function e7(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();var Nm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function vre(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return t[i]}})}),n}var t7={exports:{}},IT={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var yre=Symbol.for("react.transitional.element"),xre=Symbol.for("react.fragment");function n7(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:yre,type:t,key:i,ref:e!==void 0?e:null,props:n}}IT.Fragment=xre;IT.jsx=n7;IT.jsxs=n7;t7.exports=IT;var k=t7.exports;const _re=Mc(k),Sre=e7({__proto__:null,default:_re},[k]);var i7={exports:{}},NT={},r7={exports:{}},a7={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(t){function e(B,G){var H=B.length;B.push(G);e:for(;0<H;){var W=H-1>>>1,F=B[W];if(0<r(F,G))B[W]=G,B[H]=F,H=W;else break e}}function n(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var G=B[0],H=B.pop();if(H!==G){B[0]=H;e:for(var W=0,F=B.length,Y=F>>>1;W<Y;){var Z=2*(W+1)-1,V=B[Z],de=Z+1,se=B[de];if(0>r(V,H))de<F&&0>r(se,V)?(B[W]=se,B[de]=H,W=de):(B[W]=V,B[Z]=H,W=Z);else if(de<F&&0>r(se,H))B[W]=se,B[de]=H,W=de;else break e}}return G}function r(B,G){var H=B.sortIndex-G.sortIndex;return H!==0?H:B.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],c=[],u=1,f=null,h=3,d=!1,g=!1,b=!1,y=!1,p=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function w(B){for(var G=n(c);G!==null;){if(G.callback===null)i(c);else if(G.startTime<=B)i(c),G.sortIndex=G.expirationTime,e(l,G);else break;G=n(c)}}function M(B){if(b=!1,w(B),!g)if(n(l)!==null)g=!0,S||(S=!0,U());else{var G=n(c);G!==null&&q(M,G.startTime-B)}}var S=!1,A=-1,C=5,D=-1;function R(){return y?!0:!(t.unstable_now()-D<C)}function N(){if(y=!1,S){var B=t.unstable_now();D=B;var G=!0;try{e:{g=!1,b&&(b=!1,x(A),A=-1),d=!0;var H=h;try{t:{for(w(B),f=n(l);f!==null&&!(f.expirationTime>B&&R());){var W=f.callback;if(typeof W=="function"){f.callback=null,h=f.priorityLevel;var F=W(f.expirationTime<=B);if(B=t.unstable_now(),typeof F=="function"){f.callback=F,w(B),G=!0;break t}f===n(l)&&i(l),w(B)}else i(l);f=n(l)}if(f!==null)G=!0;else{var Y=n(c);Y!==null&&q(M,Y.startTime-B),G=!1}}break e}finally{f=null,h=H,d=!1}G=void 0}}finally{G?U():S=!1}}}var U;if(typeof _=="function")U=function(){_(N)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,z=j.port2;j.port1.onmessage=N,U=function(){z.postMessage(null)}}else U=function(){p(N,0)};function q(B,G){A=p(function(){B(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(B){switch(h){case 1:case 2:case 3:var G=3;break;default:G=h}var H=h;h=G;try{return B()}finally{h=H}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var H=h;h=B;try{return G()}finally{h=H}},t.unstable_scheduleCallback=function(B,G,H){var W=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?W+H:W):H=W,B){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=H+F,B={id:u++,callback:G,priorityLevel:B,startTime:H,expirationTime:F,sortIndex:-1},H>W?(B.sortIndex=H,e(c,B),n(l)===null&&B===n(c)&&(b?(x(A),A=-1):b=!0,q(M,H-W))):(B.sortIndex=F,e(l,B),g||d||(g=!0,S||(S=!0,U()))),B},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(B){var G=h;return function(){var H=h;h=G;try{return B.apply(this,arguments)}finally{h=H}}}})(a7);r7.exports=a7;var wre=r7.exports,s7={exports:{}},li={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var fN=Symbol.for("react.transitional.element"),Ere=Symbol.for("react.portal"),Mre=Symbol.for("react.fragment"),Tre=Symbol.for("react.strict_mode"),Are=Symbol.for("react.profiler"),Cre=Symbol.for("react.consumer"),Rre=Symbol.for("react.context"),kre=Symbol.for("react.forward_ref"),Dre=Symbol.for("react.suspense"),Ore=Symbol.for("react.memo"),o7=Symbol.for("react.lazy"),V9=Symbol.iterator;function Ire(t){return t===null||typeof t!="object"?null:(t=V9&&t[V9]||t["@@iterator"],typeof t=="function"?t:null)}var l7={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},c7=Object.assign,u7={};function yv(t,e,n){this.props=t,this.context=e,this.refs=u7,this.updater=n||l7}yv.prototype.isReactComponent={};yv.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};yv.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function f7(){}f7.prototype=yv.prototype;function hN(t,e,n){this.props=t,this.context=e,this.refs=u7,this.updater=n||l7}var dN=hN.prototype=new f7;dN.constructor=hN;c7(dN,yv.prototype);dN.isPureReactComponent=!0;var G9=Array.isArray,Yr={H:null,A:null,T:null,S:null,V:null},h7=Object.prototype.hasOwnProperty;function pN(t,e,n,i,r,a){return n=a.ref,{$$typeof:fN,type:t,key:e,ref:n!==void 0?n:null,props:a}}function Nre(t,e){return pN(t.type,e,void 0,void 0,void 0,t.props)}function mN(t){return typeof t=="object"&&t!==null&&t.$$typeof===fN}function Lre(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var W9=/\/+/g;function JR(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Lre(""+t.key):e.toString(36)}function q9(){}function Pre(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(q9,q9):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Ib(t,e,n,i,r){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(a){case"bigint":case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case fN:case Ere:s=!0;break;case o7:return s=t._init,Ib(s(t._payload),e,n,i,r)}}if(s)return r=r(t),s=i===""?"."+JR(t,0):i,G9(r)?(n="",s!=null&&(n=s.replace(W9,"$&/")+"/"),Ib(r,e,n,"",function(c){return c})):r!=null&&(mN(r)&&(r=Nre(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(W9,"$&/")+"/")+s)),e.push(r)),1;s=0;var o=i===""?".":i+":";if(G9(t))for(var l=0;l<t.length;l++)i=t[l],a=o+JR(i,l),s+=Ib(i,e,n,a,r);else if(l=Ire(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,a=o+JR(i,l++),s+=Ib(i,e,n,a,r);else if(a==="object"){if(typeof t.then=="function")return Ib(Pre(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return s}function PS(t,e,n){if(t==null)return t;var i=[],r=0;return Ib(t,i,"","",function(a){return e.call(n,a,r++)}),i}function Ure(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var X9=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Fre(){}li.Children={map:PS,forEach:function(t,e,n){PS(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return PS(t,function(){e++}),e},toArray:function(t){return PS(t,function(e){return e})||[]},only:function(t){if(!mN(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};li.Component=yv;li.Fragment=Mre;li.Profiler=Are;li.PureComponent=hN;li.StrictMode=Tre;li.Suspense=Dre;li.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Yr;li.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Yr.H.useMemoCache(t)}};li.cache=function(t){return function(){return t.apply(null,arguments)}};li.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=c7({},t.props),r=t.key,a=void 0;if(e!=null)for(s in e.ref!==void 0&&(a=void 0),e.key!==void 0&&(r=""+e.key),e)!h7.call(e,s)||s==="key"||s==="__self"||s==="__source"||s==="ref"&&e.ref===void 0||(i[s]=e[s]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];i.children=o}return pN(t.type,r,void 0,void 0,a,i)};li.createContext=function(t){return t={$$typeof:Rre,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:Cre,_context:t},t};li.createElement=function(t,e,n){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)h7.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var o=Array(s),l=0;l<s;l++)o[l]=arguments[l+2];r.children=o}if(t&&t.defaultProps)for(i in s=t.defaultProps,s)r[i]===void 0&&(r[i]=s[i]);return pN(t,a,void 0,void 0,null,r)};li.createRef=function(){return{current:null}};li.forwardRef=function(t){return{$$typeof:kre,render:t}};li.isValidElement=mN;li.lazy=function(t){return{$$typeof:o7,_payload:{_status:-1,_result:t},_init:Ure}};li.memo=function(t,e){return{$$typeof:Ore,type:t,compare:e===void 0?null:e}};li.startTransition=function(t){var e=Yr.T,n={};Yr.T=n;try{var i=t(),r=Yr.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(Fre,X9)}catch(a){X9(a)}finally{Yr.T=e}};li.unstable_useCacheRefresh=function(){return Yr.H.useCacheRefresh()};li.use=function(t){return Yr.H.use(t)};li.useActionState=function(t,e,n){return Yr.H.useActionState(t,e,n)};li.useCallback=function(t,e){return Yr.H.useCallback(t,e)};li.useContext=function(t){return Yr.H.useContext(t)};li.useDebugValue=function(){};li.useDeferredValue=function(t,e){return Yr.H.useDeferredValue(t,e)};li.useEffect=function(t,e,n){var i=Yr.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};li.useId=function(){return Yr.H.useId()};li.useImperativeHandle=function(t,e,n){return Yr.H.useImperativeHandle(t,e,n)};li.useInsertionEffect=function(t,e){return Yr.H.useInsertionEffect(t,e)};li.useLayoutEffect=function(t,e){return Yr.H.useLayoutEffect(t,e)};li.useMemo=function(t,e){return Yr.H.useMemo(t,e)};li.useOptimistic=function(t,e){return Yr.H.useOptimistic(t,e)};li.useReducer=function(t,e,n){return Yr.H.useReducer(t,e,n)};li.useRef=function(t){return Yr.H.useRef(t)};li.useState=function(t){return Yr.H.useState(t)};li.useSyncExternalStore=function(t,e,n){return Yr.H.useSyncExternalStore(t,e,n)};li.useTransition=function(){return Yr.H.useTransition()};li.version="19.1.1";s7.exports=li;var I=s7.exports;const Ee=Mc(I),d7=e7({__proto__:null,default:Ee},[I]);var p7={exports:{}},Ao={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Bre=I;function m7(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function zh(){}var Eo={d:{f:zh,r:function(){throw Error(m7(522))},D:zh,C:zh,L:zh,m:zh,X:zh,S:zh,M:zh},p:0,findDOMNode:null},zre=Symbol.for("react.portal");function jre(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:zre,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Nx=Bre.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function LT(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Ao.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Eo;Ao.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(m7(299));return jre(t,e,null,n)};Ao.flushSync=function(t){var e=Nx.T,n=Eo.p;try{if(Nx.T=null,Eo.p=2,t)return t()}finally{Nx.T=e,Eo.p=n,Eo.d.f()}};Ao.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Eo.d.C(t,e))};Ao.prefetchDNS=function(t){typeof t=="string"&&Eo.d.D(t)};Ao.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=LT(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,a=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Eo.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):n==="script"&&Eo.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Ao.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=LT(e.as,e.crossOrigin);Eo.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Eo.d.M(t)};Ao.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=LT(n,e.crossOrigin);Eo.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Ao.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=LT(e.as,e.crossOrigin);Eo.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Eo.d.m(t)};Ao.requestFormReset=function(t){Eo.d.r(t)};Ao.unstable_batchedUpdates=function(t,e){return t(e)};Ao.useFormState=function(t,e,n){return Nx.H.useFormState(t,e,n)};Ao.useFormStatus=function(){return Nx.H.useHostTransitionStatus()};Ao.version="19.1.1";function g7(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g7)}catch(t){console.error(t)}}g7(),p7.exports=Ao;var o_=p7.exports;const bx=Mc(o_);/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Fa=wre,b7=I,Hre=o_;function It(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function v7(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function l_(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function y7(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function K9(t){if(l_(t)!==t)throw Error(It(188))}function Vre(t){var e=t.alternate;if(!e){if(e=l_(t),e===null)throw Error(It(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return K9(r),t;if(a===i)return K9(r),e;a=a.sibling}throw Error(It(188))}if(n.return!==i.return)n=r,i=a;else{for(var s=!1,o=r.child;o;){if(o===n){s=!0,n=r,i=a;break}if(o===i){s=!0,i=r,n=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===n){s=!0,n=a,i=r;break}if(o===i){s=!0,i=a,n=r;break}o=o.sibling}if(!s)throw Error(It(189))}}if(n.alternate!==i)throw Error(It(190))}if(n.tag!==3)throw Error(It(188));return n.stateNode.current===n?t:e}function x7(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=x7(t),e!==null)return e;t=t.sibling}return null}var jr=Object.assign,Gre=Symbol.for("react.element"),US=Symbol.for("react.transitional.element"),vx=Symbol.for("react.portal"),Hb=Symbol.for("react.fragment"),_7=Symbol.for("react.strict_mode"),E8=Symbol.for("react.profiler"),Wre=Symbol.for("react.provider"),S7=Symbol.for("react.consumer"),Vf=Symbol.for("react.context"),gN=Symbol.for("react.forward_ref"),M8=Symbol.for("react.suspense"),T8=Symbol.for("react.suspense_list"),bN=Symbol.for("react.memo"),id=Symbol.for("react.lazy"),A8=Symbol.for("react.activity"),qre=Symbol.for("react.memo_cache_sentinel"),Y9=Symbol.iterator;function Ey(t){return t===null||typeof t!="object"?null:(t=Y9&&t[Y9]||t["@@iterator"],typeof t=="function"?t:null)}var Xre=Symbol.for("react.client.reference");function C8(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Xre?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Hb:return"Fragment";case E8:return"Profiler";case _7:return"StrictMode";case M8:return"Suspense";case T8:return"SuspenseList";case A8:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case vx:return"Portal";case Vf:return(t.displayName||"Context")+".Provider";case S7:return(t._context.displayName||"Context")+".Consumer";case gN:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case bN:return e=t.displayName||null,e!==null?e:C8(t.type)||"Memo";case id:e=t._payload,t=t._init;try{return C8(t(e))}catch{}}return null}var yx=Array.isArray,Fn=b7.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ir=Hre.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,gm={pending:!1,data:null,method:null,action:null},R8=[],Vb=-1;function lf(t){return{current:t}}function ns(t){0>Vb||(t.current=R8[Vb],R8[Vb]=null,Vb--)}function Jr(t,e){Vb++,R8[Vb]=t.current,t.current=e}var qu=lf(null),v1=lf(null),wd=lf(null),AM=lf(null);function CM(t,e){switch(Jr(wd,e),Jr(v1,t),Jr(qu,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?eB(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=eB(e),t=Bq(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ns(qu),Jr(qu,t)}function D0(){ns(qu),ns(v1),ns(wd)}function k8(t){t.memoizedState!==null&&Jr(AM,t);var e=qu.current,n=Bq(e,t.type);e!==n&&(Jr(v1,t),Jr(qu,n))}function RM(t){v1.current===t&&(ns(qu),ns(v1)),AM.current===t&&(ns(AM),C1._currentValue=gm)}var D8=Object.prototype.hasOwnProperty,vN=Fa.unstable_scheduleCallback,$R=Fa.unstable_cancelCallback,Kre=Fa.unstable_shouldYield,Yre=Fa.unstable_requestPaint,Xu=Fa.unstable_now,Jre=Fa.unstable_getCurrentPriorityLevel,w7=Fa.unstable_ImmediatePriority,E7=Fa.unstable_UserBlockingPriority,kM=Fa.unstable_NormalPriority,$re=Fa.unstable_LowPriority,M7=Fa.unstable_IdlePriority,Zre=Fa.log,Qre=Fa.unstable_setDisableYieldValue,c_=null,vl=null;function gd(t){if(typeof Zre=="function"&&Qre(t),vl&&typeof vl.setStrictMode=="function")try{vl.setStrictMode(c_,t)}catch{}}var yl=Math.clz32?Math.clz32:nae,eae=Math.log,tae=Math.LN2;function nae(t){return t>>>=0,t===0?32:31-(eae(t)/tae|0)|0}var FS=256,BS=4194304;function jp(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:return 64;case 128:return 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 t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function PT(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,a=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var o=i&134217727;return o!==0?(i=o&~a,i!==0?r=jp(i):(s&=o,s!==0?r=jp(s):n||(n=o&~t,n!==0&&(r=jp(n))))):(o=i&~a,o!==0?r=jp(o):s!==0?r=jp(s):n||(n=i&~t,n!==0&&(r=jp(n)))),r===0?0:e!==0&&e!==r&&!(e&a)&&(a=r&-r,n=e&-e,a>=n||a===32&&(n&4194048)!==0)?e:r}function u_(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function iae(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function T7(){var t=FS;return FS<<=1,!(FS&4194048)&&(FS=256),t}function A7(){var t=BS;return BS<<=1,!(BS&62914560)&&(BS=4194304),t}function ZR(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function f_(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function rae(t,e,n,i,r,a){var s=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var o=t.entanglements,l=t.expirationTimes,c=t.hiddenUpdates;for(n=s&~n;0<n;){var u=31-yl(n),f=1<<u;o[u]=0,l[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var d=h[u];d!==null&&(d.lane&=-536870913)}n&=~f}i!==0&&C7(t,i,0),a!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=a&~(s&~e))}function C7(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-yl(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function R7(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-yl(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function yN(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function xN(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function k7(){var t=ir.p;return t!==0?t:(t=window.event,t===void 0?32:Yq(t.type))}function aae(t,e){var n=ir.p;try{return ir.p=t,e()}finally{ir.p=n}}var Hd=Math.random().toString(36).slice(2),to="__reactFiber$"+Hd,Vo="__reactProps$"+Hd,xv="__reactContainer$"+Hd,O8="__reactEvents$"+Hd,sae="__reactListeners$"+Hd,oae="__reactHandles$"+Hd,J9="__reactResources$"+Hd,h_="__reactMarker$"+Hd;function _N(t){delete t[to],delete t[Vo],delete t[O8],delete t[sae],delete t[oae]}function Gb(t){var e=t[to];if(e)return e;for(var n=t.parentNode;n;){if(e=n[xv]||n[to]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=iB(t);t!==null;){if(n=t[to])return n;t=iB(t)}return e}t=n,n=t.parentNode}return null}function _v(t){if(t=t[to]||t[xv]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function xx(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(It(33))}function s0(t){var e=t[J9];return e||(e=t[J9]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Qa(t){t[h_]=!0}var D7=new Set,O7={};function $m(t,e){O0(t,e),O0(t+"Capture",e)}function O0(t,e){for(O7[t]=e,t=0;t<e.length;t++)D7.add(e[t])}var lae=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$9={},Z9={};function cae(t){return D8.call(Z9,t)?!0:D8.call($9,t)?!1:lae.test(t)?Z9[t]=!0:($9[t]=!0,!1)}function WE(t,e,n){if(cae(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function zS(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function Cf(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}var QR,Q9;function Nb(t){if(QR===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);QR=e&&e[1]||"",Q9=-1<n.stack.indexOf(`
    at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+QR+t+Q9}var e3=!1;function t3(t,e){if(!t||e3)return"";e3=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(d){var h=d}Reflect.construct(t,[],f)}else{try{f.call()}catch(d){h=d}t.call(f.prototype)}}else{try{throw Error()}catch(d){h=d}(f=t())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(d){if(d&&h&&typeof d.stack=="string")return[d.stack,h.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=i.DetermineComponentFrameRoot(),s=a[0],o=a[1];if(s&&o){var l=s.split(`
`),c=o.split(`
`);for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||l[i]!==c[r]){var u=`
`+l[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{e3=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Nb(n):""}function uae(t){switch(t.tag){case 26:case 27:case 5:return Nb(t.type);case 16:return Nb("Lazy");case 13:return Nb("Suspense");case 19:return Nb("SuspenseList");case 0:case 15:return t3(t.type,!1);case 11:return t3(t.type.render,!1);case 1:return t3(t.type,!0);case 31:return Nb("Activity");default:return""}}function eF(t){try{var e="";do e+=uae(t),t=t.return;while(t);return e}catch(n){return`
Error generating stack: `+n.message+`
`+n.stack}}function ic(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function I7(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function fae(t){var e=I7(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){i=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function DM(t){t._valueTracker||(t._valueTracker=fae(t))}function N7(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=I7(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function OM(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var hae=/[\n"\\]/g;function lc(t){return t.replace(hae,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function I8(t,e,n,i,r,a,s,o){t.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.type=s:t.removeAttribute("type"),e!=null?s==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ic(e)):t.value!==""+ic(e)&&(t.value=""+ic(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?N8(t,s,ic(e)):n!=null?N8(t,s,ic(n)):i!=null&&t.removeAttribute("value"),r==null&&a!=null&&(t.defaultChecked=!!a),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+ic(o):t.removeAttribute("name")}function L7(t,e,n,i,r,a,s,o){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(t.type=a),e!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||e!=null))return;n=n!=null?""+ic(n):"",e=e!=null?""+ic(e):n,o||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=o?t.checked:!!i,t.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.name=s)}function N8(t,e,n){e==="number"&&OM(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function o0(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+ic(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function P7(t,e,n){if(e!=null&&(e=""+ic(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+ic(n):""}function U7(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(It(92));if(yx(i)){if(1<i.length)throw Error(It(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=ic(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function I0(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var dae=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tF(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||dae.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function F7(t,e,n){if(e!=null&&typeof e!="object")throw Error(It(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&tF(t,r,i)}else for(var a in e)e.hasOwnProperty(a)&&tF(t,a,e[a])}function SN(t){if(t.indexOf("-")===-1)return!1;switch(t){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 pae=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),mae=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qE(t){return mae.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var L8=null;function wN(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Wb=null,l0=null;function nF(t){var e=_v(t);if(e&&(t=e.stateNode)){var n=t[Vo]||null;e:switch(t=e.stateNode,e.type){case"input":if(I8(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+lc(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Vo]||null;if(!r)throw Error(It(90));I8(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&N7(i)}break e;case"textarea":P7(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&o0(t,!!n.multiple,e,!1)}}}var n3=!1;function B7(t,e,n){if(n3)return t(e,n);n3=!0;try{var i=t(e);return i}finally{if(n3=!1,(Wb!==null||l0!==null)&&(qT(),Wb&&(e=Wb,t=l0,l0=Wb=null,nF(e),t)))for(e=0;e<t.length;e++)nF(t[e])}}function y1(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Vo]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(It(231,e,typeof n));return n}var oh=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),P8=!1;if(oh)try{var My={};Object.defineProperty(My,"passive",{get:function(){P8=!0}}),window.addEventListener("test",My,My),window.removeEventListener("test",My,My)}catch{P8=!1}var bd=null,EN=null,XE=null;function z7(){if(XE)return XE;var t,e=EN,n=e.length,i,r="value"in bd?bd.value:bd.textContent,a=r.length;for(t=0;t<n&&e[t]===r[t];t++);var s=n-t;for(i=1;i<=s&&e[n-i]===r[a-i];i++);return XE=r.slice(t,1<i?1-i:void 0)}function KE(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function jS(){return!0}function iF(){return!1}function Wo(t){function e(n,i,r,a,s){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?jS:iF,this.isPropagationStopped=iF,this}return jr(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=jS)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=jS)},persist:function(){},isPersistent:jS}),e}var Zm={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},UT=Wo(Zm),d_=jr({},Zm,{view:0,detail:0}),gae=Wo(d_),i3,r3,Ty,FT=jr({},d_,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:MN,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ty&&(Ty&&t.type==="mousemove"?(i3=t.screenX-Ty.screenX,r3=t.screenY-Ty.screenY):r3=i3=0,Ty=t),i3)},movementY:function(t){return"movementY"in t?t.movementY:r3}}),rF=Wo(FT),bae=jr({},FT,{dataTransfer:0}),vae=Wo(bae),yae=jr({},d_,{relatedTarget:0}),a3=Wo(yae),xae=jr({},Zm,{animationName:0,elapsedTime:0,pseudoElement:0}),_ae=Wo(xae),Sae=jr({},Zm,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),wae=Wo(Sae),Eae=jr({},Zm,{data:0}),aF=Wo(Eae),Mae={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tae={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Aae={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cae(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Aae[t])?!!e[t]:!1}function MN(){return Cae}var Rae=jr({},d_,{key:function(t){if(t.key){var e=Mae[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=KE(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Tae[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:MN,charCode:function(t){return t.type==="keypress"?KE(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?KE(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),kae=Wo(Rae),Dae=jr({},FT,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sF=Wo(Dae),Oae=jr({},d_,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:MN}),Iae=Wo(Oae),Nae=jr({},Zm,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lae=Wo(Nae),Pae=jr({},FT,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Uae=Wo(Pae),Fae=jr({},Zm,{newState:0,oldState:0}),Bae=Wo(Fae),zae=[9,13,27,32],TN=oh&&"CompositionEvent"in window,Lx=null;oh&&"documentMode"in document&&(Lx=document.documentMode);var jae=oh&&"TextEvent"in window&&!Lx,j7=oh&&(!TN||Lx&&8<Lx&&11>=Lx),oF=" ",lF=!1;function H7(t,e){switch(t){case"keyup":return zae.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V7(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qb=!1;function Hae(t,e){switch(t){case"compositionend":return V7(e);case"keypress":return e.which!==32?null:(lF=!0,oF);case"textInput":return t=e.data,t===oF&&lF?null:t;default:return null}}function Vae(t,e){if(qb)return t==="compositionend"||!TN&&H7(t,e)?(t=z7(),XE=EN=bd=null,qb=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return j7&&e.locale!=="ko"?null:e.data;default:return null}}var Gae={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cF(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Gae[t.type]:e==="textarea"}function G7(t,e,n,i){Wb?l0?l0.push(i):l0=[i]:Wb=i,e=JM(e,"onChange"),0<e.length&&(n=new UT("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var Px=null,x1=null;function Wae(t){Pq(t,0)}function BT(t){var e=xx(t);if(N7(e))return t}function uF(t,e){if(t==="change")return e}var W7=!1;if(oh){var s3;if(oh){var o3="oninput"in document;if(!o3){var fF=document.createElement("div");fF.setAttribute("oninput","return;"),o3=typeof fF.oninput=="function"}s3=o3}else s3=!1;W7=s3&&(!document.documentMode||9<document.documentMode)}function hF(){Px&&(Px.detachEvent("onpropertychange",q7),x1=Px=null)}function q7(t){if(t.propertyName==="value"&&BT(x1)){var e=[];G7(e,x1,t,wN(t)),B7(Wae,e)}}function qae(t,e,n){t==="focusin"?(hF(),Px=e,x1=n,Px.attachEvent("onpropertychange",q7)):t==="focusout"&&hF()}function Xae(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return BT(x1)}function Kae(t,e){if(t==="click")return BT(e)}function Yae(t,e){if(t==="input"||t==="change")return BT(e)}function Jae(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Tl=typeof Object.is=="function"?Object.is:Jae;function _1(t,e){if(Tl(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!D8.call(e,r)||!Tl(t[r],e[r]))return!1}return!0}function dF(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function pF(t,e){var n=dF(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dF(n)}}function X7(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?X7(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function K7(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=OM(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=OM(t.document)}return e}function AN(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var $ae=oh&&"documentMode"in document&&11>=document.documentMode,Xb=null,U8=null,Ux=null,F8=!1;function mF(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;F8||Xb==null||Xb!==OM(i)||(i=Xb,"selectionStart"in i&&AN(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ux&&_1(Ux,i)||(Ux=i,i=JM(U8,"onSelect"),0<i.length&&(e=new UT("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Xb)))}function vp(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Kb={animationend:vp("Animation","AnimationEnd"),animationiteration:vp("Animation","AnimationIteration"),animationstart:vp("Animation","AnimationStart"),transitionrun:vp("Transition","TransitionRun"),transitionstart:vp("Transition","TransitionStart"),transitioncancel:vp("Transition","TransitionCancel"),transitionend:vp("Transition","TransitionEnd")},l3={},Y7={};oh&&(Y7=document.createElement("div").style,"AnimationEvent"in window||(delete Kb.animationend.animation,delete Kb.animationiteration.animation,delete Kb.animationstart.animation),"TransitionEvent"in window||delete Kb.transitionend.transition);function Qm(t){if(l3[t])return l3[t];if(!Kb[t])return t;var e=Kb[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Y7)return l3[t]=e[n];return t}var J7=Qm("animationend"),$7=Qm("animationiteration"),Z7=Qm("animationstart"),Zae=Qm("transitionrun"),Qae=Qm("transitionstart"),ese=Qm("transitioncancel"),Q7=Qm("transitionend"),eW=new Map,B8="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");B8.push("scrollEnd");function vu(t,e){eW.set(t,e),$m(e,[t])}var gF=new WeakMap;function cc(t,e){if(typeof t=="object"&&t!==null){var n=gF.get(t);return n!==void 0?n:(e={value:t,source:e,stack:eF(e)},gF.set(t,e),e)}return{value:t,source:e,stack:eF(e)}}var Ql=[],Yb=0,CN=0;function zT(){for(var t=Yb,e=CN=Yb=0;e<t;){var n=Ql[e];Ql[e++]=null;var i=Ql[e];Ql[e++]=null;var r=Ql[e];Ql[e++]=null;var a=Ql[e];if(Ql[e++]=null,i!==null&&r!==null){var s=i.pending;s===null?r.next=r:(r.next=s.next,s.next=r),i.pending=r}a!==0&&tW(n,r,a)}}function jT(t,e,n,i){Ql[Yb++]=t,Ql[Yb++]=e,Ql[Yb++]=n,Ql[Yb++]=i,CN|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function RN(t,e,n,i){return jT(t,e,n,i),IM(t)}function Sv(t,e){return jT(t,null,null,e),IM(t)}function tW(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,a=t.return;a!==null;)a.childLanes|=n,i=a.alternate,i!==null&&(i.childLanes|=n),a.tag===22&&(t=a.stateNode,t===null||t._visibility&1||(r=!0)),t=a,a=a.return;return t.tag===3?(a=t.stateNode,r&&e!==null&&(r=31-yl(n),t=a.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),a):null}function IM(t){if(50<Xx)throw Xx=0,sO=null,Error(It(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Jb={};function tse(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pl(t,e,n,i){return new tse(t,e,n,i)}function kN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Qf(t,e){var n=t.alternate;return n===null?(n=pl(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function nW(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function YE(t,e,n,i,r,a){var s=0;if(i=t,typeof t=="function")kN(t)&&(s=1);else if(typeof t=="string")s=ioe(t,n,qu.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case A8:return t=pl(31,n,e,r),t.elementType=A8,t.lanes=a,t;case Hb:return bm(n.children,r,a,e);case _7:s=8,r|=24;break;case E8:return t=pl(12,n,e,r|2),t.elementType=E8,t.lanes=a,t;case M8:return t=pl(13,n,e,r),t.elementType=M8,t.lanes=a,t;case T8:return t=pl(19,n,e,r),t.elementType=T8,t.lanes=a,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Wre:case Vf:s=10;break e;case S7:s=9;break e;case gN:s=11;break e;case bN:s=14;break e;case id:s=16,i=null;break e}s=29,n=Error(It(130,t===null?"null":typeof t,"")),i=null}return e=pl(s,n,e,r),e.elementType=t,e.type=i,e.lanes=a,e}function bm(t,e,n,i){return t=pl(7,t,i,e),t.lanes=n,t}function c3(t,e,n){return t=pl(6,t,null,e),t.lanes=n,t}function u3(t,e,n){return e=pl(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var $b=[],Zb=0,NM=null,LM=0,rc=[],ac=0,vm=null,Gf=1,Wf="";function Hp(t,e){$b[Zb++]=LM,$b[Zb++]=NM,NM=t,LM=e}function iW(t,e,n){rc[ac++]=Gf,rc[ac++]=Wf,rc[ac++]=vm,vm=t;var i=Gf;t=Wf;var r=32-yl(i)-1;i&=~(1<<r),n+=1;var a=32-yl(e)+r;if(30<a){var s=r-r%5;a=(i&(1<<s)-1).toString(32),i>>=s,r-=s,Gf=1<<32-yl(e)+r|n<<r|i,Wf=a+t}else Gf=1<<a|n<<r|i,Wf=t}function DN(t){t.return!==null&&(Hp(t,1),iW(t,1,0))}function ON(t){for(;t===NM;)NM=$b[--Zb],$b[Zb]=null,LM=$b[--Zb],$b[Zb]=null;for(;t===vm;)vm=rc[--ac],rc[ac]=null,Wf=rc[--ac],rc[ac]=null,Gf=rc[--ac],rc[ac]=null}var _o=null,fa=null,er=!1,ym=null,Fu=!1,z8=Error(It(519));function Lm(t){var e=Error(It(418,""));throw S1(cc(e,t)),z8}function bF(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[to]=t,e[Vo]=i,n){case"dialog":Ai("cancel",e),Ai("close",e);break;case"iframe":case"object":case"embed":Ai("load",e);break;case"video":case"audio":for(n=0;n<M1.length;n++)Ai(M1[n],e);break;case"source":Ai("error",e);break;case"img":case"image":case"link":Ai("error",e),Ai("load",e);break;case"details":Ai("toggle",e);break;case"input":Ai("invalid",e),L7(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),DM(e);break;case"select":Ai("invalid",e);break;case"textarea":Ai("invalid",e),U7(e,i.value,i.defaultValue,i.children),DM(e)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||Fq(e.textContent,n)?(i.popover!=null&&(Ai("beforetoggle",e),Ai("toggle",e)),i.onScroll!=null&&Ai("scroll",e),i.onScrollEnd!=null&&Ai("scrollend",e),i.onClick!=null&&(e.onclick=YT),e=!0):e=!1,e||Lm(t)}function vF(t){for(_o=t.return;_o;)switch(_o.tag){case 5:case 13:Fu=!1;return;case 27:case 3:Fu=!0;return;default:_o=_o.return}}function Ay(t){if(t!==_o)return!1;if(!er)return vF(t),er=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||hO(t.type,t.memoizedProps)),n=!n),n&&fa&&Lm(t),vF(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(It(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){fa=fu(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}fa=null}}else e===27?(e=fa,Vd(t.type)?(t=mO,mO=null,fa=t):fa=e):fa=_o?fu(t.stateNode.nextSibling):null;return!0}function p_(){fa=_o=null,er=!1}function yF(){var t=ym;return t!==null&&(Uo===null?Uo=t:Uo.push.apply(Uo,t),ym=null),t}function S1(t){ym===null?ym=[t]:ym.push(t)}var j8=lf(null),eg=null,qf=null;function cd(t,e,n){Jr(j8,e._currentValue),e._currentValue=n}function eh(t){t._currentValue=j8.current,ns(j8)}function H8(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function V8(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var a=r.dependencies;if(a!==null){var s=r.child;a=a.firstContext;e:for(;a!==null;){var o=a;a=r;for(var l=0;l<e.length;l++)if(o.context===e[l]){a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),H8(a.return,n,t),i||(s=null);break e}a=o.next}}else if(r.tag===18){if(s=r.return,s===null)throw Error(It(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),H8(s,n,t),s=null}else s=r.child;if(s!==null)s.return=r;else for(s=r;s!==null;){if(s===t){s=null;break}if(r=s.sibling,r!==null){r.return=s.return,s=r;break}s=s.return}r=s}}function m_(t,e,n,i){t=null;for(var r=e,a=!1;r!==null;){if(!a){if(r.flags&524288)a=!0;else if(r.flags&262144)break}if(r.tag===10){var s=r.alternate;if(s===null)throw Error(It(387));if(s=s.memoizedProps,s!==null){var o=r.type;Tl(r.pendingProps.value,s.value)||(t!==null?t.push(o):t=[o])}}else if(r===AM.current){if(s=r.alternate,s===null)throw Error(It(387));s.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(C1):t=[C1])}r=r.return}t!==null&&V8(e,t,n,i),e.flags|=262144}function PM(t){for(t=t.firstContext;t!==null;){if(!Tl(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Pm(t){eg=t,qf=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function no(t){return rW(eg,t)}function HS(t,e){return eg===null&&Pm(t),rW(t,e)}function rW(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},qf===null){if(t===null)throw Error(It(308));qf=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else qf=qf.next=e;return n}var nse=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},ise=Fa.unstable_scheduleCallback,rse=Fa.unstable_NormalPriority,Pa={$$typeof:Vf,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function IN(){return{controller:new nse,data:new Map,refCount:0}}function g_(t){t.refCount--,t.refCount===0&&ise(rse,function(){t.controller.abort()})}var Fx=null,G8=0,N0=0,c0=null;function ase(t,e){if(Fx===null){var n=Fx=[];G8=0,N0=nL(),c0={status:"pending",value:void 0,then:function(i){n.push(i)}}}return G8++,e.then(xF,xF),e}function xF(){if(--G8===0&&Fx!==null){c0!==null&&(c0.status="fulfilled");var t=Fx;Fx=null,N0=0,c0=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function sse(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var _F=Fn.S;Fn.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&ase(t,e),_F!==null&&_F(t,e)};var xm=lf(null);function NN(){var t=xm.current;return t!==null?t:Dr.pooledCache}function JE(t,e){e===null?Jr(xm,xm.current):Jr(xm,e.pool)}function aW(){var t=NN();return t===null?null:{parent:Pa._currentValue,pool:t}}var b_=Error(It(460)),sW=Error(It(474)),HT=Error(It(542)),W8={then:function(){}};function SF(t){return t=t.status,t==="fulfilled"||t==="rejected"}function VS(){}function oW(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(VS,VS),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,EF(t),t;default:if(typeof e.status=="string")e.then(VS,VS);else{if(t=Dr,t!==null&&100<t.shellSuspendCounter)throw Error(It(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,EF(t),t}throw Bx=e,b_}}var Bx=null;function wF(){if(Bx===null)throw Error(It(459));var t=Bx;return Bx=null,t}function EF(t){if(t===b_||t===HT)throw Error(It(483))}var rd=!1;function LN(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function q8(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ed(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Md(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,dr&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=IM(t),tW(t,null,n),e}return jT(t,i,e,n),IM(t)}function zx(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,R7(t,n)}}function f3(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?r=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?r=a=e:a=a.next=e}else r=a=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var X8=!1;function jx(){if(X8){var t=c0;if(t!==null)throw t}}function Hx(t,e,n,i){X8=!1;var r=t.updateQueue;rd=!1;var a=r.firstBaseUpdate,s=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var l=o,c=l.next;l.next=null,s===null?a=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==s&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=r.baseState;s=0,u=c=l=null,o=a;do{var h=o.lane&-536870913,d=h!==o.lane;if(d?(zi&h)===h:(i&h)===h){h!==0&&h===N0&&(X8=!0),u!==null&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var g=t,b=o;h=e;var y=n;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){f=g.call(y,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,h=typeof g=="function"?g.call(y,f,h):g,h==null)break e;f=jr({},f,h);break e;case 2:rd=!0}}h=o.callback,h!==null&&(t.flags|=64,d&&(t.flags|=8192),d=r.callbacks,d===null?r.callbacks=[h]:d.push(h))}else d={lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=d,l=f):u=u.next=d,s|=h;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;d=o,o=d.next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}while(!0);u===null&&(l=f),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,a===null&&(r.shared.lanes=0),Ld|=s,t.lanes=s,t.memoizedState=f}}function lW(t,e){if(typeof t!="function")throw Error(It(191,t));t.call(e)}function cW(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)lW(n[t],e)}var L0=lf(null),UM=lf(0);function MF(t,e){t=uh,Jr(UM,t),Jr(L0,e),uh=t|e.baseLanes}function K8(){Jr(UM,uh),Jr(L0,L0.current)}function PN(){uh=UM.current,ns(L0),ns(UM)}var Id=0,gi=null,br=null,Ta=null,FM=!1,u0=!1,Um=!1,BM=0,w1=0,f0=null,ose=0;function pa(){throw Error(It(321))}function UN(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Tl(t[n],e[n]))return!1;return!0}function FN(t,e,n,i,r,a){return Id=a,gi=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Fn.H=t===null||t.memoizedState===null?zW:jW,Um=!1,a=n(i,r),Um=!1,u0&&(a=fW(e,n,i,r)),uW(t),a}function uW(t){Fn.H=zM;var e=br!==null&&br.next!==null;if(Id=0,Ta=br=gi=null,FM=!1,w1=0,f0=null,e)throw Error(It(300));t===null||es||(t=t.dependencies,t!==null&&PM(t)&&(es=!0))}function fW(t,e,n,i){gi=t;var r=0;do{if(u0&&(f0=null),w1=0,u0=!1,25<=r)throw Error(It(301));if(r+=1,Ta=br=null,t.updateQueue!=null){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Fn.H=pse,a=e(n,i)}while(u0);return a}function lse(){var t=Fn.H,e=t.useState()[0];return e=typeof e.then=="function"?v_(e):e,t=t.useState()[0],(br!==null?br.memoizedState:null)!==t&&(gi.flags|=1024),e}function BN(){var t=BM!==0;return BM=0,t}function zN(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function jN(t){if(FM){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}FM=!1}Id=0,Ta=br=gi=null,u0=!1,w1=BM=0,f0=null}function Lo(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ta===null?gi.memoizedState=Ta=t:Ta=Ta.next=t,Ta}function Ca(){if(br===null){var t=gi.alternate;t=t!==null?t.memoizedState:null}else t=br.next;var e=Ta===null?gi.memoizedState:Ta.next;if(e!==null)Ta=e,br=t;else{if(t===null)throw gi.alternate===null?Error(It(467)):Error(It(310));br=t,t={memoizedState:br.memoizedState,baseState:br.baseState,baseQueue:br.baseQueue,queue:br.queue,next:null},Ta===null?gi.memoizedState=Ta=t:Ta=Ta.next=t}return Ta}function HN(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function v_(t){var e=w1;return w1+=1,f0===null&&(f0=[]),t=oW(f0,t,e),e=gi,(Ta===null?e.memoizedState:Ta.next)===null&&(e=e.alternate,Fn.H=e===null||e.memoizedState===null?zW:jW),t}function VT(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return v_(t);if(t.$$typeof===Vf)return no(t)}throw Error(It(438,String(t)))}function VN(t){var e=null,n=gi.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=gi.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=HN(),gi.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=qre;return e.index++,n}function lh(t,e){return typeof e=="function"?e(t):e}function $E(t){var e=Ca();return GN(e,br,t)}function GN(t,e,n){var i=t.queue;if(i===null)throw Error(It(311));i.lastRenderedReducer=n;var r=t.baseQueue,a=i.pending;if(a!==null){if(r!==null){var s=r.next;r.next=a.next,a.next=s}e.baseQueue=r=a,i.pending=null}if(a=t.baseState,r===null)t.memoizedState=a;else{e=r.next;var o=s=null,l=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(zi&f)===f:(Id&f)===f){var h=c.revertLane;if(h===0)l!==null&&(l=l.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===N0&&(u=!0);else if((Id&h)===h){c=c.next,h===N0&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=f,s=a):l=l.next=f,gi.lanes|=h,Ld|=h;f=c.action,Um&&n(a,f),a=c.hasEagerState?c.eagerState:n(a,f)}else h={lane:f,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=h,s=a):l=l.next=h,gi.lanes|=f,Ld|=f;c=c.next}while(c!==null&&c!==e);if(l===null?s=a:l.next=o,!Tl(a,t.memoizedState)&&(es=!0,u&&(n=c0,n!==null)))throw n;t.memoizedState=a,t.baseState=s,t.baseQueue=l,i.lastRenderedState=a}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function h3(t){var e=Ca(),n=e.queue;if(n===null)throw Error(It(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,a=e.memoizedState;if(r!==null){n.pending=null;var s=r=r.next;do a=t(a,s.action),s=s.next;while(s!==r);Tl(a,e.memoizedState)||(es=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a}return[a,i]}function hW(t,e,n){var i=gi,r=Ca(),a=er;if(a){if(n===void 0)throw Error(It(407));n=n()}else n=e();var s=!Tl((br||r).memoizedState,n);s&&(r.memoizedState=n,es=!0),r=r.queue;var o=mW.bind(null,i,r,t);if(y_(2048,8,o,[t]),r.getSnapshot!==e||s||Ta!==null&&Ta.memoizedState.tag&1){if(i.flags|=2048,P0(9,GT(),pW.bind(null,i,r,n,e),null),Dr===null)throw Error(It(349));a||Id&124||dW(i,e,n)}return n}function dW(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=gi.updateQueue,e===null?(e=HN(),gi.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function pW(t,e,n,i){e.value=n,e.getSnapshot=i,gW(e)&&bW(t)}function mW(t,e,n){return n(function(){gW(e)&&bW(t)})}function gW(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Tl(t,n)}catch{return!0}}function bW(t){var e=Sv(t,2);e!==null&&_l(e,t,2)}function Y8(t){var e=Lo();if(typeof t=="function"){var n=t;if(t=n(),Um){gd(!0);try{n()}finally{gd(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lh,lastRenderedState:t},e}function vW(t,e,n,i){return t.baseState=n,GN(t,br,typeof i=="function"?i:lh)}function cse(t,e,n,i,r){if(WT(t))throw Error(It(485));if(t=e.action,t!==null){var a={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){a.listeners.push(s)}};Fn.T!==null?n(!0):a.isTransition=!1,i(a),n=e.pending,n===null?(a.next=e.pending=a,yW(e,a)):(a.next=n.next,e.pending=n.next=a)}}function yW(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var a=Fn.T,s={};Fn.T=s;try{var o=n(r,i),l=Fn.S;l!==null&&l(s,o),TF(t,e,o)}catch(c){J8(t,e,c)}finally{Fn.T=a}}else try{a=n(r,i),TF(t,e,a)}catch(c){J8(t,e,c)}}function TF(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){AF(t,e,i)},function(i){return J8(t,e,i)}):AF(t,e,n)}function AF(t,e,n){e.status="fulfilled",e.value=n,xW(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,yW(t,n)))}function J8(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,xW(e),e=e.next;while(e!==i)}t.action=null}function xW(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function _W(t,e){return e}function CF(t,e){if(er){var n=Dr.formState;if(n!==null){e:{var i=gi;if(er){if(fa){t:{for(var r=fa,a=Fu;r.nodeType!==8;){if(!a){r=null;break t}if(r=fu(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){fa=fu(r.nextSibling),i=r.data==="F!";break e}}Lm(i)}i=!1}i&&(e=n[0])}}return n=Lo(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_W,lastRenderedState:e},n.queue=i,n=UW.bind(null,gi,i),i.dispatch=n,i=Y8(!1),a=KN.bind(null,gi,!1,i.queue),i=Lo(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=cse.bind(null,gi,r,a,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function RF(t){var e=Ca();return SW(e,br,t)}function SW(t,e,n){if(e=GN(t,e,_W)[0],t=$E(lh)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=v_(e)}catch(s){throw s===b_?HT:s}else i=e;e=Ca();var r=e.queue,a=r.dispatch;return n!==e.memoizedState&&(gi.flags|=2048,P0(9,GT(),use.bind(null,r,n),null)),[i,a,t]}function use(t,e){t.action=e}function kF(t){var e=Ca(),n=br;if(n!==null)return SW(e,n,t);Ca(),e=e.memoizedState,n=Ca();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function P0(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=gi.updateQueue,e===null&&(e=HN(),gi.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function GT(){return{destroy:void 0,resource:void 0}}function wW(){return Ca().memoizedState}function ZE(t,e,n,i){var r=Lo();i=i===void 0?null:i,gi.flags|=t,r.memoizedState=P0(1|e,GT(),n,i)}function y_(t,e,n,i){var r=Ca();i=i===void 0?null:i;var a=r.memoizedState.inst;br!==null&&i!==null&&UN(i,br.memoizedState.deps)?r.memoizedState=P0(e,a,n,i):(gi.flags|=t,r.memoizedState=P0(1|e,a,n,i))}function DF(t,e){ZE(8390656,8,t,e)}function EW(t,e){y_(2048,8,t,e)}function MW(t,e){return y_(4,2,t,e)}function TW(t,e){return y_(4,4,t,e)}function AW(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function CW(t,e,n){n=n!=null?n.concat([t]):null,y_(4,4,AW.bind(null,e,t),n)}function WN(){}function RW(t,e){var n=Ca();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&UN(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function kW(t,e){var n=Ca();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&UN(e,i[1]))return i[0];if(i=t(),Um){gd(!0);try{t()}finally{gd(!1)}}return n.memoizedState=[i,e],i}function qN(t,e,n){return n===void 0||Id&1073741824?t.memoizedState=e:(t.memoizedState=n,t=xq(),gi.lanes|=t,Ld|=t,n)}function DW(t,e,n,i){return Tl(n,e)?n:L0.current!==null?(t=qN(t,n,i),Tl(t,e)||(es=!0),t):Id&42?(t=xq(),gi.lanes|=t,Ld|=t,e):(es=!0,t.memoizedState=n)}function OW(t,e,n,i,r){var a=ir.p;ir.p=a!==0&&8>a?a:8;var s=Fn.T,o={};Fn.T=o,KN(t,!1,e,n);try{var l=r(),c=Fn.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=sse(l,i);Vx(t,e,u,xl(t))}else Vx(t,e,i,xl(t))}catch(f){Vx(t,e,{then:function(){},status:"rejected",reason:f},xl())}finally{ir.p=a,Fn.T=s}}function fse(){}function $8(t,e,n,i){if(t.tag!==5)throw Error(It(476));var r=IW(t).queue;OW(t,r,e,gm,n===null?fse:function(){return NW(t),n(i)})}function IW(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:gm,baseState:gm,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lh,lastRenderedState:gm},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lh,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function NW(t){var e=IW(t).next.queue;Vx(t,e,{},xl())}function XN(){return no(C1)}function LW(){return Ca().memoizedState}function PW(){return Ca().memoizedState}function hse(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=xl();t=Ed(n);var i=Md(e,t,n);i!==null&&(_l(i,e,n),zx(i,e,n)),e={cache:IN()},t.payload=e;return}e=e.return}}function dse(t,e,n){var i=xl();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},WT(t)?FW(e,n):(n=RN(t,e,n,i),n!==null&&(_l(n,t,i),BW(n,e,i)))}function UW(t,e,n){var i=xl();Vx(t,e,n,i)}function Vx(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(WT(t))FW(e,r);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,n);if(r.hasEagerState=!0,r.eagerState=o,Tl(o,s))return jT(t,e,r,0),Dr===null&&zT(),!1}catch{}finally{}if(n=RN(t,e,r,i),n!==null)return _l(n,t,i),BW(n,e,i),!0}return!1}function KN(t,e,n,i){if(i={lane:2,revertLane:nL(),action:i,hasEagerState:!1,eagerState:null,next:null},WT(t)){if(e)throw Error(It(479))}else e=RN(t,n,i,2),e!==null&&_l(e,t,2)}function WT(t){var e=t.alternate;return t===gi||e!==null&&e===gi}function FW(t,e){u0=FM=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function BW(t,e,n){if(n&4194048){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,R7(t,n)}}var zM={readContext:no,use:VT,useCallback:pa,useContext:pa,useEffect:pa,useImperativeHandle:pa,useLayoutEffect:pa,useInsertionEffect:pa,useMemo:pa,useReducer:pa,useRef:pa,useState:pa,useDebugValue:pa,useDeferredValue:pa,useTransition:pa,useSyncExternalStore:pa,useId:pa,useHostTransitionStatus:pa,useFormState:pa,useActionState:pa,useOptimistic:pa,useMemoCache:pa,useCacheRefresh:pa},zW={readContext:no,use:VT,useCallback:function(t,e){return Lo().memoizedState=[t,e===void 0?null:e],t},useContext:no,useEffect:DF,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,ZE(4194308,4,AW.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ZE(4194308,4,t,e)},useInsertionEffect:function(t,e){ZE(4,2,t,e)},useMemo:function(t,e){var n=Lo();e=e===void 0?null:e;var i=t();if(Um){gd(!0);try{t()}finally{gd(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Lo();if(n!==void 0){var r=n(e);if(Um){gd(!0);try{n(e)}finally{gd(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=dse.bind(null,gi,t),[i.memoizedState,t]},useRef:function(t){var e=Lo();return t={current:t},e.memoizedState=t},useState:function(t){t=Y8(t);var e=t.queue,n=UW.bind(null,gi,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:WN,useDeferredValue:function(t,e){var n=Lo();return qN(n,t,e)},useTransition:function(){var t=Y8(!1);return t=OW.bind(null,gi,t.queue,!0,!1),Lo().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=gi,r=Lo();if(er){if(n===void 0)throw Error(It(407));n=n()}else{if(n=e(),Dr===null)throw Error(It(349));zi&124||dW(i,e,n)}r.memoizedState=n;var a={value:n,getSnapshot:e};return r.queue=a,DF(mW.bind(null,i,a,t),[t]),i.flags|=2048,P0(9,GT(),pW.bind(null,i,a,n,e),null),n},useId:function(){var t=Lo(),e=Dr.identifierPrefix;if(er){var n=Wf,i=Gf;n=(i&~(1<<32-yl(i)-1)).toString(32)+n,e="«"+e+"R"+n,n=BM++,0<n&&(e+="H"+n.toString(32)),e+="»"}else n=ose++,e="«"+e+"r"+n.toString(32)+"»";return t.memoizedState=e},useHostTransitionStatus:XN,useFormState:CF,useActionState:CF,useOptimistic:function(t){var e=Lo();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=KN.bind(null,gi,!0,n),n.dispatch=e,[t,e]},useMemoCache:VN,useCacheRefresh:function(){return Lo().memoizedState=hse.bind(null,gi)}},jW={readContext:no,use:VT,useCallback:RW,useContext:no,useEffect:EW,useImperativeHandle:CW,useInsertionEffect:MW,useLayoutEffect:TW,useMemo:kW,useReducer:$E,useRef:wW,useState:function(){return $E(lh)},useDebugValue:WN,useDeferredValue:function(t,e){var n=Ca();return DW(n,br.memoizedState,t,e)},useTransition:function(){var t=$E(lh)[0],e=Ca().memoizedState;return[typeof t=="boolean"?t:v_(t),e]},useSyncExternalStore:hW,useId:LW,useHostTransitionStatus:XN,useFormState:RF,useActionState:RF,useOptimistic:function(t,e){var n=Ca();return vW(n,br,t,e)},useMemoCache:VN,useCacheRefresh:PW},pse={readContext:no,use:VT,useCallback:RW,useContext:no,useEffect:EW,useImperativeHandle:CW,useInsertionEffect:MW,useLayoutEffect:TW,useMemo:kW,useReducer:h3,useRef:wW,useState:function(){return h3(lh)},useDebugValue:WN,useDeferredValue:function(t,e){var n=Ca();return br===null?qN(n,t,e):DW(n,br.memoizedState,t,e)},useTransition:function(){var t=h3(lh)[0],e=Ca().memoizedState;return[typeof t=="boolean"?t:v_(t),e]},useSyncExternalStore:hW,useId:LW,useHostTransitionStatus:XN,useFormState:kF,useActionState:kF,useOptimistic:function(t,e){var n=Ca();return br!==null?vW(n,br,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:VN,useCacheRefresh:PW},h0=null,E1=0;function GS(t){var e=E1;return E1+=1,h0===null&&(h0=[]),oW(h0,t,e)}function Cy(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function WS(t,e){throw e.$$typeof===Gre?Error(It(525)):(t=Object.prototype.toString.call(e),Error(It(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function OF(t){var e=t._init;return e(t._payload)}function HW(t){function e(p,x){if(t){var _=p.deletions;_===null?(p.deletions=[x],p.flags|=16):_.push(x)}}function n(p,x){if(!t)return null;for(;x!==null;)e(p,x),x=x.sibling;return null}function i(p){for(var x=new Map;p!==null;)p.key!==null?x.set(p.key,p):x.set(p.index,p),p=p.sibling;return x}function r(p,x){return p=Qf(p,x),p.index=0,p.sibling=null,p}function a(p,x,_){return p.index=_,t?(_=p.alternate,_!==null?(_=_.index,_<x?(p.flags|=67108866,x):_):(p.flags|=67108866,x)):(p.flags|=1048576,x)}function s(p){return t&&p.alternate===null&&(p.flags|=67108866),p}function o(p,x,_,w){return x===null||x.tag!==6?(x=c3(_,p.mode,w),x.return=p,x):(x=r(x,_),x.return=p,x)}function l(p,x,_,w){var M=_.type;return M===Hb?u(p,x,_.props.children,w,_.key):x!==null&&(x.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===id&&OF(M)===x.type)?(x=r(x,_.props),Cy(x,_),x.return=p,x):(x=YE(_.type,_.key,_.props,null,p.mode,w),Cy(x,_),x.return=p,x)}function c(p,x,_,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==_.containerInfo||x.stateNode.implementation!==_.implementation?(x=u3(_,p.mode,w),x.return=p,x):(x=r(x,_.children||[]),x.return=p,x)}function u(p,x,_,w,M){return x===null||x.tag!==7?(x=bm(_,p.mode,w,M),x.return=p,x):(x=r(x,_),x.return=p,x)}function f(p,x,_){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=c3(""+x,p.mode,_),x.return=p,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case US:return _=YE(x.type,x.key,x.props,null,p.mode,_),Cy(_,x),_.return=p,_;case vx:return x=u3(x,p.mode,_),x.return=p,x;case id:var w=x._init;return x=w(x._payload),f(p,x,_)}if(yx(x)||Ey(x))return x=bm(x,p.mode,_,null),x.return=p,x;if(typeof x.then=="function")return f(p,GS(x),_);if(x.$$typeof===Vf)return f(p,HS(p,x),_);WS(p,x)}return null}function h(p,x,_,w){var M=x!==null?x.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return M!==null?null:o(p,x,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case US:return _.key===M?l(p,x,_,w):null;case vx:return _.key===M?c(p,x,_,w):null;case id:return M=_._init,_=M(_._payload),h(p,x,_,w)}if(yx(_)||Ey(_))return M!==null?null:u(p,x,_,w,null);if(typeof _.then=="function")return h(p,x,GS(_),w);if(_.$$typeof===Vf)return h(p,x,HS(p,_),w);WS(p,_)}return null}function d(p,x,_,w,M){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return p=p.get(_)||null,o(x,p,""+w,M);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case US:return p=p.get(w.key===null?_:w.key)||null,l(x,p,w,M);case vx:return p=p.get(w.key===null?_:w.key)||null,c(x,p,w,M);case id:var S=w._init;return w=S(w._payload),d(p,x,_,w,M)}if(yx(w)||Ey(w))return p=p.get(_)||null,u(x,p,w,M,null);if(typeof w.then=="function")return d(p,x,_,GS(w),M);if(w.$$typeof===Vf)return d(p,x,_,HS(x,w),M);WS(x,w)}return null}function g(p,x,_,w){for(var M=null,S=null,A=x,C=x=0,D=null;A!==null&&C<_.length;C++){A.index>C?(D=A,A=null):D=A.sibling;var R=h(p,A,_[C],w);if(R===null){A===null&&(A=D);break}t&&A&&R.alternate===null&&e(p,A),x=a(R,x,C),S===null?M=R:S.sibling=R,S=R,A=D}if(C===_.length)return n(p,A),er&&Hp(p,C),M;if(A===null){for(;C<_.length;C++)A=f(p,_[C],w),A!==null&&(x=a(A,x,C),S===null?M=A:S.sibling=A,S=A);return er&&Hp(p,C),M}for(A=i(A);C<_.length;C++)D=d(A,p,C,_[C],w),D!==null&&(t&&D.alternate!==null&&A.delete(D.key===null?C:D.key),x=a(D,x,C),S===null?M=D:S.sibling=D,S=D);return t&&A.forEach(function(N){return e(p,N)}),er&&Hp(p,C),M}function b(p,x,_,w){if(_==null)throw Error(It(151));for(var M=null,S=null,A=x,C=x=0,D=null,R=_.next();A!==null&&!R.done;C++,R=_.next()){A.index>C?(D=A,A=null):D=A.sibling;var N=h(p,A,R.value,w);if(N===null){A===null&&(A=D);break}t&&A&&N.alternate===null&&e(p,A),x=a(N,x,C),S===null?M=N:S.sibling=N,S=N,A=D}if(R.done)return n(p,A),er&&Hp(p,C),M;if(A===null){for(;!R.done;C++,R=_.next())R=f(p,R.value,w),R!==null&&(x=a(R,x,C),S===null?M=R:S.sibling=R,S=R);return er&&Hp(p,C),M}for(A=i(A);!R.done;C++,R=_.next())R=d(A,p,C,R.value,w),R!==null&&(t&&R.alternate!==null&&A.delete(R.key===null?C:R.key),x=a(R,x,C),S===null?M=R:S.sibling=R,S=R);return t&&A.forEach(function(U){return e(p,U)}),er&&Hp(p,C),M}function y(p,x,_,w){if(typeof _=="object"&&_!==null&&_.type===Hb&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case US:e:{for(var M=_.key;x!==null;){if(x.key===M){if(M=_.type,M===Hb){if(x.tag===7){n(p,x.sibling),w=r(x,_.props.children),w.return=p,p=w;break e}}else if(x.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===id&&OF(M)===x.type){n(p,x.sibling),w=r(x,_.props),Cy(w,_),w.return=p,p=w;break e}n(p,x);break}else e(p,x);x=x.sibling}_.type===Hb?(w=bm(_.props.children,p.mode,w,_.key),w.return=p,p=w):(w=YE(_.type,_.key,_.props,null,p.mode,w),Cy(w,_),w.return=p,p=w)}return s(p);case vx:e:{for(M=_.key;x!==null;){if(x.key===M)if(x.tag===4&&x.stateNode.containerInfo===_.containerInfo&&x.stateNode.implementation===_.implementation){n(p,x.sibling),w=r(x,_.children||[]),w.return=p,p=w;break e}else{n(p,x);break}else e(p,x);x=x.sibling}w=u3(_,p.mode,w),w.return=p,p=w}return s(p);case id:return M=_._init,_=M(_._payload),y(p,x,_,w)}if(yx(_))return g(p,x,_,w);if(Ey(_)){if(M=Ey(_),typeof M!="function")throw Error(It(150));return _=M.call(_),b(p,x,_,w)}if(typeof _.then=="function")return y(p,x,GS(_),w);if(_.$$typeof===Vf)return y(p,x,HS(p,_),w);WS(p,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,x!==null&&x.tag===6?(n(p,x.sibling),w=r(x,_),w.return=p,p=w):(n(p,x),w=c3(_,p.mode,w),w.return=p,p=w),s(p)):n(p,x)}return function(p,x,_,w){try{E1=0;var M=y(p,x,_,w);return h0=null,M}catch(A){if(A===b_||A===HT)throw A;var S=pl(29,A,null,p.mode);return S.lanes=w,S.return=p,S}finally{}}}var U0=HW(!0),VW=HW(!1),yc=lf(null),Ku=null;function ud(t){var e=t.alternate;Jr(Ua,Ua.current&1),Jr(yc,t),Ku===null&&(e===null||L0.current!==null||e.memoizedState!==null)&&(Ku=t)}function GW(t){if(t.tag===22){if(Jr(Ua,Ua.current),Jr(yc,t),Ku===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Ku=t)}}else fd()}function fd(){Jr(Ua,Ua.current),Jr(yc,yc.current)}function Xf(t){ns(yc),Ku===t&&(Ku=null),ns(Ua)}var Ua=lf(0);function jM(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||pO(n)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function d3(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:jr({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Z8={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=xl(),r=Ed(i);r.payload=e,n!=null&&(r.callback=n),e=Md(t,r,i),e!==null&&(_l(e,t,i),zx(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=xl(),r=Ed(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Md(t,r,i),e!==null&&(_l(e,t,i),zx(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=xl(),i=Ed(n);i.tag=2,e!=null&&(i.callback=e),e=Md(t,i,n),e!==null&&(_l(e,t,n),zx(e,t,n))}};function IF(t,e,n,i,r,a,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,a,s):e.prototype&&e.prototype.isPureReactComponent?!_1(n,i)||!_1(r,a):!0}function NF(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Z8.enqueueReplaceState(e,e.state,null)}function Fm(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=jr({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}var HM=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function WW(t){HM(t)}function qW(t){console.error(t)}function XW(t){HM(t)}function VM(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function LF(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Q8(t,e,n){return n=Ed(n),n.tag=3,n.payload={element:null},n.callback=function(){VM(t,e)},n}function KW(t){return t=Ed(t),t.tag=3,t}function YW(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var a=i.value;t.payload=function(){return r(a)},t.callback=function(){LF(e,n,i)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){LF(e,n,i),typeof r!="function"&&(Td===null?Td=new Set([this]):Td.add(this));var o=i.stack;this.componentDidCatch(i.value,{componentStack:o!==null?o:""})})}function mse(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&m_(e,n,r,!0),n=yc.current,n!==null){switch(n.tag){case 13:return Ku===null?oO():n.alternate===null&&ha===0&&(ha=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===W8?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),E3(t,i,r)),!1;case 22:return n.flags|=65536,i===W8?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),E3(t,i,r)),!1}throw Error(It(435,n.tag))}return E3(t,i,r),oO(),!1}if(er)return e=yc.current,e!==null?(!(e.flags&65536)&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==z8&&(t=Error(It(422),{cause:i}),S1(cc(t,n)))):(i!==z8&&(e=Error(It(423),{cause:i}),S1(cc(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=cc(i,n),r=Q8(t.stateNode,i,r),f3(t,r),ha!==4&&(ha=2)),!1;var a=Error(It(520),{cause:i});if(a=cc(a,n),qx===null?qx=[a]:qx.push(a),ha!==4&&(ha=2),e===null)return!0;i=cc(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Q8(n.stateNode,i,t),f3(n,t),!1;case 1:if(e=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Td===null||!Td.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=KW(r),YW(r,t,n,i),f3(n,r),!1}n=n.return}while(n!==null);return!1}var JW=Error(It(461)),es=!1;function Ss(t,e,n,i){e.child=t===null?VW(e,null,n,i):U0(e,t.child,n,i)}function PF(t,e,n,i,r){n=n.render;var a=e.ref;if("ref"in i){var s={};for(var o in i)o!=="ref"&&(s[o]=i[o])}else s=i;return Pm(e),i=FN(t,e,n,s,a,r),o=BN(),t!==null&&!es?(zN(t,e,r),ch(t,e,r)):(er&&o&&DN(e),e.flags|=1,Ss(t,e,i,r),e.child)}function UF(t,e,n,i,r){if(t===null){var a=n.type;return typeof a=="function"&&!kN(a)&&a.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=a,$W(t,e,a,i,r)):(t=YE(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!YN(t,r)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:_1,n(s,i)&&t.ref===e.ref)return ch(t,e,r)}return e.flags|=1,t=Qf(a,i),t.ref=e.ref,t.return=e,e.child=t}function $W(t,e,n,i,r){if(t!==null){var a=t.memoizedProps;if(_1(a,i)&&t.ref===e.ref)if(es=!1,e.pendingProps=i=a,YN(t,r))t.flags&131072&&(es=!0);else return e.lanes=t.lanes,ch(t,e,r)}return eO(t,e,n,i,r)}function ZW(t,e,n){var i=e.pendingProps,r=i.children,a=t!==null?t.memoizedState:null;if(i.mode==="hidden"){if(e.flags&128){if(i=a!==null?a.baseLanes|n:n,t!==null){for(r=e.child=t.child,a=0;r!==null;)a=a|r.lanes|r.childLanes,r=r.sibling;e.childLanes=a&~i}else e.childLanes=0,e.child=null;return FF(t,e,i,n)}if(n&536870912)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&JE(e,a!==null?a.cachePool:null),a!==null?MF(e,a):K8(),GW(e);else return e.lanes=e.childLanes=536870912,FF(t,e,a!==null?a.baseLanes|n:n,n)}else a!==null?(JE(e,a.cachePool),MF(e,a),fd(),e.memoizedState=null):(t!==null&&JE(e,null),K8(),fd());return Ss(t,e,r,n),e.child}function FF(t,e,n,i){var r=NN();return r=r===null?null:{parent:Pa._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&JE(e,null),K8(),GW(e),t!==null&&m_(t,e,i,!0),null}function QE(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(It(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function eO(t,e,n,i,r){return Pm(e),n=FN(t,e,n,i,void 0,r),i=BN(),t!==null&&!es?(zN(t,e,r),ch(t,e,r)):(er&&i&&DN(e),e.flags|=1,Ss(t,e,n,r),e.child)}function BF(t,e,n,i,r,a){return Pm(e),e.updateQueue=null,n=fW(e,i,n,r),uW(t),i=BN(),t!==null&&!es?(zN(t,e,a),ch(t,e,a)):(er&&i&&DN(e),e.flags|=1,Ss(t,e,n,a),e.child)}function zF(t,e,n,i,r){if(Pm(e),e.stateNode===null){var a=Jb,s=n.contextType;typeof s=="object"&&s!==null&&(a=no(s)),a=new n(i,a),e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Z8,e.stateNode=a,a._reactInternals=e,a=e.stateNode,a.props=i,a.state=e.memoizedState,a.refs={},LN(e),s=n.contextType,a.context=typeof s=="object"&&s!==null?no(s):Jb,a.state=e.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(d3(e,n,s,i),a.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(s=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),s!==a.state&&Z8.enqueueReplaceState(a,a.state,null),Hx(e,i,a,r),jx(),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){a=e.stateNode;var o=e.memoizedProps,l=Fm(n,o);a.props=l;var c=a.context,u=n.contextType;s=Jb,typeof u=="object"&&u!==null&&(s=no(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function",o=e.pendingProps!==o,u||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o||c!==s)&&NF(e,a,i,s),rd=!1;var h=e.memoizedState;a.state=h,Hx(e,i,a,r),jx(),c=e.memoizedState,o||h!==c||rd?(typeof f=="function"&&(d3(e,n,f,i),c=e.memoizedState),(l=rd||IF(e,n,l,i,h,c,s))?(u||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),a.props=i,a.state=c,a.context=s,i=l):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,q8(t,e),s=e.memoizedProps,u=Fm(n,s),a.props=u,f=e.pendingProps,h=a.context,c=n.contextType,l=Jb,typeof c=="object"&&c!==null&&(l=no(c)),o=n.getDerivedStateFromProps,(c=typeof o=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==f||h!==l)&&NF(e,a,i,l),rd=!1,h=e.memoizedState,a.state=h,Hx(e,i,a,r),jx();var d=e.memoizedState;s!==f||h!==d||rd||t!==null&&t.dependencies!==null&&PM(t.dependencies)?(typeof o=="function"&&(d3(e,n,o,i),d=e.memoizedState),(u=rd||IF(e,n,u,i,h,d,l)||t!==null&&t.dependencies!==null&&PM(t.dependencies))?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(i,d,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(i,d,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=d),a.props=i,a.state=d,a.context=l,i=u):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return a=i,QE(t,e),i=(e.flags&128)!==0,a||i?(a=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:a.render(),e.flags|=1,t!==null&&i?(e.child=U0(e,t.child,null,r),e.child=U0(e,null,n,r)):Ss(t,e,n,r),e.memoizedState=a.state,t=e.child):t=ch(t,e,r),t}function jF(t,e,n,i){return p_(),e.flags|=256,Ss(t,e,n,i),e.child}var p3={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function m3(t){return{baseLanes:t,cachePool:aW()}}function g3(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=hc),t}function QW(t,e,n){var i=e.pendingProps,r=!1,a=(e.flags&128)!==0,s;if((s=a)||(s=t!==null&&t.memoizedState===null?!1:(Ua.current&2)!==0),s&&(r=!0,e.flags&=-129),s=(e.flags&32)!==0,e.flags&=-33,t===null){if(er){if(r?ud(e):fd(),er){var o=fa,l;if(l=o){e:{for(l=o,o=Fu;l.nodeType!==8;){if(!o){o=null;break e}if(l=fu(l.nextSibling),l===null){o=null;break e}}o=l}o!==null?(e.memoizedState={dehydrated:o,treeContext:vm!==null?{id:Gf,overflow:Wf}:null,retryLane:536870912,hydrationErrors:null},l=pl(18,null,null,0),l.stateNode=o,l.return=e,e.child=l,_o=e,fa=null,l=!0):l=!1}l||Lm(e)}if(o=e.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return pO(o)?e.lanes=32:e.lanes=536870912,null;Xf(e)}return o=i.children,i=i.fallback,r?(fd(),r=e.mode,o=GM({mode:"hidden",children:o},r),i=bm(i,r,n,null),o.return=e,i.return=e,o.sibling=i,e.child=o,r=e.child,r.memoizedState=m3(n),r.childLanes=g3(t,s,n),e.memoizedState=p3,i):(ud(e),tO(e,o))}if(l=t.memoizedState,l!==null&&(o=l.dehydrated,o!==null)){if(a)e.flags&256?(ud(e),e.flags&=-257,e=b3(t,e,n)):e.memoizedState!==null?(fd(),e.child=t.child,e.flags|=128,e=null):(fd(),r=i.fallback,o=e.mode,i=GM({mode:"visible",children:i.children},o),r=bm(r,o,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,U0(e,t.child,null,n),i=e.child,i.memoizedState=m3(n),i.childLanes=g3(t,s,n),e.memoizedState=p3,e=r);else if(ud(e),pO(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var c=s.dgst;s=c,i=Error(It(419)),i.stack="",i.digest=s,S1({value:i,source:null,stack:null}),e=b3(t,e,n)}else if(es||m_(t,e,n,!1),s=(n&t.childLanes)!==0,es||s){if(s=Dr,s!==null&&(i=n&-n,i=i&42?1:yN(i),i=i&(s.suspendedLanes|n)?0:i,i!==0&&i!==l.retryLane))throw l.retryLane=i,Sv(t,i),_l(s,t,i),JW;o.data==="$?"||oO(),e=b3(t,e,n)}else o.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,fa=fu(o.nextSibling),_o=e,er=!0,ym=null,Fu=!1,t!==null&&(rc[ac++]=Gf,rc[ac++]=Wf,rc[ac++]=vm,Gf=t.id,Wf=t.overflow,vm=e),e=tO(e,i.children),e.flags|=4096);return e}return r?(fd(),r=i.fallback,o=e.mode,l=t.child,c=l.sibling,i=Qf(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?r=Qf(c,r):(r=bm(r,o,n,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,o=t.child.memoizedState,o===null?o=m3(n):(l=o.cachePool,l!==null?(c=Pa._currentValue,l=l.parent!==c?{parent:c,pool:c}:l):l=aW(),o={baseLanes:o.baseLanes|n,cachePool:l}),r.memoizedState=o,r.childLanes=g3(t,s,n),e.memoizedState=p3,i):(ud(e),n=t.child,t=n.sibling,n=Qf(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(s=e.deletions,s===null?(e.deletions=[t],e.flags|=16):s.push(t)),e.child=n,e.memoizedState=null,n)}function tO(t,e){return e=GM({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function GM(t,e){return t=pl(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function b3(t,e,n){return U0(e,t.child,null,n),t=tO(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function HF(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),H8(t.return,e,n)}function v3(t,e,n,i,r){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r)}function eq(t,e,n){var i=e.pendingProps,r=i.revealOrder,a=i.tail;if(Ss(t,e,i.children,n),i=Ua.current,i&2)i=i&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&HF(t,n,e);else if(t.tag===19)HF(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}switch(Jr(Ua,i),r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&jM(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),v3(e,!1,r,n,a);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&jM(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}v3(e,!0,n,null,a);break;case"together":v3(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ch(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ld|=e.lanes,!(n&e.childLanes))if(t!==null){if(m_(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(It(153));if(e.child!==null){for(t=e.child,n=Qf(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Qf(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function YN(t,e){return t.lanes&e?!0:(t=t.dependencies,!!(t!==null&&PM(t)))}function gse(t,e,n){switch(e.tag){case 3:CM(e,e.stateNode.containerInfo),cd(e,Pa,t.memoizedState.cache),p_();break;case 27:case 5:k8(e);break;case 4:CM(e,e.stateNode.containerInfo);break;case 10:cd(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(ud(e),e.flags|=128,null):n&e.child.childLanes?QW(t,e,n):(ud(e),t=ch(t,e,n),t!==null?t.sibling:null);ud(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(m_(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return eq(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Jr(Ua,Ua.current),i)break;return null;case 22:case 23:return e.lanes=0,ZW(t,e,n);case 24:cd(e,Pa,t.memoizedState.cache)}return ch(t,e,n)}function tq(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)es=!0;else{if(!YN(t,n)&&!(e.flags&128))return es=!1,gse(t,e,n);es=!!(t.flags&131072)}else es=!1,er&&e.flags&1048576&&iW(e,LM,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var i=e.elementType,r=i._init;if(i=r(i._payload),e.type=i,typeof i=="function")kN(i)?(t=Fm(i,t),e.tag=1,e=zF(null,e,i,t,n)):(e.tag=0,e=eO(null,e,i,t,n));else{if(i!=null){if(r=i.$$typeof,r===gN){e.tag=11,e=PF(null,e,i,t,n);break e}else if(r===bN){e.tag=14,e=UF(null,e,i,t,n);break e}}throw e=C8(i)||i,Error(It(306,e,""))}}return e;case 0:return eO(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Fm(i,e.pendingProps),zF(t,e,i,r,n);case 3:e:{if(CM(e,e.stateNode.containerInfo),t===null)throw Error(It(387));i=e.pendingProps;var a=e.memoizedState;r=a.element,q8(t,e),Hx(e,i,null,n);var s=e.memoizedState;if(i=s.cache,cd(e,Pa,i),i!==a.cache&&V8(e,[Pa],n,!0),jx(),i=s.element,a.isDehydrated)if(a={element:i,isDehydrated:!1,cache:s.cache},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){e=jF(t,e,i,n);break e}else if(i!==r){r=cc(Error(It(424)),e),S1(r),e=jF(t,e,i,n);break e}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(fa=fu(t.firstChild),_o=e,er=!0,ym=null,Fu=!0,n=VW(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(p_(),i===r){e=ch(t,e,n);break e}Ss(t,e,i,n)}e=e.child}return e;case 26:return QE(t,e),t===null?(n=aB(e.type,null,e.pendingProps,null))?e.memoizedState=n:er||(n=e.type,t=e.pendingProps,i=$M(wd.current).createElement(n),i[to]=e,i[Vo]=t,Rs(i,n,t),Qa(i),e.stateNode=i):e.memoizedState=aB(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return k8(e),t===null&&er&&(i=e.stateNode=jq(e.type,e.pendingProps,wd.current),_o=e,Fu=!0,r=fa,Vd(e.type)?(mO=r,fa=fu(i.firstChild)):fa=r),Ss(t,e,e.pendingProps.children,n),QE(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&er&&((r=i=fa)&&(i=Gse(i,e.type,e.pendingProps,Fu),i!==null?(e.stateNode=i,_o=e,fa=fu(i.firstChild),Fu=!1,r=!0):r=!1),r||Lm(e)),k8(e),r=e.type,a=e.pendingProps,s=t!==null?t.memoizedProps:null,i=a.children,hO(r,a)?i=null:s!==null&&hO(r,s)&&(e.flags|=32),e.memoizedState!==null&&(r=FN(t,e,lse,null,null,n),C1._currentValue=r),QE(t,e),Ss(t,e,i,n),e.child;case 6:return t===null&&er&&((t=n=fa)&&(n=Wse(n,e.pendingProps,Fu),n!==null?(e.stateNode=n,_o=e,fa=null,t=!0):t=!1),t||Lm(e)),null;case 13:return QW(t,e,n);case 4:return CM(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=U0(e,null,i,n):Ss(t,e,i,n),e.child;case 11:return PF(t,e,e.type,e.pendingProps,n);case 7:return Ss(t,e,e.pendingProps,n),e.child;case 8:return Ss(t,e,e.pendingProps.children,n),e.child;case 12:return Ss(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,cd(e,e.type,i.value),Ss(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,Pm(e),r=no(r),i=i(r),e.flags|=1,Ss(t,e,i,n),e.child;case 14:return UF(t,e,e.type,e.pendingProps,n);case 15:return $W(t,e,e.type,e.pendingProps,n);case 19:return eq(t,e,n);case 31:return i=e.pendingProps,n=e.mode,i={mode:i.mode,children:i.children},t===null?(n=GM(i,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=Qf(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return ZW(t,e,n);case 24:return Pm(e),i=no(Pa),t===null?(r=NN(),r===null&&(r=Dr,a=IN(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),e.memoizedState={parent:i,cache:r},LN(e),cd(e,Pa,r)):(t.lanes&n&&(q8(t,e),Hx(e,null,null,n),jx()),r=t.memoizedState,a=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),cd(e,Pa,i)):(i=a.cache,cd(e,Pa,i),i!==r.cache&&V8(e,[Pa],n,!0))),Ss(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(It(156,e.tag))}function Rf(t){t.flags|=4}function VF(t,e){if(e.type!=="stylesheet"||e.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!Gq(e)){if(e=yc.current,e!==null&&((zi&4194048)===zi?Ku!==null:(zi&62914560)!==zi&&!(zi&536870912)||e!==Ku))throw Bx=W8,sW;t.flags|=8192}}function qS(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?A7():536870912,t.lanes|=e,F0|=e)}function Ry(t,e){if(!er)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Qr(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function bse(t,e,n){var i=e.pendingProps;switch(ON(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qr(e),null;case 1:return Qr(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),eh(Pa),D0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Ay(e)?Rf(e):t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,yF())),Qr(e),null;case 26:return n=e.memoizedState,t===null?(Rf(e),n!==null?(Qr(e),VF(e,n)):(Qr(e),e.flags&=-16777217)):n?n!==t.memoizedState?(Rf(e),Qr(e),VF(e,n)):(Qr(e),e.flags&=-16777217):(t.memoizedProps!==i&&Rf(e),Qr(e),e.flags&=-16777217),null;case 27:RM(e),n=wd.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Rf(e);else{if(!i){if(e.stateNode===null)throw Error(It(166));return Qr(e),null}t=qu.current,Ay(e)?bF(e):(t=jq(r,i,n),e.stateNode=t,Rf(e))}return Qr(e),null;case 5:if(RM(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Rf(e);else{if(!i){if(e.stateNode===null)throw Error(It(166));return Qr(e),null}if(t=qu.current,Ay(e))bF(e);else{switch(r=$M(wd.current),t){case 1:t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?t.multiple=!0:i.size&&(t.size=i.size);break;default:t=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}t[to]=e,t[Vo]=i;e:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=t;e:switch(Rs(t,n,i),n){case"button":case"input":case"select":case"textarea":t=!!i.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Rf(e)}}return Qr(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&Rf(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(It(166));if(t=wd.current,Ay(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=_o,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[to]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Fq(t.nodeValue,n)),t||Lm(e)}else t=$M(t).createTextNode(i),t[to]=e,e.stateNode=t}return Qr(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=Ay(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(It(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(It(317));r[to]=e}else p_(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Qr(e),r=!1}else r=yF(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(Xf(e),e):(Xf(e),null)}if(Xf(e),e.flags&128)return e.lanes=n,e;if(n=i!==null,t=t!==null&&t.memoizedState!==null,n){i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var a=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==r&&(i.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),qS(e,e.updateQueue),Qr(e),null;case 4:return D0(),t===null&&iL(e.stateNode.containerInfo),Qr(e),null;case 10:return eh(e.type),Qr(e),null;case 19:if(ns(Ua),r=e.memoizedState,r===null)return Qr(e),null;if(i=(e.flags&128)!==0,a=r.rendering,a===null)if(i)Ry(r,!1);else{if(ha!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=jM(t),a!==null){for(e.flags|=128,Ry(r,!1),t=a.updateQueue,e.updateQueue=t,qS(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)nW(n,t),n=n.sibling;return Jr(Ua,Ua.current&1|2),e.child}t=t.sibling}r.tail!==null&&Xu()>qM&&(e.flags|=128,i=!0,Ry(r,!1),e.lanes=4194304)}else{if(!i)if(t=jM(a),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,qS(e,t),Ry(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!er)return Qr(e),null}else 2*Xu()-r.renderingStartTime>qM&&n!==536870912&&(e.flags|=128,i=!0,Ry(r,!1),e.lanes=4194304);r.isBackwards?(a.sibling=e.child,e.child=a):(t=r.last,t!==null?t.sibling=a:e.child=a,r.last=a)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Xu(),e.sibling=null,t=Ua.current,Jr(Ua,i?t&1|2:t&1),e):(Qr(e),null);case 22:case 23:return Xf(e),PN(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?n&536870912&&!(e.flags&128)&&(Qr(e),e.subtreeFlags&6&&(e.flags|=8192)):Qr(e),n=e.updateQueue,n!==null&&qS(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ns(xm),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),eh(Pa),Qr(e),null;case 25:return null;case 30:return null}throw Error(It(156,e.tag))}function vse(t,e){switch(ON(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return eh(Pa),D0(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return RM(e),null;case 13:if(Xf(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(It(340));p_()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ns(Ua),null;case 4:return D0(),null;case 10:return eh(e.type),null;case 22:case 23:return Xf(e),PN(),t!==null&&ns(xm),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return eh(Pa),null;case 25:return null;default:return null}}function nq(t,e){switch(ON(e),e.tag){case 3:eh(Pa),D0();break;case 26:case 27:case 5:RM(e);break;case 4:D0();break;case 13:Xf(e);break;case 19:ns(Ua);break;case 10:eh(e.type);break;case 22:case 23:Xf(e),PN(),t!==null&&ns(xm);break;case 24:eh(Pa)}}function x_(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var a=n.create,s=n.inst;i=a(),s.destroy=i}n=n.next}while(n!==r)}}catch(o){wr(e,e.return,o)}}function Nd(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var a=r.next;i=a;do{if((i.tag&t)===t){var s=i.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,r=e;var l=n,c=o;try{c()}catch(u){wr(r,l,u)}}}i=i.next}while(i!==a)}}catch(u){wr(e,e.return,u)}}function iq(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{cW(e,n)}catch(i){wr(t,t.return,i)}}}function rq(t,e,n){n.props=Fm(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){wr(t,e,i)}}function Gx(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){wr(t,e,r)}}function Vu(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){wr(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){wr(t,e,r)}else n.current=null}function aq(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){wr(t,t.return,r)}}function y3(t,e,n){try{var i=t.stateNode;Bse(i,t.type,n,e),i[Vo]=e}catch(r){wr(t,t.return,r)}}function sq(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Vd(t.type)||t.tag===4}function x3(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||sq(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Vd(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function nO(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=YT));else if(i!==4&&(i===27&&Vd(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(nO(t,e,n),t=t.sibling;t!==null;)nO(t,e,n),t=t.sibling}function WM(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Vd(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(WM(t,e,n),t=t.sibling;t!==null;)WM(t,e,n),t=t.sibling}function oq(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);Rs(e,i,n),e[to]=t,e[Vo]=n}catch(a){wr(t,t.return,a)}}var jf=!1,ga=!1,_3=!1,GF=typeof WeakSet=="function"?WeakSet:Set,$a=null;function yse(t,e){if(t=t.containerInfo,uO=t2,t=K7(t),AN(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,o=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||r!==0&&f.nodeType!==3||(o=s+r),f!==a||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===r&&(o=s),h===a&&++u===i&&(l=s),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(fO={focusedElem:t,selectionRange:n},t2=!1,$a=e;$a!==null;)if(e=$a,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,$a=t;else for(;$a!==null;){switch(e=$a,a=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if(t&1024&&a!==null){t=void 0,n=e,r=a.memoizedProps,a=a.memoizedState,i=n.stateNode;try{var g=Fm(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(g,a),i.__reactInternalSnapshotBeforeUpdate=t}catch(b){wr(n,n.return,b)}}break;case 3:if(t&1024){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)dO(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":dO(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(It(163))}if(t=e.sibling,t!==null){t.return=e.return,$a=t;break}$a=e.return}}function lq(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:jh(t,n),i&4&&x_(5,n);break;case 1:if(jh(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(s){wr(n,n.return,s)}else{var r=Fm(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(s){wr(n,n.return,s)}}i&64&&iq(n),i&512&&Gx(n,n.return);break;case 3:if(jh(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{cW(t,e)}catch(s){wr(n,n.return,s)}}break;case 27:e===null&&i&4&&oq(n);case 26:case 5:jh(t,n),e===null&&i&4&&aq(n),i&512&&Gx(n,n.return);break;case 12:jh(t,n);break;case 13:jh(t,n),i&4&&fq(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=Cse.bind(null,n),qse(t,n))));break;case 22:if(i=n.memoizedState!==null||jf,!i){e=e!==null&&e.memoizedState!==null||ga,r=jf;var a=ga;jf=i,(ga=e)&&!a?td(t,n,(n.subtreeFlags&8772)!==0):jh(t,n),jf=r,ga=a}break;case 30:break;default:jh(t,n)}}function cq(t){var e=t.alternate;e!==null&&(t.alternate=null,cq(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&_N(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var qr=null,Po=!1;function kf(t,e,n){for(n=n.child;n!==null;)uq(t,e,n),n=n.sibling}function uq(t,e,n){if(vl&&typeof vl.onCommitFiberUnmount=="function")try{vl.onCommitFiberUnmount(c_,n)}catch{}switch(n.tag){case 26:ga||Vu(n,e),kf(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ga||Vu(n,e);var i=qr,r=Po;Vd(n.type)&&(qr=n.stateNode,Po=!1),kf(t,e,n),Kx(n.stateNode),qr=i,Po=r;break;case 5:ga||Vu(n,e);case 6:if(i=qr,r=Po,qr=null,kf(t,e,n),qr=i,Po=r,qr!==null)if(Po)try{(qr.nodeType===9?qr.body:qr.nodeName==="HTML"?qr.ownerDocument.body:qr).removeChild(n.stateNode)}catch(a){wr(n,e,a)}else try{qr.removeChild(n.stateNode)}catch(a){wr(n,e,a)}break;case 18:qr!==null&&(Po?(t=qr,nB(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),D1(t)):nB(qr,n.stateNode));break;case 4:i=qr,r=Po,qr=n.stateNode.containerInfo,Po=!0,kf(t,e,n),qr=i,Po=r;break;case 0:case 11:case 14:case 15:ga||Nd(2,n,e),ga||Nd(4,n,e),kf(t,e,n);break;case 1:ga||(Vu(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&rq(n,e,i)),kf(t,e,n);break;case 21:kf(t,e,n);break;case 22:ga=(i=ga)||n.memoizedState!==null,kf(t,e,n),ga=i;break;default:kf(t,e,n)}}function fq(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{D1(t)}catch(n){wr(e,e.return,n)}}function xse(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new GF),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new GF),e;default:throw Error(It(435,t.tag))}}function S3(t,e){var n=xse(t);e.forEach(function(i){var r=Rse.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function al(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],a=t,s=e,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(Vd(o.type)){qr=o.stateNode,Po=!1;break e}break;case 5:qr=o.stateNode,Po=!1;break e;case 3:case 4:qr=o.stateNode.containerInfo,Po=!0;break e}o=o.return}if(qr===null)throw Error(It(160));uq(a,s,r),qr=null,Po=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)hq(e,t),e=e.sibling}var Kc=null;function hq(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:al(e,t),sl(t),i&4&&(Nd(3,t,t.return),x_(3,t),Nd(5,t,t.return));break;case 1:al(e,t),sl(t),i&512&&(ga||n===null||Vu(n,n.return)),i&64&&jf&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Kc;if(al(e,t),sl(t),i&512&&(ga||n===null||Vu(n,n.return)),i&4){var a=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":a=r.getElementsByTagName("title")[0],(!a||a[h_]||a[to]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(i),r.head.insertBefore(a,r.querySelector("head > title"))),Rs(a,i,n),a[to]=t,Qa(a),i=a;break e;case"link":var s=oB("link","href",r).get(i+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(a=s[o],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}a=r.createElement(i),Rs(a,i,n),r.head.appendChild(a);break;case"meta":if(s=oB("meta","content",r).get(i+(n.content||""))){for(o=0;o<s.length;o++)if(a=s[o],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}a=r.createElement(i),Rs(a,i,n),r.head.appendChild(a);break;default:throw Error(It(468,i))}a[to]=t,Qa(a),i=a}t.stateNode=i}else lB(r,t.type,t.stateNode);else t.stateNode=sB(r,i,t.memoizedProps);else a!==i?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,i===null?lB(r,t.type,t.stateNode):sB(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&y3(t,t.memoizedProps,n.memoizedProps)}break;case 27:al(e,t),sl(t),i&512&&(ga||n===null||Vu(n,n.return)),n!==null&&i&4&&y3(t,t.memoizedProps,n.memoizedProps);break;case 5:if(al(e,t),sl(t),i&512&&(ga||n===null||Vu(n,n.return)),t.flags&32){r=t.stateNode;try{I0(r,"")}catch(d){wr(t,t.return,d)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,y3(t,r,n!==null?n.memoizedProps:r)),i&1024&&(_3=!0);break;case 6:if(al(e,t),sl(t),i&4){if(t.stateNode===null)throw Error(It(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(d){wr(t,t.return,d)}}break;case 3:if(nM=null,r=Kc,Kc=ZM(e.containerInfo),al(e,t),Kc=r,sl(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{D1(e.containerInfo)}catch(d){wr(t,t.return,d)}_3&&(_3=!1,dq(t));break;case 4:i=Kc,Kc=ZM(t.stateNode.containerInfo),al(e,t),sl(t),Kc=i;break;case 12:al(e,t),sl(t);break;case 13:al(e,t),sl(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eL=Xu()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,S3(t,i)));break;case 22:r=t.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=jf,u=ga;if(jf=c||r,ga=u||l,al(e,t),ga=u,jf=c,sl(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||jf||ga||Vp(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){l=n=e;try{if(a=l.stateNode,r)s=a.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=l.stateNode;var f=l.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;o.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(d){wr(l,l.return,d)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(d){wr(l,l.return,d)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,S3(t,n))));break;case 19:al(e,t),sl(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,S3(t,i)));break;case 30:break;case 21:break;default:al(e,t),sl(t)}}function sl(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(sq(i)){n=i;break}i=i.return}if(n==null)throw Error(It(160));switch(n.tag){case 27:var r=n.stateNode,a=x3(t);WM(t,a,r);break;case 5:var s=n.stateNode;n.flags&32&&(I0(s,""),n.flags&=-33);var o=x3(t);WM(t,o,s);break;case 3:case 4:var l=n.stateNode.containerInfo,c=x3(t);nO(t,c,l);break;default:throw Error(It(161))}}catch(u){wr(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function dq(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;dq(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function jh(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)lq(t,e.alternate,e),e=e.sibling}function Vp(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Nd(4,e,e.return),Vp(e);break;case 1:Vu(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&rq(e,e.return,n),Vp(e);break;case 27:Kx(e.stateNode);case 26:case 5:Vu(e,e.return),Vp(e);break;case 22:e.memoizedState===null&&Vp(e);break;case 30:Vp(e);break;default:Vp(e)}t=t.sibling}}function td(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,a=e,s=a.flags;switch(a.tag){case 0:case 11:case 15:td(r,a,n),x_(4,a);break;case 1:if(td(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){wr(i,i.return,c)}if(i=a,r=i.updateQueue,r!==null){var o=i.stateNode;try{var l=r.shared.hiddenCallbacks;if(l!==null)for(r.shared.hiddenCallbacks=null,r=0;r<l.length;r++)lW(l[r],o)}catch(c){wr(i,i.return,c)}}n&&s&64&&iq(a),Gx(a,a.return);break;case 27:oq(a);case 26:case 5:td(r,a,n),n&&i===null&&s&4&&aq(a),Gx(a,a.return);break;case 12:td(r,a,n);break;case 13:td(r,a,n),n&&s&4&&fq(r,a);break;case 22:a.memoizedState===null&&td(r,a,n),Gx(a,a.return);break;case 30:break;default:td(r,a,n)}e=e.sibling}}function JN(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&g_(n))}function $N(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&g_(t))}function Cu(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)pq(t,e,n,i),e=e.sibling}function pq(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Cu(t,e,n,i),r&2048&&x_(9,e);break;case 1:Cu(t,e,n,i);break;case 3:Cu(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&g_(t)));break;case 12:if(r&2048){Cu(t,e,n,i),t=e.stateNode;try{var a=e.memoizedProps,s=a.id,o=a.onPostCommit;typeof o=="function"&&o(s,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(l){wr(e,e.return,l)}}else Cu(t,e,n,i);break;case 13:Cu(t,e,n,i);break;case 23:break;case 22:a=e.stateNode,s=e.alternate,e.memoizedState!==null?a._visibility&2?Cu(t,e,n,i):Wx(t,e):a._visibility&2?Cu(t,e,n,i):(a._visibility|=2,Lb(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&JN(s,e);break;case 24:Cu(t,e,n,i),r&2048&&$N(e.alternate,e);break;default:Cu(t,e,n,i)}}function Lb(t,e,n,i,r){for(r=r&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var a=t,s=e,o=n,l=i,c=s.flags;switch(s.tag){case 0:case 11:case 15:Lb(a,s,o,l,r),x_(8,s);break;case 23:break;case 22:var u=s.stateNode;s.memoizedState!==null?u._visibility&2?Lb(a,s,o,l,r):Wx(a,s):(u._visibility|=2,Lb(a,s,o,l,r)),r&&c&2048&&JN(s.alternate,s);break;case 24:Lb(a,s,o,l,r),r&&c&2048&&$N(s.alternate,s);break;default:Lb(a,s,o,l,r)}e=e.sibling}}function Wx(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:Wx(n,i),r&2048&&JN(i.alternate,i);break;case 24:Wx(n,i),r&2048&&$N(i.alternate,i);break;default:Wx(n,i)}e=e.sibling}}var _x=8192;function Bg(t){if(t.subtreeFlags&_x)for(t=t.child;t!==null;)mq(t),t=t.sibling}function mq(t){switch(t.tag){case 26:Bg(t),t.flags&_x&&t.memoizedState!==null&&aoe(Kc,t.memoizedState,t.memoizedProps);break;case 5:Bg(t);break;case 3:case 4:var e=Kc;Kc=ZM(t.stateNode.containerInfo),Bg(t),Kc=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=_x,_x=16777216,Bg(t),_x=e):Bg(t));break;default:Bg(t)}}function gq(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function ky(t){var e=t.deletions;if(t.flags&16){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];$a=i,vq(i,t)}gq(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bq(t),t=t.sibling}function bq(t){switch(t.tag){case 0:case 11:case 15:ky(t),t.flags&2048&&Nd(9,t,t.return);break;case 3:ky(t);break;case 12:ky(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,eM(t)):ky(t);break;default:ky(t)}}function eM(t){var e=t.deletions;if(t.flags&16){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];$a=i,vq(i,t)}gq(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Nd(8,e,e.return),eM(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,eM(e));break;default:eM(e)}t=t.sibling}}function vq(t,e){for(;$a!==null;){var n=$a;switch(n.tag){case 0:case 11:case 15:Nd(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:g_(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,$a=i;else e:for(n=t;$a!==null;){i=$a;var r=i.sibling,a=i.return;if(cq(i),i===n){$a=null;break e}if(r!==null){r.return=a,$a=r;break e}$a=a}}}var _se={getCacheForType:function(t){var e=no(Pa),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},Sse=typeof WeakMap=="function"?WeakMap:Map,dr=0,Dr=null,Ci=null,zi=0,hr=0,hl=null,vd=!1,wv=!1,ZN=!1,uh=0,ha=0,Ld=0,_m=0,QN=0,hc=0,F0=0,qx=null,Uo=null,iO=!1,eL=0,qM=1/0,XM=null,Td=null,Ts=0,Ad=null,B0=null,d0=0,rO=0,aO=null,yq=null,Xx=0,sO=null;function xl(){if(dr&2&&zi!==0)return zi&-zi;if(Fn.T!==null){var t=N0;return t!==0?t:nL()}return k7()}function xq(){hc===0&&(hc=!(zi&536870912)||er?T7():536870912);var t=yc.current;return t!==null&&(t.flags|=32),hc}function _l(t,e,n){(t===Dr&&(hr===2||hr===9)||t.cancelPendingCommit!==null)&&(z0(t,0),yd(t,zi,hc,!1)),f_(t,n),(!(dr&2)||t!==Dr)&&(t===Dr&&(!(dr&2)&&(_m|=n),ha===4&&yd(t,zi,hc,!1)),cf(t))}function _q(t,e,n){if(dr&6)throw Error(It(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||u_(t,e),r=i?Mse(t,e):w3(t,e,!0),a=i;do{if(r===0){wv&&!i&&yd(t,e,0,!1);break}else{if(n=t.current.alternate,a&&!wse(n)){r=w3(t,e,!1),a=!1;continue}if(r===2){if(a=e,t.errorRecoveryDisabledLanes&a)var s=0;else s=t.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){e=s;e:{var o=t;r=qx;var l=o.current.memoizedState.isDehydrated;if(l&&(z0(o,s).flags|=256),s=w3(o,s,!1),s!==2){if(ZN&&!l){o.errorRecoveryDisabledLanes|=a,_m|=a,r=4;break e}a=Uo,Uo=r,a!==null&&(Uo===null?Uo=a:Uo.push.apply(Uo,a))}r=s}if(a=!1,r!==2)continue}}if(r===1){z0(t,0),yd(t,e,0,!0);break}e:{switch(i=t,a=r,a){case 0:case 1:throw Error(It(345));case 4:if((e&4194048)!==e)break;case 6:yd(i,e,hc,!vd);break e;case 2:Uo=null;break;case 3:case 5:break;default:throw Error(It(329))}if((e&62914560)===e&&(r=eL+300-Xu(),10<r)){if(yd(i,e,hc,!vd),PT(i,0,!0)!==0)break e;i.timeoutHandle=zq(WF.bind(null,i,n,Uo,XM,iO,e,hc,_m,F0,vd,a,2,-0,0),r);break e}WF(i,n,Uo,XM,iO,e,hc,_m,F0,vd,a,0,-0,0)}}break}while(!0);cf(t)}function WF(t,e,n,i,r,a,s,o,l,c,u,f,h,d){if(t.timeoutHandle=-1,f=e.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(A1={stylesheets:null,count:0,unsuspend:roe},mq(e),f=soe(),f!==null)){t.cancelPendingCommit=f(XF.bind(null,t,e,a,n,i,r,s,o,l,u,1,h,d)),yd(t,a,s,!c);return}XF(t,e,a,n,i,r,s,o,l)}function wse(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],a=r.getSnapshot;r=r.value;try{if(!Tl(a(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function yd(t,e,n,i){e&=~QN,e&=~_m,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var a=31-yl(r),s=1<<a;i[a]=-1,r&=~s}n!==0&&C7(t,n,e)}function qT(){return dr&6?!0:(__(0),!1)}function tL(){if(Ci!==null){if(hr===0)var t=Ci.return;else t=Ci,qf=eg=null,jN(t),h0=null,E1=0,t=Ci;for(;t!==null;)nq(t.alternate,t),t=t.return;Ci=null}}function z0(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,jse(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),tL(),Dr=t,Ci=n=Qf(t.current,null),zi=e,hr=0,hl=null,vd=!1,wv=u_(t,e),ZN=!1,F0=hc=QN=_m=Ld=ha=0,Uo=qx=null,iO=!1,e&8&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-yl(i),a=1<<r;e|=t[r],i&=~a}return uh=e,zT(),n}function Sq(t,e){gi=null,Fn.H=zM,e===b_||e===HT?(e=wF(),hr=3):e===sW?(e=wF(),hr=4):hr=e===JW?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,hl=e,Ci===null&&(ha=1,VM(t,cc(e,t.current)))}function wq(){var t=Fn.H;return Fn.H=zM,t===null?zM:t}function Eq(){var t=Fn.A;return Fn.A=_se,t}function oO(){ha=4,vd||(zi&4194048)!==zi&&yc.current!==null||(wv=!0),!(Ld&134217727)&&!(_m&134217727)||Dr===null||yd(Dr,zi,hc,!1)}function w3(t,e,n){var i=dr;dr|=2;var r=wq(),a=Eq();(Dr!==t||zi!==e)&&(XM=null,z0(t,e)),e=!1;var s=ha;e:do try{if(hr!==0&&Ci!==null){var o=Ci,l=hl;switch(hr){case 8:tL(),s=6;break e;case 3:case 2:case 9:case 6:yc.current===null&&(e=!0);var c=hr;if(hr=0,hl=null,Qb(t,o,l,c),n&&wv){s=0;break e}break;default:c=hr,hr=0,hl=null,Qb(t,o,l,c)}}Ese(),s=ha;break}catch(u){Sq(t,u)}while(!0);return e&&t.shellSuspendCounter++,qf=eg=null,dr=i,Fn.H=r,Fn.A=a,Ci===null&&(Dr=null,zi=0,zT()),s}function Ese(){for(;Ci!==null;)Mq(Ci)}function Mse(t,e){var n=dr;dr|=2;var i=wq(),r=Eq();Dr!==t||zi!==e?(XM=null,qM=Xu()+500,z0(t,e)):wv=u_(t,e);e:do try{if(hr!==0&&Ci!==null){e=Ci;var a=hl;t:switch(hr){case 1:hr=0,hl=null,Qb(t,e,a,1);break;case 2:case 9:if(SF(a)){hr=0,hl=null,qF(e);break}e=function(){hr!==2&&hr!==9||Dr!==t||(hr=7),cf(t)},a.then(e,e);break e;case 3:hr=7;break e;case 4:hr=5;break e;case 7:SF(a)?(hr=0,hl=null,qF(e)):(hr=0,hl=null,Qb(t,e,a,7));break;case 5:var s=null;switch(Ci.tag){case 26:s=Ci.memoizedState;case 5:case 27:var o=Ci;if(!s||Gq(s)){hr=0,hl=null;var l=o.sibling;if(l!==null)Ci=l;else{var c=o.return;c!==null?(Ci=c,XT(c)):Ci=null}break t}}hr=0,hl=null,Qb(t,e,a,5);break;case 6:hr=0,hl=null,Qb(t,e,a,6);break;case 8:tL(),ha=6;break e;default:throw Error(It(462))}}Tse();break}catch(u){Sq(t,u)}while(!0);return qf=eg=null,Fn.H=i,Fn.A=r,dr=n,Ci!==null?0:(Dr=null,zi=0,zT(),ha)}function Tse(){for(;Ci!==null&&!Kre();)Mq(Ci)}function Mq(t){var e=tq(t.alternate,t,uh);t.memoizedProps=t.pendingProps,e===null?XT(t):Ci=e}function qF(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=BF(n,e,e.pendingProps,e.type,void 0,zi);break;case 11:e=BF(n,e,e.pendingProps,e.type.render,e.ref,zi);break;case 5:jN(e);default:nq(n,e),e=Ci=nW(e,uh),e=tq(n,e,uh)}t.memoizedProps=t.pendingProps,e===null?XT(t):Ci=e}function Qb(t,e,n,i){qf=eg=null,jN(e),h0=null,E1=0;var r=e.return;try{if(mse(t,r,e,n,zi)){ha=1,VM(t,cc(n,t.current)),Ci=null;return}}catch(a){if(r!==null)throw Ci=r,a;ha=1,VM(t,cc(n,t.current)),Ci=null;return}e.flags&32768?(er||i===1?t=!0:wv||zi&536870912?t=!1:(vd=t=!0,(i===2||i===9||i===3||i===6)&&(i=yc.current,i!==null&&i.tag===13&&(i.flags|=16384))),Tq(e,t)):XT(e)}function XT(t){var e=t;do{if(e.flags&32768){Tq(e,vd);return}t=e.return;var n=bse(e.alternate,e,uh);if(n!==null){Ci=n;return}if(e=e.sibling,e!==null){Ci=e;return}Ci=e=t}while(e!==null);ha===0&&(ha=5)}function Tq(t,e){do{var n=vse(t.alternate,t);if(n!==null){n.flags&=32767,Ci=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Ci=t;return}Ci=t=n}while(t!==null);ha=6,Ci=null}function XF(t,e,n,i,r,a,s,o,l){t.cancelPendingCommit=null;do KT();while(Ts!==0);if(dr&6)throw Error(It(327));if(e!==null){if(e===t.current)throw Error(It(177));if(a=e.lanes|e.childLanes,a|=CN,rae(t,n,a,s,o,l),t===Dr&&(Ci=Dr=null,zi=0),B0=e,Ad=t,d0=n,rO=a,aO=r,yq=i,e.subtreeFlags&10256||e.flags&10256?(t.callbackNode=null,t.callbackPriority=0,kse(kM,function(){return Dq(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,e.subtreeFlags&13878||i){i=Fn.T,Fn.T=null,r=ir.p,ir.p=2,s=dr,dr|=4;try{yse(t,e,n)}finally{dr=s,ir.p=r,Fn.T=i}}Ts=1,Aq(),Cq(),Rq()}}function Aq(){if(Ts===1){Ts=0;var t=Ad,e=B0,n=(e.flags&13878)!==0;if(e.subtreeFlags&13878||n){n=Fn.T,Fn.T=null;var i=ir.p;ir.p=2;var r=dr;dr|=4;try{hq(e,t);var a=fO,s=K7(t.containerInfo),o=a.focusedElem,l=a.selectionRange;if(s!==o&&o&&o.ownerDocument&&X7(o.ownerDocument.documentElement,o)){if(l!==null&&AN(o)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var f=o.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var d=h.getSelection(),g=o.textContent.length,b=Math.min(l.start,g),y=l.end===void 0?b:Math.min(l.end,g);!d.extend&&b>y&&(s=y,y=b,b=s);var p=pF(o,b),x=pF(o,y);if(p&&x&&(d.rangeCount!==1||d.anchorNode!==p.node||d.anchorOffset!==p.offset||d.focusNode!==x.node||d.focusOffset!==x.offset)){var _=f.createRange();_.setStart(p.node,p.offset),d.removeAllRanges(),b>y?(d.addRange(_),d.extend(x.node,x.offset)):(_.setEnd(x.node,x.offset),d.addRange(_))}}}}for(f=[],d=o;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<f.length;o++){var w=f[o];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}t2=!!uO,fO=uO=null}finally{dr=r,ir.p=i,Fn.T=n}}t.current=e,Ts=2}}function Cq(){if(Ts===2){Ts=0;var t=Ad,e=B0,n=(e.flags&8772)!==0;if(e.subtreeFlags&8772||n){n=Fn.T,Fn.T=null;var i=ir.p;ir.p=2;var r=dr;dr|=4;try{lq(t,e.alternate,e)}finally{dr=r,ir.p=i,Fn.T=n}}Ts=3}}function Rq(){if(Ts===4||Ts===3){Ts=0,Yre();var t=Ad,e=B0,n=d0,i=yq;e.subtreeFlags&10256||e.flags&10256?Ts=5:(Ts=0,B0=Ad=null,kq(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Td=null),xN(n),e=e.stateNode,vl&&typeof vl.onCommitFiberRoot=="function")try{vl.onCommitFiberRoot(c_,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Fn.T,r=ir.p,ir.p=2,Fn.T=null;try{for(var a=t.onRecoverableError,s=0;s<i.length;s++){var o=i[s];a(o.value,{componentStack:o.stack})}}finally{Fn.T=e,ir.p=r}}d0&3&&KT(),cf(t),r=t.pendingLanes,n&4194090&&r&42?t===sO?Xx++:(Xx=0,sO=t):Xx=0,__(0)}}function kq(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,g_(e)))}function KT(t){return Aq(),Cq(),Rq(),Dq()}function Dq(){if(Ts!==5)return!1;var t=Ad,e=rO;rO=0;var n=xN(d0),i=Fn.T,r=ir.p;try{ir.p=32>n?32:n,Fn.T=null,n=aO,aO=null;var a=Ad,s=d0;if(Ts=0,B0=Ad=null,d0=0,dr&6)throw Error(It(331));var o=dr;if(dr|=4,bq(a.current),pq(a,a.current,s,n),dr=o,__(0,!1),vl&&typeof vl.onPostCommitFiberRoot=="function")try{vl.onPostCommitFiberRoot(c_,a)}catch{}return!0}finally{ir.p=r,Fn.T=i,kq(t,e)}}function KF(t,e,n){e=cc(n,e),e=Q8(t.stateNode,e,2),t=Md(t,e,2),t!==null&&(f_(t,2),cf(t))}function wr(t,e,n){if(t.tag===3)KF(t,t,n);else for(;e!==null;){if(e.tag===3){KF(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Td===null||!Td.has(i))){t=cc(n,t),n=KW(2),i=Md(e,n,2),i!==null&&(YW(n,i,e,t),f_(i,2),cf(i));break}}e=e.return}}function E3(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new Sse;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(ZN=!0,r.add(n),t=Ase.bind(null,t,e,n),e.then(t,t))}function Ase(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Dr===t&&(zi&n)===n&&(ha===4||ha===3&&(zi&62914560)===zi&&300>Xu()-eL?!(dr&2)&&z0(t,0):QN|=n,F0===zi&&(F0=0)),cf(t)}function Oq(t,e){e===0&&(e=A7()),t=Sv(t,e),t!==null&&(f_(t,e),cf(t))}function Cse(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Oq(t,n)}function Rse(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(It(314))}i!==null&&i.delete(e),Oq(t,n)}function kse(t,e){return vN(t,e)}var KM=null,Pb=null,lO=!1,YM=!1,M3=!1,Sm=0;function cf(t){t!==Pb&&t.next===null&&(Pb===null?KM=Pb=t:Pb=Pb.next=t),YM=!0,lO||(lO=!0,Ose())}function __(t,e){if(!M3&&YM){M3=!0;do for(var n=!1,i=KM;i!==null;){if(t!==0){var r=i.pendingLanes;if(r===0)var a=0;else{var s=i.suspendedLanes,o=i.pingedLanes;a=(1<<31-yl(42|t)+1)-1,a&=r&~(s&~o),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,YF(i,a))}else a=zi,a=PT(i,i===Dr?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(a&3)||u_(i,a)||(n=!0,YF(i,a));i=i.next}while(n);M3=!1}}function Dse(){Iq()}function Iq(){YM=lO=!1;var t=0;Sm!==0&&(zse()&&(t=Sm),Sm=0);for(var e=Xu(),n=null,i=KM;i!==null;){var r=i.next,a=Nq(i,e);a===0?(i.next=null,n===null?KM=r:n.next=r,r===null&&(Pb=n)):(n=i,(t!==0||a&3)&&(YM=!0)),i=r}__(t)}function Nq(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,a=t.pendingLanes&-62914561;0<a;){var s=31-yl(a),o=1<<s,l=r[s];l===-1?(!(o&n)||o&i)&&(r[s]=iae(o,e)):l<=e&&(t.expiredLanes|=o),a&=~o}if(e=Dr,n=zi,n=PT(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(hr===2||hr===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&$R(i),t.callbackNode=null,t.callbackPriority=0;if(!(n&3)||u_(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&$R(i),xN(n)){case 2:case 8:n=E7;break;case 32:n=kM;break;case 268435456:n=M7;break;default:n=kM}return i=Lq.bind(null,t),n=vN(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&$R(i),t.callbackPriority=2,t.callbackNode=null,2}function Lq(t,e){if(Ts!==0&&Ts!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(KT()&&t.callbackNode!==n)return null;var i=zi;return i=PT(t,t===Dr?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(_q(t,i,e),Nq(t,Xu()),t.callbackNode!=null&&t.callbackNode===n?Lq.bind(null,t):null)}function YF(t,e){if(KT())return null;_q(t,e,!0)}function Ose(){Hse(function(){dr&6?vN(w7,Dse):Iq()})}function nL(){return Sm===0&&(Sm=T7()),Sm}function JF(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:qE(""+t)}function $F(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function Ise(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var a=JF((r[Vo]||null).action),s=i.submitter;s&&(e=(e=s[Vo]||null)?JF(e.formAction):s.getAttribute("formAction"),e!==null&&(a=e,s=null));var o=new UT("action","action",null,i,r);t.push({event:o,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Sm!==0){var l=s?$F(r,s):new FormData(r);$8(n,{pending:!0,data:l,method:r.method,action:a},null,l)}}else typeof a=="function"&&(o.preventDefault(),l=s?$F(r,s):new FormData(r),$8(n,{pending:!0,data:l,method:r.method,action:a},a,l))},currentTarget:r}]})}}for(var T3=0;T3<B8.length;T3++){var A3=B8[T3],Nse=A3.toLowerCase(),Lse=A3[0].toUpperCase()+A3.slice(1);vu(Nse,"on"+Lse)}vu(J7,"onAnimationEnd");vu($7,"onAnimationIteration");vu(Z7,"onAnimationStart");vu("dblclick","onDoubleClick");vu("focusin","onFocus");vu("focusout","onBlur");vu(Zae,"onTransitionRun");vu(Qae,"onTransitionStart");vu(ese,"onTransitionCancel");vu(Q7,"onTransitionEnd");O0("onMouseEnter",["mouseout","mouseover"]);O0("onMouseLeave",["mouseout","mouseover"]);O0("onPointerEnter",["pointerout","pointerover"]);O0("onPointerLeave",["pointerout","pointerover"]);$m("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$m("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$m("onBeforeInput",["compositionend","keypress","textInput","paste"]);$m("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$m("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$m("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var M1="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Pse=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(M1));function Pq(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var a=void 0;if(e)for(var s=i.length-1;0<=s;s--){var o=i[s],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=c;try{a(r)}catch(u){HM(u)}r.currentTarget=null,a=l}else for(s=0;s<i.length;s++){if(o=i[s],l=o.instance,c=o.currentTarget,o=o.listener,l!==a&&r.isPropagationStopped())break e;a=o,r.currentTarget=c;try{a(r)}catch(u){HM(u)}r.currentTarget=null,a=l}}}}function Ai(t,e){var n=e[O8];n===void 0&&(n=e[O8]=new Set);var i=t+"__bubble";n.has(i)||(Uq(e,t,2,!1),n.add(i))}function C3(t,e,n){var i=0;e&&(i|=4),Uq(n,t,i,e)}var XS="_reactListening"+Math.random().toString(36).slice(2);function iL(t){if(!t[XS]){t[XS]=!0,D7.forEach(function(n){n!=="selectionchange"&&(Pse.has(n)||C3(n,!1,t),C3(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[XS]||(e[XS]=!0,C3("selectionchange",!1,e))}}function Uq(t,e,n,i){switch(Yq(e)){case 2:var r=coe;break;case 8:r=uoe;break;default:r=oL}n=r.bind(null,e,n,t),r=void 0,!P8||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function R3(t,e,n,i,r){var a=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var o=i.stateNode.containerInfo;if(o===r)break;if(s===4)for(s=i.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===r)return;s=s.return}for(;o!==null;){if(s=Gb(o),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){i=a=s;continue e}o=o.parentNode}}i=i.return}B7(function(){var c=a,u=wN(n),f=[];e:{var h=eW.get(t);if(h!==void 0){var d=UT,g=t;switch(t){case"keypress":if(KE(n)===0)break e;case"keydown":case"keyup":d=kae;break;case"focusin":g="focus",d=a3;break;case"focusout":g="blur",d=a3;break;case"beforeblur":case"afterblur":d=a3;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=rF;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=vae;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=Iae;break;case J7:case $7:case Z7:d=_ae;break;case Q7:d=Lae;break;case"scroll":case"scrollend":d=gae;break;case"wheel":d=Uae;break;case"copy":case"cut":case"paste":d=wae;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=sF;break;case"toggle":case"beforetoggle":d=Bae}var b=(e&4)!==0,y=!b&&(t==="scroll"||t==="scrollend"),p=b?h!==null?h+"Capture":null:h;b=[];for(var x=c,_;x!==null;){var w=x;if(_=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||_===null||p===null||(w=y1(x,p),w!=null&&b.push(T1(x,w,_))),y)break;x=x.return}0<b.length&&(h=new d(h,g,null,n,u),f.push({event:h,listeners:b}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",h&&n!==L8&&(g=n.relatedTarget||n.fromElement)&&(Gb(g)||g[xv]))break e;if((d||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,d?(g=n.relatedTarget||n.toElement,d=c,g=g?Gb(g):null,g!==null&&(y=l_(g),b=g.tag,g!==y||b!==5&&b!==27&&b!==6)&&(g=null)):(d=null,g=c),d!==g)){if(b=rF,w="onMouseLeave",p="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(b=sF,w="onPointerLeave",p="onPointerEnter",x="pointer"),y=d==null?h:xx(d),_=g==null?h:xx(g),h=new b(w,x+"leave",d,n,u),h.target=y,h.relatedTarget=_,w=null,Gb(u)===c&&(b=new b(p,x+"enter",g,n,u),b.target=_,b.relatedTarget=y,w=b),y=w,d&&g)t:{for(b=d,p=g,x=0,_=b;_;_=zg(_))x++;for(_=0,w=p;w;w=zg(w))_++;for(;0<x-_;)b=zg(b),x--;for(;0<_-x;)p=zg(p),_--;for(;x--;){if(b===p||p!==null&&b===p.alternate)break t;b=zg(b),p=zg(p)}b=null}else b=null;d!==null&&ZF(f,h,d,b,!1),g!==null&&y!==null&&ZF(f,y,g,b,!0)}}e:{if(h=c?xx(c):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var M=uF;else if(cF(h))if(W7)M=Yae;else{M=Xae;var S=qae}else d=h.nodeName,!d||d.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&SN(c.elementType)&&(M=uF):M=Kae;if(M&&(M=M(t,c))){G7(f,M,n,u);break e}S&&S(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&N8(h,"number",h.value)}switch(S=c?xx(c):window,t){case"focusin":(cF(S)||S.contentEditable==="true")&&(Xb=S,U8=c,Ux=null);break;case"focusout":Ux=U8=Xb=null;break;case"mousedown":F8=!0;break;case"contextmenu":case"mouseup":case"dragend":F8=!1,mF(f,n,u);break;case"selectionchange":if($ae)break;case"keydown":case"keyup":mF(f,n,u)}var A;if(TN)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else qb?H7(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(j7&&n.locale!=="ko"&&(qb||C!=="onCompositionStart"?C==="onCompositionEnd"&&qb&&(A=z7()):(bd=u,EN="value"in bd?bd.value:bd.textContent,qb=!0)),S=JM(c,C),0<S.length&&(C=new aF(C,t,null,n,u),f.push({event:C,listeners:S}),A?C.data=A:(A=V7(n),A!==null&&(C.data=A)))),(A=jae?Hae(t,n):Vae(t,n))&&(C=JM(c,"onBeforeInput"),0<C.length&&(S=new aF("onBeforeInput","beforeinput",null,n,u),f.push({event:S,listeners:C}),S.data=A)),Ise(f,t,c,n,u)}Pq(f,e)})}function T1(t,e,n){return{instance:t,listener:e,currentTarget:n}}function JM(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=y1(t,n),r!=null&&i.unshift(T1(t,r,a)),r=y1(t,e),r!=null&&i.push(T1(t,r,a))),t.tag===3)return i;t=t.return}return[]}function zg(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ZF(t,e,n,i,r){for(var a=e._reactName,s=[];n!==null&&n!==i;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===i)break;o!==5&&o!==26&&o!==27||c===null||(l=c,r?(c=y1(n,a),c!=null&&s.unshift(T1(n,c,l))):r||(c=y1(n,a),c!=null&&s.push(T1(n,c,l)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var Use=/\r\n?/g,Fse=/\u0000|\uFFFD/g;function QF(t){return(typeof t=="string"?t:""+t).replace(Use,`
`).replace(Fse,"")}function Fq(t,e){return e=QF(e),QF(t)===e}function YT(){}function gr(t,e,n,i,r,a){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||I0(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&I0(t,""+i);break;case"className":zS(t,"class",i);break;case"tabIndex":zS(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":zS(t,n,i);break;case"style":F7(t,i,a);break;case"data":if(e!=="object"){zS(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=qE(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof a=="function"&&(n==="formAction"?(e!=="input"&&gr(t,e,"name",r.name,r,null),gr(t,e,"formEncType",r.formEncType,r,null),gr(t,e,"formMethod",r.formMethod,r,null),gr(t,e,"formTarget",r.formTarget,r,null)):(gr(t,e,"encType",r.encType,r,null),gr(t,e,"method",r.method,r,null),gr(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=qE(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=YT);break;case"onScroll":i!=null&&Ai("scroll",t);break;case"onScrollEnd":i!=null&&Ai("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(It(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(It(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=qE(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":Ai("beforetoggle",t),Ai("toggle",t),WE(t,"popover",i);break;case"xlinkActuate":Cf(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Cf(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Cf(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Cf(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Cf(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Cf(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Cf(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Cf(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Cf(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":WE(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=pae.get(n)||n,WE(t,n,i))}}function cO(t,e,n,i,r,a){switch(n){case"style":F7(t,i,a);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(It(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(It(60));t.innerHTML=n}}break;case"children":typeof i=="string"?I0(t,i):(typeof i=="number"||typeof i=="bigint")&&I0(t,""+i);break;case"onScroll":i!=null&&Ai("scroll",t);break;case"onScrollEnd":i!=null&&Ai("scrollend",t);break;case"onClick":i!=null&&(t.onclick=YT);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!O7.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),a=t[Vo]||null,a=a!=null?a[n]:null,typeof a=="function"&&t.removeEventListener(e,a,r),typeof i=="function")){typeof a!="function"&&a!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):WE(t,n,i)}}}function Rs(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ai("error",t),Ai("load",t);var i=!1,r=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(It(137,e));default:gr(t,e,a,s,n,null)}}r&&gr(t,e,"srcSet",n.srcSet,n,null),i&&gr(t,e,"src",n.src,n,null);return;case"input":Ai("invalid",t);var o=a=s=r=null,l=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":s=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":a=u;break;case"defaultValue":o=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(It(137,e));break;default:gr(t,e,i,u,n,null)}}L7(t,a,o,l,c,s,r,!1),DM(t);return;case"select":Ai("invalid",t),i=s=a=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":a=o;break;case"defaultValue":s=o;break;case"multiple":i=o;default:gr(t,e,r,o,n,null)}e=a,n=s,t.multiple=!!i,e!=null?o0(t,!!i,e,!1):n!=null&&o0(t,!!i,n,!0);return;case"textarea":Ai("invalid",t),a=r=i=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":i=o;break;case"defaultValue":r=o;break;case"children":a=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(It(91));break;default:gr(t,e,s,o,n,null)}U7(t,i,r,a),DM(t);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(i=n[l],i!=null))switch(l){case"selected":t.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:gr(t,e,l,i,n,null)}return;case"dialog":Ai("beforetoggle",t),Ai("toggle",t),Ai("cancel",t),Ai("close",t);break;case"iframe":case"object":Ai("load",t);break;case"video":case"audio":for(i=0;i<M1.length;i++)Ai(M1[i],t);break;case"image":Ai("error",t),Ai("load",t);break;case"details":Ai("toggle",t);break;case"embed":case"source":case"link":Ai("error",t),Ai("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(It(137,e));default:gr(t,e,c,i,n,null)}return;default:if(SN(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&cO(t,e,u,i,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(i=n[o],i!=null&&gr(t,e,o,i,n,null))}function Bse(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,s=null,o=null,l=null,c=null,u=null;for(d in n){var f=n[d];if(n.hasOwnProperty(d)&&f!=null)switch(d){case"checked":break;case"value":break;case"defaultValue":l=f;default:i.hasOwnProperty(d)||gr(t,e,d,null,i,f)}}for(var h in i){var d=i[h];if(f=n[h],i.hasOwnProperty(h)&&(d!=null||f!=null))switch(h){case"type":a=d;break;case"name":r=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":s=d;break;case"defaultValue":o=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(It(137,e));break;default:d!==f&&gr(t,e,h,d,i,f)}}I8(t,s,o,l,c,u,a,r);return;case"select":d=s=o=h=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":d=l;default:i.hasOwnProperty(a)||gr(t,e,a,null,i,l)}for(r in i)if(a=i[r],l=n[r],i.hasOwnProperty(r)&&(a!=null||l!=null))switch(r){case"value":h=a;break;case"defaultValue":o=a;break;case"multiple":s=a;default:a!==l&&gr(t,e,r,a,i,l)}e=o,n=s,i=d,h!=null?o0(t,!!n,h,!1):!!i!=!!n&&(e!=null?o0(t,!!n,e,!0):o0(t,!!n,n?[]:"",!1));return;case"textarea":d=h=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!i.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:gr(t,e,o,null,i,r)}for(s in i)if(r=i[s],a=n[s],i.hasOwnProperty(s)&&(r!=null||a!=null))switch(s){case"value":h=r;break;case"defaultValue":d=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(It(91));break;default:r!==a&&gr(t,e,s,r,i,a)}P7(t,h,d);return;case"option":for(var g in n)if(h=n[g],n.hasOwnProperty(g)&&h!=null&&!i.hasOwnProperty(g))switch(g){case"selected":t.selected=!1;break;default:gr(t,e,g,null,i,h)}for(l in i)if(h=i[l],d=n[l],i.hasOwnProperty(l)&&h!==d&&(h!=null||d!=null))switch(l){case"selected":t.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:gr(t,e,l,h,i,d)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!=null&&!i.hasOwnProperty(b)&&gr(t,e,b,null,i,h);for(c in i)if(h=i[c],d=n[c],i.hasOwnProperty(c)&&h!==d&&(h!=null||d!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(It(137,e));break;default:gr(t,e,c,h,i,d)}return;default:if(SN(e)){for(var y in n)h=n[y],n.hasOwnProperty(y)&&h!==void 0&&!i.hasOwnProperty(y)&&cO(t,e,y,void 0,i,h);for(u in i)h=i[u],d=n[u],!i.hasOwnProperty(u)||h===d||h===void 0&&d===void 0||cO(t,e,u,h,i,d);return}}for(var p in n)h=n[p],n.hasOwnProperty(p)&&h!=null&&!i.hasOwnProperty(p)&&gr(t,e,p,null,i,h);for(f in i)h=i[f],d=n[f],!i.hasOwnProperty(f)||h===d||h==null&&d==null||gr(t,e,f,h,i,d)}var uO=null,fO=null;function $M(t){return t.nodeType===9?t:t.ownerDocument}function eB(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Bq(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function hO(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var k3=null;function zse(){var t=window.event;return t&&t.type==="popstate"?t===k3?!1:(k3=t,!0):(k3=null,!1)}var zq=typeof setTimeout=="function"?setTimeout:void 0,jse=typeof clearTimeout=="function"?clearTimeout:void 0,tB=typeof Promise=="function"?Promise:void 0,Hse=typeof queueMicrotask=="function"?queueMicrotask:typeof tB<"u"?function(t){return tB.resolve(null).then(t).catch(Vse)}:zq;function Vse(t){setTimeout(function(){throw t})}function Vd(t){return t==="head"}function nB(t,e){var n=e,i=0,r=0;do{var a=n.nextSibling;if(t.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(0<i&&8>i){n=i;var s=t.ownerDocument;if(n&1&&Kx(s.documentElement),n&2&&Kx(s.body),n&4)for(n=s.head,Kx(n),s=n.firstChild;s;){var o=s.nextSibling,l=s.nodeName;s[h_]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=o}}if(r===0){t.removeChild(a),D1(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=a}while(n);D1(e)}function dO(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":dO(n),_N(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function Gse(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[h_])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(a=t.getAttribute("rel"),a==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(a!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(a=t.getAttribute("src"),(a!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===a)return t}else return t;if(t=fu(t.nextSibling),t===null)break}return null}function Wse(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=fu(t.nextSibling),t===null))return null;return t}function pO(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function qse(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function fu(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var mO=null;function iB(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}function jq(t,e,n){switch(e=$M(n),t){case"html":if(t=e.documentElement,!t)throw Error(It(452));return t;case"head":if(t=e.head,!t)throw Error(It(453));return t;case"body":if(t=e.body,!t)throw Error(It(454));return t;default:throw Error(It(451))}}function Kx(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);_N(t)}var xc=new Map,rB=new Set;function ZM(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var vh=ir.d;ir.d={f:Xse,r:Kse,D:Yse,C:Jse,L:$se,m:Zse,X:eoe,S:Qse,M:toe};function Xse(){var t=vh.f(),e=qT();return t||e}function Kse(t){var e=_v(t);e!==null&&e.tag===5&&e.type==="form"?NW(e):vh.r(t)}var Ev=typeof document>"u"?null:document;function Hq(t,e,n){var i=Ev;if(i&&typeof e=="string"&&e){var r=lc(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),rB.has(r)||(rB.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),Rs(e,"link",t),Qa(e),i.head.appendChild(e)))}}function Yse(t){vh.D(t),Hq("dns-prefetch",t,null)}function Jse(t,e){vh.C(t,e),Hq("preconnect",t,e)}function $se(t,e,n){vh.L(t,e,n);var i=Ev;if(i&&t&&e){var r='link[rel="preload"][as="'+lc(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+lc(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+lc(n.imageSizes)+'"]')):r+='[href="'+lc(t)+'"]';var a=r;switch(e){case"style":a=j0(t);break;case"script":a=Mv(t)}xc.has(a)||(t=jr({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),xc.set(a,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(S_(a))||e==="script"&&i.querySelector(w_(a))||(e=i.createElement("link"),Rs(e,"link",t),Qa(e),i.head.appendChild(e)))}}function Zse(t,e){vh.m(t,e);var n=Ev;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+lc(i)+'"][href="'+lc(t)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Mv(t)}if(!xc.has(a)&&(t=jr({rel:"modulepreload",href:t},e),xc.set(a,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(w_(a)))return}i=n.createElement("link"),Rs(i,"link",t),Qa(i),n.head.appendChild(i)}}}function Qse(t,e,n){vh.S(t,e,n);var i=Ev;if(i&&t){var r=s0(i).hoistableStyles,a=j0(t);e=e||"default";var s=r.get(a);if(!s){var o={loading:0,preload:null};if(s=i.querySelector(S_(a)))o.loading=5;else{t=jr({rel:"stylesheet",href:t,"data-precedence":e},n),(n=xc.get(a))&&rL(t,n);var l=s=i.createElement("link");Qa(l),Rs(l,"link",t),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,tM(s,e,i)}s={type:"stylesheet",instance:s,count:1,state:o},r.set(a,s)}}}function eoe(t,e){vh.X(t,e);var n=Ev;if(n&&t){var i=s0(n).hoistableScripts,r=Mv(t),a=i.get(r);a||(a=n.querySelector(w_(r)),a||(t=jr({src:t,async:!0},e),(e=xc.get(r))&&aL(t,e),a=n.createElement("script"),Qa(a),Rs(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function toe(t,e){vh.M(t,e);var n=Ev;if(n&&t){var i=s0(n).hoistableScripts,r=Mv(t),a=i.get(r);a||(a=n.querySelector(w_(r)),a||(t=jr({src:t,async:!0,type:"module"},e),(e=xc.get(r))&&aL(t,e),a=n.createElement("script"),Qa(a),Rs(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function aB(t,e,n,i){var r=(r=wd.current)?ZM(r):null;if(!r)throw Error(It(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=j0(n.href),n=s0(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=j0(n.href);var a=s0(r).hoistableStyles,s=a.get(t);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,s),(a=r.querySelector(S_(t)))&&!a._p&&(s.instance=a,s.state.loading=5),xc.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xc.set(t,n),a||noe(r,t,n,s.state))),e&&i===null)throw Error(It(528,""));return s}if(e&&i!==null)throw Error(It(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Mv(n),n=s0(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(It(444,t))}}function j0(t){return'href="'+lc(t)+'"'}function S_(t){return'link[rel="stylesheet"]['+t+"]"}function Vq(t){return jr({},t,{"data-precedence":t.precedence,precedence:null})}function noe(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),Rs(e,"link",n),Qa(e),t.head.appendChild(e))}function Mv(t){return'[src="'+lc(t)+'"]'}function w_(t){return"script[async]"+t}function sB(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+lc(n.href)+'"]');if(i)return e.instance=i,Qa(i),i;var r=jr({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),Qa(i),Rs(i,"style",r),tM(i,n.precedence,t),e.instance=i;case"stylesheet":r=j0(n.href);var a=t.querySelector(S_(r));if(a)return e.state.loading|=4,e.instance=a,Qa(a),a;i=Vq(n),(r=xc.get(r))&&rL(i,r),a=(t.ownerDocument||t).createElement("link"),Qa(a);var s=a;return s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),Rs(a,"link",i),e.state.loading|=4,tM(a,n.precedence,t),e.instance=a;case"script":return a=Mv(n.src),(r=t.querySelector(w_(a)))?(e.instance=r,Qa(r),r):(i=n,(r=xc.get(a))&&(i=jr({},n),aL(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),Qa(r),Rs(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(It(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(i=e.instance,e.state.loading|=4,tM(i,n.precedence,t));return e.instance}function tM(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,a=r,s=0;s<i.length;s++){var o=i[s];if(o.dataset.precedence===e)a=o;else if(a!==r)break}a?a.parentNode.insertBefore(t,a.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function rL(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function aL(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var nM=null;function oB(t,e,n){if(nM===null){var i=new Map,r=nM=new Map;r.set(n,i)}else r=nM,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var a=n[r];if(!(a[h_]||a[to]||t==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var s=a.getAttribute(e)||"";s=t+s;var o=i.get(s);o?o.push(a):i.set(s,[a])}}return i}function lB(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function ioe(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Gq(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}var A1=null;function roe(){}function aoe(t,e,n){if(A1===null)throw Error(It(475));var i=A1;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var r=j0(n.href),a=t.querySelector(S_(r));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(i.count++,i=QM.bind(i),t.then(i,i)),e.state.loading|=4,e.instance=a,Qa(a);return}a=t.ownerDocument||t,n=Vq(n),(r=xc.get(r))&&rL(n,r),a=a.createElement("link"),Qa(a);var s=a;s._p=new Promise(function(o,l){s.onload=o,s.onerror=l}),Rs(a,"link",n),e.instance=a}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(e,t),(t=e.state.preload)&&!(e.state.loading&3)&&(i.count++,e=QM.bind(i),t.addEventListener("load",e),t.addEventListener("error",e))}}function soe(){if(A1===null)throw Error(It(475));var t=A1;return t.stylesheets&&t.count===0&&gO(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&gO(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function QM(){if(this.count--,this.count===0){if(this.stylesheets)gO(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var e2=null;function gO(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,e2=new Map,e.forEach(ooe,t),e2=null,QM.call(t))}function ooe(t,e){if(!(e.state.loading&4)){var n=e2.get(t);if(n)var i=n.get(null);else{n=new Map,e2.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var s=r[a];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),i=s)}i&&n.set(null,i)}r=e.instance,s=r.getAttribute("data-precedence"),a=n.get(s)||i,a===i&&n.set(null,r),n.set(s,r),this.count++,i=QM.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),a?a.parentNode.insertBefore(r,a.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var C1={$$typeof:Vf,Provider:null,Consumer:null,_currentValue:gm,_currentValue2:gm,_threadCount:0};function loe(t,e,n,i,r,a,s,o){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ZR(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ZR(0),this.hiddenUpdates=ZR(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Wq(t,e,n,i,r,a,s,o,l,c,u,f){return t=new loe(t,e,n,s,o,l,c,f),e=1,a===!0&&(e|=24),a=pl(3,null,null,e),t.current=a,a.stateNode=t,e=IN(),e.refCount++,t.pooledCache=e,e.refCount++,a.memoizedState={element:i,isDehydrated:n,cache:e},LN(a),t}function qq(t){return t?(t=Jb,t):Jb}function Xq(t,e,n,i,r,a){r=qq(r),i.context===null?i.context=r:i.pendingContext=r,i=Ed(e),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=Md(t,i,e),n!==null&&(_l(n,t,e),zx(n,t,e))}function cB(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function sL(t,e){cB(t,e),(t=t.alternate)&&cB(t,e)}function Kq(t){if(t.tag===13){var e=Sv(t,67108864);e!==null&&_l(e,t,67108864),sL(t,67108864)}}var t2=!0;function coe(t,e,n,i){var r=Fn.T;Fn.T=null;var a=ir.p;try{ir.p=2,oL(t,e,n,i)}finally{ir.p=a,Fn.T=r}}function uoe(t,e,n,i){var r=Fn.T;Fn.T=null;var a=ir.p;try{ir.p=8,oL(t,e,n,i)}finally{ir.p=a,Fn.T=r}}function oL(t,e,n,i){if(t2){var r=bO(i);if(r===null)R3(t,e,i,n2,n),uB(t,i);else if(hoe(r,t,e,n,i))i.stopPropagation();else if(uB(t,i),e&4&&-1<foe.indexOf(t)){for(;r!==null;){var a=_v(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=jp(a.pendingLanes);if(s!==0){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-yl(s);o.entanglements[1]|=l,s&=~l}cf(a),!(dr&6)&&(qM=Xu()+500,__(0))}}break;case 13:o=Sv(a,2),o!==null&&_l(o,a,2),qT(),sL(a,2)}if(a=bO(i),a===null&&R3(t,e,i,n2,n),a===r)break;r=a}r!==null&&i.stopPropagation()}else R3(t,e,i,null,n)}}function bO(t){return t=wN(t),lL(t)}var n2=null;function lL(t){if(n2=null,t=Gb(t),t!==null){var e=l_(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=y7(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return n2=t,null}function Yq(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Jre()){case w7:return 2;case E7:return 8;case kM:case $re:return 32;case M7:return 268435456;default:return 32}default:return 32}}var vO=!1,Cd=null,Rd=null,kd=null,R1=new Map,k1=new Map,hd=[],foe="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function uB(t,e){switch(t){case"focusin":case"focusout":Cd=null;break;case"dragenter":case"dragleave":Rd=null;break;case"mouseover":case"mouseout":kd=null;break;case"pointerover":case"pointerout":R1.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":k1.delete(e.pointerId)}}function Dy(t,e,n,i,r,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:a,targetContainers:[r]},e!==null&&(e=_v(e),e!==null&&Kq(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function hoe(t,e,n,i,r){switch(e){case"focusin":return Cd=Dy(Cd,t,e,n,i,r),!0;case"dragenter":return Rd=Dy(Rd,t,e,n,i,r),!0;case"mouseover":return kd=Dy(kd,t,e,n,i,r),!0;case"pointerover":var a=r.pointerId;return R1.set(a,Dy(R1.get(a)||null,t,e,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,k1.set(a,Dy(k1.get(a)||null,t,e,n,i,r)),!0}return!1}function Jq(t){var e=Gb(t.target);if(e!==null){var n=l_(e);if(n!==null){if(e=n.tag,e===13){if(e=y7(n),e!==null){t.blockedOn=e,aae(t.priority,function(){if(n.tag===13){var i=xl();i=yN(i);var r=Sv(n,i);r!==null&&_l(r,n,i),sL(n,i)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function iM(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=bO(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);L8=i,n.target.dispatchEvent(i),L8=null}else return e=_v(n),e!==null&&Kq(e),t.blockedOn=n,!1;e.shift()}return!0}function fB(t,e,n){iM(t)&&n.delete(e)}function doe(){vO=!1,Cd!==null&&iM(Cd)&&(Cd=null),Rd!==null&&iM(Rd)&&(Rd=null),kd!==null&&iM(kd)&&(kd=null),R1.forEach(fB),k1.forEach(fB)}function KS(t,e){t.blockedOn===e&&(t.blockedOn=null,vO||(vO=!0,Fa.unstable_scheduleCallback(Fa.unstable_NormalPriority,doe)))}var YS=null;function hB(t){YS!==t&&(YS=t,Fa.unstable_scheduleCallback(Fa.unstable_NormalPriority,function(){YS===t&&(YS=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(lL(i||n)===null)continue;break}var a=_v(n);a!==null&&(t.splice(e,3),e-=3,$8(a,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function D1(t){function e(l){return KS(l,t)}Cd!==null&&KS(Cd,t),Rd!==null&&KS(Rd,t),kd!==null&&KS(kd,t),R1.forEach(e),k1.forEach(e);for(var n=0;n<hd.length;n++){var i=hd[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<hd.length&&(n=hd[0],n.blockedOn===null);)Jq(n),n.blockedOn===null&&hd.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],a=n[i+1],s=r[Vo]||null;if(typeof a=="function")s||hB(n);else if(s){var o=null;if(a&&a.hasAttribute("formAction")){if(r=a,s=a[Vo]||null)o=s.formAction;else if(lL(r)!==null)continue}else o=s.action;typeof o=="function"?n[i+1]=o:(n.splice(i,3),i-=3),hB(n)}}}function cL(t){this._internalRoot=t}JT.prototype.render=cL.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(It(409));var n=e.current,i=xl();Xq(n,i,t,e,null,null)};JT.prototype.unmount=cL.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Xq(t.current,2,null,t,null,null),qT(),e[xv]=null}};function JT(t){this._internalRoot=t}JT.prototype.unstable_scheduleHydration=function(t){if(t){var e=k7();t={blockedOn:null,target:t,priority:e};for(var n=0;n<hd.length&&e!==0&&e<hd[n].priority;n++);hd.splice(n,0,t),n===0&&Jq(t)}};var dB=b7.version;if(dB!=="19.1.1")throw Error(It(527,dB,"19.1.1"));ir.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(It(188)):(t=Object.keys(t).join(","),Error(It(268,t)));return t=Vre(e),t=t!==null?x7(t):null,t=t===null?null:t.stateNode,t};var poe={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:Fn,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var JS=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!JS.isDisabled&&JS.supportsFiber)try{c_=JS.inject(poe),vl=JS}catch{}}NT.createRoot=function(t,e){if(!v7(t))throw Error(It(299));var n=!1,i="",r=WW,a=qW,s=XW,o=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(a=e.onCaughtError),e.onRecoverableError!==void 0&&(s=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(o=e.unstable_transitionCallbacks)),e=Wq(t,1,!1,null,null,n,i,r,a,s,o,null),t[xv]=e.current,iL(t),new cL(e)};NT.hydrateRoot=function(t,e,n){if(!v7(t))throw Error(It(299));var i=!1,r="",a=WW,s=qW,o=XW,l=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(l=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),e=Wq(t,1,!0,e,n??null,i,r,a,s,o,l,c),e.context=qq(null),n=e.current,i=xl(),i=yN(i),r=Ed(i),r.callback=null,Md(n,r,i),n=i,e.current.lanes=n,f_(e,n),cf(e),t[xv]=e.current,iL(t),new JT(e)};NT.version="19.1.1";function $q(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($q)}catch(t){console.error(t)}}$q(),i7.exports=NT;var Zq=i7.exports;const moe=Mc(Zq);var yO=new Map,$S=new WeakMap,pB=0,goe=void 0;function boe(t){return t?($S.has(t)||(pB+=1,$S.set(t,pB.toString())),$S.get(t)):"0"}function voe(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?boe(t.root):t[e]}`).toString()}function yoe(t){const e=voe(t);let n=yO.get(e);if(!n){const i=new Map;let r;const a=new IntersectionObserver(s=>{s.forEach(o=>{var l;const c=o.isIntersecting&&r.some(u=>o.intersectionRatio>=u);t.trackVisibility&&typeof o.isVisible>"u"&&(o.isVisible=c),(l=i.get(o.target))==null||l.forEach(u=>{u(c,o)})})},t);r=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:i},yO.set(e,n)}return n}function xoe(t,e,n={},i=goe){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const l=t.getBoundingClientRect();return e(i,{isIntersecting:i,target:t,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:r,observer:a,elements:s}=yoe(n),o=s.get(t)||[];return s.has(t)||s.set(t,o),o.push(e),a.observe(t),function(){o.splice(o.indexOf(e),1),o.length===0&&(s.delete(t),a.unobserve(t)),s.size===0&&(a.disconnect(),yO.delete(r))}}function _oe({threshold:t,delay:e,trackVisibility:n,rootMargin:i,root:r,triggerOnce:a,skip:s,initialInView:o,fallbackInView:l,onChange:c}={}){var u;const[f,h]=I.useState(null),d=I.useRef(c),[g,b]=I.useState({inView:!!o,entry:void 0});d.current=c,I.useEffect(()=>{if(s||!f)return;let _;return _=xoe(f,(w,M)=>{b({inView:w,entry:M}),d.current&&d.current(w,M),M.isIntersecting&&a&&_&&(_(),_=void 0)},{root:r,rootMargin:i,threshold:t,trackVisibility:n,delay:e},l),()=>{_&&_()}},[Array.isArray(t)?t.toString():t,f,r,i,a,s,n,l,e]);const y=(u=g.entry)==null?void 0:u.target,p=I.useRef(void 0);!f&&y&&!a&&!s&&p.current!==y&&(p.current=y,b({inView:!!o,entry:void 0}));const x=[h,g.inView,g.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}function dc(t,e,n){return e===void 0&&n===void 0?t:e!==void 0&&n===void 0?Math.max(t,e):Math.min(e===void 0&&n!==void 0?t:Math.max(t,e),n)}function Qq(t="mantine-"){return`${t}${Math.random().toString(36).slice(2,11)}`}function Jp(t){const e=I.useRef(t);return I.useEffect(()=>{e.current=t}),I.useMemo(()=>(...n)=>e.current?.(...n),[])}function $T(t,e){const{delay:n,flushOnUnmount:i,leading:r}=typeof e=="number"?{delay:e,flushOnUnmount:!1,leading:!1}:e,a=Jp(t),s=I.useRef(0),o=I.useMemo(()=>{const l=Object.assign((...c)=>{window.clearTimeout(s.current);const u=l._isFirstCall;l._isFirstCall=!1;function f(){window.clearTimeout(s.current),s.current=0,l._isFirstCall=!0}if(r&&u){a(...c);const g=()=>{f()},b=()=>{s.current!==0&&(f(),a(...c))},y=()=>{f()};l.flush=b,l.cancel=y,s.current=window.setTimeout(g,n);return}if(r&&!u){const g=()=>{s.current!==0&&(f(),a(...c))},b=()=>{f()};l.flush=g,l.cancel=b;const y=()=>{f()};s.current=window.setTimeout(y,n);return}const h=()=>{s.current!==0&&(f(),a(...c))},d=()=>{f()};l.flush=h,l.cancel=d,s.current=window.setTimeout(h,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return l},[a,n,r]);return I.useEffect(()=>()=>{i?o.flush():o.cancel()},[o,i]),o}const Soe=["mousedown","touchstart"];function woe(t,e,n){const i=I.useRef(null),r=e||Soe;return I.useEffect(()=>{const a=s=>{const{target:o}=s??{};if(Array.isArray(n)){const l=!document.body.contains(o)&&o?.tagName!=="HTML";n.every(u=>!!u&&!s.composedPath().includes(u))&&!l&&t(s)}else i.current&&!i.current.contains(o)&&t(s)};return r.forEach(s=>document.addEventListener(s,a)),()=>{r.forEach(s=>document.removeEventListener(s,a))}},[i,t,n]),i}function Eoe(t={timeout:2e3}){const[e,n]=I.useState(null),[i,r]=I.useState(!1),[a,s]=I.useState(null),o=u=>{window.clearTimeout(a),s(window.setTimeout(()=>r(!1),t.timeout)),r(u)};return{copy:u=>{"clipboard"in navigator?navigator.clipboard.writeText(u).then(()=>o(!0)).catch(f=>n(f)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{r(!1),n(null),window.clearTimeout(a)},error:e,copied:i}}function Moe(t,e){try{return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}catch{return t.addListener(e),()=>t.removeListener(e)}}function Toe(t,e){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(t).matches:!1}function uL(t,e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[i,r]=I.useState(n?e:Toe(t));return I.useEffect(()=>{try{const a=window.matchMedia(t);return r(a.matches),Moe(a,s=>r(s.matches))}catch{return}},[t]),i||!1}function Aoe(t,e){return uL("(prefers-color-scheme: dark)",t==="dark",e)?"dark":"light"}const Tv=typeof document<"u"?I.useLayoutEffect:I.useEffect;function vc(t,e){const n=I.useRef(!1);I.useEffect(()=>()=>{n.current=!1},[]),I.useEffect(()=>{if(n.current)return t();n.current=!0},e)}function eX({opened:t,shouldReturnFocus:e=!0}){const n=I.useRef(null),i=()=>{n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&n.current?.focus({preventScroll:!0})};return vc(()=>{let r=-1;const a=s=>{s.key==="Tab"&&window.clearTimeout(r)};return document.addEventListener("keydown",a),t?n.current=document.activeElement:e&&(r=window.setTimeout(i,10)),()=>{window.clearTimeout(r),document.removeEventListener("keydown",a)}},[t,e]),i}const Coe=/input|select|textarea|button|object/,tX="a, input, select, textarea, button, object, [tabindex]";function Roe(t){return t.style.display==="none"}function koe(t){if(t.getAttribute("aria-hidden")||t.getAttribute("hidden")||t.getAttribute("type")==="hidden")return!1;let n=t;for(;n&&!(n===document.body||n.nodeType===11);){if(Roe(n))return!1;n=n.parentNode}return!0}function nX(t){let e=t.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function xO(t){const e=t.nodeName.toLowerCase(),n=!Number.isNaN(nX(t));return(Coe.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||n)&&koe(t)}function iX(t){const e=nX(t);return(Number.isNaN(e)||e>=0)&&xO(t)}function Doe(t){return Array.from(t.querySelectorAll(tX)).filter(iX)}function Ooe(t,e){const n=Doe(t);if(!n.length){e.preventDefault();return}const i=n[e.shiftKey?0:n.length-1],r=t.getRootNode();let a=i===r.activeElement||t===r.activeElement;const s=r.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(a=n.filter(u=>u.getAttribute("type")==="radio"&&u.getAttribute("name")===s.getAttribute("name")).includes(i)),!a)return;e.preventDefault();const l=n[e.shiftKey?n.length-1:0];l&&l.focus()}function Ioe(t=!0){const e=I.useRef(null),n=r=>{let a=r.querySelector("[data-autofocus]");if(!a){const s=Array.from(r.querySelectorAll(tX));a=s.find(iX)||s.find(xO)||null,!a&&xO(r)&&(a=r)}a&&a.focus({preventScroll:!0})},i=I.useCallback(r=>{t&&r!==null&&e.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),e.current=r):e.current=null)},[t]);return I.useEffect(()=>{if(!t)return;e.current&&setTimeout(()=>n(e.current));const r=a=>{a.key==="Tab"&&e.current&&Ooe(e.current,a)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t]),i}const Noe=t=>(t+1)%1e6;function Loe(){const[,t]=I.useReducer(Noe,0);return t}const Poe=Ee.useId||(()=>{});function Uoe(){const t=Poe();return t?`mantine-${t.replace(/:/g,"")}`:""}function uf(t){const e=Uoe(),[n,i]=I.useState(e);return Tv(()=>{i(Qq())},[]),typeof t=="string"?t:typeof window>"u"?e:n}function Foe(t,e,n){I.useEffect(()=>(window.addEventListener(t,e,n),()=>window.removeEventListener(t,e,n)),[t,e])}function i2(t,e){if(typeof t=="function")return t(e);typeof t=="object"&&t!==null&&"current"in t&&(t.current=e)}function rX(...t){const e=new Map;return n=>{if(t.forEach(i=>{const r=i2(i,n);r&&e.set(i,r)}),e.size>0)return()=>{t.forEach(i=>{const r=e.get(i);r&&typeof r=="function"?r():i2(i,null)}),e.clear()}}}function Ps(...t){return I.useCallback(rX(...t),t)}function aX(t){return{x:dc(t.x,0,1),y:dc(t.y,0,1)}}function fL(t,e,n="ltr"){const i=I.useRef(!1),r=I.useRef(!1),a=I.useRef(0),[s,o]=I.useState(!1),l=I.useRef(null);return I.useEffect(()=>{i.current=!0},[]),{ref:I.useCallback(u=>{if(l.current&&(l.current(),l.current=null),!u)return;const f=({x:w,y:M})=>{cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{if(i.current&&u){u.style.userSelect="none";const S=u.getBoundingClientRect();if(S.width&&S.height){const A=dc((w-S.left)/S.width,0,1);t({x:n==="ltr"?A:1-A,y:dc((M-S.top)/S.height,0,1)})}}})},h=()=>{document.addEventListener("mousemove",p),document.addEventListener("mouseup",b),document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("touchend",b)},d=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",b),document.removeEventListener("touchmove",_),document.removeEventListener("touchend",b)},g=()=>{!r.current&&i.current&&(r.current=!0,typeof e?.onScrubStart=="function"&&e.onScrubStart(),o(!0),h())},b=()=>{r.current&&i.current&&(r.current=!1,o(!1),d(),setTimeout(()=>{typeof e?.onScrubEnd=="function"&&e.onScrubEnd()},0))},y=w=>{g(),w.preventDefault(),p(w)},p=w=>f({x:w.clientX,y:w.clientY}),x=w=>{w.cancelable&&w.preventDefault(),g(),_(w)},_=w=>{w.cancelable&&w.preventDefault(),f({x:w.changedTouches[0].clientX,y:w.changedTouches[0].clientY})};u.addEventListener("mousedown",y),u.addEventListener("touchstart",x,{passive:!1}),l.current=()=>{u.removeEventListener("mousedown",y),u.removeEventListener("touchstart",x)}},[n,t]),active:s}}function Al({value:t,defaultValue:e,finalValue:n,onChange:i=()=>{}}){const[r,a]=I.useState(e!==void 0?e:n),s=(o,...l)=>{a(o),i?.(o,...l)};return t!==void 0?[t,i,!0]:[r,s,!1]}function ZT(t,e){return uL("(prefers-reduced-motion: reduce)",t,e)}const Boe={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function zoe(t){const e=I.useRef(0),n=I.useRef(null),[i,r]=I.useState(Boe),a=I.useMemo(()=>typeof window<"u"?new ResizeObserver(s=>{const o=s[0];o&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{if(n.current){const l=o.borderBoxSize?.[0]||o.contentBoxSize?.[0];if(l){const c=l.inlineSize,u=l.blockSize;r({width:c,height:u,x:o.contentRect.x,y:o.contentRect.y,top:o.contentRect.top,left:o.contentRect.left,bottom:o.contentRect.bottom,right:o.contentRect.right})}else r(o.contentRect)}}))}):null,[]);return I.useEffect(()=>(n.current&&a?.observe(n.current,t),()=>{a?.disconnect(),e.current&&cancelAnimationFrame(e.current)}),[n.current]),[n,i]}function sX(t){const[e,{width:n,height:i}]=zoe(t);return{ref:e,width:n,height:i}}function _c(t=!1,e={}){const[n,i]=I.useState(t),r=I.useCallback(()=>{i(o=>o||(e.onOpen?.(),!0))},[e.onOpen]),a=I.useCallback(()=>{i(o=>o&&(e.onClose?.(),!1))},[e.onClose]),s=I.useCallback(()=>{n?a():r()},[a,r,n]);return[n,{open:r,close:a,toggle:s}]}function joe(t){const e=I.useRef(void 0);return I.useEffect(()=>{e.current=t},[t]),e.current}function Hoe(){const[t,e]=I.useState(!1);Tv(()=>{e(typeof window<"u"&&!Voe()&&"EyeDropper"in window)},[]);const n=I.useCallback((i={})=>t?new window.EyeDropper().open(i):Promise.resolve(void 0),[t]);return{supported:t,open:n}}function Voe(){return navigator.userAgent.includes("OPR")}function Goe(t){let e=t,n=!1;const i=new Set;return{getState(){return e},updateState(r){e=typeof r=="function"?r(e):r},setState(r){this.updateState(r),i.forEach(a=>a(e))},initialize(r){n||(e=r,n=!0)},subscribe(r){return i.add(r),()=>i.delete(r)}}}function Woe(t){return I.useSyncExternalStore(t.subscribe,()=>t.getState(),()=>t.getState())}function qoe(t,e,n){const i=[],r=[],a={};for(const s of t){const o=s.position||e;a[o]=a[o]||0,a[o]+=1,a[o]<=n?r.push(s):i.push(s)}return{notifications:r,queue:i}}const Xoe=()=>Goe({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),tg=Xoe(),Koe=(t=tg)=>Woe(t);function Av(t,e){const n=t.getState(),i=e([...n.notifications,...n.queue]),r=qoe(i,n.defaultPosition,n.limit);t.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Yoe(t,e=tg){const n=t.id||Qq();return Av(e,i=>t.id&&i.some(r=>r.id===t.id)?i:[...i,{...t,id:n}]),n}function oX(t,e=tg){return Av(e,n=>n.filter(i=>i.id===t?(i.onClose?.(i),!1):!0)),t}function Joe(t,e=tg){return Av(e,n=>n.map(i=>i.id===t.id?{...i,...t}:i)),t.id}function $oe(t=tg){Av(t,()=>[])}function Zoe(t=tg){Av(t,e=>e.slice(0,t.getState().limit))}const ks={show:Yoe,hide:oX,update:Joe,clean:$oe,cleanQueue:Zoe,updateState:Av};function Is(){return Is=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Is.apply(null,arguments)}function hL(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}function _O(t,e){return _O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},_O(t,e)}function lX(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,_O(t,e)}var cX={exports:{}},Qoe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ele=Qoe,tle=ele;function uX(){}function fX(){}fX.resetWarningCache=uX;var nle=function(){function t(i,r,a,s,o,l){if(l!==tle){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:fX,resetWarningCache:uX};return n.PropTypes=n,n};cX.exports=nle();var hX=cX.exports;const mB={disabled:!1},r2=Ee.createContext(null);var ile=function(e){return e.scrollTop},Sx="unmounted",Gp="exited",Wp="entering",Ub="entered",SO="exiting",yh=function(t){lX(e,t);function e(i,r){var a;a=t.call(this,i,r)||this;var s=r,o=s&&!s.isMounting?i.enter:i.appear,l;return a.appearStatus=null,i.in?o?(l=Gp,a.appearStatus=Wp):l=Ub:i.unmountOnExit||i.mountOnEnter?l=Sx:l=Gp,a.state={status:l},a.nextCallback=null,a}e.getDerivedStateFromProps=function(r,a){var s=r.in;return s&&a.status===Sx?{status:Gp}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var a=null;if(r!==this.props){var s=this.state.status;this.props.in?s!==Wp&&s!==Ub&&(a=Wp):(s===Wp||s===Ub)&&(a=SO)}this.updateStatus(!1,a)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,a,s,o;return a=s=o=r,r!=null&&typeof r!="number"&&(a=r.exit,s=r.enter,o=r.appear!==void 0?r.appear:s),{exit:a,enter:s,appear:o}},n.updateStatus=function(r,a){if(r===void 0&&(r=!1),a!==null)if(this.cancelNextCallback(),a===Wp){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:bx.findDOMNode(this);s&&ile(s)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Gp&&this.setState({status:Sx})},n.performEnter=function(r){var a=this,s=this.props.enter,o=this.context?this.context.isMounting:r,l=this.props.nodeRef?[o]:[bx.findDOMNode(this),o],c=l[0],u=l[1],f=this.getTimeouts(),h=o?f.appear:f.enter;if(!r&&!s||mB.disabled){this.safeSetState({status:Ub},function(){a.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Wp},function(){a.props.onEntering(c,u),a.onTransitionEnd(h,function(){a.safeSetState({status:Ub},function(){a.props.onEntered(c,u)})})})},n.performExit=function(){var r=this,a=this.props.exit,s=this.getTimeouts(),o=this.props.nodeRef?void 0:bx.findDOMNode(this);if(!a||mB.disabled){this.safeSetState({status:Gp},function(){r.props.onExited(o)});return}this.props.onExit(o),this.safeSetState({status:SO},function(){r.props.onExiting(o),r.onTransitionEnd(s.exit,function(){r.safeSetState({status:Gp},function(){r.props.onExited(o)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,a){a=this.setNextCallback(a),this.setState(r,a)},n.setNextCallback=function(r){var a=this,s=!0;return this.nextCallback=function(o){s&&(s=!1,a.nextCallback=null,r(o))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(r,a){this.setNextCallback(a);var s=this.props.nodeRef?this.props.nodeRef.current:bx.findDOMNode(this),o=r==null&&!this.props.addEndListener;if(!s||o){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===Sx)return null;var a=this.props,s=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var o=hL(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ee.createElement(r2.Provider,{value:null},typeof s=="function"?s(r,o):Ee.cloneElement(Ee.Children.only(s),o))},e}(Ee.Component);yh.contextType=r2;yh.propTypes={};function jg(){}yh.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:jg,onEntering:jg,onEntered:jg,onExit:jg,onExiting:jg,onExited:jg};yh.UNMOUNTED=Sx;yh.EXITED=Gp;yh.ENTERING=Wp;yh.ENTERED=Ub;yh.EXITING=SO;function rle(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dL(t,e){var n=function(a){return e&&I.isValidElement(a)?e(a):a},i=Object.create(null);return t&&I.Children.map(t,function(r){return r}).forEach(function(r){i[r.key]=n(r)}),i}function ale(t,e){t=t||{},e=e||{};function n(u){return u in e?e[u]:t[u]}var i=Object.create(null),r=[];for(var a in t)a in e?r.length&&(i[a]=r,r=[]):r.push(a);var s,o={};for(var l in e){if(i[l])for(s=0;s<i[l].length;s++){var c=i[l][s];o[i[l][s]]=n(c)}o[l]=n(l)}for(s=0;s<r.length;s++)o[r[s]]=n(r[s]);return o}function tm(t,e,n){return n[e]!=null?n[e]:t.props[e]}function sle(t,e){return dL(t.children,function(n){return I.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:tm(n,"appear",t),enter:tm(n,"enter",t),exit:tm(n,"exit",t)})})}function ole(t,e,n){var i=dL(t.children),r=ale(e,i);return Object.keys(r).forEach(function(a){var s=r[a];if(I.isValidElement(s)){var o=a in e,l=a in i,c=e[a],u=I.isValidElement(c)&&!c.props.in;l&&(!o||u)?r[a]=I.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:tm(s,"exit",t),enter:tm(s,"enter",t)}):!l&&o&&!u?r[a]=I.cloneElement(s,{in:!1}):l&&o&&I.isValidElement(c)&&(r[a]=I.cloneElement(s,{onExited:n.bind(null,s),in:c.props.in,exit:tm(s,"exit",t),enter:tm(s,"enter",t)}))}}),r}var lle=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},cle={component:"div",childFactory:function(e){return e}},ad=function(t){lX(e,t);function e(i,r){var a;a=t.call(this,i,r)||this;var s=a.handleExited.bind(rle(a));return a.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},a}var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(r,a){var s=a.children,o=a.handleExited,l=a.firstRender;return{children:l?sle(r,o):ole(r,s,o),firstRender:!1}},n.handleExited=function(r,a){var s=dL(this.props.children);r.key in s||(r.props.onExited&&r.props.onExited(a),this.mounted&&this.setState(function(o){var l=Is({},o.children);return delete l[r.key],{children:l}}))},n.render=function(){var r=this.props,a=r.component,s=r.childFactory,o=hL(r,["component","childFactory"]),l=this.state.contextValue,c=lle(this.state.children).map(s);return delete o.appear,delete o.enter,delete o.exit,a===null?Ee.createElement(r2.Provider,{value:l},c):Ee.createElement(r2.Provider,{value:l},Ee.createElement(a,o,c))},e}(Ee.Component);ad.propTypes={};ad.defaultProps=cle;var Bu=function(){return Bu=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Bu.apply(this,arguments)};function dX(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function ule(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,a;i<r;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}var rM="right-scroll-bar-position",aM="width-before-scroll-bar",fle="with-scroll-bars-hidden",hle="--removed-body-scroll-bar-size";function D3(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function dle(t,e){var n=I.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=e,n.facade}var ple=typeof window<"u"?I.useLayoutEffect:I.useEffect,gB=new WeakMap;function mle(t,e){var n=dle(null,function(i){return t.forEach(function(r){return D3(r,i)})});return ple(function(){var i=gB.get(n);if(i){var r=new Set(i),a=new Set(t),s=n.current;r.forEach(function(o){a.has(o)||D3(o,null)}),a.forEach(function(o){r.has(o)||D3(o,s)})}gB.set(n,t)},[t]),n}function gle(t){return t}function ble(t,e){e===void 0&&(e=gle);var n=[],i=!1,r={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(a){var s=e(a,i);return n.push(s),function(){n=n.filter(function(o){return o!==s})}},assignSyncMedium:function(a){for(i=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(o){return a(o)},filter:function(){return n}}},assignMedium:function(a){i=!0;var s=[];if(n.length){var o=n;n=[],o.forEach(a),s=n}var l=function(){var u=s;s=[],u.forEach(a)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return r}function vle(t){t===void 0&&(t={});var e=ble(null);return e.options=Bu({async:!0,ssr:!1},t),e}var pX=function(t){var e=t.sideCar,n=dX(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return I.createElement(i,Bu({},n))};pX.isSideCarExport=!0;function yle(t,e){return t.useMedium(e),pX}var mX=vle(),O3=function(){},QT=I.forwardRef(function(t,e){var n=I.useRef(null),i=I.useState({onScrollCapture:O3,onWheelCapture:O3,onTouchMoveCapture:O3}),r=i[0],a=i[1],s=t.forwardProps,o=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,f=t.shards,h=t.sideCar,d=t.noRelative,g=t.noIsolation,b=t.inert,y=t.allowPinchZoom,p=t.as,x=p===void 0?"div":p,_=t.gapMode,w=dX(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=h,S=mle([n,e]),A=Bu(Bu({},w),r);return I.createElement(I.Fragment,null,u&&I.createElement(M,{sideCar:mX,removeScrollBar:c,shards:f,noRelative:d,noIsolation:g,inert:b,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:_}),s?I.cloneElement(I.Children.only(o),Bu(Bu({},A),{ref:S})):I.createElement(x,Bu({},A,{className:l,ref:S}),o))});QT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};QT.classNames={fullWidth:aM,zeroRight:rM};var xle=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _le(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=xle();return e&&t.setAttribute("nonce",e),t}function Sle(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function wle(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Ele=function(){var t=0,e=null;return{add:function(n){t==0&&(e=_le())&&(Sle(e,n),wle(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Mle=function(){var t=Ele();return function(e,n){I.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},gX=function(){var t=Mle(),e=function(n){var i=n.styles,r=n.dynamic;return t(i,r),null};return e},Tle={left:0,top:0,right:0,gap:0},I3=function(t){return parseInt(t||"",10)||0},Ale=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[I3(n),I3(i),I3(r)]},Cle=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Tle;var e=Ale(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},Rle=gX(),p0="data-scroll-locked",kle=function(t,e,n,i){var r=t.left,a=t.top,s=t.right,o=t.gap;return n===void 0&&(n="margin"),`
  .`.concat(fle,` {
   overflow: hidden `).concat(i,`;
   padding-right: `).concat(o,"px ").concat(i,`;
  }
  body[`).concat(p0,`] {
    overflow: hidden `).concat(i,`;
    overscroll-behavior: contain;
    `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(a,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o,"px ").concat(i,`;
    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(i,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(rM,` {
    right: `).concat(o,"px ").concat(i,`;
  }
  
  .`).concat(aM,` {
    margin-right: `).concat(o,"px ").concat(i,`;
  }
  
  .`).concat(rM," .").concat(rM,` {
    right: 0 `).concat(i,`;
  }
  
  .`).concat(aM," .").concat(aM,` {
    margin-right: 0 `).concat(i,`;
  }
  
  body[`).concat(p0,`] {
    `).concat(hle,": ").concat(o,`px;
  }
`)},bB=function(){var t=parseInt(document.body.getAttribute(p0)||"0",10);return isFinite(t)?t:0},Dle=function(){I.useEffect(function(){return document.body.setAttribute(p0,(bB()+1).toString()),function(){var t=bB()-1;t<=0?document.body.removeAttribute(p0):document.body.setAttribute(p0,t.toString())}},[])},Ole=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;Dle();var a=I.useMemo(function(){return Cle(r)},[r]);return I.createElement(Rle,{styles:kle(a,!e,r,n?"":"!important")})},wO=!1;if(typeof window<"u")try{var ZS=Object.defineProperty({},"passive",{get:function(){return wO=!0,!0}});window.addEventListener("test",ZS,ZS),window.removeEventListener("test",ZS,ZS)}catch{wO=!1}var Hg=wO?{passive:!1}:!1,Ile=function(t){return t.tagName==="TEXTAREA"},bX=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ile(t)&&n[e]==="visible")},Nle=function(t){return bX(t,"overflowY")},Lle=function(t){return bX(t,"overflowX")},vB=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=vX(t,i);if(r){var a=yX(t,i),s=a[1],o=a[2];if(s>o)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Ple=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},Ule=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},vX=function(t,e){return t==="v"?Nle(e):Lle(e)},yX=function(t,e){return t==="v"?Ple(e):Ule(e)},Fle=function(t,e){return t==="h"&&e==="rtl"?-1:1},Ble=function(t,e,n,i,r){var a=Fle(t,window.getComputedStyle(e).direction),s=a*i,o=n.target,l=e.contains(o),c=!1,u=s>0,f=0,h=0;do{if(!o)break;var d=yX(t,o),g=d[0],b=d[1],y=d[2],p=b-y-a*g;(g||p)&&vX(t,o)&&(f+=p,h+=g);var x=o.parentNode;o=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&o!==document.body||l&&(e.contains(o)||e===o));return(u&&Math.abs(f)<1||!u&&Math.abs(h)<1)&&(c=!0),c},QS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},yB=function(t){return[t.deltaX,t.deltaY]},xB=function(t){return t&&"current"in t?t.current:t},zle=function(t,e){return t[0]===e[0]&&t[1]===e[1]},jle=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},Hle=0,Vg=[];function Vle(t){var e=I.useRef([]),n=I.useRef([0,0]),i=I.useRef(),r=I.useState(Hle++)[0],a=I.useState(gX)[0],s=I.useRef(t);I.useEffect(function(){s.current=t},[t]),I.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var b=ule([t.lockRef.current],(t.shards||[]).map(xB),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var o=I.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var p=QS(b),x=n.current,_="deltaX"in b?b.deltaX:x[0]-p[0],w="deltaY"in b?b.deltaY:x[1]-p[1],M,S=b.target,A=Math.abs(_)>Math.abs(w)?"h":"v";if("touches"in b&&A==="h"&&S.type==="range")return!1;var C=vB(A,S);if(!C)return!0;if(C?M=A:(M=A==="v"?"h":"v",C=vB(A,S)),!C)return!1;if(!i.current&&"changedTouches"in b&&(_||w)&&(i.current=M),!M)return!0;var D=i.current||M;return Ble(D,y,b,D==="h"?_:w)},[]),l=I.useCallback(function(b){var y=b;if(!(!Vg.length||Vg[Vg.length-1]!==a)){var p="deltaY"in y?yB(y):QS(y),x=e.current.filter(function(M){return M.name===y.type&&(M.target===y.target||y.target===M.shadowParent)&&zle(M.delta,p)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var _=(s.current.shards||[]).map(xB).filter(Boolean).filter(function(M){return M.contains(y.target)}),w=_.length>0?o(y,_[0]):!s.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),c=I.useCallback(function(b,y,p,x){var _={name:b,delta:y,target:p,should:x,shadowParent:Gle(p)};e.current.push(_),setTimeout(function(){e.current=e.current.filter(function(w){return w!==_})},1)},[]),u=I.useCallback(function(b){n.current=QS(b),i.current=void 0},[]),f=I.useCallback(function(b){c(b.type,yB(b),b.target,o(b,t.lockRef.current))},[]),h=I.useCallback(function(b){c(b.type,QS(b),b.target,o(b,t.lockRef.current))},[]);I.useEffect(function(){return Vg.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Hg),document.addEventListener("touchmove",l,Hg),document.addEventListener("touchstart",u,Hg),function(){Vg=Vg.filter(function(b){return b!==a}),document.removeEventListener("wheel",l,Hg),document.removeEventListener("touchmove",l,Hg),document.removeEventListener("touchstart",u,Hg)}},[]);var d=t.removeScrollBar,g=t.inert;return I.createElement(I.Fragment,null,g?I.createElement(a,{styles:jle(r)}):null,d?I.createElement(Ole,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Gle(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Wle=yle(mX,Vle);var a2=I.forwardRef(function(t,e){return I.createElement(QT,Bu({},t,{ref:e,sideCar:Wle}))});a2.classNames=QT.classNames;function Yu(t){return Object.keys(t)}function N3(t){return t&&typeof t=="object"&&!Array.isArray(t)}function pL(t,e){const n={...t},i=e;return N3(t)&&N3(e)&&Object.keys(e).forEach(r=>{N3(i[r])&&r in t?n[r]=pL(n[r],i[r]):n[r]=i[r]}),n}function qle(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Xle(t){return typeof t!="string"||!t.includes("var(--mantine-scale)")?t:t.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function Kle(t){const e=Xle(t);return typeof e=="number"?e:typeof e=="string"?e.includes("calc")||e.includes("var")?e:e.includes("px")?Number(e.replace("px","")):e.includes("rem")?Number(e.replace("rem",""))*16:e.includes("em")?Number(e.replace("em",""))*16:Number(e):NaN}function _B(t){return t==="0rem"?"0rem":`calc(${t} * var(--mantine-scale))`}function xX(t,{shouldScale:e=!1}={}){function n(i){if(i===0||i==="0")return`0${t}`;if(typeof i=="number"){const r=`${i/16}${t}`;return e?_B(r):r}if(typeof i=="string"){if(i===""||i.startsWith("calc(")||i.startsWith("clamp(")||i.includes("rgba("))return i;if(i.includes(","))return i.split(",").map(a=>n(a)).join(",");if(i.includes(" "))return i.split(" ").map(a=>n(a)).join(" ");const r=i.replace("px","");if(!Number.isNaN(Number(r))){const a=`${Number(r)/16}${t}`;return e?_B(a):a}}return i}return n}const Et=xX("rem",{shouldScale:!0}),EO=xX("em");function eA(t){return Object.keys(t).reduce((e,n)=>(t[n]!==void 0&&(e[n]=t[n]),e),{})}function _X(t){if(typeof t=="number")return!0;if(typeof t=="string"){if(t.startsWith("calc(")||t.startsWith("var(")||t.includes(" ")&&t.trim()!=="")return!0;const e=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return t.trim().split(/\s+/).every(i=>e.test(i))}return!1}function ng(t){return Array.isArray(t)||t===null?!1:typeof t=="object"?t.type!==I.Fragment:!1}function yu(t){const e=I.createContext(null);return[({children:r,value:a})=>k.jsx(e.Provider,{value:a,children:r}),()=>{const r=I.useContext(e);if(r===null)throw new Error(t);return r}]}function E_(t=null){const e=I.createContext(t);return[({children:r,value:a})=>k.jsx(e.Provider,{value:a,children:r}),()=>I.useContext(e)]}function SB(t,e){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(e);return`${t}-${n}`}}function MO(t,e){let n=t;for(;(n=n.parentElement)&&!n.matches(e););return n}function Yle(t,e,n){for(let i=t-1;i>=0;i-=1)if(!e[i].disabled)return i;if(n){for(let i=e.length-1;i>-1;i-=1)if(!e[i].disabled)return i}return t}function Jle(t,e,n){for(let i=t+1;i<e.length;i+=1)if(!e[i].disabled)return i;if(n){for(let i=0;i<e.length;i+=1)if(!e[i].disabled)return i}return t}function $le(t,e,n){return MO(t,n)===MO(e,n)}function Zle({parentSelector:t,siblingSelector:e,onKeyDown:n,loop:i=!0,activateOnFocus:r=!1,dir:a="rtl",orientation:s}){return o=>{n?.(o);const l=Array.from(MO(o.currentTarget,t)?.querySelectorAll(e)||[]).filter(g=>$le(o.currentTarget,g,t)),c=l.findIndex(g=>o.currentTarget===g),u=Jle(c,l,i),f=Yle(c,l,i),h=a==="rtl"?f:u,d=a==="rtl"?u:f;switch(o.key){case"ArrowRight":{s==="horizontal"&&(o.stopPropagation(),o.preventDefault(),l[h].focus(),r&&l[h].click());break}case"ArrowLeft":{s==="horizontal"&&(o.stopPropagation(),o.preventDefault(),l[d].focus(),r&&l[d].click());break}case"ArrowUp":{s==="vertical"&&(o.stopPropagation(),o.preventDefault(),l[f].focus(),r&&l[f].click());break}case"ArrowDown":{s==="vertical"&&(o.stopPropagation(),o.preventDefault(),l[u].focus(),r&&l[u].click());break}case"Home":{o.stopPropagation(),o.preventDefault(),!l[0].disabled&&l[0].focus();break}case"End":{o.stopPropagation(),o.preventDefault();const g=l.length-1;!l[g].disabled&&l[g].focus();break}}}}const Qle={app:100,modal:200,popover:300,overlay:400,max:9999};function ff(t){return Qle[t]}const s2=()=>{};function ece(t,e={active:!0}){return typeof t!="function"||!e.active?e.onKeyDown||s2:n=>{n.key==="Escape"&&(t(n),e.onTrigger?.())}}function oi(t,e="size",n=!0){if(t!==void 0)return _X(t)?n?Et(t):t:`var(--${e}-${t})`}function Pd(t){return oi(t,"mantine-spacing")}function aa(t){return t===void 0?"var(--mantine-radius-default)":oi(t,"mantine-radius")}function Ds(t){return oi(t,"mantine-font-size")}function SX(t){return oi(t,"mantine-line-height",!1)}function mL(t){if(t)return oi(t,"mantine-shadow",!1)}var tce={};function nce(){return typeof process<"u"&&tce?"production":"development"}function wB(t,e){return e.length===0?t:e.reduce((n,i)=>Math.abs(i-t)<Math.abs(n-t)?i:n)}function tA(t){const e=Ee.version;return typeof Ee.version!="string"||e.startsWith("18.")?t?.ref:t?.props?.ref}function wX(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=wX(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function as(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=wX(t))&&(i&&(i+=" "),i+=e);return i}const ice={};function rce(t){const e={};return t.forEach(n=>{Object.entries(n).forEach(([i,r])=>{e[i]?e[i]=as(e[i],r):e[i]=r})}),e}function nA({theme:t,classNames:e,props:n,stylesCtx:i}){const a=(Array.isArray(e)?e:[e]).map(s=>typeof s=="function"?s(t,n,i):s||ice);return rce(a)}function o2({theme:t,styles:e,props:n,stylesCtx:i}){return(Array.isArray(e)?e:[e]).reduce((a,s)=>typeof s=="function"?{...a,...s(t,n,i)}:{...a,...s},{})}const gL=I.createContext(null);function Gd(){const t=I.useContext(gL);if(!t)throw new Error("[@mantine/core] MantineProvider was not found in tree");return t}function ace(){return Gd().cssVariablesResolver}function sce(){return Gd().classNamesPrefix}function iA(){return Gd().getStyleNonce}function oce(){return Gd().withStaticClasses}function lce(){return Gd().headless}function cce(){return Gd().stylesTransform?.sx}function uce(){return Gd().stylesTransform?.styles}function rA(){return Gd().env||"default"}function fce(t){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t)}function hce(t){let e=t.replace("#","");if(e.length===3){const s=e.split("");e=[s[0],s[0],s[1],s[1],s[2],s[2]].join("")}if(e.length===8){const s=parseInt(e.slice(6,8),16)/255;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16),a:s}}const n=parseInt(e,16),i=n>>16&255,r=n>>8&255,a=n&255;return{r:i,g:r,b:a,a:1}}function dce(t){const[e,n,i,r]=t.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:e,g:n,b:i,a:r===void 0?1:r}}function pce(t){const e=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=t.match(e);if(!n)return{r:0,g:0,b:0,a:1};const i=parseInt(n[1],10),r=parseInt(n[2],10)/100,a=parseInt(n[3],10)/100,s=n[5]?parseFloat(n[5]):void 0,o=(1-Math.abs(2*a-1))*r,l=i/60,c=o*(1-Math.abs(l%2-1)),u=a-o/2;let f,h,d;return l>=0&&l<1?(f=o,h=c,d=0):l>=1&&l<2?(f=c,h=o,d=0):l>=2&&l<3?(f=0,h=o,d=c):l>=3&&l<4?(f=0,h=c,d=o):l>=4&&l<5?(f=c,h=0,d=o):(f=o,h=0,d=c),{r:Math.round((f+u)*255),g:Math.round((h+u)*255),b:Math.round((d+u)*255),a:s||1}}function bL(t){return fce(t)?hce(t):t.startsWith("rgb")?dce(t):t.startsWith("hsl")?pce(t):{r:0,g:0,b:0,a:1}}function ew(t,e){if(t.startsWith("var("))return`color-mix(in srgb, ${t}, black ${e*100}%)`;const{r:n,g:i,b:r,a}=bL(t),s=1-e,o=l=>Math.round(l*s);return`rgba(${o(n)}, ${o(i)}, ${o(r)}, ${a})`}function O1(t,e){return typeof t.primaryShade=="number"?t.primaryShade:e==="dark"?t.primaryShade.dark:t.primaryShade.light}function L3(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function mce(t){const e=t.match(/oklch\((.*?)%\s/);return e?parseFloat(e[1]):null}function EX(t){if(t.startsWith("oklch("))return(mce(t)||0)/100;const{r:e,g:n,b:i}=bL(t),r=e/255,a=n/255,s=i/255,o=L3(r),l=L3(a),c=L3(s);return .2126*o+.7152*l+.0722*c}function Oy(t,e=.179){return t.startsWith("var(")?!1:EX(t)>e}function fh({color:t,theme:e,colorScheme:n}){if(typeof t!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof t}`);if(t==="bright")return{color:t,value:n==="dark"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:Oy(n==="dark"?e.white:e.black,e.luminanceThreshold),variable:"--mantine-color-bright"};if(t==="dimmed")return{color:t,value:n==="dark"?e.colors.dark[2]:e.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Oy(n==="dark"?e.colors.dark[2]:e.colors.gray[6],e.luminanceThreshold),variable:"--mantine-color-dimmed"};if(t==="white"||t==="black")return{color:t,value:t==="white"?e.white:e.black,shade:void 0,isThemeColor:!1,isLight:Oy(t==="white"?e.white:e.black,e.luminanceThreshold),variable:`--mantine-color-${t}`};const[i,r]=t.split("."),a=r?Number(r):void 0,s=i in e.colors;if(s){const o=a!==void 0?e.colors[i][a]:e.colors[i][O1(e,n||"light")];return{color:i,value:o,shade:a,isThemeColor:s,isLight:Oy(o,e.luminanceThreshold),variable:r?`--mantine-color-${i}-${a}`:`--mantine-color-${i}-filled`}}return{color:t,value:t,isThemeColor:s,isLight:Oy(t,e.luminanceThreshold),shade:a,variable:void 0}}function ia(t,e){const n=fh({color:t||e.primaryColor,theme:e});return n.variable?`var(${n.variable})`:t}function TO(t,e){const n={from:t?.from||e.defaultGradient.from,to:t?.to||e.defaultGradient.to,deg:t?.deg??e.defaultGradient.deg??0},i=ia(n.from,e),r=ia(n.to,e);return`linear-gradient(${n.deg}deg, ${i} 0%, ${r} 100%)`}function ec(t,e){if(typeof t!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";if(t.startsWith("var(")){const a=(1-e)*100;return`color-mix(in srgb, ${t}, transparent ${a}%)`}if(t.startsWith("oklch"))return t.includes("/")?t.replace(/\/\s*[\d.]+\s*\)/,`/ ${e})`):t.replace(")",` / ${e})`);const{r:n,g:i,b:r}=bL(t);return`rgba(${n}, ${i}, ${r}, ${e})`}const Gg=ec,gce=({color:t,theme:e,variant:n,gradient:i,autoContrast:r})=>{const a=fh({color:t,theme:e}),s=typeof r=="boolean"?r:e.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const o=s&&a.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${t}-filled)`,hover:`var(--mantine-color-${t}-filled-hover)`,color:o,border:`${Et(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:o,border:`${Et(1)} solid transparent`}:{background:t,hover:ew(t,.1),color:o,border:`${Et(1)} solid transparent`}}if(n==="light"){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${t}-light)`,hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${Et(1)} solid transparent`};const o=e.colors[a.color][a.shade];return{background:ec(o,.1),hover:ec(o,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${Et(1)} solid transparent`}}return{background:ec(t,.1),hover:ec(t,.12),color:t,border:`${Et(1)} solid transparent`}}if(n==="outline")return a.isThemeColor?a.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${t}-outline-hover)`,color:`var(--mantine-color-${t}-outline)`,border:`${Et(1)} solid var(--mantine-color-${t}-outline)`}:{background:"transparent",hover:ec(e.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${Et(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:"transparent",hover:ec(t,.05),color:t,border:`${Et(1)} solid ${t}`};if(n==="subtle"){if(a.isThemeColor){if(a.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${t}-light-hover)`,color:`var(--mantine-color-${t}-light-color)`,border:`${Et(1)} solid transparent`};const o=e.colors[a.color][a.shade];return{background:"transparent",hover:ec(o,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${Et(1)} solid transparent`}}return{background:"transparent",hover:ec(t,.12),color:t,border:`${Et(1)} solid transparent`}}return n==="transparent"?a.isThemeColor?a.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${t}-light-color)`,border:`${Et(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${Et(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:t,border:`${Et(1)} solid transparent`}:n==="white"?a.isThemeColor?a.shade===void 0?{background:"var(--mantine-color-white)",hover:ew(e.white,.01),color:`var(--mantine-color-${t}-filled)`,border:`${Et(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:ew(e.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${Et(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:ew(e.white,.01),color:t,border:`${Et(1)} solid transparent`}:n==="gradient"?{background:TO(i,e),hover:TO(i,e),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${Et(1)} solid var(--mantine-color-default-border)`}:{}},bce={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},EB="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",aA={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:bce,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:gce,autoContrast:!1,luminanceThreshold:.3,fontFamily:EB,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:EB,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:Et(34),lineHeight:"1.3"},h2:{fontSize:Et(26),lineHeight:"1.35"},h3:{fontSize:Et(22),lineHeight:"1.4"},h4:{fontSize:Et(18),lineHeight:"1.45"},h5:{fontSize:Et(16),lineHeight:"1.5"},h6:{fontSize:Et(14),lineHeight:"1.5"}}},fontSizes:{xs:Et(12),sm:Et(14),md:Et(16),lg:Et(18),xl:Et(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:Et(2),sm:Et(4),md:Et(8),lg:Et(16),xl:Et(32)},spacing:{xs:Et(10),sm:Et(12),md:Et(16),lg:Et(20),xl:Et(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), 0 ${Et(1)} ${Et(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Et(10)} ${Et(15)} ${Et(-5)}, rgba(0, 0, 0, 0.04) 0 ${Et(7)} ${Et(7)} ${Et(-5)}`,md:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Et(20)} ${Et(25)} ${Et(-5)}, rgba(0, 0, 0, 0.04) 0 ${Et(10)} ${Et(10)} ${Et(-5)}`,lg:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Et(28)} ${Et(23)} ${Et(-7)}, rgba(0, 0, 0, 0.04) 0 ${Et(12)} ${Et(12)} ${Et(-7)}`,xl:`0 ${Et(1)} ${Et(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${Et(36)} ${Et(28)} ${Et(-7)}, rgba(0, 0, 0, 0.04) 0 ${Et(17)} ${Et(17)} ${Et(-7)}`},other:{},components:{}};function MB(t){return t==="auto"||t==="dark"||t==="light"}function vce({key:t="mantine-color-scheme-value"}={}){let e;return{get:n=>{if(typeof window>"u")return n;try{const i=window.localStorage.getItem(t);return MB(i)?i:n}catch{return n}},set:n=>{try{window.localStorage.setItem(t,n)}catch(i){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",i)}},subscribe:n=>{e=i=>{i.storageArea===window.localStorage&&i.key===t&&MB(i.newValue)&&n(i.newValue)},window.addEventListener("storage",e)},unsubscribe:()=>{window.removeEventListener("storage",e)},clear:()=>{window.localStorage.removeItem(t)}}}const yce="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",TB="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function P3(t){return t<0||t>9?!1:parseInt(t.toString(),10)===t}function AB(t){if(!(t.primaryColor in t.colors))throw new Error(yce);if(typeof t.primaryShade=="object"&&(!P3(t.primaryShade.dark)||!P3(t.primaryShade.light)))throw new Error(TB);if(typeof t.primaryShade=="number"&&!P3(t.primaryShade))throw new Error(TB)}function MX(t,e){if(!e)return AB(t),t;const n=pL(t,e);return e.fontFamily&&!e.headings?.fontFamily&&(n.headings.fontFamily=e.fontFamily),AB(n),n}const vL=I.createContext(null),xce=()=>I.useContext(vL)||aA;function va(){const t=I.useContext(vL);if(!t)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return t}function TX({theme:t,children:e,inherit:n=!0}){const i=xce(),r=I.useMemo(()=>MX(n?i:aA,t),[t,i,n]);return k.jsx(vL.Provider,{value:r,children:e})}TX.displayName="@mantine/core/MantineThemeProvider";function _ce(){const t=va(),e=iA(),n=Yu(t.breakpoints).reduce((i,r)=>{const a=t.breakpoints[r].includes("px"),s=Kle(t.breakpoints[r]),o=a?`${s-.1}px`:EO(s-.1),l=a?`${s}px`:EO(s);return`${i}@media (max-width: ${o}) {.mantine-visible-from-${r} {display: none !important;}}@media (min-width: ${l}) {.mantine-hidden-from-${r} {display: none !important;}}`},"");return k.jsx("style",{"data-mantine-styles":"classes",nonce:e?.(),dangerouslySetInnerHTML:{__html:n}})}function U3(t){return Object.entries(t).map(([e,n])=>`${e}: ${n};`).join("")}function Iy(t,e){return(Array.isArray(t)?t:[t]).reduce((i,r)=>`${r}{${i}}`,e)}function Sce(t,e){const n=U3(t.variables),i=n?Iy(e,n):"",r=U3(t.dark),a=U3(t.light),s=r?Iy(e===":host"?`${e}([data-mantine-color-scheme="dark"])`:`${e}[data-mantine-color-scheme="dark"]`,r):"",o=a?Iy(e===":host"?`${e}([data-mantine-color-scheme="light"])`:`${e}[data-mantine-color-scheme="light"]`,a):"";return`${i}

${s}

${o}`}function M_({color:t,theme:e,autoContrast:n}){return(typeof n=="boolean"?n:e.autoContrast)&&fh({color:t||e.primaryColor,theme:e}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function CB(t,e){return M_({color:t.colors[t.primaryColor][O1(t,e)],theme:t,autoContrast:null})}function tw({theme:t,color:e,colorScheme:n,name:i=e,withColorValues:r=!0}){if(!t.colors[e])return{};if(n==="light"){const o=O1(t,"light"),l={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-filled)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${o})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${o===9?8:o+1})`,[`--mantine-color-${i}-light`]:Gg(t.colors[e][o],.1),[`--mantine-color-${i}-light-hover`]:Gg(t.colors[e][o],.12),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-${o})`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${o})`,[`--mantine-color-${i}-outline-hover`]:Gg(t.colors[e][o],.05)};return r?{[`--mantine-color-${i}-0`]:t.colors[e][0],[`--mantine-color-${i}-1`]:t.colors[e][1],[`--mantine-color-${i}-2`]:t.colors[e][2],[`--mantine-color-${i}-3`]:t.colors[e][3],[`--mantine-color-${i}-4`]:t.colors[e][4],[`--mantine-color-${i}-5`]:t.colors[e][5],[`--mantine-color-${i}-6`]:t.colors[e][6],[`--mantine-color-${i}-7`]:t.colors[e][7],[`--mantine-color-${i}-8`]:t.colors[e][8],[`--mantine-color-${i}-9`]:t.colors[e][9],...l}:l}const a=O1(t,"dark"),s={[`--mantine-color-${i}-text`]:`var(--mantine-color-${i}-4)`,[`--mantine-color-${i}-filled`]:`var(--mantine-color-${i}-${a})`,[`--mantine-color-${i}-filled-hover`]:`var(--mantine-color-${i}-${a===9?8:a+1})`,[`--mantine-color-${i}-light`]:Gg(t.colors[e][Math.max(0,a-2)],.15),[`--mantine-color-${i}-light-hover`]:Gg(t.colors[e][Math.max(0,a-2)],.2),[`--mantine-color-${i}-light-color`]:`var(--mantine-color-${i}-${Math.max(a-5,0)})`,[`--mantine-color-${i}-outline`]:`var(--mantine-color-${i}-${Math.max(a-4,0)})`,[`--mantine-color-${i}-outline-hover`]:Gg(t.colors[e][Math.max(a-4,0)],.05)};return r?{[`--mantine-color-${i}-0`]:t.colors[e][0],[`--mantine-color-${i}-1`]:t.colors[e][1],[`--mantine-color-${i}-2`]:t.colors[e][2],[`--mantine-color-${i}-3`]:t.colors[e][3],[`--mantine-color-${i}-4`]:t.colors[e][4],[`--mantine-color-${i}-5`]:t.colors[e][5],[`--mantine-color-${i}-6`]:t.colors[e][6],[`--mantine-color-${i}-7`]:t.colors[e][7],[`--mantine-color-${i}-8`]:t.colors[e][8],[`--mantine-color-${i}-9`]:t.colors[e][9],...s}:s}function wce(t){return!!t&&typeof t=="object"&&"mantine-virtual-color"in t}function Wg(t,e,n){Yu(e).forEach(i=>Object.assign(t,{[`--mantine-${n}-${i}`]:e[i]}))}const AX=t=>{const e=O1(t,"light"),n=t.defaultRadius in t.radius?t.radius[t.defaultRadius]:Et(t.defaultRadius),i={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":t.scale.toString(),"--mantine-cursor-type":t.cursorType,"--mantine-webkit-font-smoothing":t.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":t.fontSmoothing?"grayscale":"unset","--mantine-color-white":t.white,"--mantine-color-black":t.black,"--mantine-line-height":t.lineHeights.md,"--mantine-font-family":t.fontFamily,"--mantine-font-family-monospace":t.fontFamilyMonospace,"--mantine-font-family-headings":t.headings.fontFamily,"--mantine-heading-font-weight":t.headings.fontWeight,"--mantine-heading-text-wrap":t.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${t.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${t.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${t.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${t.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${t.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":CB(t,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":t.black,"--mantine-color-body":t.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-${e})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":CB(t,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${t.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};Wg(i.variables,t.breakpoints,"breakpoint"),Wg(i.variables,t.spacing,"spacing"),Wg(i.variables,t.fontSizes,"font-size"),Wg(i.variables,t.lineHeights,"line-height"),Wg(i.variables,t.shadows,"shadow"),Wg(i.variables,t.radius,"radius"),t.colors[t.primaryColor].forEach((a,s)=>{i.variables[`--mantine-primary-color-${s}`]=`var(--mantine-color-${t.primaryColor}-${s})`}),Yu(t.colors).forEach(a=>{const s=t.colors[a];if(wce(s)){Object.assign(i.light,tw({theme:t,name:s.name,color:s.light,colorScheme:"light",withColorValues:!0})),Object.assign(i.dark,tw({theme:t,name:s.name,color:s.dark,colorScheme:"dark",withColorValues:!0}));return}s.forEach((o,l)=>{i.variables[`--mantine-color-${a}-${l}`]=o}),Object.assign(i.light,tw({theme:t,color:a,colorScheme:"light",withColorValues:!1})),Object.assign(i.dark,tw({theme:t,color:a,colorScheme:"dark",withColorValues:!1}))});const r=t.headings.sizes;return Yu(r).forEach(a=>{i.variables[`--mantine-${a}-font-size`]=r[a].fontSize,i.variables[`--mantine-${a}-line-height`]=r[a].lineHeight,i.variables[`--mantine-${a}-font-weight`]=r[a].fontWeight||t.headings.fontWeight}),i};function Ece({theme:t,generator:e}){const n=AX(t),i=e?.(t);return i?pL(n,i):n}const F3=AX(aA);function Mce(t){const e={variables:{},light:{},dark:{}};return Yu(t.variables).forEach(n=>{F3.variables[n]!==t.variables[n]&&(e.variables[n]=t.variables[n])}),Yu(t.light).forEach(n=>{F3.light[n]!==t.light[n]&&(e.light[n]=t.light[n])}),Yu(t.dark).forEach(n=>{F3.dark[n]!==t.dark[n]&&(e.dark[n]=t.dark[n])}),e}function Tce(t){return`
  ${t}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
  ${t}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
`}function CX({cssVariablesSelector:t,deduplicateCssVariables:e}){const n=va(),i=iA(),r=ace(),a=Ece({theme:n,generator:r}),s=t===":root"&&e,o=s?Mce(a):a,l=Sce(o,t);return l?k.jsx("style",{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${l}${s?"":Tce(t)}`}}):null}CX.displayName="@mantine/CssVariables";function qg(t,e){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,i=t!=="auto"?t:n?"dark":"light";e()?.setAttribute("data-mantine-color-scheme",i)}function Ace({manager:t,defaultColorScheme:e,getRootElement:n,forceColorScheme:i}){const r=I.useRef(null),[a,s]=I.useState(()=>t.get(e)),o=i||a,l=I.useCallback(u=>{i||(qg(u,n),s(u),t.set(u))},[t.set,o,i]),c=I.useCallback(()=>{s(e),qg(e,n),t.clear()},[t.clear,e]);return I.useEffect(()=>(t.subscribe(l),t.unsubscribe),[t.subscribe,t.unsubscribe]),Tv(()=>{qg(t.get(e),n)},[]),I.useEffect(()=>{if(i)return qg(i,n),()=>{};i===void 0&&qg(a,n),typeof window<"u"&&"matchMedia"in window&&(r.current=window.matchMedia("(prefers-color-scheme: dark)"));const u=f=>{a==="auto"&&qg(f.matches?"dark":"light",n)};return r.current?.addEventListener("change",u),()=>r.current?.removeEventListener("change",u)},[a,i]),{colorScheme:o,setColorScheme:l,clearColorScheme:c}}function Cce({respectReducedMotion:t,getRootElement:e}){Tv(()=>{t&&e()?.setAttribute("data-respect-reduced-motion","true")},[t])}function RX({theme:t,children:e,getStyleNonce:n,withStaticClasses:i=!0,withGlobalClasses:r=!0,deduplicateCssVariables:a=!0,withCssVariables:s=!0,cssVariablesSelector:o=":root",classNamesPrefix:l="mantine",colorSchemeManager:c=vce(),defaultColorScheme:u="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:d,stylesTransform:g,env:b}){const{colorScheme:y,setColorScheme:p,clearColorScheme:x}=Ace({defaultColorScheme:u,forceColorScheme:d,manager:c,getRootElement:f});return Cce({respectReducedMotion:t?.respectReducedMotion||!1,getRootElement:f}),k.jsx(gL.Provider,{value:{colorScheme:y,setColorScheme:p,clearColorScheme:x,getRootElement:f,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:o,withStaticClasses:i,stylesTransform:g,env:b},children:k.jsxs(TX,{theme:t,children:[s&&k.jsx(CX,{cssVariablesSelector:o,deduplicateCssVariables:a}),r&&k.jsx(_ce,{}),e]})})}RX.displayName="@mantine/core/MantineProvider";function Cv({classNames:t,styles:e,props:n,stylesCtx:i}){const r=va();return{resolvedClassNames:nA({theme:r,classNames:t,props:n,stylesCtx:i||void 0}),resolvedStyles:o2({theme:r,styles:e,props:n,stylesCtx:i||void 0})}}const Rce={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function kce({theme:t,options:e,unstyled:n}){return as(e?.focusable&&!n&&(t.focusClassName||Rce[t.focusRing]),e?.active&&!n&&t.activeClassName)}function Dce({selector:t,stylesCtx:e,options:n,props:i,theme:r}){return nA({theme:r,classNames:n?.classNames,props:n?.props||i,stylesCtx:e})[t]}function RB({selector:t,stylesCtx:e,theme:n,classNames:i,props:r}){return nA({theme:n,classNames:i,props:r,stylesCtx:e})[t]}function Oce({rootSelector:t,selector:e,className:n}){return t===e?n:void 0}function Ice({selector:t,classes:e,unstyled:n}){return n?void 0:e[t]}function Nce({themeName:t,classNamesPrefix:e,selector:n,withStaticClass:i}){return i===!1?[]:t.map(r=>`${e}-${r}-${n}`)}function Lce({themeName:t,theme:e,selector:n,props:i,stylesCtx:r}){return t.map(a=>nA({theme:e,classNames:e.components[a]?.classNames,props:i,stylesCtx:r})?.[n])}function Pce({options:t,classes:e,selector:n,unstyled:i}){return t?.variant&&!i?e[`${n}--${t.variant}`]:void 0}function Uce({theme:t,options:e,themeName:n,selector:i,classNamesPrefix:r,classNames:a,classes:s,unstyled:o,className:l,rootSelector:c,props:u,stylesCtx:f,withStaticClasses:h,headless:d,transformedStyles:g}){return as(kce({theme:t,options:e,unstyled:o||d}),Lce({theme:t,themeName:n,selector:i,props:u,stylesCtx:f}),Pce({options:e,classes:s,selector:i,unstyled:o}),RB({selector:i,stylesCtx:f,theme:t,classNames:a,props:u}),RB({selector:i,stylesCtx:f,theme:t,classNames:g,props:u}),Dce({selector:i,stylesCtx:f,options:e,props:u,theme:t}),Oce({rootSelector:c,selector:i,className:l}),Ice({selector:i,classes:s,unstyled:o||d}),h&&!d&&Nce({themeName:n,classNamesPrefix:r,selector:i,withStaticClass:e?.withStaticClass}),e?.className)}function Fce({theme:t,themeName:e,props:n,stylesCtx:i,selector:r}){return e.map(a=>o2({theme:t,styles:t.components[a]?.styles,props:n,stylesCtx:i})[r]).reduce((a,s)=>({...a,...s}),{})}function AO({style:t,theme:e}){return Array.isArray(t)?[...t].reduce((n,i)=>({...n,...AO({style:i,theme:e})}),{}):typeof t=="function"?t(e):t??{}}function Bce(t){return t.reduce((e,n)=>(n&&Object.keys(n).forEach(i=>{e[i]={...e[i],...eA(n[i])}}),e),{})}function zce({vars:t,varsResolver:e,theme:n,props:i,stylesCtx:r,selector:a,themeName:s,headless:o}){return Bce([o?{}:e?.(n,i,r),...s.map(l=>n.components?.[l]?.vars?.(n,i,r)),t?.(n,i,r)])?.[a]}function jce({theme:t,themeName:e,selector:n,options:i,props:r,stylesCtx:a,rootSelector:s,styles:o,style:l,vars:c,varsResolver:u,headless:f,withStylesTransform:h}){return{...!h&&Fce({theme:t,themeName:e,props:r,stylesCtx:a,selector:n}),...!h&&o2({theme:t,styles:o,props:r,stylesCtx:a})[n],...!h&&o2({theme:t,styles:i?.styles,props:i?.props||r,stylesCtx:a})[n],...zce({theme:t,props:r,stylesCtx:a,vars:c,varsResolver:u,selector:n,themeName:e,headless:f}),...s===n?AO({style:l,theme:t}):null,...AO({style:i?.style,theme:t})}}function Hce({props:t,stylesCtx:e,themeName:n}){const i=va(),r=uce()?.();return{getTransformedStyles:s=>r?[...s.map(l=>r(l,{props:t,theme:i,ctx:e})),...n.map(l=>r(i.components[l]?.styles,{props:t,theme:i,ctx:e}))].filter(Boolean):[],withStylesTransform:!!r}}function Tn({name:t,classes:e,props:n,stylesCtx:i,className:r,style:a,rootSelector:s="root",unstyled:o,classNames:l,styles:c,vars:u,varsResolver:f,attributes:h}){const d=va(),g=sce(),b=oce(),y=lce(),p=(Array.isArray(t)?t:[t]).filter(w=>w),{withStylesTransform:x,getTransformedStyles:_}=Hce({props:n,stylesCtx:i,themeName:p});return(w,M)=>({className:Uce({theme:d,options:M,themeName:p,selector:w,classNamesPrefix:g,classNames:l,classes:e,unstyled:o,className:r,rootSelector:s,props:n,stylesCtx:i,withStaticClasses:b,headless:y,transformedStyles:_([M?.styles,c])}),style:jce({theme:d,themeName:p,selector:w,options:M,props:n,stylesCtx:i,rootSelector:s,styles:c,style:a,vars:u,varsResolver:f,headless:y,withStylesTransform:x}),...h?.[w]})}function sA(t,e){return typeof t=="boolean"?t:e.autoContrast}function kB(t){const e=document.createElement("style");return e.setAttribute("data-mantine-styles","inline"),e.innerHTML="*, *::before, *::after {transition: none !important;}",e.setAttribute("data-mantine-disable-transition","true"),t&&e.setAttribute("nonce",t),document.head.appendChild(e),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(i=>i.remove())}function ig({keepTransitions:t}={}){const e=I.useRef(s2),n=I.useRef(-1),i=I.useContext(gL),r=iA(),a=I.useRef(r?.());if(!i)throw new Error("[@mantine/core] MantineProvider was not found in tree");const s=f=>{i.setColorScheme(f),e.current=t?()=>{}:kB(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{e.current?.()},10)},o=()=>{i.clearColorScheme(),e.current=t?()=>{}:kB(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{e.current?.()},10)},l=Aoe("light",{getInitialValueInEffect:!1}),c=i.colorScheme==="auto"?l:i.colorScheme,u=I.useCallback(()=>s(c==="light"?"dark":"light"),[s,c]);return I.useEffect(()=>()=>{e.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:i.colorScheme,setColorScheme:s,clearColorScheme:o,toggleColorScheme:u}}function Pt(t,e,n){const i=va(),r=i.components[t]?.defaultProps,a=typeof r=="function"?r(i):r;return{...e,...a,...eA(n)}}function B3(t){return Yu(t).reduce((e,n)=>t[n]!==void 0?`${e}${qle(n)}:${t[n]};`:e,"").trim()}function Vce({selector:t,styles:e,media:n,container:i}){const r=e?B3(e):"",a=Array.isArray(n)?n.map(o=>`@media${o.query}{${t}{${B3(o.styles)}}}`):[],s=Array.isArray(i)?i.map(o=>`@container ${o.query}{${t}{${B3(o.styles)}}}`):[];return`${r?`${t}{${r}}`:""}${a.join("")}${s.join("")}`.trim()}function kX(t){const e=iA();return k.jsx("style",{"data-mantine-styles":"inline",nonce:e?.(),dangerouslySetInnerHTML:{__html:Vce(t)}})}function T_(t){const{m:e,mx:n,my:i,mt:r,mb:a,ml:s,mr:o,me:l,ms:c,p:u,px:f,py:h,pt:d,pb:g,pl:b,pr:y,pe:p,ps:x,bd:_,bdrs:w,bg:M,c:S,opacity:A,ff:C,fz:D,fw:R,lts:N,ta:U,lh:j,fs:z,tt:q,td:B,w:G,miw:H,maw:W,h:F,mih:Y,mah:Z,bgsz:V,bgp:de,bgr:se,bga:oe,pos:ue,top:_e,left:ke,bottom:Ne,right:Ue,inset:ze,display:pe,flex:Fe,hiddenFrom:Ie,visibleFrom:qe,lightHidden:we,darkHidden:Te,sx:Ae,...Pe}=t;return{styleProps:eA({m:e,mx:n,my:i,mt:r,mb:a,ml:s,mr:o,me:l,ms:c,p:u,px:f,py:h,pt:d,pb:g,pl:b,pr:y,pe:p,ps:x,bd:_,bg:M,c:S,opacity:A,ff:C,fz:D,fw:R,lts:N,ta:U,lh:j,fs:z,tt:q,td:B,w:G,miw:H,maw:W,h:F,mih:Y,mah:Z,bgsz:V,bgp:de,bgr:se,bga:oe,pos:ue,top:_e,left:ke,bottom:Ne,right:Ue,inset:ze,display:pe,flex:Fe,bdrs:w,hiddenFrom:Ie,visibleFrom:qe,lightHidden:we,darkHidden:Te,sx:Ae}),rest:Pe}}const Gce={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bdrs:{type:"radius",property:"borderRadius"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function yL(t,e){const n=fh({color:t,theme:e});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function Wce(t,e){const n=fh({color:t,theme:e});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:yL(t,e)}function qce(t,e){if(typeof t=="number")return Et(t);if(typeof t=="string"){const[n,i,...r]=t.split(" ").filter(s=>s.trim()!=="");let a=`${Et(n)}`;return i&&(a+=` ${i}`),r.length>0&&(a+=` ${yL(r.join(" "),e)}`),a.trim()}return t}const DB={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function Xce(t){return typeof t=="string"&&t in DB?DB[t]:t}const Kce=["h1","h2","h3","h4","h5","h6"];function Yce(t,e){return typeof t=="string"&&t in e.fontSizes?`var(--mantine-font-size-${t})`:typeof t=="string"&&Kce.includes(t)?`var(--mantine-${t}-font-size)`:typeof t=="number"||typeof t=="string"?Et(t):t}function Jce(t){return t}const $ce=["h1","h2","h3","h4","h5","h6"];function Zce(t,e){return typeof t=="string"&&t in e.lineHeights?`var(--mantine-line-height-${t})`:typeof t=="string"&&$ce.includes(t)?`var(--mantine-${t}-line-height)`:t}function Qce(t,e){return typeof t=="string"&&t in e.radius?`var(--mantine-radius-${t})`:typeof t=="number"||typeof t=="string"?Et(t):t}function eue(t){return typeof t=="number"?Et(t):t}function tue(t,e){if(typeof t=="number")return Et(t);if(typeof t=="string"){const n=t.replace("-","");if(!(n in e.spacing))return Et(t);const i=`--mantine-spacing-${n}`;return t.startsWith("-")?`calc(var(${i}) * -1)`:`var(${i})`}return t}const z3={color:yL,textColor:Wce,fontSize:Yce,spacing:tue,radius:Qce,identity:Jce,size:eue,lineHeight:Zce,fontFamily:Xce,border:qce};function OB(t){return t.replace("(min-width: ","").replace("em)","")}function nue({media:t,...e}){const i=Object.keys(t).sort((r,a)=>Number(OB(r))-Number(OB(a))).map(r=>({query:r,styles:t[r]}));return{...e,media:i}}function iue(t){if(typeof t!="object"||t===null)return!1;const e=Object.keys(t);return!(e.length===1&&e[0]==="base")}function rue(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function aue(t){return typeof t=="object"&&t!==null?Yu(t).filter(e=>e!=="base"):[]}function sue(t,e){return typeof t=="object"&&t!==null&&e in t?t[e]:t}function DX({styleProps:t,data:e,theme:n}){return nue(Yu(t).reduce((i,r)=>{if(r==="hiddenFrom"||r==="visibleFrom"||r==="sx")return i;const a=e[r],s=Array.isArray(a.property)?a.property:[a.property],o=rue(t[r]);if(!iue(t[r]))return s.forEach(c=>{i.inlineStyles[c]=z3[a.type](o,n)}),i;i.hasResponsiveStyles=!0;const l=aue(t[r]);return s.forEach(c=>{o!=null&&(i.styles[c]=z3[a.type](o,n)),l.forEach(u=>{const f=`(min-width: ${n.breakpoints[u]})`;i.media[f]={...i.media[f],[c]:z3[a.type](sue(t[r],u),n)}})}),i},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function OX(){return`__m__-${I.useId().replace(/[:«»]/g,"")}`}function xL(t,e){return Array.isArray(t)?[...t].reduce((n,i)=>({...n,...xL(i,e)}),{}):typeof t=="function"?t(e):t??{}}function IX(t){return t.startsWith("data-")?t:`data-${t}`}function oue(t){return Object.keys(t).reduce((e,n)=>{const i=t[n];return i===void 0||i===""||i===!1||i===null||(e[IX(n)]=t[n]),e},{})}function NX(t){return t?typeof t=="string"?{[IX(t)]:!0}:Array.isArray(t)?[...t].reduce((e,n)=>({...e,...NX(n)}),{}):oue(t):null}function CO(t,e){return Array.isArray(t)?[...t].reduce((n,i)=>({...n,...CO(i,e)}),{}):typeof t=="function"?t(e):t??{}}function lue({theme:t,style:e,vars:n,styleProps:i}){const r=CO(e,t),a=CO(n,t);return{...r,...a,...i}}const LX=I.forwardRef(({component:t,style:e,__vars:n,className:i,variant:r,mod:a,size:s,hiddenFrom:o,visibleFrom:l,lightHidden:c,darkHidden:u,renderRoot:f,__size:h,...d},g)=>{const b=va(),y=t||"div",{styleProps:p,rest:x}=T_(d),w=cce()?.()?.(p.sx),M=OX(),S=DX({styleProps:p,theme:b,data:Gce}),A={ref:g,style:lue({theme:b,style:e,vars:n,styleProps:S.inlineStyles}),className:as(i,w,{[M]:S.hasResponsiveStyles,"mantine-light-hidden":c,"mantine-dark-hidden":u,[`mantine-hidden-from-${o}`]:o,[`mantine-visible-from-${l}`]:l}),"data-variant":r,"data-size":_X(s)?void 0:s||void 0,size:h,...NX(a),...x};return k.jsxs(k.Fragment,{children:[S.hasResponsiveStyles&&k.jsx(kX,{selector:`.${M}`,styles:S.styles,media:S.media}),typeof f=="function"?f(A):k.jsx(y,{...A})]})});LX.displayName="@mantine/core/Box";const ut=LX;function PX(t){return t}function tn(t){const e=I.forwardRef(t);return e.extend=PX,e.withProps=n=>{const i=I.forwardRef((r,a)=>k.jsx(e,{...n,...r,ref:a}));return i.extend=e.extend,i.displayName=`WithProps(${e.displayName})`,i},e}function kl(t){const e=I.forwardRef(t);return e.withProps=n=>{const i=I.forwardRef((r,a)=>k.jsx(e,{...n,...r,ref:a}));return i.extend=e.extend,i.displayName=`WithProps(${e.displayName})`,i},e.extend=PX,e}const cue=I.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Rv(){return I.useContext(cue)}function uue(t){if(!t||typeof t=="string")return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function j3(t){return t?.current?t.current.scrollHeight:"auto"}const Ny=typeof window<"u"&&window.requestAnimationFrame,IB=0,fue=t=>({height:0,overflow:"hidden",...t?{}:{display:"none"}});function hue({transitionDuration:t,transitionTimingFunction:e="ease",onTransitionEnd:n=()=>{},opened:i,keepMounted:r=!1}){const a=I.useRef(null),s=fue(r),[o,l]=I.useState(i?{}:s),c=g=>{o_.flushSync(()=>l(g))},u=g=>{c(b=>({...b,...g}))};function f(g){const b=t||uue(g);return{transition:`height ${b}ms ${e}, opacity ${b}ms ${e}`}}vc(()=>{typeof Ny=="function"&&Ny(i?()=>{u({willChange:"height",display:"block",overflow:"hidden"}),Ny(()=>{const g=j3(a);u({...f(g),height:g})})}:()=>{const g=j3(a);u({...f(g),willChange:"height",height:g}),Ny(()=>u({height:IB,overflow:"hidden"}))})},[i]);const h=g=>{if(!(g.target!==a.current||g.propertyName!=="height"))if(i){const b=j3(a);b===o.height?c({}):u({height:b}),n()}else o.height===IB&&(c(s),n())};function d({style:g={},refKey:b="ref",...y}={}){const p=y[b],x={"aria-hidden":!i,...y,[b]:rX(a,p),onTransitionEnd:h,style:{boxSizing:"border-box",...g,...o}};return Ee.version.startsWith("18")?i||(x.inert=""):x.inert=!i,x}return d}const due={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},hh=tn((t,e)=>{const{children:n,in:i,transitionDuration:r,transitionTimingFunction:a,style:s,onTransitionEnd:o,animateOpacity:l,keepMounted:c,...u}=Pt("Collapse",due,t),f=va(),h=ZT(),g=(f.respectReducedMotion?h:!1)?0:r,b=hue({opened:i,transitionDuration:g,transitionTimingFunction:a,onTransitionEnd:o,keepMounted:c});return g===0?i?k.jsx(ut,{...u,children:n}):null:k.jsx(ut,{...b({style:{opacity:i||!l?1:0,transition:l?`opacity ${g}ms ${a}`:"none",...xL(s,f)},ref:e,...u}),children:n})});hh.displayName="@mantine/core/Collapse";function oA(){return typeof window<"u"}function kv(t){return UX(t)?(t.nodeName||"").toLowerCase():"#document"}function jo(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hf(t){var e;return(e=(UX(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function UX(t){return oA()?t instanceof Node||t instanceof jo(t).Node:!1}function Fr(t){return oA()?t instanceof Element||t instanceof jo(t).Element:!1}function Cl(t){return oA()?t instanceof HTMLElement||t instanceof jo(t).HTMLElement:!1}function RO(t){return!oA()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof jo(t).ShadowRoot}const pue=new Set(["inline","contents"]);function A_(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Sc(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!pue.has(r)}const mue=new Set(["table","td","th"]);function gue(t){return mue.has(kv(t))}const bue=[":popover-open",":modal"];function lA(t){return bue.some(e=>{try{return t.matches(e)}catch{return!1}})}const vue=["transform","translate","scale","rotate","perspective"],yue=["transform","translate","scale","rotate","perspective","filter"],xue=["paint","layout","strict","content"];function _L(t){const e=cA(),n=Fr(t)?Sc(t):t;return vue.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||yue.some(i=>(n.willChange||"").includes(i))||xue.some(i=>(n.contain||"").includes(i))}function _ue(t){let e=dh(t);for(;Cl(e)&&!th(e);){if(_L(e))return e;if(lA(e))return null;e=dh(e)}return null}function cA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Sue=new Set(["html","body","#document"]);function th(t){return Sue.has(kv(t))}function Sc(t){return jo(t).getComputedStyle(t)}function uA(t){return Fr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dh(t){if(kv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||RO(t)&&t.host||hf(t);return RO(e)?e.host:e}function FX(t){const e=dh(t);return th(e)?t.ownerDocument?t.ownerDocument.body:t.body:Cl(e)&&A_(e)?e:FX(e)}function nh(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=FX(t),a=r===((i=t.ownerDocument)==null?void 0:i.body),s=jo(r);if(a){const o=kO(s);return e.concat(s,s.visualViewport||[],A_(r)?r:[],o&&n?nh(o):[])}return e.concat(r,nh(r,[],n))}function kO(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const wue=["top","right","bottom","left"],pu=Math.min,Qs=Math.max,l2=Math.round,nw=Math.floor,Ju=t=>({x:t,y:t}),Eue={left:"right",right:"left",bottom:"top",top:"bottom"},Mue={start:"end",end:"start"};function DO(t,e,n){return Qs(t,pu(e,n))}function nf(t,e){return typeof t=="function"?t(e):t}function mu(t){return t.split("-")[0]}function Dv(t){return t.split("-")[1]}function SL(t){return t==="x"?"y":"x"}function wL(t){return t==="y"?"height":"width"}const Tue=new Set(["top","bottom"]);function su(t){return Tue.has(mu(t))?"y":"x"}function EL(t){return SL(su(t))}function Aue(t,e,n){n===void 0&&(n=!1);const i=Dv(t),r=EL(t),a=wL(r);let s=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=c2(s)),[s,c2(s)]}function Cue(t){const e=c2(t);return[OO(t),e,OO(e)]}function OO(t){return t.replace(/start|end/g,e=>Mue[e])}const NB=["left","right"],LB=["right","left"],Rue=["top","bottom"],kue=["bottom","top"];function Due(t,e,n){switch(t){case"top":case"bottom":return n?e?LB:NB:e?NB:LB;case"left":case"right":return e?Rue:kue;default:return[]}}function Oue(t,e,n,i){const r=Dv(t);let a=Due(mu(t),n==="start",i);return r&&(a=a.map(s=>s+"-"+r),e&&(a=a.concat(a.map(OO)))),a}function c2(t){return t.replace(/left|right|bottom|top/g,e=>Eue[e])}function Iue(t){return{top:0,right:0,bottom:0,left:0,...t}}function ML(t){return typeof t!="number"?Iue(t):{top:t,right:t,bottom:t,left:t}}function H0(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function Nue(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function Lue(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:i}=e;return n+"/"+i}).join(" "):navigator.userAgent}function Pue(){return/apple/i.test(navigator.vendor)}function Uue(){return Nue().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Fue(){return Lue().includes("jsdom/")}const PB="data-floating-ui-focusable",Bue="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function UB(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function I1(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&RO(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Fb(t){return"composedPath"in t?t.composedPath()[0]:t.target}function H3(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function zue(t){return t.matches("html,body")}function nm(t){return t?.ownerDocument||document}function jue(t){return Cl(t)&&t.matches(Bue)}function Hue(t){if(!t||Fue())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function Vue(t){return t?t.hasAttribute(PB)?t:t.querySelector("["+PB+"]")||t:null}function sM(t,e,n){return n===void 0&&(n=!0),t.filter(r=>{var a;return r.parentId===e&&(!n||((a=r.context)==null?void 0:a.open))}).flatMap(r=>[r,...sM(t,r.id,n)])}function Gue(t){return"nativeEvent"in t}function IO(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var Wue=typeof document<"u",que=function(){},$u=Wue?I.useLayoutEffect:que;const Xue={...d7};function iw(t){const e=I.useRef(t);return $u(()=>{e.current=t}),e}const Kue=Xue.useInsertionEffect,Yue=Kue||(t=>t());function zu(t){const e=I.useRef(()=>{});return Yue(()=>{e.current=t}),I.useCallback(function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.current==null?void 0:e.current(...i)},[])}function FB(t,e,n){let{reference:i,floating:r}=t;const a=su(e),s=EL(e),o=wL(s),l=mu(e),c=a==="y",u=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[o]/2-r[o]/2;let d;switch(l){case"top":d={x:u,y:i.y-r.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-r.width,y:f};break;default:d={x:i.x,y:i.y}}switch(Dv(e)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1);break}return d}const Jue=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=FB(c,i,l),h=i,d={},g=0;for(let b=0;b<o.length;b++){const{name:y,fn:p}=o[b],{x,y:_,data:w,reset:M}=await p({x:u,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:d,rects:c,platform:s,elements:{reference:t,floating:e}});u=x??u,f=_??f,d={...d,[y]:{...d[y],...w}},M&&g<=50&&(g++,typeof M=="object"&&(M.placement&&(h=M.placement),M.rects&&(c=M.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):M.rects),{x:u,y:f}=FB(c,h,l)),b=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:d}};async function N1(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:a,rects:s,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=nf(e,t),g=ML(d),y=o[h?f==="floating"?"reference":"floating":f],p=H0(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(o.floating)),boundary:c,rootBoundary:u,strategy:l})),x=f==="floating"?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,_=await(a.getOffsetParent==null?void 0:a.getOffsetParent(o.floating)),w=await(a.isElement==null?void 0:a.isElement(_))?await(a.getScale==null?void 0:a.getScale(_))||{x:1,y:1}:{x:1,y:1},M=H0(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:x,offsetParent:_,strategy:l}):x);return{top:(p.top-M.top+g.top)/w.y,bottom:(M.bottom-p.bottom+g.bottom)/w.y,left:(p.left-M.left+g.left)/w.x,right:(M.right-p.right+g.right)/w.x}}const $ue=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:a,platform:s,elements:o,middlewareData:l}=e,{element:c,padding:u=0}=nf(t,e)||{};if(c==null)return{};const f=ML(u),h={x:n,y:i},d=EL(r),g=wL(d),b=await s.getDimensions(c),y=d==="y",p=y?"top":"left",x=y?"bottom":"right",_=y?"clientHeight":"clientWidth",w=a.reference[g]+a.reference[d]-h[d]-a.floating[g],M=h[d]-a.reference[d],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=S?S[_]:0;(!A||!await(s.isElement==null?void 0:s.isElement(S)))&&(A=o.floating[_]||a.floating[g]);const C=w/2-M/2,D=A/2-b[g]/2-1,R=pu(f[p],D),N=pu(f[x],D),U=R,j=A-b[g]-N,z=A/2-b[g]/2+C,q=DO(U,z,j),B=!l.arrow&&Dv(r)!=null&&z!==q&&a.reference[g]/2-(z<U?R:N)-b[g]/2<0,G=B?z<U?z-U:z-j:0;return{[d]:h[d]+G,data:{[d]:q,centerOffset:z-q-G,...B&&{alignmentOffset:G}},reset:B}}}),Zue=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:a,rects:s,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...y}=nf(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const p=mu(r),x=su(o),_=mu(o)===o,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=h||(_||!b?[c2(o)]:Cue(o)),S=g!=="none";!h&&S&&M.push(...Oue(o,b,g,w));const A=[o,...M],C=await N1(e,y),D=[];let R=((i=a.flip)==null?void 0:i.overflows)||[];if(u&&D.push(C[p]),f){const z=Aue(r,s,w);D.push(C[z[0]],C[z[1]])}if(R=[...R,{placement:r,overflows:D}],!D.every(z=>z<=0)){var N,U;const z=(((N=a.flip)==null?void 0:N.index)||0)+1,q=A[z];if(q&&(!(f==="alignment"?x!==su(q):!1)||R.every(H=>su(H.placement)===x?H.overflows[0]>0:!0)))return{data:{index:z,overflows:R},reset:{placement:q}};let B=(U=R.filter(G=>G.overflows[0]<=0).sort((G,H)=>G.overflows[1]-H.overflows[1])[0])==null?void 0:U.placement;if(!B)switch(d){case"bestFit":{var j;const G=(j=R.filter(H=>{if(S){const W=su(H.placement);return W===x||W==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(W=>W>0).reduce((W,F)=>W+F,0)]).sort((H,W)=>H[1]-W[1])[0])==null?void 0:j[0];G&&(B=G);break}case"initialPlacement":B=o;break}if(r!==B)return{reset:{placement:B}}}return{}}}};function BB(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function zB(t){return wue.some(e=>t[e]>=0)}const Que=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=nf(t,e);switch(i){case"referenceHidden":{const a=await N1(e,{...r,elementContext:"reference"}),s=BB(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:zB(s)}}}case"escaped":{const a=await N1(e,{...r,altBoundary:!0}),s=BB(a,n.floating);return{data:{escapedOffsets:s,escaped:zB(s)}}}default:return{}}}}};function BX(t){const e=pu(...t.map(a=>a.left)),n=pu(...t.map(a=>a.top)),i=Qs(...t.map(a=>a.right)),r=Qs(...t.map(a=>a.bottom));return{x:e,y:n,width:i-e,height:r-n}}function efe(t){const e=t.slice().sort((r,a)=>r.y-a.y),n=[];let i=null;for(let r=0;r<e.length;r++){const a=e[r];!i||a.y-i.y>i.height/2?n.push([a]):n[n.length-1].push(a),i=a}return n.map(r=>H0(BX(r)))}const tfe=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:r,platform:a,strategy:s}=e,{padding:o=2,x:l,y:c}=nf(t,e),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(i.reference))||[]),f=efe(u),h=H0(BX(u)),d=ML(o);function g(){if(f.length===2&&f[0].left>f[1].right&&l!=null&&c!=null)return f.find(y=>l>y.left-d.left&&l<y.right+d.right&&c>y.top-d.top&&c<y.bottom+d.bottom)||h;if(f.length>=2){if(su(n)==="y"){const R=f[0],N=f[f.length-1],U=mu(n)==="top",j=R.top,z=N.bottom,q=U?R.left:N.left,B=U?R.right:N.right,G=B-q,H=z-j;return{top:j,bottom:z,left:q,right:B,width:G,height:H,x:q,y:j}}const y=mu(n)==="left",p=Qs(...f.map(R=>R.right)),x=pu(...f.map(R=>R.left)),_=f.filter(R=>y?R.left===x:R.right===p),w=_[0].top,M=_[_.length-1].bottom,S=x,A=p,C=A-S,D=M-w;return{top:w,bottom:M,left:S,right:A,width:C,height:D,x:S,y:w}}return h}const b=await a.getElementRects({reference:{getBoundingClientRect:g},floating:i.floating,strategy:s});return r.reference.x!==b.reference.x||r.reference.y!==b.reference.y||r.reference.width!==b.reference.width||r.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}},zX=new Set(["left","top"]);async function nfe(t,e){const{placement:n,platform:i,elements:r}=t,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),s=mu(n),o=Dv(n),l=su(n)==="y",c=zX.has(s)?-1:1,u=a&&l?-1:1,f=nf(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof g=="number"&&(d=o==="end"?g*-1:g),l?{x:d*u,y:h*c}:{x:h*c,y:d*u}}const ife=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:a,placement:s,middlewareData:o}=e,l=await nfe(e,t);return s===((n=o.offset)==null?void 0:n.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:s}}}}},rfe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:o={fn:y=>{let{x:p,y:x}=y;return{x:p,y:x}}},...l}=nf(t,e),c={x:n,y:i},u=await N1(e,l),f=su(mu(r)),h=SL(f);let d=c[h],g=c[f];if(a){const y=h==="y"?"top":"left",p=h==="y"?"bottom":"right",x=d+u[y],_=d-u[p];d=DO(x,d,_)}if(s){const y=f==="y"?"top":"left",p=f==="y"?"bottom":"right",x=g+u[y],_=g-u[p];g=DO(x,g,_)}const b=o.fn({...e,[h]:d,[f]:g});return{...b,data:{x:b.x-n,y:b.y-i,enabled:{[h]:a,[f]:s}}}}}},afe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:a,middlewareData:s}=e,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=nf(t,e),u={x:n,y:i},f=su(r),h=SL(f);let d=u[h],g=u[f];const b=nf(o,e),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const _=h==="y"?"height":"width",w=a.reference[h]-a.floating[_]+y.mainAxis,M=a.reference[h]+a.reference[_]-y.mainAxis;d<w?d=w:d>M&&(d=M)}if(c){var p,x;const _=h==="y"?"width":"height",w=zX.has(mu(r)),M=a.reference[f]-a.floating[_]+(w&&((p=s.offset)==null?void 0:p[f])||0)+(w?0:y.crossAxis),S=a.reference[f]+a.reference[_]+(w?0:((x=s.offset)==null?void 0:x[f])||0)-(w?y.crossAxis:0);g<M?g=M:g>S&&(g=S)}return{[h]:d,[f]:g}}}},sfe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:a,platform:s,elements:o}=e,{apply:l=()=>{},...c}=nf(t,e),u=await N1(e,c),f=mu(r),h=Dv(r),d=su(r)==="y",{width:g,height:b}=a.floating;let y,p;f==="top"||f==="bottom"?(y=f,p=h===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(p=f,y=h==="end"?"top":"bottom");const x=b-u.top-u.bottom,_=g-u.left-u.right,w=pu(b-u[y],x),M=pu(g-u[p],_),S=!e.middlewareData.shift;let A=w,C=M;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(C=_),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(A=x),S&&!h){const R=Qs(u.left,0),N=Qs(u.right,0),U=Qs(u.top,0),j=Qs(u.bottom,0);d?C=g-2*(R!==0||N!==0?R+N:Qs(u.left,u.right)):A=b-2*(U!==0||j!==0?U+j:Qs(u.top,u.bottom))}await l({...e,availableWidth:C,availableHeight:A});const D=await s.getDimensions(o.floating);return g!==D.width||b!==D.height?{reset:{rects:!0}}:{}}}};function jX(t){const e=Sc(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Cl(t),a=r?t.offsetWidth:n,s=r?t.offsetHeight:i,o=l2(n)!==a||l2(i)!==s;return o&&(n=a,i=s),{width:n,height:i,$:o}}function TL(t){return Fr(t)?t:t.contextElement}function m0(t){const e=TL(t);if(!Cl(e))return Ju(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:a}=jX(e);let s=(a?l2(n.width):n.width)/i,o=(a?l2(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!o||!Number.isFinite(o))&&(o=1),{x:s,y:o}}const ofe=Ju(0);function HX(t){const e=jo(t);return!cA()||!e.visualViewport?ofe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lfe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==jo(t)?!1:e}function Bm(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),a=TL(t);let s=Ju(1);e&&(i?Fr(i)&&(s=m0(i)):s=m0(t));const o=lfe(a,n,i)?HX(a):Ju(0);let l=(r.left+o.x)/s.x,c=(r.top+o.y)/s.y,u=r.width/s.x,f=r.height/s.y;if(a){const h=jo(a),d=i&&Fr(i)?jo(i):i;let g=h,b=kO(g);for(;b&&i&&d!==g;){const y=m0(b),p=b.getBoundingClientRect(),x=Sc(b),_=p.left+(b.clientLeft+parseFloat(x.paddingLeft))*y.x,w=p.top+(b.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=_,c+=w,g=jo(b),b=kO(g)}}return H0({width:u,height:f,x:l,y:c})}function fA(t,e){const n=uA(t).scrollLeft;return e?e.left+n:Bm(hf(t)).left+n}function VX(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-fA(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function cfe(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const a=r==="fixed",s=hf(i),o=e?lA(e.floating):!1;if(i===s||o&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Ju(1);const u=Ju(0),f=Cl(i);if((f||!f&&!a)&&((kv(i)!=="body"||A_(s))&&(l=uA(i)),Cl(i))){const d=Bm(i);c=m0(i),u.x=d.x+i.clientLeft,u.y=d.y+i.clientTop}const h=s&&!f&&!a?VX(s,l):Ju(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function ufe(t){return Array.from(t.getClientRects())}function ffe(t){const e=hf(t),n=uA(t),i=t.ownerDocument.body,r=Qs(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=Qs(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+fA(t);const o=-n.scrollTop;return Sc(i).direction==="rtl"&&(s+=Qs(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:s,y:o}}const jB=25;function hfe(t,e){const n=jo(t),i=hf(t),r=n.visualViewport;let a=i.clientWidth,s=i.clientHeight,o=0,l=0;if(r){a=r.width,s=r.height;const u=cA();(!u||u&&e==="fixed")&&(o=r.offsetLeft,l=r.offsetTop)}const c=fA(i);if(c<=0){const u=i.ownerDocument,f=u.body,h=getComputedStyle(f),d=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(i.clientWidth-f.clientWidth-d);g<=jB&&(a-=g)}else c<=jB&&(a+=c);return{width:a,height:s,x:o,y:l}}const dfe=new Set(["absolute","fixed"]);function pfe(t,e){const n=Bm(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,a=Cl(t)?m0(t):Ju(1),s=t.clientWidth*a.x,o=t.clientHeight*a.y,l=r*a.x,c=i*a.y;return{width:s,height:o,x:l,y:c}}function HB(t,e,n){let i;if(e==="viewport")i=hfe(t,n);else if(e==="document")i=ffe(hf(t));else if(Fr(e))i=pfe(e,n);else{const r=HX(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return H0(i)}function GX(t,e){const n=dh(t);return n===e||!Fr(n)||th(n)?!1:Sc(n).position==="fixed"||GX(n,e)}function mfe(t,e){const n=e.get(t);if(n)return n;let i=nh(t,[],!1).filter(o=>Fr(o)&&kv(o)!=="body"),r=null;const a=Sc(t).position==="fixed";let s=a?dh(t):t;for(;Fr(s)&&!th(s);){const o=Sc(s),l=_L(s);!l&&o.position==="fixed"&&(r=null),(a?!l&&!r:!l&&o.position==="static"&&!!r&&dfe.has(r.position)||A_(s)&&!l&&GX(t,s))?i=i.filter(u=>u!==s):r=o,s=dh(s)}return e.set(t,i),i}function gfe(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const s=[...n==="clippingAncestors"?lA(e)?[]:mfe(e,this._c):[].concat(n),i],o=s[0],l=s.reduce((c,u)=>{const f=HB(e,u,r);return c.top=Qs(f.top,c.top),c.right=pu(f.right,c.right),c.bottom=pu(f.bottom,c.bottom),c.left=Qs(f.left,c.left),c},HB(e,o,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function bfe(t){const{width:e,height:n}=jX(t);return{width:e,height:n}}function vfe(t,e,n){const i=Cl(e),r=hf(e),a=n==="fixed",s=Bm(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const l=Ju(0);function c(){l.x=fA(r)}if(i||!i&&!a)if((kv(e)!=="body"||A_(r))&&(o=uA(e)),i){const d=Bm(e,!0,a,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else r&&c();a&&!i&&r&&c();const u=r&&!i&&!a?VX(r,o):Ju(0),f=s.left+o.scrollLeft-l.x-u.x,h=s.top+o.scrollTop-l.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function V3(t){return Sc(t).position==="static"}function VB(t,e){if(!Cl(t)||Sc(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return hf(t)===n&&(n=n.ownerDocument.body),n}function WX(t,e){const n=jo(t);if(lA(t))return n;if(!Cl(t)){let r=dh(t);for(;r&&!th(r);){if(Fr(r)&&!V3(r))return r;r=dh(r)}return n}let i=VB(t,e);for(;i&&gue(i)&&V3(i);)i=VB(i,e);return i&&th(i)&&V3(i)&&!_L(i)?n:i||_ue(t)||n}const yfe=async function(t){const e=this.getOffsetParent||WX,n=this.getDimensions,i=await n(t.floating);return{reference:vfe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function xfe(t){return Sc(t).direction==="rtl"}const _fe={convertOffsetParentRelativeRectToViewportRelativeRect:cfe,getDocumentElement:hf,getClippingRect:gfe,getOffsetParent:WX,getElementRects:yfe,getClientRects:ufe,getDimensions:bfe,getScale:m0,isElement:Fr,isRTL:xfe};function qX(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Sfe(t,e){let n=null,i;const r=hf(t);function a(){var o;clearTimeout(i),(o=n)==null||o.disconnect(),n=null}function s(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),a();const c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:d}=c;if(o||e(),!h||!d)return;const g=nw(f),b=nw(r.clientWidth-(u+h)),y=nw(r.clientHeight-(f+d)),p=nw(u),_={rootMargin:-g+"px "+-b+"px "+-y+"px "+-p+"px",threshold:Qs(0,pu(1,l))||1};let w=!0;function M(S){const A=S[0].intersectionRatio;if(A!==l){if(!w)return s();A?s(!1,A):i=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!qX(c,t.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(M,{..._,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,_)}n.observe(t)}return s(!0),a}function NO(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=TL(t),u=r||a?[...c?nh(c):[],...nh(e)]:[];u.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),a&&p.addEventListener("resize",n)});const f=c&&o?Sfe(c,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(p=>{let[x]=p;x&&x.target===c&&d&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=d)==null||_.observe(e)})),n()}),c&&!l&&d.observe(c),d.observe(e));let g,b=l?Bm(t):null;l&&y();function y(){const p=Bm(t);b&&!qX(b,p)&&n(),b=p,g=requestAnimationFrame(y)}return n(),()=>{var p;u.forEach(x=>{r&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),f?.(),(p=d)==null||p.disconnect(),d=null,l&&cancelAnimationFrame(g)}}const wfe=ife,Efe=rfe,Mfe=Zue,Tfe=sfe,Afe=Que,GB=$ue,Cfe=tfe,Rfe=afe,kfe=(t,e,n)=>{const i=new Map,r={platform:_fe,...n},a={...r.platform,_c:i};return Jue(t,e,{...r,platform:a})};var Dfe=typeof document<"u",Ofe=function(){},oM=Dfe?I.useLayoutEffect:Ofe;function u2(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!u2(t[i],e[i]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=n;i--!==0;){const a=r[i];if(!(a==="_owner"&&t.$$typeof)&&!u2(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function XX(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function WB(t,e){const n=XX(t);return Math.round(e*n)/n}function G3(t){const e=I.useRef(t);return oM(()=>{e.current=t}),e}function Ife(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:a,floating:s}={},transform:o=!0,whileElementsMounted:l,open:c}=t,[u,f]=I.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,d]=I.useState(i);u2(h,i)||d(i);const[g,b]=I.useState(null),[y,p]=I.useState(null),x=I.useCallback(H=>{H!==S.current&&(S.current=H,b(H))},[]),_=I.useCallback(H=>{H!==A.current&&(A.current=H,p(H))},[]),w=a||g,M=s||y,S=I.useRef(null),A=I.useRef(null),C=I.useRef(u),D=l!=null,R=G3(l),N=G3(r),U=G3(c),j=I.useCallback(()=>{if(!S.current||!A.current)return;const H={placement:e,strategy:n,middleware:h};N.current&&(H.platform=N.current),kfe(S.current,A.current,H).then(W=>{const F={...W,isPositioned:U.current!==!1};z.current&&!u2(C.current,F)&&(C.current=F,o_.flushSync(()=>{f(F)}))})},[h,e,n,N,U]);oM(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(H=>({...H,isPositioned:!1})))},[c]);const z=I.useRef(!1);oM(()=>(z.current=!0,()=>{z.current=!1}),[]),oM(()=>{if(w&&(S.current=w),M&&(A.current=M),w&&M){if(R.current)return R.current(w,M,j);j()}},[w,M,j,R,D]);const q=I.useMemo(()=>({reference:S,floating:A,setReference:x,setFloating:_}),[x,_]),B=I.useMemo(()=>({reference:w,floating:M}),[w,M]),G=I.useMemo(()=>{const H={position:n,left:0,top:0};if(!B.floating)return H;const W=WB(B.floating,u.x),F=WB(B.floating,u.y);return o?{...H,transform:"translate("+W+"px, "+F+"px)",...XX(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:F}},[n,o,B.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:j,refs:q,elements:B,floatingStyles:G}),[u,j,q,B,G])}const Nfe=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:i,padding:r}=typeof t=="function"?t(n):t;return i&&e(i)?i.current!=null?GB({element:i.current,padding:r}).fn(n):{}:i?GB({element:i,padding:r}).fn(n):{}}}},KX=(t,e)=>({...wfe(t),options:[t,e]}),AL=(t,e)=>({...Efe(t),options:[t,e]}),qB=(t,e)=>({...Rfe(t),options:[t,e]}),f2=(t,e)=>({...Mfe(t),options:[t,e]}),Lfe=(t,e)=>({...Tfe(t),options:[t,e]}),Pfe=(t,e)=>({...Afe(t),options:[t,e]}),Yx=(t,e)=>({...Cfe(t),options:[t,e]}),YX=(t,e)=>({...Nfe(t),options:[t,e]});function JX(t){const e=I.useRef(void 0),n=I.useCallback(i=>{const r=t.map(a=>{if(a!=null){if(typeof a=="function"){const s=a,o=s(i);return typeof o=="function"?o:()=>{s(null)}}return a.current=i,()=>{a.current=null}}});return()=>{r.forEach(a=>a?.())}},t);return I.useMemo(()=>t.every(i=>i==null)?null:i=>{e.current&&(e.current(),e.current=void 0),i!=null&&(e.current=n(i))},t)}const Ufe="data-floating-ui-focusable",XB="active",KB="selected",Ffe={...d7};let YB=!1,Bfe=0;const JB=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Bfe++;function zfe(){const[t,e]=I.useState(()=>YB?JB():void 0);return $u(()=>{t==null&&e(JB())},[]),I.useEffect(()=>{YB=!0},[]),t}const jfe=Ffe.useId,$X=jfe||zfe;function Hfe(){const t=new Map;return{emit(e,n){var i;(i=t.get(e))==null||i.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var i;(i=t.get(e))==null||i.delete(n)}}}const Vfe=I.createContext(null),Gfe=I.createContext(null),CL=()=>{var t;return((t=I.useContext(Vfe))==null?void 0:t.id)||null},RL=()=>I.useContext(Gfe);function kL(t){return"data-floating-ui-"+t}function Yl(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}const $B=kL("safe-polygon");function lM(t,e,n){if(n&&!IO(n))return 0;if(typeof t=="number")return t;if(typeof t=="function"){const i=t();return typeof i=="number"?i:i?.[e]}return t?.[e]}function W3(t){return typeof t=="function"?t():t}function Wfe(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,dataRef:r,events:a,elements:s}=t,{enabled:o=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:h=!0}=e,d=RL(),g=CL(),b=iw(c),y=iw(l),p=iw(n),x=iw(f),_=I.useRef(),w=I.useRef(-1),M=I.useRef(),S=I.useRef(-1),A=I.useRef(!0),C=I.useRef(!1),D=I.useRef(()=>{}),R=I.useRef(!1),N=zu(()=>{var G;const H=(G=r.current.openEvent)==null?void 0:G.type;return H?.includes("mouse")&&H!=="mousedown"});I.useEffect(()=>{if(!o)return;function G(H){let{open:W}=H;W||(Yl(w),Yl(S),A.current=!0,R.current=!1)}return a.on("openchange",G),()=>{a.off("openchange",G)}},[o,a]),I.useEffect(()=>{if(!o||!b.current||!n)return;function G(W){N()&&i(!1,W,"hover")}const H=nm(s.floating).documentElement;return H.addEventListener("mouseleave",G),()=>{H.removeEventListener("mouseleave",G)}},[s.floating,n,i,o,b,N]);const U=I.useCallback(function(G,H,W){H===void 0&&(H=!0),W===void 0&&(W="hover");const F=lM(y.current,"close",_.current);F&&!M.current?(Yl(w),w.current=window.setTimeout(()=>i(!1,G,W),F)):H&&(Yl(w),i(!1,G,W))},[y,i]),j=zu(()=>{D.current(),M.current=void 0}),z=zu(()=>{if(C.current){const G=nm(s.floating).body;G.style.pointerEvents="",G.removeAttribute($B),C.current=!1}}),q=zu(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);I.useEffect(()=>{if(!o)return;function G(Z){if(Yl(w),A.current=!1,u&&!IO(_.current)||W3(x.current)>0&&!lM(y.current,"open"))return;const V=lM(y.current,"open",_.current);V?w.current=window.setTimeout(()=>{p.current||i(!0,Z,"hover")},V):n||i(!0,Z,"hover")}function H(Z){if(q()){z();return}D.current();const V=nm(s.floating);if(Yl(S),R.current=!1,b.current&&r.current.floatingContext){n||Yl(w),M.current=b.current({...r.current.floatingContext,tree:d,x:Z.clientX,y:Z.clientY,onClose(){z(),j(),q()||U(Z,!0,"safe-polygon")}});const se=M.current;V.addEventListener("mousemove",se),D.current=()=>{V.removeEventListener("mousemove",se)};return}(_.current==="touch"?!I1(s.floating,Z.relatedTarget):!0)&&U(Z)}function W(Z){q()||r.current.floatingContext&&(b.current==null||b.current({...r.current.floatingContext,tree:d,x:Z.clientX,y:Z.clientY,onClose(){z(),j(),q()||U(Z)}})(Z))}function F(){Yl(w)}function Y(Z){q()||U(Z,!1)}if(Fr(s.domReference)){const Z=s.domReference,V=s.floating;return n&&Z.addEventListener("mouseleave",W),h&&Z.addEventListener("mousemove",G,{once:!0}),Z.addEventListener("mouseenter",G),Z.addEventListener("mouseleave",H),V&&(V.addEventListener("mouseleave",W),V.addEventListener("mouseenter",F),V.addEventListener("mouseleave",Y)),()=>{n&&Z.removeEventListener("mouseleave",W),h&&Z.removeEventListener("mousemove",G),Z.removeEventListener("mouseenter",G),Z.removeEventListener("mouseleave",H),V&&(V.removeEventListener("mouseleave",W),V.removeEventListener("mouseenter",F),V.removeEventListener("mouseleave",Y))}}},[s,o,t,u,h,U,j,z,i,n,p,d,y,b,r,q,x]),$u(()=>{var G;if(o&&n&&(G=b.current)!=null&&(G=G.__options)!=null&&G.blockPointerEvents&&N()){C.current=!0;const W=s.floating;if(Fr(s.domReference)&&W){var H;const F=nm(s.floating).body;F.setAttribute($B,"");const Y=s.domReference,Z=d==null||(H=d.nodesRef.current.find(V=>V.id===g))==null||(H=H.context)==null?void 0:H.elements.floating;return Z&&(Z.style.pointerEvents=""),F.style.pointerEvents="none",Y.style.pointerEvents="auto",W.style.pointerEvents="auto",()=>{F.style.pointerEvents="",Y.style.pointerEvents="",W.style.pointerEvents=""}}}},[o,n,g,s,d,b,N]),$u(()=>{n||(_.current=void 0,R.current=!1,j(),z())},[n,j,z]),I.useEffect(()=>()=>{j(),Yl(w),Yl(S),z()},[o,s.domReference,j,z]);const B=I.useMemo(()=>{function G(H){_.current=H.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(H){const{nativeEvent:W}=H;function F(){!A.current&&!p.current&&i(!0,W,"hover")}u&&!IO(_.current)||n||W3(x.current)===0||R.current&&H.movementX**2+H.movementY**2<2||(Yl(S),_.current==="touch"?F():(R.current=!0,S.current=window.setTimeout(F,W3(x.current))))}}},[u,i,n,p,x]);return I.useMemo(()=>o?{reference:B}:{},[o,B])}const LO=()=>{},ZX=I.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:LO,setState:LO,isInstantPhase:!1}),qfe=()=>I.useContext(ZX);function Xfe(t){const{children:e,delay:n,timeoutMs:i=0}=t,[r,a]=I.useReducer((l,c)=>({...l,...c}),{delay:n,timeoutMs:i,initialDelay:n,currentId:null,isInstantPhase:!1}),s=I.useRef(null),o=I.useCallback(l=>{a({currentId:l})},[]);return $u(()=>{r.currentId?s.current===null?s.current=r.currentId:r.isInstantPhase||a({isInstantPhase:!0}):(r.isInstantPhase&&a({isInstantPhase:!1}),s.current=null)},[r.currentId,r.isInstantPhase]),k.jsx(ZX.Provider,{value:I.useMemo(()=>({...r,setState:a,setCurrentId:o}),[r,o]),children:e})}function Kfe(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,floatingId:r}=t,{id:a,enabled:s=!0}=e,o=a??r,l=qfe(),{currentId:c,setCurrentId:u,initialDelay:f,setState:h,timeoutMs:d}=l;return $u(()=>{s&&c&&(h({delay:{open:1,close:lM(f,"close")}}),c!==o&&i(!1))},[s,o,i,h,c,f]),$u(()=>{function g(){i(!1),h({delay:f,currentId:null})}if(s&&c&&!n&&c===o){if(d){const b=window.setTimeout(g,d);return()=>{clearTimeout(b)}}g()}},[s,n,h,c,o,i,f,d]),$u(()=>{s&&(u===LO||!n||u(o))},[s,n,u,o]),l}const Yfe={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Jfe={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ZB=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function $fe(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,elements:r,dataRef:a}=t,{enabled:s=!0,escapeKey:o=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:d,capture:g}=e,b=RL(),y=zu(typeof l=="function"?l:()=>!1),p=typeof l=="function"?y:l,x=I.useRef(!1),{escapeKey:_,outsidePress:w}=ZB(d),{escapeKey:M,outsidePress:S}=ZB(g),A=I.useRef(!1),C=zu(z=>{var q;if(!n||!s||!o||z.key!=="Escape"||A.current)return;const B=(q=a.current.floatingContext)==null?void 0:q.nodeId,G=b?sM(b.nodesRef.current,B):[];if(!_&&(z.stopPropagation(),G.length>0)){let H=!0;if(G.forEach(W=>{var F;if((F=W.context)!=null&&F.open&&!W.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}i(!1,Gue(z)?z.nativeEvent:z,"escape-key")}),D=zu(z=>{var q;const B=()=>{var G;C(z),(G=Fb(z))==null||G.removeEventListener("keydown",B)};(q=Fb(z))==null||q.addEventListener("keydown",B)}),R=zu(z=>{var q;const B=a.current.insideReactTree;a.current.insideReactTree=!1;const G=x.current;if(x.current=!1,c==="click"&&G||B||typeof p=="function"&&!p(z))return;const H=Fb(z),W="["+kL("inert")+"]",F=nm(r.floating).querySelectorAll(W);let Y=Fr(H)?H:null;for(;Y&&!th(Y);){const se=dh(Y);if(th(se)||!Fr(se))break;Y=se}if(F.length&&Fr(H)&&!zue(H)&&!I1(H,r.floating)&&Array.from(F).every(se=>!I1(Y,se)))return;if(Cl(H)&&j){const se=th(H),oe=Sc(H),ue=/auto|scroll/,_e=se||ue.test(oe.overflowX),ke=se||ue.test(oe.overflowY),Ne=_e&&H.clientWidth>0&&H.scrollWidth>H.clientWidth,Ue=ke&&H.clientHeight>0&&H.scrollHeight>H.clientHeight,ze=oe.direction==="rtl",pe=Ue&&(ze?z.offsetX<=H.offsetWidth-H.clientWidth:z.offsetX>H.clientWidth),Fe=Ne&&z.offsetY>H.clientHeight;if(pe||Fe)return}const Z=(q=a.current.floatingContext)==null?void 0:q.nodeId,V=b&&sM(b.nodesRef.current,Z).some(se=>{var oe;return H3(z,(oe=se.context)==null?void 0:oe.elements.floating)});if(H3(z,r.floating)||H3(z,r.domReference)||V)return;const de=b?sM(b.nodesRef.current,Z):[];if(de.length>0){let se=!0;if(de.forEach(oe=>{var ue;if((ue=oe.context)!=null&&ue.open&&!oe.context.dataRef.current.__outsidePressBubbles){se=!1;return}}),!se)return}i(!1,z,"outside-press")}),N=zu(z=>{var q;const B=()=>{var G;R(z),(G=Fb(z))==null||G.removeEventListener(c,B)};(q=Fb(z))==null||q.addEventListener(c,B)});I.useEffect(()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=_,a.current.__outsidePressBubbles=w;let z=-1;function q(F){i(!1,F,"ancestor-scroll")}function B(){window.clearTimeout(z),A.current=!0}function G(){z=window.setTimeout(()=>{A.current=!1},cA()?5:0)}const H=nm(r.floating);o&&(H.addEventListener("keydown",M?D:C,M),H.addEventListener("compositionstart",B),H.addEventListener("compositionend",G)),p&&H.addEventListener(c,S?N:R,S);let W=[];return h&&(Fr(r.domReference)&&(W=nh(r.domReference)),Fr(r.floating)&&(W=W.concat(nh(r.floating))),!Fr(r.reference)&&r.reference&&r.reference.contextElement&&(W=W.concat(nh(r.reference.contextElement)))),W=W.filter(F=>{var Y;return F!==((Y=H.defaultView)==null?void 0:Y.visualViewport)}),W.forEach(F=>{F.addEventListener("scroll",q,{passive:!0})}),()=>{o&&(H.removeEventListener("keydown",M?D:C,M),H.removeEventListener("compositionstart",B),H.removeEventListener("compositionend",G)),p&&H.removeEventListener(c,S?N:R,S),W.forEach(F=>{F.removeEventListener("scroll",q)}),window.clearTimeout(z)}},[a,r,o,p,c,n,i,h,s,_,w,C,M,D,R,S,N]),I.useEffect(()=>{a.current.insideReactTree=!1},[a,p,c]);const U=I.useMemo(()=>({onKeyDown:C,...u&&{[Yfe[f]]:z=>{i(!1,z.nativeEvent,"reference-press")},...f!=="click"&&{onClick(z){i(!1,z.nativeEvent,"reference-press")}}}}),[C,i,u,f]),j=I.useMemo(()=>({onKeyDown:C,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Jfe[c]]:()=>{a.current.insideReactTree=!0}}),[C,c,a]);return I.useMemo(()=>s?{reference:U,floating:j}:{},[s,U,j])}function Zfe(t){const{open:e=!1,onOpenChange:n,elements:i}=t,r=$X(),a=I.useRef({}),[s]=I.useState(()=>Hfe()),o=CL()!=null,[l,c]=I.useState(i.reference),u=zu((d,g,b)=>{a.current.openEvent=d?g:void 0,s.emit("openchange",{open:d,event:g,reason:b,nested:o}),n?.(d,g,b)}),f=I.useMemo(()=>({setPositionReference:c}),[]),h=I.useMemo(()=>({reference:l||i.reference||null,floating:i.floating||null,domReference:i.reference}),[l,i.reference,i.floating]);return I.useMemo(()=>({dataRef:a,open:e,onOpenChange:u,elements:h,events:s,floatingId:r,refs:f}),[e,u,h,s,r,f])}function DL(t){t===void 0&&(t={});const{nodeId:e}=t,n=Zfe({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||n,r=i.elements,[a,s]=I.useState(null),[o,l]=I.useState(null),u=r?.domReference||a,f=I.useRef(null),h=RL();$u(()=>{u&&(f.current=u)},[u]);const d=Ife({...t,elements:{...r,...o&&{reference:o}}}),g=I.useCallback(_=>{const w=Fr(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;l(w),d.refs.setReference(w)},[d.refs]),b=I.useCallback(_=>{(Fr(_)||_===null)&&(f.current=_,s(_)),(Fr(d.refs.reference.current)||d.refs.reference.current===null||_!==null&&!Fr(_))&&d.refs.setReference(_)},[d.refs]),y=I.useMemo(()=>({...d.refs,setReference:b,setPositionReference:g,domReference:f}),[d.refs,b,g]),p=I.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),x=I.useMemo(()=>({...d,...i,refs:y,elements:p,nodeId:e}),[d,y,p,e,i]);return $u(()=>{i.dataRef.current.floatingContext=x;const _=h?.nodesRef.current.find(w=>w.id===e);_&&(_.context=x)}),I.useMemo(()=>({...d,context:x,refs:y,elements:p}),[d,y,p,x])}function q3(){return Uue()&&Pue()}function Qfe(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,events:r,dataRef:a,elements:s}=t,{enabled:o=!0,visibleOnly:l=!0}=e,c=I.useRef(!1),u=I.useRef(-1),f=I.useRef(!0);I.useEffect(()=>{if(!o)return;const d=jo(s.domReference);function g(){!n&&Cl(s.domReference)&&s.domReference===UB(nm(s.domReference))&&(c.current=!0)}function b(){f.current=!0}function y(){f.current=!1}return d.addEventListener("blur",g),q3()&&(d.addEventListener("keydown",b,!0),d.addEventListener("pointerdown",y,!0)),()=>{d.removeEventListener("blur",g),q3()&&(d.removeEventListener("keydown",b,!0),d.removeEventListener("pointerdown",y,!0))}},[s.domReference,n,o]),I.useEffect(()=>{if(!o)return;function d(g){let{reason:b}=g;(b==="reference-press"||b==="escape-key")&&(c.current=!0)}return r.on("openchange",d),()=>{r.off("openchange",d)}},[r,o]),I.useEffect(()=>()=>{Yl(u)},[]);const h=I.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(d){if(c.current)return;const g=Fb(d.nativeEvent);if(l&&Fr(g)){if(q3()&&!d.relatedTarget){if(!f.current&&!jue(g))return}else if(!Hue(g))return}i(!0,d.nativeEvent,"focus")},onBlur(d){c.current=!1;const g=d.relatedTarget,b=d.nativeEvent,y=Fr(g)&&g.hasAttribute(kL("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var p;const x=UB(s.domReference?s.domReference.ownerDocument:document);!g&&x===s.domReference||I1((p=a.current.floatingContext)==null?void 0:p.refs.floating.current,x)||I1(s.domReference,x)||y||i(!1,b,"focus")})}}),[a,s.domReference,i,l]);return I.useMemo(()=>o?{reference:h}:{},[o,h])}function X3(t,e,n){const i=new Map,r=n==="item";let a=t;if(r&&t){const{[XB]:s,[KB]:o,...l}=t;a=l}return{...n==="floating"&&{tabIndex:-1,[Ufe]:""},...a,...e.map(s=>{const o=s?s[n]:null;return typeof o=="function"?t?o(t):null:o}).concat(t).reduce((s,o)=>(o&&Object.entries(o).forEach(l=>{let[c,u]=l;if(!(r&&[XB,KB].includes(c)))if(c.indexOf("on")===0){if(i.has(c)||i.set(c,[]),typeof u=="function"){var f;(f=i.get(c))==null||f.push(u),s[c]=function(){for(var h,d=arguments.length,g=new Array(d),b=0;b<d;b++)g[b]=arguments[b];return(h=i.get(c))==null?void 0:h.map(y=>y(...g)).find(y=>y!==void 0)}}}else s[c]=u}),s),{})}}function ehe(t){t===void 0&&(t=[]);const e=t.map(o=>o?.reference),n=t.map(o=>o?.floating),i=t.map(o=>o?.item),r=I.useCallback(o=>X3(o,t,"reference"),e),a=I.useCallback(o=>X3(o,t,"floating"),n),s=I.useCallback(o=>X3(o,t,"item"),i);return I.useMemo(()=>({getReferenceProps:r,getFloatingProps:a,getItemProps:s}),[r,a,s])}const the=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function nhe(t,e){var n,i;e===void 0&&(e={});const{open:r,elements:a,floatingId:s}=t,{enabled:o=!0,role:l="dialog"}=e,c=$X(),u=((n=a.domReference)==null?void 0:n.id)||c,f=I.useMemo(()=>{var x;return((x=Vue(a.floating))==null?void 0:x.id)||s},[a.floating,s]),h=(i=the.get(l))!=null?i:l,g=CL()!=null,b=I.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?f:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":r?f:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:u},...h==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,f,g,r,u,l]),y=I.useMemo(()=>{const x={id:f,...h&&{role:h}};return h==="tooltip"||l==="label"?x:{...x,...h==="menu"&&{"aria-labelledby":u}}},[h,f,u,l]),p=I.useCallback(x=>{let{active:_,selected:w}=x;const M={role:"option",..._&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...M,"aria-selected":w}}return{}},[f,l]);return I.useMemo(()=>o?{reference:b,floating:y,item:p}:{},[o,b,y,p])}const[ihe,Tc]=yu("ScrollArea.Root component was not found in tree");function V0(t,e){const n=Jp(e);Tv(()=>{let i=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(i),r.unobserve(t)}}},[t,n])}const rhe=I.forwardRef((t,e)=>{const{style:n,...i}=t,r=Tc(),[a,s]=I.useState(0),[o,l]=I.useState(0),c=!!(a&&o);return V0(r.scrollbarX,()=>{const u=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(u),l(u)}),V0(r.scrollbarY,()=>{const u=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(u),s(u)}),c?k.jsx("div",{...i,ref:e,style:{...n,width:a,height:o}}):null}),ahe=I.forwardRef((t,e)=>{const n=Tc(),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?k.jsx(rhe,{...t,ref:e}):null}),she={scrollHideDelay:1e3,type:"hover"},QX=I.forwardRef((t,e)=>{const{type:n,scrollHideDelay:i,scrollbars:r,getStyles:a,...s}=Pt("ScrollAreaRoot",she,t),[o,l]=I.useState(null),[c,u]=I.useState(null),[f,h]=I.useState(null),[d,g]=I.useState(null),[b,y]=I.useState(null),[p,x]=I.useState(0),[_,w]=I.useState(0),[M,S]=I.useState(!1),[A,C]=I.useState(!1),D=Ps(e,R=>l(R));return k.jsx(ihe,{value:{type:n,scrollHideDelay:i,scrollArea:o,viewport:c,onViewportChange:u,content:f,onContentChange:h,scrollbarX:d,onScrollbarXChange:g,scrollbarXEnabled:M,onScrollbarXEnabledChange:S,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:A,onScrollbarYEnabledChange:C,onCornerWidthChange:x,onCornerHeightChange:w,getStyles:a},children:k.jsx(ut,{...s,ref:D,__vars:{"--sa-corner-width":r!=="xy"?"0px":`${p}px`,"--sa-corner-height":r!=="xy"?"0px":`${_}px`}})})});QX.displayName="@mantine/core/ScrollAreaRoot";function eK(t,e){const n=t/e;return Number.isNaN(n)?0:n}function hA(t){const e=eK(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=(t.scrollbar.size-n)*e;return Math.max(i,18)}function tK(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function ohe(t,[e,n]){return Math.min(n,Math.max(e,t))}function QB(t,e,n="ltr"){const i=hA(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=e.scrollbar.size-r,s=e.content-e.viewport,o=a-i,l=n==="ltr"?[0,s]:[s*-1,0],c=ohe(t,l);return tK([0,s],[0,o])(c)}function lhe(t,e,n,i="ltr"){const r=hA(n),a=r/2,s=e||a,o=r-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-o,u=n.content-n.viewport,f=i==="ltr"?[0,u]:[u*-1,0];return tK([l,c],f)(t)}function nK(t,e){return t>0&&t<e}function h2(t){return t?parseInt(t,10):0}function wm(t,e,{checkForDefaultPrevented:n=!0}={}){return i=>{t?.(i),(n===!1||!i.defaultPrevented)&&e?.(i)}}const[che,iK]=yu("ScrollAreaScrollbar was not found in tree"),rK=I.forwardRef((t,e)=>{const{sizes:n,hasThumb:i,onThumbChange:r,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:o,onDragScroll:l,onWheelScroll:c,onResize:u,...f}=t,h=Tc(),[d,g]=I.useState(null),b=Ps(e,C=>g(C)),y=I.useRef(null),p=I.useRef(""),{viewport:x}=h,_=n.content-n.viewport,w=Jp(c),M=Jp(o),S=$T(u,10),A=C=>{if(y.current){const D=C.clientX-y.current.left,R=C.clientY-y.current.top;l({x:D,y:R})}};return I.useEffect(()=>{const C=D=>{const R=D.target;d?.contains(R)&&w(D,_)};return document.addEventListener("wheel",C,{passive:!1}),()=>document.removeEventListener("wheel",C,{passive:!1})},[x,d,_,w]),I.useEffect(M,[n,M]),V0(d,S),V0(h.content,S),k.jsx(che,{value:{scrollbar:d,hasThumb:i,onThumbChange:Jp(r),onThumbPointerUp:Jp(a),onThumbPositionChange:M,onThumbPointerDown:Jp(s)},children:k.jsx("div",{...f,ref:b,"data-mantine-scrollbar":!0,style:{position:"absolute",...f.style},onPointerDown:wm(t.onPointerDown,C=>{C.preventDefault(),C.button===0&&(C.target.setPointerCapture(C.pointerId),y.current=d.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(C))}),onPointerMove:wm(t.onPointerMove,A),onPointerUp:wm(t.onPointerUp,C=>{const D=C.target;D.hasPointerCapture(C.pointerId)&&(C.preventDefault(),D.releasePointerCapture(C.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=p.current,y.current=null}})})}),aK=I.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,style:r,...a}=t,s=Tc(),[o,l]=I.useState(),c=I.useRef(null),u=Ps(e,c,s.onScrollbarXChange);return I.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),k.jsx(rK,{"data-orientation":"horizontal",...a,ref:u,sizes:n,style:{...r,"--sa-thumb-width":`${hA(n)}px`},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const d=s.viewport.scrollLeft+f.deltaX;t.onWheelScroll(d),nK(d,h)&&f.preventDefault()}},onResize:()=>{c.current&&s.viewport&&o&&i({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:h2(o.paddingLeft),paddingEnd:h2(o.paddingRight)}})}})});aK.displayName="@mantine/core/ScrollAreaScrollbarX";const sK=I.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,style:r,...a}=t,s=Tc(),[o,l]=I.useState(),c=I.useRef(null),u=Ps(e,c,s.onScrollbarYChange);return I.useEffect(()=>{c.current&&l(window.getComputedStyle(c.current))},[]),k.jsx(rK,{...a,"data-orientation":"vertical",ref:u,sizes:n,style:{"--sa-thumb-height":`${hA(n)}px`,...r},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const d=s.viewport.scrollTop+f.deltaY;t.onWheelScroll(d),nK(d,h)&&f.preventDefault()}},onResize:()=>{c.current&&s.viewport&&o&&i({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:h2(o.paddingTop),paddingEnd:h2(o.paddingBottom)}})}})});sK.displayName="@mantine/core/ScrollAreaScrollbarY";const dA=I.forwardRef((t,e)=>{const{orientation:n="vertical",...i}=t,{dir:r}=Rv(),a=Tc(),s=I.useRef(null),o=I.useRef(0),[l,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=eK(l.viewport,l.content),f={...i,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:d=>{s.current=d},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:d=>{o.current=d}},h=(d,g)=>lhe(d,o.current,l,g);return n==="horizontal"?k.jsx(aK,{...f,ref:e,onThumbPositionChange:()=>{if(a.viewport&&s.current){const d=a.viewport.scrollLeft,g=QB(d,l,r);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:d=>{a.viewport&&(a.viewport.scrollLeft=d)},onDragScroll:d=>{a.viewport&&(a.viewport.scrollLeft=h(d,r))}}):n==="vertical"?k.jsx(sK,{...f,ref:e,onThumbPositionChange:()=>{if(a.viewport&&s.current){const d=a.viewport.scrollTop,g=QB(d,l);l.scrollbar.size===0?s.current.style.setProperty("--thumb-opacity","0"):s.current.style.setProperty("--thumb-opacity","1"),s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:d=>{a.viewport&&(a.viewport.scrollTop=d)},onDragScroll:d=>{a.viewport&&(a.viewport.scrollTop=h(d))}}):null});dA.displayName="@mantine/core/ScrollAreaScrollbarVisible";const OL=I.forwardRef((t,e)=>{const n=Tc(),{forceMount:i,...r}=t,[a,s]=I.useState(!1),o=t.orientation==="horizontal",l=$T(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(o?c:u)}},10);return V0(n.viewport,l),V0(n.content,l),i||a?k.jsx(dA,{"data-state":a?"visible":"hidden",...r,ref:e}):null});OL.displayName="@mantine/core/ScrollAreaScrollbarAuto";const oK=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=Tc(),[a,s]=I.useState(!1);return I.useEffect(()=>{const{scrollArea:o}=r;let l=0;if(o){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),r.scrollHideDelay)};return o.addEventListener("pointerenter",c),o.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",c),o.removeEventListener("pointerleave",u)}}},[r.scrollArea,r.scrollHideDelay]),n||a?k.jsx(OL,{"data-state":a?"visible":"hidden",...i,ref:e}):null});oK.displayName="@mantine/core/ScrollAreaScrollbarHover";const uhe=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=Tc(),a=t.orientation==="horizontal",[s,o]=I.useState("hidden"),l=$T(()=>o("idle"),100);return I.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>o("hidden"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,r.scrollHideDelay]),I.useEffect(()=>{const{viewport:c}=r,u=a?"scrollLeft":"scrollTop";if(c){let f=c[u];const h=()=>{const d=c[u];f!==d&&(o("scrolling"),l()),f=d};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[r.viewport,a,l]),n||s!=="hidden"?k.jsx(dA,{"data-state":s==="hidden"?"hidden":"visible",...i,ref:e,onPointerEnter:wm(t.onPointerEnter,()=>o("interacting")),onPointerLeave:wm(t.onPointerLeave,()=>o("idle"))}):null}),PO=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=Tc(),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:s}=r,o=t.orientation==="horizontal";return I.useEffect(()=>(o?a(!0):s(!0),()=>{o?a(!1):s(!1)}),[o,a,s]),r.type==="hover"?k.jsx(oK,{...i,ref:e,forceMount:n}):r.type==="scroll"?k.jsx(uhe,{...i,ref:e,forceMount:n}):r.type==="auto"?k.jsx(OL,{...i,ref:e,forceMount:n}):r.type==="always"?k.jsx(dA,{...i,ref:e}):null});PO.displayName="@mantine/core/ScrollAreaScrollbar";function fhe(t,e=()=>{}){let n={left:t.scrollLeft,top:t.scrollTop},i=0;return function r(){const a={left:t.scrollLeft,top:t.scrollTop},s=n.left!==a.left,o=n.top!==a.top;(s||o)&&e(),n=a,i=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(i)}const lK=I.forwardRef((t,e)=>{const{style:n,...i}=t,r=Tc(),a=iK(),{onThumbPositionChange:s}=a,o=Ps(e,u=>a.onThumbChange(u)),l=I.useRef(void 0),c=$T(()=>{l.current&&(l.current(),l.current=void 0)},100);return I.useEffect(()=>{const{viewport:u}=r;if(u){const f=()=>{if(c(),!l.current){const h=fhe(u,s);l.current=h,s()}};return s(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[r.viewport,c,s]),k.jsx("div",{"data-state":a.hasThumb?"visible":"hidden",...i,ref:o,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:wm(t.onPointerDownCapture,u=>{const h=u.target.getBoundingClientRect(),d=u.clientX-h.left,g=u.clientY-h.top;a.onThumbPointerDown({x:d,y:g})}),onPointerUp:wm(t.onPointerUp,a.onThumbPointerUp)})});lK.displayName="@mantine/core/ScrollAreaThumb";const UO=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=iK();return n||r.hasThumb?k.jsx(lK,{ref:e,...i}):null});UO.displayName="@mantine/core/ScrollAreaThumb";const cK=I.forwardRef(({children:t,style:e,...n},i)=>{const r=Tc(),a=Ps(i,r.onViewportChange);return k.jsx(ut,{...n,ref:a,style:{overflowX:r.scrollbarXEnabled?"scroll":"hidden",overflowY:r.scrollbarYEnabled?"scroll":"hidden",...e},children:k.jsx("div",{...r.getStyles("content"),ref:r.onContentChange,children:t})})});cK.displayName="@mantine/core/ScrollAreaViewport";var IL={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const uK={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},hhe=(t,{scrollbarSize:e,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":Et(e),"--scrollarea-over-scroll-behavior":n}}),Ac=tn((t,e)=>{const n=Pt("ScrollArea",uK,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,scrollbarSize:l,vars:c,type:u,scrollHideDelay:f,viewportProps:h,viewportRef:d,onScrollPositionChange:g,children:b,offsetScrollbars:y,scrollbars:p,onBottomReached:x,onTopReached:_,overscrollBehavior:w,attributes:M,...S}=n,[A,C]=I.useState(!1),[D,R]=I.useState(!1),[N,U]=I.useState(!1),j=Tn({name:"ScrollArea",props:n,classes:IL,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:M,vars:c,varsResolver:hhe}),z=I.useRef(null),q=JX([d,z]);return I.useEffect(()=>{if(!z.current||y!=="present")return;const B=z.current,G=new ResizeObserver(()=>{const{scrollHeight:H,clientHeight:W,scrollWidth:F,clientWidth:Y}=B;R(H>W),U(F>Y)});return G.observe(B),()=>G.disconnect()},[z,y]),k.jsxs(QX,{getStyles:j,type:u==="never"?"always":u,scrollHideDelay:f,ref:e,scrollbars:p,...j("root"),...S,children:[k.jsx(cK,{...h,...j("viewport",{style:h?.style}),ref:q,"data-offset-scrollbars":y===!0?"xy":y||void 0,"data-scrollbars":p||void 0,"data-horizontal-hidden":y==="present"&&!N?"true":void 0,"data-vertical-hidden":y==="present"&&!D?"true":void 0,onScroll:B=>{h?.onScroll?.(B),g?.({x:B.currentTarget.scrollLeft,y:B.currentTarget.scrollTop});const{scrollTop:G,scrollHeight:H,clientHeight:W}=B.currentTarget;G-(H-W)>=-.6&&x?.(),G===0&&_?.()},children:b}),(p==="xy"||p==="x")&&k.jsx(PO,{...j("scrollbar"),orientation:"horizontal","data-hidden":u==="never"||y==="present"&&!N?!0:void 0,forceMount:!0,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:k.jsx(UO,{...j("thumb")})}),(p==="xy"||p==="y")&&k.jsx(PO,{...j("scrollbar"),orientation:"vertical","data-hidden":u==="never"||y==="present"&&!D?!0:void 0,forceMount:!0,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:k.jsx(UO,{...j("thumb")})}),k.jsx(ahe,{...j("corner"),"data-hovered":A||void 0,"data-hidden":u==="never"||void 0})]})});Ac.displayName="@mantine/core/ScrollArea";const NL=tn((t,e)=>{const{children:n,classNames:i,styles:r,scrollbarSize:a,scrollHideDelay:s,type:o,dir:l,offsetScrollbars:c,viewportRef:u,onScrollPositionChange:f,unstyled:h,variant:d,viewportProps:g,scrollbars:b,style:y,vars:p,onBottomReached:x,onTopReached:_,onOverflowChange:w,...M}=Pt("ScrollAreaAutosize",uK,t),S=I.useRef(null),A=JX([u,S]),[C,D]=I.useState(!1),R=I.useRef(!1);return I.useEffect(()=>{if(!w)return;const N=S.current;if(!N)return;const U=()=>{const z=N.scrollHeight>N.clientHeight;z!==C&&(R.current?w?.(z):(R.current=!0,z&&w?.(!0)),D(z))};U();const j=new ResizeObserver(U);return j.observe(N),()=>j.disconnect()},[w,C]),k.jsx(ut,{...M,ref:e,style:[{display:"flex",overflow:"hidden"},y],children:k.jsx(ut,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...b==="y"&&{minWidth:0},...b==="x"&&{minHeight:0},...b==="xy"&&{minWidth:0,minHeight:0},...b===!1&&{minWidth:0,minHeight:0}},children:k.jsx(Ac,{classNames:i,styles:r,scrollHideDelay:s,scrollbarSize:a,type:o,dir:l,offsetScrollbars:c,viewportRef:A,onScrollPositionChange:f,unstyled:h,variant:d,viewportProps:g,vars:p,scrollbars:b,onBottomReached:x,onTopReached:_,"data-autosize":"true",children:n})})})});Ac.classes=IL;NL.displayName="@mantine/core/ScrollAreaAutosize";NL.classes=IL;Ac.Autosize=NL;var fK={root:"m_87cf2631"};const dhe={__staticSelector:"UnstyledButton"},rf=kl((t,e)=>{const n=Pt("UnstyledButton",dhe,t),{className:i,component:r="button",__staticSelector:a,unstyled:s,classNames:o,styles:l,style:c,attributes:u,...f}=n,h=Tn({name:a,props:n,classes:fK,className:i,style:c,classNames:o,styles:l,unstyled:s,attributes:u});return k.jsx(ut,{...h("root",{focusable:!0}),component:r,ref:e,type:r==="button"?"button":void 0,...f})});rf.classes=fK;rf.displayName="@mantine/core/UnstyledButton";var hK={root:"m_515a97f8"};const LL=tn((t,e)=>{const n=Pt("VisuallyHidden",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,attributes:c,...u}=n,f=Tn({name:"VisuallyHidden",classes:hK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:c});return k.jsx(ut,{component:"span",ref:e,...f("root"),...u})});LL.classes=hK;LL.displayName="@mantine/core/VisuallyHidden";var dK={root:"m_1b7284a3"};const phe=(t,{radius:e,shadow:n})=>({root:{"--paper-radius":e===void 0?void 0:aa(e),"--paper-shadow":mL(n)}}),Ns=kl((t,e)=>{const n=Pt("Paper",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,withBorder:l,vars:c,radius:u,shadow:f,variant:h,mod:d,attributes:g,...b}=n,y=Tn({name:"Paper",props:n,classes:dK,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:c,varsResolver:phe});return k.jsx(ut,{ref:e,mod:[{"data-with-border":l},d],...y("root"),variant:h,...b})});Ns.classes=dK;Ns.displayName="@mantine/core/Paper";function ez(t,e,n,i){return t==="center"||i==="center"?{top:e}:t==="end"?{bottom:n}:t==="start"?{top:n}:{}}function tz(t,e,n,i,r){return t==="center"||i==="center"?{left:e}:t==="end"?{[r==="ltr"?"right":"left"]:n}:t==="start"?{[r==="ltr"?"left":"right"]:n}:{}}const mhe={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function ghe({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,arrowX:a,arrowY:s,dir:o}){const[l,c="center"]=t.split("-"),u={width:e,height:e,transform:"rotate(45deg)",position:"absolute",[mhe[l]]:i},f=-e/2;return l==="left"?{...u,...ez(c,s,n,r),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:l==="right"?{...u,...ez(c,s,n,r),left:f,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:l==="top"?{...u,...tz(c,a,n,r,o),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:l==="bottom"?{...u,...tz(c,a,n,r,o),top:f,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const d2=I.forwardRef(({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,visible:a,arrowX:s,arrowY:o,style:l,...c},u)=>{const{dir:f}=Rv();return a?k.jsx("div",{...c,ref:u,style:{...l,...ghe({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,dir:f,arrowX:s,arrowY:o})}}):null});d2.displayName="@mantine/core/FloatingArrow";function pK(t,e){if(t==="rtl"&&(e.includes("right")||e.includes("left"))){const[n,i]=e.split("-"),r=n==="right"?"left":"right";return i===void 0?r:`${r}-${i}`}return e}var mK={root:"m_9814e45f"};const bhe={zIndex:ff("modal")},vhe=(t,{gradient:e,color:n,backgroundOpacity:i,blur:r,radius:a,zIndex:s})=>({root:{"--overlay-bg":e||(n!==void 0||i!==void 0)&&ec(n||"#000",i??.6)||void 0,"--overlay-filter":r?`blur(${Et(r)})`:void 0,"--overlay-radius":a===void 0?void 0:aa(a),"--overlay-z-index":s?.toString()}}),pA=kl((t,e)=>{const n=Pt("Overlay",bhe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,fixed:c,center:u,children:f,radius:h,zIndex:d,gradient:g,blur:b,color:y,backgroundOpacity:p,mod:x,attributes:_,...w}=n,M=Tn({name:"Overlay",props:n,classes:mK,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:_,vars:l,varsResolver:vhe});return k.jsx(ut,{ref:e,...M("root"),mod:[{center:u,fixed:c},x],...w,children:f})});pA.classes=mK;pA.displayName="@mantine/core/Overlay";function K3(t){const e=document.createElement("div");return e.setAttribute("data-portal","true"),typeof t.className=="string"&&e.classList.add(...t.className.split(" ").filter(Boolean)),typeof t.style=="object"&&Object.assign(e.style,t.style),typeof t.id=="string"&&e.setAttribute("id",t.id),e}function yhe({target:t,reuseTargetNode:e,...n}){if(t)return typeof t=="string"?document.querySelector(t)||K3(n):t;if(e){const i=document.querySelector("[data-mantine-shared-portal-node]");if(i)return i;const r=K3(n);return r.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(r),r}return K3(n)}const xhe={reuseTargetNode:!0},PL=tn((t,e)=>{const{children:n,target:i,reuseTargetNode:r,...a}=Pt("Portal",xhe,t),[s,o]=I.useState(!1),l=I.useRef(null);return Tv(()=>(o(!0),l.current=yhe({target:i,reuseTargetNode:r,...a}),i2(e,l.current),!i&&!r&&l.current&&document.body.appendChild(l.current),()=>{!i&&!r&&l.current&&document.body.removeChild(l.current)}),[i]),!s||!l.current?null:o_.createPortal(k.jsx(k.Fragment,{children:n}),l.current)});PL.displayName="@mantine/core/Portal";const Ud=tn(({withinPortal:t=!0,children:e,...n},i)=>rA()==="test"||!t?k.jsx(k.Fragment,{children:e}):k.jsx(PL,{ref:i,...n,children:e}));Ud.displayName="@mantine/core/OptionalPortal";const Ly=t=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${t==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),rw={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Ly("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Ly("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Ly("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Ly("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Ly("top"),common:{transformOrigin:"top right"}}},nz={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function _he({transition:t,state:e,duration:n,timingFunction:i}){const r={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:i};return typeof t=="string"?t in rw?{transitionProperty:rw[t].transitionProperty,...r,...rw[t].common,...rw[t][nz[e]]}:{}:{transitionProperty:t.transitionProperty,...r,...t.common,...t[nz[e]]}}function She({duration:t,exitDuration:e,timingFunction:n,mounted:i,onEnter:r,onExit:a,onEntered:s,onExited:o,enterDelay:l,exitDelay:c}){const u=va(),f=ZT(),h=u.respectReducedMotion?f:!1,[d,g]=I.useState(h?0:t),[b,y]=I.useState(i?"entered":"exited"),p=I.useRef(-1),x=I.useRef(-1),_=I.useRef(-1);function w(){window.clearTimeout(p.current),window.clearTimeout(x.current),cancelAnimationFrame(_.current)}const M=A=>{w();const C=A?r:a,D=A?s:o,R=h?0:A?t:e;g(R),R===0?(typeof C=="function"&&C(),typeof D=="function"&&D(),y(A?"entered":"exited")):_.current=requestAnimationFrame(()=>{bx.flushSync(()=>{y(A?"pre-entering":"pre-exiting")}),_.current=requestAnimationFrame(()=>{typeof C=="function"&&C(),y(A?"entering":"exiting"),p.current=window.setTimeout(()=>{typeof D=="function"&&D(),y(A?"entered":"exited")},R)})})},S=A=>{if(w(),typeof(A?l:c)!="number"){M(A);return}x.current=window.setTimeout(()=>{M(A)},A?l:c)};return vc(()=>{S(i)},[i]),I.useEffect(()=>()=>{w()},[]),{transitionDuration:d,transitionStatus:b,transitionTimingFunction:n||"ease"}}function Sl({keepMounted:t,transition:e="fade",duration:n=250,exitDuration:i=n,mounted:r,children:a,timingFunction:s="ease",onExit:o,onEntered:l,onEnter:c,onExited:u,enterDelay:f,exitDelay:h}){const d=rA(),{transitionDuration:g,transitionStatus:b,transitionTimingFunction:y}=She({mounted:r,exitDuration:i,duration:n,timingFunction:s,onExit:o,onEntered:l,onEnter:c,onExited:u,enterDelay:f,exitDelay:h});return g===0||d==="test"?r?k.jsx(k.Fragment,{children:a({})}):t?a({display:"none"}):null:b==="exited"?t?a({display:"none"}):null:k.jsx(k.Fragment,{children:a(_he({transition:e,duration:g,state:b,timingFunction:y}))})}Sl.displayName="@mantine/core/Transition";const[whe,gK]=yu("Popover component was not found in the tree");function mA({children:t,active:e=!0,refProp:n="ref",innerRef:i}){const r=Ioe(e),a=Ps(r,i);return ng(t)?I.cloneElement(t,{[n]:a}):t}function bK(t){return k.jsx(LL,{tabIndex:-1,"data-autofocus":!0,...t})}mA.displayName="@mantine/core/FocusTrap";bK.displayName="@mantine/core/FocusTrapInitialFocus";mA.InitialFocus=bK;var vK={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const UL=tn((t,e)=>{const n=Pt("PopoverDropdown",null,t),{className:i,style:r,vars:a,children:s,onKeyDownCapture:o,variant:l,classNames:c,styles:u,...f}=n,h=gK(),d=eX({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},b=Ps(e,h.floating);return h.disabled?null:k.jsx(Ud,{...h.portalProps,withinPortal:h.withinPortal,children:k.jsx(Sl,{mounted:h.opened,...h.transitionProps,transition:h.transitionProps?.transition||"fade",duration:h.transitionProps?.duration??150,keepMounted:h.keepMounted,exitDuration:typeof h.transitionProps?.exitDuration=="number"?h.transitionProps.exitDuration:h.transitionProps?.duration,children:y=>k.jsx(mA,{active:h.trapFocus&&h.opened,innerRef:b,children:k.jsxs(ut,{...g,...f,variant:l,onKeyDownCapture:ece(()=>{h.onClose?.(),h.onDismiss?.()},{active:h.closeOnEscape,onTrigger:d,onKeyDown:o}),"data-position":h.placement,"data-fixed":h.floatingStrategy==="fixed"||void 0,...h.getStyles("dropdown",{className:i,props:n,classNames:c,styles:u,style:[{...y,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:Et(h.width),...h.referenceHidden?{display:"none"}:null},h.resolvedStyles.dropdown,u?.dropdown,r]}),children:[s,k.jsx(d2,{ref:h.arrowRef,arrowX:h.arrowX,arrowY:h.arrowY,visible:h.withArrow,position:h.placement,arrowSize:h.arrowSize,arrowRadius:h.arrowRadius,arrowOffset:h.arrowOffset,arrowPosition:h.arrowPosition,...h.getStyles("arrow",{props:n,classNames:c,styles:u})})]})})})})});UL.classes=vK;UL.displayName="@mantine/core/PopoverDropdown";const Ehe={refProp:"ref",popupType:"dialog"},yK=tn((t,e)=>{const{children:n,refProp:i,popupType:r,...a}=Pt("PopoverTarget",Ehe,t);if(!ng(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=a,o=gK(),l=Ps(o.reference,tA(n),e),c=o.withRoles?{"aria-haspopup":r,"aria-expanded":o.opened,"aria-controls":o.getDropdownId(),id:o.getTargetId()}:{};return I.cloneElement(n,{...s,...c,...o.targetProps,className:as(o.targetProps.className,s.className,n.props.className),[i]:l,...o.controlled?null:{onClick:()=>{o.onToggle(),n.props.onClick?.()}}})});yK.displayName="@mantine/core/PopoverTarget";function Mhe(t){if(t===void 0)return{shift:!0,flip:!0};const e={...t};return t.shift===void 0&&(e.shift=!0),t.flip===void 0&&(e.flip=!0),e}function The(t,e,n){const i=Mhe(t.middlewares),r=[KX(t.offset),Pfe()];return t.dropdownVisible&&n!=="test"&&t.preventPositionChangeWhenVisible&&(i.flip=!1),i.shift&&r.push(AL(typeof i.shift=="boolean"?{limiter:qB(),padding:5}:{limiter:qB(),padding:5,...i.shift})),i.flip&&r.push(typeof i.flip=="boolean"?f2():f2(i.flip)),i.inline&&r.push(typeof i.inline=="boolean"?Yx():Yx(i.inline)),r.push(YX({element:t.arrowRef,padding:t.arrowOffset})),(i.size||t.width==="target")&&r.push(Lfe({...typeof i.size=="boolean"?{}:i.size,apply({rects:a,availableWidth:s,availableHeight:o,...l}){const u=e().refs.floating.current?.style??{};i.size&&(typeof i.size=="object"&&i.size.apply?i.size.apply({rects:a,availableWidth:s,availableHeight:o,...l}):Object.assign(u,{maxWidth:`${s}px`,maxHeight:`${o}px`})),t.width==="target"&&Object.assign(u,{width:`${a.reference.width}px`})}})),r}function Ahe(t){const e=rA(),[n,i]=Al({value:t.opened,defaultValue:t.defaultOpened,finalValue:!1,onChange:t.onChange}),r=I.useRef(n),a=()=>{n&&!t.disabled&&i(!1)},s=()=>{t.disabled||i(!n)},o=DL({strategy:t.strategy,placement:t.preventPositionChangeWhenVisible?t.positionRef.current:t.position,middleware:The(t,()=>o,e),whileElementsMounted:t.keepMounted?void 0:NO});return I.useEffect(()=>{if(!(!o.refs.reference.current||!o.refs.floating.current)&&n)return NO(o.refs.reference.current,o.refs.floating.current,o.update)},[n,o.update]),vc(()=>{t.onPositionChange?.(o.placement),t.positionRef.current=o.placement},[o.placement,t.preventPositionChangeWhenVisible]),vc(()=>{n!==r.current&&(n?t.onOpen?.():t.onClose?.()),r.current=n},[n,t.onClose,t.onOpen]),vc(()=>{let l=-1;return n&&(l=window.setTimeout(()=>t.setDropdownVisible(!0),4)),()=>{window.clearTimeout(l)}},[n,t.position]),{floating:o,controlled:typeof t.opened=="boolean",opened:n,onClose:a,onToggle:s}}const Che={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:ff("popover"),__staticSelector:"Popover",width:"max-content"},Rhe=(t,{radius:e,shadow:n})=>({dropdown:{"--popover-radius":e===void 0?void 0:aa(e),"--popover-shadow":mL(n)}});function Ho(t){const e=Pt("Popover",Che,t),{children:n,position:i,offset:r,onPositionChange:a,positionDependencies:s,opened:o,transitionProps:l,onExitTransitionEnd:c,onEnterTransitionEnd:u,width:f,middlewares:h,withArrow:d,arrowSize:g,arrowOffset:b,arrowRadius:y,arrowPosition:p,unstyled:x,classNames:_,styles:w,closeOnClickOutside:M,withinPortal:S,portalProps:A,closeOnEscape:C,clickOutsideEvents:D,trapFocus:R,onClose:N,onDismiss:U,onOpen:j,onChange:z,zIndex:q,radius:B,shadow:G,id:H,defaultOpened:W,__staticSelector:F,withRoles:Y,disabled:Z,returnFocus:V,variant:de,keepMounted:se,vars:oe,floatingStrategy:ue,withOverlay:_e,overlayProps:ke,hideDetached:Ne,attributes:Ue,preventPositionChangeWhenVisible:ze,...pe}=e,Fe=Tn({name:F,props:e,classes:vK,classNames:_,styles:w,unstyled:x,attributes:Ue,rootSelector:"dropdown",vars:oe,varsResolver:Rhe}),{resolvedStyles:Ie}=Cv({classNames:_,styles:w,props:e}),[qe,we]=I.useState(o??W??!1),Te=I.useRef(i),Ae=I.useRef(null),[Pe,He]=I.useState(null),[$e,ie]=I.useState(null),{dir:K}=Rv(),ce=rA(),fe=uf(H),me=Ahe({middlewares:h,width:f,position:pK(K,i),offset:typeof r=="number"?r+(d?g/2:0):r,arrowRef:Ae,arrowOffset:b,onPositionChange:a,positionDependencies:s,opened:o,defaultOpened:W,onChange:z,onOpen:j,onClose:N,onDismiss:U,strategy:ue,dropdownVisible:qe,setDropdownVisible:we,positionRef:Te,disabled:Z,preventPositionChangeWhenVisible:ze,keepMounted:se});woe(()=>{M&&(me.onClose(),U?.())},D,[Pe,$e]);const $=I.useCallback(Ge=>{He(Ge),me.floating.refs.setReference(Ge)},[me.floating.refs.setReference]),Le=I.useCallback(Ge=>{ie(Ge),me.floating.refs.setFloating(Ge)},[me.floating.refs.setFloating]),Xe=I.useCallback(()=>{l?.onExited?.(),c?.(),we(!1),ze||(Te.current=i)},[l?.onExited,c,ze,i]),mt=I.useCallback(()=>{l?.onEntered?.(),u?.()},[l?.onEntered,u]);return k.jsxs(whe,{value:{returnFocus:V,disabled:Z,controlled:me.controlled,reference:$,floating:Le,x:me.floating.x,y:me.floating.y,arrowX:me.floating?.middlewareData?.arrow?.x,arrowY:me.floating?.middlewareData?.arrow?.y,opened:me.opened,arrowRef:Ae,transitionProps:{...l,onExited:Xe,onEntered:mt},width:f,withArrow:d,arrowSize:g,arrowOffset:b,arrowRadius:y,arrowPosition:p,placement:me.floating.placement,trapFocus:R,withinPortal:S,portalProps:A,zIndex:q,radius:B,shadow:G,closeOnEscape:C,onDismiss:U,onClose:me.onClose,onToggle:me.onToggle,getTargetId:()=>`${fe}-target`,getDropdownId:()=>`${fe}-dropdown`,withRoles:Y,targetProps:pe,__staticSelector:F,classNames:_,styles:w,unstyled:x,variant:de,keepMounted:se,getStyles:Fe,resolvedStyles:Ie,floatingStrategy:ue,referenceHidden:Ne&&ce!=="test"?me.floating.middlewareData.hide?.referenceHidden:!1},children:[n,_e&&k.jsx(Sl,{transition:"fade",mounted:me.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:Ge=>k.jsx(Ud,{withinPortal:S,children:k.jsx(pA,{...ke,...Fe("overlay",{className:ke?.className,style:[Ge,ke?.style]})})})})]})}Ho.Target=yK;Ho.Dropdown=UL;Ho.displayName="@mantine/core/Popover";Ho.extend=t=>t;var ou={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const xK=I.forwardRef(({className:t,...e},n)=>k.jsxs(ut,{component:"span",className:as(ou.barsLoader,t),...e,ref:n,children:[k.jsx("span",{className:ou.bar}),k.jsx("span",{className:ou.bar}),k.jsx("span",{className:ou.bar})]}));xK.displayName="@mantine/core/Bars";const _K=I.forwardRef(({className:t,...e},n)=>k.jsxs(ut,{component:"span",className:as(ou.dotsLoader,t),...e,ref:n,children:[k.jsx("span",{className:ou.dot}),k.jsx("span",{className:ou.dot}),k.jsx("span",{className:ou.dot})]}));_K.displayName="@mantine/core/Dots";const SK=I.forwardRef(({className:t,...e},n)=>k.jsx(ut,{component:"span",className:as(ou.ovalLoader,t),...e,ref:n}));SK.displayName="@mantine/core/Oval";const wK={bars:xK,oval:SK,dots:_K},khe={loaders:wK,type:"oval"},Dhe=(t,{size:e,color:n})=>({root:{"--loader-size":oi(e,"loader-size"),"--loader-color":n?ia(n,t):void 0}}),Wd=tn((t,e)=>{const n=Pt("Loader",khe,t),{size:i,color:r,type:a,vars:s,className:o,style:l,classNames:c,styles:u,unstyled:f,loaders:h,variant:d,children:g,attributes:b,...y}=n,p=Tn({name:"Loader",props:n,classes:ou,className:o,style:l,classNames:c,styles:u,unstyled:f,attributes:b,vars:s,varsResolver:Dhe});return g?k.jsx(ut,{...p("root"),ref:e,...y,children:g}):k.jsx(ut,{...p("root"),ref:e,component:h[a],variant:d,size:i,...y})});Wd.defaultLoaders=wK;Wd.classes=ou;Wd.displayName="@mantine/core/Loader";var Ov={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const iz={orientation:"horizontal"},Ohe=(t,{borderWidth:e})=>({group:{"--ai-border-width":Et(e)}}),FL=tn((t,e)=>{const n=Pt("ActionIconGroup",iz,t),{className:i,style:r,classNames:a,styles:s,unstyled:o,orientation:l,vars:c,borderWidth:u,variant:f,mod:h,attributes:d,...g}=Pt("ActionIconGroup",iz,t),b=Tn({name:"ActionIconGroup",props:n,classes:Ov,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:c,varsResolver:Ohe,rootSelector:"group"});return k.jsx(ut,{...b("group"),ref:e,variant:f,mod:[{"data-orientation":l},h],role:"group",...g})});FL.classes=Ov;FL.displayName="@mantine/core/ActionIconGroup";const Ihe=(t,{radius:e,color:n,gradient:i,variant:r,autoContrast:a,size:s})=>{const o=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:a});return{groupSection:{"--section-height":oi(s,"section-height"),"--section-padding-x":oi(s,"section-padding-x"),"--section-fz":Ds(s),"--section-radius":e===void 0?void 0:aa(e),"--section-bg":n||r?o.background:void 0,"--section-color":o.color,"--section-bd":n||r?o.border:void 0}}},BL=tn((t,e)=>{const n=Pt("ActionIconGroupSection",null,t),{className:i,style:r,classNames:a,styles:s,unstyled:o,vars:l,variant:c,gradient:u,radius:f,autoContrast:h,attributes:d,...g}=n,b=Tn({name:"ActionIconGroupSection",props:n,classes:Ov,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:Ihe,rootSelector:"groupSection"});return k.jsx(ut,{...b("groupSection"),ref:e,variant:c,...g})});BL.classes=Ov;BL.displayName="@mantine/core/ActionIconGroupSection";const Nhe=(t,{size:e,radius:n,variant:i,gradient:r,color:a,autoContrast:s})=>{const o=t.variantColorResolver({color:a||t.primaryColor,theme:t,gradient:r,variant:i||"filled",autoContrast:s});return{root:{"--ai-size":oi(e,"ai-size"),"--ai-radius":n===void 0?void 0:aa(n),"--ai-bg":a||i?o.background:void 0,"--ai-hover":a||i?o.hover:void 0,"--ai-hover-color":a||i?o.hoverColor:void 0,"--ai-color":o.color,"--ai-bd":a||i?o.border:void 0}}},Dl=kl((t,e)=>{const n=Pt("ActionIcon",null,t),{className:i,unstyled:r,variant:a,classNames:s,styles:o,style:l,loading:c,loaderProps:u,size:f,color:h,radius:d,__staticSelector:g,gradient:b,vars:y,children:p,disabled:x,"data-disabled":_,autoContrast:w,mod:M,attributes:S,...A}=n,C=Tn({name:["ActionIcon",g],props:n,className:i,style:l,classes:Ov,classNames:s,styles:o,unstyled:r,attributes:S,vars:y,varsResolver:Nhe});return k.jsxs(rf,{...C("root",{active:!x&&!c&&!_}),...A,unstyled:r,variant:a,size:f,disabled:x||c,ref:e,mod:[{loading:c,disabled:x||_},M],children:[typeof c=="boolean"&&k.jsx(Sl,{mounted:c,transition:"slide-down",duration:150,children:D=>k.jsx(ut,{component:"span",...C("loader",{style:D}),"aria-hidden":!0,children:k.jsx(Wd,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...u})})}),k.jsx(ut,{component:"span",mod:{loading:c},...C("icon"),children:p})]})});Dl.classes=Ov;Dl.displayName="@mantine/core/ActionIcon";Dl.Group=FL;Dl.GroupSection=BL;const EK=I.forwardRef(({size:t="var(--cb-icon-size, 70%)",style:e,...n},i)=>k.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:t,height:t},ref:i,...n,children:k.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));EK.displayName="@mantine/core/CloseIcon";var MK={root:"m_86a44da5","root--subtle":"m_220c80f2"};const Lhe={variant:"subtle"},Phe=(t,{size:e,radius:n,iconSize:i})=>({root:{"--cb-size":oi(e,"cb-size"),"--cb-radius":n===void 0?void 0:aa(n),"--cb-icon-size":Et(i)}}),C_=kl((t,e)=>{const n=Pt("CloseButton",Lhe,t),{iconSize:i,children:r,vars:a,radius:s,className:o,classNames:l,style:c,styles:u,unstyled:f,"data-disabled":h,disabled:d,variant:g,icon:b,mod:y,attributes:p,__staticSelector:x,..._}=n,w=Tn({name:x||"CloseButton",props:n,className:o,style:c,classes:MK,classNames:l,styles:u,unstyled:f,attributes:p,vars:a,varsResolver:Phe});return k.jsxs(rf,{ref:e,..._,unstyled:f,variant:g,disabled:d,mod:[{disabled:d||h},y],...w("root",{variant:g,active:!d&&!h}),children:[b||k.jsx(EK,{}),r]})});C_.classes=MK;C_.displayName="@mantine/core/CloseButton";function Uhe(t){return I.Children.toArray(t).filter(Boolean)}var TK={root:"m_4081bf90"};const Fhe={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},Bhe=(t,{grow:e,preventGrowOverflow:n,gap:i,align:r,justify:a,wrap:s},{childWidth:o})=>({root:{"--group-child-width":e&&n?o:void 0,"--group-gap":Pd(i),"--group-align":r,"--group-justify":a,"--group-wrap":s}}),G0=tn((t,e)=>{const n=Pt("Group",Fhe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,children:l,gap:c,align:u,justify:f,wrap:h,grow:d,preventGrowOverflow:g,vars:b,variant:y,__size:p,mod:x,attributes:_,...w}=n,M=Uhe(l),S=M.length,A=Pd(c??"md"),D={childWidth:`calc(${100/S}% - (${A} - ${A} / ${S}))`},R=Tn({name:"Group",props:n,stylesCtx:D,className:r,style:a,classes:TK,classNames:i,styles:s,unstyled:o,attributes:_,vars:b,varsResolver:Bhe});return k.jsx(ut,{...R("root"),ref:e,variant:y,mod:[{grow:d},x],size:p,...w,children:M})});G0.classes=TK;G0.displayName="@mantine/core/Group";const[zhe,xh]=yu("ModalBase component was not found in tree");function jhe({opened:t,transitionDuration:e}){const[n,i]=I.useState(t),r=I.useRef(-1),s=ZT()?0:e;return I.useEffect(()=>(t?(i(!0),window.clearTimeout(r.current)):s===0?i(!1):r.current=window.setTimeout(()=>i(!1),s),()=>window.clearTimeout(r.current)),[t,s]),n}function Hhe({id:t,transitionProps:e,opened:n,trapFocus:i,closeOnEscape:r,onClose:a,returnFocus:s}){const o=uf(t),[l,c]=I.useState(!1),[u,f]=I.useState(!1),h=typeof e?.duration=="number"?e?.duration:200,d=jhe({opened:n,transitionDuration:h});return Foe("keydown",g=>{g.key==="Escape"&&r&&!g.isComposing&&n&&g.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&a()},{capture:!0}),eX({opened:n,shouldReturnFocus:i&&s}),{_id:o,titleMounted:l,bodyMounted:u,shouldLockScroll:d,setTitleMounted:c,setBodyMounted:f}}const AK=I.forwardRef(({keepMounted:t,opened:e,onClose:n,id:i,transitionProps:r,onExitTransitionEnd:a,onEnterTransitionEnd:s,trapFocus:o,closeOnEscape:l,returnFocus:c,closeOnClickOutside:u,withinPortal:f,portalProps:h,lockScroll:d,children:g,zIndex:b,shadow:y,padding:p,__vars:x,unstyled:_,removeScrollProps:w,...M},S)=>{const{_id:A,titleMounted:C,bodyMounted:D,shouldLockScroll:R,setTitleMounted:N,setBodyMounted:U}=Hhe({id:i,transitionProps:r,opened:e,trapFocus:o,closeOnEscape:l,onClose:n,returnFocus:c}),{key:j,...z}=w||{};return k.jsx(Ud,{...h,withinPortal:f,children:k.jsx(zhe,{value:{opened:e,onClose:n,closeOnClickOutside:u,onExitTransitionEnd:a,onEnterTransitionEnd:s,transitionProps:{...r,keepMounted:t},getTitleId:()=>`${A}-title`,getBodyId:()=>`${A}-body`,titleMounted:C,bodyMounted:D,setTitleMounted:N,setBodyMounted:U,trapFocus:o,closeOnEscape:l,zIndex:b,unstyled:_},children:k.jsx(a2,{enabled:R&&d,...z,children:k.jsx(ut,{ref:S,...M,__vars:{...x,"--mb-z-index":(b||ff("modal")).toString(),"--mb-shadow":mL(y),"--mb-padding":Pd(p)},children:g})},j)})})});AK.displayName="@mantine/core/ModalBase";function Vhe(){const t=xh();return I.useEffect(()=>(t.setBodyMounted(!0),()=>t.setBodyMounted(!1)),[]),t.getBodyId()}var W0={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const CK=I.forwardRef(({className:t,...e},n)=>{const i=Vhe(),r=xh();return k.jsx(ut,{ref:n,...e,id:i,className:as({[W0.body]:!r.unstyled},t)})});CK.displayName="@mantine/core/ModalBaseBody";const RK=I.forwardRef(({className:t,onClick:e,...n},i)=>{const r=xh();return k.jsx(C_,{ref:i,...n,onClick:a=>{r.onClose(),e?.(a)},className:as({[W0.close]:!r.unstyled},t),unstyled:r.unstyled})});RK.displayName="@mantine/core/ModalBaseCloseButton";const kK=I.forwardRef(({transitionProps:t,className:e,innerProps:n,onKeyDown:i,style:r,...a},s)=>{const o=xh();return k.jsx(Sl,{mounted:o.opened,transition:"pop",...o.transitionProps,onExited:()=>{o.onExitTransitionEnd?.(),o.transitionProps?.onExited?.()},onEntered:()=>{o.onEnterTransitionEnd?.(),o.transitionProps?.onEntered?.()},...t,children:l=>k.jsx("div",{...n,className:as({[W0.inner]:!o.unstyled},n.className),children:k.jsx(mA,{active:o.opened&&o.trapFocus,innerRef:s,children:k.jsx(Ns,{...a,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":o.bodyMounted?o.getBodyId():void 0,"aria-labelledby":o.titleMounted?o.getTitleId():void 0,style:[r,l],className:as({[W0.content]:!o.unstyled},e),unstyled:o.unstyled,children:a.children})})})})});kK.displayName="@mantine/core/ModalBaseContent";const DK=I.forwardRef(({className:t,...e},n)=>{const i=xh();return k.jsx(ut,{component:"header",ref:n,className:as({[W0.header]:!i.unstyled},t),...e})});DK.displayName="@mantine/core/ModalBaseHeader";const Ghe={duration:200,timingFunction:"ease",transition:"fade"};function Whe(t){const e=xh();return{...Ghe,...e.transitionProps,...t}}const OK=I.forwardRef(({onClick:t,transitionProps:e,style:n,visible:i,...r},a)=>{const s=xh(),o=Whe(e);return k.jsx(Sl,{mounted:i!==void 0?i:s.opened,...o,transition:"fade",children:l=>k.jsx(pA,{ref:a,fixed:!0,style:[n,l],zIndex:s.zIndex,unstyled:s.unstyled,onClick:c=>{t?.(c),s.closeOnClickOutside&&s.onClose()},...r})})});OK.displayName="@mantine/core/ModalBaseOverlay";function qhe(){const t=xh();return I.useEffect(()=>(t.setTitleMounted(!0),()=>t.setTitleMounted(!1)),[]),t.getTitleId()}const IK=I.forwardRef(({className:t,...e},n)=>{const i=qhe(),r=xh();return k.jsx(ut,{component:"h2",ref:n,className:as({[W0.title]:!r.unstyled},t),...e,id:i})});IK.displayName="@mantine/core/ModalBaseTitle";function Xhe({children:t}){return k.jsx(k.Fragment,{children:t})}const[Khe,Yhe]=E_({size:"sm"}),NK=tn((t,e)=>{const n=Pt("InputClearButton",null,t),{size:i,variant:r,vars:a,classNames:s,styles:o,...l}=n,c=Yhe(),{resolvedClassNames:u,resolvedStyles:f}=Cv({classNames:s,styles:o,props:n});return k.jsx(C_,{variant:r||"transparent",ref:e,size:i||c?.size||"sm",classNames:u,styles:f,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...l.style},...l})});NK.displayName="@mantine/core/InputClearButton";const Jhe={xs:7,sm:8,md:10,lg:12,xl:15};function $he({__clearable:t,__clearSection:e,rightSection:n,__defaultRightSection:i,size:r="sm"}){const a=t&&e;return a&&(n||i)?k.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:Jhe[r]},children:[a,n||i]}):n||a||i}const[Zhe,R_]=E_({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Cc={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const Qhe=(t,{size:e})=>({description:{"--input-description-size":e===void 0?void 0:`calc(${Ds(e)} - ${Et(2)})`}}),gA=tn((t,e)=>{const n=Pt("InputDescription",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,size:c,__staticSelector:u,__inheritStyles:f=!0,attributes:h,variant:d,...g}=Pt("InputDescription",null,n),b=R_(),y=Tn({name:["InputWrapper",u],props:n,classes:Cc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:h,rootSelector:"description",vars:l,varsResolver:Qhe}),p=f&&b?.getStyles||y;return k.jsx(ut,{component:"p",ref:e,variant:d,size:c,...p("description",b?.getStyles?{className:r,style:a}:void 0),...g})});gA.classes=Cc;gA.displayName="@mantine/core/InputDescription";const ede=(t,{size:e})=>({error:{"--input-error-size":e===void 0?void 0:`calc(${Ds(e)} - ${Et(2)})`}}),bA=tn((t,e)=>{const n=Pt("InputError",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,size:c,attributes:u,__staticSelector:f,__inheritStyles:h=!0,variant:d,...g}=n,b=Tn({name:["InputWrapper",f],props:n,classes:Cc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:u,rootSelector:"error",vars:l,varsResolver:ede}),y=R_(),p=h&&y?.getStyles||b;return k.jsx(ut,{component:"p",ref:e,variant:d,size:c,...p("error",y?.getStyles?{className:r,style:a}:void 0),...g})});bA.classes=Cc;bA.displayName="@mantine/core/InputError";const rz={labelElement:"label"},tde=(t,{size:e})=>({label:{"--input-label-size":Ds(e),"--input-asterisk-color":void 0}}),vA=tn((t,e)=>{const n=Pt("InputLabel",rz,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,labelElement:c,size:u,required:f,htmlFor:h,onMouseDown:d,children:g,__staticSelector:b,variant:y,mod:p,attributes:x,..._}=Pt("InputLabel",rz,n),w=Tn({name:["InputWrapper",b],props:n,classes:Cc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:x,rootSelector:"label",vars:l,varsResolver:tde}),M=R_(),S=M?.getStyles||w;return k.jsxs(ut,{...S("label",M?.getStyles?{className:r,style:a}:void 0),component:c,variant:y,size:u,ref:e,htmlFor:c==="label"?h:void 0,mod:[{required:f},p],onMouseDown:A=>{d?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},..._,children:[g,f&&k.jsx("span",{...S("required"),"aria-hidden":!0,children:" *"})]})});vA.classes=Cc;vA.displayName="@mantine/core/InputLabel";const zL=tn((t,e)=>{const n=Pt("InputPlaceholder",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,__staticSelector:c,variant:u,error:f,mod:h,attributes:d,...g}=n,b=Tn({name:["InputPlaceholder",c],props:n,classes:Cc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,rootSelector:"placeholder"});return k.jsx(ut,{...b("placeholder"),mod:[{error:!!f},h],component:"span",variant:u,ref:e,...g})});zL.classes=Cc;zL.displayName="@mantine/core/InputPlaceholder";function nde(t,{hasDescription:e,hasError:n}){const i=t.findIndex(l=>l==="input"),r=t.slice(0,i),a=t.slice(i+1),s=e&&r.includes("description")||n&&r.includes("error");return{offsetBottom:e&&a.includes("description")||n&&a.includes("error"),offsetTop:s}}const ide={labelElement:"label",inputContainer:t=>t,inputWrapperOrder:["label","description","input","error"]},rde=(t,{size:e})=>({label:{"--input-label-size":Ds(e),"--input-asterisk-color":void 0},error:{"--input-error-size":e===void 0?void 0:`calc(${Ds(e)} - ${Et(2)})`},description:{"--input-description-size":e===void 0?void 0:`calc(${Ds(e)} - ${Et(2)})`}}),jL=tn((t,e)=>{const n=Pt("InputWrapper",ide,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,size:c,variant:u,__staticSelector:f,inputContainer:h,inputWrapperOrder:d,label:g,error:b,description:y,labelProps:p,descriptionProps:x,errorProps:_,labelElement:w,children:M,withAsterisk:S,id:A,required:C,__stylesApiProps:D,mod:R,attributes:N,...U}=n,j=Tn({name:["InputWrapper",f],props:D||n,classes:Cc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:N,vars:l,varsResolver:rde}),z={size:c,variant:u,__staticSelector:f},q=uf(A),B=typeof S=="boolean"?S:C,G=_?.id||`${q}-error`,H=x?.id||`${q}-description`,W=q,F=!!b&&typeof b!="boolean",Y=!!y,Z=`${F?G:""} ${Y?H:""}`,V=Z.trim().length>0?Z.trim():void 0,de=p?.id||`${q}-label`,se=g&&k.jsx(vA,{labelElement:w,id:de,htmlFor:W,required:B,...z,...p,children:g},"label"),oe=Y&&k.jsx(gA,{...x,...z,size:x?.size||z.size,id:x?.id||H,children:y},"description"),ue=k.jsx(I.Fragment,{children:h(M)},"input"),_e=F&&I.createElement(bA,{..._,...z,size:_?.size||z.size,key:"error",id:_?.id||G},b),ke=d.map(Ne=>{switch(Ne){case"label":return se;case"input":return ue;case"description":return oe;case"error":return _e;default:return null}});return k.jsx(Zhe,{value:{getStyles:j,describedBy:V,inputId:W,labelId:de,...nde(d,{hasDescription:Y,hasError:F})},children:k.jsx(ut,{ref:e,variant:u,size:c,mod:[{error:!!b},R],...j("root"),...U,children:ke})})});jL.classes=Cc;jL.displayName="@mantine/core/InputWrapper";const ade={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},sde=(t,e,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":oi(e.size,"input-height"),"--input-fz":Ds(e.size),"--input-radius":e.radius===void 0?void 0:aa(e.radius),"--input-left-section-width":e.leftSectionWidth!==void 0?Et(e.leftSectionWidth):void 0,"--input-right-section-width":e.rightSectionWidth!==void 0?Et(e.rightSectionWidth):void 0,"--input-padding-y":e.multiline?oi(e.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":e.leftSectionPointerEvents,"--input-right-section-pointer-events":e.rightSectionPointerEvents}}),da=kl((t,e)=>{const n=Pt("Input",ade,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,required:l,__staticSelector:c,__stylesApiProps:u,size:f,wrapperProps:h,error:d,disabled:g,leftSection:b,leftSectionProps:y,leftSectionWidth:p,rightSection:x,rightSectionProps:_,rightSectionWidth:w,rightSectionPointerEvents:M,leftSectionPointerEvents:S,variant:A,vars:C,pointer:D,multiline:R,radius:N,id:U,withAria:j,withErrorStyles:z,mod:q,inputSize:B,attributes:G,__clearSection:H,__clearable:W,__defaultRightSection:F,...Y}=n,{styleProps:Z,rest:V}=T_(Y),de=R_(),se={offsetBottom:de?.offsetBottom,offsetTop:de?.offsetTop},oe=Tn({name:["Input",c],props:u||n,classes:Cc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:G,stylesCtx:se,rootSelector:"wrapper",vars:C,varsResolver:sde}),ue=j?{required:l,disabled:g,"aria-invalid":!!d,"aria-describedby":de?.describedBy,id:de?.inputId||U}:{},_e=$he({__clearable:W,__clearSection:H,rightSection:x,__defaultRightSection:F,size:f});return k.jsx(Khe,{value:{size:f||"sm"},children:k.jsxs(ut,{...oe("wrapper"),...Z,...h,mod:[{error:!!d&&z,pointer:D,disabled:g,multiline:R,"data-with-right-section":!!_e,"data-with-left-section":!!b},q],variant:A,size:f,children:[b&&k.jsx("div",{...y,"data-position":"left",...oe("section",{className:y?.className,style:y?.style}),children:b}),k.jsx(ut,{component:"input",...V,...ue,ref:e,required:l,mod:{disabled:g,error:!!d&&z},variant:A,__size:B,...oe("input")}),_e&&k.jsx("div",{..._,"data-position":"right",...oe("section",{className:_?.className,style:_?.style}),children:_e})]})})});da.classes=Cc;da.Wrapper=jL;da.Label=vA;da.Error=bA;da.Description=gA;da.Placeholder=zL;da.ClearButton=NK;da.displayName="@mantine/core/Input";function LK(t,e,n){const i=Pt(t,e,n),{label:r,description:a,error:s,required:o,classNames:l,styles:c,className:u,unstyled:f,__staticSelector:h,__stylesApiProps:d,errorProps:g,labelProps:b,descriptionProps:y,wrapperProps:p,id:x,size:_,style:w,inputContainer:M,inputWrapperOrder:S,withAsterisk:A,variant:C,vars:D,mod:R,attributes:N,...U}=i,{styleProps:j,rest:z}=T_(U),q={label:r,description:a,error:s,required:o,classNames:l,className:u,__staticSelector:h,__stylesApiProps:d||i,errorProps:g,labelProps:b,descriptionProps:y,unstyled:f,styles:c,size:_,style:w,inputContainer:M,inputWrapperOrder:S,withAsterisk:A,variant:C,id:x,mod:R,attributes:N,...p};return{...z,classNames:l,styles:c,unstyled:f,wrapperProps:{...q,...j},inputProps:{required:o,classNames:l,styles:c,unstyled:f,size:_,__staticSelector:h,__stylesApiProps:d||i,error:s,variant:C,id:x,attributes:N}}}const ode={__staticSelector:"InputBase",withAria:!0,size:"sm"},xu=kl((t,e)=>{const{inputProps:n,wrapperProps:i,...r}=LK("InputBase",ode,t);return k.jsx(da.Wrapper,{...i,children:k.jsx(da,{...n,...r,ref:e})})});xu.classes={...da.classes,...da.Wrapper.classes};xu.displayName="@mantine/core/InputBase";const lde={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var PK={root:"m_8bffd616"};const ph=kl((t,e)=>{const n=Pt("Flex",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,gap:c,rowGap:u,columnGap:f,align:h,justify:d,wrap:g,direction:b,attributes:y,...p}=n,x=Tn({name:"Flex",classes:PK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l}),_=va(),w=OX(),M=DX({styleProps:{gap:c,rowGap:u,columnGap:f,align:h,justify:d,wrap:g,direction:b},theme:_,data:lde});return k.jsxs(k.Fragment,{children:[M.hasResponsiveStyles&&k.jsx(kX,{selector:`.${w}`,styles:M.styles,media:M.media}),k.jsx(ut,{ref:e,...x("root",{className:w,style:eA(M.inlineStyles)}),...p})]})});ph.classes=PK;ph.displayName="@mantine/core/Flex";var UK={root:"m_b6d8b162"};function cde(t){if(t==="start")return"start";if(t==="end"||t)return"end"}const ude={inherit:!1},fde=(t,{variant:e,lineClamp:n,gradient:i,size:r,color:a})=>({root:{"--text-fz":Ds(r),"--text-lh":SX(r),"--text-gradient":e==="gradient"?TO(i,t):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":a?ia(a,t):void 0}}),hu=kl((t,e)=>{const n=Pt("Text",ude,t),{lineClamp:i,truncate:r,inline:a,inherit:s,gradient:o,span:l,__staticSelector:c,vars:u,className:f,style:h,classNames:d,styles:g,unstyled:b,variant:y,mod:p,size:x,attributes:_,...w}=n,M=Tn({name:["Text",c],props:n,classes:UK,className:f,style:h,classNames:d,styles:g,unstyled:b,attributes:_,vars:u,varsResolver:fde});return k.jsx(ut,{...M("root",{focusable:!0}),ref:e,component:l?"span":"p",variant:y,mod:[{"data-truncate":cde(r),"data-line-clamp":typeof i=="number","data-inline":a,"data-inherit":s},p],size:x,...w})});hu.classes=UK;hu.displayName="@mantine/core/Text";var FK={root:"m_849cf0da"};const hde={underline:"hover"},Em=kl((t,e)=>{const{underline:n,className:i,unstyled:r,mod:a,...s}=Pt("Anchor",hde,t);return k.jsx(hu,{component:"a",ref:e,className:as({[FK.root]:!r},i),...s,mod:[{underline:n},a],__staticSelector:"Anchor",unstyled:r})});Em.classes=FK;Em.displayName="@mantine/core/Anchor";function BK(t){return typeof t=="string"?{value:t,label:t}:"value"in t&&!("label"in t)?{value:t.value,label:t.value,disabled:t.disabled}:typeof t=="number"?{value:t.toString(),label:t.toString()}:"group"in t?{group:t.group,items:t.items.map(e=>BK(e))}:t}function dde(t){return t?t.map(e=>BK(e)):[]}function zK(t){return t.reduce((e,n)=>"group"in n?{...e,...zK(n.items)}:(e[n.value]=n,e),{})}var Go={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const pde={error:null},mde=(t,{size:e,color:n})=>({chevron:{"--combobox-chevron-size":oi(e,"combobox-chevron-size"),"--combobox-chevron-color":n?ia(n,t):void 0}}),HL=tn((t,e)=>{const n=Pt("ComboboxChevron",pde,t),{size:i,error:r,style:a,className:s,classNames:o,styles:l,unstyled:c,vars:u,mod:f,...h}=n,d=Tn({name:"ComboboxChevron",classes:Go,props:n,style:a,className:s,classNames:o,styles:l,unstyled:c,vars:u,varsResolver:mde,rootSelector:"chevron"});return k.jsx(ut,{component:"svg",...h,...d("chevron"),size:i,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:r},f],ref:e,children:k.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});HL.classes=Go;HL.displayName="@mantine/core/ComboboxChevron";const[gde,Rc]=yu("Combobox component was not found in tree"),jK=I.forwardRef(({size:t,onMouseDown:e,onClick:n,onClear:i,...r},a)=>k.jsx(da.ClearButton,{ref:a,tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:s=>{s.preventDefault(),e?.(s)},onClick:s=>{i(),n?.(s)}}));jK.displayName="@mantine/core/ComboboxClearButton";const VL=tn((t,e)=>{const{classNames:n,styles:i,className:r,style:a,hidden:s,...o}=Pt("ComboboxDropdown",null,t),l=Rc();return k.jsx(Ho.Dropdown,{...o,ref:e,role:"presentation","data-hidden":s||void 0,...l.getStyles("dropdown",{className:r,style:a,classNames:n,styles:i})})});VL.classes=Go;VL.displayName="@mantine/core/ComboboxDropdown";const bde={refProp:"ref"},HK=tn((t,e)=>{const{children:n,refProp:i}=Pt("ComboboxDropdownTarget",bde,t);if(Rc(),!ng(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return k.jsx(Ho.Target,{ref:e,refProp:i,children:n})});HK.displayName="@mantine/core/ComboboxDropdownTarget";const GL=tn((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,...o}=Pt("ComboboxEmpty",null,t),l=Rc();return k.jsx(ut,{ref:e,...l.getStyles("empty",{className:i,classNames:n,styles:a,style:r}),...o})});GL.classes=Go;GL.displayName="@mantine/core/ComboboxEmpty";function WL({onKeyDown:t,withKeyboardNavigation:e,withAriaAttributes:n,withExpandedAttribute:i,targetType:r,autoComplete:a}){const s=Rc(),[o,l]=I.useState(null),c=f=>{if(t?.(f),!s.readOnly&&e){if(f.nativeEvent.isComposing)return;if(f.nativeEvent.code==="ArrowDown"&&(f.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown("keyboard"),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),f.nativeEvent.code==="ArrowUp"&&(f.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown("keyboard"),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),f.nativeEvent.code==="Enter"||f.nativeEvent.code==="NumpadEnter"){if(f.nativeEvent.keyCode===229)return;const h=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&h!==-1?(f.preventDefault(),s.store.clickSelectedOption()):r==="button"&&(f.preventDefault(),s.store.openDropdown("keyboard"))}f.key==="Escape"&&s.store.closeDropdown("keyboard"),f.nativeEvent.code==="Space"&&r==="button"&&(f.preventDefault(),s.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&o||void 0,autoComplete:a,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},onKeyDown:c}}const vde={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},VK=tn((t,e)=>{const{children:n,refProp:i,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:s,targetType:o,autoComplete:l,...c}=Pt("ComboboxEventsTarget",vde,t);if(!ng(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=Rc(),f=WL({targetType:o,withAriaAttributes:a,withKeyboardNavigation:r,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:l});return I.cloneElement(n,{...f,...c,[i]:Ps(e,u.store.targetRef,tA(n))})});VK.displayName="@mantine/core/ComboboxEventsTarget";const qL=tn((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,...o}=Pt("ComboboxFooter",null,t),l=Rc();return k.jsx(ut,{ref:e,...l.getStyles("footer",{className:i,classNames:n,style:r,styles:a}),...o,onMouseDown:c=>{c.preventDefault()}})});qL.classes=Go;qL.displayName="@mantine/core/ComboboxFooter";const XL=tn((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,children:o,label:l,id:c,...u}=Pt("ComboboxGroup",null,t),f=Rc(),h=uf(c);return k.jsxs(ut,{ref:e,role:"group","aria-labelledby":l?h:void 0,...f.getStyles("group",{className:i,classNames:n,style:r,styles:a}),...u,children:[l&&k.jsx("div",{id:h,...f.getStyles("groupLabel",{classNames:n,styles:a}),children:l}),o]})});XL.classes=Go;XL.displayName="@mantine/core/ComboboxGroup";const KL=tn((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,...o}=Pt("ComboboxHeader",null,t),l=Rc();return k.jsx(ut,{ref:e,...l.getStyles("header",{className:i,classNames:n,style:r,styles:a}),...o,onMouseDown:c=>{c.preventDefault()}})});KL.classes=Go;KL.displayName="@mantine/core/ComboboxHeader";function GK({value:t,valuesDivider:e=",",...n}){return k.jsx("input",{type:"hidden",value:Array.isArray(t)?t.join(e):t||"",...n})}GK.displayName="@mantine/core/ComboboxHiddenInput";const YL=tn((t,e)=>{const n=Pt("ComboboxOption",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,onClick:l,id:c,active:u,onMouseDown:f,onMouseOver:h,disabled:d,selected:g,mod:b,...y}=n,p=Rc(),x=I.useId(),_=c||x;return k.jsx(ut,{...p.getStyles("option",{className:r,classNames:i,styles:s,style:a}),...y,ref:e,id:_,mod:["combobox-option",{"combobox-active":u,"combobox-disabled":d,"combobox-selected":g},b],role:"option",onClick:w=>{d?w.preventDefault():(p.onOptionSubmit?.(n.value,n),l?.(w))},onMouseDown:w=>{w.preventDefault(),f?.(w)},onMouseOver:w=>{p.resetSelectionOnOptionHover&&p.store.resetSelectedOption(),h?.(w)}})});YL.classes=Go;YL.displayName="@mantine/core/ComboboxOption";const JL=tn((t,e)=>{const n=Pt("ComboboxOptions",null,t),{classNames:i,className:r,style:a,styles:s,id:o,onMouseDown:l,labelledBy:c,...u}=n,f=Rc(),h=uf(o);return I.useEffect(()=>{f.store.setListId(h)},[h]),k.jsx(ut,{ref:e,...f.getStyles("options",{className:r,style:a,classNames:i,styles:s}),...u,id:h,role:"listbox","aria-labelledby":c,onMouseDown:d=>{d.preventDefault(),l?.(d)}})});JL.classes=Go;JL.displayName="@mantine/core/ComboboxOptions";const yde={withAriaAttributes:!0,withKeyboardNavigation:!0},$L=tn((t,e)=>{const n=Pt("ComboboxSearch",yde,t),{classNames:i,styles:r,unstyled:a,vars:s,withAriaAttributes:o,onKeyDown:l,withKeyboardNavigation:c,size:u,...f}=n,h=Rc(),d=h.getStyles("search"),g=WL({targetType:"input",withAriaAttributes:o,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:l,autoComplete:"off"});return k.jsx(da,{ref:Ps(e,h.store.searchRef),classNames:[{input:d.className},i],styles:[{input:d.style},r],size:u||h.size,...g,...f,__staticSelector:"Combobox"})});$L.classes=Go;$L.displayName="@mantine/core/ComboboxSearch";const xde={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},WK=tn((t,e)=>{const{children:n,refProp:i,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:s,targetType:o,autoComplete:l,...c}=Pt("ComboboxTarget",xde,t);if(!ng(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=Rc(),f=WL({targetType:o,withAriaAttributes:a,withKeyboardNavigation:r,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:l}),h=I.cloneElement(n,{...f,...c});return k.jsx(Ho.Target,{ref:Ps(e,u.store.targetRef),children:h})});WK.displayName="@mantine/core/ComboboxTarget";function _de(t,e,n){for(let i=t-1;i>=0;i-=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i;if(n){for(let i=e.length-1;i>-1;i-=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i}return t}function Sde(t,e,n){for(let i=t+1;i<e.length;i+=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i;if(n){for(let i=0;i<e.length;i+=1)if(!e[i].hasAttribute("data-combobox-disabled"))return i}return t}function wde(t){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute("data-combobox-disabled"))return e;return-1}function qK({defaultOpened:t,opened:e,onOpenedChange:n,onDropdownClose:i,onDropdownOpen:r,loop:a=!0,scrollBehavior:s="instant"}={}){const[o,l]=Al({value:e,defaultValue:t,finalValue:!1,onChange:n}),c=I.useRef(null),u=I.useRef(-1),f=I.useRef(null),h=I.useRef(null),d=I.useRef(-1),g=I.useRef(-1),b=I.useRef(-1),y=I.useCallback((B="unknown")=>{o||(l(!0),r?.(B))},[l,r,o]),p=I.useCallback((B="unknown")=>{o&&(l(!1),i?.(B))},[l,i,o]),x=I.useCallback((B="unknown")=>{o?p(B):y(B)},[p,y,o]),_=I.useCallback(()=>{const B=document.querySelector(`#${c.current} [data-combobox-selected]`);B?.removeAttribute("data-combobox-selected"),B?.removeAttribute("aria-selected")},[]),w=I.useCallback(B=>{const H=document.getElementById(c.current)?.querySelectorAll("[data-combobox-option]");if(!H)return null;const W=B>=H.length?0:B<0?H.length-1:B;return u.current=W,H?.[W]&&!H[W].hasAttribute("data-combobox-disabled")?(_(),H[W].setAttribute("data-combobox-selected","true"),H[W].setAttribute("aria-selected","true"),H[W].scrollIntoView({block:"nearest",behavior:s}),H[W].id):null},[s,_]),M=I.useCallback(()=>{const B=document.querySelector(`#${c.current} [data-combobox-active]`);if(B){const G=document.querySelectorAll(`#${c.current} [data-combobox-option]`),H=Array.from(G).findIndex(W=>W===B);return w(H)}return w(0)},[w]),S=I.useCallback(()=>w(Sde(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),a)),[w,a]),A=I.useCallback(()=>w(_de(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),a)),[w,a]),C=I.useCallback(()=>w(wde(document.querySelectorAll(`#${c.current} [data-combobox-option]`))),[w]),D=I.useCallback((B="selected",G)=>{b.current=window.setTimeout(()=>{const H=document.querySelectorAll(`#${c.current} [data-combobox-option]`),W=Array.from(H).findIndex(F=>F.hasAttribute(`data-combobox-${B}`));u.current=W,G?.scrollIntoView&&H[W]?.scrollIntoView({block:"nearest",behavior:s})},0)},[]),R=I.useCallback(()=>{u.current=-1,_()},[_]),N=I.useCallback(()=>{document.querySelectorAll(`#${c.current} [data-combobox-option]`)?.[u.current]?.click()},[]),U=I.useCallback(B=>{c.current=B},[]),j=I.useCallback(()=>{d.current=window.setTimeout(()=>f.current?.focus(),0)},[]),z=I.useCallback(()=>{g.current=window.setTimeout(()=>h.current?.focus(),0)},[]),q=I.useCallback(()=>u.current,[]);return I.useEffect(()=>()=>{window.clearTimeout(d.current),window.clearTimeout(g.current),window.clearTimeout(b.current)},[]),{dropdownOpened:o,openDropdown:y,closeDropdown:p,toggleDropdown:x,selectedOptionIndex:u.current,getSelectedOptionIndex:q,selectOption:w,selectFirstOption:C,selectActiveOption:M,selectNextOption:S,selectPreviousOption:A,resetSelectedOption:R,updateSelectedOptionIndex:D,listId:c.current,setListId:U,clickSelectedOption:N,searchRef:f,focusSearchInput:j,targetRef:h,focusTarget:z}}const Ede={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},Mde=(t,{size:e,dropdownPadding:n})=>({options:{"--combobox-option-fz":Ds(e),"--combobox-option-padding":oi(e,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:Et(n),"--combobox-option-fz":Ds(e),"--combobox-option-padding":oi(e,"combobox-option-padding")}});function vr(t){const e=Pt("Combobox",Ede,t),{classNames:n,styles:i,unstyled:r,children:a,store:s,vars:o,onOptionSubmit:l,onClose:c,size:u,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:d,readOnly:g,attributes:b,...y}=e,p=qK(),x=s||p,_=Tn({name:d||"Combobox",classes:Go,props:e,classNames:n,styles:i,unstyled:r,attributes:b,vars:o,varsResolver:Mde}),w=()=>{c?.(),x.closeDropdown()};return k.jsx(gde,{value:{getStyles:_,store:x,onOptionSubmit:l,size:u,resetSelectionOnOptionHover:h,readOnly:g},children:k.jsx(Ho,{opened:x.dropdownOpened,preventPositionChangeWhenVisible:!0,...y,onChange:M=>!M&&w(),withRoles:!1,unstyled:r,children:a})})}const Tde=t=>t;vr.extend=Tde;vr.classes=Go;vr.displayName="@mantine/core/Combobox";vr.Target=WK;vr.Dropdown=VL;vr.Options=JL;vr.Option=YL;vr.Search=$L;vr.Empty=GL;vr.Chevron=HL;vr.Footer=qL;vr.Header=KL;vr.EventsTarget=VK;vr.DropdownTarget=HK;vr.Group=XL;vr.ClearButton=jK;vr.HiddenInput=GK;var XK={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const KK=XK,ZL=I.forwardRef(({__staticSelector:t,__stylesApiProps:e,className:n,classNames:i,styles:r,unstyled:a,children:s,label:o,description:l,id:c,disabled:u,error:f,size:h,labelPosition:d="left",bodyElement:g="div",labelElement:b="label",variant:y,style:p,vars:x,mod:_,attributes:w,...M},S)=>{const A=Tn({name:t,props:e,className:n,style:p,classes:XK,classNames:i,styles:r,unstyled:a,attributes:w});return k.jsx(ut,{...A("root"),ref:S,__vars:{"--label-fz":Ds(h),"--label-lh":oi(h,"label-lh")},mod:[{"label-position":d},_],variant:y,size:h,...M,children:k.jsxs(ut,{component:g,htmlFor:g==="label"?c:void 0,...A("body"),children:[s,k.jsxs("div",{...A("labelWrapper"),"data-disabled":u||void 0,children:[o&&k.jsx(ut,{component:b,htmlFor:b==="label"?c:void 0,...A("label"),"data-disabled":u||void 0,children:o}),l&&k.jsx(da.Description,{size:h,__inheritStyles:!1,...A("description"),children:l}),f&&typeof f!="boolean"&&k.jsx(da.Error,{size:h,__inheritStyles:!1,...A("error"),children:f})]})]})})});ZL.displayName="@mantine/core/InlineInput";const YK=I.createContext(null),Ade=YK.Provider,JK=()=>I.useContext(YK),[Cde,Rde]=E_();var $K={card:"m_26775b0a"};const kde={withBorder:!0},Dde=(t,{radius:e})=>({card:{"--card-radius":aa(e)}}),QL=tn((t,e)=>{const n=Pt("CheckboxCard",kde,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,checked:c,mod:u,withBorder:f,value:h,onClick:d,defaultChecked:g,onChange:b,attributes:y,...p}=n,x=Tn({name:"CheckboxCard",classes:$K,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l,varsResolver:Dde,rootSelector:"card"}),_=JK(),w=typeof c=="boolean"?c:_?_.value.includes(h||""):void 0,[M,S]=Al({value:w,defaultValue:g,finalValue:!1,onChange:b});return k.jsx(Cde,{value:{checked:M},children:k.jsx(rf,{ref:e,mod:[{"with-border":f,checked:M},u],...x("card"),...p,role:"checkbox","aria-checked":M,onClick:A=>{d?.(A),_?.onChange(h||""),S(!M)}})})});QL.displayName="@mantine/core/CheckboxCard";QL.classes=$K;function ZK({children:t,role:e}){const n=R_();return n?k.jsx("div",{role:e,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:t}):k.jsx(k.Fragment,{children:t})}const eP=tn((t,e)=>{const{value:n,defaultValue:i,onChange:r,size:a,wrapperProps:s,children:o,readOnly:l,...c}=Pt("CheckboxGroup",null,t),[u,f]=Al({value:n,defaultValue:i,finalValue:[],onChange:r}),h=d=>{const g=typeof d=="string"?d:d.currentTarget.value;!l&&f(u.includes(g)?u.filter(b=>b!==g):[...u,g])};return k.jsx(Ade,{value:{value:u,onChange:h,size:a},children:k.jsx(da.Wrapper,{size:a,ref:e,...s,...c,labelElement:"div",__staticSelector:"CheckboxGroup",children:k.jsx(ZK,{role:"group",children:o})})})});eP.classes=da.Wrapper.classes;eP.displayName="@mantine/core/CheckboxGroup";function tP({size:t,style:e,...n}){const i=t!==void 0?{width:Et(t),height:Et(t),...e}:e;return k.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:i,"aria-hidden":!0,...n,children:k.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function QK({indeterminate:t,...e}){return t?k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...e,children:k.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):k.jsx(tP,{...e})}var eY={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const Ode={icon:QK,variant:"filled"},Ide=(t,{radius:e,color:n,size:i,iconColor:r,variant:a,autoContrast:s})=>{const o=fh({color:n||t.primaryColor,theme:t}),l=o.isThemeColor&&o.shade===void 0?`var(--mantine-color-${o.color}-outline)`:o.color;return{indicator:{"--checkbox-size":oi(i,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:aa(e),"--checkbox-color":a==="outline"?l:ia(n,t),"--checkbox-icon-color":r?ia(r,t):sA(s,t)?M_({color:n,theme:t,autoContrast:s}):void 0}}},nP=tn((t,e)=>{const n=Pt("CheckboxIndicator",Ode,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,icon:c,indeterminate:u,radius:f,color:h,iconColor:d,autoContrast:g,checked:b,mod:y,variant:p,disabled:x,attributes:_,...w}=n,M=Tn({name:"CheckboxIndicator",classes:eY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:_,vars:l,varsResolver:Ide,rootSelector:"indicator"}),S=Rde(),A=typeof b=="boolean"||typeof u=="boolean"?b||u:S?.checked||!1;return k.jsx(ut,{ref:e,...M("indicator",{variant:p}),variant:p,mod:[{checked:A,disabled:x},y],...w,children:k.jsx(c,{indeterminate:u,...M("icon")})})});nP.displayName="@mantine/core/CheckboxIndicator";nP.classes=eY;var tY={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const Nde={labelPosition:"right",icon:QK,variant:"filled"},Lde=(t,{radius:e,color:n,size:i,iconColor:r,variant:a,autoContrast:s})=>{const o=fh({color:n||t.primaryColor,theme:t}),l=o.isThemeColor&&o.shade===void 0?`var(--mantine-color-${o.color}-outline)`:o.color;return{root:{"--checkbox-size":oi(i,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:aa(e),"--checkbox-color":a==="outline"?l:ia(n,t),"--checkbox-icon-color":r?ia(r,t):sA(s,t)?M_({color:n,theme:t,autoContrast:s}):void 0}}},mh=tn((t,e)=>{const n=Pt("Checkbox",Nde,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,label:u,id:f,size:h,radius:d,wrapperProps:g,checked:b,labelPosition:y,description:p,error:x,disabled:_,variant:w,indeterminate:M,icon:S,rootRef:A,iconColor:C,onChange:D,autoContrast:R,mod:N,attributes:U,...j}=n,z=JK(),q=h||z?.size,B=Tn({name:"Checkbox",props:n,classes:tY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:U,vars:l,varsResolver:Lde}),{styleProps:G,rest:H}=T_(j),W=uf(f),F=z?{checked:z.value.includes(H.value),onChange:V=>{z.onChange(V),D?.(V)}}:{},Y=I.useRef(null),Z=e||Y;return I.useEffect(()=>{Z&&"current"in Z&&Z.current&&(Z.current.indeterminate=M||!1)},[M,Z]),k.jsx(ZL,{...B("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:W,size:q,labelPosition:y,label:u,description:p,error:x,disabled:_,classNames:i,styles:s,unstyled:o,"data-checked":F.checked||b||void 0,variant:w,ref:A,mod:N,...G,...g,children:k.jsxs(ut,{...B("inner"),mod:{"data-label-position":y},children:[k.jsx(ut,{component:"input",id:W,ref:Z,checked:b,disabled:_,mod:{error:!!x,indeterminate:M},...B("input",{focusable:!0,variant:w}),onChange:D,...H,...F,type:"checkbox"}),k.jsx(S,{indeterminate:M,...B("icon")})]})})});mh.classes={...tY,...KK};mh.displayName="@mantine/core/Checkbox";mh.Group=eP;mh.Indicator=nP;mh.Card=QL;function L1(t){return"group"in t}function nY({options:t,search:e,limit:n}){const i=e.trim().toLowerCase(),r=[];for(let a=0;a<t.length;a+=1){const s=t[a];if(r.length===n)return r;L1(s)&&r.push({group:s.group,items:nY({options:s.items,search:e,limit:n-r.length})}),L1(s)||s.label.toLowerCase().includes(i)&&r.push(s)}return r}function Pde(t){if(t.length===0)return!0;for(const e of t)if(!("group"in e)||e.items.length>0)return!1;return!0}function iY(t,e=new Set){if(Array.isArray(t))for(const n of t)if(L1(n))iY(n.items,e);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof n.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(e.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);e.add(n.value)}}function Ude(t,e){return Array.isArray(t)?t.includes(e):t===e}function rY({data:t,withCheckIcon:e,value:n,checkIconPosition:i,unstyled:r,renderOption:a}){if(!L1(t)){const o=Ude(n,t.value),l=e&&o&&k.jsx(tP,{className:Go.optionsDropdownCheckIcon}),c=k.jsxs(k.Fragment,{children:[i==="left"&&l,k.jsx("span",{children:t.label}),i==="right"&&l]});return k.jsx(vr.Option,{value:t.value,disabled:t.disabled,className:as({[Go.optionsDropdownOption]:!r}),"data-reverse":i==="right"||void 0,"data-checked":o||void 0,"aria-selected":o,active:o,children:typeof a=="function"?a({option:t,checked:o}):c})}const s=t.items.map(o=>k.jsx(rY,{data:o,value:n,unstyled:r,withCheckIcon:e,checkIconPosition:i,renderOption:a},o.value));return k.jsx(vr.Group,{label:t.group,children:s})}function Fde({data:t,hidden:e,hiddenWhenEmpty:n,filter:i,search:r,limit:a,maxDropdownHeight:s,withScrollArea:o=!0,filterOptions:l=!0,withCheckIcon:c=!1,value:u,checkIconPosition:f,nothingFoundMessage:h,unstyled:d,labelId:g,renderOption:b,scrollAreaProps:y,"aria-label":p}){iY(t);const _=typeof r=="string"?(i||nY)({options:t,search:l?r:"",limit:a??1/0}):t,w=Pde(_),M=_.map(S=>k.jsx(rY,{data:S,withCheckIcon:c,value:u,checkIconPosition:f,unstyled:d,renderOption:b},L1(S)?S.group:S.value));return k.jsx(vr.Dropdown,{hidden:e||n&&w,"data-composed":!0,children:k.jsxs(vr.Options,{labelledBy:g,"aria-label":p,children:[o?k.jsx(Ac.Autosize,{mah:s??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...y,children:M}):M,w&&h&&k.jsx(vr.Empty,{children:h})]})})}var aY={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const Bde={iconSize:48},zde=(t,{color:e,iconSize:n,radius:i})=>{const r=fh({color:e||t.primaryColor,theme:t,colorScheme:"dark"}),a=fh({color:e||t.primaryColor,theme:t,colorScheme:"light"});return{root:{"--bq-bg-light":ec(a.value,.07),"--bq-bg-dark":ec(r.value,.06),"--bq-bd":ia(e,t),"--bq-icon-size":Et(n),"--bq-radius":aa(i)}}},iP=tn((t,e)=>{const n=Pt("Blockquote",Bde,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,children:c,icon:u,iconSize:f,cite:h,attributes:d,...g}=n,b=Tn({name:"Blockquote",classes:aY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:zde});return k.jsxs(ut,{component:"blockquote",ref:e,...b("root"),...g,children:[u&&k.jsx("span",{...b("icon"),children:u}),c,h&&k.jsx("cite",{...b("cite"),children:h})]})});iP.classes=aY;iP.displayName="@mantine/core/Blockquote";var sY={root:"m_fea6bf1a",burger:"m_d4fb9cad"};const jde=(t,{color:e,size:n,lineSize:i,transitionDuration:r,transitionTimingFunction:a})=>({root:{"--burger-color":e?ia(e,t):void 0,"--burger-size":oi(n,"burger-size"),"--burger-line-size":i?Et(i):void 0,"--burger-transition-duration":r===void 0?void 0:`${r}ms`,"--burger-transition-timing-function":a}}),rP=tn((t,e)=>{const n=Pt("Burger",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,opened:c,children:u,transitionDuration:f,transitionTimingFunction:h,lineSize:d,attributes:g,...b}=n,y=Tn({name:"Burger",classes:sY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:jde});return k.jsxs(rf,{...y("root"),ref:e,...b,children:[k.jsx(ut,{mod:["reduce-motion",{opened:c}],...y("burger")}),u]})});rP.classes=sY;rP.displayName="@mantine/core/Burger";var Iv={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const az={orientation:"horizontal"},Hde=(t,{borderWidth:e})=>({group:{"--button-border-width":Et(e)}}),aP=tn((t,e)=>{const n=Pt("ButtonGroup",az,t),{className:i,style:r,classNames:a,styles:s,unstyled:o,orientation:l,vars:c,borderWidth:u,variant:f,mod:h,attributes:d,...g}=Pt("ButtonGroup",az,t),b=Tn({name:"ButtonGroup",props:n,classes:Iv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:c,varsResolver:Hde,rootSelector:"group"});return k.jsx(ut,{...b("group"),ref:e,variant:f,mod:[{"data-orientation":l},h],role:"group",...g})});aP.classes=Iv;aP.displayName="@mantine/core/ButtonGroup";const Vde=(t,{radius:e,color:n,gradient:i,variant:r,autoContrast:a,size:s})=>{const o=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:a});return{groupSection:{"--section-height":oi(s,"section-height"),"--section-padding-x":oi(s,"section-padding-x"),"--section-fz":s?.includes("compact")?Ds(s.replace("compact-","")):Ds(s),"--section-radius":e===void 0?void 0:aa(e),"--section-bg":n||r?o.background:void 0,"--section-color":o.color,"--section-bd":n||r?o.border:void 0}}},sP=tn((t,e)=>{const n=Pt("ButtonGroupSection",null,t),{className:i,style:r,classNames:a,styles:s,unstyled:o,vars:l,variant:c,gradient:u,radius:f,autoContrast:h,attributes:d,...g}=n,b=Tn({name:"ButtonGroupSection",props:n,classes:Iv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:Vde,rootSelector:"groupSection"});return k.jsx(ut,{...b("groupSection"),ref:e,variant:c,...g})});sP.classes=Iv;sP.displayName="@mantine/core/ButtonGroupSection";const Gde={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${Et(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},Wde=(t,{radius:e,color:n,gradient:i,variant:r,size:a,justify:s,autoContrast:o})=>{const l=t.variantColorResolver({color:n||t.primaryColor,theme:t,gradient:i,variant:r||"filled",autoContrast:o});return{root:{"--button-justify":s,"--button-height":oi(a,"button-height"),"--button-padding-x":oi(a,"button-padding-x"),"--button-fz":a?.includes("compact")?Ds(a.replace("compact-","")):Ds(a),"--button-radius":e===void 0?void 0:aa(e),"--button-bg":n||r?l.background:void 0,"--button-hover":n||r?l.hover:void 0,"--button-color":l.color,"--button-bd":n||r?l.border:void 0,"--button-hover-color":n||r?l.hoverColor:void 0}}},As=kl((t,e)=>{const n=Pt("Button",null,t),{style:i,vars:r,className:a,color:s,disabled:o,children:l,leftSection:c,rightSection:u,fullWidth:f,variant:h,radius:d,loading:g,loaderProps:b,gradient:y,classNames:p,styles:x,unstyled:_,"data-disabled":w,autoContrast:M,mod:S,attributes:A,...C}=n,D=Tn({name:"Button",props:n,classes:Iv,className:a,style:i,classNames:p,styles:x,unstyled:_,attributes:A,vars:r,varsResolver:Wde}),R=!!c,N=!!u;return k.jsxs(rf,{ref:e,...D("root",{active:!o&&!g&&!w}),unstyled:_,variant:h,disabled:o||g,mod:[{disabled:o||w,loading:g,block:f,"with-left-section":R,"with-right-section":N},S],...C,children:[typeof g=="boolean"&&k.jsx(Sl,{mounted:g,transition:Gde,duration:150,children:U=>k.jsx(ut,{component:"span",...D("loader",{style:U}),"aria-hidden":!0,children:k.jsx(Wd,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...b})})}),k.jsxs("span",{...D("inner"),children:[c&&k.jsx(ut,{component:"span",...D("section"),mod:{position:"left"},children:c}),k.jsx(ut,{component:"span",mod:{loading:g},...D("label"),children:l}),u&&k.jsx(ut,{component:"span",...D("section"),mod:{position:"right"},children:u})]})]})});As.classes=Iv;As.displayName="@mantine/core/Button";As.Group=aP;As.GroupSection=sP;var oY={root:"m_b183c0a2"};const qde=(t,{color:e})=>({root:{"--code-bg":e?ia(e,t):void 0}}),oP=tn((t,e)=>{const n=Pt("Code",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,block:u,variant:f,mod:h,attributes:d,...g}=n,b=Tn({name:"Code",props:n,classes:oY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:qde});return k.jsx(ut,{component:u?"pre":"code",variant:f,ref:e,mod:[{block:u},h],...b("root"),...g,dir:"ltr"})});oP.classes=oY;oP.displayName="@mantine/core/Code";var lY={root:"m_de3d2490",colorOverlay:"m_862f3d1b",shadowOverlay:"m_98ae7f22",alphaOverlay:"m_95709ac0",childrenOverlay:"m_93e74e3"};const sz={withShadow:!0},Xde=(t,{radius:e,size:n})=>({root:{"--cs-radius":e===void 0?void 0:aa(e),"--cs-size":Et(n)}}),k_=kl((t,e)=>{const n=Pt("ColorSwatch",sz,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,size:u,radius:f,withShadow:h,children:d,variant:g,attributes:b,...y}=Pt("ColorSwatch",sz,n),p=Tn({name:"ColorSwatch",props:n,classes:lY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:l,varsResolver:Xde});return k.jsxs(ut,{ref:e,variant:g,size:u,...p("root",{focusable:!0}),...y,children:[k.jsx("span",{...p("alphaOverlay")}),h&&k.jsx("span",{...p("shadowOverlay")}),k.jsx("span",{...p("colorOverlay",{style:{backgroundColor:c}})}),k.jsx("span",{...p("childrenOverlay"),children:d})]})});k_.classes=lY;k_.displayName="@mantine/core/ColorSwatch";const[Kde,lP]=E_(null),cP=I.forwardRef(({position:t,...e},n)=>k.jsx(ut,{ref:n,__vars:{"--thumb-y-offset":`${t.y*100}%`,"--thumb-x-offset":`${t.x*100}%`},...e}));cP.displayName="@mantine/core/ColorPickerThumb";var uP={wrapper:"m_fee9c77",preview:"m_9dddfbac",body:"m_bffecc3e",sliders:"m_3283bb96",thumb:"m_40d572ba",swatch:"m_d8ee6fd8",swatches:"m_5711e686",saturation:"m_202a296e",saturationOverlay:"m_11b3db02",slider:"m_d856d47d",sliderOverlay:"m_8f327113"};const fP=tn((t,e)=>{const n=Pt("ColorSlider",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,onChange:c,onChangeEnd:u,maxValue:f,round:h,size:d="md",focusable:g=!0,value:b,overlays:y,thumbColor:p="transparent",onScrubStart:x,onScrubEnd:_,__staticSelector:w="ColorPicker",attributes:M,...S}=n,A=Tn({name:w,classes:uP,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:M}),D=lP()?.getStyles||A,R=va(),[N,U]=I.useState({y:0,x:b/f}),j=I.useRef(N),z=W=>h?Math.round(W*f):W*f,{ref:q}=fL(({x:W,y:F})=>{j.current={x:W,y:F},c?.(z(W))},{onScrubEnd:()=>{const{x:W}=j.current;u?.(z(W)),_?.()},onScrubStart:x});vc(()=>{U({y:0,x:b/f})},[b]);const B=(W,F)=>{W.preventDefault();const Y=aX(F);c?.(z(Y.x)),u?.(z(Y.x))},G=W=>{switch(W.key){case"ArrowRight":{B(W,{x:N.x+.05,y:N.y});break}case"ArrowLeft":{B(W,{x:N.x-.05,y:N.y});break}}},H=y.map((W,F)=>I.createElement("div",{...D("sliderOverlay"),style:W,key:F}));return k.jsxs(ut,{...S,ref:Ps(q,e),...D("slider"),role:"slider","aria-valuenow":b,"aria-valuemax":f,"aria-valuemin":0,tabIndex:g?0:-1,onKeyDown:G,"data-focus-ring":R.focusRing,__vars:{"--cp-thumb-size":`var(--cp-thumb-size-${d})`},children:[H,k.jsx(cP,{position:N,...D("thumb",{style:{top:Et(1),background:p}})})]})});fP.displayName="@mantine/core/ColorSlider";function pc(t,e=0,n=10**e){return Math.round(n*t)/n}function Yde({h:t,s:e,l:n,a:i}){const r=e*((n<50?n:100-n)/100);return{h:t,s:r>0?2*r/(n+r)*100:0,v:n+r,a:i}}const Jde={grad:360/400,turn:360,rad:360/(Math.PI*2)};function $de(t,e="deg"){return Number(t)*(Jde[e]||1)}const Zde=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function oz(t){const e=Zde.exec(t);return e?Yde({h:$de(e[1],e[2]),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)}):{h:0,s:0,v:0,a:1}}function FO({r:t,g:e,b:n,a:i}){const r=Math.max(t,e,n),a=r-Math.min(t,e,n),s=a?r===t?(e-n)/a:r===e?2+(n-t)/a:4+(t-e)/a:0;return{h:pc(60*(s<0?s+6:s),3),s:pc(r?a/r*100:0,3),v:pc(r/255*100,3),a:i}}function BO(t){const e=t[0]==="#"?t.slice(1):t;return e.length===3?FO({r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}):FO({r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16),a:1})}function Qde(t){const e=t[0]==="#"?t.slice(1):t,n=s=>pc(parseInt(s,16)/255,3);if(e.length===4){const s=e.slice(0,3),o=n(e[3]+e[3]);return{...BO(s),a:o}}const i=e.slice(0,6),r=n(e.slice(6,8));return{...BO(i),a:r}}const epe=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function lz(t){const e=epe.exec(t);return e?FO({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):{h:0,s:0,v:0,a:1}}const cY={hex:/^#?([0-9A-F]{3}){1,2}$/i,hexa:/^#?([0-9A-F]{4}){1,2}$/i,rgb:/^rgb\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,rgba:/^rgba\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,hsl:/hsl\(\s*(\d+)\s*,\s*(\d+(?:\.\d+)?%)\s*,\s*(\d+(?:\.\d+)?%)\)/i,hsla:/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/i},tpe={hex:BO,hexa:Qde,rgb:lz,rgba:lz,hsl:oz,hsla:oz};function wx(t){for(const[,e]of Object.entries(cY))if(e.test(t))return!0;return!1}function im(t){if(typeof t!="string")return{h:0,s:0,v:0,a:1};if(t==="transparent")return{h:0,s:0,v:0,a:0};const e=t.trim();for(const[n,i]of Object.entries(cY))if(i.test(e))return tpe[n](e);return{h:0,s:0,v:0,a:1}}const uY=I.forwardRef((t,e)=>{const{value:n,onChange:i,onChangeEnd:r,color:a,...s}=Pt("AlphaSlider",null,t);return k.jsx(fP,{...s,ref:e,value:n,onChange:o=>i?.(pc(o,2)),onChangeEnd:o=>r?.(pc(o,2)),maxValue:1,round:!1,"data-alpha":!0,overlays:[{backgroundImage:"linear-gradient(45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(-45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--slider-checkers) 75%), linear-gradient(-45deg, var(--mantine-color-body) 75%, var(--slider-checkers) 75%)",backgroundSize:`${Et(8)} ${Et(8)}`,backgroundPosition:`0 0, 0 ${Et(4)}, ${Et(4)} ${Et(-4)}, ${Et(-4)} 0`},{backgroundImage:`linear-gradient(90deg, transparent, ${a})`},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${Et(1)} inset, rgb(0, 0, 0, .15) 0 0 ${Et(4)} inset`}]})});uY.displayName="@mantine/core/AlphaSlider";function fY({h:t,s:e,v:n,a:i}){const r=t/360*6,a=e/100,s=n/100,o=Math.floor(r),l=s*(1-a),c=s*(1-(r-o)*a),u=s*(1-(1-r+o)*a),f=o%6;return{r:pc([s,c,l,l,u,s][f]*255),g:pc([u,s,s,c,l,l][f]*255),b:pc([l,l,u,s,s,c][f]*255),a:pc(i,2)}}function cz(t,e){const{r:n,g:i,b:r,a}=fY(t);return e?`rgba(${n}, ${i}, ${r}, ${pc(a,2)})`:`rgb(${n}, ${i}, ${r})`}function uz({h:t,s:e,v:n,a:i},r){const a=(200-e)*n/100,s={h:Math.round(t),s:Math.round(a>0&&a<200?e*n/100/(a<=100?a:200-a)*100:0),l:Math.round(a/2)};return r?`hsla(${s.h}, ${s.s}%, ${s.l}%, ${pc(i,2)})`:`hsl(${s.h}, ${s.s}%, ${s.l}%)`}function cM(t){const e=t.toString(16);return e.length<2?`0${e}`:e}function hY(t){const{r:e,g:n,b:i}=fY(t);return`#${cM(e)}${cM(n)}${cM(i)}`}function npe(t){const e=Math.round(t.a*255);return`${hY(t)}${cM(e)}`}const Y3={hex:hY,hexa:t=>npe(t),rgb:t=>cz(t,!1),rgba:t=>cz(t,!0),hsl:t=>uz(t,!1),hsla:t=>uz(t,!0)};function Yc(t,e){return e?t in Y3?Y3[t](e):Y3.hex(e):"#000000"}const dY=I.forwardRef((t,e)=>{const{value:n,onChange:i,onChangeEnd:r,color:a,...s}=Pt("HueSlider",{},t);return k.jsx(fP,{...s,ref:e,value:n,onChange:i,onChangeEnd:r,maxValue:360,thumbColor:`hsl(${n}, 100%, 50%)`,round:!0,"data-hue":!0,overlays:[{backgroundImage:"linear-gradient(to right,hsl(0,100%,50%),hsl(60,100%,50%),hsl(120,100%,50%),hsl(170,100%,50%),hsl(240,100%,50%),hsl(300,100%,50%),hsl(360,100%,50%))"},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${Et(1)} inset, rgb(0, 0, 0, .15) 0 0 ${Et(4)} inset`}]})});dY.displayName="@mantine/core/HueSlider";function pY({className:t,onChange:e,onChangeEnd:n,value:i,saturationLabel:r,focusable:a=!0,size:s,color:o,onScrubStart:l,onScrubEnd:c,...u}){const{getStyles:f}=lP(),[h,d]=I.useState({x:i.s/100,y:1-i.v/100}),g=I.useRef(h),{ref:b}=fL(({x,y:_})=>{g.current={x,y:_},e({s:Math.round(x*100),v:Math.round((1-_)*100)})},{onScrubEnd:()=>{const{x,y:_}=g.current;n({s:Math.round(x*100),v:Math.round((1-_)*100)}),c?.()},onScrubStart:l});I.useEffect(()=>{d({x:i.s/100,y:1-i.v/100})},[i.s,i.v]);const y=(x,_)=>{x.preventDefault();const w=aX(_);e({s:Math.round(w.x*100),v:Math.round((1-w.y)*100)}),n({s:Math.round(w.x*100),v:Math.round((1-w.y)*100)})},p=x=>{switch(x.key){case"ArrowUp":{y(x,{y:h.y-.05,x:h.x});break}case"ArrowDown":{y(x,{y:h.y+.05,x:h.x});break}case"ArrowRight":{y(x,{x:h.x+.05,y:h.y});break}case"ArrowLeft":{y(x,{x:h.x-.05,y:h.y});break}}};return k.jsxs(ut,{...f("saturation"),ref:b,...u,role:"slider","aria-label":r,"aria-valuenow":h.x,"aria-valuetext":Yc("rgba",i),tabIndex:a?0:-1,onKeyDown:p,children:[k.jsx("div",{...f("saturationOverlay",{style:{backgroundColor:`hsl(${i.h}, 100%, 50%)`}})}),k.jsx("div",{...f("saturationOverlay",{style:{backgroundImage:"linear-gradient(90deg, #fff, transparent)"}})}),k.jsx("div",{...f("saturationOverlay",{style:{backgroundImage:"linear-gradient(0deg, #000, transparent)"}})}),k.jsx(cP,{position:h,...f("thumb",{style:{backgroundColor:o}})})]})}pY.displayName="@mantine/core/Saturation";const mY=I.forwardRef(({className:t,datatype:e,setValue:n,onChangeEnd:i,size:r,focusable:a,data:s,swatchesPerRow:o,value:l,...c},u)=>{const f=lP(),h=s.map((d,g)=>I.createElement(k_,{...f.getStyles("swatch"),unstyled:f.unstyled,component:"button",type:"button",color:d,key:g,radius:"sm",onClick:()=>{n(d),i?.(d)},"aria-label":d,tabIndex:a?0:-1,"data-swatch":!0},l===d&&k.jsx(tP,{size:"35%",color:EX(d)<.5?"white":"black"})));return k.jsx(ut,{...f.getStyles("swatches"),ref:u,...c,children:h})});mY.displayName="@mantine/core/Swatches";const ipe={swatchesPerRow:7,withPicker:!0,focusable:!0,size:"md",__staticSelector:"ColorPicker"},rpe=(t,{size:e,swatchesPerRow:n})=>({wrapper:{"--cp-preview-size":oi(e,"cp-preview-size"),"--cp-width":oi(e,"cp-width"),"--cp-body-spacing":Pd(e),"--cp-swatch-size":`${100/n}%`,"--cp-thumb-size":oi(e,"cp-thumb-size"),"--cp-saturation-height":oi(e,"cp-saturation-height")}}),hP=tn((t,e)=>{const n=Pt("ColorPicker",ipe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,format:c="hex",value:u,defaultValue:f,onChange:h,onChangeEnd:d,withPicker:g,size:b,saturationLabel:y,hueLabel:p,alphaLabel:x,focusable:_,swatches:w,swatchesPerRow:M,fullWidth:S,onColorSwatchClick:A,__staticSelector:C,mod:D,attributes:R,...N}=n,U=Tn({name:C,props:n,classes:uP,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:R,rootSelector:"wrapper",vars:l,varsResolver:rpe}),j=I.useRef(c||"hex"),z=I.useRef(""),q=I.useRef(-1),B=I.useRef(!1),G=c==="hexa"||c==="rgba"||c==="hsla",[H,W,F]=Al({value:u,defaultValue:f,finalValue:"#FFFFFF",onChange:h}),[Y,Z]=I.useState(im(H)),V=()=>{window.clearTimeout(q.current),B.current=!0},de=()=>{window.clearTimeout(q.current),q.current=window.setTimeout(()=>{B.current=!1},200)},se=oe=>{Z(ue=>{const _e={...ue,...oe};return z.current=Yc(j.current,_e),_e}),W(z.current)};return vc(()=>{typeof u=="string"&&wx(u)&&!B.current&&Z(im(u))},[u]),vc(()=>{j.current=c||"hex",W(Yc(j.current,Y))},[c]),k.jsx(Kde,{value:{getStyles:U,unstyled:o},children:k.jsxs(ut,{ref:e,...U("wrapper"),size:b,mod:[{"full-width":S},D],...N,children:[g&&k.jsxs(k.Fragment,{children:[k.jsx(pY,{value:Y,onChange:se,onChangeEnd:({s:oe,v:ue})=>d?.(Yc(j.current,{...Y,s:oe,v:ue})),color:H,size:b,focusable:_,saturationLabel:y,onScrubStart:V,onScrubEnd:de}),k.jsxs("div",{...U("body"),children:[k.jsxs("div",{...U("sliders"),children:[k.jsx(dY,{value:Y.h,onChange:oe=>se({h:oe}),onChangeEnd:oe=>d?.(Yc(j.current,{...Y,h:oe})),size:b,focusable:_,"aria-label":p,onScrubStart:V,onScrubEnd:de}),G&&k.jsx(uY,{value:Y.a,onChange:oe=>se({a:oe}),onChangeEnd:oe=>{d?.(Yc(j.current,{...Y,a:oe}))},size:b,color:Yc("hex",Y),focusable:_,"aria-label":x,onScrubStart:V,onScrubEnd:de})]}),G&&k.jsx(k_,{color:H,radius:"sm",size:"var(--cp-preview-size)",...U("preview")})]})]}),Array.isArray(w)&&k.jsx(mY,{data:w,swatchesPerRow:M,focusable:_,setValue:W,value:H,onChangeEnd:oe=>{const ue=Yc(c,im(oe));A?.(ue),d?.(ue),F||Z(im(oe))}})]})})});hP.classes=uP;hP.displayName="@mantine/core/ColorPicker";function ape({style:t,...e}){return k.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--ci-eye-dropper-icon-size)",height:"var(--ci-eye-dropper-icon-size)",...t},viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[k.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),k.jsx("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),k.jsx("path",{d:"M12 3l0 4"}),k.jsx("path",{d:"M12 21l0 -3"}),k.jsx("path",{d:"M3 12l4 0"}),k.jsx("path",{d:"M21 12l-3 0"}),k.jsx("path",{d:"M12 12l0 .01"})]})}var fz={eyeDropperIcon:"m_b077c2bc",colorPreview:"m_c5ccdcab",dropdown:"m_5ece2cd7"};const hz={format:"hex",fixOnBlur:!0,withPreview:!0,swatchesPerRow:7,withPicker:!0,popoverProps:{transitionProps:{transition:"fade",duration:0}},withEyeDropper:!0},spe=(t,{size:e})=>({eyeDropperIcon:{"--ci-eye-dropper-icon-size":oi(e,"ci-eye-dropper-icon-size")},colorPreview:{"--ci-preview-size":oi(e,"ci-preview-size")}}),Nv=tn((t,e)=>{const n=Pt("ColorInput",hz,t),{classNames:i,styles:r,unstyled:a,disallowInput:s,fixOnBlur:o,popoverProps:l,withPreview:c,withEyeDropper:u,eyeDropperIcon:f,closeOnColorSwatchClick:h,eyeDropperButtonProps:d,value:g,defaultValue:b,onChange:y,onChangeEnd:p,onClick:x,onFocus:_,onBlur:w,inputProps:M,format:S="hex",wrapperProps:A,readOnly:C,withPicker:D,swatches:R,disabled:N,leftSection:U,rightSection:j,swatchesPerRow:z,...q}=LK("ColorInput",hz,t),B=Tn({name:"ColorInput",props:n,classes:fz,classNames:i,styles:r,unstyled:a,rootSelector:"wrapper",vars:n.vars,varsResolver:spe}),{resolvedClassNames:G,resolvedStyles:H}=Cv({classNames:i,styles:r,props:n}),[W,F]=I.useState(!1),[Y,Z]=I.useState(""),[V,de]=Al({value:g,defaultValue:b,finalValue:"",onChange:y}),{supported:se,open:oe}=Hoe(),ue=k.jsx(Dl,{...d,...B("eyeDropperButton",{className:d?.className,style:d?.style}),variant:"subtle",color:"gray",size:M.size,unstyled:a,onClick:()=>oe().then(Ue=>{if(Ue?.sRGBHex){const ze=Yc(S,im(Ue.sRGBHex));de(ze),p?.(ze)}}).catch(()=>{}),children:f||k.jsx(ape,{...B("eyeDropperIcon")})}),_e=Ue=>{_?.(Ue),F(!0)},ke=Ue=>{o&&de(Y),w?.(Ue),F(!1)},Ne=Ue=>{x?.(Ue),F(!0)};return I.useEffect(()=>{(wx(V)||V.trim()==="")&&Z(V)},[V]),vc(()=>{wx(V)&&de(Yc(S,im(V)))},[S]),k.jsx(da.Wrapper,{...A,classNames:G,styles:H,__staticSelector:"ColorInput",children:k.jsxs(Ho,{__staticSelector:"ColorInput",position:"bottom-start",offset:5,opened:W,...l,classNames:G,styles:H,unstyled:a,withRoles:!1,disabled:C||D===!1&&(!Array.isArray(R)||R.length===0),children:[k.jsx(Ho.Target,{children:k.jsx(da,{autoComplete:"off",...q,...M,classNames:G,styles:H,disabled:N,ref:e,__staticSelector:"ColorInput",onFocus:_e,onBlur:ke,onClick:Ne,spellCheck:!1,value:V,onChange:Ue=>{const ze=Ue.currentTarget.value;de(ze),wx(ze)&&p?.(Yc(S,im(ze)))},leftSection:U||(c?k.jsx(k_,{color:wx(V)?V:"#fff",size:"var(--ci-preview-size)",...B("colorPreview")}):null),readOnly:s||C,pointer:s,unstyled:a,rightSection:j||(u&&!N&&!C&&se?ue:null)})}),k.jsx(Ho.Dropdown,{onMouseDown:Ue=>Ue.preventDefault(),className:fz.dropdown,children:k.jsx(hP,{__staticSelector:"ColorInput",value:V,onChange:de,onChangeEnd:p,format:S,swatches:R,swatchesPerRow:z,withPicker:D,size:M.size,focusable:!1,unstyled:a,styles:H,classNames:G,onColorSwatchClick:()=>h&&F(!1),attributes:A.attributes})})]})})});Nv.classes=xu.classes;Nv.displayName="@mantine/core/ColorInput";var gY={root:"m_7485cace"};const ope=(t,{size:e,fluid:n})=>({root:{"--container-size":n?void 0:oi(e,"container-size")}}),dP=tn((t,e)=>{const n=Pt("Container",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,fluid:c,mod:u,attributes:f,strategy:h,...d}=n,g=Tn({name:"Container",classes:gY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:f,vars:l,varsResolver:ope});return k.jsx(ut,{ref:e,mod:[{fluid:c,strategy:h||"block"},u],...g("root"),...d})});dP.classes=gY;dP.displayName="@mantine/core/Container";const lpe={timeout:1e3};function bY(t){const{children:e,timeout:n,value:i,...r}=Pt("CopyButton",lpe,t),a=Eoe({timeout:n}),s=()=>a.copy(i);return k.jsx(k.Fragment,{children:e({copy:s,copied:a.copied,...r})})}bY.displayName="@mantine/core/CopyButton";var vY={root:"m_3eebeb36",label:"m_9e365f20"};const cpe={orientation:"horizontal"},upe=(t,{color:e,variant:n,size:i})=>({root:{"--divider-color":e?ia(e,t):void 0,"--divider-border-style":n,"--divider-size":oi(i,"divider-size")}}),rg=tn((t,e)=>{const n=Pt("Divider",cpe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,orientation:u,label:f,labelPosition:h,mod:d,attributes:g,...b}=n,y=Tn({name:"Divider",classes:vY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:upe});return k.jsx(ut,{ref:e,mod:[{orientation:u,"with-label":!!f},d],...y("root"),...b,role:"separator",children:f&&k.jsx(ut,{component:"span",mod:{position:h},...y("label"),children:f})})});rg.classes=vY;rg.displayName="@mantine/core/Divider";var yY={root:"m_9e117634"};const fpe=(t,{radius:e,fit:n})=>({root:{"--image-radius":e===void 0?void 0:aa(e),"--image-object-fit":n}}),D_=kl((t,e)=>{const n=Pt("Image",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,onError:c,src:u,radius:f,fit:h,fallbackSrc:d,mod:g,attributes:b,...y}=n,[p,x]=I.useState(!u);I.useEffect(()=>x(!u),[u]);const _=Tn({name:"Image",classes:yY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:l,varsResolver:fpe});return p&&d?k.jsx(ut,{component:"img",ref:e,src:d,..._("root"),onError:c,mod:["fallback",g],...y}):k.jsx(ut,{component:"img",ref:e,..._("root"),src:u,onError:w=>{c?.(w),x(!0)},mod:g,...y})});D_.classes=yY;D_.displayName="@mantine/core/Image";var hpe=I.useLayoutEffect,dpe=function(e){var n=Ee.useRef(e);return hpe(function(){n.current=e}),n},dz=function(e,n){if(typeof e=="function"){e(n);return}e.current=n},ppe=function(e,n){var i=Ee.useRef();return Ee.useCallback(function(r){e.current=r,i.current&&dz(i.current,null),i.current=n,n&&dz(n,r)},[n])},pz={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},mpe=function(e){Object.keys(pz).forEach(function(n){e.style.setProperty(n,pz[n],"important")})},mz=mpe,po=null,gz=function(e,n){var i=e.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?i+n.borderSize:i-n.paddingSize};function gpe(t,e,n,i){n===void 0&&(n=1),i===void 0&&(i=1/0),po||(po=document.createElement("textarea"),po.setAttribute("tabindex","-1"),po.setAttribute("aria-hidden","true"),mz(po)),po.parentNode===null&&document.body.appendChild(po);var r=t.paddingSize,a=t.borderSize,s=t.sizingStyle,o=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;po.style[d]=s[d]}),mz(po),po.value=e;var l=gz(po,t);po.value=e,l=gz(po,t),po.value="x";var c=po.scrollHeight-r,u=c*n;o==="border-box"&&(u=u+r+a),l=Math.max(u,l);var f=c*i;return o==="border-box"&&(f=f+r+a),l=Math.min(f,l),[l,c]}var bz=function(){},bpe=function(e,n){return e.reduce(function(i,r){return i[r]=n[r],i},{})},vpe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],ype=!!document.documentElement.currentStyle,xpe=function(e){var n=window.getComputedStyle(e);if(n===null)return null;var i=bpe(vpe,n),r=i.boxSizing;if(r==="")return null;ype&&r==="border-box"&&(i.width=parseFloat(i.width)+parseFloat(i.borderRightWidth)+parseFloat(i.borderLeftWidth)+parseFloat(i.paddingRight)+parseFloat(i.paddingLeft)+"px");var a=parseFloat(i.paddingBottom)+parseFloat(i.paddingTop),s=parseFloat(i.borderBottomWidth)+parseFloat(i.borderTopWidth);return{sizingStyle:i,paddingSize:a,borderSize:s}},_pe=xpe;function pP(t,e,n){var i=dpe(n);I.useLayoutEffect(function(){var r=function(s){return i.current(s)};if(t)return t.addEventListener(e,r),function(){return t.removeEventListener(e,r)}},[])}var Spe=function(e,n){pP(document.body,"reset",function(i){e.current.form===i.target&&n(i)})},wpe=function(e){pP(window,"resize",e)},Epe=function(e){pP(document.fonts,"loadingdone",e)},Mpe=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Tpe=function(e,n){var i=e.cacheMeasurements,r=e.maxRows,a=e.minRows,s=e.onChange,o=s===void 0?bz:s,l=e.onHeightChange,c=l===void 0?bz:l,u=hL(e,Mpe),f=u.value!==void 0,h=I.useRef(null),d=ppe(h,n),g=I.useRef(0),b=I.useRef(),y=function(){var _=h.current,w=i&&b.current?b.current:_pe(_);if(w){b.current=w;var M=gpe(w,_.value||_.placeholder||"x",a,r),S=M[0],A=M[1];g.current!==S&&(g.current=S,_.style.setProperty("height",S+"px","important"),c(S,{rowHeight:A}))}},p=function(_){f||y(),o(_)};return I.useLayoutEffect(y),Spe(h,function(){if(!f){var x=h.current.value;requestAnimationFrame(function(){var _=h.current;_&&x!==_.value&&y()})}}),wpe(y),Epe(y),I.createElement("textarea",Is({},u,{onChange:p,ref:d}))},Ape=I.forwardRef(Tpe);const Cpe={size:"sm"},yA=tn((t,e)=>{const{autosize:n,maxRows:i,minRows:r,__staticSelector:a,resize:s,...o}=Pt("Textarea",Cpe,t),l=n&&nce()!=="test",c=l?{maxRows:i,minRows:r}:{};return k.jsx(xu,{component:l?Ape:"textarea",ref:e,...o,__staticSelector:a||"Textarea",multiline:!0,"data-no-overflow":n&&i===void 0||void 0,__vars:{"--input-resize":s},...c})});yA.classes=xu.classes;yA.displayName="@mantine/core/Textarea";const[Rpe,kpe]=yu("List component was not found in tree");var mP={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const gP=tn((t,e)=>{const n=Pt("ListItem",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,icon:l,children:c,mod:u,...f}=n,h=kpe(),d=l||h.icon,g={classNames:i,styles:s};return k.jsx(ut,{...h.getStyles("item",{...g,className:r,style:a}),component:"li",mod:[{"with-icon":!!d,centered:h.center},u],ref:e,...f,children:k.jsxs("div",{...h.getStyles("itemWrapper",g),children:[d&&k.jsx("span",{...h.getStyles("itemIcon",g),children:d}),k.jsx("span",{...h.getStyles("itemLabel",g),children:c})]})})});gP.classes=mP;gP.displayName="@mantine/core/ListItem";const Dpe={type:"unordered"},Ope=(t,{size:e,spacing:n})=>({root:{"--list-fz":Ds(e),"--list-lh":SX(e),"--list-spacing":Pd(n)}}),q0=tn((t,e)=>{const n=Pt("List",Dpe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,children:c,type:u,withPadding:f,icon:h,spacing:d,center:g,listStyleType:b,mod:y,attributes:p,...x}=n,_=Tn({name:"List",classes:mP,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:p,vars:l,varsResolver:Ope});return k.jsx(Rpe,{value:{center:g,icon:h,getStyles:_},children:k.jsx(ut,{..._("root",{style:{listStyleType:b}}),component:u==="unordered"?"ul":"ol",mod:[{"with-padding":f},y],ref:e,...x,children:c})})});q0.classes=mP;q0.displayName="@mantine/core/List";q0.Item=gP;const[Ipe,Lv]=yu("Modal component was not found in tree");var _h={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const xA=tn((t,e)=>{const n=Pt("ModalBody",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=Lv();return k.jsx(CK,{ref:e,...c.getStyles("body",{classNames:i,style:a,styles:s,className:r}),...l})});xA.classes=_h;xA.displayName="@mantine/core/ModalBody";const _A=tn((t,e)=>{const n=Pt("ModalCloseButton",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=Lv();return k.jsx(RK,{ref:e,...c.getStyles("close",{classNames:i,style:a,styles:s,className:r}),...l})});_A.classes=_h;_A.displayName="@mantine/core/ModalCloseButton";const SA=tn((t,e)=>{const n=Pt("ModalContent",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,children:l,__hidden:c,...u}=n,f=Lv(),h=f.scrollAreaComponent||Xhe;return k.jsx(kK,{...f.getStyles("content",{className:r,style:a,styles:s,classNames:i}),innerProps:f.getStyles("inner",{className:r,style:a,styles:s,classNames:i}),"data-full-screen":f.fullScreen||void 0,"data-modal-content":!0,"data-hidden":c||void 0,ref:e,...u,children:k.jsx(h,{style:{maxHeight:f.fullScreen?"100dvh":`calc(100dvh - (${Et(f.yOffset)} * 2))`},children:l})})});SA.classes=_h;SA.displayName="@mantine/core/ModalContent";const wA=tn((t,e)=>{const n=Pt("ModalHeader",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=Lv();return k.jsx(DK,{ref:e,...c.getStyles("header",{classNames:i,style:a,styles:s,className:r}),...l})});wA.classes=_h;wA.displayName="@mantine/core/ModalHeader";const EA=tn((t,e)=>{const n=Pt("ModalOverlay",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=Lv();return k.jsx(OK,{ref:e,...c.getStyles("overlay",{classNames:i,style:a,styles:s,className:r}),...l})});EA.classes=_h;EA.displayName="@mantine/core/ModalOverlay";const Npe={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ff("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},Lpe=(t,{radius:e,size:n,yOffset:i,xOffset:r})=>({root:{"--modal-radius":e===void 0?void 0:aa(e),"--modal-size":oi(n,"modal-size"),"--modal-y-offset":Et(i),"--modal-x-offset":Et(r)}}),MA=tn((t,e)=>{const n=Pt("ModalRoot",Npe,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,yOffset:c,scrollAreaComponent:u,radius:f,fullScreen:h,centered:d,xOffset:g,__staticSelector:b,attributes:y,...p}=n,x=Tn({name:b,classes:_h,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l,varsResolver:Lpe});return k.jsx(Ipe,{value:{yOffset:c,scrollAreaComponent:u,getStyles:x,fullScreen:h},children:k.jsx(AK,{ref:e,...x("root"),"data-full-screen":h||void 0,"data-centered":d||void 0,"data-offset-scrollbars":u===Ac.Autosize||void 0,unstyled:o,...p})})});MA.classes=_h;MA.displayName="@mantine/core/ModalRoot";const[Ppe,Upe]=E_();function xY({children:t}){const[e,n]=I.useState([]),[i,r]=I.useState(ff("modal"));return k.jsx(Ppe,{value:{stack:e,addModal:(a,s)=>{n(o=>[...new Set([...o,a])]),r(o=>typeof s=="number"&&typeof o=="number"?Math.max(o,s):o)},removeModal:a=>n(s=>s.filter(o=>o!==a)),getZIndex:a=>`calc(${i} + ${e.indexOf(a)} + 1)`,currentId:e[e.length-1],maxZIndex:i},children:t})}xY.displayName="@mantine/core/ModalStack";const TA=tn((t,e)=>{const n=Pt("ModalTitle",null,t),{classNames:i,className:r,style:a,styles:s,vars:o,...l}=n,c=Lv();return k.jsx(IK,{ref:e,...c.getStyles("title",{classNames:i,style:a,styles:s,className:r}),...l})});TA.classes=_h;TA.displayName="@mantine/core/ModalTitle";const Fpe={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ff("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Co=tn((t,e)=>{const{title:n,withOverlay:i,overlayProps:r,withCloseButton:a,closeButtonProps:s,children:o,radius:l,opened:c,stackId:u,zIndex:f,...h}=Pt("Modal",Fpe,t),d=Upe(),g=!!n||a,b=d&&u?{closeOnEscape:d.currentId===u,trapFocus:d.currentId===u,zIndex:d.getZIndex(u)}:{},y=i===!1?!1:u&&d?d.currentId===u:c;return I.useEffect(()=>{d&&u&&(c?d.addModal(u,f||ff("modal")):d.removeModal(u))},[c,u,f]),k.jsxs(MA,{ref:e,radius:l,opened:c,zIndex:d&&u?d.getZIndex(u):f,...h,...b,children:[i&&k.jsx(EA,{visible:y,transitionProps:d&&u?{duration:0}:void 0,...r}),k.jsxs(SA,{radius:l,__hidden:d&&u&&c?u!==d.currentId:!1,children:[g&&k.jsxs(wA,{children:[n&&k.jsx(TA,{children:n}),a&&k.jsx(_A,{...s})]}),k.jsx(xA,{children:o})]})]})});Co.classes=_h;Co.displayName="@mantine/core/Modal";Co.Root=MA;Co.Overlay=EA;Co.Content=SA;Co.Body=xA;Co.Header=wA;Co.Title=TA;Co.CloseButton=_A;Co.Stack=xY;var _Y={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const Bpe={withCloseButton:!0},zpe=(t,{radius:e,color:n})=>({root:{"--notification-radius":e===void 0?void 0:aa(e),"--notification-color":n?ia(n,t):void 0}}),bP=tn((t,e)=>{const n=Pt("Notification",Bpe,t),{className:i,color:r,radius:a,loading:s,withCloseButton:o,withBorder:l,title:c,icon:u,children:f,onClose:h,closeButtonProps:d,classNames:g,style:b,styles:y,unstyled:p,variant:x,vars:_,mod:w,loaderProps:M,role:S,attributes:A,...C}=n,D=Tn({name:"Notification",classes:_Y,props:n,className:i,style:b,classNames:g,styles:y,unstyled:p,attributes:A,vars:_,varsResolver:zpe});return k.jsxs(ut,{...D("root"),mod:[{"data-with-icon":!!u||s,"data-with-border":l},w],ref:e,variant:x,role:S||"alert",...C,children:[u&&!s&&k.jsx("div",{...D("icon"),children:u}),s&&k.jsx(Wd,{size:28,color:r,...M,...D("loader")}),k.jsxs("div",{...D("body"),children:[c&&k.jsx("div",{...D("title"),children:c}),k.jsx(ut,{...D("description"),mod:{"data-with-title":!!c},children:f})]}),o&&k.jsx(C_,{iconSize:16,color:"gray",...d,unstyled:p,onClick:h,...D("closeButton")})]})});bP.classes=_Y;bP.displayName="@mantine/core/Notification";function SY(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}var P1;(function(t){t.event="event",t.props="prop"})(P1||(P1={}));function dd(){}function jpe(t){var e,n=void 0;return function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e&&i.length===e.length&&i.every(function(a,s){return a===e[s]})||(e=i,n=t.apply(void 0,i)),n}}function U1(t){return!!(t||"").match(/\d/)}function g0(t){return t==null}function Hpe(t){return typeof t=="number"&&isNaN(t)}function wY(t){return g0(t)||Hpe(t)||typeof t=="number"&&!isFinite(t)}function EY(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Vpe(t){switch(t){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Gpe(t,e,n){var i=Vpe(n),r=t.search(/[1-9]/);return r=r===-1?t.length:r,t.substring(0,r)+t.substring(r,t.length).replace(i,"$1"+e)}function Wpe(t){var e=I.useRef(t);e.current=t;var n=I.useRef(function(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];return e.current.apply(e,i)});return n.current}function vP(t,e){e===void 0&&(e=!0);var n=t[0]==="-",i=n&&e;t=t.replace("-","");var r=t.split("."),a=r[0],s=r[1]||"";return{beforeDecimal:a,afterDecimal:s,hasNegation:n,addNegation:i}}function qpe(t){if(!t)return t;var e=t[0]==="-";e&&(t=t.substring(1,t.length));var n=t.split("."),i=n[0].replace(/^0+/,"")||"0",r=n[1]||"";return(e?"-":"")+i+(r?"."+r:"")}function MY(t,e,n){for(var i="",r=n?"0":"",a=0;a<=e-1;a++)i+=t[a]||r;return i}function vz(t,e){return Array(e+1).join(t)}function TY(t){var e=t+"",n=e[0]==="-"?"-":"";n&&(e=e.substring(1));var i=e.split(/[eE]/g),r=i[0],a=i[1];if(a=Number(a),!a)return n+r;r=r.replace(".","");var s=1+a,o=r.length;return s<0?r="0."+vz("0",Math.abs(s))+r:s>=o?r=r+vz("0",s-o):r=(r.substring(0,s)||"0")+"."+r.substring(s),n+r}function yz(t,e,n){if(["","-"].indexOf(t)!==-1)return t;var i=(t.indexOf(".")!==-1||n)&&e,r=vP(t),a=r.beforeDecimal,s=r.afterDecimal,o=r.hasNegation,l=parseFloat("0."+(s||"0")),c=s.length<=e?"0."+s:l.toFixed(e),u=c.split("."),f=a;a&&Number(u[0])&&(f=a.split("").reverse().reduce(function(b,y,p){return b.length>p?(Number(b[0])+Number(y)).toString()+b.substring(1,b.length):y+b},u[0]));var h=MY(u[1]||"",e,n),d=o?"-":"",g=i?".":"";return""+d+f+g+h}function $p(t,e){if(t.value=t.value,t!==null){if(t.createTextRange){var n=t.createTextRange();return n.move("character",e),n.select(),!0}return t.selectionStart||t.selectionStart===0?(t.focus(),t.setSelectionRange(e,e),!0):(t.focus(),!1)}}var AY=jpe(function(t,e){for(var n=0,i=0,r=t.length,a=e.length;t[n]===e[n]&&n<r;)n++;for(;t[r-1-i]===e[a-1-i]&&a-i>n&&r-i>n;)i++;return{from:{start:n,end:r-i},to:{start:n,end:a-i}}}),Xpe=function(t,e){var n=Math.min(t.selectionStart,e);return{from:{start:n,end:t.selectionEnd},to:{start:n,end:e}}};function Kpe(t,e,n){return Math.min(Math.max(t,e),n)}function J3(t){return Math.max(t.selectionStart,t.selectionEnd)}function Ype(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Jpe(t){return{from:{start:0,end:0},to:{start:0,end:t.length},lastValue:""}}function $pe(t){var e=t.currentValue,n=t.formattedValue,i=t.currentValueIndex,r=t.formattedValueIndex;return e[i]===n[r]}function Zpe(t,e,n,i,r,a,s){s===void 0&&(s=$pe);var o=r.findIndex(function(w){return w}),l=t.slice(0,o);!e&&!n.startsWith(l)&&(e=l,n=l+n,i=i+l.length);for(var c=n.length,u=t.length,f={},h=new Array(c),d=0;d<c;d++){h[d]=-1;for(var g=0,b=u;g<b;g++){var y=s({currentValue:n,lastValue:e,formattedValue:t,currentValueIndex:d,formattedValueIndex:g});if(y&&f[g]!==!0){h[d]=g,f[g]=!0;break}}}for(var p=i;p<c&&(h[p]===-1||!a(n[p]));)p++;var x=p===c||h[p]===-1?u:h[p];for(p=i-1;p>0&&h[p]===-1;)p--;var _=p===-1||h[p]===-1?0:h[p]+1;return _>x?x:i-_<x-i?_:x}function xz(t,e,n,i){var r=t.length;if(e=Kpe(e,0,r),i==="left"){for(;e>=0&&!n[e];)e--;e===-1&&(e=n.indexOf(!0))}else{for(;e<=r&&!n[e];)e++;e>r&&(e=n.lastIndexOf(!0))}return e===-1&&(e=r),e}function Qpe(t){for(var e=Array.from({length:t.length+1}).map(function(){return!0}),n=0,i=e.length;n<i;n++)e[n]=!!(U1(t[n])||U1(t[n-1]));return e}function CY(t,e,n,i,r,a){a===void 0&&(a=dd);var s=Wpe(function(g,b){var y,p;return wY(g)?(p="",y=""):typeof g=="number"||b?(p=typeof g=="number"?TY(g):g,y=i(p)):(p=r(g,void 0),y=i(p)),{formattedValue:y,numAsString:p}}),o=I.useState(function(){return s(g0(t)?e:t,n)}),l=o[0],c=o[1],u=function(g,b){g.formattedValue!==l.formattedValue&&c({formattedValue:g.formattedValue,numAsString:g.value}),a(g,b)},f=t,h=n;g0(t)&&(f=l.numAsString,h=!0);var d=s(f,h);return I.useMemo(function(){c(d)},[d.formattedValue]),[l,u]}function eme(t){return t.replace(/[^0-9]/g,"")}function tme(t){return t}function nme(t){var e=t.type;e===void 0&&(e="text");var n=t.displayType;n===void 0&&(n="input");var i=t.customInput,r=t.renderText,a=t.getInputRef,s=t.format;s===void 0&&(s=tme);var o=t.removeFormatting;o===void 0&&(o=eme);var l=t.defaultValue,c=t.valueIsNumericString,u=t.onValueChange,f=t.isAllowed,h=t.onChange;h===void 0&&(h=dd);var d=t.onKeyDown;d===void 0&&(d=dd);var g=t.onMouseUp;g===void 0&&(g=dd);var b=t.onFocus;b===void 0&&(b=dd);var y=t.onBlur;y===void 0&&(y=dd);var p=t.value,x=t.getCaretBoundary;x===void 0&&(x=Qpe);var _=t.isValidInputCharacter;_===void 0&&(_=U1);var w=t.isCharacterSame,M=SY(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),S=CY(p,l,!!c,s,o,u),A=S[0],C=A.formattedValue,D=A.numAsString,R=S[1],N=I.useRef(),U=I.useRef({formattedValue:C,numAsString:D}),j=function(we,Te){U.current={formattedValue:we.formattedValue,numAsString:we.value},R(we,Te)},z=I.useState(!1),q=z[0],B=z[1],G=I.useRef(null),H=I.useRef({setCaretTimeout:null,focusTimeout:null});I.useEffect(function(){return B(!0),function(){clearTimeout(H.current.setCaretTimeout),clearTimeout(H.current.focusTimeout)}},[]);var W=s,F=function(we,Te){var Ae=parseFloat(Te);return{formattedValue:we,value:Te,floatValue:isNaN(Ae)?void 0:Ae}},Y=function(we,Te,Ae){we.selectionStart===0&&we.selectionEnd===we.value.length||($p(we,Te),H.current.setCaretTimeout=setTimeout(function(){we.value===Ae&&we.selectionStart!==Te&&$p(we,Te)},0))},Z=function(we,Te,Ae){return xz(we,Te,x(we),Ae)},V=function(we,Te,Ae){var Pe=x(Te),He=Zpe(Te,C,we,Ae,Pe,_,w);return He=xz(Te,He,Pe),He},de=function(we){var Te=we.formattedValue;Te===void 0&&(Te="");var Ae=we.input,Pe=we.source,He=we.event,$e=we.numAsString,ie;if(Ae){var K=we.inputValue||Ae.value,ce=J3(Ae);Ae.value=Te,ie=V(K,Te,ce),ie!==void 0&&Y(Ae,ie,Te)}Te!==C&&j(F(Te,$e),{event:He,source:Pe})};I.useEffect(function(){var we=U.current,Te=we.formattedValue,Ae=we.numAsString;(C!==Te||D!==Ae)&&j(F(C,D),{event:void 0,source:P1.props})},[C,D]);var se=G.current?J3(G.current):void 0,oe=typeof window<"u"?I.useLayoutEffect:I.useEffect;oe(function(){var we=G.current;if(C!==U.current.formattedValue&&we){var Te=V(U.current.formattedValue,C,se);we.value=C,Y(we,Te,C)}},[C]);var ue=function(we,Te,Ae){var Pe=Te.target,He=N.current?Xpe(N.current,Pe.selectionEnd):AY(C,we),$e=Object.assign(Object.assign({},He),{lastValue:C}),ie=o(we,$e),K=W(ie);if(ie=o(K,void 0),f&&!f(F(K,ie))){var ce=Te.target,fe=J3(ce),me=V(we,C,fe);return ce.value=C,Y(ce,me,C),!1}return de({formattedValue:K,numAsString:ie,inputValue:we,event:Te,source:Ae,input:Te.target}),!0},_e=function(we,Te){Te===void 0&&(Te=0);var Ae=we.selectionStart,Pe=we.selectionEnd;N.current={selectionStart:Ae,selectionEnd:Pe+Te}},ke=function(we){var Te=we.target,Ae=Te.value,Pe=ue(Ae,we,P1.event);Pe&&h(we),N.current=void 0},Ne=function(we){var Te=we.target,Ae=we.key,Pe=Te.selectionStart,He=Te.selectionEnd,$e=Te.value;$e===void 0&&($e="");var ie;Ae==="ArrowLeft"||Ae==="Backspace"?ie=Math.max(Pe-1,0):Ae==="ArrowRight"?ie=Math.min(Pe+1,$e.length):Ae==="Delete"&&(ie=Pe);var K=0;Ae==="Delete"&&Pe===He&&(K=1);var ce=Ae==="ArrowLeft"||Ae==="ArrowRight";if(ie===void 0||Pe!==He&&!ce){d(we),_e(Te,K);return}var fe=ie;if(ce){var me=Ae==="ArrowLeft"?"left":"right";fe=Z($e,ie,me),fe!==ie&&we.preventDefault()}else Ae==="Delete"&&!_($e[ie])?fe=Z($e,ie,"right"):Ae==="Backspace"&&!_($e[ie])&&(fe=Z($e,ie,"left"));fe!==ie&&Y(Te,fe,$e),d(we),_e(Te,K)},Ue=function(we){var Te=we.target,Ae=function(){var Pe=Te.selectionStart,He=Te.selectionEnd,$e=Te.value;if($e===void 0&&($e=""),Pe===He){var ie=Z($e,Pe);ie!==Pe&&Y(Te,ie,$e)}};Ae(),requestAnimationFrame(function(){Ae()}),g(we),_e(Te)},ze=function(we){we.persist&&we.persist();var Te=we.target,Ae=we.currentTarget;G.current=Te,H.current.focusTimeout=setTimeout(function(){var Pe=Te.selectionStart,He=Te.selectionEnd,$e=Te.value;$e===void 0&&($e="");var ie=Z($e,Pe);ie!==Pe&&!(Pe===0&&He===$e.length)&&Y(Te,ie,$e),b(Object.assign(Object.assign({},we),{currentTarget:Ae}))},0)},pe=function(we){G.current=null,clearTimeout(H.current.focusTimeout),clearTimeout(H.current.setCaretTimeout),y(we)},Fe=q&&Ype()?"numeric":void 0,Ie=Object.assign({inputMode:Fe},M,{type:e,value:C,onChange:ke,onKeyDown:Ne,onMouseUp:Ue,onFocus:ze,onBlur:pe});if(n==="text")return r?Ee.createElement(Ee.Fragment,null,r(C,M)||null):Ee.createElement("span",Object.assign({},M,{ref:a}),C);if(i){var qe=i;return Ee.createElement(qe,Object.assign({},Ie,{ref:a}))}return Ee.createElement("input",Object.assign({},Ie,{ref:a}))}function _z(t,e){var n=e.decimalScale,i=e.fixedDecimalScale,r=e.prefix;r===void 0&&(r="");var a=e.suffix;a===void 0&&(a="");var s=e.allowNegative,o=e.thousandsGroupStyle;if(o===void 0&&(o="thousand"),t===""||t==="-")return t;var l=AA(e),c=l.thousandSeparator,u=l.decimalSeparator,f=n!==0&&t.indexOf(".")!==-1||n&&i,h=vP(t,s),d=h.beforeDecimal,g=h.afterDecimal,b=h.addNegation;return n!==void 0&&(g=MY(g,n,!!i)),c&&(d=Gpe(d,c,o)),r&&(d=r+d),a&&(g=g+a),b&&(d="-"+d),t=d+(f&&u||"")+g,t}function AA(t){var e=t.decimalSeparator;e===void 0&&(e=".");var n=t.thousandSeparator,i=t.allowedDecimalSeparators;return n===!0&&(n=","),i||(i=[e,"."]),{decimalSeparator:e,thousandSeparator:n,allowedDecimalSeparators:i}}function ime(t,e){t===void 0&&(t="");var n=new RegExp("(-)"),i=new RegExp("(-)(.)*(-)"),r=n.test(t),a=i.test(t);return t=t.replace(/-/g,""),r&&!a&&e&&(t="-"+t),t}function rme(t,e){return new RegExp("(^-)|[0-9]|"+EY(t),"g")}function ame(t,e,n){return t===""?!0:!e?.match(/\d/)&&!n?.match(/\d/)&&typeof t=="string"&&!isNaN(Number(t))}function sme(t,e,n){var i;e===void 0&&(e=Jpe(t));var r=n.allowNegative,a=n.prefix;a===void 0&&(a="");var s=n.suffix;s===void 0&&(s="");var o=n.decimalScale,l=e.from,c=e.to,u=c.start,f=c.end,h=AA(n),d=h.allowedDecimalSeparators,g=h.decimalSeparator,b=t[f]===g;if(U1(t)&&(t===a||t===s)&&e.lastValue==="")return t;if(f-u===1&&d.indexOf(t[u])!==-1){var y=o===0?"":g;t=t.substring(0,u)+y+t.substring(u+1,t.length)}var p=function(G,H,W){var F=!1,Y=!1;a.startsWith("-")?F=!1:G.startsWith("--")?(F=!1,Y=!0):s.startsWith("-")&&G.length===s.length?F=!1:G[0]==="-"&&(F=!0);var Z=F?1:0;return Y&&(Z=2),Z&&(G=G.substring(Z),H-=Z,W-=Z),{value:G,start:H,end:W,hasNegation:F}},x=p(t,u,f),_=x.hasNegation;i=x,t=i.value,u=i.start,f=i.end;var w=p(e.lastValue,l.start,l.end),M=w.start,S=w.end,A=w.value,C=t.substring(u,f);t.length&&A.length&&(M>A.length-s.length||S<a.length)&&!(C&&s.startsWith(C))&&(t=A);var D=0;t.startsWith(a)?D+=a.length:u<a.length&&(D=u),t=t.substring(D),f-=D;var R=t.length,N=t.length-s.length;t.endsWith(s)?R=N:(f>N||f>t.length-s.length)&&(R=f),t=t.substring(0,R),t=ime(_?"-"+t:t,r),t=(t.match(rme(g))||[]).join("");var U=t.indexOf(g);t=t.replace(new RegExp(EY(g),"g"),function(G,H){return H===U?".":""});var j=vP(t,r),z=j.beforeDecimal,q=j.afterDecimal,B=j.addNegation;return c.end-c.start<l.end-l.start&&z===""&&b&&!parseFloat(q)&&(t=B?"-":""),t}function ome(t,e){var n=e.prefix;n===void 0&&(n="");var i=e.suffix;i===void 0&&(i="");var r=Array.from({length:t.length+1}).map(function(){return!0}),a=t[0]==="-";r.fill(!1,0,n.length+(a?1:0));var s=t.length;return r.fill(!1,s-i.length+1,s+1),r}function lme(t){var e=AA(t),n=e.thousandSeparator,i=e.decimalSeparator,r=t.prefix;r===void 0&&(r="");var a=t.allowNegative;if(a===void 0&&(a=!0),n===i)throw new Error(`
        Decimal separator can't be same as thousand separator.
        thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
        decimalSeparator: `+i+` (default value for decimalSeparator is .)
     `);return r.startsWith("-")&&a&&(console.error(`
      Prefix can't start with '-' when allowNegative is true.
      prefix: `+r+`
      allowNegative: `+a+`
    `),a=!1),Object.assign(Object.assign({},t),{allowNegative:a})}function cme(t){t=lme(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var e=t.suffix,n=t.allowNegative,i=t.allowLeadingZeros,r=t.onKeyDown;r===void 0&&(r=dd);var a=t.onBlur;a===void 0&&(a=dd);var s=t.thousandSeparator,o=t.decimalScale,l=t.fixedDecimalScale,c=t.prefix;c===void 0&&(c="");var u=t.defaultValue,f=t.value,h=t.valueIsNumericString,d=t.onValueChange,g=SY(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),b=AA(t),y=b.decimalSeparator,p=b.allowedDecimalSeparators,x=function(B){return _z(B,t)},_=function(B,G){return sme(B,G,t)},w=g0(f)?u:f,M=h??ame(w,c,e);g0(f)?g0(u)||(M=M||typeof u=="number"):M=M||typeof f=="number";var S=function(B){return wY(B)?B:(typeof B=="number"&&(B=TY(B)),M&&typeof o=="number"?yz(B,o,!!l):B)},A=CY(S(f),S(u),!!M,x,_,d),C=A[0],D=C.numAsString,R=C.formattedValue,N=A[1],U=function(B){var G=B.target,H=B.key,W=G.selectionStart,F=G.selectionEnd,Y=G.value;if(Y===void 0&&(Y=""),(H==="Backspace"||H==="Delete")&&F<c.length){B.preventDefault();return}if(W!==F){r(B);return}H==="Backspace"&&Y[0]==="-"&&W===c.length+1&&n&&$p(G,1),o&&l&&(H==="Backspace"&&Y[W-1]===y?($p(G,W-1),B.preventDefault()):H==="Delete"&&Y[W]===y&&B.preventDefault()),p?.includes(H)&&Y[W]===y&&$p(G,W+1);var Z=s===!0?",":s;H==="Backspace"&&Y[W-1]===Z&&$p(G,W-1),H==="Delete"&&Y[W]===Z&&$p(G,W+1),r(B)},j=function(B){var G=D;if(G.match(/\d/g)||(G=""),i||(G=qpe(G)),l&&o&&(G=yz(G,o,l)),G!==D){var H=_z(G,t);N({formattedValue:H,value:G,floatValue:parseFloat(G)},{event:B,source:P1.event})}a(B)},z=function(B){return B===y?!0:U1(B)},q=function(B){var G=B.currentValue,H=B.lastValue,W=B.formattedValue,F=B.currentValueIndex,Y=B.formattedValueIndex,Z=G[F],V=W[Y],de=AY(H,G),se=de.to,oe=function(ue){return _(ue).indexOf(".")+c.length};return f===0&&l&&o&&G[se.start]===y&&oe(G)<F&&oe(W)>Y?!1:F>=se.start&&F<se.end&&p&&p.includes(Z)&&V===y?!0:Z===V};return Object.assign(Object.assign({},g),{value:R,valueIsNumericString:!1,isValidInputCharacter:z,isCharacterSame:q,onValueChange:N,format:x,removeFormatting:_,getCaretBoundary:function(B){return ome(B,t)},onKeyDown:U,onBlur:j})}function ume(t){var e=cme(t);return Ee.createElement(nme,Object.assign({},e))}function Sz({direction:t,style:e,...n}){return k.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:t==="up"?"rotate(180deg)":void 0,...e},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:k.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var zO={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const fme=/^(0\.0*|-0(\.0*)?)$/,hme=/^-?0\d+(\.\d+)?\.?$/,dme=/\.\d*0$/;function jO(t){return typeof t=="string"&&t!==""&&!Number.isNaN(Number(t))}function $3(t){return typeof t=="number"?t<Number.MAX_SAFE_INTEGER:t===""||jO(t)&&Number(t)<Number.MAX_SAFE_INTEGER}function pme(t){return t.toString().replace(".","").length}function mme(t,e){return(typeof t=="number"?t<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(t)))&&!Number.isNaN(t)&&pme(e)<14&&e!==""}function wz(t,e,n){if(t===void 0)return!0;const i=e===void 0||t>=e,r=n===void 0||t<=n;return i&&r}const gme={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},bme=(t,{size:e})=>({controls:{"--ni-chevron-size":oi(e,"ni-chevron-size")}});function vme(t,e,n){const i=t.toString().replace(/^0+/,""),r=parseFloat(i);return Number.isNaN(r)?i:r>Number.MAX_SAFE_INTEGER?e!==void 0?e:i:dc(r,n,e)}const ag=tn((t,e)=>{const n=Pt("NumberInput",gme,t),{className:i,classNames:r,styles:a,unstyled:s,vars:o,onChange:l,onValueChange:c,value:u,defaultValue:f,max:h,min:d,step:g,hideControls:b,rightSection:y,isAllowed:p,clampBehavior:x,onBlur:_,allowDecimal:w,decimalScale:M,onKeyDown:S,onKeyDownCapture:A,handlersRef:C,startValue:D,disabled:R,rightSectionPointerEvents:N,allowNegative:U,readOnly:j,size:z,rightSectionWidth:q,stepHoldInterval:B,stepHoldDelay:G,allowLeadingZeros:H,withKeyboardEvents:W,trimLeadingZeroesOnBlur:F,attributes:Y,...Z}=n,V=Tn({name:"NumberInput",classes:zO,props:n,classNames:r,styles:a,unstyled:s,attributes:Y,vars:o,varsResolver:bme}),{resolvedClassNames:de,resolvedStyles:se}=Cv({classNames:r,styles:a,props:n}),[oe,ue]=Al({value:u,defaultValue:f,finalValue:"",onChange:l}),_e=G!==void 0&&B!==void 0,ke=I.useRef(null),Ne=I.useRef(null),Ue=I.useRef(0),ze=(ce,fe)=>{fe.source==="event"&&ue(mme(ce.floatValue,ce.value)&&!fme.test(ce.value)&&!(H&&hme.test(ce.value))&&!dme.test(ce.value)?ce.floatValue:ce.value),c?.(ce,fe)},pe=ce=>{const fe=String(ce).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return fe?Math.max(0,(fe[1]?fe[1].length:0)-(fe[2]?+fe[2]:0)):0},Fe=ce=>{ke.current&&typeof ce<"u"&&ke.current.setSelectionRange(ce,ce)},Ie=I.useRef(s2);Ie.current=()=>{if(!$3(oe))return;let ce;const fe=pe(oe),me=pe(g),$=Math.max(fe,me),Le=10**$;if(!jO(oe)&&(typeof oe!="number"||Number.isNaN(oe)))ce=dc(D,d,h);else if(h!==void 0){const mt=(Math.round(Number(oe)*Le)+Math.round(g*Le))/Le;ce=mt<=h?mt:h}else ce=(Math.round(Number(oe)*Le)+Math.round(g*Le))/Le;const Xe=ce.toFixed($);ue(parseFloat(Xe)),c?.({floatValue:parseFloat(Xe),formattedValue:Xe,value:Xe},{source:"increment"}),setTimeout(()=>Fe(ke.current?.value.length),0)};const qe=I.useRef(s2);qe.current=()=>{if(!$3(oe))return;let ce;const fe=d!==void 0?d:U?Number.MIN_SAFE_INTEGER:0,me=pe(oe),$=pe(g),Le=Math.max(me,$),Xe=10**Le;if(!jO(oe)&&typeof oe!="number"||Number.isNaN(oe))ce=dc(D,fe,h);else{const Ge=(Math.round(Number(oe)*Xe)-Math.round(g*Xe))/Xe;ce=fe!==void 0&&Ge<fe?fe:Ge}const mt=ce.toFixed(Le);ue(parseFloat(mt)),c?.({floatValue:parseFloat(mt),formattedValue:mt,value:mt},{source:"decrement"}),setTimeout(()=>Fe(ke.current?.value.length),0)};const we=ce=>{S?.(ce),!(j||!W)&&(ce.key==="ArrowUp"&&(ce.preventDefault(),Ie.current?.()),ce.key==="ArrowDown"&&(ce.preventDefault(),qe.current?.()))},Te=ce=>{if(A?.(ce),ce.key==="Backspace"){const fe=ke.current;fe&&fe.selectionStart===0&&fe.selectionStart===fe.selectionEnd&&(ce.preventDefault(),window.setTimeout(()=>Fe(0),0))}},Ae=ce=>{let fe=oe;x==="blur"&&typeof fe=="number"&&(fe=dc(fe,d,h)),F&&typeof fe=="string"&&pe(fe)<15&&(fe=vme(fe,h,d)),oe!==fe&&ue(fe),_?.(ce)};i2(C,{increment:Ie.current,decrement:qe.current});const Pe=ce=>{ce?Ie.current?.():qe.current?.(),Ue.current+=1},He=ce=>{if(Pe(ce),_e){const fe=typeof B=="number"?B:B(Ue.current);Ne.current=window.setTimeout(()=>He(ce),fe)}},$e=(ce,fe)=>{ce.preventDefault(),ke.current?.focus(),Pe(fe),_e&&(Ne.current=window.setTimeout(()=>He(fe),G))},ie=()=>{Ne.current&&window.clearTimeout(Ne.current),Ne.current=null,Ue.current=0},K=k.jsxs("div",{...V("controls"),children:[k.jsx(rf,{...V("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof oe=="number"&&h!==void 0&&oe>=h,mod:{direction:"up"},onMouseDown:ce=>ce.preventDefault(),onPointerDown:ce=>{$e(ce,!0)},onPointerUp:ie,onPointerLeave:ie,children:k.jsx(Sz,{direction:"up"})}),k.jsx(rf,{...V("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof oe=="number"&&d!==void 0&&oe<=d,mod:{direction:"down"},onMouseDown:ce=>ce.preventDefault(),onPointerDown:ce=>{$e(ce,!1)},onPointerUp:ie,onPointerLeave:ie,children:k.jsx(Sz,{direction:"down"})})]});return k.jsx(xu,{component:ume,allowNegative:U,className:as(zO.root,i),size:z,...Z,readOnly:j,disabled:R,value:oe,getInputRef:Ps(e,ke),onValueChange:ze,rightSection:b||j||!$3(oe)?y:y||K,classNames:de,styles:se,unstyled:s,__staticSelector:"NumberInput",decimalScale:w?M:0,onKeyDown:we,onKeyDownCapture:Te,rightSectionPointerEvents:N??(R?"none":void 0),rightSectionWidth:q??`var(--ni-right-section-width-${z||"sm"})`,allowLeadingZeros:H,onBlur:Ae,attributes:Y,isAllowed:ce=>x==="strict"?p?p(ce)&&wz(ce.floatValue,d,h):wz(ce.floatValue,d,h):p?p(ce):!0})});ag.classes={...xu.classes,...zO};ag.displayName="@mantine/core/NumberInput";const[yme,RY]=yu("Progress.Root component was not found in tree");var O_={root:"m_db6d6462",section:"m_2242eb65","stripes-animation":"m_81a374bd","stripes-animation-vertical":"m_e0fb7a86",label:"m_91e40b74"};const yP=tn((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,...o}=Pt("ProgressLabel",null,t),l=RY();return k.jsx(ut,{ref:e,...l.getStyles("label",{className:i,style:r,classNames:n,styles:a}),...o})});yP.classes=O_;yP.displayName="@mantine/core/ProgressLabel";const xme=(t,{size:e,radius:n,transitionDuration:i})=>({root:{"--progress-size":oi(e,"progress-size"),"--progress-radius":n===void 0?void 0:aa(n),"--progress-transition-duration":typeof i=="number"?`${i}ms`:void 0}}),CA=tn((t,e)=>{const n=Pt("ProgressRoot",null,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,autoContrast:c,transitionDuration:u,orientation:f,attributes:h,mod:d,...g}=n,b=Tn({name:"Progress",classes:O_,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:h,vars:l,varsResolver:xme});return k.jsx(yme,{value:{getStyles:b,autoContrast:c},children:k.jsx(ut,{ref:e,mod:[{orientation:f},d],...b("root"),...g})})});CA.classes=O_;CA.displayName="@mantine/core/ProgressRoot";const _me={withAria:!0},RA=tn((t,e)=>{const{classNames:n,className:i,style:r,styles:a,vars:s,value:o,withAria:l,color:c,striped:u,animated:f,mod:h,...d}=Pt("ProgressSection",_me,t),g=RY(),b=va(),y=l?{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":o,"aria-valuetext":`${o}%`}:{};return k.jsx(ut,{ref:e,...g.getStyles("section",{className:i,classNames:n,styles:a,style:r}),...d,...y,mod:[{striped:u||f,animated:f},h],__vars:{"--progress-section-size":`${o}%`,"--progress-section-color":ia(c,b),"--progress-label-color":sA(g.autoContrast,b)?M_({color:c,theme:b,autoContrast:g.autoContrast}):void 0}})});RA.classes=O_;RA.displayName="@mantine/core/ProgressSection";const af=tn((t,e)=>{const n=Pt("Progress",null,t),{value:i,classNames:r,styles:a,vars:s,color:o,striped:l,animated:c,"aria-label":u,...f}=n,{resolvedClassNames:h,resolvedStyles:d}=Cv({classNames:r,styles:a,props:n});return k.jsx(CA,{ref:e,classNames:h,styles:d,vars:s,...f,children:k.jsx(RA,{value:i,color:o,striped:l,animated:c,"aria-label":u})})});af.classes=O_;af.displayName="@mantine/core/Progress";af.Section=RA;af.Root=CA;af.Label=yP;const Sme={duration:100,transition:"fade"};function Ez(t,e){return{...Sme,...e,...t}}function wme({offset:t,position:e,defaultOpened:n}){const[i,r]=I.useState(n),a=I.useRef(null),{x:s,y:o,elements:l,refs:c,update:u,placement:f}=DL({placement:e,middleware:[AL({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=f.includes("right")?t:e.includes("left")?t*-1:0,d=f.includes("bottom")?t:e.includes("top")?t*-1:0,g=I.useCallback(({clientX:b,clientY:y})=>{c.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:b,y,left:b+h,top:y+d,right:b,bottom:y}}})},[l.reference]);return I.useEffect(()=>{if(c.floating.current){const b=a.current;b.addEventListener("mousemove",g);const y=nh(c.floating.current);return y.forEach(p=>{p.addEventListener("scroll",u)}),()=>{b.removeEventListener("mousemove",g),y.forEach(p=>{p.removeEventListener("scroll",u)})}}},[l.reference,c.floating.current,u,g,i]),{handleMouseMove:g,x:s,y:o,opened:i,setOpened:r,boundaryRef:a,floating:c.setFloating}}var kA={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const Eme={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:ff("popover")},Mme=(t,{radius:e,color:n})=>({tooltip:{"--tooltip-radius":e===void 0?void 0:aa(e),"--tooltip-bg":n?ia(n,t):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),xP=tn((t,e)=>{const n=Pt("TooltipFloating",Eme,t),{children:i,refProp:r,withinPortal:a,style:s,className:o,classNames:l,styles:c,unstyled:u,radius:f,color:h,label:d,offset:g,position:b,multiline:y,zIndex:p,disabled:x,defaultOpened:_,variant:w,vars:M,portalProps:S,attributes:A,...C}=n,D=va(),R=Tn({name:"TooltipFloating",props:n,classes:kA,className:o,style:s,classNames:l,styles:c,unstyled:u,attributes:A,rootSelector:"tooltip",vars:M,varsResolver:Mme}),{handleMouseMove:N,x:U,y:j,opened:z,boundaryRef:q,floating:B,setOpened:G}=wme({offset:g,position:b,defaultOpened:_});if(!ng(i))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const H=Ps(q,tA(i),e),W=i.props,F=Z=>{W.onMouseEnter?.(Z),N(Z),G(!0)},Y=Z=>{W.onMouseLeave?.(Z),G(!1)};return k.jsxs(k.Fragment,{children:[k.jsx(Ud,{...S,withinPortal:a,children:k.jsx(ut,{...C,...R("tooltip",{style:{...xL(s,D),zIndex:p,display:!x&&z?"block":"none",top:(j&&Math.round(j))??"",left:(U&&Math.round(U))??""}}),variant:w,ref:B,mod:{multiline:y},children:d})}),I.cloneElement(i,{...W,[r]:H,onMouseEnter:F,onMouseLeave:Y})]})});xP.classes=kA;xP.displayName="@mantine/core/TooltipFloating";const kY=I.createContext(!1),Tme=kY.Provider,Ame=()=>I.useContext(kY),Cme={openDelay:0,closeDelay:0};function _P(t){const{openDelay:e,closeDelay:n,children:i}=Pt("TooltipGroup",Cme,t);return k.jsx(Tme,{value:!0,children:k.jsx(Xfe,{delay:{open:e,close:n},children:i})})}_P.displayName="@mantine/core/TooltipGroup";_P.extend=t=>t;function Rme(t){if(t===void 0)return{shift:!0,flip:!0};const e={...t};return t.shift===void 0&&(e.shift=!0),t.flip===void 0&&(e.flip=!0),e}function kme(t){const e=Rme(t.middlewares),n=[KX(t.offset)];return e.shift&&n.push(AL(typeof e.shift=="boolean"?{padding:8}:{padding:8,...e.shift})),e.flip&&n.push(typeof e.flip=="boolean"?f2():f2(e.flip)),n.push(YX({element:t.arrowRef,padding:t.arrowOffset})),e.inline?n.push(typeof e.inline=="boolean"?Yx():Yx(e.inline)):t.inline&&n.push(Yx()),n}function Dme(t){const[e,n]=I.useState(t.defaultOpened),r=typeof t.opened=="boolean"?t.opened:e,a=Ame(),s=uf(),o=I.useCallback(M=>{n(M),M&&p(s)},[s]),{x:l,y:c,context:u,refs:f,placement:h,middlewareData:{arrow:{x:d,y:g}={}}}=DL({strategy:t.strategy,placement:t.position,open:r,onOpenChange:o,middleware:kme(t),whileElementsMounted:NO}),{delay:b,currentId:y,setCurrentId:p}=Kfe(u,{id:s}),{getReferenceProps:x,getFloatingProps:_}=ehe([Wfe(u,{enabled:t.events?.hover,delay:a?b:{open:t.openDelay,close:t.closeDelay},mouseOnly:!t.events?.touch}),Qfe(u,{enabled:t.events?.focus,visibleOnly:!0}),nhe(u,{role:"tooltip"}),$fe(u,{enabled:typeof t.opened>"u"})]);vc(()=>{t.onPositionChange?.(h)},[h]);const w=r&&y&&y!==s;return{x:l,y:c,arrowX:d,arrowY:g,reference:f.setReference,floating:f.setFloating,getFloatingProps:_,getReferenceProps:x,isGroupPhase:w,opened:r,placement:h}}const Mz={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:ff("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},Ome=(t,{radius:e,color:n,variant:i,autoContrast:r})=>{const a=t.variantColorResolver({theme:t,color:n||t.primaryColor,autoContrast:r,variant:i||"filled"});return{tooltip:{"--tooltip-radius":e===void 0?void 0:aa(e),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}},Or=tn((t,e)=>{const n=Pt("Tooltip",Mz,t),{children:i,position:r,refProp:a,label:s,openDelay:o,closeDelay:l,onPositionChange:c,opened:u,defaultOpened:f,withinPortal:h,radius:d,color:g,classNames:b,styles:y,unstyled:p,style:x,className:_,withArrow:w,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,offset:D,transitionProps:R,multiline:N,events:U,zIndex:j,disabled:z,positionDependencies:q,onClick:B,onMouseEnter:G,onMouseLeave:H,inline:W,variant:F,keepMounted:Y,vars:Z,portalProps:V,mod:de,floatingStrategy:se,middlewares:oe,autoContrast:ue,attributes:_e,target:ke,...Ne}=Pt("Tooltip",Mz,n),{dir:Ue}=Rv(),ze=I.useRef(null),pe=Dme({position:pK(Ue,r),closeDelay:l,openDelay:o,onPositionChange:c,opened:u,defaultOpened:f,events:U,arrowRef:ze,arrowOffset:S,offset:typeof D=="number"?D+(w?M/2:0):D,positionDependencies:[...q,ke??i],inline:W,strategy:se,middlewares:oe});I.useEffect(()=>{const Ae=ke instanceof HTMLElement?ke:typeof ke=="string"?document.querySelector(ke):ke?.current||null;Ae&&pe.reference(Ae)},[ke,pe]);const Fe=Tn({name:"Tooltip",props:n,classes:kA,className:_,style:x,classNames:b,styles:y,unstyled:p,attributes:_e,rootSelector:"tooltip",vars:Z,varsResolver:Ome});if(!ke&&!ng(i))return null;if(ke){const Ae=Ez(R,{duration:100,transition:"fade"});return k.jsx(k.Fragment,{children:k.jsx(Ud,{...V,withinPortal:h,children:k.jsx(Sl,{...Ae,keepMounted:Y,mounted:!z&&!!pe.opened,duration:pe.isGroupPhase?10:Ae.duration,children:Pe=>k.jsxs(ut,{...Ne,"data-fixed":se==="fixed"||void 0,variant:F,mod:[{multiline:N},de],...pe.getFloatingProps({ref:pe.floating,className:Fe("tooltip").className,style:{...Fe("tooltip").style,...Pe,zIndex:j,top:pe.y??0,left:pe.x??0}}),children:[s,k.jsx(d2,{ref:ze,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:w,position:pe.placement,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,...Fe("arrow")})]})})})})}const Ie=i,qe=Ie.props,we=Ps(pe.reference,tA(Ie),e),Te=Ez(R,{duration:100,transition:"fade"});return k.jsxs(k.Fragment,{children:[k.jsx(Ud,{...V,withinPortal:h,children:k.jsx(Sl,{...Te,keepMounted:Y,mounted:!z&&!!pe.opened,duration:pe.isGroupPhase?10:Te.duration,children:Ae=>k.jsxs(ut,{...Ne,"data-fixed":se==="fixed"||void 0,variant:F,mod:[{multiline:N},de],...pe.getFloatingProps({ref:pe.floating,className:Fe("tooltip").className,style:{...Fe("tooltip").style,...Ae,zIndex:j,top:pe.y??0,left:pe.x??0}}),children:[s,k.jsx(d2,{ref:ze,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:w,position:pe.placement,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,...Fe("arrow")})]})})}),I.cloneElement(Ie,pe.getReferenceProps({onClick:B,onMouseEnter:G,onMouseLeave:H,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:as(_,qe.className),...qe,[a]:we}))]})});Or.classes=kA;Or.displayName="@mantine/core/Tooltip";Or.Floating=xP;Or.Group=_P;const Ime={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},Pv=tn((t,e)=>{const n=Pt("Select",Ime,t),{classNames:i,styles:r,unstyled:a,vars:s,dropdownOpened:o,defaultDropdownOpened:l,onDropdownClose:c,onDropdownOpen:u,onFocus:f,onBlur:h,onClick:d,onChange:g,data:b,value:y,defaultValue:p,selectFirstOptionOnChange:x,onOptionSubmit:_,comboboxProps:w,readOnly:M,disabled:S,filter:A,limit:C,withScrollArea:D,maxDropdownHeight:R,size:N,searchable:U,rightSection:j,checkIconPosition:z,withCheckIcon:q,nothingFoundMessage:B,name:G,form:H,searchValue:W,defaultSearchValue:F,onSearchChange:Y,allowDeselect:Z,error:V,rightSectionPointerEvents:de,id:se,clearable:oe,clearButtonProps:ue,hiddenInputProps:_e,renderOption:ke,onClear:Ne,autoComplete:Ue,scrollAreaProps:ze,__defaultRightSection:pe,__clearSection:Fe,__clearable:Ie,chevronColor:qe,autoSelectOnBlur:we,attributes:Te,...Ae}=n,Pe=I.useMemo(()=>dde(b),[b]),He=I.useRef({}),$e=I.useMemo(()=>zK(Pe),[Pe]),ie=uf(se),[K,ce,fe]=Al({value:y,defaultValue:p,finalValue:null,onChange:g}),me=typeof K=="string"?K in $e?$e[K]:He.current[K]:void 0,$=joe(me),[Le,Xe,mt]=Al({value:W,defaultValue:F,finalValue:me?me.label:"",onChange:Y}),Ge=qK({opened:o,defaultOpened:l,onDropdownOpen:()=>{u?.(),Ge.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(Ge.resetSelectedOption,0)}}),Je=Rt=>{Xe(Rt),Ge.resetSelectedOption()},{resolvedClassNames:tt,resolvedStyles:xt}=Cv({props:n,styles:r,classNames:i});I.useEffect(()=>{x&&Ge.selectFirstOption()},[x,Le]),I.useEffect(()=>{y===null&&Je(""),typeof y=="string"&&me&&($?.value!==me.value||$?.label!==me.label)&&Je(me.label)},[y,me]),I.useEffect(()=>{!fe&&!mt&&Je(typeof K=="string"?K in $e?$e[K]?.label:He.current[K]?.label||"":"")},[$e,K]),I.useEffect(()=>{K&&K in $e&&(He.current[K]=$e[K])},[$e,K]);const Tt=k.jsx(vr.ClearButton,{...ue,onClear:()=>{ce(null,null),Je(""),Ne?.()}}),bt=oe&&!!K&&!S&&!M;return k.jsxs(k.Fragment,{children:[k.jsxs(vr,{store:Ge,__staticSelector:"Select",classNames:tt,styles:xt,unstyled:a,readOnly:M,size:N,attributes:Te,keepMounted:we,onOptionSubmit:Rt=>{_?.(Rt);const Oe=Z&&$e[Rt].value===K?null:$e[Rt],Ve=Oe?Oe.value:null;Ve!==K&&ce(Ve,Oe),!fe&&Je(typeof Ve=="string"&&Oe?.label||""),Ge.closeDropdown()},...w,children:[k.jsx(vr.Target,{targetType:U?"input":"button",autoComplete:Ue,children:k.jsx(xu,{id:ie,ref:e,__defaultRightSection:k.jsx(vr.Chevron,{size:N,error:V,unstyled:a,color:qe}),__clearSection:Tt,__clearable:bt,rightSection:j,rightSectionPointerEvents:de||"none",...Ae,size:N,__staticSelector:"Select",disabled:S,readOnly:M||!U,value:Le,onChange:Rt=>{Je(Rt.currentTarget.value),Ge.openDropdown(),x&&Ge.selectFirstOption()},onFocus:Rt=>{U&&Ge.openDropdown(),f?.(Rt)},onBlur:Rt=>{we&&Ge.clickSelectedOption(),U&&Ge.closeDropdown();const Oe=typeof K=="string"&&(K in $e?$e[K]:He.current[K]);Je(Oe&&Oe.label||""),h?.(Rt)},onClick:Rt=>{U?Ge.openDropdown():Ge.toggleDropdown(),d?.(Rt)},classNames:tt,styles:xt,unstyled:a,pointer:!U,error:V,attributes:Te})}),k.jsx(Fde,{data:Pe,hidden:M||S,filter:A,search:Le,limit:C,hiddenWhenEmpty:!B,withScrollArea:D,maxDropdownHeight:R,filterOptions:!!U&&me?.label!==Le,value:K,checkIconPosition:z,withCheckIcon:q,nothingFoundMessage:B,unstyled:a,labelId:Ae.label?`${ie}-label`:void 0,"aria-label":Ae.label?void 0:Ae["aria-label"],renderOption:ke,scrollAreaProps:ze})]}),k.jsx(vr.HiddenInput,{value:K,name:G,form:H,disabled:S,..._e})]})});Pv.classes={...xu.classes,...vr.classes};Pv.displayName="@mantine/core/Select";const[Nme,DA]=yu("SliderProvider was not found in tree"),DY=I.forwardRef(({size:t,disabled:e,variant:n,color:i,thumbSize:r,radius:a,...s},o)=>{const{getStyles:l}=DA();return k.jsx(ut,{tabIndex:-1,variant:n,size:t,ref:o,...l("root"),...s})});DY.displayName="@mantine/core/SliderRoot";const OY=I.forwardRef(({max:t,min:e,value:n,position:i,label:r,dragging:a,onMouseDown:s,onKeyDownCapture:o,labelTransitionProps:l,labelAlwaysOn:c,thumbLabel:u,onFocus:f,onBlur:h,showLabelOnHover:d,isHovered:g,children:b=null,disabled:y},p)=>{const{getStyles:x}=DA(),[_,w]=I.useState(!1),M=c||a||_||d&&g;return k.jsxs(ut,{tabIndex:0,role:"slider","aria-label":u,"aria-valuemax":t,"aria-valuemin":e,"aria-valuenow":n,ref:p,__vars:{"--slider-thumb-offset":`${i}%`},...x("thumb",{focusable:!0}),mod:{dragging:a,disabled:y},onFocus:S=>{w(!0),typeof f=="function"&&f(S)},onBlur:S=>{w(!1),typeof h=="function"&&h(S)},onTouchStart:s,onMouseDown:s,onKeyDownCapture:o,onClick:S=>S.stopPropagation(),children:[b,k.jsx(Sl,{mounted:r!=null&&!!M,transition:"fade",duration:0,...l,children:S=>k.jsx("div",{...x("label",{style:S}),children:r})})]})});OY.displayName="@mantine/core/SliderThumb";function IY({value:t,min:e,max:n}){const i=(t-e)/(n-e)*100;return Math.min(Math.max(i,0),100)}function Lme({mark:t,offset:e,value:n,inverted:i=!1}){return i?typeof e=="number"&&t.value<=e||t.value>=n:typeof e=="number"?t.value>=e&&t.value<=n:t.value<=n}function NY({marks:t,min:e,max:n,disabled:i,value:r,offset:a,inverted:s}){const{getStyles:o}=DA();if(!t)return null;const l=t.map((c,u)=>I.createElement(ut,{...o("markWrapper"),__vars:{"--mark-offset":`${IY({value:c.value,min:e,max:n})}%`},key:u},k.jsx(ut,{...o("mark"),mod:{filled:Lme({mark:c,value:r,offset:a,inverted:s}),disabled:i}}),c.label&&k.jsx("div",{...o("markLabel"),children:c.label})));return k.jsx("div",{children:l})}NY.displayName="@mantine/core/SliderMarks";function LY({filled:t,children:e,offset:n,disabled:i,marksOffset:r,inverted:a,containerProps:s,...o}){const{getStyles:l}=DA();return k.jsx(ut,{...l("trackContainer"),mod:{disabled:i},...s,children:k.jsxs(ut,{...l("track"),mod:{inverted:a,disabled:i},children:[k.jsx(ut,{mod:{inverted:a,disabled:i},__vars:{"--slider-bar-width":`calc(${t}% + 2 * var(--slider-size))`,"--slider-bar-offset":`calc(${n}% - var(--slider-size))`},...l("bar")}),e,k.jsx(NY,{...o,offset:r,disabled:i,inverted:a})]})})}LY.displayName="@mantine/core/SliderTrack";function Pme({value:t,containerWidth:e,min:n,max:i,step:r,precision:a}){const o=(e?Math.min(Math.max(t,0),e)/e:t)*(i-n),l=(o!==0?Math.round(o/r)*r:0)+n,c=Math.max(l,n);return a!==void 0?Number(c.toFixed(a)):c}function aw(t,e){return parseFloat(t.toFixed(e))}function Ume(t){if(!t)return 0;const e=t.toString().split(".");return e.length>1?e[1].length:0}function Z3(t,e){const i=[...e].sort((r,a)=>r.value-a.value).find(r=>r.value>t);return i?i.value:t}function Q3(t,e){const i=[...e].sort((r,a)=>a.value-r.value).find(r=>r.value<t);return i?i.value:t}function Tz(t){const e=[...t].sort((n,i)=>n.value-i.value);return e.length>0?e[0].value:0}function Az(t){const e=[...t].sort((n,i)=>n.value-i.value);return e.length>0?e[e.length-1].value:100}var PY={root:"m_dd36362e",label:"m_c9357328",thumb:"m_c9a9a60a",trackContainer:"m_a8645c2",track:"m_c9ade57f",bar:"m_38aeed47",markWrapper:"m_b7b0423a",mark:"m_dd33bc19",markLabel:"m_68c77a5b"};const Fme={radius:"xl",min:0,max:100,step:1,marks:[],label:t=>t,labelTransitionProps:{transition:"fade",duration:0},thumbLabel:"",showLabelOnHover:!0,scale:t=>t,size:"md"},Bme=(t,{size:e,color:n,thumbSize:i,radius:r})=>({root:{"--slider-size":oi(e,"slider-size"),"--slider-color":n?ia(n,t):void 0,"--slider-radius":r===void 0?void 0:aa(r),"--slider-thumb-size":i!==void 0?Et(i):"calc(var(--slider-size) * 2)"}}),OA=tn((t,e)=>{const n=Pt("Slider",Fme,t),{classNames:i,styles:r,value:a,onChange:s,onChangeEnd:o,size:l,min:c,max:u,domain:f,step:h,precision:d,defaultValue:g,name:b,marks:y,label:p,labelTransitionProps:x,labelAlwaysOn:_,thumbLabel:w,showLabelOnHover:M,thumbChildren:S,disabled:A,unstyled:C,scale:D,inverted:R,className:N,style:U,vars:j,hiddenInputProps:z,restrictToMarks:q,thumbProps:B,attributes:G,...H}=n,W=Tn({name:"Slider",props:n,classes:PY,classNames:i,className:N,styles:r,style:U,attributes:G,vars:j,varsResolver:Bme,unstyled:C}),{dir:F}=Rv(),[Y,Z]=I.useState(!1),[V,de]=Al({value:typeof a=="number"?dc(a,c,u):a,defaultValue:typeof g=="number"?dc(g,c,u):g,finalValue:dc(0,c,u),onChange:s}),se=I.useRef(V),oe=I.useRef(o);I.useEffect(()=>{oe.current=o},[o]);const ue=I.useRef(null),_e=I.useRef(null),[ke,Ne]=f||[c,u],Ue=IY({value:V,min:ke,max:Ne}),ze=D(V),pe=typeof p=="function"?p(ze):p,Fe=d??Ume(h),Ie=I.useCallback(({x:He})=>{if(!A){const $e=Pme({value:He,min:ke,max:Ne,step:h,precision:Fe}),ie=dc($e,c,u);de(q&&y?.length?wB(ie,y.map(K=>K.value)):ie),se.current=ie}},[A,c,u,ke,Ne,h,Fe,de,y,q]),qe=I.useCallback(()=>{if(!A&&oe.current){const He=q&&y?.length?wB(se.current,y.map($e=>$e.value)):se.current;oe.current(He)}},[A,y,q]),{ref:we,active:Te}=fL(Ie,{onScrubEnd:qe},F),Ae=I.useCallback(He=>{!A&&oe.current&&oe.current(He)},[A]),Pe=He=>{if(!A)switch(He.key){case"ArrowUp":{if(He.preventDefault(),_e.current?.focus(),q&&y){const ie=Z3(V,y);de(ie),Ae(ie);break}const $e=aw(Math.min(Math.max(V+h,c),u),Fe);de($e),Ae($e);break}case"ArrowRight":{if(He.preventDefault(),_e.current?.focus(),q&&y){const ie=F==="rtl"?Q3(V,y):Z3(V,y);de(ie),Ae(ie);break}const $e=aw(Math.min(Math.max(F==="rtl"?V-h:V+h,c),u),Fe);de($e),Ae($e);break}case"ArrowDown":{if(He.preventDefault(),_e.current?.focus(),q&&y){const ie=Q3(V,y);de(ie),Ae(ie);break}const $e=aw(Math.min(Math.max(V-h,c),u),Fe);de($e),Ae($e);break}case"ArrowLeft":{if(He.preventDefault(),_e.current?.focus(),q&&y){const ie=F==="rtl"?Z3(V,y):Q3(V,y);de(ie),Ae(ie);break}const $e=aw(Math.min(Math.max(F==="rtl"?V+h:V-h,c),u),Fe);de($e),Ae($e);break}case"Home":{if(He.preventDefault(),_e.current?.focus(),q&&y){de(Tz(y)),Ae(Tz(y));break}de(c),Ae(c);break}case"End":{if(He.preventDefault(),_e.current?.focus(),q&&y){de(Az(y)),Ae(Az(y));break}de(u),Ae(u);break}}};return k.jsx(Nme,{value:{getStyles:W},children:k.jsxs(DY,{...H,ref:Ps(e,ue),onKeyDownCapture:Pe,onMouseDownCapture:()=>ue.current?.focus(),size:l,disabled:A,children:[k.jsx(LY,{inverted:R,offset:0,filled:Ue,marks:y,min:ke,max:Ne,value:ze,disabled:A,containerProps:{ref:we,onMouseEnter:M?()=>Z(!0):void 0,onMouseLeave:M?()=>Z(!1):void 0},children:k.jsx(OY,{max:Ne,min:ke,value:ze,position:Ue,dragging:Te,label:pe,ref:_e,labelTransitionProps:x,labelAlwaysOn:_,thumbLabel:w,showLabelOnHover:M,isHovered:Y,disabled:A,...B,children:S})}),k.jsx("input",{type:"hidden",name:b,value:ze,...z})]})})});OA.classes=PY;OA.displayName="@mantine/core/Slider";var UY={root:"m_6d731127"};const zme={gap:"md",align:"stretch",justify:"flex-start"},jme=(t,{gap:e,align:n,justify:i})=>({root:{"--stack-gap":Pd(e),"--stack-align":n,"--stack-justify":i}}),Mm=tn((t,e)=>{const n=Pt("Stack",zme,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,align:c,justify:u,gap:f,variant:h,attributes:d,...g}=n,b=Tn({name:"Stack",props:n,classes:UY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:jme});return k.jsx(ut,{ref:e,...b("root"),variant:h,...g})});Mm.classes=UY;Mm.displayName="@mantine/core/Stack";const FY=I.createContext(null),Hme=FY.Provider,Vme=()=>I.useContext(FY),SP=tn((t,e)=>{const{value:n,defaultValue:i,onChange:r,size:a,wrapperProps:s,children:o,readOnly:l,...c}=Pt("SwitchGroup",null,t),[u,f]=Al({value:n,defaultValue:i,finalValue:[],onChange:r}),h=d=>{const g=d.currentTarget.value;!l&&f(u.includes(g)?u.filter(b=>b!==g):[...u,g])};return k.jsx(Hme,{value:{value:u,onChange:h,size:a},children:k.jsx(da.Wrapper,{size:a,ref:e,...s,...c,labelElement:"div",__staticSelector:"SwitchGroup",children:k.jsx(ZK,{role:"group",children:o})})})});SP.classes=da.Wrapper.classes;SP.displayName="@mantine/core/SwitchGroup";var BY={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const Gme={labelPosition:"right",withThumbIndicator:!0},Wme=(t,{radius:e,color:n,size:i})=>({root:{"--switch-radius":e===void 0?void 0:aa(e),"--switch-height":oi(i,"switch-height"),"--switch-width":oi(i,"switch-width"),"--switch-thumb-size":oi(i,"switch-thumb-size"),"--switch-label-font-size":oi(i,"switch-label-font-size"),"--switch-track-label-padding":oi(i,"switch-track-label-padding"),"--switch-color":n?ia(n,t):void 0}}),pd=tn((t,e)=>{const n=Pt("Switch",Gme,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,color:c,label:u,offLabel:f,onLabel:h,id:d,size:g,radius:b,wrapperProps:y,thumbIcon:p,checked:x,defaultChecked:_,onChange:w,labelPosition:M,description:S,error:A,disabled:C,variant:D,rootRef:R,mod:N,withThumbIndicator:U,attributes:j,...z}=n,q=Vme(),B=g||q?.size,G=Tn({name:"Switch",props:n,classes:BY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:j,vars:l,varsResolver:Wme}),{styleProps:H,rest:W}=T_(z),F=uf(d),Y=q?{checked:q.value.includes(W.value),onChange:q.onChange}:{},[Z,V]=Al({value:Y.checked??x,defaultValue:_,finalValue:!1});return k.jsxs(ZL,{...G("root"),__staticSelector:"Switch",__stylesApiProps:n,id:F,size:B,labelPosition:M,label:u,description:S,error:A,disabled:C,bodyElement:"label",labelElement:"span",classNames:i,styles:s,unstyled:o,"data-checked":Y.checked||x||void 0,variant:D,ref:R,mod:N,...H,...y,children:[k.jsx("input",{...W,disabled:C,checked:Z,"data-checked":Y.checked||x||void 0,onChange:de=>{q?Y.onChange?.(de):w?.(de),V(de.currentTarget.checked)},id:F,ref:e,type:"checkbox",role:"switch",...G("input")}),k.jsxs(ut,{"aria-hidden":"true",component:"span",mod:{error:A,"label-position":M,"without-labels":!h&&!f},...G("track"),children:[k.jsx(ut,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":U&&!p},...G("thumb"),children:p}),k.jsx("span",{...G("trackLabel"),children:Z?h:f})]})]})});pd.classes={...BY,...KK};pd.displayName="@mantine/core/Switch";pd.Group=SP;const[qme,Xme]=yu("Table component was not found in the tree");var I_={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function Kme(t,e){if(!e)return;const n={};return e.columnBorder&&t.withColumnBorders&&(n["data-with-column-border"]=!0),e.rowBorder&&t.withRowBorders&&(n["data-with-row-border"]=!0),e.striped&&t.striped&&(n["data-striped"]=t.striped),e.highlightOnHover&&t.highlightOnHover&&(n["data-hover"]=!0),e.captionSide&&t.captionSide&&(n["data-side"]=t.captionSide),e.stickyHeader&&t.stickyHeader&&(n["data-sticky"]=!0),n}function sg(t,e){const n=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,i=tn((r,a)=>{const s=Pt(n,{},r),{classNames:o,className:l,style:c,styles:u,...f}=s,h=Xme();return k.jsx(ut,{component:t,ref:a,...Kme(h,e),...h.getStyles(t,{className:l,classNames:o,style:c,styles:u,props:s}),...f})});return i.displayName=`@mantine/core/${n}`,i.classes=I_,i}const HO=sg("th",{columnBorder:!0}),zY=sg("td",{columnBorder:!0}),uM=sg("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),jY=sg("thead",{stickyHeader:!0}),HY=sg("tbody"),VY=sg("tfoot"),GY=sg("caption",{captionSide:!0});function wP({data:t}){return k.jsxs(k.Fragment,{children:[t.caption&&k.jsx(GY,{children:t.caption}),t.head&&k.jsx(jY,{children:k.jsx(uM,{children:t.head.map((e,n)=>k.jsx(HO,{children:e},n))})}),t.body&&k.jsx(HY,{children:t.body.map((e,n)=>k.jsx(uM,{children:e.map((i,r)=>k.jsx(zY,{children:i},r))},n))}),t.foot&&k.jsx(VY,{children:k.jsx(uM,{children:t.foot.map((e,n)=>k.jsx(HO,{children:e},n))})})]})}wP.displayName="@mantine/core/TableDataRenderer";const Yme={type:"scrollarea"},Jme=(t,{minWidth:e,maxHeight:n,type:i})=>({scrollContainer:{"--table-min-width":Et(e),"--table-max-height":Et(n),"--table-overflow":i==="native"?"auto":void 0}}),EP=tn((t,e)=>{const n=Pt("TableScrollContainer",Yme,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,children:c,minWidth:u,maxHeight:f,type:h,scrollAreaProps:d,attributes:g,...b}=n,y=Tn({name:"TableScrollContainer",classes:I_,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:Jme,rootSelector:"scrollContainer"});return k.jsx(ut,{component:h==="scrollarea"?Ac:"div",...h==="scrollarea"?f?{offsetScrollbars:"xy",...d}:{offsetScrollbars:"x",...d}:{},ref:e,...y("scrollContainer"),...b,children:k.jsx("div",{...y("scrollContainerInner"),children:c})})});EP.classes=I_;EP.displayName="@mantine/core/TableScrollContainer";const $me={withRowBorders:!0,verticalSpacing:7},Zme=(t,{layout:e,captionSide:n,horizontalSpacing:i,verticalSpacing:r,borderColor:a,stripedColor:s,highlightOnHoverColor:o,striped:l,highlightOnHover:c,stickyHeaderOffset:u,stickyHeader:f})=>({table:{"--table-layout":e,"--table-caption-side":n,"--table-horizontal-spacing":Pd(i),"--table-vertical-spacing":Pd(r),"--table-border-color":a?ia(a,t):void 0,"--table-striped-color":l&&s?ia(s,t):void 0,"--table-highlight-on-hover-color":c&&o?ia(o,t):void 0,"--table-sticky-header-offset":f?Et(u):void 0}}),kc=tn((t,e)=>{const n=Pt("Table",$me,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,horizontalSpacing:c,verticalSpacing:u,captionSide:f,stripedColor:h,highlightOnHoverColor:d,striped:g,highlightOnHover:b,withColumnBorders:y,withRowBorders:p,withTableBorder:x,borderColor:_,layout:w,variant:M,data:S,children:A,stickyHeader:C,stickyHeaderOffset:D,mod:R,tabularNums:N,attributes:U,...j}=n,z=Tn({name:"Table",props:n,className:r,style:a,classes:I_,classNames:i,styles:s,unstyled:o,attributes:U,rootSelector:"table",vars:l,varsResolver:Zme});return k.jsx(qme,{value:{getStyles:z,stickyHeader:C,striped:g===!0?"odd":g||void 0,highlightOnHover:b,withColumnBorders:y,withRowBorders:p,captionSide:f||"bottom"},children:k.jsx(ut,{component:"table",variant:M,ref:e,mod:[{"data-with-table-border":x,"data-tabular-nums":N},R],...z("table"),...j,children:A||!!S&&k.jsx(wP,{data:S})})})});kc.classes=I_;kc.displayName="@mantine/core/Table";kc.Td=zY;kc.Th=HO;kc.Tr=uM;kc.Thead=jY;kc.Tbody=HY;kc.Tfoot=VY;kc.Caption=GY;kc.ScrollContainer=EP;kc.DataRenderer=wP;const[Qme,MP]=yu("Tabs component was not found in the tree");var N_={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const TP=tn((t,e)=>{const n=Pt("TabsList",null,t),{children:i,className:r,grow:a,justify:s,classNames:o,styles:l,style:c,mod:u,...f}=n,h=MP();return k.jsx(ut,{...f,...h.getStyles("list",{className:r,style:c,classNames:o,styles:l,props:n,variant:h.variant}),ref:e,role:"tablist",variant:h.variant,mod:[{grow:a,orientation:h.orientation,placement:h.orientation==="vertical"&&h.placement,inverted:h.inverted},u],"aria-orientation":h.orientation,__vars:{"--tabs-justify":s},children:i})});TP.classes=N_;TP.displayName="@mantine/core/TabsList";const AP=tn((t,e)=>{const n=Pt("TabsPanel",null,t),{children:i,className:r,value:a,classNames:s,styles:o,style:l,mod:c,keepMounted:u,...f}=n,h=MP(),d=h.value===a,g=h.keepMounted||u||d?i:null;return k.jsx(ut,{...h.getStyles("panel",{className:r,classNames:s,styles:o,style:[l,d?void 0:{display:"none"}],props:n}),ref:e,mod:[{orientation:h.orientation},c],role:"tabpanel",id:h.getPanelId(a),"aria-labelledby":h.getTabId(a),...f,children:g})});AP.classes=N_;AP.displayName="@mantine/core/TabsPanel";const CP=tn((t,e)=>{const n=Pt("TabsTab",null,t),{className:i,children:r,rightSection:a,leftSection:s,value:o,onClick:l,onKeyDown:c,disabled:u,color:f,style:h,classNames:d,styles:g,vars:b,mod:y,tabIndex:p,...x}=n,_=va(),{dir:w}=Rv(),M=MP(),S=o===M.value,A=D=>{M.onChange(M.allowTabDeactivation&&o===M.value?null:o),l?.(D)},C={classNames:d,styles:g,props:n};return k.jsxs(rf,{...M.getStyles("tab",{className:i,style:h,variant:M.variant,...C}),disabled:u,unstyled:M.unstyled,variant:M.variant,mod:[{active:S,disabled:u,orientation:M.orientation,inverted:M.inverted,placement:M.orientation==="vertical"&&M.placement},y],ref:e,role:"tab",id:M.getTabId(o),"aria-selected":S,tabIndex:p!==void 0?p:S||M.value===null?0:-1,"aria-controls":M.getPanelId(o),onClick:A,__vars:{"--tabs-color":f?ia(f,_):void 0},onKeyDown:Zle({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:M.activateTabWithKeyboard,loop:M.loop,orientation:M.orientation||"horizontal",dir:w,onKeyDown:c}),...x,children:[s&&k.jsx("span",{...M.getStyles("tabSection",C),"data-position":"left",children:s}),r&&k.jsx("span",{...M.getStyles("tabLabel",C),children:r}),a&&k.jsx("span",{...M.getStyles("tabSection",C),"data-position":"right",children:a})]})});CP.classes=N_;CP.displayName="@mantine/core/TabsTab";const Cz="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",ege={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},tge=(t,{radius:e,color:n,autoContrast:i})=>({root:{"--tabs-radius":aa(e),"--tabs-color":ia(n,t),"--tabs-text-color":sA(i,t)?M_({color:n,theme:t,autoContrast:i}):void 0}}),Kf=tn((t,e)=>{const n=Pt("Tabs",ege,t),{defaultValue:i,value:r,onChange:a,orientation:s,children:o,loop:l,id:c,activateTabWithKeyboard:u,allowTabDeactivation:f,variant:h,color:d,radius:g,inverted:b,placement:y,keepMounted:p,classNames:x,styles:_,unstyled:w,className:M,style:S,vars:A,autoContrast:C,mod:D,attributes:R,...N}=n,U=uf(c),[j,z]=Al({value:r,defaultValue:i,finalValue:null,onChange:a}),q=Tn({name:"Tabs",props:n,classes:N_,className:M,style:S,classNames:x,styles:_,unstyled:w,attributes:R,vars:A,varsResolver:tge});return k.jsx(Qme,{value:{placement:y,value:j,orientation:s,id:U,loop:l,activateTabWithKeyboard:u,getTabId:SB(`${U}-tab`,Cz),getPanelId:SB(`${U}-panel`,Cz),onChange:z,allowTabDeactivation:f,variant:h,color:d,radius:g,inverted:b,keepMounted:p,unstyled:w,getStyles:q},children:k.jsx(ut,{ref:e,id:U,variant:h,mod:[{orientation:s,inverted:s==="horizontal"&&b,placement:s==="vertical"&&y},D],...q("root"),...N,children:o})})});Kf.classes=N_;Kf.displayName="@mantine/core/Tabs";Kf.Tab=CP;Kf.Panel=AP;Kf.List=TP;const og=tn((t,e)=>{const n=Pt("TextInput",null,t);return k.jsx(xu,{component:"input",ref:e,...n,__staticSelector:"TextInput"})});og.classes=xu.classes;og.displayName="@mantine/core/TextInput";const nge=["h1","h2","h3","h4","h5","h6"],ige=["xs","sm","md","lg","xl"];function rge(t,e){const n=e!==void 0?e:`h${t}`;return nge.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:ige.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${t}-font-weight)`,lineHeight:`var(--mantine-h${t}-line-height)`}:{fontSize:Et(n),fontWeight:`var(--mantine-h${t}-font-weight)`,lineHeight:`var(--mantine-h${t}-line-height)`}}var WY={root:"m_8a5d1357"};const age={order:1},sge=(t,{order:e,size:n,lineClamp:i,textWrap:r})=>{const a=rge(e||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof i=="number"?i.toString():void 0,"--title-text-wrap":r}}},IA=tn((t,e)=>{const n=Pt("Title",age,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,order:l,vars:c,size:u,variant:f,lineClamp:h,textWrap:d,mod:g,attributes:b,...y}=n,p=Tn({name:"Title",props:n,classes:WY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:c,varsResolver:sge});return[1,2,3,4,5,6].includes(l)?k.jsx(ut,{...p("root"),component:`h${l}`,variant:f,ref:e,mod:[{order:l,"data-line-clamp":typeof h=="number"},g],size:u,...y}):null});IA.classes=WY;IA.displayName="@mantine/core/Title";const qY=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function oge(t,e){return t.reduce((n,i)=>(n[i.position||e].push(i),n),qY.reduce((n,i)=>(n[i]=[],n),{}))}const Rz={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},lge={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function cge({state:t,maxHeight:e,position:n,transitionDuration:i}){const[r,a]=n.split("-"),s=a==="center"?`${r}-center`:a,o={opacity:0,maxHeight:e,transform:Rz[s],transitionDuration:`${i}ms, ${i}ms, ${i}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},l={opacity:1,transform:lge[s]},c={opacity:0,maxHeight:0,transform:Rz[s]};return{...o,...{entering:l,entered:l,exiting:c,exited:c}[t]}}function uge(t,e){return typeof e=="number"?e:e===!1||t===!1?!1:t}const XY=I.forwardRef(({data:t,onHide:e,autoClose:n,...i},r)=>{const{autoClose:a,message:s,...o}=t,l=uge(n,t.autoClose),c=I.useRef(-1),u=()=>window.clearTimeout(c.current),f=()=>{e(t.id),u()},h=()=>{typeof l=="number"&&(c.current=window.setTimeout(f,l))};return I.useEffect(()=>{t.onOpen?.(t)},[]),I.useEffect(()=>(h(),u),[l]),k.jsx(bP,{...i,...o,onClose:f,ref:r,onMouseEnter:u,onMouseLeave:h,children:s})});XY.displayName="@mantine/notifications/NotificationContainer";var KY={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const fge=yh,hge={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:ff("overlay"),store:tg,withinPortal:!0},dge=(t,{zIndex:e,containerWidth:n})=>({root:{"--notifications-z-index":e?.toString(),"--notifications-container-width":Et(n)}}),Sh=tn((t,e)=>{const n=Pt("Notifications",hge,t),{classNames:i,className:r,style:a,styles:s,unstyled:o,vars:l,position:c,autoClose:u,transitionDuration:f,containerWidth:h,notificationMaxHeight:d,limit:g,zIndex:b,store:y,portalProps:p,withinPortal:x,..._}=n,w=va(),M=Koe(y),S=Loe(),A=ZT(),C=I.useRef({}),D=I.useRef(0),N=(w.respectReducedMotion?A:!1)?1:f,U=Tn({name:"Notifications",classes:KY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,vars:l,varsResolver:dge});I.useEffect(()=>{y?.updateState(q=>({...q,limit:g||5,defaultPosition:c}))},[g,c]),vc(()=>{M.notifications.length>D.current&&setTimeout(()=>S(),0),D.current=M.notifications.length},[M.notifications]);const j=oge(M.notifications,c),z=qY.reduce((q,B)=>(q[B]=j[B].map(({style:G,...H})=>k.jsx(fge,{timeout:N,onEnter:()=>C.current[H.id].offsetHeight,nodeRef:{current:C.current[H.id]},children:W=>k.jsx(XY,{ref:F=>{F&&(C.current[H.id]=F)},data:H,onHide:F=>oX(F,y),autoClose:u,...U("notification",{style:{...cge({state:W,position:B,transitionDuration:N,maxHeight:d}),...G}})})},H.id)),q),{});return k.jsxs(Ud,{withinPortal:x,...p,children:[k.jsx(ut,{...U("root"),"data-position":"top-center",ref:e,..._,children:k.jsx(ad,{children:z["top-center"]})}),k.jsx(ut,{...U("root"),"data-position":"top-left",..._,children:k.jsx(ad,{children:z["top-left"]})}),k.jsx(ut,{...U("root",{className:a2.classNames.fullWidth}),"data-position":"top-right",..._,children:k.jsx(ad,{children:z["top-right"]})}),k.jsx(ut,{...U("root",{className:a2.classNames.fullWidth}),"data-position":"bottom-right",..._,children:k.jsx(ad,{children:z["bottom-right"]})}),k.jsx(ut,{...U("root"),"data-position":"bottom-left",..._,children:k.jsx(ad,{children:z["bottom-left"]})}),k.jsx(ut,{...U("root"),"data-position":"bottom-center",..._,children:k.jsx(ad,{children:z["bottom-center"]})})]})});Sh.classes=KY;Sh.displayName="@mantine/notifications/Notifications";Sh.show=ks.show;Sh.hide=ks.hide;Sh.update=ks.update;Sh.clean=ks.clean;Sh.cleanQueue=ks.cleanQueue;Sh.updateState=ks.updateState;/**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */const Uv="179",pge={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},mge={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},YY=0,VO=1,JY=2,gge=3,$Y=0,NA=1,Jx=2,Xc=3,gu=0,Ra=1,Kr=2,Zu=0,Tm=1,GO=2,WO=3,qO=4,ZY=5,md=100,QY=101,eJ=102,tJ=103,nJ=104,iJ=200,rJ=201,aJ=202,sJ=203,p2=204,m2=205,oJ=206,lJ=207,cJ=208,uJ=209,fJ=210,hJ=211,dJ=212,pJ=213,mJ=214,g2=0,b2=1,v2=2,zm=3,y2=4,x2=5,_2=6,S2=7,L_=0,gJ=1,bJ=2,Qu=0,vJ=1,yJ=2,xJ=3,RP=4,_J=5,SJ=6,wJ=7,F1="attached",kP="detached",Fd=300,sf=301,Bd=302,X0=303,B1=304,Fv=306,zd=1e3,ba=1001,K0=1002,is=1003,LA=1004,bge=1004,rm=1005,vge=1005,Hi=1006,b0=1007,yge=1007,mc=1008,XO=1008,To=1009,PA=1010,UA=1011,Y0=1012,Bv=1013,wc=1014,yr=1015,ts=1016,FA=1017,BA=1018,J0=1020,DP=35902,OP=1021,IP=1022,$r=1023,$0=1026,Z0=1027,wh=1028,zv=1029,zA=1030,P_=1031,xge=1032,jv=1033,$x=33776,Zx=33777,Qx=33778,e1=33779,w2=35840,E2=35841,M2=35842,T2=35843,A2=36196,C2=37492,R2=37496,k2=37808,D2=37809,O2=37810,I2=37811,N2=37812,L2=37813,P2=37814,U2=37815,F2=37816,B2=37817,z2=37818,j2=37819,H2=37820,V2=37821,t1=36492,G2=36494,W2=36495,NP=36283,q2=36284,X2=36285,K2=36286,EJ=2200,MJ=2201,TJ=2202,Q0=2300,ev=2301,fM=2302,am=2400,sm=2401,z1=2402,jA=2500,LP=2501,AJ=0,PP=1,Y2=2,CJ=3200,UP=3201,_ge=3202,Sge=3203,qd=0,RJ=1,tu="",Es="srgb",bu="srgb-linear",j1="linear",fr="srgb",wge=0,qp=7680,Ege=7681,Mge=7682,Tge=7683,Age=34055,Cge=34056,Rge=5386,kge=512,Dge=513,Oge=514,Ige=515,Nge=516,Lge=517,Pge=518,KO=519,kJ=512,DJ=513,OJ=514,FP=515,IJ=516,NJ=517,LJ=518,PJ=519,H1=35044,V1=35048,Uge=35040,Fge=35045,Bge=35049,zge=35041,jge=35046,Hge=35050,Vge=35042,Gge="100",YO="300 es",gl=2e3,tv=2001,Wge={COMPUTE:"compute",RENDER:"render"},qge={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},Xge={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};let df=class{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const a=r.indexOf(n);a!==-1&&r.splice(a,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let a=0,s=r.length;a<s;a++)r[a].call(this,e);e.target=null}}};const Js=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let kz=1234567;const Am=Math.PI/180,nv=180/Math.PI;function wl(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(Js[t&255]+Js[t>>8&255]+Js[t>>16&255]+Js[t>>24&255]+"-"+Js[e&255]+Js[e>>8&255]+"-"+Js[e>>16&15|64]+Js[e>>24&255]+"-"+Js[n&63|128]+Js[n>>8&255]+"-"+Js[n>>16&255]+Js[n>>24&255]+Js[i&255]+Js[i>>8&255]+Js[i>>16&255]+Js[i>>24&255]).toLowerCase()}function Ln(t,e,n){return Math.max(e,Math.min(n,t))}function BP(t,e){return(t%e+e)%e}function Kge(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function Yge(t,e,n){return t!==e?(n-t)/(e-t):0}function n1(t,e,n){return(1-n)*t+n*e}function Jge(t,e,n,i){return n1(t,e,1-Math.exp(-n*i))}function $ge(t,e=1){return e-Math.abs(BP(t,e*2)-e)}function Zge(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Qge(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function ebe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function tbe(t,e){return t+Math.random()*(e-t)}function nbe(t){return t*(.5-Math.random())}function ibe(t){t!==void 0&&(kz=t);let e=kz+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function rbe(t){return t*Am}function abe(t){return t*nv}function sbe(t){return(t&t-1)===0&&t!==0}function obe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function lbe(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function cbe(t,e,n,i,r){const a=Math.cos,s=Math.sin,o=a(n/2),l=s(n/2),c=a((e+i)/2),u=s((e+i)/2),f=a((e-i)/2),h=s((e-i)/2),d=a((i-e)/2),g=s((i-e)/2);switch(r){case"XYX":t.set(o*u,l*f,l*h,o*c);break;case"YZY":t.set(l*h,o*u,l*f,o*c);break;case"ZXZ":t.set(l*f,l*h,o*u,o*c);break;case"XZX":t.set(o*u,l*g,l*d,o*c);break;case"YXY":t.set(l*d,o*u,l*g,o*c);break;case"ZYZ":t.set(l*g,l*d,o*u,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function So(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Qn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const gc={DEG2RAD:Am,RAD2DEG:nv,generateUUID:wl,clamp:Ln,euclideanModulo:BP,mapLinear:Kge,inverseLerp:Yge,lerp:n1,damp:Jge,pingpong:$ge,smoothstep:Zge,smootherstep:Qge,randInt:ebe,randFloat:tbe,randFloatSpread:nbe,seededRandom:ibe,degToRad:rbe,radToDeg:abe,isPowerOfTwo:sbe,ceilPowerOfTwo:obe,floorPowerOfTwo:lbe,setQuaternionFromProperEuler:cbe,normalize:Qn,denormalize:So};class wt{constructor(e=0,n=0){wt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Ln(this.x,e.x,n.x),this.y=Ln(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=Ln(this.x,e,n),this.y=Ln(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ln(i,e,n))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(Ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),a=this.x-e.x,s=this.y-e.y;return this.x=a*i-s*r+e.x,this.y=a*r+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Vn{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,a,s,o){let l=i[r+0],c=i[r+1],u=i[r+2],f=i[r+3];const h=a[s+0],d=a[s+1],g=a[s+2],b=a[s+3];if(o===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(o===1){e[n+0]=h,e[n+1]=d,e[n+2]=g,e[n+3]=b;return}if(f!==b||l!==h||c!==d||u!==g){let y=1-o;const p=l*h+c*d+u*g+f*b,x=p>=0?1:-1,_=1-p*p;if(_>Number.EPSILON){const M=Math.sqrt(_),S=Math.atan2(M,p*x);y=Math.sin(y*S)/M,o=Math.sin(o*S)/M}const w=o*x;if(l=l*y+h*w,c=c*y+d*w,u=u*y+g*w,f=f*y+b*w,y===1-o){const M=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=M,c*=M,u*=M,f*=M}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,i,r,a,s){const o=i[r],l=i[r+1],c=i[r+2],u=i[r+3],f=a[s],h=a[s+1],d=a[s+2],g=a[s+3];return e[n]=o*g+u*f+l*d-c*h,e[n+1]=l*g+u*h+c*f-o*d,e[n+2]=c*g+u*d+o*h-l*f,e[n+3]=u*g-o*f-l*h-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,a=e._z,s=e._order,o=Math.cos,l=Math.sin,c=o(i/2),u=o(r/2),f=o(a/2),h=l(i/2),d=l(r/2),g=l(a/2);switch(s){case"XYZ":this._x=h*u*f+c*d*g,this._y=c*d*f-h*u*g,this._z=c*u*g+h*d*f,this._w=c*u*f-h*d*g;break;case"YXZ":this._x=h*u*f+c*d*g,this._y=c*d*f-h*u*g,this._z=c*u*g-h*d*f,this._w=c*u*f+h*d*g;break;case"ZXY":this._x=h*u*f-c*d*g,this._y=c*d*f+h*u*g,this._z=c*u*g+h*d*f,this._w=c*u*f-h*d*g;break;case"ZYX":this._x=h*u*f-c*d*g,this._y=c*d*f+h*u*g,this._z=c*u*g-h*d*f,this._w=c*u*f+h*d*g;break;case"YZX":this._x=h*u*f+c*d*g,this._y=c*d*f+h*u*g,this._z=c*u*g-h*d*f,this._w=c*u*f-h*d*g;break;case"XZY":this._x=h*u*f-c*d*g,this._y=c*d*f-h*u*g,this._z=c*u*g+h*d*f,this._w=c*u*f+h*d*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],a=n[8],s=n[1],o=n[5],l=n[9],c=n[2],u=n[6],f=n[10],h=i+o+f;if(h>0){const d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-l)*d,this._y=(a-c)*d,this._z=(s-r)*d}else if(i>o&&i>f){const d=2*Math.sqrt(1+i-o-f);this._w=(u-l)/d,this._x=.25*d,this._y=(r+s)/d,this._z=(a+c)/d}else if(o>f){const d=2*Math.sqrt(1+o-i-f);this._w=(a-c)/d,this._x=(r+s)/d,this._y=.25*d,this._z=(l+u)/d}else{const d=2*Math.sqrt(1+f-i-o);this._w=(s-r)/d,this._x=(a+c)/d,this._y=(l+u)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ln(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,r),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,a=e._z,s=e._w,o=n._x,l=n._y,c=n._z,u=n._w;return this._x=i*u+s*o+r*c-a*l,this._y=r*u+s*l+a*o-i*c,this._z=a*u+s*c+i*l-r*o,this._w=s*u-i*o-r*l-a*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const i=this._x,r=this._y,a=this._z,s=this._w;let o=s*e._w+i*e._x+r*e._y+a*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=i,this._y=r,this._z=a,this;const l=1-o*o;if(l<=Number.EPSILON){const d=1-n;return this._w=d*s+n*this._w,this._x=d*i+n*this._x,this._y=d*r+n*this._y,this._z=d*a+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,o),f=Math.sin((1-n)*u)/c,h=Math.sin(n*u)/c;return this._w=s*f+this._w*h,this._x=i*f+this._x*h,this._y=r*f+this._y*h,this._z=a*f+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),a*Math.sin(n),a*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class te{constructor(e=0,n=0,i=0){te.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(Dz.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(Dz.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*n+a[3]*i+a[6]*r,this.y=a[1]*n+a[4]*i+a[7]*r,this.z=a[2]*n+a[5]*i+a[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,a=e.elements,s=1/(a[3]*n+a[7]*i+a[11]*r+a[15]);return this.x=(a[0]*n+a[4]*i+a[8]*r+a[12])*s,this.y=(a[1]*n+a[5]*i+a[9]*r+a[13])*s,this.z=(a[2]*n+a[6]*i+a[10]*r+a[14])*s,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,a=e.x,s=e.y,o=e.z,l=e.w,c=2*(s*r-o*i),u=2*(o*n-a*r),f=2*(a*i-s*n);return this.x=n+l*c+s*f-o*u,this.y=i+l*u+o*c-a*f,this.z=r+l*f+a*u-s*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,a=e.elements;return this.x=a[0]*n+a[4]*i+a[8]*r,this.y=a[1]*n+a[5]*i+a[9]*r,this.z=a[2]*n+a[6]*i+a[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Ln(this.x,e.x,n.x),this.y=Ln(this.y,e.y,n.y),this.z=Ln(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=Ln(this.x,e,n),this.y=Ln(this.y,e,n),this.z=Ln(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ln(i,e,n))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,a=e.z,s=n.x,o=n.y,l=n.z;return this.x=r*l-a*o,this.y=a*s-i*l,this.z=i*o-r*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return ek.copy(this).projectOnVector(e),this.sub(ek)}reflect(e){return this.sub(ek.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(Ln(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const ek=new te,Dz=new Vn;class Kn{constructor(e,n,i,r,a,s,o,l,c){Kn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,a,s,o,l,c)}set(e,n,i,r,a,s,o,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=n,u[4]=a,u[5]=l,u[6]=i,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,a=this.elements,s=i[0],o=i[3],l=i[6],c=i[1],u=i[4],f=i[7],h=i[2],d=i[5],g=i[8],b=r[0],y=r[3],p=r[6],x=r[1],_=r[4],w=r[7],M=r[2],S=r[5],A=r[8];return a[0]=s*b+o*x+l*M,a[3]=s*y+o*_+l*S,a[6]=s*p+o*w+l*A,a[1]=c*b+u*x+f*M,a[4]=c*y+u*_+f*S,a[7]=c*p+u*w+f*A,a[2]=h*b+d*x+g*M,a[5]=h*y+d*_+g*S,a[8]=h*p+d*w+g*A,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return n*s*u-n*o*c-i*a*u+i*o*l+r*a*c-r*s*l}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8],f=u*s-o*c,h=o*l-u*a,d=c*a-s*l,g=n*f+i*h+r*d;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const b=1/g;return e[0]=f*b,e[1]=(r*c-u*i)*b,e[2]=(o*i-r*s)*b,e[3]=h*b,e[4]=(u*n-r*l)*b,e[5]=(r*a-o*n)*b,e[6]=d*b,e[7]=(i*l-c*n)*b,e[8]=(s*n-i*a)*b,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,a,s,o){const l=Math.cos(a),c=Math.sin(a);return this.set(i*l,i*c,-i*(l*s+c*o)+s+e,-r*c,r*l,-r*(-c*s+l*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply(tk.makeScale(e,n)),this}rotate(e){return this.premultiply(tk.makeRotation(-e)),this}translate(e,n){return this.premultiply(tk.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const tk=new Kn;function UJ(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const ube={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function e0(t,e){return new ube[t](e)}function G1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function FJ(){const t=G1("canvas");return t.style.display="block",t}const Oz={};function v0(t){t in Oz||(Oz[t]=!0,console.warn(t))}function fbe(t,e,n){return new Promise(function(i,r){function a(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}}setTimeout(a,n)})}const Iz=new Kn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Nz=new Kn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function hbe(){const t={enabled:!0,workingColorSpace:bu,spaces:{},convert:function(r,a,s){return this.enabled===!1||a===s||!a||!s||(this.spaces[a].transfer===fr&&(r.r=ih(r.r),r.g=ih(r.g),r.b=ih(r.b)),this.spaces[a].primaries!==this.spaces[s].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[s].fromXYZ)),this.spaces[s].transfer===fr&&(r.r=y0(r.r),r.g=y0(r.g),r.b=y0(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===tu?j1:this.spaces[r].transfer},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,s){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[s].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return v0("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return v0("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,a)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[bu]:{primaries:e,whitePoint:i,transfer:j1,toXYZ:Iz,fromXYZ:Nz,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Es},outputColorSpaceConfig:{drawingBufferColorSpace:Es}},[Es]:{primaries:e,whitePoint:i,transfer:fr,toXYZ:Iz,fromXYZ:Nz,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Es}}}),t}const pi=hbe();function ih(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function y0(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Xg;class BJ{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Xg===void 0&&(Xg=G1("canvas")),Xg.width=e.width,Xg.height=e.height;const r=Xg.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Xg}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=G1("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),a=r.data;for(let s=0;s<a.length;s++)a[s]=ih(a[s]/255)*255;return i.putImageData(r,0,0),n}else if(e.data){const n=e.data.slice(0);for(let i=0;i<n.length;i++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[i]=Math.floor(ih(n[i]/255)*255):n[i]=ih(n[i]);return{data:n,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let dbe=0;class xd{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:dbe++}),this.uuid=wl(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let s=0,o=r.length;s<o;s++)r[s].isDataTexture?a.push(nk(r[s].image)):a.push(nk(r[s]))}else a=nk(r);i.url=a}return n||(e.images[this.uuid]=i),i}}function nk(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?BJ.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let pbe=0;const ik=new te;class nr extends df{constructor(e=nr.DEFAULT_IMAGE,n=nr.DEFAULT_MAPPING,i=ba,r=ba,a=Hi,s=mc,o=$r,l=To,c=nr.DEFAULT_ANISOTROPY,u=tu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:pbe++}),this.uuid=wl(),this.name="",this.source=new xd(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=a,this.minFilter=s,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new wt(0,0),this.repeat=new wt(1,1),this.center=new wt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Kn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(ik).x}get height(){return this.source.getSize(ik).y}get depth(){return this.source.getSize(ik).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Fd)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case zd:e.x=e.x-Math.floor(e.x);break;case ba:e.x=e.x<0?0:1;break;case K0:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case zd:e.y=e.y-Math.floor(e.y);break;case ba:e.y=e.y<0?0:1;break;case K0:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}nr.DEFAULT_IMAGE=null;nr.DEFAULT_MAPPING=Fd;nr.DEFAULT_ANISOTROPY=1;class ei{constructor(e=0,n=0,i=0,r=1){ei.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,a=this.w,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r+s[12]*a,this.y=s[1]*n+s[5]*i+s[9]*r+s[13]*a,this.z=s[2]*n+s[6]*i+s[10]*r+s[14]*a,this.w=s[3]*n+s[7]*i+s[11]*r+s[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,a;const l=e.elements,c=l[0],u=l[4],f=l[8],h=l[1],d=l[5],g=l[9],b=l[2],y=l[6],p=l[10];if(Math.abs(u-h)<.01&&Math.abs(f-b)<.01&&Math.abs(g-y)<.01){if(Math.abs(u+h)<.1&&Math.abs(f+b)<.1&&Math.abs(g+y)<.1&&Math.abs(c+d+p-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const _=(c+1)/2,w=(d+1)/2,M=(p+1)/2,S=(u+h)/4,A=(f+b)/4,C=(g+y)/4;return _>w&&_>M?_<.01?(i=0,r=.707106781,a=.707106781):(i=Math.sqrt(_),r=S/i,a=A/i):w>M?w<.01?(i=.707106781,r=0,a=.707106781):(r=Math.sqrt(w),i=S/r,a=C/r):M<.01?(i=.707106781,r=.707106781,a=0):(a=Math.sqrt(M),i=A/a,r=C/a),this.set(i,r,a,n),this}let x=Math.sqrt((y-g)*(y-g)+(f-b)*(f-b)+(h-u)*(h-u));return Math.abs(x)<.001&&(x=1),this.x=(y-g)/x,this.y=(f-b)/x,this.z=(h-u)/x,this.w=Math.acos((c+d+p-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Ln(this.x,e.x,n.x),this.y=Ln(this.y,e.y,n.y),this.z=Ln(this.z,e.z,n.z),this.w=Ln(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=Ln(this.x,e,n),this.y=Ln(this.y,e,n),this.z=Ln(this.z,e,n),this.w=Ln(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Ln(i,e,n))}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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),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 zP extends df{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Hi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new ei(0,0,e,n),this.scissorTest=!1,this.viewport=new ei(0,0,e,n);const r={width:e,height:n,depth:i.depth},a=new nr(r);this.textures=[];const s=i.count;for(let o=0;o<s;o++)this.textures[o]=a.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const n={minFilter:Hi,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(n)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,n,i=1){if(this.width!==e||this.height!==n||this.depth!==i){this.width=e,this.height=n,this.depth=i;for(let r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=e,this.textures[r].image.height=n,this.textures[r].image.depth=i,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const r=Object.assign({},e.textures[n].image);this.textures[n].source=new xd(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ec extends zP{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class HA extends nr{constructor(e=null,n=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=is,this.minFilter=is,this.wrapR=ba,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class mbe extends Ec{constructor(e=1,n=1,i=1,r={}){super(e,n,r),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new HA(null,e,n,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class VA extends nr{constructor(e=null,n=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:r},this.magFilter=is,this.minFilter=is,this.wrapR=ba,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class gbe extends Ec{constructor(e=1,n=1,i=1,r={}){super(e,n,r),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new VA(null,e,n,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class rr{constructor(e=new te(1/0,1/0,1/0),n=new te(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n+=3)this.expandByPoint(zc.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(zc.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=zc.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,n=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const a=i.getAttribute("position");if(n===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let s=0,o=a.count;s<o;s++)e.isMesh===!0?e.getVertexPosition(s,zc):zc.fromBufferAttribute(a,s),zc.applyMatrix4(e.matrixWorld),this.expandByPoint(zc);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),sw.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),sw.copy(i.boundingBox)),sw.applyMatrix4(e.matrixWorld),this.union(sw)}const r=e.children;for(let a=0,s=r.length;a<s;a++)this.expandByObject(r[a],n);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,zc),zc.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Py),ow.subVectors(this.max,Py),Kg.subVectors(e.a,Py),Yg.subVectors(e.b,Py),Jg.subVectors(e.c,Py),Hh.subVectors(Yg,Kg),Vh.subVectors(Jg,Yg),yp.subVectors(Kg,Jg);let n=[0,-Hh.z,Hh.y,0,-Vh.z,Vh.y,0,-yp.z,yp.y,Hh.z,0,-Hh.x,Vh.z,0,-Vh.x,yp.z,0,-yp.x,-Hh.y,Hh.x,0,-Vh.y,Vh.x,0,-yp.y,yp.x,0];return!rk(n,Kg,Yg,Jg,ow)||(n=[1,0,0,0,1,0,0,0,1],!rk(n,Kg,Yg,Jg,ow))?!1:(lw.crossVectors(Hh,Vh),n=[lw.x,lw.y,lw.z],rk(n,Kg,Yg,Jg,ow))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,zc).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(zc).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Df[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Df[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Df[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Df[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Df[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Df[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Df[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Df[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Df),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Df=[new te,new te,new te,new te,new te,new te,new te,new te],zc=new te,sw=new rr,Kg=new te,Yg=new te,Jg=new te,Hh=new te,Vh=new te,yp=new te,Py=new te,ow=new te,lw=new te,xp=new te;function rk(t,e,n,i,r){for(let a=0,s=t.length-3;a<=s;a+=3){xp.fromArray(t,a);const o=r.x*Math.abs(xp.x)+r.y*Math.abs(xp.y)+r.z*Math.abs(xp.z),l=e.dot(xp),c=n.dot(xp),u=i.dot(xp);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const bbe=new rr,Uy=new te,ak=new te;class Ir{constructor(e=new te,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):bbe.setFromPoints(e).getCenter(i);let r=0;for(let a=0,s=e.length;a<s;a++)r=Math.max(r,i.distanceToSquared(e[a]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const i=this.center.distanceToSquared(e);return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Uy.subVectors(e,this.center);const n=Uy.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(Uy,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(ak.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Uy.copy(e.center).add(ak)),this.expandByPoint(Uy.copy(e.center).sub(ak))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const Of=new te,sk=new te,cw=new te,Gh=new te,ok=new te,uw=new te,lk=new te;class pf{constructor(e=new te,n=new te(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Of)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Of.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Of.copy(this.origin).addScaledVector(this.direction,n),Of.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){sk.copy(e).add(n).multiplyScalar(.5),cw.copy(n).sub(e).normalize(),Gh.copy(this.origin).sub(sk);const a=e.distanceTo(n)*.5,s=-this.direction.dot(cw),o=Gh.dot(this.direction),l=-Gh.dot(cw),c=Gh.lengthSq(),u=Math.abs(1-s*s);let f,h,d,g;if(u>0)if(f=s*l-o,h=s*o-l,g=a*u,f>=0)if(h>=-g)if(h<=g){const b=1/u;f*=b,h*=b,d=f*(f+s*h+2*o)+h*(s*f+h+2*l)+c}else h=a,f=Math.max(0,-(s*h+o)),d=-f*f+h*(h+2*l)+c;else h=-a,f=Math.max(0,-(s*h+o)),d=-f*f+h*(h+2*l)+c;else h<=-g?(f=Math.max(0,-(-s*a+o)),h=f>0?-a:Math.min(Math.max(-a,-l),a),d=-f*f+h*(h+2*l)+c):h<=g?(f=0,h=Math.min(Math.max(-a,-l),a),d=h*(h+2*l)+c):(f=Math.max(0,-(s*a+o)),h=f>0?a:Math.min(Math.max(-a,-l),a),d=-f*f+h*(h+2*l)+c);else h=s>0?-a:a,f=Math.max(0,-(s*h+o)),d=-f*f+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(sk).addScaledVector(cw,h),d}intersectSphere(e,n){Of.subVectors(e.center,this.origin);const i=Of.dot(this.direction),r=Of.dot(Of)-i*i,a=e.radius*e.radius;if(r>a)return null;const s=Math.sqrt(a-r),o=i-s,l=i+s;return l<0?null:o<0?this.at(l,n):this.at(o,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,a,s,o,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(a=(e.min.y-h.y)*u,s=(e.max.y-h.y)*u):(a=(e.max.y-h.y)*u,s=(e.min.y-h.y)*u),i>s||a>r||((a>i||isNaN(i))&&(i=a),(s<r||isNaN(r))&&(r=s),f>=0?(o=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(o=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,Of)!==null}intersectTriangle(e,n,i,r,a){ok.subVectors(n,e),uw.subVectors(i,e),lk.crossVectors(ok,uw);let s=this.direction.dot(lk),o;if(s>0){if(r)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Gh.subVectors(this.origin,e);const l=o*this.direction.dot(uw.crossVectors(Gh,uw));if(l<0)return null;const c=o*this.direction.dot(ok.cross(Gh));if(c<0||l+c>s)return null;const u=-o*Gh.dot(lk);return u<0?null:this.at(u/s,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Ot{constructor(e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y){Ot.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y)}set(e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y){const p=this.elements;return p[0]=e,p[4]=n,p[8]=i,p[12]=r,p[1]=a,p[5]=s,p[9]=o,p[13]=l,p[2]=c,p[6]=u,p[10]=f,p[14]=h,p[3]=d,p[7]=g,p[11]=b,p[15]=y,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 Ot().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,i=e.elements,r=1/$g.setFromMatrixColumn(e,0).length(),a=1/$g.setFromMatrixColumn(e,1).length(),s=1/$g.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*a,n[5]=i[5]*a,n[6]=i[6]*a,n[7]=0,n[8]=i[8]*s,n[9]=i[9]*s,n[10]=i[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,a=e.z,s=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(a),f=Math.sin(a);if(e.order==="XYZ"){const h=s*u,d=s*f,g=o*u,b=o*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=d+g*c,n[5]=h-b*c,n[9]=-o*l,n[2]=b-h*c,n[6]=g+d*c,n[10]=s*l}else if(e.order==="YXZ"){const h=l*u,d=l*f,g=c*u,b=c*f;n[0]=h+b*o,n[4]=g*o-d,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-o,n[2]=d*o-g,n[6]=b+h*o,n[10]=s*l}else if(e.order==="ZXY"){const h=l*u,d=l*f,g=c*u,b=c*f;n[0]=h-b*o,n[4]=-s*f,n[8]=g+d*o,n[1]=d+g*o,n[5]=s*u,n[9]=b-h*o,n[2]=-s*c,n[6]=o,n[10]=s*l}else if(e.order==="ZYX"){const h=s*u,d=s*f,g=o*u,b=o*f;n[0]=l*u,n[4]=g*c-d,n[8]=h*c+b,n[1]=l*f,n[5]=b*c+h,n[9]=d*c-g,n[2]=-c,n[6]=o*l,n[10]=s*l}else if(e.order==="YZX"){const h=s*l,d=s*c,g=o*l,b=o*c;n[0]=l*u,n[4]=b-h*f,n[8]=g*f+d,n[1]=f,n[5]=s*u,n[9]=-o*u,n[2]=-c*u,n[6]=d*f+g,n[10]=h-b*f}else if(e.order==="XZY"){const h=s*l,d=s*c,g=o*l,b=o*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=h*f+b,n[5]=s*u,n[9]=d*f-g,n[2]=g*f-d,n[6]=o*u,n[10]=b*f+h}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(vbe,e,ybe)}lookAt(e,n,i){const r=this.elements;return ol.subVectors(e,n),ol.lengthSq()===0&&(ol.z=1),ol.normalize(),Wh.crossVectors(i,ol),Wh.lengthSq()===0&&(Math.abs(i.z)===1?ol.x+=1e-4:ol.z+=1e-4,ol.normalize(),Wh.crossVectors(i,ol)),Wh.normalize(),fw.crossVectors(ol,Wh),r[0]=Wh.x,r[4]=fw.x,r[8]=ol.x,r[1]=Wh.y,r[5]=fw.y,r[9]=ol.y,r[2]=Wh.z,r[6]=fw.z,r[10]=ol.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,a=this.elements,s=i[0],o=i[4],l=i[8],c=i[12],u=i[1],f=i[5],h=i[9],d=i[13],g=i[2],b=i[6],y=i[10],p=i[14],x=i[3],_=i[7],w=i[11],M=i[15],S=r[0],A=r[4],C=r[8],D=r[12],R=r[1],N=r[5],U=r[9],j=r[13],z=r[2],q=r[6],B=r[10],G=r[14],H=r[3],W=r[7],F=r[11],Y=r[15];return a[0]=s*S+o*R+l*z+c*H,a[4]=s*A+o*N+l*q+c*W,a[8]=s*C+o*U+l*B+c*F,a[12]=s*D+o*j+l*G+c*Y,a[1]=u*S+f*R+h*z+d*H,a[5]=u*A+f*N+h*q+d*W,a[9]=u*C+f*U+h*B+d*F,a[13]=u*D+f*j+h*G+d*Y,a[2]=g*S+b*R+y*z+p*H,a[6]=g*A+b*N+y*q+p*W,a[10]=g*C+b*U+y*B+p*F,a[14]=g*D+b*j+y*G+p*Y,a[3]=x*S+_*R+w*z+M*H,a[7]=x*A+_*N+w*q+M*W,a[11]=x*C+_*U+w*B+M*F,a[15]=x*D+_*j+w*G+M*Y,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],a=e[12],s=e[1],o=e[5],l=e[9],c=e[13],u=e[2],f=e[6],h=e[10],d=e[14],g=e[3],b=e[7],y=e[11],p=e[15];return g*(+a*l*f-r*c*f-a*o*h+i*c*h+r*o*d-i*l*d)+b*(+n*l*d-n*c*h+a*s*h-r*s*d+r*c*u-a*l*u)+y*(+n*c*f-n*o*d-a*s*f+i*s*d+a*o*u-i*c*u)+p*(-r*o*u-n*l*f+n*o*h+r*s*f-i*s*h+i*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],a=e[3],s=e[4],o=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],g=e[12],b=e[13],y=e[14],p=e[15],x=f*y*c-b*h*c+b*l*d-o*y*d-f*l*p+o*h*p,_=g*h*c-u*y*c-g*l*d+s*y*d+u*l*p-s*h*p,w=u*b*c-g*f*c+g*o*d-s*b*d-u*o*p+s*f*p,M=g*f*l-u*b*l-g*o*h+s*b*h+u*o*y-s*f*y,S=n*x+i*_+r*w+a*M;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/S;return e[0]=x*A,e[1]=(b*h*a-f*y*a-b*r*d+i*y*d+f*r*p-i*h*p)*A,e[2]=(o*y*a-b*l*a+b*r*c-i*y*c-o*r*p+i*l*p)*A,e[3]=(f*l*a-o*h*a-f*r*c+i*h*c+o*r*d-i*l*d)*A,e[4]=_*A,e[5]=(u*y*a-g*h*a+g*r*d-n*y*d-u*r*p+n*h*p)*A,e[6]=(g*l*a-s*y*a-g*r*c+n*y*c+s*r*p-n*l*p)*A,e[7]=(s*h*a-u*l*a+u*r*c-n*h*c-s*r*d+n*l*d)*A,e[8]=w*A,e[9]=(g*f*a-u*b*a-g*i*d+n*b*d+u*i*p-n*f*p)*A,e[10]=(s*b*a-g*o*a+g*i*c-n*b*c-s*i*p+n*o*p)*A,e[11]=(u*o*a-s*f*a-u*i*c+n*f*c+s*i*d-n*o*d)*A,e[12]=M*A,e[13]=(u*b*r-g*f*r+g*i*h-n*b*h-u*i*y+n*f*y)*A,e[14]=(g*o*r-s*b*r-g*i*l+n*b*l+s*i*y-n*o*y)*A,e[15]=(s*f*r-u*o*r+u*i*l-n*f*l-s*i*h+n*o*h)*A,this}scale(e){const n=this.elements,i=e.x,r=e.y,a=e.z;return n[0]*=i,n[4]*=r,n[8]*=a,n[1]*=i,n[5]*=r,n[9]*=a,n[2]*=i,n[6]*=r,n[10]*=a,n[3]*=i,n[7]*=r,n[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),a=1-i,s=e.x,o=e.y,l=e.z,c=a*s,u=a*o;return this.set(c*s+i,c*o-r*l,c*l+r*o,0,c*o+r*l,u*o+i,u*l-r*s,0,c*l-r*o,u*l+r*s,a*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,a,s){return this.set(1,i,a,0,e,1,s,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,a=n._x,s=n._y,o=n._z,l=n._w,c=a+a,u=s+s,f=o+o,h=a*c,d=a*u,g=a*f,b=s*u,y=s*f,p=o*f,x=l*c,_=l*u,w=l*f,M=i.x,S=i.y,A=i.z;return r[0]=(1-(b+p))*M,r[1]=(d+w)*M,r[2]=(g-_)*M,r[3]=0,r[4]=(d-w)*S,r[5]=(1-(h+p))*S,r[6]=(y+x)*S,r[7]=0,r[8]=(g+_)*A,r[9]=(y-x)*A,r[10]=(1-(h+b))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;let a=$g.set(r[0],r[1],r[2]).length();const s=$g.set(r[4],r[5],r[6]).length(),o=$g.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),e.x=r[12],e.y=r[13],e.z=r[14],jc.copy(this);const c=1/a,u=1/s,f=1/o;return jc.elements[0]*=c,jc.elements[1]*=c,jc.elements[2]*=c,jc.elements[4]*=u,jc.elements[5]*=u,jc.elements[6]*=u,jc.elements[8]*=f,jc.elements[9]*=f,jc.elements[10]*=f,n.setFromRotationMatrix(jc),i.x=a,i.y=s,i.z=o,this}makePerspective(e,n,i,r,a,s,o=gl,l=!1){const c=this.elements,u=2*a/(n-e),f=2*a/(i-r),h=(n+e)/(n-e),d=(i+r)/(i-r);let g,b;if(l)g=a/(s-a),b=s*a/(s-a);else if(o===gl)g=-(s+a)/(s-a),b=-2*s*a/(s-a);else if(o===tv)g=-s/(s-a),b=-s*a/(s-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=f,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=b,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,n,i,r,a,s,o=gl,l=!1){const c=this.elements,u=2/(n-e),f=2/(i-r),h=-(n+e)/(n-e),d=-(i+r)/(i-r);let g,b;if(l)g=1/(s-a),b=s/(s-a);else if(o===gl)g=-2/(s-a),b=-(s+a)/(s-a);else if(o===tv)g=-1/(s-a),b=-a/(s-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=h,c[1]=0,c[5]=f,c[9]=0,c[13]=d,c[2]=0,c[6]=0,c[10]=g,c[14]=b,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const $g=new te,jc=new Ot,vbe=new te(0,0,0),ybe=new te(1,1,1),Wh=new te,fw=new te,ol=new te,Lz=new Ot,Pz=new Vn;class mi{constructor(e=0,n=0,i=0,r=mi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,a=r[0],s=r[4],o=r[8],l=r[1],c=r[5],u=r[9],f=r[2],h=r[6],d=r[10];switch(n){case"XYZ":this._y=Math.asin(Ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ln(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,a),this._z=0);break;case"ZXY":this._x=Math.asin(Ln(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-Ln(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(Ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,a)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-Ln(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return Lz.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Lz,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return Pz.setFromEuler(this),this.setFromQuaternion(Pz,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}mi.DEFAULT_ORDER="XYZ";class iv{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let xbe=0;const Uz=new te,Zg=new Vn,If=new Ot,hw=new te,Fy=new te,_be=new te,Sbe=new Vn,Fz=new te(1,0,0),Bz=new te(0,1,0),zz=new te(0,0,1),jz={type:"added"},wbe={type:"removed"},Qg={type:"childadded",child:null},ck={type:"childremoved",child:null};class Ni extends df{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:xbe++}),this.uuid=wl(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ni.DEFAULT_UP.clone();const e=new te,n=new mi,i=new Vn,r=new te(1,1,1);function a(){i.setFromEuler(n,!1)}function s(){n.setFromQuaternion(i,void 0,!1)}n._onChange(a),i._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Ot},normalMatrix:{value:new Kn}}),this.matrix=new Ot,this.matrixWorld=new Ot,this.matrixAutoUpdate=Ni.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Ni.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new iv,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return Zg.setFromAxisAngle(e,n),this.quaternion.multiply(Zg),this}rotateOnWorldAxis(e,n){return Zg.setFromAxisAngle(e,n),this.quaternion.premultiply(Zg),this}rotateX(e){return this.rotateOnAxis(Fz,e)}rotateY(e){return this.rotateOnAxis(Bz,e)}rotateZ(e){return this.rotateOnAxis(zz,e)}translateOnAxis(e,n){return Uz.copy(e).applyQuaternion(this.quaternion),this.position.add(Uz.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(Fz,e)}translateY(e){return this.translateOnAxis(Bz,e)}translateZ(e){return this.translateOnAxis(zz,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(If.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?hw.copy(e):hw.set(e,n,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Fy.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?If.lookAt(Fy,hw,this.up):If.lookAt(hw,Fy,this.up),this.quaternion.setFromRotationMatrix(If),r&&(If.extractRotation(r.matrixWorld),Zg.setFromRotationMatrix(If),this.quaternion.premultiply(Zg.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(jz),Qg.child=e,this.dispatchEvent(Qg),Qg.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(wbe),ck.child=e,this.dispatchEvent(ck),ck.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),If.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),If.multiply(e.parent.matrixWorld)),e.applyMatrix4(If),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(jz),Qg.child=e,this.dispatchEvent(Qg),Qg.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,r=this.children.length;i<r;i++){const s=this.children[i].getObjectByProperty(e,n);if(s!==void 0)return s}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);const r=this.children;for(let a=0,s=r.length;a<s;a++)r[a].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fy,e,_be),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fy,Sbe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){const r=this.children;for(let a=0,s=r.length;a<s;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const f=l[c];a(e.shapes,f)}else a(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(a(e.materials,this.material[l]));r.material=o}else r.material=a(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(a(e.animations,l))}}if(n){const o=s(e.geometries),l=s(e.materials),c=s(e.textures),u=s(e.images),f=s(e.shapes),h=s(e.skeletons),d=s(e.animations),g=s(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),d.length>0&&(i.animations=d),g.length>0&&(i.nodes=g)}return i.object=r,i;function s(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}Ni.DEFAULT_UP=new te(0,1,0);Ni.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ni.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Hc=new te,Nf=new te,uk=new te,Lf=new te,eb=new te,tb=new te,Hz=new te,fk=new te,hk=new te,dk=new te,pk=new ei,mk=new ei,gk=new ei;class Fo{constructor(e=new te,n=new te,i=new te){this.a=e,this.b=n,this.c=i}static getNormal(e,n,i,r){r.subVectors(i,n),Hc.subVectors(e,n),r.cross(Hc);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(e,n,i,r,a){Hc.subVectors(r,n),Nf.subVectors(i,n),uk.subVectors(e,n);const s=Hc.dot(Hc),o=Hc.dot(Nf),l=Hc.dot(uk),c=Nf.dot(Nf),u=Nf.dot(uk),f=s*c-o*o;if(f===0)return a.set(0,0,0),null;const h=1/f,d=(c*l-o*u)*h,g=(s*u-o*l)*h;return a.set(1-d-g,g,d)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,Lf)===null?!1:Lf.x>=0&&Lf.y>=0&&Lf.x+Lf.y<=1}static getInterpolation(e,n,i,r,a,s,o,l){return this.getBarycoord(e,n,i,r,Lf)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(a,Lf.x),l.addScaledVector(s,Lf.y),l.addScaledVector(o,Lf.z),l)}static getInterpolatedAttribute(e,n,i,r,a,s){return pk.setScalar(0),mk.setScalar(0),gk.setScalar(0),pk.fromBufferAttribute(e,n),mk.fromBufferAttribute(e,i),gk.fromBufferAttribute(e,r),s.setScalar(0),s.addScaledVector(pk,a.x),s.addScaledVector(mk,a.y),s.addScaledVector(gk,a.z),s}static isFrontFacing(e,n,i,r){return Hc.subVectors(i,n),Nf.subVectors(e,n),Hc.cross(Nf).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Hc.subVectors(this.c,this.b),Nf.subVectors(this.a,this.b),Hc.cross(Nf).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Fo.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Fo.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,a){return Fo.getInterpolation(e,this.a,this.b,this.c,n,i,r,a)}containsPoint(e){return Fo.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Fo.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,a=this.c;let s,o;eb.subVectors(r,i),tb.subVectors(a,i),fk.subVectors(e,i);const l=eb.dot(fk),c=tb.dot(fk);if(l<=0&&c<=0)return n.copy(i);hk.subVectors(e,r);const u=eb.dot(hk),f=tb.dot(hk);if(u>=0&&f<=u)return n.copy(r);const h=l*f-u*c;if(h<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(i).addScaledVector(eb,s);dk.subVectors(e,a);const d=eb.dot(dk),g=tb.dot(dk);if(g>=0&&d<=g)return n.copy(a);const b=d*c-l*g;if(b<=0&&c>=0&&g<=0)return o=c/(c-g),n.copy(i).addScaledVector(tb,o);const y=u*g-d*f;if(y<=0&&f-u>=0&&d-g>=0)return Hz.subVectors(a,r),o=(f-u)/(f-u+(d-g)),n.copy(r).addScaledVector(Hz,o);const p=1/(y+b+h);return s=b*p,o=h*p,n.copy(i).addScaledVector(eb,s).addScaledVector(tb,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const zJ={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},qh={h:0,s:0,l:0},dw={h:0,s:0,l:0};function bk(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let Ut=class{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Es){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,pi.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=pi.workingColorSpace){return this.r=e,this.g=n,this.b=i,pi.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=pi.workingColorSpace){if(e=BP(e,1),n=Ln(n,0,1),i=Ln(i,0,1),n===0)this.r=this.g=this.b=i;else{const a=i<=.5?i*(1+n):i+n-i*n,s=2*i-a;this.r=bk(s,a,e+1/3),this.g=bk(s,a,e),this.b=bk(s,a,e-1/3)}return pi.colorSpaceToWorking(this,r),this}setStyle(e,n=Es){function i(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const s=r[1],o=r[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,n);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,n);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=r[1],s=a.length;if(s===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(a,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Es){const i=zJ[e.toLowerCase()];return i!==void 0?this.setHex(i,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ih(e.r),this.g=ih(e.g),this.b=ih(e.b),this}copyLinearToSRGB(e){return this.r=y0(e.r),this.g=y0(e.g),this.b=y0(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Es){return pi.workingToColorSpace($s.copy(this),e),Math.round(Ln($s.r*255,0,255))*65536+Math.round(Ln($s.g*255,0,255))*256+Math.round(Ln($s.b*255,0,255))}getHexString(e=Es){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=pi.workingColorSpace){pi.workingToColorSpace($s.copy(this),n);const i=$s.r,r=$s.g,a=$s.b,s=Math.max(i,r,a),o=Math.min(i,r,a);let l,c;const u=(o+s)/2;if(o===s)l=0,c=0;else{const f=s-o;switch(c=u<=.5?f/(s+o):f/(2-s-o),s){case i:l=(r-a)/f+(r<a?6:0);break;case r:l=(a-i)/f+2;break;case a:l=(i-r)/f+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,n=pi.workingColorSpace){return pi.workingToColorSpace($s.copy(this),n),e.r=$s.r,e.g=$s.g,e.b=$s.b,e}getStyle(e=Es){pi.workingToColorSpace($s.copy(this),e);const n=$s.r,i=$s.g,r=$s.b;return e!==Es?`color(${e} ${n.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,n,i){return this.getHSL(qh),this.setHSL(qh.h+e,qh.s+n,qh.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,i){return this.r=e.r+(n.r-e.r)*i,this.g=e.g+(n.g-e.g)*i,this.b=e.b+(n.b-e.b)*i,this}lerpHSL(e,n){this.getHSL(qh),e.getHSL(dw);const i=n1(qh.h,dw.h,n),r=n1(qh.s,dw.s,n),a=n1(qh.l,dw.l,n);return this.setHSL(i,r,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,i=this.g,r=this.b,a=e.elements;return this.r=a[0]*n+a[3]*i+a[6]*r,this.g=a[1]*n+a[4]*i+a[7]*r,this.b=a[2]*n+a[5]*i+a[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const $s=new Ut;Ut.NAMES=zJ;let Ebe=0;class ka extends df{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Ebe++}),this.uuid=wl(),this.name="",this.type="Material",this.blending=Tm,this.side=gu,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=p2,this.blendDst=m2,this.blendEquation=md,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ut(0,0,0),this.blendAlpha=0,this.depthFunc=zm,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=KO,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=qp,this.stencilZFail=qp,this.stencilZPass=qp,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.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Tm&&(i.blending=this.blending),this.side!==gu&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==p2&&(i.blendSrc=this.blendSrc),this.blendDst!==m2&&(i.blendDst=this.blendDst),this.blendEquation!==md&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==zm&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==KO&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==qp&&(i.stencilFail=this.stencilFail),this.stencilZFail!==qp&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==qp&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(a){const s=[];for(const o in a){const l=a[o];delete l.metadata,s.push(l)}return s}if(n){const a=r(e.textures),s=r(e.images);a.length>0&&(i.textures=a),s.length>0&&(i.images=s)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let a=0;a!==r;++a)i[a]=n[a].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Cs extends ka{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ut(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.envMapRotation=new mi,this.combine=L_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Hf=Mbe();function Mbe(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const a=new Uint32Array(2048),s=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;!(c&8388608);)c<<=1,u-=8388608;c&=-8388609,u+=947912704,a[l]=c|u}for(let l=1024;l<2048;++l)a[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:a,exponentTable:s,offsetTable:o}}function Io(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Ln(t,-65504,65504),Hf.floatView[0]=t;const e=Hf.uint32View[0],n=e>>23&511;return Hf.baseTable[n]+((e&8388607)>>Hf.shiftTable[n])}function Ex(t){const e=t>>10;return Hf.uint32View[0]=Hf.mantissaTable[Hf.offsetTable[e]+(t&1023)]+Hf.exponentTable[e],Hf.floatView[0]}class om{static toHalfFloat(e){return Io(e)}static fromHalfFloat(e){return Ex(e)}}const wa=new te,pw=new wt;let Tbe=0;class Nn{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Tbe++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=H1,this.updateRanges=[],this.gpuType=yr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,a=this.itemSize;r<a;r++)this.array[e+r]=n.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,i=this.count;n<i;n++)pw.fromBufferAttribute(this,n),pw.applyMatrix3(e),this.setXY(n,pw.x,pw.y);else if(this.itemSize===3)for(let n=0,i=this.count;n<i;n++)wa.fromBufferAttribute(this,n),wa.applyMatrix3(e),this.setXYZ(n,wa.x,wa.y,wa.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)wa.fromBufferAttribute(this,n),wa.applyMatrix4(e),this.setXYZ(n,wa.x,wa.y,wa.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)wa.fromBufferAttribute(this,n),wa.applyNormalMatrix(e),this.setXYZ(n,wa.x,wa.y,wa.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)wa.fromBufferAttribute(this,n),wa.transformDirection(e),this.setXYZ(n,wa.x,wa.y,wa.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let i=this.array[e*this.itemSize+n];return this.normalized&&(i=So(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=Qn(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=So(n,this.array)),n}setX(e,n){return this.normalized&&(n=Qn(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=So(n,this.array)),n}setY(e,n){return this.normalized&&(n=Qn(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=So(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Qn(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=So(n,this.array)),n}setW(e,n){return this.normalized&&(n=Qn(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array)),this.array[e+0]=n,this.array[e+1]=i,this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array),r=Qn(r,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,n,i,r,a){return e*=this.itemSize,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array),r=Qn(r,this.array),a=Qn(a,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==H1&&(e.usage=this.usage),e}}class Abe extends Nn{constructor(e,n,i){super(new Int8Array(e),n,i)}}class Cbe extends Nn{constructor(e,n,i){super(new Uint8Array(e),n,i)}}class Rbe extends Nn{constructor(e,n,i){super(new Uint8ClampedArray(e),n,i)}}class kbe extends Nn{constructor(e,n,i){super(new Int16Array(e),n,i)}}class jP extends Nn{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class Dbe extends Nn{constructor(e,n,i){super(new Int32Array(e),n,i)}}class HP extends Nn{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class jJ extends Nn{constructor(e,n,i){super(new Uint16Array(e),n,i),this.isFloat16BufferAttribute=!0}getX(e){let n=Ex(this.array[e*this.itemSize]);return this.normalized&&(n=So(n,this.array)),n}setX(e,n){return this.normalized&&(n=Qn(n,this.array)),this.array[e*this.itemSize]=Io(n),this}getY(e){let n=Ex(this.array[e*this.itemSize+1]);return this.normalized&&(n=So(n,this.array)),n}setY(e,n){return this.normalized&&(n=Qn(n,this.array)),this.array[e*this.itemSize+1]=Io(n),this}getZ(e){let n=Ex(this.array[e*this.itemSize+2]);return this.normalized&&(n=So(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Qn(n,this.array)),this.array[e*this.itemSize+2]=Io(n),this}getW(e){let n=Ex(this.array[e*this.itemSize+3]);return this.normalized&&(n=So(n,this.array)),n}setW(e,n){return this.normalized&&(n=Qn(n,this.array)),this.array[e*this.itemSize+3]=Io(n),this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array)),this.array[e+0]=Io(n),this.array[e+1]=Io(i),this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array),r=Qn(r,this.array)),this.array[e+0]=Io(n),this.array[e+1]=Io(i),this.array[e+2]=Io(r),this}setXYZW(e,n,i,r,a){return e*=this.itemSize,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array),r=Qn(r,this.array),a=Qn(a,this.array)),this.array[e+0]=Io(n),this.array[e+1]=Io(i),this.array[e+2]=Io(r),this.array[e+3]=Io(a),this}}class fn extends Nn{constructor(e,n,i){super(new Float32Array(e),n,i)}}let Obe=0;const Gl=new Ot,vk=new Ni,nb=new te,ll=new rr,By=new rr,Ya=new te;class Dn extends df{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Obe++}),this.uuid=wl(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(UJ(e)?HP:jP)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,i=0){this.groups.push({start:e,count:n,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const a=new Kn().getNormalMatrix(e);i.applyNormalMatrix(a),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Gl.makeRotationFromQuaternion(e),this.applyMatrix4(Gl),this}rotateX(e){return Gl.makeRotationX(e),this.applyMatrix4(Gl),this}rotateY(e){return Gl.makeRotationY(e),this.applyMatrix4(Gl),this}rotateZ(e){return Gl.makeRotationZ(e),this.applyMatrix4(Gl),this}translate(e,n,i){return Gl.makeTranslation(e,n,i),this.applyMatrix4(Gl),this}scale(e,n,i){return Gl.makeScale(e,n,i),this.applyMatrix4(Gl),this}lookAt(e){return vk.lookAt(e),vk.updateMatrix(),this.applyMatrix4(vk.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(nb).negate(),this.translate(nb.x,nb.y,nb.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const i=[];for(let r=0,a=e.length;r<a;r++){const s=e[r];i.push(s.x,s.y,s.z||0)}this.setAttribute("position",new fn(i,3))}else{const i=Math.min(e.length,n.count);for(let r=0;r<i;r++){const a=e[r];n.setXYZ(r,a.x,a.y,a.z||0)}e.length>n.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new te(-1/0,-1/0,-1/0),new te(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i<r;i++){const a=n[i];ll.setFromBufferAttribute(a),this.morphTargetsRelative?(Ya.addVectors(this.boundingBox.min,ll.min),this.boundingBox.expandByPoint(Ya),Ya.addVectors(this.boundingBox.max,ll.max),this.boundingBox.expandByPoint(Ya)):(this.boundingBox.expandByPoint(ll.min),this.boundingBox.expandByPoint(ll.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ir);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new te,1/0);return}if(e){const i=this.boundingSphere.center;if(ll.setFromBufferAttribute(e),n)for(let a=0,s=n.length;a<s;a++){const o=n[a];By.setFromBufferAttribute(o),this.morphTargetsRelative?(Ya.addVectors(ll.min,By.min),ll.expandByPoint(Ya),Ya.addVectors(ll.max,By.max),ll.expandByPoint(Ya)):(ll.expandByPoint(By.min),ll.expandByPoint(By.max))}ll.getCenter(i);let r=0;for(let a=0,s=e.count;a<s;a++)Ya.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(Ya));if(n)for(let a=0,s=n.length;a<s;a++){const o=n[a],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)Ya.fromBufferAttribute(o,c),l&&(nb.fromBufferAttribute(e,c),Ya.add(nb)),r=Math.max(r,i.distanceToSquared(Ya))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=n.position,r=n.normal,a=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Nn(new Float32Array(4*i.count),4));const s=this.getAttribute("tangent"),o=[],l=[];for(let C=0;C<i.count;C++)o[C]=new te,l[C]=new te;const c=new te,u=new te,f=new te,h=new wt,d=new wt,g=new wt,b=new te,y=new te;function p(C,D,R){c.fromBufferAttribute(i,C),u.fromBufferAttribute(i,D),f.fromBufferAttribute(i,R),h.fromBufferAttribute(a,C),d.fromBufferAttribute(a,D),g.fromBufferAttribute(a,R),u.sub(c),f.sub(c),d.sub(h),g.sub(h);const N=1/(d.x*g.y-g.x*d.y);isFinite(N)&&(b.copy(u).multiplyScalar(g.y).addScaledVector(f,-d.y).multiplyScalar(N),y.copy(f).multiplyScalar(d.x).addScaledVector(u,-g.x).multiplyScalar(N),o[C].add(b),o[D].add(b),o[R].add(b),l[C].add(y),l[D].add(y),l[R].add(y))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let C=0,D=x.length;C<D;++C){const R=x[C],N=R.start,U=R.count;for(let j=N,z=N+U;j<z;j+=3)p(e.getX(j+0),e.getX(j+1),e.getX(j+2))}const _=new te,w=new te,M=new te,S=new te;function A(C){M.fromBufferAttribute(r,C),S.copy(M);const D=o[C];_.copy(D),_.sub(M.multiplyScalar(M.dot(D))).normalize(),w.crossVectors(S,D);const N=w.dot(l[C])<0?-1:1;s.setXYZW(C,_.x,_.y,_.z,N)}for(let C=0,D=x.length;C<D;++C){const R=x[C],N=R.start,U=R.count;for(let j=N,z=N+U;j<z;j+=3)A(e.getX(j+0)),A(e.getX(j+1)),A(e.getX(j+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new Nn(new Float32Array(n.count*3),3),this.setAttribute("normal",i);else for(let h=0,d=i.count;h<d;h++)i.setXYZ(h,0,0,0);const r=new te,a=new te,s=new te,o=new te,l=new te,c=new te,u=new te,f=new te;if(e)for(let h=0,d=e.count;h<d;h+=3){const g=e.getX(h+0),b=e.getX(h+1),y=e.getX(h+2);r.fromBufferAttribute(n,g),a.fromBufferAttribute(n,b),s.fromBufferAttribute(n,y),u.subVectors(s,a),f.subVectors(r,a),u.cross(f),o.fromBufferAttribute(i,g),l.fromBufferAttribute(i,b),c.fromBufferAttribute(i,y),o.add(u),l.add(u),c.add(u),i.setXYZ(g,o.x,o.y,o.z),i.setXYZ(b,l.x,l.y,l.z),i.setXYZ(y,c.x,c.y,c.z)}else for(let h=0,d=n.count;h<d;h+=3)r.fromBufferAttribute(n,h+0),a.fromBufferAttribute(n,h+1),s.fromBufferAttribute(n,h+2),u.subVectors(s,a),f.subVectors(r,a),u.cross(f),i.setXYZ(h+0,u.x,u.y,u.z),i.setXYZ(h+1,u.x,u.y,u.z),i.setXYZ(h+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,i=e.count;n<i;n++)Ya.fromBufferAttribute(e,n),Ya.normalize(),e.setXYZ(n,Ya.x,Ya.y,Ya.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,f=o.normalized,h=new c.constructor(l.length*u);let d=0,g=0;for(let b=0,y=l.length;b<y;b++){o.isInterleavedBufferAttribute?d=l[b]*o.data.stride+o.offset:d=l[b]*u;for(let p=0;p<u;p++)h[g++]=c[d++]}return new Nn(h,u,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new Dn,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,i);n.setAttribute(o,c)}const a=this.morphAttributes;for(const o in a){const l=[],c=a[o];for(let u=0,f=c.length;u<f;u++){const h=c[u],d=e(h,i);l.push(d)}n.morphAttributes[o]=l}n.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let o=0,l=s.length;o<l;o++){const c=s[o];n.addGroup(c.start,c.count,c.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let a=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,h=c.length;f<h;f++){const d=c[f];u.push(d.toJSON(e.data))}u.length>0&&(r[l]=u,a=!0)}a&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const a=e.morphAttributes;for(const c in a){const u=[],f=a[c];for(let h=0,d=f.length;h<d;h++)u.push(f[h].clone(n));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let c=0,u=s.length;c<u;c++){const f=s[c];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Vz=new Ot,_p=new pf,mw=new Ir,Gz=new te,gw=new te,bw=new te,vw=new te,yk=new te,yw=new te,Wz=new te,xw=new te;class _i extends Ni{constructor(e=new Dn,n=new Cs){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=r.length;a<s;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}getVertexPosition(e,n){const i=this.geometry,r=i.attributes.position,a=i.morphAttributes.position,s=i.morphTargetsRelative;n.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(a&&o){yw.set(0,0,0);for(let l=0,c=a.length;l<c;l++){const u=o[l],f=a[l];u!==0&&(yk.fromBufferAttribute(f,e),s?yw.addScaledVector(yk,u):yw.addScaledVector(yk.sub(n),u))}n.add(yw)}return n}raycast(e,n){const i=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),mw.copy(i.boundingSphere),mw.applyMatrix4(a),_p.copy(e.ray).recast(e.near),!(mw.containsPoint(_p.origin)===!1&&(_p.intersectSphere(mw,Gz)===null||_p.origin.distanceToSquared(Gz)>(e.far-e.near)**2))&&(Vz.copy(a).invert(),_p.copy(e.ray).applyMatrix4(Vz),!(i.boundingBox!==null&&_p.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,_p)))}_computeIntersections(e,n,i){let r;const a=this.geometry,s=this.material,o=a.index,l=a.attributes.position,c=a.attributes.uv,u=a.attributes.uv1,f=a.attributes.normal,h=a.groups,d=a.drawRange;if(o!==null)if(Array.isArray(s))for(let g=0,b=h.length;g<b;g++){const y=h[g],p=s[y.materialIndex],x=Math.max(y.start,d.start),_=Math.min(o.count,Math.min(y.start+y.count,d.start+d.count));for(let w=x,M=_;w<M;w+=3){const S=o.getX(w),A=o.getX(w+1),C=o.getX(w+2);r=_w(this,p,e,i,c,u,f,S,A,C),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const g=Math.max(0,d.start),b=Math.min(o.count,d.start+d.count);for(let y=g,p=b;y<p;y+=3){const x=o.getX(y),_=o.getX(y+1),w=o.getX(y+2);r=_w(this,s,e,i,c,u,f,x,_,w),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}else if(l!==void 0)if(Array.isArray(s))for(let g=0,b=h.length;g<b;g++){const y=h[g],p=s[y.materialIndex],x=Math.max(y.start,d.start),_=Math.min(l.count,Math.min(y.start+y.count,d.start+d.count));for(let w=x,M=_;w<M;w+=3){const S=w,A=w+1,C=w+2;r=_w(this,p,e,i,c,u,f,S,A,C),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=y.materialIndex,n.push(r))}}else{const g=Math.max(0,d.start),b=Math.min(l.count,d.start+d.count);for(let y=g,p=b;y<p;y+=3){const x=y,_=y+1,w=y+2;r=_w(this,s,e,i,c,u,f,x,_,w),r&&(r.faceIndex=Math.floor(y/3),n.push(r))}}}}function Ibe(t,e,n,i,r,a,s,o){let l;if(e.side===Ra?l=i.intersectTriangle(s,a,r,!0,o):l=i.intersectTriangle(r,a,s,e.side===gu,o),l===null)return null;xw.copy(o),xw.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(xw);return c<n.near||c>n.far?null:{distance:c,point:xw.clone(),object:t}}function _w(t,e,n,i,r,a,s,o,l,c){t.getVertexPosition(o,gw),t.getVertexPosition(l,bw),t.getVertexPosition(c,vw);const u=Ibe(t,e,n,i,gw,bw,vw,Wz);if(u){const f=new te;Fo.getBarycoord(Wz,gw,bw,vw,f),r&&(u.uv=Fo.getInterpolatedAttribute(r,o,l,c,f,new wt)),a&&(u.uv1=Fo.getInterpolatedAttribute(a,o,l,c,f,new wt)),s&&(u.normal=Fo.getInterpolatedAttribute(s,o,l,c,f,new te),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const h={a:o,b:l,c,normal:new te,materialIndex:0};Fo.getNormal(gw,bw,vw,h.normal),u.face=h,u.barycoord=f}return u}class Xd extends Dn{constructor(e=1,n=1,i=1,r=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:s};const o=this;r=Math.floor(r),a=Math.floor(a),s=Math.floor(s);const l=[],c=[],u=[],f=[];let h=0,d=0;g("z","y","x",-1,-1,i,n,e,s,a,0),g("z","y","x",1,-1,i,n,-e,s,a,1),g("x","z","y",1,1,e,i,n,r,s,2),g("x","z","y",1,-1,e,i,-n,r,s,3),g("x","y","z",1,-1,e,n,i,r,a,4),g("x","y","z",-1,-1,e,n,-i,r,a,5),this.setIndex(l),this.setAttribute("position",new fn(c,3)),this.setAttribute("normal",new fn(u,3)),this.setAttribute("uv",new fn(f,2));function g(b,y,p,x,_,w,M,S,A,C,D){const R=w/A,N=M/C,U=w/2,j=M/2,z=S/2,q=A+1,B=C+1;let G=0,H=0;const W=new te;for(let F=0;F<B;F++){const Y=F*N-j;for(let Z=0;Z<q;Z++){const V=Z*R-U;W[b]=V*x,W[y]=Y*_,W[p]=z,c.push(W.x,W.y,W.z),W[b]=0,W[y]=0,W[p]=S>0?1:-1,u.push(W.x,W.y,W.z),f.push(Z/A),f.push(1-F/C),G+=1}}for(let F=0;F<C;F++)for(let Y=0;Y<A;Y++){const Z=h+Y+q*F,V=h+Y+q*(F+1),de=h+(Y+1)+q*(F+1),se=h+(Y+1)+q*F;l.push(Z,V,se),l.push(V,de,se),H+=6}o.addGroup(d,H,D),d+=H,h+=G}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Xd(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function rv(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function bo(t){const e={};for(let n=0;n<t.length;n++){const i=rv(t[n]);for(const r in i)e[r]=i[r]}return e}function Nbe(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function HJ(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:pi.workingColorSpace}const av={clone:rv,merge:bo};var Lbe=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,Pbe=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class ss extends ka{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Lbe,this.fragmentShader=Pbe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=rv(e.uniforms),this.uniformsGroups=Nbe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const r in this.uniforms){const s=this.uniforms[r].value;s&&s.isTexture?n.uniforms[r]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?n.uniforms[r]={type:"c",value:s.getHex()}:s&&s.isVector2?n.uniforms[r]={type:"v2",value:s.toArray()}:s&&s.isVector3?n.uniforms[r]={type:"v3",value:s.toArray()}:s&&s.isVector4?n.uniforms[r]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?n.uniforms[r]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?n.uniforms[r]={type:"m4",value:s.toArray()}:n.uniforms[r]={value:s}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class GA extends Ni{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ot,this.projectionMatrix=new Ot,this.projectionMatrixInverse=new Ot,this.coordinateSystem=gl,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Xh=new te,qz=new wt,Xz=new wt;class ta extends GA{constructor(e=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=nv*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Am*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return nv*2*Math.atan(Math.tan(Am*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,i){Xh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Xh.x,Xh.y).multiplyScalar(-e/Xh.z),Xh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Xh.x,Xh.y).multiplyScalar(-e/Xh.z)}getViewSize(e,n){return this.getViewBounds(e,qz,Xz),n.subVectors(Xz,qz)}setViewOffset(e,n,i,r,a,s){this.aspect=e/n,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=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Am*.5*this.fov)/this.zoom,i=2*n,r=this.aspect*i,a=-.5*r;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;a+=s.offsetX*r/l,n-=s.offsetY*i/c,r*=s.width/l,i*=s.height/c}const o=this.filmOffset;o!==0&&(a+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,n,n-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const ib=-90,rb=1;class VJ extends Ni{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new ta(ib,rb,e,n);r.layers=this.layers,this.add(r);const a=new ta(ib,rb,e,n);a.layers=this.layers,this.add(a);const s=new ta(ib,rb,e,n);s.layers=this.layers,this.add(s);const o=new ta(ib,rb,e,n);o.layers=this.layers,this.add(o);const l=new ta(ib,rb,e,n);l.layers=this.layers,this.add(l);const c=new ta(ib,rb,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,r,a,s,o,l]=n;for(const c of n)this.remove(c);if(e===gl)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===tv)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,s,o,l,c,u]=this.children,f=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const b=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(n,a),e.setRenderTarget(i,1,r),e.render(n,s),e.setRenderTarget(i,2,r),e.render(n,o),e.setRenderTarget(i,3,r),e.render(n,l),e.setRenderTarget(i,4,r),e.render(n,c),i.texture.generateMipmaps=b,e.setRenderTarget(i,5,r),e.render(n,u),e.setRenderTarget(f,h,d),e.xr.enabled=g,i.texture.needsPMREMUpdate=!0}}class U_ extends nr{constructor(e=[],n=sf,i,r,a,s,o,l,c,u){super(e,n,i,r,a,s,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class VP extends Ec{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new U_(r),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:`

				varying vec3 vWorldDirection;

				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {

					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

				}

				void main() {

					vWorldDirection = transformDirection( position, modelMatrix );

					#include <begin_vertex>
					#include <project_vertex>

				}
			`,fragmentShader:`

				uniform sampler2D tEquirect;

				varying vec3 vWorldDirection;

				#include <common>

				void main() {

					vec3 direction = normalize( vWorldDirection );

					vec2 sampleUV = equirectUv( direction );

					gl_FragColor = texture2D( tEquirect, sampleUV );

				}
			`},r=new Xd(5,5,5),a=new ss({name:"CubemapFromEquirect",uniforms:rv(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Ra,blending:Zu});a.uniforms.tEquirect.value=n;const s=new _i(r,a),o=n.minFilter;return n.minFilter===mc&&(n.minFilter=Hi),new VJ(1,10,this).update(e,s),n.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(e,n=!0,i=!0,r=!0){const a=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,i,r);e.setRenderTarget(a)}}class bl extends Ni{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Ube={type:"move"};class hM{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new bl,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 bl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new bl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,i){let r=null,a=null,s=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){s=!0;for(const b of e.hand.values()){const y=n.getJointPose(b,i),p=this._getHandJoint(c,b);y!==null&&(p.matrix.fromArray(y.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=y.radius),p.visible=y!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=u.position.distanceTo(f.position),d=.02,g=.005;c.inputState.pinching&&h>d+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=d-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(a=n.getPose(e.gripSpace,i),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&a!==null&&(r=a),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Ube)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=a!==null),c!==null&&(c.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new bl;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class WA{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ut(e),this.density=n}clone(){return new WA(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class qA{constructor(e,n=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ut(e),this.near=n,this.far=i}clone(){return new qA(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Hv extends Ni{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new mi,this.environmentIntensity=1,this.environmentRotation=new mi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class F_{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=H1,this.updateRanges=[],this.version=0,this.uuid=wl()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,i){e*=this.stride,i*=n.stride;for(let r=0,a=this.stride;r<a;r++)this.array[e+r]=n.array[i+r];return this}set(e,n=0){return this.array.set(e,n),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=wl()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const n=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(n,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=wl()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const mo=new te;class Bo{constructor(e,n,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=n,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let n=0,i=this.data.count;n<i;n++)mo.fromBufferAttribute(this,n),mo.applyMatrix4(e),this.setXYZ(n,mo.x,mo.y,mo.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)mo.fromBufferAttribute(this,n),mo.applyNormalMatrix(e),this.setXYZ(n,mo.x,mo.y,mo.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)mo.fromBufferAttribute(this,n),mo.transformDirection(e),this.setXYZ(n,mo.x,mo.y,mo.z);return this}getComponent(e,n){let i=this.array[e*this.data.stride+this.offset+n];return this.normalized&&(i=So(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=Qn(i,this.array)),this.data.array[e*this.data.stride+this.offset+n]=i,this}setX(e,n){return this.normalized&&(n=Qn(n,this.array)),this.data.array[e*this.data.stride+this.offset]=n,this}setY(e,n){return this.normalized&&(n=Qn(n,this.array)),this.data.array[e*this.data.stride+this.offset+1]=n,this}setZ(e,n){return this.normalized&&(n=Qn(n,this.array)),this.data.array[e*this.data.stride+this.offset+2]=n,this}setW(e,n){return this.normalized&&(n=Qn(n,this.array)),this.data.array[e*this.data.stride+this.offset+3]=n,this}getX(e){let n=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(n=So(n,this.array)),n}getY(e){let n=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(n=So(n,this.array)),n}getZ(e){let n=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(n=So(n,this.array)),n}getW(e){let n=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(n=So(n,this.array)),n}setXY(e,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this}setXYZ(e,n,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array),r=Qn(r,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,n,i,r,a){return e=e*this.data.stride+this.offset,this.normalized&&(n=Qn(n,this.array),i=Qn(i,this.array),r=Qn(r,this.array),a=Qn(a,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=a,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)n.push(this.data.array[r+a])}return new Nn(new this.array.constructor(n),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Bo(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)n.push(this.data.array[r+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:n,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class GP extends ka{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ut(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let ab;const zy=new te,sb=new te,ob=new te,lb=new wt,jy=new wt,GJ=new Ot,Sw=new te,Hy=new te,ww=new te,Kz=new wt,xk=new wt,Yz=new wt;class WJ extends Ni{constructor(e=new GP){if(super(),this.isSprite=!0,this.type="Sprite",ab===void 0){ab=new Dn;const n=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new F_(n,5);ab.setIndex([0,1,2,0,2,3]),ab.setAttribute("position",new Bo(i,3,0,!1)),ab.setAttribute("uv",new Bo(i,2,3,!1))}this.geometry=ab,this.material=e,this.center=new wt(.5,.5),this.count=1}raycast(e,n){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),sb.setFromMatrixScale(this.matrixWorld),GJ.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ob.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&sb.multiplyScalar(-ob.z);const i=this.material.rotation;let r,a;i!==0&&(a=Math.cos(i),r=Math.sin(i));const s=this.center;Ew(Sw.set(-.5,-.5,0),ob,s,sb,r,a),Ew(Hy.set(.5,-.5,0),ob,s,sb,r,a),Ew(ww.set(.5,.5,0),ob,s,sb,r,a),Kz.set(0,0),xk.set(1,0),Yz.set(1,1);let o=e.ray.intersectTriangle(Sw,Hy,ww,!1,zy);if(o===null&&(Ew(Hy.set(-.5,.5,0),ob,s,sb,r,a),xk.set(0,1),o=e.ray.intersectTriangle(Sw,ww,Hy,!1,zy),o===null))return;const l=e.ray.origin.distanceTo(zy);l<e.near||l>e.far||n.push({distance:l,point:zy.clone(),uv:Fo.getInterpolation(zy,Sw,Hy,ww,Kz,xk,Yz,new wt),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Ew(t,e,n,i,r,a){lb.subVectors(t,n).addScalar(.5).multiply(i),r!==void 0?(jy.x=a*lb.x-r*lb.y,jy.y=r*lb.x+a*lb.y):jy.copy(lb),t.copy(e),t.x+=jy.x,t.y+=jy.y,t.applyMatrix4(GJ)}const Mw=new te,Jz=new te;class qJ extends Ni{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const n=e.levels;for(let i=0,r=n.length;i<r;i++){const a=n[i];this.addLevel(a.object.clone(),a.distance,a.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,n=0,i=0){n=Math.abs(n);const r=this.levels;let a;for(a=0;a<r.length&&!(n<r[a].distance);a++);return r.splice(a,0,{distance:n,hysteresis:i,object:e}),this.add(e),this}removeLevel(e){const n=this.levels;for(let i=0;i<n.length;i++)if(n[i].distance===e){const r=n.splice(i,1);return this.remove(r[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const n=this.levels;if(n.length>0){let i,r;for(i=1,r=n.length;i<r;i++){let a=n[i].distance;if(n[i].object.visible&&(a-=a*n[i].hysteresis),e<a)break}return n[i-1].object}return null}raycast(e,n){if(this.levels.length>0){Mw.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Mw);this.getObjectForDistance(r).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){Mw.setFromMatrixPosition(e.matrixWorld),Jz.setFromMatrixPosition(this.matrixWorld);const i=Mw.distanceTo(Jz)/e.zoom;n[0].object.visible=!0;let r,a;for(r=1,a=n.length;r<a;r++){let s=n[r].distance;if(n[r].object.visible&&(s-=s*n[r].hysteresis),i>=s)n[r-1].object.visible=!1,n[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<a;r++)n[r].object.visible=!1}}toJSON(e){const n=super.toJSON(e);this.autoUpdate===!1&&(n.object.autoUpdate=!1),n.object.levels=[];const i=this.levels;for(let r=0,a=i.length;r<a;r++){const s=i[r];n.object.levels.push({object:s.object.uuid,distance:s.distance,hysteresis:s.hysteresis})}return n}}const $z=new te,Zz=new ei,Qz=new ei,Fbe=new te,ej=new Ot,Tw=new te,_k=new Ir,tj=new Ot,Sk=new pf;let XA=class extends _i{constructor(e,n){super(e,n),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=F1,this.bindMatrix=new Ot,this.bindMatrixInverse=new Ot,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new rr),this.boundingBox.makeEmpty();const n=e.getAttribute("position");for(let i=0;i<n.count;i++)this.getVertexPosition(i,Tw),this.boundingBox.expandByPoint(Tw)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ir),this.boundingSphere.makeEmpty();const n=e.getAttribute("position");for(let i=0;i<n.count;i++)this.getVertexPosition(i,Tw),this.boundingSphere.expandByPoint(Tw)}copy(e,n){return super.copy(e,n),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,n){const i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),_k.copy(this.boundingSphere),_k.applyMatrix4(r),e.ray.intersectsSphere(_k)!==!1&&(tj.copy(r).invert(),Sk.copy(e.ray).applyMatrix4(tj),!(this.boundingBox!==null&&Sk.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,n,Sk)))}getVertexPosition(e,n){return super.getVertexPosition(e,n),this.applyBoneTransform(e,n),n}bind(e,n){this.skeleton=e,n===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.copy(n).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new ei,n=this.geometry.attributes.skinWeight;for(let i=0,r=n.count;i<r;i++){e.fromBufferAttribute(n,i);const a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),n.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===F1?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===kP?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,n){const i=this.skeleton,r=this.geometry;Zz.fromBufferAttribute(r.attributes.skinIndex,e),Qz.fromBufferAttribute(r.attributes.skinWeight,e),$z.copy(n).applyMatrix4(this.bindMatrix),n.set(0,0,0);for(let a=0;a<4;a++){const s=Qz.getComponent(a);if(s!==0){const o=Zz.getComponent(a);ej.multiplyMatrices(i.bones[o].matrixWorld,i.boneInverses[o]),n.addScaledVector(Fbe.copy($z).applyMatrix4(ej),s)}}return n.applyMatrix4(this.bindMatrixInverse)}};class B_ extends Ni{constructor(){super(),this.isBone=!0,this.type="Bone"}}class rs extends nr{constructor(e=null,n=1,i=1,r,a,s,o,l,c=is,u=is,f,h){super(null,s,o,l,c,u,r,a,f,h),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const nj=new Ot,Bbe=new Ot;class Vv{constructor(e=[],n=[]){this.uuid=wl(),this.bones=e.slice(0),this.boneInverses=n,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,n=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),n.length===0)this.calculateInverses();else if(e.length!==n.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Ot)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,n=this.bones.length;e<n;e++){const i=new Ot;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,n=this.bones.length;e<n;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,n=this.bones.length;e<n;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,n=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let a=0,s=e.length;a<s;a++){const o=e[a]?e[a].matrixWorld:Bbe;nj.multiplyMatrices(o,n[a]),nj.toArray(i,a*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Vv(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4);n.set(this.boneMatrices);const i=new rs(n,e,e,$r,yr);return i.needsUpdate=!0,this.boneMatrices=n,this.boneTexture=i,this}getBoneByName(e){for(let n=0,i=this.bones.length;n<i;n++){const r=this.bones[n];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,n){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const a=e.bones[i];let s=n[a];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",a),s=new B_),this.bones.push(s),this.boneInverses.push(new Ot().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const n=this.bones,i=this.boneInverses;for(let r=0,a=n.length;r<a;r++){const s=n[r];e.bones.push(s.uuid);const o=i[r];e.boneInverses.push(o.toArray())}return e}}class of extends Nn{constructor(e,n,i,r=1){super(e,n,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const cb=new Ot,ij=new Ot,Aw=[],rj=new rr,zbe=new Ot,Vy=new _i,Gy=new Ir;class KA extends _i{constructor(e,n,i){super(e,n),this.isInstancedMesh=!0,this.instanceMatrix=new of(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,zbe)}computeBoundingBox(){const e=this.geometry,n=this.count;this.boundingBox===null&&(this.boundingBox=new rr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<n;i++)this.getMatrixAt(i,cb),rj.copy(e.boundingBox).applyMatrix4(cb),this.boundingBox.union(rj)}computeBoundingSphere(){const e=this.geometry,n=this.count;this.boundingSphere===null&&(this.boundingSphere=new Ir),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<n;i++)this.getMatrixAt(i,cb),Gy.copy(e.boundingSphere).applyMatrix4(cb),this.boundingSphere.union(Gy)}copy(e,n){return super.copy(e,n),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,n){n.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,n){n.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,n){const i=n.morphTargetInfluences,r=this.morphTexture.source.data.data,a=i.length+1,s=e*a+1;for(let o=0;o<i.length;o++)i[o]=r[s+o]}raycast(e,n){const i=this.matrixWorld,r=this.count;if(Vy.geometry=this.geometry,Vy.material=this.material,Vy.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Gy.copy(this.boundingSphere),Gy.applyMatrix4(i),e.ray.intersectsSphere(Gy)!==!1))for(let a=0;a<r;a++){this.getMatrixAt(a,cb),ij.multiplyMatrices(i,cb),Vy.matrixWorld=ij,Vy.raycast(e,Aw);for(let s=0,o=Aw.length;s<o;s++){const l=Aw[s];l.instanceId=a,l.object=this,n.push(l)}Aw.length=0}}setColorAt(e,n){this.instanceColor===null&&(this.instanceColor=new of(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),n.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,n){n.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,n){const i=n.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new rs(new Float32Array(r*this.count),r,this.count,wh,yr));const a=this.morphTexture.source.data.data;let s=0;for(let c=0;c<i.length;c++)s+=i[c];const o=this.geometry.morphTargetsRelative?1:1-s,l=r*e;a[l]=o,a.set(i,l+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const wk=new te,jbe=new te,Hbe=new Kn;class $c{constructor(e=new te(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=wk.subVectors(i,n).cross(jbe.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(wk),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/r;return a<0||a>1?null:n.copy(e.start).addScaledVector(i,a)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||Hbe.getNormalMatrix(e),r=this.coplanarPoint(wk).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Sp=new Ir,Vbe=new wt(.5,.5),Cw=new te;class Kd{constructor(e=new $c,n=new $c,i=new $c,r=new $c,a=new $c,s=new $c){this.planes=[e,n,i,r,a,s]}set(e,n,i,r,a,s){const o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(i),o[3].copy(r),o[4].copy(a),o[5].copy(s),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=gl,i=!1){const r=this.planes,a=e.elements,s=a[0],o=a[1],l=a[2],c=a[3],u=a[4],f=a[5],h=a[6],d=a[7],g=a[8],b=a[9],y=a[10],p=a[11],x=a[12],_=a[13],w=a[14],M=a[15];if(r[0].setComponents(c-s,d-u,p-g,M-x).normalize(),r[1].setComponents(c+s,d+u,p+g,M+x).normalize(),r[2].setComponents(c+o,d+f,p+b,M+_).normalize(),r[3].setComponents(c-o,d-f,p-b,M-_).normalize(),i)r[4].setComponents(l,h,y,w).normalize(),r[5].setComponents(c-l,d-h,p-y,M-w).normalize();else if(r[4].setComponents(c-l,d-h,p-y,M-w).normalize(),n===gl)r[5].setComponents(c+l,d+h,p+y,M+w).normalize();else if(n===tv)r[5].setComponents(l,h,y,w).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Sp.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Sp.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Sp)}intersectsSprite(e){Sp.center.set(0,0,0);const n=Vbe.distanceTo(e.center);return Sp.radius=.7071067811865476+n,Sp.applyMatrix4(e.matrixWorld),this.intersectsSphere(Sp)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let a=0;a<6;a++)if(n[a].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const n=this.planes;for(let i=0;i<6;i++){const r=n[i];if(Cw.x=r.normal.x>0?e.max.x:e.min.x,Cw.y=r.normal.y>0?e.max.y:e.min.y,Cw.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Cw)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Ru=new Ot,ku=new Kd;class YA{constructor(){this.coordinateSystem=gl}intersectsObject(e,n){if(!n.isArrayCamera||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Ru.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ku.setFromProjectionMatrix(Ru,r.coordinateSystem,r.reversedDepth),ku.intersectsObject(e))return!0}return!1}intersectsSprite(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Ru.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ku.setFromProjectionMatrix(Ru,r.coordinateSystem,r.reversedDepth),ku.intersectsSprite(e))return!0}return!1}intersectsSphere(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Ru.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ku.setFromProjectionMatrix(Ru,r.coordinateSystem,r.reversedDepth),ku.intersectsSphere(e))return!0}return!1}intersectsBox(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Ru.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ku.setFromProjectionMatrix(Ru,r.coordinateSystem,r.reversedDepth),ku.intersectsBox(e))return!0}return!1}containsPoint(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const r=n.cameras[i];if(Ru.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ku.setFromProjectionMatrix(Ru,r.coordinateSystem,r.reversedDepth),ku.containsPoint(e))return!0}return!1}clone(){return new YA}}function Ek(t,e){return t-e}function Gbe(t,e){return t.z-e.z}function Wbe(t,e){return e.z-t.z}class qbe{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,n,i,r){const a=this.pool,s=this.list;this.index>=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});const o=a[this.index];s.push(o),this.index++,o.start=e,o.count=n,o.z=i,o.index=r}reset(){this.list.length=0,this.index=0}}const Do=new Ot,Xbe=new Ut(1,1,1),aj=new Kd,Kbe=new YA,Rw=new rr,wp=new Ir,Wy=new te,sj=new te,Ybe=new te,Mk=new qbe,Zs=new _i,kw=[];function Jbe(t,e,n=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const r=t.count;for(let a=0;a<r;a++)for(let s=0;s<i;s++)e.setComponent(a+n,s,t.getComponent(a,s))}else e.array.set(t.array,n*i);e.needsUpdate=!0}function Ep(t,e){if(t.constructor!==e.constructor){const n=Math.min(t.length,e.length);for(let i=0;i<n;i++)e[i]=t[i]}else{const n=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,n))}}let XJ=class extends _i{constructor(e,n,i=n*2,r){super(new Dn,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=n,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4),i=new rs(n,e,e,$r,yr);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Uint32Array(e*e),i=new rs(n,e,e,zv,wc);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Float32Array(e*e*4).fill(1),i=new rs(n,e,e,$r,yr);i.colorSpace=pi.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){const n=this.geometry,i=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const a in e.attributes){const s=e.getAttribute(a),{array:o,itemSize:l,normalized:c}=s,u=new o.constructor(i*l),f=new Nn(u,l,c);n.setAttribute(a,f)}if(e.getIndex()!==null){const a=i>65535?new Uint32Array(r):new Uint16Array(r);n.setIndex(new Nn(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in n.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),a=n.getAttribute(i);if(r.itemSize!==a.itemSize||r.normalized!==a.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const n=this._instanceInfo;if(e<0||e>=n.length||n[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const n=this._geometryInfo;if(e<0||e>=n.length||n[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this.boundingBox,n=this._instanceInfo;e.makeEmpty();for(let i=0,r=n.length;i<r;i++){if(n[i].active===!1)continue;const a=n[i].geometryIndex;this.getMatrixAt(i,Do),this.getBoundingBoxAt(a,Rw).applyMatrix4(Do),e.union(Rw)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ir);const e=this.boundingSphere,n=this._instanceInfo;e.makeEmpty();for(let i=0,r=n.length;i<r;i++){if(n[i].active===!1)continue;const a=n[i].geometryIndex;this.getMatrixAt(i,Do),this.getBoundingSphereAt(a,wp).applyMatrix4(Do),e.union(wp)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Ek),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=i):(r=this._instanceInfo.length,this._instanceInfo.push(i));const a=this._matricesTexture;Do.identity().toArray(a.image.data,r*16),a.needsUpdate=!0;const s=this._colorsTexture;return s&&(Xbe.toArray(s.image.data,r*4),s.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,n=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=n===-1?e.getAttribute("position").count:n;const s=e.getIndex();if(s!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=i===-1?s.count:i),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Ek),l=this._availableGeometryIds.shift(),a[l]=r):(l=this._geometryCount,this._geometryCount++,a.push(r)),this.setGeometryAt(l,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,l}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const i=this.geometry,r=i.getIndex()!==null,a=i.getIndex(),s=n.getIndex(),o=this._geometryInfo[e];if(r&&s.count>o.reservedIndexCount||n.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=n.getAttribute("position").count;for(const u in i.attributes){const f=n.getAttribute(u),h=i.getAttribute(u);Jbe(f,h,l);const d=f.itemSize;for(let g=f.count,b=c;g<b;g++){const y=l+g;for(let p=0;p<d;p++)h.setComponent(y,p,0)}h.needsUpdate=!0,h.addUpdateRange(l*d,c*d)}if(r){const u=o.indexStart,f=o.reservedIndexCount;o.indexCount=n.getIndex().count;for(let h=0;h<s.count;h++)a.setX(u+h,l+s.getX(h));for(let h=s.count,d=f;h<d;h++)a.setX(u+h,l);a.needsUpdate=!0,a.addUpdateRange(u,o.reservedIndexCount)}return o.start=r?o.indexStart:o.vertexStart,o.count=r?o.indexCount:o.vertexCount,o.boundingBox=null,n.boundingBox!==null&&(o.boundingBox=n.boundingBox.clone()),o.boundingSphere=null,n.boundingSphere!==null&&(o.boundingSphere=n.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const n=this._geometryInfo;if(e>=n.length||n[e].active===!1)return this;const i=this._instanceInfo;for(let r=0,a=i.length;r<a;r++)i[r].active&&i[r].geometryIndex===e&&this.deleteInstance(r);return n[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,n=0;const i=this._geometryInfo,r=i.map((s,o)=>o).sort((s,o)=>i[s].vertexStart-i[o].vertexStart),a=this.geometry;for(let s=0,o=i.length;s<o;s++){const l=r[s],c=i[l];if(c.active!==!1){if(a.index!==null){if(c.indexStart!==n){const{indexStart:u,vertexStart:f,reservedIndexCount:h}=c,d=a.index,g=d.array,b=e-f;for(let y=u;y<u+h;y++)g[y]=g[y]+b;d.array.copyWithin(n,u,u+h),d.addUpdateRange(n,h),c.indexStart=n}n+=c.reservedIndexCount}if(c.vertexStart!==e){const{vertexStart:u,reservedVertexCount:f}=c,h=a.attributes;for(const d in h){const g=h[d],{array:b,itemSize:y}=g;b.copyWithin(e*y,u*y,(u+f)*y),g.addUpdateRange(e*y,f*y)}c.vertexStart=e}e+=c.reservedVertexCount,c.start=a.index?c.indexStart:c.vertexStart,this._nextIndexStart=a.index?c.indexStart+c.reservedIndexCount:0,this._nextVertexStart=c.vertexStart+c.reservedVertexCount}}return this}getBoundingBoxAt(e,n){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const a=new rr,s=i.index,o=i.attributes.position;for(let l=r.start,c=r.start+r.count;l<c;l++){let u=l;s&&(u=s.getX(u)),a.expandByPoint(Wy.fromBufferAttribute(o,u))}r.boundingBox=a}return n.copy(r.boundingBox),n}getBoundingSphereAt(e,n){if(e>=this._geometryCount)return null;const i=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const a=new Ir;this.getBoundingBoxAt(e,Rw),Rw.getCenter(a.center);const s=i.index,o=i.attributes.position;let l=0;for(let c=r.start,u=r.start+r.count;c<u;c++){let f=c;s&&(f=s.getX(f)),Wy.fromBufferAttribute(o,f),l=Math.max(l,a.center.distanceToSquared(Wy))}a.radius=Math.sqrt(l),r.boundingSphere=a}return n.copy(r.boundingSphere),n}setMatrixAt(e,n){this.validateInstanceId(e);const i=this._matricesTexture,r=this._matricesTexture.image.data;return n.toArray(r,e*16),i.needsUpdate=!0,this}getMatrixAt(e,n){return this.validateInstanceId(e),n.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,n){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),n.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,n){return this.validateInstanceId(e),n.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,n){return this.validateInstanceId(e),this._instanceInfo[e].visible===n?this:(this._instanceInfo[e].visible=n,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,n){return this.validateInstanceId(e),this.validateGeometryId(n),this._instanceInfo[e].geometryIndex=n,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,n={}){this.validateGeometryId(e);const i=this._geometryInfo[e];return n.vertexStart=i.vertexStart,n.vertexCount=i.vertexCount,n.reservedVertexCount=i.reservedVertexCount,n.indexStart=i.indexStart,n.indexCount=i.indexCount,n.reservedIndexCount=i.reservedIndexCount,n.start=i.start,n.count=i.count,n}setInstanceCount(e){const n=this._availableInstanceIds,i=this._instanceInfo;for(n.sort(Ek);n[n.length-1]===i.length-1;)i.pop(),n.pop();if(e<i.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const r=new Int32Array(e),a=new Int32Array(e);Ep(this._multiDrawCounts,r),Ep(this._multiDrawStarts,a),this._multiDrawCounts=r,this._multiDrawStarts=a,this._maxInstanceCount=e;const s=this._indirectTexture,o=this._matricesTexture,l=this._colorsTexture;s.dispose(),this._initIndirectTexture(),Ep(s.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),Ep(o.image.data,this._matricesTexture.image.data),l&&(l.dispose(),this._initColorsTexture(),Ep(l.image.data,this._colorsTexture.image.data))}setGeometrySize(e,n){const i=[...this._geometryInfo].filter(o=>o.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${n}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>n)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${n}. Cannot shrink further.`);const a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=n,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Dn,this._initializeGeometry(a));const s=this.geometry;a.index&&Ep(a.index.array,s.index.array);for(const o in a.attributes)Ep(a.attributes[o].array,s.attributes[o].array)}raycast(e,n){const i=this._instanceInfo,r=this._geometryInfo,a=this.matrixWorld,s=this.geometry;Zs.material=this.material,Zs.geometry.index=s.index,Zs.geometry.attributes=s.attributes,Zs.geometry.boundingBox===null&&(Zs.geometry.boundingBox=new rr),Zs.geometry.boundingSphere===null&&(Zs.geometry.boundingSphere=new Ir);for(let o=0,l=i.length;o<l;o++){if(!i[o].visible||!i[o].active)continue;const c=i[o].geometryIndex,u=r[c];Zs.geometry.setDrawRange(u.start,u.count),this.getMatrixAt(o,Zs.matrixWorld).premultiply(a),this.getBoundingBoxAt(c,Zs.geometry.boundingBox),this.getBoundingSphereAt(c,Zs.geometry.boundingSphere),Zs.raycast(e,kw);for(let f=0,h=kw.length;f<h;f++){const d=kw[f];d.object=this,d.batchId=o,n.push(d)}kw.length=0}Zs.material=null,Zs.geometry.index=null,Zs.geometry.attributes={},Zs.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(n=>({...n,boundingBox:n.boundingBox!==null?n.boundingBox.clone():null,boundingSphere:n.boundingSphere!==null?n.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(n=>({...n})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,n,i,r,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=r.getIndex(),o=s===null?1:s.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._geometryInfo,h=this.perObjectFrustumCulled,d=this._indirectTexture,g=d.image.data,b=i.isArrayCamera?Kbe:aj;h&&!i.isArrayCamera&&(Do.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),aj.setFromProjectionMatrix(Do,i.coordinateSystem,i.reversedDepth));let y=0;if(this.sortObjects){Do.copy(this.matrixWorld).invert(),Wy.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Do),sj.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Do);for(let _=0,w=l.length;_<w;_++)if(l[_].visible&&l[_].active){const M=l[_].geometryIndex;this.getMatrixAt(_,Do),this.getBoundingSphereAt(M,wp).applyMatrix4(Do);let S=!1;if(h&&(S=!b.intersectsSphere(wp,i)),!S){const A=f[M],C=Ybe.subVectors(wp.center,Wy).dot(sj);Mk.push(A.start,A.count,C,_)}}const p=Mk.list,x=this.customSort;x===null?p.sort(a.transparent?Wbe:Gbe):x.call(this,p,i);for(let _=0,w=p.length;_<w;_++){const M=p[_];c[y]=M.start*o,u[y]=M.count,g[y]=M.index,y++}Mk.reset()}else for(let p=0,x=l.length;p<x;p++)if(l[p].visible&&l[p].active){const _=l[p].geometryIndex;let w=!1;if(h&&(this.getMatrixAt(p,Do),this.getBoundingSphereAt(_,wp).applyMatrix4(Do),w=!b.intersectsSphere(wp,i)),!w){const M=f[_];c[y]=M.start*o,u[y]=M.count,g[y]=p,y++}}d.needsUpdate=!0,this._multiDrawCount=y,this._visibilityChanged=!1}onBeforeShadow(e,n,i,r,a,s){this.onBeforeRender(e,null,r,a,s)}};class Us extends ka{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ut(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const J2=new te,$2=new te,oj=new Ot,qy=new pf,Dw=new Ir,Tk=new te,lj=new te;let gh=class extends Ni{constructor(e=new Dn,n=new Us){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[0];for(let r=1,a=n.count;r<a;r++)J2.fromBufferAttribute(n,r-1),$2.fromBufferAttribute(n,r),i[r]=i[r-1],i[r]+=J2.distanceTo($2);e.setAttribute("lineDistance",new fn(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,n){const i=this.geometry,r=this.matrixWorld,a=e.params.Line.threshold,s=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Dw.copy(i.boundingSphere),Dw.applyMatrix4(r),Dw.radius+=a,e.ray.intersectsSphere(Dw)===!1)return;oj.copy(r).invert(),qy.copy(e.ray).applyMatrix4(oj);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,u=i.index,h=i.attributes.position;if(u!==null){const d=Math.max(0,s.start),g=Math.min(u.count,s.start+s.count);for(let b=d,y=g-1;b<y;b+=c){const p=u.getX(b),x=u.getX(b+1),_=Ow(this,e,qy,l,p,x,b);_&&n.push(_)}if(this.isLineLoop){const b=u.getX(g-1),y=u.getX(d),p=Ow(this,e,qy,l,b,y,g-1);p&&n.push(p)}}else{const d=Math.max(0,s.start),g=Math.min(h.count,s.start+s.count);for(let b=d,y=g-1;b<y;b+=c){const p=Ow(this,e,qy,l,b,b+1,b);p&&n.push(p)}if(this.isLineLoop){const b=Ow(this,e,qy,l,g-1,d,g-1);b&&n.push(b)}}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=r.length;a<s;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}};function Ow(t,e,n,i,r,a,s){const o=t.geometry.attributes.position;if(J2.fromBufferAttribute(o,r),$2.fromBufferAttribute(o,a),n.distanceSqToSegment(J2,$2,Tk,lj)>i)return;Tk.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(Tk);if(!(c<e.near||c>e.far))return{distance:c,point:lj.clone().applyMatrix4(t.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:t}}const cj=new te,uj=new te;let Dc=class extends gh{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[];for(let r=0,a=n.count;r<a;r+=2)cj.fromBufferAttribute(n,r),uj.fromBufferAttribute(n,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+cj.distanceTo(uj);e.setAttribute("lineDistance",new fn(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}};class WP extends gh{constructor(e,n){super(e,n),this.isLineLoop=!0,this.type="LineLoop"}}class JA extends ka{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ut(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const fj=new Ot,JO=new pf,Iw=new Ir,Nw=new te;class qP extends Ni{constructor(e=new Dn,n=new JA){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,n){const i=this.geometry,r=this.matrixWorld,a=e.params.Points.threshold,s=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Iw.copy(i.boundingSphere),Iw.applyMatrix4(r),Iw.radius+=a,e.ray.intersectsSphere(Iw)===!1)return;fj.copy(r).invert(),JO.copy(e.ray).applyMatrix4(fj);const o=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=i.index,f=i.attributes.position;if(c!==null){const h=Math.max(0,s.start),d=Math.min(c.count,s.start+s.count);for(let g=h,b=d;g<b;g++){const y=c.getX(g);Nw.fromBufferAttribute(f,y),hj(Nw,y,l,r,e,n,this)}}else{const h=Math.max(0,s.start),d=Math.min(f.count,s.start+s.count);for(let g=h,b=d;g<b;g++)Nw.fromBufferAttribute(f,g),hj(Nw,g,l,r,e,n,this)}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,s=r.length;a<s;a++){const o=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=a}}}}}function hj(t,e,n,i,r,a,s){const o=JO.distanceSqToPoint(t);if(o<n){const l=new te;JO.closestPointToPoint(t,l),l.applyMatrix4(i);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;a.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:s})}}class KJ extends nr{constructor(e,n,i,r,a=Hi,s=Hi,o,l,c){super(e,n,i,r,a,s,o,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const u=this;function f(){u.needsUpdate=!0,u._requestVideoFrameCallbackId=e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(f))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),super.dispose()}}class $be extends KJ{constructor(e,n,i,r,a,s,o,l){super({},e,n,i,r,a,s,o,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class Zbe extends nr{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=is,this.minFilter=is,this.generateMipmaps=!1,this.needsUpdate=!0}}class $A extends nr{constructor(e,n,i,r,a,s,o,l,c,u,f,h){super(null,s,o,l,c,u,r,a,f,h),this.isCompressedTexture=!0,this.image={width:n,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Qbe extends $A{constructor(e,n,i,r,a,s){super(e,n,i,a,s),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=ba,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class e0e extends $A{constructor(e,n,i){super(void 0,e[0].width,e[0].height,n,i,sf),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class t0e extends nr{constructor(e,n,i,r,a,s,o,l,c){super(e,n,i,r,a,s,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class XP extends nr{constructor(e,n,i=wc,r,a,s,o=is,l=is,c,u=$0,f=1){if(u!==$0&&u!==Z0)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const h={width:e,height:n,depth:f};super(h,r,a,s,o,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new xd(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class ZA extends Dn{constructor(e=1,n=1,i=4,r=8,a=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:n,capSegments:i,radialSegments:r,heightSegments:a},n=Math.max(0,n),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),a=Math.max(1,Math.floor(a));const s=[],o=[],l=[],c=[],u=n/2,f=Math.PI/2*e,h=n,d=2*f+h,g=i*2+a,b=r+1,y=new te,p=new te;for(let x=0;x<=g;x++){let _=0,w=0,M=0,S=0;if(x<=i){const D=x/i,R=D*Math.PI/2;w=-u-e*Math.cos(R),M=e*Math.sin(R),S=-e*Math.cos(R),_=D*f}else if(x<=i+a){const D=(x-i)/a;w=-u+D*n,M=e,S=0,_=f+D*h}else{const D=(x-i-a)/i,R=D*Math.PI/2;w=u+e*Math.sin(R),M=e*Math.cos(R),S=e*Math.sin(R),_=f+h+D*f}const A=Math.max(0,Math.min(1,_/d));let C=0;x===0?C=.5/r:x===g&&(C=-.5/r);for(let D=0;D<=r;D++){const R=D/r,N=R*Math.PI*2,U=Math.sin(N),j=Math.cos(N);p.x=-M*j,p.y=w,p.z=M*U,o.push(p.x,p.y,p.z),y.set(-M*j,S,M*U),y.normalize(),l.push(y.x,y.y,y.z),c.push(R+C,A)}if(x>0){const D=(x-1)*b;for(let R=0;R<r;R++){const N=D+R,U=D+R+1,j=x*b+R,z=x*b+R+1;s.push(N,U,j),s.push(U,z,j)}}}this.setIndex(s),this.setAttribute("position",new fn(o,3)),this.setAttribute("normal",new fn(l,3)),this.setAttribute("uv",new fn(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ZA(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class QA extends Dn{constructor(e=1,n=32,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:n,thetaStart:i,thetaLength:r},n=Math.max(3,n);const a=[],s=[],o=[],l=[],c=new te,u=new wt;s.push(0,0,0),o.push(0,0,1),l.push(.5,.5);for(let f=0,h=3;f<=n;f++,h+=3){const d=i+f/n*r;c.x=e*Math.cos(d),c.y=e*Math.sin(d),s.push(c.x,c.y,c.z),o.push(0,0,1),u.x=(s[h]/e+1)/2,u.y=(s[h+1]/e+1)/2,l.push(u.x,u.y)}for(let f=1;f<=n;f++)a.push(f,f+1,0);this.setIndex(a),this.setAttribute("position",new fn(s,3)),this.setAttribute("normal",new fn(o,3)),this.setAttribute("uv",new fn(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new QA(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class jm extends Dn{constructor(e=1,n=1,i=1,r=32,a=1,s=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:i,radialSegments:r,heightSegments:a,openEnded:s,thetaStart:o,thetaLength:l};const c=this;r=Math.floor(r),a=Math.floor(a);const u=[],f=[],h=[],d=[];let g=0;const b=[],y=i/2;let p=0;x(),s===!1&&(e>0&&_(!0),n>0&&_(!1)),this.setIndex(u),this.setAttribute("position",new fn(f,3)),this.setAttribute("normal",new fn(h,3)),this.setAttribute("uv",new fn(d,2));function x(){const w=new te,M=new te;let S=0;const A=(n-e)/i;for(let C=0;C<=a;C++){const D=[],R=C/a,N=R*(n-e)+e;for(let U=0;U<=r;U++){const j=U/r,z=j*l+o,q=Math.sin(z),B=Math.cos(z);M.x=N*q,M.y=-R*i+y,M.z=N*B,f.push(M.x,M.y,M.z),w.set(q,A,B).normalize(),h.push(w.x,w.y,w.z),d.push(j,1-R),D.push(g++)}b.push(D)}for(let C=0;C<r;C++)for(let D=0;D<a;D++){const R=b[D][C],N=b[D+1][C],U=b[D+1][C+1],j=b[D][C+1];(e>0||D!==0)&&(u.push(R,N,j),S+=3),(n>0||D!==a-1)&&(u.push(N,U,j),S+=3)}c.addGroup(p,S,0),p+=S}function _(w){const M=g,S=new wt,A=new te;let C=0;const D=w===!0?e:n,R=w===!0?1:-1;for(let U=1;U<=r;U++)f.push(0,y*R,0),h.push(0,R,0),d.push(.5,.5),g++;const N=g;for(let U=0;U<=r;U++){const z=U/r*l+o,q=Math.cos(z),B=Math.sin(z);A.x=D*B,A.y=y*R,A.z=D*q,f.push(A.x,A.y,A.z),h.push(0,R,0),S.x=q*.5+.5,S.y=B*.5*R+.5,d.push(S.x,S.y),g++}for(let U=0;U<r;U++){const j=M+U,z=N+U;w===!0?u.push(z,z+1,j):u.push(z+1,z,j),C+=3}c.addGroup(p,C,w===!0?1:2),p+=C}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new jm(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class z_ extends jm{constructor(e=1,n=1,i=32,r=1,a=!1,s=0,o=Math.PI*2){super(0,e,n,i,r,a,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:s,thetaLength:o}}static fromJSON(e){return new z_(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Yd extends Dn{constructor(e=[],n=[],i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:n,radius:i,detail:r};const a=[],s=[];o(r),c(i),u(),this.setAttribute("position",new fn(a,3)),this.setAttribute("normal",new fn(a.slice(),3)),this.setAttribute("uv",new fn(s,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(x){const _=new te,w=new te,M=new te;for(let S=0;S<n.length;S+=3)d(n[S+0],_),d(n[S+1],w),d(n[S+2],M),l(_,w,M,x)}function l(x,_,w,M){const S=M+1,A=[];for(let C=0;C<=S;C++){A[C]=[];const D=x.clone().lerp(w,C/S),R=_.clone().lerp(w,C/S),N=S-C;for(let U=0;U<=N;U++)U===0&&C===S?A[C][U]=D:A[C][U]=D.clone().lerp(R,U/N)}for(let C=0;C<S;C++)for(let D=0;D<2*(S-C)-1;D++){const R=Math.floor(D/2);D%2===0?(h(A[C][R+1]),h(A[C+1][R]),h(A[C][R])):(h(A[C][R+1]),h(A[C+1][R+1]),h(A[C+1][R]))}}function c(x){const _=new te;for(let w=0;w<a.length;w+=3)_.x=a[w+0],_.y=a[w+1],_.z=a[w+2],_.normalize().multiplyScalar(x),a[w+0]=_.x,a[w+1]=_.y,a[w+2]=_.z}function u(){const x=new te;for(let _=0;_<a.length;_+=3){x.x=a[_+0],x.y=a[_+1],x.z=a[_+2];const w=y(x)/2/Math.PI+.5,M=p(x)/Math.PI+.5;s.push(w,1-M)}g(),f()}function f(){for(let x=0;x<s.length;x+=6){const _=s[x+0],w=s[x+2],M=s[x+4],S=Math.max(_,w,M),A=Math.min(_,w,M);S>.9&&A<.1&&(_<.2&&(s[x+0]+=1),w<.2&&(s[x+2]+=1),M<.2&&(s[x+4]+=1))}}function h(x){a.push(x.x,x.y,x.z)}function d(x,_){const w=x*3;_.x=e[w+0],_.y=e[w+1],_.z=e[w+2]}function g(){const x=new te,_=new te,w=new te,M=new te,S=new wt,A=new wt,C=new wt;for(let D=0,R=0;D<a.length;D+=9,R+=6){x.set(a[D+0],a[D+1],a[D+2]),_.set(a[D+3],a[D+4],a[D+5]),w.set(a[D+6],a[D+7],a[D+8]),S.set(s[R+0],s[R+1]),A.set(s[R+2],s[R+3]),C.set(s[R+4],s[R+5]),M.copy(x).add(_).add(w).divideScalar(3);const N=y(M);b(S,R+0,x,N),b(A,R+2,_,N),b(C,R+4,w,N)}}function b(x,_,w,M){M<0&&x.x===1&&(s[_]=x.x-1),w.x===0&&w.z===0&&(s[_]=M/2/Math.PI+.5)}function y(x){return Math.atan2(x.z,-x.x)}function p(x){return Math.atan2(-x.y,Math.sqrt(x.x*x.x+x.z*x.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Yd(e.vertices,e.indices,e.radius,e.details)}}class eC extends Yd{constructor(e=1,n=0){const i=(1+Math.sqrt(5))/2,r=1/i,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],s=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(a,s,e,n),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new eC(e.radius,e.detail)}}const Lw=new te,Pw=new te,Ak=new te,Uw=new Fo;class YJ extends Dn{constructor(e=null,n=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:n},e!==null){const r=Math.pow(10,4),a=Math.cos(Am*n),s=e.getIndex(),o=e.getAttribute("position"),l=s?s.count:o.count,c=[0,0,0],u=["a","b","c"],f=new Array(3),h={},d=[];for(let g=0;g<l;g+=3){s?(c[0]=s.getX(g),c[1]=s.getX(g+1),c[2]=s.getX(g+2)):(c[0]=g,c[1]=g+1,c[2]=g+2);const{a:b,b:y,c:p}=Uw;if(b.fromBufferAttribute(o,c[0]),y.fromBufferAttribute(o,c[1]),p.fromBufferAttribute(o,c[2]),Uw.getNormal(Ak),f[0]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,f[1]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,f[2]=`${Math.round(p.x*r)},${Math.round(p.y*r)},${Math.round(p.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let x=0;x<3;x++){const _=(x+1)%3,w=f[x],M=f[_],S=Uw[u[x]],A=Uw[u[_]],C=`${w}_${M}`,D=`${M}_${w}`;D in h&&h[D]?(Ak.dot(h[D].normal)<=a&&(d.push(S.x,S.y,S.z),d.push(A.x,A.y,A.z)),h[D]=null):C in h||(h[C]={index0:c[x],index1:c[_],normal:Ak.clone()})}}for(const g in h)if(h[g]){const{index0:b,index1:y}=h[g];Lw.fromBufferAttribute(o,b),Pw.fromBufferAttribute(o,y),d.push(Lw.x,Lw.y,Lw.z),d.push(Pw.x,Pw.y,Pw.z)}this.setAttribute("position",new fn(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class _u{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,n){const i=this.getUtoTmapping(e);return this.getPoint(i,n)}getPoints(e=5){const n=[];for(let i=0;i<=e;i++)n.push(this.getPoint(i/e));return n}getSpacedPoints(e=5){const n=[];for(let i=0;i<=e;i++)n.push(this.getPointAt(i/e));return n}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const n=[];let i,r=this.getPoint(0),a=0;n.push(0);for(let s=1;s<=e;s++)i=this.getPoint(s/e),a+=i.distanceTo(r),n.push(a),r=i;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n=null){const i=this.getLengths();let r=0;const a=i.length;let s;n?s=n:s=e*i[a-1];let o=0,l=a-1,c;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),c=i[r]-s,c<0)o=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===s)return r/(a-1);const u=i[r],h=i[r+1]-u,d=(s-u)/h;return(r+d)/(a-1)}getTangent(e,n){let r=e-1e-4,a=e+1e-4;r<0&&(r=0),a>1&&(a=1);const s=this.getPoint(r),o=this.getPoint(a),l=n||(s.isVector2?new wt:new te);return l.copy(o).sub(s).normalize(),l}getTangentAt(e,n){const i=this.getUtoTmapping(e);return this.getTangent(i,n)}computeFrenetFrames(e,n=!1){const i=new te,r=[],a=[],s=[],o=new te,l=new Ot;for(let d=0;d<=e;d++){const g=d/e;r[d]=this.getTangentAt(g,new te)}a[0]=new te,s[0]=new te;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),f=Math.abs(r[0].y),h=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),h<=c&&i.set(0,0,1),o.crossVectors(r[0],i).normalize(),a[0].crossVectors(r[0],o),s[0].crossVectors(r[0],a[0]);for(let d=1;d<=e;d++){if(a[d]=a[d-1].clone(),s[d]=s[d-1].clone(),o.crossVectors(r[d-1],r[d]),o.length()>Number.EPSILON){o.normalize();const g=Math.acos(Ln(r[d-1].dot(r[d]),-1,1));a[d].applyMatrix4(l.makeRotationAxis(o,g))}s[d].crossVectors(r[d],a[d])}if(n===!0){let d=Math.acos(Ln(a[0].dot(a[e]),-1,1));d/=e,r[0].dot(o.crossVectors(a[0],a[e]))>0&&(d=-d);for(let g=1;g<=e;g++)a[g].applyMatrix4(l.makeRotationAxis(r[g],d*g)),s[g].crossVectors(r[g],a[g])}return{tangents:r,normals:a,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class tC extends _u{constructor(e=0,n=0,i=1,r=1,a=0,s=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=i,this.yRadius=r,this.aStartAngle=a,this.aEndAngle=s,this.aClockwise=o,this.aRotation=l}getPoint(e,n=new wt){const i=n,r=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const s=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=r;for(;a>r;)a-=r;a<Number.EPSILON&&(s?a=0:a=r),this.aClockwise===!0&&!s&&(a===r?a=-r:a=a-r);const o=this.aStartAngle+e*a;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const u=Math.cos(this.aRotation),f=Math.sin(this.aRotation),h=l-this.aX,d=c-this.aY;l=h*u-d*f+this.aX,c=h*f+d*u+this.aY}return i.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class JJ extends tC{constructor(e,n,i,r,a,s){super(e,n,i,i,r,a,s),this.isArcCurve=!0,this.type="ArcCurve"}}function KP(){let t=0,e=0,n=0,i=0;function r(a,s,o,l){t=a,e=o,n=-3*a+3*s-2*o-l,i=2*a-2*s+o+l}return{initCatmullRom:function(a,s,o,l,c){r(s,o,c*(o-a),c*(l-s))},initNonuniformCatmullRom:function(a,s,o,l,c,u,f){let h=(s-a)/c-(o-a)/(c+u)+(o-s)/u,d=(o-s)/u-(l-s)/(u+f)+(l-o)/f;h*=u,d*=u,r(s,o,h,d)},calc:function(a){const s=a*a,o=s*a;return t+e*a+n*s+i*o}}}const Fw=new te,Ck=new KP,Rk=new KP,kk=new KP;class YP extends _u{constructor(e=[],n=!1,i="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=n,this.curveType=i,this.tension=r}getPoint(e,n=new te){const i=n,r=this.points,a=r.length,s=(a-(this.closed?0:1))*e;let o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:l===0&&o===a-1&&(o=a-2,l=1);let c,u;this.closed||o>0?c=r[(o-1)%a]:(Fw.subVectors(r[0],r[1]).add(r[0]),c=Fw);const f=r[o%a],h=r[(o+1)%a];if(this.closed||o+2<a?u=r[(o+2)%a]:(Fw.subVectors(r[a-1],r[a-2]).add(r[a-1]),u=Fw),this.curveType==="centripetal"||this.curveType==="chordal"){const d=this.curveType==="chordal"?.5:.25;let g=Math.pow(c.distanceToSquared(f),d),b=Math.pow(f.distanceToSquared(h),d),y=Math.pow(h.distanceToSquared(u),d);b<1e-4&&(b=1),g<1e-4&&(g=b),y<1e-4&&(y=b),Ck.initNonuniformCatmullRom(c.x,f.x,h.x,u.x,g,b,y),Rk.initNonuniformCatmullRom(c.y,f.y,h.y,u.y,g,b,y),kk.initNonuniformCatmullRom(c.z,f.z,h.z,u.z,g,b,y)}else this.curveType==="catmullrom"&&(Ck.initCatmullRom(c.x,f.x,h.x,u.x,this.tension),Rk.initCatmullRom(c.y,f.y,h.y,u.y,this.tension),kk.initCatmullRom(c.z,f.z,h.z,u.z,this.tension));return i.set(Ck.calc(l),Rk.calc(l),kk.calc(l)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const r=e.points[n];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let n=0,i=this.points.length;n<i;n++){const r=this.points[n];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const r=e.points[n];this.points.push(new te().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function dj(t,e,n,i,r){const a=(i-e)*.5,s=(r-n)*.5,o=t*t,l=t*o;return(2*n-2*i+a+s)*l+(-3*n+3*i-2*a-s)*o+a*t+n}function n0e(t,e){const n=1-t;return n*n*e}function i0e(t,e){return 2*(1-t)*t*e}function r0e(t,e){return t*t*e}function i1(t,e,n,i){return n0e(t,e)+i0e(t,n)+r0e(t,i)}function a0e(t,e){const n=1-t;return n*n*n*e}function s0e(t,e){const n=1-t;return 3*n*n*t*e}function o0e(t,e){return 3*(1-t)*t*t*e}function l0e(t,e){return t*t*t*e}function r1(t,e,n,i,r){return a0e(t,e)+s0e(t,n)+o0e(t,i)+l0e(t,r)}class JP extends _u{constructor(e=new wt,n=new wt,i=new wt,r=new wt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=n,this.v2=i,this.v3=r}getPoint(e,n=new wt){const i=n,r=this.v0,a=this.v1,s=this.v2,o=this.v3;return i.set(r1(e,r.x,a.x,s.x,o.x),r1(e,r.y,a.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class $P extends _u{constructor(e=new te,n=new te,i=new te,r=new te){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=n,this.v2=i,this.v3=r}getPoint(e,n=new te){const i=n,r=this.v0,a=this.v1,s=this.v2,o=this.v3;return i.set(r1(e,r.x,a.x,s.x,o.x),r1(e,r.y,a.y,s.y,o.y),r1(e,r.z,a.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class ZP extends _u{constructor(e=new wt,n=new wt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=n}getPoint(e,n=new wt){const i=n;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new wt){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class $J extends _u{constructor(e=new te,n=new te){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=n}getPoint(e,n=new te){const i=n;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new te){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class QP extends _u{constructor(e=new wt,n=new wt,i=new wt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=n,this.v2=i}getPoint(e,n=new wt){const i=n,r=this.v0,a=this.v1,s=this.v2;return i.set(i1(e,r.x,a.x,s.x),i1(e,r.y,a.y,s.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class eU extends _u{constructor(e=new te,n=new te,i=new te){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=n,this.v2=i}getPoint(e,n=new te){const i=n,r=this.v0,a=this.v1,s=this.v2;return i.set(i1(e,r.x,a.x,s.x),i1(e,r.y,a.y,s.y),i1(e,r.z,a.z,s.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class tU extends _u{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,n=new wt){const i=n,r=this.points,a=(r.length-1)*e,s=Math.floor(a),o=a-s,l=r[s===0?s:s-1],c=r[s],u=r[s>r.length-2?r.length-1:s+1],f=r[s>r.length-3?r.length-1:s+2];return i.set(dj(o,l.x,c.x,u.x,f.x),dj(o,l.y,c.y,u.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const r=e.points[n];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let n=0,i=this.points.length;n<i;n++){const r=this.points[n];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const r=e.points[n];this.points.push(new wt().fromArray(r))}return this}}var Z2=Object.freeze({__proto__:null,ArcCurve:JJ,CatmullRomCurve3:YP,CubicBezierCurve:JP,CubicBezierCurve3:$P,EllipseCurve:tC,LineCurve:ZP,LineCurve3:$J,QuadraticBezierCurve:QP,QuadraticBezierCurve3:eU,SplineCurve:tU});class ZJ extends _u{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),n=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(n)){const i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new Z2[i](n,e))}return this}getPoint(e,n){const i=e*this.getLength(),r=this.getCurveLengths();let a=0;for(;a<r.length;){if(r[a]>=i){const s=r[a]-i,o=this.curves[a],l=o.getLength(),c=l===0?0:1-s/l;return o.getPointAt(c,n)}a++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let i=0,r=this.curves.length;i<r;i++)n+=this.curves[i].getLength(),e.push(n);return this.cacheLengths=e,e}getSpacedPoints(e=40){const n=[];for(let i=0;i<=e;i++)n.push(this.getPoint(i/e));return this.autoClose&&n.push(n[0]),n}getPoints(e=12){const n=[];let i;for(let r=0,a=this.curves;r<a.length;r++){const s=a[r],o=s.isEllipseCurve?e*2:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,l=s.getPoints(o);for(let c=0;c<l.length;c++){const u=l[c];i&&i.equals(u)||(n.push(u),i=u)}}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,i=e.curves.length;n<i;n++){const r=e.curves[n];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let n=0,i=this.curves.length;n<i;n++){const r=this.curves[n];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let n=0,i=e.curves.length;n<i;n++){const r=e.curves[n];this.curves.push(new Z2[r.type]().fromJSON(r))}return this}}class Q2 extends ZJ{constructor(e){super(),this.type="Path",this.currentPoint=new wt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let n=1,i=e.length;n<i;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){return this.currentPoint.set(e,n),this}lineTo(e,n){const i=new ZP(this.currentPoint.clone(),new wt(e,n));return this.curves.push(i),this.currentPoint.set(e,n),this}quadraticCurveTo(e,n,i,r){const a=new QP(this.currentPoint.clone(),new wt(e,n),new wt(i,r));return this.curves.push(a),this.currentPoint.set(i,r),this}bezierCurveTo(e,n,i,r,a,s){const o=new JP(this.currentPoint.clone(),new wt(e,n),new wt(i,r),new wt(a,s));return this.curves.push(o),this.currentPoint.set(a,s),this}splineThru(e){const n=[this.currentPoint.clone()].concat(e),i=new tU(n);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,n,i,r,a,s){const o=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+o,n+l,i,r,a,s),this}absarc(e,n,i,r,a,s){return this.absellipse(e,n,i,i,r,a,s),this}ellipse(e,n,i,r,a,s,o,l){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+c,n+u,i,r,a,s,o,l),this}absellipse(e,n,i,r,a,s,o,l){const c=new tC(e,n,i,r,a,s,o,l);if(this.curves.length>0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Cm extends Q2{constructor(e){super(e),this.uuid=wl(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let i=0,r=this.holes.length;i<r;i++)n[i]=this.holes[i].getPoints(e);return n}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let n=0,i=e.holes.length;n<i;n++){const r=e.holes[n];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let n=0,i=this.holes.length;n<i;n++){const r=this.holes[n];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let n=0,i=e.holes.length;n<i;n++){const r=e.holes[n];this.holes.push(new Q2().fromJSON(r))}return this}}function c0e(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let a=QJ(t,0,r,n,!0);const s=[];if(!a||a.next===a.prev)return s;let o,l,c;if(i&&(a=p0e(t,e,a,n)),t.length>80*n){o=1/0,l=1/0;let u=-1/0,f=-1/0;for(let h=n;h<r;h+=n){const d=t[h],g=t[h+1];d<o&&(o=d),g<l&&(l=g),d>u&&(u=d),g>f&&(f=g)}c=Math.max(u-o,f-l),c=c!==0?32767/c:0}return W1(a,s,n,o,l,c,0),s}function QJ(t,e,n,i,r){let a;if(r===M0e(t,e,n,i)>0)for(let s=e;s<n;s+=i)a=pj(s/i|0,t[s],t[s+1],a);else for(let s=n-i;s>=e;s-=i)a=pj(s/i|0,t[s],t[s+1],a);return a&&sv(a,a.next)&&(X1(a),a=a.next),a}function Hm(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(sv(n,n.next)||na(n.prev,n,n.next)===0)){if(X1(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function W1(t,e,n,i,r,a,s){if(!t)return;!s&&a&&y0e(t,i,r,a);let o=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(a?f0e(t,i,r,a):u0e(t)){e.push(l.i,t.i,c.i),X1(t),t=c.next,o=c.next;continue}if(t=c,t===o){s?s===1?(t=h0e(Hm(t),e),W1(t,e,n,i,r,a,2)):s===2&&d0e(t,e,n,i,r,a):W1(Hm(t),e,n,i,r,a,1);break}}}function u0e(t){const e=t.prev,n=t,i=t.next;if(na(e,n,i)>=0)return!1;const r=e.x,a=n.x,s=i.x,o=e.y,l=n.y,c=i.y,u=Math.min(r,a,s),f=Math.min(o,l,c),h=Math.max(r,a,s),d=Math.max(o,l,c);let g=i.next;for(;g!==e;){if(g.x>=u&&g.x<=h&&g.y>=f&&g.y<=d&&Mx(r,o,a,l,s,c,g.x,g.y)&&na(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function f0e(t,e,n,i){const r=t.prev,a=t,s=t.next;if(na(r,a,s)>=0)return!1;const o=r.x,l=a.x,c=s.x,u=r.y,f=a.y,h=s.y,d=Math.min(o,l,c),g=Math.min(u,f,h),b=Math.max(o,l,c),y=Math.max(u,f,h),p=$O(d,g,e,n,i),x=$O(b,y,e,n,i);let _=t.prevZ,w=t.nextZ;for(;_&&_.z>=p&&w&&w.z<=x;){if(_.x>=d&&_.x<=b&&_.y>=g&&_.y<=y&&_!==r&&_!==s&&Mx(o,u,l,f,c,h,_.x,_.y)&&na(_.prev,_,_.next)>=0||(_=_.prevZ,w.x>=d&&w.x<=b&&w.y>=g&&w.y<=y&&w!==r&&w!==s&&Mx(o,u,l,f,c,h,w.x,w.y)&&na(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;_&&_.z>=p;){if(_.x>=d&&_.x<=b&&_.y>=g&&_.y<=y&&_!==r&&_!==s&&Mx(o,u,l,f,c,h,_.x,_.y)&&na(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;w&&w.z<=x;){if(w.x>=d&&w.x<=b&&w.y>=g&&w.y<=y&&w!==r&&w!==s&&Mx(o,u,l,f,c,h,w.x,w.y)&&na(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function h0e(t,e){let n=t;do{const i=n.prev,r=n.next.next;!sv(i,r)&&t$(i,n,n.next,r)&&q1(i,r)&&q1(r,i)&&(e.push(i.i,n.i,r.i),X1(n),X1(n.next),n=t=r),n=n.next}while(n!==t);return Hm(n)}function d0e(t,e,n,i,r,a){let s=t;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&S0e(s,o)){let l=n$(s,o);s=Hm(s,s.next),l=Hm(l,l.next),W1(s,e,n,i,r,a,0),W1(l,e,n,i,r,a,0);return}o=o.next}s=s.next}while(s!==t)}function p0e(t,e,n,i){const r=[];for(let a=0,s=e.length;a<s;a++){const o=e[a]*i,l=a<s-1?e[a+1]*i:t.length,c=QJ(t,o,l,i,!1);c===c.next&&(c.steiner=!0),r.push(_0e(c))}r.sort(m0e);for(let a=0;a<r.length;a++)n=g0e(r[a],n);return n}function m0e(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const i=(t.next.y-t.y)/(t.next.x-t.x),r=(e.next.y-e.y)/(e.next.x-e.x);n=i-r}return n}function g0e(t,e){const n=b0e(t,e);if(!n)return e;const i=n$(n,t);return Hm(i,i.next),Hm(n,n.next)}function b0e(t,e){let n=e;const i=t.x,r=t.y;let a=-1/0,s;if(sv(t,n))return n;do{if(sv(t,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const f=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=i&&f>a&&(a=f,s=n.x<n.next.x?n:n.next,f===i))return s}n=n.next}while(n!==e);if(!s)return null;const o=s,l=s.x,c=s.y;let u=1/0;n=s;do{if(i>=n.x&&n.x>=l&&i!==n.x&&e$(r<c?i:a,r,l,c,r<c?a:i,r,n.x,n.y)){const f=Math.abs(r-n.y)/(i-n.x);q1(n,t)&&(f<u||f===u&&(n.x>s.x||n.x===s.x&&v0e(s,n)))&&(s=n,u=f)}n=n.next}while(n!==o);return s}function v0e(t,e){return na(t.prev,t,e.prev)<0&&na(e.next,t,t.next)<0}function y0e(t,e,n,i){let r=t;do r.z===0&&(r.z=$O(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,x0e(r)}function x0e(t){let e,n=1;do{let i=t,r;t=null;let a=null;for(e=0;i;){e++;let s=i,o=0;for(let c=0;c<n&&(o++,s=s.nextZ,!!s);c++);let l=n;for(;o>0||l>0&&s;)o!==0&&(l===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,o--):(r=s,s=s.nextZ,l--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;i=s}a.nextZ=null,n*=2}while(e>1);return t}function $O(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function _0e(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function e$(t,e,n,i,r,a,s,o){return(r-s)*(e-o)>=(t-s)*(a-o)&&(t-s)*(i-o)>=(n-s)*(e-o)&&(n-s)*(a-o)>=(r-s)*(i-o)}function Mx(t,e,n,i,r,a,s,o){return!(t===s&&e===o)&&e$(t,e,n,i,r,a,s,o)}function S0e(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!w0e(t,e)&&(q1(t,e)&&q1(e,t)&&E0e(t,e)&&(na(t.prev,t,e.prev)||na(t,e.prev,e))||sv(t,e)&&na(t.prev,t,t.next)>0&&na(e.prev,e,e.next)>0)}function na(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function sv(t,e){return t.x===e.x&&t.y===e.y}function t$(t,e,n,i){const r=zw(na(t,e,n)),a=zw(na(t,e,i)),s=zw(na(n,i,t)),o=zw(na(n,i,e));return!!(r!==a&&s!==o||r===0&&Bw(t,n,e)||a===0&&Bw(t,i,e)||s===0&&Bw(n,t,i)||o===0&&Bw(n,e,i))}function Bw(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function zw(t){return t>0?1:t<0?-1:0}function w0e(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&t$(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function q1(t,e){return na(t.prev,t,t.next)<0?na(t,e,t.next)>=0&&na(t,t.prev,e)>=0:na(t,e,t.prev)<0||na(t,t.next,e)<0}function E0e(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,a=(t.y+e.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function n$(t,e){const n=ZO(t.i,t.x,t.y),i=ZO(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function pj(t,e,n,i){const r=ZO(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X1(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ZO(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function M0e(t,e,n,i){let r=0;for(let a=e,s=n-i;a<n;a+=i)r+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return r}class T0e{static triangulate(e,n,i=2){return c0e(e,n,i)}}class lu{static area(e){const n=e.length;let i=0;for(let r=n-1,a=0;a<n;r=a++)i+=e[r].x*e[a].y-e[a].x*e[r].y;return i*.5}static isClockWise(e){return lu.area(e)<0}static triangulateShape(e,n){const i=[],r=[],a=[];mj(e),gj(i,e);let s=e.length;n.forEach(mj);for(let l=0;l<n.length;l++)r.push(s),s+=n[l].length,gj(i,n[l]);const o=T0e.triangulate(i,r);for(let l=0;l<o.length;l+=3)a.push(o.slice(l,l+3));return a}}function mj(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function gj(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class nC extends Dn{constructor(e=new Cm([new wt(.5,.5),new wt(-.5,.5),new wt(-.5,-.5),new wt(.5,-.5)]),n={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:n},e=Array.isArray(e)?e:[e];const i=this,r=[],a=[];for(let o=0,l=e.length;o<l;o++){const c=e[o];s(c)}this.setAttribute("position",new fn(r,3)),this.setAttribute("uv",new fn(a,2)),this.computeVertexNormals();function s(o){const l=[],c=n.curveSegments!==void 0?n.curveSegments:12,u=n.steps!==void 0?n.steps:1,f=n.depth!==void 0?n.depth:1;let h=n.bevelEnabled!==void 0?n.bevelEnabled:!0,d=n.bevelThickness!==void 0?n.bevelThickness:.2,g=n.bevelSize!==void 0?n.bevelSize:d-.1,b=n.bevelOffset!==void 0?n.bevelOffset:0,y=n.bevelSegments!==void 0?n.bevelSegments:3;const p=n.extrudePath,x=n.UVGenerator!==void 0?n.UVGenerator:A0e;let _,w=!1,M,S,A,C;p&&(_=p.getSpacedPoints(u),w=!0,h=!1,M=p.computeFrenetFrames(u,!1),S=new te,A=new te,C=new te),h||(y=0,d=0,g=0,b=0);const D=o.extractPoints(c);let R=D.shape;const N=D.holes;if(!lu.isClockWise(R)){R=R.reverse();for(let Fe=0,Ie=N.length;Fe<Ie;Fe++){const qe=N[Fe];lu.isClockWise(qe)&&(N[Fe]=qe.reverse())}}function j(Fe){const qe=10000000000000001e-36;let we=Fe[0];for(let Te=1;Te<=Fe.length;Te++){const Ae=Te%Fe.length,Pe=Fe[Ae],He=Pe.x-we.x,$e=Pe.y-we.y,ie=He*He+$e*$e,K=Math.max(Math.abs(Pe.x),Math.abs(Pe.y),Math.abs(we.x),Math.abs(we.y)),ce=qe*K*K;if(ie<=ce){Fe.splice(Ae,1),Te--;continue}we=Pe}}j(R),N.forEach(j);const z=N.length,q=R;for(let Fe=0;Fe<z;Fe++){const Ie=N[Fe];R=R.concat(Ie)}function B(Fe,Ie,qe){return Ie||console.error("THREE.ExtrudeGeometry: vec does not exist"),Fe.clone().addScaledVector(Ie,qe)}const G=R.length;function H(Fe,Ie,qe){let we,Te,Ae;const Pe=Fe.x-Ie.x,He=Fe.y-Ie.y,$e=qe.x-Fe.x,ie=qe.y-Fe.y,K=Pe*Pe+He*He,ce=Pe*ie-He*$e;if(Math.abs(ce)>Number.EPSILON){const fe=Math.sqrt(K),me=Math.sqrt($e*$e+ie*ie),$=Ie.x-He/fe,Le=Ie.y+Pe/fe,Xe=qe.x-ie/me,mt=qe.y+$e/me,Ge=((Xe-$)*ie-(mt-Le)*$e)/(Pe*ie-He*$e);we=$+Pe*Ge-Fe.x,Te=Le+He*Ge-Fe.y;const Je=we*we+Te*Te;if(Je<=2)return new wt(we,Te);Ae=Math.sqrt(Je/2)}else{let fe=!1;Pe>Number.EPSILON?$e>Number.EPSILON&&(fe=!0):Pe<-Number.EPSILON?$e<-Number.EPSILON&&(fe=!0):Math.sign(He)===Math.sign(ie)&&(fe=!0),fe?(we=-He,Te=Pe,Ae=Math.sqrt(K)):(we=Pe,Te=He,Ae=Math.sqrt(K/2))}return new wt(we/Ae,Te/Ae)}const W=[];for(let Fe=0,Ie=q.length,qe=Ie-1,we=Fe+1;Fe<Ie;Fe++,qe++,we++)qe===Ie&&(qe=0),we===Ie&&(we=0),W[Fe]=H(q[Fe],q[qe],q[we]);const F=[];let Y,Z=W.concat();for(let Fe=0,Ie=z;Fe<Ie;Fe++){const qe=N[Fe];Y=[];for(let we=0,Te=qe.length,Ae=Te-1,Pe=we+1;we<Te;we++,Ae++,Pe++)Ae===Te&&(Ae=0),Pe===Te&&(Pe=0),Y[we]=H(qe[we],qe[Ae],qe[Pe]);F.push(Y),Z=Z.concat(Y)}let V;if(y===0)V=lu.triangulateShape(q,N);else{const Fe=[],Ie=[];for(let qe=0;qe<y;qe++){const we=qe/y,Te=d*Math.cos(we*Math.PI/2),Ae=g*Math.sin(we*Math.PI/2)+b;for(let Pe=0,He=q.length;Pe<He;Pe++){const $e=B(q[Pe],W[Pe],Ae);ke($e.x,$e.y,-Te),we===0&&Fe.push($e)}for(let Pe=0,He=z;Pe<He;Pe++){const $e=N[Pe];Y=F[Pe];const ie=[];for(let K=0,ce=$e.length;K<ce;K++){const fe=B($e[K],Y[K],Ae);ke(fe.x,fe.y,-Te),we===0&&ie.push(fe)}we===0&&Ie.push(ie)}}V=lu.triangulateShape(Fe,Ie)}const de=V.length,se=g+b;for(let Fe=0;Fe<G;Fe++){const Ie=h?B(R[Fe],Z[Fe],se):R[Fe];w?(A.copy(M.normals[0]).multiplyScalar(Ie.x),S.copy(M.binormals[0]).multiplyScalar(Ie.y),C.copy(_[0]).add(A).add(S),ke(C.x,C.y,C.z)):ke(Ie.x,Ie.y,0)}for(let Fe=1;Fe<=u;Fe++)for(let Ie=0;Ie<G;Ie++){const qe=h?B(R[Ie],Z[Ie],se):R[Ie];w?(A.copy(M.normals[Fe]).multiplyScalar(qe.x),S.copy(M.binormals[Fe]).multiplyScalar(qe.y),C.copy(_[Fe]).add(A).add(S),ke(C.x,C.y,C.z)):ke(qe.x,qe.y,f/u*Fe)}for(let Fe=y-1;Fe>=0;Fe--){const Ie=Fe/y,qe=d*Math.cos(Ie*Math.PI/2),we=g*Math.sin(Ie*Math.PI/2)+b;for(let Te=0,Ae=q.length;Te<Ae;Te++){const Pe=B(q[Te],W[Te],we);ke(Pe.x,Pe.y,f+qe)}for(let Te=0,Ae=N.length;Te<Ae;Te++){const Pe=N[Te];Y=F[Te];for(let He=0,$e=Pe.length;He<$e;He++){const ie=B(Pe[He],Y[He],we);w?ke(ie.x,ie.y+_[u-1].y,_[u-1].x+qe):ke(ie.x,ie.y,f+qe)}}}oe(),ue();function oe(){const Fe=r.length/3;if(h){let Ie=0,qe=G*Ie;for(let we=0;we<de;we++){const Te=V[we];Ne(Te[2]+qe,Te[1]+qe,Te[0]+qe)}Ie=u+y*2,qe=G*Ie;for(let we=0;we<de;we++){const Te=V[we];Ne(Te[0]+qe,Te[1]+qe,Te[2]+qe)}}else{for(let Ie=0;Ie<de;Ie++){const qe=V[Ie];Ne(qe[2],qe[1],qe[0])}for(let Ie=0;Ie<de;Ie++){const qe=V[Ie];Ne(qe[0]+G*u,qe[1]+G*u,qe[2]+G*u)}}i.addGroup(Fe,r.length/3-Fe,0)}function ue(){const Fe=r.length/3;let Ie=0;_e(q,Ie),Ie+=q.length;for(let qe=0,we=N.length;qe<we;qe++){const Te=N[qe];_e(Te,Ie),Ie+=Te.length}i.addGroup(Fe,r.length/3-Fe,1)}function _e(Fe,Ie){let qe=Fe.length;for(;--qe>=0;){const we=qe;let Te=qe-1;Te<0&&(Te=Fe.length-1);for(let Ae=0,Pe=u+y*2;Ae<Pe;Ae++){const He=G*Ae,$e=G*(Ae+1),ie=Ie+we+He,K=Ie+Te+He,ce=Ie+Te+$e,fe=Ie+we+$e;Ue(ie,K,ce,fe)}}}function ke(Fe,Ie,qe){l.push(Fe),l.push(Ie),l.push(qe)}function Ne(Fe,Ie,qe){ze(Fe),ze(Ie),ze(qe);const we=r.length/3,Te=x.generateTopUV(i,r,we-3,we-2,we-1);pe(Te[0]),pe(Te[1]),pe(Te[2])}function Ue(Fe,Ie,qe,we){ze(Fe),ze(Ie),ze(we),ze(Ie),ze(qe),ze(we);const Te=r.length/3,Ae=x.generateSideWallUV(i,r,Te-6,Te-3,Te-2,Te-1);pe(Ae[0]),pe(Ae[1]),pe(Ae[3]),pe(Ae[1]),pe(Ae[2]),pe(Ae[3])}function ze(Fe){r.push(l[Fe*3+0]),r.push(l[Fe*3+1]),r.push(l[Fe*3+2])}function pe(Fe){a.push(Fe.x),a.push(Fe.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes,i=this.parameters.options;return C0e(n,i,e)}static fromJSON(e,n){const i=[];for(let a=0,s=e.shapes.length;a<s;a++){const o=n[e.shapes[a]];i.push(o)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Z2[r.type]().fromJSON(r)),new nC(i,e.options)}}const A0e={generateTopUV:function(t,e,n,i,r){const a=e[n*3],s=e[n*3+1],o=e[i*3],l=e[i*3+1],c=e[r*3],u=e[r*3+1];return[new wt(a,s),new wt(o,l),new wt(c,u)]},generateSideWallUV:function(t,e,n,i,r,a){const s=e[n*3],o=e[n*3+1],l=e[n*3+2],c=e[i*3],u=e[i*3+1],f=e[i*3+2],h=e[r*3],d=e[r*3+1],g=e[r*3+2],b=e[a*3],y=e[a*3+1],p=e[a*3+2];return Math.abs(o-u)<Math.abs(s-c)?[new wt(s,1-l),new wt(c,1-f),new wt(h,1-g),new wt(b,1-p)]:[new wt(o,1-l),new wt(u,1-f),new wt(d,1-g),new wt(y,1-p)]}};function C0e(t,e,n){if(n.shapes=[],Array.isArray(t))for(let i=0,r=t.length;i<r;i++){const a=t[i];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return n.options=Object.assign({},e),e.extrudePath!==void 0&&(n.options.extrudePath=e.extrudePath.toJSON()),n}class Gv extends Yd{constructor(e=1,n=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],a=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,a,e,n),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new Gv(e.radius,e.detail)}}class iC extends Dn{constructor(e=[new wt(0,-.5),new wt(.5,0),new wt(0,.5)],n=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:i,phiLength:r},n=Math.floor(n),r=Ln(r,0,Math.PI*2);const a=[],s=[],o=[],l=[],c=[],u=1/n,f=new te,h=new wt,d=new te,g=new te,b=new te;let y=0,p=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:y=e[x+1].x-e[x].x,p=e[x+1].y-e[x].y,d.x=p*1,d.y=-y,d.z=p*0,b.copy(d),d.normalize(),l.push(d.x,d.y,d.z);break;case e.length-1:l.push(b.x,b.y,b.z);break;default:y=e[x+1].x-e[x].x,p=e[x+1].y-e[x].y,d.x=p*1,d.y=-y,d.z=p*0,g.copy(d),d.x+=b.x,d.y+=b.y,d.z+=b.z,d.normalize(),l.push(d.x,d.y,d.z),b.copy(g)}for(let x=0;x<=n;x++){const _=i+x*u*r,w=Math.sin(_),M=Math.cos(_);for(let S=0;S<=e.length-1;S++){f.x=e[S].x*w,f.y=e[S].y,f.z=e[S].x*M,s.push(f.x,f.y,f.z),h.x=x/n,h.y=S/(e.length-1),o.push(h.x,h.y);const A=l[3*S+0]*w,C=l[3*S+1],D=l[3*S+0]*M;c.push(A,C,D)}}for(let x=0;x<n;x++)for(let _=0;_<e.length-1;_++){const w=_+x*e.length,M=w,S=w+e.length,A=w+e.length+1,C=w+1;a.push(M,S,C),a.push(A,C,S)}this.setIndex(a),this.setAttribute("position",new fn(s,3)),this.setAttribute("uv",new fn(o,2)),this.setAttribute("normal",new fn(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new iC(e.points,e.segments,e.phiStart,e.phiLength)}}class j_ extends Yd{constructor(e=1,n=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,n),this.type="OctahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new j_(e.radius,e.detail)}}class Ol extends Dn{constructor(e=1,n=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:i,heightSegments:r};const a=e/2,s=n/2,o=Math.floor(i),l=Math.floor(r),c=o+1,u=l+1,f=e/o,h=n/l,d=[],g=[],b=[],y=[];for(let p=0;p<u;p++){const x=p*h-s;for(let _=0;_<c;_++){const w=_*f-a;g.push(w,-x,0),b.push(0,0,1),y.push(_/o),y.push(1-p/l)}}for(let p=0;p<l;p++)for(let x=0;x<o;x++){const _=x+c*p,w=x+c*(p+1),M=x+1+c*(p+1),S=x+1+c*p;d.push(_,w,S),d.push(w,M,S)}this.setIndex(d),this.setAttribute("position",new fn(g,3)),this.setAttribute("normal",new fn(b,3)),this.setAttribute("uv",new fn(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ol(e.width,e.height,e.widthSegments,e.heightSegments)}}class rC extends Dn{constructor(e=.5,n=1,i=32,r=1,a=0,s=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:n,thetaSegments:i,phiSegments:r,thetaStart:a,thetaLength:s},i=Math.max(3,i),r=Math.max(1,r);const o=[],l=[],c=[],u=[];let f=e;const h=(n-e)/r,d=new te,g=new wt;for(let b=0;b<=r;b++){for(let y=0;y<=i;y++){const p=a+y/i*s;d.x=f*Math.cos(p),d.y=f*Math.sin(p),l.push(d.x,d.y,d.z),c.push(0,0,1),g.x=(d.x/n+1)/2,g.y=(d.y/n+1)/2,u.push(g.x,g.y)}f+=h}for(let b=0;b<r;b++){const y=b*(i+1);for(let p=0;p<i;p++){const x=p+y,_=x,w=x+i+1,M=x+i+2,S=x+1;o.push(_,w,S),o.push(w,M,S)}}this.setIndex(o),this.setAttribute("position",new fn(l,3)),this.setAttribute("normal",new fn(c,3)),this.setAttribute("uv",new fn(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rC(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class aC extends Dn{constructor(e=new Cm([new wt(0,.5),new wt(-.5,-.5),new wt(.5,-.5)]),n=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:n};const i=[],r=[],a=[],s=[];let o=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let u=0;u<e.length;u++)c(e[u]),this.addGroup(o,l,u),o+=l,l=0;this.setIndex(i),this.setAttribute("position",new fn(r,3)),this.setAttribute("normal",new fn(a,3)),this.setAttribute("uv",new fn(s,2));function c(u){const f=r.length/3,h=u.extractPoints(n);let d=h.shape;const g=h.holes;lu.isClockWise(d)===!1&&(d=d.reverse());for(let y=0,p=g.length;y<p;y++){const x=g[y];lu.isClockWise(x)===!0&&(g[y]=x.reverse())}const b=lu.triangulateShape(d,g);for(let y=0,p=g.length;y<p;y++){const x=g[y];d=d.concat(x)}for(let y=0,p=d.length;y<p;y++){const x=d[y];r.push(x.x,x.y,0),a.push(0,0,1),s.push(x.x,x.y)}for(let y=0,p=b.length;y<p;y++){const x=b[y],_=x[0]+f,w=x[1]+f,M=x[2]+f;i.push(_,w,M),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes;return R0e(n,e)}static fromJSON(e,n){const i=[];for(let r=0,a=e.shapes.length;r<a;r++){const s=n[e.shapes[r]];i.push(s)}return new aC(i,e.curveSegments)}}function R0e(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,i=t.length;n<i;n++){const r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}class Wv extends Dn{constructor(e=1,n=32,i=16,r=0,a=Math.PI*2,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:n,heightSegments:i,phiStart:r,phiLength:a,thetaStart:s,thetaLength:o},n=Math.max(3,Math.floor(n)),i=Math.max(2,Math.floor(i));const l=Math.min(s+o,Math.PI);let c=0;const u=[],f=new te,h=new te,d=[],g=[],b=[],y=[];for(let p=0;p<=i;p++){const x=[],_=p/i;let w=0;p===0&&s===0?w=.5/n:p===i&&l===Math.PI&&(w=-.5/n);for(let M=0;M<=n;M++){const S=M/n;f.x=-e*Math.cos(r+S*a)*Math.sin(s+_*o),f.y=e*Math.cos(s+_*o),f.z=e*Math.sin(r+S*a)*Math.sin(s+_*o),g.push(f.x,f.y,f.z),h.copy(f).normalize(),b.push(h.x,h.y,h.z),y.push(S+w,1-_),x.push(c++)}u.push(x)}for(let p=0;p<i;p++)for(let x=0;x<n;x++){const _=u[p][x+1],w=u[p][x],M=u[p+1][x],S=u[p+1][x+1];(p!==0||s>0)&&d.push(_,w,S),(p!==i-1||l<Math.PI)&&d.push(w,M,S)}this.setIndex(d),this.setAttribute("position",new fn(g,3)),this.setAttribute("normal",new fn(b,3)),this.setAttribute("uv",new fn(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wv(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class sC extends Yd{constructor(e=1,n=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,n),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new sC(e.radius,e.detail)}}class oC extends Dn{constructor(e=1,n=.4,i=12,r=48,a=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:n,radialSegments:i,tubularSegments:r,arc:a},i=Math.floor(i),r=Math.floor(r);const s=[],o=[],l=[],c=[],u=new te,f=new te,h=new te;for(let d=0;d<=i;d++)for(let g=0;g<=r;g++){const b=g/r*a,y=d/i*Math.PI*2;f.x=(e+n*Math.cos(y))*Math.cos(b),f.y=(e+n*Math.cos(y))*Math.sin(b),f.z=n*Math.sin(y),o.push(f.x,f.y,f.z),u.x=e*Math.cos(b),u.y=e*Math.sin(b),h.subVectors(f,u).normalize(),l.push(h.x,h.y,h.z),c.push(g/r),c.push(d/i)}for(let d=1;d<=i;d++)for(let g=1;g<=r;g++){const b=(r+1)*d+g-1,y=(r+1)*(d-1)+g-1,p=(r+1)*(d-1)+g,x=(r+1)*d+g;s.push(b,y,x),s.push(y,p,x)}this.setIndex(s),this.setAttribute("position",new fn(o,3)),this.setAttribute("normal",new fn(l,3)),this.setAttribute("uv",new fn(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new oC(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class lC extends Dn{constructor(e=1,n=.4,i=64,r=8,a=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:n,tubularSegments:i,radialSegments:r,p:a,q:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],c=[],u=[],f=new te,h=new te,d=new te,g=new te,b=new te,y=new te,p=new te;for(let _=0;_<=i;++_){const w=_/i*a*Math.PI*2;x(w,a,s,e,d),x(w+.01,a,s,e,g),y.subVectors(g,d),p.addVectors(g,d),b.crossVectors(y,p),p.crossVectors(b,y),b.normalize(),p.normalize();for(let M=0;M<=r;++M){const S=M/r*Math.PI*2,A=-n*Math.cos(S),C=n*Math.sin(S);f.x=d.x+(A*p.x+C*b.x),f.y=d.y+(A*p.y+C*b.y),f.z=d.z+(A*p.z+C*b.z),l.push(f.x,f.y,f.z),h.subVectors(f,d).normalize(),c.push(h.x,h.y,h.z),u.push(_/i),u.push(M/r)}}for(let _=1;_<=i;_++)for(let w=1;w<=r;w++){const M=(r+1)*(_-1)+(w-1),S=(r+1)*_+(w-1),A=(r+1)*_+w,C=(r+1)*(_-1)+w;o.push(M,S,C),o.push(S,A,C)}this.setIndex(o),this.setAttribute("position",new fn(l,3)),this.setAttribute("normal",new fn(c,3)),this.setAttribute("uv",new fn(u,2));function x(_,w,M,S,A){const C=Math.cos(_),D=Math.sin(_),R=M/w*_,N=Math.cos(R);A.x=S*(2+N)*.5*C,A.y=S*(2+N)*D*.5,A.z=S*Math.sin(R)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lC(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class cC extends Dn{constructor(e=new eU(new te(-1,-1,0),new te(-1,1,0),new te(1,1,0)),n=64,i=1,r=8,a=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:n,radius:i,radialSegments:r,closed:a};const s=e.computeFrenetFrames(n,a);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new te,l=new te,c=new wt;let u=new te;const f=[],h=[],d=[],g=[];b(),this.setIndex(g),this.setAttribute("position",new fn(f,3)),this.setAttribute("normal",new fn(h,3)),this.setAttribute("uv",new fn(d,2));function b(){for(let _=0;_<n;_++)y(_);y(a===!1?n:0),x(),p()}function y(_){u=e.getPointAt(_/n,u);const w=s.normals[_],M=s.binormals[_];for(let S=0;S<=r;S++){const A=S/r*Math.PI*2,C=Math.sin(A),D=-Math.cos(A);l.x=D*w.x+C*M.x,l.y=D*w.y+C*M.y,l.z=D*w.z+C*M.z,l.normalize(),h.push(l.x,l.y,l.z),o.x=u.x+i*l.x,o.y=u.y+i*l.y,o.z=u.z+i*l.z,f.push(o.x,o.y,o.z)}}function p(){for(let _=1;_<=n;_++)for(let w=1;w<=r;w++){const M=(r+1)*(_-1)+(w-1),S=(r+1)*_+(w-1),A=(r+1)*_+w,C=(r+1)*(_-1)+w;g.push(M,S,C),g.push(S,A,C)}}function x(){for(let _=0;_<=n;_++)for(let w=0;w<=r;w++)c.x=_/n,c.y=w/r,d.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new cC(new Z2[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class nU extends Dn{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const n=[],i=new Set,r=new te,a=new te;if(e.index!==null){const s=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,u=l.length;c<u;++c){const f=l[c],h=f.start,d=f.count;for(let g=h,b=h+d;g<b;g+=3)for(let y=0;y<3;y++){const p=o.getX(g+y),x=o.getX(g+(y+1)%3);r.fromBufferAttribute(s,p),a.fromBufferAttribute(s,x),bj(r,a,i)===!0&&(n.push(r.x,r.y,r.z),n.push(a.x,a.y,a.z))}}}else{const s=e.attributes.position;for(let o=0,l=s.count/3;o<l;o++)for(let c=0;c<3;c++){const u=3*o+c,f=3*o+(c+1)%3;r.fromBufferAttribute(s,u),a.fromBufferAttribute(s,f),bj(r,a,i)===!0&&(n.push(r.x,r.y,r.z),n.push(a.x,a.y,a.z))}}this.setAttribute("position",new fn(n,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function bj(t,e,n){const i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return n.has(i)===!0||n.has(r)===!0?!1:(n.add(i),n.add(r),!0)}var vj=Object.freeze({__proto__:null,BoxGeometry:Xd,CapsuleGeometry:ZA,CircleGeometry:QA,ConeGeometry:z_,CylinderGeometry:jm,DodecahedronGeometry:eC,EdgesGeometry:YJ,ExtrudeGeometry:nC,IcosahedronGeometry:Gv,LatheGeometry:iC,OctahedronGeometry:j_,PlaneGeometry:Ol,PolyhedronGeometry:Yd,RingGeometry:rC,ShapeGeometry:aC,SphereGeometry:Wv,TetrahedronGeometry:sC,TorusGeometry:oC,TorusKnotGeometry:lC,TubeGeometry:cC,WireframeGeometry:nU});class lg extends ka{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ut(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class i$ extends ss{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class qv extends ka{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ut(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new mi,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Oc extends qv{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new wt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Ln(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ut(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ut(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ut(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class r$ extends ka{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ut(16777215),this.specular=new Ut(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new mi,this.combine=L_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class eT extends ka{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ut(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class a$ extends ka{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class s$ extends ka{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ut(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ut(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new mi,this.combine=L_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class uC extends ka{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=CJ,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class fC extends ka{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class o$ extends ka{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ut(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qd,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class l$ extends Us{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function lm(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function c$(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function u$(t){function e(r,a){return t[r]-t[a]}const n=t.length,i=new Array(n);for(let r=0;r!==n;++r)i[r]=r;return i.sort(e),i}function QO(t,e,n){const i=t.length,r=new t.constructor(i);for(let a=0,s=0;s!==i;++a){const o=n[a]*e;for(let l=0;l!==e;++l)r[s++]=t[o+l]}return r}function iU(t,e,n,i){let r=1,a=t[0];for(;a!==void 0&&a[i]===void 0;)a=t[r++];if(a===void 0)return;let s=a[i];if(s!==void 0)if(Array.isArray(s))do s=a[i],s!==void 0&&(e.push(a.time),n.push(...s)),a=t[r++];while(a!==void 0);else if(s.toArray!==void 0)do s=a[i],s!==void 0&&(e.push(a.time),s.toArray(n,n.length)),a=t[r++];while(a!==void 0);else do s=a[i],s!==void 0&&(e.push(a.time),n.push(s)),a=t[r++];while(a!==void 0)}function k0e(t,e,n,i,r=30){const a=t.clone();a.name=e;const s=[];for(let l=0;l<a.tracks.length;++l){const c=a.tracks[l],u=c.getValueSize(),f=[],h=[];for(let d=0;d<c.times.length;++d){const g=c.times[d]*r;if(!(g<n||g>=i)){f.push(c.times[d]);for(let b=0;b<u;++b)h.push(c.values[d*u+b])}}f.length!==0&&(c.times=lm(f,c.times.constructor),c.values=lm(h,c.values.constructor),s.push(c))}a.tracks=s;let o=1/0;for(let l=0;l<a.tracks.length;++l)o>a.tracks[l].times[0]&&(o=a.tracks[l].times[0]);for(let l=0;l<a.tracks.length;++l)a.tracks[l].shift(-1*o);return a.resetDuration(),a}function D0e(t,e=0,n=t,i=30){i<=0&&(i=30);const r=n.tracks.length,a=e/i;for(let s=0;s<r;++s){const o=n.tracks[s],l=o.ValueTypeName;if(l==="bool"||l==="string")continue;const c=t.tracks.find(function(p){return p.name===o.name&&p.ValueTypeName===l});if(c===void 0)continue;let u=0;const f=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=f/3);let h=0;const d=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);const g=o.times.length-1;let b;if(a<=o.times[0]){const p=u,x=f-u;b=o.values.slice(p,x)}else if(a>=o.times[g]){const p=g*f+u,x=p+f-u;b=o.values.slice(p,x)}else{const p=o.createInterpolant(),x=u,_=f-u;p.evaluate(a),b=p.resultBuffer.slice(x,_)}l==="quaternion"&&new Vn().fromArray(b).normalize().conjugate().toArray(b);const y=c.times.length;for(let p=0;p<y;++p){const x=p*d+h;if(l==="quaternion")Vn.multiplyQuaternionsFlat(c.values,x,b,0,c.values,x);else{const _=d-h*2;for(let w=0;w<_;++w)c.values[x+w]-=b[w]}}}return t.blendMode=LP,t}class O0e{static convertArray(e,n){return lm(e,n)}static isTypedArray(e){return c$(e)}static getKeyframeOrder(e){return u$(e)}static sortedArray(e,n,i){return QO(e,n,i)}static flattenJSON(e,n,i,r){iU(e,n,i,r)}static subclip(e,n,i,r,a=30){return k0e(e,n,i,r,a)}static makeClipAdditive(e,n=0,i=e,r=30){return D0e(e,n,i,r)}}class Xv{constructor(e,n,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new n.constructor(i),this.sampleValues=n,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let i=this._cachedIndex,r=n[i],a=n[i-1];e:{t:{let s;n:{i:if(!(e<r)){for(let o=i+2;;){if(r===void 0){if(e<a)break i;return i=n.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===o)break;if(a=r,r=n[++i],e<r)break t}s=n.length;break n}if(!(e>=a)){const o=n[1];e<o&&(i=2,a=o);for(let l=i-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=a,a=n[--i-1],e>=a)break t}s=i,i=0;break n}break e}for(;i<s;){const o=i+s>>>1;e<n[o]?s=o:i=o+1}if(r=n[i],a=n[i-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=n.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,a,r)}return this.interpolate_(i,a,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const n=this.resultBuffer,i=this.sampleValues,r=this.valueSize,a=e*r;for(let s=0;s!==r;++s)n[s]=i[a+s];return n}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class f$ extends Xv{constructor(e,n,i,r){super(e,n,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:am,endingEnd:am}}intervalChanged_(e,n,i){const r=this.parameterPositions;let a=e-2,s=e+1,o=r[a],l=r[s];if(o===void 0)switch(this.getSettings_().endingStart){case sm:a=e,o=2*n-i;break;case z1:a=r.length-2,o=n+r[a]-r[a+1];break;default:a=e,o=i}if(l===void 0)switch(this.getSettings_().endingEnd){case sm:s=e,l=2*i-n;break;case z1:s=1,l=i+r[1]-r[0];break;default:s=e-1,l=n}const c=(i-n)*.5,u=this.valueSize;this._weightPrev=c/(n-o),this._weightNext=c/(l-i),this._offsetPrev=a*u,this._offsetNext=s*u}interpolate_(e,n,i,r){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=this._offsetPrev,f=this._offsetNext,h=this._weightPrev,d=this._weightNext,g=(i-n)/(r-n),b=g*g,y=b*g,p=-h*y+2*h*b-h*g,x=(1+h)*y+(-1.5-2*h)*b+(-.5+h)*g+1,_=(-1-d)*y+(1.5+d)*b+.5*g,w=d*y-d*b;for(let M=0;M!==o;++M)a[M]=p*s[u+M]+x*s[c+M]+_*s[l+M]+w*s[f+M];return a}}class rU extends Xv{constructor(e,n,i,r){super(e,n,i,r)}interpolate_(e,n,i,r){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=(i-n)/(r-n),f=1-u;for(let h=0;h!==o;++h)a[h]=s[c+h]*f+s[l+h]*u;return a}}class h$ extends Xv{constructor(e,n,i,r){super(e,n,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ic{constructor(e,n,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(n===void 0||n.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=lm(n,this.TimeBufferType),this.values=lm(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const n=e.constructor;let i;if(n.toJSON!==this.toJSON)i=n.toJSON(e);else{i={name:e.name,times:lm(e.times,Array),values:lm(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new h$(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new rU(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new f$(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let n;switch(e){case Q0:n=this.InterpolantFactoryMethodDiscrete;break;case ev:n=this.InterpolantFactoryMethodLinear;break;case fM:n=this.InterpolantFactoryMethodSmooth;break}if(n===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=n,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Q0;case this.InterpolantFactoryMethodLinear:return ev;case this.InterpolantFactoryMethodSmooth:return fM}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const n=this.times;for(let i=0,r=n.length;i!==r;++i)n[i]+=e}return this}scale(e){if(e!==1){const n=this.times;for(let i=0,r=n.length;i!==r;++i)n[i]*=e}return this}trim(e,n){const i=this.times,r=i.length;let a=0,s=r-1;for(;a!==r&&i[a]<e;)++a;for(;s!==-1&&i[s]>n;)--s;if(++s,a!==0||s!==r){a>=s&&(s=Math.max(s,1),a=s-1);const o=this.getValueSize();this.times=i.slice(a,s),this.values=this.values.slice(a*o,s*o)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,a=i.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let o=0;o!==a;o++){const l=i[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,s),e=!1;break}s=l}if(r!==void 0&&c$(r))for(let o=0,l=r.length;o!==l;++o){const c=r[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===fM,a=e.length-1;let s=1;for(let o=1;o<a;++o){let l=!1;const c=e[o],u=e[o+1];if(c!==u&&(o!==1||c!==e[0]))if(r)l=!0;else{const f=o*i,h=f-i,d=f+i;for(let g=0;g!==i;++g){const b=n[f+g];if(b!==n[h+g]||b!==n[d+g]){l=!0;break}}}if(l){if(o!==s){e[s]=e[o];const f=o*i,h=s*i;for(let d=0;d!==i;++d)n[h+d]=n[f+d]}++s}}if(a>0){e[s]=e[a];for(let o=a*i,l=s*i,c=0;c!==i;++c)n[l+c]=n[o+c];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*i)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),i=this.constructor,r=new i(this.name,e,n);return r.createInterpolant=this.createInterpolant,r}}Ic.prototype.ValueTypeName="";Ic.prototype.TimeBufferType=Float32Array;Ic.prototype.ValueBufferType=Float32Array;Ic.prototype.DefaultInterpolation=ev;class cg extends Ic{constructor(e,n,i){super(e,n,i)}}cg.prototype.ValueTypeName="bool";cg.prototype.ValueBufferType=Array;cg.prototype.DefaultInterpolation=Q0;cg.prototype.InterpolantFactoryMethodLinear=void 0;cg.prototype.InterpolantFactoryMethodSmooth=void 0;class aU extends Ic{constructor(e,n,i,r){super(e,n,i,r)}}aU.prototype.ValueTypeName="color";class Vm extends Ic{constructor(e,n,i,r){super(e,n,i,r)}}Vm.prototype.ValueTypeName="number";class d$ extends Xv{constructor(e,n,i,r){super(e,n,i,r)}interpolate_(e,n,i,r){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=(i-n)/(r-n);let c=e*o;for(let u=c+o;c!==u;c+=4)Vn.slerpFlat(a,0,s,c-o,s,c,l);return a}}class Gm extends Ic{constructor(e,n,i,r){super(e,n,i,r)}InterpolantFactoryMethodLinear(e){return new d$(this.times,this.values,this.getValueSize(),e)}}Gm.prototype.ValueTypeName="quaternion";Gm.prototype.InterpolantFactoryMethodSmooth=void 0;class ug extends Ic{constructor(e,n,i){super(e,n,i)}}ug.prototype.ValueTypeName="string";ug.prototype.ValueBufferType=Array;ug.prototype.DefaultInterpolation=Q0;ug.prototype.InterpolantFactoryMethodLinear=void 0;ug.prototype.InterpolantFactoryMethodSmooth=void 0;class Wm extends Ic{constructor(e,n,i,r){super(e,n,i,r)}}Wm.prototype.ValueTypeName="vector";class ov{constructor(e="",n=-1,i=[],r=jA){this.name=e,this.tracks=i,this.duration=n,this.blendMode=r,this.uuid=wl(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],i=e.tracks,r=1/(e.fps||1);for(let s=0,o=i.length;s!==o;++s)n.push(N0e(i[s]).scale(r));const a=new this(e.name,e.duration,n,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){const n=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,s=i.length;a!==s;++a)n.push(Ic.toJSON(i[a]));return r}static CreateFromMorphTargetSequence(e,n,i,r){const a=n.length,s=[];for(let o=0;o<a;o++){let l=[],c=[];l.push((o+a-1)%a,o,(o+1)%a),c.push(0,1,0);const u=u$(l);l=QO(l,1,u),c=QO(c,1,u),!r&&l[0]===0&&(l.push(a),c.push(c[0])),s.push(new Vm(".morphTargetInfluences["+n[o].name+"]",l,c).scale(1/i))}return new this(e,-1,s)}static findByName(e,n){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===n)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,n,i){const r={},a=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],u=c.name.match(a);if(u&&u.length>1){const f=u[1];let h=r[f];h||(r[f]=h=[]),h.push(c)}}const s=[];for(const o in r)s.push(this.CreateFromMorphTargetSequence(o,r[o],n,i));return s}static parseAnimation(e,n){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,h,d,g,b){if(d.length!==0){const y=[],p=[];iU(d,y,p,g),y.length!==0&&b.push(new f(h,y,p))}},r=[],a=e.name||"default",s=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f<c.length;f++){const h=c[f].keys;if(!(!h||h.length===0))if(h[0].morphTargets){const d={};let g;for(g=0;g<h.length;g++)if(h[g].morphTargets)for(let b=0;b<h[g].morphTargets.length;b++)d[h[g].morphTargets[b]]=-1;for(const b in d){const y=[],p=[];for(let x=0;x!==h[g].morphTargets.length;++x){const _=h[g];y.push(_.time),p.push(_.morphTarget===b?1:0)}r.push(new Vm(".morphTargetInfluence["+b+"]",y,p))}l=d.length*s}else{const d=".bones["+n[f].name+"]";i(Wm,d+".position",h,"pos",r),i(Gm,d+".quaternion",h,"rot",r),i(Wm,d+".scale",h,"scl",r)}}return r.length===0?null:new this(a,l,r,o)}resetDuration(){const e=this.tracks;let n=0;for(let i=0,r=e.length;i!==r;++i){const a=this.tracks[i];n=Math.max(n,a.times[a.times.length-1])}return this.duration=n,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let n=0;n<this.tracks.length;n++)e=e&&this.tracks[n].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function I0e(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Vm;case"vector":case"vector2":case"vector3":case"vector4":return Wm;case"color":return aU;case"quaternion":return Gm;case"bool":case"boolean":return cg;case"string":return ug}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function N0e(t){if(t.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=I0e(t.type);if(t.times===void 0){const n=[],i=[];iU(t.keys,n,i,"value"),t.times=n,t.values=i}return e.parse!==void 0?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const Gu={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class hC{constructor(e,n,i){const r=this;let a=!1,s=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=i,this.abortController=new AbortController,this.itemStart=function(u){o++,a===!1&&r.onStart!==void 0&&r.onStart(u,s,o),a=!0},this.itemEnd=function(u){s++,r.onProgress!==void 0&&r.onProgress(u,s,o),s===o&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,f){return c.push(u,f),this},this.removeHandler=function(u){const f=c.indexOf(u);return f!==-1&&c.splice(f,2),this},this.getHandler=function(u){for(let f=0,h=c.length;f<h;f+=2){const d=c[f],g=c[f+1];if(d.global&&(d.lastIndex=0),d.test(u))return g}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}}}const p$=new hC;class Fs{constructor(e){this.manager=e!==void 0?e:p$,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){const i=this;return new Promise(function(r,a){i.load(e,r,n,a)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Fs.DEFAULT_MATERIAL_NAME="__DEFAULT";const Pf={};class L0e extends Error{constructor(e,n){super(e),this.response=n}}class Os extends Fs{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,n,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=Gu.get(`file:${e}`);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{n&&n(a),this.manager.itemEnd(e)},0),a;if(Pf[e]!==void 0){Pf[e].push({onLoad:n,onProgress:i,onError:r});return}Pf[e]=[],Pf[e].push({onLoad:n,onProgress:i,onError:r});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Pf[e],f=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=h?parseInt(h):0,g=d!==0;let b=0;const y=new ReadableStream({start(p){x();function x(){f.read().then(({done:_,value:w})=>{if(_)p.close();else{b+=w.byteLength;const M=new ProgressEvent("progress",{lengthComputable:g,loaded:b,total:d});for(let S=0,A=u.length;S<A;S++){const C=u[S];C.onProgress&&C.onProgress(M)}p.enqueue(w),x()}},_=>{p.error(_)})}}});return new Response(y)}else throw new L0e(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,o));case"json":return c.json();default:if(o==="")return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(o),h=f&&f[1]?f[1].toLowerCase():void 0,d=new TextDecoder(h);return c.arrayBuffer().then(g=>d.decode(g))}}}).then(c=>{Gu.add(`file:${e}`,c);const u=Pf[e];delete Pf[e];for(let f=0,h=u.length;f<h;f++){const d=u[f];d.onLoad&&d.onLoad(c)}}).catch(c=>{const u=Pf[e];if(u===void 0)throw this.manager.itemError(e),c;delete Pf[e];for(let f=0,h=u.length;f<h;f++){const d=u[f];d.onError&&d.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class P0e extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=new Os(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(l){r?r(l):console.error(l),a.manager.itemError(e)}},i,r)}parse(e){const n=[];for(let i=0;i<e.length;i++){const r=ov.parse(e[i]);n.push(r)}return n}}class U0e extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=[],o=new $A,l=new Os(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(a.withCredentials);let c=0;function u(f){l.load(e[f],function(h){const d=a.parse(h,!0);s[f]={width:d.width,height:d.height,format:d.format,mipmaps:d.mipmaps},c+=1,c===6&&(d.mipmapCount===1&&(o.minFilter=Hi),o.image=s,o.format=d.format,o.needsUpdate=!0,n&&n(o))},i,r)}if(Array.isArray(e))for(let f=0,h=e.length;f<h;++f)u(f);else l.load(e,function(f){const h=a.parse(f,!0);if(h.isCubemap){const d=h.mipmaps.length/h.mipmapCount;for(let g=0;g<d;g++){s[g]={mipmaps:[]};for(let b=0;b<h.mipmapCount;b++)s[g].mipmaps.push(h.mipmaps[g*h.mipmapCount+b]),s[g].format=h.format,s[g].width=h.width,s[g].height=h.height}o.image=s}else o.image.width=h.width,o.image.height=h.height,o.mipmaps=h.mipmaps;h.mipmapCount===1&&(o.minFilter=Hi),o.format=h.format,o.needsUpdate=!0,n&&n(o)},i,r);return o}}const ub=new WeakMap;class K1 extends Fs{constructor(e){super(e)}load(e,n,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=Gu.get(`image:${e}`);if(s!==void 0){if(s.complete===!0)a.manager.itemStart(e),setTimeout(function(){n&&n(s),a.manager.itemEnd(e)},0);else{let f=ub.get(s);f===void 0&&(f=[],ub.set(s,f)),f.push({onLoad:n,onError:r})}return s}const o=G1("img");function l(){u(),n&&n(this);const f=ub.get(this)||[];for(let h=0;h<f.length;h++){const d=f[h];d.onLoad&&d.onLoad(this)}ub.delete(this),a.manager.itemEnd(e)}function c(f){u(),r&&r(f),Gu.remove(`image:${e}`);const h=ub.get(this)||[];for(let d=0;d<h.length;d++){const g=h[d];g.onError&&g.onError(f)}ub.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function u(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),Gu.add(`image:${e}`,o),a.manager.itemStart(e),o.src=e,o}}class m$ extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=new U_;a.colorSpace=Es;const s=new K1(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function l(c){s.load(e[c],function(u){a.images[c]=u,o++,o===6&&(a.needsUpdate=!0,n&&n(a))},void 0,r)}for(let c=0;c<e.length;++c)l(c);return a}}class sU extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=new rs,o=new Os(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(a.withCredentials),o.load(e,function(l){let c;try{c=a.parse(l)}catch(u){if(r!==void 0)r(u);else{console.error(u);return}}c.image!==void 0?s.image=c.image:c.data!==void 0&&(s.image.width=c.width,s.image.height=c.height,s.image.data=c.data),s.wrapS=c.wrapS!==void 0?c.wrapS:ba,s.wrapT=c.wrapT!==void 0?c.wrapT:ba,s.magFilter=c.magFilter!==void 0?c.magFilter:Hi,s.minFilter=c.minFilter!==void 0?c.minFilter:Hi,s.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(s.colorSpace=c.colorSpace),c.flipY!==void 0&&(s.flipY=c.flipY),c.format!==void 0&&(s.format=c.format),c.type!==void 0&&(s.type=c.type),c.mipmaps!==void 0&&(s.mipmaps=c.mipmaps,s.minFilter=mc),c.mipmapCount===1&&(s.minFilter=Hi),c.generateMipmaps!==void 0&&(s.generateMipmaps=c.generateMipmaps),s.needsUpdate=!0,n&&n(s,c)},i,r),s}}class lv extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=new nr,s=new K1(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(o){a.image=o,a.needsUpdate=!0,n!==void 0&&n(a)},i,r),a}}class Jd extends Ni{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new Ut(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class g$ extends Jd{constructor(e,n,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Ni.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ut(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const Dk=new Ot,yj=new te,xj=new te;class oU{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new wt(512,512),this.mapType=To,this.map=null,this.mapPass=null,this.matrix=new Ot,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Kd,this._frameExtents=new wt(1,1),this._viewportCount=1,this._viewports=[new ei(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;yj.setFromMatrixPosition(e.matrixWorld),n.position.copy(yj),xj.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(xj),n.updateMatrixWorld(),Dk.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Dk,n.coordinateSystem,n.reversedDepth),n.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Dk)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class F0e extends oU{constructor(){super(new ta(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,i=nv*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,a=e.distance||n.far;(i!==n.fov||r!==n.aspect||a!==n.far)&&(n.fov=i,n.aspect=r,n.far=a,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class lU extends Jd{constructor(e,n,i=0,r=Math.PI/3,a=0,s=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ni.DEFAULT_UP),this.updateMatrix(),this.target=new Ni,this.distance=i,this.angle=r,this.penumbra=a,this.decay=s,this.map=null,this.shadow=new F0e}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const _j=new Ot,Xy=new te,Ok=new te;class B0e extends oU{constructor(){super(new ta(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new wt(4,2),this._viewportCount=6,this._viewports=[new ei(2,1,1,1),new ei(0,1,1,1),new ei(3,1,1,1),new ei(1,1,1,1),new ei(3,0,1,1),new ei(1,0,1,1)],this._cubeDirections=[new te(1,0,0),new te(-1,0,0),new te(0,0,1),new te(0,0,-1),new te(0,1,0),new te(0,-1,0)],this._cubeUps=[new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,1,0),new te(0,0,1),new te(0,0,-1)]}updateMatrices(e,n=0){const i=this.camera,r=this.matrix,a=e.distance||i.far;a!==i.far&&(i.far=a,i.updateProjectionMatrix()),Xy.setFromMatrixPosition(e.matrixWorld),i.position.copy(Xy),Ok.copy(i.position),Ok.add(this._cubeDirections[n]),i.up.copy(this._cubeUps[n]),i.lookAt(Ok),i.updateMatrixWorld(),r.makeTranslation(-Xy.x,-Xy.y,-Xy.z),_j.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_j,i.coordinateSystem,i.reversedDepth)}}class cU extends Jd{constructor(e,n,i=0,r=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new B0e}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Eh extends GA{constructor(e=-1,n=1,i=1,r=-1,a=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=i,this.bottom=r,this.near=a,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,i,r,a,s){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=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=i-e,s=i+e,o=r+n,l=r-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=c*this.view.offsetX,s=a+c*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}this.projectionMatrix.makeOrthographic(a,s,o,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class z0e extends oU{constructor(){super(new Eh(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class dC extends Jd{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ni.DEFAULT_UP),this.updateMatrix(),this.target=new Ni,this.shadow=new z0e}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class b$ extends Jd{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class v$ extends Jd{constructor(e,n,i=10,r=10){super(e,n),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class y${constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new te)}set(e){for(let n=0;n<9;n++)this.coefficients[n].copy(e[n]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,n){const i=e.x,r=e.y,a=e.z,s=this.coefficients;return n.copy(s[0]).multiplyScalar(.282095),n.addScaledVector(s[1],.488603*r),n.addScaledVector(s[2],.488603*a),n.addScaledVector(s[3],.488603*i),n.addScaledVector(s[4],1.092548*(i*r)),n.addScaledVector(s[5],1.092548*(r*a)),n.addScaledVector(s[6],.315392*(3*a*a-1)),n.addScaledVector(s[7],1.092548*(i*a)),n.addScaledVector(s[8],.546274*(i*i-r*r)),n}getIrradianceAt(e,n){const i=e.x,r=e.y,a=e.z,s=this.coefficients;return n.copy(s[0]).multiplyScalar(.886227),n.addScaledVector(s[1],2*.511664*r),n.addScaledVector(s[2],2*.511664*a),n.addScaledVector(s[3],2*.511664*i),n.addScaledVector(s[4],2*.429043*i*r),n.addScaledVector(s[5],2*.429043*r*a),n.addScaledVector(s[6],.743125*a*a-.247708),n.addScaledVector(s[7],2*.429043*i*a),n.addScaledVector(s[8],.429043*(i*i-r*r)),n}add(e){for(let n=0;n<9;n++)this.coefficients[n].add(e.coefficients[n]);return this}addScaledSH(e,n){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],n);return this}scale(e){for(let n=0;n<9;n++)this.coefficients[n].multiplyScalar(e);return this}lerp(e,n){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],n);return this}equals(e){for(let n=0;n<9;n++)if(!this.coefficients[n].equals(e.coefficients[n]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,n=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,n+r*3);return this}toArray(e=[],n=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,n+r*3);return e}static getBasisAt(e,n){const i=e.x,r=e.y,a=e.z;n[0]=.282095,n[1]=.488603*r,n[2]=.488603*a,n[3]=.488603*i,n[4]=1.092548*i*r,n[5]=1.092548*r*a,n[6]=.315392*(3*a*a-1),n[7]=1.092548*i*a,n[8]=.546274*(i*i-r*r)}}class x$ extends Jd{constructor(e=new y$,n=1){super(void 0,n),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const n=super.toJSON(e);return n.object.sh=this.sh.toArray(),n}}class pC extends Fs{constructor(e){super(e),this.textures={}}load(e,n,i,r){const a=this,s=new Os(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(l){r?r(l):console.error(l),a.manager.itemError(e)}},i,r)}parse(e){const n=this.textures;function i(a){return n[a]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",a),n[a]}const r=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new Ut().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const a in e.uniforms){const s=e.uniforms[a];switch(r.uniforms[a]={},s.type){case"t":r.uniforms[a].value=i(s.value);break;case"c":r.uniforms[a].value=new Ut().setHex(s.value);break;case"v2":r.uniforms[a].value=new wt().fromArray(s.value);break;case"v3":r.uniforms[a].value=new te().fromArray(s.value);break;case"v4":r.uniforms[a].value=new ei().fromArray(s.value);break;case"m3":r.uniforms[a].value=new Kn().fromArray(s.value);break;case"m4":r.uniforms[a].value=new Ot().fromArray(s.value);break;default:r.uniforms[a].value=s.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const a in e.extensions)r.extensions[a]=e.extensions[a];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),r.normalScale=new wt().fromArray(a)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new wt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return pC.createMaterialFromType(e)}static createMaterialFromType(e){const n={ShadowMaterial:lg,SpriteMaterial:GP,RawShaderMaterial:i$,ShaderMaterial:ss,PointsMaterial:JA,MeshPhysicalMaterial:Oc,MeshStandardMaterial:qv,MeshPhongMaterial:r$,MeshToonMaterial:eT,MeshNormalMaterial:a$,MeshLambertMaterial:s$,MeshDepthMaterial:uC,MeshDistanceMaterial:fC,MeshBasicMaterial:Cs,MeshMatcapMaterial:o$,LineDashedMaterial:l$,LineBasicMaterial:Us,Material:ka};return new n[e]}}class Dd{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}class H_ extends Dn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class _$ extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=new Os(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,function(o){try{n(a.parse(JSON.parse(o)))}catch(l){r?r(l):console.error(l),a.manager.itemError(e)}},i,r)}parse(e){const n={},i={};function r(d,g){if(n[g]!==void 0)return n[g];const y=d.interleavedBuffers[g],p=a(d,y.buffer),x=e0(y.type,p),_=new F_(x,y.stride);return _.uuid=y.uuid,n[g]=_,_}function a(d,g){if(i[g]!==void 0)return i[g];const y=d.arrayBuffers[g],p=new Uint32Array(y).buffer;return i[g]=p,p}const s=e.isInstancedBufferGeometry?new H_:new Dn,o=e.data.index;if(o!==void 0){const d=e0(o.type,o.array);s.setIndex(new Nn(d,1))}const l=e.data.attributes;for(const d in l){const g=l[d];let b;if(g.isInterleavedBufferAttribute){const y=r(e.data,g.data);b=new Bo(y,g.itemSize,g.offset,g.normalized)}else{const y=e0(g.type,g.array),p=g.isInstancedBufferAttribute?of:Nn;b=new p(y,g.itemSize,g.normalized)}g.name!==void 0&&(b.name=g.name),g.usage!==void 0&&b.setUsage(g.usage),s.setAttribute(d,b)}const c=e.data.morphAttributes;if(c)for(const d in c){const g=c[d],b=[];for(let y=0,p=g.length;y<p;y++){const x=g[y];let _;if(x.isInterleavedBufferAttribute){const w=r(e.data,x.data);_=new Bo(w,x.itemSize,x.offset,x.normalized)}else{const w=e0(x.type,x.array);_=new Nn(w,x.itemSize,x.normalized)}x.name!==void 0&&(_.name=x.name),b.push(_)}s.morphAttributes[d]=b}e.data.morphTargetsRelative&&(s.morphTargetsRelative=!0);const f=e.data.groups||e.data.drawcalls||e.data.offsets;if(f!==void 0)for(let d=0,g=f.length;d!==g;++d){const b=f[d];s.addGroup(b.start,b.count,b.materialIndex)}const h=e.data.boundingSphere;return h!==void 0&&(s.boundingSphere=new Ir().fromJSON(h)),e.name&&(s.name=e.name),e.userData&&(s.userData=e.userData),s}}class j0e extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=this.path===""?Dd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const o=new Os(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){let c=null;try{c=JSON.parse(l)}catch(f){r!==void 0&&r(f),console.error("THREE:ObjectLoader: Can't parse "+e+".",f.message);return}const u=c.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}a.parse(c,n)},i,r)}async loadAsync(e,n){const i=this,r=this.path===""?Dd.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const a=new Os(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials);const s=await a.loadAsync(e,n),o=JSON.parse(s),l=o.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(o)}parse(e,n){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),a=this.parseGeometries(e.geometries,r),s=this.parseImages(e.images,function(){n!==void 0&&n(c)}),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),c=this.parseObject(e.object,a,l,o,i),u=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,u),this.bindLightTargets(c),n!==void 0){let f=!1;for(const h in s)if(s[h].data instanceof HTMLImageElement){f=!0;break}f===!1&&n(c)}return c}async parseAsync(e){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),a=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,a),o=this.parseMaterials(e.materials,s),l=this.parseObject(e.object,r,o,s,n),c=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,c),this.bindLightTargets(l),l}parseShapes(e){const n={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const a=new Cm().fromJSON(e[i]);n[a.uuid]=a}return n}parseSkeletons(e,n){const i={},r={};if(n.traverse(function(a){a.isBone&&(r[a.uuid]=a)}),e!==void 0)for(let a=0,s=e.length;a<s;a++){const o=new Vv().fromJSON(e[a],r);i[o.uuid]=o}return i}parseGeometries(e,n){const i={};if(e!==void 0){const r=new _$;for(let a=0,s=e.length;a<s;a++){let o;const l=e[a];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(l);break;default:l.type in vj?o=vj[l.type].fromJSON(l,n):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}o.uuid=l.uuid,l.name!==void 0&&(o.name=l.name),l.userData!==void 0&&(o.userData=l.userData),i[l.uuid]=o}}return i}parseMaterials(e,n){const i={},r={};if(e!==void 0){const a=new pC;a.setTextures(n);for(let s=0,o=e.length;s<o;s++){const l=e[s];i[l.uuid]===void 0&&(i[l.uuid]=a.parse(l)),r[l.uuid]=i[l.uuid]}}return r}parseAnimations(e){const n={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],a=ov.parse(r);n[a.uuid]=a}return n}parseImages(e,n){const i=this,r={};let a;function s(l){return i.manager.itemStart(l),a.load(l,function(){i.manager.itemEnd(l)},void 0,function(){i.manager.itemError(l),i.manager.itemEnd(l)})}function o(l){if(typeof l=="string"){const c=l,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return s(u)}else return l.data?{data:e0(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new hC(n);a=new K1(l),a.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c<u;c++){const f=e[c],h=f.url;if(Array.isArray(h)){const d=[];for(let g=0,b=h.length;g<b;g++){const y=h[g],p=o(y);p!==null&&(p instanceof HTMLImageElement?d.push(p):d.push(new rs(p.data,p.width,p.height)))}r[f.uuid]=new xd(d)}else{const d=o(f.url);r[f.uuid]=new xd(d)}}}return r}async parseImagesAsync(e){const n=this,i={};let r;async function a(s){if(typeof s=="string"){const o=s,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(o)?o:n.resourcePath+o;return await r.loadAsync(l)}else return s.data?{data:e0(s.type,s.data),width:s.width,height:s.height}:null}if(e!==void 0&&e.length>0){r=new K1(this.manager),r.setCrossOrigin(this.crossOrigin);for(let s=0,o=e.length;s<o;s++){const l=e[s],c=l.url;if(Array.isArray(c)){const u=[];for(let f=0,h=c.length;f<h;f++){const d=c[f],g=await a(d);g!==null&&(g instanceof HTMLImageElement?u.push(g):u.push(new rs(g.data,g.width,g.height)))}i[l.uuid]=new xd(u)}else{const u=await a(l.url);i[l.uuid]=new xd(u)}}}return i}parseTextures(e,n){function i(a,s){return typeof a=="number"?a:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",a),s[a])}const r={};if(e!==void 0)for(let a=0,s=e.length;a<s;a++){const o=e[a];o.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),n[o.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const l=n[o.image],c=l.data;let u;Array.isArray(c)?(u=new U_,c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new rs:u=new nr,c&&(u.needsUpdate=!0)),u.source=l,u.uuid=o.uuid,o.name!==void 0&&(u.name=o.name),o.mapping!==void 0&&(u.mapping=i(o.mapping,H0e)),o.channel!==void 0&&(u.channel=o.channel),o.offset!==void 0&&u.offset.fromArray(o.offset),o.repeat!==void 0&&u.repeat.fromArray(o.repeat),o.center!==void 0&&u.center.fromArray(o.center),o.rotation!==void 0&&(u.rotation=o.rotation),o.wrap!==void 0&&(u.wrapS=i(o.wrap[0],Sj),u.wrapT=i(o.wrap[1],Sj)),o.format!==void 0&&(u.format=o.format),o.internalFormat!==void 0&&(u.internalFormat=o.internalFormat),o.type!==void 0&&(u.type=o.type),o.colorSpace!==void 0&&(u.colorSpace=o.colorSpace),o.minFilter!==void 0&&(u.minFilter=i(o.minFilter,wj)),o.magFilter!==void 0&&(u.magFilter=i(o.magFilter,wj)),o.anisotropy!==void 0&&(u.anisotropy=o.anisotropy),o.flipY!==void 0&&(u.flipY=o.flipY),o.generateMipmaps!==void 0&&(u.generateMipmaps=o.generateMipmaps),o.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(u.unpackAlignment=o.unpackAlignment),o.compareFunction!==void 0&&(u.compareFunction=o.compareFunction),o.userData!==void 0&&(u.userData=o.userData),r[o.uuid]=u}return r}parseObject(e,n,i,r,a){let s;function o(h){return n[h]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",h),n[h]}function l(h){if(h!==void 0){if(Array.isArray(h)){const d=[];for(let g=0,b=h.length;g<b;g++){const y=h[g];i[y]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",y),d.push(i[y])}return d}return i[h]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",h),i[h]}}function c(h){return r[h]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",h),r[h]}let u,f;switch(e.type){case"Scene":s=new Hv,e.background!==void 0&&(Number.isInteger(e.background)?s.background=new Ut(e.background):s.background=c(e.background)),e.environment!==void 0&&(s.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?s.fog=new qA(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(s.fog=new WA(e.fog.color,e.fog.density)),e.fog.name!==""&&(s.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(s.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&s.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(s.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&s.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":s=new ta(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(s.focus=e.focus),e.zoom!==void 0&&(s.zoom=e.zoom),e.filmGauge!==void 0&&(s.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(s.filmOffset=e.filmOffset),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new Eh(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(s.zoom=e.zoom),e.view!==void 0&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new b$(e.color,e.intensity);break;case"DirectionalLight":s=new dC(e.color,e.intensity),s.target=e.target||"";break;case"PointLight":s=new cU(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new v$(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new lU(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),s.target=e.target||"";break;case"HemisphereLight":s=new g$(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=new x$().fromJSON(e);break;case"SkinnedMesh":u=o(e.geometry),f=l(e.material),s=new XA(u,f),e.bindMode!==void 0&&(s.bindMode=e.bindMode),e.bindMatrix!==void 0&&s.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(s.skeleton=e.skeleton);break;case"Mesh":u=o(e.geometry),f=l(e.material),s=new _i(u,f);break;case"InstancedMesh":u=o(e.geometry),f=l(e.material);const h=e.count,d=e.instanceMatrix,g=e.instanceColor;s=new KA(u,f,h),s.instanceMatrix=new of(new Float32Array(d.array),16),g!==void 0&&(s.instanceColor=new of(new Float32Array(g.array),g.itemSize));break;case"BatchedMesh":u=o(e.geometry),f=l(e.material),s=new XJ(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,f),s.geometry=u,s.perObjectFrustumCulled=e.perObjectFrustumCulled,s.sortObjects=e.sortObjects,s._drawRanges=e.drawRanges,s._reservedRanges=e.reservedRanges,s._geometryInfo=e.geometryInfo.map(b=>{let y=null,p=null;return b.boundingBox!==void 0&&(y=new rr().fromJSON(b.boundingBox)),b.boundingSphere!==void 0&&(p=new Ir().fromJSON(b.boundingSphere)),{...b,boundingBox:y,boundingSphere:p}}),s._instanceInfo=e.instanceInfo,s._availableInstanceIds=e._availableInstanceIds,s._availableGeometryIds=e._availableGeometryIds,s._nextIndexStart=e.nextIndexStart,s._nextVertexStart=e.nextVertexStart,s._geometryCount=e.geometryCount,s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._matricesTexture=c(e.matricesTexture.uuid),s._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(s._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(s.boundingSphere=new Ir().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(s.boundingBox=new rr().fromJSON(e.boundingBox));break;case"LOD":s=new qJ;break;case"Line":s=new gh(o(e.geometry),l(e.material));break;case"LineLoop":s=new WP(o(e.geometry),l(e.material));break;case"LineSegments":s=new Dc(o(e.geometry),l(e.material));break;case"PointCloud":case"Points":s=new qP(o(e.geometry),l(e.material));break;case"Sprite":s=new WJ(l(e.material));break;case"Group":s=new bl;break;case"Bone":s=new B_;break;default:s=new Ni}if(s.uuid=e.uuid,e.name!==void 0&&(s.name=e.name),e.matrix!==void 0?(s.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(e.position!==void 0&&s.position.fromArray(e.position),e.rotation!==void 0&&s.rotation.fromArray(e.rotation),e.quaternion!==void 0&&s.quaternion.fromArray(e.quaternion),e.scale!==void 0&&s.scale.fromArray(e.scale)),e.up!==void 0&&s.up.fromArray(e.up),e.castShadow!==void 0&&(s.castShadow=e.castShadow),e.receiveShadow!==void 0&&(s.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(s.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(s.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(s.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(s.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(s.visible=e.visible),e.frustumCulled!==void 0&&(s.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(s.renderOrder=e.renderOrder),e.userData!==void 0&&(s.userData=e.userData),e.layers!==void 0&&(s.layers.mask=e.layers),e.children!==void 0){const h=e.children;for(let d=0;d<h.length;d++)s.add(this.parseObject(h[d],n,i,r,a))}if(e.animations!==void 0){const h=e.animations;for(let d=0;d<h.length;d++){const g=h[d];s.animations.push(a[g])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(s.autoUpdate=e.autoUpdate);const h=e.levels;for(let d=0;d<h.length;d++){const g=h[d],b=s.getObjectByProperty("uuid",g.object);b!==void 0&&s.addLevel(b,g.distance,g.hysteresis)}}return s}bindSkeletons(e,n){Object.keys(n).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=n[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}bindLightTargets(e){e.traverse(function(n){if(n.isDirectionalLight||n.isSpotLight){const i=n.target,r=e.getObjectByProperty("uuid",i);r!==void 0?n.target=r:n.target=new Ni}})}}const H0e={UVMapping:Fd,CubeReflectionMapping:sf,CubeRefractionMapping:Bd,EquirectangularReflectionMapping:X0,EquirectangularRefractionMapping:B1,CubeUVReflectionMapping:Fv},Sj={RepeatWrapping:zd,ClampToEdgeWrapping:ba,MirroredRepeatWrapping:K0},wj={NearestFilter:is,NearestMipmapNearestFilter:LA,NearestMipmapLinearFilter:rm,LinearFilter:Hi,LinearMipmapNearestFilter:b0,LinearMipmapLinearFilter:mc},Ik=new WeakMap;class S$ extends Fs{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,n,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,s=Gu.get(`image-bitmap:${e}`);if(s!==void 0){if(a.manager.itemStart(e),s.then){s.then(c=>{if(Ik.has(s)===!0)r&&r(Ik.get(s)),a.manager.itemError(e),a.manager.itemEnd(e);else return n&&n(c),a.manager.itemEnd(e),c});return}return setTimeout(function(){n&&n(s),a.manager.itemEnd(e)},0),s}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const l=fetch(e,o).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(c){return Gu.add(`image-bitmap:${e}`,c),n&&n(c),a.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Ik.set(l,c),Gu.remove(`image-bitmap:${e}`),a.manager.itemError(e),a.manager.itemEnd(e)});Gu.add(`image-bitmap:${e}`,l),a.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let jw;class uU{static getContext(){return jw===void 0&&(jw=new(window.AudioContext||window.webkitAudioContext)),jw}static setContext(e){jw=e}}class V0e extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=new Os(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(l){try{const c=l.slice(0);uU.getContext().decodeAudioData(c,function(f){n(f)}).catch(o)}catch(c){o(c)}},i,r);function o(l){r?r(l):console.error(l),a.manager.itemError(e)}}}const Ej=new Ot,Mj=new Ot,Mp=new Ot;class G0e{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ta,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ta,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,Mp.copy(e.projectionMatrix);const r=n.eyeSep/2,a=r*n.near/n.focus,s=n.near*Math.tan(Am*n.fov*.5)/n.zoom;let o,l;Mj.elements[12]=-r,Ej.elements[12]=r,o=-s*n.aspect+a,l=s*n.aspect+a,Mp.elements[0]=2*n.near/(l-o),Mp.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(Mp),o=-s*n.aspect-a,l=s*n.aspect-a,Mp.elements[0]=2*n.near/(l-o),Mp.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(Mp)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Mj),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Ej)}}class w$ extends ta{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class fU{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const n=performance.now();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}const Tp=new te,Nk=new Vn,W0e=new te,Ap=new te,Cp=new te;class q0e extends Ni{constructor(){super(),this.type="AudioListener",this.context=uU.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new fU}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const n=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Tp,Nk,W0e),Ap.set(0,0,-1).applyQuaternion(Nk),Cp.set(0,1,0).applyQuaternion(Nk),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(Tp.x,i),n.positionY.linearRampToValueAtTime(Tp.y,i),n.positionZ.linearRampToValueAtTime(Tp.z,i),n.forwardX.linearRampToValueAtTime(Ap.x,i),n.forwardY.linearRampToValueAtTime(Ap.y,i),n.forwardZ.linearRampToValueAtTime(Ap.z,i),n.upX.linearRampToValueAtTime(Cp.x,i),n.upY.linearRampToValueAtTime(Cp.y,i),n.upZ.linearRampToValueAtTime(Cp.z,i)}else n.setPosition(Tp.x,Tp.y,Tp.z),n.setOrientation(Ap.x,Ap.y,Ap.z,Cp.x,Cp.y,Cp.z)}}class E$ extends Ni{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,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(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,n){return super.copy(e,n),e.sourceType!=="buffer"?(console.warn("THREE.Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const Rp=new te,Tj=new Vn,X0e=new te,kp=new te;class K0e extends E${constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,n,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=n,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Rp,Tj,X0e),kp.set(0,0,1).applyQuaternion(Tj);const n=this.panner;if(n.positionX){const i=this.context.currentTime+this.listener.timeDelta;n.positionX.linearRampToValueAtTime(Rp.x,i),n.positionY.linearRampToValueAtTime(Rp.y,i),n.positionZ.linearRampToValueAtTime(Rp.z,i),n.orientationX.linearRampToValueAtTime(kp.x,i),n.orientationY.linearRampToValueAtTime(kp.y,i),n.orientationZ.linearRampToValueAtTime(kp.z,i)}else n.setPosition(Rp.x,Rp.y,Rp.z),n.setOrientation(kp.x,kp.y,kp.z)}}class Y0e{constructor(e,n=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=n,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const n=this.getFrequencyData();for(let i=0;i<n.length;i++)e+=n[i];return e/n.length}}class M${constructor(e,n,i){this.binding=e,this.valueSize=i;let r,a,s;switch(n){case"quaternion":r=this._slerp,a=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,a=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,a=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=a,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,n){const i=this.buffer,r=this.valueSize,a=e*r+r;let s=this.cumulativeWeight;if(s===0){for(let o=0;o!==r;++o)i[a+o]=i[o];s=n}else{s+=n;const o=n/s;this._mixBufferRegion(i,a,0,o,r)}this.cumulativeWeight=s}accumulateAdditive(e){const n=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(n,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const n=this.valueSize,i=this.buffer,r=e*n+n,a=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){const l=n*this._origIndex;this._mixBufferRegion(i,r,l,1-a,n)}s>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*n,1,n);for(let l=n,c=n+n;l!==c;++l)if(i[l]!==i[l+n]){o.setValue(i,r);break}}saveOriginalState(){const e=this.binding,n=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(n,r);for(let a=i,s=r;a!==s;++a)n[a]=n[r+a%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,n=e+this.valueSize;for(let i=e;i<n;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,n=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[n+i]=this.buffer[e+i]}_select(e,n,i,r,a){if(r>=.5)for(let s=0;s!==a;++s)e[n+s]=e[i+s]}_slerp(e,n,i,r){Vn.slerpFlat(e,n,e,n,e,i,r)}_slerpAdditive(e,n,i,r,a){const s=this._workIndex*a;Vn.multiplyQuaternionsFlat(e,s,e,n,e,i),Vn.slerpFlat(e,n,e,n,e,s,r)}_lerp(e,n,i,r,a){const s=1-r;for(let o=0;o!==a;++o){const l=n+o;e[l]=e[l]*s+e[i+o]*r}}_lerpAdditive(e,n,i,r,a){for(let s=0;s!==a;++s){const o=n+s;e[o]=e[o]+e[i+s]*r}}}const hU="\\[\\]\\.:\\/",J0e=new RegExp("["+hU+"]","g"),dU="[^"+hU+"]",$0e="[^"+hU.replace("\\.","")+"]",Z0e=/((?:WC+[\/:])*)/.source.replace("WC",dU),Q0e=/(WCOD+)?/.source.replace("WCOD",$0e),eve=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",dU),tve=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",dU),nve=new RegExp("^"+Z0e+Q0e+eve+tve+"$"),ive=["material","materials","bones","map"];class rve{constructor(e,n,i){const r=i||Fi.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,r)}getValue(e,n){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,n)}setValue(e,n){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,a=i.length;r!==a;++r)i[r].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].unbind()}}class Fi{constructor(e,n,i){this.path=n,this.parsedPath=i||Fi.parseTrackName(n),this.node=Fi.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,i){return e&&e.isAnimationObjectGroup?new Fi.Composite(e,n,i):new Fi(e,n,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(J0e,"")}static parseTrackName(e){const n=nve.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const a=i.nodeName.substring(r+1);ive.indexOf(a)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=a)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(n);if(i!==void 0)return i}if(e.children){const i=function(a){for(let s=0;s<a.length;s++){const o=a[s];if(o.name===n||o.uuid===n)return o;const l=i(o.children);if(l)return l}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,n){e[n]=this.targetObject[this.propertyName]}_getValue_array(e,n){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)e[n++]=i[r]}_getValue_arrayElement(e,n){e[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,n){this.resolvedProperty.toArray(e,n)}_setValue_direct(e,n){this.targetObject[this.propertyName]=e[n]}_setValue_direct_setNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,n){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++]}_setValue_array_setNeedsUpdate(e,n){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,n){const i=this.resolvedProperty;for(let r=0,a=i.length;r!==a;++r)i[r]=e[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,n){this.resolvedProperty[this.propertyIndex]=e[n]}_setValue_arrayElement_setNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,n){this.resolvedProperty.fromArray(e,n)}_setValue_fromArray_setNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,n){this.bind(),this.getValue(e,n)}_setValue_unbound(e,n){this.bind(),this.setValue(e,n)}bind(){let e=this.node;const n=this.parsedPath,i=n.objectName,r=n.propertyName;let a=n.propertyIndex;if(e||(e=Fi.findNode(this.rootNode,n.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let c=n.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let u=0;u<e.length;u++)if(e[u].name===c){c=u;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const s=e[r];if(s===void 0){const c=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(a!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[a]!==void 0&&(a=e.morphTargetDictionary[a])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=a}else s.fromArray!==void 0&&s.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Fi.Composite=rve;Fi.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Fi.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Fi.prototype.GetterByBindingType=[Fi.prototype._getValue_direct,Fi.prototype._getValue_array,Fi.prototype._getValue_arrayElement,Fi.prototype._getValue_toArray];Fi.prototype.SetterByBindingTypeAndVersioning=[[Fi.prototype._setValue_direct,Fi.prototype._setValue_direct_setNeedsUpdate,Fi.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Fi.prototype._setValue_array,Fi.prototype._setValue_array_setNeedsUpdate,Fi.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Fi.prototype._setValue_arrayElement,Fi.prototype._setValue_arrayElement_setNeedsUpdate,Fi.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Fi.prototype._setValue_fromArray,Fi.prototype._setValue_fromArray_setNeedsUpdate,Fi.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class ave{constructor(){this.isAnimationObjectGroup=!0,this.uuid=wl(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}add(){const e=this._objects,n=this._indicesByUUID,i=this._paths,r=this._parsedPaths,a=this._bindings,s=a.length;let o,l=e.length,c=this.nCachedObjects_;for(let u=0,f=arguments.length;u!==f;++u){const h=arguments[u],d=h.uuid;let g=n[d];if(g===void 0){g=l++,n[d]=g,e.push(h);for(let b=0,y=s;b!==y;++b)a[b].push(new Fi(h,i[b],r[b]))}else if(g<c){o=e[g];const b=--c,y=e[b];n[y.uuid]=g,e[g]=y,n[d]=b,e[b]=h;for(let p=0,x=s;p!==x;++p){const _=a[p],w=_[b];let M=_[g];_[g]=w,M===void 0&&(M=new Fi(h,i[p],r[p])),_[b]=M}}else e[g]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,n=this._indicesByUUID,i=this._bindings,r=i.length;let a=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const l=arguments[s],c=l.uuid,u=n[c];if(u!==void 0&&u>=a){const f=a++,h=e[f];n[h.uuid]=u,e[u]=h,n[c]=f,e[f]=l;for(let d=0,g=r;d!==g;++d){const b=i[d],y=b[f],p=b[u];b[u]=y,b[f]=p}}}this.nCachedObjects_=a}uncache(){const e=this._objects,n=this._indicesByUUID,i=this._bindings,r=i.length;let a=this.nCachedObjects_,s=e.length;for(let o=0,l=arguments.length;o!==l;++o){const c=arguments[o],u=c.uuid,f=n[u];if(f!==void 0)if(delete n[u],f<a){const h=--a,d=e[h],g=--s,b=e[g];n[d.uuid]=f,e[f]=d,n[b.uuid]=h,e[h]=b,e.pop();for(let y=0,p=r;y!==p;++y){const x=i[y],_=x[h],w=x[g];x[f]=_,x[h]=w,x.pop()}}else{const h=--s,d=e[h];h>0&&(n[d.uuid]=f),e[f]=d,e.pop();for(let g=0,b=r;g!==b;++g){const y=i[g];y[f]=y[h],y.pop()}}}this.nCachedObjects_=a}subscribe_(e,n){const i=this._bindingsIndicesByPath;let r=i[e];const a=this._bindings;if(r!==void 0)return a[r];const s=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);r=a.length,i[e]=r,s.push(e),o.push(n),a.push(f);for(let h=u,d=l.length;h!==d;++h){const g=l[h];f[h]=new Fi(g,e,n)}return f}unsubscribe_(e){const n=this._bindingsIndicesByPath,i=n[e];if(i!==void 0){const r=this._paths,a=this._parsedPaths,s=this._bindings,o=s.length-1,l=s[o],c=e[o];n[c]=i,s[i]=l,s.pop(),a[i]=a[o],a.pop(),r[i]=r[o],r.pop()}}}class T${constructor(e,n,i=null,r=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=i,this.blendMode=r;const a=n.tracks,s=a.length,o=new Array(s),l={endingStart:am,endingEnd:am};for(let c=0;c!==s;++c){const u=a[c].createInterpolant(null);o[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=MJ,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,n){return this.loop=e,this.repetitions=n,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,n,i=!1){if(e.fadeOut(n),this.fadeIn(n),i===!0){const r=this._clip.duration,a=e._clip.duration,s=a/r,o=r/a;e.warp(1,s,n),this.warp(o,1,n)}return this}crossFadeTo(e,n,i=!1){return e.crossFadeFrom(this,n,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,n,i){const r=this._mixer,a=r.time,s=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=a,l[1]=a+i,c[0]=e/s,c[1]=n/s,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,n,i,r){if(!this.enabled){this._updateWeight(e);return}const a=this._startTime;if(a!==null){const l=(e-a)*i;l<0||i===0?n=0:(this._startTime=null,n=i*l)}n*=this._updateTimeScale(e);const s=this._updateTime(n),o=this._updateWeight(e);if(o>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case LP:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(s),c[u].accumulateAdditive(o);break;case jA:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(s),c[u].accumulate(r,o)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];n*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];n*=r,e>i.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,i=this.loop;let r=this.time+e,a=this._loopCount;const s=i===TJ;if(e===0)return a===-1?r:s&&(a&1)===1?n-r:r;if(i===EJ){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=n)r=n;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),r>=n||r<0){const o=Math.floor(r/n);r-=n*o,a+=Math.abs(o);const l=this.repetitions-a;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?n:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,s)}else this._setEndings(!1,!1,s);this._loopCount=a,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=r;if(s&&(a&1)===1)return n-r}return r}_setEndings(e,n,i){const r=this._interpolantSettings;i?(r.endingStart=sm,r.endingEnd=sm):(e?r.endingStart=this.zeroSlopeAtStart?sm:am:r.endingStart=z1,n?r.endingEnd=this.zeroSlopeAtEnd?sm:am:r.endingEnd=z1)}_scheduleFading(e,n,i){const r=this._mixer,a=r.time;let s=this._weightInterpolant;s===null&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,l=s.sampleValues;return o[0]=a,l[0]=n,o[1]=a+e,l[1]=i,this}}const sve=new Float32Array(1);class A$ extends df{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const i=e._localRoot||this._root,r=e._clip.tracks,a=r.length,s=e._propertyBindings,o=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==a;++f){const h=r[f],d=h.name;let g=u[d];if(g!==void 0)++g.referenceCount,s[f]=g;else{if(g=s[f],g!==void 0){g._cacheIndex===null&&(++g.referenceCount,this._addInactiveBinding(g,l,d));continue}const b=n&&n._propertyBindings[f].binding.parsedPath;g=new M$(Fi.create(i,d,b),h.ValueTypeName,h.getValueSize()),++g.referenceCount,this._addInactiveBinding(g,l,d),s[f]=g}o[f].resultBuffer=g.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,a=this._actionsByClip[r];this._bindAction(e,a&&a.knownActions[0]),this._addInactiveAction(e,r,i)}const n=e._propertyBindings;for(let i=0,r=n.length;i!==r;++i){const a=n[i];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let i=0,r=n.length;i!==r;++i){const a=n[i];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const n=e._cacheIndex;return n!==null&&n<this._nActiveActions}_addInactiveAction(e,n,i){const r=this._actions,a=this._actionsByClip;let s=a[n];if(s===void 0)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[n]=s;else{const o=s.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),s.actionByRoot[i]=e}_removeInactiveAction(e){const n=this._actions,i=n[n.length-1],r=e._cacheIndex;i._cacheIndex=r,n[r]=i,n.pop(),e._cacheIndex=null;const a=e._clip.uuid,s=this._actionsByClip,o=s[a],l=o.knownActions,c=l[l.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,l[u]=c,l.pop(),e._byClipCacheIndex=null;const f=o.actionByRoot,h=(e._localRoot||this._root).uuid;delete f[h],l.length===0&&delete s[a],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const n=e._propertyBindings;for(let i=0,r=n.length;i!==r;++i){const a=n[i];--a.referenceCount===0&&this._removeInactiveBinding(a)}}_lendAction(e){const n=this._actions,i=e._cacheIndex,r=this._nActiveActions++,a=n[r];e._cacheIndex=r,n[r]=e,a._cacheIndex=i,n[i]=a}_takeBackAction(e){const n=this._actions,i=e._cacheIndex,r=--this._nActiveActions,a=n[r];e._cacheIndex=r,n[r]=e,a._cacheIndex=i,n[i]=a}_addInactiveBinding(e,n,i){const r=this._bindingsByRootAndName,a=this._bindings;let s=r[n];s===void 0&&(s={},r[n]=s),s[i]=e,e._cacheIndex=a.length,a.push(e)}_removeInactiveBinding(e){const n=this._bindings,i=e.binding,r=i.rootNode.uuid,a=i.path,s=this._bindingsByRootAndName,o=s[r],l=n[n.length-1],c=e._cacheIndex;l._cacheIndex=c,n[c]=l,n.pop(),delete o[a],Object.keys(o).length===0&&delete s[r]}_lendBinding(e){const n=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,a=n[r];e._cacheIndex=r,n[r]=e,a._cacheIndex=i,n[i]=a}_takeBackBinding(e){const n=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,a=n[r];e._cacheIndex=r,n[r]=e,a._cacheIndex=i,n[i]=a}_lendControlInterpolant(){const e=this._controlInterpolants,n=this._nActiveControlInterpolants++;let i=e[n];return i===void 0&&(i=new rU(new Float32Array(2),new Float32Array(2),1,sve),i.__cacheIndex=n,e[n]=i),i}_takeBackControlInterpolant(e){const n=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,a=n[r];e.__cacheIndex=r,n[r]=e,a.__cacheIndex=i,n[i]=a}clipAction(e,n,i){const r=n||this._root,a=r.uuid;let s=typeof e=="string"?ov.findByName(r,e):e;const o=s!==null?s.uuid:e,l=this._actionsByClip[o];let c=null;if(i===void 0&&(s!==null?i=s.blendMode:i=jA),l!==void 0){const f=l.actionByRoot[a];if(f!==void 0&&f.blendMode===i)return f;c=l.knownActions[0],s===null&&(s=c._clip)}if(s===null)return null;const u=new T$(this,s,n,i);return this._bindAction(u,c),this._addInactiveAction(u,o,a),u}existingAction(e,n){const i=n||this._root,r=i.uuid,a=typeof e=="string"?ov.findByName(i,e):e,s=a?a.uuid:e,o=this._actionsByClip[s];return o!==void 0&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions,n=this._nActiveActions;for(let i=n-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const n=this._actions,i=this._nActiveActions,r=this.time+=e,a=Math.sign(e),s=this._accuIndex^=1;for(let c=0;c!==i;++c)n[c]._update(r,e,a,s);const o=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)o[c].apply(s);return this}setTime(e){this.time=0;for(let n=0;n<this._actions.length;n++)this._actions[n].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const n=this._actions,i=e.uuid,r=this._actionsByClip,a=r[i];if(a!==void 0){const s=a.knownActions;for(let o=0,l=s.length;o!==l;++o){const c=s[o];this._deactivateAction(c);const u=c._cacheIndex,f=n[n.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,f._cacheIndex=u,n[u]=f,n.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}}uncacheRoot(e){const n=e.uuid,i=this._actionsByClip;for(const s in i){const o=i[s].actionByRoot,l=o[n];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,a=r[n];if(a!==void 0)for(const s in a){const o=a[s];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,n){const i=this.existingAction(e,n);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class ove extends zP{constructor(e=1,n=1,i=1,r={}){super(e,n,r),this.isRenderTarget3D=!0,this.depth=i,this.texture=new VA(null,e,n,i),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class mC{constructor(e){this.value=e}clone(){return new mC(this.value.clone===void 0?this.value:this.value.clone())}}let lve=0;class cve extends df{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:lve++}),this.name="",this.usage=H1,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const n=this.uniforms.indexOf(e);return n!==-1&&this.uniforms.splice(n,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const n=e.uniforms;this.uniforms.length=0;for(let i=0,r=n.length;i<r;i++){const a=Array.isArray(n[i])?n[i]:[n[i]];for(let s=0;s<a.length;s++)this.uniforms.push(a[s].clone())}return this}clone(){return new this.constructor().copy(this)}}class tT extends F_{constructor(e,n,i=1){super(e,n),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const n=super.clone(e);return n.meshPerAttribute=this.meshPerAttribute,n}toJSON(e){const n=super.toJSON(e);return n.isInstancedInterleavedBuffer=!0,n.meshPerAttribute=this.meshPerAttribute,n}}class C${constructor(e,n,i,r,a,s=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=n,this.itemSize=i,this.elementSize=r,this.count=a,this.normalized=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,n){return this.type=e,this.elementSize=n,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const Aj=new Ot;class V_{constructor(e,n,i=0,r=1/0){this.ray=new pf(e,n),this.near=i,this.far=r,this.camera=null,this.layers=new iv,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):console.error("THREE.Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return Aj.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Aj),this}intersectObject(e,n=!0,i=[]){return eI(e,this,i,n),i.sort(Cj),i}intersectObjects(e,n=!0,i=[]){for(let r=0,a=e.length;r<a;r++)eI(e[r],this,i,n);return i.sort(Cj),i}}function Cj(t,e){return t.distance-e.distance}function eI(t,e,n,i){let r=!0;if(t.layers.test(e.layers)&&t.raycast(e,n)===!1&&(r=!1),r===!0&&i===!0){const a=t.children;for(let s=0,o=a.length;s<o;s++)eI(a[s],e,n,!0)}}class uve{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=fve.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function fve(){this._document.hidden===!1&&this.reset()}class R${constructor(e=1,n=0,i=0){this.radius=e,this.phi=n,this.theta=i}set(e,n,i){return this.radius=e,this.phi=n,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Ln(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,i){return this.radius=Math.sqrt(e*e+n*n+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(Ln(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class hve{constructor(e=1,n=0,i=0){this.radius=e,this.theta=n,this.y=i}set(e,n,i){return this.radius=e,this.theta=n,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=n,this}clone(){return new this.constructor().copy(this)}}class pU{constructor(e,n,i,r){pU.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,n,i,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,n=0){for(let i=0;i<4;i++)this.elements[i]=e[i+n];return this}set(e,n,i,r){const a=this.elements;return a[0]=e,a[2]=n,a[1]=i,a[3]=r,this}}const Rj=new wt;class dve{constructor(e=new wt(1/0,1/0),n=new wt(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=Rj.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Rj).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const kj=new te,Hw=new te,fb=new te,hb=new te,Lk=new te,pve=new te,mve=new te;class k${constructor(e=new te,n=new te){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){kj.subVectors(e,this.start),Hw.subVectors(this.end,this.start);const i=Hw.dot(Hw);let a=Hw.dot(kj)/i;return n&&(a=Ln(a,0,1)),a}closestPointToPoint(e,n,i){const r=this.closestPointToPointParameter(e,n);return this.delta(i).multiplyScalar(r).add(this.start)}distanceSqToLine3(e,n=pve,i=mve){const r=10000000000000001e-32;let a,s;const o=this.start,l=e.start,c=this.end,u=e.end;fb.subVectors(c,o),hb.subVectors(u,l),Lk.subVectors(o,l);const f=fb.dot(fb),h=hb.dot(hb),d=hb.dot(Lk);if(f<=r&&h<=r)return n.copy(o),i.copy(l),n.sub(i),n.dot(n);if(f<=r)a=0,s=d/h,s=Ln(s,0,1);else{const g=fb.dot(Lk);if(h<=r)s=0,a=Ln(-g/f,0,1);else{const b=fb.dot(hb),y=f*h-b*b;y!==0?a=Ln((b*d-g*h)/y,0,1):a=0,s=(b*a+d)/h,s<0?(s=0,a=Ln(-g/f,0,1)):s>1&&(s=1,a=Ln((b-g)/f,0,1))}}return n.copy(o).add(fb.multiplyScalar(a)),i.copy(l).add(hb.multiplyScalar(s)),n.sub(i),n.dot(n)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const Dj=new te;class gve extends Ni{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const i=new Dn,r=[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 s=0,o=1,l=32;s<l;s++,o++){const c=s/l*Math.PI*2,u=o/l*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(u),Math.sin(u),1)}i.setAttribute("position",new fn(r,3));const a=new Us({fog:!1,toneMapped:!1});this.cone=new Dc(i,a),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,n=e*Math.tan(this.light.angle);this.cone.scale.set(n,n,e),Dj.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Dj),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Kh=new te,Vw=new Ot,Pk=new Ot;class bve extends Dc{constructor(e){const n=D$(e),i=new Dn,r=[],a=[];for(let c=0;c<n.length;c++){const u=n[c];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),a.push(0,0,0),a.push(0,0,0))}i.setAttribute("position",new fn(r,3)),i.setAttribute("color",new fn(a,3));const s=new Us({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,s),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=n,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const o=new Ut(255),l=new Ut(65280);this.setColors(o,l)}updateMatrixWorld(e){const n=this.bones,i=this.geometry,r=i.getAttribute("position");Pk.copy(this.root.matrixWorld).invert();for(let a=0,s=0;a<n.length;a++){const o=n[a];o.parent&&o.parent.isBone&&(Vw.multiplyMatrices(Pk,o.matrixWorld),Kh.setFromMatrixPosition(Vw),r.setXYZ(s,Kh.x,Kh.y,Kh.z),Vw.multiplyMatrices(Pk,o.parent.matrixWorld),Kh.setFromMatrixPosition(Vw),r.setXYZ(s+1,Kh.x,Kh.y,Kh.z),s+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,n){const r=this.geometry.getAttribute("color");for(let a=0;a<r.count;a+=2)r.setXYZ(a,e.r,e.g,e.b),r.setXYZ(a+1,n.r,n.g,n.b);return r.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function D$(t){const e=[];t.isBone===!0&&e.push(t);for(let n=0;n<t.children.length;n++)e.push(...D$(t.children[n]));return e}class vve extends _i{constructor(e,n,i){const r=new Wv(n,4,2),a=new Cs({wireframe:!0,fog:!1,toneMapped:!1});super(r,a),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const yve=new te,Oj=new Ut,Ij=new Ut;class xve extends Ni{constructor(e,n,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new j_(n);r.rotateY(Math.PI*.5),this.material=new Cs({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const a=r.getAttribute("position"),s=new Float32Array(a.count*3);r.setAttribute("color",new Nn(s,3)),this.add(new _i(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const n=e.geometry.getAttribute("color");Oj.copy(this.light.color),Ij.copy(this.light.groundColor);for(let i=0,r=n.count;i<r;i++){const a=i<r/2?Oj:Ij;n.setXYZ(i,a.r,a.g,a.b)}n.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(yve.setFromMatrixPosition(this.light.matrixWorld).negate())}}class _ve extends Dc{constructor(e=10,n=10,i=4473924,r=8947848){i=new Ut(i),r=new Ut(r);const a=n/2,s=e/n,o=e/2,l=[],c=[];for(let h=0,d=0,g=-o;h<=n;h++,g+=s){l.push(-o,0,g,o,0,g),l.push(g,0,-o,g,0,o);const b=h===a?i:r;b.toArray(c,d),d+=3,b.toArray(c,d),d+=3,b.toArray(c,d),d+=3,b.toArray(c,d),d+=3}const u=new Dn;u.setAttribute("position",new fn(l,3)),u.setAttribute("color",new fn(c,3));const f=new Us({vertexColors:!0,toneMapped:!1});super(u,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Sve extends Dc{constructor(e=10,n=16,i=8,r=64,a=4473924,s=8947848){a=new Ut(a),s=new Ut(s);const o=[],l=[];if(n>1)for(let f=0;f<n;f++){const h=f/n*(Math.PI*2),d=Math.sin(h)*e,g=Math.cos(h)*e;o.push(0,0,0),o.push(d,0,g);const b=f&1?a:s;l.push(b.r,b.g,b.b),l.push(b.r,b.g,b.b)}for(let f=0;f<i;f++){const h=f&1?a:s,d=e-e/i*f;for(let g=0;g<r;g++){let b=g/r*(Math.PI*2),y=Math.sin(b)*d,p=Math.cos(b)*d;o.push(y,0,p),l.push(h.r,h.g,h.b),b=(g+1)/r*(Math.PI*2),y=Math.sin(b)*d,p=Math.cos(b)*d,o.push(y,0,p),l.push(h.r,h.g,h.b)}}const c=new Dn;c.setAttribute("position",new fn(o,3)),c.setAttribute("color",new fn(l,3));const u=new Us({vertexColors:!0,toneMapped:!1});super(c,u),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Nj=new te,Gw=new te,Lj=new te;class wve extends Ni{constructor(e,n,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",n===void 0&&(n=1);let r=new Dn;r.setAttribute("position",new fn([-n,n,0,n,n,0,n,-n,0,-n,-n,0,-n,n,0],3));const a=new Us({fog:!1,toneMapped:!1});this.lightPlane=new gh(r,a),this.add(this.lightPlane),r=new Dn,r.setAttribute("position",new fn([0,0,0,0,0,1],3)),this.targetLine=new gh(r,a),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Nj.setFromMatrixPosition(this.light.matrixWorld),Gw.setFromMatrixPosition(this.light.target.matrixWorld),Lj.subVectors(Gw,Nj),this.lightPlane.lookAt(Gw),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Gw),this.targetLine.scale.z=Lj.length()}}const Ww=new te,ua=new GA;class Eve extends Dc{constructor(e){const n=new Dn,i=new Us({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],a=[],s={};o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4");function o(g,b){l(g),l(b)}function l(g){r.push(0,0,0),a.push(0,0,0),s[g]===void 0&&(s[g]=[]),s[g].push(r.length/3-1)}n.setAttribute("position",new fn(r,3)),n.setAttribute("color",new fn(a,3)),super(n,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();const c=new Ut(16755200),u=new Ut(16711680),f=new Ut(43775),h=new Ut(16777215),d=new Ut(3355443);this.setColors(c,u,f,h,d)}setColors(e,n,i,r,a){const o=this.geometry.getAttribute("color");return o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,n.r,n.g,n.b),o.setXYZ(25,n.r,n.g,n.b),o.setXYZ(26,n.r,n.g,n.b),o.setXYZ(27,n.r,n.g,n.b),o.setXYZ(28,n.r,n.g,n.b),o.setXYZ(29,n.r,n.g,n.b),o.setXYZ(30,n.r,n.g,n.b),o.setXYZ(31,n.r,n.g,n.b),o.setXYZ(32,i.r,i.g,i.b),o.setXYZ(33,i.r,i.g,i.b),o.setXYZ(34,i.r,i.g,i.b),o.setXYZ(35,i.r,i.g,i.b),o.setXYZ(36,i.r,i.g,i.b),o.setXYZ(37,i.r,i.g,i.b),o.setXYZ(38,r.r,r.g,r.b),o.setXYZ(39,r.r,r.g,r.b),o.setXYZ(40,a.r,a.g,a.b),o.setXYZ(41,a.r,a.g,a.b),o.setXYZ(42,a.r,a.g,a.b),o.setXYZ(43,a.r,a.g,a.b),o.setXYZ(44,a.r,a.g,a.b),o.setXYZ(45,a.r,a.g,a.b),o.setXYZ(46,a.r,a.g,a.b),o.setXYZ(47,a.r,a.g,a.b),o.setXYZ(48,a.r,a.g,a.b),o.setXYZ(49,a.r,a.g,a.b),o.needsUpdate=!0,this}update(){const e=this.geometry,n=this.pointMap,i=1,r=1;let a,s;if(ua.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)a=1,s=0;else if(this.camera.coordinateSystem===gl)a=-1,s=1;else if(this.camera.coordinateSystem===tv)a=0,s=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);ma("c",n,e,ua,0,0,a),ma("t",n,e,ua,0,0,s),ma("n1",n,e,ua,-i,-r,a),ma("n2",n,e,ua,i,-r,a),ma("n3",n,e,ua,-i,r,a),ma("n4",n,e,ua,i,r,a),ma("f1",n,e,ua,-i,-r,s),ma("f2",n,e,ua,i,-r,s),ma("f3",n,e,ua,-i,r,s),ma("f4",n,e,ua,i,r,s),ma("u1",n,e,ua,i*.7,r*1.1,a),ma("u2",n,e,ua,-i*.7,r*1.1,a),ma("u3",n,e,ua,0,r*2,a),ma("cf1",n,e,ua,-i,0,s),ma("cf2",n,e,ua,i,0,s),ma("cf3",n,e,ua,0,-r,s),ma("cf4",n,e,ua,0,r,s),ma("cn1",n,e,ua,-i,0,a),ma("cn2",n,e,ua,i,0,a),ma("cn3",n,e,ua,0,-r,a),ma("cn4",n,e,ua,0,r,a),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function ma(t,e,n,i,r,a,s){Ww.set(r,a,s).unproject(i);const o=e[t];if(o!==void 0){const l=n.getAttribute("position");for(let c=0,u=o.length;c<u;c++)l.setXYZ(o[c],Ww.x,Ww.y,Ww.z)}}const qw=new rr;class Mve extends Dc{constructor(e,n=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),a=new Dn;a.setIndex(new Nn(i,1)),a.setAttribute("position",new Nn(r,3)),super(a,new Us({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&qw.setFromObject(this.object),qw.isEmpty())return;const e=qw.min,n=qw.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class tI extends Dc{constructor(e,n=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],a=new Dn;a.setIndex(new Nn(i,1)),a.setAttribute("position",new fn(r,3)),super(a,new Us({color:n,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const n=this.box;n.isEmpty()||(n.getCenter(this.position),n.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class Tve extends gh{constructor(e,n=1,i=16776960){const r=i,a=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],s=new Dn;s.setAttribute("position",new fn(a,3)),s.computeBoundingSphere(),super(s,new Us({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=n;const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new Dn;l.setAttribute("position",new fn(o,3)),l.computeBoundingSphere(),this.add(new _i(l,new Cs({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const Pj=new te;let Xw,Uk;class Ave extends Ni{constructor(e=new te(0,0,1),n=new te(0,0,0),i=1,r=16776960,a=i*.2,s=a*.2){super(),this.type="ArrowHelper",Xw===void 0&&(Xw=new Dn,Xw.setAttribute("position",new fn([0,0,0,0,1,0],3)),Uk=new z_(.5,1,5,1),Uk.translate(0,-.5,0)),this.position.copy(n),this.line=new gh(Xw,new Us({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new _i(Uk,new Cs({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,a,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Pj.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(Pj,n)}}setLength(e,n=e*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Cve extends Dc{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Dn;r.setAttribute("position",new fn(n,3)),r.setAttribute("color",new fn(i,3));const a=new Us({vertexColors:!0,toneMapped:!1});super(r,a),this.type="AxesHelper"}setColors(e,n,i){const r=new Ut,a=this.geometry.attributes.color.array;return r.set(e),r.toArray(a,0),r.toArray(a,3),r.set(n),r.toArray(a,6),r.toArray(a,9),r.set(i),r.toArray(a,12),r.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Rve{constructor(){this.type="ShapePath",this.color=new Ut,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new Q2,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,i,r){return this.currentPath.quadraticCurveTo(e,n,i,r),this}bezierCurveTo(e,n,i,r,a,s){return this.currentPath.bezierCurveTo(e,n,i,r,a,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(p){const x=[];for(let _=0,w=p.length;_<w;_++){const M=p[_],S=new Cm;S.curves=M.curves,x.push(S)}return x}function i(p,x){const _=x.length;let w=!1;for(let M=_-1,S=0;S<_;M=S++){let A=x[M],C=x[S],D=C.x-A.x,R=C.y-A.y;if(Math.abs(R)>Number.EPSILON){if(R<0&&(A=x[S],D=-D,C=x[M],R=-R),p.y<A.y||p.y>C.y)continue;if(p.y===A.y){if(p.x===A.x)return!0}else{const N=R*(p.x-A.x)-D*(p.y-A.y);if(N===0)return!0;if(N<0)continue;w=!w}}else{if(p.y!==A.y)continue;if(C.x<=p.x&&p.x<=A.x||A.x<=p.x&&p.x<=C.x)return!0}}return w}const r=lu.isClockWise,a=this.subPaths;if(a.length===0)return[];let s,o,l;const c=[];if(a.length===1)return o=a[0],l=new Cm,l.curves=o.curves,c.push(l),c;let u=!r(a[0].getPoints());u=e?!u:u;const f=[],h=[];let d=[],g=0,b;h[g]=void 0,d[g]=[];for(let p=0,x=a.length;p<x;p++)o=a[p],b=o.getPoints(),s=r(b),s=e?!s:s,s?(!u&&h[g]&&g++,h[g]={s:new Cm,p:b},h[g].s.curves=o.curves,u&&g++,d[g]=[]):d[g].push({h:o,p:b[0]});if(!h[0])return n(a);if(h.length>1){let p=!1,x=0;for(let _=0,w=h.length;_<w;_++)f[_]=[];for(let _=0,w=h.length;_<w;_++){const M=d[_];for(let S=0;S<M.length;S++){const A=M[S];let C=!0;for(let D=0;D<h.length;D++)i(A.p,h[D].p)&&(_!==D&&x++,C?(C=!1,f[D].push(A)):p=!0);C&&f[_].push(A)}}x>0&&p===!1&&(d=f)}let y;for(let p=0,x=h.length;p<x;p++){l=h[p].s,c.push(l),y=d[p];for(let _=0,w=y.length;_<w;_++)l.holes.push(y[_].h)}return c}}class kve extends df{constructor(e,n=null){super(),this.object=e,this.domElement=n,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function Dve(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}function Ove(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}function Ive(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}function nI(t,e,n,i){const r=Nve(i);switch(n){case OP:return t*e;case wh:return t*e/r.components*r.byteLength;case zv:return t*e/r.components*r.byteLength;case zA:return t*e*2/r.components*r.byteLength;case P_:return t*e*2/r.components*r.byteLength;case IP:return t*e*3/r.components*r.byteLength;case $r:return t*e*4/r.components*r.byteLength;case jv:return t*e*4/r.components*r.byteLength;case $x:case Zx:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case Qx:case e1:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case E2:case T2:return Math.max(t,16)*Math.max(e,8)/4;case w2:case M2:return Math.max(t,8)*Math.max(e,8)/2;case A2:case C2:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case R2:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case k2:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case D2:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case O2:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case I2:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case N2:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case L2:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case P2:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case U2:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case F2:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case B2:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case z2:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case j2:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case H2:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case V2:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case t1:case G2:case W2:return Math.ceil(t/4)*Math.ceil(e/4)*16;case NP:case q2:return Math.ceil(t/4)*Math.ceil(e/4)*8;case X2:case K2:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function Nve(t){switch(t){case To:case PA:return{byteLength:1,components:1};case Y0:case UA:case ts:return{byteLength:2,components:1};case FA:case BA:return{byteLength:2,components:4};case wc:case Bv:case yr:return{byteLength:4,components:1};case DP:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}class Lve{static contain(e,n){return Dve(e,n)}static cover(e,n){return Ove(e,n)}static fill(e){return Ive(e)}static getByteLength(e,n,i,r){return nI(e,n,i,r)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Uv}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Uv);/**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */function O$(){let t=null,e=!1,n=null,i=null;function r(a,s){n(a,s),i=t.requestAnimationFrame(r)}return{start:function(){e!==!0&&n!==null&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(a){n=a},setContext:function(a){t=a}}}function Pve(t){const e=new WeakMap;function n(o,l){const c=o.array,u=o.usage,f=c.byteLength,h=t.createBuffer();t.bindBuffer(l,h),t.bufferData(l,c,u),o.onUploadCallback();let d;if(c instanceof Float32Array)d=t.FLOAT;else if(typeof Float16Array<"u"&&c instanceof Float16Array)d=t.HALF_FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?d=t.HALF_FLOAT:d=t.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=t.SHORT;else if(c instanceof Uint32Array)d=t.UNSIGNED_INT;else if(c instanceof Int32Array)d=t.INT;else if(c instanceof Int8Array)d=t.BYTE;else if(c instanceof Uint8Array)d=t.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:f}}function i(o,l,c){const u=l.array,f=l.updateRanges;if(t.bindBuffer(c,o),f.length===0)t.bufferSubData(c,0,u);else{f.sort((d,g)=>d.start-g.start);let h=0;for(let d=1;d<f.length;d++){const g=f[h],b=f[d];b.start<=g.start+g.count+1?g.count=Math.max(g.count,b.start+b.count-g.start):(++h,f[h]=b)}f.length=h+1;for(let d=0,g=f.length;d<g;d++){const b=f[d];t.bufferSubData(c,b.start*u.BYTES_PER_ELEMENT,u,b.start,b.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function a(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(t.deleteBuffer(l.buffer),e.delete(o))}function s(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const u=e.get(o);(!u||u.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=e.get(o);if(c===void 0)e.set(o,n(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");i(c.buffer,o,l),c.version=o.version}}return{get:r,remove:a,update:s}}var Uve=`#ifdef USE_ALPHAHASH
	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,Fve=`#ifdef USE_ALPHAHASH
	const float ALPHA_HASH_SCALE = 0.05;
	float hash2D( vec2 value ) {
		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
	}
	float hash3D( vec3 value ) {
		return hash2D( vec2( hash2D( value.xy ), value.z ) );
	}
	float getAlphaHashThreshold( vec3 position ) {
		float maxDeriv = max(
			length( dFdx( position.xyz ) ),
			length( dFdy( position.xyz ) )
		);
		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
		vec2 pixScales = vec2(
			exp2( floor( log2( pixScale ) ) ),
			exp2( ceil( log2( pixScale ) ) )
		);
		vec2 alpha = vec2(
			hash3D( floor( pixScales.x * position.xyz ) ),
			hash3D( floor( pixScales.y * position.xyz ) )
		);
		float lerpFactor = fract( log2( pixScale ) );
		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
		float a = min( lerpFactor, 1.0 - lerpFactor );
		vec3 cases = vec3(
			x * x / ( 2.0 * a * ( 1.0 - a ) ),
			( x - 0.5 * a ) / ( 1.0 - a ),
			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
		);
		float threshold = ( x < ( 1.0 - a ) )
			? ( ( x < a ) ? cases.x : cases.y )
			: cases.z;
		return clamp( threshold , 1.0e-6, 1.0 );
	}
#endif`,Bve=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,zve=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,jve=`#ifdef USE_ALPHATEST
	#ifdef ALPHA_TO_COVERAGE
	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
	if ( diffuseColor.a == 0.0 ) discard;
	#else
	if ( diffuseColor.a < alphaTest ) discard;
	#endif
#endif`,Hve=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,Vve=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_CLEARCOAT ) 
		clearcoatSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_SHEEN ) 
		sheenSpecularIndirect *= ambientOcclusion;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,Gve=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,Wve=`#ifdef USE_BATCHING
	#if ! defined( GL_ANGLE_multi_draw )
	#define gl_DrawID _gl_DrawID
	uniform int _gl_DrawID;
	#endif
	uniform highp sampler2D batchingTexture;
	uniform highp usampler2D batchingIdTexture;
	mat4 getBatchingMatrix( const in float i ) {
		int size = textureSize( batchingTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
	float getIndirectIndex( const in int i ) {
		int size = textureSize( batchingIdTexture, 0 ).x;
		int x = i % size;
		int y = i / size;
		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
	}
#endif
#ifdef USE_BATCHING_COLOR
	uniform sampler2D batchingColorTexture;
	vec3 getBatchingColor( const in float i ) {
		int size = textureSize( batchingColorTexture, 0 ).x;
		int j = int( i );
		int x = j % size;
		int y = j / size;
		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
	}
#endif`,qve=`#ifdef USE_BATCHING
	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
#endif`,Xve=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
	vPosition = vec3( position );
#endif`,Kve=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,Yve=`float G_BlinnPhong_Implicit( ) {
	return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
	float G = G_BlinnPhong_Implicit( );
	float D = D_BlinnPhong( shininess, dotNH );
	return F * ( G * D );
} // validated`,Jve=`#ifdef USE_IRIDESCENCE
	const mat3 XYZ_TO_REC709 = mat3(
		 3.2404542, -0.9692660,  0.0556434,
		-1.5371385,  1.8760108, -0.2040259,
		-0.4985314,  0.0415560,  1.0572252
	);
	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
		vec3 sqrtF0 = sqrt( fresnel0 );
		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
	}
	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
	}
	float IorToFresnel0( float transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
	}
	vec3 evalSensitivity( float OPD, vec3 shift ) {
		float phase = 2.0 * PI * OPD * 1.0e-9;
		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
		xyz /= 1.0685e-7;
		vec3 rgb = XYZ_TO_REC709 * xyz;
		return rgb;
	}
	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
		vec3 I;
		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
		float cosTheta2Sq = 1.0 - sinTheta2Sq;
		if ( cosTheta2Sq < 0.0 ) {
			return vec3( 1.0 );
		}
		float cosTheta2 = sqrt( cosTheta2Sq );
		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
		float T121 = 1.0 - R12;
		float phi12 = 0.0;
		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
		float phi21 = PI - phi12;
		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
		vec3 phi23 = vec3( 0.0 );
		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
		vec3 phi = vec3( phi21 ) + phi23;
		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
		vec3 r123 = sqrt( R123 );
		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
		vec3 C0 = R12 + Rs;
		I = C0;
		vec3 Cm = Rs - T121;
		for ( int m = 1; m <= 2; ++ m ) {
			Cm *= r123;
			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
			I += Cm * Sm;
		}
		return max( I, vec3( 0.0 ) );
	}
#endif`,$ve=`#ifdef USE_BUMPMAP
	uniform sampler2D bumpMap;
	uniform float bumpScale;
	vec2 dHdxy_fwd() {
		vec2 dSTdx = dFdx( vBumpMapUv );
		vec2 dSTdy = dFdy( vBumpMapUv );
		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
		return vec2( dBx, dBy );
	}
	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
		vec3 vN = surf_norm;
		vec3 R1 = cross( vSigmaY, vN );
		vec3 R2 = cross( vN, vSigmaX );
		float fDet = dot( vSigmaX, R1 ) * faceDirection;
		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
		return normalize( abs( fDet ) * surf_norm - vGrad );
	}
#endif`,Zve=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#ifdef ALPHA_TO_COVERAGE
		float distanceToPlane, distanceGradient;
		float clipOpacity = 1.0;
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
			distanceGradient = fwidth( distanceToPlane ) / 2.0;
			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			if ( clipOpacity == 0.0 ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			float unionClipOpacity = 1.0;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
				distanceGradient = fwidth( distanceToPlane ) / 2.0;
				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
			}
			#pragma unroll_loop_end
			clipOpacity *= 1.0 - unionClipOpacity;
		#endif
		diffuseColor.a *= clipOpacity;
		if ( diffuseColor.a == 0.0 ) discard;
	#else
		#pragma unroll_loop_start
		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
		}
		#pragma unroll_loop_end
		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
			bool clipped = true;
			#pragma unroll_loop_start
			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
				plane = clippingPlanes[ i ];
				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
			}
			#pragma unroll_loop_end
			if ( clipped ) discard;
		#endif
	#endif
#endif`,Qve=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,eye=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,tye=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,nye=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,iye=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,rye=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	varying vec3 vColor;
#endif`,aye=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif
#ifdef USE_BATCHING_COLOR
	vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
	vColor.xyz *= batchingColor.xyz;
#endif`,sye=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
	return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
	float precisionSafeLength( vec3 v ) { return length( v ); }
#else
	float precisionSafeLength( vec3 v ) {
		float maxComponent = max3( abs( v ) );
		return length( v / maxComponent ) * maxComponent;
	}
#endif
struct IncidentLight {
	vec3 color;
	vec3 direction;
	bool visible;
};
struct ReflectedLight {
	vec3 directDiffuse;
	vec3 directSpecular;
	vec3 indirectDiffuse;
	vec3 indirectSpecular;
};
#ifdef USE_ALPHAHASH
	varying vec3 vPosition;
#endif
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
	mat3 tmp;
	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
	return tmp;
}
bool isPerspectiveMatrix( mat4 m ) {
	return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
	return vec2( u, v );
}
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
	return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
} // validated`,oye=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_minTileSize 16.0
	float getFace( vec3 direction ) {
		vec3 absDirection = abs( direction );
		float face = - 1.0;
		if ( absDirection.x > absDirection.z ) {
			if ( absDirection.x > absDirection.y )
				face = direction.x > 0.0 ? 0.0 : 3.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		} else {
			if ( absDirection.z > absDirection.y )
				face = direction.z > 0.0 ? 2.0 : 5.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		}
		return face;
	}
	vec2 getUV( vec3 direction, float face ) {
		vec2 uv;
		if ( face == 0.0 ) {
			uv = vec2( direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 1.0 ) {
			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
		} else if ( face == 2.0 ) {
			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
		} else if ( face == 3.0 ) {
			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 4.0 ) {
			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
		} else {
			uv = vec2( direction.x, direction.y ) / abs( direction.z );
		}
		return 0.5 * ( uv + 1.0 );
	}
	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
		float face = getFace( direction );
		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
		mipInt = max( mipInt, cubeUV_minMipLevel );
		float faceSize = exp2( mipInt );
		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
		uv.x *= CUBEUV_TEXEL_WIDTH;
		uv.y *= CUBEUV_TEXEL_HEIGHT;
		#ifdef texture2DGradEXT
			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
		#else
			return texture2D( envMap, uv ).rgb;
		#endif
	}
	#define cubeUV_r0 1.0
	#define cubeUV_m0 - 2.0
	#define cubeUV_r1 0.8
	#define cubeUV_m1 - 1.0
	#define cubeUV_r4 0.4
	#define cubeUV_m4 2.0
	#define cubeUV_r5 0.305
	#define cubeUV_m5 3.0
	#define cubeUV_r6 0.21
	#define cubeUV_m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= cubeUV_r1 ) {
			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
		} else if ( roughness >= cubeUV_r4 ) {
			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
		} else if ( roughness >= cubeUV_r5 ) {
			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
		} else if ( roughness >= cubeUV_r6 ) {
			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
		float mipF = fract( mip );
		float mipInt = floor( mip );
		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
		if ( mipF == 0.0 ) {
			return vec4( color0, 1.0 );
		} else {
			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
			return vec4( mix( color0, color1, mipF ), 1.0 );
		}
	}
#endif`,lye=`vec3 transformedNormal = objectNormal;
#ifdef USE_TANGENT
	vec3 transformedTangent = objectTangent;
#endif
#ifdef USE_BATCHING
	mat3 bm = mat3( batchingMatrix );
	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
	transformedNormal = bm * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = bm * transformedTangent;
	#endif
#endif
#ifdef USE_INSTANCING
	mat3 im = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
	transformedNormal = im * transformedNormal;
	#ifdef USE_TANGENT
		transformedTangent = im * transformedTangent;
	#endif
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,cye=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,uye=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,fye=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
		emissiveColor = sRGBTransferEOTF( emissiveColor );
	#endif
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,hye=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,dye="gl_FragColor = linearToOutputTexel( gl_FragColor );",pye=`vec4 LinearTransferOETF( in vec4 value ) {
	return value;
}
vec4 sRGBTransferEOTF( in vec4 value ) {
	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
}
vec4 sRGBTransferOETF( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,mye=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vec3 cameraToFrag;
		if ( isOrthographic ) {
			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToFrag = normalize( vWorldPosition - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
		#else
			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
		#endif
	#else
		vec3 reflectVec = vReflect;
	#endif
	#ifdef ENVMAP_TYPE_CUBE
		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#ifdef ENVMAP_BLENDING_MULTIPLY
		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_MIX )
		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_ADD )
		outgoingLight += envColor.xyz * specularStrength * reflectivity;
	#endif
#endif`,gye=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	uniform mat3 envMapRotation;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,bye=`#ifdef USE_ENVMAP
	uniform float reflectivity;
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		varying vec3 vWorldPosition;
		uniform float refractionRatio;
	#else
		varying vec3 vReflect;
	#endif
#endif`,vye=`#ifdef USE_ENVMAP
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		
		varying vec3 vWorldPosition;
	#else
		varying vec3 vReflect;
		uniform float refractionRatio;
	#endif
#endif`,yye=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vWorldPosition = worldPosition.xyz;
	#else
		vec3 cameraToVertex;
		if ( isOrthographic ) {
			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vReflect = reflect( cameraToVertex, worldNormal );
		#else
			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
		#endif
	#endif
#endif`,xye=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,_ye=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,Sye=`#ifdef USE_FOG
	#ifdef FOG_EXP2
		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
	#else
		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
	#endif
	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,wye=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,Eye=`#ifdef USE_GRADIENTMAP
	uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
	float dotNL = dot( normal, lightDirection );
	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
	#ifdef USE_GRADIENTMAP
		return vec3( texture2D( gradientMap, coord ).r );
	#else
		vec2 fw = fwidth( coord ) * 0.5;
		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
	#endif
}`,Mye=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,Tye=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,Aye=`varying vec3 vViewPosition;
struct LambertMaterial {
	vec3 diffuseColor;
	float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Lambert
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,Cye=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
#if defined( USE_LIGHT_PROBES )
	uniform vec3 lightProbe[ 9 ];
#endif
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
	float x = normal.x, y = normal.y, z = normal.z;
	vec3 result = shCoefficients[ 0 ] * 0.886227;
	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
	return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
	return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
	vec3 irradiance = ambientLightColor;
	return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
	if ( cutoffDistance > 0.0 ) {
		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
	}
	return distanceFalloff;
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
	return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
	struct DirectionalLight {
		vec3 direction;
		vec3 color;
	};
	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
		light.color = directionalLight.color;
		light.direction = directionalLight.direction;
		light.visible = true;
	}
#endif
#if NUM_POINT_LIGHTS > 0
	struct PointLight {
		vec3 position;
		vec3 color;
		float distance;
		float decay;
	};
	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float lightDistance = length( lVector );
		light.color = pointLight.color;
		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
		light.visible = ( light.color != vec3( 0.0 ) );
	}
#endif
#if NUM_SPOT_LIGHTS > 0
	struct SpotLight {
		vec3 position;
		vec3 direction;
		vec3 color;
		float distance;
		float decay;
		float coneCos;
		float penumbraCos;
	};
	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometryPosition;
		light.direction = normalize( lVector );
		float angleCos = dot( light.direction, spotLight.direction );
		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
		if ( spotAttenuation > 0.0 ) {
			float lightDistance = length( lVector );
			light.color = spotLight.color * spotAttenuation;
			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
			light.visible = ( light.color != vec3( 0.0 ) );
		} else {
			light.color = vec3( 0.0 );
			light.visible = false;
		}
	}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
	struct RectAreaLight {
		vec3 color;
		vec3 position;
		vec3 halfWidth;
		vec3 halfHeight;
	};
	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
	struct HemisphereLight {
		vec3 direction;
		vec3 skyColor;
		vec3 groundColor;
	};
	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
		float dotNL = dot( normal, hemiLight.direction );
		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
		return irradiance;
	}
#endif`,Rye=`#ifdef USE_ENVMAP
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
			return PI * envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
		#ifdef ENVMAP_TYPE_CUBE_UV
			vec3 reflectVec = reflect( - viewDir, normal );
			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
			return envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	#ifdef USE_ANISOTROPY
		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
			#ifdef ENVMAP_TYPE_CUBE_UV
				vec3 bentNormal = cross( bitangent, viewDir );
				bentNormal = normalize( cross( bentNormal, bitangent ) );
				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
				return getIBLRadiance( viewDir, bentNormal, roughness );
			#else
				return vec3( 0.0 );
			#endif
		}
	#endif
#endif`,kye=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,Dye=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Toon
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,Oye=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,Iye=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_BlinnPhong
#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,Nye=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
	material.ior = ior;
	#ifdef USE_SPECULAR
		float specularIntensityFactor = specularIntensity;
		vec3 specularColorFactor = specularColor;
		#ifdef USE_SPECULAR_COLORMAP
			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
		#endif
		#ifdef USE_SPECULAR_INTENSITYMAP
			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
		#endif
		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
	#else
		float specularIntensityFactor = 1.0;
		vec3 specularColorFactor = vec3( 1.0 );
		material.specularF90 = 1.0;
	#endif
	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
	material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
	material.clearcoat = clearcoat;
	material.clearcoatRoughness = clearcoatRoughness;
	material.clearcoatF0 = vec3( 0.04 );
	material.clearcoatF90 = 1.0;
	#ifdef USE_CLEARCOATMAP
		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
	#endif
	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
	#endif
	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
	material.clearcoatRoughness += geometryRoughness;
	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_DISPERSION
	material.dispersion = dispersion;
#endif
#ifdef USE_IRIDESCENCE
	material.iridescence = iridescence;
	material.iridescenceIOR = iridescenceIOR;
	#ifdef USE_IRIDESCENCEMAP
		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
	#endif
	#ifdef USE_IRIDESCENCE_THICKNESSMAP
		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
	#else
		material.iridescenceThickness = iridescenceThicknessMaximum;
	#endif
#endif
#ifdef USE_SHEEN
	material.sheenColor = sheenColor;
	#ifdef USE_SHEEN_COLORMAP
		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
	#endif
	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
	#ifdef USE_SHEEN_ROUGHNESSMAP
		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
	#endif
#endif
#ifdef USE_ANISOTROPY
	#ifdef USE_ANISOTROPYMAP
		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
	#else
		vec2 anisotropyV = anisotropyVector;
	#endif
	material.anisotropy = length( anisotropyV );
	if( material.anisotropy == 0.0 ) {
		anisotropyV = vec2( 1.0, 0.0 );
	} else {
		anisotropyV /= material.anisotropy;
		material.anisotropy = saturate( material.anisotropy );
	}
	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
#endif`,Lye=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	float dispersion;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_IRIDESCENCE
		float iridescence;
		float iridescenceIOR;
		float iridescenceThickness;
		vec3 iridescenceFresnel;
		vec3 iridescenceF0;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
	#ifdef IOR
		float ior;
	#endif
	#ifdef USE_TRANSMISSION
		float transmission;
		float transmissionAlpha;
		float thickness;
		float attenuationDistance;
		vec3 attenuationColor;
	#endif
	#ifdef USE_ANISOTROPY
		float anisotropy;
		float alphaT;
		vec3 anisotropyT;
		vec3 anisotropyB;
	#endif
};
vec3 clearcoatSpecularDirect = vec3( 0.0 );
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
vec3 sheenSpecularDirect = vec3( 0.0 );
vec3 sheenSpecularIndirect = vec3(0.0 );
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
    float x2 = x * x;
    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
	float a2 = pow2( alpha );
	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
	return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
	float a2 = pow2( alpha );
	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
	return RECIPROCAL_PI * a2 / pow2( denom );
}
#ifdef USE_ANISOTROPY
	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
		float v = 0.5 / ( gv + gl );
		return saturate(v);
	}
	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
		float a2 = alphaT * alphaB;
		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
		highp float v2 = dot( v, v );
		float w2 = a2 / v2;
		return RECIPROCAL_PI * a2 * pow2 ( w2 );
	}
#endif
#ifdef USE_CLEARCOAT
	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
		vec3 f0 = material.clearcoatF0;
		float f90 = material.clearcoatF90;
		float roughness = material.clearcoatRoughness;
		float alpha = pow2( roughness );
		vec3 halfDir = normalize( lightDir + viewDir );
		float dotNL = saturate( dot( normal, lightDir ) );
		float dotNV = saturate( dot( normal, viewDir ) );
		float dotNH = saturate( dot( normal, halfDir ) );
		float dotVH = saturate( dot( viewDir, halfDir ) );
		vec3 F = F_Schlick( f0, f90, dotVH );
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
		return F * ( V * D );
	}
#endif
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
	vec3 f0 = material.specularColor;
	float f90 = material.specularF90;
	float roughness = material.roughness;
	float alpha = pow2( roughness );
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( f0, f90, dotVH );
	#ifdef USE_IRIDESCENCE
		F = mix( F, material.iridescenceFresnel, material.iridescence );
	#endif
	#ifdef USE_ANISOTROPY
		float dotTL = dot( material.anisotropyT, lightDir );
		float dotTV = dot( material.anisotropyT, viewDir );
		float dotTH = dot( material.anisotropyT, halfDir );
		float dotBL = dot( material.anisotropyB, lightDir );
		float dotBV = dot( material.anisotropyB, viewDir );
		float dotBH = dot( material.anisotropyB, halfDir );
		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
	#else
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
	#endif
	return F * ( V * D );
}
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
	const float LUT_SIZE = 64.0;
	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
	const float LUT_BIAS = 0.5 / LUT_SIZE;
	float dotNV = saturate( dot( N, V ) );
	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
	uv = uv * LUT_SCALE + LUT_BIAS;
	return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
	float l = length( f );
	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
	float x = dot( v1, v2 );
	float y = abs( x );
	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
	float b = 3.4175940 + ( 4.1616724 + y ) * y;
	float v = a / b;
	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
	return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
	vec3 lightNormal = cross( v1, v2 );
	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
	vec3 T1, T2;
	T1 = normalize( V - N * dot( V, N ) );
	T2 = - cross( N, T1 );
	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
	vec3 coords[ 4 ];
	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
	coords[ 0 ] = normalize( coords[ 0 ] );
	coords[ 1 ] = normalize( coords[ 1 ] );
	coords[ 2 ] = normalize( coords[ 2 ] );
	coords[ 3 ] = normalize( coords[ 3 ] );
	vec3 vectorFormFactor = vec3( 0.0 );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
	return vec3( result );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
	float alpha = pow2( roughness );
	float invAlpha = 1.0 / alpha;
	float cos2h = dotNH * dotNH;
	float sin2h = max( 1.0 - cos2h, 0.0078125 );
	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float D = D_Charlie( sheenRoughness, dotNH );
	float V = V_Neubelt( dotNV, dotNL );
	return sheenColor * ( D * V );
}
#endif
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	float r2 = roughness * roughness;
	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
	return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
	vec4 r = roughness * c0 + c1;
	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
	return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	#ifdef USE_IRIDESCENCE
		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
	#else
		vec3 Fr = specularColor;
	#endif
	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
	float Ess = fab.x + fab.y;
	float Ems = 1.0 - Ess;
	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
	singleScatter += FssEss;
	multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometryNormal;
		vec3 viewDir = geometryViewDir;
		vec3 position = geometryPosition;
		vec3 lightPos = rectAreaLight.position;
		vec3 halfWidth = rectAreaLight.halfWidth;
		vec3 halfHeight = rectAreaLight.halfHeight;
		vec3 lightColor = rectAreaLight.color;
		float roughness = material.roughness;
		vec3 rectCoords[ 4 ];
		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
		vec2 uv = LTC_Uv( normal, viewDir, roughness );
		vec4 t1 = texture2D( ltc_1, uv );
		vec4 t2 = texture2D( ltc_2, uv );
		mat3 mInv = mat3(
			vec3( t1.x, 0, t1.y ),
			vec3(    0, 1,    0 ),
			vec3( t1.z, 0, t1.w )
		);
		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
	#endif
	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	#ifdef USE_IRIDESCENCE
		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
	#else
		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	#endif
	vec3 totalScattering = singleScattering + multiScattering;
	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct				RE_Direct_Physical
#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,Pye=`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 geometryClearcoatNormal = vec3( 0.0 );
#ifdef USE_CLEARCOAT
	geometryClearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometryViewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		pointLight = pointLights[ i ];
		getPointLightInfo( pointLight, geometryPosition, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;
	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		spotLight = spotLights[ i ];
		getSpotLightInfo( spotLight, geometryPosition, directLight );
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		directionalLight = directionalLights[ i ];
		getDirectionalLightInfo( directionalLight, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
	RectAreaLight rectAreaLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	#if defined( USE_LIGHT_PROBES )
		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
	#endif
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,Uye=`#if defined( RE_IndirectDiffuse )
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
		irradiance += lightMapIrradiance;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
		iblIrradiance += getIBLIrradiance( geometryNormal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	#ifdef USE_ANISOTROPY
		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
	#else
		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
	#endif
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,Fye=`#if defined( RE_IndirectDiffuse )
	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif`,Bye=`#if defined( USE_LOGDEPTHBUF )
	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,zye=`#if defined( USE_LOGDEPTHBUF )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,jye=`#ifdef USE_LOGDEPTHBUF
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,Hye=`#ifdef USE_LOGDEPTHBUF
	vFragDepth = 1.0 + gl_Position.w;
	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,Vye=`#ifdef USE_MAP
	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
	#ifdef DECODE_VIDEO_TEXTURE
		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
	#endif
	diffuseColor *= sampledDiffuseColor;
#endif`,Gye=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,Wye=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	#if defined( USE_POINTS_UV )
		vec2 uv = vUv;
	#else
		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
	#endif
#endif
#ifdef USE_MAP
	diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,qye=`#if defined( USE_POINTS_UV )
	varying vec2 vUv;
#else
	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
		uniform mat3 uvTransform;
	#endif
#endif
#ifdef USE_MAP
	uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,Xye=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
	metalnessFactor *= texelMetalness.b;
#endif`,Kye=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,Yye=`#ifdef USE_INSTANCING_MORPH
	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
	}
#endif`,Jye=`#if defined( USE_MORPHCOLORS )
	vColor *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		#if defined( USE_COLOR_ALPHA )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
		#elif defined( USE_COLOR )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
		#endif
	}
#endif`,$ye=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,Zye=`#ifdef USE_MORPHTARGETS
	#ifndef USE_INSTANCING_MORPH
		uniform float morphTargetBaseInfluence;
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
	#endif
	uniform sampler2DArray morphTargetsTexture;
	uniform ivec2 morphTargetsTextureSize;
	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
		int y = texelIndex / morphTargetsTextureSize.x;
		int x = texelIndex - y * morphTargetsTextureSize.x;
		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
		return texelFetch( morphTargetsTexture, morphUV, 0 );
	}
#endif`,Qye=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
	}
#endif`,exe=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
	vec3 fdx = dFdx( vViewPosition );
	vec3 fdy = dFdy( vViewPosition );
	vec3 normal = normalize( cross( fdx, fdy ) );
#else
	vec3 normal = normalize( vNormal );
	#ifdef DOUBLE_SIDED
		normal *= faceDirection;
	#endif
#endif
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
	#ifdef USE_TANGENT
		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn = getTangentFrame( - vViewPosition, normal,
		#if defined( USE_NORMALMAP )
			vNormalMapUv
		#elif defined( USE_CLEARCOAT_NORMALMAP )
			vClearcoatNormalMapUv
		#else
			vUv
		#endif
		);
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn[0] *= faceDirection;
		tbn[1] *= faceDirection;
	#endif
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	#ifdef USE_TANGENT
		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
	#else
		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
	#endif
	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
		tbn2[0] *= faceDirection;
		tbn2[1] *= faceDirection;
	#endif
#endif
vec3 nonPerturbedNormal = normal;`,txe=`#ifdef USE_NORMALMAP_OBJECTSPACE
	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	#ifdef FLIP_SIDED
		normal = - normal;
	#endif
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	normal = normalize( normalMatrix * normal );
#elif defined( USE_NORMALMAP_TANGENTSPACE )
	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
	mapN.xy *= normalScale;
	normal = normalize( tbn * mapN );
#elif defined( USE_BUMPMAP )
	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,nxe=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,ixe=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,rxe=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,axe=`#ifdef USE_NORMALMAP
	uniform sampler2D normalMap;
	uniform vec2 normalScale;
#endif
#ifdef USE_NORMALMAP_OBJECTSPACE
	uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
		vec3 q0 = dFdx( eye_pos.xyz );
		vec3 q1 = dFdy( eye_pos.xyz );
		vec2 st0 = dFdx( uv.st );
		vec2 st1 = dFdy( uv.st );
		vec3 N = surf_norm;
		vec3 q1perp = cross( q1, N );
		vec3 q0perp = cross( N, q0 );
		vec3 T = q1perp * st0.x + q0perp * st1.x;
		vec3 B = q1perp * st0.y + q0perp * st1.y;
		float det = max( dot( T, T ), dot( B, B ) );
		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
		return mat3( T * scale, B * scale, N );
	}
#endif`,sxe=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,oxe=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,lxe=`#ifdef USE_CLEARCOATMAP
	uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform sampler2D clearcoatNormalMap;
	uniform vec2 clearcoatNormalScale;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform sampler2D clearcoatRoughnessMap;
#endif`,cxe=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,uxe=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,fxe=`vec3 packNormalToRGB( const in vec3 normal ) {
	return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
	return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
const float Inv255 = 1. / 255.;
const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
vec4 packDepthToRGBA( const in float v ) {
	if( v <= 0.0 )
		return vec4( 0., 0., 0., 0. );
	if( v >= 1.0 )
		return vec4( 1., 1., 1., 1. );
	float vuf;
	float af = modf( v * PackFactors.a, vuf );
	float bf = modf( vuf * ShiftRight8, vuf );
	float gf = modf( vuf * ShiftRight8, vuf );
	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
}
vec3 packDepthToRGB( const in float v ) {
	if( v <= 0.0 )
		return vec3( 0., 0., 0. );
	if( v >= 1.0 )
		return vec3( 1., 1., 1. );
	float vuf;
	float bf = modf( v * PackFactors.b, vuf );
	float gf = modf( vuf * ShiftRight8, vuf );
	return vec3( vuf * Inv255, gf * PackUpscale, bf );
}
vec2 packDepthToRG( const in float v ) {
	if( v <= 0.0 )
		return vec2( 0., 0. );
	if( v >= 1.0 )
		return vec2( 1., 1. );
	float vuf;
	float gf = modf( v * 256., vuf );
	return vec2( vuf * Inv255, gf );
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors4 );
}
float unpackRGBToDepth( const in vec3 v ) {
	return dot( v, UnpackFactors3 );
}
float unpackRGToDepth( const in vec2 v ) {
	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
}
vec4 pack2HalfToRGBA( const in vec2 v ) {
	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( const in vec4 v ) {
	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
	return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return depth * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
	return ( near * far ) / ( ( far - near ) * depth - far );
}`,hxe=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,dxe=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
	mvPosition = batchingMatrix * mvPosition;
#endif
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,pxe=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,mxe=`#ifdef DITHERING
	vec3 dithering( vec3 color ) {
		float grid_position = rand( gl_FragCoord.xy );
		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
		return color + dither_shift_RGB;
	}
#endif`,gxe=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
	roughnessFactor *= texelRoughness.g;
#endif`,bxe=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,vxe=`#if NUM_SPOT_LIGHT_COORDS > 0
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		float depth = unpackRGBAToDepth( texture2D( depths, uv ) );
		#ifdef USE_REVERSEDEPTHBUF
			return step( depth, compare );
		#else
			return step( compare, depth );
		#endif
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		#ifdef USE_REVERSEDEPTHBUF
			float hard_shadow = step( distribution.x, compare );
		#else
			float hard_shadow = step( compare , distribution.x );
		#endif
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return mix( 1.0, shadow, shadowIntensity );
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		float shadow = 1.0;
		vec3 lightToPosition = shadowCoord.xyz;
		
		float lightToPositionLength = length( lightToPosition );
		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
			vec3 bd3D = normalize( lightToPosition );
			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
				shadow = (
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
				) * ( 1.0 / 9.0 );
			#else
				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
			#endif
		}
		return mix( 1.0, shadow, shadowIntensity );
	}
#endif`,yxe=`#if NUM_SPOT_LIGHT_COORDS > 0
	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		struct SpotLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowIntensity;
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,xxe=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
	vec4 shadowWorldPosition;
#endif
#if defined( USE_SHADOWMAP )
	#if NUM_DIR_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
		}
		#pragma unroll_loop_end
	#endif
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
		shadowWorldPosition = worldPosition;
		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
		#endif
		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
#endif`,_xe=`float getShadowMask() {
	float shadow = 1.0;
	#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		directionalLight = directionalLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		spotLight = spotLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		pointLight = pointLightShadows[ i ];
		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,Sxe=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,wxe=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	uniform highp sampler2D boneTexture;
	mat4 getBoneMatrix( const in float i ) {
		int size = textureSize( boneTexture, 0 ).x;
		int j = int( i ) * 4;
		int x = j % size;
		int y = j / size;
		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
		return mat4( v1, v2, v3, v4 );
	}
#endif`,Exe=`#ifdef USE_SKINNING
	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
	vec4 skinned = vec4( 0.0 );
	skinned += boneMatX * skinVertex * skinWeight.x;
	skinned += boneMatY * skinVertex * skinWeight.y;
	skinned += boneMatZ * skinVertex * skinWeight.z;
	skinned += boneMatW * skinVertex * skinWeight.w;
	transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,Mxe=`#ifdef USE_SKINNING
	mat4 skinMatrix = mat4( 0.0 );
	skinMatrix += skinWeight.x * boneMatX;
	skinMatrix += skinWeight.y * boneMatY;
	skinMatrix += skinWeight.z * boneMatZ;
	skinMatrix += skinWeight.w * boneMatW;
	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
	#ifdef USE_TANGENT
		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#endif
#endif`,Txe=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,Axe=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,Cxe=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,Rxe=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
	return saturate( toneMappingExposure * color );
}
vec3 ReinhardToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 CineonToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	color = max( vec3( 0.0 ), color - 0.004 );
	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
	return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
	const mat3 ACESInputMat = mat3(
		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
		vec3( 0.04823, 0.01566, 0.83777 )
	);
	const mat3 ACESOutputMat = mat3(
		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
		vec3( -0.07367, -0.00605,  1.07602 )
	);
	color *= toneMappingExposure / 0.6;
	color = ACESInputMat * color;
	color = RRTAndODTFit( color );
	color = ACESOutputMat * color;
	return saturate( color );
}
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
	vec3( 1.6605, - 0.1246, - 0.0182 ),
	vec3( - 0.5876, 1.1329, - 0.1006 ),
	vec3( - 0.0728, - 0.0083, 1.1187 )
);
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
	vec3( 0.6274, 0.0691, 0.0164 ),
	vec3( 0.3293, 0.9195, 0.0880 ),
	vec3( 0.0433, 0.0113, 0.8956 )
);
vec3 agxDefaultContrastApprox( vec3 x ) {
	vec3 x2 = x * x;
	vec3 x4 = x2 * x2;
	return + 15.5 * x4 * x2
		- 40.14 * x4 * x
		+ 31.96 * x4
		- 6.868 * x2 * x
		+ 0.4298 * x2
		+ 0.1191 * x
		- 0.00232;
}
vec3 AgXToneMapping( vec3 color ) {
	const mat3 AgXInsetMatrix = mat3(
		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
	);
	const mat3 AgXOutsetMatrix = mat3(
		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
	);
	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
	color *= toneMappingExposure;
	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
	color = AgXInsetMatrix * color;
	color = max( color, 1e-10 );	color = log2( color );
	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
	color = clamp( color, 0.0, 1.0 );
	color = agxDefaultContrastApprox( color );
	color = AgXOutsetMatrix * color;
	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
	color = clamp( color, 0.0, 1.0 );
	return color;
}
vec3 NeutralToneMapping( vec3 color ) {
	const float StartCompression = 0.8 - 0.04;
	const float Desaturation = 0.15;
	color *= toneMappingExposure;
	float x = min( color.r, min( color.g, color.b ) );
	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
	color -= offset;
	float peak = max( color.r, max( color.g, color.b ) );
	if ( peak < StartCompression ) return color;
	float d = 1. - StartCompression;
	float newPeak = 1. - d * d / ( peak + d - StartCompression );
	color *= newPeak / peak;
	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
	return mix( color, vec3( newPeak ), g );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,kxe=`#ifdef USE_TRANSMISSION
	material.transmission = transmission;
	material.transmissionAlpha = 1.0;
	material.thickness = thickness;
	material.attenuationDistance = attenuationDistance;
	material.attenuationColor = attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
	#endif
	#ifdef USE_THICKNESSMAP
		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
	#endif
	vec3 pos = vWorldPosition;
	vec3 v = normalize( cameraPosition - pos );
	vec3 n = inverseTransformDirection( normal, viewMatrix );
	vec4 transmitted = getIBLVolumeRefraction(
		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
		material.attenuationColor, material.attenuationDistance );
	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,Dxe=`#ifdef USE_TRANSMISSION
	uniform float transmission;
	uniform float thickness;
	uniform float attenuationDistance;
	uniform vec3 attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		uniform sampler2D transmissionMap;
	#endif
	#ifdef USE_THICKNESSMAP
		uniform sampler2D thicknessMap;
	#endif
	uniform vec2 transmissionSamplerSize;
	uniform sampler2D transmissionSamplerMap;
	uniform mat4 modelMatrix;
	uniform mat4 projectionMatrix;
	varying vec3 vWorldPosition;
	float w0( float a ) {
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
	}
	float w1( float a ) {
		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
	}
	float w2( float a ){
		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
	}
	float w3( float a ) {
		return ( 1.0 / 6.0 ) * ( a * a * a );
	}
	float g0( float a ) {
		return w0( a ) + w1( a );
	}
	float g1( float a ) {
		return w2( a ) + w3( a );
	}
	float h0( float a ) {
		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
	}
	float h1( float a ) {
		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
	}
	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
		uv = uv * texelSize.zw + 0.5;
		vec2 iuv = floor( uv );
		vec2 fuv = fract( uv );
		float g0x = g0( fuv.x );
		float g1x = g1( fuv.x );
		float h0x = h0( fuv.x );
		float h1x = h1( fuv.x );
		float h0y = h0( fuv.y );
		float h1y = h1( fuv.y );
		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
	}
	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
		vec2 fLodSizeInv = 1.0 / fLodSize;
		vec2 cLodSizeInv = 1.0 / cLodSize;
		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
		return mix( fSample, cSample, fract( lod ) );
	}
	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
		vec3 modelScale;
		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
		return normalize( refractionVector ) * thickness * modelScale;
	}
	float applyIorToRoughness( const in float roughness, const in float ior ) {
		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
	}
	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
	}
	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
		if ( isinf( attenuationDistance ) ) {
			return vec3( 1.0 );
		} else {
			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
		}
	}
	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
		const in vec3 attenuationColor, const in float attenuationDistance ) {
		vec4 transmittedLight;
		vec3 transmittance;
		#ifdef USE_DISPERSION
			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
			for ( int i = 0; i < 3; i ++ ) {
				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
				vec3 refractedRayExit = position + transmissionRay;
				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
				refractionCoords += 1.0;
				refractionCoords /= 2.0;
				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
				transmittedLight[ i ] = transmissionSample[ i ];
				transmittedLight.a += transmissionSample.a;
				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
			}
			transmittedLight.a /= 3.0;
		#else
			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
			vec3 refractedRayExit = position + transmissionRay;
			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
			refractionCoords += 1.0;
			refractionCoords /= 2.0;
			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
		#endif
		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
	}
#endif`,Oxe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_SPECULARMAP
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,Ixe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	varying vec2 vUv;
#endif
#ifdef USE_MAP
	uniform mat3 mapTransform;
	varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
	uniform mat3 alphaMapTransform;
	varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
	uniform mat3 lightMapTransform;
	varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
	uniform mat3 aoMapTransform;
	varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
	uniform mat3 bumpMapTransform;
	varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
	uniform mat3 normalMapTransform;
	varying vec2 vNormalMapUv;
#endif
#ifdef USE_DISPLACEMENTMAP
	uniform mat3 displacementMapTransform;
	varying vec2 vDisplacementMapUv;
#endif
#ifdef USE_EMISSIVEMAP
	uniform mat3 emissiveMapTransform;
	varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
	uniform mat3 metalnessMapTransform;
	varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
	uniform mat3 roughnessMapTransform;
	varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
	uniform mat3 anisotropyMapTransform;
	varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
	uniform mat3 clearcoatMapTransform;
	varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform mat3 clearcoatNormalMapTransform;
	varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform mat3 clearcoatRoughnessMapTransform;
	varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
	uniform mat3 sheenColorMapTransform;
	varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	uniform mat3 sheenRoughnessMapTransform;
	varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
	uniform mat3 iridescenceMapTransform;
	varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform mat3 iridescenceThicknessMapTransform;
	varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SPECULARMAP
	uniform mat3 specularMapTransform;
	varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
	uniform mat3 specularColorMapTransform;
	varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	uniform mat3 specularIntensityMapTransform;
	varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
	uniform mat3 transmissionMapTransform;
	varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
	uniform mat3 thicknessMapTransform;
	varying vec2 vThicknessMapUv;
#endif`,Nxe=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
	vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ALPHAMAP
	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_LIGHTMAP
	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_AOMAP
	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_BUMPMAP
	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_NORMALMAP
	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_DISPLACEMENTMAP
	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_EMISSIVEMAP
	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_METALNESSMAP
	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ROUGHNESSMAP
	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ANISOTROPYMAP
	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOATMAP
	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCEMAP
	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_COLORMAP
	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULARMAP
	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_COLORMAP
	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_TRANSMISSIONMAP
	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_THICKNESSMAP
	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
#endif`,Lxe=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_BATCHING
		worldPosition = batchingMatrix * worldPosition;
	#endif
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`;const Pxe=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,Uxe=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
	vec4 texColor = texture2D( t2D, vUv );
	#ifdef DECODE_VIDEO_TEXTURE
		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,Fxe=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,Bxe=`#ifdef ENVMAP_TYPE_CUBE
	uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
	uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
uniform mat3 backgroundRotation;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	#ifdef ENVMAP_TYPE_CUBE
		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
	#else
		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
	#endif
	texColor.rgb *= backgroundIntensity;
	gl_FragColor = texColor;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,zxe=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,jxe=`uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
	gl_FragColor = texColor;
	gl_FragColor.a *= opacity;
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,Hxe=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vHighPrecisionZW = gl_Position.zw;
}`,Vxe=`#if DEPTH_PACKING == 3200
	uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#if DEPTH_PACKING == 3200
		diffuseColor.a = opacity;
	#endif
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <logdepthbuf_fragment>
	#ifdef USE_REVERSEDEPTHBUF
		float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
	#else
		float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
	#endif
	#if DEPTH_PACKING == 3200
		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
	#elif DEPTH_PACKING == 3201
		gl_FragColor = packDepthToRGBA( fragCoordZ );
	#elif DEPTH_PACKING == 3202
		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
	#elif DEPTH_PACKING == 3203
		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
	#endif
}`,Gxe=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <skinbase_vertex>
	#include <morphinstance_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <worldpos_vertex>
	#include <clipping_planes_vertex>
	vWorldPosition = worldPosition.xyz;
}`,Wxe=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
	vec4 diffuseColor = vec4( 1.0 );
	#include <clipping_planes_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	float dist = length( vWorldPosition - referencePosition );
	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
	dist = saturate( dist );
	gl_FragColor = packDepthToRGBA( dist );
}`,qxe=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,Xxe=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
	vec3 direction = normalize( vWorldDirection );
	vec2 sampleUV = equirectUv( direction );
	gl_FragColor = texture2D( tEquirect, sampleUV );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
}`,Kxe=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	vLineDistance = scale * lineDistance;
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,Yxe=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,Jxe=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinbase_vertex>
		#include <skinnormal_vertex>
		#include <defaultnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <fog_vertex>
}`,$xe=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
	varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
	#else
		reflectedLight.indirectDiffuse += vec3( 1.0 );
	#endif
	#include <aomap_fragment>
	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
	vec3 outgoingLight = reflectedLight.indirectDiffuse;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,Zxe=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,Qxe=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_lambert_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,e1e=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
	vViewPosition = - mvPosition.xyz;
}`,t1e=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	vec3 viewDir = normalize( vViewPosition );
	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
	vec3 y = cross( viewDir, x );
	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
	#ifdef USE_MATCAP
		vec4 matcapColor = texture2D( matcap, uv );
	#else
		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
	#endif
	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,n1e=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	vViewPosition = - mvPosition.xyz;
#endif
}`,i1e=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
	varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
	#ifdef OPAQUE
		gl_FragColor.a = 1.0;
	#endif
}`,r1e=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,a1e=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_phong_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,s1e=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
#ifdef USE_TRANSMISSION
	vWorldPosition = worldPosition.xyz;
#endif
}`,o1e=`#define STANDARD
#ifdef PHYSICAL
	#define IOR
	#define USE_SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
	uniform float ior;
#endif
#ifdef USE_SPECULAR
	uniform float specularIntensity;
	uniform vec3 specularColor;
	#ifdef USE_SPECULAR_COLORMAP
		uniform sampler2D specularColorMap;
	#endif
	#ifdef USE_SPECULAR_INTENSITYMAP
		uniform sampler2D specularIntensityMap;
	#endif
#endif
#ifdef USE_CLEARCOAT
	uniform float clearcoat;
	uniform float clearcoatRoughness;
#endif
#ifdef USE_DISPERSION
	uniform float dispersion;
#endif
#ifdef USE_IRIDESCENCE
	uniform float iridescence;
	uniform float iridescenceIOR;
	uniform float iridescenceThicknessMinimum;
	uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
	uniform vec3 sheenColor;
	uniform float sheenRoughness;
	#ifdef USE_SHEEN_COLORMAP
		uniform sampler2D sheenColorMap;
	#endif
	#ifdef USE_SHEEN_ROUGHNESSMAP
		uniform sampler2D sheenRoughnessMap;
	#endif
#endif
#ifdef USE_ANISOTROPY
	uniform vec2 anisotropyVector;
	#ifdef USE_ANISOTROPYMAP
		uniform sampler2D anisotropyMap;
	#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <roughnessmap_fragment>
	#include <metalnessmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <clearcoat_normal_fragment_begin>
	#include <clearcoat_normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_physical_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
	#include <transmission_fragment>
	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
	#ifdef USE_SHEEN
		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
	#endif
	#ifdef USE_CLEARCOAT
		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
	#endif
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,l1e=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,c1e=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_toon_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,u1e=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
#ifdef USE_POINTS_UV
	varying vec2 vUv;
	uniform mat3 uvTransform;
#endif
void main() {
	#ifdef USE_POINTS_UV
		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	#endif
	#include <color_vertex>
	#include <morphinstance_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	gl_PointSize = size;
	#ifdef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
	#endif
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <fog_vertex>
}`,f1e=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_particle_fragment>
	#include <color_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,h1e=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <batching_vertex>
	#include <beginnormal_vertex>
	#include <morphinstance_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,d1e=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
	#include <logdepthbuf_fragment>
	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,p1e=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	vec4 mvPosition = modelViewMatrix[ 3 ];
	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
	#ifndef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) scale *= - mvPosition.z;
	#endif
	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
	vec2 rotatedPosition;
	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
	mvPosition.xy += rotatedPosition;
	gl_Position = projectionMatrix * mvPosition;
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,m1e=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <alphahash_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <opaque_fragment>
	#include <tonemapping_fragment>
	#include <colorspace_fragment>
	#include <fog_fragment>
}`,ln={alphahash_fragment:Uve,alphahash_pars_fragment:Fve,alphamap_fragment:Bve,alphamap_pars_fragment:zve,alphatest_fragment:jve,alphatest_pars_fragment:Hve,aomap_fragment:Vve,aomap_pars_fragment:Gve,batching_pars_vertex:Wve,batching_vertex:qve,begin_vertex:Xve,beginnormal_vertex:Kve,bsdfs:Yve,iridescence_fragment:Jve,bumpmap_pars_fragment:$ve,clipping_planes_fragment:Zve,clipping_planes_pars_fragment:Qve,clipping_planes_pars_vertex:eye,clipping_planes_vertex:tye,color_fragment:nye,color_pars_fragment:iye,color_pars_vertex:rye,color_vertex:aye,common:sye,cube_uv_reflection_fragment:oye,defaultnormal_vertex:lye,displacementmap_pars_vertex:cye,displacementmap_vertex:uye,emissivemap_fragment:fye,emissivemap_pars_fragment:hye,colorspace_fragment:dye,colorspace_pars_fragment:pye,envmap_fragment:mye,envmap_common_pars_fragment:gye,envmap_pars_fragment:bye,envmap_pars_vertex:vye,envmap_physical_pars_fragment:Rye,envmap_vertex:yye,fog_vertex:xye,fog_pars_vertex:_ye,fog_fragment:Sye,fog_pars_fragment:wye,gradientmap_pars_fragment:Eye,lightmap_pars_fragment:Mye,lights_lambert_fragment:Tye,lights_lambert_pars_fragment:Aye,lights_pars_begin:Cye,lights_toon_fragment:kye,lights_toon_pars_fragment:Dye,lights_phong_fragment:Oye,lights_phong_pars_fragment:Iye,lights_physical_fragment:Nye,lights_physical_pars_fragment:Lye,lights_fragment_begin:Pye,lights_fragment_maps:Uye,lights_fragment_end:Fye,logdepthbuf_fragment:Bye,logdepthbuf_pars_fragment:zye,logdepthbuf_pars_vertex:jye,logdepthbuf_vertex:Hye,map_fragment:Vye,map_pars_fragment:Gye,map_particle_fragment:Wye,map_particle_pars_fragment:qye,metalnessmap_fragment:Xye,metalnessmap_pars_fragment:Kye,morphinstance_vertex:Yye,morphcolor_vertex:Jye,morphnormal_vertex:$ye,morphtarget_pars_vertex:Zye,morphtarget_vertex:Qye,normal_fragment_begin:exe,normal_fragment_maps:txe,normal_pars_fragment:nxe,normal_pars_vertex:ixe,normal_vertex:rxe,normalmap_pars_fragment:axe,clearcoat_normal_fragment_begin:sxe,clearcoat_normal_fragment_maps:oxe,clearcoat_pars_fragment:lxe,iridescence_pars_fragment:cxe,opaque_fragment:uxe,packing:fxe,premultiplied_alpha_fragment:hxe,project_vertex:dxe,dithering_fragment:pxe,dithering_pars_fragment:mxe,roughnessmap_fragment:gxe,roughnessmap_pars_fragment:bxe,shadowmap_pars_fragment:vxe,shadowmap_pars_vertex:yxe,shadowmap_vertex:xxe,shadowmask_pars_fragment:_xe,skinbase_vertex:Sxe,skinning_pars_vertex:wxe,skinning_vertex:Exe,skinnormal_vertex:Mxe,specularmap_fragment:Txe,specularmap_pars_fragment:Axe,tonemapping_fragment:Cxe,tonemapping_pars_fragment:Rxe,transmission_fragment:kxe,transmission_pars_fragment:Dxe,uv_pars_fragment:Oxe,uv_pars_vertex:Ixe,uv_vertex:Nxe,worldpos_vertex:Lxe,background_vert:Pxe,background_frag:Uxe,backgroundCube_vert:Fxe,backgroundCube_frag:Bxe,cube_vert:zxe,cube_frag:jxe,depth_vert:Hxe,depth_frag:Vxe,distanceRGBA_vert:Gxe,distanceRGBA_frag:Wxe,equirect_vert:qxe,equirect_frag:Xxe,linedashed_vert:Kxe,linedashed_frag:Yxe,meshbasic_vert:Jxe,meshbasic_frag:$xe,meshlambert_vert:Zxe,meshlambert_frag:Qxe,meshmatcap_vert:e1e,meshmatcap_frag:t1e,meshnormal_vert:n1e,meshnormal_frag:i1e,meshphong_vert:r1e,meshphong_frag:a1e,meshphysical_vert:s1e,meshphysical_frag:o1e,meshtoon_vert:l1e,meshtoon_frag:c1e,points_vert:u1e,points_frag:f1e,shadow_vert:h1e,shadow_frag:d1e,sprite_vert:p1e,sprite_frag:m1e},en={common:{diffuse:{value:new Ut(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Kn},alphaMap:{value:null},alphaMapTransform:{value:new Kn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Kn}},envmap:{envMap:{value:null},envMapRotation:{value:new Kn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Kn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Kn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Kn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Kn},normalScale:{value:new wt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Kn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Kn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Kn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Kn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ut(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 Ut(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Kn},alphaTest:{value:0},uvTransform:{value:new Kn}},sprite:{diffuse:{value:new Ut(16777215)},opacity:{value:1},center:{value:new wt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Kn},alphaMap:{value:null},alphaMapTransform:{value:new Kn},alphaTest:{value:0}}},Zc={basic:{uniforms:bo([en.common,en.specularmap,en.envmap,en.aomap,en.lightmap,en.fog]),vertexShader:ln.meshbasic_vert,fragmentShader:ln.meshbasic_frag},lambert:{uniforms:bo([en.common,en.specularmap,en.envmap,en.aomap,en.lightmap,en.emissivemap,en.bumpmap,en.normalmap,en.displacementmap,en.fog,en.lights,{emissive:{value:new Ut(0)}}]),vertexShader:ln.meshlambert_vert,fragmentShader:ln.meshlambert_frag},phong:{uniforms:bo([en.common,en.specularmap,en.envmap,en.aomap,en.lightmap,en.emissivemap,en.bumpmap,en.normalmap,en.displacementmap,en.fog,en.lights,{emissive:{value:new Ut(0)},specular:{value:new Ut(1118481)},shininess:{value:30}}]),vertexShader:ln.meshphong_vert,fragmentShader:ln.meshphong_frag},standard:{uniforms:bo([en.common,en.envmap,en.aomap,en.lightmap,en.emissivemap,en.bumpmap,en.normalmap,en.displacementmap,en.roughnessmap,en.metalnessmap,en.fog,en.lights,{emissive:{value:new Ut(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ln.meshphysical_vert,fragmentShader:ln.meshphysical_frag},toon:{uniforms:bo([en.common,en.aomap,en.lightmap,en.emissivemap,en.bumpmap,en.normalmap,en.displacementmap,en.gradientmap,en.fog,en.lights,{emissive:{value:new Ut(0)}}]),vertexShader:ln.meshtoon_vert,fragmentShader:ln.meshtoon_frag},matcap:{uniforms:bo([en.common,en.bumpmap,en.normalmap,en.displacementmap,en.fog,{matcap:{value:null}}]),vertexShader:ln.meshmatcap_vert,fragmentShader:ln.meshmatcap_frag},points:{uniforms:bo([en.points,en.fog]),vertexShader:ln.points_vert,fragmentShader:ln.points_frag},dashed:{uniforms:bo([en.common,en.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ln.linedashed_vert,fragmentShader:ln.linedashed_frag},depth:{uniforms:bo([en.common,en.displacementmap]),vertexShader:ln.depth_vert,fragmentShader:ln.depth_frag},normal:{uniforms:bo([en.common,en.bumpmap,en.normalmap,en.displacementmap,{opacity:{value:1}}]),vertexShader:ln.meshnormal_vert,fragmentShader:ln.meshnormal_frag},sprite:{uniforms:bo([en.sprite,en.fog]),vertexShader:ln.sprite_vert,fragmentShader:ln.sprite_frag},background:{uniforms:{uvTransform:{value:new Kn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ln.background_vert,fragmentShader:ln.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Kn}},vertexShader:ln.backgroundCube_vert,fragmentShader:ln.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ln.cube_vert,fragmentShader:ln.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ln.equirect_vert,fragmentShader:ln.equirect_frag},distanceRGBA:{uniforms:bo([en.common,en.displacementmap,{referencePosition:{value:new te},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ln.distanceRGBA_vert,fragmentShader:ln.distanceRGBA_frag},shadow:{uniforms:bo([en.lights,en.fog,{color:{value:new Ut(0)},opacity:{value:1}}]),vertexShader:ln.shadow_vert,fragmentShader:ln.shadow_frag}};Zc.physical={uniforms:bo([Zc.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Kn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Kn},clearcoatNormalScale:{value:new wt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Kn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Kn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Kn},sheen:{value:0},sheenColor:{value:new Ut(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Kn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Kn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Kn},transmissionSamplerSize:{value:new wt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Kn},attenuationDistance:{value:0},attenuationColor:{value:new Ut(0)},specularColor:{value:new Ut(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Kn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Kn},anisotropyVector:{value:new wt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Kn}}]),vertexShader:ln.meshphysical_vert,fragmentShader:ln.meshphysical_frag};const Kw={r:0,b:0,g:0},Dp=new mi,g1e=new Ot;function b1e(t,e,n,i,r,a,s){const o=new Ut(0);let l=a===!0?0:1,c,u,f=null,h=0,d=null;function g(_){let w=_.isScene===!0?_.background:null;return w&&w.isTexture&&(w=(_.backgroundBlurriness>0?n:e).get(w)),w}function b(_){let w=!1;const M=g(_);M===null?p(o,l):M&&M.isColor&&(p(M,1),w=!0);const S=t.xr.getEnvironmentBlendMode();S==="additive"?i.buffers.color.setClear(0,0,0,1,s):S==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,s),(t.autoClear||w)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function y(_,w){const M=g(w);M&&(M.isCubeTexture||M.mapping===Fv)?(u===void 0&&(u=new _i(new Xd(1,1,1),new ss({name:"BackgroundCubeMaterial",uniforms:rv(Zc.backgroundCube.uniforms),vertexShader:Zc.backgroundCube.vertexShader,fragmentShader:Zc.backgroundCube.fragmentShader,side:Ra,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(S,A,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Dp.copy(w.backgroundRotation),Dp.x*=-1,Dp.y*=-1,Dp.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Dp.y*=-1,Dp.z*=-1),u.material.uniforms.envMap.value=M,u.material.uniforms.flipEnvMap.value=M.isCubeTexture&&M.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(g1e.makeRotationFromEuler(Dp)),u.material.toneMapped=pi.getTransfer(M.colorSpace)!==fr,(f!==M||h!==M.version||d!==t.toneMapping)&&(u.material.needsUpdate=!0,f=M,h=M.version,d=t.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null)):M&&M.isTexture&&(c===void 0&&(c=new _i(new Ol(2,2),new ss({name:"BackgroundMaterial",uniforms:rv(Zc.background.uniforms),vertexShader:Zc.background.vertexShader,fragmentShader:Zc.background.fragmentShader,side:gu,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=M,c.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,c.material.toneMapped=pi.getTransfer(M.colorSpace)!==fr,M.matrixAutoUpdate===!0&&M.updateMatrix(),c.material.uniforms.uvTransform.value.copy(M.matrix),(f!==M||h!==M.version||d!==t.toneMapping)&&(c.material.needsUpdate=!0,f=M,h=M.version,d=t.toneMapping),c.layers.enableAll(),_.unshift(c,c.geometry,c.material,0,0,null))}function p(_,w){_.getRGB(Kw,HJ(t)),i.buffers.color.setClear(Kw.r,Kw.g,Kw.b,w,s)}function x(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(_,w=1){o.set(_),l=w,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(_){l=_,p(o,l)},render:b,addToRenderList:y,dispose:x}}function v1e(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=h(null);let a=r,s=!1;function o(R,N,U,j,z){let q=!1;const B=f(j,U,N);a!==B&&(a=B,c(a.object)),q=d(R,j,U,z),q&&g(R,j,U,z),z!==null&&e.update(z,t.ELEMENT_ARRAY_BUFFER),(q||s)&&(s=!1,w(R,N,U,j),z!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(z).buffer))}function l(){return t.createVertexArray()}function c(R){return t.bindVertexArray(R)}function u(R){return t.deleteVertexArray(R)}function f(R,N,U){const j=U.wireframe===!0;let z=i[R.id];z===void 0&&(z={},i[R.id]=z);let q=z[N.id];q===void 0&&(q={},z[N.id]=q);let B=q[j];return B===void 0&&(B=h(l()),q[j]=B),B}function h(R){const N=[],U=[],j=[];for(let z=0;z<n;z++)N[z]=0,U[z]=0,j[z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:U,attributeDivisors:j,object:R,attributes:{},index:null}}function d(R,N,U,j){const z=a.attributes,q=N.attributes;let B=0;const G=U.getAttributes();for(const H in G)if(G[H].location>=0){const F=z[H];let Y=q[H];if(Y===void 0&&(H==="instanceMatrix"&&R.instanceMatrix&&(Y=R.instanceMatrix),H==="instanceColor"&&R.instanceColor&&(Y=R.instanceColor)),F===void 0||F.attribute!==Y||Y&&F.data!==Y.data)return!0;B++}return a.attributesNum!==B||a.index!==j}function g(R,N,U,j){const z={},q=N.attributes;let B=0;const G=U.getAttributes();for(const H in G)if(G[H].location>=0){let F=q[H];F===void 0&&(H==="instanceMatrix"&&R.instanceMatrix&&(F=R.instanceMatrix),H==="instanceColor"&&R.instanceColor&&(F=R.instanceColor));const Y={};Y.attribute=F,F&&F.data&&(Y.data=F.data),z[H]=Y,B++}a.attributes=z,a.attributesNum=B,a.index=j}function b(){const R=a.newAttributes;for(let N=0,U=R.length;N<U;N++)R[N]=0}function y(R){p(R,0)}function p(R,N){const U=a.newAttributes,j=a.enabledAttributes,z=a.attributeDivisors;U[R]=1,j[R]===0&&(t.enableVertexAttribArray(R),j[R]=1),z[R]!==N&&(t.vertexAttribDivisor(R,N),z[R]=N)}function x(){const R=a.newAttributes,N=a.enabledAttributes;for(let U=0,j=N.length;U<j;U++)N[U]!==R[U]&&(t.disableVertexAttribArray(U),N[U]=0)}function _(R,N,U,j,z,q,B){B===!0?t.vertexAttribIPointer(R,N,U,z,q):t.vertexAttribPointer(R,N,U,j,z,q)}function w(R,N,U,j){b();const z=j.attributes,q=U.getAttributes(),B=N.defaultAttributeValues;for(const G in q){const H=q[G];if(H.location>=0){let W=z[G];if(W===void 0&&(G==="instanceMatrix"&&R.instanceMatrix&&(W=R.instanceMatrix),G==="instanceColor"&&R.instanceColor&&(W=R.instanceColor)),W!==void 0){const F=W.normalized,Y=W.itemSize,Z=e.get(W);if(Z===void 0)continue;const V=Z.buffer,de=Z.type,se=Z.bytesPerElement,oe=de===t.INT||de===t.UNSIGNED_INT||W.gpuType===Bv;if(W.isInterleavedBufferAttribute){const ue=W.data,_e=ue.stride,ke=W.offset;if(ue.isInstancedInterleavedBuffer){for(let Ne=0;Ne<H.locationSize;Ne++)p(H.location+Ne,ue.meshPerAttribute);R.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let Ne=0;Ne<H.locationSize;Ne++)y(H.location+Ne);t.bindBuffer(t.ARRAY_BUFFER,V);for(let Ne=0;Ne<H.locationSize;Ne++)_(H.location+Ne,Y/H.locationSize,de,F,_e*se,(ke+Y/H.locationSize*Ne)*se,oe)}else{if(W.isInstancedBufferAttribute){for(let ue=0;ue<H.locationSize;ue++)p(H.location+ue,W.meshPerAttribute);R.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=W.meshPerAttribute*W.count)}else for(let ue=0;ue<H.locationSize;ue++)y(H.location+ue);t.bindBuffer(t.ARRAY_BUFFER,V);for(let ue=0;ue<H.locationSize;ue++)_(H.location+ue,Y/H.locationSize,de,F,Y*se,Y/H.locationSize*ue*se,oe)}}else if(B!==void 0){const F=B[G];if(F!==void 0)switch(F.length){case 2:t.vertexAttrib2fv(H.location,F);break;case 3:t.vertexAttrib3fv(H.location,F);break;case 4:t.vertexAttrib4fv(H.location,F);break;default:t.vertexAttrib1fv(H.location,F)}}}}x()}function M(){C();for(const R in i){const N=i[R];for(const U in N){const j=N[U];for(const z in j)u(j[z].object),delete j[z];delete N[U]}delete i[R]}}function S(R){if(i[R.id]===void 0)return;const N=i[R.id];for(const U in N){const j=N[U];for(const z in j)u(j[z].object),delete j[z];delete N[U]}delete i[R.id]}function A(R){for(const N in i){const U=i[N];if(U[R.id]===void 0)continue;const j=U[R.id];for(const z in j)u(j[z].object),delete j[z];delete U[R.id]}}function C(){D(),s=!0,a!==r&&(a=r,c(a.object))}function D(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:o,reset:C,resetDefaultState:D,dispose:M,releaseStatesOfGeometry:S,releaseStatesOfProgram:A,initAttributes:b,enableAttribute:y,disableUnusedAttributes:x}}function y1e(t,e,n){let i;function r(c){i=c}function a(c,u){t.drawArrays(i,c,u),n.update(u,i,1)}function s(c,u,f){f!==0&&(t.drawArraysInstanced(i,c,u,f),n.update(u,i,f))}function o(c,u,f){if(f===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,c,0,u,0,f);let d=0;for(let g=0;g<f;g++)d+=u[g];n.update(d,i,1)}function l(c,u,f,h){if(f===0)return;const d=e.get("WEBGL_multi_draw");if(d===null)for(let g=0;g<c.length;g++)s(c[g],u[g],h[g]);else{d.multiDrawArraysInstancedWEBGL(i,c,0,u,0,h,0,f);let g=0;for(let b=0;b<f;b++)g+=u[b]*h[b];n.update(g,i,1)}}this.setMode=r,this.render=a,this.renderInstances=s,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function x1e(t,e,n,i){let r;function a(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const A=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function s(A){return!(A!==$r&&i.convert(A)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(A){const C=A===ts&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==To&&i.convert(A)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==yr&&!C)}function l(A){if(A==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=n.logarithmicDepthBuffer===!0,h=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),d=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),b=t.getParameter(t.MAX_TEXTURE_SIZE),y=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),p=t.getParameter(t.MAX_VERTEX_ATTRIBS),x=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),_=t.getParameter(t.MAX_VARYING_VECTORS),w=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),M=g>0,S=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:l,textureFormatReadable:s,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:f,reversedDepthBuffer:h,maxTextures:d,maxVertexTextures:g,maxTextureSize:b,maxCubemapSize:y,maxAttributes:p,maxVertexUniforms:x,maxVaryings:_,maxFragmentUniforms:w,vertexTextures:M,maxSamples:S}}function _1e(t){const e=this;let n=null,i=0,r=!1,a=!1;const s=new $c,o=new Kn,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,h){const d=f.length!==0||h||i!==0||r;return r=h,i=f.length,d},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(f,h){n=u(f,h,0)},this.setState=function(f,h,d){const g=f.clippingPlanes,b=f.clipIntersection,y=f.clipShadows,p=t.get(f);if(!r||g===null||g.length===0||a&&!y)a?u(null):c();else{const x=a?0:i,_=x*4;let w=p.clippingState||null;l.value=w,w=u(g,h,_,d);for(let M=0;M!==_;++M)w[M]=n[M];p.clippingState=w,this.numIntersection=b?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,h,d,g){const b=f!==null?f.length:0;let y=null;if(b!==0){if(y=l.value,g!==!0||y===null){const p=d+b*4,x=h.matrixWorldInverse;o.getNormalMatrix(x),(y===null||y.length<p)&&(y=new Float32Array(p));for(let _=0,w=d;_!==b;++_,w+=4)s.copy(f[_]).applyMatrix4(x,o),s.normal.toArray(y,w),y[w+3]=s.constant}l.value=y,l.needsUpdate=!0}return e.numPlanes=b,e.numIntersection=0,y}}function S1e(t){let e=new WeakMap;function n(s,o){return o===X0?s.mapping=sf:o===B1&&(s.mapping=Bd),s}function i(s){if(s&&s.isTexture){const o=s.mapping;if(o===X0||o===B1)if(e.has(s)){const l=e.get(s).texture;return n(l,s.mapping)}else{const l=s.image;if(l&&l.height>0){const c=new VP(l.height);return c.fromEquirectangularTexture(t,s),e.set(s,c),s.addEventListener("dispose",r),n(c.texture,s.mapping)}else return null}}return s}function r(s){const o=s.target;o.removeEventListener("dispose",r);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function a(){e=new WeakMap}return{get:i,dispose:a}}const t0=4,Uj=[.125,.215,.35,.446,.526,.582],Zp=20,Fk=new Eh,Fj=new Ut;let Bk=null,zk=0,jk=0,Hk=!1;const Xp=(1+Math.sqrt(5))/2,db=1/Xp,Bj=[new te(-Xp,db,0),new te(Xp,db,0),new te(-db,0,Xp),new te(db,0,Xp),new te(0,Xp,-db),new te(0,Xp,db),new te(-1,1,-1),new te(1,1,-1),new te(-1,1,1),new te(1,1,1)],w1e=new te;class iI{constructor(e){this._renderer=e,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(e,n=0,i=.1,r=100,a={}){const{size:s=256,position:o=w1e}=a;Bk=this._renderer.getRenderTarget(),zk=this._renderer.getActiveCubeFace(),jk=this._renderer.getActiveMipmapLevel(),Hk=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(s);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,o),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Hj(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=jj(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Bk,zk,jk),this._renderer.xr.enabled=Hk,e.scissorTest=!1,Yw(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===sf||e.mapping===Bd?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Bk=this._renderer.getRenderTarget(),zk=this._renderer.getActiveCubeFace(),jk=this._renderer.getActiveMipmapLevel(),Hk=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=n||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,i={magFilter:Hi,minFilter:Hi,generateMipmaps:!1,type:ts,format:$r,colorSpace:bu,depthBuffer:!1},r=zj(e,n,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=zj(e,n,i);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=E1e(a)),this._blurMaterial=M1e(a,e,n)}return r}_compileMaterial(e){const n=new _i(this._lodPlanes[0],e);this._renderer.compile(n,Fk)}_sceneToCubeUV(e,n,i,r,a){const l=new ta(90,1,n,i),c=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],f=this._renderer,h=f.autoClear,d=f.toneMapping;f.getClearColor(Fj),f.toneMapping=Qu,f.autoClear=!1,f.state.buffers.depth.getReversed()&&(f.setRenderTarget(r),f.clearDepth(),f.setRenderTarget(null));const b=new Cs({name:"PMREM.Background",side:Ra,depthWrite:!1,depthTest:!1}),y=new _i(new Xd,b);let p=!1;const x=e.background;x?x.isColor&&(b.color.copy(x),e.background=null,p=!0):(b.color.copy(Fj),p=!0);for(let _=0;_<6;_++){const w=_%3;w===0?(l.up.set(0,c[_],0),l.position.set(a.x,a.y,a.z),l.lookAt(a.x+u[_],a.y,a.z)):w===1?(l.up.set(0,0,c[_]),l.position.set(a.x,a.y,a.z),l.lookAt(a.x,a.y+u[_],a.z)):(l.up.set(0,c[_],0),l.position.set(a.x,a.y,a.z),l.lookAt(a.x,a.y,a.z+u[_]));const M=this._cubeSize;Yw(r,w*M,_>2?M:0,M,M),f.setRenderTarget(r),p&&f.render(y,l),f.render(e,l)}y.geometry.dispose(),y.material.dispose(),f.toneMapping=d,f.autoClear=h,e.background=x}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===sf||e.mapping===Bd;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Hj()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=jj());const a=r?this._cubemapMaterial:this._equirectMaterial,s=new _i(this._lodPlanes[0],a),o=a.uniforms;o.envMap.value=e;const l=this._cubeSize;Yw(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(s,Fk)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodPlanes.length;for(let a=1;a<r;a++){const s=Math.sqrt(this._sigmas[a]*this._sigmas[a]-this._sigmas[a-1]*this._sigmas[a-1]),o=Bj[(r-a-1)%Bj.length];this._blur(e,a-1,a,s,o)}n.autoClear=i}_blur(e,n,i,r,a){const s=this._pingPongRenderTarget;this._halfBlur(e,s,n,i,r,"latitudinal",a),this._halfBlur(s,e,i,i,r,"longitudinal",a)}_halfBlur(e,n,i,r,a,s,o){const l=this._renderer,c=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,f=new _i(this._lodPlanes[r],c),h=c.uniforms,d=this._sizeLods[i]-1,g=isFinite(a)?Math.PI/(2*d):2*Math.PI/(2*Zp-1),b=a/g,y=isFinite(a)?1+Math.floor(u*b):Zp;y>Zp&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${Zp}`);const p=[];let x=0;for(let A=0;A<Zp;++A){const C=A/b,D=Math.exp(-C*C/2);p.push(D),A===0?x+=D:A<y&&(x+=2*D)}for(let A=0;A<p.length;A++)p[A]=p[A]/x;h.envMap.value=e.texture,h.samples.value=y,h.weights.value=p,h.latitudinal.value=s==="latitudinal",o&&(h.poleAxis.value=o);const{_lodMax:_}=this;h.dTheta.value=g,h.mipInt.value=_-i;const w=this._sizeLods[r],M=3*w*(r>_-t0?r-_+t0:0),S=4*(this._cubeSize-w);Yw(n,M,S,3*w,2*w),l.setRenderTarget(n),l.render(f,Fk)}}function E1e(t){const e=[],n=[],i=[];let r=t;const a=t-t0+1+Uj.length;for(let s=0;s<a;s++){const o=Math.pow(2,r);n.push(o);let l=1/o;s>t-t0?l=Uj[s-t+t0-1]:s===0&&(l=0),i.push(l);const c=1/(o-2),u=-c,f=1+c,h=[u,u,f,u,f,f,u,u,f,f,u,f],d=6,g=6,b=3,y=2,p=1,x=new Float32Array(b*g*d),_=new Float32Array(y*g*d),w=new Float32Array(p*g*d);for(let S=0;S<d;S++){const A=S%3*2/3-1,C=S>2?0:-1,D=[A,C,0,A+2/3,C,0,A+2/3,C+1,0,A,C,0,A+2/3,C+1,0,A,C+1,0];x.set(D,b*g*S),_.set(h,y*g*S);const R=[S,S,S,S,S,S];w.set(R,p*g*S)}const M=new Dn;M.setAttribute("position",new Nn(x,b)),M.setAttribute("uv",new Nn(_,y)),M.setAttribute("faceIndex",new Nn(w,p)),e.push(M),r>t0&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function zj(t,e,n){const i=new Ec(t,e,n);return i.texture.mapping=Fv,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Yw(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function M1e(t,e,n){const i=new Float32Array(Zp),r=new te(0,1,0);return new ss({name:"SphericalGaussianBlur",defines:{n:Zp,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:mU(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform int samples;
			uniform float weights[ n ];
			uniform bool latitudinal;
			uniform float dTheta;
			uniform float mipInt;
			uniform vec3 poleAxis;

			#define ENVMAP_TYPE_CUBE_UV
			#include <cube_uv_reflection_fragment>

			vec3 getSample( float theta, vec3 axis ) {

				float cosTheta = cos( theta );
				// Rodrigues' axis-angle rotation
				vec3 sampleDirection = vOutputDirection * cosTheta
					+ cross( axis, vOutputDirection ) * sin( theta )
					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );

				return bilinearCubeUV( envMap, sampleDirection, mipInt );

			}

			void main() {

				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );

				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {

					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );

				}

				axis = normalize( axis );

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );

				for ( int i = 1; i < n; i++ ) {

					if ( i >= samples ) {

						break;

					}

					float theta = dTheta * float( i );
					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );

				}

			}
		`,blending:Zu,depthTest:!1,depthWrite:!1})}function jj(){return new ss({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:mU(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;

			#include <common>

			void main() {

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );

			}
		`,blending:Zu,depthTest:!1,depthWrite:!1})}function Hj(){return new ss({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:mU(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			uniform float flipEnvMap;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			void main() {

				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );

			}
		`,blending:Zu,depthTest:!1,depthWrite:!1})}function mU(){return`

		precision mediump float;
		precision mediump int;

		attribute float faceIndex;

		varying vec3 vOutputDirection;

		// RH coordinate system; PMREM face-indexing convention
		vec3 getDirection( vec2 uv, float face ) {

			uv = 2.0 * uv - 1.0;

			vec3 direction = vec3( uv, 1.0 );

			if ( face == 0.0 ) {

				direction = direction.zyx; // ( 1, v, u ) pos x

			} else if ( face == 1.0 ) {

				direction = direction.xzy;
				direction.xz *= -1.0; // ( -u, 1, -v ) pos y

			} else if ( face == 2.0 ) {

				direction.x *= -1.0; // ( -u, v, 1 ) pos z

			} else if ( face == 3.0 ) {

				direction = direction.zyx;
				direction.xz *= -1.0; // ( -1, v, -u ) neg x

			} else if ( face == 4.0 ) {

				direction = direction.xzy;
				direction.xy *= -1.0; // ( -u, -1, v ) neg y

			} else if ( face == 5.0 ) {

				direction.z *= -1.0; // ( u, v, -1 ) neg z

			}

			return direction;

		}

		void main() {

			vOutputDirection = getDirection( uv, faceIndex );
			gl_Position = vec4( position, 1.0 );

		}
	`}function T1e(t){let e=new WeakMap,n=null;function i(o){if(o&&o.isTexture){const l=o.mapping,c=l===X0||l===B1,u=l===sf||l===Bd;if(c||u){let f=e.get(o);const h=f!==void 0?f.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==h)return n===null&&(n=new iI(t)),f=c?n.fromEquirectangular(o,f):n.fromCubemap(o,f),f.texture.pmremVersion=o.pmremVersion,e.set(o,f),f.texture;if(f!==void 0)return f.texture;{const d=o.image;return c&&d&&d.height>0||u&&d&&r(d)?(n===null&&(n=new iI(t)),f=c?n.fromEquirectangular(o):n.fromCubemap(o),f.texture.pmremVersion=o.pmremVersion,e.set(o,f),o.addEventListener("dispose",a),f.texture):null}}}return o}function r(o){let l=0;const c=6;for(let u=0;u<c;u++)o[u]!==void 0&&l++;return l===c}function a(o){const l=o.target;l.removeEventListener("dispose",a);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function s(){e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:i,dispose:s}}function A1e(t){const e={};function n(i){if(e[i]!==void 0)return e[i];let r;switch(i){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(i)}return e[i]=r,r}return{has:function(i){return n(i)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(i){const r=n(i);return r===null&&v0("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function C1e(t,e,n,i){const r={},a=new WeakMap;function s(f){const h=f.target;h.index!==null&&e.remove(h.index);for(const g in h.attributes)e.remove(h.attributes[g]);h.removeEventListener("dispose",s),delete r[h.id];const d=a.get(h);d&&(e.remove(d),a.delete(h)),i.releaseStatesOfGeometry(h),h.isInstancedBufferGeometry===!0&&delete h._maxInstanceCount,n.memory.geometries--}function o(f,h){return r[h.id]===!0||(h.addEventListener("dispose",s),r[h.id]=!0,n.memory.geometries++),h}function l(f){const h=f.attributes;for(const d in h)e.update(h[d],t.ARRAY_BUFFER)}function c(f){const h=[],d=f.index,g=f.attributes.position;let b=0;if(d!==null){const x=d.array;b=d.version;for(let _=0,w=x.length;_<w;_+=3){const M=x[_+0],S=x[_+1],A=x[_+2];h.push(M,S,S,A,A,M)}}else if(g!==void 0){const x=g.array;b=g.version;for(let _=0,w=x.length/3-1;_<w;_+=3){const M=_+0,S=_+1,A=_+2;h.push(M,S,S,A,A,M)}}else return;const y=new(UJ(h)?HP:jP)(h,1);y.version=b;const p=a.get(f);p&&e.remove(p),a.set(f,y)}function u(f){const h=a.get(f);if(h){const d=f.index;d!==null&&h.version<d.version&&c(f)}else c(f);return a.get(f)}return{get:o,update:l,getWireframeAttribute:u}}function R1e(t,e,n){let i;function r(h){i=h}let a,s;function o(h){a=h.type,s=h.bytesPerElement}function l(h,d){t.drawElements(i,d,a,h*s),n.update(d,i,1)}function c(h,d,g){g!==0&&(t.drawElementsInstanced(i,d,a,h*s,g),n.update(d,i,g))}function u(h,d,g){if(g===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,d,0,a,h,0,g);let y=0;for(let p=0;p<g;p++)y+=d[p];n.update(y,i,1)}function f(h,d,g,b){if(g===0)return;const y=e.get("WEBGL_multi_draw");if(y===null)for(let p=0;p<h.length;p++)c(h[p]/s,d[p],b[p]);else{y.multiDrawElementsInstancedWEBGL(i,d,0,a,h,0,b,0,g);let p=0;for(let x=0;x<g;x++)p+=d[x]*b[x];n.update(p,i,1)}}this.setMode=r,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=f}function k1e(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(a,s,o){switch(n.calls++,s){case t.TRIANGLES:n.triangles+=o*(a/3);break;case t.LINES:n.lines+=o*(a/2);break;case t.LINE_STRIP:n.lines+=o*(a-1);break;case t.LINE_LOOP:n.lines+=o*a;break;case t.POINTS:n.points+=o*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",s);break}}function r(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:r,update:i}}function D1e(t,e,n){const i=new WeakMap,r=new ei;function a(s,o,l){const c=s.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,f=u!==void 0?u.length:0;let h=i.get(o);if(h===void 0||h.count!==f){let D=function(){A.dispose(),i.delete(o),o.removeEventListener("dispose",D)};h!==void 0&&h.texture.dispose();const d=o.morphAttributes.position!==void 0,g=o.morphAttributes.normal!==void 0,b=o.morphAttributes.color!==void 0,y=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],x=o.morphAttributes.color||[];let _=0;d===!0&&(_=1),g===!0&&(_=2),b===!0&&(_=3);let w=o.attributes.position.count*_,M=1;w>e.maxTextureSize&&(M=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const S=new Float32Array(w*M*4*f),A=new HA(S,w,M,f);A.type=yr,A.needsUpdate=!0;const C=_*4;for(let R=0;R<f;R++){const N=y[R],U=p[R],j=x[R],z=w*M*4*R;for(let q=0;q<N.count;q++){const B=q*C;d===!0&&(r.fromBufferAttribute(N,q),S[z+B+0]=r.x,S[z+B+1]=r.y,S[z+B+2]=r.z,S[z+B+3]=0),g===!0&&(r.fromBufferAttribute(U,q),S[z+B+4]=r.x,S[z+B+5]=r.y,S[z+B+6]=r.z,S[z+B+7]=0),b===!0&&(r.fromBufferAttribute(j,q),S[z+B+8]=r.x,S[z+B+9]=r.y,S[z+B+10]=r.z,S[z+B+11]=j.itemSize===4?r.w:1)}}h={count:f,texture:A,size:new wt(w,M)},i.set(o,h),o.addEventListener("dispose",D)}if(s.isInstancedMesh===!0&&s.morphTexture!==null)l.getUniforms().setValue(t,"morphTexture",s.morphTexture,n);else{let d=0;for(let b=0;b<c.length;b++)d+=c[b];const g=o.morphTargetsRelative?1:1-d;l.getUniforms().setValue(t,"morphTargetBaseInfluence",g),l.getUniforms().setValue(t,"morphTargetInfluences",c)}l.getUniforms().setValue(t,"morphTargetsTexture",h.texture,n),l.getUniforms().setValue(t,"morphTargetsTextureSize",h.size)}return{update:a}}function O1e(t,e,n,i){let r=new WeakMap;function a(l){const c=i.render.frame,u=l.geometry,f=e.get(l,u);if(r.get(f)!==c&&(e.update(f),r.set(f,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),r.get(l)!==c&&(n.update(l.instanceMatrix,t.ARRAY_BUFFER),l.instanceColor!==null&&n.update(l.instanceColor,t.ARRAY_BUFFER),r.set(l,c))),l.isSkinnedMesh){const h=l.skeleton;r.get(h)!==c&&(h.update(),r.set(h,c))}return f}function s(){r=new WeakMap}function o(l){const c=l.target;c.removeEventListener("dispose",o),n.remove(c.instanceMatrix),c.instanceColor!==null&&n.remove(c.instanceColor)}return{update:a,dispose:s}}const I$=new nr,Vj=new XP(1,1),N$=new HA,L$=new VA,P$=new U_,Gj=[],Wj=[],qj=new Float32Array(16),Xj=new Float32Array(9),Kj=new Float32Array(4);function Kv(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let a=Gj[r];if(a===void 0&&(a=new Float32Array(r),Gj[r]=a),e!==0){i.toArray(a,0);for(let s=1,o=0;s!==e;++s)o+=n,t[s].toArray(a,o)}return a}function Ba(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function za(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function gC(t,e){let n=Wj[e];n===void 0&&(n=new Int32Array(e),Wj[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function I1e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function N1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ba(n,e))return;t.uniform2fv(this.addr,e),za(n,e)}}function L1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(e.r!==void 0)(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Ba(n,e))return;t.uniform3fv(this.addr,e),za(n,e)}}function P1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ba(n,e))return;t.uniform4fv(this.addr,e),za(n,e)}}function U1e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(Ba(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),za(n,e)}else{if(Ba(n,i))return;Kj.set(i),t.uniformMatrix2fv(this.addr,!1,Kj),za(n,i)}}function F1e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(Ba(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),za(n,e)}else{if(Ba(n,i))return;Xj.set(i),t.uniformMatrix3fv(this.addr,!1,Xj),za(n,i)}}function B1e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(Ba(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),za(n,e)}else{if(Ba(n,i))return;qj.set(i),t.uniformMatrix4fv(this.addr,!1,qj),za(n,i)}}function z1e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function j1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ba(n,e))return;t.uniform2iv(this.addr,e),za(n,e)}}function H1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Ba(n,e))return;t.uniform3iv(this.addr,e),za(n,e)}}function V1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ba(n,e))return;t.uniform4iv(this.addr,e),za(n,e)}}function G1e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function W1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ba(n,e))return;t.uniform2uiv(this.addr,e),za(n,e)}}function q1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Ba(n,e))return;t.uniform3uiv(this.addr,e),za(n,e)}}function X1e(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ba(n,e))return;t.uniform4uiv(this.addr,e),za(n,e)}}function K1e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r);let a;this.type===t.SAMPLER_2D_SHADOW?(Vj.compareFunction=FP,a=Vj):a=I$,n.setTexture2D(e||a,r)}function Y1e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||L$,r)}function J1e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||P$,r)}function $1e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||N$,r)}function Z1e(t){switch(t){case 5126:return I1e;case 35664:return N1e;case 35665:return L1e;case 35666:return P1e;case 35674:return U1e;case 35675:return F1e;case 35676:return B1e;case 5124:case 35670:return z1e;case 35667:case 35671:return j1e;case 35668:case 35672:return H1e;case 35669:case 35673:return V1e;case 5125:return G1e;case 36294:return W1e;case 36295:return q1e;case 36296:return X1e;case 35678:case 36198:case 36298:case 36306:case 35682:return K1e;case 35679:case 36299:case 36307:return Y1e;case 35680:case 36300:case 36308:case 36293:return J1e;case 36289:case 36303:case 36311:case 36292:return $1e}}function Q1e(t,e){t.uniform1fv(this.addr,e)}function e_e(t,e){const n=Kv(e,this.size,2);t.uniform2fv(this.addr,n)}function t_e(t,e){const n=Kv(e,this.size,3);t.uniform3fv(this.addr,n)}function n_e(t,e){const n=Kv(e,this.size,4);t.uniform4fv(this.addr,n)}function i_e(t,e){const n=Kv(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function r_e(t,e){const n=Kv(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function a_e(t,e){const n=Kv(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function s_e(t,e){t.uniform1iv(this.addr,e)}function o_e(t,e){t.uniform2iv(this.addr,e)}function l_e(t,e){t.uniform3iv(this.addr,e)}function c_e(t,e){t.uniform4iv(this.addr,e)}function u_e(t,e){t.uniform1uiv(this.addr,e)}function f_e(t,e){t.uniform2uiv(this.addr,e)}function h_e(t,e){t.uniform3uiv(this.addr,e)}function d_e(t,e){t.uniform4uiv(this.addr,e)}function p_e(t,e,n){const i=this.cache,r=e.length,a=gC(n,r);Ba(i,a)||(t.uniform1iv(this.addr,a),za(i,a));for(let s=0;s!==r;++s)n.setTexture2D(e[s]||I$,a[s])}function m_e(t,e,n){const i=this.cache,r=e.length,a=gC(n,r);Ba(i,a)||(t.uniform1iv(this.addr,a),za(i,a));for(let s=0;s!==r;++s)n.setTexture3D(e[s]||L$,a[s])}function g_e(t,e,n){const i=this.cache,r=e.length,a=gC(n,r);Ba(i,a)||(t.uniform1iv(this.addr,a),za(i,a));for(let s=0;s!==r;++s)n.setTextureCube(e[s]||P$,a[s])}function b_e(t,e,n){const i=this.cache,r=e.length,a=gC(n,r);Ba(i,a)||(t.uniform1iv(this.addr,a),za(i,a));for(let s=0;s!==r;++s)n.setTexture2DArray(e[s]||N$,a[s])}function v_e(t){switch(t){case 5126:return Q1e;case 35664:return e_e;case 35665:return t_e;case 35666:return n_e;case 35674:return i_e;case 35675:return r_e;case 35676:return a_e;case 5124:case 35670:return s_e;case 35667:case 35671:return o_e;case 35668:case 35672:return l_e;case 35669:case 35673:return c_e;case 5125:return u_e;case 36294:return f_e;case 36295:return h_e;case 36296:return d_e;case 35678:case 36198:case 36298:case 36306:case 35682:return p_e;case 35679:case 36299:case 36307:return m_e;case 35680:case 36300:case 36308:case 36293:return g_e;case 36289:case 36303:case 36311:case 36292:return b_e}}class y_e{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.setValue=Z1e(n.type)}}class x_e{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=v_e(n.type)}}class __e{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,i){const r=this.seq;for(let a=0,s=r.length;a!==s;++a){const o=r[a];o.setValue(e,n[o.id],i)}}}const Vk=/(\w+)(\])?(\[|\.)?/g;function Yj(t,e){t.seq.push(e),t.map[e.id]=e}function S_e(t,e,n){const i=t.name,r=i.length;for(Vk.lastIndex=0;;){const a=Vk.exec(i),s=Vk.lastIndex;let o=a[1];const l=a[2]==="]",c=a[3];if(l&&(o=o|0),c===void 0||c==="["&&s+2===r){Yj(n,c===void 0?new y_e(o,t,e):new x_e(o,t,e));break}else{let f=n.map[o];f===void 0&&(f=new __e(o),Yj(n,f)),n=f}}}class dM{constructor(e,n){this.seq=[],this.map={};const i=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){const a=e.getActiveUniform(n,r),s=e.getUniformLocation(n,a.name);S_e(a,s,this)}}setValue(e,n,i,r){const a=this.map[n];a!==void 0&&a.setValue(e,i,r)}setOptional(e,n,i){const r=n[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,n,i,r){for(let a=0,s=n.length;a!==s;++a){const o=n[a],l=i[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,r)}}static seqWithValue(e,n){const i=[];for(let r=0,a=e.length;r!==a;++r){const s=e[r];s.id in n&&i.push(s)}return i}}function Jj(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}const w_e=37297;let E_e=0;function M_e(t,e){const n=t.split(`
`),i=[],r=Math.max(e-6,0),a=Math.min(e+6,n.length);for(let s=r;s<a;s++){const o=s+1;i.push(`${o===e?">":" "} ${o}: ${n[s]}`)}return i.join(`
`)}const $j=new Kn;function T_e(t){pi._getMatrix($j,pi.workingColorSpace,t);const e=`mat3( ${$j.elements.map(n=>n.toFixed(4))} )`;switch(pi.getTransfer(t)){case j1:return[e,"LinearTransferOETF"];case fr:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function Zj(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),a=(t.getShaderInfoLog(e)||"").trim();if(i&&a==="")return"";const s=/ERROR: 0:(\d+)/.exec(a);if(s){const o=parseInt(s[1]);return n.toUpperCase()+`

`+a+`

`+M_e(t.getShaderSource(e),o)}else return a}function A_e(t,e){const n=T_e(e);return[`vec4 ${t}( vec4 value ) {`,`	return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(`
`)}function C_e(t,e){let n;switch(e){case vJ:n="Linear";break;case yJ:n="Reinhard";break;case xJ:n="Cineon";break;case RP:n="ACESFilmic";break;case SJ:n="AgX";break;case wJ:n="Neutral";break;case _J:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const Jw=new te;function R_e(){pi.getLuminanceCoefficients(Jw);const t=Jw.x.toFixed(4),e=Jw.y.toFixed(4),n=Jw.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${t}, ${e}, ${n} );`,"	return dot( weights, rgb );","}"].join(`
`)}function k_e(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Tx).join(`
`)}function D_e(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(`
`)}function O_e(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const a=t.getActiveAttrib(e,r),s=a.name;let o=1;a.type===t.FLOAT_MAT2&&(o=2),a.type===t.FLOAT_MAT3&&(o=3),a.type===t.FLOAT_MAT4&&(o=4),n[s]={type:a.type,location:t.getAttribLocation(e,s),locationSize:o}}return n}function Tx(t){return t!==""}function Qj(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function e5(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const I_e=/^[ \t]*#include +<([\w\d./]+)>/gm;function rI(t){return t.replace(I_e,L_e)}const N_e=new Map;function L_e(t,e){let n=ln[e];if(n===void 0){const i=N_e.get(e);if(i!==void 0)n=ln[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return rI(n)}const P_e=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function t5(t){return t.replace(P_e,U_e)}function U_e(t,e,n,i){let r="";for(let a=parseInt(e);a<parseInt(n);a++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function n5(t){let e=`precision ${t.precision} float;
	precision ${t.precision} int;
	precision ${t.precision} sampler2D;
	precision ${t.precision} samplerCube;
	precision ${t.precision} sampler3D;
	precision ${t.precision} sampler2DArray;
	precision ${t.precision} sampler2DShadow;
	precision ${t.precision} samplerCubeShadow;
	precision ${t.precision} sampler2DArrayShadow;
	precision ${t.precision} isampler2D;
	precision ${t.precision} isampler3D;
	precision ${t.precision} isamplerCube;
	precision ${t.precision} isampler2DArray;
	precision ${t.precision} usampler2D;
	precision ${t.precision} usampler3D;
	precision ${t.precision} usamplerCube;
	precision ${t.precision} usampler2DArray;
	`;return t.precision==="highp"?e+=`
#define HIGH_PRECISION`:t.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function F_e(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===NA?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===Jx?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===Xc&&(e="SHADOWMAP_TYPE_VSM"),e}function B_e(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case sf:case Bd:e="ENVMAP_TYPE_CUBE";break;case Fv:e="ENVMAP_TYPE_CUBE_UV";break}return e}function z_e(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case Bd:e="ENVMAP_MODE_REFRACTION";break}return e}function j_e(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case L_:e="ENVMAP_BLENDING_MULTIPLY";break;case gJ:e="ENVMAP_BLENDING_MIX";break;case bJ:e="ENVMAP_BLENDING_ADD";break}return e}function H_e(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),7*16)),texelHeight:i,maxMip:n}}function V_e(t,e,n,i){const r=t.getContext(),a=n.defines;let s=n.vertexShader,o=n.fragmentShader;const l=F_e(n),c=B_e(n),u=z_e(n),f=j_e(n),h=H_e(n),d=k_e(n),g=D_e(a),b=r.createProgram();let y,p,x=n.glslVersion?"#version "+n.glslVersion+`
`:"";n.isRawShaderMaterial?(y=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(Tx).join(`
`),y.length>0&&(y+=`
`),p=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(Tx).join(`
`),p.length>0&&(p+=`
`)):(y=[n5(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
`].filter(Tx).join(`
`),p=[n5(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Qu?"#define TONE_MAPPING":"",n.toneMapping!==Qu?ln.tonemapping_pars_fragment:"",n.toneMapping!==Qu?C_e("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",ln.colorspace_pars_fragment,A_e("linearToOutputTexel",n.outputColorSpace),R_e(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
`].filter(Tx).join(`
`)),s=rI(s),s=Qj(s,n),s=e5(s,n),o=rI(o),o=Qj(o,n),o=e5(o,n),s=t5(s),o=t5(o),n.isRawShaderMaterial!==!0&&(x=`#version 300 es
`,y=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+y,p=["#define varying in",n.glslVersion===YO?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===YO?"":"#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(`
`)+`
`+p);const _=x+y+s,w=x+p+o,M=Jj(r,r.VERTEX_SHADER,_),S=Jj(r,r.FRAGMENT_SHADER,w);r.attachShader(b,M),r.attachShader(b,S),n.index0AttributeName!==void 0?r.bindAttribLocation(b,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(b,0,"position"),r.linkProgram(b);function A(N){if(t.debug.checkShaderErrors){const U=r.getProgramInfoLog(b)||"",j=r.getShaderInfoLog(M)||"",z=r.getShaderInfoLog(S)||"",q=U.trim(),B=j.trim(),G=z.trim();let H=!0,W=!0;if(r.getProgramParameter(b,r.LINK_STATUS)===!1)if(H=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(r,b,M,S);else{const F=Zj(r,M,"vertex"),Y=Zj(r,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(b,r.VALIDATE_STATUS)+`

Material Name: `+N.name+`
Material Type: `+N.type+`

Program Info Log: `+q+`
`+F+`
`+Y)}else q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",q):(B===""||G==="")&&(W=!1);W&&(N.diagnostics={runnable:H,programLog:q,vertexShader:{log:B,prefix:y},fragmentShader:{log:G,prefix:p}})}r.deleteShader(M),r.deleteShader(S),C=new dM(r,b),D=O_e(r,b)}let C;this.getUniforms=function(){return C===void 0&&A(this),C};let D;this.getAttributes=function(){return D===void 0&&A(this),D};let R=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return R===!1&&(R=r.getProgramParameter(b,w_e)),R},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(b),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=E_e++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=M,this.fragmentShader=S,this}let G_e=0;class W_e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),a=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return s.has(r)===!1&&(s.add(r),r.usedTimes++),s.has(a)===!1&&(s.add(a),a.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new q_e(e),n.set(e,i)),i}}class q_e{constructor(e){this.id=G_e++,this.code=e,this.usedTimes=0}}function X_e(t,e,n,i,r,a,s){const o=new iv,l=new W_e,c=new Set,u=[],f=r.logarithmicDepthBuffer,h=r.vertexTextures;let d=r.precision;const g={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 b(D){return c.add(D),D===0?"uv":`uv${D}`}function y(D,R,N,U,j){const z=U.fog,q=j.geometry,B=D.isMeshStandardMaterial?U.environment:null,G=(D.isMeshStandardMaterial?n:e).get(D.envMap||B),H=G&&G.mapping===Fv?G.image.height:null,W=g[D.type];D.precision!==null&&(d=r.getMaxPrecision(D.precision),d!==D.precision&&console.warn("THREE.WebGLProgram.getParameters:",D.precision,"not supported, using",d,"instead."));const F=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,Y=F!==void 0?F.length:0;let Z=0;q.morphAttributes.position!==void 0&&(Z=1),q.morphAttributes.normal!==void 0&&(Z=2),q.morphAttributes.color!==void 0&&(Z=3);let V,de,se,oe;if(W){const cn=Zc[W];V=cn.vertexShader,de=cn.fragmentShader}else V=D.vertexShader,de=D.fragmentShader,l.update(D),se=l.getVertexShaderID(D),oe=l.getFragmentShaderID(D);const ue=t.getRenderTarget(),_e=t.state.buffers.depth.getReversed(),ke=j.isInstancedMesh===!0,Ne=j.isBatchedMesh===!0,Ue=!!D.map,ze=!!D.matcap,pe=!!G,Fe=!!D.aoMap,Ie=!!D.lightMap,qe=!!D.bumpMap,we=!!D.normalMap,Te=!!D.displacementMap,Ae=!!D.emissiveMap,Pe=!!D.metalnessMap,He=!!D.roughnessMap,$e=D.anisotropy>0,ie=D.clearcoat>0,K=D.dispersion>0,ce=D.iridescence>0,fe=D.sheen>0,me=D.transmission>0,$=$e&&!!D.anisotropyMap,Le=ie&&!!D.clearcoatMap,Xe=ie&&!!D.clearcoatNormalMap,mt=ie&&!!D.clearcoatRoughnessMap,Ge=ce&&!!D.iridescenceMap,Je=ce&&!!D.iridescenceThicknessMap,tt=fe&&!!D.sheenColorMap,xt=fe&&!!D.sheenRoughnessMap,Tt=!!D.specularMap,bt=!!D.specularColorMap,Rt=!!D.specularIntensityMap,Oe=me&&!!D.transmissionMap,Ve=me&&!!D.thicknessMap,ht=!!D.gradientMap,Ft=!!D.alphaMap,st=D.alphaTest>0,it=!!D.alphaHash,vt=!!D.extensions;let Kt=Qu;D.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(Kt=t.toneMapping);const Xt={shaderID:W,shaderType:D.type,shaderName:D.name,vertexShader:V,fragmentShader:de,defines:D.defines,customVertexShaderID:se,customFragmentShaderID:oe,isRawShaderMaterial:D.isRawShaderMaterial===!0,glslVersion:D.glslVersion,precision:d,batching:Ne,batchingColor:Ne&&j._colorsTexture!==null,instancing:ke,instancingColor:ke&&j.instanceColor!==null,instancingMorph:ke&&j.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:ue===null?t.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:bu,alphaToCoverage:!!D.alphaToCoverage,map:Ue,matcap:ze,envMap:pe,envMapMode:pe&&G.mapping,envMapCubeUVHeight:H,aoMap:Fe,lightMap:Ie,bumpMap:qe,normalMap:we,displacementMap:h&&Te,emissiveMap:Ae,normalMapObjectSpace:we&&D.normalMapType===RJ,normalMapTangentSpace:we&&D.normalMapType===qd,metalnessMap:Pe,roughnessMap:He,anisotropy:$e,anisotropyMap:$,clearcoat:ie,clearcoatMap:Le,clearcoatNormalMap:Xe,clearcoatRoughnessMap:mt,dispersion:K,iridescence:ce,iridescenceMap:Ge,iridescenceThicknessMap:Je,sheen:fe,sheenColorMap:tt,sheenRoughnessMap:xt,specularMap:Tt,specularColorMap:bt,specularIntensityMap:Rt,transmission:me,transmissionMap:Oe,thicknessMap:Ve,gradientMap:ht,opaque:D.transparent===!1&&D.blending===Tm&&D.alphaToCoverage===!1,alphaMap:Ft,alphaTest:st,alphaHash:it,combine:D.combine,mapUv:Ue&&b(D.map.channel),aoMapUv:Fe&&b(D.aoMap.channel),lightMapUv:Ie&&b(D.lightMap.channel),bumpMapUv:qe&&b(D.bumpMap.channel),normalMapUv:we&&b(D.normalMap.channel),displacementMapUv:Te&&b(D.displacementMap.channel),emissiveMapUv:Ae&&b(D.emissiveMap.channel),metalnessMapUv:Pe&&b(D.metalnessMap.channel),roughnessMapUv:He&&b(D.roughnessMap.channel),anisotropyMapUv:$&&b(D.anisotropyMap.channel),clearcoatMapUv:Le&&b(D.clearcoatMap.channel),clearcoatNormalMapUv:Xe&&b(D.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:mt&&b(D.clearcoatRoughnessMap.channel),iridescenceMapUv:Ge&&b(D.iridescenceMap.channel),iridescenceThicknessMapUv:Je&&b(D.iridescenceThicknessMap.channel),sheenColorMapUv:tt&&b(D.sheenColorMap.channel),sheenRoughnessMapUv:xt&&b(D.sheenRoughnessMap.channel),specularMapUv:Tt&&b(D.specularMap.channel),specularColorMapUv:bt&&b(D.specularColorMap.channel),specularIntensityMapUv:Rt&&b(D.specularIntensityMap.channel),transmissionMapUv:Oe&&b(D.transmissionMap.channel),thicknessMapUv:Ve&&b(D.thicknessMap.channel),alphaMapUv:Ft&&b(D.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(we||$e),vertexColors:D.vertexColors,vertexAlphas:D.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:j.isPoints===!0&&!!q.attributes.uv&&(Ue||Ft),fog:!!z,useFog:D.fog===!0,fogExp2:!!z&&z.isFogExp2,flatShading:D.flatShading===!0&&D.wireframe===!1,sizeAttenuation:D.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:_e,skinning:j.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:Z,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:D.dithering,shadowMapEnabled:t.shadowMap.enabled&&N.length>0,shadowMapType:t.shadowMap.type,toneMapping:Kt,decodeVideoTexture:Ue&&D.map.isVideoTexture===!0&&pi.getTransfer(D.map.colorSpace)===fr,decodeVideoTextureEmissive:Ae&&D.emissiveMap.isVideoTexture===!0&&pi.getTransfer(D.emissiveMap.colorSpace)===fr,premultipliedAlpha:D.premultipliedAlpha,doubleSided:D.side===Kr,flipSided:D.side===Ra,useDepthPacking:D.depthPacking>=0,depthPacking:D.depthPacking||0,index0AttributeName:D.index0AttributeName,extensionClipCullDistance:vt&&D.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(vt&&D.extensions.multiDraw===!0||Ne)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:D.customProgramCacheKey()};return Xt.vertexUv1s=c.has(1),Xt.vertexUv2s=c.has(2),Xt.vertexUv3s=c.has(3),c.clear(),Xt}function p(D){const R=[];if(D.shaderID?R.push(D.shaderID):(R.push(D.customVertexShaderID),R.push(D.customFragmentShaderID)),D.defines!==void 0)for(const N in D.defines)R.push(N),R.push(D.defines[N]);return D.isRawShaderMaterial===!1&&(x(R,D),_(R,D),R.push(t.outputColorSpace)),R.push(D.customProgramCacheKey),R.join()}function x(D,R){D.push(R.precision),D.push(R.outputColorSpace),D.push(R.envMapMode),D.push(R.envMapCubeUVHeight),D.push(R.mapUv),D.push(R.alphaMapUv),D.push(R.lightMapUv),D.push(R.aoMapUv),D.push(R.bumpMapUv),D.push(R.normalMapUv),D.push(R.displacementMapUv),D.push(R.emissiveMapUv),D.push(R.metalnessMapUv),D.push(R.roughnessMapUv),D.push(R.anisotropyMapUv),D.push(R.clearcoatMapUv),D.push(R.clearcoatNormalMapUv),D.push(R.clearcoatRoughnessMapUv),D.push(R.iridescenceMapUv),D.push(R.iridescenceThicknessMapUv),D.push(R.sheenColorMapUv),D.push(R.sheenRoughnessMapUv),D.push(R.specularMapUv),D.push(R.specularColorMapUv),D.push(R.specularIntensityMapUv),D.push(R.transmissionMapUv),D.push(R.thicknessMapUv),D.push(R.combine),D.push(R.fogExp2),D.push(R.sizeAttenuation),D.push(R.morphTargetsCount),D.push(R.morphAttributeCount),D.push(R.numDirLights),D.push(R.numPointLights),D.push(R.numSpotLights),D.push(R.numSpotLightMaps),D.push(R.numHemiLights),D.push(R.numRectAreaLights),D.push(R.numDirLightShadows),D.push(R.numPointLightShadows),D.push(R.numSpotLightShadows),D.push(R.numSpotLightShadowsWithMaps),D.push(R.numLightProbes),D.push(R.shadowMapType),D.push(R.toneMapping),D.push(R.numClippingPlanes),D.push(R.numClipIntersection),D.push(R.depthPacking)}function _(D,R){o.disableAll(),R.supportsVertexTextures&&o.enable(0),R.instancing&&o.enable(1),R.instancingColor&&o.enable(2),R.instancingMorph&&o.enable(3),R.matcap&&o.enable(4),R.envMap&&o.enable(5),R.normalMapObjectSpace&&o.enable(6),R.normalMapTangentSpace&&o.enable(7),R.clearcoat&&o.enable(8),R.iridescence&&o.enable(9),R.alphaTest&&o.enable(10),R.vertexColors&&o.enable(11),R.vertexAlphas&&o.enable(12),R.vertexUv1s&&o.enable(13),R.vertexUv2s&&o.enable(14),R.vertexUv3s&&o.enable(15),R.vertexTangents&&o.enable(16),R.anisotropy&&o.enable(17),R.alphaHash&&o.enable(18),R.batching&&o.enable(19),R.dispersion&&o.enable(20),R.batchingColor&&o.enable(21),R.gradientMap&&o.enable(22),D.push(o.mask),o.disableAll(),R.fog&&o.enable(0),R.useFog&&o.enable(1),R.flatShading&&o.enable(2),R.logarithmicDepthBuffer&&o.enable(3),R.reversedDepthBuffer&&o.enable(4),R.skinning&&o.enable(5),R.morphTargets&&o.enable(6),R.morphNormals&&o.enable(7),R.morphColors&&o.enable(8),R.premultipliedAlpha&&o.enable(9),R.shadowMapEnabled&&o.enable(10),R.doubleSided&&o.enable(11),R.flipSided&&o.enable(12),R.useDepthPacking&&o.enable(13),R.dithering&&o.enable(14),R.transmission&&o.enable(15),R.sheen&&o.enable(16),R.opaque&&o.enable(17),R.pointsUvs&&o.enable(18),R.decodeVideoTexture&&o.enable(19),R.decodeVideoTextureEmissive&&o.enable(20),R.alphaToCoverage&&o.enable(21),D.push(o.mask)}function w(D){const R=g[D.type];let N;if(R){const U=Zc[R];N=av.clone(U.uniforms)}else N=D.uniforms;return N}function M(D,R){let N;for(let U=0,j=u.length;U<j;U++){const z=u[U];if(z.cacheKey===R){N=z,++N.usedTimes;break}}return N===void 0&&(N=new V_e(t,R,D,a),u.push(N)),N}function S(D){if(--D.usedTimes===0){const R=u.indexOf(D);u[R]=u[u.length-1],u.pop(),D.destroy()}}function A(D){l.remove(D)}function C(){l.dispose()}return{getParameters:y,getProgramCacheKey:p,getUniforms:w,acquireProgram:M,releaseProgram:S,releaseShaderCache:A,programs:u,dispose:C}}function K_e(){let t=new WeakMap;function e(s){return t.has(s)}function n(s){let o=t.get(s);return o===void 0&&(o={},t.set(s,o)),o}function i(s){t.delete(s)}function r(s,o,l){t.get(s)[o]=l}function a(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:a}}function Y_e(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function i5(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function r5(){const t=[];let e=0;const n=[],i=[],r=[];function a(){e=0,n.length=0,i.length=0,r.length=0}function s(f,h,d,g,b,y){let p=t[e];return p===void 0?(p={id:f.id,object:f,geometry:h,material:d,groupOrder:g,renderOrder:f.renderOrder,z:b,group:y},t[e]=p):(p.id=f.id,p.object=f,p.geometry=h,p.material=d,p.groupOrder=g,p.renderOrder=f.renderOrder,p.z=b,p.group=y),e++,p}function o(f,h,d,g,b,y){const p=s(f,h,d,g,b,y);d.transmission>0?i.push(p):d.transparent===!0?r.push(p):n.push(p)}function l(f,h,d,g,b,y){const p=s(f,h,d,g,b,y);d.transmission>0?i.unshift(p):d.transparent===!0?r.unshift(p):n.unshift(p)}function c(f,h){n.length>1&&n.sort(f||Y_e),i.length>1&&i.sort(h||i5),r.length>1&&r.sort(h||i5)}function u(){for(let f=e,h=t.length;f<h;f++){const d=t[f];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:n,transmissive:i,transparent:r,init:a,push:o,unshift:l,finish:u,sort:c}}function J_e(){let t=new WeakMap;function e(i,r){const a=t.get(i);let s;return a===void 0?(s=new r5,t.set(i,[s])):r>=a.length?(s=new r5,a.push(s)):s=a[r],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function $_e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new te,color:new Ut};break;case"SpotLight":n={position:new te,direction:new te,color:new Ut,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new te,color:new Ut,distance:0,decay:0};break;case"HemisphereLight":n={direction:new te,skyColor:new Ut,groundColor:new Ut};break;case"RectAreaLight":n={color:new Ut,position:new te,halfWidth:new te,halfHeight:new te};break}return t[e.id]=n,n}}}function Z_e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new wt};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new wt};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new wt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let Q_e=0;function eSe(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function tSe(t){const e=new $_e,n=Z_e(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new te);const r=new te,a=new Ot,s=new Ot;function o(c){let u=0,f=0,h=0;for(let D=0;D<9;D++)i.probe[D].set(0,0,0);let d=0,g=0,b=0,y=0,p=0,x=0,_=0,w=0,M=0,S=0,A=0;c.sort(eSe);for(let D=0,R=c.length;D<R;D++){const N=c[D],U=N.color,j=N.intensity,z=N.distance,q=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)u+=U.r*j,f+=U.g*j,h+=U.b*j;else if(N.isLightProbe){for(let B=0;B<9;B++)i.probe[B].addScaledVector(N.sh.coefficients[B],j);A++}else if(N.isDirectionalLight){const B=e.get(N);if(B.color.copy(N.color).multiplyScalar(N.intensity),N.castShadow){const G=N.shadow,H=n.get(N);H.shadowIntensity=G.intensity,H.shadowBias=G.bias,H.shadowNormalBias=G.normalBias,H.shadowRadius=G.radius,H.shadowMapSize=G.mapSize,i.directionalShadow[d]=H,i.directionalShadowMap[d]=q,i.directionalShadowMatrix[d]=N.shadow.matrix,x++}i.directional[d]=B,d++}else if(N.isSpotLight){const B=e.get(N);B.position.setFromMatrixPosition(N.matrixWorld),B.color.copy(U).multiplyScalar(j),B.distance=z,B.coneCos=Math.cos(N.angle),B.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),B.decay=N.decay,i.spot[b]=B;const G=N.shadow;if(N.map&&(i.spotLightMap[M]=N.map,M++,G.updateMatrices(N),N.castShadow&&S++),i.spotLightMatrix[b]=G.matrix,N.castShadow){const H=n.get(N);H.shadowIntensity=G.intensity,H.shadowBias=G.bias,H.shadowNormalBias=G.normalBias,H.shadowRadius=G.radius,H.shadowMapSize=G.mapSize,i.spotShadow[b]=H,i.spotShadowMap[b]=q,w++}b++}else if(N.isRectAreaLight){const B=e.get(N);B.color.copy(U).multiplyScalar(j),B.halfWidth.set(N.width*.5,0,0),B.halfHeight.set(0,N.height*.5,0),i.rectArea[y]=B,y++}else if(N.isPointLight){const B=e.get(N);if(B.color.copy(N.color).multiplyScalar(N.intensity),B.distance=N.distance,B.decay=N.decay,N.castShadow){const G=N.shadow,H=n.get(N);H.shadowIntensity=G.intensity,H.shadowBias=G.bias,H.shadowNormalBias=G.normalBias,H.shadowRadius=G.radius,H.shadowMapSize=G.mapSize,H.shadowCameraNear=G.camera.near,H.shadowCameraFar=G.camera.far,i.pointShadow[g]=H,i.pointShadowMap[g]=q,i.pointShadowMatrix[g]=N.shadow.matrix,_++}i.point[g]=B,g++}else if(N.isHemisphereLight){const B=e.get(N);B.skyColor.copy(N.color).multiplyScalar(j),B.groundColor.copy(N.groundColor).multiplyScalar(j),i.hemi[p]=B,p++}}y>0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=en.LTC_FLOAT_1,i.rectAreaLTC2=en.LTC_FLOAT_2):(i.rectAreaLTC1=en.LTC_HALF_1,i.rectAreaLTC2=en.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=h;const C=i.hash;(C.directionalLength!==d||C.pointLength!==g||C.spotLength!==b||C.rectAreaLength!==y||C.hemiLength!==p||C.numDirectionalShadows!==x||C.numPointShadows!==_||C.numSpotShadows!==w||C.numSpotMaps!==M||C.numLightProbes!==A)&&(i.directional.length=d,i.spot.length=b,i.rectArea.length=y,i.point.length=g,i.hemi.length=p,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=_,i.pointShadowMap.length=_,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=_,i.spotLightMatrix.length=w+M-S,i.spotLightMap.length=M,i.numSpotLightShadowsWithMaps=S,i.numLightProbes=A,C.directionalLength=d,C.pointLength=g,C.spotLength=b,C.rectAreaLength=y,C.hemiLength=p,C.numDirectionalShadows=x,C.numPointShadows=_,C.numSpotShadows=w,C.numSpotMaps=M,C.numLightProbes=A,i.version=Q_e++)}function l(c,u){let f=0,h=0,d=0,g=0,b=0;const y=u.matrixWorldInverse;for(let p=0,x=c.length;p<x;p++){const _=c[p];if(_.isDirectionalLight){const w=i.directional[f];w.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),w.direction.sub(r),w.direction.transformDirection(y),f++}else if(_.isSpotLight){const w=i.spot[d];w.position.setFromMatrixPosition(_.matrixWorld),w.position.applyMatrix4(y),w.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),w.direction.sub(r),w.direction.transformDirection(y),d++}else if(_.isRectAreaLight){const w=i.rectArea[g];w.position.setFromMatrixPosition(_.matrixWorld),w.position.applyMatrix4(y),s.identity(),a.copy(_.matrixWorld),a.premultiply(y),s.extractRotation(a),w.halfWidth.set(_.width*.5,0,0),w.halfHeight.set(0,_.height*.5,0),w.halfWidth.applyMatrix4(s),w.halfHeight.applyMatrix4(s),g++}else if(_.isPointLight){const w=i.point[h];w.position.setFromMatrixPosition(_.matrixWorld),w.position.applyMatrix4(y),h++}else if(_.isHemisphereLight){const w=i.hemi[b];w.direction.setFromMatrixPosition(_.matrixWorld),w.direction.transformDirection(y),b++}}}return{setup:o,setupView:l,state:i}}function a5(t){const e=new tSe(t),n=[],i=[];function r(u){c.camera=u,n.length=0,i.length=0}function a(u){n.push(u)}function s(u){i.push(u)}function o(){e.setup(n)}function l(u){e.setupView(n,u)}const c={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:o,setupLightsView:l,pushLight:a,pushShadow:s}}function nSe(t){let e=new WeakMap;function n(r,a=0){const s=e.get(r);let o;return s===void 0?(o=new a5(t),e.set(r,[o])):a>=s.length?(o=new a5(t),s.push(o)):o=s[a],o}function i(){e=new WeakMap}return{get:n,dispose:i}}const iSe=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,rSe=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
	const float samples = float( VSM_SAMPLES );
	float mean = 0.0;
	float squared_mean = 0.0;
	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
	for ( float i = 0.0; i < samples; i ++ ) {
		float uvOffset = uvStart + i * uvStride;
		#ifdef HORIZONTAL_PASS
			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
			mean += distribution.x;
			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
		#else
			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
			mean += depth;
			squared_mean += depth * depth;
		#endif
	}
	mean = mean / samples;
	squared_mean = squared_mean / samples;
	float std_dev = sqrt( squared_mean - mean * mean );
	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function aSe(t,e,n){let i=new Kd;const r=new wt,a=new wt,s=new ei,o=new uC({depthPacking:UP}),l=new fC,c={},u=n.maxTextureSize,f={[gu]:Ra,[Ra]:gu,[Kr]:Kr},h=new ss({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new wt},radius:{value:4}},vertexShader:iSe,fragmentShader:rSe}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const g=new Dn;g.setAttribute("position",new Nn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new _i(g,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=NA;let p=this.type;this.render=function(S,A,C){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||S.length===0)return;const D=t.getRenderTarget(),R=t.getActiveCubeFace(),N=t.getActiveMipmapLevel(),U=t.state;U.setBlending(Zu),U.buffers.depth.getReversed()?U.buffers.color.setClear(0,0,0,0):U.buffers.color.setClear(1,1,1,1),U.buffers.depth.setTest(!0),U.setScissorTest(!1);const j=p!==Xc&&this.type===Xc,z=p===Xc&&this.type!==Xc;for(let q=0,B=S.length;q<B;q++){const G=S[q],H=G.shadow;if(H===void 0){console.warn("THREE.WebGLShadowMap:",G,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;r.copy(H.mapSize);const W=H.getFrameExtents();if(r.multiply(W),a.copy(H.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(a.x=Math.floor(u/W.x),r.x=a.x*W.x,H.mapSize.x=a.x),r.y>u&&(a.y=Math.floor(u/W.y),r.y=a.y*W.y,H.mapSize.y=a.y)),H.map===null||j===!0||z===!0){const Y=this.type!==Xc?{minFilter:is,magFilter:is}:{};H.map!==null&&H.map.dispose(),H.map=new Ec(r.x,r.y,Y),H.map.texture.name=G.name+".shadowMap",H.camera.updateProjectionMatrix()}t.setRenderTarget(H.map),t.clear();const F=H.getViewportCount();for(let Y=0;Y<F;Y++){const Z=H.getViewport(Y);s.set(a.x*Z.x,a.y*Z.y,a.x*Z.z,a.y*Z.w),U.viewport(s),H.updateMatrices(G,Y),i=H.getFrustum(),w(A,C,H.camera,G,this.type)}H.isPointLightShadow!==!0&&this.type===Xc&&x(H,C),H.needsUpdate=!1}p=this.type,y.needsUpdate=!1,t.setRenderTarget(D,R,N)};function x(S,A){const C=e.update(b);h.defines.VSM_SAMPLES!==S.blurSamples&&(h.defines.VSM_SAMPLES=S.blurSamples,d.defines.VSM_SAMPLES=S.blurSamples,h.needsUpdate=!0,d.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new Ec(r.x,r.y)),h.uniforms.shadow_pass.value=S.map.texture,h.uniforms.resolution.value=S.mapSize,h.uniforms.radius.value=S.radius,t.setRenderTarget(S.mapPass),t.clear(),t.renderBufferDirect(A,null,C,h,b,null),d.uniforms.shadow_pass.value=S.mapPass.texture,d.uniforms.resolution.value=S.mapSize,d.uniforms.radius.value=S.radius,t.setRenderTarget(S.map),t.clear(),t.renderBufferDirect(A,null,C,d,b,null)}function _(S,A,C,D){let R=null;const N=C.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(N!==void 0)R=N;else if(R=C.isPointLight===!0?l:o,t.localClippingEnabled&&A.clipShadows===!0&&Array.isArray(A.clippingPlanes)&&A.clippingPlanes.length!==0||A.displacementMap&&A.displacementScale!==0||A.alphaMap&&A.alphaTest>0||A.map&&A.alphaTest>0||A.alphaToCoverage===!0){const U=R.uuid,j=A.uuid;let z=c[U];z===void 0&&(z={},c[U]=z);let q=z[j];q===void 0&&(q=R.clone(),z[j]=q,A.addEventListener("dispose",M)),R=q}if(R.visible=A.visible,R.wireframe=A.wireframe,D===Xc?R.side=A.shadowSide!==null?A.shadowSide:A.side:R.side=A.shadowSide!==null?A.shadowSide:f[A.side],R.alphaMap=A.alphaMap,R.alphaTest=A.alphaToCoverage===!0?.5:A.alphaTest,R.map=A.map,R.clipShadows=A.clipShadows,R.clippingPlanes=A.clippingPlanes,R.clipIntersection=A.clipIntersection,R.displacementMap=A.displacementMap,R.displacementScale=A.displacementScale,R.displacementBias=A.displacementBias,R.wireframeLinewidth=A.wireframeLinewidth,R.linewidth=A.linewidth,C.isPointLight===!0&&R.isMeshDistanceMaterial===!0){const U=t.properties.get(R);U.light=C}return R}function w(S,A,C,D,R){if(S.visible===!1)return;if(S.layers.test(A.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&R===Xc)&&(!S.frustumCulled||i.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,S.matrixWorld);const j=e.update(S),z=S.material;if(Array.isArray(z)){const q=j.groups;for(let B=0,G=q.length;B<G;B++){const H=q[B],W=z[H.materialIndex];if(W&&W.visible){const F=_(S,W,D,R);S.onBeforeShadow(t,S,A,C,j,F,H),t.renderBufferDirect(C,null,j,F,S,H),S.onAfterShadow(t,S,A,C,j,F,H)}}}else if(z.visible){const q=_(S,z,D,R);S.onBeforeShadow(t,S,A,C,j,q,null),t.renderBufferDirect(C,null,j,q,S,null),S.onAfterShadow(t,S,A,C,j,q,null)}}const U=S.children;for(let j=0,z=U.length;j<z;j++)w(U[j],A,C,D,R)}function M(S){S.target.removeEventListener("dispose",M);for(const C in c){const D=c[C],R=S.target.uuid;R in D&&(D[R].dispose(),delete D[R])}}}const sSe={[g2]:b2,[v2]:_2,[y2]:S2,[zm]:x2,[b2]:g2,[_2]:v2,[S2]:y2,[x2]:zm};function oSe(t,e){function n(){let Oe=!1;const Ve=new ei;let ht=null;const Ft=new ei(0,0,0,0);return{setMask:function(st){ht!==st&&!Oe&&(t.colorMask(st,st,st,st),ht=st)},setLocked:function(st){Oe=st},setClear:function(st,it,vt,Kt,Xt){Xt===!0&&(st*=Kt,it*=Kt,vt*=Kt),Ve.set(st,it,vt,Kt),Ft.equals(Ve)===!1&&(t.clearColor(st,it,vt,Kt),Ft.copy(Ve))},reset:function(){Oe=!1,ht=null,Ft.set(-1,0,0,0)}}}function i(){let Oe=!1,Ve=!1,ht=null,Ft=null,st=null;return{setReversed:function(it){if(Ve!==it){const vt=e.get("EXT_clip_control");it?vt.clipControlEXT(vt.LOWER_LEFT_EXT,vt.ZERO_TO_ONE_EXT):vt.clipControlEXT(vt.LOWER_LEFT_EXT,vt.NEGATIVE_ONE_TO_ONE_EXT),Ve=it;const Kt=st;st=null,this.setClear(Kt)}},getReversed:function(){return Ve},setTest:function(it){it?ue(t.DEPTH_TEST):_e(t.DEPTH_TEST)},setMask:function(it){ht!==it&&!Oe&&(t.depthMask(it),ht=it)},setFunc:function(it){if(Ve&&(it=sSe[it]),Ft!==it){switch(it){case g2:t.depthFunc(t.NEVER);break;case b2:t.depthFunc(t.ALWAYS);break;case v2:t.depthFunc(t.LESS);break;case zm:t.depthFunc(t.LEQUAL);break;case y2:t.depthFunc(t.EQUAL);break;case x2:t.depthFunc(t.GEQUAL);break;case _2:t.depthFunc(t.GREATER);break;case S2:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}Ft=it}},setLocked:function(it){Oe=it},setClear:function(it){st!==it&&(Ve&&(it=1-it),t.clearDepth(it),st=it)},reset:function(){Oe=!1,ht=null,Ft=null,st=null,Ve=!1}}}function r(){let Oe=!1,Ve=null,ht=null,Ft=null,st=null,it=null,vt=null,Kt=null,Xt=null;return{setTest:function(cn){Oe||(cn?ue(t.STENCIL_TEST):_e(t.STENCIL_TEST))},setMask:function(cn){Ve!==cn&&!Oe&&(t.stencilMask(cn),Ve=cn)},setFunc:function(cn,Gn,bn){(ht!==cn||Ft!==Gn||st!==bn)&&(t.stencilFunc(cn,Gn,bn),ht=cn,Ft=Gn,st=bn)},setOp:function(cn,Gn,bn){(it!==cn||vt!==Gn||Kt!==bn)&&(t.stencilOp(cn,Gn,bn),it=cn,vt=Gn,Kt=bn)},setLocked:function(cn){Oe=cn},setClear:function(cn){Xt!==cn&&(t.clearStencil(cn),Xt=cn)},reset:function(){Oe=!1,Ve=null,ht=null,Ft=null,st=null,it=null,vt=null,Kt=null,Xt=null}}}const a=new n,s=new i,o=new r,l=new WeakMap,c=new WeakMap;let u={},f={},h=new WeakMap,d=[],g=null,b=!1,y=null,p=null,x=null,_=null,w=null,M=null,S=null,A=new Ut(0,0,0),C=0,D=!1,R=null,N=null,U=null,j=null,z=null;const q=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let B=!1,G=0;const H=t.getParameter(t.VERSION);H.indexOf("WebGL")!==-1?(G=parseFloat(/^WebGL (\d)/.exec(H)[1]),B=G>=1):H.indexOf("OpenGL ES")!==-1&&(G=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),B=G>=2);let W=null,F={};const Y=t.getParameter(t.SCISSOR_BOX),Z=t.getParameter(t.VIEWPORT),V=new ei().fromArray(Y),de=new ei().fromArray(Z);function se(Oe,Ve,ht,Ft){const st=new Uint8Array(4),it=t.createTexture();t.bindTexture(Oe,it),t.texParameteri(Oe,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Oe,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let vt=0;vt<ht;vt++)Oe===t.TEXTURE_3D||Oe===t.TEXTURE_2D_ARRAY?t.texImage3D(Ve,0,t.RGBA,1,1,Ft,0,t.RGBA,t.UNSIGNED_BYTE,st):t.texImage2D(Ve+vt,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,st);return it}const oe={};oe[t.TEXTURE_2D]=se(t.TEXTURE_2D,t.TEXTURE_2D,1),oe[t.TEXTURE_CUBE_MAP]=se(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),oe[t.TEXTURE_2D_ARRAY]=se(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),oe[t.TEXTURE_3D]=se(t.TEXTURE_3D,t.TEXTURE_3D,1,1),a.setClear(0,0,0,1),s.setClear(1),o.setClear(0),ue(t.DEPTH_TEST),s.setFunc(zm),qe(!1),we(VO),ue(t.CULL_FACE),Fe(Zu);function ue(Oe){u[Oe]!==!0&&(t.enable(Oe),u[Oe]=!0)}function _e(Oe){u[Oe]!==!1&&(t.disable(Oe),u[Oe]=!1)}function ke(Oe,Ve){return f[Oe]!==Ve?(t.bindFramebuffer(Oe,Ve),f[Oe]=Ve,Oe===t.DRAW_FRAMEBUFFER&&(f[t.FRAMEBUFFER]=Ve),Oe===t.FRAMEBUFFER&&(f[t.DRAW_FRAMEBUFFER]=Ve),!0):!1}function Ne(Oe,Ve){let ht=d,Ft=!1;if(Oe){ht=h.get(Ve),ht===void 0&&(ht=[],h.set(Ve,ht));const st=Oe.textures;if(ht.length!==st.length||ht[0]!==t.COLOR_ATTACHMENT0){for(let it=0,vt=st.length;it<vt;it++)ht[it]=t.COLOR_ATTACHMENT0+it;ht.length=st.length,Ft=!0}}else ht[0]!==t.BACK&&(ht[0]=t.BACK,Ft=!0);Ft&&t.drawBuffers(ht)}function Ue(Oe){return g!==Oe?(t.useProgram(Oe),g=Oe,!0):!1}const ze={[md]:t.FUNC_ADD,[QY]:t.FUNC_SUBTRACT,[eJ]:t.FUNC_REVERSE_SUBTRACT};ze[tJ]=t.MIN,ze[nJ]=t.MAX;const pe={[iJ]:t.ZERO,[rJ]:t.ONE,[aJ]:t.SRC_COLOR,[p2]:t.SRC_ALPHA,[fJ]:t.SRC_ALPHA_SATURATE,[cJ]:t.DST_COLOR,[oJ]:t.DST_ALPHA,[sJ]:t.ONE_MINUS_SRC_COLOR,[m2]:t.ONE_MINUS_SRC_ALPHA,[uJ]:t.ONE_MINUS_DST_COLOR,[lJ]:t.ONE_MINUS_DST_ALPHA,[hJ]:t.CONSTANT_COLOR,[dJ]:t.ONE_MINUS_CONSTANT_COLOR,[pJ]:t.CONSTANT_ALPHA,[mJ]:t.ONE_MINUS_CONSTANT_ALPHA};function Fe(Oe,Ve,ht,Ft,st,it,vt,Kt,Xt,cn){if(Oe===Zu){b===!0&&(_e(t.BLEND),b=!1);return}if(b===!1&&(ue(t.BLEND),b=!0),Oe!==ZY){if(Oe!==y||cn!==D){if((p!==md||w!==md)&&(t.blendEquation(t.FUNC_ADD),p=md,w=md),cn)switch(Oe){case Tm:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case GO:t.blendFunc(t.ONE,t.ONE);break;case WO:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case qO:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",Oe);break}else switch(Oe){case Tm:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case GO:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case WO:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case qO:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",Oe);break}x=null,_=null,M=null,S=null,A.set(0,0,0),C=0,y=Oe,D=cn}return}st=st||Ve,it=it||ht,vt=vt||Ft,(Ve!==p||st!==w)&&(t.blendEquationSeparate(ze[Ve],ze[st]),p=Ve,w=st),(ht!==x||Ft!==_||it!==M||vt!==S)&&(t.blendFuncSeparate(pe[ht],pe[Ft],pe[it],pe[vt]),x=ht,_=Ft,M=it,S=vt),(Kt.equals(A)===!1||Xt!==C)&&(t.blendColor(Kt.r,Kt.g,Kt.b,Xt),A.copy(Kt),C=Xt),y=Oe,D=!1}function Ie(Oe,Ve){Oe.side===Kr?_e(t.CULL_FACE):ue(t.CULL_FACE);let ht=Oe.side===Ra;Ve&&(ht=!ht),qe(ht),Oe.blending===Tm&&Oe.transparent===!1?Fe(Zu):Fe(Oe.blending,Oe.blendEquation,Oe.blendSrc,Oe.blendDst,Oe.blendEquationAlpha,Oe.blendSrcAlpha,Oe.blendDstAlpha,Oe.blendColor,Oe.blendAlpha,Oe.premultipliedAlpha),s.setFunc(Oe.depthFunc),s.setTest(Oe.depthTest),s.setMask(Oe.depthWrite),a.setMask(Oe.colorWrite);const Ft=Oe.stencilWrite;o.setTest(Ft),Ft&&(o.setMask(Oe.stencilWriteMask),o.setFunc(Oe.stencilFunc,Oe.stencilRef,Oe.stencilFuncMask),o.setOp(Oe.stencilFail,Oe.stencilZFail,Oe.stencilZPass)),Ae(Oe.polygonOffset,Oe.polygonOffsetFactor,Oe.polygonOffsetUnits),Oe.alphaToCoverage===!0?ue(t.SAMPLE_ALPHA_TO_COVERAGE):_e(t.SAMPLE_ALPHA_TO_COVERAGE)}function qe(Oe){R!==Oe&&(Oe?t.frontFace(t.CW):t.frontFace(t.CCW),R=Oe)}function we(Oe){Oe!==YY?(ue(t.CULL_FACE),Oe!==N&&(Oe===VO?t.cullFace(t.BACK):Oe===JY?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):_e(t.CULL_FACE),N=Oe}function Te(Oe){Oe!==U&&(B&&t.lineWidth(Oe),U=Oe)}function Ae(Oe,Ve,ht){Oe?(ue(t.POLYGON_OFFSET_FILL),(j!==Ve||z!==ht)&&(t.polygonOffset(Ve,ht),j=Ve,z=ht)):_e(t.POLYGON_OFFSET_FILL)}function Pe(Oe){Oe?ue(t.SCISSOR_TEST):_e(t.SCISSOR_TEST)}function He(Oe){Oe===void 0&&(Oe=t.TEXTURE0+q-1),W!==Oe&&(t.activeTexture(Oe),W=Oe)}function $e(Oe,Ve,ht){ht===void 0&&(W===null?ht=t.TEXTURE0+q-1:ht=W);let Ft=F[ht];Ft===void 0&&(Ft={type:void 0,texture:void 0},F[ht]=Ft),(Ft.type!==Oe||Ft.texture!==Ve)&&(W!==ht&&(t.activeTexture(ht),W=ht),t.bindTexture(Oe,Ve||oe[Oe]),Ft.type=Oe,Ft.texture=Ve)}function ie(){const Oe=F[W];Oe!==void 0&&Oe.type!==void 0&&(t.bindTexture(Oe.type,null),Oe.type=void 0,Oe.texture=void 0)}function K(){try{t.compressedTexImage2D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function ce(){try{t.compressedTexImage3D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function fe(){try{t.texSubImage2D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function me(){try{t.texSubImage3D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function $(){try{t.compressedTexSubImage2D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function Le(){try{t.compressedTexSubImage3D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function Xe(){try{t.texStorage2D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function mt(){try{t.texStorage3D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function Ge(){try{t.texImage2D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function Je(){try{t.texImage3D(...arguments)}catch(Oe){console.error("THREE.WebGLState:",Oe)}}function tt(Oe){V.equals(Oe)===!1&&(t.scissor(Oe.x,Oe.y,Oe.z,Oe.w),V.copy(Oe))}function xt(Oe){de.equals(Oe)===!1&&(t.viewport(Oe.x,Oe.y,Oe.z,Oe.w),de.copy(Oe))}function Tt(Oe,Ve){let ht=c.get(Ve);ht===void 0&&(ht=new WeakMap,c.set(Ve,ht));let Ft=ht.get(Oe);Ft===void 0&&(Ft=t.getUniformBlockIndex(Ve,Oe.name),ht.set(Oe,Ft))}function bt(Oe,Ve){const Ft=c.get(Ve).get(Oe);l.get(Ve)!==Ft&&(t.uniformBlockBinding(Ve,Ft,Oe.__bindingPointIndex),l.set(Ve,Ft))}function Rt(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),s.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),u={},W=null,F={},f={},h=new WeakMap,d=[],g=null,b=!1,y=null,p=null,x=null,_=null,w=null,M=null,S=null,A=new Ut(0,0,0),C=0,D=!1,R=null,N=null,U=null,j=null,z=null,V.set(0,0,t.canvas.width,t.canvas.height),de.set(0,0,t.canvas.width,t.canvas.height),a.reset(),s.reset(),o.reset()}return{buffers:{color:a,depth:s,stencil:o},enable:ue,disable:_e,bindFramebuffer:ke,drawBuffers:Ne,useProgram:Ue,setBlending:Fe,setMaterial:Ie,setFlipSided:qe,setCullFace:we,setLineWidth:Te,setPolygonOffset:Ae,setScissorTest:Pe,activeTexture:He,bindTexture:$e,unbindTexture:ie,compressedTexImage2D:K,compressedTexImage3D:ce,texImage2D:Ge,texImage3D:Je,updateUBOMapping:Tt,uniformBlockBinding:bt,texStorage2D:Xe,texStorage3D:mt,texSubImage2D:fe,texSubImage3D:me,compressedTexSubImage2D:$,compressedTexSubImage3D:Le,scissor:tt,viewport:xt,reset:Rt}}function lSe(t,e,n,i,r,a,s){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new wt,u=new WeakMap;let f;const h=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(ie,K){return d?new OffscreenCanvas(ie,K):G1("canvas")}function b(ie,K,ce){let fe=1;const me=$e(ie);if((me.width>ce||me.height>ce)&&(fe=ce/Math.max(me.width,me.height)),fe<1)if(typeof HTMLImageElement<"u"&&ie instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ie instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ie instanceof ImageBitmap||typeof VideoFrame<"u"&&ie instanceof VideoFrame){const $=Math.floor(fe*me.width),Le=Math.floor(fe*me.height);f===void 0&&(f=g($,Le));const Xe=K?g($,Le):f;return Xe.width=$,Xe.height=Le,Xe.getContext("2d").drawImage(ie,0,0,$,Le),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+$+"x"+Le+")."),Xe}else return"data"in ie&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),ie;return ie}function y(ie){return ie.generateMipmaps}function p(ie){t.generateMipmap(ie)}function x(ie){return ie.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:ie.isWebGL3DRenderTarget?t.TEXTURE_3D:ie.isWebGLArrayRenderTarget||ie.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function _(ie,K,ce,fe,me=!1){if(ie!==null){if(t[ie]!==void 0)return t[ie];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ie+"'")}let $=K;if(K===t.RED&&(ce===t.FLOAT&&($=t.R32F),ce===t.HALF_FLOAT&&($=t.R16F),ce===t.UNSIGNED_BYTE&&($=t.R8)),K===t.RED_INTEGER&&(ce===t.UNSIGNED_BYTE&&($=t.R8UI),ce===t.UNSIGNED_SHORT&&($=t.R16UI),ce===t.UNSIGNED_INT&&($=t.R32UI),ce===t.BYTE&&($=t.R8I),ce===t.SHORT&&($=t.R16I),ce===t.INT&&($=t.R32I)),K===t.RG&&(ce===t.FLOAT&&($=t.RG32F),ce===t.HALF_FLOAT&&($=t.RG16F),ce===t.UNSIGNED_BYTE&&($=t.RG8)),K===t.RG_INTEGER&&(ce===t.UNSIGNED_BYTE&&($=t.RG8UI),ce===t.UNSIGNED_SHORT&&($=t.RG16UI),ce===t.UNSIGNED_INT&&($=t.RG32UI),ce===t.BYTE&&($=t.RG8I),ce===t.SHORT&&($=t.RG16I),ce===t.INT&&($=t.RG32I)),K===t.RGB_INTEGER&&(ce===t.UNSIGNED_BYTE&&($=t.RGB8UI),ce===t.UNSIGNED_SHORT&&($=t.RGB16UI),ce===t.UNSIGNED_INT&&($=t.RGB32UI),ce===t.BYTE&&($=t.RGB8I),ce===t.SHORT&&($=t.RGB16I),ce===t.INT&&($=t.RGB32I)),K===t.RGBA_INTEGER&&(ce===t.UNSIGNED_BYTE&&($=t.RGBA8UI),ce===t.UNSIGNED_SHORT&&($=t.RGBA16UI),ce===t.UNSIGNED_INT&&($=t.RGBA32UI),ce===t.BYTE&&($=t.RGBA8I),ce===t.SHORT&&($=t.RGBA16I),ce===t.INT&&($=t.RGBA32I)),K===t.RGB&&ce===t.UNSIGNED_INT_5_9_9_9_REV&&($=t.RGB9_E5),K===t.RGBA){const Le=me?j1:pi.getTransfer(fe);ce===t.FLOAT&&($=t.RGBA32F),ce===t.HALF_FLOAT&&($=t.RGBA16F),ce===t.UNSIGNED_BYTE&&($=Le===fr?t.SRGB8_ALPHA8:t.RGBA8),ce===t.UNSIGNED_SHORT_4_4_4_4&&($=t.RGBA4),ce===t.UNSIGNED_SHORT_5_5_5_1&&($=t.RGB5_A1)}return($===t.R16F||$===t.R32F||$===t.RG16F||$===t.RG32F||$===t.RGBA16F||$===t.RGBA32F)&&e.get("EXT_color_buffer_float"),$}function w(ie,K){let ce;return ie?K===null||K===wc||K===J0?ce=t.DEPTH24_STENCIL8:K===yr?ce=t.DEPTH32F_STENCIL8:K===Y0&&(ce=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):K===null||K===wc||K===J0?ce=t.DEPTH_COMPONENT24:K===yr?ce=t.DEPTH_COMPONENT32F:K===Y0&&(ce=t.DEPTH_COMPONENT16),ce}function M(ie,K){return y(ie)===!0||ie.isFramebufferTexture&&ie.minFilter!==is&&ie.minFilter!==Hi?Math.log2(Math.max(K.width,K.height))+1:ie.mipmaps!==void 0&&ie.mipmaps.length>0?ie.mipmaps.length:ie.isCompressedTexture&&Array.isArray(ie.image)?K.mipmaps.length:1}function S(ie){const K=ie.target;K.removeEventListener("dispose",S),C(K),K.isVideoTexture&&u.delete(K)}function A(ie){const K=ie.target;K.removeEventListener("dispose",A),R(K)}function C(ie){const K=i.get(ie);if(K.__webglInit===void 0)return;const ce=ie.source,fe=h.get(ce);if(fe){const me=fe[K.__cacheKey];me.usedTimes--,me.usedTimes===0&&D(ie),Object.keys(fe).length===0&&h.delete(ce)}i.remove(ie)}function D(ie){const K=i.get(ie);t.deleteTexture(K.__webglTexture);const ce=ie.source,fe=h.get(ce);delete fe[K.__cacheKey],s.memory.textures--}function R(ie){const K=i.get(ie);if(ie.depthTexture&&(ie.depthTexture.dispose(),i.remove(ie.depthTexture)),ie.isWebGLCubeRenderTarget)for(let fe=0;fe<6;fe++){if(Array.isArray(K.__webglFramebuffer[fe]))for(let me=0;me<K.__webglFramebuffer[fe].length;me++)t.deleteFramebuffer(K.__webglFramebuffer[fe][me]);else t.deleteFramebuffer(K.__webglFramebuffer[fe]);K.__webglDepthbuffer&&t.deleteRenderbuffer(K.__webglDepthbuffer[fe])}else{if(Array.isArray(K.__webglFramebuffer))for(let fe=0;fe<K.__webglFramebuffer.length;fe++)t.deleteFramebuffer(K.__webglFramebuffer[fe]);else t.deleteFramebuffer(K.__webglFramebuffer);if(K.__webglDepthbuffer&&t.deleteRenderbuffer(K.__webglDepthbuffer),K.__webglMultisampledFramebuffer&&t.deleteFramebuffer(K.__webglMultisampledFramebuffer),K.__webglColorRenderbuffer)for(let fe=0;fe<K.__webglColorRenderbuffer.length;fe++)K.__webglColorRenderbuffer[fe]&&t.deleteRenderbuffer(K.__webglColorRenderbuffer[fe]);K.__webglDepthRenderbuffer&&t.deleteRenderbuffer(K.__webglDepthRenderbuffer)}const ce=ie.textures;for(let fe=0,me=ce.length;fe<me;fe++){const $=i.get(ce[fe]);$.__webglTexture&&(t.deleteTexture($.__webglTexture),s.memory.textures--),i.remove(ce[fe])}i.remove(ie)}let N=0;function U(){N=0}function j(){const ie=N;return ie>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+ie+" texture units while this GPU supports only "+r.maxTextures),N+=1,ie}function z(ie){const K=[];return K.push(ie.wrapS),K.push(ie.wrapT),K.push(ie.wrapR||0),K.push(ie.magFilter),K.push(ie.minFilter),K.push(ie.anisotropy),K.push(ie.internalFormat),K.push(ie.format),K.push(ie.type),K.push(ie.generateMipmaps),K.push(ie.premultiplyAlpha),K.push(ie.flipY),K.push(ie.unpackAlignment),K.push(ie.colorSpace),K.join()}function q(ie,K){const ce=i.get(ie);if(ie.isVideoTexture&&Pe(ie),ie.isRenderTargetTexture===!1&&ie.isExternalTexture!==!0&&ie.version>0&&ce.__version!==ie.version){const fe=ie.image;if(fe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(fe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{oe(ce,ie,K);return}}else ie.isExternalTexture&&(ce.__webglTexture=ie.sourceTexture?ie.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,ce.__webglTexture,t.TEXTURE0+K)}function B(ie,K){const ce=i.get(ie);if(ie.isRenderTargetTexture===!1&&ie.version>0&&ce.__version!==ie.version){oe(ce,ie,K);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ce.__webglTexture,t.TEXTURE0+K)}function G(ie,K){const ce=i.get(ie);if(ie.isRenderTargetTexture===!1&&ie.version>0&&ce.__version!==ie.version){oe(ce,ie,K);return}n.bindTexture(t.TEXTURE_3D,ce.__webglTexture,t.TEXTURE0+K)}function H(ie,K){const ce=i.get(ie);if(ie.version>0&&ce.__version!==ie.version){ue(ce,ie,K);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ce.__webglTexture,t.TEXTURE0+K)}const W={[zd]:t.REPEAT,[ba]:t.CLAMP_TO_EDGE,[K0]:t.MIRRORED_REPEAT},F={[is]:t.NEAREST,[LA]:t.NEAREST_MIPMAP_NEAREST,[rm]:t.NEAREST_MIPMAP_LINEAR,[Hi]:t.LINEAR,[b0]:t.LINEAR_MIPMAP_NEAREST,[mc]:t.LINEAR_MIPMAP_LINEAR},Y={[kJ]:t.NEVER,[PJ]:t.ALWAYS,[DJ]:t.LESS,[FP]:t.LEQUAL,[OJ]:t.EQUAL,[LJ]:t.GEQUAL,[IJ]:t.GREATER,[NJ]:t.NOTEQUAL};function Z(ie,K){if(K.type===yr&&e.has("OES_texture_float_linear")===!1&&(K.magFilter===Hi||K.magFilter===b0||K.magFilter===rm||K.magFilter===mc||K.minFilter===Hi||K.minFilter===b0||K.minFilter===rm||K.minFilter===mc)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(ie,t.TEXTURE_WRAP_S,W[K.wrapS]),t.texParameteri(ie,t.TEXTURE_WRAP_T,W[K.wrapT]),(ie===t.TEXTURE_3D||ie===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ie,t.TEXTURE_WRAP_R,W[K.wrapR]),t.texParameteri(ie,t.TEXTURE_MAG_FILTER,F[K.magFilter]),t.texParameteri(ie,t.TEXTURE_MIN_FILTER,F[K.minFilter]),K.compareFunction&&(t.texParameteri(ie,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(ie,t.TEXTURE_COMPARE_FUNC,Y[K.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(K.magFilter===is||K.minFilter!==rm&&K.minFilter!==mc||K.type===yr&&e.has("OES_texture_float_linear")===!1)return;if(K.anisotropy>1||i.get(K).__currentAnisotropy){const ce=e.get("EXT_texture_filter_anisotropic");t.texParameterf(ie,ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(K.anisotropy,r.getMaxAnisotropy())),i.get(K).__currentAnisotropy=K.anisotropy}}}function V(ie,K){let ce=!1;ie.__webglInit===void 0&&(ie.__webglInit=!0,K.addEventListener("dispose",S));const fe=K.source;let me=h.get(fe);me===void 0&&(me={},h.set(fe,me));const $=z(K);if($!==ie.__cacheKey){me[$]===void 0&&(me[$]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,ce=!0),me[$].usedTimes++;const Le=me[ie.__cacheKey];Le!==void 0&&(me[ie.__cacheKey].usedTimes--,Le.usedTimes===0&&D(K)),ie.__cacheKey=$,ie.__webglTexture=me[$].texture}return ce}function de(ie,K,ce){return Math.floor(Math.floor(ie/ce)/K)}function se(ie,K,ce,fe){const $=ie.updateRanges;if($.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,K.width,K.height,ce,fe,K.data);else{$.sort((Je,tt)=>Je.start-tt.start);let Le=0;for(let Je=1;Je<$.length;Je++){const tt=$[Le],xt=$[Je],Tt=tt.start+tt.count,bt=de(xt.start,K.width,4),Rt=de(tt.start,K.width,4);xt.start<=Tt+1&&bt===Rt&&de(xt.start+xt.count-1,K.width,4)===bt?tt.count=Math.max(tt.count,xt.start+xt.count-tt.start):(++Le,$[Le]=xt)}$.length=Le+1;const Xe=t.getParameter(t.UNPACK_ROW_LENGTH),mt=t.getParameter(t.UNPACK_SKIP_PIXELS),Ge=t.getParameter(t.UNPACK_SKIP_ROWS);t.pixelStorei(t.UNPACK_ROW_LENGTH,K.width);for(let Je=0,tt=$.length;Je<tt;Je++){const xt=$[Je],Tt=Math.floor(xt.start/4),bt=Math.ceil(xt.count/4),Rt=Tt%K.width,Oe=Math.floor(Tt/K.width),Ve=bt,ht=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,Rt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Oe),n.texSubImage2D(t.TEXTURE_2D,0,Rt,Oe,Ve,ht,ce,fe,K.data)}ie.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,Xe),t.pixelStorei(t.UNPACK_SKIP_PIXELS,mt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Ge)}}function oe(ie,K,ce){let fe=t.TEXTURE_2D;(K.isDataArrayTexture||K.isCompressedArrayTexture)&&(fe=t.TEXTURE_2D_ARRAY),K.isData3DTexture&&(fe=t.TEXTURE_3D);const me=V(ie,K),$=K.source;n.bindTexture(fe,ie.__webglTexture,t.TEXTURE0+ce);const Le=i.get($);if($.version!==Le.__version||me===!0){n.activeTexture(t.TEXTURE0+ce);const Xe=pi.getPrimaries(pi.workingColorSpace),mt=K.colorSpace===tu?null:pi.getPrimaries(K.colorSpace),Ge=K.colorSpace===tu||Xe===mt?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,K.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,K.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ge);let Je=b(K.image,!1,r.maxTextureSize);Je=He(K,Je);const tt=a.convert(K.format,K.colorSpace),xt=a.convert(K.type);let Tt=_(K.internalFormat,tt,xt,K.colorSpace,K.isVideoTexture);Z(fe,K);let bt;const Rt=K.mipmaps,Oe=K.isVideoTexture!==!0,Ve=Le.__version===void 0||me===!0,ht=$.dataReady,Ft=M(K,Je);if(K.isDepthTexture)Tt=w(K.format===Z0,K.type),Ve&&(Oe?n.texStorage2D(t.TEXTURE_2D,1,Tt,Je.width,Je.height):n.texImage2D(t.TEXTURE_2D,0,Tt,Je.width,Je.height,0,tt,xt,null));else if(K.isDataTexture)if(Rt.length>0){Oe&&Ve&&n.texStorage2D(t.TEXTURE_2D,Ft,Tt,Rt[0].width,Rt[0].height);for(let st=0,it=Rt.length;st<it;st++)bt=Rt[st],Oe?ht&&n.texSubImage2D(t.TEXTURE_2D,st,0,0,bt.width,bt.height,tt,xt,bt.data):n.texImage2D(t.TEXTURE_2D,st,Tt,bt.width,bt.height,0,tt,xt,bt.data);K.generateMipmaps=!1}else Oe?(Ve&&n.texStorage2D(t.TEXTURE_2D,Ft,Tt,Je.width,Je.height),ht&&se(K,Je,tt,xt)):n.texImage2D(t.TEXTURE_2D,0,Tt,Je.width,Je.height,0,tt,xt,Je.data);else if(K.isCompressedTexture)if(K.isCompressedArrayTexture){Oe&&Ve&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ft,Tt,Rt[0].width,Rt[0].height,Je.depth);for(let st=0,it=Rt.length;st<it;st++)if(bt=Rt[st],K.format!==$r)if(tt!==null)if(Oe){if(ht)if(K.layerUpdates.size>0){const vt=nI(bt.width,bt.height,K.format,K.type);for(const Kt of K.layerUpdates){const Xt=bt.data.subarray(Kt*vt/bt.data.BYTES_PER_ELEMENT,(Kt+1)*vt/bt.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,st,0,0,Kt,bt.width,bt.height,1,tt,Xt)}K.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,st,0,0,0,bt.width,bt.height,Je.depth,tt,bt.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,st,Tt,bt.width,bt.height,Je.depth,0,bt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Oe?ht&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,st,0,0,0,bt.width,bt.height,Je.depth,tt,xt,bt.data):n.texImage3D(t.TEXTURE_2D_ARRAY,st,Tt,bt.width,bt.height,Je.depth,0,tt,xt,bt.data)}else{Oe&&Ve&&n.texStorage2D(t.TEXTURE_2D,Ft,Tt,Rt[0].width,Rt[0].height);for(let st=0,it=Rt.length;st<it;st++)bt=Rt[st],K.format!==$r?tt!==null?Oe?ht&&n.compressedTexSubImage2D(t.TEXTURE_2D,st,0,0,bt.width,bt.height,tt,bt.data):n.compressedTexImage2D(t.TEXTURE_2D,st,Tt,bt.width,bt.height,0,bt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Oe?ht&&n.texSubImage2D(t.TEXTURE_2D,st,0,0,bt.width,bt.height,tt,xt,bt.data):n.texImage2D(t.TEXTURE_2D,st,Tt,bt.width,bt.height,0,tt,xt,bt.data)}else if(K.isDataArrayTexture)if(Oe){if(Ve&&n.texStorage3D(t.TEXTURE_2D_ARRAY,Ft,Tt,Je.width,Je.height,Je.depth),ht)if(K.layerUpdates.size>0){const st=nI(Je.width,Je.height,K.format,K.type);for(const it of K.layerUpdates){const vt=Je.data.subarray(it*st/Je.data.BYTES_PER_ELEMENT,(it+1)*st/Je.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,it,Je.width,Je.height,1,tt,xt,vt)}K.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Je.width,Je.height,Je.depth,tt,xt,Je.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Tt,Je.width,Je.height,Je.depth,0,tt,xt,Je.data);else if(K.isData3DTexture)Oe?(Ve&&n.texStorage3D(t.TEXTURE_3D,Ft,Tt,Je.width,Je.height,Je.depth),ht&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Je.width,Je.height,Je.depth,tt,xt,Je.data)):n.texImage3D(t.TEXTURE_3D,0,Tt,Je.width,Je.height,Je.depth,0,tt,xt,Je.data);else if(K.isFramebufferTexture){if(Ve)if(Oe)n.texStorage2D(t.TEXTURE_2D,Ft,Tt,Je.width,Je.height);else{let st=Je.width,it=Je.height;for(let vt=0;vt<Ft;vt++)n.texImage2D(t.TEXTURE_2D,vt,Tt,st,it,0,tt,xt,null),st>>=1,it>>=1}}else if(Rt.length>0){if(Oe&&Ve){const st=$e(Rt[0]);n.texStorage2D(t.TEXTURE_2D,Ft,Tt,st.width,st.height)}for(let st=0,it=Rt.length;st<it;st++)bt=Rt[st],Oe?ht&&n.texSubImage2D(t.TEXTURE_2D,st,0,0,tt,xt,bt):n.texImage2D(t.TEXTURE_2D,st,Tt,tt,xt,bt);K.generateMipmaps=!1}else if(Oe){if(Ve){const st=$e(Je);n.texStorage2D(t.TEXTURE_2D,Ft,Tt,st.width,st.height)}ht&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,tt,xt,Je)}else n.texImage2D(t.TEXTURE_2D,0,Tt,tt,xt,Je);y(K)&&p(fe),Le.__version=$.version,K.onUpdate&&K.onUpdate(K)}ie.__version=K.version}function ue(ie,K,ce){if(K.image.length!==6)return;const fe=V(ie,K),me=K.source;n.bindTexture(t.TEXTURE_CUBE_MAP,ie.__webglTexture,t.TEXTURE0+ce);const $=i.get(me);if(me.version!==$.__version||fe===!0){n.activeTexture(t.TEXTURE0+ce);const Le=pi.getPrimaries(pi.workingColorSpace),Xe=K.colorSpace===tu?null:pi.getPrimaries(K.colorSpace),mt=K.colorSpace===tu||Le===Xe?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,K.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,K.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,mt);const Ge=K.isCompressedTexture||K.image[0].isCompressedTexture,Je=K.image[0]&&K.image[0].isDataTexture,tt=[];for(let it=0;it<6;it++)!Ge&&!Je?tt[it]=b(K.image[it],!0,r.maxCubemapSize):tt[it]=Je?K.image[it].image:K.image[it],tt[it]=He(K,tt[it]);const xt=tt[0],Tt=a.convert(K.format,K.colorSpace),bt=a.convert(K.type),Rt=_(K.internalFormat,Tt,bt,K.colorSpace),Oe=K.isVideoTexture!==!0,Ve=$.__version===void 0||fe===!0,ht=me.dataReady;let Ft=M(K,xt);Z(t.TEXTURE_CUBE_MAP,K);let st;if(Ge){Oe&&Ve&&n.texStorage2D(t.TEXTURE_CUBE_MAP,Ft,Rt,xt.width,xt.height);for(let it=0;it<6;it++){st=tt[it].mipmaps;for(let vt=0;vt<st.length;vt++){const Kt=st[vt];K.format!==$r?Tt!==null?Oe?ht&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,vt,0,0,Kt.width,Kt.height,Tt,Kt.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,vt,Rt,Kt.width,Kt.height,0,Kt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Oe?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,vt,0,0,Kt.width,Kt.height,Tt,bt,Kt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,vt,Rt,Kt.width,Kt.height,0,Tt,bt,Kt.data)}}}else{if(st=K.mipmaps,Oe&&Ve){st.length>0&&Ft++;const it=$e(tt[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,Ft,Rt,it.width,it.height)}for(let it=0;it<6;it++)if(Je){Oe?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,tt[it].width,tt[it].height,Tt,bt,tt[it].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,Rt,tt[it].width,tt[it].height,0,Tt,bt,tt[it].data);for(let vt=0;vt<st.length;vt++){const Xt=st[vt].image[it].image;Oe?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,vt+1,0,0,Xt.width,Xt.height,Tt,bt,Xt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,vt+1,Rt,Xt.width,Xt.height,0,Tt,bt,Xt.data)}}else{Oe?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,Tt,bt,tt[it]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,Rt,Tt,bt,tt[it]);for(let vt=0;vt<st.length;vt++){const Kt=st[vt];Oe?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,vt+1,0,0,Tt,bt,Kt.image[it]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,vt+1,Rt,Tt,bt,Kt.image[it])}}}y(K)&&p(t.TEXTURE_CUBE_MAP),$.__version=me.version,K.onUpdate&&K.onUpdate(K)}ie.__version=K.version}function _e(ie,K,ce,fe,me,$){const Le=a.convert(ce.format,ce.colorSpace),Xe=a.convert(ce.type),mt=_(ce.internalFormat,Le,Xe,ce.colorSpace),Ge=i.get(K),Je=i.get(ce);if(Je.__renderTarget=K,!Ge.__hasExternalTextures){const tt=Math.max(1,K.width>>$),xt=Math.max(1,K.height>>$);me===t.TEXTURE_3D||me===t.TEXTURE_2D_ARRAY?n.texImage3D(me,$,mt,tt,xt,K.depth,0,Le,Xe,null):n.texImage2D(me,$,mt,tt,xt,0,Le,Xe,null)}n.bindFramebuffer(t.FRAMEBUFFER,ie),Ae(K)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,fe,me,Je.__webglTexture,0,Te(K)):(me===t.TEXTURE_2D||me>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,fe,me,Je.__webglTexture,$),n.bindFramebuffer(t.FRAMEBUFFER,null)}function ke(ie,K,ce){if(t.bindRenderbuffer(t.RENDERBUFFER,ie),K.depthBuffer){const fe=K.depthTexture,me=fe&&fe.isDepthTexture?fe.type:null,$=w(K.stencilBuffer,me),Le=K.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Xe=Te(K);Ae(K)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Xe,$,K.width,K.height):ce?t.renderbufferStorageMultisample(t.RENDERBUFFER,Xe,$,K.width,K.height):t.renderbufferStorage(t.RENDERBUFFER,$,K.width,K.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Le,t.RENDERBUFFER,ie)}else{const fe=K.textures;for(let me=0;me<fe.length;me++){const $=fe[me],Le=a.convert($.format,$.colorSpace),Xe=a.convert($.type),mt=_($.internalFormat,Le,Xe,$.colorSpace),Ge=Te(K);ce&&Ae(K)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,Ge,mt,K.width,K.height):Ae(K)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Ge,mt,K.width,K.height):t.renderbufferStorage(t.RENDERBUFFER,mt,K.width,K.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function Ne(ie,K){if(K&&K.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,ie),!(K.depthTexture&&K.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const fe=i.get(K.depthTexture);fe.__renderTarget=K,(!fe.__webglTexture||K.depthTexture.image.width!==K.width||K.depthTexture.image.height!==K.height)&&(K.depthTexture.image.width=K.width,K.depthTexture.image.height=K.height,K.depthTexture.needsUpdate=!0),q(K.depthTexture,0);const me=fe.__webglTexture,$=Te(K);if(K.depthTexture.format===$0)Ae(K)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,me,0,$):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,me,0);else if(K.depthTexture.format===Z0)Ae(K)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,me,0,$):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,me,0);else throw new Error("Unknown depthTexture format")}function Ue(ie){const K=i.get(ie),ce=ie.isWebGLCubeRenderTarget===!0;if(K.__boundDepthTexture!==ie.depthTexture){const fe=ie.depthTexture;if(K.__depthDisposeCallback&&K.__depthDisposeCallback(),fe){const me=()=>{delete K.__boundDepthTexture,delete K.__depthDisposeCallback,fe.removeEventListener("dispose",me)};fe.addEventListener("dispose",me),K.__depthDisposeCallback=me}K.__boundDepthTexture=fe}if(ie.depthTexture&&!K.__autoAllocateDepthBuffer){if(ce)throw new Error("target.depthTexture not supported in Cube render targets");const fe=ie.texture.mipmaps;fe&&fe.length>0?Ne(K.__webglFramebuffer[0],ie):Ne(K.__webglFramebuffer,ie)}else if(ce){K.__webglDepthbuffer=[];for(let fe=0;fe<6;fe++)if(n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer[fe]),K.__webglDepthbuffer[fe]===void 0)K.__webglDepthbuffer[fe]=t.createRenderbuffer(),ke(K.__webglDepthbuffer[fe],ie,!1);else{const me=ie.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,$=K.__webglDepthbuffer[fe];t.bindRenderbuffer(t.RENDERBUFFER,$),t.framebufferRenderbuffer(t.FRAMEBUFFER,me,t.RENDERBUFFER,$)}}else{const fe=ie.texture.mipmaps;if(fe&&fe.length>0?n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer),K.__webglDepthbuffer===void 0)K.__webglDepthbuffer=t.createRenderbuffer(),ke(K.__webglDepthbuffer,ie,!1);else{const me=ie.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,$=K.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,$),t.framebufferRenderbuffer(t.FRAMEBUFFER,me,t.RENDERBUFFER,$)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function ze(ie,K,ce){const fe=i.get(ie);K!==void 0&&_e(fe.__webglFramebuffer,ie,ie.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ce!==void 0&&Ue(ie)}function pe(ie){const K=ie.texture,ce=i.get(ie),fe=i.get(K);ie.addEventListener("dispose",A);const me=ie.textures,$=ie.isWebGLCubeRenderTarget===!0,Le=me.length>1;if(Le||(fe.__webglTexture===void 0&&(fe.__webglTexture=t.createTexture()),fe.__version=K.version,s.memory.textures++),$){ce.__webglFramebuffer=[];for(let Xe=0;Xe<6;Xe++)if(K.mipmaps&&K.mipmaps.length>0){ce.__webglFramebuffer[Xe]=[];for(let mt=0;mt<K.mipmaps.length;mt++)ce.__webglFramebuffer[Xe][mt]=t.createFramebuffer()}else ce.__webglFramebuffer[Xe]=t.createFramebuffer()}else{if(K.mipmaps&&K.mipmaps.length>0){ce.__webglFramebuffer=[];for(let Xe=0;Xe<K.mipmaps.length;Xe++)ce.__webglFramebuffer[Xe]=t.createFramebuffer()}else ce.__webglFramebuffer=t.createFramebuffer();if(Le)for(let Xe=0,mt=me.length;Xe<mt;Xe++){const Ge=i.get(me[Xe]);Ge.__webglTexture===void 0&&(Ge.__webglTexture=t.createTexture(),s.memory.textures++)}if(ie.samples>0&&Ae(ie)===!1){ce.__webglMultisampledFramebuffer=t.createFramebuffer(),ce.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,ce.__webglMultisampledFramebuffer);for(let Xe=0;Xe<me.length;Xe++){const mt=me[Xe];ce.__webglColorRenderbuffer[Xe]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,ce.__webglColorRenderbuffer[Xe]);const Ge=a.convert(mt.format,mt.colorSpace),Je=a.convert(mt.type),tt=_(mt.internalFormat,Ge,Je,mt.colorSpace,ie.isXRRenderTarget===!0),xt=Te(ie);t.renderbufferStorageMultisample(t.RENDERBUFFER,xt,tt,ie.width,ie.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Xe,t.RENDERBUFFER,ce.__webglColorRenderbuffer[Xe])}t.bindRenderbuffer(t.RENDERBUFFER,null),ie.depthBuffer&&(ce.__webglDepthRenderbuffer=t.createRenderbuffer(),ke(ce.__webglDepthRenderbuffer,ie,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if($){n.bindTexture(t.TEXTURE_CUBE_MAP,fe.__webglTexture),Z(t.TEXTURE_CUBE_MAP,K);for(let Xe=0;Xe<6;Xe++)if(K.mipmaps&&K.mipmaps.length>0)for(let mt=0;mt<K.mipmaps.length;mt++)_e(ce.__webglFramebuffer[Xe][mt],ie,K,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,mt);else _e(ce.__webglFramebuffer[Xe],ie,K,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0);y(K)&&p(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(Le){for(let Xe=0,mt=me.length;Xe<mt;Xe++){const Ge=me[Xe],Je=i.get(Ge);let tt=t.TEXTURE_2D;(ie.isWebGL3DRenderTarget||ie.isWebGLArrayRenderTarget)&&(tt=ie.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(tt,Je.__webglTexture),Z(tt,Ge),_e(ce.__webglFramebuffer,ie,Ge,t.COLOR_ATTACHMENT0+Xe,tt,0),y(Ge)&&p(tt)}n.unbindTexture()}else{let Xe=t.TEXTURE_2D;if((ie.isWebGL3DRenderTarget||ie.isWebGLArrayRenderTarget)&&(Xe=ie.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Xe,fe.__webglTexture),Z(Xe,K),K.mipmaps&&K.mipmaps.length>0)for(let mt=0;mt<K.mipmaps.length;mt++)_e(ce.__webglFramebuffer[mt],ie,K,t.COLOR_ATTACHMENT0,Xe,mt);else _e(ce.__webglFramebuffer,ie,K,t.COLOR_ATTACHMENT0,Xe,0);y(K)&&p(Xe),n.unbindTexture()}ie.depthBuffer&&Ue(ie)}function Fe(ie){const K=ie.textures;for(let ce=0,fe=K.length;ce<fe;ce++){const me=K[ce];if(y(me)){const $=x(ie),Le=i.get(me).__webglTexture;n.bindTexture($,Le),p($),n.unbindTexture()}}}const Ie=[],qe=[];function we(ie){if(ie.samples>0){if(Ae(ie)===!1){const K=ie.textures,ce=ie.width,fe=ie.height;let me=t.COLOR_BUFFER_BIT;const $=ie.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Le=i.get(ie),Xe=K.length>1;if(Xe)for(let Ge=0;Ge<K.length;Ge++)n.bindFramebuffer(t.FRAMEBUFFER,Le.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,Le.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,Le.__webglMultisampledFramebuffer);const mt=ie.texture.mipmaps;mt&&mt.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Le.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Le.__webglFramebuffer);for(let Ge=0;Ge<K.length;Ge++){if(ie.resolveDepthBuffer&&(ie.depthBuffer&&(me|=t.DEPTH_BUFFER_BIT),ie.stencilBuffer&&ie.resolveStencilBuffer&&(me|=t.STENCIL_BUFFER_BIT)),Xe){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,Le.__webglColorRenderbuffer[Ge]);const Je=i.get(K[Ge]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Je,0)}t.blitFramebuffer(0,0,ce,fe,0,0,ce,fe,me,t.NEAREST),l===!0&&(Ie.length=0,qe.length=0,Ie.push(t.COLOR_ATTACHMENT0+Ge),ie.depthBuffer&&ie.resolveDepthBuffer===!1&&(Ie.push($),qe.push($),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,qe)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,Ie))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),Xe)for(let Ge=0;Ge<K.length;Ge++){n.bindFramebuffer(t.FRAMEBUFFER,Le.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.RENDERBUFFER,Le.__webglColorRenderbuffer[Ge]);const Je=i.get(K[Ge]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,Le.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.TEXTURE_2D,Je,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Le.__webglMultisampledFramebuffer)}else if(ie.depthBuffer&&ie.resolveDepthBuffer===!1&&l){const K=ie.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[K])}}}function Te(ie){return Math.min(r.maxSamples,ie.samples)}function Ae(ie){const K=i.get(ie);return ie.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&K.__useRenderToTexture!==!1}function Pe(ie){const K=s.render.frame;u.get(ie)!==K&&(u.set(ie,K),ie.update())}function He(ie,K){const ce=ie.colorSpace,fe=ie.format,me=ie.type;return ie.isCompressedTexture===!0||ie.isVideoTexture===!0||ce!==bu&&ce!==tu&&(pi.getTransfer(ce)===fr?(fe!==$r||me!==To)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ce)),K}function $e(ie){return typeof HTMLImageElement<"u"&&ie instanceof HTMLImageElement?(c.width=ie.naturalWidth||ie.width,c.height=ie.naturalHeight||ie.height):typeof VideoFrame<"u"&&ie instanceof VideoFrame?(c.width=ie.displayWidth,c.height=ie.displayHeight):(c.width=ie.width,c.height=ie.height),c}this.allocateTextureUnit=j,this.resetTextureUnits=U,this.setTexture2D=q,this.setTexture2DArray=B,this.setTexture3D=G,this.setTextureCube=H,this.rebindTextures=ze,this.setupRenderTarget=pe,this.updateRenderTargetMipmap=Fe,this.updateMultisampleRenderTarget=we,this.setupDepthRenderbuffer=Ue,this.setupFrameBufferTexture=_e,this.useMultisampledRTT=Ae}function gU(t,e){function n(i,r=tu){let a;const s=pi.getTransfer(r);if(i===To)return t.UNSIGNED_BYTE;if(i===FA)return t.UNSIGNED_SHORT_4_4_4_4;if(i===BA)return t.UNSIGNED_SHORT_5_5_5_1;if(i===DP)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===PA)return t.BYTE;if(i===UA)return t.SHORT;if(i===Y0)return t.UNSIGNED_SHORT;if(i===Bv)return t.INT;if(i===wc)return t.UNSIGNED_INT;if(i===yr)return t.FLOAT;if(i===ts)return t.HALF_FLOAT;if(i===OP)return t.ALPHA;if(i===IP)return t.RGB;if(i===$r)return t.RGBA;if(i===$0)return t.DEPTH_COMPONENT;if(i===Z0)return t.DEPTH_STENCIL;if(i===wh)return t.RED;if(i===zv)return t.RED_INTEGER;if(i===zA)return t.RG;if(i===P_)return t.RG_INTEGER;if(i===jv)return t.RGBA_INTEGER;if(i===$x||i===Zx||i===Qx||i===e1)if(s===fr)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(i===$x)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Zx)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Qx)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===e1)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(i===$x)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Zx)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Qx)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===e1)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===w2||i===E2||i===M2||i===T2)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(i===w2)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===E2)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===M2)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===T2)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===A2||i===C2||i===R2)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(i===A2||i===C2)return s===fr?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(i===R2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===k2||i===D2||i===O2||i===I2||i===N2||i===L2||i===P2||i===U2||i===F2||i===B2||i===z2||i===j2||i===H2||i===V2)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(i===k2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===D2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===O2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===I2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===N2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===L2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===P2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===U2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===F2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===B2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===z2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===j2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===H2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===V2)return s===fr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===t1||i===G2||i===W2)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(i===t1)return s===fr?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===G2)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===W2)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===NP||i===q2||i===X2||i===K2)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(i===t1)return a.COMPRESSED_RED_RGTC1_EXT;if(i===q2)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===X2)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===K2)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===J0?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}class U$ extends nr{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}}const cSe=`
void main() {

	gl_Position = vec4( position, 1.0 );

}`,uSe=`
uniform sampler2DArray depthColor;
uniform float depthWidth;
uniform float depthHeight;

void main() {

	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );

	if ( coord.x >= 1.0 ) {

		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;

	} else {

		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;

	}

}`;class fSe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new U$(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new ss({vertexShader:cSe,fragmentShader:uSe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new _i(new Ol(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class hSe extends df{constructor(e,n){super();const i=this;let r=null,a=1,s=null,o="local-floor",l=1,c=null,u=null,f=null,h=null,d=null,g=null;const b=new fSe,y={},p=n.getContextAttributes();let x=null,_=null;const w=[],M=[],S=new wt;let A=null;const C=new ta;C.viewport=new ei;const D=new ta;D.viewport=new ei;const R=[C,D],N=new w$;let U=null,j=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(se){let oe=w[se];return oe===void 0&&(oe=new hM,w[se]=oe),oe.getTargetRaySpace()},this.getControllerGrip=function(se){let oe=w[se];return oe===void 0&&(oe=new hM,w[se]=oe),oe.getGripSpace()},this.getHand=function(se){let oe=w[se];return oe===void 0&&(oe=new hM,w[se]=oe),oe.getHandSpace()};function z(se){const oe=M.indexOf(se.inputSource);if(oe===-1)return;const ue=w[oe];ue!==void 0&&(ue.update(se.inputSource,se.frame,c||s),ue.dispatchEvent({type:se.type,data:se.inputSource}))}function q(){r.removeEventListener("select",z),r.removeEventListener("selectstart",z),r.removeEventListener("selectend",z),r.removeEventListener("squeeze",z),r.removeEventListener("squeezestart",z),r.removeEventListener("squeezeend",z),r.removeEventListener("end",q),r.removeEventListener("inputsourceschange",B);for(let se=0;se<w.length;se++){const oe=M[se];oe!==null&&(M[se]=null,w[se].disconnect(oe))}U=null,j=null,b.reset();for(const se in y)delete y[se];e.setRenderTarget(x),d=null,h=null,f=null,r=null,_=null,de.stop(),i.isPresenting=!1,e.setPixelRatio(A),e.setSize(S.width,S.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(se){a=se,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(se){o=se,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||s},this.setReferenceSpace=function(se){c=se},this.getBaseLayer=function(){return h!==null?h:d},this.getBinding=function(){return f},this.getFrame=function(){return g},this.getSession=function(){return r},this.setSession=async function(se){if(r=se,r!==null){if(x=e.getRenderTarget(),r.addEventListener("select",z),r.addEventListener("selectstart",z),r.addEventListener("selectend",z),r.addEventListener("squeeze",z),r.addEventListener("squeezestart",z),r.addEventListener("squeezeend",z),r.addEventListener("end",q),r.addEventListener("inputsourceschange",B),p.xrCompatible!==!0&&await n.makeXRCompatible(),A=e.getPixelRatio(),e.getSize(S),typeof XRWebGLBinding<"u"&&(f=new XRWebGLBinding(r,n)),f!==null&&"createProjectionLayer"in XRWebGLBinding.prototype){let ue=null,_e=null,ke=null;p.depth&&(ke=p.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,ue=p.stencil?Z0:$0,_e=p.stencil?J0:wc);const Ne={colorFormat:n.RGBA8,depthFormat:ke,scaleFactor:a};h=f.createProjectionLayer(Ne),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),_=new Ec(h.textureWidth,h.textureHeight,{format:$r,type:To,depthTexture:new XP(h.textureWidth,h.textureHeight,_e,void 0,void 0,void 0,void 0,void 0,void 0,ue),stencilBuffer:p.stencil,colorSpace:e.outputColorSpace,samples:p.antialias?4:0,resolveDepthBuffer:h.ignoreDepthValues===!1,resolveStencilBuffer:h.ignoreDepthValues===!1})}else{const ue={antialias:p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:a};d=new XRWebGLLayer(r,n,ue),r.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),_=new Ec(d.framebufferWidth,d.framebufferHeight,{format:$r,type:To,colorSpace:e.outputColorSpace,stencilBuffer:p.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}_.isXRRenderTarget=!0,this.setFoveation(l),c=null,s=await r.requestReferenceSpace(o),de.setContext(r),de.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return b.getDepthTexture()};function B(se){for(let oe=0;oe<se.removed.length;oe++){const ue=se.removed[oe],_e=M.indexOf(ue);_e>=0&&(M[_e]=null,w[_e].disconnect(ue))}for(let oe=0;oe<se.added.length;oe++){const ue=se.added[oe];let _e=M.indexOf(ue);if(_e===-1){for(let Ne=0;Ne<w.length;Ne++)if(Ne>=M.length){M.push(ue),_e=Ne;break}else if(M[Ne]===null){M[Ne]=ue,_e=Ne;break}if(_e===-1)break}const ke=w[_e];ke&&ke.connect(ue)}}const G=new te,H=new te;function W(se,oe,ue){G.setFromMatrixPosition(oe.matrixWorld),H.setFromMatrixPosition(ue.matrixWorld);const _e=G.distanceTo(H),ke=oe.projectionMatrix.elements,Ne=ue.projectionMatrix.elements,Ue=ke[14]/(ke[10]-1),ze=ke[14]/(ke[10]+1),pe=(ke[9]+1)/ke[5],Fe=(ke[9]-1)/ke[5],Ie=(ke[8]-1)/ke[0],qe=(Ne[8]+1)/Ne[0],we=Ue*Ie,Te=Ue*qe,Ae=_e/(-Ie+qe),Pe=Ae*-Ie;if(oe.matrixWorld.decompose(se.position,se.quaternion,se.scale),se.translateX(Pe),se.translateZ(Ae),se.matrixWorld.compose(se.position,se.quaternion,se.scale),se.matrixWorldInverse.copy(se.matrixWorld).invert(),ke[10]===-1)se.projectionMatrix.copy(oe.projectionMatrix),se.projectionMatrixInverse.copy(oe.projectionMatrixInverse);else{const He=Ue+Ae,$e=ze+Ae,ie=we-Pe,K=Te+(_e-Pe),ce=pe*ze/$e*He,fe=Fe*ze/$e*He;se.projectionMatrix.makePerspective(ie,K,ce,fe,He,$e),se.projectionMatrixInverse.copy(se.projectionMatrix).invert()}}function F(se,oe){oe===null?se.matrixWorld.copy(se.matrix):se.matrixWorld.multiplyMatrices(oe.matrixWorld,se.matrix),se.matrixWorldInverse.copy(se.matrixWorld).invert()}this.updateCamera=function(se){if(r===null)return;let oe=se.near,ue=se.far;b.texture!==null&&(b.depthNear>0&&(oe=b.depthNear),b.depthFar>0&&(ue=b.depthFar)),N.near=D.near=C.near=oe,N.far=D.far=C.far=ue,(U!==N.near||j!==N.far)&&(r.updateRenderState({depthNear:N.near,depthFar:N.far}),U=N.near,j=N.far),N.layers.mask=se.layers.mask|6,C.layers.mask=N.layers.mask&3,D.layers.mask=N.layers.mask&5;const _e=se.parent,ke=N.cameras;F(N,_e);for(let Ne=0;Ne<ke.length;Ne++)F(ke[Ne],_e);ke.length===2?W(N,C,D):N.projectionMatrix.copy(C.projectionMatrix),Y(se,N,_e)};function Y(se,oe,ue){ue===null?se.matrix.copy(oe.matrixWorld):(se.matrix.copy(ue.matrixWorld),se.matrix.invert(),se.matrix.multiply(oe.matrixWorld)),se.matrix.decompose(se.position,se.quaternion,se.scale),se.updateMatrixWorld(!0),se.projectionMatrix.copy(oe.projectionMatrix),se.projectionMatrixInverse.copy(oe.projectionMatrixInverse),se.isPerspectiveCamera&&(se.fov=nv*2*Math.atan(1/se.projectionMatrix.elements[5]),se.zoom=1)}this.getCamera=function(){return N},this.getFoveation=function(){if(!(h===null&&d===null))return l},this.setFoveation=function(se){l=se,h!==null&&(h.fixedFoveation=se),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=se)},this.hasDepthSensing=function(){return b.texture!==null},this.getDepthSensingMesh=function(){return b.getMesh(N)},this.getCameraTexture=function(se){return y[se]};let Z=null;function V(se,oe){if(u=oe.getViewerPose(c||s),g=oe,u!==null){const ue=u.views;d!==null&&(e.setRenderTargetFramebuffer(_,d.framebuffer),e.setRenderTarget(_));let _e=!1;ue.length!==N.cameras.length&&(N.cameras.length=0,_e=!0);for(let ze=0;ze<ue.length;ze++){const pe=ue[ze];let Fe=null;if(d!==null)Fe=d.getViewport(pe);else{const qe=f.getViewSubImage(h,pe);Fe=qe.viewport,ze===0&&(e.setRenderTargetTextures(_,qe.colorTexture,qe.depthStencilTexture),e.setRenderTarget(_))}let Ie=R[ze];Ie===void 0&&(Ie=new ta,Ie.layers.enable(ze),Ie.viewport=new ei,R[ze]=Ie),Ie.matrix.fromArray(pe.transform.matrix),Ie.matrix.decompose(Ie.position,Ie.quaternion,Ie.scale),Ie.projectionMatrix.fromArray(pe.projectionMatrix),Ie.projectionMatrixInverse.copy(Ie.projectionMatrix).invert(),Ie.viewport.set(Fe.x,Fe.y,Fe.width,Fe.height),ze===0&&(N.matrix.copy(Ie.matrix),N.matrix.decompose(N.position,N.quaternion,N.scale)),_e===!0&&N.cameras.push(Ie)}const ke=r.enabledFeatures;if(ke&&ke.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&f){const ze=f.getDepthInformation(ue[0]);ze&&ze.isValid&&ze.texture&&b.init(ze,r.renderState)}if(ke&&ke.includes("camera-access")&&(e.state.unbindTexture(),f))for(let ze=0;ze<ue.length;ze++){const pe=ue[ze].camera;if(pe){let Fe=y[pe];Fe||(Fe=new U$,y[pe]=Fe);const Ie=f.getCameraImage(pe);Fe.sourceTexture=Ie}}}for(let ue=0;ue<w.length;ue++){const _e=M[ue],ke=w[ue];_e!==null&&ke!==void 0&&ke.update(_e,oe,c||s)}Z&&Z(se,oe),oe.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:oe}),g=null}const de=new O$;de.setAnimationLoop(V),this.setAnimationLoop=function(se){Z=se},this.dispose=function(){}}}const Op=new mi,dSe=new Ot;function pSe(t,e){function n(y,p){y.matrixAutoUpdate===!0&&y.updateMatrix(),p.value.copy(y.matrix)}function i(y,p){p.color.getRGB(y.fogColor.value,HJ(t)),p.isFog?(y.fogNear.value=p.near,y.fogFar.value=p.far):p.isFogExp2&&(y.fogDensity.value=p.density)}function r(y,p,x,_,w){p.isMeshBasicMaterial||p.isMeshLambertMaterial?a(y,p):p.isMeshToonMaterial?(a(y,p),f(y,p)):p.isMeshPhongMaterial?(a(y,p),u(y,p)):p.isMeshStandardMaterial?(a(y,p),h(y,p),p.isMeshPhysicalMaterial&&d(y,p,w)):p.isMeshMatcapMaterial?(a(y,p),g(y,p)):p.isMeshDepthMaterial?a(y,p):p.isMeshDistanceMaterial?(a(y,p),b(y,p)):p.isMeshNormalMaterial?a(y,p):p.isLineBasicMaterial?(s(y,p),p.isLineDashedMaterial&&o(y,p)):p.isPointsMaterial?l(y,p,x,_):p.isSpriteMaterial?c(y,p):p.isShadowMaterial?(y.color.value.copy(p.color),y.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function a(y,p){y.opacity.value=p.opacity,p.color&&y.diffuse.value.copy(p.color),p.emissive&&y.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(y.map.value=p.map,n(p.map,y.mapTransform)),p.alphaMap&&(y.alphaMap.value=p.alphaMap,n(p.alphaMap,y.alphaMapTransform)),p.bumpMap&&(y.bumpMap.value=p.bumpMap,n(p.bumpMap,y.bumpMapTransform),y.bumpScale.value=p.bumpScale,p.side===Ra&&(y.bumpScale.value*=-1)),p.normalMap&&(y.normalMap.value=p.normalMap,n(p.normalMap,y.normalMapTransform),y.normalScale.value.copy(p.normalScale),p.side===Ra&&y.normalScale.value.negate()),p.displacementMap&&(y.displacementMap.value=p.displacementMap,n(p.displacementMap,y.displacementMapTransform),y.displacementScale.value=p.displacementScale,y.displacementBias.value=p.displacementBias),p.emissiveMap&&(y.emissiveMap.value=p.emissiveMap,n(p.emissiveMap,y.emissiveMapTransform)),p.specularMap&&(y.specularMap.value=p.specularMap,n(p.specularMap,y.specularMapTransform)),p.alphaTest>0&&(y.alphaTest.value=p.alphaTest);const x=e.get(p),_=x.envMap,w=x.envMapRotation;_&&(y.envMap.value=_,Op.copy(w),Op.x*=-1,Op.y*=-1,Op.z*=-1,_.isCubeTexture&&_.isRenderTargetTexture===!1&&(Op.y*=-1,Op.z*=-1),y.envMapRotation.value.setFromMatrix4(dSe.makeRotationFromEuler(Op)),y.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=p.reflectivity,y.ior.value=p.ior,y.refractionRatio.value=p.refractionRatio),p.lightMap&&(y.lightMap.value=p.lightMap,y.lightMapIntensity.value=p.lightMapIntensity,n(p.lightMap,y.lightMapTransform)),p.aoMap&&(y.aoMap.value=p.aoMap,y.aoMapIntensity.value=p.aoMapIntensity,n(p.aoMap,y.aoMapTransform))}function s(y,p){y.diffuse.value.copy(p.color),y.opacity.value=p.opacity,p.map&&(y.map.value=p.map,n(p.map,y.mapTransform))}function o(y,p){y.dashSize.value=p.dashSize,y.totalSize.value=p.dashSize+p.gapSize,y.scale.value=p.scale}function l(y,p,x,_){y.diffuse.value.copy(p.color),y.opacity.value=p.opacity,y.size.value=p.size*x,y.scale.value=_*.5,p.map&&(y.map.value=p.map,n(p.map,y.uvTransform)),p.alphaMap&&(y.alphaMap.value=p.alphaMap,n(p.alphaMap,y.alphaMapTransform)),p.alphaTest>0&&(y.alphaTest.value=p.alphaTest)}function c(y,p){y.diffuse.value.copy(p.color),y.opacity.value=p.opacity,y.rotation.value=p.rotation,p.map&&(y.map.value=p.map,n(p.map,y.mapTransform)),p.alphaMap&&(y.alphaMap.value=p.alphaMap,n(p.alphaMap,y.alphaMapTransform)),p.alphaTest>0&&(y.alphaTest.value=p.alphaTest)}function u(y,p){y.specular.value.copy(p.specular),y.shininess.value=Math.max(p.shininess,1e-4)}function f(y,p){p.gradientMap&&(y.gradientMap.value=p.gradientMap)}function h(y,p){y.metalness.value=p.metalness,p.metalnessMap&&(y.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,y.metalnessMapTransform)),y.roughness.value=p.roughness,p.roughnessMap&&(y.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,y.roughnessMapTransform)),p.envMap&&(y.envMapIntensity.value=p.envMapIntensity)}function d(y,p,x){y.ior.value=p.ior,p.sheen>0&&(y.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),y.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(y.sheenColorMap.value=p.sheenColorMap,n(p.sheenColorMap,y.sheenColorMapTransform)),p.sheenRoughnessMap&&(y.sheenRoughnessMap.value=p.sheenRoughnessMap,n(p.sheenRoughnessMap,y.sheenRoughnessMapTransform))),p.clearcoat>0&&(y.clearcoat.value=p.clearcoat,y.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(y.clearcoatMap.value=p.clearcoatMap,n(p.clearcoatMap,y.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,n(p.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(y.clearcoatNormalMap.value=p.clearcoatNormalMap,n(p.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Ra&&y.clearcoatNormalScale.value.negate())),p.dispersion>0&&(y.dispersion.value=p.dispersion),p.iridescence>0&&(y.iridescence.value=p.iridescence,y.iridescenceIOR.value=p.iridescenceIOR,y.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(y.iridescenceMap.value=p.iridescenceMap,n(p.iridescenceMap,y.iridescenceMapTransform)),p.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=p.iridescenceThicknessMap,n(p.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),p.transmission>0&&(y.transmission.value=p.transmission,y.transmissionSamplerMap.value=x.texture,y.transmissionSamplerSize.value.set(x.width,x.height),p.transmissionMap&&(y.transmissionMap.value=p.transmissionMap,n(p.transmissionMap,y.transmissionMapTransform)),y.thickness.value=p.thickness,p.thicknessMap&&(y.thicknessMap.value=p.thicknessMap,n(p.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=p.attenuationDistance,y.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(y.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(y.anisotropyMap.value=p.anisotropyMap,n(p.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=p.specularIntensity,y.specularColor.value.copy(p.specularColor),p.specularColorMap&&(y.specularColorMap.value=p.specularColorMap,n(p.specularColorMap,y.specularColorMapTransform)),p.specularIntensityMap&&(y.specularIntensityMap.value=p.specularIntensityMap,n(p.specularIntensityMap,y.specularIntensityMapTransform))}function g(y,p){p.matcap&&(y.matcap.value=p.matcap)}function b(y,p){const x=e.get(p).light;y.referencePosition.value.setFromMatrixPosition(x.matrixWorld),y.nearDistance.value=x.shadow.camera.near,y.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function mSe(t,e,n,i){let r={},a={},s=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,_){const w=_.program;i.uniformBlockBinding(x,w)}function c(x,_){let w=r[x.id];w===void 0&&(g(x),w=u(x),r[x.id]=w,x.addEventListener("dispose",y));const M=_.program;i.updateUBOMapping(x,M);const S=e.render.frame;a[x.id]!==S&&(h(x),a[x.id]=S)}function u(x){const _=f();x.__bindingPointIndex=_;const w=t.createBuffer(),M=x.__size,S=x.usage;return t.bindBuffer(t.UNIFORM_BUFFER,w),t.bufferData(t.UNIFORM_BUFFER,M,S),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,_,w),w}function f(){for(let x=0;x<o;x++)if(s.indexOf(x)===-1)return s.push(x),x;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function h(x){const _=r[x.id],w=x.uniforms,M=x.__cache;t.bindBuffer(t.UNIFORM_BUFFER,_);for(let S=0,A=w.length;S<A;S++){const C=Array.isArray(w[S])?w[S]:[w[S]];for(let D=0,R=C.length;D<R;D++){const N=C[D];if(d(N,S,D,M)===!0){const U=N.__offset,j=Array.isArray(N.value)?N.value:[N.value];let z=0;for(let q=0;q<j.length;q++){const B=j[q],G=b(B);typeof B=="number"||typeof B=="boolean"?(N.__data[0]=B,t.bufferSubData(t.UNIFORM_BUFFER,U+z,N.__data)):B.isMatrix3?(N.__data[0]=B.elements[0],N.__data[1]=B.elements[1],N.__data[2]=B.elements[2],N.__data[3]=0,N.__data[4]=B.elements[3],N.__data[5]=B.elements[4],N.__data[6]=B.elements[5],N.__data[7]=0,N.__data[8]=B.elements[6],N.__data[9]=B.elements[7],N.__data[10]=B.elements[8],N.__data[11]=0):(B.toArray(N.__data,z),z+=G.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,U,N.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function d(x,_,w,M){const S=x.value,A=_+"_"+w;if(M[A]===void 0)return typeof S=="number"||typeof S=="boolean"?M[A]=S:M[A]=S.clone(),!0;{const C=M[A];if(typeof S=="number"||typeof S=="boolean"){if(C!==S)return M[A]=S,!0}else if(C.equals(S)===!1)return C.copy(S),!0}return!1}function g(x){const _=x.uniforms;let w=0;const M=16;for(let A=0,C=_.length;A<C;A++){const D=Array.isArray(_[A])?_[A]:[_[A]];for(let R=0,N=D.length;R<N;R++){const U=D[R],j=Array.isArray(U.value)?U.value:[U.value];for(let z=0,q=j.length;z<q;z++){const B=j[z],G=b(B),H=w%M,W=H%G.boundary,F=H+W;w+=W,F!==0&&M-F<G.storage&&(w+=M-F),U.__data=new Float32Array(G.storage/Float32Array.BYTES_PER_ELEMENT),U.__offset=w,w+=G.storage}}}const S=w%M;return S>0&&(w+=M-S),x.__size=w,x.__cache={},this}function b(x){const _={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(_.boundary=4,_.storage=4):x.isVector2?(_.boundary=8,_.storage=8):x.isVector3||x.isColor?(_.boundary=16,_.storage=12):x.isVector4?(_.boundary=16,_.storage=16):x.isMatrix3?(_.boundary=48,_.storage=48):x.isMatrix4?(_.boundary=64,_.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),_}function y(x){const _=x.target;_.removeEventListener("dispose",y);const w=s.indexOf(_.__bindingPointIndex);s.splice(w,1),t.deleteBuffer(r[_.id]),delete r[_.id],delete a[_.id]}function p(){for(const x in r)t.deleteBuffer(r[x]);s=[],r={},a={}}return{bind:l,update:c,dispose:p}}class bU{constructor(e={}){const{canvas:n=FJ(),context:i=null,depth:r=!0,stencil:a=!1,alpha:s=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1,reversedDepthBuffer:h=!1}=e;this.isWebGLRenderer=!0;let d;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=i.getContextAttributes().alpha}else d=s;const g=new Uint32Array(4),b=new Int32Array(4);let y=null,p=null;const x=[],_=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Qu,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const w=this;let M=!1;this._outputColorSpace=Es;let S=0,A=0,C=null,D=-1,R=null;const N=new ei,U=new ei;let j=null;const z=new Ut(0);let q=0,B=n.width,G=n.height,H=1,W=null,F=null;const Y=new ei(0,0,B,G),Z=new ei(0,0,B,G);let V=!1;const de=new Kd;let se=!1,oe=!1;const ue=new Ot,_e=new te,ke=new ei,Ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Ue=!1;function ze(){return C===null?H:1}let pe=i;function Fe(ee,ye){return n.getContext(ee,ye)}try{const ee={alpha:!0,depth:r,stencil:a,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Uv}`),n.addEventListener("webglcontextlost",ht,!1),n.addEventListener("webglcontextrestored",Ft,!1),n.addEventListener("webglcontextcreationerror",st,!1),pe===null){const ye="webgl2";if(pe=Fe(ye,ee),pe===null)throw Fe(ye)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(ee){throw console.error("THREE.WebGLRenderer: "+ee.message),ee}let Ie,qe,we,Te,Ae,Pe,He,$e,ie,K,ce,fe,me,$,Le,Xe,mt,Ge,Je,tt,xt,Tt,bt,Rt;function Oe(){Ie=new A1e(pe),Ie.init(),Tt=new gU(pe,Ie),qe=new x1e(pe,Ie,e,Tt),we=new oSe(pe,Ie),qe.reversedDepthBuffer&&h&&we.buffers.depth.setReversed(!0),Te=new k1e(pe),Ae=new K_e,Pe=new lSe(pe,Ie,we,Ae,qe,Tt,Te),He=new S1e(w),$e=new T1e(w),ie=new Pve(pe),bt=new v1e(pe,ie),K=new C1e(pe,ie,Te,bt),ce=new O1e(pe,K,ie,Te),Je=new D1e(pe,qe,Pe),Xe=new _1e(Ae),fe=new X_e(w,He,$e,Ie,qe,bt,Xe),me=new pSe(w,Ae),$=new J_e,Le=new nSe(Ie),Ge=new b1e(w,He,$e,we,ce,d,l),mt=new aSe(w,ce,qe),Rt=new mSe(pe,Te,qe,we),tt=new y1e(pe,Ie,Te),xt=new R1e(pe,Ie,Te),Te.programs=fe.programs,w.capabilities=qe,w.extensions=Ie,w.properties=Ae,w.renderLists=$,w.shadowMap=mt,w.state=we,w.info=Te}Oe();const Ve=new hSe(w,pe);this.xr=Ve,this.getContext=function(){return pe},this.getContextAttributes=function(){return pe.getContextAttributes()},this.forceContextLoss=function(){const ee=Ie.get("WEBGL_lose_context");ee&&ee.loseContext()},this.forceContextRestore=function(){const ee=Ie.get("WEBGL_lose_context");ee&&ee.restoreContext()},this.getPixelRatio=function(){return H},this.setPixelRatio=function(ee){ee!==void 0&&(H=ee,this.setSize(B,G,!1))},this.getSize=function(ee){return ee.set(B,G)},this.setSize=function(ee,ye,Ce=!0){if(Ve.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}B=ee,G=ye,n.width=Math.floor(ee*H),n.height=Math.floor(ye*H),Ce===!0&&(n.style.width=ee+"px",n.style.height=ye+"px"),this.setViewport(0,0,ee,ye)},this.getDrawingBufferSize=function(ee){return ee.set(B*H,G*H).floor()},this.setDrawingBufferSize=function(ee,ye,Ce){B=ee,G=ye,H=Ce,n.width=Math.floor(ee*Ce),n.height=Math.floor(ye*Ce),this.setViewport(0,0,ee,ye)},this.getCurrentViewport=function(ee){return ee.copy(N)},this.getViewport=function(ee){return ee.copy(Y)},this.setViewport=function(ee,ye,Ce,De){ee.isVector4?Y.set(ee.x,ee.y,ee.z,ee.w):Y.set(ee,ye,Ce,De),we.viewport(N.copy(Y).multiplyScalar(H).round())},this.getScissor=function(ee){return ee.copy(Z)},this.setScissor=function(ee,ye,Ce,De){ee.isVector4?Z.set(ee.x,ee.y,ee.z,ee.w):Z.set(ee,ye,Ce,De),we.scissor(U.copy(Z).multiplyScalar(H).round())},this.getScissorTest=function(){return V},this.setScissorTest=function(ee){we.setScissorTest(V=ee)},this.setOpaqueSort=function(ee){W=ee},this.setTransparentSort=function(ee){F=ee},this.getClearColor=function(ee){return ee.copy(Ge.getClearColor())},this.setClearColor=function(){Ge.setClearColor(...arguments)},this.getClearAlpha=function(){return Ge.getClearAlpha()},this.setClearAlpha=function(){Ge.setClearAlpha(...arguments)},this.clear=function(ee=!0,ye=!0,Ce=!0){let De=0;if(ee){let ve=!1;if(C!==null){const _t=C.texture.format;ve=_t===jv||_t===P_||_t===zv}if(ve){const _t=C.texture.type,lt=_t===To||_t===wc||_t===Y0||_t===J0||_t===FA||_t===BA,yt=Ge.getClearColor(),St=Ge.getClearAlpha(),Nt=yt.r,Ht=yt.g,at=yt.b;lt?(g[0]=Nt,g[1]=Ht,g[2]=at,g[3]=St,pe.clearBufferuiv(pe.COLOR,0,g)):(b[0]=Nt,b[1]=Ht,b[2]=at,b[3]=St,pe.clearBufferiv(pe.COLOR,0,b))}else De|=pe.COLOR_BUFFER_BIT}ye&&(De|=pe.DEPTH_BUFFER_BIT),Ce&&(De|=pe.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),pe.clear(De)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",ht,!1),n.removeEventListener("webglcontextrestored",Ft,!1),n.removeEventListener("webglcontextcreationerror",st,!1),Ge.dispose(),$.dispose(),Le.dispose(),Ae.dispose(),He.dispose(),$e.dispose(),ce.dispose(),bt.dispose(),Rt.dispose(),fe.dispose(),Ve.dispose(),Ve.removeEventListener("sessionstart",bn),Ve.removeEventListener("sessionend",Jn),ai.stop()};function ht(ee){ee.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function Ft(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const ee=Te.autoReset,ye=mt.enabled,Ce=mt.autoUpdate,De=mt.needsUpdate,ve=mt.type;Oe(),Te.autoReset=ee,mt.enabled=ye,mt.autoUpdate=Ce,mt.needsUpdate=De,mt.type=ve}function st(ee){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",ee.statusMessage)}function it(ee){const ye=ee.target;ye.removeEventListener("dispose",it),vt(ye)}function vt(ee){Kt(ee),Ae.remove(ee)}function Kt(ee){const ye=Ae.get(ee).programs;ye!==void 0&&(ye.forEach(function(Ce){fe.releaseProgram(Ce)}),ee.isShaderMaterial&&fe.releaseShaderCache(ee))}this.renderBufferDirect=function(ee,ye,Ce,De,ve,_t){ye===null&&(ye=Ne);const lt=ve.isMesh&&ve.matrixWorld.determinant()<0,yt=ge(ee,ye,Ce,De,ve);we.setMaterial(De,lt);let St=Ce.index,Nt=1;if(De.wireframe===!0){if(St=K.getWireframeAttribute(Ce),St===void 0)return;Nt=2}const Ht=Ce.drawRange,at=Ce.attributes.position;let nn=Ht.start*Nt,un=(Ht.start+Ht.count)*Nt;_t!==null&&(nn=Math.max(nn,_t.start*Nt),un=Math.min(un,(_t.start+_t.count)*Nt)),St!==null?(nn=Math.max(nn,0),un=Math.min(un,St.count)):at!=null&&(nn=Math.max(nn,0),un=Math.min(un,at.count));const dn=un-nn;if(dn<0||dn===1/0)return;bt.setup(ve,De,yt,Ce,St);let On,$t=tt;if(St!==null&&(On=ie.get(St),$t=xt,$t.setIndex(On)),ve.isMesh)De.wireframe===!0?(we.setLineWidth(De.wireframeLinewidth*ze()),$t.setMode(pe.LINES)):$t.setMode(pe.TRIANGLES);else if(ve.isLine){let Yt=De.linewidth;Yt===void 0&&(Yt=1),we.setLineWidth(Yt*ze()),ve.isLineSegments?$t.setMode(pe.LINES):ve.isLineLoop?$t.setMode(pe.LINE_LOOP):$t.setMode(pe.LINE_STRIP)}else ve.isPoints?$t.setMode(pe.POINTS):ve.isSprite&&$t.setMode(pe.TRIANGLES);if(ve.isBatchedMesh)if(ve._multiDrawInstances!==null)v0("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),$t.renderMultiDrawInstances(ve._multiDrawStarts,ve._multiDrawCounts,ve._multiDrawCount,ve._multiDrawInstances);else if(Ie.get("WEBGL_multi_draw"))$t.renderMultiDraw(ve._multiDrawStarts,ve._multiDrawCounts,ve._multiDrawCount);else{const Yt=ve._multiDrawStarts,Pn=ve._multiDrawCounts,wn=ve._multiDrawCount,Xn=St?ie.get(St).bytesPerElement:1,En=Ae.get(De).currentProgram.getUniforms();for(let Mn=0;Mn<wn;Mn++)En.setValue(pe,"_gl_DrawID",Mn),$t.render(Yt[Mn]/Xn,Pn[Mn])}else if(ve.isInstancedMesh)$t.renderInstances(nn,dn,ve.count);else if(Ce.isInstancedBufferGeometry){const Yt=Ce._maxInstanceCount!==void 0?Ce._maxInstanceCount:1/0,Pn=Math.min(Ce.instanceCount,Yt);$t.renderInstances(nn,dn,Pn)}else $t.render(nn,dn)};function Xt(ee,ye,Ce){ee.transparent===!0&&ee.side===Kr&&ee.forceSinglePass===!1?(ee.side=Ra,ee.needsUpdate=!0,ui(ee,ye,Ce),ee.side=gu,ee.needsUpdate=!0,ui(ee,ye,Ce),ee.side=Kr):ui(ee,ye,Ce)}this.compile=function(ee,ye,Ce=null){Ce===null&&(Ce=ee),p=Le.get(Ce),p.init(ye),_.push(p),Ce.traverseVisible(function(ve){ve.isLight&&ve.layers.test(ye.layers)&&(p.pushLight(ve),ve.castShadow&&p.pushShadow(ve))}),ee!==Ce&&ee.traverseVisible(function(ve){ve.isLight&&ve.layers.test(ye.layers)&&(p.pushLight(ve),ve.castShadow&&p.pushShadow(ve))}),p.setupLights();const De=new Set;return ee.traverse(function(ve){if(!(ve.isMesh||ve.isPoints||ve.isLine||ve.isSprite))return;const _t=ve.material;if(_t)if(Array.isArray(_t))for(let lt=0;lt<_t.length;lt++){const yt=_t[lt];Xt(yt,Ce,ve),De.add(yt)}else Xt(_t,Ce,ve),De.add(_t)}),p=_.pop(),De},this.compileAsync=function(ee,ye,Ce=null){const De=this.compile(ee,ye,Ce);return new Promise(ve=>{function _t(){if(De.forEach(function(lt){Ae.get(lt).currentProgram.isReady()&&De.delete(lt)}),De.size===0){ve(ee);return}setTimeout(_t,10)}Ie.get("KHR_parallel_shader_compile")!==null?_t():setTimeout(_t,10)})};let cn=null;function Gn(ee){cn&&cn(ee)}function bn(){ai.stop()}function Jn(){ai.start()}const ai=new O$;ai.setAnimationLoop(Gn),typeof self<"u"&&ai.setContext(self),this.setAnimationLoop=function(ee){cn=ee,Ve.setAnimationLoop(ee),ee===null?ai.stop():ai.start()},Ve.addEventListener("sessionstart",bn),Ve.addEventListener("sessionend",Jn),this.render=function(ee,ye){if(ye!==void 0&&ye.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;if(ee.matrixWorldAutoUpdate===!0&&ee.updateMatrixWorld(),ye.parent===null&&ye.matrixWorldAutoUpdate===!0&&ye.updateMatrixWorld(),Ve.enabled===!0&&Ve.isPresenting===!0&&(Ve.cameraAutoUpdate===!0&&Ve.updateCamera(ye),ye=Ve.getCamera()),ee.isScene===!0&&ee.onBeforeRender(w,ee,ye,C),p=Le.get(ee,_.length),p.init(ye),_.push(p),ue.multiplyMatrices(ye.projectionMatrix,ye.matrixWorldInverse),de.setFromProjectionMatrix(ue,gl,ye.reversedDepth),oe=this.localClippingEnabled,se=Xe.init(this.clippingPlanes,oe),y=$.get(ee,x.length),y.init(),x.push(y),Ve.enabled===!0&&Ve.isPresenting===!0){const _t=w.xr.getDepthSensingMesh();_t!==null&&vi(_t,ye,-1/0,w.sortObjects)}vi(ee,ye,0,w.sortObjects),y.finish(),w.sortObjects===!0&&y.sort(W,F),Ue=Ve.enabled===!1||Ve.isPresenting===!1||Ve.hasDepthSensing()===!1,Ue&&Ge.addToRenderList(y,ee),this.info.render.frame++,se===!0&&Xe.beginShadows();const Ce=p.state.shadowsArray;mt.render(Ce,ee,ye),se===!0&&Xe.endShadows(),this.info.autoReset===!0&&this.info.reset();const De=y.opaque,ve=y.transmissive;if(p.setupLights(),ye.isArrayCamera){const _t=ye.cameras;if(ve.length>0)for(let lt=0,yt=_t.length;lt<yt;lt++){const St=_t[lt];Yi(De,ve,ee,St)}Ue&&Ge.render(ee);for(let lt=0,yt=_t.length;lt<yt;lt++){const St=_t[lt];Yn(y,ee,St,St.viewport)}}else ve.length>0&&Yi(De,ve,ee,ye),Ue&&Ge.render(ee),Yn(y,ee,ye);C!==null&&A===0&&(Pe.updateMultisampleRenderTarget(C),Pe.updateRenderTargetMipmap(C)),ee.isScene===!0&&ee.onAfterRender(w,ee,ye),bt.resetDefaultState(),D=-1,R=null,_.pop(),_.length>0?(p=_[_.length-1],se===!0&&Xe.setGlobalState(w.clippingPlanes,p.state.camera)):p=null,x.pop(),x.length>0?y=x[x.length-1]:y=null};function vi(ee,ye,Ce,De){if(ee.visible===!1)return;if(ee.layers.test(ye.layers)){if(ee.isGroup)Ce=ee.renderOrder;else if(ee.isLOD)ee.autoUpdate===!0&&ee.update(ye);else if(ee.isLight)p.pushLight(ee),ee.castShadow&&p.pushShadow(ee);else if(ee.isSprite){if(!ee.frustumCulled||de.intersectsSprite(ee)){De&&ke.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(ue);const lt=ce.update(ee),yt=ee.material;yt.visible&&y.push(ee,lt,yt,Ce,ke.z,null)}}else if((ee.isMesh||ee.isLine||ee.isPoints)&&(!ee.frustumCulled||de.intersectsObject(ee))){const lt=ce.update(ee),yt=ee.material;if(De&&(ee.boundingSphere!==void 0?(ee.boundingSphere===null&&ee.computeBoundingSphere(),ke.copy(ee.boundingSphere.center)):(lt.boundingSphere===null&&lt.computeBoundingSphere(),ke.copy(lt.boundingSphere.center)),ke.applyMatrix4(ee.matrixWorld).applyMatrix4(ue)),Array.isArray(yt)){const St=lt.groups;for(let Nt=0,Ht=St.length;Nt<Ht;Nt++){const at=St[Nt],nn=yt[at.materialIndex];nn&&nn.visible&&y.push(ee,lt,nn,Ce,ke.z,at)}}else yt.visible&&y.push(ee,lt,yt,Ce,ke.z,null)}}const _t=ee.children;for(let lt=0,yt=_t.length;lt<yt;lt++)vi(_t[lt],ye,Ce,De)}function Yn(ee,ye,Ce,De){const ve=ee.opaque,_t=ee.transmissive,lt=ee.transparent;p.setupLightsView(Ce),se===!0&&Xe.setGlobalState(w.clippingPlanes,Ce),De&&we.viewport(N.copy(De)),ve.length>0&&ci(ve,ye,Ce),_t.length>0&&ci(_t,ye,Ce),lt.length>0&&ci(lt,ye,Ce),we.buffers.depth.setTest(!0),we.buffers.depth.setMask(!0),we.buffers.color.setMask(!0),we.setPolygonOffset(!1)}function Yi(ee,ye,Ce,De){if((Ce.isScene===!0?Ce.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[De.id]===void 0&&(p.state.transmissionRenderTarget[De.id]=new Ec(1,1,{generateMipmaps:!0,type:Ie.has("EXT_color_buffer_half_float")||Ie.has("EXT_color_buffer_float")?ts:To,minFilter:mc,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:pi.workingColorSpace}));const _t=p.state.transmissionRenderTarget[De.id],lt=De.viewport||N;_t.setSize(lt.z*w.transmissionResolutionScale,lt.w*w.transmissionResolutionScale);const yt=w.getRenderTarget(),St=w.getActiveCubeFace(),Nt=w.getActiveMipmapLevel();w.setRenderTarget(_t),w.getClearColor(z),q=w.getClearAlpha(),q<1&&w.setClearColor(16777215,.5),w.clear(),Ue&&Ge.render(Ce);const Ht=w.toneMapping;w.toneMapping=Qu;const at=De.viewport;if(De.viewport!==void 0&&(De.viewport=void 0),p.setupLightsView(De),se===!0&&Xe.setGlobalState(w.clippingPlanes,De),ci(ee,Ce,De),Pe.updateMultisampleRenderTarget(_t),Pe.updateRenderTargetMipmap(_t),Ie.has("WEBGL_multisampled_render_to_texture")===!1){let nn=!1;for(let un=0,dn=ye.length;un<dn;un++){const On=ye[un],$t=On.object,Yt=On.geometry,Pn=On.material,wn=On.group;if(Pn.side===Kr&&$t.layers.test(De.layers)){const Xn=Pn.side;Pn.side=Ra,Pn.needsUpdate=!0,hn($t,Ce,De,Yt,Pn,wn),Pn.side=Xn,Pn.needsUpdate=!0,nn=!0}}nn===!0&&(Pe.updateMultisampleRenderTarget(_t),Pe.updateRenderTargetMipmap(_t))}w.setRenderTarget(yt,St,Nt),w.setClearColor(z,q),at!==void 0&&(De.viewport=at),w.toneMapping=Ht}function ci(ee,ye,Ce){const De=ye.isScene===!0?ye.overrideMaterial:null;for(let ve=0,_t=ee.length;ve<_t;ve++){const lt=ee[ve],yt=lt.object,St=lt.geometry,Nt=lt.group;let Ht=lt.material;Ht.allowOverride===!0&&De!==null&&(Ht=De),yt.layers.test(Ce.layers)&&hn(yt,ye,Ce,St,Ht,Nt)}}function hn(ee,ye,Ce,De,ve,_t){ee.onBeforeRender(w,ye,Ce,De,ve,_t),ee.modelViewMatrix.multiplyMatrices(Ce.matrixWorldInverse,ee.matrixWorld),ee.normalMatrix.getNormalMatrix(ee.modelViewMatrix),ve.onBeforeRender(w,ye,Ce,De,ee,_t),ve.transparent===!0&&ve.side===Kr&&ve.forceSinglePass===!1?(ve.side=Ra,ve.needsUpdate=!0,w.renderBufferDirect(Ce,ye,De,ve,ee,_t),ve.side=gu,ve.needsUpdate=!0,w.renderBufferDirect(Ce,ye,De,ve,ee,_t),ve.side=Kr):w.renderBufferDirect(Ce,ye,De,ve,ee,_t),ee.onAfterRender(w,ye,Ce,De,ve,_t)}function ui(ee,ye,Ce){ye.isScene!==!0&&(ye=Ne);const De=Ae.get(ee),ve=p.state.lights,_t=p.state.shadowsArray,lt=ve.state.version,yt=fe.getParameters(ee,ve.state,_t,ye,Ce),St=fe.getProgramCacheKey(yt);let Nt=De.programs;De.environment=ee.isMeshStandardMaterial?ye.environment:null,De.fog=ye.fog,De.envMap=(ee.isMeshStandardMaterial?$e:He).get(ee.envMap||De.environment),De.envMapRotation=De.environment!==null&&ee.envMap===null?ye.environmentRotation:ee.envMapRotation,Nt===void 0&&(ee.addEventListener("dispose",it),Nt=new Map,De.programs=Nt);let Ht=Nt.get(St);if(Ht!==void 0){if(De.currentProgram===Ht&&De.lightsStateVersion===lt)return re(ee,yt),Ht}else yt.uniforms=fe.getUniforms(ee),ee.onBeforeCompile(yt,w),Ht=fe.acquireProgram(yt,St),Nt.set(St,Ht),De.uniforms=yt.uniforms;const at=De.uniforms;return(!ee.isShaderMaterial&&!ee.isRawShaderMaterial||ee.clipping===!0)&&(at.clippingPlanes=Xe.uniform),re(ee,yt),De.needsLights=rt(ee),De.lightsStateVersion=lt,De.needsLights&&(at.ambientLightColor.value=ve.state.ambient,at.lightProbe.value=ve.state.probe,at.directionalLights.value=ve.state.directional,at.directionalLightShadows.value=ve.state.directionalShadow,at.spotLights.value=ve.state.spot,at.spotLightShadows.value=ve.state.spotShadow,at.rectAreaLights.value=ve.state.rectArea,at.ltc_1.value=ve.state.rectAreaLTC1,at.ltc_2.value=ve.state.rectAreaLTC2,at.pointLights.value=ve.state.point,at.pointLightShadows.value=ve.state.pointShadow,at.hemisphereLights.value=ve.state.hemi,at.directionalShadowMap.value=ve.state.directionalShadowMap,at.directionalShadowMatrix.value=ve.state.directionalShadowMatrix,at.spotShadowMap.value=ve.state.spotShadowMap,at.spotLightMatrix.value=ve.state.spotLightMatrix,at.spotLightMap.value=ve.state.spotLightMap,at.pointShadowMap.value=ve.state.pointShadowMap,at.pointShadowMatrix.value=ve.state.pointShadowMatrix),De.currentProgram=Ht,De.uniformsList=null,Ht}function $n(ee){if(ee.uniformsList===null){const ye=ee.currentProgram.getUniforms();ee.uniformsList=dM.seqWithValue(ye.seq,ee.uniforms)}return ee.uniformsList}function re(ee,ye){const Ce=Ae.get(ee);Ce.outputColorSpace=ye.outputColorSpace,Ce.batching=ye.batching,Ce.batchingColor=ye.batchingColor,Ce.instancing=ye.instancing,Ce.instancingColor=ye.instancingColor,Ce.instancingMorph=ye.instancingMorph,Ce.skinning=ye.skinning,Ce.morphTargets=ye.morphTargets,Ce.morphNormals=ye.morphNormals,Ce.morphColors=ye.morphColors,Ce.morphTargetsCount=ye.morphTargetsCount,Ce.numClippingPlanes=ye.numClippingPlanes,Ce.numIntersection=ye.numClipIntersection,Ce.vertexAlphas=ye.vertexAlphas,Ce.vertexTangents=ye.vertexTangents,Ce.toneMapping=ye.toneMapping}function ge(ee,ye,Ce,De,ve){ye.isScene!==!0&&(ye=Ne),Pe.resetTextureUnits();const _t=ye.fog,lt=De.isMeshStandardMaterial?ye.environment:null,yt=C===null?w.outputColorSpace:C.isXRRenderTarget===!0?C.texture.colorSpace:bu,St=(De.isMeshStandardMaterial?$e:He).get(De.envMap||lt),Nt=De.vertexColors===!0&&!!Ce.attributes.color&&Ce.attributes.color.itemSize===4,Ht=!!Ce.attributes.tangent&&(!!De.normalMap||De.anisotropy>0),at=!!Ce.morphAttributes.position,nn=!!Ce.morphAttributes.normal,un=!!Ce.morphAttributes.color;let dn=Qu;De.toneMapped&&(C===null||C.isXRRenderTarget===!0)&&(dn=w.toneMapping);const On=Ce.morphAttributes.position||Ce.morphAttributes.normal||Ce.morphAttributes.color,$t=On!==void 0?On.length:0,Yt=Ae.get(De),Pn=p.state.lights;if(se===!0&&(oe===!0||ee!==R)){const Wn=ee===R&&De.id===D;Xe.setState(De,ee,Wn)}let wn=!1;De.version===Yt.__version?(Yt.needsLights&&Yt.lightsStateVersion!==Pn.state.version||Yt.outputColorSpace!==yt||ve.isBatchedMesh&&Yt.batching===!1||!ve.isBatchedMesh&&Yt.batching===!0||ve.isBatchedMesh&&Yt.batchingColor===!0&&ve.colorTexture===null||ve.isBatchedMesh&&Yt.batchingColor===!1&&ve.colorTexture!==null||ve.isInstancedMesh&&Yt.instancing===!1||!ve.isInstancedMesh&&Yt.instancing===!0||ve.isSkinnedMesh&&Yt.skinning===!1||!ve.isSkinnedMesh&&Yt.skinning===!0||ve.isInstancedMesh&&Yt.instancingColor===!0&&ve.instanceColor===null||ve.isInstancedMesh&&Yt.instancingColor===!1&&ve.instanceColor!==null||ve.isInstancedMesh&&Yt.instancingMorph===!0&&ve.morphTexture===null||ve.isInstancedMesh&&Yt.instancingMorph===!1&&ve.morphTexture!==null||Yt.envMap!==St||De.fog===!0&&Yt.fog!==_t||Yt.numClippingPlanes!==void 0&&(Yt.numClippingPlanes!==Xe.numPlanes||Yt.numIntersection!==Xe.numIntersection)||Yt.vertexAlphas!==Nt||Yt.vertexTangents!==Ht||Yt.morphTargets!==at||Yt.morphNormals!==nn||Yt.morphColors!==un||Yt.toneMapping!==dn||Yt.morphTargetsCount!==$t)&&(wn=!0):(wn=!0,Yt.__version=De.version);let Xn=Yt.currentProgram;wn===!0&&(Xn=ui(De,ye,ve));let En=!1,Mn=!1,pn=!1;const rn=Xn.getUniforms(),yi=Yt.uniforms;if(we.useProgram(Xn.program)&&(En=!0,Mn=!0,pn=!0),De.id!==D&&(D=De.id,Mn=!0),En||R!==ee){we.buffers.depth.getReversed()&&ee.reversedDepth!==!0&&(ee._reversedDepth=!0,ee.updateProjectionMatrix()),rn.setValue(pe,"projectionMatrix",ee.projectionMatrix),rn.setValue(pe,"viewMatrix",ee.matrixWorldInverse);const Oi=rn.map.cameraPosition;Oi!==void 0&&Oi.setValue(pe,_e.setFromMatrixPosition(ee.matrixWorld)),qe.logarithmicDepthBuffer&&rn.setValue(pe,"logDepthBufFC",2/(Math.log(ee.far+1)/Math.LN2)),(De.isMeshPhongMaterial||De.isMeshToonMaterial||De.isMeshLambertMaterial||De.isMeshBasicMaterial||De.isMeshStandardMaterial||De.isShaderMaterial)&&rn.setValue(pe,"isOrthographic",ee.isOrthographicCamera===!0),R!==ee&&(R=ee,Mn=!0,pn=!0)}if(ve.isSkinnedMesh){rn.setOptional(pe,ve,"bindMatrix"),rn.setOptional(pe,ve,"bindMatrixInverse");const Wn=ve.skeleton;Wn&&(Wn.boneTexture===null&&Wn.computeBoneTexture(),rn.setValue(pe,"boneTexture",Wn.boneTexture,Pe))}ve.isBatchedMesh&&(rn.setOptional(pe,ve,"batchingTexture"),rn.setValue(pe,"batchingTexture",ve._matricesTexture,Pe),rn.setOptional(pe,ve,"batchingIdTexture"),rn.setValue(pe,"batchingIdTexture",ve._indirectTexture,Pe),rn.setOptional(pe,ve,"batchingColorTexture"),ve._colorsTexture!==null&&rn.setValue(pe,"batchingColorTexture",ve._colorsTexture,Pe));const Li=Ce.morphAttributes;if((Li.position!==void 0||Li.normal!==void 0||Li.color!==void 0)&&Je.update(ve,Ce,Xn),(Mn||Yt.receiveShadow!==ve.receiveShadow)&&(Yt.receiveShadow=ve.receiveShadow,rn.setValue(pe,"receiveShadow",ve.receiveShadow)),De.isMeshGouraudMaterial&&De.envMap!==null&&(yi.envMap.value=St,yi.flipEnvMap.value=St.isCubeTexture&&St.isRenderTargetTexture===!1?-1:1),De.isMeshStandardMaterial&&De.envMap===null&&ye.environment!==null&&(yi.envMapIntensity.value=ye.environmentIntensity),Mn&&(rn.setValue(pe,"toneMappingExposure",w.toneMappingExposure),Yt.needsLights&&je(yi,pn),_t&&De.fog===!0&&me.refreshFogUniforms(yi,_t),me.refreshMaterialUniforms(yi,De,H,G,p.state.transmissionRenderTarget[ee.id]),dM.upload(pe,$n(Yt),yi,Pe)),De.isShaderMaterial&&De.uniformsNeedUpdate===!0&&(dM.upload(pe,$n(Yt),yi,Pe),De.uniformsNeedUpdate=!1),De.isSpriteMaterial&&rn.setValue(pe,"center",ve.center),rn.setValue(pe,"modelViewMatrix",ve.modelViewMatrix),rn.setValue(pe,"normalMatrix",ve.normalMatrix),rn.setValue(pe,"modelMatrix",ve.matrixWorld),De.isShaderMaterial||De.isRawShaderMaterial){const Wn=De.uniformsGroups;for(let Oi=0,ya=Wn.length;Oi<ya;Oi++){const Ji=Wn[Oi];Rt.update(Ji,Xn),Rt.bind(Ji,Xn)}}return Xn}function je(ee,ye){ee.ambientLightColor.needsUpdate=ye,ee.lightProbe.needsUpdate=ye,ee.directionalLights.needsUpdate=ye,ee.directionalLightShadows.needsUpdate=ye,ee.pointLights.needsUpdate=ye,ee.pointLightShadows.needsUpdate=ye,ee.spotLights.needsUpdate=ye,ee.spotLightShadows.needsUpdate=ye,ee.rectAreaLights.needsUpdate=ye,ee.hemisphereLights.needsUpdate=ye}function rt(ee){return ee.isMeshLambertMaterial||ee.isMeshToonMaterial||ee.isMeshPhongMaterial||ee.isMeshStandardMaterial||ee.isShadowMaterial||ee.isShaderMaterial&&ee.lights===!0}this.getActiveCubeFace=function(){return S},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return C},this.setRenderTargetTextures=function(ee,ye,Ce){const De=Ae.get(ee);De.__autoAllocateDepthBuffer=ee.resolveDepthBuffer===!1,De.__autoAllocateDepthBuffer===!1&&(De.__useRenderToTexture=!1),Ae.get(ee.texture).__webglTexture=ye,Ae.get(ee.depthTexture).__webglTexture=De.__autoAllocateDepthBuffer?void 0:Ce,De.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(ee,ye){const Ce=Ae.get(ee);Ce.__webglFramebuffer=ye,Ce.__useDefaultFramebuffer=ye===void 0};const dt=pe.createFramebuffer();this.setRenderTarget=function(ee,ye=0,Ce=0){C=ee,S=ye,A=Ce;let De=!0,ve=null,_t=!1,lt=!1;if(ee){const St=Ae.get(ee);if(St.__useDefaultFramebuffer!==void 0)we.bindFramebuffer(pe.FRAMEBUFFER,null),De=!1;else if(St.__webglFramebuffer===void 0)Pe.setupRenderTarget(ee);else if(St.__hasExternalTextures)Pe.rebindTextures(ee,Ae.get(ee.texture).__webglTexture,Ae.get(ee.depthTexture).__webglTexture);else if(ee.depthBuffer){const at=ee.depthTexture;if(St.__boundDepthTexture!==at){if(at!==null&&Ae.has(at)&&(ee.width!==at.image.width||ee.height!==at.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Pe.setupDepthRenderbuffer(ee)}}const Nt=ee.texture;(Nt.isData3DTexture||Nt.isDataArrayTexture||Nt.isCompressedArrayTexture)&&(lt=!0);const Ht=Ae.get(ee).__webglFramebuffer;ee.isWebGLCubeRenderTarget?(Array.isArray(Ht[ye])?ve=Ht[ye][Ce]:ve=Ht[ye],_t=!0):ee.samples>0&&Pe.useMultisampledRTT(ee)===!1?ve=Ae.get(ee).__webglMultisampledFramebuffer:Array.isArray(Ht)?ve=Ht[Ce]:ve=Ht,N.copy(ee.viewport),U.copy(ee.scissor),j=ee.scissorTest}else N.copy(Y).multiplyScalar(H).floor(),U.copy(Z).multiplyScalar(H).floor(),j=V;if(Ce!==0&&(ve=dt),we.bindFramebuffer(pe.FRAMEBUFFER,ve)&&De&&we.drawBuffers(ee,ve),we.viewport(N),we.scissor(U),we.setScissorTest(j),_t){const St=Ae.get(ee.texture);pe.framebufferTexture2D(pe.FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_CUBE_MAP_POSITIVE_X+ye,St.__webglTexture,Ce)}else if(lt){const St=ye;for(let Nt=0;Nt<ee.textures.length;Nt++){const Ht=Ae.get(ee.textures[Nt]);pe.framebufferTextureLayer(pe.FRAMEBUFFER,pe.COLOR_ATTACHMENT0+Nt,Ht.__webglTexture,Ce,St)}}else if(ee!==null&&Ce!==0){const St=Ae.get(ee.texture);pe.framebufferTexture2D(pe.FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_2D,St.__webglTexture,Ce)}D=-1},this.readRenderTargetPixels=function(ee,ye,Ce,De,ve,_t,lt,yt=0){if(!(ee&&ee.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let St=Ae.get(ee).__webglFramebuffer;if(ee.isWebGLCubeRenderTarget&&lt!==void 0&&(St=St[lt]),St){we.bindFramebuffer(pe.FRAMEBUFFER,St);try{const Nt=ee.textures[yt],Ht=Nt.format,at=Nt.type;if(!qe.textureFormatReadable(Ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!qe.textureTypeReadable(at)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ye>=0&&ye<=ee.width-De&&Ce>=0&&Ce<=ee.height-ve&&(ee.textures.length>1&&pe.readBuffer(pe.COLOR_ATTACHMENT0+yt),pe.readPixels(ye,Ce,De,ve,Tt.convert(Ht),Tt.convert(at),_t))}finally{const Nt=C!==null?Ae.get(C).__webglFramebuffer:null;we.bindFramebuffer(pe.FRAMEBUFFER,Nt)}}},this.readRenderTargetPixelsAsync=async function(ee,ye,Ce,De,ve,_t,lt,yt=0){if(!(ee&&ee.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let St=Ae.get(ee).__webglFramebuffer;if(ee.isWebGLCubeRenderTarget&&lt!==void 0&&(St=St[lt]),St)if(ye>=0&&ye<=ee.width-De&&Ce>=0&&Ce<=ee.height-ve){we.bindFramebuffer(pe.FRAMEBUFFER,St);const Nt=ee.textures[yt],Ht=Nt.format,at=Nt.type;if(!qe.textureFormatReadable(Ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!qe.textureTypeReadable(at))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const nn=pe.createBuffer();pe.bindBuffer(pe.PIXEL_PACK_BUFFER,nn),pe.bufferData(pe.PIXEL_PACK_BUFFER,_t.byteLength,pe.STREAM_READ),ee.textures.length>1&&pe.readBuffer(pe.COLOR_ATTACHMENT0+yt),pe.readPixels(ye,Ce,De,ve,Tt.convert(Ht),Tt.convert(at),0);const un=C!==null?Ae.get(C).__webglFramebuffer:null;we.bindFramebuffer(pe.FRAMEBUFFER,un);const dn=pe.fenceSync(pe.SYNC_GPU_COMMANDS_COMPLETE,0);return pe.flush(),await fbe(pe,dn,4),pe.bindBuffer(pe.PIXEL_PACK_BUFFER,nn),pe.getBufferSubData(pe.PIXEL_PACK_BUFFER,0,_t),pe.deleteBuffer(nn),pe.deleteSync(dn),_t}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(ee,ye=null,Ce=0){const De=Math.pow(2,-Ce),ve=Math.floor(ee.image.width*De),_t=Math.floor(ee.image.height*De),lt=ye!==null?ye.x:0,yt=ye!==null?ye.y:0;Pe.setTexture2D(ee,0),pe.copyTexSubImage2D(pe.TEXTURE_2D,Ce,0,0,lt,yt,ve,_t),we.unbindTexture()};const ot=pe.createFramebuffer(),kt=pe.createFramebuffer();this.copyTextureToTexture=function(ee,ye,Ce=null,De=null,ve=0,_t=null){_t===null&&(ve!==0?(v0("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),_t=ve,ve=0):_t=0);let lt,yt,St,Nt,Ht,at,nn,un,dn;const On=ee.isCompressedTexture?ee.mipmaps[_t]:ee.image;if(Ce!==null)lt=Ce.max.x-Ce.min.x,yt=Ce.max.y-Ce.min.y,St=Ce.isBox3?Ce.max.z-Ce.min.z:1,Nt=Ce.min.x,Ht=Ce.min.y,at=Ce.isBox3?Ce.min.z:0;else{const Li=Math.pow(2,-ve);lt=Math.floor(On.width*Li),yt=Math.floor(On.height*Li),ee.isDataArrayTexture?St=On.depth:ee.isData3DTexture?St=Math.floor(On.depth*Li):St=1,Nt=0,Ht=0,at=0}De!==null?(nn=De.x,un=De.y,dn=De.z):(nn=0,un=0,dn=0);const $t=Tt.convert(ye.format),Yt=Tt.convert(ye.type);let Pn;ye.isData3DTexture?(Pe.setTexture3D(ye,0),Pn=pe.TEXTURE_3D):ye.isDataArrayTexture||ye.isCompressedArrayTexture?(Pe.setTexture2DArray(ye,0),Pn=pe.TEXTURE_2D_ARRAY):(Pe.setTexture2D(ye,0),Pn=pe.TEXTURE_2D),pe.pixelStorei(pe.UNPACK_FLIP_Y_WEBGL,ye.flipY),pe.pixelStorei(pe.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ye.premultiplyAlpha),pe.pixelStorei(pe.UNPACK_ALIGNMENT,ye.unpackAlignment);const wn=pe.getParameter(pe.UNPACK_ROW_LENGTH),Xn=pe.getParameter(pe.UNPACK_IMAGE_HEIGHT),En=pe.getParameter(pe.UNPACK_SKIP_PIXELS),Mn=pe.getParameter(pe.UNPACK_SKIP_ROWS),pn=pe.getParameter(pe.UNPACK_SKIP_IMAGES);pe.pixelStorei(pe.UNPACK_ROW_LENGTH,On.width),pe.pixelStorei(pe.UNPACK_IMAGE_HEIGHT,On.height),pe.pixelStorei(pe.UNPACK_SKIP_PIXELS,Nt),pe.pixelStorei(pe.UNPACK_SKIP_ROWS,Ht),pe.pixelStorei(pe.UNPACK_SKIP_IMAGES,at);const rn=ee.isDataArrayTexture||ee.isData3DTexture,yi=ye.isDataArrayTexture||ye.isData3DTexture;if(ee.isDepthTexture){const Li=Ae.get(ee),Wn=Ae.get(ye),Oi=Ae.get(Li.__renderTarget),ya=Ae.get(Wn.__renderTarget);we.bindFramebuffer(pe.READ_FRAMEBUFFER,Oi.__webglFramebuffer),we.bindFramebuffer(pe.DRAW_FRAMEBUFFER,ya.__webglFramebuffer);for(let Ji=0;Ji<St;Ji++)rn&&(pe.framebufferTextureLayer(pe.READ_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,Ae.get(ee).__webglTexture,ve,at+Ji),pe.framebufferTextureLayer(pe.DRAW_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,Ae.get(ye).__webglTexture,_t,dn+Ji)),pe.blitFramebuffer(Nt,Ht,lt,yt,nn,un,lt,yt,pe.DEPTH_BUFFER_BIT,pe.NEAREST);we.bindFramebuffer(pe.READ_FRAMEBUFFER,null),we.bindFramebuffer(pe.DRAW_FRAMEBUFFER,null)}else if(ve!==0||ee.isRenderTargetTexture||Ae.has(ee)){const Li=Ae.get(ee),Wn=Ae.get(ye);we.bindFramebuffer(pe.READ_FRAMEBUFFER,ot),we.bindFramebuffer(pe.DRAW_FRAMEBUFFER,kt);for(let Oi=0;Oi<St;Oi++)rn?pe.framebufferTextureLayer(pe.READ_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,Li.__webglTexture,ve,at+Oi):pe.framebufferTexture2D(pe.READ_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_2D,Li.__webglTexture,ve),yi?pe.framebufferTextureLayer(pe.DRAW_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,Wn.__webglTexture,_t,dn+Oi):pe.framebufferTexture2D(pe.DRAW_FRAMEBUFFER,pe.COLOR_ATTACHMENT0,pe.TEXTURE_2D,Wn.__webglTexture,_t),ve!==0?pe.blitFramebuffer(Nt,Ht,lt,yt,nn,un,lt,yt,pe.COLOR_BUFFER_BIT,pe.NEAREST):yi?pe.copyTexSubImage3D(Pn,_t,nn,un,dn+Oi,Nt,Ht,lt,yt):pe.copyTexSubImage2D(Pn,_t,nn,un,Nt,Ht,lt,yt);we.bindFramebuffer(pe.READ_FRAMEBUFFER,null),we.bindFramebuffer(pe.DRAW_FRAMEBUFFER,null)}else yi?ee.isDataTexture||ee.isData3DTexture?pe.texSubImage3D(Pn,_t,nn,un,dn,lt,yt,St,$t,Yt,On.data):ye.isCompressedArrayTexture?pe.compressedTexSubImage3D(Pn,_t,nn,un,dn,lt,yt,St,$t,On.data):pe.texSubImage3D(Pn,_t,nn,un,dn,lt,yt,St,$t,Yt,On):ee.isDataTexture?pe.texSubImage2D(pe.TEXTURE_2D,_t,nn,un,lt,yt,$t,Yt,On.data):ee.isCompressedTexture?pe.compressedTexSubImage2D(pe.TEXTURE_2D,_t,nn,un,On.width,On.height,$t,On.data):pe.texSubImage2D(pe.TEXTURE_2D,_t,nn,un,lt,yt,$t,Yt,On);pe.pixelStorei(pe.UNPACK_ROW_LENGTH,wn),pe.pixelStorei(pe.UNPACK_IMAGE_HEIGHT,Xn),pe.pixelStorei(pe.UNPACK_SKIP_PIXELS,En),pe.pixelStorei(pe.UNPACK_SKIP_ROWS,Mn),pe.pixelStorei(pe.UNPACK_SKIP_IMAGES,pn),_t===0&&ye.generateMipmaps&&pe.generateMipmap(Pn),we.unbindTexture()},this.copyTextureToTexture3D=function(ee,ye,Ce=null,De=null,ve=0){return v0('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(ee,ye,Ce,De,ve)},this.initRenderTarget=function(ee){Ae.get(ee).__webglFramebuffer===void 0&&Pe.setupRenderTarget(ee)},this.initTexture=function(ee){ee.isCubeTexture?Pe.setTextureCube(ee,0):ee.isData3DTexture?Pe.setTexture3D(ee,0):ee.isDataArrayTexture||ee.isCompressedArrayTexture?Pe.setTexture2DArray(ee,0):Pe.setTexture2D(ee,0),we.unbindTexture()},this.resetState=function(){S=0,A=0,C=null,we.reset(),bt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return gl}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=pi._getDrawingBufferColorSpace(e),n.unpackColorSpace=pi._getUnpackColorSpace()}}const gSe=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:RP,AddEquation:md,AddOperation:bJ,AdditiveAnimationBlendMode:LP,AdditiveBlending:GO,AgXToneMapping:SJ,AlphaFormat:OP,AlwaysCompare:PJ,AlwaysDepth:b2,AlwaysStencilFunc:KO,AmbientLight:b$,AnimationAction:T$,AnimationClip:ov,AnimationLoader:P0e,AnimationMixer:A$,AnimationObjectGroup:ave,AnimationUtils:O0e,ArcCurve:JJ,ArrayCamera:w$,ArrowHelper:Ave,AttachedBindMode:F1,Audio:E$,AudioAnalyser:Y0e,AudioContext:uU,AudioListener:q0e,AudioLoader:V0e,AxesHelper:Cve,BackSide:Ra,BasicDepthPacking:CJ,BasicShadowMap:$Y,BatchedMesh:XJ,Bone:B_,BooleanKeyframeTrack:cg,Box2:dve,Box3:rr,Box3Helper:tI,BoxGeometry:Xd,BoxHelper:Mve,BufferAttribute:Nn,BufferGeometry:Dn,BufferGeometryLoader:_$,ByteType:PA,Cache:Gu,Camera:GA,CameraHelper:Eve,CanvasTexture:t0e,CapsuleGeometry:ZA,CatmullRomCurve3:YP,CineonToneMapping:xJ,CircleGeometry:QA,ClampToEdgeWrapping:ba,Clock:fU,Color:Ut,ColorKeyframeTrack:aU,ColorManagement:pi,CompressedArrayTexture:Qbe,CompressedCubeTexture:e0e,CompressedTexture:$A,CompressedTextureLoader:U0e,ConeGeometry:z_,ConstantAlphaFactor:pJ,ConstantColorFactor:hJ,Controls:kve,CubeCamera:VJ,CubeReflectionMapping:sf,CubeRefractionMapping:Bd,CubeTexture:U_,CubeTextureLoader:m$,CubeUVReflectionMapping:Fv,CubicBezierCurve:JP,CubicBezierCurve3:$P,CubicInterpolant:f$,CullFaceBack:VO,CullFaceFront:JY,CullFaceFrontBack:gge,CullFaceNone:YY,Curve:_u,CurvePath:ZJ,CustomBlending:ZY,CustomToneMapping:_J,CylinderGeometry:jm,Cylindrical:hve,Data3DTexture:VA,DataArrayTexture:HA,DataTexture:rs,DataTextureLoader:sU,DataUtils:om,DecrementStencilOp:Tge,DecrementWrapStencilOp:Cge,DefaultLoadingManager:p$,DepthFormat:$0,DepthStencilFormat:Z0,DepthTexture:XP,DetachedBindMode:kP,DirectionalLight:dC,DirectionalLightHelper:wve,DiscreteInterpolant:h$,DodecahedronGeometry:eC,DoubleSide:Kr,DstAlphaFactor:oJ,DstColorFactor:cJ,DynamicCopyUsage:Hge,DynamicDrawUsage:V1,DynamicReadUsage:Bge,EdgesGeometry:YJ,EllipseCurve:tC,EqualCompare:OJ,EqualDepth:y2,EqualStencilFunc:Oge,EquirectangularReflectionMapping:X0,EquirectangularRefractionMapping:B1,Euler:mi,EventDispatcher:df,ExtrudeGeometry:nC,FileLoader:Os,Float16BufferAttribute:jJ,Float32BufferAttribute:fn,FloatType:yr,Fog:qA,FogExp2:WA,FramebufferTexture:Zbe,FrontSide:gu,Frustum:Kd,FrustumArray:YA,GLBufferAttribute:C$,GLSL1:Gge,GLSL3:YO,GreaterCompare:IJ,GreaterDepth:_2,GreaterEqualCompare:LJ,GreaterEqualDepth:x2,GreaterEqualStencilFunc:Pge,GreaterStencilFunc:Nge,GridHelper:_ve,Group:bl,HalfFloatType:ts,HemisphereLight:g$,HemisphereLightHelper:xve,IcosahedronGeometry:Gv,ImageBitmapLoader:S$,ImageLoader:K1,ImageUtils:BJ,IncrementStencilOp:Mge,IncrementWrapStencilOp:Age,InstancedBufferAttribute:of,InstancedBufferGeometry:H_,InstancedInterleavedBuffer:tT,InstancedMesh:KA,Int16BufferAttribute:kbe,Int32BufferAttribute:Dbe,Int8BufferAttribute:Abe,IntType:Bv,InterleavedBuffer:F_,InterleavedBufferAttribute:Bo,Interpolant:Xv,InterpolateDiscrete:Q0,InterpolateLinear:ev,InterpolateSmooth:fM,InterpolationSamplingMode:Xge,InterpolationSamplingType:qge,InvertStencilOp:Rge,KeepStencilOp:qp,KeyframeTrack:Ic,LOD:qJ,LatheGeometry:iC,Layers:iv,LessCompare:DJ,LessDepth:v2,LessEqualCompare:FP,LessEqualDepth:zm,LessEqualStencilFunc:Ige,LessStencilFunc:Dge,Light:Jd,LightProbe:x$,Line:gh,Line3:k$,LineBasicMaterial:Us,LineCurve:ZP,LineCurve3:$J,LineDashedMaterial:l$,LineLoop:WP,LineSegments:Dc,LinearFilter:Hi,LinearInterpolant:rU,LinearMipMapLinearFilter:XO,LinearMipMapNearestFilter:yge,LinearMipmapLinearFilter:mc,LinearMipmapNearestFilter:b0,LinearSRGBColorSpace:bu,LinearToneMapping:vJ,LinearTransfer:j1,Loader:Fs,LoaderUtils:Dd,LoadingManager:hC,LoopOnce:EJ,LoopPingPong:TJ,LoopRepeat:MJ,MOUSE:pge,Material:ka,MaterialLoader:pC,MathUtils:gc,Matrix2:pU,Matrix3:Kn,Matrix4:Ot,MaxEquation:nJ,Mesh:_i,MeshBasicMaterial:Cs,MeshDepthMaterial:uC,MeshDistanceMaterial:fC,MeshLambertMaterial:s$,MeshMatcapMaterial:o$,MeshNormalMaterial:a$,MeshPhongMaterial:r$,MeshPhysicalMaterial:Oc,MeshStandardMaterial:qv,MeshToonMaterial:eT,MinEquation:tJ,MirroredRepeatWrapping:K0,MixOperation:gJ,MultiplyBlending:qO,MultiplyOperation:L_,NearestFilter:is,NearestMipMapLinearFilter:vge,NearestMipMapNearestFilter:bge,NearestMipmapLinearFilter:rm,NearestMipmapNearestFilter:LA,NeutralToneMapping:wJ,NeverCompare:kJ,NeverDepth:g2,NeverStencilFunc:kge,NoBlending:Zu,NoColorSpace:tu,NoToneMapping:Qu,NormalAnimationBlendMode:jA,NormalBlending:Tm,NotEqualCompare:NJ,NotEqualDepth:S2,NotEqualStencilFunc:Lge,NumberKeyframeTrack:Vm,Object3D:Ni,ObjectLoader:j0e,ObjectSpaceNormalMap:RJ,OctahedronGeometry:j_,OneFactor:rJ,OneMinusConstantAlphaFactor:mJ,OneMinusConstantColorFactor:dJ,OneMinusDstAlphaFactor:lJ,OneMinusDstColorFactor:uJ,OneMinusSrcAlphaFactor:m2,OneMinusSrcColorFactor:sJ,OrthographicCamera:Eh,PCFShadowMap:NA,PCFSoftShadowMap:Jx,PMREMGenerator:iI,Path:Q2,PerspectiveCamera:ta,Plane:$c,PlaneGeometry:Ol,PlaneHelper:Tve,PointLight:cU,PointLightHelper:vve,Points:qP,PointsMaterial:JA,PolarGridHelper:Sve,PolyhedronGeometry:Yd,PositionalAudio:K0e,PropertyBinding:Fi,PropertyMixer:M$,QuadraticBezierCurve:QP,QuadraticBezierCurve3:eU,Quaternion:Vn,QuaternionKeyframeTrack:Gm,QuaternionLinearInterpolant:d$,RED_GREEN_RGTC2_Format:X2,RED_RGTC1_Format:NP,REVISION:Uv,RGBADepthPacking:UP,RGBAFormat:$r,RGBAIntegerFormat:jv,RGBA_ASTC_10x10_Format:j2,RGBA_ASTC_10x5_Format:F2,RGBA_ASTC_10x6_Format:B2,RGBA_ASTC_10x8_Format:z2,RGBA_ASTC_12x10_Format:H2,RGBA_ASTC_12x12_Format:V2,RGBA_ASTC_4x4_Format:k2,RGBA_ASTC_5x4_Format:D2,RGBA_ASTC_5x5_Format:O2,RGBA_ASTC_6x5_Format:I2,RGBA_ASTC_6x6_Format:N2,RGBA_ASTC_8x5_Format:L2,RGBA_ASTC_8x6_Format:P2,RGBA_ASTC_8x8_Format:U2,RGBA_BPTC_Format:t1,RGBA_ETC2_EAC_Format:R2,RGBA_PVRTC_2BPPV1_Format:T2,RGBA_PVRTC_4BPPV1_Format:M2,RGBA_S3TC_DXT1_Format:Zx,RGBA_S3TC_DXT3_Format:Qx,RGBA_S3TC_DXT5_Format:e1,RGBDepthPacking:_ge,RGBFormat:IP,RGBIntegerFormat:xge,RGB_BPTC_SIGNED_Format:G2,RGB_BPTC_UNSIGNED_Format:W2,RGB_ETC1_Format:A2,RGB_ETC2_Format:C2,RGB_PVRTC_2BPPV1_Format:E2,RGB_PVRTC_4BPPV1_Format:w2,RGB_S3TC_DXT1_Format:$x,RGDepthPacking:Sge,RGFormat:zA,RGIntegerFormat:P_,RawShaderMaterial:i$,Ray:pf,Raycaster:V_,RectAreaLight:v$,RedFormat:wh,RedIntegerFormat:zv,ReinhardToneMapping:yJ,RenderTarget:zP,RenderTarget3D:ove,RepeatWrapping:zd,ReplaceStencilOp:Ege,ReverseSubtractEquation:eJ,RingGeometry:rC,SIGNED_RED_GREEN_RGTC2_Format:K2,SIGNED_RED_RGTC1_Format:q2,SRGBColorSpace:Es,SRGBTransfer:fr,Scene:Hv,ShaderChunk:ln,ShaderLib:Zc,ShaderMaterial:ss,ShadowMaterial:lg,Shape:Cm,ShapeGeometry:aC,ShapePath:Rve,ShapeUtils:lu,ShortType:UA,Skeleton:Vv,SkeletonHelper:bve,SkinnedMesh:XA,Source:xd,Sphere:Ir,SphereGeometry:Wv,Spherical:R$,SphericalHarmonics3:y$,SplineCurve:tU,SpotLight:lU,SpotLightHelper:gve,Sprite:WJ,SpriteMaterial:GP,SrcAlphaFactor:p2,SrcAlphaSaturateFactor:fJ,SrcColorFactor:aJ,StaticCopyUsage:jge,StaticDrawUsage:H1,StaticReadUsage:Fge,StereoCamera:G0e,StreamCopyUsage:Vge,StreamDrawUsage:Uge,StreamReadUsage:zge,StringKeyframeTrack:ug,SubtractEquation:QY,SubtractiveBlending:WO,TOUCH:mge,TangentSpaceNormalMap:qd,TetrahedronGeometry:sC,Texture:nr,TextureLoader:lv,TextureUtils:Lve,Timer:uve,TimestampQuery:Wge,TorusGeometry:oC,TorusKnotGeometry:lC,Triangle:Fo,TriangleFanDrawMode:Y2,TriangleStripDrawMode:PP,TrianglesDrawMode:AJ,TubeGeometry:cC,UVMapping:Fd,Uint16BufferAttribute:jP,Uint32BufferAttribute:HP,Uint8BufferAttribute:Cbe,Uint8ClampedBufferAttribute:Rbe,Uniform:mC,UniformsGroup:cve,UniformsLib:en,UniformsUtils:av,UnsignedByteType:To,UnsignedInt248Type:J0,UnsignedInt5999Type:DP,UnsignedIntType:wc,UnsignedShort4444Type:FA,UnsignedShort5551Type:BA,UnsignedShortType:Y0,VSMShadowMap:Xc,Vector2:wt,Vector3:te,Vector4:ei,VectorKeyframeTrack:Wm,VideoFrameTexture:$be,VideoTexture:KJ,WebGL3DRenderTarget:gbe,WebGLArrayRenderTarget:mbe,WebGLCoordinateSystem:gl,WebGLCubeRenderTarget:VP,WebGLRenderTarget:Ec,WebGLRenderer:bU,WebGLUtils:gU,WebGPUCoordinateSystem:tv,WebXRController:hM,WireframeGeometry:nU,WrapAroundEnding:z1,ZeroCurvatureEnding:am,ZeroFactor:iJ,ZeroSlopeEnding:sm,ZeroStencilOp:wge,createCanvasElement:FJ},Symbol.toStringTag,{value:"Module"}));var F$={exports:{}},$d={};/**
 * @license React
 * react-reconciler-constants.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */$d.ConcurrentRoot=1;$d.ContinuousEventPriority=8;$d.DefaultEventPriority=32;$d.DiscreteEventPriority=2;$d.IdleEventPriority=268435456;$d.LegacyRoot=0;$d.NoEventPriority=0;F$.exports=$d;var pM=F$.exports,B$={exports:{}},z$={},j$={exports:{}},H$={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var cv=I;function bSe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var vSe=typeof Object.is=="function"?Object.is:bSe,ySe=cv.useState,xSe=cv.useEffect,_Se=cv.useLayoutEffect,SSe=cv.useDebugValue;function wSe(t,e){var n=e(),i=ySe({inst:{value:n,getSnapshot:e}}),r=i[0].inst,a=i[1];return _Se(function(){r.value=n,r.getSnapshot=e,Gk(r)&&a({inst:r})},[t,n,e]),xSe(function(){return Gk(r)&&a({inst:r}),t(function(){Gk(r)&&a({inst:r})})},[t]),SSe(n),n}function Gk(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!vSe(t,n)}catch{return!0}}function ESe(t,e){return e()}var MSe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ESe:wSe;H$.useSyncExternalStore=cv.useSyncExternalStore!==void 0?cv.useSyncExternalStore:MSe;j$.exports=H$;var TSe=j$.exports;/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var bC=I,ASe=TSe;function CSe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var RSe=typeof Object.is=="function"?Object.is:CSe,kSe=ASe.useSyncExternalStore,DSe=bC.useRef,OSe=bC.useEffect,ISe=bC.useMemo,NSe=bC.useDebugValue;z$.useSyncExternalStoreWithSelector=function(t,e,n,i,r){var a=DSe(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=ISe(function(){function l(d){if(!c){if(c=!0,u=d,d=i(d),r!==void 0&&s.hasValue){var g=s.value;if(r(g,d))return f=g}return f=d}if(g=f,RSe(u,d))return g;var b=i(d);return r!==void 0&&r(g,b)?(u=d,g):(u=d,f=b)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,i,r]);var o=kSe(t,a[0],a[1]);return OSe(function(){s.hasValue=!0,s.value=o},[o]),NSe(o),o};B$.exports=z$;var LSe=B$.exports;const V$=Mc(LSe),s5=t=>{let e;const n=new Set,i=(c,u)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const h=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(d=>d(e,h))}},r=()=>e,o={setState:i,getState:r,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=e=t(i,r,o);return o},PSe=t=>t?s5(t):s5,{useSyncExternalStoreWithSelector:USe}=V$,FSe=t=>t;function BSe(t,e=FSe,n){const i=USe(t.subscribe,t.getState,t.getInitialState,e,n);return Ee.useDebugValue(i),i}const o5=(t,e)=>{const n=PSe(t),i=(r,a=e)=>BSe(n,r,a);return Object.assign(i,n),i},G$=(t,e)=>t?o5(t,e):o5,zSe=t=>typeof t=="object"&&typeof t.then=="function",cm=[];function W$(t,e,n=(i,r)=>i===r){if(t===e)return!0;if(!t||!e)return!1;const i=t.length;if(e.length!==i)return!1;for(let r=0;r<i;r++)if(!n(t[r],e[r]))return!1;return!0}function q$(t,e=null,n=!1,i={}){e===null&&(e=[t]);for(const a of cm)if(W$(e,a.keys,a.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(a,"error"))throw a.error;if(Object.prototype.hasOwnProperty.call(a,"response"))return i.lifespan&&i.lifespan>0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,i.lifespan)),a.response;if(!n)throw a.promise}const r={keys:e,equal:i.equal,remove:()=>{const a=cm.indexOf(r);a!==-1&&cm.splice(a,1)},promise:(zSe(t)?t:t(...e)).then(a=>{r.response=a,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(a=>r.error=a)};if(cm.push(r),!n)throw r.promise}const jSe=(t,e,n)=>q$(t,e,!1,n),HSe=(t,e,n)=>void q$(t,e,!0,n),VSe=t=>{if(t===void 0||t.length===0)cm.splice(0,cm.length);else{const e=cm.find(n=>W$(t,n.keys,n.equal));e&&e.remove()}};var X$={exports:{}},K$={exports:{}},Y$={exports:{}},J$={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(t){function e(B,G){var H=B.length;B.push(G);e:for(;0<H;){var W=H-1>>>1,F=B[W];if(0<r(F,G))B[W]=G,B[H]=F,H=W;else break e}}function n(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var G=B[0],H=B.pop();if(H!==G){B[0]=H;e:for(var W=0,F=B.length,Y=F>>>1;W<Y;){var Z=2*(W+1)-1,V=B[Z],de=Z+1,se=B[de];if(0>r(V,H))de<F&&0>r(se,V)?(B[W]=se,B[de]=H,W=de):(B[W]=V,B[Z]=H,W=Z);else if(de<F&&0>r(se,H))B[W]=se,B[de]=H,W=de;else break e}}return G}function r(B,G){var H=B.sortIndex-G.sortIndex;return H!==0?H:B.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],c=[],u=1,f=null,h=3,d=!1,g=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function _(B){for(var G=n(c);G!==null;){if(G.callback===null)i(c);else if(G.startTime<=B)i(c),G.sortIndex=G.expirationTime,e(l,G);else break;G=n(c)}}function w(B){if(b=!1,_(B),!g)if(n(l)!==null)g=!0,z();else{var G=n(c);G!==null&&q(w,G.startTime-B)}}var M=!1,S=-1,A=5,C=-1;function D(){return!(t.unstable_now()-C<A)}function R(){if(M){var B=t.unstable_now();C=B;var G=!0;try{e:{g=!1,b&&(b=!1,p(S),S=-1),d=!0;var H=h;try{t:{for(_(B),f=n(l);f!==null&&!(f.expirationTime>B&&D());){var W=f.callback;if(typeof W=="function"){f.callback=null,h=f.priorityLevel;var F=W(f.expirationTime<=B);if(B=t.unstable_now(),typeof F=="function"){f.callback=F,_(B),G=!0;break t}f===n(l)&&i(l),_(B)}else i(l);f=n(l)}if(f!==null)G=!0;else{var Y=n(c);Y!==null&&q(w,Y.startTime-B),G=!1}}break e}finally{f=null,h=H,d=!1}G=void 0}}finally{G?N():M=!1}}}var N;if(typeof x=="function")N=function(){x(R)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,j=U.port2;U.port1.onmessage=R,N=function(){j.postMessage(null)}}else N=function(){y(R,0)};function z(){M||(M=!0,N())}function q(B,G){S=y(function(){B(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_continueExecution=function(){g||d||(g=!0,z())},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(B){switch(h){case 1:case 2:case 3:var G=3;break;default:G=h}var H=h;h=G;try{return B()}finally{h=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var H=h;h=B;try{return G()}finally{h=H}},t.unstable_scheduleCallback=function(B,G,H){var W=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?W+H:W):H=W,B){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=H+F,B={id:u++,callback:G,priorityLevel:B,startTime:H,expirationTime:F,sortIndex:-1},H>W?(B.sortIndex=H,e(c,B),n(l)===null&&B===n(c)&&(b?(p(S),S=-1):b=!0,q(w,H-W))):(B.sortIndex=F,e(l,B),g||d||(g=!0,z())),B},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(B){var G=h;return function(){var H=h;h=G;try{return B.apply(this,arguments)}finally{h=H}}}})(J$);Y$.exports=J$;var aI=Y$.exports;/**
 * @license React
 * react-reconciler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(t){t.exports=function(e){function n(m,v,T,O){return new Lne(m,v,T,O)}function i(){}function r(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)v+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(m){return m===null||typeof m!="object"?null:(m=c9&&m[c9]||m["@@iterator"],typeof m=="function"?m:null)}function s(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===jne?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case xg:return"Fragment";case yg:return"Portal";case bR:return"Profiler";case s9:return"StrictMode";case yR:return"Suspense";case xR:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case kh:return(m.displayName||"Context")+".Provider";case o9:return(m._context.displayName||"Context")+".Consumer";case vR:var v=m.render;return m=m.displayName,m||(m=v.displayName||v.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case _R:return v=m.displayName||null,v!==null?v:s(m.type)||"Memo";case Dh:v=m._payload,m=m._init;try{return s(m(v))}catch{}}return null}function o(m){if(SR===void 0)try{throw Error()}catch(T){var v=T.stack.trim().match(/\n( *(at )?)/);SR=v&&v[1]||"",u9=-1<T.stack.indexOf(`
    at`)?" (<anonymous>)":-1<T.stack.indexOf("@")?"@unknown:0:0":""}return`
`+SR+m+u9}function l(m,v){if(!m||wR)return"";wR=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var O={DetermineComponentFrameRoot:function(){try{if(v){var an=function(){throw Error()};if(Object.defineProperty(an.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(an,[])}catch(Zn){var sn=Zn}Reflect.construct(m,[],an)}else{try{an.call()}catch(Zn){sn=Zn}m.call(an.prototype)}}else{try{throw Error()}catch(Zn){sn=Zn}(an=m())&&typeof an.catch=="function"&&an.catch(function(){})}}catch(Zn){if(Zn&&sn&&typeof Zn.stack=="string")return[Zn.stack,sn.stack]}return[null,null]}};O.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var P=Object.getOwnPropertyDescriptor(O.DetermineComponentFrameRoot,"name");P&&P.configurable&&Object.defineProperty(O.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var X=O.DetermineComponentFrameRoot(),be=X[0],Be=X[1];if(be&&Be){var nt=be.split(`
`),Ct=Be.split(`
`);for(P=O=0;O<nt.length&&!nt[O].includes("DetermineComponentFrameRoot");)O++;for(;P<Ct.length&&!Ct[P].includes("DetermineComponentFrameRoot");)P++;if(O===nt.length||P===Ct.length)for(O=nt.length-1,P=Ct.length-1;1<=O&&0<=P&&nt[O]!==Ct[P];)P--;for(;1<=O&&0<=P;O--,P--)if(nt[O]!==Ct[P]){if(O!==1||P!==1)do if(O--,P--,0>P||nt[O]!==Ct[P]){var qt=`
`+nt[O].replace(" at new "," at ");return m.displayName&&qt.includes("<anonymous>")&&(qt=qt.replace("<anonymous>",m.displayName)),qt}while(1<=O&&0<=P);break}}}finally{wR=!1,Error.prepareStackTrace=T}return(T=m?m.displayName||m.name:"")?o(T):""}function c(m){switch(m.tag){case 26:case 27:case 5:return o(m.type);case 16:return o("Lazy");case 13:return o("Suspense");case 19:return o("SuspenseList");case 0:case 15:return m=l(m.type,!1),m;case 11:return m=l(m.type.render,!1),m;case 1:return m=l(m.type,!0),m;default:return""}}function u(m){try{var v="";do v+=c(m),m=m.return;while(m);return v}catch(T){return`
Error generating stack: `+T.message+`
`+T.stack}}function f(m){var v=m,T=m;if(m.alternate)for(;v.return;)v=v.return;else{m=v;do v=m,v.flags&4098&&(T=v.return),m=v.return;while(m)}return v.tag===3?T:null}function h(m){if(f(m)!==m)throw Error(r(188))}function d(m){var v=m.alternate;if(!v){if(v=f(m),v===null)throw Error(r(188));return v!==m?null:m}for(var T=m,O=v;;){var P=T.return;if(P===null)break;var X=P.alternate;if(X===null){if(O=P.return,O!==null){T=O;continue}break}if(P.child===X.child){for(X=P.child;X;){if(X===T)return h(P),m;if(X===O)return h(P),v;X=X.sibling}throw Error(r(188))}if(T.return!==O.return)T=P,O=X;else{for(var be=!1,Be=P.child;Be;){if(Be===T){be=!0,T=P,O=X;break}if(Be===O){be=!0,O=P,T=X;break}Be=Be.sibling}if(!be){for(Be=X.child;Be;){if(Be===T){be=!0,T=X,O=P;break}if(Be===O){be=!0,O=X,T=P;break}Be=Be.sibling}if(!be)throw Error(r(189))}}if(T.alternate!==O)throw Error(r(190))}if(T.tag!==3)throw Error(r(188));return T.stateNode.current===T?m:v}function g(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(v=g(m),v!==null)return v;m=m.sibling}return null}function b(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(m.tag!==4&&(v=b(m),v!==null))return v;m=m.sibling}return null}function y(m){return{current:m}}function p(m){0>Sg||(m.current=RR[Sg],RR[Sg]=null,Sg--)}function x(m,v){Sg++,RR[Sg]=m.current,m.current=v}function _(m){return m>>>=0,m===0?32:31-(nre(m)/ire|0)|0}function w(m){var v=m&42;if(v!==0)return v;switch(m&-m){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:return 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 m&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return m&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return m}}function M(m,v){var T=m.pendingLanes;if(T===0)return 0;var O=0,P=m.suspendedLanes,X=m.pingedLanes,be=m.warmLanes;m=m.finishedLanes!==0;var Be=T&134217727;return Be!==0?(T=Be&~P,T!==0?O=w(T):(X&=Be,X!==0?O=w(X):m||(be=Be&~be,be!==0&&(O=w(be))))):(Be=T&~P,Be!==0?O=w(Be):X!==0?O=w(X):m||(be=T&~be,be!==0&&(O=w(be)))),O===0?0:v!==0&&v!==O&&!(v&P)&&(P=O&-O,be=v&-v,P>=be||P===32&&(be&4194176)!==0)?v:O}function S(m,v){return(m.pendingLanes&~(m.suspendedLanes&~m.pingedLanes)&v)===0}function A(m,v){switch(m){case 1:case 2:case 4:case 8:return v+250;case 16:case 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 v+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function C(){var m=gS;return gS<<=1,!(gS&4194176)&&(gS=128),m}function D(){var m=bS;return bS<<=1,!(bS&62914560)&&(bS=4194304),m}function R(m){for(var v=[],T=0;31>T;T++)v.push(m);return v}function N(m,v){m.pendingLanes|=v,v!==268435456&&(m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0)}function U(m,v,T,O,P,X){var be=m.pendingLanes;m.pendingLanes=T,m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0,m.expiredLanes&=T,m.entangledLanes&=T,m.errorRecoveryDisabledLanes&=T,m.shellSuspendCounter=0;var Be=m.entanglements,nt=m.expirationTimes,Ct=m.hiddenUpdates;for(T=be&~T;0<T;){var qt=31-el(T),an=1<<qt;Be[qt]=0,nt[qt]=-1;var sn=Ct[qt];if(sn!==null)for(Ct[qt]=null,qt=0;qt<sn.length;qt++){var Zn=sn[qt];Zn!==null&&(Zn.lane&=-536870913)}T&=~an}O!==0&&j(m,O,0),X!==0&&P===0&&m.tag!==0&&(m.suspendedLanes|=X&~(be&~v))}function j(m,v,T){m.pendingLanes|=v,m.suspendedLanes&=~v;var O=31-el(v);m.entangledLanes|=v,m.entanglements[O]=m.entanglements[O]|1073741824|T&4194218}function z(m,v){var T=m.entangledLanes|=v;for(m=m.entanglements;T;){var O=31-el(T),P=1<<O;P&v|m[O]&v&&(m[O]|=v),T&=~P}}function q(m){return m&=-m,2<m?8<m?m&134217727?32:268435456:8:2}function B(m){if(tl&&typeof tl.onCommitFiberRoot=="function")try{tl.onCommitFiberRoot(hy,m,void 0,(m.current.flags&128)===128)}catch{}}function G(m){if(typeof lre=="function"&&cre(m),tl&&typeof tl.setStrictMode=="function")try{tl.setStrictMode(hy,m)}catch{}}function H(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}function W(m,v){if(typeof m=="object"&&m!==null){var T=P9.get(m);return T!==void 0?T:(v={value:m,source:v,stack:u(v)},P9.set(m,v),v)}return{value:m,source:v,stack:u(v)}}function F(m,v){Eg[Mg++]=xS,Eg[Mg++]=yS,yS=m,xS=v}function Y(m,v,T){Fl[Bl++]=Sf,Fl[Bl++]=wf,Fl[Bl++]=lp,lp=m;var O=Sf;m=wf;var P=32-el(O)-1;O&=~(1<<P),T+=1;var X=32-el(v)+P;if(30<X){var be=P-P%5;X=(O&(1<<be)-1).toString(32),O>>=be,P-=be,Sf=1<<32-el(v)+P|T<<P|O,wf=X+m}else Sf=1<<X|T<<P|O,wf=m}function Z(m){m.return!==null&&(F(m,1),Y(m,1,0))}function V(m){for(;m===yS;)yS=Eg[--Mg],Eg[Mg]=null,xS=Eg[--Mg],Eg[Mg]=null;for(;m===lp;)lp=Fl[--Bl],Fl[Bl]=null,wf=Fl[--Bl],Fl[Bl]=null,Sf=Fl[--Bl],Fl[Bl]=null}function de(m,v){x(Ih,v),x(dy,m),x(ds,null),m=Gne(v),p(ds),x(ds,m)}function se(){p(ds),p(dy),p(Ih)}function oe(m){m.memoizedState!==null&&x(_S,m);var v=ds.current,T=Wne(v,m.type);v!==T&&(x(dy,m),x(ds,T))}function ue(m){dy.current===m&&(p(ds),p(dy)),_S.current===m&&(p(_S),_f?op._currentValue=_g:op._currentValue2=_g)}function _e(m){var v=Error(r(418,""));throw pe(W(v,m)),OR}function ke(m,v){if(!Pl)throw Error(r(175));Fie(m.stateNode,m.type,m.memoizedProps,v,m)||_e(m)}function Ne(m){for(ho=m.return;ho;)switch(ho.tag){case 3:case 27:Eu=!0;return;case 5:case 13:Eu=!1;return;default:ho=ho.return}}function Ue(m){if(!Pl||m!==ho)return!1;if(!Vi)return Ne(m),Vi=!0,!1;var v=!1;if(Ks?m.tag!==3&&m.tag!==27&&(m.tag!==5||M9(m.type)&&!mS(m.type,m.memoizedProps))&&(v=!0):m.tag!==3&&(m.tag!==5||M9(m.type)&&!mS(m.type,m.memoizedProps))&&(v=!0),v&&Ys&&_e(m),Ne(m),m.tag===13){if(!Pl)throw Error(r(316));if(m=m.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));Ys=jie(m)}else Ys=ho?w9(m.stateNode):null;return!0}function ze(){Pl&&(Ys=ho=null,Vi=!1)}function pe(m){Fc===null?Fc=[m]:Fc.push(m)}function Fe(){for(var m=Tg,v=IR=Tg=0;v<m;){var T=zl[v];zl[v++]=null;var O=zl[v];zl[v++]=null;var P=zl[v];zl[v++]=null;var X=zl[v];if(zl[v++]=null,O!==null&&P!==null){var be=O.pending;be===null?P.next=P:(P.next=be.next,be.next=P),O.pending=P}X!==0&&Te(T,P,X)}}function Ie(m,v,T,O){zl[Tg++]=m,zl[Tg++]=v,zl[Tg++]=T,zl[Tg++]=O,IR|=O,m.lanes|=O,m=m.alternate,m!==null&&(m.lanes|=O)}function qe(m,v,T,O){return Ie(m,v,T,O),Ae(m)}function we(m,v){return Ie(m,null,null,v),Ae(m)}function Te(m,v,T){m.lanes|=T;var O=m.alternate;O!==null&&(O.lanes|=T);for(var P=!1,X=m.return;X!==null;)X.childLanes|=T,O=X.alternate,O!==null&&(O.childLanes|=T),X.tag===22&&(m=X.stateNode,m===null||m._visibility&1||(P=!0)),m=X,X=X.return;P&&v!==null&&m.tag===3&&(X=m.stateNode,P=31-el(T),X=X.hiddenUpdates,m=X[P],m===null?X[P]=[v]:m.push(v),v.lane=T|536870912)}function Ae(m){if(50<Sy)throw Sy=0,YR=null,Error(r(185));for(var v=m.return;v!==null;)m=v,v=m.return;return m.tag===3?m.stateNode:null}function Pe(m){m!==Ag&&m.next===null&&(Ag===null?SS=Ag=m:Ag=Ag.next=m),wS=!0,NR||(NR=!0,fe($e))}function He(m,v){if(!LR&&wS){LR=!0;do for(var T=!1,O=SS;O!==null;){if(m!==0){var P=O.pendingLanes;if(P===0)var X=0;else{var be=O.suspendedLanes,Be=O.pingedLanes;X=(1<<31-el(42|m)+1)-1,X&=P&~(be&~Be),X=X&201326677?X&201326677|1:X?X|2:0}X!==0&&(T=!0,ce(O,X))}else X=Ui,X=M(O,O===Ar?X:0),!(X&3)||S(O,X)||(T=!0,ce(O,X));O=O.next}while(T);LR=!1}}function $e(){wS=NR=!1;var m=0;Cg!==0&&(Qne()&&(m=Cg),Cg=0);for(var v=Uc(),T=null,O=SS;O!==null;){var P=O.next,X=ie(O,v);X===0?(O.next=null,T===null?SS=P:T.next=P,P===null&&(Ag=T)):(T=O,(m!==0||X&3)&&(wS=!0)),O=P}He(m)}function ie(m,v){for(var T=m.suspendedLanes,O=m.pingedLanes,P=m.expirationTimes,X=m.pendingLanes&-62914561;0<X;){var be=31-el(X),Be=1<<be,nt=P[be];nt===-1?(!(Be&T)||Be&O)&&(P[be]=A(Be,v)):nt<=v&&(m.expiredLanes|=Be),X&=~Be}if(v=Ar,T=Ui,T=M(m,m===v?T:0),O=m.callbackNode,T===0||m===v&&Cr===2||m.cancelPendingCommit!==null)return O!==null&&O!==null&&kR(O),m.callbackNode=null,m.callbackPriority=0;if(!(T&3)||S(m,T)){if(v=T&-T,v===m.callbackPriority)return v;switch(O!==null&&kR(O),q(T)){case 2:case 8:T=sre;break;case 32:T=DR;break;case 268435456:T=ore;break;default:T=DR}return O=K.bind(null,m),T=vS(T,O),m.callbackPriority=v,m.callbackNode=T,v}return O!==null&&O!==null&&kR(O),m.callbackPriority=2,m.callbackNode=null,2}function K(m,v){var T=m.callbackNode;if(rp()&&m.callbackNode!==T)return null;var O=Ui;return O=M(m,m===Ar?O:0),O===0?null:(B4(m,O,v),ie(m,Uc()),m.callbackNode!=null&&m.callbackNode===T?K.bind(null,m):null)}function ce(m,v){if(rp())return null;B4(m,v,!0)}function fe(m){aie?sie(function(){mr&6?vS(L9,m):m()}):vS(L9,m)}function me(){return Cg===0&&(Cg=C()),Cg}function $(m,v){if(py===null){var T=py=[];PR=0,Rg=me(),kg={status:"pending",value:void 0,then:function(O){T.push(O)}}}return PR++,v.then(Le,Le),v}function Le(){if(--PR===0&&py!==null){kg!==null&&(kg.status="fulfilled");var m=py;py=null,Rg=0,kg=null;for(var v=0;v<m.length;v++)(0,m[v])()}}function Xe(m,v){var T=[],O={status:"pending",value:null,reason:null,then:function(P){T.push(P)}};return m.then(function(){O.status="fulfilled",O.value=v;for(var P=0;P<T.length;P++)(0,T[P])(v)},function(P){for(O.status="rejected",O.reason=P,P=0;P<T.length;P++)(0,T[P])(void 0)}),O}function mt(m){m.updateQueue={baseState:m.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ge(m,v){m=m.updateQueue,v.updateQueue===m&&(v.updateQueue={baseState:m.baseState,firstBaseUpdate:m.firstBaseUpdate,lastBaseUpdate:m.lastBaseUpdate,shared:m.shared,callbacks:null})}function Je(m){return{lane:m,tag:0,payload:null,callback:null,next:null}}function tt(m,v,T){var O=m.updateQueue;if(O===null)return null;if(O=O.shared,mr&2){var P=O.pending;return P===null?v.next=v:(v.next=P.next,P.next=v),O.pending=v,v=Ae(m),Te(m,null,T),v}return Ie(m,O,v,T),Ae(m)}function xt(m,v,T){if(v=v.updateQueue,v!==null&&(v=v.shared,(T&4194176)!==0)){var O=v.lanes;O&=m.pendingLanes,T|=O,v.lanes=T,z(m,T)}}function Tt(m,v){var T=m.updateQueue,O=m.alternate;if(O!==null&&(O=O.updateQueue,T===O)){var P=null,X=null;if(T=T.firstBaseUpdate,T!==null){do{var be={lane:T.lane,tag:T.tag,payload:T.payload,callback:null,next:null};X===null?P=X=be:X=X.next=be,T=T.next}while(T!==null);X===null?P=X=v:X=X.next=v}else P=X=v;T={baseState:O.baseState,firstBaseUpdate:P,lastBaseUpdate:X,shared:O.shared,callbacks:O.callbacks},m.updateQueue=T;return}m=T.lastBaseUpdate,m===null?T.firstBaseUpdate=v:m.next=v,T.lastBaseUpdate=v}function bt(){if(UR){var m=kg;if(m!==null)throw m}}function Rt(m,v,T,O){UR=!1;var P=m.updateQueue;Nh=!1;var X=P.firstBaseUpdate,be=P.lastBaseUpdate,Be=P.shared.pending;if(Be!==null){P.shared.pending=null;var nt=Be,Ct=nt.next;nt.next=null,be===null?X=Ct:be.next=Ct,be=nt;var qt=m.alternate;qt!==null&&(qt=qt.updateQueue,Be=qt.lastBaseUpdate,Be!==be&&(Be===null?qt.firstBaseUpdate=Ct:Be.next=Ct,qt.lastBaseUpdate=nt))}if(X!==null){var an=P.baseState;be=0,qt=Ct=nt=null,Be=X;do{var sn=Be.lane&-536870913,Zn=sn!==Be.lane;if(Zn?(Ui&sn)===sn:(O&sn)===sn){sn!==0&&sn===Rg&&(UR=!0),qt!==null&&(qt=qt.next={lane:0,tag:Be.tag,payload:Be.payload,callback:null,next:null});e:{var Vl=m,wy=Be;sn=v;var bp=T;switch(wy.tag){case 1:if(Vl=wy.payload,typeof Vl=="function"){an=Vl.call(bp,an,sn);break e}an=Vl;break e;case 3:Vl.flags=Vl.flags&-65537|128;case 0:if(Vl=wy.payload,sn=typeof Vl=="function"?Vl.call(bp,an,sn):Vl,sn==null)break e;an=gR({},an,sn);break e;case 2:Nh=!0}}sn=Be.callback,sn!==null&&(m.flags|=64,Zn&&(m.flags|=8192),Zn=P.callbacks,Zn===null?P.callbacks=[sn]:Zn.push(sn))}else Zn={lane:sn,tag:Be.tag,payload:Be.payload,callback:Be.callback,next:null},qt===null?(Ct=qt=Zn,nt=an):qt=qt.next=Zn,be|=sn;if(Be=Be.next,Be===null){if(Be=P.shared.pending,Be===null)break;Zn=Be,Be=Zn.next,Zn.next=null,P.lastBaseUpdate=Zn,P.shared.pending=null}}while(!0);qt===null&&(nt=an),P.baseState=nt,P.firstBaseUpdate=Ct,P.lastBaseUpdate=qt,X===null&&(P.shared.lanes=0),Uh|=be,m.lanes=be,m.memoizedState=an}}function Oe(m,v){if(typeof m!="function")throw Error(r(191,m));m.call(v)}function Ve(m,v){var T=m.callbacks;if(T!==null)for(m.callbacks=null,m=0;m<T.length;m++)Oe(T[m],v)}function ht(m,v){if(nl(m,v))return!0;if(typeof m!="object"||m===null||typeof v!="object"||v===null)return!1;var T=Object.keys(m),O=Object.keys(v);if(T.length!==O.length)return!1;for(O=0;O<T.length;O++){var P=T[O];if(!ure.call(v,P)||!nl(m[P],v[P]))return!1}return!0}function Ft(m){return m=m.status,m==="fulfilled"||m==="rejected"}function st(){}function it(m,v,T){switch(T=m[T],T===void 0?m.push(v):T!==v&&(v.then(st,st),v=T),v.status){case"fulfilled":return v.value;case"rejected":throw m=v.reason,m===my?Error(r(483)):m;default:if(typeof v.status=="string")v.then(st,st);else{if(m=Ar,m!==null&&100<m.shellSuspendCounter)throw Error(r(482));m=v,m.status="pending",m.then(function(O){if(v.status==="pending"){var P=v;P.status="fulfilled",P.value=O}},function(O){if(v.status==="pending"){var P=v;P.status="rejected",P.reason=O}})}switch(v.status){case"fulfilled":return v.value;case"rejected":throw m=v.reason,m===my?Error(r(483)):m}throw Dg=v,my}}function vt(){if(Dg===null)throw Error(r(459));var m=Dg;return Dg=null,m}function Kt(m){var v=gy;return gy+=1,Og===null&&(Og=[]),it(Og,m,v)}function Xt(m,v){v=v.props.ref,m.ref=v!==void 0?v:null}function cn(m,v){throw v.$$typeof===Fne?Error(r(525)):(m=Object.prototype.toString.call(v),Error(r(31,m==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":m)))}function Gn(m){var v=m._init;return v(m._payload)}function bn(m){function v(ct,Qe){if(m){var gt=ct.deletions;gt===null?(ct.deletions=[Qe],ct.flags|=16):gt.push(Qe)}}function T(ct,Qe){if(!m)return null;for(;Qe!==null;)v(ct,Qe),Qe=Qe.sibling;return null}function O(ct){for(var Qe=new Map;ct!==null;)ct.key!==null?Qe.set(ct.key,ct):Qe.set(ct.index,ct),ct=ct.sibling;return Qe}function P(ct,Qe){return ct=Rh(ct,Qe),ct.index=0,ct.sibling=null,ct}function X(ct,Qe,gt){return ct.index=gt,m?(gt=ct.alternate,gt!==null?(gt=gt.index,gt<Qe?(ct.flags|=33554434,Qe):gt):(ct.flags|=33554434,Qe)):(ct.flags|=1048576,Qe)}function be(ct){return m&&ct.alternate===null&&(ct.flags|=33554434),ct}function Be(ct,Qe,gt,Vt){return Qe===null||Qe.tag!==6?(Qe=dR(gt,ct.mode,Vt),Qe.return=ct,Qe):(Qe=P(Qe,gt),Qe.return=ct,Qe)}function nt(ct,Qe,gt,Vt){var Sn=gt.type;return Sn===xg?qt(ct,Qe,gt.props.children,Vt,gt.key):Qe!==null&&(Qe.elementType===Sn||typeof Sn=="object"&&Sn!==null&&Sn.$$typeof===Dh&&Gn(Sn)===Qe.type)?(Qe=P(Qe,gt.props),Xt(Qe,gt),Qe.return=ct,Qe):(Qe=hS(gt.type,gt.key,gt.props,null,ct.mode,Vt),Xt(Qe,gt),Qe.return=ct,Qe)}function Ct(ct,Qe,gt,Vt){return Qe===null||Qe.tag!==4||Qe.stateNode.containerInfo!==gt.containerInfo||Qe.stateNode.implementation!==gt.implementation?(Qe=pR(gt,ct.mode,Vt),Qe.return=ct,Qe):(Qe=P(Qe,gt.children||[]),Qe.return=ct,Qe)}function qt(ct,Qe,gt,Vt,Sn){return Qe===null||Qe.tag!==7?(Qe=ap(gt,ct.mode,Vt,Sn),Qe.return=ct,Qe):(Qe=P(Qe,gt),Qe.return=ct,Qe)}function an(ct,Qe,gt){if(typeof Qe=="string"&&Qe!==""||typeof Qe=="number"||typeof Qe=="bigint")return Qe=dR(""+Qe,ct.mode,gt),Qe.return=ct,Qe;if(typeof Qe=="object"&&Qe!==null){switch(Qe.$$typeof){case dS:return gt=hS(Qe.type,Qe.key,Qe.props,null,ct.mode,gt),Xt(gt,Qe),gt.return=ct,gt;case yg:return Qe=pR(Qe,ct.mode,gt),Qe.return=ct,Qe;case Dh:var Vt=Qe._init;return Qe=Vt(Qe._payload),an(ct,Qe,gt)}if(pS(Qe)||a(Qe))return Qe=ap(Qe,ct.mode,gt,null),Qe.return=ct,Qe;if(typeof Qe.then=="function")return an(ct,Kt(Qe),gt);if(Qe.$$typeof===kh)return an(ct,np(ct,Qe),gt);cn(ct,Qe)}return null}function sn(ct,Qe,gt,Vt){var Sn=Qe!==null?Qe.key:null;if(typeof gt=="string"&&gt!==""||typeof gt=="number"||typeof gt=="bigint")return Sn!==null?null:Be(ct,Qe,""+gt,Vt);if(typeof gt=="object"&&gt!==null){switch(gt.$$typeof){case dS:return gt.key===Sn?nt(ct,Qe,gt,Vt):null;case yg:return gt.key===Sn?Ct(ct,Qe,gt,Vt):null;case Dh:return Sn=gt._init,gt=Sn(gt._payload),sn(ct,Qe,gt,Vt)}if(pS(gt)||a(gt))return Sn!==null?null:qt(ct,Qe,gt,Vt,null);if(typeof gt.then=="function")return sn(ct,Qe,Kt(gt),Vt);if(gt.$$typeof===kh)return sn(ct,Qe,np(ct,gt),Vt);cn(ct,gt)}return null}function Zn(ct,Qe,gt,Vt,Sn){if(typeof Vt=="string"&&Vt!==""||typeof Vt=="number"||typeof Vt=="bigint")return ct=ct.get(gt)||null,Be(Qe,ct,""+Vt,Sn);if(typeof Vt=="object"&&Vt!==null){switch(Vt.$$typeof){case dS:return ct=ct.get(Vt.key===null?gt:Vt.key)||null,nt(Qe,ct,Vt,Sn);case yg:return ct=ct.get(Vt.key===null?gt:Vt.key)||null,Ct(Qe,ct,Vt,Sn);case Dh:var Pr=Vt._init;return Vt=Pr(Vt._payload),Zn(ct,Qe,gt,Vt,Sn)}if(pS(Vt)||a(Vt))return ct=ct.get(gt)||null,qt(Qe,ct,Vt,Sn,null);if(typeof Vt.then=="function")return Zn(ct,Qe,gt,Kt(Vt),Sn);if(Vt.$$typeof===kh)return Zn(ct,Qe,gt,np(Qe,Vt),Sn);cn(Qe,Vt)}return null}function Vl(ct,Qe,gt,Vt){for(var Sn=null,Pr=null,Bn=Qe,Gi=Qe=0,Ka=null;Bn!==null&&Gi<gt.length;Gi++){Bn.index>Gi?(Ka=Bn,Bn=null):Ka=Bn.sibling;var Wi=sn(ct,Bn,gt[Gi],Vt);if(Wi===null){Bn===null&&(Bn=Ka);break}m&&Bn&&Wi.alternate===null&&v(ct,Bn),Qe=X(Wi,Qe,Gi),Pr===null?Sn=Wi:Pr.sibling=Wi,Pr=Wi,Bn=Ka}if(Gi===gt.length)return T(ct,Bn),Vi&&F(ct,Gi),Sn;if(Bn===null){for(;Gi<gt.length;Gi++)Bn=an(ct,gt[Gi],Vt),Bn!==null&&(Qe=X(Bn,Qe,Gi),Pr===null?Sn=Bn:Pr.sibling=Bn,Pr=Bn);return Vi&&F(ct,Gi),Sn}for(Bn=O(Bn);Gi<gt.length;Gi++)Ka=Zn(Bn,ct,Gi,gt[Gi],Vt),Ka!==null&&(m&&Ka.alternate!==null&&Bn.delete(Ka.key===null?Gi:Ka.key),Qe=X(Ka,Qe,Gi),Pr===null?Sn=Ka:Pr.sibling=Ka,Pr=Ka);return m&&Bn.forEach(function(Bh){return v(ct,Bh)}),Vi&&F(ct,Gi),Sn}function wy(ct,Qe,gt,Vt){if(gt==null)throw Error(r(151));for(var Sn=null,Pr=null,Bn=Qe,Gi=Qe=0,Ka=null,Wi=gt.next();Bn!==null&&!Wi.done;Gi++,Wi=gt.next()){Bn.index>Gi?(Ka=Bn,Bn=null):Ka=Bn.sibling;var Bh=sn(ct,Bn,Wi.value,Vt);if(Bh===null){Bn===null&&(Bn=Ka);break}m&&Bn&&Bh.alternate===null&&v(ct,Bn),Qe=X(Bh,Qe,Gi),Pr===null?Sn=Bh:Pr.sibling=Bh,Pr=Bh,Bn=Ka}if(Wi.done)return T(ct,Bn),Vi&&F(ct,Gi),Sn;if(Bn===null){for(;!Wi.done;Gi++,Wi=gt.next())Wi=an(ct,Wi.value,Vt),Wi!==null&&(Qe=X(Wi,Qe,Gi),Pr===null?Sn=Wi:Pr.sibling=Wi,Pr=Wi);return Vi&&F(ct,Gi),Sn}for(Bn=O(Bn);!Wi.done;Gi++,Wi=gt.next())Wi=Zn(Bn,ct,Gi,Wi.value,Vt),Wi!==null&&(m&&Wi.alternate!==null&&Bn.delete(Wi.key===null?Gi:Wi.key),Qe=X(Wi,Qe,Gi),Pr===null?Sn=Wi:Pr.sibling=Wi,Pr=Wi);return m&&Bn.forEach(function(bre){return v(ct,bre)}),Vi&&F(ct,Gi),Sn}function bp(ct,Qe,gt,Vt){if(typeof gt=="object"&&gt!==null&&gt.type===xg&&gt.key===null&&(gt=gt.props.children),typeof gt=="object"&&gt!==null){switch(gt.$$typeof){case dS:e:{for(var Sn=gt.key;Qe!==null;){if(Qe.key===Sn){if(Sn=gt.type,Sn===xg){if(Qe.tag===7){T(ct,Qe.sibling),Vt=P(Qe,gt.props.children),Vt.return=ct,ct=Vt;break e}}else if(Qe.elementType===Sn||typeof Sn=="object"&&Sn!==null&&Sn.$$typeof===Dh&&Gn(Sn)===Qe.type){T(ct,Qe.sibling),Vt=P(Qe,gt.props),Xt(Vt,gt),Vt.return=ct,ct=Vt;break e}T(ct,Qe);break}else v(ct,Qe);Qe=Qe.sibling}gt.type===xg?(Vt=ap(gt.props.children,ct.mode,Vt,gt.key),Vt.return=ct,ct=Vt):(Vt=hS(gt.type,gt.key,gt.props,null,ct.mode,Vt),Xt(Vt,gt),Vt.return=ct,ct=Vt)}return be(ct);case yg:e:{for(Sn=gt.key;Qe!==null;){if(Qe.key===Sn)if(Qe.tag===4&&Qe.stateNode.containerInfo===gt.containerInfo&&Qe.stateNode.implementation===gt.implementation){T(ct,Qe.sibling),Vt=P(Qe,gt.children||[]),Vt.return=ct,ct=Vt;break e}else{T(ct,Qe);break}else v(ct,Qe);Qe=Qe.sibling}Vt=pR(gt,ct.mode,Vt),Vt.return=ct,ct=Vt}return be(ct);case Dh:return Sn=gt._init,gt=Sn(gt._payload),bp(ct,Qe,gt,Vt)}if(pS(gt))return Vl(ct,Qe,gt,Vt);if(a(gt)){if(Sn=a(gt),typeof Sn!="function")throw Error(r(150));return gt=Sn.call(gt),wy(ct,Qe,gt,Vt)}if(typeof gt.then=="function")return bp(ct,Qe,Kt(gt),Vt);if(gt.$$typeof===kh)return bp(ct,Qe,np(ct,gt),Vt);cn(ct,gt)}return typeof gt=="string"&&gt!==""||typeof gt=="number"||typeof gt=="bigint"?(gt=""+gt,Qe!==null&&Qe.tag===6?(T(ct,Qe.sibling),Vt=P(Qe,gt),Vt.return=ct,ct=Vt):(T(ct,Qe),Vt=dR(gt,ct.mode,Vt),Vt.return=ct,ct=Vt),be(ct)):T(ct,Qe)}return function(ct,Qe,gt,Vt){try{gy=0;var Sn=bp(ct,Qe,gt,Vt);return Og=null,Sn}catch(Bn){if(Bn===my)throw Bn;var Pr=n(29,Bn,null,ct.mode);return Pr.lanes=Vt,Pr.return=ct,Pr}finally{}}}function Jn(m,v){m=Af,x(MS,m),x(Ig,v),Af=m|v.baseLanes}function ai(){x(MS,Af),x(Ig,Ig.current)}function vi(){Af=MS.current,p(Ig),p(MS)}function Yn(m){var v=m.alternate;x(Ia,Ia.current&1),x(jl,m),Mu===null&&(v===null||Ig.current!==null||v.memoizedState!==null)&&(Mu=m)}function Yi(m){if(m.tag===22){if(x(Ia,Ia.current),x(jl,m),Mu===null){var v=m.alternate;v!==null&&v.memoizedState!==null&&(Mu=m)}}else ci()}function ci(){x(Ia,Ia.current),x(jl,jl.current)}function hn(m){p(jl),Mu===m&&(Mu=null),p(Ia)}function ui(m){for(var v=m;v!==null;){if(v.tag===13){var T=v.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||TR(T)||AR(T)))return v}else if(v.tag===19&&v.memoizedProps.revealOrder!==void 0){if(v.flags&128)return v}else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===m)break;for(;v.sibling===null;){if(v.return===null||v.return===m)return null;v=v.return}v.sibling.return=v.return,v=v.sibling}return null}function $n(){throw Error(r(321))}function re(m,v){if(v===null)return!1;for(var T=0;T<v.length&&T<m.length;T++)if(!nl(m[T],v[T]))return!1;return!0}function ge(m,v,T,O,P,X){return Lh=X,di=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,qn.H=m===null||m.memoizedState===null?fp:Ph,up=!1,X=T(O,P),up=!1,Ng&&(X=rt(v,T,O,P)),je(m),X}function je(m){qn.H=Tu;var v=pr!==null&&pr.next!==null;if(Lh=0,_a=pr=di=null,TS=!1,by=0,Lg=null,v)throw Error(r(300));m===null||qa||(m=m.dependencies,m!==null&&tp(m)&&(qa=!0))}function rt(m,v,T,O){di=m;var P=0;do{if(Ng&&(Lg=null),by=0,Ng=!1,25<=P)throw Error(r(301));if(P+=1,_a=pr=null,m.updateQueue!=null){var X=m.updateQueue;X.lastEffect=null,X.events=null,X.stores=null,X.memoCache!=null&&(X.memoCache.index=0)}qn.H=hp,X=v(T,O)}while(Ng);return X}function dt(){var m=qn.H,v=m.useState()[0];return v=typeof v.then=="function"?De(v):v,m=m.useState()[0],(pr!==null?pr.memoizedState:null)!==m&&(di.flags|=1024),v}function ot(){var m=AS!==0;return AS=0,m}function kt(m,v,T){v.updateQueue=m.updateQueue,v.flags&=-2053,m.lanes&=~T}function ee(m){if(TS){for(m=m.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.next}TS=!1}Lh=0,_a=pr=di=null,Ng=!1,by=AS=0,Lg=null}function ye(){var m={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _a===null?di.memoizedState=_a=m:_a=_a.next=m,_a}function Ce(){if(pr===null){var m=di.alternate;m=m!==null?m.memoizedState:null}else m=pr.next;var v=_a===null?di.memoizedState:_a.next;if(v!==null)_a=v,pr=m;else{if(m===null)throw di.alternate===null?Error(r(467)):Error(r(310));pr=m,m={memoizedState:pr.memoizedState,baseState:pr.baseState,baseQueue:pr.baseQueue,queue:pr.queue,next:null},_a===null?di.memoizedState=_a=m:_a=_a.next=m}return _a}function De(m){var v=by;return by+=1,Lg===null&&(Lg=[]),m=it(Lg,m,v),v=di,(_a===null?v.memoizedState:_a.next)===null&&(v=v.alternate,qn.H=v===null||v.memoizedState===null?fp:Ph),m}function ve(m){if(m!==null&&typeof m=="object"){if(typeof m.then=="function")return De(m);if(m.$$typeof===kh)return Oa(m)}throw Error(r(438,String(m)))}function _t(m){var v=null,T=di.updateQueue;if(T!==null&&(v=T.memoCache),v==null){var O=di.alternate;O!==null&&(O=O.updateQueue,O!==null&&(O=O.memoCache,O!=null&&(v={data:O.data.map(function(P){return P.slice()}),index:0})))}if(v==null&&(v={data:[],index:0}),T===null&&(T=BR(),di.updateQueue=T),T.memoCache=v,T=v.data[v.index],T===void 0)for(T=v.data[v.index]=Array(m),O=0;O<m;O++)T[O]=zne;return v.index++,T}function lt(m,v){return typeof v=="function"?v(m):v}function yt(m){var v=Ce();return St(v,pr,m)}function St(m,v,T){var O=m.queue;if(O===null)throw Error(r(311));O.lastRenderedReducer=T;var P=m.baseQueue,X=O.pending;if(X!==null){if(P!==null){var be=P.next;P.next=X.next,X.next=be}v.baseQueue=P=X,O.pending=null}if(X=m.baseState,P===null)m.memoizedState=X;else{v=P.next;var Be=be=null,nt=null,Ct=v,qt=!1;do{var an=Ct.lane&-536870913;if(an!==Ct.lane?(Ui&an)===an:(Lh&an)===an){var sn=Ct.revertLane;if(sn===0)nt!==null&&(nt=nt.next={lane:0,revertLane:0,action:Ct.action,hasEagerState:Ct.hasEagerState,eagerState:Ct.eagerState,next:null}),an===Rg&&(qt=!0);else if((Lh&sn)===sn){Ct=Ct.next,sn===Rg&&(qt=!0);continue}else an={lane:0,revertLane:Ct.revertLane,action:Ct.action,hasEagerState:Ct.hasEagerState,eagerState:Ct.eagerState,next:null},nt===null?(Be=nt=an,be=X):nt=nt.next=an,di.lanes|=sn,Uh|=sn;an=Ct.action,up&&T(X,an),X=Ct.hasEagerState?Ct.eagerState:T(X,an)}else sn={lane:an,revertLane:Ct.revertLane,action:Ct.action,hasEagerState:Ct.hasEagerState,eagerState:Ct.eagerState,next:null},nt===null?(Be=nt=sn,be=X):nt=nt.next=sn,di.lanes|=an,Uh|=an;Ct=Ct.next}while(Ct!==null&&Ct!==v);if(nt===null?be=X:nt.next=Be,!nl(X,m.memoizedState)&&(qa=!0,qt&&(T=kg,T!==null)))throw T;m.memoizedState=X,m.baseState=be,m.baseQueue=nt,O.lastRenderedState=X}return P===null&&(O.lanes=0),[m.memoizedState,O.dispatch]}function Nt(m){var v=Ce(),T=v.queue;if(T===null)throw Error(r(311));T.lastRenderedReducer=m;var O=T.dispatch,P=T.pending,X=v.memoizedState;if(P!==null){T.pending=null;var be=P=P.next;do X=m(X,be.action),be=be.next;while(be!==P);nl(X,v.memoizedState)||(qa=!0),v.memoizedState=X,v.baseQueue===null&&(v.baseState=X),T.lastRenderedState=X}return[X,O]}function Ht(m,v,T){var O=di,P=Ce(),X=Vi;if(X){if(T===void 0)throw Error(r(407));T=T()}else T=v();var be=!nl((pr||P).memoizedState,T);if(be&&(P.memoizedState=T,qa=!0),P=P.queue,In(un.bind(null,O,P,m),[m]),P.getSnapshot!==v||be||_a!==null&&_a.memoizedState.tag&1){if(O.flags|=2048,Ji(9,nn.bind(null,O,P,T,v),{destroy:void 0},null),Ar===null)throw Error(r(349));X||Lh&60||at(O,v,T)}return T}function at(m,v,T){m.flags|=16384,m={getSnapshot:v,value:T},v=di.updateQueue,v===null?(v=BR(),di.updateQueue=v,v.stores=[m]):(T=v.stores,T===null?v.stores=[m]:T.push(m))}function nn(m,v,T,O){v.value=T,v.getSnapshot=O,dn(v)&&On(m)}function un(m,v,T){return T(function(){dn(v)&&On(m)})}function dn(m){var v=m.getSnapshot;m=m.value;try{var T=v();return!nl(m,T)}catch{return!0}}function On(m){var v=we(m,2);v!==null&&fo(v,m,2)}function $t(m){var v=ye();if(typeof m=="function"){var T=m;if(m=T(),up){G(!0);try{T()}finally{G(!1)}}}return v.memoizedState=v.baseState=m,v.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lt,lastRenderedState:m},v}function Yt(m,v,T,O){return m.baseState=T,St(m,pr,typeof O=="function"?O:lt)}function Pn(m,v,T,O,P){if(An(m))throw Error(r(485));if(m=v.action,m!==null){var X={payload:P,action:m,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(be){X.listeners.push(be)}};qn.T!==null?T(!0):X.isTransition=!1,O(X),T=v.pending,T===null?(X.next=v.pending=X,wn(v,X)):(X.next=T.next,v.pending=T.next=X)}}function wn(m,v){var T=v.action,O=v.payload,P=m.state;if(v.isTransition){var X=qn.T,be={};qn.T=be;try{var Be=T(P,O),nt=qn.S;nt!==null&&nt(be,Be),Xn(m,v,Be)}catch(Ct){Mn(m,v,Ct)}finally{qn.T=X}}else try{X=T(P,O),Xn(m,v,X)}catch(Ct){Mn(m,v,Ct)}}function Xn(m,v,T){T!==null&&typeof T=="object"&&typeof T.then=="function"?T.then(function(O){En(m,v,O)},function(O){return Mn(m,v,O)}):En(m,v,T)}function En(m,v,T){v.status="fulfilled",v.value=T,pn(v),m.state=T,v=m.pending,v!==null&&(T=v.next,T===v?m.pending=null:(T=T.next,v.next=T,wn(m,T)))}function Mn(m,v,T){var O=m.pending;if(m.pending=null,O!==null){O=O.next;do v.status="rejected",v.reason=T,pn(v),v=v.next;while(v!==O)}m.action=null}function pn(m){m=m.listeners;for(var v=0;v<m.length;v++)(0,m[v])()}function rn(m,v){return v}function yi(m,v){if(Vi){var T=Ar.formState;if(T!==null){e:{var O=di;if(Vi){if(Ys){var P=Die(Ys,Eu);if(P){Ys=w9(P),O=Oie(P);break e}}_e(O)}O=!1}O&&(v=T[0])}}T=ye(),T.memoizedState=T.baseState=v,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rn,lastRenderedState:v},T.queue=O,T=mn.bind(null,di,O),O.dispatch=T,O=$t(!1);var X=Si.bind(null,di,!1,O.queue);return O=ye(),P={state:v,dispatch:null,action:m,pending:null},O.queue=P,T=Pn.bind(null,di,P,X,T),P.dispatch=T,O.memoizedState=m,[v,T,!1]}function Li(m){var v=Ce();return Wn(v,pr,m)}function Wn(m,v,T){v=St(m,v,rn)[0],m=yt(lt)[0],v=typeof v=="object"&&v!==null&&typeof v.then=="function"?De(v):v;var O=Ce(),P=O.queue,X=P.dispatch;return T!==O.memoizedState&&(di.flags|=2048,Ji(9,Oi.bind(null,P,T),{destroy:void 0},null)),[v,X,m]}function Oi(m,v){m.action=v}function ya(m){var v=Ce(),T=pr;if(T!==null)return Wn(v,T,m);Ce(),v=v.memoizedState,T=Ce();var O=T.queue.dispatch;return T.memoizedState=m,[v,O,!1]}function Ji(m,v,T,O){return m={tag:m,create:v,inst:T,deps:O,next:null},v=di.updateQueue,v===null&&(v=BR(),di.updateQueue=v),T=v.lastEffect,T===null?v.lastEffect=m.next=m:(O=T.next,T.next=m,m.next=O,v.lastEffect=m),m}function Xo(){return Ce().memoizedState}function Bs(m,v,T,O){var P=ye();di.flags|=m,P.memoizedState=Ji(1|v,T,{destroy:void 0},O===void 0?null:O)}function ao(m,v,T,O){var P=Ce();O=O===void 0?null:O;var X=P.memoizedState.inst;pr!==null&&O!==null&&re(O,pr.memoizedState.deps)?P.memoizedState=Ji(v,T,X,O):(di.flags|=m,P.memoizedState=Ji(1|v,T,X,O))}function so(m,v){Bs(8390656,8,m,v)}function In(m,v){ao(2048,8,m,v)}function zs(m,v){return ao(4,2,m,v)}function Ha(m,v){return ao(4,4,m,v)}function Va(m,v){if(typeof v=="function"){m=m();var T=v(m);return function(){typeof T=="function"?T():v(null)}}if(v!=null)return m=m(),v.current=m,function(){v.current=null}}function xa(m,v,T){T=T!=null?T.concat([m]):null,ao(4,4,Va.bind(null,v,m),T)}function oo(){}function js(m,v){var T=Ce();v=v===void 0?null:v;var O=T.memoizedState;return v!==null&&re(v,O[1])?O[0]:(T.memoizedState=[m,v],m)}function Ro(m,v){var T=Ce();v=v===void 0?null:v;var O=T.memoizedState;if(v!==null&&re(v,O[1]))return O[0];if(O=m(),up){G(!0);try{m()}finally{G(!1)}}return T.memoizedState=[O,v],O}function E(m,v,T){return T===void 0||Lh&1073741824?m.memoizedState=v:(m.memoizedState=T,m=F4(),di.lanes|=m,Uh|=m,T)}function L(m,v,T,O){return nl(T,v)?T:Ig.current!==null?(m=E(m,T,O),nl(m,v)||(qa=!0),m):Lh&42?(m=F4(),di.lanes|=m,Uh|=m,v):(qa=!0,m.memoizedState=T)}function J(m,v,T,O,P){var X=sp();ko(X!==0&&8>X?X:8);var be=qn.T,Be={};qn.T=Be,Si(m,!1,v,T);try{var nt=P(),Ct=qn.S;if(Ct!==null&&Ct(Be,nt),nt!==null&&typeof nt=="object"&&typeof nt.then=="function"){var qt=Xe(nt,O);_n(m,v,qt,Zo(m))}else _n(m,v,O,Zo(m))}catch(an){_n(m,v,{then:function(){},status:"rejected",reason:an},Zo())}finally{ko(X),qn.T=be}}function ne(m){var v=m.memoizedState;if(v!==null)return v;v={memoizedState:_g,baseState:_g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lt,lastRenderedState:_g},next:null};var T={};return v.next={memoizedState:T,baseState:T,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lt,lastRenderedState:T},next:null},m.memoizedState=v,m=m.alternate,m!==null&&(m.memoizedState=v),v}function xe(){return Oa(op)}function Ke(){return Ce().memoizedState}function et(){return Ce().memoizedState}function Lt(m){for(var v=m.return;v!==null;){switch(v.tag){case 24:case 3:var T=Zo();m=Je(T);var O=tt(v,m,T);O!==null&&(fo(O,v,T),xt(O,v,T)),v={cache:Th()},m.payload=v;return}v=v.return}}function zt(m,v,T){var O=Zo();T={lane:O,revertLane:0,action:T,hasEagerState:!1,eagerState:null,next:null},An(m)?ni(v,T):(T=qe(m,v,T,O),T!==null&&(fo(T,m,O),Er(T,v,O)))}function mn(m,v,T){var O=Zo();_n(m,v,T,O)}function _n(m,v,T,O){var P={lane:O,revertLane:0,action:T,hasEagerState:!1,eagerState:null,next:null};if(An(m))ni(v,P);else{var X=m.alternate;if(m.lanes===0&&(X===null||X.lanes===0)&&(X=v.lastRenderedReducer,X!==null))try{var be=v.lastRenderedState,Be=X(be,T);if(P.hasEagerState=!0,P.eagerState=Be,nl(Be,be))return Ie(m,v,P,0),Ar===null&&Fe(),!1}catch{}finally{}if(T=qe(m,v,P,O),T!==null)return fo(T,m,O),Er(T,v,O),!0}return!1}function Si(m,v,T,O){if(O={lane:2,revertLane:me(),action:O,hasEagerState:!1,eagerState:null,next:null},An(m)){if(v)throw Error(r(479))}else v=qe(m,T,O,2),v!==null&&fo(v,m,2)}function An(m){var v=m.alternate;return m===di||v!==null&&v===di}function ni(m,v){Ng=TS=!0;var T=m.pending;T===null?v.next=v:(v.next=T.next,T.next=v),m.pending=v}function Er(m,v,T){if(T&4194176){var O=v.lanes;O&=m.pendingLanes,T|=O,v.lanes=T,z(m,T)}}function wi(m,v,T,O){v=m.memoizedState,T=T(O,v),T=T==null?v:gR({},v,T),m.memoizedState=T,m.lanes===0&&(m.updateQueue.baseState=T)}function ji(m,v,T,O,P,X,be){return m=m.stateNode,typeof m.shouldComponentUpdate=="function"?m.shouldComponentUpdate(O,X,be):v.prototype&&v.prototype.isPureReactComponent?!ht(T,O)||!ht(P,X):!0}function Pi(m,v,T,O){m=v.state,typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps(T,O),typeof v.UNSAFE_componentWillReceiveProps=="function"&&v.UNSAFE_componentWillReceiveProps(T,O),v.state!==m&&zR.enqueueReplaceState(v,v.state,null)}function fi(m,v){var T=v;if("ref"in v){T={};for(var O in v)O!=="ref"&&(T[O]=v[O])}if(m=m.defaultProps){T===v&&(T=gR({},T));for(var P in m)T[P]===void 0&&(T[P]=m[P])}return T}function Da(m,v){try{var T=m.onUncaughtError;T(v.value,{componentStack:v.stack})}catch(O){setTimeout(function(){throw O})}}function Ll(m,v,T){try{var O=m.onCaughtError;O(T.value,{componentStack:T.stack,errorBoundary:v.tag===1?v.stateNode:null})}catch(P){setTimeout(function(){throw P})}}function Ko(m,v,T){return T=Je(T),T.tag=3,T.payload={element:null},T.callback=function(){Da(m,v)},T}function os(m){return m=Je(m),m.tag=3,m}function Ei(m,v,T,O){var P=T.type.getDerivedStateFromError;if(typeof P=="function"){var X=O.value;m.payload=function(){return P(X)},m.callback=function(){Ll(v,T,O)}}var be=T.stateNode;be!==null&&typeof be.componentDidCatch=="function"&&(m.callback=function(){Ll(v,T,O),typeof P!="function"&&(Fh===null?Fh=new Set([this]):Fh.add(this));var Be=O.stack;this.componentDidCatch(O.value,{componentStack:Be!==null?Be:""})})}function ep(m,v,T,O,P){if(T.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){if(v=T.alternate,v!==null&&Lc(v,T,P,!0),T=jl.current,T!==null){switch(T.tag){case 13:return Mu===null?cR():T.alternate===null&&ca===0&&(ca=3),T.flags&=-257,T.flags|=65536,T.lanes=P,O===ES?T.flags|=16384:(v=T.updateQueue,v===null?T.updateQueue=new Set([O]):v.add(O),fR(m,O,P)),!1;case 22:return T.flags|=65536,O===ES?T.flags|=16384:(v=T.updateQueue,v===null?(v={transitions:null,markerInstances:null,retryQueue:new Set([O])},T.updateQueue=v):(T=v.retryQueue,T===null?v.retryQueue=new Set([O]):T.add(O)),fR(m,O,P)),!1}throw Error(r(435,T.tag))}return fR(m,O,P),cR(),!1}if(Vi)return v=jl.current,v!==null?(!(v.flags&65536)&&(v.flags|=256),v.flags|=65536,v.lanes=P,O!==OR&&(m=Error(r(422),{cause:O}),pe(W(m,T)))):(O!==OR&&(v=Error(r(423),{cause:O}),pe(W(v,T))),m=m.current.alternate,m.flags|=65536,P&=-P,m.lanes|=P,O=W(O,T),P=Ko(m.stateNode,O,P),Tt(m,P),ca!==4&&(ca=2)),!1;var X=Error(r(520),{cause:O});if(X=W(X,T),yy===null?yy=[X]:yy.push(X),ca!==4&&(ca=2),v===null)return!0;O=W(O,T),T=v;do{switch(T.tag){case 3:return T.flags|=65536,m=P&-P,T.lanes|=m,m=Ko(T.stateNode,O,m),Tt(T,m),!1;case 1:if(v=T.type,X=T.stateNode,(T.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||X!==null&&typeof X.componentDidCatch=="function"&&(Fh===null||!Fh.has(X))))return T.flags|=65536,P&=-P,T.lanes|=P,P=os(P),Ei(P,m,T,O),Tt(T,P),!1}T=T.return}while(T!==null);return!1}function xr(m,v,T,O){v.child=m===null?U9(v,null,T,O):cp(v,m.child,T,O)}function ls(m,v,T,O,P){T=T.render;var X=v.ref;if("ref"in O){var be={};for(var Be in O)Be!=="ref"&&(be[Be]=O[Be])}else be=O;return vf(v),O=ge(m,v,T,be,X,P),Be=ot(),m!==null&&!qa?(kt(m,v,P),Ga(m,v,P)):(Vi&&Be&&Z(v),v.flags|=1,xr(m,v,O,P),v.child)}function Nc(m,v,T,O,P){if(m===null){var X=T.type;return typeof X=="function"&&!hR(X)&&X.defaultProps===void 0&&T.compare===null?(v.tag=15,v.type=X,Hs(m,v,X,O,P)):(m=hS(T.type,null,O,v,v.mode,P),m.ref=v.ref,m.return=v,v.child=m)}if(X=m.child,!Vs(m,P)){var be=X.memoizedProps;if(T=T.compare,T=T!==null?T:ht,T(be,O)&&m.ref===v.ref)return Ga(m,v,P)}return v.flags|=1,m=Rh(X,O),m.ref=v.ref,m.return=v,v.child=m}function Hs(m,v,T,O,P){if(m!==null){var X=m.memoizedProps;if(ht(X,O)&&m.ref===v.ref)if(qa=!1,v.pendingProps=O=X,Vs(m,P))m.flags&131072&&(qa=!0);else return v.lanes=m.lanes,Ga(m,v,P)}return Ze(m,v,T,O,P)}function le(m,v,T){var O=v.pendingProps,P=O.children,X=(v.stateNode._pendingVisibility&2)!==0,be=m!==null?m.memoizedState:null;if(Re(m,v),O.mode==="hidden"||X){if(v.flags&128){if(O=be!==null?be.baseLanes|T:T,m!==null){for(P=v.child=m.child,X=0;P!==null;)X=X|P.lanes|P.childLanes,P=P.sibling;v.childLanes=X&~O}else v.childLanes=0,v.child=null;return ae(m,v,O,T)}if(T&536870912)v.memoizedState={baseLanes:0,cachePool:null},m!==null&&Lr(v,be!==null?be.cachePool:null),be!==null?Jn(v,be):ai(),Yi(v);else return v.lanes=v.childLanes=536870912,ae(m,v,be!==null?be.baseLanes|T:T,T)}else be!==null?(Lr(v,be.cachePool),Jn(v,be),ci(),v.memoizedState=null):(m!==null&&Lr(v,null),ai(),ci());return xr(m,v,P,T),v.child}function ae(m,v,T,O){var P=pg();return P=P===null?null:{parent:_f?oa._currentValue:oa._currentValue2,pool:P},v.memoizedState={baseLanes:T,cachePool:P},m!==null&&Lr(v,null),ai(),Yi(v),m!==null&&Lc(m,v,O,!0),null}function Re(m,v){var T=v.ref;if(T===null)m!==null&&m.ref!==null&&(v.flags|=2097664);else{if(typeof T!="function"&&typeof T!="object")throw Error(r(284));(m===null||m.ref!==T)&&(v.flags|=2097664)}}function Ze(m,v,T,O,P){return vf(v),T=ge(m,v,T,O,void 0,P),O=ot(),m!==null&&!qa?(kt(m,v,P),Ga(m,v,P)):(Vi&&O&&Z(v),v.flags|=1,xr(m,v,T,P),v.child)}function pt(m,v,T,O,P,X){return vf(v),v.updateQueue=null,T=rt(v,O,T,P),je(m),O=ot(),m!==null&&!qa?(kt(m,v,X),Ga(m,v,X)):(Vi&&O&&Z(v),v.flags|=1,xr(m,v,T,X),v.child)}function Dt(m,v,T,O,P){if(vf(v),v.stateNode===null){var X=wg,be=T.contextType;typeof be=="object"&&be!==null&&(X=Oa(be)),X=new T(O,X),v.memoizedState=X.state!==null&&X.state!==void 0?X.state:null,X.updater=zR,v.stateNode=X,X._reactInternals=v,X=v.stateNode,X.props=O,X.state=v.memoizedState,X.refs={},mt(v),be=T.contextType,X.context=typeof be=="object"&&be!==null?Oa(be):wg,X.state=v.memoizedState,be=T.getDerivedStateFromProps,typeof be=="function"&&(wi(v,T,be,O),X.state=v.memoizedState),typeof T.getDerivedStateFromProps=="function"||typeof X.getSnapshotBeforeUpdate=="function"||typeof X.UNSAFE_componentWillMount!="function"&&typeof X.componentWillMount!="function"||(be=X.state,typeof X.componentWillMount=="function"&&X.componentWillMount(),typeof X.UNSAFE_componentWillMount=="function"&&X.UNSAFE_componentWillMount(),be!==X.state&&zR.enqueueReplaceState(X,X.state,null),Rt(v,O,X,P),bt(),X.state=v.memoizedState),typeof X.componentDidMount=="function"&&(v.flags|=4194308),O=!0}else if(m===null){X=v.stateNode;var Be=v.memoizedProps,nt=fi(T,Be);X.props=nt;var Ct=X.context,qt=T.contextType;be=wg,typeof qt=="object"&&qt!==null&&(be=Oa(qt));var an=T.getDerivedStateFromProps;qt=typeof an=="function"||typeof X.getSnapshotBeforeUpdate=="function",Be=v.pendingProps!==Be,qt||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(Be||Ct!==be)&&Pi(v,X,O,be),Nh=!1;var sn=v.memoizedState;X.state=sn,Rt(v,O,X,P),bt(),Ct=v.memoizedState,Be||sn!==Ct||Nh?(typeof an=="function"&&(wi(v,T,an,O),Ct=v.memoizedState),(nt=Nh||ji(v,T,nt,O,sn,Ct,be))?(qt||typeof X.UNSAFE_componentWillMount!="function"&&typeof X.componentWillMount!="function"||(typeof X.componentWillMount=="function"&&X.componentWillMount(),typeof X.UNSAFE_componentWillMount=="function"&&X.UNSAFE_componentWillMount()),typeof X.componentDidMount=="function"&&(v.flags|=4194308)):(typeof X.componentDidMount=="function"&&(v.flags|=4194308),v.memoizedProps=O,v.memoizedState=Ct),X.props=O,X.state=Ct,X.context=be,O=nt):(typeof X.componentDidMount=="function"&&(v.flags|=4194308),O=!1)}else{X=v.stateNode,Ge(m,v),be=v.memoizedProps,qt=fi(T,be),X.props=qt,an=v.pendingProps,sn=X.context,Ct=T.contextType,nt=wg,typeof Ct=="object"&&Ct!==null&&(nt=Oa(Ct)),Be=T.getDerivedStateFromProps,(Ct=typeof Be=="function"||typeof X.getSnapshotBeforeUpdate=="function")||typeof X.UNSAFE_componentWillReceiveProps!="function"&&typeof X.componentWillReceiveProps!="function"||(be!==an||sn!==nt)&&Pi(v,X,O,nt),Nh=!1,sn=v.memoizedState,X.state=sn,Rt(v,O,X,P),bt();var Zn=v.memoizedState;be!==an||sn!==Zn||Nh||m!==null&&m.dependencies!==null&&tp(m.dependencies)?(typeof Be=="function"&&(wi(v,T,Be,O),Zn=v.memoizedState),(qt=Nh||ji(v,T,qt,O,sn,Zn,nt)||m!==null&&m.dependencies!==null&&tp(m.dependencies))?(Ct||typeof X.UNSAFE_componentWillUpdate!="function"&&typeof X.componentWillUpdate!="function"||(typeof X.componentWillUpdate=="function"&&X.componentWillUpdate(O,Zn,nt),typeof X.UNSAFE_componentWillUpdate=="function"&&X.UNSAFE_componentWillUpdate(O,Zn,nt)),typeof X.componentDidUpdate=="function"&&(v.flags|=4),typeof X.getSnapshotBeforeUpdate=="function"&&(v.flags|=1024)):(typeof X.componentDidUpdate!="function"||be===m.memoizedProps&&sn===m.memoizedState||(v.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||be===m.memoizedProps&&sn===m.memoizedState||(v.flags|=1024),v.memoizedProps=O,v.memoizedState=Zn),X.props=O,X.state=Zn,X.context=nt,O=qt):(typeof X.componentDidUpdate!="function"||be===m.memoizedProps&&sn===m.memoizedState||(v.flags|=4),typeof X.getSnapshotBeforeUpdate!="function"||be===m.memoizedProps&&sn===m.memoizedState||(v.flags|=1024),O=!1)}return X=O,Re(m,v),O=(v.flags&128)!==0,X||O?(X=v.stateNode,T=O&&typeof T.getDerivedStateFromError!="function"?null:X.render(),v.flags|=1,m!==null&&O?(v.child=cp(v,m.child,null,P),v.child=cp(v,null,T,P)):xr(m,v,T,P),v.memoizedState=X.state,m=v.child):m=Ga(m,v,P),m}function jt(m,v,T,O){return ze(),v.flags|=256,xr(m,v,T,O),v.child}function Mt(m){return{baseLanes:m,cachePool:ay()}}function Jt(m,v,T){return m=m!==null?m.childLanes&~T:0,v&&(m|=Hl),m}function yn(m,v,T){var O=v.pendingProps,P=!1,X=(v.flags&128)!==0,be;if((be=X)||(be=m!==null&&m.memoizedState===null?!1:(Ia.current&2)!==0),be&&(P=!0,v.flags&=-129),be=(v.flags&32)!==0,v.flags&=-33,m===null){if(Vi){if(P?Yn(v):ci(),Vi){var Be=Ys,nt;(nt=Be)&&(Be=Uie(Be,Eu),Be!==null?(v.memoizedState={dehydrated:Be,treeContext:lp!==null?{id:Sf,overflow:wf}:null,retryLane:536870912},nt=n(18,null,null,0),nt.stateNode=Be,nt.return=v,v.child=nt,ho=v,Ys=null,nt=!0):nt=!1),nt||_e(v)}if(Be=v.memoizedState,Be!==null&&(Be=Be.dehydrated,Be!==null))return AR(Be)?v.lanes=16:v.lanes=536870912,null;hn(v)}return Be=O.children,O=O.fallback,P?(ci(),P=v.mode,Be=xi({mode:"hidden",children:Be},P),O=ap(O,P,T,null),Be.return=v,O.return=v,Be.sibling=O,v.child=Be,P=v.child,P.memoizedState=Mt(T),P.childLanes=Jt(m,be,T),v.memoizedState=jR,O):(Yn(v),kn(v,Be))}if(nt=m.memoizedState,nt!==null&&(Be=nt.dehydrated,Be!==null)){if(X)v.flags&256?(Yn(v),v.flags&=-257,v=Nr(m,v,T)):v.memoizedState!==null?(ci(),v.child=m.child,v.flags|=128,v=null):(ci(),P=O.fallback,Be=v.mode,O=xi({mode:"visible",children:O.children},Be),P=ap(P,Be,T,null),P.flags|=2,O.return=v,P.return=v,O.sibling=P,v.child=O,cp(v,m.child,null,T),O=v.child,O.memoizedState=Mt(T),O.childLanes=Jt(m,be,T),v.memoizedState=jR,v=P);else if(Yn(v),AR(Be))be=Rie(Be).digest,O=Error(r(419)),O.stack="",O.digest=be,pe({value:O,source:null,stack:null}),v=Nr(m,v,T);else if(qa||Lc(m,v,T,!1),be=(T&m.childLanes)!==0,qa||be){if(be=Ar,be!==null){if(O=T&-T,O&42)O=1;else switch(O){case 2:O=1;break;case 8:O=4;break;case 32:O=16;break;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:O=64;break;case 268435456:O=134217728;break;default:O=0}if(O=O&(be.suspendedLanes|T)?0:O,O!==0&&O!==nt.retryLane)throw nt.retryLane=O,we(m,O),fo(be,m,O),B9}TR(Be)||cR(),v=Nr(m,v,T)}else TR(Be)?(v.flags|=128,v.child=m.child,v=One.bind(null,m),kie(Be,v),v=null):(m=nt.treeContext,Pl&&(Ys=Nie(Be),ho=v,Vi=!0,Fc=null,Eu=!1,m!==null&&(Fl[Bl++]=Sf,Fl[Bl++]=wf,Fl[Bl++]=lp,Sf=m.id,wf=m.overflow,lp=v)),v=kn(v,O.children),v.flags|=4096);return v}return P?(ci(),P=O.fallback,Be=v.mode,nt=m.child,X=nt.sibling,O=Rh(nt,{mode:"hidden",children:O.children}),O.subtreeFlags=nt.subtreeFlags&31457280,X!==null?P=Rh(X,P):(P=ap(P,Be,T,null),P.flags|=2),P.return=v,O.return=v,O.sibling=P,v.child=O,O=P,P=v.child,Be=m.child.memoizedState,Be===null?Be=Mt(T):(nt=Be.cachePool,nt!==null?(X=_f?oa._currentValue:oa._currentValue2,nt=nt.parent!==X?{parent:X,pool:X}:nt):nt=ay(),Be={baseLanes:Be.baseLanes|T,cachePool:nt}),P.memoizedState=Be,P.childLanes=Jt(m,be,T),v.memoizedState=jR,O):(Yn(v),T=m.child,m=T.sibling,T=Rh(T,{mode:"visible",children:O.children}),T.return=v,T.sibling=null,m!==null&&(be=v.deletions,be===null?(v.deletions=[m],v.flags|=16):be.push(m)),v.child=T,v.memoizedState=null,T)}function kn(m,v){return v=xi({mode:"visible",children:v},m.mode),v.return=m,m.child=v}function xi(m,v){return e9(m,v,0,null)}function Nr(m,v,T){return cp(v,m.child,null,T),m=kn(v,v.pendingProps.children),m.flags|=2,v.memoizedState=null,m}function Hr(m,v,T){m.lanes|=v;var O=m.alternate;O!==null&&(O.lanes|=v),bf(m.return,v,T)}function $i(m,v,T,O,P){var X=m.memoizedState;X===null?m.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:O,tail:T,tailMode:P}:(X.isBackwards=v,X.rendering=null,X.renderingStartTime=0,X.last=O,X.tail=T,X.tailMode=P)}function cs(m,v,T){var O=v.pendingProps,P=O.revealOrder,X=O.tail;if(xr(m,v,O.children,T),O=Ia.current,O&2)O=O&1|2,v.flags|=128;else{if(m!==null&&m.flags&128)e:for(m=v.child;m!==null;){if(m.tag===13)m.memoizedState!==null&&Hr(m,T,v);else if(m.tag===19)Hr(m,T,v);else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===v)break e;for(;m.sibling===null;){if(m.return===null||m.return===v)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}O&=1}switch(x(Ia,O),P){case"forwards":for(T=v.child,P=null;T!==null;)m=T.alternate,m!==null&&ui(m)===null&&(P=T),T=T.sibling;T=P,T===null?(P=v.child,v.child=null):(P=T.sibling,T.sibling=null),$i(v,!1,P,T,X);break;case"backwards":for(T=null,P=v.child,v.child=null;P!==null;){if(m=P.alternate,m!==null&&ui(m)===null){v.child=P;break}m=P.sibling,P.sibling=T,T=P,P=m}$i(v,!0,T,null,X);break;case"together":$i(v,!1,null,null,void 0);break;default:v.memoizedState=null}return v.child}function Ga(m,v,T){if(m!==null&&(v.dependencies=m.dependencies),Uh|=v.lanes,!(T&v.childLanes))if(m!==null){if(Lc(m,v,T,!1),(T&v.childLanes)===0)return null}else return null;if(m!==null&&v.child!==m.child)throw Error(r(153));if(v.child!==null){for(m=v.child,T=Rh(m,m.pendingProps),v.child=T,T.return=v;m.sibling!==null;)m=m.sibling,T=T.sibling=Rh(m,m.pendingProps),T.return=v;T.sibling=null}return v.child}function Vs(m,v){return m.lanes&v?!0:(m=m.dependencies,!!(m!==null&&tp(m)))}function gf(m,v,T){switch(v.tag){case 3:de(v,v.stateNode.containerInfo),Yo(v,oa,m.memoizedState.cache),ze();break;case 27:case 5:oe(v);break;case 4:de(v,v.stateNode.containerInfo);break;case 10:Yo(v,v.type,v.memoizedProps.value);break;case 13:var O=v.memoizedState;if(O!==null)return O.dehydrated!==null?(Yn(v),v.flags|=128,null):T&v.child.childLanes?yn(m,v,T):(Yn(v),m=Ga(m,v,T),m!==null?m.sibling:null);Yn(v);break;case 19:var P=(m.flags&128)!==0;if(O=(T&v.childLanes)!==0,O||(Lc(m,v,T,!1),O=(T&v.childLanes)!==0),P){if(O)return cs(m,v,T);v.flags|=128}if(P=v.memoizedState,P!==null&&(P.rendering=null,P.tail=null,P.lastEffect=null),x(Ia,Ia.current),O)break;return null;case 22:case 23:return v.lanes=0,le(m,v,T);case 24:Yo(v,oa,m.memoizedState.cache)}return Ga(m,v,T)}function us(m,v,T){if(m!==null)if(m.memoizedProps!==v.pendingProps)qa=!0;else{if(!Vs(m,T)&&!(v.flags&128))return qa=!1,gf(m,v,T);qa=!!(m.flags&131072)}else qa=!1,Vi&&v.flags&1048576&&Y(v,xS,v.index);switch(v.lanes=0,v.tag){case 16:e:{m=v.pendingProps;var O=v.elementType,P=O._init;if(O=P(O._payload),v.type=O,typeof O=="function")hR(O)?(m=fi(O,m),v.tag=1,v=Dt(null,v,O,m,T)):(v.tag=0,v=Ze(null,v,O,m,T));else{if(O!=null){if(P=O.$$typeof,P===vR){v.tag=11,v=ls(null,v,O,m,T);break e}else if(P===_R){v.tag=14,v=Nc(null,v,O,m,T);break e}}throw v=s(O)||O,Error(r(306,v,""))}}return v;case 0:return Ze(m,v,v.type,v.pendingProps,T);case 1:return O=v.type,P=fi(O,v.pendingProps),Dt(m,v,O,P,T);case 3:e:{if(de(v,v.stateNode.containerInfo),m===null)throw Error(r(387));var X=v.pendingProps;P=v.memoizedState,O=P.element,Ge(m,v),Rt(v,X,null,T);var be=v.memoizedState;if(X=be.cache,Yo(v,oa,X),X!==P.cache&&wu(v,[oa],T,!0),bt(),X=be.element,Pl&&P.isDehydrated)if(P={element:X,isDehydrated:!1,cache:be.cache},v.updateQueue.baseState=P,v.memoizedState=P,v.flags&256){v=jt(m,v,X,T);break e}else if(X!==O){O=W(Error(r(424)),v),pe(O),v=jt(m,v,X,T);break e}else for(Pl&&(Ys=Iie(v.stateNode.containerInfo),ho=v,Vi=!0,Fc=null,Eu=!0),T=U9(v,null,X,T),v.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(ze(),X===O){v=Ga(m,v,T);break e}xr(m,v,X,T)}v=v.child}return v;case 26:if(Ul)return Re(m,v),m===null?(T=A9(v.type,null,v.pendingProps,null))?v.memoizedState=T:Vi||(v.stateNode=Yie(v.type,v.pendingProps,Ih.current,v)):v.memoizedState=A9(v.type,m.memoizedProps,v.pendingProps,m.memoizedState),null;case 27:if(Ks)return oe(v),m===null&&Ks&&Vi&&(O=v.stateNode=I9(v.type,v.pendingProps,Ih.current,ds.current,!1),ho=v,Eu=!0,Ys=E9(O)),O=v.pendingProps.children,m!==null||Vi?xr(m,v,O,T):v.child=cp(v,null,O,T),Re(m,v),v.child;case 5:return m===null&&Vi&&(qie(v.type,v.pendingProps,ds.current),(P=O=Ys)&&(O=Lie(O,v.type,v.pendingProps,Eu),O!==null?(v.stateNode=O,ho=v,Ys=E9(O),Eu=!1,P=!0):P=!1),P||_e(v)),oe(v),P=v.type,X=v.pendingProps,be=m!==null?m.memoizedProps:null,O=X.children,mS(P,X)?O=null:be!==null&&mS(P,be)&&(v.flags|=32),v.memoizedState!==null&&(P=ge(m,v,dt,null,null,T),_f?op._currentValue=P:op._currentValue2=P),Re(m,v),xr(m,v,O,T),v.child;case 6:return m===null&&Vi&&(Xie(v.pendingProps,ds.current),(m=T=Ys)&&(T=Pie(T,v.pendingProps,Eu),T!==null?(v.stateNode=T,ho=v,Ys=null,m=!0):m=!1),m||_e(v)),null;case 13:return yn(m,v,T);case 4:return de(v,v.stateNode.containerInfo),O=v.pendingProps,m===null?v.child=cp(v,null,O,T):xr(m,v,O,T),v.child;case 11:return ls(m,v,v.type,v.pendingProps,T);case 7:return xr(m,v,v.pendingProps,T),v.child;case 8:return xr(m,v,v.pendingProps.children,T),v.child;case 12:return xr(m,v,v.pendingProps.children,T),v.child;case 10:return O=v.pendingProps,Yo(v,v.type,O.value),xr(m,v,O.children,T),v.child;case 9:return P=v.type._context,O=v.pendingProps.children,vf(v),P=Oa(P),O=O(P),v.flags|=1,xr(m,v,O,T),v.child;case 14:return Nc(m,v,v.type,v.pendingProps,T);case 15:return Hs(m,v,v.type,v.pendingProps,T);case 19:return cs(m,v,T);case 22:return le(m,v,T);case 24:return vf(v),O=Oa(oa),m===null?(P=pg(),P===null&&(P=Ar,X=Th(),P.pooledCache=X,X.refCount++,X!==null&&(P.pooledCacheLanes|=T),P=X),v.memoizedState={parent:O,cache:P},mt(v),Yo(v,oa,P)):(m.lanes&T&&(Ge(m,v),Rt(v,null,null,T),bt()),P=m.memoizedState,X=v.memoizedState,P.parent!==O?(P={parent:O,cache:O},v.memoizedState=P,v.lanes===0&&(v.memoizedState=v.updateQueue.baseState=P),Yo(v,oa,O)):(O=X.cache,Yo(v,oa,O),O!==P.cache&&wu(v,[oa],T,!0))),xr(m,v,v.pendingProps.children,T),v.child;case 29:throw v.pendingProps}throw Error(r(156,v.tag))}function Yo(m,v,T){_f?(x(CS,v._currentValue),v._currentValue=T):(x(CS,v._currentValue2),v._currentValue2=T)}function lo(m){var v=CS.current;_f?m._currentValue=v:m._currentValue2=v,p(CS)}function bf(m,v,T){for(;m!==null;){var O=m.alternate;if((m.childLanes&v)!==v?(m.childLanes|=v,O!==null&&(O.childLanes|=v)):O!==null&&(O.childLanes&v)!==v&&(O.childLanes|=v),m===T)break;m=m.return}}function wu(m,v,T,O){var P=m.child;for(P!==null&&(P.return=m);P!==null;){var X=P.dependencies;if(X!==null){var be=P.child;X=X.firstContext;e:for(;X!==null;){var Be=X;X=P;for(var nt=0;nt<v.length;nt++)if(Be.context===v[nt]){X.lanes|=T,Be=X.alternate,Be!==null&&(Be.lanes|=T),bf(X.return,T,m),O||(be=null);break e}X=Be.next}}else if(P.tag===18){if(be=P.return,be===null)throw Error(r(341));be.lanes|=T,X=be.alternate,X!==null&&(X.lanes|=T),bf(be,T,m),be=null}else be=P.child;if(be!==null)be.return=P;else for(be=P;be!==null;){if(be===m){be=null;break}if(P=be.sibling,P!==null){P.return=be.return,be=P;break}be=be.return}P=be}}function Lc(m,v,T,O){m=null;for(var P=v,X=!1;P!==null;){if(!X){if(P.flags&524288)X=!0;else if(P.flags&262144)break}if(P.tag===10){var be=P.alternate;if(be===null)throw Error(r(387));if(be=be.memoizedProps,be!==null){var Be=P.type;nl(P.pendingProps.value,be.value)||(m!==null?m.push(Be):m=[Be])}}else if(P===_S.current){if(be=P.alternate,be===null)throw Error(r(387));be.memoizedState.memoizedState!==P.memoizedState.memoizedState&&(m!==null?m.push(op):m=[op])}P=P.return}m!==null&&wu(v,m,T,O),v.flags|=262144}function tp(m){for(m=m.firstContext;m!==null;){var v=m.context;if(!nl(_f?v._currentValue:v._currentValue2,m.memoizedValue))return!0;m=m.next}return!1}function vf(m){dp=m,Ef=null,m=m.dependencies,m!==null&&(m.firstContext=null)}function Oa(m){return yf(dp,m)}function np(m,v){return dp===null&&vf(m),yf(m,v)}function yf(m,v){var T=_f?v._currentValue:v._currentValue2;if(v={context:v,memoizedValue:T,next:null},Ef===null){if(m===null)throw Error(r(308));Ef=v,m.dependencies={lanes:0,firstContext:v},m.flags|=524288}else Ef=Ef.next=v;return T}function Th(){return{controller:new hre,data:new Map,refCount:0}}function Vr(m){m.refCount--,m.refCount===0&&dre(pre,function(){m.controller.abort()})}function pg(){var m=pp.current;return m!==null?m:Ar.pooledCache}function Lr(m,v){v===null?x(pp,pp.current):x(pp,v.pool)}function ay(){var m=pg();return m===null?null:{parent:_f?oa._currentValue:oa._currentValue2,pool:m}}function fs(m){m.flags|=4}function Ah(m,v){if(m!==null&&m.child===v.child)return!1;if(v.flags&16)return!0;for(m=v.child;m!==null;){if(m.flags&13878||m.subtreeFlags&13878)return!0;m=m.sibling}return!1}function sy(m,v,T,O){if(Xs)for(T=v.child;T!==null;){if(T.tag===5||T.tag===6)ER(m,T.stateNode);else if(!(T.tag===4||Ks&&T.tag===27)&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===v)break;for(;T.sibling===null;){if(T.return===null||T.return===v)return;T=T.return}T.sibling.return=T.return,T=T.sibling}else if(Oh)for(var P=v.child;P!==null;){if(P.tag===5){var X=P.stateNode;T&&O&&(X=_9(X,P.type,P.memoizedProps)),ER(m,X)}else if(P.tag===6)X=P.stateNode,T&&O&&(X=S9(X,P.memoizedProps)),ER(m,X);else if(P.tag!==4){if(P.tag===22&&P.memoizedState!==null)X=P.child,X!==null&&(X.return=P),sy(m,P,!0,!0);else if(P.child!==null){P.child.return=P,P=P.child;continue}}if(P===v)break;for(;P.sibling===null;){if(P.return===null||P.return===v)return;P=P.return}P.sibling.return=P.return,P=P.sibling}}function cS(m,v,T,O){if(Oh)for(var P=v.child;P!==null;){if(P.tag===5){var X=P.stateNode;T&&O&&(X=_9(X,P.type,P.memoizedProps)),y9(m,X)}else if(P.tag===6)X=P.stateNode,T&&O&&(X=S9(X,P.memoizedProps)),y9(m,X);else if(P.tag!==4){if(P.tag===22&&P.memoizedState!==null)X=P.child,X!==null&&(X.return=P),cS(m,P,!(P.memoizedProps!==null&&P.memoizedProps.mode==="manual"),!0);else if(P.child!==null){P.child.return=P,P=P.child;continue}}if(P===v)break;for(;P.sibling===null;){if(P.return===null||P.return===v)return;P=P.return}P.sibling.return=P.return,P=P.sibling}}function mg(m,v){if(Oh&&Ah(m,v)){m=v.stateNode;var T=m.containerInfo,O=v9();cS(O,v,!1,!1),m.pendingChildren=O,fs(v),Cie(T,O)}}function Q(m,v,T,O){if(Xs)m.memoizedProps!==O&&fs(v);else if(Oh){var P=m.stateNode,X=m.memoizedProps;if((m=Ah(m,v))||X!==O){var be=ds.current;X=Aie(P,T,X,O,!m,null),X===P?v.stateNode=P:(h9(X,T,O,be)&&fs(v),v.stateNode=X,m?sy(X,v,!1,!1):fs(v))}else v.stateNode=P}}function he(m,v,T){if(tie(v,T)){if(m.flags|=16777216,!m9(v,T))if(V4())m.flags|=8192;else throw Dg=ES,FR}else m.flags&=-16777217}function Se(m,v){if($ie(v)){if(m.flags|=16777216,!O9(v))if(V4())m.flags|=8192;else throw Dg=ES,FR}else m.flags&=-16777217}function Me(m,v){v!==null&&(m.flags|=4),m.flags&16384&&(v=m.tag!==22?D():536870912,m.lanes|=v,Fg|=v)}function We(m,v){if(!Vi)switch(m.tailMode){case"hidden":v=m.tail;for(var T=null;v!==null;)v.alternate!==null&&(T=v),v=v.sibling;T===null?m.tail=null:T.sibling=null;break;case"collapsed":T=m.tail;for(var O=null;T!==null;)T.alternate!==null&&(O=T),T=T.sibling;O===null?v||m.tail===null?m.tail=null:m.tail.sibling=null:O.sibling=null}}function Ye(m){var v=m.alternate!==null&&m.alternate.child===m.child,T=0,O=0;if(v)for(var P=m.child;P!==null;)T|=P.lanes|P.childLanes,O|=P.subtreeFlags&31457280,O|=P.flags&31457280,P.return=m,P=P.sibling;else for(P=m.child;P!==null;)T|=P.lanes|P.childLanes,O|=P.subtreeFlags,O|=P.flags,P.return=m,P=P.sibling;return m.subtreeFlags|=O,m.childLanes=T,v}function At(m,v,T){var O=v.pendingProps;switch(V(v),v.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ye(v),null;case 1:return Ye(v),null;case 3:return T=v.stateNode,O=null,m!==null&&(O=m.memoizedState.cache),v.memoizedState.cache!==O&&(v.flags|=2048),lo(oa),se(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(m===null||m.child===null)&&(Ue(v)?fs(v):m===null||m.memoizedState.isDehydrated&&!(v.flags&256)||(v.flags|=1024,Fc!==null&&(oR(Fc),Fc=null))),mg(m,v),Ye(v),null;case 26:if(Ul){T=v.type;var P=v.memoizedState;return m===null?(fs(v),P!==null?(Ye(v),Se(v,P)):(Ye(v),he(v,T,O))):P?P!==m.memoizedState?(fs(v),Ye(v),Se(v,P)):(Ye(v),v.flags&=-16777217):(Xs?m.memoizedProps!==O&&fs(v):Q(m,v,T,O),Ye(v),he(v,T,O)),null}case 27:if(Ks){if(ue(v),T=Ih.current,P=v.type,m!==null&&v.stateNode!=null)Xs?m.memoizedProps!==O&&fs(v):Q(m,v,P,O);else{if(!O){if(v.stateNode===null)throw Error(r(166));return Ye(v),null}m=ds.current,Ue(v)?ke(v,m):(m=I9(P,O,T,m,!0),v.stateNode=m,fs(v))}return Ye(v),null}case 5:if(ue(v),T=v.type,m!==null&&v.stateNode!=null)Q(m,v,T,O);else{if(!O){if(v.stateNode===null)throw Error(r(166));return Ye(v),null}m=ds.current,Ue(v)?ke(v,m):(P=Kne(T,O,Ih.current,m,v),sy(P,v,!1,!1),v.stateNode=P,h9(P,T,O,m)&&fs(v))}return Ye(v),he(v,v.type,v.pendingProps),null;case 6:if(m&&v.stateNode!=null)T=m.memoizedProps,Xs?T!==O&&fs(v):Oh&&(T!==O?(v.stateNode=d9(O,Ih.current,ds.current,v),fs(v)):v.stateNode=m.stateNode);else{if(typeof O!="string"&&v.stateNode===null)throw Error(r(166));if(m=Ih.current,T=ds.current,Ue(v)){if(!Pl)throw Error(r(176));if(m=v.stateNode,T=v.memoizedProps,O=null,P=ho,P!==null)switch(P.tag){case 27:case 5:O=P.memoizedProps}Bie(m,T,v,O)||_e(v)}else v.stateNode=d9(O,m,T,v)}return Ye(v),null;case 13:if(O=v.memoizedState,m===null||m.memoizedState!==null&&m.memoizedState.dehydrated!==null){if(P=Ue(v),O!==null&&O.dehydrated!==null){if(m===null){if(!P)throw Error(r(318));if(!Pl)throw Error(r(344));if(P=v.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(r(317));zie(P,v)}else ze(),!(v.flags&128)&&(v.memoizedState=null),v.flags|=4;Ye(v),P=!1}else Fc!==null&&(oR(Fc),Fc=null),P=!0;if(!P)return v.flags&256?(hn(v),v):(hn(v),null)}if(hn(v),v.flags&128)return v.lanes=T,v;if(T=O!==null,m=m!==null&&m.memoizedState!==null,T){O=v.child,P=null,O.alternate!==null&&O.alternate.memoizedState!==null&&O.alternate.memoizedState.cachePool!==null&&(P=O.alternate.memoizedState.cachePool.pool);var X=null;O.memoizedState!==null&&O.memoizedState.cachePool!==null&&(X=O.memoizedState.cachePool.pool),X!==P&&(O.flags|=2048)}return T!==m&&T&&(v.child.flags|=8192),Me(v,v.updateQueue),Ye(v),null;case 4:return se(),mg(m,v),m===null&&$ne(v.stateNode.containerInfo),Ye(v),null;case 10:return lo(v.type),Ye(v),null;case 19:if(p(Ia),P=v.memoizedState,P===null)return Ye(v),null;if(O=(v.flags&128)!==0,X=P.rendering,X===null)if(O)We(P,!1);else{if(ca!==0||m!==null&&m.flags&128)for(m=v.child;m!==null;){if(X=ui(m),X!==null){for(v.flags|=128,We(P,!1),m=X.updateQueue,v.updateQueue=m,Me(v,m),v.subtreeFlags=0,m=T,T=v.child;T!==null;)Q4(T,m),T=T.sibling;return x(Ia,Ia.current&1|2),v.child}m=m.sibling}P.tail!==null&&Uc()>xy&&(v.flags|=128,O=!0,We(P,!1),v.lanes=4194304)}else{if(!O)if(m=ui(X),m!==null){if(v.flags|=128,O=!0,m=m.updateQueue,v.updateQueue=m,Me(v,m),We(P,!0),P.tail===null&&P.tailMode==="hidden"&&!X.alternate&&!Vi)return Ye(v),null}else 2*Uc()-P.renderingStartTime>xy&&T!==536870912&&(v.flags|=128,O=!0,We(P,!1),v.lanes=4194304);P.isBackwards?(X.sibling=v.child,v.child=X):(m=P.last,m!==null?m.sibling=X:v.child=X,P.last=X)}return P.tail!==null?(v=P.tail,P.rendering=v,P.tail=v.sibling,P.renderingStartTime=Uc(),v.sibling=null,m=Ia.current,x(Ia,O?m&1|2:m&1),v):(Ye(v),null);case 22:case 23:return hn(v),vi(),O=v.memoizedState!==null,m!==null?m.memoizedState!==null!==O&&(v.flags|=8192):O&&(v.flags|=8192),O?T&536870912&&!(v.flags&128)&&(Ye(v),v.subtreeFlags&6&&(v.flags|=8192)):Ye(v),T=v.updateQueue,T!==null&&Me(v,T.retryQueue),T=null,m!==null&&m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),O=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(O=v.memoizedState.cachePool.pool),O!==T&&(v.flags|=2048),m!==null&&p(pp),null;case 24:return T=null,m!==null&&(T=m.memoizedState.cache),v.memoizedState.cache!==T&&(v.flags|=2048),lo(oa),Ye(v),null;case 25:return null}throw Error(r(156,v.tag))}function Bt(m,v){switch(V(v),v.tag){case 1:return m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 3:return lo(oa),se(),m=v.flags,m&65536&&!(m&128)?(v.flags=m&-65537|128,v):null;case 26:case 27:case 5:return ue(v),null;case 13:if(hn(v),m=v.memoizedState,m!==null&&m.dehydrated!==null){if(v.alternate===null)throw Error(r(340));ze()}return m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 19:return p(Ia),null;case 4:return se(),null;case 10:return lo(v.type),null;case 22:case 23:return hn(v),vi(),m!==null&&p(pp),m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 24:return lo(oa),null;case 25:return null;default:return null}}function Gt(m,v){switch(V(v),v.tag){case 3:lo(oa),se();break;case 26:case 27:case 5:ue(v);break;case 4:se();break;case 13:hn(v);break;case 19:p(Ia);break;case 10:lo(v.type);break;case 22:case 23:hn(v),vi(),m!==null&&p(pp);break;case 24:lo(oa)}}function Qt(m,v){try{var T=v.updateQueue,O=T!==null?T.lastEffect:null;if(O!==null){var P=O.next;T=P;do{if((T.tag&m)===m){O=void 0;var X=T.create,be=T.inst;O=X(),be.destroy=O}T=T.next}while(T!==P)}}catch(Be){ur(v,v.return,Be)}}function Zt(m,v,T){try{var O=v.updateQueue,P=O!==null?O.lastEffect:null;if(P!==null){var X=P.next;O=X;do{if((O.tag&m)===m){var be=O.inst,Be=be.destroy;if(Be!==void 0){be.destroy=void 0,P=v;var nt=T;try{Be()}catch(Ct){ur(P,nt,Ct)}}}O=O.next}while(O!==X)}}catch(Ct){ur(v,v.return,Ct)}}function on(m){var v=m.updateQueue;if(v!==null){var T=m.stateNode;try{Ve(v,T)}catch(O){ur(m,m.return,O)}}}function Un(m,v,T){T.props=fi(m.type,m.memoizedProps),T.state=m.memoizedState;try{T.componentWillUnmount()}catch(O){ur(m,v,O)}}function hi(m,v){try{var T=m.ref;if(T!==null){var O=m.stateNode;switch(m.tag){case 26:case 27:case 5:var P=cy(O);break;default:P=O}typeof T=="function"?m.refCleanup=T(P):T.current=P}}catch(X){ur(m,v,X)}}function Hn(m,v){var T=m.ref,O=m.refCleanup;if(T!==null)if(typeof O=="function")try{O()}catch(P){ur(m,v,P)}finally{m.refCleanup=null,m=m.alternate,m!=null&&(m.refCleanup=null)}else if(typeof T=="function")try{T(null)}catch(P){ur(m,v,P)}else T.current=null}function si(m){var v=m.type,T=m.memoizedProps,O=m.stateNode;try{gie(O,v,T,m)}catch(P){ur(m,m.return,P)}}function Cn(m,v,T){try{bie(m.stateNode,m.type,T,v,m)}catch(O){ur(m,m.return,O)}}function vn(m){return m.tag===5||m.tag===3||(Ul?m.tag===26:!1)||(Ks?m.tag===27:!1)||m.tag===4}function lr(m){e:for(;;){for(;m.sibling===null;){if(m.return===null||vn(m.return))return null;m=m.return}for(m.sibling.return=m.return,m=m.sibling;m.tag!==5&&m.tag!==6&&(!Ks||m.tag!==27)&&m.tag!==18;){if(m.flags&2||m.child===null||m.tag===4)continue e;m.child.return=m,m=m.child}if(!(m.flags&2))return m.stateNode}}function Mr(m,v,T){var O=m.tag;if(O===5||O===6)m=m.stateNode,v?yie(T,m,v):pie(T,m);else if(!(O===4||Ks&&O===27)&&(m=m.child,m!==null))for(Mr(m,v,T),m=m.sibling;m!==null;)Mr(m,v,T),m=m.sibling}function Zr(m,v,T){var O=m.tag;if(O===5||O===6)m=m.stateNode,v?vie(T,m,v):die(T,m);else if(!(O===4||Ks&&O===27)&&(m=m.child,m!==null))for(Zr(m,v,T),m=m.sibling;m!==null;)Zr(m,v,T),m=m.sibling}function Zi(m,v,T){m=m.containerInfo;try{x9(m,T)}catch(O){ur(v,v.return,O)}}function Gr(m,v){for(qne(m.containerInfo),Xa=v;Xa!==null;)if(m=Xa,v=m.child,(m.subtreeFlags&1028)!==0&&v!==null)v.return=m,Xa=v;else for(;Xa!==null;){m=Xa;var T=m.alternate;switch(v=m.flags,m.tag){case 0:break;case 11:case 15:break;case 1:if(v&1024&&T!==null){v=void 0;var O=m,P=T.memoizedProps;T=T.memoizedState;var X=O.stateNode;try{var be=fi(O.type,P,O.elementType===O.type);v=X.getSnapshotBeforeUpdate(be,T),X.__reactInternalSnapshotBeforeUpdate=v}catch(Be){ur(O,O.return,Be)}}break;case 3:v&1024&&Xs&&Tie(m.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(v&1024)throw Error(r(163))}if(v=m.sibling,v!==null){v.return=m.return,Xa=v;break}Xa=m.return}return be=H9,H9=!1,be}function Gs(m,v,T){var O=T.flags;switch(T.tag){case 0:case 11:case 15:hs(m,T),O&4&&Qt(5,T);break;case 1:if(hs(m,T),O&4)if(m=T.stateNode,v===null)try{m.componentDidMount()}catch(Be){ur(T,T.return,Be)}else{var P=fi(T.type,v.memoizedProps);v=v.memoizedState;try{m.componentDidUpdate(P,v,m.__reactInternalSnapshotBeforeUpdate)}catch(Be){ur(T,T.return,Be)}}O&64&&on(T),O&512&&hi(T,T.return);break;case 3:if(hs(m,T),O&64&&(O=T.updateQueue,O!==null)){if(m=null,T.child!==null)switch(T.child.tag){case 27:case 5:m=cy(T.child.stateNode);break;case 1:m=T.child.stateNode}try{Ve(O,m)}catch(Be){ur(T,T.return,Be)}}break;case 26:if(Ul){hs(m,T),O&512&&hi(T,T.return);break}case 27:case 5:hs(m,T),v===null&&O&4&&si(T),O&512&&hi(T,T.return);break;case 12:hs(m,T);break;case 13:hs(m,T),O&4&&Jo(m,T);break;case 22:if(P=T.memoizedState!==null||Mf,!P){v=v!==null&&v.memoizedState!==null||la;var X=Mf,be=la;Mf=P,(la=v)&&!be?Pc(m,T,(T.subtreeFlags&8772)!==0):hs(m,T),Mf=X,la=be}O&512&&(T.memoizedProps.mode==="manual"?hi(T,T.return):Hn(T,T.return));break;default:hs(m,T)}}function Wa(m){var v=m.alternate;v!==null&&(m.alternate=null,Wa(v)),m.child=null,m.deletions=null,m.sibling=null,m.tag===5&&(v=m.stateNode,v!==null&&eie(v)),m.stateNode=null,m.return=null,m.dependencies=null,m.memoizedProps=null,m.memoizedState=null,m.pendingProps=null,m.stateNode=null,m.updateQueue=null}function Wr(m,v,T){for(T=T.child;T!==null;)co(m,v,T),T=T.sibling}function co(m,v,T){if(tl&&typeof tl.onCommitFiberUnmount=="function")try{tl.onCommitFiberUnmount(hy,T)}catch{}switch(T.tag){case 26:if(Ul){la||Hn(T,v),Wr(m,v,T),T.memoizedState?R9(T.memoizedState):T.stateNode&&D9(T.stateNode);break}case 27:if(Ks){la||Hn(T,v);var O=Sa,P=il;Sa=T.stateNode,Wr(m,v,T),tre(T.stateNode),Sa=O,il=P;break}case 5:la||Hn(T,v);case 6:if(Xs){if(O=Sa,P=il,Sa=null,Wr(m,v,T),Sa=O,il=P,Sa!==null)if(il)try{_ie(Sa,T.stateNode)}catch(X){ur(T,v,X)}else try{xie(Sa,T.stateNode)}catch(X){ur(T,v,X)}}else Wr(m,v,T);break;case 18:Xs&&Sa!==null&&(il?Wie(Sa,T.stateNode):Gie(Sa,T.stateNode));break;case 4:Xs?(O=Sa,P=il,Sa=T.stateNode.containerInfo,il=!0,Wr(m,v,T),Sa=O,il=P):(Oh&&Zi(T.stateNode,T,v9()),Wr(m,v,T));break;case 0:case 11:case 14:case 15:la||Zt(2,T,v),la||Zt(4,T,v),Wr(m,v,T);break;case 1:la||(Hn(T,v),O=T.stateNode,typeof O.componentWillUnmount=="function"&&Un(T,v,O)),Wr(m,v,T);break;case 21:Wr(m,v,T);break;case 22:la||Hn(T,v),la=(O=la)||T.memoizedState!==null,Wr(m,v,T),la=O;break;default:Wr(m,v,T)}}function Jo(m,v){if(Pl&&v.memoizedState===null&&(m=v.alternate,m!==null&&(m=m.memoizedState,m!==null&&(m=m.dehydrated,m!==null))))try{Vie(m)}catch(T){ur(v,v.return,T)}}function uo(m){switch(m.tag){case 13:case 19:var v=m.stateNode;return v===null&&(v=m.stateNode=new j9),v;case 22:return m=m.stateNode,v=m._retryCache,v===null&&(v=m._retryCache=new j9),v;default:throw Error(r(435,m.tag))}}function Ws(m,v){var T=uo(m);v.forEach(function(O){var P=Ine.bind(null,m,O);T.has(O)||(T.add(O),O.then(P,P))})}function Tr(m,v){var T=v.deletions;if(T!==null)for(var O=0;O<T.length;O++){var P=T[O],X=m,be=v;if(Xs){var Be=be;e:for(;Be!==null;){switch(Be.tag){case 27:case 5:Sa=Be.stateNode,il=!1;break e;case 3:Sa=Be.stateNode.containerInfo,il=!0;break e;case 4:Sa=Be.stateNode.containerInfo,il=!0;break e}Be=Be.return}if(Sa===null)throw Error(r(160));co(X,be,P),Sa=null,il=!1}else co(X,be,P);X=P.alternate,X!==null&&(X.return=null),P.return=null}if(v.subtreeFlags&13878)for(v=v.child;v!==null;)$o(v,m),v=v.sibling}function $o(m,v){var T=m.alternate,O=m.flags;switch(m.tag){case 0:case 11:case 14:case 15:Tr(v,m),cr(m),O&4&&(Zt(3,m,m.return),Qt(3,m),Zt(5,m,m.return));break;case 1:Tr(v,m),cr(m),O&512&&(la||T===null||Hn(T,T.return)),O&64&&Mf&&(m=m.updateQueue,m!==null&&(O=m.callbacks,O!==null&&(T=m.shared.hiddenCallbacks,m.shared.hiddenCallbacks=T===null?O:T.concat(O))));break;case 26:if(Ul){var P=Bc;Tr(v,m),cr(m),O&512&&(la||T===null||Hn(T,T.return)),O&4&&(O=T!==null?T.memoizedState:null,v=m.memoizedState,T===null?v===null?m.stateNode===null?m.stateNode=Kie(P,m.type,m.memoizedProps,m):k9(P,m.type,m.stateNode):m.stateNode=C9(P,v,m.memoizedProps):O!==v?(O===null?T.stateNode!==null&&D9(T.stateNode):R9(O),v===null?k9(P,m.type,m.stateNode):C9(P,v,m.memoizedProps)):v===null&&m.stateNode!==null&&Cn(m,m.memoizedProps,T.memoizedProps));break}case 27:if(Ks&&O&4&&m.alternate===null){P=m.stateNode;var X=m.memoizedProps;try{Qie(P),ere(m.type,X,P,m)}catch(qt){ur(m,m.return,qt)}}case 5:if(Tr(v,m),cr(m),O&512&&(la||T===null||Hn(T,T.return)),Xs){if(m.flags&32){v=m.stateNode;try{b9(v)}catch(qt){ur(m,m.return,qt)}}O&4&&m.stateNode!=null&&(v=m.memoizedProps,Cn(m,v,T!==null?T.memoizedProps:v)),O&1024&&(HR=!0)}break;case 6:if(Tr(v,m),cr(m),O&4&&Xs){if(m.stateNode===null)throw Error(r(162));O=m.memoizedProps,T=T!==null?T.memoizedProps:O,v=m.stateNode;try{mie(v,T,O)}catch(qt){ur(m,m.return,qt)}}break;case 3:if(Ul?(Jie(),P=Bc,Bc=CR(v.containerInfo),Tr(v,m),Bc=P):Tr(v,m),cr(m),O&4){if(Xs&&Pl&&T!==null&&T.memoizedState.isDehydrated)try{Hie(v.containerInfo)}catch(qt){ur(m,m.return,qt)}if(Oh){O=v.containerInfo,T=v.pendingChildren;try{x9(O,T)}catch(qt){ur(m,m.return,qt)}}}HR&&(HR=!1,qs(m));break;case 4:Ul?(T=Bc,Bc=CR(m.stateNode.containerInfo),Tr(v,m),cr(m),Bc=T):(Tr(v,m),cr(m)),O&4&&Oh&&Zi(m.stateNode,m,m.stateNode.pendingChildren);break;case 12:Tr(v,m),cr(m);break;case 13:Tr(v,m),cr(m),m.child.flags&8192&&m.memoizedState!==null!=(T!==null&&T.memoizedState!==null)&&(qR=Uc()),O&4&&(O=m.updateQueue,O!==null&&(m.updateQueue=null,Ws(m,O)));break;case 22:O&512&&(la||T===null||Hn(T,T.return)),P=m.memoizedState!==null;var be=T!==null&&T.memoizedState!==null,Be=Mf,nt=la;if(Mf=Be||P,la=nt||be,Tr(v,m),la=nt,Mf=Be,cr(m),v=m.stateNode,v._current=m,v._visibility&=-3,v._visibility|=v._pendingVisibility&2,O&8192&&(v._visibility=P?v._visibility&-2:v._visibility|1,P&&(v=Mf||la,T===null||be||v||sa(m)),Xs&&(m.memoizedProps===null||m.memoizedProps.mode!=="manual"))){e:if(T=null,Xs)for(v=m;;){if(v.tag===5||Ul&&v.tag===26||Ks&&v.tag===27){if(T===null){be=T=v;try{X=be.stateNode,P?Sie(X):Eie(be.stateNode,be.memoizedProps)}catch(qt){ur(be,be.return,qt)}}}else if(v.tag===6){if(T===null){be=v;try{var Ct=be.stateNode;P?wie(Ct):Mie(Ct,be.memoizedProps)}catch(qt){ur(be,be.return,qt)}}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===m)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===m)break e;for(;v.sibling===null;){if(v.return===null||v.return===m)break e;T===v&&(T=null),v=v.return}T===v&&(T=null),v.sibling.return=v.return,v=v.sibling}}O&4&&(O=m.updateQueue,O!==null&&(T=O.retryQueue,T!==null&&(O.retryQueue=null,Ws(m,T))));break;case 19:Tr(v,m),cr(m),O&4&&(O=m.updateQueue,O!==null&&(m.updateQueue=null,Ws(m,O)));break;case 21:break;default:Tr(v,m),cr(m)}}function cr(m){var v=m.flags;if(v&2){try{if(Xs&&(!Ks||m.tag!==27)){e:{for(var T=m.return;T!==null;){if(vn(T)){var O=T;break e}T=T.return}throw Error(r(160))}switch(O.tag){case 27:if(Ks){var P=O.stateNode,X=lr(m);Zr(m,X,P);break}case 5:var be=O.stateNode;O.flags&32&&(b9(be),O.flags&=-33);var Be=lr(m);Zr(m,Be,be);break;case 3:case 4:var nt=O.stateNode.containerInfo,Ct=lr(m);Mr(m,Ct,nt);break;default:throw Error(r(161))}}}catch(qt){ur(m,m.return,qt)}m.flags&=-3}v&4096&&(m.flags&=-4097)}function qs(m){if(m.subtreeFlags&1024)for(m=m.child;m!==null;){var v=m;qs(v),v.tag===5&&v.flags&1024&&rie(v.stateNode),m=m.sibling}}function hs(m,v){if(v.subtreeFlags&8772)for(v=v.child;v!==null;)Gs(m,v.alternate,v),v=v.sibling}function sa(m){for(m=m.child;m!==null;){var v=m;switch(v.tag){case 0:case 11:case 14:case 15:Zt(4,v,v.return),sa(v);break;case 1:Hn(v,v.return);var T=v.stateNode;typeof T.componentWillUnmount=="function"&&Un(v,v.return,T),sa(v);break;case 26:case 27:case 5:Hn(v,v.return),sa(v);break;case 22:Hn(v,v.return),v.memoizedState===null&&sa(v);break;default:sa(v)}m=m.sibling}}function Pc(m,v,T){for(T=T&&(v.subtreeFlags&8772)!==0,v=v.child;v!==null;){var O=v.alternate,P=m,X=v,be=X.flags;switch(X.tag){case 0:case 11:case 15:Pc(P,X,T),Qt(4,X);break;case 1:if(Pc(P,X,T),O=X,P=O.stateNode,typeof P.componentDidMount=="function")try{P.componentDidMount()}catch(Ct){ur(O,O.return,Ct)}if(O=X,P=O.updateQueue,P!==null){var Be=O.stateNode;try{var nt=P.shared.hiddenCallbacks;if(nt!==null)for(P.shared.hiddenCallbacks=null,P=0;P<nt.length;P++)Oe(nt[P],Be)}catch(Ct){ur(O,O.return,Ct)}}T&&be&64&&on(X),hi(X,X.return);break;case 26:case 27:case 5:Pc(P,X,T),T&&O===null&&be&4&&si(X),hi(X,X.return);break;case 12:Pc(P,X,T);break;case 13:Pc(P,X,T),T&&be&4&&Jo(P,X);break;case 22:X.memoizedState===null&&Pc(P,X,T),hi(X,X.return);break;default:Pc(P,X,T)}v=v.sibling}}function tR(m,v){var T=null;m!==null&&m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),m=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(m=v.memoizedState.cachePool.pool),m!==T&&(m!=null&&m.refCount++,T!=null&&Vr(T))}function nR(m,v){m=null,v.alternate!==null&&(m=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==m&&(v.refCount++,m!=null&&Vr(m))}function Ch(m,v,T,O){if(v.subtreeFlags&10256)for(v=v.child;v!==null;)O4(m,v,T,O),v=v.sibling}function O4(m,v,T,O){var P=v.flags;switch(v.tag){case 0:case 11:case 15:Ch(m,v,T,O),P&2048&&Qt(9,v);break;case 3:Ch(m,v,T,O),P&2048&&(m=null,v.alternate!==null&&(m=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==m&&(v.refCount++,m!=null&&Vr(m)));break;case 12:if(P&2048){Ch(m,v,T,O),m=v.stateNode;try{var X=v.memoizedProps,be=X.id,Be=X.onPostCommit;typeof Be=="function"&&Be(be,v.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(nt){ur(v,v.return,nt)}}else Ch(m,v,T,O);break;case 23:break;case 22:X=v.stateNode,v.memoizedState!==null?X._visibility&4?Ch(m,v,T,O):oy(m,v):X._visibility&4?Ch(m,v,T,O):(X._visibility|=4,gg(m,v,T,O,(v.subtreeFlags&10256)!==0)),P&2048&&tR(v.alternate,v);break;case 24:Ch(m,v,T,O),P&2048&&nR(v.alternate,v);break;default:Ch(m,v,T,O)}}function gg(m,v,T,O,P){for(P=P&&(v.subtreeFlags&10256)!==0,v=v.child;v!==null;){var X=m,be=v,Be=T,nt=O,Ct=be.flags;switch(be.tag){case 0:case 11:case 15:gg(X,be,Be,nt,P),Qt(8,be);break;case 23:break;case 22:var qt=be.stateNode;be.memoizedState!==null?qt._visibility&4?gg(X,be,Be,nt,P):oy(X,be):(qt._visibility|=4,gg(X,be,Be,nt,P)),P&&Ct&2048&&tR(be.alternate,be);break;case 24:gg(X,be,Be,nt,P),P&&Ct&2048&&nR(be.alternate,be);break;default:gg(X,be,Be,nt,P)}v=v.sibling}}function oy(m,v){if(v.subtreeFlags&10256)for(v=v.child;v!==null;){var T=m,O=v,P=O.flags;switch(O.tag){case 22:oy(T,O),P&2048&&tR(O.alternate,O);break;case 24:oy(T,O),P&2048&&nR(O.alternate,O);break;default:oy(T,O)}v=v.sibling}}function ip(m){if(m.subtreeFlags&Pg)for(m=m.child;m!==null;)I4(m),m=m.sibling}function I4(m){switch(m.tag){case 26:ip(m),m.flags&Pg&&(m.memoizedState!==null?Zie(Bc,m.memoizedState,m.memoizedProps):g9(m.type,m.memoizedProps));break;case 5:ip(m),m.flags&Pg&&g9(m.type,m.memoizedProps);break;case 3:case 4:if(Ul){var v=Bc;Bc=CR(m.stateNode.containerInfo),ip(m),Bc=v}else ip(m);break;case 22:m.memoizedState===null&&(v=m.alternate,v!==null&&v.memoizedState!==null?(v=Pg,Pg=16777216,ip(m),Pg=v):ip(m));break;default:ip(m)}}function N4(m){var v=m.alternate;if(v!==null&&(m=v.child,m!==null)){v.child=null;do v=m.sibling,m.sibling=null,m=v;while(m!==null)}}function ly(m){var v=m.deletions;if(m.flags&16){if(v!==null)for(var T=0;T<v.length;T++){var O=v[T];Xa=O,P4(O,m)}N4(m)}if(m.subtreeFlags&10256)for(m=m.child;m!==null;)L4(m),m=m.sibling}function L4(m){switch(m.tag){case 0:case 11:case 15:ly(m),m.flags&2048&&Zt(9,m,m.return);break;case 3:ly(m);break;case 12:ly(m);break;case 22:var v=m.stateNode;m.memoizedState!==null&&v._visibility&4&&(m.return===null||m.return.tag!==13)?(v._visibility&=-5,uS(m)):ly(m);break;default:ly(m)}}function uS(m){var v=m.deletions;if(m.flags&16){if(v!==null)for(var T=0;T<v.length;T++){var O=v[T];Xa=O,P4(O,m)}N4(m)}for(m=m.child;m!==null;){switch(v=m,v.tag){case 0:case 11:case 15:Zt(8,v,v.return),uS(v);break;case 22:T=v.stateNode,T._visibility&4&&(T._visibility&=-5,uS(v));break;default:uS(v)}m=m.sibling}}function P4(m,v){for(;Xa!==null;){var T=Xa;switch(T.tag){case 0:case 11:case 15:Zt(8,T,v);break;case 23:case 22:if(T.memoizedState!==null&&T.memoizedState.cachePool!==null){var O=T.memoizedState.cachePool.pool;O!=null&&O.refCount++}break;case 24:Vr(T.memoizedState.cache)}if(O=T.child,O!==null)O.return=T,Xa=O;else e:for(T=m;Xa!==null;){O=Xa;var P=O.sibling,X=O.return;if(Wa(O),O===T){Xa=null;break e}if(P!==null){P.return=X,Xa=P;break e}Xa=X}}}function iR(m){var v=p9(m);if(v!=null){if(typeof v.memoizedProps["data-testname"]!="string")throw Error(r(364));return v}if(m=oie(m),m===null)throw Error(r(362));return m.stateNode.current}function rR(m,v){var T=m.tag;switch(v.$$typeof){case RS:if(m.type===v.value)return!0;break;case kS:e:{for(v=v.value,m=[m,0],T=0;T<m.length;){var O=m[T++],P=O.tag,X=m[T++],be=v[X];if(P!==5&&P!==26&&P!==27||!fy(O)){for(;be!=null&&rR(O,be);)X++,be=v[X];if(X===v.length){v=!0;break e}else for(O=O.child;O!==null;)m.push(O,X),O=O.sibling}}v=!1}return v;case DS:if((T===5||T===26||T===27)&&uie(m.stateNode,v.value))return!0;break;case IS:if((T===5||T===6||T===26||T===27)&&(m=cie(m),m!==null&&0<=m.indexOf(v.value)))return!0;break;case OS:if((T===5||T===26||T===27)&&(m=m.memoizedProps["data-testname"],typeof m=="string"&&m.toLowerCase()===v.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function aR(m){switch(m.$$typeof){case RS:return"<"+(s(m.value)||"Unknown")+">";case kS:return":has("+(aR(m)||"")+")";case DS:return'[role="'+m.value+'"]';case IS:return'"'+m.value+'"';case OS:return'[data-testname="'+m.value+'"]';default:throw Error(r(365))}}function U4(m,v){var T=[];m=[m,0];for(var O=0;O<m.length;){var P=m[O++],X=P.tag,be=m[O++],Be=v[be];if(X!==5&&X!==26&&X!==27||!fy(P)){for(;Be!=null&&rR(P,Be);)be++,Be=v[be];if(be===v.length)T.push(P);else for(P=P.child;P!==null;)m.push(P,be),P=P.sibling}}return T}function sR(m,v){if(!uy)throw Error(r(363));m=iR(m),m=U4(m,v),v=[],m=Array.from(m);for(var T=0;T<m.length;){var O=m[T++],P=O.tag;if(P===5||P===26||P===27)fy(O)||v.push(O.stateNode);else for(O=O.child;O!==null;)m.push(O),O=O.sibling}return v}function Zo(){if(mr&2&&Ui!==0)return Ui&-Ui;if(qn.T!==null){var m=Rg;return m!==0?m:me()}return Zne()}function F4(){Hl===0&&(Hl=!(Ui&536870912)||Vi?C():536870912);var m=jl.current;return m!==null&&(m.flags|=32),Hl}function fo(m,v,T){(m===Ar&&Cr===2||m.cancelPendingCommit!==null)&&(bg(m,0),xf(m,Ui,Hl,!1)),N(m,T),(!(mr&2)||m!==Ar)&&(m===Ar&&(!(mr&2)&&(mp|=T),ca===4&&xf(m,Ui,Hl,!1)),Pe(m))}function B4(m,v,T){if(mr&6)throw Error(r(327));var O=!T&&(v&60)===0&&(v&m.expiredLanes)===0||S(m,v),P=O?Cne(m,v):uR(m,v,!0),X=O;do{if(P===0){Ug&&!O&&xf(m,v,0,!1);break}else if(P===6)xf(m,v,0,!Tf);else{if(T=m.current.alternate,X&&!Tne(T)){P=uR(m,v,!1),X=!1;continue}if(P===2){if(X=v,m.errorRecoveryDisabledLanes&X)var be=0;else be=m.pendingLanes&-536870913,be=be!==0?be:be&536870912?536870912:0;if(be!==0){v=be;e:{var Be=m;P=yy;var nt=Pl&&Be.current.memoizedState.isDehydrated;if(nt&&(bg(Be,be).flags|=256),be=uR(Be,be,!1),be!==2){if(VR&&!nt){Be.errorRecoveryDisabledLanes|=X,mp|=X,P=4;break e}X=Au,Au=P,X!==null&&oR(X)}P=be}if(X=!1,P!==2)continue}}if(P===1){bg(m,0),xf(m,v,0,!0);break}e:{switch(O=m,P){case 0:case 1:throw Error(r(345));case 4:if((v&4194176)===v){xf(O,v,Hl,!Tf);break e}break;case 2:Au=null;break;case 3:case 5:break;default:throw Error(r(329))}if(O.finishedWork=T,O.finishedLanes=v,(v&62914560)===v&&(X=qR+300-Uc(),10<X)){if(xf(O,v,Hl,!Tf),M(O,0)!==0)break e;O.timeoutHandle=Yne(z4.bind(null,O,T,Au,NS,WR,v,Hl,mp,Fg,Tf,2,-0,0),X);break e}z4(O,T,Au,NS,WR,v,Hl,mp,Fg,Tf,0,-0,0)}}break}while(!0);Pe(m)}function oR(m){Au===null?Au=m:Au.push.apply(Au,m)}function z4(m,v,T,O,P,X,be,Be,nt,Ct,qt,an,sn){var Zn=v.subtreeFlags;if((Zn&8192||(Zn&16785408)===16785408)&&(nie(),I4(v),v=iie(),v!==null)){m.cancelPendingCommit=v(Y4.bind(null,m,T,O,P,be,Be,nt,1,an,sn)),xf(m,X,be,!Ct);return}Y4(m,T,O,P,be,Be,nt,qt,an,sn)}function Tne(m){for(var v=m;;){var T=v.tag;if((T===0||T===11||T===15)&&v.flags&16384&&(T=v.updateQueue,T!==null&&(T=T.stores,T!==null)))for(var O=0;O<T.length;O++){var P=T[O],X=P.getSnapshot;P=P.value;try{if(!nl(X(),P))return!1}catch{return!1}}if(T=v.child,v.subtreeFlags&16384&&T!==null)T.return=v,v=T;else{if(v===m)break;for(;v.sibling===null;){if(v.return===null||v.return===m)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function xf(m,v,T,O){v&=~GR,v&=~mp,m.suspendedLanes|=v,m.pingedLanes&=~v,O&&(m.warmLanes|=v),O=m.expirationTimes;for(var P=v;0<P;){var X=31-el(P),be=1<<X;O[X]=-1,P&=~be}T!==0&&j(m,T,v)}function j4(){return mr&6?!0:(He(0),!1)}function lR(){if(Ti!==null){if(Cr===0)var m=Ti.return;else m=Ti,Ef=dp=null,ee(m),Og=null,gy=0,m=Ti;for(;m!==null;)Gt(m.alternate,m),m=m.return;Ti=null}}function bg(m,v){m.finishedWork=null,m.finishedLanes=0;var T=m.timeoutHandle;T!==MR&&(m.timeoutHandle=MR,Jne(T)),T=m.cancelPendingCommit,T!==null&&(m.cancelPendingCommit=null,T()),lR(),Ar=m,Ti=T=Rh(m.current,null),Ui=v,Cr=0,rl=null,Tf=!1,Ug=S(m,v),VR=!1,Fg=Hl=GR=mp=Uh=ca=0,Au=yy=null,WR=!1,v&8&&(v|=v&32);var O=m.entangledLanes;if(O!==0)for(m=m.entanglements,O&=v;0<O;){var P=31-el(O),X=1<<P;v|=m[P],O&=~X}return Af=v,Fe(),T}function H4(m,v){di=null,qn.H=Tu,v===my?(v=vt(),Cr=3):v===FR?(v=vt(),Cr=4):Cr=v===B9?8:v!==null&&typeof v=="object"&&typeof v.then=="function"?6:1,rl=v,Ti===null&&(ca=1,Da(m,W(v,m.current)))}function V4(){var m=jl.current;return m===null?!0:(Ui&4194176)===Ui?Mu===null:(Ui&62914560)===Ui||Ui&536870912?m===Mu:!1}function G4(){var m=qn.H;return qn.H=Tu,m===null?Tu:m}function W4(){var m=qn.A;return qn.A=mre,m}function cR(){ca=4,Tf||(Ui&4194176)!==Ui&&jl.current!==null||(Ug=!0),!(Uh&134217727)&&!(mp&134217727)||Ar===null||xf(Ar,Ui,Hl,!1)}function uR(m,v,T){var O=mr;mr|=2;var P=G4(),X=W4();(Ar!==m||Ui!==v)&&(NS=null,bg(m,v)),v=!1;var be=ca;e:do try{if(Cr!==0&&Ti!==null){var Be=Ti,nt=rl;switch(Cr){case 8:lR(),be=6;break e;case 3:case 2:case 6:jl.current===null&&(v=!0);var Ct=Cr;if(Cr=0,rl=null,vg(m,Be,nt,Ct),T&&Ug){be=0;break e}break;default:Ct=Cr,Cr=0,rl=null,vg(m,Be,nt,Ct)}}Ane(),be=ca;break}catch(qt){H4(m,qt)}while(!0);return v&&m.shellSuspendCounter++,Ef=dp=null,mr=O,qn.H=P,qn.A=X,Ti===null&&(Ar=null,Ui=0,Fe()),be}function Ane(){for(;Ti!==null;)q4(Ti)}function Cne(m,v){var T=mr;mr|=2;var O=G4(),P=W4();Ar!==m||Ui!==v?(NS=null,xy=Uc()+500,bg(m,v)):Ug=S(m,v);e:do try{if(Cr!==0&&Ti!==null){v=Ti;var X=rl;t:switch(Cr){case 1:Cr=0,rl=null,vg(m,v,X,1);break;case 2:if(Ft(X)){Cr=0,rl=null,X4(v);break}v=function(){Cr===2&&Ar===m&&(Cr=7),Pe(m)},X.then(v,v);break e;case 3:Cr=7;break e;case 4:Cr=5;break e;case 7:Ft(X)?(Cr=0,rl=null,X4(v)):(Cr=0,rl=null,vg(m,v,X,7));break;case 5:var be=null;switch(Ti.tag){case 26:be=Ti.memoizedState;case 5:case 27:var Be=Ti,nt=Be.type,Ct=Be.pendingProps;if(be?O9(be):m9(nt,Ct)){Cr=0,rl=null;var qt=Be.sibling;if(qt!==null)Ti=qt;else{var an=Be.return;an!==null?(Ti=an,fS(an)):Ti=null}break t}}Cr=0,rl=null,vg(m,v,X,5);break;case 6:Cr=0,rl=null,vg(m,v,X,6);break;case 8:lR(),ca=6;break e;default:throw Error(r(462))}}Rne();break}catch(sn){H4(m,sn)}while(!0);return Ef=dp=null,qn.H=O,qn.A=P,mr=T,Ti!==null?0:(Ar=null,Ui=0,Fe(),ca)}function Rne(){for(;Ti!==null&&!rre();)q4(Ti)}function q4(m){var v=us(m.alternate,m,Af);m.memoizedProps=m.pendingProps,v===null?fS(m):Ti=v}function X4(m){var v=m,T=v.alternate;switch(v.tag){case 15:case 0:v=pt(T,v,v.pendingProps,v.type,void 0,Ui);break;case 11:v=pt(T,v,v.pendingProps,v.type.render,v.ref,Ui);break;case 5:ee(v);default:Gt(T,v),v=Ti=Q4(v,Af),v=us(T,v,Af)}m.memoizedProps=m.pendingProps,v===null?fS(m):Ti=v}function vg(m,v,T,O){Ef=dp=null,ee(v),Og=null,gy=0;var P=v.return;try{if(ep(m,P,v,T,Ui)){ca=1,Da(m,W(T,m.current)),Ti=null;return}}catch(X){if(P!==null)throw Ti=P,X;ca=1,Da(m,W(T,m.current)),Ti=null;return}v.flags&32768?(Vi||O===1?m=!0:Ug||Ui&536870912?m=!1:(Tf=m=!0,(O===2||O===3||O===6)&&(O=jl.current,O!==null&&O.tag===13&&(O.flags|=16384))),K4(v,m)):fS(v)}function fS(m){var v=m;do{if(v.flags&32768){K4(v,Tf);return}m=v.return;var T=At(v.alternate,v,Af);if(T!==null){Ti=T;return}if(v=v.sibling,v!==null){Ti=v;return}Ti=v=m}while(v!==null);ca===0&&(ca=5)}function K4(m,v){do{var T=Bt(m.alternate,m);if(T!==null){T.flags&=32767,Ti=T;return}if(T=m.return,T!==null&&(T.flags|=32768,T.subtreeFlags=0,T.deletions=null),!v&&(m=m.sibling,m!==null)){Ti=m;return}Ti=m=T}while(m!==null);ca=6,Ti=null}function Y4(m,v,T,O,P,X,be,Be,nt,Ct){var qt=qn.T,an=sp();try{ko(2),qn.T=null,kne(m,v,T,O,an,P,X,be,Be,nt,Ct)}finally{qn.T=qt,ko(an)}}function kne(m,v,T,O,P,X,be,Be){do rp();while(gp!==null);if(mr&6)throw Error(r(327));var nt=m.finishedWork;if(O=m.finishedLanes,nt===null)return null;if(m.finishedWork=null,m.finishedLanes=0,nt===m.current)throw Error(r(177));m.callbackNode=null,m.callbackPriority=0,m.cancelPendingCommit=null;var Ct=nt.lanes|nt.childLanes;if(Ct|=IR,U(m,O,Ct,X,be,Be),m===Ar&&(Ti=Ar=null,Ui=0),!(nt.subtreeFlags&10256)&&!(nt.flags&10256)||LS||(LS=!0,XR=Ct,KR=T,Nne(DR,function(){return rp(),null})),T=(nt.flags&15990)!==0,nt.subtreeFlags&15990||T?(T=qn.T,qn.T=null,X=sp(),ko(2),be=mr,mr|=4,Gr(m,nt),$o(nt,m),Xne(m.containerInfo),m.current=nt,Gs(m,nt.alternate,nt),are(),mr=be,ko(X),qn.T=T):m.current=nt,LS?(LS=!1,gp=m,_y=O):J4(m,Ct),Ct=m.pendingLanes,Ct===0&&(Fh=null),B(nt.stateNode),Pe(m),v!==null)for(P=m.onRecoverableError,nt=0;nt<v.length;nt++)Ct=v[nt],P(Ct.value,{componentStack:Ct.stack});return _y&3&&rp(),Ct=m.pendingLanes,O&4194218&&Ct&42?m===YR?Sy++:(Sy=0,YR=m):Sy=0,He(0),null}function J4(m,v){(m.pooledCacheLanes&=v)===0&&(v=m.pooledCache,v!=null&&(m.pooledCache=null,Vr(v)))}function rp(){if(gp!==null){var m=gp,v=XR;XR=0;var T=q(_y),O=32>T?32:T;T=qn.T;var P=sp();try{if(ko(O),qn.T=null,gp===null)var X=!1;else{O=KR,KR=null;var be=gp,Be=_y;if(gp=null,_y=0,mr&6)throw Error(r(331));var nt=mr;if(mr|=4,L4(be.current),O4(be,be.current,Be,O),mr=nt,He(0,!1),tl&&typeof tl.onPostCommitFiberRoot=="function")try{tl.onPostCommitFiberRoot(hy,be)}catch{}X=!0}return X}finally{ko(P),qn.T=T,J4(m,v)}}return!1}function $4(m,v,T){v=W(T,v),v=Ko(m.stateNode,v,2),m=tt(m,v,2),m!==null&&(N(m,2),Pe(m))}function ur(m,v,T){if(m.tag===3)$4(m,m,T);else for(;v!==null;){if(v.tag===3){$4(v,m,T);break}else if(v.tag===1){var O=v.stateNode;if(typeof v.type.getDerivedStateFromError=="function"||typeof O.componentDidCatch=="function"&&(Fh===null||!Fh.has(O))){m=W(T,m),T=os(2),O=tt(v,T,2),O!==null&&(Ei(T,O,v,m),N(O,2),Pe(O));break}}v=v.return}}function fR(m,v,T){var O=m.pingCache;if(O===null){O=m.pingCache=new gre;var P=new Set;O.set(v,P)}else P=O.get(v),P===void 0&&(P=new Set,O.set(v,P));P.has(T)||(VR=!0,P.add(T),m=Dne.bind(null,m,v,T),v.then(m,m))}function Dne(m,v,T){var O=m.pingCache;O!==null&&O.delete(v),m.pingedLanes|=m.suspendedLanes&T,m.warmLanes&=~T,Ar===m&&(Ui&T)===T&&(ca===4||ca===3&&(Ui&62914560)===Ui&&300>Uc()-qR?!(mr&2)&&bg(m,0):GR|=T,Fg===Ui&&(Fg=0)),Pe(m)}function Z4(m,v){v===0&&(v=D()),m=we(m,v),m!==null&&(N(m,v),Pe(m))}function One(m){var v=m.memoizedState,T=0;v!==null&&(T=v.retryLane),Z4(m,T)}function Ine(m,v){var T=0;switch(m.tag){case 13:var O=m.stateNode,P=m.memoizedState;P!==null&&(T=P.retryLane);break;case 19:O=m.stateNode;break;case 22:O=m.stateNode._retryCache;break;default:throw Error(r(314))}O!==null&&O.delete(v),Z4(m,T)}function Nne(m,v){return vS(m,v)}function Lne(m,v,T,O){this.tag=m,this.key=T,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=v,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=O,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hR(m){return m=m.prototype,!(!m||!m.isReactComponent)}function Rh(m,v){var T=m.alternate;return T===null?(T=n(m.tag,v,m.key,m.mode),T.elementType=m.elementType,T.type=m.type,T.stateNode=m.stateNode,T.alternate=m,m.alternate=T):(T.pendingProps=v,T.type=m.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=m.flags&31457280,T.childLanes=m.childLanes,T.lanes=m.lanes,T.child=m.child,T.memoizedProps=m.memoizedProps,T.memoizedState=m.memoizedState,T.updateQueue=m.updateQueue,v=m.dependencies,T.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},T.sibling=m.sibling,T.index=m.index,T.ref=m.ref,T.refCleanup=m.refCleanup,T}function Q4(m,v){m.flags&=31457282;var T=m.alternate;return T===null?(m.childLanes=0,m.lanes=v,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=T.childLanes,m.lanes=T.lanes,m.child=T.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=T.memoizedProps,m.memoizedState=T.memoizedState,m.updateQueue=T.updateQueue,m.type=T.type,v=T.dependencies,m.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext}),m}function hS(m,v,T,O,P,X){var be=0;if(O=m,typeof m=="function")hR(m)&&(be=1);else if(typeof m=="string")be=Ul&&Ks?T9(m,T,ds.current)?26:N9(m)?27:5:Ul?T9(m,T,ds.current)?26:5:Ks&&N9(m)?27:5;else e:switch(m){case xg:return ap(T.children,P,X,v);case s9:be=8,P|=24;break;case bR:return m=n(12,T,v,P|2),m.elementType=bR,m.lanes=X,m;case yR:return m=n(13,T,v,P),m.elementType=yR,m.lanes=X,m;case xR:return m=n(19,T,v,P),m.elementType=xR,m.lanes=X,m;case l9:return e9(T,P,X,v);default:if(typeof m=="object"&&m!==null)switch(m.$$typeof){case Bne:case kh:be=10;break e;case o9:be=9;break e;case vR:be=11;break e;case _R:be=14;break e;case Dh:be=16,O=null;break e}be=29,T=Error(r(130,m===null?"null":typeof m,"")),O=null}return v=n(be,T,v,P),v.elementType=m,v.type=O,v.lanes=X,v}function ap(m,v,T,O){return m=n(7,m,O,v),m.lanes=T,m}function e9(m,v,T,O){m=n(22,m,O,v),m.elementType=l9,m.lanes=T;var P={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var X=P._current;if(X===null)throw Error(r(456));if(!(P._pendingVisibility&2)){var be=we(X,2);be!==null&&(P._pendingVisibility|=2,fo(be,X,2))}},attach:function(){var X=P._current;if(X===null)throw Error(r(456));if(P._pendingVisibility&2){var be=we(X,2);be!==null&&(P._pendingVisibility&=-3,fo(be,X,2))}}};return m.stateNode=P,m}function dR(m,v,T){return m=n(6,m,null,v),m.lanes=T,m}function pR(m,v,T){return v=n(4,m.children!==null?m.children:[],m.key,v),v.lanes=T,v.stateNode={containerInfo:m.containerInfo,pendingChildren:null,implementation:m.implementation},v}function Pne(m,v,T,O,P,X,be,Be){this.tag=1,this.containerInfo=m,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=MR,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=R(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=R(0),this.hiddenUpdates=R(null),this.identifierPrefix=O,this.onUncaughtError=P,this.onCaughtError=X,this.onRecoverableError=be,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Be,this.incompleteTransitions=new Map}function t9(m,v,T,O,P,X,be,Be,nt,Ct,qt,an){return m=new Pne(m,v,T,be,Be,nt,Ct,an),v=1,X===!0&&(v|=24),X=n(3,null,null,v),m.current=X,X.stateNode=m,v=Th(),v.refCount++,m.pooledCache=v,v.refCount++,X.memoizedState={element:O,isDehydrated:T,cache:v},mt(X),m}function n9(m){return m?(m=wg,m):wg}function i9(m){var v=m._reactInternals;if(v===void 0)throw typeof m.render=="function"?Error(r(188)):(m=Object.keys(m).join(","),Error(r(268,m)));return m=d(v),m=m!==null?g(m):null,m===null?null:cy(m.stateNode)}function r9(m,v,T,O,P,X){P=n9(P),O.context===null?O.context=P:O.pendingContext=P,O=Je(v),O.payload={element:T},X=X===void 0?null:X,X!==null&&(O.callback=X),T=tt(m,O,v),T!==null&&(fo(T,m,v),xt(T,m,v))}function a9(m,v){if(m=m.memoizedState,m!==null&&m.dehydrated!==null){var T=m.retryLane;m.retryLane=T!==0&&T<v?T:v}}function mR(m,v){a9(m,v),(m=m.alternate)&&a9(m,v)}var Mi={},Une=I,Qo=aI,gR=Object.assign,Fne=Symbol.for("react.element"),dS=Symbol.for("react.transitional.element"),yg=Symbol.for("react.portal"),xg=Symbol.for("react.fragment"),s9=Symbol.for("react.strict_mode"),bR=Symbol.for("react.profiler"),Bne=Symbol.for("react.provider"),o9=Symbol.for("react.consumer"),kh=Symbol.for("react.context"),vR=Symbol.for("react.forward_ref"),yR=Symbol.for("react.suspense"),xR=Symbol.for("react.suspense_list"),_R=Symbol.for("react.memo"),Dh=Symbol.for("react.lazy"),l9=Symbol.for("react.offscreen"),zne=Symbol.for("react.memo_cache_sentinel"),c9=Symbol.iterator,jne=Symbol.for("react.client.reference"),qn=Une.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,SR,u9,wR=!1,pS=Array.isArray,Hne=e.rendererVersion,Vne=e.rendererPackageName,f9=e.extraDevToolsConfig,cy=e.getPublicInstance,Gne=e.getRootHostContext,Wne=e.getChildHostContext,qne=e.prepareForCommit,Xne=e.resetAfterCommit,Kne=e.createInstance,ER=e.appendInitialChild,h9=e.finalizeInitialChildren,mS=e.shouldSetTextContent,d9=e.createTextInstance,Yne=e.scheduleTimeout,Jne=e.cancelTimeout,MR=e.noTimeout,_f=e.isPrimaryRenderer;e.warnsIfNotActing;var Xs=e.supportsMutation,Oh=e.supportsPersistence,Pl=e.supportsHydration,p9=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var $ne=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var ko=e.setCurrentUpdatePriority,sp=e.getCurrentUpdatePriority,Zne=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var Qne=e.shouldAttemptEagerTransition,eie=e.detachDeletedInstance;e.requestPostPaintCallback;var tie=e.maySuspendCommit,m9=e.preloadInstance,nie=e.startSuspendingCommit,g9=e.suspendInstance,iie=e.waitForCommitToBeReady,_g=e.NotPendingTransition,op=e.HostTransitionContext,rie=e.resetFormInstance;e.bindToConsole;var aie=e.supportsMicrotasks,sie=e.scheduleMicrotask,uy=e.supportsTestSelectors,oie=e.findFiberRoot,lie=e.getBoundingRect,cie=e.getTextContent,fy=e.isHiddenSubtree,uie=e.matchAccessibilityRole,fie=e.setFocusIfFocusable,hie=e.setupIntersectionObserver,die=e.appendChild,pie=e.appendChildToContainer,mie=e.commitTextUpdate,gie=e.commitMount,bie=e.commitUpdate,vie=e.insertBefore,yie=e.insertInContainerBefore,xie=e.removeChild,_ie=e.removeChildFromContainer,b9=e.resetTextContent,Sie=e.hideInstance,wie=e.hideTextInstance,Eie=e.unhideInstance,Mie=e.unhideTextInstance,Tie=e.clearContainer,Aie=e.cloneInstance,v9=e.createContainerChildSet,y9=e.appendChildToContainerChildSet,Cie=e.finalizeContainerChildren,x9=e.replaceContainerChildren,_9=e.cloneHiddenInstance,S9=e.cloneHiddenTextInstance,TR=e.isSuspenseInstancePending,AR=e.isSuspenseInstanceFallback,Rie=e.getSuspenseInstanceFallbackErrorDetails,kie=e.registerSuspenseInstanceRetry,Die=e.canHydrateFormStateMarker,Oie=e.isFormStateMarkerMatching,w9=e.getNextHydratableSibling,E9=e.getFirstHydratableChild,Iie=e.getFirstHydratableChildWithinContainer,Nie=e.getFirstHydratableChildWithinSuspenseInstance,Lie=e.canHydrateInstance,Pie=e.canHydrateTextInstance,Uie=e.canHydrateSuspenseInstance,Fie=e.hydrateInstance,Bie=e.hydrateTextInstance,zie=e.hydrateSuspenseInstance,jie=e.getNextHydratableInstanceAfterSuspenseInstance,Hie=e.commitHydratedContainer,Vie=e.commitHydratedSuspenseInstance,Gie=e.clearSuspenseBoundary,Wie=e.clearSuspenseBoundaryFromContainer,M9=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var qie=e.validateHydratableInstance,Xie=e.validateHydratableTextInstance,Ul=e.supportsResources,T9=e.isHostHoistableType,CR=e.getHoistableRoot,A9=e.getResource,C9=e.acquireResource,R9=e.releaseResource,Kie=e.hydrateHoistable,k9=e.mountHoistable,D9=e.unmountHoistable,Yie=e.createHoistableInstance,Jie=e.prepareToCommitHoistables,$ie=e.mayResourceSuspendCommit,O9=e.preloadResource,Zie=e.suspendResource,Ks=e.supportsSingletons,I9=e.resolveSingletonInstance,Qie=e.clearSingleton,ere=e.acquireSingletonInstance,tre=e.releaseSingletonInstance,N9=e.isHostSingletonType,RR=[],Sg=-1,wg={},el=Math.clz32?Math.clz32:_,nre=Math.log,ire=Math.LN2,gS=128,bS=4194304,vS=Qo.unstable_scheduleCallback,kR=Qo.unstable_cancelCallback,rre=Qo.unstable_shouldYield,are=Qo.unstable_requestPaint,Uc=Qo.unstable_now,L9=Qo.unstable_ImmediatePriority,sre=Qo.unstable_UserBlockingPriority,DR=Qo.unstable_NormalPriority,ore=Qo.unstable_IdlePriority,lre=Qo.log,cre=Qo.unstable_setDisableYieldValue,hy=null,tl=null,nl=typeof Object.is=="function"?Object.is:H,P9=new WeakMap,Eg=[],Mg=0,yS=null,xS=0,Fl=[],Bl=0,lp=null,Sf=1,wf="",ds=y(null),dy=y(null),Ih=y(null),_S=y(null),ho=null,Ys=null,Vi=!1,Fc=null,Eu=!1,OR=Error(r(519)),zl=[],Tg=0,IR=0,SS=null,Ag=null,NR=!1,wS=!1,LR=!1,Cg=0,py=null,PR=0,Rg=0,kg=null,Nh=!1,UR=!1,ure=Object.prototype.hasOwnProperty,my=Error(r(460)),FR=Error(r(474)),ES={then:function(){}},Dg=null,Og=null,gy=0,cp=bn(!0),U9=bn(!1),Ig=y(null),MS=y(0),jl=y(null),Mu=null,Ia=y(0),Lh=0,di=null,pr=null,_a=null,TS=!1,Ng=!1,up=!1,AS=0,by=0,Lg=null,fre=0,BR=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},Tu={readContext:Oa,use:ve,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useLayoutEffect:$n,useInsertionEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useSyncExternalStore:$n,useId:$n};Tu.useCacheRefresh=$n,Tu.useMemoCache=$n,Tu.useHostTransitionStatus=$n,Tu.useFormState=$n,Tu.useActionState=$n,Tu.useOptimistic=$n;var fp={readContext:Oa,use:ve,useCallback:function(m,v){return ye().memoizedState=[m,v===void 0?null:v],m},useContext:Oa,useEffect:so,useImperativeHandle:function(m,v,T){T=T!=null?T.concat([m]):null,Bs(4194308,4,Va.bind(null,v,m),T)},useLayoutEffect:function(m,v){return Bs(4194308,4,m,v)},useInsertionEffect:function(m,v){Bs(4,2,m,v)},useMemo:function(m,v){var T=ye();v=v===void 0?null:v;var O=m();if(up){G(!0);try{m()}finally{G(!1)}}return T.memoizedState=[O,v],O},useReducer:function(m,v,T){var O=ye();if(T!==void 0){var P=T(v);if(up){G(!0);try{T(v)}finally{G(!1)}}}else P=v;return O.memoizedState=O.baseState=P,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:m,lastRenderedState:P},O.queue=m,m=m.dispatch=zt.bind(null,di,m),[O.memoizedState,m]},useRef:function(m){var v=ye();return m={current:m},v.memoizedState=m},useState:function(m){m=$t(m);var v=m.queue,T=mn.bind(null,di,v);return v.dispatch=T,[m.memoizedState,T]},useDebugValue:oo,useDeferredValue:function(m,v){var T=ye();return E(T,m,v)},useTransition:function(){var m=$t(!1);return m=J.bind(null,di,m.queue,!0,!1),ye().memoizedState=m,[!1,m]},useSyncExternalStore:function(m,v,T){var O=di,P=ye();if(Vi){if(T===void 0)throw Error(r(407));T=T()}else{if(T=v(),Ar===null)throw Error(r(349));Ui&60||at(O,v,T)}P.memoizedState=T;var X={value:T,getSnapshot:v};return P.queue=X,so(un.bind(null,O,X,m),[m]),O.flags|=2048,Ji(9,nn.bind(null,O,X,T,v),{destroy:void 0},null),T},useId:function(){var m=ye(),v=Ar.identifierPrefix;if(Vi){var T=wf,O=Sf;T=(O&~(1<<32-el(O)-1)).toString(32)+T,v=":"+v+"R"+T,T=AS++,0<T&&(v+="H"+T.toString(32)),v+=":"}else T=fre++,v=":"+v+"r"+T.toString(32)+":";return m.memoizedState=v},useCacheRefresh:function(){return ye().memoizedState=Lt.bind(null,di)}};fp.useMemoCache=_t,fp.useHostTransitionStatus=xe,fp.useFormState=yi,fp.useActionState=yi,fp.useOptimistic=function(m){var v=ye();v.memoizedState=v.baseState=m;var T={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return v.queue=T,v=Si.bind(null,di,!0,T),T.dispatch=v,[m,v]};var Ph={readContext:Oa,use:ve,useCallback:js,useContext:Oa,useEffect:In,useImperativeHandle:xa,useInsertionEffect:zs,useLayoutEffect:Ha,useMemo:Ro,useReducer:yt,useRef:Xo,useState:function(){return yt(lt)},useDebugValue:oo,useDeferredValue:function(m,v){var T=Ce();return L(T,pr.memoizedState,m,v)},useTransition:function(){var m=yt(lt)[0],v=Ce().memoizedState;return[typeof m=="boolean"?m:De(m),v]},useSyncExternalStore:Ht,useId:Ke};Ph.useCacheRefresh=et,Ph.useMemoCache=_t,Ph.useHostTransitionStatus=xe,Ph.useFormState=Li,Ph.useActionState=Li,Ph.useOptimistic=function(m,v){var T=Ce();return Yt(T,pr,m,v)};var hp={readContext:Oa,use:ve,useCallback:js,useContext:Oa,useEffect:In,useImperativeHandle:xa,useInsertionEffect:zs,useLayoutEffect:Ha,useMemo:Ro,useReducer:Nt,useRef:Xo,useState:function(){return Nt(lt)},useDebugValue:oo,useDeferredValue:function(m,v){var T=Ce();return pr===null?E(T,m,v):L(T,pr.memoizedState,m,v)},useTransition:function(){var m=Nt(lt)[0],v=Ce().memoizedState;return[typeof m=="boolean"?m:De(m),v]},useSyncExternalStore:Ht,useId:Ke};hp.useCacheRefresh=et,hp.useMemoCache=_t,hp.useHostTransitionStatus=xe,hp.useFormState=ya,hp.useActionState=ya,hp.useOptimistic=function(m,v){var T=Ce();return pr!==null?Yt(T,pr,m,v):(T.baseState=m,[m,T.queue.dispatch])};var zR={isMounted:function(m){return(m=m._reactInternals)?f(m)===m:!1},enqueueSetState:function(m,v,T){m=m._reactInternals;var O=Zo(),P=Je(O);P.payload=v,T!=null&&(P.callback=T),v=tt(m,P,O),v!==null&&(fo(v,m,O),xt(v,m,O))},enqueueReplaceState:function(m,v,T){m=m._reactInternals;var O=Zo(),P=Je(O);P.tag=1,P.payload=v,T!=null&&(P.callback=T),v=tt(m,P,O),v!==null&&(fo(v,m,O),xt(v,m,O))},enqueueForceUpdate:function(m,v){m=m._reactInternals;var T=Zo(),O=Je(T);O.tag=2,v!=null&&(O.callback=v),v=tt(m,O,T),v!==null&&(fo(v,m,T),xt(v,m,T))}},F9=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var v=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(v))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},B9=Error(r(461)),qa=!1,jR={dehydrated:null,treeContext:null,retryLane:0},CS=y(null),dp=null,Ef=null,hre=typeof AbortController<"u"?AbortController:function(){var m=[],v=this.signal={aborted:!1,addEventListener:function(T,O){m.push(O)}};this.abort=function(){v.aborted=!0,m.forEach(function(T){return T()})}},dre=Qo.unstable_scheduleCallback,pre=Qo.unstable_NormalPriority,oa={$$typeof:kh,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},z9=qn.S;qn.S=function(m,v){typeof v=="object"&&v!==null&&typeof v.then=="function"&&$(m,v),z9!==null&&z9(m,v)};var pp=y(null),Mf=!1,la=!1,HR=!1,j9=typeof WeakSet=="function"?WeakSet:Set,Xa=null,H9=!1,Sa=null,il=!1,Bc=null,Pg=8192,mre={getCacheForType:function(m){var v=Oa(oa),T=v.data.get(m);return T===void 0&&(T=m(),v.data.set(m,T)),T}},RS=0,kS=1,DS=2,OS=3,IS=4;if(typeof Symbol=="function"&&Symbol.for){var vy=Symbol.for;RS=vy("selector.component"),kS=vy("selector.has_pseudo_class"),DS=vy("selector.role"),OS=vy("selector.test_id"),IS=vy("selector.text")}var gre=typeof WeakMap=="function"?WeakMap:Map,mr=0,Ar=null,Ti=null,Ui=0,Cr=0,rl=null,Tf=!1,Ug=!1,VR=!1,Af=0,ca=0,Uh=0,mp=0,GR=0,Hl=0,Fg=0,yy=null,Au=null,WR=!1,qR=0,xy=1/0,NS=null,Fh=null,LS=!1,gp=null,_y=0,XR=0,KR=null,Sy=0,YR=null;return Mi.attemptContinuousHydration=function(m){if(m.tag===13){var v=we(m,67108864);v!==null&&fo(v,m,67108864),mR(m,67108864)}},Mi.attemptHydrationAtCurrentPriority=function(m){if(m.tag===13){var v=Zo(),T=we(m,v);T!==null&&fo(T,m,v),mR(m,v)}},Mi.attemptSynchronousHydration=function(m){switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var v=w(m.pendingLanes);if(v!==0){for(m.pendingLanes|=2,m.entangledLanes|=2;v;){var T=1<<31-el(v);m.entanglements[1]|=T,v&=~T}Pe(m),!(mr&6)&&(xy=Uc()+500,He(0))}}break;case 13:v=we(m,2),v!==null&&fo(v,m,2),j4(),mR(m,2)}},Mi.batchedUpdates=function(m,v){return m(v)},Mi.createComponentSelector=function(m){return{$$typeof:RS,value:m}},Mi.createContainer=function(m,v,T,O,P,X,be,Be,nt,Ct){return t9(m,v,!1,null,T,O,X,be,Be,nt,Ct,null)},Mi.createHasPseudoClassSelector=function(m){return{$$typeof:kS,value:m}},Mi.createHydrationContainer=function(m,v,T,O,P,X,be,Be,nt,Ct,qt,an,sn){return m=t9(T,O,!0,m,P,X,Be,nt,Ct,qt,an,sn),m.context=n9(null),T=m.current,O=Zo(),P=Je(O),P.callback=v??null,tt(T,P,O),m.current.lanes=O,N(m,O),Pe(m),m},Mi.createPortal=function(m,v,T){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yg,key:O==null?null:""+O,children:m,containerInfo:v,implementation:T}},Mi.createRoleSelector=function(m){return{$$typeof:DS,value:m}},Mi.createTestNameSelector=function(m){return{$$typeof:OS,value:m}},Mi.createTextSelector=function(m){return{$$typeof:IS,value:m}},Mi.defaultOnCaughtError=function(m){console.error(m)},Mi.defaultOnRecoverableError=function(m){F9(m)},Mi.defaultOnUncaughtError=function(m){F9(m)},Mi.deferredUpdates=function(m){var v=qn.T,T=sp();try{return ko(32),qn.T=null,m()}finally{ko(T),qn.T=v}},Mi.discreteUpdates=function(m,v,T,O,P){var X=qn.T,be=sp();try{return ko(2),qn.T=null,m(v,T,O,P)}finally{ko(be),qn.T=X,mr===0&&(xy=Uc()+500)}},Mi.findAllNodes=sR,Mi.findBoundingRects=function(m,v){if(!uy)throw Error(r(363));v=sR(m,v),m=[];for(var T=0;T<v.length;T++)m.push(lie(v[T]));for(v=m.length-1;0<v;v--){T=m[v];for(var O=T.x,P=O+T.width,X=T.y,be=X+T.height,Be=v-1;0<=Be;Be--)if(v!==Be){var nt=m[Be],Ct=nt.x,qt=Ct+nt.width,an=nt.y,sn=an+nt.height;if(O>=Ct&&X>=an&&P<=qt&&be<=sn){m.splice(v,1);break}else if(O!==Ct||T.width!==nt.width||sn<X||an>be){if(!(X!==an||T.height!==nt.height||qt<O||Ct>P)){Ct>O&&(nt.width+=Ct-O,nt.x=O),qt<P&&(nt.width=P-Ct),m.splice(v,1);break}}else{an>X&&(nt.height+=an-X,nt.y=X),sn<be&&(nt.height=be-an),m.splice(v,1);break}}}return m},Mi.findHostInstance=i9,Mi.findHostInstanceWithNoPortals=function(m){return m=d(m),m=m!==null?b(m):null,m===null?null:cy(m.stateNode)},Mi.findHostInstanceWithWarning=function(m){return i9(m)},Mi.flushPassiveEffects=rp,Mi.flushSyncFromReconciler=function(m){var v=mr;mr|=1;var T=qn.T,O=sp();try{if(ko(2),qn.T=null,m)return m()}finally{ko(O),qn.T=T,mr=v,!(mr&6)&&He(0)}},Mi.flushSyncWork=j4,Mi.focusWithin=function(m,v){if(!uy)throw Error(r(363));for(m=iR(m),v=U4(m,v),v=Array.from(v),m=0;m<v.length;){var T=v[m++],O=T.tag;if(!fy(T)){if((O===5||O===26||O===27)&&fie(T.stateNode))return!0;for(T=T.child;T!==null;)v.push(T),T=T.sibling}}return!1},Mi.getFindAllNodesFailureDescription=function(m,v){if(!uy)throw Error(r(363));var T=0,O=[];m=[iR(m),0];for(var P=0;P<m.length;){var X=m[P++],be=X.tag,Be=m[P++],nt=v[Be];if((be!==5&&be!==26&&be!==27||!fy(X))&&(rR(X,nt)&&(O.push(aR(nt)),Be++,Be>T&&(T=Be)),Be<v.length))for(X=X.child;X!==null;)m.push(X,Be),X=X.sibling}if(T<v.length){for(m=[];T<v.length;T++)m.push(aR(v[T]));return`findAllNodes was able to match part of the selector:
  `+(O.join(" > ")+`

No matching component was found for:
  `)+m.join(" > ")}return null},Mi.getPublicRootInstance=function(m){if(m=m.current,!m.child)return null;switch(m.child.tag){case 27:case 5:return cy(m.child.stateNode);default:return m.child.stateNode}},Mi.injectIntoDevTools=function(){var m={bundleType:0,version:Hne,rendererPackageName:Vne,currentDispatcherRef:qn,findFiberByHostInstance:p9,reconcilerVersion:"19.0.0"};if(f9!==null&&(m.rendererConfig=f9),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")m=!1;else{var v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(v.isDisabled||!v.supportsFiber)m=!0;else{try{hy=v.inject(m),tl=v}catch{}m=!!v.checkDCE}}return m},Mi.isAlreadyRendering=function(){return!1},Mi.observeVisibleRects=function(m,v,T,O){if(!uy)throw Error(r(363));m=sR(m,v);var P=hie(m,T,O).disconnect;return{disconnect:function(){P()}}},Mi.shouldError=function(){return null},Mi.shouldSuspend=function(){return!1},Mi.startHostTransition=function(m,v,T,O){if(m.tag!==5)throw Error(r(476));var P=ne(m).queue;J(m,P,v,_g,T===null?i:function(){var X=ne(m).next.queue;return _n(m,X,{},Zo()),T(O)})},Mi.updateContainer=function(m,v,T,O){var P=v.current,X=Zo();return r9(P,X,m,v,T,O),X},Mi.updateContainerSync=function(m,v,T,O){return v.tag===0&&rp(),r9(v.current,2,m,v,T,O),2},Mi},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(K$);var GSe=K$.exports;X$.exports=GSe;var WSe=X$.exports;const qSe=Mc(WSe);function vU(t,e,n){if(!t)return;if(n(t)===!0)return t;let i=e?t.return:t.child;for(;i;){const r=vU(i,e,n);if(r)return r;i=e?null:i.sibling}}function $$(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const yU=$$(I.createContext(null));let Z$=class extends I.Component{render(){return I.createElement(yU.Provider,{value:this._reactInternals},this.props.children)}};function Q$(){const t=I.useContext(yU);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=I.useId();return I.useMemo(()=>{for(const n of[t,t?.alternate]){if(!n)continue;const i=vU(n,!1,r=>{let a=r.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(i)return i}},[t,e])}const XSe=Symbol.for("react.context"),KSe=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===XSe;function YSe(){const t=Q$(),[e]=I.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;KSe(i)&&i!==yU&&!e.has(i)&&e.set(i,I.use($$(i))),n=n.return}return e}function eZ(){const t=YSe();return I.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>i=>I.createElement(e,null,I.createElement(n.Provider,{...i,value:t.get(n)})),e=>I.createElement(Z$,{...e})),[t])}function tZ(t){let e=t.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const nZ=t=>t&&t.isOrthographicCamera,JSe=t=>t&&t.hasOwnProperty("current"),$Se=t=>t!=null&&(typeof t=="string"||typeof t=="number"||t.isColor),G_=((t,e)=>typeof window<"u"&&(((t=window.document)==null?void 0:t.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?I.useLayoutEffect:I.useEffect;function xU(t){const e=I.useRef(t);return G_(()=>void(e.current=t),[t]),e}function ZSe(){const t=Q$(),e=eZ();return I.useMemo(()=>({children:n})=>{const r=!!vU(t,!0,a=>a.type===I.StrictMode)?I.StrictMode:I.Fragment;return k.jsx(r,{children:k.jsx(e,{children:n})})},[t,e])}function QSe({set:t}){return G_(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}const ewe=(t=>(t=class extends I.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}},t.getDerivedStateFromError=()=>({error:!0}),t))();function iZ(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}function pb(t){var e;return(e=t.__r3f)==null?void 0:e.root.getState()}const Xr={obj:t=>t===Object(t)&&!Xr.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,nul:t=>t===null,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:i="reference",strict:r=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(Xr.str(t)||Xr.num(t)||Xr.boo(t))return t===e;const a=Xr.obj(t);if(a&&i==="reference")return t===e;const s=Xr.arr(t);if(s&&n==="reference")return t===e;if((s||a)&&t===e)return!0;let o;for(o in t)if(!(o in e))return!1;if(a&&n==="shallow"&&i==="shallow"){for(o in r?e:t)if(!Xr.equ(t[o],e[o],{strict:r,objects:"reference"}))return!1}else for(o in r?e:t)if(t[o]!==e[o])return!1;if(Xr.und(o)){if(s&&t.length===0&&e.length===0||a&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function twe(t){const e={nodes:{},materials:{},meshes:{}};return t&&t.traverse(n=>{n.name&&(e.nodes[n.name]=n),n.material&&!e.materials[n.material.name]&&(e.materials[n.material.name]=n.material),n.isMesh&&!e.meshes[n.name]&&(e.meshes[n.name]=n)}),e}function nwe(t){t.type!=="Scene"&&(t.dispose==null||t.dispose());for(const e in t){const n=t[e];n?.type!=="Scene"&&(n==null||n.dispose==null||n.dispose())}}const rZ=["children","key","ref"];function iwe(t){const e={};for(const n in t)rZ.includes(n)||(e[n]=t[n]);return e}function nT(t,e,n,i){const r=t;let a=r?.__r3f;return a||(a={root:e,type:n,parent:null,children:[],props:iwe(i),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=a)),a}function Y1(t,e){let n=t[e];if(!e.includes("-"))return{root:t,key:e,target:n};n=t;for(const r of e.split("-")){var i;e=r,t=n,n=(i=n)==null?void 0:i[e]}return{root:t,key:e,target:n}}const l5=/-\d+$/;function iT(t,e){if(Xr.str(e.props.attach)){if(l5.test(e.props.attach)){const r=e.props.attach.replace(l5,""),{root:a,key:s}=Y1(t.object,r);Array.isArray(a[s])||(a[s]=[])}const{root:n,key:i}=Y1(t.object,e.props.attach);e.previousAttach=n[i],n[i]=e.object}else Xr.fun(e.props.attach)&&(e.previousAttach=e.props.attach(t.object,e.object))}function rT(t,e){if(Xr.str(e.props.attach)){const{root:n,key:i}=Y1(t.object,e.props.attach),r=e.previousAttach;r===void 0?delete n[i]:n[i]=r}else e.previousAttach==null||e.previousAttach(t.object,e.object);delete e.previousAttach}const sI=[...rZ,"args","dispose","attach","object","onUpdate","dispose"],c5=new Map;function rwe(t){let e=c5.get(t.constructor);try{e||(e=new t.constructor,c5.set(t.constructor,e))}catch{}return e}function awe(t,e){const n={};for(const i in e)if(!sI.includes(i)&&!Xr.equ(e[i],t.props[i])){n[i]=e[i];for(const r in e)r.startsWith(`${i}-`)&&(n[r]=e[r])}for(const i in t.props){if(sI.includes(i)||e.hasOwnProperty(i))continue;const{root:r,key:a}=Y1(t.object,i);if(r.constructor&&r.constructor.length===0){const s=rwe(r);Xr.und(s)||(n[a]=s[a])}else n[a]=0}return n}const swe=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],owe=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function nu(t,e){var n;const i=t.__r3f,r=i&&tZ(i).getState(),a=i?.eventCount;for(const o in e){let l=e[o];if(sI.includes(o))continue;if(i&&owe.test(o)){typeof l=="function"?i.handlers[o]=l:delete i.handlers[o],i.eventCount=Object.keys(i.handlers).length;continue}if(l===void 0)continue;let{root:c,key:u,target:f}=Y1(t,o);if(f instanceof iv&&l instanceof iv)f.mask=l.mask;else if(f instanceof Ut&&$Se(l))f.set(l);else if(f!==null&&typeof f=="object"&&typeof f.set=="function"&&typeof f.copy=="function"&&l!=null&&l.constructor&&f.constructor===l.constructor)f.copy(l);else if(f!==null&&typeof f=="object"&&typeof f.set=="function"&&Array.isArray(l))typeof f.fromArray=="function"?f.fromArray(l):f.set(...l);else if(f!==null&&typeof f=="object"&&typeof f.set=="function"&&typeof l=="number")typeof f.setScalar=="function"?f.setScalar(l):f.set(l);else{var s;c[u]=l,r&&!r.linear&&swe.includes(u)&&(s=c[u])!=null&&s.isTexture&&c[u].format===$r&&c[u].type===To&&(c[u].colorSpace=Es)}}if(i!=null&&i.parent&&r!=null&&r.internal&&(n=i.object)!=null&&n.isObject3D&&a!==i.eventCount){const o=i.object,l=r.internal.interaction.indexOf(o);l>-1&&r.internal.interaction.splice(l,1),i.eventCount&&o.raycast!==null&&r.internal.interaction.push(o)}return i&&i.props.attach===void 0&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&Yv(i),t}function Yv(t){var e;if(!t.parent)return;t.props.onUpdate==null||t.props.onUpdate(t.object);const n=(e=t.root)==null||e.getState==null?void 0:e.getState();n&&n.internal.frames===0&&n.invalidate()}function aZ(t,e){t.manual||(nZ(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix())}const vo=t=>t?.isObject3D;function $w(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function sZ(t,e,n,i){const r=n.get(e);r&&(n.delete(e),n.size===0&&(t.delete(i),r.target.releasePointerCapture(i)))}function lwe(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(i=>i!==e),n.initialHits=n.initialHits.filter(i=>i!==e),n.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&n.hovered.delete(r)}),n.capturedMap.forEach((i,r)=>{sZ(n.capturedMap,e,i,r)})}function cwe(t){function e(l){const{internal:c}=t.getState(),u=l.offsetX-c.initialClick[0],f=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+f*f))}function n(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var f;return(f=c.__r3f)==null?void 0:f.handlers["onPointer"+u]}))}function i(l,c){const u=t.getState(),f=new Set,h=[],d=c?c(u.internal.interaction):u.internal.interaction;for(let p=0;p<d.length;p++){const x=pb(d[p]);x&&(x.raycaster.camera=void 0)}u.previousRoot||u.events.compute==null||u.events.compute(l,u);function g(p){const x=pb(p);if(!x||!x.events.enabled||x.raycaster.camera===null)return[];if(x.raycaster.camera===void 0){var _;x.events.compute==null||x.events.compute(l,x,(_=x.previousRoot)==null?void 0:_.getState()),x.raycaster.camera===void 0&&(x.raycaster.camera=null)}return x.raycaster.camera?x.raycaster.intersectObject(p,!0):[]}let b=d.flatMap(g).sort((p,x)=>{const _=pb(p.object),w=pb(x.object);return!_||!w?p.distance-x.distance:w.events.priority-_.events.priority||p.distance-x.distance}).filter(p=>{const x=$w(p);return f.has(x)?!1:(f.add(x),!0)});u.events.filter&&(b=u.events.filter(b,u));for(const p of b){let x=p.object;for(;x;){var y;(y=x.__r3f)!=null&&y.eventCount&&h.push({...p,eventObject:x}),x=x.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let p of u.internal.capturedMap.get(l.pointerId).values())f.has($w(p.intersection))||h.push(p.intersection);return h}function r(l,c,u,f){if(l.length){const h={stopped:!1};for(const d of l){let g=pb(d.object);if(g||d.object.traverseAncestors(b=>{const y=pb(b);if(y)return g=y,!1}),g){const{raycaster:b,pointer:y,camera:p,internal:x}=g,_=new te(y.x,y.y,0).unproject(p),w=D=>{var R,N;return(R=(N=x.capturedMap.get(D))==null?void 0:N.has(d.eventObject))!=null?R:!1},M=D=>{const R={intersection:d,target:c.target};x.capturedMap.has(D)?x.capturedMap.get(D).set(d.eventObject,R):x.capturedMap.set(D,new Map([[d.eventObject,R]])),c.target.setPointerCapture(D)},S=D=>{const R=x.capturedMap.get(D);R&&sZ(x.capturedMap,d.eventObject,R,D)};let A={};for(let D in c){let R=c[D];typeof R!="function"&&(A[D]=R)}let C={...d,...A,pointer:y,intersections:l,stopped:h.stopped,delta:u,unprojectedPoint:_,ray:b.ray,camera:p,stopPropagation(){const D="pointerId"in c&&x.capturedMap.get(c.pointerId);if((!D||D.has(d.eventObject))&&(C.stopped=h.stopped=!0,x.hovered.size&&Array.from(x.hovered.values()).find(R=>R.eventObject===d.eventObject))){const R=l.slice(0,l.indexOf(d));a([...R,d])}},target:{hasPointerCapture:w,setPointerCapture:M,releasePointerCapture:S},currentTarget:{hasPointerCapture:w,setPointerCapture:M,releasePointerCapture:S},nativeEvent:c};if(f(C),h.stopped===!0)break}}}return l}function a(l){const{internal:c}=t.getState();for(const u of c.hovered.values())if(!l.length||!l.find(f=>f.object===u.object&&f.index===u.index&&f.instanceId===u.instanceId)){const h=u.eventObject.__r3f;if(c.hovered.delete($w(u)),h!=null&&h.eventCount){const d=h.handlers,g={...u,intersections:l};d.onPointerOut==null||d.onPointerOut(g),d.onPointerLeave==null||d.onPointerLeave(g)}}}function s(l,c){for(let u=0;u<c.length;u++){const f=c[u].__r3f;f==null||f.handlers.onPointerMissed==null||f.handlers.onPointerMissed(l)}}function o(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>a([]);case"onLostPointerCapture":return c=>{const{internal:u}=t.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),a([]))})}}return function(u){const{onPointerMissed:f,internal:h}=t.getState();h.lastEvent.current=u;const d=l==="onPointerMove",g=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(u,d?n:void 0),p=g?e(u):0;l==="onPointerDown"&&(h.initialClick=[u.offsetX,u.offsetY],h.initialHits=y.map(_=>_.eventObject)),g&&!y.length&&p<=2&&(s(u,h.interaction),f&&f(u)),d&&a(y);function x(_){const w=_.eventObject,M=w.__r3f;if(!(M!=null&&M.eventCount))return;const S=M.handlers;if(d){if(S.onPointerOver||S.onPointerEnter||S.onPointerOut||S.onPointerLeave){const A=$w(_),C=h.hovered.get(A);C?C.stopped&&_.stopPropagation():(h.hovered.set(A,_),S.onPointerOver==null||S.onPointerOver(_),S.onPointerEnter==null||S.onPointerEnter(_))}S.onPointerMove==null||S.onPointerMove(_)}else{const A=S[l];A?(!g||h.initialHits.includes(w))&&(s(u,h.interaction.filter(C=>!h.initialHits.includes(C))),A(_)):g&&h.initialHits.includes(w)&&s(u,h.interaction.filter(C=>!h.initialHits.includes(C)))}}r(y,u,p,x)}}return{handlePointer:o}}const u5=t=>!!(t!=null&&t.render),_U=I.createContext(null),uwe=(t,e)=>{const n=G$((o,l)=>{const c=new te,u=new te,f=new te;function h(p=l().camera,x=u,_=l().size){const{width:w,height:M,top:S,left:A}=_,C=w/M;x.isVector3?f.copy(x):f.set(...x);const D=p.getWorldPosition(c).distanceTo(f);if(nZ(p))return{width:w/p.zoom,height:M/p.zoom,top:S,left:A,factor:1,distance:D,aspect:C};{const R=p.fov*Math.PI/180,N=2*Math.tan(R/2)*D,U=N*(w/M);return{width:U,height:N,top:S,left:A,factor:w/U,distance:D,aspect:C}}}let d;const g=p=>o(x=>({performance:{...x.performance,current:p}})),b=new wt;return{set:o,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(p=1)=>t(l(),p),advance:(p,x)=>e(p,x,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new fU,pointer:b,mouse:b,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const p=l();d&&clearTimeout(d),p.performance.current!==p.performance.min&&g(p.performance.min),d=setTimeout(()=>g(l().performance.max),p.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:h},setEvents:p=>o(x=>({...x,events:{...x.events,...p}})),setSize:(p,x,_=0,w=0)=>{const M=l().camera,S={width:p,height:x,top:_,left:w};o(A=>({size:S,viewport:{...A.viewport,...h(M,u,S)}}))},setDpr:p=>o(x=>{const _=iZ(p);return{viewport:{...x.viewport,dpr:_,initialDpr:x.viewport.initialDpr||_}}}),setFrameloop:(p="always")=>{const x=l().clock;x.stop(),x.elapsedTime=0,p!=="never"&&(x.start(),x.elapsedTime=0),o(()=>({frameloop:p}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:I.createRef(),active:!1,frames:0,priority:0,subscribe:(p,x,_)=>{const w=l().internal;return w.priority=w.priority+(x>0?1:0),w.subscribers.push({ref:p,priority:x,store:_}),w.subscribers=w.subscribers.sort((M,S)=>M.priority-S.priority),()=>{const M=l().internal;M!=null&&M.subscribers&&(M.priority=M.priority-(x>0?1:0),M.subscribers=M.subscribers.filter(S=>S.ref!==p))}}}}}),i=n.getState();let r=i.size,a=i.viewport.dpr,s=i.camera;return n.subscribe(()=>{const{camera:o,size:l,viewport:c,gl:u,set:f}=n.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==a){r=l,a=c.dpr,aZ(o,l),c.dpr>0&&u.setPixelRatio(c.dpr);const h=typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,h)}o!==s&&(s=o,f(h=>({viewport:{...h.viewport,...h.viewport.getCurrentViewport(o)}})))}),n.subscribe(o=>t(o)),n};function SU(){const t=I.useContext(_U);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function Ri(t=n=>n,e){return SU()(t,e)}function ra(t,e=0){const n=SU(),i=n.getState().internal.subscribe,r=xU(t);return G_(()=>i(r,e,n),[e,i,n]),null}const f5=new WeakMap,fwe=t=>{var e;return typeof t=="function"&&(t==null||(e=t.prototype)==null?void 0:e.constructor)===t};function oZ(t,e){return function(n,...i){let r;return fwe(n)?(r=f5.get(n),r||(r=new n,f5.set(n,r))):r=n,t&&t(r),Promise.all(i.map(a=>new Promise((s,o)=>r.load(a,l=>{vo(l?.scene)&&Object.assign(l,twe(l.scene)),s(l)},e,l=>o(new Error(`Could not load ${a}: ${l?.message}`))))))}}function uv(t,e,n,i){const r=Array.isArray(e)?e:[e],a=jSe(oZ(n,i),[t,...r],{equal:Xr.equ});return Array.isArray(e)?a:a[0]}uv.preload=function(t,e,n){const i=Array.isArray(e)?e:[e];return HSe(oZ(n),[t,...i])};uv.clear=function(t,e){const n=Array.isArray(e)?e:[e];return VSe([t,...n])};function hwe(t){const e=qSe(t);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:I.version}),e}const lZ=0,fv={},dwe=/^three(?=[A-Z])/,vC=t=>`${t[0].toUpperCase()}${t.slice(1)}`;let pwe=0;const mwe=t=>typeof t=="function";function W_(t){if(mwe(t)){const e=`${pwe++}`;return fv[e]=t,e}else Object.assign(fv,t)}function cZ(t,e){const n=vC(t),i=fv[n];if(t!=="primitive"&&!i)throw new Error(`R3F: ${n} 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(t==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function gwe(t,e,n){var i;return t=vC(t)in fv?t:t.replace(dwe,""),cZ(t,e),t==="primitive"&&(i=e.object)!=null&&i.__r3f&&delete e.object.__r3f,nT(e.object,n,t,e)}function bwe(t){if(!t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?rT(t.parent,t):vo(t.object)&&(t.object.visible=!1),t.isHidden=!0,Yv(t)}}function uZ(t){if(t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?iT(t.parent,t):vo(t.object)&&t.props.visible!==!1&&(t.object.visible=!0),t.isHidden=!1,Yv(t)}}function wU(t,e,n){const i=e.root.getState();if(!(!t.parent&&t.object!==i.scene)){if(!e.object){var r,a;const s=fv[vC(e.type)];e.object=(r=e.props.object)!=null?r:new s(...(a=e.props.args)!=null?a:[]),e.object.__r3f=e}if(nu(e.object,e.props),e.props.attach)iT(t,e);else if(vo(e.object)&&vo(t.object)){const s=t.object.children.indexOf(n?.object);if(n&&s!==-1){const o=t.object.children.indexOf(e.object);if(o!==-1){t.object.children.splice(o,1);const l=o<s?s-1:s;t.object.children.splice(l,0,e.object)}else e.object.parent=t.object,t.object.children.splice(s,0,e.object),e.object.dispatchEvent({type:"added"}),t.object.dispatchEvent({type:"childadded",child:e.object})}else t.object.add(e.object)}for(const s of e.children)wU(e,s);Yv(e)}}function Wk(t,e){e&&(e.parent=t,t.children.push(e),wU(t,e))}function h5(t,e,n){if(!e||!n)return;e.parent=t;const i=t.children.indexOf(n);i!==-1?t.children.splice(i,0,e):t.children.push(e),wU(t,e,n)}function fZ(t){if(typeof t.dispose=="function"){const e=()=>{try{t.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():aI.unstable_scheduleCallback(aI.unstable_IdlePriority,e)}}function oI(t,e,n){if(!e)return;e.parent=null;const i=t.children.indexOf(e);i!==-1&&t.children.splice(i,1),e.props.attach?rT(t,e):vo(e.object)&&vo(t.object)&&(t.object.remove(e.object),lwe(tZ(e),e.object));const r=e.props.dispose!==null&&n!==!1;for(let a=e.children.length-1;a>=0;a--){const s=e.children[a];oI(e,s,r)}e.children.length=0,delete e.object.__r3f,r&&e.type!=="primitive"&&e.object.type!=="Scene"&&fZ(e.object),n===void 0&&Yv(e)}function vwe(t,e){for(const n of[t,t.alternate])if(n!==null)if(typeof n.ref=="function"){n.refCleanup==null||n.refCleanup();const i=n.ref(e);typeof i=="function"&&(n.refCleanup=i)}else n.ref&&(n.ref.current=e)}const mM=[];function ywe(){for(const[n]of mM){const i=n.parent;if(i){n.props.attach?rT(i,n):vo(n.object)&&vo(i.object)&&i.object.remove(n.object);for(const r of n.children)r.props.attach?rT(n,r):vo(r.object)&&vo(n.object)&&n.object.remove(r.object)}n.isHidden&&uZ(n),n.object.__r3f&&delete n.object.__r3f,n.type!=="primitive"&&fZ(n.object)}for(const[n,i,r]of mM){n.props=i;const a=n.parent;if(a){var t,e;const s=fv[vC(n.type)];n.object=(t=n.props.object)!=null?t:new s(...(e=n.props.args)!=null?e:[]),n.object.__r3f=n,vwe(r,n.object),nu(n.object,n.props),n.props.attach?iT(a,n):vo(n.object)&&vo(a.object)&&a.object.add(n.object);for(const o of n.children)o.props.attach?iT(n,o):vo(o.object)&&vo(n.object)&&n.object.add(o.object);Yv(n)}}mM.length=0}const qk=()=>{},d5={};let Zw=lZ;const xwe=0,_we=4,aT=hwe({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:gwe,removeChild:oI,appendChild:Wk,appendInitialChild:Wk,insertBefore:h5,appendChildToContainer(t,e){const n=t.getState().scene.__r3f;!e||!n||Wk(n,e)},removeChildFromContainer(t,e){const n=t.getState().scene.__r3f;!e||!n||oI(n,e)},insertInContainerBefore(t,e,n){const i=t.getState().scene.__r3f;!e||!n||!i||h5(i,e,n)},getRootHostContext:()=>d5,getChildHostContext:()=>d5,commitUpdate(t,e,n,i,r){var a,s,o;cZ(e,i);let l=!1;if((t.type==="primitive"&&n.object!==i.object||((a=i.args)==null?void 0:a.length)!==((s=n.args)==null?void 0:s.length)||(o=i.args)!=null&&o.some((u,f)=>{var h;return u!==((h=n.args)==null?void 0:h[f])}))&&(l=!0),l)mM.push([t,{...i},r]);else{const u=awe(t,i);Object.keys(u).length&&(Object.assign(t.props,u),nu(t.object,u))}(r.sibling===null||(r.flags&_we)===xwe)&&ywe()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:t=>t?.object,prepareForCommit:()=>null,preparePortalMount:t=>nT(t.getState().scene,t,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:bwe,unhideInstance:uZ,createTextInstance:qk,hideTextInstance:qk,unhideTextInstance:qk,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:I.createContext(null),setCurrentUpdatePriority(t){Zw=t},getCurrentUpdatePriority(){return Zw},resolveUpdatePriority(){var t;if(Zw!==lZ)return Zw;switch(typeof window<"u"&&((t=window.event)==null?void 0:t.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return pM.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return pM.ContinuousEventPriority;default:return pM.DefaultEventPriority}},resetFormInstance(){}}),qm=new Map,mb={objects:"shallow",strict:!1};function Swe(t,e){if(!e&&typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:n,height:i,top:r,left:a}=t.parentElement.getBoundingClientRect();return{width:n,height:i,top:r,left:a}}else if(!e&&typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function wwe(t){const e=qm.get(t),n=e?.fiber,i=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,a=i||uwe(uI,m5),s=n||aT.createContainer(a,pM.ConcurrentRoot,null,!1,null,"",r,r,r,null);e||qm.set(t,{fiber:s,store:a});let o,l,c=!1,u=null;return{async configure(f={}){let h;u=new Promise(Y=>h=Y);let{gl:d,size:g,scene:b,events:y,onCreated:p,shadows:x=!1,linear:_=!1,flat:w=!1,legacy:M=!1,orthographic:S=!1,frameloop:A="always",dpr:C=[1,2],performance:D,raycaster:R,camera:N,onPointerMissed:U}=f,j=a.getState(),z=j.gl;if(!j.gl){const Y={canvas:t,powerPreference:"high-performance",antialias:!0,alpha:!0},Z=typeof d=="function"?await d(Y):d;u5(Z)?z=Z:z=new bU({...Y,...d}),j.set({gl:z})}let q=j.raycaster;q||j.set({raycaster:q=new V_});const{params:B,...G}=R||{};if(Xr.equ(G,q,mb)||nu(q,{...G}),Xr.equ(B,q.params,mb)||nu(q,{params:{...q.params,...B}}),!j.camera||j.camera===l&&!Xr.equ(l,N,mb)){l=N;const Y=N?.isCamera,Z=Y?N:S?new Eh(0,0,0,0,.1,1e3):new ta(75,0,.1,1e3);Y||(Z.position.z=5,N&&(nu(Z,N),Z.manual||("aspect"in N||"left"in N||"right"in N||"bottom"in N||"top"in N)&&(Z.manual=!0,Z.updateProjectionMatrix())),!j.camera&&!(N!=null&&N.rotation)&&Z.lookAt(0,0,0)),j.set({camera:Z}),q.camera=Z}if(!j.scene){let Y;b!=null&&b.isScene?(Y=b,nT(Y,a,"",{})):(Y=new Hv,nT(Y,a,"",{}),b&&nu(Y,b)),j.set({scene:Y})}y&&!j.events.handlers&&j.set({events:y(a)});const H=Swe(t,g);if(Xr.equ(H,j.size,mb)||j.setSize(H.width,H.height,H.top,H.left),C&&j.viewport.dpr!==iZ(C)&&j.setDpr(C),j.frameloop!==A&&j.setFrameloop(A),j.onPointerMissed||j.set({onPointerMissed:U}),D&&!Xr.equ(D,j.performance,mb)&&j.set(Y=>({performance:{...Y.performance,...D}})),!j.xr){var W;const Y=(de,se)=>{const oe=a.getState();oe.frameloop!=="never"&&m5(de,!0,oe,se)},Z=()=>{const de=a.getState();de.gl.xr.enabled=de.gl.xr.isPresenting,de.gl.xr.setAnimationLoop(de.gl.xr.isPresenting?Y:null),de.gl.xr.isPresenting||uI(de)},V={connect(){const de=a.getState().gl;de.xr.addEventListener("sessionstart",Z),de.xr.addEventListener("sessionend",Z)},disconnect(){const de=a.getState().gl;de.xr.removeEventListener("sessionstart",Z),de.xr.removeEventListener("sessionend",Z)}};typeof((W=z.xr)==null?void 0:W.addEventListener)=="function"&&V.connect(),j.set({xr:V})}if(z.shadowMap){const Y=z.shadowMap.enabled,Z=z.shadowMap.type;if(z.shadowMap.enabled=!!x,Xr.boo(x))z.shadowMap.type=Jx;else if(Xr.str(x)){var F;const V={basic:$Y,percentage:NA,soft:Jx,variance:Xc};z.shadowMap.type=(F=V[x])!=null?F:Jx}else Xr.obj(x)&&Object.assign(z.shadowMap,x);(Y!==z.shadowMap.enabled||Z!==z.shadowMap.type)&&(z.shadowMap.needsUpdate=!0)}return pi.enabled=!M,c||(z.outputColorSpace=_?bu:Es,z.toneMapping=w?Qu:RP),j.legacy!==M&&j.set(()=>({legacy:M})),j.linear!==_&&j.set(()=>({linear:_})),j.flat!==w&&j.set(()=>({flat:w})),d&&!Xr.fun(d)&&!u5(d)&&!Xr.equ(d,z,mb)&&nu(z,d),o=p,c=!0,h(),this},render(f){return!c&&!u&&this.configure(),u.then(()=>{aT.updateContainer(k.jsx(Ewe,{store:a,children:f,onCreated:o,rootElement:t}),s,null,()=>{})}),a},unmount(){hZ(t)}}}function Ewe({store:t,children:e,onCreated:n,rootElement:i}){return G_(()=>{const r=t.getState();r.set(a=>({internal:{...a.internal,active:!0}})),n&&n(r),t.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),k.jsx(_U.Provider,{value:t,children:e})}function hZ(t,e){const n=qm.get(t),i=n?.fiber;if(i){const r=n?.store.getState();r&&(r.internal.active=!1),aT.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var a,s,o,l;r.events.disconnect==null||r.events.disconnect(),(a=r.gl)==null||(s=a.renderLists)==null||s.dispose==null||s.dispose(),(o=r.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),nwe(r.scene),qm.delete(t)}catch{}},500)})}}function Mwe(t,e,n){return k.jsx(Twe,{children:t,container:e,state:n})}function Twe({state:t={},children:e,container:n}){const{events:i,size:r,...a}=t,s=SU(),[o]=I.useState(()=>new V_),[l]=I.useState(()=>new wt),c=xU((f,h)=>{let d;if(h.camera&&r){const g=h.camera;d=f.viewport.getCurrentViewport(g,new te,r),g!==f.camera&&aZ(g,r)}return{...f,...h,scene:n,raycaster:o,pointer:l,mouse:l,previousRoot:s,events:{...f.events,...h.events,...i},size:{...f.size,...r},viewport:{...f.viewport,...d},setEvents:g=>h.set(b=>({...b,events:{...b.events,...g}}))}}),u=I.useMemo(()=>{const f=G$((d,g)=>({...a,set:d,get:g})),h=d=>f.setState(g=>c.current(d,g));return h(s.getState()),s.subscribe(h),f},[s,n]);return k.jsx(k.Fragment,{children:aT.createPortal(k.jsx(_U.Provider,{value:u,children:e}),u,null)})}function dZ(t,e){const n={callback:t};return e.add(n),()=>void e.delete(n)}const pZ=new Set,mZ=new Set,Awe=new Set,Cwe=t=>dZ(t,pZ),Rwe=t=>dZ(t,mZ);function Xk(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function a1(t,e){switch(t){case"before":return Xk(pZ,e);case"after":return Xk(mZ,e);case"tail":return Xk(Awe,e)}}let Kk,Yk;function lI(t,e,n){let i=e.clock.getDelta();e.frameloop==="never"&&typeof t=="number"&&(i=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),Kk=e.internal.subscribers;for(let r=0;r<Kk.length;r++)Yk=Kk[r],Yk.ref.current(Yk.store.getState(),i,n);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let sT=!1,cI=!1,Jk,p5,gb;function gZ(t){p5=requestAnimationFrame(gZ),sT=!0,Jk=0,a1("before",t),cI=!0;for(const n of qm.values()){var e;gb=n.store.getState(),gb.internal.active&&(gb.frameloop==="always"||gb.internal.frames>0)&&!((e=gb.gl.xr)!=null&&e.isPresenting)&&(Jk+=lI(t,gb))}if(cI=!1,a1("after",t),Jk===0)return a1("tail",t),sT=!1,cancelAnimationFrame(p5)}function uI(t,e=1){var n;if(!t)return qm.forEach(i=>uI(i.store.getState(),e));(n=t.gl.xr)!=null&&n.isPresenting||!t.internal.active||t.frameloop==="never"||(e>1?t.internal.frames=Math.min(60,t.internal.frames+e):cI?t.internal.frames=2:t.internal.frames=1,sT||(sT=!0,requestAnimationFrame(gZ)))}function m5(t,e=!0,n,i){if(e&&a1("before",t),n)lI(t,n,i);else for(const r of qm.values())lI(t,r.store.getState());e&&a1("after",t)}const $k={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 kwe(t){const{handlePointer:e}=cwe(t);return{priority:1,enabled:!0,compute(n,i,r){i.pointer.set(n.offsetX/i.size.width*2-1,-(n.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys($k).reduce((n,i)=>({...n,[i]:e(i)}),{}),update:()=>{var n;const{events:i,internal:r}=t.getState();(n=r.lastEvent)!=null&&n.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:n=>{const{set:i,events:r}=t.getState();if(r.disconnect==null||r.disconnect(),i(a=>({events:{...a.events,connected:n}})),r.handlers)for(const a in r.handlers){const s=r.handlers[a],[o,l]=$k[a];n.addEventListener(o,s,{passive:l})}},disconnect:()=>{const{set:n,events:i}=t.getState();if(i.connected){if(i.handlers)for(const r in i.handlers){const a=i.handlers[r],[s]=$k[r];i.connected.removeEventListener(s,a)}n(r=>({events:{...r.events,connected:void 0}}))}}}}function g5(t,e){let n;return(...i)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...i),e)}}function Dwe({debounce:t,scroll:e,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!r)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[a,s]=I.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=I.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),l=t?typeof t=="number"?t:t.scroll:null,c=t?typeof t=="number"?t:t.resize:null,u=I.useRef(!1);I.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[f,h,d]=I.useMemo(()=>{const p=()=>{if(!o.current.element)return;const{left:x,top:_,width:w,height:M,bottom:S,right:A,x:C,y:D}=o.current.element.getBoundingClientRect(),R={left:x,top:_,width:w,height:M,bottom:S,right:A,x:C,y:D};o.current.element instanceof HTMLElement&&i&&(R.height=o.current.element.offsetHeight,R.width=o.current.element.offsetWidth),Object.freeze(R),u.current&&!Lwe(o.current.lastBounds,R)&&s(o.current.lastBounds=R)};return[p,c?g5(p,c):p,l?g5(p,l):p]},[s,i,l,c]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(p=>p.removeEventListener("scroll",d,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function b(){o.current.element&&(o.current.resizeObserver=new r(d),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(p=>p.addEventListener("scroll",d,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{d()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const y=p=>{!p||p===o.current.element||(g(),o.current.element=p,o.current.scrollContainers=bZ(p),b())};return Iwe(d,!!e),Owe(h),I.useEffect(()=>{g(),b()},[e,d,h]),I.useEffect(()=>g,[]),[y,a,f]}function Owe(t){I.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Iwe(t,e){I.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function bZ(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:i,overflowY:r}=window.getComputedStyle(t);return[n,i,r].some(a=>a==="auto"||a==="scroll")&&e.push(t),[...e,...bZ(t.parentElement)]}const Nwe=["x","y","top","bottom","left","right","width","height"],Lwe=(t,e)=>Nwe.every(n=>t[n]===e[n]);function Pwe({ref:t,children:e,fallback:n,resize:i,style:r,gl:a,events:s=kwe,eventSource:o,eventPrefix:l,shadows:c,linear:u,flat:f,legacy:h,orthographic:d,frameloop:g,dpr:b,performance:y,raycaster:p,camera:x,scene:_,onPointerMissed:w,onCreated:M,...S}){I.useMemo(()=>W_(gSe),[]);const A=ZSe(),[C,D]=Dwe({scroll:!0,debounce:{scroll:50,resize:0},...i}),R=I.useRef(null),N=I.useRef(null);I.useImperativeHandle(t,()=>R.current);const U=xU(w),[j,z]=I.useState(!1),[q,B]=I.useState(!1);if(j)throw j;if(q)throw q;const G=I.useRef(null);G_(()=>{const W=R.current;if(D.width>0&&D.height>0&&W){G.current||(G.current=wwe(W));async function F(){await G.current.configure({gl:a,scene:_,events:s,shadows:c,linear:u,flat:f,legacy:h,orthographic:d,frameloop:g,dpr:b,performance:y,raycaster:p,camera:x,size:D,onPointerMissed:(...Y)=>U.current==null?void 0:U.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(o?JSe(o)?o.current:o:N.current),l&&Y.setEvents({compute:(Z,V)=>{const de=Z[l+"X"],se=Z[l+"Y"];V.pointer.set(de/V.size.width*2-1,-(se/V.size.height)*2+1),V.raycaster.setFromCamera(V.pointer,V.camera)}}),M?.(Y)}}),G.current.render(k.jsx(A,{children:k.jsx(ewe,{set:B,children:k.jsx(I.Suspense,{fallback:k.jsx(QSe,{set:z}),children:e??null})})}))}F()}}),I.useEffect(()=>{const W=R.current;if(W)return()=>hZ(W)},[]);const H=o?"none":"auto";return k.jsx("div",{ref:N,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:H,...r},...S,children:k.jsx("div",{ref:C,style:{width:"100%",height:"100%"},children:k.jsx("canvas",{ref:R,style:{display:"block"},children:n})})})}function Uwe(t){return k.jsx(Z$,{children:k.jsx(Pwe,{...t})})}const q_=new te,EU=new te,Fwe=new te,b5=new wt;function Bwe(t,e,n){const i=q_.setFromMatrixPosition(t.matrixWorld);i.project(e);const r=n.width/2,a=n.height/2;return[i.x*r+r,-(i.y*a)+a]}function zwe(t,e){const n=q_.setFromMatrixPosition(t.matrixWorld),i=EU.setFromMatrixPosition(e.matrixWorld),r=n.sub(i),a=e.getWorldDirection(Fwe);return r.angleTo(a)>Math.PI/2}function jwe(t,e,n,i){const r=q_.setFromMatrixPosition(t.matrixWorld),a=r.clone();a.project(e),b5.set(a.x,a.y),n.setFromCamera(b5,e);const s=n.intersectObjects(i,!0);if(s.length){const o=s[0].distance;return r.distanceTo(n.ray.origin)<o}return!0}function Hwe(t,e){if(e instanceof Eh)return e.zoom;if(e instanceof ta){const n=q_.setFromMatrixPosition(t.matrixWorld),i=EU.setFromMatrixPosition(e.matrixWorld),r=e.fov*Math.PI/180,a=n.distanceTo(i);return 1/(2*Math.tan(r/2)*a)}else return 1}function Vwe(t,e,n){if(e instanceof ta||e instanceof Eh){const i=q_.setFromMatrixPosition(t.matrixWorld),r=EU.setFromMatrixPosition(e.matrixWorld),a=i.distanceTo(r),s=(n[1]-n[0])/(e.far-e.near),o=n[1]-s*e.far;return Math.round(s*a+o)}}const fI=t=>Math.abs(t)<1e-10?0:t;function vZ(t,e,n=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=fI(e[r]*t.elements[r])+(r!==15?",":")");return n+i}const Gwe=(t=>e=>vZ(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Wwe=(t=>(e,n)=>vZ(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]);function qwe(t){return t&&typeof t=="object"&&"current"in t}const Jv=I.forwardRef(({children:t,eps:e=.001,style:n,className:i,prepend:r,center:a,fullscreen:s,portal:o,distanceFactor:l,sprite:c=!1,transform:u=!1,occlude:f,onOcclude:h,castShadow:d,receiveShadow:g,material:b,geometry:y,zIndexRange:p=[16777271,0],calculatePosition:x=Bwe,as:_="div",wrapperClass:w,pointerEvents:M="auto",...S},A)=>{const{gl:C,camera:D,scene:R,size:N,raycaster:U,events:j,viewport:z}=Ri(),[q]=I.useState(()=>document.createElement(_)),B=I.useRef(null),G=I.useRef(null),H=I.useRef(0),W=I.useRef([0,0]),F=I.useRef(null),Y=I.useRef(null),Z=o?.current||j.connected||C.domElement.parentNode,V=I.useRef(null),de=I.useRef(!1),se=I.useMemo(()=>f&&f!=="blending"||Array.isArray(f)&&f.length&&qwe(f[0]),[f]);I.useLayoutEffect(()=>{const Ne=C.domElement;f&&f==="blending"?(Ne.style.zIndex=`${Math.floor(p[0]/2)}`,Ne.style.position="absolute",Ne.style.pointerEvents="none"):(Ne.style.zIndex=null,Ne.style.position=null,Ne.style.pointerEvents=null)},[f]),I.useLayoutEffect(()=>{if(G.current){const Ne=B.current=Zq.createRoot(q);if(R.updateMatrixWorld(),u)q.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Ue=x(G.current,D,N);q.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Ue[0]}px,${Ue[1]}px,0);transform-origin:0 0;`}return Z&&(r?Z.prepend(q):Z.appendChild(q)),()=>{Z&&Z.removeChild(q),Ne.unmount()}}},[Z,u]),I.useLayoutEffect(()=>{w&&(q.className=w)},[w]);const oe=I.useMemo(()=>u?{position:"absolute",top:0,left:0,width:N.width,height:N.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:a?"translate3d(-50%,-50%,0)":"none",...s&&{top:-N.height/2,left:-N.width/2,width:N.width,height:N.height},...n},[n,a,s,N,u]),ue=I.useMemo(()=>({position:"absolute",pointerEvents:M}),[M]);I.useLayoutEffect(()=>{if(de.current=!1,u){var Ne;(Ne=B.current)==null||Ne.render(I.createElement("div",{ref:F,style:oe},I.createElement("div",{ref:Y,style:ue},I.createElement("div",{ref:A,className:i,style:n,children:t}))))}else{var Ue;(Ue=B.current)==null||Ue.render(I.createElement("div",{ref:A,style:oe,className:i,children:t}))}});const _e=I.useRef(!0);ra(Ne=>{if(G.current){D.updateMatrixWorld(),G.current.updateWorldMatrix(!0,!1);const Ue=u?W.current:x(G.current,D,N);if(u||Math.abs(H.current-D.zoom)>e||Math.abs(W.current[0]-Ue[0])>e||Math.abs(W.current[1]-Ue[1])>e){const ze=zwe(G.current,D);let pe=!1;se&&(Array.isArray(f)?pe=f.map(we=>we.current):f!=="blending"&&(pe=[R]));const Fe=_e.current;if(pe){const we=jwe(G.current,D,U,pe);_e.current=we&&!ze}else _e.current=!ze;Fe!==_e.current&&(h?h(!_e.current):q.style.display=_e.current?"block":"none");const Ie=Math.floor(p[0]/2),qe=f?se?[p[0],Ie]:[Ie-1,0]:p;if(q.style.zIndex=`${Vwe(G.current,D,qe)}`,u){const[we,Te]=[N.width/2,N.height/2],Ae=D.projectionMatrix.elements[5]*Te,{isOrthographicCamera:Pe,top:He,left:$e,bottom:ie,right:K}=D,ce=Gwe(D.matrixWorldInverse),fe=Pe?`scale(${Ae})translate(${fI(-(K+$e)/2)}px,${fI((He+ie)/2)}px)`:`translateZ(${Ae}px)`;let me=G.current.matrixWorld;c&&(me=D.matrixWorldInverse.clone().transpose().copyPosition(me).scale(G.current.scale),me.elements[3]=me.elements[7]=me.elements[11]=0,me.elements[15]=1),q.style.width=N.width+"px",q.style.height=N.height+"px",q.style.perspective=Pe?"":`${Ae}px`,F.current&&Y.current&&(F.current.style.transform=`${fe}${ce}translate(${we}px,${Te}px)`,Y.current.style.transform=Wwe(me,1/((l||10)/400)))}else{const we=l===void 0?1:Hwe(G.current,D)*l;q.style.transform=`translate3d(${Ue[0]}px,${Ue[1]}px,0) scale(${we})`}W.current=Ue,H.current=D.zoom}}if(!se&&V.current&&!de.current)if(u){if(F.current){const Ue=F.current.children[0];if(Ue!=null&&Ue.clientWidth&&Ue!=null&&Ue.clientHeight){const{isOrthographicCamera:ze}=D;if(ze||y)S.scale&&(Array.isArray(S.scale)?S.scale instanceof te?V.current.scale.copy(S.scale.clone().divideScalar(1)):V.current.scale.set(1/S.scale[0],1/S.scale[1],1/S.scale[2]):V.current.scale.setScalar(1/S.scale));else{const pe=(l||10)/400,Fe=Ue.clientWidth*pe,Ie=Ue.clientHeight*pe;V.current.scale.set(Fe,Ie,1)}de.current=!0}}}else{const Ue=q.children[0];if(Ue!=null&&Ue.clientWidth&&Ue!=null&&Ue.clientHeight){const ze=1/z.factor,pe=Ue.clientWidth*ze,Fe=Ue.clientHeight*ze;V.current.scale.set(pe,Fe,1),de.current=!0}V.current.lookAt(Ne.camera.position)}});const ke=I.useMemo(()=>({vertexShader:u?void 0:`
          /*
            This shader is from the THREE's SpriteMaterial.
            We need to turn the backing plane into a Sprite
            (make it always face the camera) if "transfrom"
            is false.
          */
          #include <common>

          void main() {
            vec2 center = vec2(0., 1.);
            float rotation = 0.0;

            // This is somewhat arbitrary, but it seems to work well
            // Need to figure out how to derive this dynamically if it even matters
            float size = 0.03;

            vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
            vec2 scale;
            scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
            scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );

            bool isPerspective = isPerspectiveMatrix( projectionMatrix );
            if ( isPerspective ) scale *= - mvPosition.z;

            vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
            vec2 rotatedPosition;
            rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
            rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
            mvPosition.xy += rotatedPosition;

            gl_Position = projectionMatrix * mvPosition;
          }
      `,fragmentShader:`
        void main() {
          gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
        }
      `}),[u]);return I.createElement("group",Is({},S,{ref:G}),f&&!se&&I.createElement("mesh",{castShadow:d,receiveShadow:g,ref:V},y||I.createElement("planeGeometry",null),b||I.createElement("shaderMaterial",{side:Kr,vertexShader:ke.vertexShader,fragmentShader:ke.fragmentShader})))}),X_=parseInt(Uv.replace(/\D+/g,"")),yZ=X_>=125?"uv1":"uv2",Xwe=(t,e)=>{const n=t[0].index!==null,i=new Set(Object.keys(t[0].attributes)),r=new Set(Object.keys(t[0].morphAttributes)),a={},s={},o=t[0].morphTargetsRelative,l=new Dn;let c=0;if(t.forEach((u,f)=>{let h=0;if(n!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let d in u.attributes){if(!i.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;a[d]===void 0&&(a[d]=[]),a[d].push(u.attributes[d]),h++}if(h!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let d in u.morphAttributes){if(!r.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+".  .morphAttributes must be consistent throughout all geometries."),null;s[d]===void 0&&(s[d]=[]),s[d].push(u.morphAttributes[d])}l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(u.userData);{let d;if(u.index)d=u.index.count;else if(u.attributes.position!==void 0)d=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+f+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,d,f),c+=d}}),n){let u=0;const f=[];t.forEach(h=>{const d=h.index;for(let g=0;g<d.count;++g)f.push(d.getX(g)+u);u+=h.attributes.position.count}),l.setIndex(f)}for(let u in a){const f=v5(a[u]);if(!f)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+u+" attribute."),null;l.setAttribute(u,f)}for(let u in s){const f=s[u][0].length;if(f===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[u]=[];for(let h=0;h<f;++h){const d=[];for(let b=0;b<s[u].length;++b)d.push(s[u][b][h]);const g=v5(d);if(!g)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+u+" morphAttribute."),null;l.morphAttributes[u].push(g)}}return l},v5=t=>{let e,n,i,r=0;if(t.forEach(a=>{if(e===void 0&&(e=a.array.constructor),e!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(n===void 0&&(n=a.itemSize),n!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(i===void 0&&(i=a.normalized),i!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;r+=a.array.length}),e&&n){const a=new e(r);let s=0;return t.forEach(o=>{a.set(o.array,s),s+=o.array.length}),new Nn(a,n,i)}};function y5(t,e){if(e===AJ)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Y2||e===PP){let n=t.getIndex();if(n===null){const s=[],o=t.getAttribute("position");if(o!==void 0){for(let l=0;l<o.count;l++)s.push(l);t.setIndex(s),n=t.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t}const i=n.count-2,r=[];if(n)if(e===Y2)for(let s=1;s<=i;s++)r.push(n.getX(0)),r.push(n.getX(s)),r.push(n.getX(s+1));else for(let s=0;s<i;s++)s%2===0?(r.push(n.getX(s)),r.push(n.getX(s+1)),r.push(n.getX(s+2))):(r.push(n.getX(s+2)),r.push(n.getX(s+1)),r.push(n.getX(s)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=t.clone();return a.setIndex(r),a.clearGroups(),a}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}function Kwe(t,e=Math.PI/3){const n=Math.cos(e),i=(1+1e-10)*100,r=[new te,new te,new te],a=new te,s=new te,o=new te,l=new te;function c(b){const y=~~(b.x*i),p=~~(b.y*i),x=~~(b.z*i);return`${y},${p},${x}`}const u=t.index?t.toNonIndexed():t,f=u.attributes.position,h={};for(let b=0,y=f.count/3;b<y;b++){const p=3*b,x=r[0].fromBufferAttribute(f,p+0),_=r[1].fromBufferAttribute(f,p+1),w=r[2].fromBufferAttribute(f,p+2);a.subVectors(w,_),s.subVectors(x,_);const M=new te().crossVectors(a,s).normalize();for(let S=0;S<3;S++){const A=r[S],C=c(A);C in h||(h[C]=[]),h[C].push(M)}}const d=new Float32Array(f.count*3),g=new Nn(d,3,!1);for(let b=0,y=f.count/3;b<y;b++){const p=3*b,x=r[0].fromBufferAttribute(f,p+0),_=r[1].fromBufferAttribute(f,p+1),w=r[2].fromBufferAttribute(f,p+2);a.subVectors(w,_),s.subVectors(x,_),o.crossVectors(a,s).normalize();for(let M=0;M<3;M++){const S=r[M],A=c(S),C=h[A];l.set(0,0,0);for(let D=0,R=C.length;D<R;D++){const N=C[D];o.dot(N)>n&&l.add(N)}l.normalize(),g.setXYZ(p+M,l.x,l.y,l.z)}}return u.setAttribute("normal",g),u}var uc=Uint8Array,_d=Uint16Array,hI=Uint32Array,xZ=new uc([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]),_Z=new uc([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]),Ywe=new uc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),SZ=function(t,e){for(var n=new _d(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];for(var r=new hI(n[30]),i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return[n,r]},wZ=SZ(xZ,2),EZ=wZ[0],Jwe=wZ[1];EZ[28]=258,Jwe[258]=28;var $we=SZ(_Z,0),Zwe=$we[0],dI=new _d(32768);for(var Br=0;Br<32768;++Br){var Yh=(Br&43690)>>>1|(Br&21845)<<1;Yh=(Yh&52428)>>>2|(Yh&13107)<<2,Yh=(Yh&61680)>>>4|(Yh&3855)<<4,dI[Br]=((Yh&65280)>>>8|(Yh&255)<<8)>>>1}var s1=function(t,e,n){for(var i=t.length,r=0,a=new _d(e);r<i;++r)++a[t[r]-1];var s=new _d(e);for(r=0;r<e;++r)s[r]=s[r-1]+a[r-1]<<1;var o;if(n){o=new _d(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],f=s[t[r]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)o[dI[f]>>>l]=c}else for(o=new _d(i),r=0;r<i;++r)t[r]&&(o[r]=dI[s[t[r]-1]++]>>>15-t[r]);return o},K_=new uc(288);for(var Br=0;Br<144;++Br)K_[Br]=8;for(var Br=144;Br<256;++Br)K_[Br]=9;for(var Br=256;Br<280;++Br)K_[Br]=7;for(var Br=280;Br<288;++Br)K_[Br]=8;var MZ=new uc(32);for(var Br=0;Br<32;++Br)MZ[Br]=5;var Qwe=s1(K_,9,1),eEe=s1(MZ,5,1),Zk=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Vc=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(e&7)&n},Qk=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},tEe=function(t){return(t/8|0)+(t&7&&1)},nEe=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof _d?_d:t instanceof hI?hI:uc)(n-e);return i.set(t.subarray(e,n)),i},iEe=function(t,e,n){var i=t.length;if(!i||n&&!n.l&&i<5)return e||new uc(0);var r=!e||n,a=!n||n.i;n||(n={}),e||(e=new uc(i*3));var s=function(oe){var ue=e.length;if(oe>ue){var _e=new uc(Math.max(ue*2,oe));_e.set(e),e=_e}},o=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,h=n.m,d=n.n,g=i*8;do{if(!u){n.f=o=Vc(t,l,1);var b=Vc(t,l+1,3);if(l+=3,b)if(b==1)u=Qwe,f=eEe,h=9,d=5;else if(b==2){var _=Vc(t,l,31)+257,w=Vc(t,l+10,15)+4,M=_+Vc(t,l+5,31)+1;l+=14;for(var S=new uc(M),A=new uc(19),C=0;C<w;++C)A[Ywe[C]]=Vc(t,l+C*3,7);l+=w*3;for(var D=Zk(A),R=(1<<D)-1,N=s1(A,D,1),C=0;C<M;){var U=N[Vc(t,l,R)];l+=U&15;var y=U>>>4;if(y<16)S[C++]=y;else{var j=0,z=0;for(y==16?(z=3+Vc(t,l,3),l+=2,j=S[C-1]):y==17?(z=3+Vc(t,l,7),l+=3):y==18&&(z=11+Vc(t,l,127),l+=7);z--;)S[C++]=j}}var q=S.subarray(0,_),B=S.subarray(_);h=Zk(q),d=Zk(B),u=s1(q,h,1),f=s1(B,d,1)}else throw"invalid block type";else{var y=tEe(l)+4,p=t[y-4]|t[y-3]<<8,x=y+p;if(x>i){if(a)throw"unexpected EOF";break}r&&s(c+p),e.set(t.subarray(y,x),c),n.b=c+=p,n.p=l=x*8;continue}if(l>g){if(a)throw"unexpected EOF";break}}r&&s(c+131072);for(var G=(1<<h)-1,H=(1<<d)-1,W=l;;W=l){var j=u[Qk(t,l)&G],F=j>>>4;if(l+=j&15,l>g){if(a)throw"unexpected EOF";break}if(!j)throw"invalid length/literal";if(F<256)e[c++]=F;else if(F==256){W=l,u=null;break}else{var Y=F-254;if(F>264){var C=F-257,Z=xZ[C];Y=Vc(t,l,(1<<Z)-1)+EZ[C],l+=Z}var V=f[Qk(t,l)&H],de=V>>>4;if(!V)throw"invalid distance";l+=V&15;var B=Zwe[de];if(de>3){var Z=_Z[de];B+=Qk(t,l)&(1<<Z)-1,l+=Z}if(l>g){if(a)throw"unexpected EOF";break}r&&s(c+131072);for(var se=c+Y;c<se;c+=4)e[c]=e[c-B],e[c+1]=e[c+1-B],e[c+2]=e[c+2-B],e[c+3]=e[c+3-B];c=se}}n.l=u,n.p=W,n.b=c,u&&(o=1,n.m=h,n.d=f,n.n=d)}while(!o);return c==e.length?e:nEe(e,0,c)},rEe=new uc(0),aEe=function(t){if((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function Qw(t,e){return iEe((aEe(t),t.subarray(2,-4)),e)}var sEe=typeof TextDecoder<"u"&&new TextDecoder,oEe=0;try{sEe.decode(rEe,{stream:!0}),oEe=1}catch{}const lEe=t=>t&&t.isCubeTexture;class cEe extends _i{constructor(e,n){var i,r;const a=lEe(e),o=((r=a?(i=e.image[0])==null?void 0:i.width:e.image.width)!=null?r:1024)/4,l=Math.floor(Math.log2(o)),c=Math.pow(2,l),u=3*Math.max(c,16*7),f=4*c,h=[a?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/u}`,`#define CUBEUV_TEXEL_HEIGHT ${1/f}`,`#define CUBEUV_MAX_MIP ${l}.0`],d=`
        varying vec3 vWorldPosition;
        void main() 
        {
            vec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );
            vWorldPosition = worldPosition.xyz;
            
            gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
        }
        `,g=h.join(`
`)+`
        #define ENVMAP_TYPE_CUBE_UV
        varying vec3 vWorldPosition;
        uniform float radius;
        uniform float height;
        uniform float angle;
        #ifdef ENVMAP_TYPE_CUBE
            uniform samplerCube map;
        #else
            uniform sampler2D map;
        #endif
        // From: https://www.shadertoy.com/view/4tsBD7
        float diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) 
        {
            float d = dot ( rd, n );
            
            if( d > 0.0 ) { return 1e6; }
            
            vec3  o = ro - c;
            float t = - dot( n, o ) / d;
            vec3  q = o + rd * t;
            
            return ( dot( q, q ) < r * r ) ? t : 1e6;
        }
        // From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm
        float sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) 
        {
            vec3 oc = ro - ce;
            float b = dot( oc, rd );
            float c = dot( oc, oc ) - ra * ra;
            float h = b * b - c;
            
            if( h < 0.0 ) { return -1.0; }
            
            h = sqrt( h );
            
            return - b + h;
        }
        vec3 project() 
        {
            vec3 p = normalize( vWorldPosition );
            vec3 camPos = cameraPosition;
            camPos.y -= height;
            float intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );
            if( intersection > 0.0 ) {
                
                vec3 h = vec3( 0.0, - height, 0.0 );
                float intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );
                p = ( camPos + min( intersection, intersection2 ) * p ) / radius;
            } else {
                p = vec3( 0.0, 1.0, 0.0 );
            }
            return p;
        }
        #include <common>
        #include <cube_uv_reflection_fragment>
        void main() 
        {
            vec3 projectedWorldPosition = project();
            
            #ifdef ENVMAP_TYPE_CUBE
                vec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;
            #else
                vec3 direction = normalize( projectedWorldPosition );
                vec2 uv = equirectUv( direction );
                vec3 outcolor = texture2D( map, uv ).rgb;
            #endif
            gl_FragColor = vec4( outcolor, 1.0 );
            #include <tonemapping_fragment>
            #include <${X_>=154?"colorspace_fragment":"encodings_fragment"}>
        }
        `,b={map:{value:e},height:{value:n?.height||15},radius:{value:n?.radius||100}},y=new Gv(1,16),p=new ss({uniforms:b,fragmentShader:g,vertexShader:d,side:Kr});super(y,p)}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}function oT(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let e="";for(let n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch{return e}}const um="srgb",rh="srgb-linear",x5=3001,uEe=3e3;class fEe extends Fs{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(n){return new gEe(n)}),this.register(function(n){return new bEe(n)}),this.register(function(n){return new TEe(n)}),this.register(function(n){return new AEe(n)}),this.register(function(n){return new CEe(n)}),this.register(function(n){return new yEe(n)}),this.register(function(n){return new xEe(n)}),this.register(function(n){return new _Ee(n)}),this.register(function(n){return new SEe(n)}),this.register(function(n){return new mEe(n)}),this.register(function(n){return new wEe(n)}),this.register(function(n){return new vEe(n)}),this.register(function(n){return new MEe(n)}),this.register(function(n){return new EEe(n)}),this.register(function(n){return new dEe(n)}),this.register(function(n){return new REe(n)}),this.register(function(n){return new kEe(n)})}load(e,n,i,r){const a=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const c=Dd.extractUrlBase(e);s=Dd.resolveURL(c,this.path)}else s=Dd.extractUrlBase(e);this.manager.itemStart(e);const o=function(c){r?r(c):console.error(c),a.manager.itemError(e),a.manager.itemEnd(e)},l=new Os(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(c){try{a.parse(c,s,function(u){n(u),a.manager.itemEnd(e)},o)}catch(u){o(u)}},i,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,i,r){let a;const s={},o={};if(typeof e=="string")a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(oT(new Uint8Array(e.slice(0,4)))===TZ){try{s[ki.KHR_BINARY_GLTF]=new DEe(e)}catch(u){r&&r(u);return}a=JSON.parse(s[ki.KHR_BINARY_GLTF].content)}else a=JSON.parse(oT(new Uint8Array(e)));else a=e;if(a.asset===void 0||a.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const l=new GEe(a,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c<this.pluginCallbacks.length;c++){const u=this.pluginCallbacks[c](l);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[u.name]=u,s[u.name]=!0}if(a.extensionsUsed)for(let c=0;c<a.extensionsUsed.length;++c){const u=a.extensionsUsed[c],f=a.extensionsRequired||[];switch(u){case ki.KHR_MATERIALS_UNLIT:s[u]=new pEe;break;case ki.KHR_DRACO_MESH_COMPRESSION:s[u]=new OEe(a,this.dracoLoader);break;case ki.KHR_TEXTURE_TRANSFORM:s[u]=new IEe;break;case ki.KHR_MESH_QUANTIZATION:s[u]=new NEe;break;default:f.indexOf(u)>=0&&o[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(i,r)}parseAsync(e,n){const i=this;return new Promise(function(r,a){i.parse(e,n,r,a)})}}function hEe(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const ki={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class dEe{constructor(e){this.parser=e,this.name=ki.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let i=0,r=n.length;i<r;i++){const a=n[i];a.extensions&&a.extensions[this.name]&&a.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}_loadLight(e){const n=this.parser,i="light:"+e;let r=n.cache.get(i);if(r)return r;const a=n.json,l=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let c;const u=new Ut(16777215);l.color!==void 0&&u.setRGB(l.color[0],l.color[1],l.color[2],rh);const f=l.range!==void 0?l.range:0;switch(l.type){case"directional":c=new dC(u),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new cU(u),c.distance=f;break;case"spot":c=new lU(u),c.distance=f,l.spot=l.spot||{},l.spot.innerConeAngle=l.spot.innerConeAngle!==void 0?l.spot.innerConeAngle:0,l.spot.outerConeAngle=l.spot.outerConeAngle!==void 0?l.spot.outerConeAngle:Math.PI/4,c.angle=l.spot.outerConeAngle,c.penumbra=1-l.spot.innerConeAngle/l.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+l.type)}return c.position.set(0,0,0),c.decay=2,Bf(c,l),l.intensity!==void 0&&(c.intensity=l.intensity),c.name=n.createUniqueName(l.name||"light_"+e),r=Promise.resolve(c),n.cache.add(i,r),r}getDependency(e,n){if(e==="light")return this._loadLight(n)}createNodeAttachment(e){const n=this,i=this.parser,a=i.json.nodes[e],o=(a.extensions&&a.extensions[this.name]||{}).light;return o===void 0?null:this._loadLight(o).then(function(l){return i._getNodeRef(n.cache,o,l)})}}class pEe{constructor(){this.name=ki.KHR_MATERIALS_UNLIT}getMaterialType(){return Cs}extendParams(e,n,i){const r=[];e.color=new Ut(1,1,1),e.opacity=1;const a=n.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const s=a.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],rh),e.opacity=s[3]}a.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",a.baseColorTexture,um))}return Promise.all(r)}}class mEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,n){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=r.extensions[this.name].emissiveStrength;return a!==void 0&&(n.emissiveIntensity=a),Promise.resolve()}}class gEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];if(s.clearcoatFactor!==void 0&&(n.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&a.push(i.assignTexture(n,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(n.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&a.push(i.assignTexture(n,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(a.push(i.assignTexture(n,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const o=s.clearcoatNormalTexture.scale;n.clearcoatNormalScale=new wt(o,o)}return Promise.all(a)}}class bEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_DISPERSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=r.extensions[this.name];return n.dispersion=a.dispersion!==void 0?a.dispersion:0,Promise.resolve()}}class vEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];return s.iridescenceFactor!==void 0&&(n.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&a.push(i.assignTexture(n,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(n.iridescenceIOR=s.iridescenceIor),n.iridescenceThicknessRange===void 0&&(n.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(n.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(n.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&a.push(i.assignTexture(n,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(a)}}class yEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[];n.sheenColor=new Ut(0,0,0),n.sheenRoughness=0,n.sheen=1;const s=r.extensions[this.name];if(s.sheenColorFactor!==void 0){const o=s.sheenColorFactor;n.sheenColor.setRGB(o[0],o[1],o[2],rh)}return s.sheenRoughnessFactor!==void 0&&(n.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&a.push(i.assignTexture(n,"sheenColorMap",s.sheenColorTexture,um)),s.sheenRoughnessTexture!==void 0&&a.push(i.assignTexture(n,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(a)}}class xEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];return s.transmissionFactor!==void 0&&(n.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&a.push(i.assignTexture(n,"transmissionMap",s.transmissionTexture)),Promise.all(a)}}class _Ee{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];n.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&a.push(i.assignTexture(n,"thicknessMap",s.thicknessTexture)),n.attenuationDistance=s.attenuationDistance||1/0;const o=s.attenuationColor||[1,1,1];return n.attenuationColor=new Ut().setRGB(o[0],o[1],o[2],rh),Promise.all(a)}}class SEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const r=this.parser.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=r.extensions[this.name];return n.ior=a.ior!==void 0?a.ior:1.5,Promise.resolve()}}class wEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];n.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&a.push(i.assignTexture(n,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return n.specularColor=new Ut().setRGB(o[0],o[1],o[2],rh),s.specularColorTexture!==void 0&&a.push(i.assignTexture(n,"specularColorMap",s.specularColorTexture,um)),Promise.all(a)}}class EEe{constructor(e){this.parser=e,this.name=ki.EXT_MATERIALS_BUMP}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];return n.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&a.push(i.assignTexture(n,"bumpMap",s.bumpTexture)),Promise.all(a)}}class MEe{constructor(e){this.parser=e,this.name=ki.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Oc}extendMaterialParams(e,n){const i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const a=[],s=r.extensions[this.name];return s.anisotropyStrength!==void 0&&(n.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(n.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&a.push(i.assignTexture(n,"anisotropyMap",s.anisotropyTexture)),Promise.all(a)}}class TEe{constructor(e){this.parser=e,this.name=ki.KHR_TEXTURE_BASISU}loadTexture(e){const n=this.parser,i=n.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const a=r.extensions[this.name],s=n.options.ktx2Loader;if(!s){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,a.source,s)}}class AEe{constructor(e){this.parser=e,this.name=ki.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,i=this.parser,r=i.json,a=r.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=r.images[s.source];let l=i.textureLoader;if(o.uri){const c=i.options.manager.getHandler(o.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,s.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class CEe{constructor(e){this.parser=e,this.name=ki.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,i=this.parser,r=i.json,a=r.textures[e];if(!a.extensions||!a.extensions[n])return null;const s=a.extensions[n],o=r.images[s.source];let l=i.textureLoader;if(o.uri){const c=i.options.manager.getHandler(o.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,s.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class REe{constructor(e){this.name=ki.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,i=n.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],a=this.parser.getDependency("buffer",r.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(o){const l=r.byteOffset||0,c=r.byteLength||0,u=r.count,f=r.byteStride,h=new Uint8Array(o,l,c);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(u,f,h,r.mode,r.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(u*f);return s.decodeGltfBuffer(new Uint8Array(d),u,f,h,r.mode,r.filter),d})})}else return null}}class kEe{constructor(e){this.name=ki.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,i=n.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=n.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==Zl.TRIANGLES&&c.mode!==Zl.TRIANGLE_STRIP&&c.mode!==Zl.TRIANGLE_FAN&&c.mode!==void 0)return null;const s=i.extensions[this.name].attributes,o=[],l={};for(const c in s)o.push(this.parser.getDependency("accessor",s[c]).then(u=>(l[c]=u,l[c])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(c=>{const u=c.pop(),f=u.isGroup?u.children:[u],h=c[0].count,d=[];for(const g of f){const b=new Ot,y=new te,p=new Vn,x=new te(1,1,1),_=new KA(g.geometry,g.material,h);for(let w=0;w<h;w++)l.TRANSLATION&&y.fromBufferAttribute(l.TRANSLATION,w),l.ROTATION&&p.fromBufferAttribute(l.ROTATION,w),l.SCALE&&x.fromBufferAttribute(l.SCALE,w),_.setMatrixAt(w,b.compose(y,p,x));for(const w in l)if(w==="_COLOR_0"){const M=l[w];_.instanceColor=new of(M.array,M.itemSize,M.normalized)}else w!=="TRANSLATION"&&w!=="ROTATION"&&w!=="SCALE"&&g.geometry.setAttribute(w,l[w]);Ni.prototype.copy.call(_,g),this.parser.assignFinalMaterial(_),d.push(_)}return u.isGroup?(u.clear(),u.add(...d),u):d[0]}))}}const TZ="glTF",Ky=12,_5={JSON:1313821514,BIN:5130562};class DEe{constructor(e){this.name=ki.KHR_BINARY_GLTF,this.content=null,this.body=null;const n=new DataView(e,0,Ky);if(this.header={magic:oT(new Uint8Array(e.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==TZ)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Ky,r=new DataView(e,Ky);let a=0;for(;a<i;){const s=r.getUint32(a,!0);a+=4;const o=r.getUint32(a,!0);if(a+=4,o===_5.JSON){const l=new Uint8Array(e,Ky+a,s);this.content=oT(l)}else if(o===_5.BIN){const l=Ky+a;this.body=e.slice(l,l+s)}a+=s}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class OEe{constructor(e,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=ki.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=n,this.dracoLoader.preload()}decodePrimitive(e,n){const i=this.json,r=this.dracoLoader,a=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,o={},l={},c={};for(const u in s){const f=pI[u]||u.toLowerCase();o[f]=s[u]}for(const u in e.attributes){const f=pI[u]||u.toLowerCase();if(s[u]!==void 0){const h=i.accessors[e.attributes[u]],d=x0[h.componentType];c[f]=d.name,l[f]=h.normalized===!0}}return n.getDependency("bufferView",a).then(function(u){return new Promise(function(f,h){r.decodeDracoFile(u,function(d){for(const g in d.attributes){const b=d.attributes[g],y=l[g];y!==void 0&&(b.normalized=y)}f(d)},o,c,rh,h)})})}}class IEe{constructor(){this.name=ki.KHR_TEXTURE_TRANSFORM}extendTexture(e,n){return(n.texCoord===void 0||n.texCoord===e.channel)&&n.offset===void 0&&n.rotation===void 0&&n.scale===void 0||(e=e.clone(),n.texCoord!==void 0&&(e.channel=n.texCoord),n.offset!==void 0&&e.offset.fromArray(n.offset),n.rotation!==void 0&&(e.rotation=n.rotation),n.scale!==void 0&&e.repeat.fromArray(n.scale),e.needsUpdate=!0),e}}class NEe{constructor(){this.name=ki.KHR_MESH_QUANTIZATION}}class AZ extends Xv{constructor(e,n,i,r){super(e,n,i,r)}copySampleValue_(e){const n=this.resultBuffer,i=this.sampleValues,r=this.valueSize,a=e*r*3+r;for(let s=0;s!==r;s++)n[s]=i[a+s];return n}interpolate_(e,n,i,r){const a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,c=o*3,u=r-n,f=(i-n)/u,h=f*f,d=h*f,g=e*c,b=g-c,y=-2*d+3*h,p=d-h,x=1-y,_=p-h+f;for(let w=0;w!==o;w++){const M=s[b+w+o],S=s[b+w+l]*u,A=s[g+w+o],C=s[g+w]*u;a[w]=x*M+_*S+y*A+p*C}return a}}const LEe=new Vn;class PEe extends AZ{interpolate_(e,n,i,r){const a=super.interpolate_(e,n,i,r);return LEe.fromArray(a).normalize().toArray(a),a}}const Zl={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},x0={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},S5={9728:is,9729:Hi,9984:LA,9985:b0,9986:rm,9987:mc},w5={33071:ba,33648:K0,10497:zd},eD={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pI={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...X_>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Jh={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},UEe={CUBICSPLINE:void 0,LINEAR:ev,STEP:Q0},tD={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function FEe(t){return t.DefaultMaterial===void 0&&(t.DefaultMaterial=new qv({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:gu})),t.DefaultMaterial}function Ip(t,e,n){for(const i in n.extensions)t[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=n.extensions[i])}function Bf(t,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function BEe(t,e,n){let i=!1,r=!1,a=!1;for(let c=0,u=e.length;c<u;c++){const f=e[c];if(f.POSITION!==void 0&&(i=!0),f.NORMAL!==void 0&&(r=!0),f.COLOR_0!==void 0&&(a=!0),i&&r&&a)break}if(!i&&!r&&!a)return Promise.resolve(t);const s=[],o=[],l=[];for(let c=0,u=e.length;c<u;c++){const f=e[c];if(i){const h=f.POSITION!==void 0?n.getDependency("accessor",f.POSITION):t.attributes.position;s.push(h)}if(r){const h=f.NORMAL!==void 0?n.getDependency("accessor",f.NORMAL):t.attributes.normal;o.push(h)}if(a){const h=f.COLOR_0!==void 0?n.getDependency("accessor",f.COLOR_0):t.attributes.color;l.push(h)}}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(l)]).then(function(c){const u=c[0],f=c[1],h=c[2];return i&&(t.morphAttributes.position=u),r&&(t.morphAttributes.normal=f),a&&(t.morphAttributes.color=h),t.morphTargetsRelative=!0,t})}function zEe(t,e){if(t.updateMorphTargets(),e.weights!==void 0)for(let n=0,i=e.weights.length;n<i;n++)t.morphTargetInfluences[n]=e.weights[n];if(e.extras&&Array.isArray(e.extras.targetNames)){const n=e.extras.targetNames;if(t.morphTargetInfluences.length===n.length){t.morphTargetDictionary={};for(let i=0,r=n.length;i<r;i++)t.morphTargetDictionary[n[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function jEe(t){let e;const n=t.extensions&&t.extensions[ki.KHR_DRACO_MESH_COMPRESSION];if(n?e="draco:"+n.bufferView+":"+n.indices+":"+nD(n.attributes):e=t.indices+":"+nD(t.attributes)+":"+t.mode,t.targets!==void 0)for(let i=0,r=t.targets.length;i<r;i++)e+=":"+nD(t.targets[i]);return e}function nD(t){let e="";const n=Object.keys(t).sort();for(let i=0,r=n.length;i<r;i++)e+=n[i]+":"+t[n[i]]+";";return e}function mI(t){switch(t){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function HEe(t){return t.search(/\.jpe?g($|\?)/i)>0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const VEe=new Ot;class GEe{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new hEe,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,a=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,a=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&a<98?this.textureLoader=new lv(this.options.manager):this.textureLoader=new S$(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Os(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const i=this,r=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(s){const o={scene:s[0][r.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:r.asset,parser:i,userData:{}};return Ip(a,o,r),Bf(o,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(o)})).then(function(){for(const l of o.scenes)l.updateMatrixWorld();e(o)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],i=this.json.meshes||[];for(let r=0,a=n.length;r<a;r++){const s=n[r].joints;for(let o=0,l=s.length;o<l;o++)e[s[o]].isBone=!0}for(let r=0,a=e.length;r<a;r++){const s=e[r];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(i[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,n){n!==void 0&&(e.refs[n]===void 0&&(e.refs[n]=e.uses[n]=0),e.refs[n]++)}_getNodeRef(e,n,i){if(e.refs[n]<=1)return i;const r=i.clone(),a=(s,o)=>{const l=this.associations.get(s);l!=null&&this.associations.set(o,l);for(const[c,u]of s.children.entries())a(u,o.children[c])};return a(i,r),r.name+="_instance_"+e.uses[n]++,r}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let i=0;i<n.length;i++){const r=e(n[i]);if(r)return r}return null}_invokeAll(e){const n=Object.values(this.plugins);n.unshift(this);const i=[];for(let r=0;r<n.length;r++){const a=e(n[r]);a&&i.push(a)}return i}getDependency(e,n){const i=e+":"+n;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(n);break;case"node":r=this._invokeOne(function(a){return a.loadNode&&a.loadNode(n)});break;case"mesh":r=this._invokeOne(function(a){return a.loadMesh&&a.loadMesh(n)});break;case"accessor":r=this.loadAccessor(n);break;case"bufferView":r=this._invokeOne(function(a){return a.loadBufferView&&a.loadBufferView(n)});break;case"buffer":r=this.loadBuffer(n);break;case"material":r=this._invokeOne(function(a){return a.loadMaterial&&a.loadMaterial(n)});break;case"texture":r=this._invokeOne(function(a){return a.loadTexture&&a.loadTexture(n)});break;case"skin":r=this.loadSkin(n);break;case"animation":r=this._invokeOne(function(a){return a.loadAnimation&&a.loadAnimation(n)});break;case"camera":r=this.loadCamera(n);break;default:if(r=this._invokeOne(function(a){return a!=this&&a.getDependency&&a.getDependency(e,n)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(i,r)}return r}getDependencies(e){let n=this.cache.get(e);if(!n){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];n=Promise.all(r.map(function(a,s){return i.getDependency(e,s)})),this.cache.add(e,n)}return n}loadBuffer(e){const n=this.json.buffers[e],i=this.fileLoader;if(n.type&&n.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+n.type+" buffer type is not supported.");if(n.uri===void 0&&e===0)return Promise.resolve(this.extensions[ki.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(a,s){i.load(Dd.resolveURL(n.uri,r.path),a,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+n.uri+'".'))})})}loadBufferView(e){const n=this.json.bufferViews[e];return this.getDependency("buffer",n.buffer).then(function(i){const r=n.byteLength||0,a=n.byteOffset||0;return i.slice(a,a+r)})}loadAccessor(e){const n=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){const s=eD[r.type],o=x0[r.componentType],l=r.normalized===!0,c=new o(r.count*s);return Promise.resolve(new Nn(c,s,l))}const a=[];return r.bufferView!==void 0?a.push(this.getDependency("bufferView",r.bufferView)):a.push(null),r.sparse!==void 0&&(a.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(a).then(function(s){const o=s[0],l=eD[r.type],c=x0[r.componentType],u=c.BYTES_PER_ELEMENT,f=u*l,h=r.byteOffset||0,d=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,g=r.normalized===!0;let b,y;if(d&&d!==f){const p=Math.floor(h/d),x="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+p+":"+r.count;let _=n.cache.get(x);_||(b=new c(o,p*d,r.count*d/u),_=new F_(b,d/u),n.cache.add(x,_)),y=new Bo(_,l,h%d/u,g)}else o===null?b=new c(r.count*l):b=new c(o,h,r.count*l),y=new Nn(b,l,g);if(r.sparse!==void 0){const p=eD.SCALAR,x=x0[r.sparse.indices.componentType],_=r.sparse.indices.byteOffset||0,w=r.sparse.values.byteOffset||0,M=new x(s[1],_,r.sparse.count*p),S=new c(s[2],w,r.sparse.count*l);o!==null&&(y=new Nn(y.array.slice(),y.itemSize,y.normalized));for(let A=0,C=M.length;A<C;A++){const D=M[A];if(y.setX(D,S[A*l]),l>=2&&y.setY(D,S[A*l+1]),l>=3&&y.setZ(D,S[A*l+2]),l>=4&&y.setW(D,S[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(e){const n=this.json,i=this.options,a=n.textures[e].source,s=n.images[a];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,a,o)}loadTextureImage(e,n,i){const r=this,a=this.json,s=a.textures[e],o=a.images[n],l=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,i).then(function(u){u.flipY=!1,u.name=s.name||o.name||"",u.name===""&&typeof o.uri=="string"&&o.uri.startsWith("data:image/")===!1&&(u.name=o.uri);const h=(a.samplers||{})[s.sampler]||{};return u.magFilter=S5[h.magFilter]||Hi,u.minFilter=S5[h.minFilter]||mc,u.wrapS=w5[h.wrapS]||zd,u.wrapT=w5[h.wrapT]||zd,r.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const i=this,r=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const s=r.images[e],o=self.URL||self.webkitURL;let l=s.uri||"",c=!1;if(s.bufferView!==void 0)l=i.getDependency("bufferView",s.bufferView).then(function(f){c=!0;const h=new Blob([f],{type:s.mimeType});return l=o.createObjectURL(h),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(f){return new Promise(function(h,d){let g=h;n.isImageBitmapLoader===!0&&(g=function(b){const y=new nr(b);y.needsUpdate=!0,h(y)}),n.load(Dd.resolveURL(f,a.path),g,void 0,d)})}).then(function(f){return c===!0&&o.revokeObjectURL(l),Bf(f,s),f.userData.mimeType=s.mimeType||HEe(s.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=u,u}assignTexture(e,n,i,r){const a=this;return this.getDependency("texture",i.index).then(function(s){if(!s)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(s=s.clone(),s.channel=i.texCoord),a.extensions[ki.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[ki.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=a.associations.get(s);s=a.extensions[ki.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),a.associations.set(s,l)}}return r!==void 0&&(typeof r=="number"&&(r=r===x5?um:rh),"colorSpace"in s?s.colorSpace=r:s.encoding=r===um?x5:uEe),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let i=e.material;const r=n.attributes.tangent===void 0,a=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const o="PointsMaterial:"+i.uuid;let l=this.cache.get(o);l||(l=new JA,ka.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(o,l)),i=l}else if(e.isLine){const o="LineBasicMaterial:"+i.uuid;let l=this.cache.get(o);l||(l=new Us,ka.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(o,l)),i=l}if(r||a||s){let o="ClonedMaterial:"+i.uuid+":";r&&(o+="derivative-tangents:"),a&&(o+="vertex-colors:"),s&&(o+="flat-shading:");let l=this.cache.get(o);l||(l=i.clone(),a&&(l.vertexColors=!0),s&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(o,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return qv}loadMaterial(e){const n=this,i=this.json,r=this.extensions,a=i.materials[e];let s;const o={},l=a.extensions||{},c=[];if(l[ki.KHR_MATERIALS_UNLIT]){const f=r[ki.KHR_MATERIALS_UNLIT];s=f.getMaterialType(),c.push(f.extendParams(o,a,n))}else{const f=a.pbrMetallicRoughness||{};if(o.color=new Ut(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){const h=f.baseColorFactor;o.color.setRGB(h[0],h[1],h[2],rh),o.opacity=h[3]}f.baseColorTexture!==void 0&&c.push(n.assignTexture(o,"map",f.baseColorTexture,um)),o.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,o.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(o,"metalnessMap",f.metallicRoughnessTexture)),c.push(n.assignTexture(o,"roughnessMap",f.metallicRoughnessTexture))),s=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(e,o)})))}a.doubleSided===!0&&(o.side=Kr);const u=a.alphaMode||tD.OPAQUE;if(u===tD.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,u===tD.MASK&&(o.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&s!==Cs&&(c.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new wt(1,1),a.normalTexture.scale!==void 0)){const f=a.normalTexture.scale;o.normalScale.set(f,f)}if(a.occlusionTexture!==void 0&&s!==Cs&&(c.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&s!==Cs){const f=a.emissiveFactor;o.emissive=new Ut().setRGB(f[0],f[1],f[2],rh)}return a.emissiveTexture!==void 0&&s!==Cs&&c.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture,um)),Promise.all(c).then(function(){const f=new s(o);return a.name&&(f.name=a.name),Bf(f,a),n.associations.set(f,{materials:e}),a.extensions&&Ip(r,f,a),f})}createUniqueName(e){const n=Fi.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,i=this.extensions,r=this.primitiveCache;function a(o){return i[ki.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(o,n).then(function(l){return E5(l,o,n)})}const s=[];for(let o=0,l=e.length;o<l;o++){const c=e[o],u=jEe(c),f=r[u];if(f)s.push(f.promise);else{let h;c.extensions&&c.extensions[ki.KHR_DRACO_MESH_COMPRESSION]?h=a(c):h=E5(new Dn,c,n),r[u]={primitive:c,promise:h},s.push(h)}}return Promise.all(s)}loadMesh(e){const n=this,i=this.json,r=this.extensions,a=i.meshes[e],s=a.primitives,o=[];for(let l=0,c=s.length;l<c;l++){const u=s[l].material===void 0?FEe(this.cache):this.getDependency("material",s[l].material);o.push(u)}return o.push(n.loadGeometries(s)),Promise.all(o).then(function(l){const c=l.slice(0,l.length-1),u=l[l.length-1],f=[];for(let d=0,g=u.length;d<g;d++){const b=u[d],y=s[d];let p;const x=c[d];if(y.mode===Zl.TRIANGLES||y.mode===Zl.TRIANGLE_STRIP||y.mode===Zl.TRIANGLE_FAN||y.mode===void 0)p=a.isSkinnedMesh===!0?new XA(b,x):new _i(b,x),p.isSkinnedMesh===!0&&p.normalizeSkinWeights(),y.mode===Zl.TRIANGLE_STRIP?p.geometry=y5(p.geometry,PP):y.mode===Zl.TRIANGLE_FAN&&(p.geometry=y5(p.geometry,Y2));else if(y.mode===Zl.LINES)p=new Dc(b,x);else if(y.mode===Zl.LINE_STRIP)p=new gh(b,x);else if(y.mode===Zl.LINE_LOOP)p=new WP(b,x);else if(y.mode===Zl.POINTS)p=new qP(b,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+y.mode);Object.keys(p.geometry.morphAttributes).length>0&&zEe(p,a),p.name=n.createUniqueName(a.name||"mesh_"+e),Bf(p,a),y.extensions&&Ip(r,p,y),n.assignFinalMaterial(p),f.push(p)}for(let d=0,g=f.length;d<g;d++)n.associations.set(f[d],{meshes:e,primitives:d});if(f.length===1)return a.extensions&&Ip(r,f[0],a),f[0];const h=new bl;a.extensions&&Ip(r,h,a),n.associations.set(h,{meshes:e});for(let d=0,g=f.length;d<g;d++)h.add(f[d]);return h})}loadCamera(e){let n;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?n=new ta(gc.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(n=new Eh(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(n.name=this.createUniqueName(i.name)),Bf(n,i),Promise.resolve(n)}loadSkin(e){const n=this.json.skins[e],i=[];for(let r=0,a=n.joints.length;r<a;r++)i.push(this._loadNodeShallow(n.joints[r]));return n.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",n.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(r){const a=r.pop(),s=r,o=[],l=[];for(let c=0,u=s.length;c<u;c++){const f=s[c];if(f){o.push(f);const h=new Ot;a!==null&&h.fromArray(a.array,c*16),l.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',n.joints[c])}return new Vv(o,l)})}loadAnimation(e){const n=this.json,i=this,r=n.animations[e],a=r.name?r.name:"animation_"+e,s=[],o=[],l=[],c=[],u=[];for(let f=0,h=r.channels.length;f<h;f++){const d=r.channels[f],g=r.samplers[d.sampler],b=d.target,y=b.node,p=r.parameters!==void 0?r.parameters[g.input]:g.input,x=r.parameters!==void 0?r.parameters[g.output]:g.output;b.node!==void 0&&(s.push(this.getDependency("node",y)),o.push(this.getDependency("accessor",p)),l.push(this.getDependency("accessor",x)),c.push(g),u.push(b))}return Promise.all([Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(c),Promise.all(u)]).then(function(f){const h=f[0],d=f[1],g=f[2],b=f[3],y=f[4],p=[];for(let x=0,_=h.length;x<_;x++){const w=h[x],M=d[x],S=g[x],A=b[x],C=y[x];if(w===void 0)continue;w.updateMatrix&&w.updateMatrix();const D=i._createAnimationTracks(w,M,S,A,C);if(D)for(let R=0;R<D.length;R++)p.push(D[R])}return new ov(a,void 0,p)})}createNodeMesh(e){const n=this.json,i=this,r=n.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(a){const s=i._getNodeRef(i.meshCache,r.mesh,a);return r.weights!==void 0&&s.traverse(function(o){if(o.isMesh)for(let l=0,c=r.weights.length;l<c;l++)o.morphTargetInfluences[l]=r.weights[l]}),s})}loadNode(e){const n=this.json,i=this,r=n.nodes[e],a=i._loadNodeShallow(e),s=[],o=r.children||[];for(let c=0,u=o.length;c<u;c++)s.push(i.getDependency("node",o[c]));const l=r.skin===void 0?Promise.resolve(null):i.getDependency("skin",r.skin);return Promise.all([a,Promise.all(s),l]).then(function(c){const u=c[0],f=c[1],h=c[2];h!==null&&u.traverse(function(d){d.isSkinnedMesh&&d.bind(h,VEe)});for(let d=0,g=f.length;d<g;d++)u.add(f[d]);return u})}_loadNodeShallow(e){const n=this.json,i=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const a=n.nodes[e],s=a.name?r.createUniqueName(a.name):"",o=[],l=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return l&&o.push(l),a.camera!==void 0&&o.push(r.getDependency("camera",a.camera).then(function(c){return r._getNodeRef(r.cameraCache,a.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){o.push(c)}),this.nodeCache[e]=Promise.all(o).then(function(c){let u;if(a.isBone===!0?u=new B_:c.length>1?u=new bl:c.length===1?u=c[0]:u=new Ni,u!==c[0])for(let f=0,h=c.length;f<h;f++)u.add(c[f]);if(a.name&&(u.userData.name=a.name,u.name=s),Bf(u,a),a.extensions&&Ip(i,u,a),a.matrix!==void 0){const f=new Ot;f.fromArray(a.matrix),u.applyMatrix4(f)}else a.translation!==void 0&&u.position.fromArray(a.translation),a.rotation!==void 0&&u.quaternion.fromArray(a.rotation),a.scale!==void 0&&u.scale.fromArray(a.scale);return r.associations.has(u)||r.associations.set(u,{}),r.associations.get(u).nodes=e,u}),this.nodeCache[e]}loadScene(e){const n=this.extensions,i=this.json.scenes[e],r=this,a=new bl;i.name&&(a.name=r.createUniqueName(i.name)),Bf(a,i),i.extensions&&Ip(n,a,i);const s=i.nodes||[],o=[];for(let l=0,c=s.length;l<c;l++)o.push(r.getDependency("node",s[l]));return Promise.all(o).then(function(l){for(let u=0,f=l.length;u<f;u++)a.add(l[u]);const c=u=>{const f=new Map;for(const[h,d]of r.associations)(h instanceof ka||h instanceof nr)&&f.set(h,d);return u.traverse(h=>{const d=r.associations.get(h);d!=null&&f.set(h,d)}),f};return r.associations=c(a),a})}_createAnimationTracks(e,n,i,r,a){const s=[],o=e.name?e.name:e.uuid,l=[];Jh[a.path]===Jh.weights?e.traverse(function(h){h.morphTargetInfluences&&l.push(h.name?h.name:h.uuid)}):l.push(o);let c;switch(Jh[a.path]){case Jh.weights:c=Vm;break;case Jh.rotation:c=Gm;break;case Jh.position:case Jh.scale:c=Wm;break;default:switch(i.itemSize){case 1:c=Vm;break;case 2:case 3:default:c=Wm;break}break}const u=r.interpolation!==void 0?UEe[r.interpolation]:ev,f=this._getArrayFromAccessor(i);for(let h=0,d=l.length;h<d;h++){const g=new c(l[h]+"."+Jh[a.path],n.array,f,u);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(g),s.push(g)}return s}_getArrayFromAccessor(e){let n=e.array;if(e.normalized){const i=mI(n.constructor),r=new Float32Array(n.length);for(let a=0,s=n.length;a<s;a++)r[a]=n[a]*i;n=r}return n}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(i){const r=this instanceof Gm?PEe:AZ;return new r(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function WEe(t,e,n){const i=e.attributes,r=new rr;if(i.POSITION!==void 0){const o=n.json.accessors[i.POSITION],l=o.min,c=o.max;if(l!==void 0&&c!==void 0){if(r.set(new te(l[0],l[1],l[2]),new te(c[0],c[1],c[2])),o.normalized){const u=mI(x0[o.componentType]);r.min.multiplyScalar(u),r.max.multiplyScalar(u)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const a=e.targets;if(a!==void 0){const o=new te,l=new te;for(let c=0,u=a.length;c<u;c++){const f=a[c];if(f.POSITION!==void 0){const h=n.json.accessors[f.POSITION],d=h.min,g=h.max;if(d!==void 0&&g!==void 0){if(l.setX(Math.max(Math.abs(d[0]),Math.abs(g[0]))),l.setY(Math.max(Math.abs(d[1]),Math.abs(g[1]))),l.setZ(Math.max(Math.abs(d[2]),Math.abs(g[2]))),h.normalized){const b=mI(x0[h.componentType]);l.multiplyScalar(b)}o.max(l)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(o)}t.boundingBox=r;const s=new Ir;r.getCenter(s.center),s.radius=r.min.distanceTo(r.max)/2,t.boundingSphere=s}function E5(t,e,n){const i=e.attributes,r=[];function a(s,o){return n.getDependency("accessor",s).then(function(l){t.setAttribute(o,l)})}for(const s in i){const o=pI[s]||s.toLowerCase();o in t.attributes||r.push(a(i[s],o))}if(e.indices!==void 0&&!t.index){const s=n.getDependency("accessor",e.indices).then(function(o){t.setIndex(o)});r.push(s)}return Bf(t,e),WEe(t,e,n),Promise.all(r).then(function(){return e.targets!==void 0?BEe(t,e.targets,n):t})}class qEe extends sU{constructor(e){super(e),this.type=ts}parse(e){const s=function(C,D){switch(C){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(D||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(D||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(D||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(D||""))}},u=`
`,f=function(C,D,R){D=D||1024;let U=C.pos,j=-1,z=0,q="",B=String.fromCharCode.apply(null,new Uint16Array(C.subarray(U,U+128)));for(;0>(j=B.indexOf(u))&&z<D&&U<C.byteLength;)q+=B,z+=B.length,U+=128,B+=String.fromCharCode.apply(null,new Uint16Array(C.subarray(U,U+128)));return-1<j?(C.pos+=z+j+1,q+B.slice(0,j)):!1},h=function(C){const D=/^#\?(\S+)/,R=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,N=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,U=/^\s*FORMAT=(\S+)\s*$/,j=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,z={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let q,B;for((C.pos>=C.byteLength||!(q=f(C)))&&s(1,"no header found"),(B=q.match(D))||s(3,"bad initial token"),z.valid|=1,z.programtype=B[1],z.string+=q+`
`;q=f(C),q!==!1;){if(z.string+=q+`
`,q.charAt(0)==="#"){z.comments+=q+`
`;continue}if((B=q.match(R))&&(z.gamma=parseFloat(B[1])),(B=q.match(N))&&(z.exposure=parseFloat(B[1])),(B=q.match(U))&&(z.valid|=2,z.format=B[1]),(B=q.match(j))&&(z.valid|=4,z.height=parseInt(B[1],10),z.width=parseInt(B[2],10)),z.valid&2&&z.valid&4)break}return z.valid&2||s(3,"missing format specifier"),z.valid&4||s(3,"missing image size specifier"),z},d=function(C,D,R){const N=D;if(N<8||N>32767||C[0]!==2||C[1]!==2||C[2]&128)return new Uint8Array(C);N!==(C[2]<<8|C[3])&&s(3,"wrong scanline width");const U=new Uint8Array(4*D*R);U.length||s(4,"unable to allocate buffer space");let j=0,z=0;const q=4*N,B=new Uint8Array(4),G=new Uint8Array(q);let H=R;for(;H>0&&z<C.byteLength;){z+4>C.byteLength&&s(1),B[0]=C[z++],B[1]=C[z++],B[2]=C[z++],B[3]=C[z++],(B[0]!=2||B[1]!=2||(B[2]<<8|B[3])!=N)&&s(3,"bad rgbe scanline format");let W=0,F;for(;W<q&&z<C.byteLength;){F=C[z++];const Z=F>128;if(Z&&(F-=128),(F===0||W+F>q)&&s(3,"bad scanline data"),Z){const V=C[z++];for(let de=0;de<F;de++)G[W++]=V}else G.set(C.subarray(z,z+F),W),W+=F,z+=F}const Y=N;for(let Z=0;Z<Y;Z++){let V=0;U[j]=G[Z+V],V+=N,U[j+1]=G[Z+V],V+=N,U[j+2]=G[Z+V],V+=N,U[j+3]=G[Z+V],j+=4}H--}return U},g=function(C,D,R,N){const U=C[D+3],j=Math.pow(2,U-128)/255;R[N+0]=C[D+0]*j,R[N+1]=C[D+1]*j,R[N+2]=C[D+2]*j,R[N+3]=1},b=function(C,D,R,N){const U=C[D+3],j=Math.pow(2,U-128)/255;R[N+0]=om.toHalfFloat(Math.min(C[D+0]*j,65504)),R[N+1]=om.toHalfFloat(Math.min(C[D+1]*j,65504)),R[N+2]=om.toHalfFloat(Math.min(C[D+2]*j,65504)),R[N+3]=om.toHalfFloat(1)},y=new Uint8Array(e);y.pos=0;const p=h(y),x=p.width,_=p.height,w=d(y.subarray(y.pos),x,_);let M,S,A;switch(this.type){case yr:A=w.length/4;const C=new Float32Array(A*4);for(let R=0;R<A;R++)g(w,R*4,C,R*4);M=C,S=yr;break;case ts:A=w.length/4;const D=new Uint16Array(A*4);for(let R=0;R<A;R++)b(w,R*4,D,R*4);M=D,S=ts;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:x,height:_,data:M,header:p.string,gamma:p.gamma,exposure:p.exposure,type:S}}setDataType(e){return this.type=e,this}load(e,n,i,r){function a(s,o){switch(s.type){case yr:case ts:"colorSpace"in s?s.colorSpace="srgb-linear":s.encoding=3e3,s.minFilter=Hi,s.magFilter=Hi,s.generateMipmaps=!1,s.flipY=!0;break}n&&n(s,o)}return super.load(e,a,i,r)}}const Yy=X_>=152;class XEe extends sU{constructor(e){super(e),this.type=ts}parse(e){const D=Math.pow(2.7182818,2.2);function R(re,ge){for(var je=0,rt=0;rt<65536;++rt)(rt==0||re[rt>>3]&1<<(rt&7))&&(ge[je++]=rt);for(var dt=je-1;je<65536;)ge[je++]=0;return dt}function N(re){for(var ge=0;ge<16384;ge++)re[ge]={},re[ge].len=0,re[ge].lit=0,re[ge].p=null}const U={l:0,c:0,lc:0};function j(re,ge,je,rt,dt){for(;je<re;)ge=ge<<8|xt(rt,dt),je+=8;je-=re,U.l=ge>>je&(1<<re)-1,U.c=ge,U.lc=je}const z=new Array(59);function q(re){for(var ge=0;ge<=58;++ge)z[ge]=0;for(var ge=0;ge<65537;++ge)z[re[ge]]+=1;for(var je=0,ge=58;ge>0;--ge){var rt=je+z[ge]>>1;z[ge]=je,je=rt}for(var ge=0;ge<65537;++ge){var dt=re[ge];dt>0&&(re[ge]=dt|z[dt]++<<6)}}function B(re,ge,je,rt,dt,ot,kt){for(var ee=je,ye=0,Ce=0;dt<=ot;dt++){if(ee.value-je.value>rt)return!1;j(6,ye,Ce,re,ee);var De=U.l;if(ye=U.c,Ce=U.lc,kt[dt]=De,De==63){if(ee.value-je.value>rt)throw"Something wrong with hufUnpackEncTable";j(8,ye,Ce,re,ee);var ve=U.l+6;if(ye=U.c,Ce=U.lc,dt+ve>ot+1)throw"Something wrong with hufUnpackEncTable";for(;ve--;)kt[dt++]=0;dt--}else if(De>=59){var ve=De-59+2;if(dt+ve>ot+1)throw"Something wrong with hufUnpackEncTable";for(;ve--;)kt[dt++]=0;dt--}}q(kt)}function G(re){return re&63}function H(re){return re>>6}function W(re,ge,je,rt){for(;ge<=je;ge++){var dt=H(re[ge]),ot=G(re[ge]);if(dt>>ot)throw"Invalid table entry";if(ot>14){var kt=rt[dt>>ot-14];if(kt.len)throw"Invalid table entry";if(kt.lit++,kt.p){var ee=kt.p;kt.p=new Array(kt.lit);for(var ye=0;ye<kt.lit-1;++ye)kt.p[ye]=ee[ye]}else kt.p=new Array(1);kt.p[kt.lit-1]=ge}else if(ot)for(var Ce=0,ye=1<<14-ot;ye>0;ye--){var kt=rt[(dt<<14-ot)+Ce];if(kt.len||kt.p)throw"Invalid table entry";kt.len=ot,kt.lit=ge,Ce++}}return!0}const F={c:0,lc:0};function Y(re,ge,je,rt){re=re<<8|xt(je,rt),ge+=8,F.c=re,F.lc=ge}const Z={c:0,lc:0};function V(re,ge,je,rt,dt,ot,kt,ee,ye,Ce){if(re==ge){rt<8&&(Y(je,rt,dt,kt),je=F.c,rt=F.lc),rt-=8;var De=je>>rt,De=new Uint8Array([De])[0];if(ye.value+De>Ce)return!1;for(var ve=ee[ye.value-1];De-- >0;)ee[ye.value++]=ve}else if(ye.value<Ce)ee[ye.value++]=re;else return!1;Z.c=je,Z.lc=rt}function de(re){return re&65535}function se(re){var ge=de(re);return ge>32767?ge-65536:ge}const oe={a:0,b:0};function ue(re,ge){var je=se(re),rt=se(ge),dt=rt,ot=je+(dt&1)+(dt>>1),kt=ot,ee=ot-dt;oe.a=kt,oe.b=ee}function _e(re,ge){var je=de(re),rt=de(ge),dt=je-(rt>>1)&65535,ot=rt+dt-32768&65535;oe.a=ot,oe.b=dt}function ke(re,ge,je,rt,dt,ot,kt){for(var ee=kt<16384,ye=je>dt?dt:je,Ce=1,De;Ce<=ye;)Ce<<=1;for(Ce>>=1,De=Ce,Ce>>=1;Ce>=1;){for(var ve=0,_t=ve+ot*(dt-De),lt=ot*Ce,yt=ot*De,St=rt*Ce,Nt=rt*De,Ht,at,nn,un;ve<=_t;ve+=yt){for(var dn=ve,On=ve+rt*(je-De);dn<=On;dn+=Nt){var $t=dn+St,Yt=dn+lt,Pn=Yt+St;ee?(ue(re[dn+ge],re[Yt+ge]),Ht=oe.a,nn=oe.b,ue(re[$t+ge],re[Pn+ge]),at=oe.a,un=oe.b,ue(Ht,at),re[dn+ge]=oe.a,re[$t+ge]=oe.b,ue(nn,un),re[Yt+ge]=oe.a,re[Pn+ge]=oe.b):(_e(re[dn+ge],re[Yt+ge]),Ht=oe.a,nn=oe.b,_e(re[$t+ge],re[Pn+ge]),at=oe.a,un=oe.b,_e(Ht,at),re[dn+ge]=oe.a,re[$t+ge]=oe.b,_e(nn,un),re[Yt+ge]=oe.a,re[Pn+ge]=oe.b)}if(je&Ce){var Yt=dn+lt;ee?ue(re[dn+ge],re[Yt+ge]):_e(re[dn+ge],re[Yt+ge]),Ht=oe.a,re[Yt+ge]=oe.b,re[dn+ge]=Ht}}if(dt&Ce)for(var dn=ve,On=ve+rt*(je-De);dn<=On;dn+=Nt){var $t=dn+St;ee?ue(re[dn+ge],re[$t+ge]):_e(re[dn+ge],re[$t+ge]),Ht=oe.a,re[$t+ge]=oe.b,re[dn+ge]=Ht}De=Ce,Ce>>=1}return ve}function Ne(re,ge,je,rt,dt,ot,kt,ee,ye,Ce){for(var De=0,ve=0,_t=ee,lt=Math.trunc(dt.value+(ot+7)/8);dt.value<lt;)for(Y(De,ve,je,dt),De=F.c,ve=F.lc;ve>=14;){var yt=De>>ve-14&16383,St=ge[yt];if(St.len)ve-=St.len,V(St.lit,kt,De,ve,je,rt,dt,ye,Ce,_t),De=Z.c,ve=Z.lc;else{if(!St.p)throw"hufDecode issues";var Nt;for(Nt=0;Nt<St.lit;Nt++){for(var Ht=G(re[St.p[Nt]]);ve<Ht&&dt.value<lt;)Y(De,ve,je,dt),De=F.c,ve=F.lc;if(ve>=Ht&&H(re[St.p[Nt]])==(De>>ve-Ht&(1<<Ht)-1)){ve-=Ht,V(St.p[Nt],kt,De,ve,je,rt,dt,ye,Ce,_t),De=Z.c,ve=Z.lc;break}}if(Nt==St.lit)throw"hufDecode issues"}}var at=8-ot&7;for(De>>=at,ve-=at;ve>0;){var St=ge[De<<14-ve&16383];if(St.len)ve-=St.len,V(St.lit,kt,De,ve,je,rt,dt,ye,Ce,_t),De=Z.c,ve=Z.lc;else throw"hufDecode issues"}return!0}function Ue(re,ge,je,rt,dt,ot){var kt={value:0},ee=je.value,ye=tt(ge,je),Ce=tt(ge,je);je.value+=4;var De=tt(ge,je);if(je.value+=4,ye<0||ye>=65537||Ce<0||Ce>=65537)throw"Something wrong with HUF_ENCSIZE";var ve=new Array(65537),_t=new Array(16384);N(_t);var lt=rt-(je.value-ee);if(B(re,ge,je,lt,ye,Ce,ve),De>8*(rt-(je.value-ee)))throw"Something wrong with hufUncompress";W(ve,ye,Ce,_t),Ne(ve,_t,re,ge,je,De,Ce,ot,dt,kt)}function ze(re,ge,je){for(var rt=0;rt<je;++rt)ge[rt]=re[ge[rt]]}function pe(re){for(var ge=1;ge<re.length;ge++){var je=re[ge-1]+re[ge]-128;re[ge]=je}}function Fe(re,ge){for(var je=0,rt=Math.floor((re.length+1)/2),dt=0,ot=re.length-1;!(dt>ot||(ge[dt++]=re[je++],dt>ot));)ge[dt++]=re[rt++]}function Ie(re){for(var ge=re.byteLength,je=new Array,rt=0,dt=new DataView(re);ge>0;){var ot=dt.getInt8(rt++);if(ot<0){var kt=-ot;ge-=kt+1;for(var ee=0;ee<kt;ee++)je.push(dt.getUint8(rt++))}else{var kt=ot;ge-=2;for(var ye=dt.getUint8(rt++),ee=0;ee<kt+1;ee++)je.push(ye)}}return je}function qe(re,ge,je,rt,dt,ot){var $t=new DataView(ot.buffer),kt=je[re.idx[0]].width,ee=je[re.idx[0]].height,ye=3,Ce=Math.floor(kt/8),De=Math.ceil(kt/8),ve=Math.ceil(ee/8),_t=kt-(De-1)*8,lt=ee-(ve-1)*8,yt={value:0},St=new Array(ye),Nt=new Array(ye),Ht=new Array(ye),at=new Array(ye),nn=new Array(ye);for(let En=0;En<ye;++En)nn[En]=ge[re.idx[En]],St[En]=En<1?0:St[En-1]+De*ve,Nt[En]=new Float32Array(64),Ht[En]=new Uint16Array(64),at[En]=new Uint16Array(De*64);for(let En=0;En<ve;++En){var un=8;En==ve-1&&(un=lt);var dn=8;for(let pn=0;pn<De;++pn){pn==De-1&&(dn=_t);for(let rn=0;rn<ye;++rn)Ht[rn].fill(0),Ht[rn][0]=dt[St[rn]++],we(yt,rt,Ht[rn]),Te(Ht[rn],Nt[rn]),Ae(Nt[rn]);Pe(Nt);for(let rn=0;rn<ye;++rn)He(Nt[rn],at[rn],pn*64)}let Mn=0;for(let pn=0;pn<ye;++pn){const rn=je[re.idx[pn]].type;for(let yi=8*En;yi<8*En+un;++yi){Mn=nn[pn][yi];for(let Li=0;Li<Ce;++Li){const Wn=Li*64+(yi&7)*8;$t.setUint16(Mn+0*2*rn,at[pn][Wn+0],!0),$t.setUint16(Mn+1*2*rn,at[pn][Wn+1],!0),$t.setUint16(Mn+2*2*rn,at[pn][Wn+2],!0),$t.setUint16(Mn+3*2*rn,at[pn][Wn+3],!0),$t.setUint16(Mn+4*2*rn,at[pn][Wn+4],!0),$t.setUint16(Mn+5*2*rn,at[pn][Wn+5],!0),$t.setUint16(Mn+6*2*rn,at[pn][Wn+6],!0),$t.setUint16(Mn+7*2*rn,at[pn][Wn+7],!0),Mn+=8*2*rn}}if(Ce!=De)for(let yi=8*En;yi<8*En+un;++yi){const Li=nn[pn][yi]+8*Ce*2*rn,Wn=Ce*64+(yi&7)*8;for(let Oi=0;Oi<dn;++Oi)$t.setUint16(Li+Oi*2*rn,at[pn][Wn+Oi],!0)}}}for(var On=new Uint16Array(kt),$t=new DataView(ot.buffer),Yt=0;Yt<ye;++Yt){je[re.idx[Yt]].decoded=!0;var Pn=je[re.idx[Yt]].type;if(je[Yt].type==2)for(var wn=0;wn<ee;++wn){const En=nn[Yt][wn];for(var Xn=0;Xn<kt;++Xn)On[Xn]=$t.getUint16(En+Xn*2*Pn,!0);for(var Xn=0;Xn<kt;++Xn)$t.setFloat32(En+Xn*2*Pn,Ve(On[Xn]),!0)}}}function we(re,ge,je){for(var rt,dt=1;dt<64;)rt=ge[re.value],rt==65280?dt=64:rt>>8==255?dt+=rt&255:(je[dt]=rt,dt++),re.value++}function Te(re,ge){ge[0]=Ve(re[0]),ge[1]=Ve(re[1]),ge[2]=Ve(re[5]),ge[3]=Ve(re[6]),ge[4]=Ve(re[14]),ge[5]=Ve(re[15]),ge[6]=Ve(re[27]),ge[7]=Ve(re[28]),ge[8]=Ve(re[2]),ge[9]=Ve(re[4]),ge[10]=Ve(re[7]),ge[11]=Ve(re[13]),ge[12]=Ve(re[16]),ge[13]=Ve(re[26]),ge[14]=Ve(re[29]),ge[15]=Ve(re[42]),ge[16]=Ve(re[3]),ge[17]=Ve(re[8]),ge[18]=Ve(re[12]),ge[19]=Ve(re[17]),ge[20]=Ve(re[25]),ge[21]=Ve(re[30]),ge[22]=Ve(re[41]),ge[23]=Ve(re[43]),ge[24]=Ve(re[9]),ge[25]=Ve(re[11]),ge[26]=Ve(re[18]),ge[27]=Ve(re[24]),ge[28]=Ve(re[31]),ge[29]=Ve(re[40]),ge[30]=Ve(re[44]),ge[31]=Ve(re[53]),ge[32]=Ve(re[10]),ge[33]=Ve(re[19]),ge[34]=Ve(re[23]),ge[35]=Ve(re[32]),ge[36]=Ve(re[39]),ge[37]=Ve(re[45]),ge[38]=Ve(re[52]),ge[39]=Ve(re[54]),ge[40]=Ve(re[20]),ge[41]=Ve(re[22]),ge[42]=Ve(re[33]),ge[43]=Ve(re[38]),ge[44]=Ve(re[46]),ge[45]=Ve(re[51]),ge[46]=Ve(re[55]),ge[47]=Ve(re[60]),ge[48]=Ve(re[21]),ge[49]=Ve(re[34]),ge[50]=Ve(re[37]),ge[51]=Ve(re[47]),ge[52]=Ve(re[50]),ge[53]=Ve(re[56]),ge[54]=Ve(re[59]),ge[55]=Ve(re[61]),ge[56]=Ve(re[35]),ge[57]=Ve(re[36]),ge[58]=Ve(re[48]),ge[59]=Ve(re[49]),ge[60]=Ve(re[57]),ge[61]=Ve(re[58]),ge[62]=Ve(re[62]),ge[63]=Ve(re[63])}function Ae(re){const ge=.5*Math.cos(.7853975),je=.5*Math.cos(3.14159/16),rt=.5*Math.cos(3.14159/8),dt=.5*Math.cos(3*3.14159/16),ot=.5*Math.cos(5*3.14159/16),kt=.5*Math.cos(3*3.14159/8),ee=.5*Math.cos(7*3.14159/16);for(var ye=new Array(4),Ce=new Array(4),De=new Array(4),ve=new Array(4),_t=0;_t<8;++_t){var lt=_t*8;ye[0]=rt*re[lt+2],ye[1]=kt*re[lt+2],ye[2]=rt*re[lt+6],ye[3]=kt*re[lt+6],Ce[0]=je*re[lt+1]+dt*re[lt+3]+ot*re[lt+5]+ee*re[lt+7],Ce[1]=dt*re[lt+1]-ee*re[lt+3]-je*re[lt+5]-ot*re[lt+7],Ce[2]=ot*re[lt+1]-je*re[lt+3]+ee*re[lt+5]+dt*re[lt+7],Ce[3]=ee*re[lt+1]-ot*re[lt+3]+dt*re[lt+5]-je*re[lt+7],De[0]=ge*(re[lt+0]+re[lt+4]),De[3]=ge*(re[lt+0]-re[lt+4]),De[1]=ye[0]+ye[3],De[2]=ye[1]-ye[2],ve[0]=De[0]+De[1],ve[1]=De[3]+De[2],ve[2]=De[3]-De[2],ve[3]=De[0]-De[1],re[lt+0]=ve[0]+Ce[0],re[lt+1]=ve[1]+Ce[1],re[lt+2]=ve[2]+Ce[2],re[lt+3]=ve[3]+Ce[3],re[lt+4]=ve[3]-Ce[3],re[lt+5]=ve[2]-Ce[2],re[lt+6]=ve[1]-Ce[1],re[lt+7]=ve[0]-Ce[0]}for(var yt=0;yt<8;++yt)ye[0]=rt*re[16+yt],ye[1]=kt*re[16+yt],ye[2]=rt*re[48+yt],ye[3]=kt*re[48+yt],Ce[0]=je*re[8+yt]+dt*re[24+yt]+ot*re[40+yt]+ee*re[56+yt],Ce[1]=dt*re[8+yt]-ee*re[24+yt]-je*re[40+yt]-ot*re[56+yt],Ce[2]=ot*re[8+yt]-je*re[24+yt]+ee*re[40+yt]+dt*re[56+yt],Ce[3]=ee*re[8+yt]-ot*re[24+yt]+dt*re[40+yt]-je*re[56+yt],De[0]=ge*(re[yt]+re[32+yt]),De[3]=ge*(re[yt]-re[32+yt]),De[1]=ye[0]+ye[3],De[2]=ye[1]-ye[2],ve[0]=De[0]+De[1],ve[1]=De[3]+De[2],ve[2]=De[3]-De[2],ve[3]=De[0]-De[1],re[0+yt]=ve[0]+Ce[0],re[8+yt]=ve[1]+Ce[1],re[16+yt]=ve[2]+Ce[2],re[24+yt]=ve[3]+Ce[3],re[32+yt]=ve[3]-Ce[3],re[40+yt]=ve[2]-Ce[2],re[48+yt]=ve[1]-Ce[1],re[56+yt]=ve[0]-Ce[0]}function Pe(re){for(var ge=0;ge<64;++ge){var je=re[0][ge],rt=re[1][ge],dt=re[2][ge];re[0][ge]=je+1.5747*dt,re[1][ge]=je-.1873*rt-.4682*dt,re[2][ge]=je+1.8556*rt}}function He(re,ge,je){for(var rt=0;rt<64;++rt)ge[je+rt]=om.toHalfFloat($e(re[rt]))}function $e(re){return re<=1?Math.sign(re)*Math.pow(Math.abs(re),2.2):Math.sign(re)*Math.pow(D,Math.abs(re)-1)}function ie(re){return new DataView(re.array.buffer,re.offset.value,re.size)}function K(re){var ge=re.viewer.buffer.slice(re.offset.value,re.offset.value+re.size),je=new Uint8Array(Ie(ge)),rt=new Uint8Array(je.length);return pe(je),Fe(je,rt),new DataView(rt.buffer)}function ce(re){var ge=re.array.slice(re.offset.value,re.offset.value+re.size),je=Qw(ge),rt=new Uint8Array(je.length);return pe(je),Fe(je,rt),new DataView(rt.buffer)}function fe(re){for(var ge=re.viewer,je={value:re.offset.value},rt=new Uint16Array(re.width*re.scanlineBlockSize*(re.channels*re.type)),dt=new Uint8Array(8192),ot=0,kt=new Array(re.channels),ee=0;ee<re.channels;ee++)kt[ee]={},kt[ee].start=ot,kt[ee].end=kt[ee].start,kt[ee].nx=re.width,kt[ee].ny=re.lines,kt[ee].size=re.type,ot+=kt[ee].nx*kt[ee].ny*kt[ee].size;var ye=ht(ge,je),Ce=ht(ge,je);if(Ce>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(ye<=Ce)for(var ee=0;ee<Ce-ye+1;ee++)dt[ee+ye]=Tt(ge,je);var De=new Uint16Array(65536),ve=R(dt,De),_t=tt(ge,je);Ue(re.array,ge,je,_t,rt,ot);for(var ee=0;ee<re.channels;++ee)for(var lt=kt[ee],yt=0;yt<kt[ee].size;++yt)ke(rt,lt.start+yt,lt.nx,lt.size,lt.ny,lt.nx*lt.size,ve);ze(De,rt,ot);for(var St=0,Nt=new Uint8Array(rt.buffer.byteLength),Ht=0;Ht<re.lines;Ht++)for(var at=0;at<re.channels;at++){var lt=kt[at],nn=lt.nx*lt.size,un=new Uint8Array(rt.buffer,lt.end*2,nn*2);Nt.set(un,St),St+=nn*2,lt.end+=nn}return new DataView(Nt.buffer)}function me(re){var ge=re.array.slice(re.offset.value,re.offset.value+re.size),je=Qw(ge);const rt=re.lines*re.channels*re.width,dt=re.type==1?new Uint16Array(rt):new Uint32Array(rt);let ot=0,kt=0;const ee=new Array(4);for(let ye=0;ye<re.lines;ye++)for(let Ce=0;Ce<re.channels;Ce++){let De=0;switch(re.type){case 1:ee[0]=ot,ee[1]=ee[0]+re.width,ot=ee[1]+re.width;for(let ve=0;ve<re.width;++ve){const _t=je[ee[0]++]<<8|je[ee[1]++];De+=_t,dt[kt]=De,kt++}break;case 2:ee[0]=ot,ee[1]=ee[0]+re.width,ee[2]=ee[1]+re.width,ot=ee[2]+re.width;for(let ve=0;ve<re.width;++ve){const _t=je[ee[0]++]<<24|je[ee[1]++]<<16|je[ee[2]++]<<8;De+=_t,dt[kt]=De,kt++}break}}return new DataView(dt.buffer)}function $(re){var ge=re.viewer,je={value:re.offset.value},rt=new Uint8Array(re.width*re.lines*(re.channels*re.type*2)),dt={version:bt(ge,je),unknownUncompressedSize:bt(ge,je),unknownCompressedSize:bt(ge,je),acCompressedSize:bt(ge,je),dcCompressedSize:bt(ge,je),rleCompressedSize:bt(ge,je),rleUncompressedSize:bt(ge,je),rleRawSize:bt(ge,je),totalAcUncompressedCount:bt(ge,je),totalDcUncompressedCount:bt(ge,je),acCompression:bt(ge,je)};if(dt.version<2)throw"EXRLoader.parse: "+ci.compression+" version "+dt.version+" is unsupported";for(var ot=new Array,kt=ht(ge,je)-2;kt>0;){var ee=Le(ge.buffer,je),ye=Tt(ge,je),Ce=ye>>2&3,De=(ye>>4)-1,ve=new Int8Array([De])[0],_t=Tt(ge,je);ot.push({name:ee,index:ve,type:_t,compression:Ce}),kt-=ee.length+3}for(var lt=ci.channels,yt=new Array(re.channels),St=0;St<re.channels;++St){var Nt=yt[St]={},Ht=lt[St];Nt.name=Ht.name,Nt.compression=0,Nt.decoded=!1,Nt.type=Ht.pixelType,Nt.pLinear=Ht.pLinear,Nt.width=re.width,Nt.height=re.lines}for(var at={idx:new Array(3)},nn=0;nn<re.channels;++nn)for(var Nt=yt[nn],St=0;St<ot.length;++St){var un=ot[St];Nt.name==un.name&&(Nt.compression=un.compression,un.index>=0&&(at.idx[un.index]=nn),Nt.offset=nn)}if(dt.acCompressedSize>0)switch(dt.acCompression){case 0:var $t=new Uint16Array(dt.totalAcUncompressedCount);Ue(re.array,ge,je,dt.acCompressedSize,$t,dt.totalAcUncompressedCount);break;case 1:var dn=re.array.slice(je.value,je.value+dt.totalAcUncompressedCount),On=Qw(dn),$t=new Uint16Array(On.buffer);je.value+=dt.totalAcUncompressedCount;break}if(dt.dcCompressedSize>0){var Yt={array:re.array,offset:je,size:dt.dcCompressedSize},Pn=new Uint16Array(ce(Yt).buffer);je.value+=dt.dcCompressedSize}if(dt.rleRawSize>0){var dn=re.array.slice(je.value,je.value+dt.rleCompressedSize),On=Qw(dn),wn=Ie(On.buffer);je.value+=dt.rleCompressedSize}for(var Xn=0,En=new Array(yt.length),St=0;St<En.length;++St)En[St]=new Array;for(var Mn=0;Mn<re.lines;++Mn)for(var pn=0;pn<yt.length;++pn)En[pn].push(Xn),Xn+=yt[pn].width*re.type*2;qe(at,En,yt,$t,Pn,rt);for(var St=0;St<yt.length;++St){var Nt=yt[St];if(!Nt.decoded)switch(Nt.compression){case 2:for(var rn=0,yi=0,Mn=0;Mn<re.lines;++Mn){for(var Li=En[St][rn],Wn=0;Wn<Nt.width;++Wn){for(var Oi=0;Oi<2*Nt.type;++Oi)rt[Li++]=wn[yi+Oi*Nt.width*Nt.height];yi++}rn++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(rt.buffer)}function Le(re,ge){for(var je=new Uint8Array(re),rt=0;je[ge.value+rt]!=0;)rt+=1;var dt=new TextDecoder().decode(je.slice(ge.value,ge.value+rt));return ge.value=ge.value+rt+1,dt}function Xe(re,ge,je){var rt=new TextDecoder().decode(new Uint8Array(re).slice(ge.value,ge.value+je));return ge.value=ge.value+je,rt}function mt(re,ge){var je=Je(re,ge),rt=tt(re,ge);return[je,rt]}function Ge(re,ge){var je=tt(re,ge),rt=tt(re,ge);return[je,rt]}function Je(re,ge){var je=re.getInt32(ge.value,!0);return ge.value=ge.value+4,je}function tt(re,ge){var je=re.getUint32(ge.value,!0);return ge.value=ge.value+4,je}function xt(re,ge){var je=re[ge.value];return ge.value=ge.value+1,je}function Tt(re,ge){var je=re.getUint8(ge.value);return ge.value=ge.value+1,je}const bt=function(re,ge){let je;return"getBigInt64"in DataView.prototype?je=Number(re.getBigInt64(ge.value,!0)):je=re.getUint32(ge.value+4,!0)+Number(re.getUint32(ge.value,!0)<<32),ge.value+=8,je};function Rt(re,ge){var je=re.getFloat32(ge.value,!0);return ge.value+=4,je}function Oe(re,ge){return om.toHalfFloat(Rt(re,ge))}function Ve(re){var ge=(re&31744)>>10,je=re&1023;return(re>>15?-1:1)*(ge?ge===31?je?NaN:1/0:Math.pow(2,ge-15)*(1+je/1024):6103515625e-14*(je/1024))}function ht(re,ge){var je=re.getUint16(ge.value,!0);return ge.value+=2,je}function Ft(re,ge){return Ve(ht(re,ge))}function st(re,ge,je,rt){for(var dt=je.value,ot=[];je.value<dt+rt-1;){var kt=Le(ge,je),ee=Je(re,je),ye=Tt(re,je);je.value+=3;var Ce=Je(re,je),De=Je(re,je);ot.push({name:kt,pixelType:ee,pLinear:ye,xSampling:Ce,ySampling:De})}return je.value+=1,ot}function it(re,ge){var je=Rt(re,ge),rt=Rt(re,ge),dt=Rt(re,ge),ot=Rt(re,ge),kt=Rt(re,ge),ee=Rt(re,ge),ye=Rt(re,ge),Ce=Rt(re,ge);return{redX:je,redY:rt,greenX:dt,greenY:ot,blueX:kt,blueY:ee,whiteX:ye,whiteY:Ce}}function vt(re,ge){var je=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],rt=Tt(re,ge);return je[rt]}function Kt(re,ge){var je=tt(re,ge),rt=tt(re,ge),dt=tt(re,ge),ot=tt(re,ge);return{xMin:je,yMin:rt,xMax:dt,yMax:ot}}function Xt(re,ge){var je=["INCREASING_Y"],rt=Tt(re,ge);return je[rt]}function cn(re,ge){var je=Rt(re,ge),rt=Rt(re,ge);return[je,rt]}function Gn(re,ge){var je=Rt(re,ge),rt=Rt(re,ge),dt=Rt(re,ge);return[je,rt,dt]}function bn(re,ge,je,rt,dt){if(rt==="string"||rt==="stringvector"||rt==="iccProfile")return Xe(ge,je,dt);if(rt==="chlist")return st(re,ge,je,dt);if(rt==="chromaticities")return it(re,je);if(rt==="compression")return vt(re,je);if(rt==="box2i")return Kt(re,je);if(rt==="lineOrder")return Xt(re,je);if(rt==="float")return Rt(re,je);if(rt==="v2f")return cn(re,je);if(rt==="v3f")return Gn(re,je);if(rt==="int")return Je(re,je);if(rt==="rational")return mt(re,je);if(rt==="timecode")return Ge(re,je);if(rt==="preview")return je.value+=dt,"skipped";je.value+=dt}function Jn(re,ge,je){const rt={};if(re.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";rt.version=re.getUint8(4);const dt=re.getUint8(5);rt.spec={singleTile:!!(dt&2),longName:!!(dt&4),deepFormat:!!(dt&8),multiPart:!!(dt&16)},je.value=8;for(var ot=!0;ot;){var kt=Le(ge,je);if(kt==0)ot=!1;else{var ee=Le(ge,je),ye=tt(re,je),Ce=bn(re,ge,je,ee,ye);Ce===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${ee}'.`):rt[kt]=Ce}}if(dt&-5)throw console.error("EXRHeader:",rt),"THREE.EXRLoader: provided file is currently unsupported.";return rt}function ai(re,ge,je,rt,dt){const ot={size:0,viewer:ge,array:je,offset:rt,width:re.dataWindow.xMax-re.dataWindow.xMin+1,height:re.dataWindow.yMax-re.dataWindow.yMin+1,channels:re.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:re.channels[0].pixelType,uncompress:null,getter:null,format:null,[Yy?"colorSpace":"encoding"]:null};switch(re.compression){case"NO_COMPRESSION":ot.lines=1,ot.uncompress=ie;break;case"RLE_COMPRESSION":ot.lines=1,ot.uncompress=K;break;case"ZIPS_COMPRESSION":ot.lines=1,ot.uncompress=ce;break;case"ZIP_COMPRESSION":ot.lines=16,ot.uncompress=ce;break;case"PIZ_COMPRESSION":ot.lines=32,ot.uncompress=fe;break;case"PXR24_COMPRESSION":ot.lines=16,ot.uncompress=me;break;case"DWAA_COMPRESSION":ot.lines=32,ot.uncompress=$;break;case"DWAB_COMPRESSION":ot.lines=256,ot.uncompress=$;break;default:throw"EXRLoader.parse: "+re.compression+" is unsupported"}if(ot.scanlineBlockSize=ot.lines,ot.type==1)switch(dt){case yr:ot.getter=Ft,ot.inputSize=2;break;case ts:ot.getter=ht,ot.inputSize=2;break}else if(ot.type==2)switch(dt){case yr:ot.getter=Rt,ot.inputSize=4;break;case ts:ot.getter=Oe,ot.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+ot.type+" for "+re.compression+".";ot.blockCount=(re.dataWindow.yMax+1)/ot.scanlineBlockSize;for(var kt=0;kt<ot.blockCount;kt++)bt(ge,rt);ot.outputChannels=ot.channels==3?4:ot.channels;const ee=ot.width*ot.height*ot.outputChannels;switch(dt){case yr:ot.byteArray=new Float32Array(ee),ot.channels<ot.outputChannels&&ot.byteArray.fill(1,0,ee);break;case ts:ot.byteArray=new Uint16Array(ee),ot.channels<ot.outputChannels&&ot.byteArray.fill(15360,0,ee);break;default:console.error("THREE.EXRLoader: unsupported type: ",dt);break}return ot.bytesPerLine=ot.width*ot.inputSize*ot.channels,ot.outputChannels==4?ot.format=$r:ot.format=wh,Yy?ot.colorSpace="srgb-linear":ot.encoding=3e3,ot}const vi=new DataView(e),Yn=new Uint8Array(e),Yi={value:0},ci=Jn(vi,e,Yi),hn=ai(ci,vi,Yn,Yi,this.type),ui={value:0},$n={R:0,G:1,B:2,A:3,Y:0};for(let re=0;re<hn.height/hn.scanlineBlockSize;re++){const ge=tt(vi,Yi);hn.size=tt(vi,Yi),hn.lines=ge+hn.scanlineBlockSize>hn.height?hn.height-ge:hn.scanlineBlockSize;const rt=hn.size<hn.lines*hn.bytesPerLine?hn.uncompress(hn):ie(hn);Yi.value+=hn.size;for(let dt=0;dt<hn.scanlineBlockSize;dt++){const ot=dt+re*hn.scanlineBlockSize;if(ot>=hn.height)break;for(let kt=0;kt<hn.channels;kt++){const ee=$n[ci.channels[kt].name];for(let ye=0;ye<hn.width;ye++){ui.value=(dt*(hn.channels*hn.width)+kt*hn.width+ye)*hn.inputSize;const Ce=(hn.height-1-ot)*(hn.width*hn.outputChannels)+ye*hn.outputChannels+ee;hn.byteArray[Ce]=hn.getter(rt,ui)}}}}return{header:ci,width:hn.width,height:hn.height,data:hn.byteArray,format:hn.format,[Yy?"colorSpace":"encoding"]:hn[Yy?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,n,i,r){function a(s,o){Yy?s.colorSpace=o.colorSpace:s.encoding=o.encoding,s.minFilter=Hi,s.magFilter=Hi,s.generateMipmaps=!1,s.flipY=!1,n&&n(s,o)}return super.load(e,a,i,r)}}const iD=new WeakMap;class KEe extends Fs{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,n,i,r){const a=new Os(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,s=>{const o={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(s,o).then(n).catch(r)},i,r)}decodeDracoFile(e,n,i,r){const a={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,a).then(n)}decodeGeometry(e,n){for(const l in n.attributeTypes){const c=n.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(n.attributeTypes[l]=c.name)}const i=JSON.stringify(n);if(iD.has(e)){const l=iD.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const a=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(a,s).then(l=>(r=l,new Promise((c,u)=>{r._callbacks[a]={resolve:c,reject:u},r.postMessage({type:"decode",id:a,taskConfig:n,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{r&&a&&this._releaseTask(r,a)}),iD.set(e,{key:i,promise:o}),o}_createGeometry(e){const n=new Dn;e.index&&n.setIndex(new Nn(e.index.array,1));for(let i=0;i<e.attributes.length;i++){const r=e.attributes[i],a=r.name,s=r.array,o=r.itemSize;n.setAttribute(a,new Nn(s,o))}return n}_loadLibrary(e,n){const i=new Os(this.manager);return i.setPath(this.decoderPath),i.setResponseType(n),i.setWithCredentials(this.withCredentials),new Promise((r,a)=>{i.load(e,r,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",n=[];return e?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const a=YEe.toString(),s=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,n){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const r=new Worker(this.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(a){const s=a.data;switch(s.type){case"decode":r._callbacks[s.id].resolve(s);break;case"error":r._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(r)}else this.workerPool.sort(function(r,a){return r._taskLoad>a._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=n,i._taskLoad+=n,i})}_releaseTask(e,n){e._taskLoad-=e._taskCosts[n],delete e._callbacks[n],delete e._taskCosts[n]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function YEe(){let t,e;onmessage=function(s){const o=s.data;switch(o.type){case"init":t=o.decoderConfig,e=new Promise(function(u){t.onModuleLoaded=function(f){u({draco:f})},DracoDecoderModule(t)});break;case"decode":const l=o.buffer,c=o.taskConfig;e.then(u=>{const f=u.draco,h=new f.Decoder,d=new f.DecoderBuffer;d.Init(new Int8Array(l),l.byteLength);try{const g=n(f,h,d,c),b=g.attributes.map(y=>y.array.buffer);g.index&&b.push(g.index.array.buffer),self.postMessage({type:"decode",id:o.id,geometry:g},b)}catch(g){console.error(g),self.postMessage({type:"error",id:o.id,error:g.message})}finally{f.destroy(d),f.destroy(h)}});break}};function n(s,o,l,c){const u=c.attributeIDs,f=c.attributeTypes;let h,d;const g=o.GetEncodedGeometryType(l);if(g===s.TRIANGULAR_MESH)h=new s.Mesh,d=o.DecodeBufferToMesh(l,h);else if(g===s.POINT_CLOUD)h=new s.PointCloud,d=o.DecodeBufferToPointCloud(l,h);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!d.ok()||h.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+d.error_msg());const b={index:null,attributes:[]};for(const y in u){const p=self[f[y]];let x,_;if(c.useUniqueIDs)_=u[y],x=o.GetAttributeByUniqueId(h,_);else{if(_=o.GetAttributeId(h,s[u[y]]),_===-1)continue;x=o.GetAttribute(h,_)}b.attributes.push(r(s,o,h,y,p,x))}return g===s.TRIANGULAR_MESH&&(b.index=i(s,o,h)),s.destroy(h),b}function i(s,o,l){const u=l.num_faces()*3,f=u*4,h=s._malloc(f);o.GetTrianglesUInt32Array(l,f,h);const d=new Uint32Array(s.HEAPF32.buffer,h,u).slice();return s._free(h),{array:d,itemSize:1}}function r(s,o,l,c,u,f){const h=f.num_components(),g=l.num_points()*h,b=g*u.BYTES_PER_ELEMENT,y=a(s,u),p=s._malloc(b);o.GetAttributeDataArrayForAllPoints(l,f,y,b,p);const x=new u(s.HEAPF32.buffer,p,g).slice();return s._free(p),{name:c,array:x,itemSize:h}}function a(s,o){switch(o){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}const M5=new rr,eE=new te;class yC extends H_{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],i=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(i),this.setAttribute("position",new fn(e,3)),this.setAttribute("uv",new fn(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,i=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),i.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const i=new tT(n,6,1);return this.setAttribute("instanceStart",new Bo(i,3,0)),this.setAttribute("instanceEnd",new Bo(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,n=3){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const r=new tT(i,n*2,1);return this.setAttribute("instanceColorStart",new Bo(r,n,0)),this.setAttribute("instanceColorEnd",new Bo(r,n,n)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new nU(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),M5.setFromBufferAttribute(n),this.boundingBox.union(M5))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ir),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const i=this.boundingSphere.center;this.boundingBox.getCenter(i);let r=0;for(let a=0,s=e.count;a<s;a++)eE.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(eE)),eE.fromBufferAttribute(n,a),r=Math.max(r,i.distanceToSquared(eE));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}class MU extends yC{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const n=e.length-3,i=new Float32Array(2*n);for(let r=0;r<n;r+=3)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];return super.setPositions(i),this}setColors(e,n=3){const i=e.length-n,r=new Float32Array(2*i);if(n===3)for(let a=0;a<i;a+=n)r[2*a]=e[a],r[2*a+1]=e[a+1],r[2*a+2]=e[a+2],r[2*a+3]=e[a+3],r[2*a+4]=e[a+4],r[2*a+5]=e[a+5];else for(let a=0;a<i;a+=n)r[2*a]=e[a],r[2*a+1]=e[a+1],r[2*a+2]=e[a+2],r[2*a+3]=e[a+3],r[2*a+4]=e[a+4],r[2*a+5]=e[a+5],r[2*a+6]=e[a+6],r[2*a+7]=e[a+7];return super.setColors(r,n),this}fromLine(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}}class xC extends ss{constructor(e){super({type:"LineMaterial",uniforms:av.clone(av.merge([en.common,en.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new wt(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
				#include <common>
				#include <fog_pars_vertex>
				#include <logdepthbuf_pars_vertex>
				#include <clipping_planes_pars_vertex>

				uniform float linewidth;
				uniform vec2 resolution;

				attribute vec3 instanceStart;
				attribute vec3 instanceEnd;

				#ifdef USE_COLOR
					#ifdef USE_LINE_COLOR_ALPHA
						varying vec4 vLineColor;
						attribute vec4 instanceColorStart;
						attribute vec4 instanceColorEnd;
					#else
						varying vec3 vLineColor;
						attribute vec3 instanceColorStart;
						attribute vec3 instanceColorEnd;
					#endif
				#endif

				#ifdef WORLD_UNITS

					varying vec4 worldPos;
					varying vec3 worldStart;
					varying vec3 worldEnd;

					#ifdef USE_DASH

						varying vec2 vUv;

					#endif

				#else

					varying vec2 vUv;

				#endif

				#ifdef USE_DASH

					uniform float dashScale;
					attribute float instanceDistanceStart;
					attribute float instanceDistanceEnd;
					varying float vLineDistance;

				#endif

				void trimSegment( const in vec4 start, inout vec4 end ) {

					// trim end segment so it terminates between the camera plane and the near plane

					// conservative estimate of the near plane
					float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
					float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
					float nearEstimate = - 0.5 * b / a;

					float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );

					end.xyz = mix( start.xyz, end.xyz, alpha );

				}

				void main() {

					#ifdef USE_COLOR

						vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;

					#endif

					#ifdef USE_DASH

						vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
						vUv = uv;

					#endif

					float aspect = resolution.x / resolution.y;

					// camera space
					vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
					vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );

					#ifdef WORLD_UNITS

						worldStart = start.xyz;
						worldEnd = end.xyz;

					#else

						vUv = uv;

					#endif

					// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
					// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
					// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
					// perhaps there is a more elegant solution -- WestLangley

					bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column

					if ( perspective ) {

						if ( start.z < 0.0 && end.z >= 0.0 ) {

							trimSegment( start, end );

						} else if ( end.z < 0.0 && start.z >= 0.0 ) {

							trimSegment( end, start );

						}

					}

					// clip space
					vec4 clipStart = projectionMatrix * start;
					vec4 clipEnd = projectionMatrix * end;

					// ndc space
					vec3 ndcStart = clipStart.xyz / clipStart.w;
					vec3 ndcEnd = clipEnd.xyz / clipEnd.w;

					// direction
					vec2 dir = ndcEnd.xy - ndcStart.xy;

					// account for clip-space aspect ratio
					dir.x *= aspect;
					dir = normalize( dir );

					#ifdef WORLD_UNITS

						// get the offset direction as perpendicular to the view vector
						vec3 worldDir = normalize( end.xyz - start.xyz );
						vec3 offset;
						if ( position.y < 0.5 ) {

							offset = normalize( cross( start.xyz, worldDir ) );

						} else {

							offset = normalize( cross( end.xyz, worldDir ) );

						}

						// sign flip
						if ( position.x < 0.0 ) offset *= - 1.0;

						float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );

						// don't extend the line if we're rendering dashes because we
						// won't be rendering the endcaps
						#ifndef USE_DASH

							// extend the line bounds to encompass  endcaps
							start.xyz += - worldDir * linewidth * 0.5;
							end.xyz += worldDir * linewidth * 0.5;

							// shift the position of the quad so it hugs the forward edge of the line
							offset.xy -= dir * forwardOffset;
							offset.z += 0.5;

						#endif

						// endcaps
						if ( position.y > 1.0 || position.y < 0.0 ) {

							offset.xy += dir * 2.0 * forwardOffset;

						}

						// adjust for linewidth
						offset *= linewidth * 0.5;

						// set the world position
						worldPos = ( position.y < 0.5 ) ? start : end;
						worldPos.xyz += offset;

						// project the worldpos
						vec4 clip = projectionMatrix * worldPos;

						// shift the depth of the projected points so the line
						// segments overlap neatly
						vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
						clip.z = clipPose.z * clip.w;

					#else

						vec2 offset = vec2( dir.y, - dir.x );
						// undo aspect ratio adjustment
						dir.x /= aspect;
						offset.x /= aspect;

						// sign flip
						if ( position.x < 0.0 ) offset *= - 1.0;

						// endcaps
						if ( position.y < 0.0 ) {

							offset += - dir;

						} else if ( position.y > 1.0 ) {

							offset += dir;

						}

						// adjust for linewidth
						offset *= linewidth;

						// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
						offset /= resolution.y;

						// select end
						vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;

						// back to clip space
						offset *= clip.w;

						clip.xy += offset;

					#endif

					gl_Position = clip;

					vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation

					#include <logdepthbuf_vertex>
					#include <clipping_planes_vertex>
					#include <fog_vertex>

				}
			`,fragmentShader:`
				uniform vec3 diffuse;
				uniform float opacity;
				uniform float linewidth;

				#ifdef USE_DASH

					uniform float dashOffset;
					uniform float dashSize;
					uniform float gapSize;

				#endif

				varying float vLineDistance;

				#ifdef WORLD_UNITS

					varying vec4 worldPos;
					varying vec3 worldStart;
					varying vec3 worldEnd;

					#ifdef USE_DASH

						varying vec2 vUv;

					#endif

				#else

					varying vec2 vUv;

				#endif

				#include <common>
				#include <fog_pars_fragment>
				#include <logdepthbuf_pars_fragment>
				#include <clipping_planes_pars_fragment>

				#ifdef USE_COLOR
					#ifdef USE_LINE_COLOR_ALPHA
						varying vec4 vLineColor;
					#else
						varying vec3 vLineColor;
					#endif
				#endif

				vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {

					float mua;
					float mub;

					vec3 p13 = p1 - p3;
					vec3 p43 = p4 - p3;

					vec3 p21 = p2 - p1;

					float d1343 = dot( p13, p43 );
					float d4321 = dot( p43, p21 );
					float d1321 = dot( p13, p21 );
					float d4343 = dot( p43, p43 );
					float d2121 = dot( p21, p21 );

					float denom = d2121 * d4343 - d4321 * d4321;

					float numer = d1343 * d4321 - d1321 * d4343;

					mua = numer / denom;
					mua = clamp( mua, 0.0, 1.0 );
					mub = ( d1343 + d4321 * ( mua ) ) / d4343;
					mub = clamp( mub, 0.0, 1.0 );

					return vec2( mua, mub );

				}

				void main() {

					#include <clipping_planes_fragment>

					#ifdef USE_DASH

						if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps

						if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX

					#endif

					float alpha = opacity;

					#ifdef WORLD_UNITS

						// Find the closest points on the view ray and the line segment
						vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
						vec3 lineDir = worldEnd - worldStart;
						vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );

						vec3 p1 = worldStart + lineDir * params.x;
						vec3 p2 = rayEnd * params.y;
						vec3 delta = p1 - p2;
						float len = length( delta );
						float norm = len / linewidth;

						#ifndef USE_DASH

							#ifdef USE_ALPHA_TO_COVERAGE

								float dnorm = fwidth( norm );
								alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );

							#else

								if ( norm > 0.5 ) {

									discard;

								}

							#endif

						#endif

					#else

						#ifdef USE_ALPHA_TO_COVERAGE

							// artifacts appear on some hardware if a derivative is taken within a conditional
							float a = vUv.x;
							float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
							float len2 = a * a + b * b;
							float dlen = fwidth( len2 );

							if ( abs( vUv.y ) > 1.0 ) {

								alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );

							}

						#else

							if ( abs( vUv.y ) > 1.0 ) {

								float a = vUv.x;
								float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
								float len2 = a * a + b * b;

								if ( len2 > 1.0 ) discard;

							}

						#endif

					#endif

					vec4 diffuseColor = vec4( diffuse, alpha );
					#ifdef USE_COLOR
						#ifdef USE_LINE_COLOR_ALPHA
							diffuseColor *= vLineColor;
						#else
							diffuseColor.rgb *= vLineColor;
						#endif
					#endif

					#include <logdepthbuf_fragment>

					gl_FragColor = diffuseColor;

					#include <tonemapping_fragment>
					#include <${X_>=154?"colorspace_fragment":"encodings_fragment"}>
					#include <fog_fragment>
					#include <premultiplied_alpha_fragment>

				}
			`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(n){this.uniforms.diffuse.value=n}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(n){n===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(n){this.uniforms.linewidth.value=n}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(n){!!n!="USE_DASH"in this.defines&&(this.needsUpdate=!0),n===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(n){this.uniforms.dashScale.value=n}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(n){this.uniforms.dashSize.value=n}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(n){this.uniforms.dashOffset.value=n}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(n){this.uniforms.gapSize.value=n}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(n){this.uniforms.opacity.value=n}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(n){this.uniforms.resolution.value.copy(n)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(n){!!n!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),n===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}const rD=new ei,T5=new te,A5=new te,ps=new ei,ms=new ei,Du=new ei,aD=new te,sD=new Ot,xs=new k$,C5=new te,tE=new rr,nE=new Ir,Ou=new ei;let ju,Rm;function R5(t,e,n){return Ou.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),Ou.multiplyScalar(1/Ou.w),Ou.x=Rm/n.width,Ou.y=Rm/n.height,Ou.applyMatrix4(t.projectionMatrixInverse),Ou.multiplyScalar(1/Ou.w),Math.abs(Math.max(Ou.x,Ou.y))}function JEe(t,e){const n=t.matrixWorld,i=t.geometry,r=i.attributes.instanceStart,a=i.attributes.instanceEnd,s=Math.min(i.instanceCount,r.count);for(let o=0,l=s;o<l;o++){xs.start.fromBufferAttribute(r,o),xs.end.fromBufferAttribute(a,o),xs.applyMatrix4(n);const c=new te,u=new te;ju.distanceSqToSegment(xs.start,xs.end,u,c),u.distanceTo(c)<Rm*.5&&e.push({point:u,pointOnLine:c,distance:ju.origin.distanceTo(u),object:t,face:null,faceIndex:o,uv:null,[yZ]:null})}}function $Ee(t,e,n){const i=e.projectionMatrix,a=t.material.resolution,s=t.matrixWorld,o=t.geometry,l=o.attributes.instanceStart,c=o.attributes.instanceEnd,u=Math.min(o.instanceCount,l.count),f=-e.near;ju.at(1,Du),Du.w=1,Du.applyMatrix4(e.matrixWorldInverse),Du.applyMatrix4(i),Du.multiplyScalar(1/Du.w),Du.x*=a.x/2,Du.y*=a.y/2,Du.z=0,aD.copy(Du),sD.multiplyMatrices(e.matrixWorldInverse,s);for(let h=0,d=u;h<d;h++){if(ps.fromBufferAttribute(l,h),ms.fromBufferAttribute(c,h),ps.w=1,ms.w=1,ps.applyMatrix4(sD),ms.applyMatrix4(sD),ps.z>f&&ms.z>f)continue;if(ps.z>f){const _=ps.z-ms.z,w=(ps.z-f)/_;ps.lerp(ms,w)}else if(ms.z>f){const _=ms.z-ps.z,w=(ms.z-f)/_;ms.lerp(ps,w)}ps.applyMatrix4(i),ms.applyMatrix4(i),ps.multiplyScalar(1/ps.w),ms.multiplyScalar(1/ms.w),ps.x*=a.x/2,ps.y*=a.y/2,ms.x*=a.x/2,ms.y*=a.y/2,xs.start.copy(ps),xs.start.z=0,xs.end.copy(ms),xs.end.z=0;const b=xs.closestPointToPointParameter(aD,!0);xs.at(b,C5);const y=gc.lerp(ps.z,ms.z,b),p=y>=-1&&y<=1,x=aD.distanceTo(C5)<Rm*.5;if(p&&x){xs.start.fromBufferAttribute(l,h),xs.end.fromBufferAttribute(c,h),xs.start.applyMatrix4(s),xs.end.applyMatrix4(s);const _=new te,w=new te;ju.distanceSqToSegment(xs.start,xs.end,w,_),n.push({point:w,pointOnLine:_,distance:ju.origin.distanceTo(w),object:t,face:null,faceIndex:h,uv:null,[yZ]:null})}}}class TU extends _i{constructor(e=new yC,n=new xC({color:Math.random()*16777215})){super(e,n),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,n=e.attributes.instanceStart,i=e.attributes.instanceEnd,r=new Float32Array(2*n.count);for(let s=0,o=0,l=n.count;s<l;s++,o+=2)T5.fromBufferAttribute(n,s),A5.fromBufferAttribute(i,s),r[o]=o===0?0:r[o-1],r[o+1]=r[o]+T5.distanceTo(A5);const a=new tT(r,2,1);return e.setAttribute("instanceDistanceStart",new Bo(a,1,0)),e.setAttribute("instanceDistanceEnd",new Bo(a,1,1)),this}raycast(e,n){const i=this.material.worldUnits,r=e.camera;r===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=e.params.Line2!==void 0&&e.params.Line2.threshold||0;ju=e.ray;const s=this.matrixWorld,o=this.geometry,l=this.material;Rm=l.linewidth+a,o.boundingSphere===null&&o.computeBoundingSphere(),nE.copy(o.boundingSphere).applyMatrix4(s);let c;if(i)c=Rm*.5;else{const f=Math.max(r.near,nE.distanceToPoint(ju.origin));c=R5(r,f,l.resolution)}if(nE.radius+=c,ju.intersectsSphere(nE)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),tE.copy(o.boundingBox).applyMatrix4(s);let u;if(i)u=Rm*.5;else{const f=Math.max(r.near,tE.distanceToPoint(ju.origin));u=R5(r,f,l.resolution)}tE.expandByScalar(u),ju.intersectsBox(tE)!==!1&&(i?JEe(this,n):$Ee(this,r,n))}onBeforeRender(e){const n=this.material.uniforms;n&&n.resolution&&(e.getViewport(rD),this.material.uniforms.resolution.value.set(rD.z,rD.w))}}class CZ extends TU{constructor(e=new MU,n=new xC({color:Math.random()*16777215})){super(e,n),this.isLine2=!0,this.type="Line2"}}const ZEe=new te,QEe=new te,eMe=new te,tMe=(t,e,n)=>{const i=n.width/2,r=n.height/2;e.updateMatrixWorld(!1);const a=t.project(e);return a.x=a.x*i+i,a.y=-(a.y*r)+r,a},nMe=(t,e,n,i=1)=>{const r=ZEe.set(t.x/n.width*2-1,-(t.y/n.height)*2+1,i);return r.unproject(e),r},RZ=(t,e,n,i)=>{const r=tMe(eMe.copy(t),n,i);let a=0;for(let s=0;s<2;++s){const o=QEe.copy(r).setComponent(s,r.getComponent(s)+e),l=nMe(o,n,i,o.z);a=Math.max(a,t.distanceTo(l))}return a},Xm=I.forwardRef(function({points:e,color:n=16777215,vertexColors:i,linewidth:r,lineWidth:a,segments:s,dashed:o,...l},c){var u,f;const h=Ri(p=>p.size),d=I.useMemo(()=>s?new TU:new CZ,[s]),[g]=I.useState(()=>new xC),b=(i==null||(u=i[0])==null?void 0:u.length)===4?4:3,y=I.useMemo(()=>{const p=s?new yC:new MU,x=e.map(_=>{const w=Array.isArray(_);return _ instanceof te||_ instanceof ei?[_.x,_.y,_.z]:_ instanceof wt?[_.x,_.y,0]:w&&_.length===3?[_[0],_[1],_[2]]:w&&_.length===2?[_[0],_[1],0]:_});if(p.setPositions(x.flat()),i){n=16777215;const _=i.map(w=>w instanceof Ut?w.toArray():w);p.setColors(_.flat(),b)}return p},[e,s,i,b]);return I.useLayoutEffect(()=>{d.computeLineDistances()},[e,d]),I.useLayoutEffect(()=>{o?g.defines.USE_DASH="":delete g.defines.USE_DASH,g.needsUpdate=!0},[o,g]),I.useEffect(()=>()=>{y.dispose(),g.dispose()},[y]),I.createElement("primitive",Is({object:d,ref:c},l),I.createElement("primitive",{object:y,attach:"geometry"}),I.createElement("primitive",Is({object:g,attach:"material",color:n,vertexColors:!!i,resolution:[h.width,h.height],linewidth:(f=r??a)!==null&&f!==void 0?f:1,dashed:o,transparent:b===4},l)))}),iMe=I.forwardRef(function({start:e,end:n,midA:i,midB:r,segments:a=20,...s},o){const l=I.useMemo(()=>{const c=e instanceof te?e:new te(...e),u=n instanceof te?n:new te(...n),f=i instanceof te?i:new te(...i),h=r instanceof te?r:new te(...r);return new $P(c,f,h,u).getPoints(a)},[e,n,i,r,a]);return I.createElement(Xm,Is({ref:o,points:l},s))}),rMe=I.forwardRef(function({points:e,closed:n=!1,curveType:i="centripetal",tension:r=.5,segments:a=20,vertexColors:s,...o},l){const c=I.useMemo(()=>{const h=e.map(d=>d instanceof te?d:new te(...d));return new YP(h,n,i,r)},[e,n,i,r]),u=I.useMemo(()=>c.getPoints(a),[c,a]),f=I.useMemo(()=>{if(!s||s.length<2)return;if(s.length===a+1)return s;const h=s.map(b=>b instanceof Ut?b:new Ut(...b));n&&h.push(h[0].clone());const d=[h[0]],g=a/(h.length-1);for(let b=1;b<a;b++){const y=b%g/g,p=Math.floor(b/g);d.push(h[p].clone().lerp(h[p+1],y))}return d.push(h[h.length-1]),d},[s,a]);return I.createElement(Xm,Is({ref:l,points:u,vertexColors:f},o))});function aMe(){var t=Object.create(null);function e(r,a){var s=r.id,o=r.name,l=r.dependencies;l===void 0&&(l=[]);var c=r.init;c===void 0&&(c=function(){});var u=r.getTransferables;if(u===void 0&&(u=null),!t[s])try{l=l.map(function(h){return h&&h.isWorkerModule&&(e(h,function(d){if(d instanceof Error)throw d}),h=t[h.id].value),h}),c=i("<"+o+">.init",c),u&&(u=i("<"+o+">.getTransferables",u));var f=null;typeof c=="function"?f=c.apply(void 0,l):console.error("worker module init function failed to rehydrate"),t[s]={id:s,value:f,getTransferables:u},a(f)}catch(h){h&&h.noLog||console.error(h),a(h)}}function n(r,a){var s,o=r.id,l=r.args;(!t[o]||typeof t[o].value!="function")&&a(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var c=(s=t[o]).value.apply(s,l);c&&typeof c.then=="function"?c.then(u,function(f){return a(f instanceof Error?f:new Error(""+f))}):u(c)}catch(f){a(f)}function u(f){try{var h=t[o].getTransferables&&t[o].getTransferables(f);(!h||!Array.isArray(h)||!h.length)&&(h=void 0),a(f,h)}catch(d){console.error(d),a(d)}}}function i(r,a){var s=void 0;self.troikaDefine=function(l){return s=l};var o=URL.createObjectURL(new Blob(["/** "+r.replace(/\*/g,"")+` **/

troikaDefine(
`+a+`
)`],{type:"application/javascript"}));try{importScripts(o)}catch(l){console.error(l)}return URL.revokeObjectURL(o),delete self.troikaDefine,s}self.addEventListener("message",function(r){var a=r.data,s=a.messageId,o=a.action,l=a.data;try{o==="registerModule"&&e(l,function(c){c instanceof Error?postMessage({messageId:s,success:!1,error:c.message}):postMessage({messageId:s,success:!0,result:{isCallable:typeof c=="function"}})}),o==="callModule"&&n(l,function(c,u){c instanceof Error?postMessage({messageId:s,success:!1,error:c.message}):postMessage({messageId:s,success:!0,result:c},u||void 0)})}catch(c){postMessage({messageId:s,success:!1,error:c.stack})}})}function sMe(t){var e=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return e._getInitResult().then(function(r){if(typeof r=="function")return r.apply(void 0,n);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var n=t.dependencies,i=t.init;n=Array.isArray(n)?n.map(function(a){return a&&(a=a.onMainThread||a,a._getInitResult&&(a=a._getInitResult())),a}):[];var r=Promise.all(n).then(function(a){return i.apply(null,a)});return e._getInitResult=function(){return r},r},e}var kZ=function(){var t=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),t=!0}catch(n){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+n.message+"]")}return kZ=function(){return t},t},oMe=0,lMe=0,oD=!1,o1=Object.create(null),l1=Object.create(null),gI=Object.create(null);function $v(t){if((!t||typeof t.init!="function")&&!oD)throw new Error("requires `options.init` function");var e=t.dependencies,n=t.init,i=t.getTransferables,r=t.workerId,a=sMe(t);r==null&&(r="#default");var s="workerModule"+ ++oMe,o=t.name||s,l=null;e=e&&e.map(function(u){return typeof u=="function"&&!u.workerModuleData&&(oD=!0,u=$v({workerId:r,name:"<"+o+"> function dependency: "+u.name,init:`function(){return (
`+gM(u)+`
)}`}),oD=!1),u&&u.workerModuleData&&(u=u.workerModuleData),u});function c(){for(var u=[],f=arguments.length;f--;)u[f]=arguments[f];if(!kZ())return a.apply(void 0,u);if(!l){l=k5(r,"registerModule",c.workerModuleData);var h=function(){l=null,l1[r].delete(h)};(l1[r]||(l1[r]=new Set)).add(h)}return l.then(function(d){var g=d.isCallable;if(g)return k5(r,"callModule",{id:s,args:u});throw new Error("Worker module function was called but `init` did not return a callable function")})}return c.workerModuleData={isWorkerModule:!0,id:s,name:o,dependencies:e,init:gM(n),getTransferables:i&&gM(i)},c.onMainThread=a,c}function cMe(t){l1[t]&&l1[t].forEach(function(e){e()}),o1[t]&&(o1[t].terminate(),delete o1[t])}function gM(t){var e=t.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function uMe(t){var e=o1[t];if(!e){var n=gM(aMe);e=o1[t]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+t.replace(/\*/g,"")+` **/

;(`+n+")()"],{type:"application/javascript"}))),e.onmessage=function(i){var r=i.data,a=r.messageId,s=gI[a];if(!s)throw new Error("WorkerModule response with empty or unknown messageId");delete gI[a],s(r)}}return e}function k5(t,e,n){return new Promise(function(i,r){var a=++lMe;gI[a]=function(s){s.success?i(s.result):r(new Error("Error in worker "+e+" call: "+s.error))},uMe(t).postMessage({messageId:a,action:e,data:n})})}function DZ(){var t=function(e){function n(W,F,Y,Z,V,de,se,oe){var ue=1-se;oe.x=ue*ue*W+2*ue*se*Y+se*se*V,oe.y=ue*ue*F+2*ue*se*Z+se*se*de}function i(W,F,Y,Z,V,de,se,oe,ue,_e){var ke=1-ue;_e.x=ke*ke*ke*W+3*ke*ke*ue*Y+3*ke*ue*ue*V+ue*ue*ue*se,_e.y=ke*ke*ke*F+3*ke*ke*ue*Z+3*ke*ue*ue*de+ue*ue*ue*oe}function r(W,F){for(var Y=/([MLQCZ])([^MLQCZ]*)/g,Z,V,de,se,oe;Z=Y.exec(W);){var ue=Z[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(_e){return parseFloat(_e)});switch(Z[1]){case"M":se=V=ue[0],oe=de=ue[1];break;case"L":(ue[0]!==se||ue[1]!==oe)&&F("L",se,oe,se=ue[0],oe=ue[1]);break;case"Q":{F("Q",se,oe,se=ue[2],oe=ue[3],ue[0],ue[1]);break}case"C":{F("C",se,oe,se=ue[4],oe=ue[5],ue[0],ue[1],ue[2],ue[3]);break}case"Z":(se!==V||oe!==de)&&F("L",se,oe,V,de);break}}}function a(W,F,Y){Y===void 0&&(Y=16);var Z={x:0,y:0};r(W,function(V,de,se,oe,ue,_e,ke,Ne,Ue){switch(V){case"L":F(de,se,oe,ue);break;case"Q":{for(var ze=de,pe=se,Fe=1;Fe<Y;Fe++)n(de,se,_e,ke,oe,ue,Fe/(Y-1),Z),F(ze,pe,Z.x,Z.y),ze=Z.x,pe=Z.y;break}case"C":{for(var Ie=de,qe=se,we=1;we<Y;we++)i(de,se,_e,ke,Ne,Ue,oe,ue,we/(Y-1),Z),F(Ie,qe,Z.x,Z.y),Ie=Z.x,qe=Z.y;break}}})}var s="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",o="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",l=new WeakMap,c={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function u(W,F){var Y=W.getContext?W.getContext("webgl",c):W,Z=l.get(Y);if(!Z){let ke=function(Ie){var qe=de[Ie];if(!qe&&(qe=de[Ie]=Y.getExtension(Ie),!qe))throw new Error(Ie+" not supported");return qe},Ne=function(Ie,qe){var we=Y.createShader(qe);return Y.shaderSource(we,Ie),Y.compileShader(we),we},Ue=function(Ie,qe,we,Te){if(!se[Ie]){var Ae={},Pe={},He=Y.createProgram();Y.attachShader(He,Ne(qe,Y.VERTEX_SHADER)),Y.attachShader(He,Ne(we,Y.FRAGMENT_SHADER)),Y.linkProgram(He),se[Ie]={program:He,transaction:function(ie){Y.useProgram(He),ie({setUniform:function(ce,fe){for(var me=[],$=arguments.length-2;$-- >0;)me[$]=arguments[$+2];var Le=Pe[fe]||(Pe[fe]=Y.getUniformLocation(He,fe));Y["uniform"+ce].apply(Y,[Le].concat(me))},setAttribute:function(ce,fe,me,$,Le){var Xe=Ae[ce];Xe||(Xe=Ae[ce]={buf:Y.createBuffer(),loc:Y.getAttribLocation(He,ce),data:null}),Y.bindBuffer(Y.ARRAY_BUFFER,Xe.buf),Y.vertexAttribPointer(Xe.loc,fe,Y.FLOAT,!1,0,0),Y.enableVertexAttribArray(Xe.loc),V?Y.vertexAttribDivisor(Xe.loc,$):ke("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Xe.loc,$),Le!==Xe.data&&(Y.bufferData(Y.ARRAY_BUFFER,Le,me),Xe.data=Le)}})}}}se[Ie].transaction(Te)},ze=function(Ie,qe){ue++;try{Y.activeTexture(Y.TEXTURE0+ue);var we=oe[Ie];we||(we=oe[Ie]=Y.createTexture(),Y.bindTexture(Y.TEXTURE_2D,we),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MIN_FILTER,Y.NEAREST),Y.texParameteri(Y.TEXTURE_2D,Y.TEXTURE_MAG_FILTER,Y.NEAREST)),Y.bindTexture(Y.TEXTURE_2D,we),qe(we,ue)}finally{ue--}},pe=function(Ie,qe,we){var Te=Y.createFramebuffer();_e.push(Te),Y.bindFramebuffer(Y.FRAMEBUFFER,Te),Y.activeTexture(Y.TEXTURE0+qe),Y.bindTexture(Y.TEXTURE_2D,Ie),Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_2D,Ie,0);try{we(Te)}finally{Y.deleteFramebuffer(Te),Y.bindFramebuffer(Y.FRAMEBUFFER,_e[--_e.length-1]||null)}},Fe=function(){de={},se={},oe={},ue=-1,_e.length=0};var V=typeof WebGL2RenderingContext<"u"&&Y instanceof WebGL2RenderingContext,de={},se={},oe={},ue=-1,_e=[];Y.canvas.addEventListener("webglcontextlost",function(Ie){Fe(),Ie.preventDefault()},!1),l.set(Y,Z={gl:Y,isWebGL2:V,getExtension:ke,withProgram:Ue,withTexture:ze,withTextureFramebuffer:pe,handleContextLoss:Fe})}F(Z)}function f(W,F,Y,Z,V,de,se,oe){se===void 0&&(se=15),oe===void 0&&(oe=null),u(W,function(ue){var _e=ue.gl,ke=ue.withProgram,Ne=ue.withTexture;Ne("copy",function(Ue,ze){_e.texImage2D(_e.TEXTURE_2D,0,_e.RGBA,V,de,0,_e.RGBA,_e.UNSIGNED_BYTE,F),ke("copy",s,o,function(pe){var Fe=pe.setUniform,Ie=pe.setAttribute;Ie("aUV",2,_e.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),Fe("1i","image",ze),_e.bindFramebuffer(_e.FRAMEBUFFER,oe||null),_e.disable(_e.BLEND),_e.colorMask(se&8,se&4,se&2,se&1),_e.viewport(Y,Z,V,de),_e.scissor(Y,Z,V,de),_e.drawArrays(_e.TRIANGLES,0,3)})})})}function h(W,F,Y){var Z=W.width,V=W.height;u(W,function(de){var se=de.gl,oe=new Uint8Array(Z*V*4);se.readPixels(0,0,Z,V,se.RGBA,se.UNSIGNED_BYTE,oe),W.width=F,W.height=Y,f(se,oe,0,0,Z,V)})}var d=Object.freeze({__proto__:null,withWebGLContext:u,renderImageData:f,resizeWebGLCanvasWithoutClearing:h});function g(W,F,Y,Z,V,de){de===void 0&&(de=1);var se=new Uint8Array(W*F),oe=Z[2]-Z[0],ue=Z[3]-Z[1],_e=[];a(Y,function(Ie,qe,we,Te){_e.push({x1:Ie,y1:qe,x2:we,y2:Te,minX:Math.min(Ie,we),minY:Math.min(qe,Te),maxX:Math.max(Ie,we),maxY:Math.max(qe,Te)})}),_e.sort(function(Ie,qe){return Ie.maxX-qe.maxX});for(var ke=0;ke<W;ke++)for(var Ne=0;Ne<F;Ne++){var Ue=pe(Z[0]+oe*(ke+.5)/W,Z[1]+ue*(Ne+.5)/F),ze=Math.pow(1-Math.abs(Ue)/V,de)/2;Ue<0&&(ze=1-ze),ze=Math.max(0,Math.min(255,Math.round(ze*255))),se[Ne*W+ke]=ze}return se;function pe(Ie,qe){for(var we=1/0,Te=1/0,Ae=_e.length;Ae--;){var Pe=_e[Ae];if(Pe.maxX+Te<=Ie)break;if(Ie+Te>Pe.minX&&qe-Te<Pe.maxY&&qe+Te>Pe.minY){var He=p(Ie,qe,Pe.x1,Pe.y1,Pe.x2,Pe.y2);He<we&&(we=He,Te=Math.sqrt(we))}}return Fe(Ie,qe)&&(Te=-Te),Te}function Fe(Ie,qe){for(var we=0,Te=_e.length;Te--;){var Ae=_e[Te];if(Ae.maxX<=Ie)break;var Pe=Ae.y1>qe!=Ae.y2>qe&&Ie<(Ae.x2-Ae.x1)*(qe-Ae.y1)/(Ae.y2-Ae.y1)+Ae.x1;Pe&&(we+=Ae.y1<Ae.y2?1:-1)}return we!==0}}function b(W,F,Y,Z,V,de,se,oe,ue,_e){de===void 0&&(de=1),oe===void 0&&(oe=0),ue===void 0&&(ue=0),_e===void 0&&(_e=0),y(W,F,Y,Z,V,de,se,null,oe,ue,_e)}function y(W,F,Y,Z,V,de,se,oe,ue,_e,ke){de===void 0&&(de=1),ue===void 0&&(ue=0),_e===void 0&&(_e=0),ke===void 0&&(ke=0);for(var Ne=g(W,F,Y,Z,V,de),Ue=new Uint8Array(Ne.length*4),ze=0;ze<Ne.length;ze++)Ue[ze*4+ke]=Ne[ze];f(se,Ue,ue,_e,W,F,1<<3-ke,oe)}function p(W,F,Y,Z,V,de){var se=V-Y,oe=de-Z,ue=se*se+oe*oe,_e=ue?Math.max(0,Math.min(1,((W-Y)*se+(F-Z)*oe)/ue)):0,ke=W-(Y+_e*se),Ne=F-(Z+_e*oe);return ke*ke+Ne*Ne}var x=Object.freeze({__proto__:null,generate:g,generateIntoCanvas:b,generateIntoFramebuffer:y}),_="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",w="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.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.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",M="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",S=new Float32Array([0,0,2,0,0,2]),A=null,C=!1,D={},R=new WeakMap;function N(W){if(!C&&!q(W))throw new Error("WebGL generation not supported")}function U(W,F,Y,Z,V,de,se){if(de===void 0&&(de=1),se===void 0&&(se=null),!se&&(se=A,!se)){var oe=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!oe)throw new Error("OffscreenCanvas or DOM canvas not supported");se=A=oe.getContext("webgl",{depth:!1})}N(se);var ue=new Uint8Array(W*F*4);u(se,function(Ue){var ze=Ue.gl,pe=Ue.withTexture,Fe=Ue.withTextureFramebuffer;pe("readable",function(Ie,qe){ze.texImage2D(ze.TEXTURE_2D,0,ze.RGBA,W,F,0,ze.RGBA,ze.UNSIGNED_BYTE,null),Fe(Ie,qe,function(we){z(W,F,Y,Z,V,de,ze,we,0,0,0),ze.readPixels(0,0,W,F,ze.RGBA,ze.UNSIGNED_BYTE,ue)})})});for(var _e=new Uint8Array(W*F),ke=0,Ne=0;ke<ue.length;ke+=4)_e[Ne++]=ue[ke];return _e}function j(W,F,Y,Z,V,de,se,oe,ue,_e){de===void 0&&(de=1),oe===void 0&&(oe=0),ue===void 0&&(ue=0),_e===void 0&&(_e=0),z(W,F,Y,Z,V,de,se,null,oe,ue,_e)}function z(W,F,Y,Z,V,de,se,oe,ue,_e,ke){de===void 0&&(de=1),ue===void 0&&(ue=0),_e===void 0&&(_e=0),ke===void 0&&(ke=0),N(se);var Ne=[];a(Y,function(Ue,ze,pe,Fe){Ne.push(Ue,ze,pe,Fe)}),Ne=new Float32Array(Ne),u(se,function(Ue){var ze=Ue.gl,pe=Ue.isWebGL2,Fe=Ue.getExtension,Ie=Ue.withProgram,qe=Ue.withTexture,we=Ue.withTextureFramebuffer,Te=Ue.handleContextLoss;if(qe("rawDistances",function(Ae,Pe){(W!==Ae._lastWidth||F!==Ae._lastHeight)&&ze.texImage2D(ze.TEXTURE_2D,0,ze.RGBA,Ae._lastWidth=W,Ae._lastHeight=F,0,ze.RGBA,ze.UNSIGNED_BYTE,null),Ie("main",_,w,function(He){var $e=He.setAttribute,ie=He.setUniform,K=!pe&&Fe("ANGLE_instanced_arrays"),ce=!pe&&Fe("EXT_blend_minmax");$e("aUV",2,ze.STATIC_DRAW,0,S),$e("aLineSegment",4,ze.DYNAMIC_DRAW,1,Ne),ie.apply(void 0,["4f","uGlyphBounds"].concat(Z)),ie("1f","uMaxDistance",V),ie("1f","uExponent",de),we(Ae,Pe,function(fe){ze.enable(ze.BLEND),ze.colorMask(!0,!0,!0,!0),ze.viewport(0,0,W,F),ze.scissor(0,0,W,F),ze.blendFunc(ze.ONE,ze.ONE),ze.blendEquationSeparate(ze.FUNC_ADD,pe?ze.MAX:ce.MAX_EXT),ze.clear(ze.COLOR_BUFFER_BIT),pe?ze.drawArraysInstanced(ze.TRIANGLES,0,3,Ne.length/4):K.drawArraysInstancedANGLE(ze.TRIANGLES,0,3,Ne.length/4)})}),Ie("post",s,M,function(He){He.setAttribute("aUV",2,ze.STATIC_DRAW,0,S),He.setUniform("1i","tex",Pe),ze.bindFramebuffer(ze.FRAMEBUFFER,oe),ze.disable(ze.BLEND),ze.colorMask(ke===0,ke===1,ke===2,ke===3),ze.viewport(ue,_e,W,F),ze.scissor(ue,_e,W,F),ze.drawArrays(ze.TRIANGLES,0,3)})}),ze.isContextLost())throw Te(),new Error("webgl context lost")})}function q(W){var F=!W||W===A?D:W.canvas||W,Y=R.get(F);if(Y===void 0){C=!0;var Z=null;try{var V=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],de=U(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,W);Y=de&&V.length===de.length&&de.every(function(se,oe){return se===V[oe]}),Y||(Z="bad trial run results",console.info(V,de))}catch(se){Y=!1,Z=se.message}Z&&console.warn("WebGL SDF generation not supported:",Z),C=!1,R.set(F,Y)}return Y}var B=Object.freeze({__proto__:null,generate:U,generateIntoCanvas:j,generateIntoFramebuffer:z,isSupported:q});function G(W,F,Y,Z,V,de){V===void 0&&(V=Math.max(Z[2]-Z[0],Z[3]-Z[1])/2),de===void 0&&(de=1);try{return U.apply(B,arguments)}catch(se){return console.info("WebGL SDF generation failed, falling back to JS",se),g.apply(x,arguments)}}function H(W,F,Y,Z,V,de,se,oe,ue,_e){V===void 0&&(V=Math.max(Z[2]-Z[0],Z[3]-Z[1])/2),de===void 0&&(de=1),oe===void 0&&(oe=0),ue===void 0&&(ue=0),_e===void 0&&(_e=0);try{return j.apply(B,arguments)}catch(ke){return console.info("WebGL SDF generation failed, falling back to JS",ke),b.apply(x,arguments)}}return e.forEachPathCommand=r,e.generate=G,e.generateIntoCanvas=H,e.javascript=x,e.pathToLineSegments=a,e.webgl=B,e.webglUtils=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}function fMe(){var t=function(e){var n={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},i={},r={};i.L=1,r[1]="L",Object.keys(n).forEach(function(Te,Ae){i[Te]=1<<Ae+1,r[i[Te]]=Te}),Object.freeze(i);var a=i.LRI|i.RLI|i.FSI,s=i.L|i.R|i.AL,o=i.B|i.S|i.WS|i.ON|i.FSI|i.LRI|i.RLI|i.PDI,l=i.BN|i.RLE|i.LRE|i.RLO|i.LRO|i.PDF,c=i.S|i.WS|i.B|a|i.PDI|l,u=null;function f(){if(!u){u=new Map;var Te=function(Pe){if(n.hasOwnProperty(Pe)){var He=0;n[Pe].split(",").forEach(function($e){var ie=$e.split("+"),K=ie[0],ce=ie[1];K=parseInt(K,36),ce=ce?parseInt(ce,36):0,u.set(He+=K,i[Pe]);for(var fe=0;fe<ce;fe++)u.set(++He,i[Pe])})}};for(var Ae in n)Te(Ae)}}function h(Te){return f(),u.get(Te.codePointAt(0))||i.L}function d(Te){return r[h(Te)]}var g={pairs:"14>1,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 b(Te,Ae){var Pe=36,He=0,$e=new Map,ie=Ae&&new Map,K;return Te.split(",").forEach(function ce(fe){if(fe.indexOf("+")!==-1)for(var me=+fe;me--;)ce(K);else{K=fe;var $=fe.split(">"),Le=$[0],Xe=$[1];Le=String.fromCodePoint(He+=parseInt(Le,Pe)),Xe=String.fromCodePoint(He+=parseInt(Xe,Pe)),$e.set(Le,Xe),Ae&&ie.set(Xe,Le)}}),{map:$e,reverseMap:ie}}var y,p,x;function _(){if(!y){var Te=b(g.pairs,!0),Ae=Te.map,Pe=Te.reverseMap;y=Ae,p=Pe,x=b(g.canonical,!1).map}}function w(Te){return _(),y.get(Te)||null}function M(Te){return _(),p.get(Te)||null}function S(Te){return _(),x.get(Te)||null}var A=i.L,C=i.R,D=i.EN,R=i.ES,N=i.ET,U=i.AN,j=i.CS,z=i.B,q=i.S,B=i.ON,G=i.BN,H=i.NSM,W=i.AL,F=i.LRO,Y=i.RLO,Z=i.LRE,V=i.RLE,de=i.PDF,se=i.LRI,oe=i.RLI,ue=i.FSI,_e=i.PDI;function ke(Te,Ae){for(var Pe=125,He=new Uint32Array(Te.length),$e=0;$e<Te.length;$e++)He[$e]=h(Te[$e]);var ie=new Map;function K(le,ae){var Re=He[le];He[le]=ae,ie.set(Re,ie.get(Re)-1),Re&o&&ie.set(o,ie.get(o)-1),ie.set(ae,(ie.get(ae)||0)+1),ae&o&&ie.set(o,(ie.get(o)||0)+1)}for(var ce=new Uint8Array(Te.length),fe=new Map,me=[],$=null,Le=0;Le<Te.length;Le++)$||me.push($={start:Le,end:Te.length-1,level:Ae==="rtl"?1:Ae==="ltr"?0:Nc(Le,!1)}),He[Le]&z&&($.end=Le,$=null);for(var Xe=V|Z|Y|F|a|_e|de|z,mt=function(le){return le+(le&1?1:2)},Ge=function(le){return le+(le&1?2:1)},Je=0;Je<me.length;Je++){$=me[Je];var tt=[{_level:$.level,_override:0,_isolate:0}],xt=void 0,Tt=0,bt=0,Rt=0;ie.clear();for(var Oe=$.start;Oe<=$.end;Oe++){var Ve=He[Oe];if(xt=tt[tt.length-1],ie.set(Ve,(ie.get(Ve)||0)+1),Ve&o&&ie.set(o,(ie.get(o)||0)+1),Ve&Xe)if(Ve&(V|Z)){ce[Oe]=xt._level;var ht=(Ve===V?Ge:mt)(xt._level);ht<=Pe&&!Tt&&!bt?tt.push({_level:ht,_override:0,_isolate:0}):Tt||bt++}else if(Ve&(Y|F)){ce[Oe]=xt._level;var Ft=(Ve===Y?Ge:mt)(xt._level);Ft<=Pe&&!Tt&&!bt?tt.push({_level:Ft,_override:Ve&Y?C:A,_isolate:0}):Tt||bt++}else if(Ve&a){Ve&ue&&(Ve=Nc(Oe+1,!0)===1?oe:se),ce[Oe]=xt._level,xt._override&&K(Oe,xt._override);var st=(Ve===oe?Ge:mt)(xt._level);st<=Pe&&Tt===0&&bt===0?(Rt++,tt.push({_level:st,_override:0,_isolate:1,_isolInitIndex:Oe})):Tt++}else if(Ve&_e){if(Tt>0)Tt--;else if(Rt>0){for(bt=0;!tt[tt.length-1]._isolate;)tt.pop();var it=tt[tt.length-1]._isolInitIndex;it!=null&&(fe.set(it,Oe),fe.set(Oe,it)),tt.pop(),Rt--}xt=tt[tt.length-1],ce[Oe]=xt._level,xt._override&&K(Oe,xt._override)}else Ve&de?(Tt===0&&(bt>0?bt--:!xt._isolate&&tt.length>1&&(tt.pop(),xt=tt[tt.length-1])),ce[Oe]=xt._level):Ve&z&&(ce[Oe]=$.level);else ce[Oe]=xt._level,xt._override&&Ve!==G&&K(Oe,xt._override)}for(var vt=[],Kt=null,Xt=$.start;Xt<=$.end;Xt++){var cn=He[Xt];if(!(cn&l)){var Gn=ce[Xt],bn=cn&a,Jn=cn===_e;Kt&&Gn===Kt._level?(Kt._end=Xt,Kt._endsWithIsolInit=bn):vt.push(Kt={_start:Xt,_end:Xt,_level:Gn,_startsWithPDI:Jn,_endsWithIsolInit:bn})}}for(var ai=[],vi=0;vi<vt.length;vi++){var Yn=vt[vi];if(!Yn._startsWithPDI||Yn._startsWithPDI&&!fe.has(Yn._start)){for(var Yi=[Kt=Yn],ci=void 0;Kt&&Kt._endsWithIsolInit&&(ci=fe.get(Kt._end))!=null;)for(var hn=vi+1;hn<vt.length;hn++)if(vt[hn]._start===ci){Yi.push(Kt=vt[hn]);break}for(var ui=[],$n=0;$n<Yi.length;$n++)for(var re=Yi[$n],ge=re._start;ge<=re._end;ge++)ui.push(ge);for(var je=ce[ui[0]],rt=$.level,dt=ui[0]-1;dt>=0;dt--)if(!(He[dt]&l)){rt=ce[dt];break}var ot=ui[ui.length-1],kt=ce[ot],ee=$.level;if(!(He[ot]&a)){for(var ye=ot+1;ye<=$.end;ye++)if(!(He[ye]&l)){ee=ce[ye];break}}ai.push({_seqIndices:ui,_sosType:Math.max(rt,je)%2?C:A,_eosType:Math.max(ee,kt)%2?C:A})}}for(var Ce=0;Ce<ai.length;Ce++){var De=ai[Ce],ve=De._seqIndices,_t=De._sosType,lt=De._eosType,yt=ce[ve[0]]&1?C:A;if(ie.get(H))for(var St=0;St<ve.length;St++){var Nt=ve[St];if(He[Nt]&H){for(var Ht=_t,at=St-1;at>=0;at--)if(!(He[ve[at]]&l)){Ht=He[ve[at]];break}K(Nt,Ht&(a|_e)?B:Ht)}}if(ie.get(D))for(var nn=0;nn<ve.length;nn++){var un=ve[nn];if(He[un]&D)for(var dn=nn-1;dn>=-1;dn--){var On=dn===-1?_t:He[ve[dn]];if(On&s){On===W&&K(un,U);break}}}if(ie.get(W))for(var $t=0;$t<ve.length;$t++){var Yt=ve[$t];He[Yt]&W&&K(Yt,C)}if(ie.get(R)||ie.get(j))for(var Pn=1;Pn<ve.length-1;Pn++){var wn=ve[Pn];if(He[wn]&(R|j)){for(var Xn=0,En=0,Mn=Pn-1;Mn>=0&&(Xn=He[ve[Mn]],!!(Xn&l));Mn--);for(var pn=Pn+1;pn<ve.length&&(En=He[ve[pn]],!!(En&l));pn++);Xn===En&&(He[wn]===R?Xn===D:Xn&(D|U))&&K(wn,Xn)}}if(ie.get(D))for(var rn=0;rn<ve.length;rn++){var yi=ve[rn];if(He[yi]&D){for(var Li=rn-1;Li>=0&&He[ve[Li]]&(N|l);Li--)K(ve[Li],D);for(rn++;rn<ve.length&&He[ve[rn]]&(N|l|D);rn++)He[ve[rn]]!==D&&K(ve[rn],D)}}if(ie.get(N)||ie.get(R)||ie.get(j))for(var Wn=0;Wn<ve.length;Wn++){var Oi=ve[Wn];if(He[Oi]&(N|R|j)){K(Oi,B);for(var ya=Wn-1;ya>=0&&He[ve[ya]]&l;ya--)K(ve[ya],B);for(var Ji=Wn+1;Ji<ve.length&&He[ve[Ji]]&l;Ji++)K(ve[Ji],B)}}if(ie.get(D))for(var Xo=0,Bs=_t;Xo<ve.length;Xo++){var ao=ve[Xo],so=He[ao];so&D?Bs===A&&K(ao,A):so&s&&(Bs=so)}if(ie.get(o)){var In=C|D|U,zs=In|A,Ha=[];{for(var Va=[],xa=0;xa<ve.length;xa++)if(He[ve[xa]]&o){var oo=Te[ve[xa]],js=void 0;if(w(oo)!==null)if(Va.length<63)Va.push({char:oo,seqIndex:xa});else break;else if((js=M(oo))!==null)for(var Ro=Va.length-1;Ro>=0;Ro--){var E=Va[Ro].char;if(E===js||E===M(S(oo))||w(S(E))===oo){Ha.push([Va[Ro].seqIndex,xa]),Va.length=Ro;break}}}Ha.sort(function(le,ae){return le[0]-ae[0]})}for(var L=0;L<Ha.length;L++){for(var J=Ha[L],ne=J[0],xe=J[1],Ke=!1,et=0,Lt=ne+1;Lt<xe;Lt++){var zt=ve[Lt];if(He[zt]&zs){Ke=!0;var mn=He[zt]&In?C:A;if(mn===yt){et=mn;break}}}if(Ke&&!et){et=_t;for(var _n=ne-1;_n>=0;_n--){var Si=ve[_n];if(He[Si]&zs){var An=He[Si]&In?C:A;An!==yt?et=An:et=yt;break}}}if(et){if(He[ve[ne]]=He[ve[xe]]=et,et!==yt){for(var ni=ne+1;ni<ve.length;ni++)if(!(He[ve[ni]]&l)){h(Te[ve[ni]])&H&&(He[ve[ni]]=et);break}}if(et!==yt){for(var Er=xe+1;Er<ve.length;Er++)if(!(He[ve[Er]]&l)){h(Te[ve[Er]])&H&&(He[ve[Er]]=et);break}}}}for(var wi=0;wi<ve.length;wi++)if(He[ve[wi]]&o){for(var ji=wi,Pi=wi,fi=_t,Da=wi-1;Da>=0;Da--)if(He[ve[Da]]&l)ji=Da;else{fi=He[ve[Da]]&In?C:A;break}for(var Ll=lt,Ko=wi+1;Ko<ve.length;Ko++)if(He[ve[Ko]]&(o|l))Pi=Ko;else{Ll=He[ve[Ko]]&In?C:A;break}for(var os=ji;os<=Pi;os++)He[ve[os]]=fi===Ll?fi:yt;wi=Pi}}}for(var Ei=$.start;Ei<=$.end;Ei++){var ep=ce[Ei],xr=He[Ei];if(ep&1?xr&(A|D|U)&&ce[Ei]++:xr&C?ce[Ei]++:xr&(U|D)&&(ce[Ei]+=2),xr&l&&(ce[Ei]=Ei===0?$.level:ce[Ei-1]),Ei===$.end||h(Te[Ei])&(q|z))for(var ls=Ei;ls>=0&&h(Te[ls])&c;ls--)ce[ls]=$.level}}return{levels:ce,paragraphs:me};function Nc(le,ae){for(var Re=le;Re<Te.length;Re++){var Ze=He[Re];if(Ze&(C|W))return 1;if(Ze&(z|A)||ae&&Ze===_e)return 0;if(Ze&a){var pt=Hs(Re);Re=pt===-1?Te.length:pt}}return 0}function Hs(le){for(var ae=1,Re=le+1;Re<Te.length;Re++){var Ze=He[Re];if(Ze&z)break;if(Ze&_e){if(--ae===0)return Re}else Ze&a&&ae++}return-1}}var Ne="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",Ue;function ze(){if(!Ue){var Te=b(Ne,!0),Ae=Te.map,Pe=Te.reverseMap;Pe.forEach(function(He,$e){Ae.set($e,He)}),Ue=Ae}}function pe(Te){return ze(),Ue.get(Te)||null}function Fe(Te,Ae,Pe,He){var $e=Te.length;Pe=Math.max(0,Pe==null?0:+Pe),He=Math.min($e-1,He==null?$e-1:+He);for(var ie=new Map,K=Pe;K<=He;K++)if(Ae[K]&1){var ce=pe(Te[K]);ce!==null&&ie.set(K,ce)}return ie}function Ie(Te,Ae,Pe,He){var $e=Te.length;Pe=Math.max(0,Pe==null?0:+Pe),He=Math.min($e-1,He==null?$e-1:+He);var ie=[];return Ae.paragraphs.forEach(function(K){var ce=Math.max(Pe,K.start),fe=Math.min(He,K.end);if(ce<fe){for(var me=Ae.levels.slice(ce,fe+1),$=fe;$>=ce&&h(Te[$])&c;$--)me[$]=K.level;for(var Le=K.level,Xe=1/0,mt=0;mt<me.length;mt++){var Ge=me[mt];Ge>Le&&(Le=Ge),Ge<Xe&&(Xe=Ge|1)}for(var Je=Le;Je>=Xe;Je--)for(var tt=0;tt<me.length;tt++)if(me[tt]>=Je){for(var xt=tt;tt+1<me.length&&me[tt+1]>=Je;)tt++;tt>xt&&ie.push([xt+ce,tt+ce])}}}),ie}function qe(Te,Ae,Pe,He){var $e=we(Te,Ae,Pe,He),ie=[].concat(Te);return $e.forEach(function(K,ce){ie[ce]=(Ae.levels[K]&1?pe(Te[K]):null)||Te[K]}),ie.join("")}function we(Te,Ae,Pe,He){for(var $e=Ie(Te,Ae,Pe,He),ie=[],K=0;K<Te.length;K++)ie[K]=K;return $e.forEach(function(ce){for(var fe=ce[0],me=ce[1],$=ie.slice(fe,me+1),Le=$.length;Le--;)ie[me-Le]=$[Le]}),ie}return e.closingToOpeningBracket=M,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=S,e.getEmbeddingLevels=ke,e.getMirroredCharacter=pe,e.getMirroredCharactersMap=Fe,e.getReorderSegments=Ie,e.getReorderedIndices=we,e.getReorderedString=qe,e.openingToClosingBracket=w,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}const OZ=/\bvoid\s+main\s*\(\s*\)\s*{/g;function bI(t){const e=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(i,r){let a=ln[r];return a?bI(a):i}return t.replace(e,n)}const bs=[];for(let t=0;t<256;t++)bs[t]=(t<16?"0":"")+t.toString(16);function hMe(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(bs[t&255]+bs[t>>8&255]+bs[t>>16&255]+bs[t>>24&255]+"-"+bs[e&255]+bs[e>>8&255]+"-"+bs[e>>16&15|64]+bs[e>>24&255]+"-"+bs[n&63|128]+bs[n>>8&255]+"-"+bs[n>>16&255]+bs[n>>24&255]+bs[i&255]+bs[i>>8&255]+bs[i>>16&255]+bs[i>>24&255]).toUpperCase()}const Np=Object.assign||function(){let t=arguments[0];for(let e=1,n=arguments.length;e<n;e++){let i=arguments[e];if(i)for(let r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},dMe=Date.now(),D5=new WeakMap,O5=new Map;let pMe=1e10;function J1(t,e){const n=vMe(e);let i=D5.get(t);if(i||D5.set(t,i=Object.create(null)),i[n])return new i[n];const r=`_onBeforeCompile${n}`,a=function(c,u){t.onBeforeCompile.call(this,c,u);const f=this.customProgramCacheKey()+"|"+c.vertexShader+"|"+c.fragmentShader;let h=O5[f];if(!h){const d=mMe(this,c,e,n);h=O5[f]=d}c.vertexShader=h.vertexShader,c.fragmentShader=h.fragmentShader,Np(c.uniforms,this.uniforms),e.timeUniform&&(c.uniforms[e.timeUniform]={get value(){return Date.now()-dMe}}),this[r]&&this[r](c)},s=function(){return o(e.chained?t:t.clone())},o=function(c){const u=Object.create(c,l);return Object.defineProperty(u,"baseMaterial",{value:t}),Object.defineProperty(u,"id",{value:pMe++}),u.uuid=hMe(),u.uniforms=Np({},c.uniforms,e.uniforms),u.defines=Np({},c.defines,e.defines),u.defines[`TROIKA_DERIVED_MATERIAL_${n}`]="",u.extensions=Np({},c.extensions,e.extensions),u._listeners=void 0,u},l={constructor:{value:s},isDerivedMaterial:{value:!0},type:{get:()=>t.type,set:c=>{t.type=c}},isDerivedFrom:{writable:!0,configurable:!0,value:function(c){const u=this.baseMaterial;return c===u||u.isDerivedMaterial&&u.isDerivedFrom(c)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return t.customProgramCacheKey()+"|"+n}},onBeforeCompile:{get(){return a},set(c){this[r]=c}},copy:{writable:!0,configurable:!0,value:function(c){return t.copy.call(this,c),!t.isShaderMaterial&&!t.isDerivedMaterial&&(Np(this.extensions,c.extensions),Np(this.defines,c.defines),Np(this.uniforms,av.clone(c.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){const c=new t.constructor;return o(c).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let c=this._depthMaterial;return c||(c=this._depthMaterial=J1(t.isDerivedMaterial?t.getDepthMaterial():new uC({depthPacking:UP}),e),c.defines.IS_DEPTH_MATERIAL="",c.uniforms=this.uniforms),c}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let c=this._distanceMaterial;return c||(c=this._distanceMaterial=J1(t.isDerivedMaterial?t.getDistanceMaterial():new fC,e),c.defines.IS_DISTANCE_MATERIAL="",c.uniforms=this.uniforms),c}},dispose:{writable:!0,configurable:!0,value(){const{_depthMaterial:c,_distanceMaterial:u}=this;c&&c.dispose(),u&&u.dispose(),t.dispose.call(this)}}};return i[n]=s,new s}function mMe(t,{vertexShader:e,fragmentShader:n},i,r){let{vertexDefs:a,vertexMainIntro:s,vertexMainOutro:o,vertexTransform:l,fragmentDefs:c,fragmentMainIntro:u,fragmentMainOutro:f,fragmentColorTransform:h,customRewriter:d,timeUniform:g}=i;if(a=a||"",s=s||"",o=o||"",c=c||"",u=u||"",f=f||"",(l||d)&&(e=bI(e)),(h||d)&&(n=n.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,`
//!BEGIN_POST_CHUNK $1
$&
//!END_POST_CHUNK
`),n=bI(n)),d){let b=d({vertexShader:e,fragmentShader:n});e=b.vertexShader,n=b.fragmentShader}if(h){let b=[];n=n.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,y=>(b.push(y),"")),f=`${h}
${b.join(`
`)}
${f}`}if(g){const b=`
uniform float ${g};
`;a=b+a,c=b+c}return l&&(e=`vec3 troika_position_${r};
vec3 troika_normal_${r};
vec2 troika_uv_${r};
${e}
`,a=`${a}
void troikaVertexTransform${r}(inout vec3 position, inout vec3 normal, inout vec2 uv) {
  ${l}
}
`,s=`
troika_position_${r} = vec3(position);
troika_normal_${r} = vec3(normal);
troika_uv_${r} = vec2(uv);
troikaVertexTransform${r}(troika_position_${r}, troika_normal_${r}, troika_uv_${r});
${s}
`,e=e.replace(/\b(position|normal|uv)\b/g,(b,y,p,x)=>/\battribute\s+vec[23]\s+$/.test(x.substr(0,p))?y:`troika_${y}_${r}`),t.map&&t.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${r}`))),e=I5(e,r,a,s,o),n=I5(n,r,c,u,f),{vertexShader:e,fragmentShader:n}}function I5(t,e,n,i,r){return(i||r||n)&&(t=t.replace(OZ,`
${n}
void troikaOrigMain${e}() {`),t+=`
void main() {
  ${i}
  troikaOrigMain${e}();
  ${r}
}`),t}function gMe(t,e){return t==="uniforms"?void 0:typeof e=="function"?e.toString():e}let bMe=0;const N5=new Map;function vMe(t){const e=JSON.stringify(t,gMe);let n=N5.get(e);return n==null&&N5.set(e,n=++bMe),n}/*!
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 yMe(){return typeof window>"u"&&(self.window=self),function(t){var e={parse:function(r){var a=e._bin,s=new Uint8Array(r);if(a.readASCII(s,0,4)=="ttcf"){var o=4;a.readUshort(s,o),o+=2,a.readUshort(s,o),o+=2;var l=a.readUint(s,o);o+=4;for(var c=[],u=0;u<l;u++){var f=a.readUint(s,o);o+=4,c.push(e._readFont(s,f))}return c}return[e._readFont(s,0)]},_readFont:function(r,a){var s=e._bin,o=a;s.readFixed(r,a),a+=4;var l=s.readUshort(r,a);a+=2,s.readUshort(r,a),a+=2,s.readUshort(r,a),a+=2,s.readUshort(r,a),a+=2;for(var c=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],u={_data:r,_offset:o},f={},h=0;h<l;h++){var d=s.readASCII(r,a,4);a+=4,s.readUint(r,a),a+=4;var g=s.readUint(r,a);a+=4;var b=s.readUint(r,a);a+=4,f[d]={offset:g,length:b}}for(h=0;h<c.length;h++){var y=c[h];f[y]&&(u[y.trim()]=e[y.trim()].parse(r,f[y].offset,f[y].length,u))}return u},_tabOffset:function(r,a,s){for(var o=e._bin,l=o.readUshort(r,s+4),c=s+12,u=0;u<l;u++){var f=o.readASCII(r,c,4);c+=4,o.readUint(r,c),c+=4;var h=o.readUint(r,c);if(c+=4,o.readUint(r,c),c+=4,f==a)return h}return 0}};e._bin={readFixed:function(r,a){return(r[a]<<8|r[a+1])+(r[a+2]<<8|r[a+3])/65540},readF2dot14:function(r,a){return e._bin.readShort(r,a)/16384},readInt:function(r,a){return e._bin._view(r).getInt32(a)},readInt8:function(r,a){return e._bin._view(r).getInt8(a)},readShort:function(r,a){return e._bin._view(r).getInt16(a)},readUshort:function(r,a){return e._bin._view(r).getUint16(a)},readUshorts:function(r,a,s){for(var o=[],l=0;l<s;l++)o.push(e._bin.readUshort(r,a+2*l));return o},readUint:function(r,a){return e._bin._view(r).getUint32(a)},readUint64:function(r,a){return 4294967296*e._bin.readUint(r,a)+e._bin.readUint(r,a+4)},readASCII:function(r,a,s){for(var o="",l=0;l<s;l++)o+=String.fromCharCode(r[a+l]);return o},readUnicode:function(r,a,s){for(var o="",l=0;l<s;l++){var c=r[a++]<<8|r[a++];o+=String.fromCharCode(c)}return o},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(r,a,s){var o=e._bin._tdec;return o&&a==0&&s==r.length?o.decode(r):e._bin.readASCII(r,a,s)},readBytes:function(r,a,s){for(var o=[],l=0;l<s;l++)o.push(r[a+l]);return o},readASCIIArray:function(r,a,s){for(var o=[],l=0;l<s;l++)o.push(String.fromCharCode(r[a+l]));return o},_view:function(r){return r._dataView||(r._dataView=r.buffer?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(new Uint8Array(r).buffer))}},e._lctf={},e._lctf.parse=function(r,a,s,o,l){var c=e._bin,u={},f=a;c.readFixed(r,a),a+=4;var h=c.readUshort(r,a);a+=2;var d=c.readUshort(r,a);a+=2;var g=c.readUshort(r,a);return a+=2,u.scriptList=e._lctf.readScriptList(r,f+h),u.featureList=e._lctf.readFeatureList(r,f+d),u.lookupList=e._lctf.readLookupList(r,f+g,l),u},e._lctf.readLookupList=function(r,a,s){var o=e._bin,l=a,c=[],u=o.readUshort(r,a);a+=2;for(var f=0;f<u;f++){var h=o.readUshort(r,a);a+=2;var d=e._lctf.readLookupTable(r,l+h,s);c.push(d)}return c},e._lctf.readLookupTable=function(r,a,s){var o=e._bin,l=a,c={tabs:[]};c.ltype=o.readUshort(r,a),a+=2,c.flag=o.readUshort(r,a),a+=2;var u=o.readUshort(r,a);a+=2;for(var f=c.ltype,h=0;h<u;h++){var d=o.readUshort(r,a);a+=2;var g=s(r,f,l+d,c);c.tabs.push(g)}return c},e._lctf.numOfOnes=function(r){for(var a=0,s=0;s<32;s++)r>>>s&1&&a++;return a},e._lctf.readClassDef=function(r,a){var s=e._bin,o=[],l=s.readUshort(r,a);if(a+=2,l==1){var c=s.readUshort(r,a);a+=2;var u=s.readUshort(r,a);a+=2;for(var f=0;f<u;f++)o.push(c+f),o.push(c+f),o.push(s.readUshort(r,a)),a+=2}if(l==2){var h=s.readUshort(r,a);for(a+=2,f=0;f<h;f++)o.push(s.readUshort(r,a)),a+=2,o.push(s.readUshort(r,a)),a+=2,o.push(s.readUshort(r,a)),a+=2}return o},e._lctf.getInterval=function(r,a){for(var s=0;s<r.length;s+=3){var o=r[s],l=r[s+1];if(r[s+2],o<=a&&a<=l)return s}return-1},e._lctf.readCoverage=function(r,a){var s=e._bin,o={};o.fmt=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);return a+=2,o.fmt==1&&(o.tab=s.readUshorts(r,a,l)),o.fmt==2&&(o.tab=s.readUshorts(r,a,3*l)),o},e._lctf.coverageIndex=function(r,a){var s=r.tab;if(r.fmt==1)return s.indexOf(a);if(r.fmt==2){var o=e._lctf.getInterval(s,a);if(o!=-1)return s[o+2]+(a-s[o])}return-1},e._lctf.readFeatureList=function(r,a){var s=e._bin,o=a,l=[],c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=s.readASCII(r,a,4);a+=4;var h=s.readUshort(r,a);a+=2;var d=e._lctf.readFeatureTable(r,o+h);d.tag=f.trim(),l.push(d)}return l},e._lctf.readFeatureTable=function(r,a){var s=e._bin,o=a,l={},c=s.readUshort(r,a);a+=2,c>0&&(l.featureParams=o+c);var u=s.readUshort(r,a);a+=2,l.tab=[];for(var f=0;f<u;f++)l.tab.push(s.readUshort(r,a+2*f));return l},e._lctf.readScriptList=function(r,a){var s=e._bin,o=a,l={},c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=s.readASCII(r,a,4);a+=4;var h=s.readUshort(r,a);a+=2,l[f.trim()]=e._lctf.readScriptTable(r,o+h)}return l},e._lctf.readScriptTable=function(r,a){var s=e._bin,o=a,l={},c=s.readUshort(r,a);a+=2,c>0&&(l.default=e._lctf.readLangSysTable(r,o+c));var u=s.readUshort(r,a);a+=2;for(var f=0;f<u;f++){var h=s.readASCII(r,a,4);a+=4;var d=s.readUshort(r,a);a+=2,l[h.trim()]=e._lctf.readLangSysTable(r,o+d)}return l},e._lctf.readLangSysTable=function(r,a){var s=e._bin,o={};s.readUshort(r,a),a+=2,o.reqFeature=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);return a+=2,o.features=s.readUshorts(r,a,l),o},e.CFF={},e.CFF.parse=function(r,a,s){var o=e._bin;(r=new Uint8Array(r.buffer,a,s))[a=0],r[++a],r[++a],r[++a],a++;var l=[];a=e.CFF.readIndex(r,a,l);for(var c=[],u=0;u<l.length-1;u++)c.push(o.readASCII(r,a+l[u],l[u+1]-l[u]));a+=l[l.length-1];var f=[];a=e.CFF.readIndex(r,a,f);var h=[];for(u=0;u<f.length-1;u++)h.push(e.CFF.readDict(r,a+f[u],a+f[u+1]));a+=f[f.length-1];var d=h[0],g=[];a=e.CFF.readIndex(r,a,g);var b=[];for(u=0;u<g.length-1;u++)b.push(o.readASCII(r,a+g[u],g[u+1]-g[u]));if(a+=g[g.length-1],e.CFF.readSubrs(r,a,d),d.CharStrings){a=d.CharStrings,g=[],a=e.CFF.readIndex(r,a,g);var y=[];for(u=0;u<g.length-1;u++)y.push(o.readBytes(r,a+g[u],g[u+1]-g[u]));d.CharStrings=y}if(d.ROS){a=d.FDArray;var p=[];for(a=e.CFF.readIndex(r,a,p),d.FDArray=[],u=0;u<p.length-1;u++){var x=e.CFF.readDict(r,a+p[u],a+p[u+1]);e.CFF._readFDict(r,x,b),d.FDArray.push(x)}a+=p[p.length-1],a=d.FDSelect,d.FDSelect=[];var _=r[a];if(a++,_!=3)throw _;var w=o.readUshort(r,a);for(a+=2,u=0;u<w+1;u++)d.FDSelect.push(o.readUshort(r,a),r[a+2]),a+=3}return d.Encoding&&(d.Encoding=e.CFF.readEncoding(r,d.Encoding,d.CharStrings.length)),d.charset&&(d.charset=e.CFF.readCharset(r,d.charset,d.CharStrings.length)),e.CFF._readFDict(r,d,b),d},e.CFF._readFDict=function(r,a,s){var o;for(var l in a.Private&&(o=a.Private[1],a.Private=e.CFF.readDict(r,o,o+a.Private[0]),a.Private.Subrs&&e.CFF.readSubrs(r,o+a.Private.Subrs,a.Private)),a)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(l)!=-1&&(a[l]=s[a[l]-426+35])},e.CFF.readSubrs=function(r,a,s){var o=e._bin,l=[];a=e.CFF.readIndex(r,a,l);var c,u=l.length;c=u<1240?107:u<33900?1131:32768,s.Bias=c,s.Subrs=[];for(var f=0;f<l.length-1;f++)s.Subrs.push(o.readBytes(r,a+l[f],l[f+1]-l[f]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(r,a){for(var s=0;s<r.charset.length;s++)if(r.charset[s]==a)return s;return-1},e.CFF.glyphBySE=function(r,a){return a<0||a>255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[a])},e.CFF.readEncoding=function(r,a,s){e._bin;var o=[".notdef"],l=r[a];if(a++,l!=0)throw"error: unknown encoding format: "+l;var c=r[a];a++;for(var u=0;u<c;u++)o.push(r[a+u]);return o},e.CFF.readCharset=function(r,a,s){var o=e._bin,l=[".notdef"],c=r[a];if(a++,c==0)for(var u=0;u<s;u++){var f=o.readUshort(r,a);a+=2,l.push(f)}else{if(c!=1&&c!=2)throw"error: format: "+c;for(;l.length<s;){f=o.readUshort(r,a),a+=2;var h=0;for(c==1?(h=r[a],a++):(h=o.readUshort(r,a),a+=2),u=0;u<=h;u++)l.push(f),f++}}return l},e.CFF.readIndex=function(r,a,s){var o=e._bin,l=o.readUshort(r,a)+1,c=r[a+=2];if(a++,c==1)for(var u=0;u<l;u++)s.push(r[a+u]);else if(c==2)for(u=0;u<l;u++)s.push(o.readUshort(r,a+2*u));else if(c==3)for(u=0;u<l;u++)s.push(16777215&o.readUint(r,a+3*u-1));else if(l!=1)throw"unsupported offset size: "+c+", count: "+l;return(a+=l*c)-1},e.CFF.getCharString=function(r,a,s){var o=e._bin,l=r[a],c=r[a+1];r[a+2],r[a+3],r[a+4];var u=1,f=null,h=null;l<=20&&(f=l,u=1),l==12&&(f=100*l+c,u=2),21<=l&&l<=27&&(f=l,u=1),l==28&&(h=o.readShort(r,a+1),u=3),29<=l&&l<=31&&(f=l,u=1),32<=l&&l<=246&&(h=l-139,u=1),247<=l&&l<=250&&(h=256*(l-247)+c+108,u=2),251<=l&&l<=254&&(h=256*-(l-251)-c-108,u=2),l==255&&(h=o.readInt(r,a+1)/65535,u=5),s.val=h??"o"+f,s.size=u},e.CFF.readCharString=function(r,a,s){for(var o=a+s,l=e._bin,c=[];a<o;){var u=r[a],f=r[a+1];r[a+2],r[a+3],r[a+4];var h=1,d=null,g=null;u<=20&&(d=u,h=1),u==12&&(d=100*u+f,h=2),u!=19&&u!=20||(d=u,h=2),21<=u&&u<=27&&(d=u,h=1),u==28&&(g=l.readShort(r,a+1),h=3),29<=u&&u<=31&&(d=u,h=1),32<=u&&u<=246&&(g=u-139,h=1),247<=u&&u<=250&&(g=256*(u-247)+f+108,h=2),251<=u&&u<=254&&(g=256*-(u-251)-f-108,h=2),u==255&&(g=l.readInt(r,a+1)/65535,h=5),c.push(g??"o"+d),a+=h}return c},e.CFF.readDict=function(r,a,s){for(var o=e._bin,l={},c=[];a<s;){var u=r[a],f=r[a+1];r[a+2],r[a+3],r[a+4];var h=1,d=null,g=null;if(u==28&&(g=o.readShort(r,a+1),h=3),u==29&&(g=o.readInt(r,a+1),h=5),32<=u&&u<=246&&(g=u-139,h=1),247<=u&&u<=250&&(g=256*(u-247)+f+108,h=2),251<=u&&u<=254&&(g=256*-(u-251)-f-108,h=2),u==255)throw g=o.readInt(r,a+1)/65535,h=5,"unknown number";if(u==30){var b=[];for(h=1;;){var y=r[a+h];h++;var p=y>>4,x=15&y;if(p!=15&&b.push(p),x!=15&&b.push(x),x==15)break}for(var _="",w=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],M=0;M<b.length;M++)_+=w[b[M]];g=parseFloat(_)}u<=21&&(d=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][u],h=1,u==12&&(d=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][f],h=2)),d!=null?(l[d]=c.length==1?c[0]:c,c=[]):c.push(g),a+=h}return l},e.cmap={},e.cmap.parse=function(r,a,s){r=new Uint8Array(r.buffer,a,s),a=0;var o=e._bin,l={};o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);a+=2;var u=[];l.tables=[];for(var f=0;f<c;f++){var h=o.readUshort(r,a);a+=2;var d=o.readUshort(r,a);a+=2;var g=o.readUint(r,a);a+=4;var b="p"+h+"e"+d,y=u.indexOf(g);if(y==-1){var p;y=l.tables.length,u.push(g);var x=o.readUshort(r,g);x==0?p=e.cmap.parse0(r,g):x==4?p=e.cmap.parse4(r,g):x==6?p=e.cmap.parse6(r,g):x==12?p=e.cmap.parse12(r,g):console.debug("unknown format: "+x,h,d,g),l.tables.push(p)}if(l[b]!=null)throw"multiple tables for one platform+encoding";l[b]=y}return l},e.cmap.parse0=function(r,a){var s=e._bin,o={};o.format=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);a+=2,s.readUshort(r,a),a+=2,o.map=[];for(var c=0;c<l-6;c++)o.map.push(r[a+c]);return o},e.cmap.parse4=function(r,a){var s=e._bin,o=a,l={};l.format=s.readUshort(r,a),a+=2;var c=s.readUshort(r,a);a+=2,s.readUshort(r,a),a+=2;var u=s.readUshort(r,a);a+=2;var f=u/2;l.searchRange=s.readUshort(r,a),a+=2,l.entrySelector=s.readUshort(r,a),a+=2,l.rangeShift=s.readUshort(r,a),a+=2,l.endCount=s.readUshorts(r,a,f),a+=2*f,a+=2,l.startCount=s.readUshorts(r,a,f),a+=2*f,l.idDelta=[];for(var h=0;h<f;h++)l.idDelta.push(s.readShort(r,a)),a+=2;for(l.idRangeOffset=s.readUshorts(r,a,f),a+=2*f,l.glyphIdArray=[];a<o+c;)l.glyphIdArray.push(s.readUshort(r,a)),a+=2;return l},e.cmap.parse6=function(r,a){var s=e._bin,o={};o.format=s.readUshort(r,a),a+=2,s.readUshort(r,a),a+=2,s.readUshort(r,a),a+=2,o.firstCode=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);a+=2,o.glyphIdArray=[];for(var c=0;c<l;c++)o.glyphIdArray.push(s.readUshort(r,a)),a+=2;return o},e.cmap.parse12=function(r,a){var s=e._bin,o={};o.format=s.readUshort(r,a),a+=2,a+=2,s.readUint(r,a),a+=4,s.readUint(r,a),a+=4;var l=s.readUint(r,a);a+=4,o.groups=[];for(var c=0;c<l;c++){var u=a+12*c,f=s.readUint(r,u+0),h=s.readUint(r,u+4),d=s.readUint(r,u+8);o.groups.push([f,h,d])}return o},e.glyf={},e.glyf.parse=function(r,a,s,o){for(var l=[],c=0;c<o.maxp.numGlyphs;c++)l.push(null);return l},e.glyf._parseGlyf=function(r,a){var s=e._bin,o=r._data,l=e._tabOffset(o,"glyf",r._offset)+r.loca[a];if(r.loca[a]==r.loca[a+1])return null;var c={};if(c.noc=s.readShort(o,l),l+=2,c.xMin=s.readShort(o,l),l+=2,c.yMin=s.readShort(o,l),l+=2,c.xMax=s.readShort(o,l),l+=2,c.yMax=s.readShort(o,l),l+=2,c.xMin>=c.xMax||c.yMin>=c.yMax)return null;if(c.noc>0){c.endPts=[];for(var u=0;u<c.noc;u++)c.endPts.push(s.readUshort(o,l)),l+=2;var f=s.readUshort(o,l);if(l+=2,o.length-l<f)return null;c.instructions=s.readBytes(o,l,f),l+=f;var h=c.endPts[c.noc-1]+1;for(c.flags=[],u=0;u<h;u++){var d=o[l];if(l++,c.flags.push(d),(8&d)!=0){var g=o[l];l++;for(var b=0;b<g;b++)c.flags.push(d),u++}}for(c.xs=[],u=0;u<h;u++){var y=(2&c.flags[u])!=0,p=(16&c.flags[u])!=0;y?(c.xs.push(p?o[l]:-o[l]),l++):p?c.xs.push(0):(c.xs.push(s.readShort(o,l)),l+=2)}for(c.ys=[],u=0;u<h;u++)y=(4&c.flags[u])!=0,p=(32&c.flags[u])!=0,y?(c.ys.push(p?o[l]:-o[l]),l++):p?c.ys.push(0):(c.ys.push(s.readShort(o,l)),l+=2);var x=0,_=0;for(u=0;u<h;u++)x+=c.xs[u],_+=c.ys[u],c.xs[u]=x,c.ys[u]=_}else{var w;c.parts=[];do{w=s.readUshort(o,l),l+=2;var M={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(c.parts.push(M),M.glyphIndex=s.readUshort(o,l),l+=2,1&w){var S=s.readShort(o,l);l+=2;var A=s.readShort(o,l);l+=2}else S=s.readInt8(o,l),l++,A=s.readInt8(o,l),l++;2&w?(M.m.tx=S,M.m.ty=A):(M.p1=S,M.p2=A),8&w?(M.m.a=M.m.d=s.readF2dot14(o,l),l+=2):64&w?(M.m.a=s.readF2dot14(o,l),l+=2,M.m.d=s.readF2dot14(o,l),l+=2):128&w&&(M.m.a=s.readF2dot14(o,l),l+=2,M.m.b=s.readF2dot14(o,l),l+=2,M.m.c=s.readF2dot14(o,l),l+=2,M.m.d=s.readF2dot14(o,l),l+=2)}while(32&w);if(256&w){var C=s.readUshort(o,l);for(l+=2,c.instr=[],u=0;u<C;u++)c.instr.push(o[l]),l++}}return c},e.GDEF={},e.GDEF.parse=function(r,a,s,o){var l=a;a+=4;var c=e._bin.readUshort(r,a);return{glyphClassDef:c===0?null:e._lctf.readClassDef(r,l+c)}},e.GPOS={},e.GPOS.parse=function(r,a,s,o){return e._lctf.parse(r,a,s,o,e.GPOS.subt)},e.GPOS.subt=function(r,a,s,o){var l=e._bin,c=s,u={};if(u.fmt=l.readUshort(r,s),s+=2,a==1||a==2||a==3||a==7||a==8&&u.fmt<=2){var f=l.readUshort(r,s);s+=2,u.coverage=e._lctf.readCoverage(r,f+c)}if(a==1&&u.fmt==1){var h=l.readUshort(r,s);s+=2,h!=0&&(u.pos=e.GPOS.readValueRecord(r,s,h))}else if(a==2&&u.fmt>=1&&u.fmt<=2){h=l.readUshort(r,s),s+=2;var d=l.readUshort(r,s);s+=2;var g=e._lctf.numOfOnes(h),b=e._lctf.numOfOnes(d);if(u.fmt==1){u.pairsets=[];var y=l.readUshort(r,s);s+=2;for(var p=0;p<y;p++){var x=c+l.readUshort(r,s);s+=2;var _=l.readUshort(r,x);x+=2;for(var w=[],M=0;M<_;M++){var S=l.readUshort(r,x);x+=2,h!=0&&(U=e.GPOS.readValueRecord(r,x,h),x+=2*g),d!=0&&(j=e.GPOS.readValueRecord(r,x,d),x+=2*b),w.push({gid2:S,val1:U,val2:j})}u.pairsets.push(w)}}if(u.fmt==2){var A=l.readUshort(r,s);s+=2;var C=l.readUshort(r,s);s+=2;var D=l.readUshort(r,s);s+=2;var R=l.readUshort(r,s);for(s+=2,u.classDef1=e._lctf.readClassDef(r,c+A),u.classDef2=e._lctf.readClassDef(r,c+C),u.matrix=[],p=0;p<D;p++){var N=[];for(M=0;M<R;M++){var U=null,j=null;h!=0&&(U=e.GPOS.readValueRecord(r,s,h),s+=2*g),d!=0&&(j=e.GPOS.readValueRecord(r,s,d),s+=2*b),N.push({val1:U,val2:j})}u.matrix.push(N)}}}else if(a==4&&u.fmt==1)u.markCoverage=e._lctf.readCoverage(r,l.readUshort(r,s)+c),u.baseCoverage=e._lctf.readCoverage(r,l.readUshort(r,s+2)+c),u.markClassCount=l.readUshort(r,s+4),u.markArray=e.GPOS.readMarkArray(r,l.readUshort(r,s+6)+c),u.baseArray=e.GPOS.readBaseArray(r,l.readUshort(r,s+8)+c,u.markClassCount);else if(a==6&&u.fmt==1)u.mark1Coverage=e._lctf.readCoverage(r,l.readUshort(r,s)+c),u.mark2Coverage=e._lctf.readCoverage(r,l.readUshort(r,s+2)+c),u.markClassCount=l.readUshort(r,s+4),u.mark1Array=e.GPOS.readMarkArray(r,l.readUshort(r,s+6)+c),u.mark2Array=e.GPOS.readBaseArray(r,l.readUshort(r,s+8)+c,u.markClassCount);else{if(a==9&&u.fmt==1){var z=l.readUshort(r,s);s+=2;var q=l.readUint(r,s);if(s+=4,o.ltype==9)o.ltype=z;else if(o.ltype!=z)throw"invalid extension substitution";return e.GPOS.subt(r,o.ltype,c+q)}console.debug("unsupported GPOS table LookupType",a,"format",u.fmt)}return u},e.GPOS.readValueRecord=function(r,a,s){var o=e._bin,l=[];return l.push(1&s?o.readShort(r,a):0),a+=1&s?2:0,l.push(2&s?o.readShort(r,a):0),a+=2&s?2:0,l.push(4&s?o.readShort(r,a):0),a+=4&s?2:0,l.push(8&s?o.readShort(r,a):0),a+=8&s?2:0,l},e.GPOS.readBaseArray=function(r,a,s){var o=e._bin,l=[],c=a,u=o.readUshort(r,a);a+=2;for(var f=0;f<u;f++){for(var h=[],d=0;d<s;d++)h.push(e.GPOS.readAnchorRecord(r,c+o.readUshort(r,a))),a+=2;l.push(h)}return l},e.GPOS.readMarkArray=function(r,a){var s=e._bin,o=[],l=a,c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=e.GPOS.readAnchorRecord(r,s.readUshort(r,a+2)+l);f.markClass=s.readUshort(r,a),o.push(f),a+=4}return o},e.GPOS.readAnchorRecord=function(r,a){var s=e._bin,o={};return o.fmt=s.readUshort(r,a),o.x=s.readShort(r,a+2),o.y=s.readShort(r,a+4),o},e.GSUB={},e.GSUB.parse=function(r,a,s,o){return e._lctf.parse(r,a,s,o,e.GSUB.subt)},e.GSUB.subt=function(r,a,s,o){var l=e._bin,c=s,u={};if(u.fmt=l.readUshort(r,s),s+=2,a!=1&&a!=2&&a!=4&&a!=5&&a!=6)return null;if(a==1||a==2||a==4||a==5&&u.fmt<=2||a==6&&u.fmt<=2){var f=l.readUshort(r,s);s+=2,u.coverage=e._lctf.readCoverage(r,c+f)}if(a==1&&u.fmt>=1&&u.fmt<=2){if(u.fmt==1)u.delta=l.readShort(r,s),s+=2;else if(u.fmt==2){var h=l.readUshort(r,s);s+=2,u.newg=l.readUshorts(r,s,h),s+=2*u.newg.length}}else if(a==2&&u.fmt==1){h=l.readUshort(r,s),s+=2,u.seqs=[];for(var d=0;d<h;d++){var g=l.readUshort(r,s)+c;s+=2;var b=l.readUshort(r,g);u.seqs.push(l.readUshorts(r,g+2,b))}}else if(a==4)for(u.vals=[],h=l.readUshort(r,s),s+=2,d=0;d<h;d++){var y=l.readUshort(r,s);s+=2,u.vals.push(e.GSUB.readLigatureSet(r,c+y))}else if(a==5&&u.fmt==2){if(u.fmt==2){var p=l.readUshort(r,s);s+=2,u.cDef=e._lctf.readClassDef(r,c+p),u.scset=[];var x=l.readUshort(r,s);for(s+=2,d=0;d<x;d++){var _=l.readUshort(r,s);s+=2,u.scset.push(_==0?null:e.GSUB.readSubClassSet(r,c+_))}}}else if(a==6&&u.fmt==3){if(u.fmt==3){for(d=0;d<3;d++){h=l.readUshort(r,s),s+=2;for(var w=[],M=0;M<h;M++)w.push(e._lctf.readCoverage(r,c+l.readUshort(r,s+2*M)));s+=2*h,d==0&&(u.backCvg=w),d==1&&(u.inptCvg=w),d==2&&(u.ahedCvg=w)}h=l.readUshort(r,s),s+=2,u.lookupRec=e.GSUB.readSubstLookupRecords(r,s,h)}}else{if(a==7&&u.fmt==1){var S=l.readUshort(r,s);s+=2;var A=l.readUint(r,s);if(s+=4,o.ltype==9)o.ltype=S;else if(o.ltype!=S)throw"invalid extension substitution";return e.GSUB.subt(r,o.ltype,c+A)}console.debug("unsupported GSUB table LookupType",a,"format",u.fmt)}return u},e.GSUB.readSubClassSet=function(r,a){var s=e._bin.readUshort,o=a,l=[],c=s(r,a);a+=2;for(var u=0;u<c;u++){var f=s(r,a);a+=2,l.push(e.GSUB.readSubClassRule(r,o+f))}return l},e.GSUB.readSubClassRule=function(r,a){var s=e._bin.readUshort,o={},l=s(r,a),c=s(r,a+=2);a+=2,o.input=[];for(var u=0;u<l-1;u++)o.input.push(s(r,a)),a+=2;return o.substLookupRecords=e.GSUB.readSubstLookupRecords(r,a,c),o},e.GSUB.readSubstLookupRecords=function(r,a,s){for(var o=e._bin.readUshort,l=[],c=0;c<s;c++)l.push(o(r,a),o(r,a+2)),a+=4;return l},e.GSUB.readChainSubClassSet=function(r,a){var s=e._bin,o=a,l=[],c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=s.readUshort(r,a);a+=2,l.push(e.GSUB.readChainSubClassRule(r,o+f))}return l},e.GSUB.readChainSubClassRule=function(r,a){for(var s=e._bin,o={},l=["backtrack","input","lookahead"],c=0;c<l.length;c++){var u=s.readUshort(r,a);a+=2,c==1&&u--,o[l[c]]=s.readUshorts(r,a,u),a+=2*o[l[c]].length}return u=s.readUshort(r,a),a+=2,o.subst=s.readUshorts(r,a,2*u),a+=2*o.subst.length,o},e.GSUB.readLigatureSet=function(r,a){var s=e._bin,o=a,l=[],c=s.readUshort(r,a);a+=2;for(var u=0;u<c;u++){var f=s.readUshort(r,a);a+=2,l.push(e.GSUB.readLigature(r,o+f))}return l},e.GSUB.readLigature=function(r,a){var s=e._bin,o={chain:[]};o.nglyph=s.readUshort(r,a),a+=2;var l=s.readUshort(r,a);a+=2;for(var c=0;c<l-1;c++)o.chain.push(s.readUshort(r,a)),a+=2;return o},e.head={},e.head.parse=function(r,a,s){var o=e._bin,l={};return o.readFixed(r,a),a+=4,l.fontRevision=o.readFixed(r,a),a+=4,o.readUint(r,a),a+=4,o.readUint(r,a),a+=4,l.flags=o.readUshort(r,a),a+=2,l.unitsPerEm=o.readUshort(r,a),a+=2,l.created=o.readUint64(r,a),a+=8,l.modified=o.readUint64(r,a),a+=8,l.xMin=o.readShort(r,a),a+=2,l.yMin=o.readShort(r,a),a+=2,l.xMax=o.readShort(r,a),a+=2,l.yMax=o.readShort(r,a),a+=2,l.macStyle=o.readUshort(r,a),a+=2,l.lowestRecPPEM=o.readUshort(r,a),a+=2,l.fontDirectionHint=o.readShort(r,a),a+=2,l.indexToLocFormat=o.readShort(r,a),a+=2,l.glyphDataFormat=o.readShort(r,a),a+=2,l},e.hhea={},e.hhea.parse=function(r,a,s){var o=e._bin,l={};return o.readFixed(r,a),a+=4,l.ascender=o.readShort(r,a),a+=2,l.descender=o.readShort(r,a),a+=2,l.lineGap=o.readShort(r,a),a+=2,l.advanceWidthMax=o.readUshort(r,a),a+=2,l.minLeftSideBearing=o.readShort(r,a),a+=2,l.minRightSideBearing=o.readShort(r,a),a+=2,l.xMaxExtent=o.readShort(r,a),a+=2,l.caretSlopeRise=o.readShort(r,a),a+=2,l.caretSlopeRun=o.readShort(r,a),a+=2,l.caretOffset=o.readShort(r,a),a+=2,a+=8,l.metricDataFormat=o.readShort(r,a),a+=2,l.numberOfHMetrics=o.readUshort(r,a),a+=2,l},e.hmtx={},e.hmtx.parse=function(r,a,s,o){for(var l=e._bin,c={aWidth:[],lsBearing:[]},u=0,f=0,h=0;h<o.maxp.numGlyphs;h++)h<o.hhea.numberOfHMetrics&&(u=l.readUshort(r,a),a+=2,f=l.readShort(r,a),a+=2),c.aWidth.push(u),c.lsBearing.push(f);return c},e.kern={},e.kern.parse=function(r,a,s,o){var l=e._bin,c=l.readUshort(r,a);if(a+=2,c==1)return e.kern.parseV1(r,a-2,s,o);var u=l.readUshort(r,a);a+=2;for(var f={glyph1:[],rval:[]},h=0;h<u;h++){a+=2,s=l.readUshort(r,a),a+=2;var d=l.readUshort(r,a);a+=2;var g=d>>>8;if((g&=15)!=0)throw"unknown kern table format: "+g;a=e.kern.readFormat0(r,a,f)}return f},e.kern.parseV1=function(r,a,s,o){var l=e._bin;l.readFixed(r,a),a+=4;var c=l.readUint(r,a);a+=4;for(var u={glyph1:[],rval:[]},f=0;f<c;f++){l.readUint(r,a),a+=4;var h=l.readUshort(r,a);a+=2,l.readUshort(r,a),a+=2;var d=h>>>8;if((d&=15)!=0)throw"unknown kern table format: "+d;a=e.kern.readFormat0(r,a,u)}return u},e.kern.readFormat0=function(r,a,s){var o=e._bin,l=-1,c=o.readUshort(r,a);a+=2,o.readUshort(r,a),a+=2,o.readUshort(r,a),a+=2,o.readUshort(r,a),a+=2;for(var u=0;u<c;u++){var f=o.readUshort(r,a);a+=2;var h=o.readUshort(r,a);a+=2;var d=o.readShort(r,a);a+=2,f!=l&&(s.glyph1.push(f),s.rval.push({glyph2:[],vals:[]}));var g=s.rval[s.rval.length-1];g.glyph2.push(h),g.vals.push(d),l=f}return a},e.loca={},e.loca.parse=function(r,a,s,o){var l=e._bin,c=[],u=o.head.indexToLocFormat,f=o.maxp.numGlyphs+1;if(u==0)for(var h=0;h<f;h++)c.push(l.readUshort(r,a+(h<<1))<<1);if(u==1)for(h=0;h<f;h++)c.push(l.readUint(r,a+(h<<2)));return c},e.maxp={},e.maxp.parse=function(r,a,s){var o=e._bin,l={},c=o.readUint(r,a);return a+=4,l.numGlyphs=o.readUshort(r,a),a+=2,c==65536&&(l.maxPoints=o.readUshort(r,a),a+=2,l.maxContours=o.readUshort(r,a),a+=2,l.maxCompositePoints=o.readUshort(r,a),a+=2,l.maxCompositeContours=o.readUshort(r,a),a+=2,l.maxZones=o.readUshort(r,a),a+=2,l.maxTwilightPoints=o.readUshort(r,a),a+=2,l.maxStorage=o.readUshort(r,a),a+=2,l.maxFunctionDefs=o.readUshort(r,a),a+=2,l.maxInstructionDefs=o.readUshort(r,a),a+=2,l.maxStackElements=o.readUshort(r,a),a+=2,l.maxSizeOfInstructions=o.readUshort(r,a),a+=2,l.maxComponentElements=o.readUshort(r,a),a+=2,l.maxComponentDepth=o.readUshort(r,a),a+=2),l},e.name={},e.name.parse=function(r,a,s){var o=e._bin,l={};o.readUshort(r,a),a+=2;var c=o.readUshort(r,a);a+=2,o.readUshort(r,a);for(var u,f=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],h=a+=2,d=0;d<c;d++){var g=o.readUshort(r,a);a+=2;var b=o.readUshort(r,a);a+=2;var y=o.readUshort(r,a);a+=2;var p=o.readUshort(r,a);a+=2;var x=o.readUshort(r,a);a+=2;var _=o.readUshort(r,a);a+=2;var w,M=f[p],S=h+12*c+_;if(g==0)w=o.readUnicode(r,S,x/2);else if(g==3&&b==0)w=o.readUnicode(r,S,x/2);else if(b==0)w=o.readASCII(r,S,x);else if(b==1)w=o.readUnicode(r,S,x/2);else if(b==3)w=o.readUnicode(r,S,x/2);else{if(g!=1)throw"unknown encoding "+b+", platformID: "+g;w=o.readASCII(r,S,x),console.debug("reading unknown MAC encoding "+b+" as ASCII")}var A="p"+g+","+y.toString(16);l[A]==null&&(l[A]={}),l[A][M!==void 0?M:p]=w,l[A]._lang=y}for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==1033)return l[C];for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==0)return l[C];for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==3084)return l[C];for(var C in l)if(l[C].postScriptName!=null)return l[C];for(var C in l){u=C;break}return console.debug("returning name table with languageID "+l[u]._lang),l[u]},e["OS/2"]={},e["OS/2"].parse=function(r,a,s){var o=e._bin.readUshort(r,a);a+=2;var l={};if(o==0)e["OS/2"].version0(r,a,l);else if(o==1)e["OS/2"].version1(r,a,l);else if(o==2||o==3||o==4)e["OS/2"].version2(r,a,l);else{if(o!=5)throw"unknown OS/2 table version: "+o;e["OS/2"].version5(r,a,l)}return l},e["OS/2"].version0=function(r,a,s){var o=e._bin;return s.xAvgCharWidth=o.readShort(r,a),a+=2,s.usWeightClass=o.readUshort(r,a),a+=2,s.usWidthClass=o.readUshort(r,a),a+=2,s.fsType=o.readUshort(r,a),a+=2,s.ySubscriptXSize=o.readShort(r,a),a+=2,s.ySubscriptYSize=o.readShort(r,a),a+=2,s.ySubscriptXOffset=o.readShort(r,a),a+=2,s.ySubscriptYOffset=o.readShort(r,a),a+=2,s.ySuperscriptXSize=o.readShort(r,a),a+=2,s.ySuperscriptYSize=o.readShort(r,a),a+=2,s.ySuperscriptXOffset=o.readShort(r,a),a+=2,s.ySuperscriptYOffset=o.readShort(r,a),a+=2,s.yStrikeoutSize=o.readShort(r,a),a+=2,s.yStrikeoutPosition=o.readShort(r,a),a+=2,s.sFamilyClass=o.readShort(r,a),a+=2,s.panose=o.readBytes(r,a,10),a+=10,s.ulUnicodeRange1=o.readUint(r,a),a+=4,s.ulUnicodeRange2=o.readUint(r,a),a+=4,s.ulUnicodeRange3=o.readUint(r,a),a+=4,s.ulUnicodeRange4=o.readUint(r,a),a+=4,s.achVendID=[o.readInt8(r,a),o.readInt8(r,a+1),o.readInt8(r,a+2),o.readInt8(r,a+3)],a+=4,s.fsSelection=o.readUshort(r,a),a+=2,s.usFirstCharIndex=o.readUshort(r,a),a+=2,s.usLastCharIndex=o.readUshort(r,a),a+=2,s.sTypoAscender=o.readShort(r,a),a+=2,s.sTypoDescender=o.readShort(r,a),a+=2,s.sTypoLineGap=o.readShort(r,a),a+=2,s.usWinAscent=o.readUshort(r,a),a+=2,s.usWinDescent=o.readUshort(r,a),a+=2},e["OS/2"].version1=function(r,a,s){var o=e._bin;return a=e["OS/2"].version0(r,a,s),s.ulCodePageRange1=o.readUint(r,a),a+=4,s.ulCodePageRange2=o.readUint(r,a),a+=4},e["OS/2"].version2=function(r,a,s){var o=e._bin;return a=e["OS/2"].version1(r,a,s),s.sxHeight=o.readShort(r,a),a+=2,s.sCapHeight=o.readShort(r,a),a+=2,s.usDefault=o.readUshort(r,a),a+=2,s.usBreak=o.readUshort(r,a),a+=2,s.usMaxContext=o.readUshort(r,a),a+=2},e["OS/2"].version5=function(r,a,s){var o=e._bin;return a=e["OS/2"].version2(r,a,s),s.usLowerOpticalPointSize=o.readUshort(r,a),a+=2,s.usUpperOpticalPointSize=o.readUshort(r,a),a+=2},e.post={},e.post.parse=function(r,a,s){var o=e._bin,l={};return l.version=o.readFixed(r,a),a+=4,l.italicAngle=o.readFixed(r,a),a+=4,l.underlinePosition=o.readShort(r,a),a+=2,l.underlineThickness=o.readShort(r,a),a+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(r,a){var s=r.cmap,o=-1;if(s.p0e4!=null?o=s.p0e4:s.p3e1!=null?o=s.p3e1:s.p1e0!=null?o=s.p1e0:s.p0e3!=null&&(o=s.p0e3),o==-1)throw"no familiar platform and encoding!";var l=s.tables[o];if(l.format==0)return a>=l.map.length?0:l.map[a];if(l.format==4){for(var c=-1,u=0;u<l.endCount.length;u++)if(a<=l.endCount[u]){c=u;break}return c==-1||l.startCount[c]>a?0:65535&(l.idRangeOffset[c]!=0?l.glyphIdArray[a-l.startCount[c]+(l.idRangeOffset[c]>>1)-(l.idRangeOffset.length-c)]:a+l.idDelta[c])}if(l.format==12){if(a>l.groups[l.groups.length-1][1])return 0;for(u=0;u<l.groups.length;u++){var f=l.groups[u];if(f[0]<=a&&a<=f[1])return f[2]+(a-f[0])}return 0}throw"unknown cmap table format "+l.format},e.U.glyphToPath=function(r,a){var s={cmds:[],crds:[]};if(r.SVG&&r.SVG.entries[a]){var o=r.SVG.entries[a];return o==null?s:(typeof o=="string"&&(o=e.SVG.toPath(o),r.SVG.entries[a]=o),o)}if(r.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:r.CFF.Private?r.CFF.Private.defaultWidthX:0,open:!1},c=r.CFF,u=r.CFF.Private;if(c.ROS){for(var f=0;c.FDSelect[f+2]<=a;)f+=2;u=c.FDArray[c.FDSelect[f+1]].Private}e.U._drawCFF(r.CFF.CharStrings[a],l,c,u,s)}else r.glyf&&e.U._drawGlyf(a,r,s);return s},e.U._drawGlyf=function(r,a,s){var o=a.glyf[r];o==null&&(o=a.glyf[r]=e.glyf._parseGlyf(a,r)),o!=null&&(o.noc>-1?e.U._simpleGlyph(o,s):e.U._compoGlyph(o,a,s))},e.U._simpleGlyph=function(r,a){for(var s=0;s<r.noc;s++){for(var o=s==0?0:r.endPts[s-1]+1,l=r.endPts[s],c=o;c<=l;c++){var u=c==o?l:c-1,f=c==l?o:c+1,h=1&r.flags[c],d=1&r.flags[u],g=1&r.flags[f],b=r.xs[c],y=r.ys[c];if(c==o)if(h){if(!d){e.U.P.moveTo(a,b,y);continue}e.U.P.moveTo(a,r.xs[u],r.ys[u])}else d?e.U.P.moveTo(a,r.xs[u],r.ys[u]):e.U.P.moveTo(a,(r.xs[u]+b)/2,(r.ys[u]+y)/2);h?d&&e.U.P.lineTo(a,b,y):g?e.U.P.qcurveTo(a,b,y,r.xs[f],r.ys[f]):e.U.P.qcurveTo(a,b,y,(b+r.xs[f])/2,(y+r.ys[f])/2)}e.U.P.closePath(a)}},e.U._compoGlyph=function(r,a,s){for(var o=0;o<r.parts.length;o++){var l={cmds:[],crds:[]},c=r.parts[o];e.U._drawGlyf(c.glyphIndex,a,l);for(var u=c.m,f=0;f<l.crds.length;f+=2){var h=l.crds[f],d=l.crds[f+1];s.crds.push(h*u.a+d*u.b+u.tx),s.crds.push(h*u.c+d*u.d+u.ty)}for(f=0;f<l.cmds.length;f++)s.cmds.push(l.cmds[f])}},e.U._getGlyphClass=function(r,a){var s=e._lctf.getInterval(a,r);return s==-1?0:a[s+2]},e.U._applySubs=function(r,a,s,o){for(var l=r.length-a-1,c=0;c<s.tabs.length;c++)if(s.tabs[c]!=null){var u,f=s.tabs[c];if(!f.coverage||(u=e._lctf.coverageIndex(f.coverage,r[a]))!=-1){if(s.ltype==1)r[a],f.fmt==1?r[a]=r[a]+f.delta:r[a]=f.newg[u];else if(s.ltype==4)for(var h=f.vals[u],d=0;d<h.length;d++){var g=h[d],b=g.chain.length;if(!(b>l)){for(var y=!0,p=0,x=0;x<b;x++){for(;r[a+p+(1+x)]==-1;)p++;g.chain[x]!=r[a+p+(1+x)]&&(y=!1)}if(y){for(r[a]=g.nglyph,x=0;x<b+p;x++)r[a+x+1]=-1;break}}}else if(s.ltype==5&&f.fmt==2)for(var _=e._lctf.getInterval(f.cDef,r[a]),w=f.cDef[_+2],M=f.scset[w],S=0;S<M.length;S++){var A=M[S],C=A.input;if(!(C.length>l)){for(y=!0,x=0;x<C.length;x++){var D=e._lctf.getInterval(f.cDef,r[a+1+x]);if(_==-1&&f.cDef[D+2]!=C[x]){y=!1;break}}if(y){var R=A.substLookupRecords;for(d=0;d<R.length;d+=2)R[d],R[d+1]}}}else if(s.ltype==6&&f.fmt==3){if(!e.U._glsCovered(r,f.backCvg,a-f.backCvg.length)||!e.U._glsCovered(r,f.inptCvg,a)||!e.U._glsCovered(r,f.ahedCvg,a+f.inptCvg.length))continue;var N=f.lookupRec;for(S=0;S<N.length;S+=2){_=N[S];var U=o[N[S+1]];e.U._applySubs(r,a+_,U,o)}}}}},e.U._glsCovered=function(r,a,s){for(var o=0;o<a.length;o++)if(e._lctf.coverageIndex(a[o],r[s+o])==-1)return!1;return!0},e.U.glyphsToPath=function(r,a,s){for(var o={cmds:[],crds:[]},l=0,c=0;c<a.length;c++){var u=a[c];if(u!=-1){for(var f=c<a.length-1&&a[c+1]!=-1?a[c+1]:0,h=e.U.glyphToPath(r,u),d=0;d<h.crds.length;d+=2)o.crds.push(h.crds[d]+l),o.crds.push(h.crds[d+1]);for(s&&o.cmds.push(s),d=0;d<h.cmds.length;d++)o.cmds.push(h.cmds[d]);s&&o.cmds.push("X"),l+=r.hmtx.aWidth[u],c<a.length-1&&(l+=e.U.getPairAdjustment(r,u,f))}}return o},e.U.P={},e.U.P.moveTo=function(r,a,s){r.cmds.push("M"),r.crds.push(a,s)},e.U.P.lineTo=function(r,a,s){r.cmds.push("L"),r.crds.push(a,s)},e.U.P.curveTo=function(r,a,s,o,l,c,u){r.cmds.push("C"),r.crds.push(a,s,o,l,c,u)},e.U.P.qcurveTo=function(r,a,s,o,l){r.cmds.push("Q"),r.crds.push(a,s,o,l)},e.U.P.closePath=function(r){r.cmds.push("Z")},e.U._drawCFF=function(r,a,s,o,l){for(var c=a.stack,u=a.nStems,f=a.haveWidth,h=a.width,d=a.open,g=0,b=a.x,y=a.y,p=0,x=0,_=0,w=0,M=0,S=0,A=0,C=0,D=0,R=0,N={val:0,size:0};g<r.length;){e.CFF.getCharString(r,g,N);var U=N.val;if(g+=N.size,U=="o1"||U=="o18")c.length%2!=0&&!f&&(h=c.shift()+o.nominalWidthX),u+=c.length>>1,c.length=0,f=!0;else if(U=="o3"||U=="o23")c.length%2!=0&&!f&&(h=c.shift()+o.nominalWidthX),u+=c.length>>1,c.length=0,f=!0;else if(U=="o4")c.length>1&&!f&&(h=c.shift()+o.nominalWidthX,f=!0),d&&e.U.P.closePath(l),y+=c.pop(),e.U.P.moveTo(l,b,y),d=!0;else if(U=="o5")for(;c.length>0;)b+=c.shift(),y+=c.shift(),e.U.P.lineTo(l,b,y);else if(U=="o6"||U=="o7")for(var j=c.length,z=U=="o6",q=0;q<j;q++){var B=c.shift();z?b+=B:y+=B,z=!z,e.U.P.lineTo(l,b,y)}else if(U=="o8"||U=="o24"){j=c.length;for(var G=0;G+6<=j;)p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w+c.shift(),e.U.P.curveTo(l,p,x,_,w,b,y),G+=6;U=="o24"&&(b+=c.shift(),y+=c.shift(),e.U.P.lineTo(l,b,y))}else{if(U=="o11")break;if(U=="o1234"||U=="o1235"||U=="o1236"||U=="o1237")U=="o1234"&&(x=y,_=(p=b+c.shift())+c.shift(),R=w=x+c.shift(),S=w,C=y,b=(A=(M=(D=_+c.shift())+c.shift())+c.shift())+c.shift(),e.U.P.curveTo(l,p,x,_,w,D,R),e.U.P.curveTo(l,M,S,A,C,b,y)),U=="o1235"&&(p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),D=_+c.shift(),R=w+c.shift(),M=D+c.shift(),S=R+c.shift(),A=M+c.shift(),C=S+c.shift(),b=A+c.shift(),y=C+c.shift(),c.shift(),e.U.P.curveTo(l,p,x,_,w,D,R),e.U.P.curveTo(l,M,S,A,C,b,y)),U=="o1236"&&(p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),R=w=x+c.shift(),S=w,A=(M=(D=_+c.shift())+c.shift())+c.shift(),C=S+c.shift(),b=A+c.shift(),e.U.P.curveTo(l,p,x,_,w,D,R),e.U.P.curveTo(l,M,S,A,C,b,y)),U=="o1237"&&(p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),D=_+c.shift(),R=w+c.shift(),M=D+c.shift(),S=R+c.shift(),A=M+c.shift(),C=S+c.shift(),Math.abs(A-b)>Math.abs(C-y)?b=A+c.shift():y=C+c.shift(),e.U.P.curveTo(l,p,x,_,w,D,R),e.U.P.curveTo(l,M,S,A,C,b,y));else if(U=="o14"){if(c.length>0&&!f&&(h=c.shift()+s.nominalWidthX,f=!0),c.length==4){var H=c.shift(),W=c.shift(),F=c.shift(),Y=c.shift(),Z=e.CFF.glyphBySE(s,F),V=e.CFF.glyphBySE(s,Y);e.U._drawCFF(s.CharStrings[Z],a,s,o,l),a.x=H,a.y=W,e.U._drawCFF(s.CharStrings[V],a,s,o,l)}d&&(e.U.P.closePath(l),d=!1)}else if(U=="o19"||U=="o20")c.length%2!=0&&!f&&(h=c.shift()+o.nominalWidthX),u+=c.length>>1,c.length=0,f=!0,g+=u+7>>3;else if(U=="o21")c.length>2&&!f&&(h=c.shift()+o.nominalWidthX,f=!0),y+=c.pop(),b+=c.pop(),d&&e.U.P.closePath(l),e.U.P.moveTo(l,b,y),d=!0;else if(U=="o22")c.length>1&&!f&&(h=c.shift()+o.nominalWidthX,f=!0),b+=c.pop(),d&&e.U.P.closePath(l),e.U.P.moveTo(l,b,y),d=!0;else if(U=="o25"){for(;c.length>6;)b+=c.shift(),y+=c.shift(),e.U.P.lineTo(l,b,y);p=b+c.shift(),x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w+c.shift(),e.U.P.curveTo(l,p,x,_,w,b,y)}else if(U=="o26")for(c.length%2&&(b+=c.shift());c.length>0;)p=b,x=y+c.shift(),b=_=p+c.shift(),y=(w=x+c.shift())+c.shift(),e.U.P.curveTo(l,p,x,_,w,b,y);else if(U=="o27")for(c.length%2&&(y+=c.shift());c.length>0;)x=y,_=(p=b+c.shift())+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w,e.U.P.curveTo(l,p,x,_,w,b,y);else if(U=="o10"||U=="o29"){var de=U=="o10"?o:s;if(c.length==0)console.debug("error: empty stack");else{var se=c.pop(),oe=de.Subrs[se+de.Bias];a.x=b,a.y=y,a.nStems=u,a.haveWidth=f,a.width=h,a.open=d,e.U._drawCFF(oe,a,s,o,l),b=a.x,y=a.y,u=a.nStems,f=a.haveWidth,h=a.width,d=a.open}}else if(U=="o30"||U=="o31"){var ue=c.length,_e=(G=0,U=="o31");for(G+=ue-(j=-3&ue);G<j;)_e?(x=y,_=(p=b+c.shift())+c.shift(),y=(w=x+c.shift())+c.shift(),j-G==5?(b=_+c.shift(),G++):b=_,_e=!1):(p=b,x=y+c.shift(),_=p+c.shift(),w=x+c.shift(),b=_+c.shift(),j-G==5?(y=w+c.shift(),G++):y=w,_e=!0),e.U.P.curveTo(l,p,x,_,w,b,y),G+=4}else{if((U+"").charAt(0)=="o")throw console.debug("Unknown operation: "+U,r),U;c.push(U)}}}a.x=b,a.y=y,a.nStems=u,a.haveWidth=f,a.width=h,a.open=d};var n=e,i={Typr:n};return t.Typr=n,t.default=i,Object.defineProperty(t,"__esModule",{value:!0}),t}({}).Typr}/*!
Custom bundle of woff2otf (https://github.com/arty-name/woff2otf) with fflate
(https://github.com/101arrowz/fflate) for use in Troika text rendering. 
Original licenses apply: 
- fflate: https://github.com/101arrowz/fflate/blob/master/LICENSE (MIT)
- woff2otf.js: https://github.com/arty-name/woff2otf/blob/master/woff2otf.js (Apache2)
*/function xMe(){return function(t){var e=Uint8Array,n=Uint16Array,i=Uint32Array,r=new e([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]),a=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(U,j){for(var z=new n(31),q=0;q<31;++q)z[q]=j+=1<<U[q-1];var B=new i(z[30]);for(q=1;q<30;++q)for(var G=z[q];G<z[q+1];++G)B[G]=G-z[q]<<5|q;return[z,B]},l=o(r,2),c=l[0],u=l[1];c[28]=258,u[258]=28;for(var f=o(a,0)[0],h=new n(32768),d=0;d<32768;++d){var g=(43690&d)>>>1|(21845&d)<<1;g=(61680&(g=(52428&g)>>>2|(13107&g)<<2))>>>4|(3855&g)<<4,h[d]=((65280&g)>>>8|(255&g)<<8)>>>1}var b=function(U,j,z){for(var q=U.length,B=0,G=new n(j);B<q;++B)++G[U[B]-1];var H,W=new n(j);for(B=0;B<j;++B)W[B]=W[B-1]+G[B-1]<<1;{H=new n(1<<j);var F=15-j;for(B=0;B<q;++B)if(U[B])for(var Y=B<<4|U[B],Z=j-U[B],V=W[U[B]-1]++<<Z,de=V|(1<<Z)-1;V<=de;++V)H[h[V]>>>F]=Y}return H},y=new e(288);for(d=0;d<144;++d)y[d]=8;for(d=144;d<256;++d)y[d]=9;for(d=256;d<280;++d)y[d]=7;for(d=280;d<288;++d)y[d]=8;var p=new e(32);for(d=0;d<32;++d)p[d]=5;var x=b(y,9),_=b(p,5),w=function(U){for(var j=U[0],z=1;z<U.length;++z)U[z]>j&&(j=U[z]);return j},M=function(U,j,z){var q=j/8|0;return(U[q]|U[q+1]<<8)>>(7&j)&z},S=function(U,j){var z=j/8|0;return(U[z]|U[z+1]<<8|U[z+2]<<16)>>(7&j)},A=["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"],C=function(U,j,z){var q=new Error(j||A[U]);if(q.code=U,Error.captureStackTrace&&Error.captureStackTrace(q,C),!z)throw q;return q},D=function(U,j,z){var q=U.length;if(!q||z&&!z.l&&q<5)return j||new e(0);var B=!j||z,G=!z||z.i;z||(z={}),j||(j=new e(3*q));var H,W=function(xt){var Tt=j.length;if(xt>Tt){var bt=new e(Math.max(2*Tt,xt));bt.set(j),j=bt}},F=z.f||0,Y=z.p||0,Z=z.b||0,V=z.l,de=z.d,se=z.m,oe=z.n,ue=8*q;do{if(!V){z.f=F=M(U,Y,1);var _e=M(U,Y+1,3);if(Y+=3,!_e){var ke=U[(Pe=((H=Y)/8|0)+(7&H&&1)+4)-4]|U[Pe-3]<<8,Ne=Pe+ke;if(Ne>q){G&&C(0);break}B&&W(Z+ke),j.set(U.subarray(Pe,Ne),Z),z.b=Z+=ke,z.p=Y=8*Ne;continue}if(_e==1)V=x,de=_,se=9,oe=5;else if(_e==2){var Ue=M(U,Y,31)+257,ze=M(U,Y+10,15)+4,pe=Ue+M(U,Y+5,31)+1;Y+=14;for(var Fe=new e(pe),Ie=new e(19),qe=0;qe<ze;++qe)Ie[s[qe]]=M(U,Y+3*qe,7);Y+=3*ze;var we=w(Ie),Te=(1<<we)-1,Ae=b(Ie,we);for(qe=0;qe<pe;){var Pe,He=Ae[M(U,Y,Te)];if(Y+=15&He,(Pe=He>>>4)<16)Fe[qe++]=Pe;else{var $e=0,ie=0;for(Pe==16?(ie=3+M(U,Y,3),Y+=2,$e=Fe[qe-1]):Pe==17?(ie=3+M(U,Y,7),Y+=3):Pe==18&&(ie=11+M(U,Y,127),Y+=7);ie--;)Fe[qe++]=$e}}var K=Fe.subarray(0,Ue),ce=Fe.subarray(Ue);se=w(K),oe=w(ce),V=b(K,se),de=b(ce,oe)}else C(1);if(Y>ue){G&&C(0);break}}B&&W(Z+131072);for(var fe=(1<<se)-1,me=(1<<oe)-1,$=Y;;$=Y){var Le=($e=V[S(U,Y)&fe])>>>4;if((Y+=15&$e)>ue){G&&C(0);break}if($e||C(2),Le<256)j[Z++]=Le;else{if(Le==256){$=Y,V=null;break}var Xe=Le-254;if(Le>264){var mt=r[qe=Le-257];Xe=M(U,Y,(1<<mt)-1)+c[qe],Y+=mt}var Ge=de[S(U,Y)&me],Je=Ge>>>4;if(Ge||C(3),Y+=15&Ge,ce=f[Je],Je>3&&(mt=a[Je],ce+=S(U,Y)&(1<<mt)-1,Y+=mt),Y>ue){G&&C(0);break}B&&W(Z+131072);for(var tt=Z+Xe;Z<tt;Z+=4)j[Z]=j[Z-ce],j[Z+1]=j[Z+1-ce],j[Z+2]=j[Z+2-ce],j[Z+3]=j[Z+3-ce];Z=tt}}z.l=V,z.p=$,z.b=Z,V&&(F=1,z.m=se,z.d=de,z.n=oe)}while(!F);return Z==j.length?j:function(xt,Tt,bt){(bt==null||bt>xt.length)&&(bt=xt.length);var Rt=new(xt instanceof n?n:xt instanceof i?i:e)(bt-Tt);return Rt.set(xt.subarray(Tt,bt)),Rt}(j,0,Z)},R=new e(0),N=typeof TextDecoder<"u"&&new TextDecoder;try{N.decode(R,{stream:!0})}catch{}return t.convert_streams=function(U){var j=new DataView(U),z=0;function q(){var Ue=j.getUint16(z);return z+=2,Ue}function B(){var Ue=j.getUint32(z);return z+=4,Ue}function G(Ue){ke.setUint16(Ne,Ue),Ne+=2}function H(Ue){ke.setUint32(Ne,Ue),Ne+=4}for(var W={signature:B(),flavor:B(),length:B(),numTables:q(),reserved:q(),totalSfntSize:B(),majorVersion:q(),minorVersion:q(),metaOffset:B(),metaLength:B(),metaOrigLength:B(),privOffset:B(),privLength:B()},F=0;Math.pow(2,F)<=W.numTables;)F++;F--;for(var Y=16*Math.pow(2,F),Z=16*W.numTables-Y,V=12,de=[],se=0;se<W.numTables;se++)de.push({tag:B(),offset:B(),compLength:B(),origLength:B(),origChecksum:B()}),V+=16;var oe,ue=new Uint8Array(12+16*de.length+de.reduce(function(Ue,ze){return Ue+ze.origLength+4},0)),_e=ue.buffer,ke=new DataView(_e),Ne=0;return H(W.flavor),G(W.numTables),G(Y),G(F),G(Z),de.forEach(function(Ue){H(Ue.tag),H(Ue.origChecksum),H(V),H(Ue.origLength),Ue.outOffset=V,(V+=Ue.origLength)%4!=0&&(V+=4-V%4)}),de.forEach(function(Ue){var ze,pe=U.slice(Ue.offset,Ue.offset+Ue.compLength);if(Ue.compLength!=Ue.origLength){var Fe=new Uint8Array(Ue.origLength);ze=new Uint8Array(pe,2),D(ze,Fe)}else Fe=new Uint8Array(pe);ue.set(Fe,Ue.outOffset);var Ie=0;(V=Ue.outOffset+Ue.origLength)%4!=0&&(Ie=4-V%4),ue.set(new Uint8Array(Ie).buffer,Ue.outOffset+Ue.origLength),oe=V+Ie}),_e.slice(0,oe)},Object.defineProperty(t,"__esModule",{value:!0}),t}({}).convert_streams}function _Me(t,e){const n={M:2,L:2,Q:4,C:6,Z:0},i={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},r=1,a=2,s=4,o=8,l=16,c=32;let u;function f(A){if(!u){const C={R:a,L:r,D:s,C:l,U:c,T:o};u=new Map;for(let D in i){let R=0;i[D].split(",").forEach(N=>{let[U,j]=N.split("+");U=parseInt(U,36),j=j?parseInt(j,36):0,u.set(R+=U,C[D]);for(let z=j;z--;)u.set(++R,C[D])})}}return u.get(A)||c}const h=1,d=2,g=3,b=4,y=[null,"isol","init","fina","medi"];function p(A){const C=new Uint8Array(A.length);let D=c,R=h,N=-1;for(let U=0;U<A.length;U++){const j=A.codePointAt(U);let z=f(j)|0,q=h;z&o||(D&(r|s|l)?z&(a|s|l)?(q=g,(R===h||R===g)&&C[N]++):z&(r|c)&&(R===d||R===b)&&C[N]--:D&(a|c)&&(R===d||R===b)&&C[N]--,R=C[U]=q,D=z,N=U,j>65535&&U++)}return C}function x(A,C){const D=[];for(let N=0;N<C.length;N++){const U=C.codePointAt(N);U>65535&&N++,D.push(t.U.codeToGlyph(A,U))}const R=A.GSUB;if(R){const{lookupList:N,featureList:U}=R;let j;const z=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,q=[];U.forEach(B=>{if(z.test(B.tag))for(let G=0;G<B.tab.length;G++){if(q[B.tab[G]])continue;q[B.tab[G]]=!0;const H=N[B.tab[G]],W=/^(isol|init|fina|medi)$/.test(B.tag);W&&!j&&(j=p(C));for(let F=0;F<D.length;F++)(!j||!W||y[j[F]]===B.tag)&&t.U._applySubs(D,F,H,N)}})}return D}function _(A,C){const D=new Int16Array(C.length*3);let R=0;for(;R<C.length;R++){const z=C[R];if(z===-1)continue;D[R*3+2]=A.hmtx.aWidth[z];const q=A.GPOS;if(q){const B=q.lookupList;for(let G=0;G<B.length;G++){const H=B[G];for(let W=0;W<H.tabs.length;W++){const F=H.tabs[W];if(H.ltype===1){if(t._lctf.coverageIndex(F.coverage,z)!==-1&&F.pos){j(F.pos,R);break}}else if(H.ltype===2){let Y=null,Z=N();if(Z!==-1){const V=t._lctf.coverageIndex(F.coverage,C[Z]);if(V!==-1){if(F.fmt===1){const de=F.pairsets[V];for(let se=0;se<de.length;se++)de[se].gid2===z&&(Y=de[se])}else if(F.fmt===2){const de=t.U._getGlyphClass(C[Z],F.classDef1),se=t.U._getGlyphClass(z,F.classDef2);Y=F.matrix[de][se]}if(Y){Y.val1&&j(Y.val1,Z),Y.val2&&j(Y.val2,R);break}}}}else if(H.ltype===4){const Y=t._lctf.coverageIndex(F.markCoverage,z);if(Y!==-1){const Z=N(U),V=Z===-1?-1:t._lctf.coverageIndex(F.baseCoverage,C[Z]);if(V!==-1){const de=F.markArray[Y],se=F.baseArray[V][de.markClass];D[R*3]=se.x-de.x+D[Z*3]-D[Z*3+2],D[R*3+1]=se.y-de.y+D[Z*3+1];break}}}else if(H.ltype===6){const Y=t._lctf.coverageIndex(F.mark1Coverage,z);if(Y!==-1){const Z=N();if(Z!==-1){const V=C[Z];if(w(A,V)===3){const de=t._lctf.coverageIndex(F.mark2Coverage,V);if(de!==-1){const se=F.mark1Array[Y],oe=F.mark2Array[de][se.markClass];D[R*3]=oe.x-se.x+D[Z*3]-D[Z*3+2],D[R*3+1]=oe.y-se.y+D[Z*3+1];break}}}}}}}}else if(A.kern&&!A.cff){const B=N();if(B!==-1){const G=A.kern.glyph1.indexOf(C[B]);if(G!==-1){const H=A.kern.rval[G].glyph2.indexOf(z);H!==-1&&(D[B*3+2]+=A.kern.rval[G].vals[H])}}}}return D;function N(z){for(let q=R-1;q>=0;q--)if(C[q]!==-1&&(!z||z(C[q])))return q;return-1}function U(z){return w(A,z)===1}function j(z,q){for(let B=0;B<3;B++)D[q*3+B]+=z[B]||0}}function w(A,C){const D=A.GDEF&&A.GDEF.glyphClassDef;return D?t.U._getGlyphClass(C,D):0}function M(...A){for(let C=0;C<A.length;C++)if(typeof A[C]=="number")return A[C]}function S(A){const C=Object.create(null),D=A["OS/2"],R=A.hhea,N=A.head.unitsPerEm,U=M(D&&D.sTypoAscender,R&&R.ascender,N),j={unitsPerEm:N,ascender:U,descender:M(D&&D.sTypoDescender,R&&R.descender,0),capHeight:M(D&&D.sCapHeight,U),xHeight:M(D&&D.sxHeight,U),lineGap:M(D&&D.sTypoLineGap,R&&R.lineGap),supportsCodePoint(z){return t.U.codeToGlyph(A,z)>0},forEachGlyph(z,q,B,G){let H=0;const W=1/j.unitsPerEm*q,F=x(A,z);let Y=0;const Z=_(A,F);return F.forEach((V,de)=>{if(V!==-1){let se=C[V];if(!se){const{cmds:oe,crds:ue}=t.U.glyphToPath(A,V);let _e="",ke=0;for(let Fe=0,Ie=oe.length;Fe<Ie;Fe++){const qe=n[oe[Fe]];_e+=oe[Fe];for(let we=1;we<=qe;we++)_e+=(we>1?",":"")+ue[ke++]}let Ne,Ue,ze,pe;if(ue.length){Ne=Ue=1/0,ze=pe=-1/0;for(let Fe=0,Ie=ue.length;Fe<Ie;Fe+=2){let qe=ue[Fe],we=ue[Fe+1];qe<Ne&&(Ne=qe),we<Ue&&(Ue=we),qe>ze&&(ze=qe),we>pe&&(pe=we)}}else Ne=ze=Ue=pe=0;se=C[V]={index:V,advanceWidth:A.hmtx.aWidth[V],xMin:Ne,yMin:Ue,xMax:ze,yMax:pe,path:_e}}G.call(null,se,H+Z[de*3]*W,Z[de*3+1]*W,Y),H+=Z[de*3+2]*W,B&&(H+=B*q)}Y+=z.codePointAt(Y)>65535?2:1}),H}};return j}return function(C){const D=new Uint8Array(C,0,4),R=t._bin.readASCII(D,0,4);if(R==="wOFF")C=e(C);else if(R==="wOF2")throw new Error("woff2 fonts not supported");return S(t.parse(C)[0])}}const SMe=$v({name:"Typr Font Parser",dependencies:[yMe,xMe,_Me],init(t,e,n){const i=t(),r=e();return n(i,r)}});/*!
Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver)
for use in Troika text rendering. 
Original MIT license applies
*/function wMe(){return function(t){var e=function(){this.buckets=new Map};e.prototype.add=function(_){var w=_>>5;this.buckets.set(w,(this.buckets.get(w)||0)|1<<(31&_))},e.prototype.has=function(_){var w=this.buckets.get(_>>5);return w!==void 0&&(w&1<<(31&_))!=0},e.prototype.serialize=function(){var _=[];return this.buckets.forEach(function(w,M){_.push((+M).toString(36)+":"+w.toString(36))}),_.join(",")},e.prototype.deserialize=function(_){var w=this;this.buckets.clear(),_.split(",").forEach(function(M){var S=M.split(":");w.buckets.set(parseInt(S[0],36),parseInt(S[1],36))})};var n=Math.pow(2,8),i=n-1,r=~i;function a(_){var w=function(S){return S&r}(_).toString(16),M=function(S){return(S&r)+n-1}(_).toString(16);return"codepoint-index/plane"+(_>>16)+"/"+w+"-"+M+".json"}function s(_,w){var M=_&i,S=w.codePointAt(M/6|0);return((S=(S||48)-48)&1<<M%6)!=0}function o(_,w){var M;(M=_,M.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(S){return S.split("-").map(function(A){return parseInt(A.trim(),16)})})).forEach(function(S){var A=S[0],C=S[1];C===void 0&&(C=A),w(A,C)})}function l(_,w){o(_,function(M,S){for(var A=M;A<=S;A++)w(A)})}var c={},u={},f=new WeakMap,h="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function d(_){var w=f.get(_);return w||(w=new e,l(_.ranges,function(M){return w.add(M)}),f.set(_,w)),w}var g,b=new Map;function y(_,w,M){return _[w]?w:_[M]?M:function(S){for(var A in S)return A}(_)}function p(_,w){var M=w;if(!_.includes(M)){M=1/0;for(var S=0;S<_.length;S++)Math.abs(_[S]-w)<Math.abs(M-w)&&(M=_[S])}return M}function x(_){return g||(g=new Set,l("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(w){g.add(w)})),g.has(_)}return t.CodePointSet=e,t.clearCache=function(){c={},u={}},t.getFontsForString=function(_,w){w===void 0&&(w={});var M,S=w.lang;S===void 0&&(S=new RegExp("\\p{Script=Hangul}","u").test(M=_)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(M)?"ja":"en");var A=w.category;A===void 0&&(A="sans-serif");var C=w.style;C===void 0&&(C="normal");var D=w.weight;D===void 0&&(D=400);var R=(w.dataUrl||h).replace(/\/$/g,""),N=new Map,U=new Uint8Array(_.length),j={},z={},q=new Array(_.length),B=new Map,G=!1;function H(Y){var Z=b.get(Y);return Z||(Z=fetch(R+"/"+Y).then(function(V){if(!V.ok)throw new Error(V.statusText);return V.json().then(function(de){if(!Array.isArray(de)||de[0]!==1)throw new Error("Incorrect schema version; need 1, got "+de[0]);return de[1]})}).catch(function(V){if(R!==h)return G||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+R+'", trying default CDN. '+V.message),G=!0),R=h,b.delete(Y),H(Y);throw V}),b.set(Y,Z)),Z}for(var W=function(Y){var Z=_.codePointAt(Y),V=a(Z);q[Y]=V,c[V]||B.has(V)||B.set(V,H(V).then(function(de){c[V]=de})),Z>65535&&(Y++,F=Y)},F=0;F<_.length;F++)W(F);return Promise.all(B.values()).then(function(){B.clear();for(var Y=function(V){var de=_.codePointAt(V),se=null,oe=c[q[V]],ue=void 0;for(var _e in oe){var ke=z[_e];if(ke===void 0&&(ke=z[_e]=new RegExp(_e).test(S||"en")),ke){for(var Ne in ue=_e,oe[_e])if(s(de,oe[_e][Ne])){se=Ne;break}break}}if(!se){e:for(var Ue in oe)if(Ue!==ue){for(var ze in oe[Ue])if(s(de,oe[Ue][ze])){se=ze;break e}}}se||(console.debug("No font coverage for U+"+de.toString(16)),se="latin"),q[V]=se,u[se]||B.has(se)||B.set(se,H("font-meta/"+se+".json").then(function(pe){u[se]=pe})),de>65535&&(V++,Z=V)},Z=0;Z<_.length;Z++)Y(Z);return Promise.all(B.values())}).then(function(){for(var Y,Z=null,V=0;V<_.length;V++){var de=_.codePointAt(V);if(Z&&(x(de)||d(Z).has(de)))U[V]=U[V-1];else{Z=u[q[V]];var se=j[Z.id];if(!se){var oe=Z.typeforms,ue=y(oe,A,"sans-serif"),_e=y(oe[ue],C,"normal"),ke=p((Y=oe[ue])===null||Y===void 0?void 0:Y[_e],D);se=j[Z.id]=R+"/font-files/"+Z.id+"/"+ue+"."+_e+"."+ke+".woff"}var Ne=N.get(se);Ne==null&&(Ne=N.size,N.set(se,Ne)),U[V]=Ne}de>65535&&(V++,U[V]=U[V-1])}return{fontUrls:Array.from(N.keys()),chars:U}})},Object.defineProperty(t,"__esModule",{value:!0}),t}({})}function EMe(t,e){const n=Object.create(null),i=Object.create(null);function r(s,o){const l=c=>{console.error(`Failure loading font ${s}`,c)};try{const c=new XMLHttpRequest;c.open("get",s,!0),c.responseType="arraybuffer",c.onload=function(){if(c.status>=400)l(new Error(c.statusText));else if(c.status>0)try{const u=t(c.response);u.src=s,o(u)}catch(u){l(u)}},c.onerror=l,c.send()}catch(c){l(c)}}function a(s,o){let l=n[s];l?o(l):i[s]?i[s].push(o):(i[s]=[o],r(s,c=>{c.src=s,n[s]=c,i[s].forEach(u=>u(c)),delete i[s]}))}return function(s,o,{lang:l,fonts:c=[],style:u="normal",weight:f="normal",unicodeFontsURL:h}={}){const d=new Uint8Array(s.length),g=[];s.length||x();const b=new Map,y=[];if(u!=="italic"&&(u="normal"),typeof f!="number"&&(f=f==="bold"?700:400),c&&!Array.isArray(c)&&(c=[c]),c=c.slice().filter(w=>!w.lang||w.lang.test(l)).reverse(),c.length){let A=0;(function C(D=0){for(let R=D,N=s.length;R<N;R++){const U=s.codePointAt(R);if(A===1&&g[d[R-1]].supportsCodePoint(U)||R>0&&/\s/.test(s[R]))d[R]=d[R-1],A===2&&(y[y.length-1][1]=R);else for(let j=d[R],z=c.length;j<=z;j++)if(j===z){const q=A===2?y[y.length-1]:y[y.length]=[R,R];q[1]=R,A=2}else{d[R]=j;const{src:q,unicodeRange:B}=c[j];if(!B||_(U,B)){const G=n[q];if(!G){a(q,()=>{C(R)});return}if(G.supportsCodePoint(U)){let H=b.get(G);typeof H!="number"&&(H=g.length,g.push(G),b.set(G,H)),d[R]=H,A=1;break}}}U>65535&&R+1<N&&(d[R+1]=d[R],R++,A===2&&(y[y.length-1][1]=R))}p()})()}else y.push([0,s.length-1]),p();function p(){if(y.length){const w=y.map(M=>s.substring(M[0],M[1]+1)).join(`
`);e.getFontsForString(w,{lang:l||void 0,style:u,weight:f,dataUrl:h}).then(({fontUrls:M,chars:S})=>{const A=g.length;let C=0;y.forEach(R=>{for(let N=0,U=R[1]-R[0];N<=U;N++)d[R[0]+N]=S[C++]+A;C++});let D=0;M.forEach((R,N)=>{a(R,U=>{g[N+A]=U,++D===M.length&&x()})})})}else x()}function x(){o({chars:d,fonts:g})}function _(w,M){for(let S=0;S<M.length;S++){const[A,C=A]=M[S];if(A<=w&&w<=C)return!0}return!1}}}const MMe=$v({name:"FontResolver",dependencies:[EMe,SMe,wMe],init(t,e,n){return t(e,n())}});function TMe(t,e){const i=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,r="[^\\S\\u00A0]",a=new RegExp(`${r}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function s({text:g,lang:b,fonts:y,style:p,weight:x,preResolvedFonts:_,unicodeFontsURL:w},M){const S=({chars:A,fonts:C})=>{let D,R;const N=[];for(let U=0;U<A.length;U++)A[U]!==R?(R=A[U],N.push(D={start:U,end:U,fontObj:C[A[U]]})):D.end=U;M(N)};_?S(_):t(g,S,{lang:b,fonts:y,style:p,weight:x,unicodeFontsURL:w})}function o({text:g="",font:b,lang:y,sdfGlyphSize:p=64,fontSize:x=400,fontWeight:_=1,fontStyle:w="normal",letterSpacing:M=0,lineHeight:S="normal",maxWidth:A=1/0,direction:C,textAlign:D="left",textIndent:R=0,whiteSpace:N="normal",overflowWrap:U="normal",anchorX:j=0,anchorY:z=0,metricsOnly:q=!1,unicodeFontsURL:B,preResolvedFonts:G=null,includeCaretPositions:H=!1,chunkedBoundsSize:W=8192,colorRanges:F=null},Y){const Z=f(),V={fontLoad:0,typesetting:0};g.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),g=g.replace(/\r\n/g,`
`).replace(/\r/g,`
`)),x=+x,M=+M,A=+A,S=S||"normal",R=+R,s({text:g,lang:y,style:w,weight:_,fonts:typeof b=="string"?[{src:b}]:b,unicodeFontsURL:B,preResolvedFonts:G},de=>{V.fontLoad=f()-Z;const se=isFinite(A);let oe=null,ue=null,_e=null,ke=null,Ne=null,Ue=null,ze=null,pe=null,Fe=0,Ie=0,qe=N!=="nowrap";const we=new Map,Te=f();let Ae=R,Pe=0,He=new h;const $e=[He];de.forEach(me=>{const{fontObj:$}=me,{ascender:Le,descender:Xe,unitsPerEm:mt,lineGap:Ge,capHeight:Je,xHeight:tt}=$;let xt=we.get($);if(!xt){const Ve=x/mt,ht=S==="normal"?(Le-Xe+Ge)*Ve:S*x,Ft=(ht-(Le-Xe)*Ve)/2,st=Math.min(ht,(Le-Xe)*Ve),it=(Le+Xe)/2*Ve+st/2;xt={index:we.size,src:$.src,fontObj:$,fontSizeMult:Ve,unitsPerEm:mt,ascender:Le*Ve,descender:Xe*Ve,capHeight:Je*Ve,xHeight:tt*Ve,lineHeight:ht,baseline:-Ft-Le*Ve,caretTop:it,caretBottom:it-st},we.set($,xt)}const{fontSizeMult:Tt}=xt,bt=g.slice(me.start,me.end+1);let Rt,Oe;$.forEachGlyph(bt,x,M,(Ve,ht,Ft,st)=>{ht+=Pe,st+=me.start,Rt=ht,Oe=Ve;const it=g.charAt(st),vt=Ve.advanceWidth*Tt,Kt=He.count;let Xt;if("isEmpty"in Ve||(Ve.isWhitespace=!!it&&new RegExp(r).test(it),Ve.canBreakAfter=!!it&&a.test(it),Ve.isEmpty=Ve.xMin===Ve.xMax||Ve.yMin===Ve.yMax||i.test(it)),!Ve.isWhitespace&&!Ve.isEmpty&&Ie++,qe&&se&&!Ve.isWhitespace&&ht+vt+Ae>A&&Kt){if(He.glyphAt(Kt-1).glyphObj.canBreakAfter)Xt=new h,Ae=-ht;else for(let Gn=Kt;Gn--;)if(Gn===0&&U==="break-word"){Xt=new h,Ae=-ht;break}else if(He.glyphAt(Gn).glyphObj.canBreakAfter){Xt=He.splitAt(Gn+1);const bn=Xt.glyphAt(0).x;Ae-=bn;for(let Jn=Xt.count;Jn--;)Xt.glyphAt(Jn).x-=bn;break}Xt&&(He.isSoftWrapped=!0,He=Xt,$e.push(He),Fe=A)}let cn=He.glyphAt(He.count);cn.glyphObj=Ve,cn.x=ht+Ae,cn.y=Ft,cn.width=vt,cn.charIndex=st,cn.fontData=xt,it===`
`&&(He=new h,$e.push(He),Ae=-(ht+vt+M*x)+R)}),Pe=Rt+Oe.advanceWidth*Tt+M*x});let ie=0;$e.forEach(me=>{let $=!0;for(let Le=me.count;Le--;){const Xe=me.glyphAt(Le);$&&!Xe.glyphObj.isWhitespace&&(me.width=Xe.x+Xe.width,me.width>Fe&&(Fe=me.width),$=!1);let{lineHeight:mt,capHeight:Ge,xHeight:Je,baseline:tt}=Xe.fontData;mt>me.lineHeight&&(me.lineHeight=mt);const xt=tt-me.baseline;xt<0&&(me.baseline+=xt,me.cap+=xt,me.ex+=xt),me.cap=Math.max(me.cap,me.baseline+Ge),me.ex=Math.max(me.ex,me.baseline+Je)}me.baseline-=ie,me.cap-=ie,me.ex-=ie,ie+=me.lineHeight});let K=0,ce=0;if(j&&(typeof j=="number"?K=-j:typeof j=="string"&&(K=-Fe*(j==="left"?0:j==="center"?.5:j==="right"?1:c(j)))),z&&(typeof z=="number"?ce=-z:typeof z=="string"&&(ce=z==="top"?0:z==="top-baseline"?-$e[0].baseline:z==="top-cap"?-$e[0].cap:z==="top-ex"?-$e[0].ex:z==="middle"?ie/2:z==="bottom"?ie:z==="bottom-baseline"?-$e[$e.length-1].baseline:c(z)*ie)),!q){const me=e.getEmbeddingLevels(g,C);oe=new Uint16Array(Ie),ue=new Uint8Array(Ie),_e=new Float32Array(Ie*2),ke={},ze=[1/0,1/0,-1/0,-1/0],pe=[],H&&(Ue=new Float32Array(g.length*4)),F&&(Ne=new Uint8Array(Ie*3));let $=0,Le=-1,Xe=-1,mt,Ge;if($e.forEach((Je,tt)=>{let{count:xt,width:Tt}=Je;if(xt>0){let bt=0;for(let st=xt;st--&&Je.glyphAt(st).glyphObj.isWhitespace;)bt++;let Rt=0,Oe=0;if(D==="center")Rt=(Fe-Tt)/2;else if(D==="right")Rt=Fe-Tt;else if(D==="justify"&&Je.isSoftWrapped){let st=0;for(let it=xt-bt;it--;)Je.glyphAt(it).glyphObj.isWhitespace&&st++;Oe=(Fe-Tt)/st}if(Oe||Rt){let st=0;for(let it=0;it<xt;it++){let vt=Je.glyphAt(it);const Kt=vt.glyphObj;vt.x+=Rt+st,Oe!==0&&Kt.isWhitespace&&it<xt-bt&&(st+=Oe,vt.width+=Oe)}}const Ve=e.getReorderSegments(g,me,Je.glyphAt(0).charIndex,Je.glyphAt(Je.count-1).charIndex);for(let st=0;st<Ve.length;st++){const[it,vt]=Ve[st];let Kt=1/0,Xt=-1/0;for(let cn=0;cn<xt;cn++)if(Je.glyphAt(cn).charIndex>=it){let Gn=cn,bn=cn;for(;bn<xt;bn++){let Jn=Je.glyphAt(bn);if(Jn.charIndex>vt)break;bn<xt-bt&&(Kt=Math.min(Kt,Jn.x),Xt=Math.max(Xt,Jn.x+Jn.width))}for(let Jn=Gn;Jn<bn;Jn++){const ai=Je.glyphAt(Jn);ai.x=Xt-(ai.x+ai.width-Kt)}break}}let ht;const Ft=st=>ht=st;for(let st=0;st<xt;st++){const it=Je.glyphAt(st);ht=it.glyphObj;const vt=ht.index,Kt=me.levels[it.charIndex]&1;if(Kt){const Xt=e.getMirroredCharacter(g[it.charIndex]);Xt&&it.fontData.fontObj.forEachGlyph(Xt,0,0,Ft)}if(H){const{charIndex:Xt,fontData:cn}=it,Gn=it.x+K,bn=it.x+it.width+K;Ue[Xt*4]=Kt?bn:Gn,Ue[Xt*4+1]=Kt?Gn:bn,Ue[Xt*4+2]=Je.baseline+cn.caretBottom+ce,Ue[Xt*4+3]=Je.baseline+cn.caretTop+ce;const Jn=Xt-Le;Jn>1&&u(Ue,Le,Jn),Le=Xt}if(F){const{charIndex:Xt}=it;for(;Xt>Xe;)Xe++,F.hasOwnProperty(Xe)&&(Ge=F[Xe])}if(!ht.isWhitespace&&!ht.isEmpty){const Xt=$++,{fontSizeMult:cn,src:Gn,index:bn}=it.fontData,Jn=ke[Gn]||(ke[Gn]={});Jn[vt]||(Jn[vt]={path:ht.path,pathBounds:[ht.xMin,ht.yMin,ht.xMax,ht.yMax]});const ai=it.x+K,vi=it.y+Je.baseline+ce;_e[Xt*2]=ai,_e[Xt*2+1]=vi;const Yn=ai+ht.xMin*cn,Yi=vi+ht.yMin*cn,ci=ai+ht.xMax*cn,hn=vi+ht.yMax*cn;Yn<ze[0]&&(ze[0]=Yn),Yi<ze[1]&&(ze[1]=Yi),ci>ze[2]&&(ze[2]=ci),hn>ze[3]&&(ze[3]=hn),Xt%W===0&&(mt={start:Xt,end:Xt,rect:[1/0,1/0,-1/0,-1/0]},pe.push(mt)),mt.end++;const ui=mt.rect;if(Yn<ui[0]&&(ui[0]=Yn),Yi<ui[1]&&(ui[1]=Yi),ci>ui[2]&&(ui[2]=ci),hn>ui[3]&&(ui[3]=hn),oe[Xt]=vt,ue[Xt]=bn,F){const $n=Xt*3;Ne[$n]=Ge>>16&255,Ne[$n+1]=Ge>>8&255,Ne[$n+2]=Ge&255}}}}}),Ue){const Je=g.length-Le;Je>1&&u(Ue,Le,Je)}}const fe=[];we.forEach(({index:me,src:$,unitsPerEm:Le,ascender:Xe,descender:mt,lineHeight:Ge,capHeight:Je,xHeight:tt})=>{fe[me]={src:$,unitsPerEm:Le,ascender:Xe,descender:mt,lineHeight:Ge,capHeight:Je,xHeight:tt}}),V.typesetting=f()-Te,Y({glyphIds:oe,glyphFontIndices:ue,glyphPositions:_e,glyphData:ke,fontData:fe,caretPositions:Ue,glyphColors:Ne,chunkedBounds:pe,fontSize:x,topBaseline:ce+$e[0].baseline,blockBounds:[K,ce-ie,K+Fe,ce],visibleBounds:ze,timings:V})})}function l(g,b){o({...g,metricsOnly:!0},y=>{const[p,x,_,w]=y.blockBounds;b({width:_-p,height:w-x})})}function c(g){let b=g.match(/^([\d.]+)%$/),y=b?parseFloat(b[1]):NaN;return isNaN(y)?0:y/100}function u(g,b,y){const p=g[b*4],x=g[b*4+1],_=g[b*4+2],w=g[b*4+3],M=(x-p)/y;for(let S=0;S<y;S++){const A=(b+S)*4;g[A]=p+M*S,g[A+1]=p+M*(S+1),g[A+2]=_,g[A+3]=w}}function f(){return(self.performance||Date).now()}function h(){this.data=[]}const d=["glyphObj","x","y","width","charIndex","fontData"];return h.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/d.length)},glyphAt(g){let b=h.flyweight;return b.data=this.data,b.index=g,b},splitAt(g){let b=new h;return b.data=this.data.splice(g*d.length),b}},h.flyweight=d.reduce((g,b,y,p)=>(Object.defineProperty(g,b,{get(){return this.data[this.index*d.length+y]},set(x){this.data[this.index*d.length+y]=x}}),g),{data:null,index:0}),{typeset:o,measure:l}}const km=()=>(self.performance||Date).now(),_C=DZ();let L5;function AMe(t,e,n,i,r,a,s,o,l,c,u=!0){return u?RMe(t,e,n,i,r,a,s,o,l,c).then(null,f=>(L5||(console.warn("WebGL SDF generation failed, falling back to JS",f),L5=!0),U5(t,e,n,i,r,a,s,o,l,c))):U5(t,e,n,i,r,a,s,o,l,c)}const bM=[],CMe=5;let vI=0;function IZ(){const t=km();for(;bM.length&&km()-t<CMe;)bM.shift()();vI=bM.length?setTimeout(IZ,0):0}const RMe=(...t)=>new Promise((e,n)=>{bM.push(()=>{const i=km();try{_C.webgl.generateIntoCanvas(...t),e({timing:km()-i})}catch(r){n(r)}}),vI||(vI=setTimeout(IZ,0))}),kMe=4,DMe=2e3,P5={};let OMe=0;function U5(t,e,n,i,r,a,s,o,l,c){const u="TroikaTextSDFGenerator_JS_"+OMe++%kMe;let f=P5[u];return f||(f=P5[u]={workerModule:$v({name:u,workerId:u,dependencies:[DZ,km],init(h,d){const g=h().javascript.generate;return function(...b){const y=d();return{textureData:g(...b),timing:d()-y}}},getTransferables(h){return[h.textureData.buffer]}}),requests:0,idleTimer:null}),f.requests++,clearTimeout(f.idleTimer),f.workerModule(t,e,n,i,r,a).then(({textureData:h,timing:d})=>{const g=km(),b=new Uint8Array(h.length*4);for(let y=0;y<h.length;y++)b[y*4+c]=h[y];return _C.webglUtils.renderImageData(s,b,o,l,t,e,1<<3-c),d+=km()-g,--f.requests===0&&(f.idleTimer=setTimeout(()=>{cMe(u)},DMe)),{timing:d}})}function IMe(t){t._warm||(_C.webgl.isSupported(t),t._warm=!0)}const NMe=_C.webglUtils.resizeWebGLCanvasWithoutClearing,Ax={unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},LMe=new Ut;function bb(){return(self.performance||Date).now()}const F5=Object.create(null);function PMe(t,e){t=FMe({},t);const n=bb(),i=[];if(t.font&&i.push({label:"user",src:BMe(t.font)}),t.font=i,t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||Ax.sdfGlyphSize,t.unicodeFontsURL=t.unicodeFontsURL||Ax.unicodeFontsURL,t.colorRanges!=null){let h={};for(let d in t.colorRanges)if(t.colorRanges.hasOwnProperty(d)){let g=t.colorRanges[d];typeof g!="number"&&(g=LMe.set(g).getHex()),h[d]=g}t.colorRanges=h}Object.freeze(t);const{textureWidth:r,sdfExponent:a}=Ax,{sdfGlyphSize:s}=t,o=r/s*4;let l=F5[s];if(!l){const h=document.createElement("canvas");h.width=r,h.height=s*256/o,l=F5[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:h,sdfTexture:new nr(h,void 0,void 0,void 0,Hi,Hi),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,UMe(l)}const{sdfTexture:c,sdfCanvas:u}=l;PZ(t).then(h=>{const{glyphIds:d,glyphFontIndices:g,fontData:b,glyphPositions:y,fontSize:p,timings:x}=h,_=[],w=new Float32Array(d.length*4);let M=0,S=0;const A=bb(),C=b.map(j=>{let z=l.glyphsByFont.get(j.src);return z||l.glyphsByFont.set(j.src,z=new Map),z});d.forEach((j,z)=>{const q=g[z],{src:B,unitsPerEm:G}=b[q];let H=C[q].get(j);if(!H){const{path:V,pathBounds:de}=h.glyphData[B][j],se=Math.max(de[2]-de[0],de[3]-de[1])/s*(Ax.sdfMargin*s+.5),oe=l.glyphCount++,ue=[de[0]-se,de[1]-se,de[2]+se,de[3]+se];C[q].set(j,H={path:V,atlasIndex:oe,sdfViewBox:ue}),_.push(H)}const{sdfViewBox:W}=H,F=y[S++],Y=y[S++],Z=p/G;w[M++]=F+W[0]*Z,w[M++]=Y+W[1]*Z,w[M++]=F+W[2]*Z,w[M++]=Y+W[3]*Z,d[z]=H.atlasIndex}),x.quads=(x.quads||0)+(bb()-A);const D=bb();x.sdf={};const R=u.height,N=Math.ceil(l.glyphCount/o),U=Math.pow(2,Math.ceil(Math.log2(N*s)));U>R&&(console.info(`Increasing SDF texture size ${R}->${U}`),NMe(u,r,U),c.dispose()),Promise.all(_.map(j=>NZ(j,l,t.gpuAccelerateSDF).then(({timing:z})=>{x.sdf[j.atlasIndex]=z}))).then(()=>{_.length&&!l.contextLost&&(LZ(l),c.needsUpdate=!0),x.sdfTotal=bb()-D,x.total=bb()-n,e(Object.freeze({parameters:t,sdfTexture:c,sdfGlyphSize:s,sdfExponent:a,glyphBounds:w,glyphAtlasIndices:d,glyphColors:h.glyphColors,caretPositions:h.caretPositions,chunkedBounds:h.chunkedBounds,ascender:h.ascender,descender:h.descender,lineHeight:h.lineHeight,capHeight:h.capHeight,xHeight:h.xHeight,topBaseline:h.topBaseline,blockBounds:h.blockBounds,visibleBounds:h.visibleBounds,timings:h.timings}))})}),Promise.resolve().then(()=>{l.contextLost||IMe(u)})}function NZ({path:t,atlasIndex:e,sdfViewBox:n},{sdfGlyphSize:i,sdfCanvas:r,contextLost:a},s){if(a)return Promise.resolve({timing:-1});const{textureWidth:o,sdfExponent:l}=Ax,c=Math.max(n[2]-n[0],n[3]-n[1]),u=Math.floor(e/4),f=u%(o/i)*i,h=Math.floor(u/(o/i))*i,d=e%4;return AMe(i,i,t,n,c,l,r,f,h,d,s)}function UMe(t){const e=t.sdfCanvas;e.addEventListener("webglcontextlost",n=>{console.log("Context Lost",n),n.preventDefault(),t.contextLost=!0}),e.addEventListener("webglcontextrestored",n=>{console.log("Context Restored",n),t.contextLost=!1;const i=[];t.glyphsByFont.forEach(r=>{r.forEach(a=>{i.push(NZ(a,t,!0))})}),Promise.all(i).then(()=>{LZ(t),t.sdfTexture.needsUpdate=!0})})}function FMe(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}let iE;function BMe(t){return iE||(iE=typeof document>"u"?{}:document.createElement("a")),iE.href=t,iE.href}function LZ(t){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:n}=t,{width:i,height:r}=e,a=t.sdfCanvas.getContext("webgl");let s=n.image.data;(!s||s.length!==i*r*4)&&(s=new Uint8Array(i*r*4),n.image={width:i,height:r,data:s},n.flipY=!1,n.isDataTexture=!0),a.readPixels(0,0,i,r,a.RGBA,a.UNSIGNED_BYTE,s)}}const zMe=$v({name:"Typesetter",dependencies:[TMe,MMe,fMe],init(t,e,n){return t(e,n())}}),PZ=$v({name:"Typesetter",dependencies:[zMe],init(t){return function(e){return new Promise(n=>{t.typeset(e,n)})}},getTransferables(t){const e=[];for(let n in t)t[n]&&t[n].buffer&&e.push(t[n].buffer);return e}});PZ.onMainThread;const B5={};function jMe(t){let e=B5[t];return e||(e=B5[t]=new Ol(1,1,t,t).translate(.5,.5,0)),e}const vM="aTroikaGlyphBounds",c1="aTroikaGlyphIndex",HMe="aTroikaGlyphColor";class VMe extends H_{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 Ir,this.boundingBox=new rr}computeBoundingSphere(){}computeBoundingBox(){}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let n=jMe(e);["position","normal","uv"].forEach(i=>{this.attributes[i]=n.attributes[i].clone()}),this.setIndex(n.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,n,i,r,a){this.updateAttributeData(vM,e,4),this.updateAttributeData(c1,n,1),this.updateAttributeData(HMe,a,3),this._blockBounds=i,this._chunkedBounds=r,this.instanceCount=n.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:n,boundingBox:i}=this;if(n){const{PI:r,floor:a,min:s,max:o,sin:l,cos:c}=Math,u=r/2,f=r*2,h=Math.abs(n),d=e[0]/h,g=e[2]/h,b=a((d+u)/f)!==a((g+u)/f)?-h:s(l(d)*h,l(g)*h),y=a((d-u)/f)!==a((g-u)/f)?h:o(l(d)*h,l(g)*h),p=a((d+r)/f)!==a((g+r)/f)?h*2:o(h-c(d)*h,h-c(g)*h);i.min.set(b,e[1],n<0?-p:0),i.max.set(y,e[3],n<0?0:p)}else i.min.set(e[0],e[1],0),i.max.set(e[2],e[3],0);i.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let n=this.getAttribute(c1).count,i=this._chunkedBounds;if(i)for(let r=i.length;r--;){n=i[r].end;let a=i[r].rect;if(a[1]<e.w&&a[3]>e.y&&a[0]<e.z&&a[2]>e.x)break}this.instanceCount=n}updateAttributeData(e,n,i){const r=this.getAttribute(e);n?r&&r.array.length===n.length?(r.array.set(n),r.needsUpdate=!0):(this.setAttribute(e,new of(n,i)),delete this._maxInstanceCount,this.dispose()):r&&this.deleteAttribute(e)}}const GMe=`
uniform vec2 uTroikaSDFTextureSize;
uniform float uTroikaSDFGlyphSize;
uniform vec4 uTroikaTotalBounds;
uniform vec4 uTroikaClipRect;
uniform mat3 uTroikaOrient;
uniform bool uTroikaUseGlyphColors;
uniform float uTroikaEdgeOffset;
uniform float uTroikaBlurRadius;
uniform vec2 uTroikaPositionOffset;
uniform float uTroikaCurveRadius;
attribute vec4 aTroikaGlyphBounds;
attribute float aTroikaGlyphIndex;
attribute vec3 aTroikaGlyphColor;
varying vec2 vTroikaGlyphUV;
varying vec4 vTroikaTextureUVBounds;
varying float vTroikaTextureChannel;
varying vec3 vTroikaGlyphColor;
varying vec2 vTroikaGlyphDimensions;
`,WMe=`
vec4 bounds = aTroikaGlyphBounds;
bounds.xz += uTroikaPositionOffset.x;
bounds.yw -= uTroikaPositionOffset.y;

vec4 outlineBounds = vec4(
  bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,
  bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius
);
vec4 clippedBounds = vec4(
  clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),
  clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)
);

vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);

position.xy = mix(bounds.xy, bounds.zw, clippedXY);

uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);

float rad = uTroikaCurveRadius;
if (rad != 0.0) {
  float angle = position.x / rad;
  position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);
  normal.xz = vec2(sin(angle), cos(angle));
}
  
position = uTroikaOrient * position;
normal = uTroikaOrient * normal;

vTroikaGlyphUV = clippedXY.xy;
vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);


float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;
vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;
vec2 txStartUV = txUvPerSquare * vec2(
  mod(floor(aTroikaGlyphIndex / 4.0), txCols),
  floor(floor(aTroikaGlyphIndex / 4.0) / txCols)
);
vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);
vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);
`,qMe=`
uniform sampler2D uTroikaSDFTexture;
uniform vec2 uTroikaSDFTextureSize;
uniform float uTroikaSDFGlyphSize;
uniform float uTroikaSDFExponent;
uniform float uTroikaEdgeOffset;
uniform float uTroikaFillOpacity;
uniform float uTroikaBlurRadius;
uniform vec3 uTroikaStrokeColor;
uniform float uTroikaStrokeWidth;
uniform float uTroikaStrokeOpacity;
uniform bool uTroikaSDFDebug;
varying vec2 vTroikaGlyphUV;
varying vec4 vTroikaTextureUVBounds;
varying float vTroikaTextureChannel;
varying vec2 vTroikaGlyphDimensions;

float troikaSdfValueToSignedDistance(float alpha) {
  // Inverse of exponential encoding in webgl-sdf-generator
  
  float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);
  float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;
  float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);
  return signedDist;
}

float troikaGlyphUvToSdfValue(vec2 glyphUV) {
  vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);
  vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);
  float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1
  return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;
}

float troikaGlyphUvToDistance(vec2 uv) {
  return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));
}

float troikaGetAADist() {
  
  #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300
  return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;
  #else
  return vTroikaGlyphDimensions.x / 64.0;
  #endif
}

float troikaGetFragDistValue() {
  vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);
  float distance = troikaGlyphUvToDistance(clampedGlyphUV);
 
  // Extrapolate distance when outside bounds:
  distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : 
    length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);

  

  return distance;
}

float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {
  #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)
  float alpha = step(-distanceOffset, -distance);
  #else

  float alpha = smoothstep(
    distanceOffset + aaDist,
    distanceOffset - aaDist,
    distance
  );
  #endif

  return alpha;
}
`,XMe=`
float aaDist = troikaGetAADist();
float fragDistance = troikaGetFragDistValue();
float edgeAlpha = uTroikaSDFDebug ?
  troikaGlyphUvToSdfValue(vTroikaGlyphUV) :
  troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));

#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)
vec4 fillRGBA = gl_FragColor;
fillRGBA.a *= uTroikaFillOpacity;
vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);
if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;
gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(
  -uTroikaStrokeWidth - aaDist,
  -uTroikaStrokeWidth + aaDist,
  fragDistance
));
gl_FragColor.a *= edgeAlpha;
#endif

if (edgeAlpha == 0.0) {
  discard;
}
`;function UZ(t){const e=J1(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new wt},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new ei(0,0,0,0)},uTroikaClipRect:{value:new ei(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new wt},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Ut},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Kn},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:GMe,vertexTransform:WMe,fragmentDefs:qMe,fragmentColorTransform:XMe,customRewriter({vertexShader:n,fragmentShader:i}){let r=/\buniform\s+vec3\s+diffuse\b/;return r.test(i)&&(i=i.replace(r,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),r.test(n)||(n=n.replace(OZ,`uniform vec3 diffuse;
$&
vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
`))),{vertexShader:n,fragmentShader:i}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const AU=new Cs({color:16777215,side:Kr,transparent:!0}),z5=8421504,j5=new Ot,rE=new te,lD=new te,Jy=[],KMe=new te,cD="+x+y";function H5(t){return Array.isArray(t)?t[0]:t}let FZ=()=>{const t=new _i(new Ol(1,1),AU);return FZ=()=>t,t},BZ=()=>{const t=new _i(new Ol(1,1,32,1),AU);return BZ=()=>t,t};const YMe={type:"syncstart"},JMe={type:"synccomplete"},zZ=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],$Me=zZ.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class u1 extends _i{constructor(){const e=new VMe;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,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=z5,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=cD,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(YMe),PMe({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",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,unicodeFontsURL:this.unicodeFontsURL},n=>{this._isSyncing=!1,this._textRenderInfo=n,this.geometry.updateGlyphs(n.glyphBounds,n.glyphAtlasIndices,n.blockBounds,n.chunkedBounds,n.glyphColors);const i=this._queuedSyncs;i&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{i.forEach(r=>r&&r())})),this.dispatchEvent(JMe),e&&e()})))}onBeforeRender(e,n,i,r,a,s){this.sync(),a.isTroikaTextMaterial&&this._prepareForRender(a)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(e){return UZ(e)}get material(){let e=this._derivedMaterial;const n=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=AU.clone());if((!e||!e.isDerivedFrom(n))&&(e=this._derivedMaterial=this.createDerivedMaterial(n),n.addEventListener("dispose",function i(){n.removeEventListener("dispose",i),e.dispose()})),this.hasOutline()){let i=e._outlineMtl;return i||(i=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),i.isTextOutlineMaterial=!0,i.depthWrite=!1,i.map=null,e.addEventListener("dispose",function r(){e.removeEventListener("dispose",r),i.dispose()})),[i,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return H5(this.material).getDepthMaterial()}set customDepthMaterial(e){}get customDistanceMaterial(){return H5(this.material).getDistanceMaterial()}set customDistanceMaterial(e){}_prepareForRender(e){const n=e.isTextOutlineMaterial,i=e.uniforms,r=this.textRenderInfo;if(r){const{sdfTexture:o,blockBounds:l}=r;i.uTroikaSDFTexture.value=o,i.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),i.uTroikaSDFGlyphSize.value=r.sdfGlyphSize,i.uTroikaSDFExponent.value=r.sdfExponent,i.uTroikaTotalBounds.value.fromArray(l),i.uTroikaUseGlyphColors.value=!n&&!!r.glyphColors;let c=0,u=0,f=0,h,d,g,b=0,y=0;if(n){let{outlineWidth:x,outlineOffsetX:_,outlineOffsetY:w,outlineBlur:M,outlineOpacity:S}=this;c=this._parsePercent(x)||0,u=Math.max(0,this._parsePercent(M)||0),h=S,b=this._parsePercent(_)||0,y=this._parsePercent(w)||0}else f=Math.max(0,this._parsePercent(this.strokeWidth)||0),f&&(g=this.strokeColor,i.uTroikaStrokeColor.value.set(g??z5),d=this.strokeOpacity,d==null&&(d=1)),h=this.fillOpacity;i.uTroikaEdgeOffset.value=c,i.uTroikaPositionOffset.value.set(b,y),i.uTroikaBlurRadius.value=u,i.uTroikaStrokeWidth.value=f,i.uTroikaStrokeOpacity.value=d,i.uTroikaFillOpacity.value=h??1,i.uTroikaCurveRadius.value=this.curveRadius||0;let p=this.clipRect;if(p&&Array.isArray(p)&&p.length===4)i.uTroikaClipRect.value.fromArray(p);else{const x=(this.fontSize||.1)*100;i.uTroikaClipRect.value.set(l[0]-x,l[1]-x,l[2]+x,l[3]+x)}this.geometry.applyClipRect(i.uTroikaClipRect.value)}i.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const a=n?this.outlineColor||0:this.color;if(a==null)delete e.color;else{const o=e.hasOwnProperty("color")?e.color:e.color=new Ut;(a!==o._input||typeof a=="object")&&o.set(o._input=a)}let s=this.orientation||cD;if(s!==e._orientation){let o=i.uTroikaOrient.value;s=s.replace(/[^-+xyz]/g,"");let l=s!==cD&&s.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,c,u,f,h]=l;rE.set(0,0,0)[u]=c==="-"?1:-1,lD.set(0,0,0)[h]=f==="-"?-1:1,j5.lookAt(KMe,rE.cross(lD),lD),o.setFromMatrix4(j5)}else o.identity();e._orientation=s}}_parsePercent(e){if(typeof e=="string"){let n=e.match(/^(-?[\d.]+)%$/),i=n?parseFloat(n[1]):NaN;e=(isNaN(i)?0:i/100)*this.fontSize}return e}localPositionToTextCoords(e,n=new wt){n.copy(e);const i=this.curveRadius;return i&&(n.x=Math.atan2(e.x,Math.abs(i)-Math.abs(e.z))*Math.abs(i)),n}worldPositionToTextCoords(e,n=new wt){return rE.copy(e),this.localPositionToTextCoords(this.worldToLocal(rE),n)}raycast(e,n){const{textRenderInfo:i,curveRadius:r}=this;if(i){const a=i.blockBounds,s=r?BZ():FZ(),o=s.geometry,{position:l,uv:c}=o.attributes;for(let u=0;u<c.count;u++){let f=a[0]+c.getX(u)*(a[2]-a[0]);const h=a[1]+c.getY(u)*(a[3]-a[1]);let d=0;r&&(d=r-Math.cos(f/r)*r,f=Math.sin(f/r)*r),l.setXYZ(u,f,h,d)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,s.matrixWorld=this.matrixWorld,s.material.side=this.material.side,Jy.length=0,s.raycast(e,Jy);for(let u=0;u<Jy.length;u++)Jy[u].object=this,n.push(Jy[u])}}copy(e){const n=this.geometry;return super.copy(e),this.geometry=n,$Me.forEach(i=>{this[i]=e[i]}),this}clone(){return new this.constructor().copy(this)}}zZ.forEach(t=>{const e="_private_"+t;Object.defineProperty(u1.prototype,t,{get(){return this[e]},set(n){n!==this[e]&&(this[e]=n,this._needsSync=!0)}})});const ZMe={type:"syncstart"},QMe={type:"synccomplete"},n0="aTroikaTextBatchMemberIndex",yI=32,V5=new rr,G5=new Ut;class CU extends u1{constructor(){super(),this._members=new Map,this._dataTextures={},this._onMemberSynced=e=>{this._members.get(e.target).dirty=!0}}add(...e){for(let n=0;n<e.length;n++)e[n]instanceof u1?this.addText(e[n]):super.add(e[n]);return this}remove(...e){for(let n=0;n<e.length;n++)e[n]instanceof u1?this.removeText(e[n]):super.remove(e[n]);return this}addText(e){this._members.has(e)||(this._members.set(e,{index:-1,glyphCount:-1,dirty:!0}),e.addEventListener("synccomplete",this._onMemberSynced))}removeText(e){this._needsRepack=!0,e.removeEventListener("synccomplete",this._onMemberSynced),this._members.delete(e)}createDerivedMaterial(e){return e2e(e)}updateMatrixWorld(e){super.updateMatrixWorld(e),this.updateBounds()}updateBounds(){const e=this.geometry.boundingBox.makeEmpty();this._members.forEach((n,i)=>{i.matrixAutoUpdate&&i.updateMatrix(),V5.copy(i.geometry.boundingBox).applyMatrix4(i.matrix),e.union(V5)}),e.getBoundingSphere(this.geometry.boundingSphere)}hasOutline(){for(let e of this._members.keys())if(e.hasOutline())return!0;return!1}_prepareForRender(e){const n=e.isTextOutlineMaterial;e.uniforms.uTroikaIsOutline.value=n;let i=this._dataTextures[n?"outline":"main"];const r=Math.pow(2,Math.ceil(Math.log2(this._members.size*yI)));if(!i||r!==i.image.data.length){i&&i.dispose();const o=Math.min(r/4,1024);i=this._dataTextures[n?"outline":"main"]=new rs(new Float32Array(r),o,r/4/o,$r,yr)}const a=i.image.data,s=(o,l)=>{l!==a[o]&&(a[o]=l,i.needsUpdate=!0)};this._members.forEach(({index:o,dirty:l},c)=>{if(o>-1){const u=o*yI,f=c.matrix.elements;for(let A=0;A<16;A++)s(u+A,f[A]);c._prepareForRender(e);const{uTroikaTotalBounds:h,uTroikaClipRect:d,uTroikaPositionOffset:g,uTroikaEdgeOffset:b,uTroikaBlurRadius:y,uTroikaStrokeWidth:p,uTroikaStrokeColor:x,uTroikaStrokeOpacity:_,uTroikaFillOpacity:w,uTroikaCurveRadius:M}=e.uniforms;for(let A=0;A<4;A++)s(u+16+A,h.value.getComponent(A));for(let A=0;A<4;A++)s(u+20+A,d.value.getComponent(A));let S=n?c.outlineColor||0:c.color;S==null&&(S=this.color),S==null&&(S=this.material.color),S==null&&(S=16777215),s(u+24,G5.set(S).getHex()),s(u+25,w.value),s(u+26,M.value),n?(s(u+28,g.value.x),s(u+29,g.value.y),s(u+30,b.value),s(u+31,y.value)):(s(u+28,p.value),s(u+29,G5.set(x.value).getHex()),s(u+30,_.value))}}),e.setMatrixTexture(i),super._prepareForRender(e)}sync(e){let n=this._needsRepack?[]:null;this._needsRepack=!1,this._members.forEach((i,r)=>{(i.dirty||r._needsSync)&&(i.dirty=!1,(n||(n=[])).push(new Promise(a=>{r._needsSync?r.sync(a):a()})))}),n&&(this.dispatchEvent(ZMe),Promise.all(n).then(()=>{const{geometry:i}=this,r=i.attributes;let a=r[n0]&&r[n0].array||new Uint16Array(0),s=r[c1]&&r[c1].array||new Float32Array(0),o=r[vM]&&r[vM].array||new Float32Array(0),l=0;this._members.forEach((f,{textRenderInfo:h})=>{h&&(l+=h.glyphAtlasIndices.length,this._textRenderInfo=h)}),l!==a.length&&(a=uD(a,l),s=uD(s,l),o=uD(o,l*4));let c=0,u=0;this._members.forEach((f,{textRenderInfo:h})=>{if(h){const d=h.glyphAtlasIndices.length;a.fill(c,u,u+d),s.set(h.glyphAtlasIndices,u,u+d),o.set(h.glyphBounds,u*4,(u+d)*4),u+=d,f.index=c++}}),i.updateAttributeData(n0,a,1),i.getAttribute(n0).setUsage(V1),i.updateAttributeData(c1,s,1),i.updateAttributeData(vM,o,4),this.updateBounds(),this.dispatchEvent(QMe),e&&e()}))}copy(e){return e instanceof CU&&(super.copy(e),this._members.forEach((n,i)=>this.removeText(i)),e._members.forEach((n,i)=>this.addText(i))),this}dispose(){super.dispose(),Object.values(this._dataTextures).forEach(e=>e.dispose())}}function uD(t,e){const n=new t.constructor(e);return n.set(t.subarray(0,e)),n}function e2e(t){const e="uTroikaMatricesTexture",n="uTroikaMatricesTextureSize";let i=J1(t,{chained:!0,uniforms:{[n]:{value:new wt},[e]:{value:null}},vertexDefs:`
      uniform highp sampler2D ${e};
      uniform vec2 ${n};
      attribute float ${n0};

      vec4 troikaBatchTexel(float offset) {
        offset += ${n0} * ${yI.toFixed(1)} / 4.0;
        float w = ${n}.x;
        vec2 uv = (vec2(mod(offset, w), floor(offset / w)) + 0.5) / ${n};
        return texture2D(${e}, uv);
      }
    `,vertexTransform:`
      mat4 matrix = mat4(
        troikaBatchTexel(0.0),
        troikaBatchTexel(1.0),
        troikaBatchTexel(2.0),
        troikaBatchTexel(3.0)
      );
      position.xyz = (matrix * vec4(position, 1.0)).xyz;
    `});return i=UZ(i),i=J1(i,{chained:!0,uniforms:{uTroikaIsOutline:{value:!1}},customRewriter(r){return["uTroikaTotalBounds","uTroikaClipRect","uTroikaPositionOffset","uTroikaEdgeOffset","uTroikaBlurRadius","uTroikaStrokeWidth","uTroikaStrokeColor","uTroikaStrokeOpacity","uTroikaFillOpacity","uTroikaCurveRadius","diffuse"].forEach(s=>{r=t2e(r,s)}),r},vertexDefs:`
      uniform bool uTroikaIsOutline;
      vec3 troikaFloatToColor(float v) {
        return mod(floor(vec3(v / 65536.0, v / 256.0, v)), 256.0) / 256.0;
      }
    `,vertexTransform:`
      uTroikaTotalBounds = troikaBatchTexel(4.0);
      uTroikaClipRect = troikaBatchTexel(5.0);
      
      vec4 data = troikaBatchTexel(6.0);
      diffuse = troikaFloatToColor(data.x);
      uTroikaFillOpacity = data.y;
      uTroikaCurveRadius = data.z;
      
      data = troikaBatchTexel(7.0);
      if (uTroikaIsOutline) {
        if (data == vec4(0.0)) { // degenerate if zero outline
          position = vec3(0.0);
        } else {
          uTroikaPositionOffset = data.xy;
          uTroikaEdgeOffset = data.z;
          uTroikaBlurRadius = data.w;
        }
      } else {
        uTroikaStrokeWidth = data.x;
        uTroikaStrokeColor = troikaFloatToColor(data.y);
        uTroikaStrokeOpacity = data.z;
      }
    `}),i.setMatrixTexture=r=>{i.uniforms[e].value=r,i.uniforms[n].value.set(r.image.width,r.image.height)},i}function t2e({vertexShader:t,fragmentShader:e},n,i=n){const r=new RegExp(`uniform\\s+(bool|float|vec[234]|mat[34])\\s+${n}\\b`);let a,s=!1;e=e.replace(r,(l,c)=>(s=!0,`varying ${a=c} ${i}`));let o=!1;return t=t.replace(r,(l,c)=>(o=!0,`${s?"varying":""} ${a=c} ${i}`)),o||(t=`${s?"varying":""} ${a} ${i};
${t}`),{vertexShader:t,fragmentShader:e}}function SC(t,e,n,i){var r;return r=class extends ss{constructor(a){super({vertexShader:e,fragmentShader:n,...a});for(const s in t)this.uniforms[s]=new mC(t[s]),Object.defineProperty(this,s,{get(){return this.uniforms[s].value},set(o){this.uniforms[s].value=o}});this.uniforms=av.clone(this.uniforms)}},r.key=gc.generateUUID(),r}const n2e=()=>parseInt(Uv.replace(/\D+/g,"")),jZ=n2e();/*!
 * camera-controls
 * https://github.com/yomotsu/camera-controls
 * (c) 2017 @yomotsu
 * Released under the MIT License.
 */const ea={LEFT:1,RIGHT:2,MIDDLE:4},ft=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),vb={NONE:0,IN:1,OUT:-1};function Lp(t){return t.isPerspectiveCamera}function nd(t){return t.isOrthographicCamera}const $h=Math.PI*2,W5=Math.PI/2,HZ=1e-5,$y=Math.PI/180;function Wc(t,e,n){return Math.max(e,Math.min(n,t))}function Rr(t,e=HZ){return Math.abs(t)<e}function ar(t,e,n=HZ){return Rr(t-e,n)}function q5(t,e){return Math.round(t/e)*e}function Zy(t){return isFinite(t)?t:t<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Qy(t){return Math.abs(t)<Number.MAX_VALUE?t:t*(1/0)}function aE(t,e,n,i,r=1/0,a){i=Math.max(1e-4,i);const s=2/i,o=s*a,l=1/(1+o+.48*o*o+.235*o*o*o);let c=t-e;const u=e,f=r*i;c=Wc(c,-f,f),e=t-c;const h=(n.value+s*c)*a;n.value=(n.value-s*h)*l;let d=e+(c+h)*l;return u-t>0==d>u&&(d=u,n.value=(d-u)/a),d}function X5(t,e,n,i,r=1/0,a,s){i=Math.max(1e-4,i);const o=2/i,l=o*a,c=1/(1+l+.48*l*l+.235*l*l*l);let u=e.x,f=e.y,h=e.z,d=t.x-u,g=t.y-f,b=t.z-h;const y=u,p=f,x=h,_=r*i,w=_*_,M=d*d+g*g+b*b;if(M>w){const q=Math.sqrt(M);d=d/q*_,g=g/q*_,b=b/q*_}u=t.x-d,f=t.y-g,h=t.z-b;const S=(n.x+o*d)*a,A=(n.y+o*g)*a,C=(n.z+o*b)*a;n.x=(n.x-o*S)*c,n.y=(n.y-o*A)*c,n.z=(n.z-o*C)*c,s.x=u+(d+S)*c,s.y=f+(g+A)*c,s.z=h+(b+C)*c;const D=y-t.x,R=p-t.y,N=x-t.z,U=s.x-y,j=s.y-p,z=s.z-x;return D*U+R*j+N*z>0&&(s.x=y,s.y=p,s.z=x,n.x=(s.x-y)/a,n.y=(s.y-p)/a,n.z=(s.z-x)/a),s}function fD(t,e){e.set(0,0),t.forEach(n=>{e.x+=n.clientX,e.y+=n.clientY}),e.x/=t.length,e.y/=t.length}function hD(t,e){return nd(t)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}let i2e=class{constructor(){this._listeners={}}addEventListener(e,n){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const r=this._listeners[e];if(r!==void 0){const a=r.indexOf(n);a!==-1&&r.splice(a,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let a=0,s=r.length;a<s;a++)r[a].call(this,e)}}};var dD;const r2e="3.1.0",sE=1/8,a2e=/Mac/.test((dD=globalThis?.navigator)===null||dD===void 0?void 0:dD.platform);let zn,K5,oE,pD,Oo,ii,qi,yb,ex,Iu,Nu,Pp,Y5,J5,cl,xb,_b,$5,mD,Z5,gD,bD,lE,s2e=class xI extends i2e{static install(e){zn=e.THREE,K5=Object.freeze(new zn.Vector3(0,0,0)),oE=Object.freeze(new zn.Vector3(0,1,0)),pD=Object.freeze(new zn.Vector3(0,0,1)),Oo=new zn.Vector2,ii=new zn.Vector3,qi=new zn.Vector3,yb=new zn.Vector3,ex=new zn.Vector3,Iu=new zn.Vector3,Nu=new zn.Vector3,Pp=new zn.Vector3,Y5=new zn.Vector3,J5=new zn.Vector3,cl=new zn.Spherical,xb=new zn.Spherical,_b=new zn.Box3,$5=new zn.Box3,mD=new zn.Sphere,Z5=new zn.Quaternion,gD=new zn.Quaternion,bD=new zn.Matrix4,lE=new zn.Raycaster}static get ACTION(){return ft}set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,n){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=ft.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=vb.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new zn.Vector3,this._focalOffsetVelocity=new zn.Vector3,this._zoomVelocity={value:0},this._truckInternal=(p,x,_,w)=>{let M,S;if(Lp(this._camera)){const A=ii.copy(this._camera.position).sub(this._target),C=this._camera.getEffectiveFOV()*$y,D=A.length()*Math.tan(C*.5);M=this.truckSpeed*p*D/this._elementRect.height,S=this.truckSpeed*x*D/this._elementRect.height}else if(nd(this._camera)){const A=this._camera;M=this.truckSpeed*p*(A.right-A.left)/A.zoom/this._elementRect.width,S=this.truckSpeed*x*(A.top-A.bottom)/A.zoom/this._elementRect.height}else return;w?(_?this.setFocalOffset(this._focalOffsetEnd.x+M,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(M,0,!0),this.forward(-S,!0)):_?this.setFocalOffset(this._focalOffsetEnd.x+M,this._focalOffsetEnd.y+S,this._focalOffsetEnd.z,!0):this.truck(M,S,!0)},this._rotateInternal=(p,x)=>{const _=$h*this.azimuthRotateSpeed*p/this._elementRect.height,w=$h*this.polarRotateSpeed*x/this._elementRect.height;this.rotate(_,w,!0)},this._dollyInternal=(p,x,_)=>{const w=Math.pow(.95,-p*this.dollySpeed),M=this._sphericalEnd.radius,S=this._sphericalEnd.radius*w,A=Wc(S,this.minDistance,this.maxDistance),C=A-S;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(S,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(C,!0),this._dollyToNoClamp(A,!0)):this._dollyToNoClamp(A,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?S:A)-M,this._dollyControlCoord.set(x,_)),this._lastDollyDirection=Math.sign(-p)},this._zoomInternal=(p,x,_)=>{const w=Math.pow(.95,p*this.dollySpeed),M=this._zoom,S=this._zoom*w;this.zoomTo(S,!0),this.dollyToCursor&&(this._changedZoom+=S-M,this._dollyControlCoord.set(x,_))},typeof zn>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new zn.Quaternion().setFromUnitVectors(this._camera.up,oE),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=ft.NONE,this._target=new zn.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new zn.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new zn.Spherical().setFromVector3(ii.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 zn.Vector3,new zn.Vector3,new zn.Vector3,new zn.Vector3],this._updateNearPlaneCorners(),this._boundary=new zn.Box3(new zn.Vector3(-1/0,-1/0,-1/0),new zn.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 zn.Vector2,this.mouseButtons={left:ft.ROTATE,middle:ft.DOLLY,right:ft.TRUCK,wheel:Lp(this._camera)?ft.DOLLY:nd(this._camera)?ft.ZOOM:ft.NONE},this.touches={one:ft.TOUCH_ROTATE,two:Lp(this._camera)?ft.TOUCH_DOLLY_TRUCK:nd(this._camera)?ft.TOUCH_ZOOM_TRUCK:ft.NONE,three:ft.TOUCH_TRUCK};const i=new zn.Vector2,r=new zn.Vector2,a=new zn.Vector2,s=p=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const w=this._domElement.getBoundingClientRect(),M=p.clientX/w.width,S=p.clientY/w.height;if(M<this._interactiveArea.left||M>this._interactiveArea.right||S<this._interactiveArea.top||S>this._interactiveArea.bottom)return}const x=p.pointerType!=="mouse"?null:(p.buttons&ea.LEFT)===ea.LEFT?ea.LEFT:(p.buttons&ea.MIDDLE)===ea.MIDDLE?ea.MIDDLE:(p.buttons&ea.RIGHT)===ea.RIGHT?ea.RIGHT:null;if(x!==null){const w=this._findPointerByMouseButton(x);w&&this._disposePointer(w)}if((p.buttons&ea.LEFT)===ea.LEFT&&this._lockedPointer)return;const _={pointerId:p.pointerId,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:x};this._activePointers.push(_),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),this._isDragging=!0,h(p)},o=p=>{p.cancelable&&p.preventDefault();const x=p.pointerId,_=this._lockedPointer||this._findPointerById(x);if(_){if(_.clientX=p.clientX,_.clientY=p.clientY,_.deltaX=p.movementX,_.deltaY=p.movementY,this._state=0,p.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&&(p.buttons&ea.LEFT)===ea.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(p.buttons&ea.MIDDLE)===ea.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(p.buttons&ea.RIGHT)===ea.RIGHT&&(this._state=this._state|this.mouseButtons.right);d()}},l=p=>{const x=this._findPointerById(p.pointerId);if(!(x&&x===this._lockedPointer)){if(x&&this._disposePointer(x),p.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=ft.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=ft.NONE;g()}};let c=-1;const u=p=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===ft.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const S=this._domElement.getBoundingClientRect(),A=p.clientX/S.width,C=p.clientY/S.height;if(A<this._interactiveArea.left||A>this._interactiveArea.right||C<this._interactiveArea.top||C>this._interactiveArea.bottom)return}if(p.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===ft.ROTATE||this.mouseButtons.wheel===ft.TRUCK){const S=performance.now();c-S<1e3&&this._getClientRect(this._elementRect),c=S}const x=a2e?-1:-3,_=p.deltaMode===1||p.ctrlKey?p.deltaY/x:p.deltaY/(x*10),w=this.dollyToCursor?(p.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,M=this.dollyToCursor?(p.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case ft.ROTATE:{this._rotateInternal(p.deltaX,p.deltaY),this._isUserControllingRotate=!0;break}case ft.TRUCK:{this._truckInternal(p.deltaX,p.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case ft.SCREEN_PAN:{this._truckInternal(p.deltaX,p.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case ft.OFFSET:{this._truckInternal(p.deltaX,p.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case ft.DOLLY:{this._dollyInternal(-_,w,M),this._isUserControllingDolly=!0;break}case ft.ZOOM:{this._zoomInternal(-_,w,M),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},f=p=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===xI.ACTION.NONE){const x=p instanceof PointerEvent?p.pointerId:0,_=this._findPointerById(x);_&&this._disposePointer(_),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}p.preventDefault()}},h=p=>{if(!this._enabled)return;if(fD(this._activePointers,Oo),this._getClientRect(this._elementRect),i.copy(Oo),r.copy(Oo),this._activePointers.length>=2){const _=Oo.x-this._activePointers[1].clientX,w=Oo.y-this._activePointers[1].clientY,M=Math.sqrt(_*_+w*w);a.set(0,M);const S=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,A=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;r.set(S,A)}if(this._state=0,!p)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in p&&p.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&&(p.buttons&ea.LEFT)===ea.LEFT&&(this._state=this._state|this.mouseButtons.left),(p.buttons&ea.MIDDLE)===ea.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&ea.RIGHT)===ea.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&ft.ROTATE)===ft.ROTATE||(this._state&ft.TOUCH_ROTATE)===ft.TOUCH_ROTATE||(this._state&ft.TOUCH_DOLLY_ROTATE)===ft.TOUCH_DOLLY_ROTATE||(this._state&ft.TOUCH_ZOOM_ROTATE)===ft.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&ft.TRUCK)===ft.TRUCK||(this._state&ft.SCREEN_PAN)===ft.SCREEN_PAN||(this._state&ft.TOUCH_TRUCK)===ft.TOUCH_TRUCK||(this._state&ft.TOUCH_SCREEN_PAN)===ft.TOUCH_SCREEN_PAN||(this._state&ft.TOUCH_DOLLY_TRUCK)===ft.TOUCH_DOLLY_TRUCK||(this._state&ft.TOUCH_DOLLY_SCREEN_PAN)===ft.TOUCH_DOLLY_SCREEN_PAN||(this._state&ft.TOUCH_ZOOM_TRUCK)===ft.TOUCH_ZOOM_TRUCK||(this._state&ft.TOUCH_ZOOM_SCREEN_PAN)===ft.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&ft.DOLLY)===ft.DOLLY||(this._state&ft.TOUCH_DOLLY)===ft.TOUCH_DOLLY||(this._state&ft.TOUCH_DOLLY_TRUCK)===ft.TOUCH_DOLLY_TRUCK||(this._state&ft.TOUCH_DOLLY_SCREEN_PAN)===ft.TOUCH_DOLLY_SCREEN_PAN||(this._state&ft.TOUCH_DOLLY_OFFSET)===ft.TOUCH_DOLLY_OFFSET||(this._state&ft.TOUCH_DOLLY_ROTATE)===ft.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&ft.ZOOM)===ft.ZOOM||(this._state&ft.TOUCH_ZOOM)===ft.TOUCH_ZOOM||(this._state&ft.TOUCH_ZOOM_TRUCK)===ft.TOUCH_ZOOM_TRUCK||(this._state&ft.TOUCH_ZOOM_SCREEN_PAN)===ft.TOUCH_ZOOM_SCREEN_PAN||(this._state&ft.TOUCH_ZOOM_OFFSET)===ft.TOUCH_ZOOM_OFFSET||(this._state&ft.TOUCH_ZOOM_ROTATE)===ft.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&ft.OFFSET)===ft.OFFSET||(this._state&ft.TOUCH_OFFSET)===ft.TOUCH_OFFSET||(this._state&ft.TOUCH_DOLLY_OFFSET)===ft.TOUCH_DOLLY_OFFSET||(this._state&ft.TOUCH_ZOOM_OFFSET)===ft.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},d=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,fD(this._activePointers,Oo);const x=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,_=x?-x.deltaX:r.x-Oo.x,w=x?-x.deltaY:r.y-Oo.y;if(r.copy(Oo),((this._state&ft.ROTATE)===ft.ROTATE||(this._state&ft.TOUCH_ROTATE)===ft.TOUCH_ROTATE||(this._state&ft.TOUCH_DOLLY_ROTATE)===ft.TOUCH_DOLLY_ROTATE||(this._state&ft.TOUCH_ZOOM_ROTATE)===ft.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(_,w),this._isUserControllingRotate=!0),(this._state&ft.DOLLY)===ft.DOLLY||(this._state&ft.ZOOM)===ft.ZOOM){const M=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,A=this.dollyDragInverted?-1:1;(this._state&ft.DOLLY)===ft.DOLLY?(this._dollyInternal(A*w*sE,M,S),this._isUserControllingDolly=!0):(this._zoomInternal(A*w*sE,M,S),this._isUserControllingZoom=!0)}if((this._state&ft.TOUCH_DOLLY)===ft.TOUCH_DOLLY||(this._state&ft.TOUCH_ZOOM)===ft.TOUCH_ZOOM||(this._state&ft.TOUCH_DOLLY_TRUCK)===ft.TOUCH_DOLLY_TRUCK||(this._state&ft.TOUCH_ZOOM_TRUCK)===ft.TOUCH_ZOOM_TRUCK||(this._state&ft.TOUCH_DOLLY_SCREEN_PAN)===ft.TOUCH_DOLLY_SCREEN_PAN||(this._state&ft.TOUCH_ZOOM_SCREEN_PAN)===ft.TOUCH_ZOOM_SCREEN_PAN||(this._state&ft.TOUCH_DOLLY_OFFSET)===ft.TOUCH_DOLLY_OFFSET||(this._state&ft.TOUCH_ZOOM_OFFSET)===ft.TOUCH_ZOOM_OFFSET||(this._state&ft.TOUCH_DOLLY_ROTATE)===ft.TOUCH_DOLLY_ROTATE||(this._state&ft.TOUCH_ZOOM_ROTATE)===ft.TOUCH_ZOOM_ROTATE){const M=Oo.x-this._activePointers[1].clientX,S=Oo.y-this._activePointers[1].clientY,A=Math.sqrt(M*M+S*S),C=a.y-A;a.set(0,A);const D=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,R=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&ft.TOUCH_DOLLY)===ft.TOUCH_DOLLY||(this._state&ft.TOUCH_DOLLY_ROTATE)===ft.TOUCH_DOLLY_ROTATE||(this._state&ft.TOUCH_DOLLY_TRUCK)===ft.TOUCH_DOLLY_TRUCK||(this._state&ft.TOUCH_DOLLY_SCREEN_PAN)===ft.TOUCH_DOLLY_SCREEN_PAN||(this._state&ft.TOUCH_DOLLY_OFFSET)===ft.TOUCH_DOLLY_OFFSET?(this._dollyInternal(C*sE,D,R),this._isUserControllingDolly=!0):(this._zoomInternal(C*sE,D,R),this._isUserControllingZoom=!0)}((this._state&ft.TRUCK)===ft.TRUCK||(this._state&ft.TOUCH_TRUCK)===ft.TOUCH_TRUCK||(this._state&ft.TOUCH_DOLLY_TRUCK)===ft.TOUCH_DOLLY_TRUCK||(this._state&ft.TOUCH_ZOOM_TRUCK)===ft.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(_,w,!1,!1),this._isUserControllingTruck=!0),((this._state&ft.SCREEN_PAN)===ft.SCREEN_PAN||(this._state&ft.TOUCH_SCREEN_PAN)===ft.TOUCH_SCREEN_PAN||(this._state&ft.TOUCH_DOLLY_SCREEN_PAN)===ft.TOUCH_DOLLY_SCREEN_PAN||(this._state&ft.TOUCH_ZOOM_SCREEN_PAN)===ft.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(_,w,!1,!0),this._isUserControllingTruck=!0),((this._state&ft.OFFSET)===ft.OFFSET||(this._state&ft.TOUCH_OFFSET)===ft.TOUCH_OFFSET||(this._state&ft.TOUCH_DOLLY_OFFSET)===ft.TOUCH_DOLLY_OFFSET||(this._state&ft.TOUCH_ZOOM_OFFSET)===ft.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(_,w,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},g=()=>{fD(this._activePointers,Oo),r.copy(Oo),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",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),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",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",b),this._domElement.ownerDocument.addEventListener("pointerlockerror",y),this._domElement.ownerDocument.addEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),h())},this.unlockPointer=()=>{var p,x,_;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(p=this._domElement)===null||p===void 0||p.ownerDocument.exitPointerLock(),(x=this._domElement)===null||x===void 0||x.ownerDocument.removeEventListener("pointerlockchange",b),(_=this._domElement)===null||_===void 0||_.ownerDocument.removeEventListener("pointerlockerror",y),this.cancel()};const b=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},y=()=>{this.unlockPointer()};this._addAllEventListeners=p=>{this._domElement=p,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",s),this._domElement.addEventListener("pointercancel",l),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",f)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",s),this._domElement.removeEventListener("pointercancel",l),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",f),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.removeEventListener("pointerlockchange",b),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))},this.cancel=()=>{this._state!==ft.NONE&&(this._state=ft.NONE,this._activePointers.length=0,g())},n&&this.connect(n),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=Wc(e.width,0,1),this._interactiveArea.height=Wc(e.height,0,1),this._interactiveArea.x=Wc(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Wc(e.y,0,1-this._interactiveArea.height)}addEventListener(e,n){super.addEventListener(e,n)}removeEventListener(e,n){super.removeEventListener(e,n)}rotate(e,n,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+n,i)}rotateAzimuthTo(e,n=!1){return this.rotateTo(e,this._sphericalEnd.phi,n)}rotatePolarTo(e,n=!1){return this.rotateTo(this._sphericalEnd.theta,e,n)}rotateTo(e,n,i=!1){this._isUserControllingRotate=!1;const r=Wc(e,this.minAzimuthAngle,this.maxAzimuthAngle),a=Wc(n,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=a,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const s=!i||ar(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ar(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(s)}dolly(e,n=!1){return this.dollyTo(this._sphericalEnd.radius-e,n)}dollyTo(e,n=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=vb.NONE,this._changedDolly=0,this._dollyToNoClamp(Wc(e,this.minDistance,this.maxDistance),n)}_dollyToNoClamp(e,n=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const s=this._collisionTest(),o=ar(s,this._spherical.radius);if(!(i>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,s)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,n||(this._spherical.radius=this._sphericalEnd.radius);const a=!n||ar(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(a)}dollyInFixed(e,n=!1){this._targetEnd.add(this._getCameraDirection(ex).multiplyScalar(e)),n||this._target.copy(this._targetEnd);const i=!n||ar(this._target.x,this._targetEnd.x,this.restThreshold)&&ar(this._target.y,this._targetEnd.y,this.restThreshold)&&ar(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,n=!1){return this.zoomTo(this._zoomEnd+e,n)}zoomTo(e,n=!1){this._isUserControllingZoom=!1,this._zoomEnd=Wc(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,n||(this._zoom=this._zoomEnd);const i=!n||ar(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,n,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,n,i)}truck(e,n,i=!1){this._camera.updateMatrix(),Iu.setFromMatrixColumn(this._camera.matrix,0),Nu.setFromMatrixColumn(this._camera.matrix,1),Iu.multiplyScalar(e),Nu.multiplyScalar(-n);const r=ii.copy(Iu).add(Nu),a=qi.copy(this._targetEnd).add(r);return this.moveTo(a.x,a.y,a.z,i)}forward(e,n=!1){ii.setFromMatrixColumn(this._camera.matrix,0),ii.crossVectors(this._camera.up,ii),ii.multiplyScalar(e);const i=qi.copy(this._targetEnd).add(ii);return this.moveTo(i.x,i.y,i.z,n)}elevate(e,n=!1){return ii.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+ii.x,this._targetEnd.y+ii.y,this._targetEnd.z+ii.z,n)}moveTo(e,n,i,r=!1){this._isUserControllingTruck=!1;const a=ii.set(e,n,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,a,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);const s=!r||ar(this._target.x,this._targetEnd.x,this.restThreshold)&&ar(this._target.y,this._targetEnd.y,this.restThreshold)&&ar(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}lookInDirectionOf(e,n,i,r=!1){const o=ii.set(e,n,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(o.x,o.y,o.z,r)}fitToBox(e,n,{cover:i=!1,paddingLeft:r=0,paddingRight:a=0,paddingBottom:s=0,paddingTop:o=0}={}){const l=[],c=e.isBox3?_b.copy(e):_b.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=q5(this._sphericalEnd.theta,W5),f=q5(this._sphericalEnd.phi,W5);l.push(this.rotateTo(u,f,n));const h=ii.setFromSpherical(this._sphericalEnd).normalize(),d=Z5.setFromUnitVectors(h,pD),g=ar(Math.abs(h.y),1);g&&d.multiply(gD.setFromAxisAngle(oE,u)),d.multiply(this._yAxisUpSpaceInverse);const b=$5.makeEmpty();qi.copy(c.min).applyQuaternion(d),b.expandByPoint(qi),qi.copy(c.min).setX(c.max.x).applyQuaternion(d),b.expandByPoint(qi),qi.copy(c.min).setY(c.max.y).applyQuaternion(d),b.expandByPoint(qi),qi.copy(c.max).setZ(c.min.z).applyQuaternion(d),b.expandByPoint(qi),qi.copy(c.min).setZ(c.max.z).applyQuaternion(d),b.expandByPoint(qi),qi.copy(c.max).setY(c.min.y).applyQuaternion(d),b.expandByPoint(qi),qi.copy(c.max).setX(c.min.x).applyQuaternion(d),b.expandByPoint(qi),qi.copy(c.max).applyQuaternion(d),b.expandByPoint(qi),b.min.x-=r,b.min.y-=s,b.max.x+=a,b.max.y+=o,d.setFromUnitVectors(pD,h),g&&d.premultiply(gD.invert()),d.premultiply(this._yAxisUpSpace);const y=b.getSize(ii),p=b.getCenter(qi).applyQuaternion(d);if(Lp(this._camera)){const x=this.getDistanceToFitBox(y.x,y.y,y.z,i);l.push(this.moveTo(p.x,p.y,p.z,n)),l.push(this.dollyTo(x,n)),l.push(this.setFocalOffset(0,0,0,n))}else if(nd(this._camera)){const x=this._camera,_=x.right-x.left,w=x.top-x.bottom,M=i?Math.max(_/y.x,w/y.y):Math.min(_/y.x,w/y.y);l.push(this.moveTo(p.x,p.y,p.z,n)),l.push(this.zoomTo(M,n)),l.push(this.setFocalOffset(0,0,0,n))}return Promise.all(l)}fitToSphere(e,n){const i=[],a="isObject3D"in e?xI.createBoundingSphere(e,mD):mD.copy(e);if(i.push(this.moveTo(a.center.x,a.center.y,a.center.z,n)),Lp(this._camera)){const s=this.getDistanceToFitSphere(a.radius);i.push(this.dollyTo(s,n))}else if(nd(this._camera)){const s=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,l=2*a.radius,c=Math.min(s/l,o/l);i.push(this.zoomTo(c,n))}return i.push(this.setFocalOffset(0,0,0,n)),Promise.all(i)}setLookAt(e,n,i,r,a,s,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=vb.NONE,this._changedDolly=0;const l=qi.set(r,a,s),c=ii.set(e,n,i);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!o||ar(this._target.x,this._targetEnd.x,this.restThreshold)&&ar(this._target.y,this._targetEnd.y,this.restThreshold)&&ar(this._target.z,this._targetEnd.z,this.restThreshold)&&ar(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ar(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&ar(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerp(e,n,i,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=vb.NONE,this._changedDolly=0;const a=ii.set(...e.target);if("spherical"in e)cl.set(...e.spherical);else{const f=qi.set(...e.position);cl.setFromVector3(f.sub(a).applyQuaternion(this._yAxisUpSpace))}const s=yb.set(...n.target);if("spherical"in n)xb.set(...n.spherical);else{const f=qi.set(...n.position);xb.setFromVector3(f.sub(s).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(a.lerp(s,i));const o=xb.theta-cl.theta,l=xb.phi-cl.phi,c=xb.radius-cl.radius;this._sphericalEnd.set(cl.radius+c*i,cl.phi+l*i,cl.theta+o*i),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!r||ar(this._target.x,this._targetEnd.x,this.restThreshold)&&ar(this._target.y,this._targetEnd.y,this.restThreshold)&&ar(this._target.z,this._targetEnd.z,this.restThreshold)&&ar(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ar(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&ar(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(e,n,i,r,a,s,o,l,c,u,f,h,d,g=!1){return this.lerp({position:[e,n,i],target:[r,a,s]},{position:[o,l,c],target:[u,f,h]},d,g)}setPosition(e,n,i,r=!1){return this.setLookAt(e,n,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,n,i,r=!1){const a=this.getPosition(ii),s=this.setLookAt(a.x,a.y,a.z,e,n,i,r);return this._sphericalEnd.phi=Wc(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),s}setFocalOffset(e,n,i,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,n,i),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);const a=!r||ar(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&ar(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&ar(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}setOrbitPoint(e,n,i){this._camera.updateMatrixWorld(),Iu.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Nu.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Pp.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=ii.set(e,n,i),a=r.distanceTo(this._camera.position),s=r.sub(this._camera.position);Iu.multiplyScalar(s.x),Nu.multiplyScalar(s.y),Pp.multiplyScalar(s.z),ii.copy(Iu).add(Nu).add(Pp),ii.z=ii.z+a,this.dollyTo(a,!1),this.setFocalOffset(-ii.x,ii.y,-ii.z,!1),this.moveTo(e,n,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,n,i,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new zn.Vector4,typeof e=="number"?this._viewport.set(e,n,i,r):this._viewport.copy(e)}getDistanceToFitBox(e,n,i,r=!1){if(hD(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const a=e/n,s=this._camera.getEffectiveFOV()*$y,o=this._camera.aspect;return((r?a>o:a<o)?n:e/o)*.5/Math.tan(s*.5)+i*.5}getDistanceToFitSphere(e){if(hD(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const n=this._camera.getEffectiveFOV()*$y,i=Math.atan(Math.tan(n*.5)*this._camera.aspect)*2,r=1<this._camera.aspect?n:i;return e/Math.sin(r*.5)}getTarget(e,n=!0){return(e&&e.isVector3?e:new zn.Vector3).copy(n?this._targetEnd:this._target)}getPosition(e,n=!0){return(e&&e.isVector3?e:new zn.Vector3).setFromSpherical(n?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(n?this._targetEnd:this._target)}getSpherical(e,n=!0){return(e||new zn.Spherical).copy(n?this._sphericalEnd:this._spherical)}getFocalOffset(e,n=!0){return(e&&e.isVector3?e:new zn.Vector3).copy(n?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%$h+$h)%$h,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=$h),this._spherical.theta+=$h*Math.round((this._sphericalEnd.theta-this._spherical.theta)/$h),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!ar(this._camera.up.x,this._cameraUp0.x)||!ar(this._camera.up.y,this._cameraUp0.y)||!ar(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const i=this.getPosition(ii);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}const n=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(n)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,oE),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=ii.subVectors(this._target,this._camera.position).normalize(),n=qi.crossVectors(e,this._camera.up);this._camera.up.crossVectors(n,e).normalize(),this._camera.updateMatrixWorld();const i=this.getPosition(ii);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}update(e){const n=this._sphericalEnd.theta-this._spherical.theta,i=this._sphericalEnd.phi-this._spherical.phi,r=this._sphericalEnd.radius-this._spherical.radius,a=Y5.subVectors(this._targetEnd,this._target),s=J5.subVectors(this._focalOffsetEnd,this._focalOffset),o=this._zoomEnd-this._zoom;if(Rr(n))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const f=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=aE(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,f,1/0,e),this._needsUpdate=!0}if(Rr(i))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const f=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=aE(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,f,1/0,e),this._needsUpdate=!0}if(Rr(r))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const f=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=aE(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,f,this.maxSpeed,e),this._needsUpdate=!0}if(Rr(a.x)&&Rr(a.y)&&Rr(a.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const f=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;X5(this._target,this._targetEnd,this._targetVelocity,f,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(Rr(s.x)&&Rr(s.y)&&Rr(s.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const f=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;X5(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,f,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(Rr(o))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const f=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=aE(this._zoom,this._zoomEnd,this._zoomVelocity,f,1/0,e)}if(this.dollyToCursor){if(Lp(this._camera)&&this._changedDolly!==0){const f=this._spherical.radius-this._lastDistance,h=this._camera,d=this._getCameraDirection(ex),g=ii.copy(d).cross(h.up).normalize();g.lengthSq()===0&&(g.x=1);const b=qi.crossVectors(g,d),y=this._sphericalEnd.radius*Math.tan(h.getEffectiveFOV()*$y*.5),x=(this._sphericalEnd.radius-f-this._sphericalEnd.radius)/this._sphericalEnd.radius,_=yb.copy(this._targetEnd).add(g.multiplyScalar(this._dollyControlCoord.x*y*h.aspect)).add(b.multiplyScalar(this._dollyControlCoord.y*y)),w=ii.copy(this._targetEnd).lerp(_,x),M=this._lastDollyDirection===vb.IN&&this._spherical.radius<=this.minDistance,S=this._lastDollyDirection===vb.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(M||S)){this._sphericalEnd.radius-=f,this._spherical.radius-=f;const C=qi.copy(d).multiplyScalar(-f);w.add(C)}this._boundary.clampPoint(w,w);const A=qi.subVectors(w,this._targetEnd);this._targetEnd.copy(w),this._target.add(A),this._changedDolly-=f,Rr(this._changedDolly)&&(this._changedDolly=0)}else if(nd(this._camera)&&this._changedZoom!==0){const f=this._zoom-this._lastZoom,h=this._camera,d=ii.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(h.near+h.far)/(h.near-h.far)).unproject(h),g=qi.set(0,0,-1).applyQuaternion(h.quaternion),b=yb.copy(d).add(g.multiplyScalar(-d.dot(h.up))),p=-(this._zoom-f-this._zoom)/this._zoom,x=this._getCameraDirection(ex),_=this._targetEnd.dot(x),w=ii.copy(this._targetEnd).lerp(b,p),M=w.dot(x),S=x.multiplyScalar(M-_);w.sub(S),this._boundary.clampPoint(w,w);const A=qi.subVectors(w,this._targetEnd);this._targetEnd.copy(w),this._target.add(A),this._changedZoom-=f,Rr(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const l=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,l),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!Rr(this._focalOffset.x)||!Rr(this._focalOffset.y)||!Rr(this._focalOffset.z))&&(Iu.setFromMatrixColumn(this._camera.matrix,0),Nu.setFromMatrixColumn(this._camera.matrix,1),Pp.setFromMatrixColumn(this._camera.matrix,2),Iu.multiplyScalar(this._focalOffset.x),Nu.multiplyScalar(-this._focalOffset.y),Pp.multiplyScalar(this._focalOffset.z),ii.copy(Iu).add(Nu).add(Pp),this._camera.position.add(ii),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),ii.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const u=this._needsUpdate;return u&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):u?(this.dispatchEvent({type:"update"}),Rr(n,this.restThreshold)&&Rr(i,this.restThreshold)&&Rr(r,this.restThreshold)&&Rr(a.x,this.restThreshold)&&Rr(a.y,this.restThreshold)&&Rr(a.z,this.restThreshold)&&Rr(s.x,this.restThreshold)&&Rr(s.y,this.restThreshold)&&Rr(s.z,this.restThreshold)&&Rr(o,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!u&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=u,this._needsUpdate=!1,u}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:Zy(this.maxDistance),minZoom:this.minZoom,maxZoom:Zy(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Zy(this.maxPolarAngle),minAzimuthAngle:Zy(this.minAzimuthAngle),maxAzimuthAngle:Zy(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:ii.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,n=!1){const i=JSON.parse(e);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=Qy(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=Qy(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=Qy(i.maxPolarAngle),this.minAzimuthAngle=Qy(i.minAzimuthAngle),this.maxAzimuthAngle=Qy(i.maxAzimuthAngle),this.smoothTime=i.smoothTime,this.draggingSmoothTime=i.draggingSmoothTime,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],n),cl.setFromVector3(ii.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(cl.theta,cl.phi,n),this.dollyTo(cl.radius,n),this.zoomTo(i.zoom,n),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],n),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",r2e),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(n=>n.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(n=>n.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,n,i){const r=n.lengthSq();if(r===0)return e;const a=qi.copy(n).add(e),o=this._boundary.clampPoint(a,yb).sub(a),l=o.lengthSq();if(l===0)return e.add(n);if(l===r)return e;if(i===0)return e.add(n).add(o);{const c=1+i*l/n.dot(o);return e.add(qi.copy(n).multiplyScalar(c)).add(o.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(Lp(this._camera)){const e=this._camera,n=e.near,i=e.getEffectiveFOV()*$y,r=Math.tan(i*.5)*n,a=r*e.aspect;this._nearPlaneCorners[0].set(-a,-r,0),this._nearPlaneCorners[1].set(a,-r,0),this._nearPlaneCorners[2].set(a,r,0),this._nearPlaneCorners[3].set(-a,r,0)}else if(nd(this._camera)){const e=this._camera,n=1/e.zoom,i=e.left*n,r=e.right*n,a=e.top*n,s=e.bottom*n;this._nearPlaneCorners[0].set(i,a,0),this._nearPlaneCorners[1].set(r,a,0),this._nearPlaneCorners[2].set(r,s,0),this._nearPlaneCorners[3].set(i,s,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||hD(this._camera,"_collisionTest"))return e;const i=this._getTargetDirection(ex);bD.lookAt(K5,i,this._camera.up);for(let r=0;r<4;r++){const a=qi.copy(this._nearPlaneCorners[r]);a.applyMatrix4(bD);const s=yb.addVectors(this._target,a);lE.set(s,i),lE.far=this._spherical.radius+1;const o=lE.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance<e&&(e=o[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const n=this._domElement.getBoundingClientRect();return e.x=n.left,e.y=n.top,this._viewport?(e.x+=this._viewport.x,e.y+=n.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=n.width,e.height=n.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(n=>{const i=()=>{this.removeEventListener("rest",i),n()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,n=new zn.Sphere){const i=n,r=i.center;_b.makeEmpty(),e.traverseVisible(s=>{s.isMesh&&_b.expandByObject(s)}),_b.getCenter(r);let a=0;return e.traverseVisible(s=>{if(!s.isMesh)return;const o=s;if(!o.geometry)return;const l=o.geometry.clone();l.applyMatrix4(o.matrixWorld);const u=l.attributes.position;for(let f=0,h=u.count;f<h;f++)ii.fromBufferAttribute(u,f),a=Math.max(a,r.distanceToSquared(ii))}),i.radius=Math.sqrt(a),i}};const Q5=I.forwardRef((t,e)=>{const{impl:n,camera:i,domElement:r,makeDefault:a,onControlStart:s,onControl:o,onControlEnd:l,onTransitionStart:c,onUpdate:u,onWake:f,onRest:h,onSleep:d,onStart:g,onEnd:b,onChange:y,regress:p,...x}=t,_=n??s2e;I.useMemo(()=>{const q={Box3:rr,MathUtils:{clamp:gc.clamp},Matrix4:Ot,Quaternion:Vn,Raycaster:V_,Sphere:Ir,Spherical:R$,Vector2:wt,Vector3:te,Vector4:ei};_.install({THREE:q}),W_({CameraControlsImpl:_})},[_]);const w=Ri(q=>q.camera),M=Ri(q=>q.gl),S=Ri(q=>q.invalidate),A=Ri(q=>q.events),C=Ri(q=>q.setEvents),D=Ri(q=>q.set),R=Ri(q=>q.get),N=Ri(q=>q.performance),U=i||w,j=r||A.connected||M.domElement,z=I.useMemo(()=>new _(U),[_,U]);return ra((q,B)=>{z.update(B)},-1),I.useEffect(()=>(z.connect(j),()=>void z.disconnect()),[j,z]),I.useEffect(()=>{function q(){S(),p&&N.regress()}const B=de=>{q(),s?.(de),g?.(de)},G=de=>{q(),o?.(de),y?.(de)},H=de=>{l?.(de),b?.(de)},W=de=>{q(),c?.(de),y?.(de)},F=de=>{q(),u?.(de),y?.(de)},Y=de=>{q(),f?.(de),y?.(de)},Z=de=>{h?.(de)},V=de=>{d?.(de)};return z.addEventListener("controlstart",B),z.addEventListener("control",G),z.addEventListener("controlend",H),z.addEventListener("transitionstart",W),z.addEventListener("update",F),z.addEventListener("wake",Y),z.addEventListener("rest",Z),z.addEventListener("sleep",V),()=>{z.removeEventListener("controlstart",B),z.removeEventListener("control",G),z.removeEventListener("controlend",H),z.removeEventListener("transitionstart",W),z.removeEventListener("update",F),z.removeEventListener("wake",Y),z.removeEventListener("rest",Z),z.removeEventListener("sleep",V)}},[z,S,C,p,N,s,o,l,c,u,f,h,d,y,g,b]),I.useEffect(()=>{if(a){const q=R().controls;return D({controls:z}),()=>D({controls:q})}},[a,z]),I.createElement("primitive",Is({ref:e,object:z},x))}),o2e=SC({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new Ut,sectionColor:new Ut,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new te,worldPlanePosition:new te},`
    varying vec3 localPosition;
    varying vec4 worldPosition;

    uniform vec3 worldCamProjPosition;
    uniform vec3 worldPlanePosition;
    uniform float fadeDistance;
    uniform bool infiniteGrid;
    uniform bool followCamera;

    void main() {
      localPosition = position.xzy;
      if (infiniteGrid) localPosition *= 1.0 + fadeDistance;
      
      worldPosition = modelMatrix * vec4(localPosition, 1.0);
      if (followCamera) {
        worldPosition.xyz += (worldCamProjPosition - worldPlanePosition);
        localPosition = (inverse(modelMatrix) * worldPosition).xyz;
      }

      gl_Position = projectionMatrix * viewMatrix * worldPosition;
    }
  `,`
    varying vec3 localPosition;
    varying vec4 worldPosition;

    uniform vec3 worldCamProjPosition;
    uniform float cellSize;
    uniform float sectionSize;
    uniform vec3 cellColor;
    uniform vec3 sectionColor;
    uniform float fadeDistance;
    uniform float fadeStrength;
    uniform float fadeFrom;
    uniform float cellThickness;
    uniform float sectionThickness;

    float getGrid(float size, float thickness) {
      vec2 r = localPosition.xz / size;
      vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r);
      float line = min(grid.x, grid.y) + 1.0 - thickness;
      return 1.0 - min(line, 1.0);
    }

    void main() {
      float g1 = getGrid(cellSize, cellThickness);
      float g2 = getGrid(sectionSize, sectionThickness);

      vec3 from = worldCamProjPosition*vec3(fadeFrom);
      float dist = distance(from, worldPosition.xyz);
      float d = 1.0 - min(dist / fadeDistance, 1.0);
      vec3 color = mix(cellColor, sectionColor, min(1.0, sectionThickness * g2));

      gl_FragColor = vec4(color, (g1 + g2) * pow(d, fadeStrength));
      gl_FragColor.a = mix(0.75 * gl_FragColor.a, gl_FragColor.a, g2);
      if (gl_FragColor.a <= 0.0) discard;

      #include <tonemapping_fragment>
      #include <${jZ>=154?"colorspace_fragment":"encodings_fragment"}>
    }
  `),VZ=I.forwardRef(({args:t,cellColor:e="#000000",sectionColor:n="#2080ff",cellSize:i=.5,sectionSize:r=1,followCamera:a=!1,infiniteGrid:s=!1,fadeDistance:o=100,fadeStrength:l=1,fadeFrom:c=1,cellThickness:u=.5,sectionThickness:f=1,side:h=Ra,...d},g)=>{W_({GridMaterial:o2e});const b=I.useRef(null);I.useImperativeHandle(g,()=>b.current,[]);const y=new $c,p=new te(0,1,0),x=new te(0,0,0);ra(M=>{y.setFromNormalAndCoplanarPoint(p,x).applyMatrix4(b.current.matrixWorld);const S=b.current.material,A=S.uniforms.worldCamProjPosition,C=S.uniforms.worldPlanePosition;y.projectPoint(M.camera.position,A.value),C.value.set(0,0,0).applyMatrix4(b.current.matrixWorld)});const _={cellSize:i,sectionSize:r,cellColor:e,sectionColor:n,cellThickness:u,sectionThickness:f},w={fadeDistance:o,fadeStrength:l,fadeFrom:c,infiniteGrid:s,followCamera:a};return I.createElement("mesh",Is({ref:b,frustumCulled:!1},d),I.createElement("gridMaterial",Is({transparent:!0,"extensions-derivatives":!0,side:h},_,w)),I.createElement("planeGeometry",{args:t}))}),l2e="modulepreload",c2e=function(t){return"/"+t},e6={},u2e=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");r=Promise.allSettled(n.map(l=>{if(l=c2e(l),l in e6)return;e6[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":l2e,c||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((h,d)=>{f.addEventListener("load",h),f.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return r.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};var GZ={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(Nm,function(){var n=function(){function i(d){return s.appendChild(d.dom),d}function r(d){for(var g=0;g<s.children.length;g++)s.children[g].style.display=g===d?"block":"none";a=d}var a=0,s=document.createElement("div");s.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",s.addEventListener("click",function(d){d.preventDefault(),r(++a%s.children.length)},!1);var o=(performance||Date).now(),l=o,c=0,u=i(new n.Panel("FPS","#0ff","#002")),f=i(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=i(new n.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:s,addPanel:i,showPanel:r,begin:function(){o=(performance||Date).now()},end:function(){c++;var d=(performance||Date).now();if(f.update(d-o,200),d>l+1e3&&(u.update(1e3*c/(d-l),100),l=d,c=0,h)){var g=performance.memory;h.update(g.usedJSHeapSize/1048576,g.jsHeapSizeLimit/1048576)}return d},update:function(){o=this.end()},domElement:s,setMode:r}};return n.Panel=function(i,r,a){var s=1/0,o=0,l=Math.round,c=l(window.devicePixelRatio||1),u=80*c,f=48*c,h=3*c,d=2*c,g=3*c,b=15*c,y=74*c,p=30*c,x=document.createElement("canvas");x.width=u,x.height=f,x.style.cssText="width:80px;height:48px";var _=x.getContext("2d");return _.font="bold "+9*c+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=a,_.fillRect(0,0,u,f),_.fillStyle=r,_.fillText(i,h,d),_.fillRect(g,b,y,p),_.fillStyle=a,_.globalAlpha=.9,_.fillRect(g,b,y,p),{dom:x,update:function(w,M){s=Math.min(s,w),o=Math.max(o,w),_.fillStyle=a,_.globalAlpha=1,_.fillRect(0,0,u,b),_.fillStyle=r,_.fillText(l(w)+" "+i+" ("+l(s)+"-"+l(o)+")",h,d),_.drawImage(x,g+c,b,y-c,p,g,b,y-c,p),_.fillRect(g+y-c,b,c,p),_.fillStyle=a,_.globalAlpha=.9,_.fillRect(g+y-c,b,c,l((1-w/M)*p))}}},n})})(GZ);var f2e=GZ.exports;const h2e=Mc(f2e);function d2e(t,e=[],n){const[i,r]=I.useState();return I.useLayoutEffect(()=>{const a=t();return r(a),()=>void 0},e),i}function p2e({showPanel:t=0,className:e,parent:n}){const i=d2e(()=>new h2e,[]);return I.useEffect(()=>{if(i){const r=n&&n.current||document.body;i.showPanel(t),r?.appendChild(i.dom);const a=(e??"").split(" ").filter(l=>l);a.length&&i.dom.classList.add(...a);const s=Cwe(()=>i.begin()),o=Rwe(()=>i.end());return()=>{a.length&&i.dom.classList.remove(...a),r?.removeChild(i.dom),s(),o()}}},[n,i,e,t]),null}const t6=(t,e)=>{t.updateRanges[0]=e};function m2e(t){return typeof t=="function"}const n6=new Ot,i6=new Ot,cE=[],tx=new _i;class g2e extends bl{constructor(){super(),this.color=new Ut("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var e;return(e=this.instance.current)==null?void 0:e.geometry}raycast(e,n){const i=this.instance.current;if(!i||!i.geometry||!i.material)return;tx.geometry=i.geometry;const r=i.matrixWorld,a=i.userData.instances.indexOf(this.instanceKey);if(!(a===-1||a>i.count)){i.getMatrixAt(a,n6),i6.multiplyMatrices(r,n6),tx.matrixWorld=i6,i.material instanceof ka?tx.material.side=i.material.side:tx.material.side=i.material[0].side,tx.raycast(e,cE);for(let s=0,o=cE.length;s<o;s++){const l=cE[s];l.instanceId=a,l.object=this,n.push(l)}cE.length=0}}}const WZ=I.createContext(null),r6=new Ot,a6=new Ot,b2e=new Ot,s6=new te,o6=new Vn,l6=new te,v2e=t=>t.isInstancedBufferAttribute,sc=I.forwardRef(({context:t,children:e,...n},i)=>{I.useMemo(()=>W_({PositionMesh:g2e}),[]);const r=I.useRef(null);I.useImperativeHandle(i,()=>r.current,[]);const{subscribe:a,getParent:s}=I.useContext(t||WZ);return I.useLayoutEffect(()=>a(r),[]),I.createElement("positionMesh",Is({instance:s(),instanceKey:r,ref:r},n),e)}),lT=I.forwardRef(({context:t,children:e,range:n,limit:i=1e3,frames:r=1/0,...a},s)=>{const[{localContext:o,instance:l}]=I.useState(()=>{const x=I.createContext(null);return{localContext:x,instance:I.forwardRef((_,w)=>I.createElement(sc,Is({context:x},_,{ref:w})))}}),c=I.useRef(null);I.useImperativeHandle(s,()=>c.current,[]);const[u,f]=I.useState([]),[[h,d]]=I.useState(()=>{const x=new Float32Array(i*16);for(let _=0;_<i;_++)b2e.identity().toArray(x,_*16);return[x,new Float32Array([...new Array(i*3)].map(()=>1))]});I.useEffect(()=>{c.current.instanceMatrix.needsUpdate=!0});let g=0,b=0;const y=I.useRef([]);I.useLayoutEffect(()=>{y.current=Object.entries(c.current.geometry.attributes).filter(([x,_])=>v2e(_))}),ra(()=>{if(r===1/0||g<r){c.current.updateMatrix(),c.current.updateMatrixWorld(),r6.copy(c.current.matrixWorld).invert(),b=Math.min(i,n!==void 0?n:i,u.length),c.current.count=b,t6(c.current.instanceMatrix,{start:0,count:b*16}),t6(c.current.instanceColor,{start:0,count:b*3});for(let x=0;x<u.length;x++){const _=u[x].current;_.matrixWorld.decompose(s6,o6,l6),a6.compose(s6,o6,l6).premultiply(r6),a6.toArray(h,x*16),c.current.instanceMatrix.needsUpdate=!0,_.color.toArray(d,x*3),c.current.instanceColor.needsUpdate=!0}g++}});const p=I.useMemo(()=>({getParent:()=>c,subscribe:x=>(f(_=>[..._,x]),()=>f(_=>_.filter(w=>w.current!==x.current)))}),[]);return I.createElement("instancedMesh",Is({userData:{instances:u,limit:i,frames:r},matrixAutoUpdate:!1,ref:c,args:[null,null,0],raycast:()=>null},a),I.createElement("instancedBufferAttribute",{attach:"instanceMatrix",args:[h,16],usage:V1}),I.createElement("instancedBufferAttribute",{attach:"instanceColor",args:[d,3],usage:V1}),m2e(e)?I.createElement(o.Provider,{value:p},e(l)):t?I.createElement(t.Provider,{value:p},e):I.createElement(WZ.Provider,{value:p},e))}),qZ=(t,e,n)=>{let i;switch(t){case To:i=new Uint8ClampedArray(e*n*4);break;case ts:i=new Uint16Array(e*n*4);break;case wc:i=new Uint32Array(e*n*4);break;case PA:i=new Int8Array(e*n*4);break;case UA:i=new Int16Array(e*n*4);break;case Bv:i=new Int32Array(e*n*4);break;case yr:i=new Float32Array(e*n*4);break;default:throw new Error("Unsupported data type")}return i};let uE;const y2e=(t,e,n,i)=>{if(uE!==void 0)return uE;const r=new Ec(1,1,i);e.setRenderTarget(r);const a=new _i(new Ol,new Cs({color:16777215}));e.render(a,n),e.setRenderTarget(null);const s=qZ(t,r.width,r.height);return e.readRenderTargetPixels(r,0,0,r.width,r.height,s),r.dispose(),a.geometry.dispose(),a.material.dispose(),uE=s[0]!==0,uE};class RU{constructor(e){var n,i,r,a,s,o,l,c,u,f,h,d,g,b,y,p;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(_){throw this._renderer.setRenderTarget(null),_}this._renderer.setRenderTarget(null)},this._width=e.width,this._height=e.height,this._type=e.type,this._colorSpace=e.colorSpace;const x={format:$r,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:((n=e.renderTargetOptions)===null||n===void 0?void 0:n.anisotropy)!==void 0?(i=e.renderTargetOptions)===null||i===void 0?void 0:i.anisotropy:1,generateMipmaps:((r=e.renderTargetOptions)===null||r===void 0?void 0:r.generateMipmaps)!==void 0?(a=e.renderTargetOptions)===null||a===void 0?void 0:a.generateMipmaps:!1,magFilter:((s=e.renderTargetOptions)===null||s===void 0?void 0:s.magFilter)!==void 0?(o=e.renderTargetOptions)===null||o===void 0?void 0:o.magFilter:Hi,minFilter:((l=e.renderTargetOptions)===null||l===void 0?void 0:l.minFilter)!==void 0?(c=e.renderTargetOptions)===null||c===void 0?void 0:c.minFilter:Hi,samples:((u=e.renderTargetOptions)===null||u===void 0?void 0:u.samples)!==void 0?(f=e.renderTargetOptions)===null||f===void 0?void 0:f.samples:void 0,wrapS:((h=e.renderTargetOptions)===null||h===void 0?void 0:h.wrapS)!==void 0?(d=e.renderTargetOptions)===null||d===void 0?void 0:d.wrapS:ba,wrapT:((g=e.renderTargetOptions)===null||g===void 0?void 0:g.wrapT)!==void 0?(b=e.renderTargetOptions)===null||b===void 0?void 0:b.wrapT:ba};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=RU.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Hv,this._camera=new Eh,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!y2e(this._type,this._renderer,this._camera,x)){let _;switch(this._type){case ts:_=this._renderer.extensions.has("EXT_color_buffer_float")?yr:void 0;break}_!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${yr}`),this._type=_):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new _i(new Ol,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new Ec(this.width,this.height,x),this._renderTarget.texture.mapping=((y=e.renderTargetOptions)===null||y===void 0?void 0:y.mapping)!==void 0?(p=e.renderTargetOptions)===null||p===void 0?void 0:p.mapping:Fd}static instantiateRenderer(){const e=new bU;return e.setSize(128,128),e}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const e=qZ(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,e),e}toDataTexture(e){const n=new rs(this.toArray(),this.width,this.height,$r,this._type,e?.mapping||Fd,e?.wrapS||ba,e?.wrapT||ba,e?.magFilter||Hi,e?.minFilter||Hi,e?.anisotropy||1,bu);return n.generateMipmaps=e?.generateMipmaps!==void 0?e?.generateMipmaps:!1,n}disposeOnDemandRenderer(){this._renderer.setRenderTarget(null),this._rendererIsDisposable&&(this._renderer.dispose(),this._renderer.forceContextLoss())}dispose(e){this.disposeOnDemandRenderer(),e&&this.renderTarget.dispose(),this.material instanceof ss&&Object.values(this.material.uniforms).forEach(n=>{n.value instanceof nr&&n.value.dispose()}),Object.values(this.material).forEach(n=>{n instanceof nr&&n.dispose()}),this.material.dispose(),this._quad.geometry.dispose()}get width(){return this._width}set width(e){this._width=e,this._renderTarget.setSize(this._width,this._height)}get height(){return this._height}set height(e){this._height=e,this._renderTarget.setSize(this._width,this._height)}get renderer(){return this._renderer}get renderTarget(){return this._renderTarget}set renderTarget(e){this._renderTarget=e,this._width=e.width,this._height=e.height}get material(){return this._material}get type(){return this._type}get colorSpace(){return this._colorSpace}}const x2e=`
varying vec2 vUv;

void main() {
  vUv = uv;
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`,_2e=`
// min half float value
#define HALF_FLOAT_MIN vec3( -65504, -65504, -65504 )
// max half float value
#define HALF_FLOAT_MAX vec3( 65504, 65504, 65504 )

uniform sampler2D sdr;
uniform sampler2D gainMap;
uniform vec3 gamma;
uniform vec3 offsetHdr;
uniform vec3 offsetSdr;
uniform vec3 gainMapMin;
uniform vec3 gainMapMax;
uniform float weightFactor;

varying vec2 vUv;

void main() {
  vec3 rgb = texture2D( sdr, vUv ).rgb;
  vec3 recovery = texture2D( gainMap, vUv ).rgb;
  vec3 logRecovery = pow( recovery, gamma );
  vec3 logBoost = gainMapMin * ( 1.0 - logRecovery ) + gainMapMax * logRecovery;
  vec3 hdrColor = (rgb + offsetSdr) * exp2( logBoost * weightFactor ) - offsetHdr;
  vec3 clampedHdrColor = max( HALF_FLOAT_MIN, min( HALF_FLOAT_MAX, hdrColor ));
  gl_FragColor = vec4( clampedHdrColor , 1.0 );
}
`;class S2e extends ss{constructor({gamma:e,offsetHdr:n,offsetSdr:i,gainMapMin:r,gainMapMax:a,maxDisplayBoost:s,hdrCapacityMin:o,hdrCapacityMax:l,sdr:c,gainMap:u}){super({name:"GainMapDecoderMaterial",vertexShader:x2e,fragmentShader:_2e,uniforms:{sdr:{value:c},gainMap:{value:u},gamma:{value:new te(1/e[0],1/e[1],1/e[2])},offsetHdr:{value:new te().fromArray(n)},offsetSdr:{value:new te().fromArray(i)},gainMapMin:{value:new te().fromArray(r)},gainMapMax:{value:new te().fromArray(a)},weightFactor:{value:(Math.log2(s)-o)/(l-o)}},blending:Zu,depthTest:!1,depthWrite:!1}),this._maxDisplayBoost=s,this._hdrCapacityMin=o,this._hdrCapacityMax=l,this.needsUpdate=!0,this.uniformsNeedUpdate=!0}get sdr(){return this.uniforms.sdr.value}set sdr(e){this.uniforms.sdr.value=e}get gainMap(){return this.uniforms.gainMap.value}set gainMap(e){this.uniforms.gainMap.value=e}get offsetHdr(){return this.uniforms.offsetHdr.value.toArray()}set offsetHdr(e){this.uniforms.offsetHdr.value.fromArray(e)}get offsetSdr(){return this.uniforms.offsetSdr.value.toArray()}set offsetSdr(e){this.uniforms.offsetSdr.value.fromArray(e)}get gainMapMin(){return this.uniforms.gainMapMin.value.toArray()}set gainMapMin(e){this.uniforms.gainMapMin.value.fromArray(e)}get gainMapMax(){return this.uniforms.gainMapMax.value.toArray()}set gainMapMax(e){this.uniforms.gainMapMax.value.fromArray(e)}get gamma(){const e=this.uniforms.gamma.value;return[1/e.x,1/e.y,1/e.z]}set gamma(e){const n=this.uniforms.gamma.value;n.x=1/e[0],n.y=1/e[1],n.z=1/e[2]}get hdrCapacityMin(){return this._hdrCapacityMin}set hdrCapacityMin(e){this._hdrCapacityMin=e,this.calculateWeight()}get hdrCapacityMax(){return this._hdrCapacityMax}set hdrCapacityMax(e){this._hdrCapacityMax=e,this.calculateWeight()}get maxDisplayBoost(){return this._maxDisplayBoost}set maxDisplayBoost(e){this._maxDisplayBoost=Math.max(1,Math.min(65504,e)),this.calculateWeight()}calculateWeight(){const e=(Math.log2(this._maxDisplayBoost)-this._hdrCapacityMin)/(this._hdrCapacityMax-this._hdrCapacityMin);this.uniforms.weightFactor.value=Math.max(0,Math.min(1,e))}}class XZ extends Error{}class KZ extends Error{}const nx=(t,e,n)=>{const i=new RegExp(`${e}="([^"]*)"`,"i").exec(t);if(i)return i[1];const r=new RegExp(`<${e}[^>]*>([\\s\\S]*?)</${e}>`,"i").exec(t);if(r){const a=r[1].match(/<rdf:li>([^<]*)<\/rdf:li>/g);return a&&a.length===3?a.map(s=>s.replace(/<\/?rdf:li>/g,"")):r[1].trim()}if(n!==void 0)return n;throw new Error(`Can't find ${e} in gainmap metadata`)},w2e=t=>{let e;typeof TextDecoder<"u"?e=new TextDecoder().decode(t):e=t.toString();let n=e.indexOf("<x:xmpmeta");for(;n!==-1;){const i=e.indexOf("x:xmpmeta>",n),r=e.slice(n,i+10);try{const a=nx(r,"hdrgm:GainMapMin","0"),s=nx(r,"hdrgm:GainMapMax"),o=nx(r,"hdrgm:Gamma","1"),l=nx(r,"hdrgm:OffsetSDR","0.015625"),c=nx(r,"hdrgm:OffsetHDR","0.015625"),u=/hdrgm:HDRCapacityMin="([^"]*)"/.exec(r),f=u?u[1]:"0",h=/hdrgm:HDRCapacityMax="([^"]*)"/.exec(r);if(!h)throw new Error("Incomplete gainmap metadata");const d=h[1];return{gainMapMin:Array.isArray(a)?a.map(g=>parseFloat(g)):[parseFloat(a),parseFloat(a),parseFloat(a)],gainMapMax:Array.isArray(s)?s.map(g=>parseFloat(g)):[parseFloat(s),parseFloat(s),parseFloat(s)],gamma:Array.isArray(o)?o.map(g=>parseFloat(g)):[parseFloat(o),parseFloat(o),parseFloat(o)],offsetSdr:Array.isArray(l)?l.map(g=>parseFloat(g)):[parseFloat(l),parseFloat(l),parseFloat(l)],offsetHdr:Array.isArray(c)?c.map(g=>parseFloat(g)):[parseFloat(c),parseFloat(c),parseFloat(c)],hdrCapacityMin:parseFloat(f),hdrCapacityMax:parseFloat(d)}}catch{}n=e.indexOf("<x:xmpmeta",i)}};class E2e{constructor(e){this.options={debug:e&&e.debug!==void 0?e.debug:!1,extractFII:e&&e.extractFII!==void 0?e.extractFII:!0,extractNonFII:e&&e.extractNonFII!==void 0?e.extractNonFII:!0}}extract(e){return new Promise((n,i)=>{const r=this.options.debug,a=new DataView(e.buffer);if(a.getUint16(0)!==65496){i(new Error("Not a valid jpeg"));return}const s=a.byteLength;let o=2,l=0,c;for(;o<s;){if(++l>250){i(new Error(`Found no marker after ${l} loops 😵`));return}if(a.getUint8(o)!==255){i(new Error(`Not a valid marker at offset 0x${o.toString(16)}, found: 0x${a.getUint8(o).toString(16)}`));return}if(c=a.getUint8(o+1),r&&console.log(`Marker: ${c.toString(16)}`),c===226){r&&console.log("Found APP2 marker (0xffe2)");const u=o+4;if(a.getUint32(u)===1297106432){const f=u+4;let h;if(a.getUint16(f)===18761)h=!1;else if(a.getUint16(f)===19789)h=!0;else{i(new Error("No valid endianness marker found in TIFF header"));return}if(a.getUint16(f+2,!h)!==42){i(new Error("Not valid TIFF data! (no 0x002A marker)"));return}const d=a.getUint32(f+4,!h);if(d<8){i(new Error("Not valid TIFF data! (First offset less than 8)"));return}const g=f+d,b=a.getUint16(g,!h),y=g+2;let p=0;for(let M=y;M<y+12*b;M+=12)a.getUint16(M,!h)===45057&&(p=a.getUint32(M+8,!h));const _=g+2+b*12+4,w=[];for(let M=_;M<_+p*16;M+=16){const S={MPType:a.getUint32(M,!h),size:a.getUint32(M+4,!h),dataOffset:a.getUint32(M+8,!h),dependantImages:a.getUint32(M+12,!h),start:-1,end:-1,isFII:!1};S.dataOffset?(S.start=f+S.dataOffset,S.isFII=!1):(S.start=0,S.isFII=!0),S.end=S.start+S.size,w.push(S)}if(this.options.extractNonFII&&w.length){const M=new Blob([a]),S=[];for(const A of w){if(A.isFII&&!this.options.extractFII)continue;const C=M.slice(A.start,A.end+1,"image/jpeg");S.push(C)}n(S)}}}o+=2+a.getUint16(o+2)}})}}const M2e=async t=>{const e=w2e(t);if(!e)throw new KZ("Gain map XMP metadata not found");const i=await new E2e({extractFII:!0,extractNonFII:!0}).extract(t);if(i.length!==2)throw new XZ("Gain map recovery image not found");return{sdr:new Uint8Array(await i[0].arrayBuffer()),gainMap:new Uint8Array(await i[1].arrayBuffer()),metadata:e}},c6=t=>new Promise((e,n)=>{const i=document.createElement("img");i.onload=()=>{e(i)},i.onerror=r=>{n(r)},i.src=URL.createObjectURL(t)});class YZ extends Fs{constructor(e,n){super(n),e&&(this._renderer=e),this._internalLoadingManager=new hC}setRenderer(e){return this._renderer=e,this}setRenderTargetOptions(e){return this._renderTargetOptions=e,this}prepareQuadRenderer(){this._renderer||console.warn("WARNING: An existing WebGL Renderer was not passed to this Loader constructor or in setRenderer, the result of this Loader will need to be converted to a Data Texture with toDataTexture() before you can use it in your renderer.");const e=new S2e({gainMapMax:[1,1,1],gainMapMin:[0,0,0],gamma:[1,1,1],offsetHdr:[1,1,1],offsetSdr:[1,1,1],hdrCapacityMax:1,hdrCapacityMin:0,maxDisplayBoost:1,gainMap:new nr,sdr:new nr});return new RU({width:16,height:16,type:ts,colorSpace:bu,material:e,renderer:this._renderer,renderTargetOptions:this._renderTargetOptions})}async render(e,n,i,r){const a=r?new Blob([r],{type:"image/jpeg"}):void 0,s=new Blob([i],{type:"image/jpeg"});let o,l,c=!1;if(typeof createImageBitmap>"u"){const h=await Promise.all([a?c6(a):Promise.resolve(void 0),c6(s)]);l=h[0],o=h[1],c=!0}else{const h=await Promise.all([a?createImageBitmap(a,{imageOrientation:"flipY"}):Promise.resolve(void 0),createImageBitmap(s,{imageOrientation:"flipY"})]);l=h[0],o=h[1]}const u=new nr(l||new ImageData(2,2),Fd,ba,ba,Hi,XO,$r,To,1,bu);u.flipY=c,u.needsUpdate=!0;const f=new nr(o,Fd,ba,ba,Hi,XO,$r,To,1,Es);f.flipY=c,f.needsUpdate=!0,e.width=o.width,e.height=o.height,e.material.gainMap=u,e.material.sdr=f,e.material.gainMapMin=n.gainMapMin,e.material.gainMapMax=n.gainMapMax,e.material.offsetHdr=n.offsetHdr,e.material.offsetSdr=n.offsetSdr,e.material.gamma=n.gamma,e.material.hdrCapacityMin=n.hdrCapacityMin,e.material.hdrCapacityMax=n.hdrCapacityMax,e.material.maxDisplayBoost=Math.pow(2,n.hdrCapacityMax),e.material.needsUpdate=!0,e.render()}}class T2e extends YZ{load([e,n,i],r,a,s){const o=this.prepareQuadRenderer();let l,c,u;const f=async()=>{if(l&&c&&u){try{await this.render(o,u,l,c)}catch(D){this.manager.itemError(e),this.manager.itemError(n),this.manager.itemError(i),typeof s=="function"&&s(D),o.disposeOnDemandRenderer();return}typeof r=="function"&&r(o),this.manager.itemEnd(e),this.manager.itemEnd(n),this.manager.itemEnd(i),o.disposeOnDemandRenderer()}};let h=!0,d=0,g=0,b=!0,y=0,p=0,x=!0,_=0,w=0;const M=()=>{if(typeof a=="function"){const D=d+y+_,R=g+p+w,N=h&&b&&x;a(new ProgressEvent("progress",{lengthComputable:N,loaded:R,total:D}))}};this.manager.itemStart(e),this.manager.itemStart(n),this.manager.itemStart(i);const S=new Os(this._internalLoadingManager);S.setResponseType("arraybuffer"),S.setRequestHeader(this.requestHeader),S.setPath(this.path),S.setWithCredentials(this.withCredentials),S.load(e,async D=>{if(typeof D=="string")throw new Error("Invalid sdr buffer");l=D,await f()},D=>{h=D.lengthComputable,g=D.loaded,d=D.total,M()},D=>{this.manager.itemError(e),typeof s=="function"&&s(D)});const A=new Os(this._internalLoadingManager);A.setResponseType("arraybuffer"),A.setRequestHeader(this.requestHeader),A.setPath(this.path),A.setWithCredentials(this.withCredentials),A.load(n,async D=>{if(typeof D=="string")throw new Error("Invalid gainmap buffer");c=D,await f()},D=>{b=D.lengthComputable,p=D.loaded,y=D.total,M()},D=>{this.manager.itemError(n),typeof s=="function"&&s(D)});const C=new Os(this._internalLoadingManager);return C.setRequestHeader(this.requestHeader),C.setPath(this.path),C.setWithCredentials(this.withCredentials),C.load(i,async D=>{if(typeof D!="string")throw new Error("Invalid metadata string");u=JSON.parse(D),await f()},D=>{x=D.lengthComputable,w=D.loaded,_=D.total,M()},D=>{this.manager.itemError(i),typeof s=="function"&&s(D)}),o}}class A2e extends YZ{load(e,n,i,r){const a=this.prepareQuadRenderer(),s=new Os(this._internalLoadingManager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.setWithCredentials(this.withCredentials),this.manager.itemStart(e),s.load(e,async o=>{if(typeof o=="string")throw new Error("Invalid buffer, received [string], was expecting [ArrayBuffer]");const l=new Uint8Array(o);let c,u,f;try{const h=await M2e(l);c=h.sdr,u=h.gainMap,f=h.metadata}catch(h){if(h instanceof KZ||h instanceof XZ)console.warn(`Failure to reconstruct an HDR image from ${e}: Gain map metadata not found in the file, HDRJPGLoader will render the SDR jpeg`),f={gainMapMin:[0,0,0],gainMapMax:[1,1,1],gamma:[1,1,1],hdrCapacityMin:0,hdrCapacityMax:1,offsetHdr:[0,0,0],offsetSdr:[0,0,0]},c=l;else throw h}try{await this.render(a,f,c,u)}catch(h){this.manager.itemError(e),typeof r=="function"&&r(h),a.disposeOnDemandRenderer();return}typeof n=="function"&&n(a),this.manager.itemEnd(e),a.disposeOnDemandRenderer()},i,o=>{this.manager.itemError(e),typeof r=="function"&&r(o)}),a}}const $1={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},JZ="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",_0=t=>Array.isArray(t),kU=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function wC({files:t=kU,path:e="",preset:n=void 0,colorSpace:i=void 0,extensions:r}={}){n&&(DU(n),t=$1[n],e=JZ);const a=_0(t),{extension:s,isCubemap:o}=OU(t),l=IU(s);if(!l)throw new Error("useEnvironment: Unrecognized file extension: "+t);const c=Ri(d=>d.gl);I.useLayoutEffect(()=>{if(s!=="webp"&&s!=="jpg"&&s!=="jpeg")return;function d(){uv.clear(l,a?[t]:t)}c.domElement.addEventListener("webglcontextlost",d,{once:!0})},[t,c.domElement]);const u=uv(l,a?[t]:t,d=>{(s==="webp"||s==="jpg"||s==="jpeg")&&d.setRenderer(c),d.setPath==null||d.setPath(e),r&&r(d)});let f=a?u[0]:u;if(s==="jpg"||s==="jpeg"||s==="webp"){var h;f=(h=f.renderTarget)==null?void 0:h.texture}return f.mapping=o?sf:X0,f.colorSpace=i??(o?"srgb":"srgb-linear"),f}const C2e={files:kU,path:"",preset:void 0,extensions:void 0};wC.preload=t=>{const e={...C2e,...t};let{files:n,path:i=""}=e;const{preset:r,extensions:a}=e;r&&(DU(r),n=$1[r],i=JZ);const{extension:s}=OU(n);if(s==="webp"||s==="jpg"||s==="jpeg")throw new Error("useEnvironment: Preloading gainmaps is not supported");const o=IU(s);if(!o)throw new Error("useEnvironment: Unrecognized file extension: "+n);uv.preload(o,_0(n)?[n]:n,l=>{l.setPath==null||l.setPath(i),a&&a(l)})};const R2e={files:kU,preset:void 0};wC.clear=t=>{const e={...R2e,...t};let{files:n}=e;const{preset:i}=e;i&&(DU(i),n=$1[i]);const{extension:r}=OU(n),a=IU(r);if(!a)throw new Error("useEnvironment: Unrecognized file extension: "+n);uv.clear(a,_0(n)?[n]:n)};function DU(t){if(!(t in $1))throw new Error("Preset must be one of: "+Object.keys($1).join(", "))}function OU(t){var e;const n=_0(t)&&t.length===6,i=_0(t)&&t.length===3&&t.some(s=>s.endsWith("json")),r=_0(t)?t[0]:t;return{extension:n?"cube":i?"webp":r.startsWith("data:application/exr")?"exr":r.startsWith("data:application/hdr")?"hdr":r.startsWith("data:image/jpeg")?"jpg":(e=r.split(".").pop())==null||(e=e.split("?"))==null||(e=e.shift())==null?void 0:e.toLowerCase(),isCubemap:n,isGainmap:i}}function IU(t){return t==="cube"?m$:t==="hdr"?qEe:t==="exr"?XEe:t==="jpg"||t==="jpeg"?A2e:t==="webp"?T2e:null}const k2e=t=>t.current&&t.current.isScene,D2e=t=>k2e(t)?t.current:t;function NU(t,e,n,i,r={}){var a,s,o,l;r={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...r};const c=D2e(e||n),u=c.background,f=c.environment,h={backgroundBlurriness:c.backgroundBlurriness,backgroundIntensity:c.backgroundIntensity,backgroundRotation:(a=(s=c.backgroundRotation)==null||s.clone==null?void 0:s.clone())!==null&&a!==void 0?a:[0,0,0],environmentIntensity:c.environmentIntensity,environmentRotation:(o=(l=c.environmentRotation)==null||l.clone==null?void 0:l.clone())!==null&&o!==void 0?o:[0,0,0]};return t!=="only"&&(c.environment=i),t&&(c.background=i),nu(c,r),()=>{t!=="only"&&(c.environment=f),t&&(c.background=u),nu(c,h)}}function LU({scene:t,background:e=!1,map:n,...i}){const r=Ri(a=>a.scene);return I.useLayoutEffect(()=>{if(n)return NU(e,t,r,n,i)}),null}function $Z({background:t=!1,scene:e,blur:n,backgroundBlurriness:i,backgroundIntensity:r,backgroundRotation:a,environmentIntensity:s,environmentRotation:o,...l}){const c=wC(l),u=Ri(f=>f.scene);return I.useLayoutEffect(()=>NU(t,e,u,c,{backgroundBlurriness:n??i,backgroundIntensity:r,backgroundRotation:a,environmentIntensity:s,environmentRotation:o})),I.useEffect(()=>()=>{c.dispose()},[c]),null}function O2e({children:t,near:e=.1,far:n=1e3,resolution:i=256,frames:r=1,map:a,background:s=!1,blur:o,backgroundBlurriness:l,backgroundIntensity:c,backgroundRotation:u,environmentIntensity:f,environmentRotation:h,scene:d,files:g,path:b,preset:y=void 0,extensions:p}){const x=Ri(C=>C.gl),_=Ri(C=>C.scene),w=I.useRef(null),[M]=I.useState(()=>new Hv),S=I.useMemo(()=>{const C=new VP(i);return C.texture.type=ts,C},[i]);I.useEffect(()=>()=>{S.dispose()},[S]),I.useLayoutEffect(()=>{if(r===1){const C=x.autoClear;x.autoClear=!0,w.current.update(x,M),x.autoClear=C}return NU(s,d,_,S.texture,{backgroundBlurriness:o??l,backgroundIntensity:c,backgroundRotation:u,environmentIntensity:f,environmentRotation:h})},[t,M,S.texture,d,_,s,r,x]);let A=1;return ra(()=>{if(r===1/0||A<r){const C=x.autoClear;x.autoClear=!0,w.current.update(x,M),x.autoClear=C,A++}}),I.createElement(I.Fragment,null,Mwe(I.createElement(I.Fragment,null,t,I.createElement("cubeCamera",{ref:w,args:[e,n,S]}),g||y?I.createElement($Z,{background:!0,files:g,preset:y,path:b,extensions:p}):a?I.createElement(LU,{background:!0,map:a,extensions:p}):null),M))}function I2e(t){var e,n,i,r;const a=wC(t),s=t.map||a;I.useMemo(()=>W_({GroundProjectedEnvImpl:cEe}),[]),I.useEffect(()=>()=>{a.dispose()},[a]);const o=I.useMemo(()=>[s],[s]),l=(e=t.ground)==null?void 0:e.height,c=(n=t.ground)==null?void 0:n.radius,u=(i=(r=t.ground)==null?void 0:r.scale)!==null&&i!==void 0?i:1e3;return I.createElement(I.Fragment,null,I.createElement(LU,Is({},t,{map:s})),I.createElement("groundProjectedEnvImpl",{args:o,scale:u,height:l,radius:c}))}function N2e(t){return t.ground?I.createElement(I2e,t):t.map?I.createElement(LU,t):t.children?I.createElement(O2e,t):I.createElement($Z,t)}const L2e=I.createContext(null);function P2e({iterations:t=10,ms:e=250,threshold:n=.75,step:i=.1,factor:r=.5,flipflops:a=1/0,bounds:s=h=>h>100?[60,100]:[40,60],onIncline:o,onDecline:l,onChange:c,onFallback:u,children:f}){const h=Math.pow(10,0),[d,g]=I.useState(()=>({fps:0,index:0,factor:r,flipped:0,refreshrate:0,fallback:!1,frames:[],averages:[],subscriptions:new Map,subscribe:y=>{const p=Symbol();return d.subscriptions.set(p,y.current),()=>void d.subscriptions.delete(p)}}));let b=0;return ra(()=>{const{frames:y,averages:p}=d;if(!d.fallback&&p.length<t){y.push(performance.now());const x=y[y.length-1]-y[0];if(x>=e){if(d.fps=Math.round(y.length/x*1e3*h)/h,d.refreshrate=Math.max(d.refreshrate,d.fps),p[d.index++%t]=d.fps,p.length===t){const[_,w]=s(d.refreshrate),M=p.filter(A=>A>=w),S=p.filter(A=>A<_);M.length>t*n&&(d.factor=Math.min(1,d.factor+i),d.flipped++,o&&o(d),d.subscriptions.forEach(A=>A.onIncline&&A.onIncline(d))),S.length>t*n&&(d.factor=Math.max(0,d.factor-i),d.flipped++,l&&l(d),d.subscriptions.forEach(A=>A.onDecline&&A.onDecline(d))),b!==d.factor&&(b=d.factor,c&&c(d),d.subscriptions.forEach(A=>A.onChange&&A.onChange(d))),d.flipped>a&&!d.fallback&&(d.fallback=!0,u&&u(d),d.subscriptions.forEach(A=>A.onFallback&&A.onFallback(d))),d.averages=[]}d.frames=[]}}}),I.createElement(L2e.Provider,{value:d},f)}const U2e={},u6=t=>{let e;const n=new Set,i=(u,f)=>{const h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){const d=e;e=f??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(g=>g(e,d))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(U2e?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=e=t(i,r,l);return l},F2e=t=>t?u6(t):u6,ZZ={},{useDebugValue:B2e}=Ee,{useSyncExternalStoreWithSelector:z2e}=V$;let f6=!1;const j2e=t=>t;function H2e(t,e=j2e,n){(ZZ?"production":void 0)!=="production"&&n&&!f6&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),f6=!0);const i=z2e(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return B2e(i),i}const h6=t=>{(ZZ?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?F2e(t):t,n=(i,r)=>H2e(e,i,r);return Object.assign(n,e),n},Y_=t=>t?h6(t):h6,J_=I.createContext(null),fE=new te,d6=new te,V2e=(t,e,n,i)=>{const r=e.dot(e),a=e.dot(t)-e.dot(n),s=e.dot(i);return s===0?-a/r:(fE.copy(i).multiplyScalar(r/s).sub(e),d6.copy(i).multiplyScalar(a/s).add(n).sub(t),-fE.dot(d6)/fE.dot(fE))},G2e=new te(0,1,0),p6=new Ot,vD=({direction:t,axis:e})=>{const{translation:n,translationLimits:i,annotations:r,annotationsClass:a,depthTest:s,scale:o,lineWidth:l,fixed:c,axisColors:u,hoveredColor:f,opacity:h,renderOrder:d,onDragStart:g,onDrag:b,onDragEnd:y,userData:p}=I.useContext(J_),x=Ri(H=>H.controls),_=I.useRef(null),w=I.useRef(null),M=I.useRef(null),S=I.useRef(0),[A,C]=I.useState(!1),D=I.useCallback(H=>{r&&(_.current.innerText=`${n.current[e].toFixed(2)}`,_.current.style.display="block"),H.stopPropagation();const W=new Ot().extractRotation(w.current.matrixWorld),F=H.point.clone(),Y=new te().setFromMatrixPosition(w.current.matrixWorld),Z=t.clone().applyMatrix4(W).normalize();M.current={clickPoint:F,dir:Z},S.current=n.current[e],g({component:"Arrow",axis:e,origin:Y,directions:[Z]}),x&&(x.enabled=!1),H.target.setPointerCapture(H.pointerId)},[r,t,x,g,n,e]),R=I.useCallback(H=>{if(H.stopPropagation(),A||C(!0),M.current){const{clickPoint:W,dir:F}=M.current,[Y,Z]=i?.[e]||[void 0,void 0];let V=V2e(W,F,H.ray.origin,H.ray.direction);Y!==void 0&&(V=Math.max(V,Y-S.current)),Z!==void 0&&(V=Math.min(V,Z-S.current)),n.current[e]=S.current+V,r&&(_.current.innerText=`${n.current[e].toFixed(2)}`),p6.makeTranslation(F.x*V,F.y*V,F.z*V),b(p6)}},[r,b,A,n,i,e]),N=I.useCallback(H=>{r&&(_.current.style.display="none"),H.stopPropagation(),M.current=null,y(),x&&(x.enabled=!0),H.target.releasePointerCapture(H.pointerId)},[r,x,y]),U=I.useCallback(H=>{H.stopPropagation(),C(!1)},[]),{cylinderLength:j,coneWidth:z,coneLength:q,matrixL:B}=I.useMemo(()=>{const H=c?l/o*1.6:o/20,W=c?.2:o/5,F=c?1-W:o-W,Y=new Vn().setFromUnitVectors(G2e,t.clone().normalize()),Z=new Ot().makeRotationFromQuaternion(Y);return{cylinderLength:F,coneWidth:H,coneLength:W,matrixL:Z}},[t,o,l,c]),G=A?f:u[e];return I.createElement("group",{ref:w},I.createElement("group",{matrix:B,matrixAutoUpdate:!1,onPointerDown:D,onPointerMove:R,onPointerUp:N,onPointerOut:U},r&&I.createElement(Jv,{position:[0,-q,0]},I.createElement("div",{style:{display:"none",background:"#151520",color:"white",padding:"6px 8px",borderRadius:7,whiteSpace:"nowrap"},className:a,ref:_})),I.createElement("mesh",{visible:!1,position:[0,(j+q)/2,0],userData:p},I.createElement("cylinderGeometry",{args:[z*1.4,z*1.4,j+q,8,1]})),I.createElement(Xm,{transparent:!0,raycast:()=>null,depthTest:s,points:[0,0,0,0,j,0],lineWidth:l,side:Kr,color:G,opacity:h,polygonOffset:!0,renderOrder:1,polygonOffsetFactor:-10,fog:!1}),I.createElement("mesh",{raycast:()=>null,position:[0,j+q/2,0],renderOrder:d},I.createElement("coneGeometry",{args:[z,q,24,1]}),I.createElement("meshBasicMaterial",{transparent:!0,depthTest:s,color:G,opacity:h,polygonOffset:!0,polygonOffsetFactor:-10,fog:!1}))))},yD=new te,xD=new te,_D=t=>t*180/Math.PI,W2e=t=>t*Math.PI/180,q2e=(t,e,n,i,r)=>{yD.copy(t).sub(n),xD.copy(e).sub(n);const a=i.dot(i),s=r.dot(r),o=yD.dot(i)/a,l=yD.dot(r)/s,c=xD.dot(i)/a,u=xD.dot(r)/s,f=Math.atan2(l,o);return Math.atan2(u,c)-f},X2e=(t,e)=>{let n=Math.floor(t/e);return n=n<0?n+1:n,t-n*e},m6=t=>{let e=X2e(t,2*Math.PI);return Math.abs(e)<1e-6?0:(e<0&&(e+=2*Math.PI),e)},hE=new Ot,g6=new te,dE=new pf,SD=new te,wD=({dir1:t,dir2:e,axis:n})=>{const{rotationLimits:i,annotations:r,annotationsClass:a,depthTest:s,scale:o,lineWidth:l,fixed:c,axisColors:u,hoveredColor:f,renderOrder:h,opacity:d,onDragStart:g,onDrag:b,onDragEnd:y,userData:p}=I.useContext(J_),x=Ri(G=>G.controls),_=I.useRef(null),w=I.useRef(null),M=I.useRef(0),S=I.useRef(0),A=I.useRef(null),[C,D]=I.useState(!1),R=I.useCallback(G=>{r&&(_.current.innerText=`${_D(S.current).toFixed(0)}º`,_.current.style.display="block"),G.stopPropagation();const H=G.point.clone(),W=new te().setFromMatrixPosition(w.current.matrixWorld),F=new te().setFromMatrixColumn(w.current.matrixWorld,0).normalize(),Y=new te().setFromMatrixColumn(w.current.matrixWorld,1).normalize(),Z=new te().setFromMatrixColumn(w.current.matrixWorld,2).normalize(),V=new $c().setFromNormalAndCoplanarPoint(Z,W);A.current={clickPoint:H,origin:W,e1:F,e2:Y,normal:Z,plane:V},g({component:"Rotator",axis:n,origin:W,directions:[F,Y,Z]}),x&&(x.enabled=!1),G.target.setPointerCapture(G.pointerId)},[r,x,g,n]),N=I.useCallback(G=>{if(G.stopPropagation(),C||D(!0),A.current){const{clickPoint:H,origin:W,e1:F,e2:Y,normal:Z,plane:V}=A.current,[de,se]=i?.[n]||[void 0,void 0];dE.copy(G.ray),dE.intersectPlane(V,SD),dE.direction.negate(),dE.intersectPlane(V,SD);let oe=q2e(H,SD,W,F,Y),ue=_D(oe);G.shiftKey&&(ue=Math.round(ue/10)*10,oe=W2e(ue)),de!==void 0&&se!==void 0&&se-de<2*Math.PI?(oe=m6(oe),oe=oe>Math.PI?oe-2*Math.PI:oe,oe=gc.clamp(oe,de-M.current,se-M.current),S.current=M.current+oe):(S.current=m6(M.current+oe),S.current=S.current>Math.PI?S.current-2*Math.PI:S.current),r&&(ue=_D(S.current),_.current.innerText=`${ue.toFixed(0)}º`),hE.makeRotationAxis(Z,oe),g6.copy(W).applyMatrix4(hE).sub(W).negate(),hE.setPosition(g6),b(hE)}},[r,b,C,i,n]),U=I.useCallback(G=>{r&&(_.current.style.display="none"),G.stopPropagation(),M.current=S.current,A.current=null,y(),x&&(x.enabled=!0),G.target.releasePointerCapture(G.pointerId)},[r,x,y]),j=I.useCallback(G=>{G.stopPropagation(),D(!1)},[]),z=I.useMemo(()=>{const G=t.clone().normalize(),H=e.clone().normalize();return new Ot().makeBasis(G,H,G.clone().cross(H))},[t,e]),q=c?.65:o*.65,B=I.useMemo(()=>{const H=[];for(let W=0;W<=32;W++){const F=W*(Math.PI/2)/32;H.push(new te(Math.cos(F)*q,Math.sin(F)*q,0))}return H},[q]);return I.createElement("group",{ref:w,onPointerDown:R,onPointerMove:N,onPointerUp:U,onPointerOut:j,matrix:z,matrixAutoUpdate:!1},r&&I.createElement(Jv,{position:[q,q,0]},I.createElement("div",{style:{display:"none",background:"#151520",color:"white",padding:"6px 8px",borderRadius:7,whiteSpace:"nowrap"},className:a,ref:_})),I.createElement(Xm,{points:B,lineWidth:l*4,visible:!1,userData:p}),I.createElement(Xm,{transparent:!0,raycast:()=>null,depthTest:s,points:B,lineWidth:l,side:Kr,color:C?f:u[n],opacity:d,polygonOffset:!0,polygonOffsetFactor:-10,renderOrder:h,fog:!1}))},K2e=(t,e,n)=>{const i=Math.abs(t.x)>=Math.abs(t.y)&&Math.abs(t.x)>=Math.abs(t.z)?0:Math.abs(t.y)>=Math.abs(t.x)&&Math.abs(t.y)>=Math.abs(t.z)?1:2,r=[0,1,2].sort((g,b)=>Math.abs(e.getComponent(b))-Math.abs(e.getComponent(g))),a=i===r[0]?r[1]:r[0],s=t.getComponent(i),o=t.getComponent(a),l=e.getComponent(i),c=e.getComponent(a),u=n.getComponent(i),h=(n.getComponent(a)-u*(o/s))/(c-l*(o/s));return[(u-h*l)/s,h]},pE=new pf,mE=new te,b6=new Ot,ED=({dir1:t,dir2:e,axis:n})=>{const{translation:i,translationLimits:r,annotations:a,annotationsClass:s,depthTest:o,scale:l,lineWidth:c,fixed:u,axisColors:f,hoveredColor:h,opacity:d,onDragStart:g,onDrag:b,onDragEnd:y,userData:p}=I.useContext(J_),x=Ri(W=>W.controls),_=I.useRef(null),w=I.useRef(null),M=I.useRef(null),S=I.useRef(0),A=I.useRef(0),[C,D]=I.useState(!1),R=I.useCallback(W=>{a&&(_.current.innerText=`${i.current[(n+1)%3].toFixed(2)}, ${i.current[(n+2)%3].toFixed(2)}`,_.current.style.display="block"),W.stopPropagation();const F=W.point.clone(),Y=new te().setFromMatrixPosition(w.current.matrixWorld),Z=new te().setFromMatrixColumn(w.current.matrixWorld,0).normalize(),V=new te().setFromMatrixColumn(w.current.matrixWorld,1).normalize(),de=new te().setFromMatrixColumn(w.current.matrixWorld,2).normalize(),se=new $c().setFromNormalAndCoplanarPoint(de,Y);M.current={clickPoint:F,e1:Z,e2:V,plane:se},S.current=i.current[(n+1)%3],A.current=i.current[(n+2)%3],g({component:"Slider",axis:n,origin:Y,directions:[Z,V,de]}),x&&(x.enabled=!1),W.target.setPointerCapture(W.pointerId)},[a,x,g,n]),N=I.useCallback(W=>{if(W.stopPropagation(),C||D(!0),M.current){const{clickPoint:F,e1:Y,e2:Z,plane:V}=M.current,[de,se]=r?.[(n+1)%3]||[void 0,void 0],[oe,ue]=r?.[(n+2)%3]||[void 0,void 0];pE.copy(W.ray),pE.intersectPlane(V,mE),pE.direction.negate(),pE.intersectPlane(V,mE),mE.sub(F);let[_e,ke]=K2e(Y,Z,mE);de!==void 0&&(_e=Math.max(_e,de-S.current)),se!==void 0&&(_e=Math.min(_e,se-S.current)),oe!==void 0&&(ke=Math.max(ke,oe-A.current)),ue!==void 0&&(ke=Math.min(ke,ue-A.current)),i.current[(n+1)%3]=S.current+_e,i.current[(n+2)%3]=A.current+ke,a&&(_.current.innerText=`${i.current[(n+1)%3].toFixed(2)}, ${i.current[(n+2)%3].toFixed(2)}`),b6.makeTranslation(_e*Y.x+ke*Z.x,_e*Y.y+ke*Z.y,_e*Y.z+ke*Z.z),b(b6)}},[a,b,C,i,r,n]),U=I.useCallback(W=>{a&&(_.current.style.display="none"),W.stopPropagation(),M.current=null,y(),x&&(x.enabled=!0),W.target.releasePointerCapture(W.pointerId)},[a,x,y]),j=I.useCallback(W=>{W.stopPropagation(),D(!1)},[]),z=I.useMemo(()=>{const W=t.clone().normalize(),F=e.clone().normalize();return new Ot().makeBasis(W,F,W.clone().cross(F))},[t,e]),q=u?1/7:l/7,B=u?.225:l*.225,G=C?h:f[n],H=I.useMemo(()=>[new te(0,0,0),new te(0,B,0),new te(B,B,0),new te(B,0,0),new te(0,0,0)],[B]);return I.createElement("group",{ref:w,matrix:z,matrixAutoUpdate:!1},a&&I.createElement(Jv,{position:[0,0,0]},I.createElement("div",{style:{display:"none",background:"#151520",color:"white",padding:"6px 8px",borderRadius:7,whiteSpace:"nowrap"},className:s,ref:_})),I.createElement("group",{position:[q*1.7,q*1.7,0]},I.createElement("mesh",{visible:!0,onPointerDown:R,onPointerMove:N,onPointerUp:U,onPointerOut:j,scale:B,userData:p},I.createElement("planeGeometry",null),I.createElement("meshBasicMaterial",{transparent:!0,depthTest:o,color:G,polygonOffset:!0,polygonOffsetFactor:-10,side:Kr,fog:!1})),I.createElement(Xm,{position:[-B/2,-B/2,0],transparent:!0,depthTest:o,points:H,lineWidth:c,color:G,opacity:d,polygonOffset:!0,polygonOffsetFactor:-10,userData:p,fog:!1})))},Cx=new te,v6=new te,Y2e=(t,e,n,i)=>{const r=e.dot(e),a=e.dot(t)-e.dot(n),s=e.dot(i);return s===0?-a/r:(Cx.copy(i).multiplyScalar(r/s).sub(e),v6.copy(i).multiplyScalar(a/s).add(n).sub(t),-Cx.dot(v6)/Cx.dot(Cx))},J2e=new te(0,1,0),ix=new te,y6=new Ot,MD=({direction:t,axis:e})=>{const{scaleLimits:n,annotations:i,annotationsClass:r,depthTest:a,scale:s,lineWidth:o,fixed:l,axisColors:c,hoveredColor:u,opacity:f,renderOrder:h,onDragStart:d,onDrag:g,onDragEnd:b,userData:y}=I.useContext(J_),p=Ri(W=>W.size),x=Ri(W=>W.controls),_=I.useRef(null),w=I.useRef(null),M=I.useRef(null),S=I.useRef(1),A=I.useRef(1),C=I.useRef(null),[D,R]=I.useState(!1),N=l?1.2:1.2*s,U=I.useCallback(W=>{i&&(_.current.innerText=`${A.current.toFixed(2)}`,_.current.style.display="block"),W.stopPropagation();const F=new Ot().extractRotation(w.current.matrixWorld),Y=W.point.clone(),Z=new te().setFromMatrixPosition(w.current.matrixWorld),V=t.clone().applyMatrix4(F).normalize(),de=w.current.matrixWorld.clone(),se=de.clone().invert(),oe=l?1/RZ(w.current.getWorldPosition(Cx),s,W.camera,p):1;C.current={clickPoint:Y,dir:V,mPLG:de,mPLGInv:se,offsetMultiplier:oe},d({component:"Sphere",axis:e,origin:Z,directions:[V]}),x&&(x.enabled=!1),W.target.setPointerCapture(W.pointerId)},[i,x,t,d,e,l,s,p]),j=I.useCallback(W=>{if(W.stopPropagation(),D||R(!0),C.current){const{clickPoint:F,dir:Y,mPLG:Z,mPLGInv:V,offsetMultiplier:de}=C.current,[se,oe]=n?.[e]||[1e-5,void 0],_e=Y2e(F,Y,W.ray.origin,W.ray.direction)*de,ke=l?_e:_e/s;let Ne=Math.pow(2,ke*.2);W.shiftKey&&(Ne=Math.round(Ne*10)/10),Ne=Math.max(Ne,se/S.current),oe!==void 0&&(Ne=Math.min(Ne,oe/S.current)),A.current=S.current*Ne,M.current.position.set(0,N+_e,0),i&&(_.current.innerText=`${A.current.toFixed(2)}`),ix.set(1,1,1),ix.setComponent(e,Ne),y6.makeScale(ix.x,ix.y,ix.z).premultiply(Z).multiply(V),g(y6)}},[i,N,g,D,n,e]),z=I.useCallback(W=>{i&&(_.current.style.display="none"),W.stopPropagation(),S.current=A.current,C.current=null,M.current.position.set(0,N,0),b(),x&&(x.enabled=!0),W.target.releasePointerCapture(W.pointerId)},[i,x,b,N]),q=I.useCallback(W=>{W.stopPropagation(),R(!1)},[]),{radius:B,matrixL:G}=I.useMemo(()=>{const W=l?o/s*1.8:s/22.5,F=new Vn().setFromUnitVectors(J2e,t.clone().normalize()),Y=new Ot().makeRotationFromQuaternion(F);return{radius:W,matrixL:Y}},[t,s,o,l]),H=D?u:c[e];return I.createElement("group",{ref:w},I.createElement("group",{matrix:G,matrixAutoUpdate:!1,onPointerDown:U,onPointerMove:j,onPointerUp:z,onPointerOut:q},i&&I.createElement(Jv,{position:[0,N/2,0]},I.createElement("div",{style:{display:"none",background:"#151520",color:"white",padding:"6px 8px",borderRadius:7,whiteSpace:"nowrap"},className:r,ref:_})),I.createElement("mesh",{ref:M,position:[0,N,0],renderOrder:h,userData:y},I.createElement("sphereGeometry",{args:[B,12,12]}),I.createElement("meshBasicMaterial",{transparent:!0,depthTest:a,color:H,opacity:f,polygonOffset:!0,polygonOffsetFactor:-10}))))},x6=new Ot,_6=new Ot,S6=new Ot,gE=new Ot,TD=new Ot,Sb=new Ot,w6=new Ot,E6=new Ot,M6=new Ot,wb=new rr,AD=new rr,T6=new te,A6=new te,C6=new te,R6=new te,rx=new te,Eb=new te(1,0,0),Mb=new te(0,1,0),Tb=new te(0,0,1),QZ=I.forwardRef(({enabled:t=!0,matrix:e,onDragStart:n,onDrag:i,onDragEnd:r,autoTransform:a=!0,anchor:s,disableAxes:o=!1,disableSliders:l=!1,disableRotations:c=!1,disableScaling:u=!1,activeAxes:f=[!0,!0,!0],offset:h=[0,0,0],rotation:d=[0,0,0],scale:g=1,lineWidth:b=4,fixed:y=!1,translationLimits:p,rotationLimits:x,scaleLimits:_,depthTest:w=!0,renderOrder:M=500,axisColors:S=["#ff2060","#20df80","#2080ff"],hoveredColor:A="#ffff40",annotations:C=!1,annotationsClass:D,opacity:R=1,visible:N=!0,userData:U,children:j,...z},q)=>{const B=Ri(oe=>oe.invalidate),G=I.useRef(null),H=I.useRef(null),W=I.useRef(null),F=I.useRef(null),Y=I.useRef([0,0,0]),Z=I.useRef(new te(1,1,1)),V=I.useRef(new te(1,1,1));I.useLayoutEffect(()=>{s&&(F.current.updateWorldMatrix(!0,!0),gE.copy(F.current.matrixWorld).invert(),wb.makeEmpty(),F.current.traverse(oe=>{oe.geometry&&(oe.geometry.boundingBox||oe.geometry.computeBoundingBox(),Sb.copy(oe.matrixWorld).premultiply(gE),AD.copy(oe.geometry.boundingBox),AD.applyMatrix4(Sb),wb.union(AD))}),T6.copy(wb.max).add(wb.min).multiplyScalar(.5),A6.copy(wb.max).sub(wb.min).multiplyScalar(.5),C6.copy(A6).multiply(new te(...s)).add(T6),R6.set(...h).add(C6),W.current.position.copy(R6),B())});const de=I.useMemo(()=>({onDragStart:oe=>{x6.copy(H.current.matrix),_6.copy(H.current.matrixWorld),n&&n(oe),B()},onDrag:oe=>{S6.copy(G.current.matrixWorld),gE.copy(S6).invert(),TD.copy(_6).premultiply(oe),Sb.copy(TD).premultiply(gE),w6.copy(x6).invert(),E6.copy(Sb).multiply(w6),a&&H.current.matrix.copy(Sb),i&&i(Sb,E6,TD,oe),B()},onDragEnd:()=>{r&&r(),B()},translation:Y,translationLimits:p,rotationLimits:x,axisColors:S,hoveredColor:A,opacity:R,scale:g,lineWidth:b,fixed:y,depthTest:w,renderOrder:M,userData:U,annotations:C,annotationsClass:D}),[n,i,r,Y,p,x,_,w,g,b,y,...S,A,R,U,a,C,D]),se=new te;return ra(oe=>{if(y){const ue=RZ(W.current.getWorldPosition(se),g,oe.camera,oe.size);Z.current.setScalar(ue)}e&&e instanceof Ot&&(H.current.matrix=e),H.current.updateWorldMatrix(!0,!0),M6.makeRotationFromEuler(W.current.rotation).setPosition(W.current.position).premultiply(H.current.matrixWorld),V.current.setFromMatrixScale(M6),rx.copy(Z.current).divide(V.current),(Math.abs(W.current.scale.x-rx.x)>1e-4||Math.abs(W.current.scale.y-rx.y)>1e-4||Math.abs(W.current.scale.z-rx.z)>1e-4)&&(W.current.scale.copy(rx),oe.invalidate())}),I.useImperativeHandle(q,()=>H.current,[]),I.createElement(J_.Provider,{value:de},I.createElement("group",{ref:G},I.createElement("group",Is({ref:H,matrix:e,matrixAutoUpdate:!1},z),I.createElement("group",{visible:N,ref:W,position:h,rotation:d},t&&I.createElement(I.Fragment,null,!o&&f[0]&&I.createElement(vD,{axis:0,direction:Eb}),!o&&f[1]&&I.createElement(vD,{axis:1,direction:Mb}),!o&&f[2]&&I.createElement(vD,{axis:2,direction:Tb}),!l&&f[0]&&f[1]&&I.createElement(ED,{axis:2,dir1:Eb,dir2:Mb}),!l&&f[0]&&f[2]&&I.createElement(ED,{axis:1,dir1:Tb,dir2:Eb}),!l&&f[2]&&f[1]&&I.createElement(ED,{axis:0,dir1:Mb,dir2:Tb}),!c&&f[0]&&f[1]&&I.createElement(wD,{axis:2,dir1:Eb,dir2:Mb}),!c&&f[0]&&f[2]&&I.createElement(wD,{axis:1,dir1:Tb,dir2:Eb}),!c&&f[2]&&f[1]&&I.createElement(wD,{axis:0,dir1:Mb,dir2:Tb}),!u&&f[0]&&I.createElement(MD,{axis:0,direction:Eb}),!u&&f[1]&&I.createElement(MD,{axis:1,direction:Mb}),!u&&f[2]&&I.createElement(MD,{axis:2,direction:Tb}))),I.createElement("group",{ref:F},j))))}),bi=Ee.createContext(null);/*!
 * hold-event
 * https://github.com/yomotsu/hold-event
 * (c) 2020 @yomotsu
 * Released under the MIT License.
 */var _s;(function(t){t.HOLD_START="holdStart",t.HOLD_END="holdEnd",t.HOLDING="holding"})(_s||(_s={}));class $2e{constructor(){this._listeners={}}addEventListener(e,n){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}removeEventListener(e,n){const r=this._listeners[e];if(r!==void 0){const a=r.indexOf(n);a!==-1&&r.splice(a,1)}}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let a=0,s=r.length;a<s;a++)r[a].call(this,e)}}}class Z2e extends $2e{constructor(e){super(),this._enabled=!0,this._holding=!1,this._intervalId=-1,this._deltaTime=0,this._elapsedTime=0,this._lastTime=0,this._holdStart=n=>{if(!this._enabled||this._holding)return;this._deltaTime=0,this._elapsedTime=0,this._lastTime=performance.now(),this.dispatchEvent({type:_s.HOLD_START,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:n}),this._holding=!0;const i=()=>{this._intervalId=this.holdIntervalDelay?window.setTimeout(i,this.holdIntervalDelay):window.requestAnimationFrame(i);const r=performance.now();this._deltaTime=r-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:_s.HOLDING,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:n})};this._intervalId=this.holdIntervalDelay?window.setTimeout(i,this.holdIntervalDelay):window.requestAnimationFrame(i)},this._holdEnd=n=>{if(!this._enabled||!this._holding)return;const i=performance.now();this._deltaTime=i-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:_s.HOLD_END,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:n}),window.clearTimeout(this._intervalId),window.cancelAnimationFrame(this._intervalId),this._holding=!1},this.holdIntervalDelay=e}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._enabled||this._holdEnd())}get holding(){return this._holding}}class Lu extends Z2e{constructor(e,n){if(typeof e!="string"){console.error("KeyboardKeyHold: the first argument has to be a KeyboardEvent.code string.");return}super(n),this._holdStart=this._holdStart.bind(this),this._holdEnd=this._holdEnd.bind(this);const i=a=>{Q2e(a)||a.code===e&&this._holdStart(a)},r=a=>{a.code===e&&this._holdEnd(a)};document.addEventListener("keydown",i),document.addEventListener("keyup",r),window.addEventListener("blur",this._holdEnd)}}function Q2e(t){const e=t.target;return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.isContentEditable}function Yf(t){const e=t.useSceneTree.getState()[""],n=e?.wxyz??[1,0,0,0],i=e?.position??[0,0,0];return new Ot().makeRotationFromQuaternion(new Vn(n[1],n[2],n[3],n[0])).setPosition(i[0],i[1],i[2])}function eQ(t,e){const n=Yf(t).invert(),i=e.origin.clone().applyMatrix4(n),r=n.setPosition(0,0,0),a=e.direction.clone().applyMatrix4(r);return new pf(i,a)}function EC(t){const e=Ee.useContext(bi);return tQ(e,t)}function tQ(t,e){let n=!0,i=!1,r=null;function a(o){const l=t.mutable.current;l.sendMessage!==null&&(r=o,n?(l.sendMessage(o),i=!1,n=!1,setTimeout(()=>{n=!0,i&&r&&a(r)},e)):i=!0)}function s(){t.mutable.current.sendMessage!==null&&r!==null&&(t.mutable.current.sendMessage(r),r=null,i=!1)}return{send:a,flush:s}}function CD(t){return t!=null&&t.isTexture!==void 0}function eTe({visible:t,children:e}){const{camera:n}=Ri(),i=I.useRef(null),r=new te;return ra(()=>{if(i.current&&t){i.current.getWorldPosition(r);const a=n.position.distanceTo(r),s=Math.tan(n.fov*Math.PI/360);i.current.scale.setScalar(a/20*s)}}),k.jsxs("group",{ref:i,visible:t,children:[k.jsxs(lT,{limit:6,children:[k.jsx("boxGeometry",{args:[.4,.02,.02]}),k.jsx("meshBasicMaterial",{opacity:.625,transparent:!0}),k.jsx(sc,{position:[.5,0,0],color:"#777777"}),k.jsx(sc,{position:[-.5,0,0],color:"#777777"}),k.jsx(sc,{position:[0,0,.5],rotation:new mi(0,Math.PI/2,0),color:"#777777"}),k.jsx(sc,{position:[0,0,-.5],rotation:new mi(0,Math.PI/2,0),color:"#777777"}),k.jsx(sc,{position:[0,.5,0],rotation:new mi(0,0,Math.PI/2),color:"#999999"}),k.jsx(sc,{position:[0,-.5,0],rotation:new mi(0,0,Math.PI/2),color:"#999999"})]}),k.jsxs("mesh",{children:[k.jsx("sphereGeometry",{args:[.04,8,8]}),k.jsx("meshBasicMaterial",{color:"#999999",opacity:.625,transparent:!0})]}),e]})}function tTe({forceShow:t,pivotRef:e,onPivotChange:n,update:i,crosshairVisible:r}){const a=I.useContext(bi),s=a.useGui(c=>c.showOrbitOriginTool),o=a.useDevSettings(c=>c.enableOrbitCrosshair);Ee.useEffect(i,[s]);const l=s||t;return k.jsxs(QZ,{ref:e,scale:200,lineWidth:3,fixed:!0,axisColors:["#ffaaff","#ff33ff","#ffaaff"],disableScaling:!0,disableAxes:!l,disableRotations:!l,disableSliders:!l,onDragEnd:()=>{n(e.current.matrix)},children:[k.jsx(VZ,{args:[10,10,10,10],infiniteGrid:!0,fadeStrength:0,fadeFrom:0,fadeDistance:1e3,sectionColor:"#ffaaff",cellColor:"#ffccff",side:Kr,visible:l}),k.jsx(eTe,{visible:o&&r})]})}function nTe(){const t=I.useContext(bi),e=Ri(H=>H.camera),n=EC(20).send,i=I.useRef(null),r=I.useRef(null),a=t.mutable.current,[s,o]=I.useState(0),[l,c]=I.useState(!1),u=s>0||l,[f,h]=I.useState(null),d=.5;ra(H=>{if(f&&a.cameraControl){const W=a.cameraControl,F=W.camera,Y=H.clock.getElapsedTime()-f.startTime,Z=Math.min(Y/f.duration,1),V=Z*Z*(3-2*Z),de=new te().copy(f.startUp).lerp(f.targetUp,V).normalize(),se=new te().copy(f.startLookAt).lerp(f.targetLookAt,V);F.up.copy(de);const oe=new te;W.getPosition(oe),W.updateCameraUp(),W.setPosition(oe.x,oe.y,oe.z,!1),W.setLookAt(oe.x,oe.y,oe.z,se.x,se.y,se.z,!1),Z>=1&&h(null)}});const{clock:g}=Ri(),b=H=>{if(!a.cameraControl)return;const W=new te;W.setFromMatrixPosition(H);const F=a.cameraControl,Y=a.cameraControl.camera,Z=new te().setFromMatrixColumn(H,1),V=F.getTarget(new te);h({startUp:Y.up.clone(),targetUp:Z,startLookAt:V,targetLookAt:W,startTime:g.getElapsedTime(),duration:d})},y=()=>{if(f!==null||!a.cameraControl||!r.current)return;const W=a.cameraControl.getTarget(new te),F=new Ot().extractRotation(r.current.matrix),Y=e.up.clone().normalize(),Z=new te(0,1,0).applyMatrix4(F).normalize(),V=new te().crossVectors(Z,Y).normalize(),de=Math.acos(Math.min(1,Math.max(-1,Y.dot(Z)))),se=new Ot;V.lengthSq()>1e-4&&se.makeRotationAxis(V,de);const oe=new Ot;oe.multiply(se),oe.multiply(F),oe.setPosition(W),r.current.matrix.copy(oe),r.current.updateMatrixWorld(!0)};a.resetCameraView=()=>{e.up.set(i.current.camera.up.x,i.current.camera.up.y,i.current.camera.up.z),a.cameraControl.updateCameraUp(),a.cameraControl.setLookAt(i.current.camera.position.x,i.current.camera.position.y,i.current.camera.position.z,i.current.lookAt.x,i.current.lookAt.y,i.current.lookAt.z,!0)};const p=new Vn().setFromEuler(new mi(Math.PI,0,0)),x=new Vn,_=new Ot,w=new te,M=new Vn,S=new te,A=new te,C=Ee.useCallback(()=>{y();const H=e,W=a.cameraControl,F=a.canvas;if(W===null){setTimeout(C,10);return}const Y=Yf(t).invert(),Z=Y.clone().multiply(_.makeRotationFromQuaternion(H.quaternion).setPosition(H.position)).multiply(_.makeRotationFromQuaternion(p));x.setFromRotationMatrix(Y),W.getTarget(w).applyQuaternion(x);const V=H.up.clone().applyQuaternion(x);i.current===null&&(i.current={camera:H.clone(),lookAt:W.getTarget(new te)}),Z.decompose(S,M,A),n({type:"ViewerCameraMessage",wxyz:[M.w,M.x,M.y,M.z],position:S.toArray(),image_height:F.height,image_width:F.width,fov:H.fov*Math.PI/180,near:H.near,far:H.far,look_at:[w.x,w.y,w.z],up_direction:[V.x,V.y,V.z]}),z&&console.log(`&initialCameraPosition=${S.x.toFixed(3)},${S.y.toFixed(3)},${S.z.toFixed(3)}&initialCameraLookAt=${w.x.toFixed(3)},${w.y.toFixed(3)},${w.z.toFixed(3)}&initialCameraUp=${V.x.toFixed(3)},${V.y.toFixed(3)},${V.z.toFixed(3)}`)},[e,n]),D=new URLSearchParams(window.location.search),R=D.get("initialCameraPosition"),N=D.get("initialCameraLookAt"),U=D.get("initialCameraUp"),j=D.get("forceOrbitOriginTool")==="1",z=t.useDevSettings(H=>H.logCamera),q=t.useGui(H=>H.websocketState==="connected"),B=Ee.useRef(!1);Ee.useEffect(()=>{if(!B.current){const H=new te(...R?R.split(",").map(Number):[3,3,3]);H.applyMatrix4(Yf(t));const W=new te(...N?N.split(",").map(Number):[0,0,0]);W.applyMatrix4(Yf(t));const F=new te(...U?U.split(",").map(Number):[0,0,1]);F.applyMatrix4(Yf(t)),F.normalize(),e.up.set(F.x,F.y,F.z),a.cameraControl.updateCameraUp(),a.cameraControl.setLookAt(H.x,H.y,H.z,W.x,W.y,W.z,!1),B.current=!0}a.sendCamera=C,q&&setTimeout(()=>C(),50)},[q,C]);const G=a.canvas;return Ee.useEffect(()=>{const H=new ResizeObserver(()=>{C()});return H.observe(G),()=>H.disconnect()},[G]),Ee.useEffect(()=>{const H=a.cameraControl,W={w:new Lu("KeyW",1e3/60),a:new Lu("KeyA",1e3/60),s:new Lu("KeyS",1e3/60),d:new Lu("KeyD",1e3/60),q:new Lu("KeyQ",1e3/60),e:new Lu("KeyE",1e3/60),up:new Lu("ArrowUp",1e3/60),down:new Lu("ArrowDown",1e3/60),left:new Lu("ArrowLeft",1e3/60),right:new Lu("ArrowRight",1e3/60)};W.a.addEventListener(_s.HOLDING,F=>{H.truck(-.002*F?.deltaTime,0,!1)}),W.d.addEventListener(_s.HOLDING,F=>{H.truck(.002*F?.deltaTime,0,!1)}),W.w.addEventListener(_s.HOLDING,F=>{H.forward(.002*F?.deltaTime,!1)}),W.s.addEventListener(_s.HOLDING,F=>{H.forward(-.002*F?.deltaTime,!1)}),W.q.addEventListener(_s.HOLDING,F=>{H.elevate(-.002*F?.deltaTime,!1)}),W.e.addEventListener(_s.HOLDING,F=>{H.elevate(.002*F?.deltaTime,!1)}),W.left.addEventListener(_s.HOLDING,F=>{H.rotate(-.05*gc.DEG2RAD*F?.deltaTime,0,!0)}),W.right.addEventListener(_s.HOLDING,F=>{H.rotate(.05*gc.DEG2RAD*F?.deltaTime,0,!0)}),W.up.addEventListener(_s.HOLDING,F=>{H.rotate(0,-.05*gc.DEG2RAD*F?.deltaTime,!0)}),W.down.addEventListener(_s.HOLDING,F=>{H.rotate(0,.05*gc.DEG2RAD*F?.deltaTime,!0)});for(const F of Object.values(W))F.addEventListener(_s.HOLD_START,()=>{o(Y=>Y+1)}),F.addEventListener(_s.HOLD_END,()=>{o(Y=>Math.max(0,Y-1))});return()=>{}},[Q5]),k.jsxs(k.Fragment,{children:[k.jsx(Q5,{ref:H=>a.cameraControl=H,minDistance:.01,dollySpeed:.3,smoothTime:.05,draggingSmoothTime:0,onChange:C,onStart:()=>{c(!0)},onEnd:()=>{c(!1)},makeDefault:!0}),k.jsx(tTe,{forceShow:j,pivotRef:r,onPivotChange:H=>{b(H)},update:y,crosshairVisible:u})]})}const Zv=Ee.createContext(null);function $_(t,e){if(t===e)return!0;if(!t||!e)return t===e;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const PU=SC({screenspace:!1,color:new Ut("black"),opacity:1,thickness:.05,size:new wt},`#include <common>
   #include <morphtarget_pars_vertex>
   #include <skinning_pars_vertex>
   uniform float thickness;
   uniform float screenspace;
   uniform vec2 size;
   void main() {
     #if defined (USE_SKINNING)
	     #include <beginnormal_vertex>
       #include <morphnormal_vertex>
       #include <skinbase_vertex>
       #include <skinnormal_vertex>
       #include <defaultnormal_vertex>
     #endif
     #include <begin_vertex>
	   #include <morphtarget_vertex>
	   #include <skinning_vertex>
     #include <project_vertex>
     vec4 tNormal = vec4(normal, 0.0);
     vec4 tPosition = vec4(transformed, 1.0);
     #ifdef USE_INSTANCING
       tNormal = instanceMatrix * tNormal;
       tPosition = instanceMatrix * tPosition;
     #endif
     if (screenspace == 0.0) {
       vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness;
       gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);
     } else {
       vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition;
       vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal;
       vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0;
       clipPosition.xy += offset;
       gl_Position = clipPosition;
     }
   }`,`uniform vec3 color;
   uniform float opacity;
   void main(){
     gl_FragColor = vec4(color, opacity);
     #include <tonemapping_fragment>
     #include <${jZ>=154?"colorspace_fragment":"encodings_fragment"}>
   }`),iTe=I.forwardRef(function({color:e="black",opacity:n=1,transparent:i=!1,screenspace:r=!1,toneMapped:a=!0,polygonOffset:s=!1,polygonOffsetFactor:o=0,renderOrder:l=0,thickness:c=.05,angle:u=Math.PI,...f},h){const d=I.useRef(null),[g]=I.useState(()=>new PU({side:Ra})),y=Ri(_=>_.gl).getDrawingBufferSize(new wt),p=I.useRef(0),x=I.useRef();return I.useLayoutEffect(()=>{const _=d.current;if(!_)return;const w=_.parent;if(w&&w.geometry&&(p.current!==u||x.current!==w.geometry)){p.current=u,x.current=w.geometry;let M=_.children[0];M&&(u&&M.geometry.dispose(),_.remove(M)),w.skeleton?(M=new XA,M.material=g,M.bind(w.skeleton,w.bindMatrix),_.add(M)):w.isInstancedMesh?(M=new KA(w.geometry,g,w.count),M.instanceMatrix=w.instanceMatrix,_.add(M)):(M=new _i,M.material=g,_.add(M)),M.geometry=u?Kwe(w.geometry,u):w.geometry}}),I.useLayoutEffect(()=>{const _=d.current;if(!_)return;const w=_.children[0];w&&(w.renderOrder=l,nu(w.material,{transparent:i,thickness:c,color:e,opacity:n,size:y,screenspace:r,toneMapped:a,polygonOffset:s,polygonOffsetFactor:o}))}),I.useEffect(()=>()=>{const _=d.current;if(!_)return;const w=_.children[0];w&&(u&&w.geometry.dispose(),_.remove(w))},[]),k.jsx("group",{ref:_=>{d.current=_,typeof h=="function"?h(_):h&&(h.current=_)},...f})});function Jf(t={unmountOnHide:!1,enableCreaseAngle:!1}){const e=Ee.useContext(Zv);return e===null||!e.clickable?null:k.jsx(rTe,{...t})}function rTe(t){const e=Ee.useRef(null),n=Ee.useContext(Zv),[i,r]=Ee.useState(!0),a=t.enableCreaseAngle?Math.PI:0;return ra(()=>{if(!(n===null||!n.clickable)){if(t.unmountOnHide){i!==n.state.current.isHovered&&r(n.state.current.isHovered);return}e.current!==null&&(e.current.visible=n.state.current.isHovered)}}),i?k.jsx(iTe,{ref:e,thickness:10,screenspace:!0,color:16514816,opacity:.8,transparent:!0,angle:a}):null}const Wl={instanceMatrix:new Ot,transformMatrix:new Ot,finalMatrix:new Ot,position:new te,quaternion:new Vn,scale:new te,oneVector:new te(1,1,1)},yM=({geometry:t,batched_positions:e,batched_wxyzs:n,batched_scales:i,meshTransform:r,computeBatchIndexFromInstanceIndex:a})=>{const s=Ee.useContext(Zv),o=Ee.useRef(null),l=Ri(h=>h.gl),c=Ee.useMemo(()=>l.getDrawingBufferSize(new wt),[l]),u=Ee.useMemo(()=>t?t.clone():null,[t]),f=Ee.useMemo(()=>{const h=new PU({side:Ra});return h.thickness=10,h.color=new Ut(16514816),h.opacity=.8,h.size=c,h.transparent=!0,h.screenspace=!0,h.toneMapped=!0,h},[c]);return Ee.useEffect(()=>()=>{u&&u.dispose()},[u]),Ee.useEffect(()=>()=>{f&&f.dispose()},[f]),ra(()=>{if(!(!o.current||!u||!s)&&(o.current.visible=!1,s.state.current.isHovered&&s.state.current.instanceId!==null)){const h=s.state.current.instanceId,d=a?a(h):h,g=new DataView(e.buffer,e.byteOffset,e.byteLength),b=new DataView(n.buffer,n.byteOffset,n.byteLength),y=i?new DataView(i.buffer,i.byteOffset,i.byteLength):null;if(d>=0&&d*12<e.byteLength){const p=d*3*4%e.byteLength,x=d*4*4%n.byteLength;if(o.current.position.set(g.getFloat32(p,!0),g.getFloat32(p+4,!0),g.getFloat32(p+8,!0)),o.current.quaternion.set(b.getFloat32(x+4,!0),b.getFloat32(x+8,!0),b.getFloat32(x+12,!0),b.getFloat32(x,!0)),y&&i)if(i.byteLength===n.byteLength/4*3){const _=d*3*4%i.byteLength;o.current.scale.set(y.getFloat32(_,!0),y.getFloat32(_+4,!0),y.getFloat32(_+8,!0))}else{const _=d*4%i.byteLength,w=y.getFloat32(_,!0);o.current.scale.setScalar(w)}else o.current.scale.set(1,1,1);r&&(Wl.instanceMatrix.compose(o.current.position,o.current.quaternion,o.current.scale),Wl.transformMatrix.compose(r.position,r.rotation,r.scale),Wl.finalMatrix.copy(Wl.instanceMatrix).multiply(Wl.transformMatrix),Wl.finalMatrix.decompose(Wl.position,Wl.quaternion,Wl.scale),o.current.position.copy(Wl.position),o.current.quaternion.copy(Wl.quaternion),o.current.scale.copy(Wl.scale)),o.current.visible=!0}}}),!s||!s.clickable||!u?null:k.jsx("mesh",{ref:o,geometry:u,material:f,visible:!1})},nQ=Ee.createContext(null),k6=16777215,D6=.85,O6=.2,I6=.2;function aTe(t,e){const n=t.material;return n?((Array.isArray(n)?n:[n]).forEach(r=>{r.depthTest=e,r.depthWrite=!1,r.transparent=!0,r.needsUpdate=!0}),t.renderOrder=1e4,!0):!1}function sTe(t,e,n,i){return t.updateMatrix(),t.updateWorldMatrix(!1,!1),t.getWorldQuaternion(n),e.getWorldQuaternion(i).premultiply(n.invert()),i}function _I(t,e,n){return t==="screen"?.3*e:n}function oTe(t,e,n){if("fov"in t&&typeof t.fov=="number"){n.copy(e),n.applyMatrix4(t.matrixWorldInverse);const i=-n.z,r=Math.tan(t.fov*Math.PI/360);return i/10*r}else return 1}const lTe=new Wv(1),cTe=SC({scale:1,point_ball_norm:0,uniformColor:new Ut(1,1,1)},`
  precision mediump float;

  varying vec3 vPosition;
  varying vec3 vColor; // in the vertex shader
  uniform float scale;
  uniform vec3 uniformColor;

  void main() {
      vPosition = position;
      #ifdef USE_COLOR
      vColor = color;
      #else
      vColor = uniformColor;
      #endif
      vec4 world_pos = modelViewMatrix * vec4(position, 1.0);
      gl_Position = projectionMatrix * world_pos;
      gl_PointSize = (scale / -world_pos.z);
  }
   `,`varying vec3 vPosition;
  varying vec3 vColor;
  uniform float point_ball_norm;

  void main() {
      if (point_ball_norm < 1000.0) {
          float r = pow(
              pow(abs(gl_PointCoord.x - 0.5), point_ball_norm)
              + pow(abs(gl_PointCoord.y - 0.5), point_ball_norm),
              1.0 / point_ball_norm);
          if (r > 0.5) discard;
      }
      gl_FragColor = vec4(vColor, 1.0);
  }
   `),uTe=Ee.forwardRef(function({children:e,...n},i){const r=Ri(c=>c.get),a=n.props,s=Ee.useMemo(()=>{const c=new Dn;return n.props.precision==="float16"?c.setAttribute("position",new jJ(new Uint16Array(a.points.buffer.slice(a.points.byteOffset,a.points.byteOffset+a.points.byteLength)),3)):c.setAttribute("position",new fn(new Float32Array(a.points.buffer.slice(a.points.byteOffset,a.points.byteOffset+a.points.byteLength)),3)),a.colors.length>3?c.setAttribute("color",new Nn(new Uint8Array(a.colors),3,!0)):a.colors.length<3&&console.error(`Invalid color buffer length, got ${a.colors.length}`),c},[a.points,a.colors]),o=Ee.useMemo(()=>{const c=new cTe;return a.colors.length>3?c.vertexColors=!0:(c.vertexColors=!1,c.uniforms.uniformColor.value=new Ut(a.colors[0]/255,a.colors[1]/255,a.colors[2]/255)),c},[a.colors]);Ee.useEffect(()=>()=>{s.dispose(),o.dispose()},[s,o]),Ee.useEffect(()=>{o.uniforms.scale.value=10,o.uniforms.point_ball_norm.value={square:1/0,diamond:1,circle:2,rounded:3,sparkle:.6}[a.point_shape]},[a.point_shape,o]);const l=new wt;return ra(()=>{o.uniforms.scale.value=a.point_size/Math.tan(r().camera.fov/180*Math.PI/2)*r().gl.getSize(l).height*r().gl.getPixelRatio()}),k.jsx("points",{frustumCulled:!1,ref:i,geometry:s,material:o,children:e})}),fTe=Ee.forwardRef(function({showAxes:e=!0,axesLength:n=.5,axesRadius:i=.0125,originRadius:r=void 0,originColor:a=15526912,children:s},o){return r=r??i*2,k.jsxs("group",{ref:o,children:[e&&k.jsxs(k.Fragment,{children:[k.jsxs("mesh",{geometry:lTe,scale:new te(r,r,r),children:[k.jsx("meshBasicMaterial",{color:a}),k.jsx(Jf,{})]}),k.jsxs(lT,{limit:6,children:[k.jsx("meshBasicMaterial",{}),k.jsx("cylinderGeometry",{args:[i,i,n,16]}),k.jsx(sc,{rotation:new mi(0,0,3*Math.PI/2),position:[.5*n,0,0],color:13369344,children:k.jsx(Jf,{unmountOnHide:!0,enableCreaseAngle:!0})}),k.jsx(sc,{position:[0,.5*n,0],color:52224,children:k.jsx(Jf,{unmountOnHide:!0,enableCreaseAngle:!0})}),k.jsx(sc,{rotation:new mi(Math.PI/2,0,0),position:[0,0,.5*n],color:204,children:k.jsx(Jf,{unmountOnHide:!0,enableCreaseAngle:!0})})]})]}),s]})}),hTe=Ee.forwardRef(function({batched_wxyzs:e,batched_positions:n,batched_scales:i,axes_length:r=.5,axes_radius:a=.0125,children:s},o){const l=Ee.useRef(null),c=Ee.useMemo(()=>new jm(a,a,r,16),[a,r]),u=Ee.useMemo(()=>new Cs,[]);Ee.useEffect(()=>()=>{c.dispose(),u.dispose()},[c,u]);const f=Ee.useMemo(()=>({T_frame_framex:new Ot().makeRotationFromEuler(new mi(0,0,3*Math.PI/2)).setPosition(.5*r,0,0),T_frame_framey:new Ot().makeRotationFromEuler(new mi(0,0,0)).setPosition(0,.5*r,0),T_frame_framez:new Ot().makeRotationFromEuler(new mi(Math.PI/2,0,0)).setPosition(0,0,.5*r),red:new Ut(13369344),green:new Ut(52224),blue:new Ut(204)}),[r]);Ee.useEffect(()=>{if(!l.current)return;const p=new Ot,x=new Ot,_=new Ot,w=new Ot,M=new Vn,S=new te,{T_frame_framex:A,T_frame_framey:C,T_frame_framez:D,red:R,green:N,blue:U}=f,j=new DataView(n.buffer,n.byteOffset,n.byteLength),z=new DataView(e.buffer,e.byteOffset,e.byteLength),q=i?new DataView(i.buffer,i.byteOffset,i.byteLength):null,B=e.byteLength/(4*4);for(let G=0;G<B;G++){const H=G*3*4%n.byteLength,W=G*4*4%e.byteLength,F=i&&i.byteLength===e.byteLength/4*3?G*3*4%i.byteLength:G*4%(i?.byteLength??4);if(q&&i)if(i.byteLength===e.byteLength/4*3)S.set(q.getFloat32(F,!0),q.getFloat32(F+4,!0),q.getFloat32(F+8,!0));else{const Y=q.getFloat32(F,!0);S.set(Y,Y,Y)}else S.set(1,1,1);p.makeRotationFromQuaternion(M.set(z.getFloat32(W+4,!0),z.getFloat32(W+8,!0),z.getFloat32(W+12,!0),z.getFloat32(W,!0))).scale(S).setPosition(j.getFloat32(H,!0),j.getFloat32(H+4,!0),j.getFloat32(H+8,!0)),x.copy(p).multiply(A),_.copy(p).multiply(C),w.copy(p).multiply(D),l.current.setMatrixAt(G*3+0,x),l.current.setMatrixAt(G*3+1,_),l.current.setMatrixAt(G*3+2,w),l.current.setColorAt(G*3+0,R),l.current.setColorAt(G*3+1,N),l.current.setColorAt(G*3+2,U)}l.current.instanceMatrix.needsUpdate=!0,l.current.instanceColor.needsUpdate=!0},[e,n,i,f]);const h=Ee.useMemo(()=>new jm(a,a,r,16),[a,r]),d=Ee.useMemo(()=>({position:new te(.5*r,0,0),rotation:new Vn().setFromEuler(new mi(0,0,3*Math.PI/2)),scale:new te(1,1,1)}),[r]),g=Ee.useMemo(()=>({position:new te(0,.5*r,0),rotation:new Vn().setFromEuler(new mi(0,0,0)),scale:new te(1,1,1)}),[r]),b=Ee.useMemo(()=>({position:new te(0,0,.5*r),rotation:new Vn().setFromEuler(new mi(Math.PI/2,0,0)),scale:new te(1,1,1)}),[r]),y=e.byteLength/(4*4)*3;return k.jsxs("group",{ref:o,children:[k.jsx("instancedMesh",{ref:l,args:[c,u,y]}),k.jsx(yM,{geometry:h,batched_positions:n,batched_wxyzs:e,batched_scales:i,meshTransform:d,computeBatchIndexFromInstanceIndex:p=>Math.floor(p/3)}),k.jsx(yM,{geometry:h,batched_positions:n,batched_wxyzs:e,batched_scales:i,meshTransform:g,computeBatchIndexFromInstanceIndex:p=>Math.floor(p/3)}),k.jsx(yM,{geometry:h,batched_positions:n,batched_wxyzs:e,batched_scales:i,meshTransform:b,computeBatchIndexFromInstanceIndex:p=>Math.floor(p/3)}),s]})}),dTe=Ee.forwardRef(function({children:e,...n},i){const[r,a]=Ee.useState();return Ee.useEffect(()=>{if(n.props._format!==null&&n.props._data!==null){const s=URL.createObjectURL(new Blob([n.props._data],{type:"image/"+n.props._format}));new lv().load(s,o=>{a(o),URL.revokeObjectURL(s)})}},[n.props._format,n.props._data]),k.jsxs("group",{ref:i,children:[k.jsxs("mesh",{rotation:new mi(Math.PI,0,0),castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[k.jsx(Jf,{}),k.jsx("planeGeometry",{attach:"geometry",args:[n.props.render_width,n.props.render_height]}),k.jsx("meshBasicMaterial",{attach:"material",transparent:!0,side:Kr,map:r,toneMapped:!1})]}),e]})});function pTe(t){const[e,n]=t.split("-");return{anchorX:n==="left"?"left":n==="right"?"right":"center",anchorY:e==="top"?"top":e==="bottom"?"bottom":"middle"}}const mTe=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useContext(bi),a=Ee.useRef(null),s=Ee.useRef(null),o=Ee.useContext(nQ);if(!o)throw new Error("ViserLabel must be used within BatchedLabelManager context");const{anchorX:l,anchorY:c}=pTe(n.props.anchor),u=_I(n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height);return Ee.useEffect(()=>{const h=new u1;return h.text=n.props.text,h.font="./Inter-VariableFont_slnt,wght.ttf",h.fontSize=u,h.color=0,h.anchorX=l,h.anchorY=c,h.sdfGlyphSize=32,h.position.set(0,0,0),s.current=h,o.registerText(h,n.name,n.props.depth_test,n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height,l,c),()=>{o.unregisterText(h),h.dispose()}},[]),Ee.useEffect(()=>{s.current&&(s.current.text=n.props.text,o.syncText(s.current))},[n.props.text,o]),Ee.useEffect(()=>{s.current&&o.updateText(s.current,n.props.depth_test,n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height,l,c)},[n.props.depth_test,n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height,l,c,o]),Ee.useImperativeHandle(i,()=>a.current,[]),r.useSceneTree(h=>{const d=h[n.name];return d?.children&&d.children.length>0})?k.jsx("group",{ref:a,children:e}):null});function iQ(t){return t[0]<<16|t[1]<<8|t[2]}function N6(t){const e=new rs(Uint8Array.from(t===3?[0,128,255]:[0,64,128,192,255]),t,1,wh);return e.needsUpdate=!0,e}function gTe(t){throw new Error(`Should never get here! ${t}`)}function L6(t){"map"in t&&t.map?.dispose(),"lightMap"in t&&t.lightMap?.dispose(),"bumpMap"in t&&t.bumpMap?.dispose(),"normalMap"in t&&t.normalMap?.dispose(),"specularMap"in t&&t.specularMap?.dispose(),"envMap"in t&&t.envMap?.dispose(),"alphaMap"in t&&t.alphaMap?.dispose(),"aoMap"in t&&t.aoMap?.dispose(),"displacementMap"in t&&t.displacementMap?.dispose(),"emissiveMap"in t&&t.emissiveMap?.dispose(),"gradientMap"in t&&t.gradientMap?.dispose(),"metalnessMap"in t&&t.metalnessMap?.dispose(),"roughnessMap"in t&&t.roughnessMap?.dispose(),t.dispose()}function Z_(t){const e={color:t.color===void 0?16777215:iQ(t.color),wireframe:t.wireframe,transparent:t.opacity!==null,opacity:t.opacity??1,side:{front:gu,back:Ra,double:Kr}[t.side]};return t.material=="standard"||t.wireframe?new qv({flatShading:t.flat_shading&&!t.wireframe,...e}):t.material=="toon3"?new eT({gradientMap:N6(3),...e}):t.material=="toon5"?new eT({gradientMap:N6(5),...e}):gTe(t.material)}const bTe=Ee.forwardRef(function({children:e,...n},i){const[r,a]=Ee.useState();Ee.useEffect(()=>{if(n.props._format!==null&&n.props._image_data!==null){const y=URL.createObjectURL(new Blob([n.props._image_data],{type:"image/"+n.props._format}));new lv().load(y,p=>{a(p),URL.revokeObjectURL(y)})}else a(void 0)},[n.props._format,n.props._image_data]);let s=Math.tan(n.props.fov/2),o=s*n.props.aspect,l=1;const c=Math.cbrt(o*s*l/3);o/=c,s/=c,l/=c,o*=n.props.scale,s*=n.props.scale,l*=n.props.scale;const u=Ee.useContext(Zv),[f,h]=Ee.useState(!1);ra(()=>{u!==null&&u.state.current.isHovered!==f&&h(u.state.current.isHovered)});const d=[[-1,-1,1],[1,-1,1],[1,-1,1],[1,1,1],[1,1,1],[-1,1,1],[-1,1,1],[-1,-1,1],[-1,-1,1],[0,0,0],[0,0,0],[1,-1,1],[-1,1,1],[0,0,0],[0,0,0],[1,1,1],[0,-1.2,1],r===void 0?[0,-.9,1]:[0,-1,1]].map(y=>[y[0]*o,y[1]*s,y[2]*l]),g=Ee.useMemo(()=>{if(n.props.variant!=="filled")return null;const y=new Dn,p=new Float32Array([0,0,0,-o,-s,l,o,-s,l,o,s,l,-o,s,l]),x=new Uint16Array([0,1,2,0,2,3,0,3,4,0,4,1,1,4,3,1,3,2]);return y.setAttribute("position",new Nn(p,3)),y.setIndex(new Nn(x,1)),y.computeVertexNormals(),y},[o,s,l,n.props.variant]),b=new Ut().setRGB(n.props.color[0]/255,n.props.color[1]/255,n.props.color[2]/255);return k.jsxs("group",{ref:i,children:[k.jsx(Xm,{points:d,color:f?16514816:iQ(n.props.color),lineWidth:f?1.5*n.props.line_width:n.props.line_width,segments:!0}),n.props.variant==="filled"&&g&&k.jsx("mesh",{geometry:g,children:k.jsx("meshBasicMaterial",{color:f?16514816:b,transparent:!0,opacity:.3,side:Kr,depthWrite:!1})}),r&&k.jsxs("mesh",{position:[0,0,l*.999999],rotation:new mi(Math.PI,0,0),castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[k.jsx("planeGeometry",{attach:"geometry",args:[n.props.aspect*s*2,s*2]}),k.jsx("meshBasicMaterial",{attach:"material",transparent:!0,side:Kr,map:r,toneMapped:!1})]}),e]})});var vTe=async function(t={}){var e,n=t,i,r,a=new Promise((le,ae)=>{i=le,r=ae}),s=typeof window=="object",o=typeof WorkerGlobalScope<"u",l=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(l){const{createRequire:le}=await u2e(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]);var c=le(import.meta.url)}var u=import.meta.url,f="";function h(le){return n.locateFile?n.locateFile(le,f):f+le}var d,g;if(l){var b=c("fs"),y=c("path");u.startsWith("file:")&&(f=y.dirname(c("url").fileURLToPath(u))+"/"),g=le=>{le=q(le)?new URL(le):le;var ae=b.readFileSync(le);return ae},d=async(le,ae=!0)=>{le=q(le)?new URL(le):le;var Re=b.readFileSync(le,ae?void 0:"utf8");return Re},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else if(s||o){try{f=new URL(".",u).href}catch{}o&&(g=le=>{var ae=new XMLHttpRequest;return ae.open("GET",le,!1),ae.responseType="arraybuffer",ae.send(null),new Uint8Array(ae.response)}),d=async le=>{if(q(le))return new Promise((Re,Ze)=>{var pt=new XMLHttpRequest;pt.open("GET",le,!0),pt.responseType="arraybuffer",pt.onload=()=>{if(pt.status==200||pt.status==0&&pt.response){Re(pt.response);return}Ze(pt.status)},pt.onerror=Ze,pt.send(null)});var ae=await fetch(le,{credentials:"same-origin"});if(ae.ok)return ae.arrayBuffer();throw new Error(ae.status+" : "+ae.url)}}console.log.bind(console);var p=console.error.bind(console),x,_,w=!1,M,S,A,C,D,R,N,U,j,z,q=le=>le.startsWith("file://");function B(){var le=_.buffer;M=new Int8Array(le),A=new Int16Array(le),S=new Uint8Array(le),C=new Uint16Array(le),D=new Int32Array(le),R=new Uint32Array(le),N=new Float32Array(le),z=new Float64Array(le),U=new BigInt64Array(le),j=new BigUint64Array(le)}function G(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)we(n.preRun.shift());pe(qe)}function H(){Ei.z()}function W(){if(n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Ie(n.postRun.shift());pe(Fe)}var F=0,Y=null;function Z(le){F++,n.monitorRunDependencies?.(F)}function V(le){if(F--,n.monitorRunDependencies?.(F),F==0&&Y){var ae=Y;Y=null,ae()}}function de(le){n.onAbort?.(le),le="Aborted("+le+")",p(le),w=!0,le+=". Build with -sASSERTIONS for more info.";var ae=new WebAssembly.RuntimeError(le);throw r(ae),ae}var se;function oe(){return n.locateFile?h("Sorter.wasm"):new URL("/assets/Sorter-C9-Mizw7.wasm",import.meta.url).href}function ue(le){if(le==se&&x)return new Uint8Array(x);if(g)return g(le);throw"both async and sync fetching of the wasm failed"}async function _e(le){if(!x)try{var ae=await d(le);return new Uint8Array(ae)}catch{}return ue(le)}async function ke(le,ae){try{var Re=await _e(le),Ze=await WebAssembly.instantiate(Re,ae);return Ze}catch(pt){p(`failed to asynchronously prepare wasm: ${pt}`),de(pt)}}async function Ne(le,ae,Re){if(!le&&typeof WebAssembly.instantiateStreaming=="function"&&!q(ae)&&!l)try{var Ze=fetch(ae,{credentials:"same-origin"}),pt=await WebAssembly.instantiateStreaming(Ze,Re);return pt}catch(Dt){p(`wasm streaming compile failed: ${Dt}`),p("falling back to ArrayBuffer instantiation")}return ke(ae,Re)}function Ue(){return{a:os}}async function ze(){function le(Dt,jt){return Ei=Dt.exports,_=Ei.y,B(),ve=Ei.B,V(),Ei}Z();function ae(Dt){return le(Dt.instance)}var Re=Ue();if(n.instantiateWasm)return new Promise((Dt,jt)=>{n.instantiateWasm(Re,(Mt,Jt)=>{Dt(le(Mt))})});se??=oe();try{var Ze=await Ne(x,se,Re),pt=ae(Ze);return pt}catch(Dt){return r(Dt),Promise.reject(Dt)}}var pe=le=>{for(;le.length>0;)le.shift()(n)},Fe=[],Ie=le=>Fe.push(le),qe=[],we=le=>qe.push(le);class Te{constructor(ae){this.excPtr=ae,this.ptr=ae-24}set_type(ae){R[this.ptr+4>>2]=ae}get_type(){return R[this.ptr+4>>2]}set_destructor(ae){R[this.ptr+8>>2]=ae}get_destructor(){return R[this.ptr+8>>2]}set_caught(ae){ae=ae?1:0,M[this.ptr+12]=ae}get_caught(){return M[this.ptr+12]!=0}set_rethrown(ae){ae=ae?1:0,M[this.ptr+13]=ae}get_rethrown(){return M[this.ptr+13]!=0}init(ae,Re){this.set_adjusted_ptr(0),this.set_type(ae),this.set_destructor(Re)}set_adjusted_ptr(ae){R[this.ptr+16>>2]=ae}get_adjusted_ptr(){return R[this.ptr+16>>2]}}var Ae=0,Pe=(le,ae,Re)=>{var Ze=new Te(le);throw Ze.init(ae,Re),Ae=le,Ae},He=()=>de(""),$e=()=>{for(var le=new Array(256),ae=0;ae<256;++ae)le[ae]=String.fromCharCode(ae);ie=le},ie,K=le=>{for(var ae="",Re=le;S[Re];)ae+=ie[S[Re++]];return ae},ce={},fe={},me={},$=class extends Error{constructor(ae){super(ae),this.name="BindingError"}},Le=le=>{throw new $(le)};function Xe(le,ae,Re={}){var Ze=ae.name;if(le||Le(`type "${Ze}" must have a positive integer typeid pointer`),fe.hasOwnProperty(le)){if(Re.ignoreDuplicateRegistrations)return;Le(`Cannot register type '${Ze}' twice`)}if(fe[le]=ae,delete me[le],ce.hasOwnProperty(le)){var pt=ce[le];delete ce[le],pt.forEach(Dt=>Dt())}}function mt(le,ae,Re={}){return Xe(le,ae,Re)}var Ge=(le,ae,Re)=>{switch(ae){case 1:return Re?Ze=>M[Ze]:Ze=>S[Ze];case 2:return Re?Ze=>A[Ze>>1]:Ze=>C[Ze>>1];case 4:return Re?Ze=>D[Ze>>2]:Ze=>R[Ze>>2];case 8:return Re?Ze=>U[Ze>>3]:Ze=>j[Ze>>3];default:throw new TypeError(`invalid integer width (${ae}): ${le}`)}},Je=(le,ae,Re,Ze,pt)=>{ae=K(ae);const Dt=Ze===0n;let jt=Mt=>Mt;if(Dt){const Mt=Re*8;jt=Jt=>BigInt.asUintN(Mt,Jt),pt=jt(pt)}mt(le,{name:ae,fromWireType:jt,toWireType:(Mt,Jt)=>(typeof Jt=="number"&&(Jt=BigInt(Jt)),Jt),argPackAdvance:tt,readValueFromPointer:Ge(ae,Re,!Dt),destructorFunction:null})},tt=8,xt=(le,ae,Re,Ze)=>{ae=K(ae),mt(le,{name:ae,fromWireType:function(pt){return!!pt},toWireType:function(pt,Dt){return Dt?Re:Ze},argPackAdvance:tt,readValueFromPointer:function(pt){return this.fromWireType(S[pt])},destructorFunction:null})},Tt=le=>({count:le.count,deleteScheduled:le.deleteScheduled,preservePointerOnDelete:le.preservePointerOnDelete,ptr:le.ptr,ptrType:le.ptrType,smartPtr:le.smartPtr,smartPtrType:le.smartPtrType}),bt=le=>{function ae(Re){return Re.$$.ptrType.registeredClass.name}Le(ae(le)+" instance already deleted")},Rt=!1,Oe=le=>{},Ve=le=>{le.smartPtr?le.smartPtrType.rawDestructor(le.smartPtr):le.ptrType.registeredClass.rawDestructor(le.ptr)},ht=le=>{le.count.value-=1;var ae=le.count.value===0;ae&&Ve(le)},Ft=le=>typeof FinalizationRegistry>"u"?(Ft=ae=>ae,le):(Rt=new FinalizationRegistry(ae=>{ht(ae.$$)}),Ft=ae=>{var Re=ae.$$,Ze=!!Re.smartPtr;if(Ze){var pt={$$:Re};Rt.register(ae,pt,ae)}return ae},Oe=ae=>Rt.unregister(ae),Ft(le)),st=()=>{let le=it.prototype;Object.assign(le,{isAliasOf(Re){if(!(this instanceof it)||!(Re instanceof it))return!1;var Ze=this.$$.ptrType.registeredClass,pt=this.$$.ptr;Re.$$=Re.$$;for(var Dt=Re.$$.ptrType.registeredClass,jt=Re.$$.ptr;Ze.baseClass;)pt=Ze.upcast(pt),Ze=Ze.baseClass;for(;Dt.baseClass;)jt=Dt.upcast(jt),Dt=Dt.baseClass;return Ze===Dt&&pt===jt},clone(){if(this.$$.ptr||bt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var Re=Ft(Object.create(Object.getPrototypeOf(this),{$$:{value:Tt(this.$$)}}));return Re.$$.count.value+=1,Re.$$.deleteScheduled=!1,Re},delete(){this.$$.ptr||bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Le("Object already scheduled for deletion"),Oe(this),ht(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Le("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const ae=Symbol.dispose;ae&&(le[ae]=le.delete)};function it(){}var vt=(le,ae)=>Object.defineProperty(ae,"name",{value:le}),Kt={},Xt=(le,ae,Re)=>{if(le[ae].overloadTable===void 0){var Ze=le[ae];le[ae]=function(...pt){return le[ae].overloadTable.hasOwnProperty(pt.length)||Le(`Function '${Re}' called with an invalid number of arguments (${pt.length}) - expects one of (${le[ae].overloadTable})!`),le[ae].overloadTable[pt.length].apply(this,pt)},le[ae].overloadTable=[],le[ae].overloadTable[Ze.argCount]=Ze}},cn=(le,ae,Re)=>{n.hasOwnProperty(le)?(Le(`Cannot register public name '${le}' twice`),Xt(n,le,le),n[le].overloadTable.hasOwnProperty(Re)&&Le(`Cannot register multiple overloads of a function with the same number of arguments (${Re})!`),n[le].overloadTable[Re]=ae):(n[le]=ae,n[le].argCount=Re)},Gn=48,bn=57,Jn=le=>{le=le.replace(/[^a-zA-Z0-9_]/g,"$");var ae=le.charCodeAt(0);return ae>=Gn&&ae<=bn?`_${le}`:le};function ai(le,ae,Re,Ze,pt,Dt,jt,Mt){this.name=le,this.constructor=ae,this.instancePrototype=Re,this.rawDestructor=Ze,this.baseClass=pt,this.getActualType=Dt,this.upcast=jt,this.downcast=Mt,this.pureVirtualFunctions=[]}var vi=(le,ae,Re)=>{for(;ae!==Re;)ae.upcast||Le(`Expected null or instance of ${Re.name}, got an instance of ${ae.name}`),le=ae.upcast(le),ae=ae.baseClass;return le},Yn=le=>{if(le===null)return"null";var ae=typeof le;return ae==="object"||ae==="array"||ae==="function"?le.toString():""+le};function Yi(le,ae){if(ae===null)return this.isReference&&Le(`null is not a valid ${this.name}`),0;ae.$$||Le(`Cannot pass "${Yn(ae)}" as a ${this.name}`),ae.$$.ptr||Le(`Cannot pass deleted object as a pointer of type ${this.name}`);var Re=ae.$$.ptrType.registeredClass,Ze=vi(ae.$$.ptr,Re,this.registeredClass);return Ze}function ci(le,ae){var Re;if(ae===null)return this.isReference&&Le(`null is not a valid ${this.name}`),this.isSmartPointer?(Re=this.rawConstructor(),le!==null&&le.push(this.rawDestructor,Re),Re):0;(!ae||!ae.$$)&&Le(`Cannot pass "${Yn(ae)}" as a ${this.name}`),ae.$$.ptr||Le(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&ae.$$.ptrType.isConst&&Le(`Cannot convert argument of type ${ae.$$.smartPtrType?ae.$$.smartPtrType.name:ae.$$.ptrType.name} to parameter type ${this.name}`);var Ze=ae.$$.ptrType.registeredClass;if(Re=vi(ae.$$.ptr,Ze,this.registeredClass),this.isSmartPointer)switch(ae.$$.smartPtr===void 0&&Le("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:ae.$$.smartPtrType===this?Re=ae.$$.smartPtr:Le(`Cannot convert argument of type ${ae.$$.smartPtrType?ae.$$.smartPtrType.name:ae.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:Re=ae.$$.smartPtr;break;case 2:if(ae.$$.smartPtrType===this)Re=ae.$$.smartPtr;else{var pt=ae.clone();Re=this.rawShare(Re,pn.toHandle(()=>pt.delete())),le!==null&&le.push(this.rawDestructor,Re)}break;default:Le("Unsupporting sharing policy")}return Re}function hn(le,ae){if(ae===null)return this.isReference&&Le(`null is not a valid ${this.name}`),0;ae.$$||Le(`Cannot pass "${Yn(ae)}" as a ${this.name}`),ae.$$.ptr||Le(`Cannot pass deleted object as a pointer of type ${this.name}`),ae.$$.ptrType.isConst&&Le(`Cannot convert argument of type ${ae.$$.ptrType.name} to parameter type ${this.name}`);var Re=ae.$$.ptrType.registeredClass,Ze=vi(ae.$$.ptr,Re,this.registeredClass);return Ze}function ui(le){return this.fromWireType(R[le>>2])}var $n=(le,ae,Re)=>{if(ae===Re)return le;if(Re.baseClass===void 0)return null;var Ze=$n(le,ae,Re.baseClass);return Ze===null?null:Re.downcast(Ze)},re={},ge=(le,ae)=>{for(ae===void 0&&Le("ptr should not be undefined");le.baseClass;)ae=le.upcast(ae),le=le.baseClass;return ae},je=(le,ae)=>(ae=ge(le,ae),re[ae]),rt=class extends Error{constructor(ae){super(ae),this.name="InternalError"}},dt=le=>{throw new rt(le)},ot=(le,ae)=>{(!ae.ptrType||!ae.ptr)&&dt("makeClassHandle requires ptr and ptrType");var Re=!!ae.smartPtrType,Ze=!!ae.smartPtr;return Re!==Ze&&dt("Both smartPtrType and smartPtr must be specified"),ae.count={value:1},Ft(Object.create(le,{$$:{value:ae,writable:!0}}))};function kt(le){var ae=this.getPointee(le);if(!ae)return this.destructor(le),null;var Re=je(this.registeredClass,ae);if(Re!==void 0){if(Re.$$.count.value===0)return Re.$$.ptr=ae,Re.$$.smartPtr=le,Re.clone();var Ze=Re.clone();return this.destructor(le),Ze}function pt(){return this.isSmartPointer?ot(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:ae,smartPtrType:this,smartPtr:le}):ot(this.registeredClass.instancePrototype,{ptrType:this,ptr:le})}var Dt=this.registeredClass.getActualType(ae),jt=Kt[Dt];if(!jt)return pt.call(this);var Mt;this.isConst?Mt=jt.constPointerType:Mt=jt.pointerType;var Jt=$n(ae,this.registeredClass,Mt.registeredClass);return Jt===null?pt.call(this):this.isSmartPointer?ot(Mt.registeredClass.instancePrototype,{ptrType:Mt,ptr:Jt,smartPtrType:this,smartPtr:le}):ot(Mt.registeredClass.instancePrototype,{ptrType:Mt,ptr:Jt})}var ee=()=>{Object.assign(ye.prototype,{getPointee(le){return this.rawGetPointee&&(le=this.rawGetPointee(le)),le},destructor(le){this.rawDestructor?.(le)},argPackAdvance:tt,readValueFromPointer:ui,fromWireType:kt})};function ye(le,ae,Re,Ze,pt,Dt,jt,Mt,Jt,yn,kn){this.name=le,this.registeredClass=ae,this.isReference=Re,this.isConst=Ze,this.isSmartPointer=pt,this.pointeeType=Dt,this.sharingPolicy=jt,this.rawGetPointee=Mt,this.rawConstructor=Jt,this.rawShare=yn,this.rawDestructor=kn,!pt&&ae.baseClass===void 0?Ze?(this.toWireType=Yi,this.destructorFunction=null):(this.toWireType=hn,this.destructorFunction=null):this.toWireType=ci}var Ce=(le,ae,Re)=>{n.hasOwnProperty(le)||dt("Replacing nonexistent public symbol"),n[le].overloadTable!==void 0&&Re!==void 0||(n[le]=ae,n[le].argCount=Re)},De=[],ve,_t=le=>{var ae=De[le];return ae||(De[le]=ae=ve.get(le)),ae},lt=(le,ae,Re=!1)=>{le=K(le);function Ze(){var Dt=_t(ae);return Dt}var pt=Ze();return typeof pt!="function"&&Le(`unknown function pointer with signature ${le}: ${ae}`),pt};class yt extends Error{}var St=le=>{var ae=ep(le),Re=K(ae);return ls(ae),Re},Nt=(le,ae)=>{var Re=[],Ze={};function pt(Dt){if(!Ze[Dt]&&!fe[Dt]){if(me[Dt]){me[Dt].forEach(pt);return}Re.push(Dt),Ze[Dt]=!0}}throw ae.forEach(pt),new yt(`${le}: `+Re.map(St).join([", "]))},Ht=(le,ae,Re)=>{le.forEach(Mt=>me[Mt]=ae);function Ze(Mt){var Jt=Re(Mt);Jt.length!==le.length&&dt("Mismatched type converter count");for(var yn=0;yn<le.length;++yn)mt(le[yn],Jt[yn])}var pt=new Array(ae.length),Dt=[],jt=0;ae.forEach((Mt,Jt)=>{fe.hasOwnProperty(Mt)?pt[Jt]=fe[Mt]:(Dt.push(Mt),ce.hasOwnProperty(Mt)||(ce[Mt]=[]),ce[Mt].push(()=>{pt[Jt]=fe[Mt],++jt,jt===Dt.length&&Ze(pt)}))}),Dt.length===0&&Ze(pt)},at=(le,ae,Re,Ze,pt,Dt,jt,Mt,Jt,yn,kn,xi,Nr)=>{kn=K(kn),Dt=lt(pt,Dt),Mt&&=lt(jt,Mt),yn&&=lt(Jt,yn),Nr=lt(xi,Nr);var Hr=Jn(kn);cn(Hr,function(){Nt(`Cannot construct ${kn} due to unbound types`,[Ze])}),Ht([le,ae,Re],Ze?[Ze]:[],$i=>{$i=$i[0];var cs,Ga;Ze?(cs=$i.registeredClass,Ga=cs.instancePrototype):Ga=it.prototype;var Vs=vt(kn,function(...wu){if(Object.getPrototypeOf(this)!==gf)throw new $(`Use 'new' to construct ${kn}`);if(us.constructor_body===void 0)throw new $(`${kn} has no accessible constructor`);var Lc=us.constructor_body[wu.length];if(Lc===void 0)throw new $(`Tried to invoke ctor of ${kn} with invalid number of parameters (${wu.length}) - expected (${Object.keys(us.constructor_body).toString()}) parameters instead!`);return Lc.apply(this,wu)}),gf=Object.create(Ga,{constructor:{value:Vs}});Vs.prototype=gf;var us=new ai(kn,Vs,gf,Nr,cs,Dt,Mt,yn);us.baseClass&&(us.baseClass.__derivedClasses??=[],us.baseClass.__derivedClasses.push(us));var Yo=new ye(kn,us,!0,!1,!1),lo=new ye(kn+"*",us,!1,!1,!1),bf=new ye(kn+" const*",us,!1,!0,!1);return Kt[le]={pointerType:lo,constPointerType:bf},Ce(Hr,Vs),[Yo,lo,bf]})},nn=(le,ae)=>{for(var Re=[],Ze=0;Ze<le;Ze++)Re.push(R[ae+Ze*4>>2]);return Re},un=le=>{for(;le.length;){var ae=le.pop(),Re=le.pop();Re(ae)}};function dn(le){for(var ae=1;ae<le.length;++ae)if(le[ae]!==null&&le[ae].destructorFunction===void 0)return!0;return!1}function On(le,ae,Re,Ze){var pt=dn(le),Dt=le.length-2,jt=[],Mt=["fn"];ae&&Mt.push("thisWired");for(var Jt=0;Jt<Dt;++Jt)jt.push(`arg${Jt}`),Mt.push(`arg${Jt}Wired`);jt=jt.join(","),Mt=Mt.join(",");var yn=`return function (${jt}) {
`;pt&&(yn+=`var destructors = [];
`);var kn=pt?"destructors":"null",xi=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];ae&&(yn+=`var thisWired = classParam['toWireType'](${kn}, this);
`);for(var Jt=0;Jt<Dt;++Jt)yn+=`var arg${Jt}Wired = argType${Jt}['toWireType'](${kn}, arg${Jt});
`,xi.push(`argType${Jt}`);if(yn+=(Re||Ze?"var rv = ":"")+`invoker(${Mt});
`,pt)yn+=`runDestructors(destructors);
`;else for(var Jt=ae?1:2;Jt<le.length;++Jt){var Nr=Jt===1?"thisWired":"arg"+(Jt-2)+"Wired";le[Jt].destructorFunction!==null&&(yn+=`${Nr}_dtor(${Nr});
`,xi.push(`${Nr}_dtor`))}return Re&&(yn+=`var ret = retType['fromWireType'](rv);
return ret;
`),yn+=`}
`,[xi,yn]}function $t(le,ae,Re,Ze,pt,Dt){var jt=ae.length;jt<2&&Le("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var Mt=ae[1]!==null&&Re!==null,Jt=dn(ae),yn=ae[0].name!=="void",kn=[le,Le,Ze,pt,un,ae[0],ae[1]],xi=0;xi<jt-2;++xi)kn.push(ae[xi+2]);if(!Jt)for(var xi=Mt?1:2;xi<ae.length;++xi)ae[xi].destructorFunction!==null&&kn.push(ae[xi].destructorFunction);let[Nr,Hr]=On(ae,Mt,yn,Dt);var $i=new Function(...Nr,Hr)(...kn);return vt(le,$i)}var Yt=(le,ae,Re,Ze,pt,Dt)=>{var jt=nn(ae,Re);pt=lt(Ze,pt),Ht([],[le],Mt=>{Mt=Mt[0];var Jt=`constructor ${Mt.name}`;if(Mt.registeredClass.constructor_body===void 0&&(Mt.registeredClass.constructor_body=[]),Mt.registeredClass.constructor_body[ae-1]!==void 0)throw new $(`Cannot register multiple constructors with identical number of parameters (${ae-1}) for class '${Mt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Mt.registeredClass.constructor_body[ae-1]=()=>{Nt(`Cannot construct ${Mt.name} due to unbound types`,jt)},Ht([],jt,yn=>(yn.splice(1,0,null),Mt.registeredClass.constructor_body[ae-1]=$t(Jt,yn,null,pt,Dt),[])),[]})},Pn=le=>{le=le.trim();const ae=le.indexOf("(");return ae===-1?le:le.slice(0,ae)},wn=(le,ae,Re,Ze,pt,Dt,jt,Mt,Jt,yn)=>{var kn=nn(Re,Ze);ae=K(ae),ae=Pn(ae),Dt=lt(pt,Dt,Jt),Ht([],[le],xi=>{xi=xi[0];var Nr=`${xi.name}.${ae}`;ae.startsWith("@@")&&(ae=Symbol[ae.substring(2)]),Mt&&xi.registeredClass.pureVirtualFunctions.push(ae);function Hr(){Nt(`Cannot call ${Nr} due to unbound types`,kn)}var $i=xi.registeredClass.instancePrototype,cs=$i[ae];return cs===void 0||cs.overloadTable===void 0&&cs.className!==xi.name&&cs.argCount===Re-2?(Hr.argCount=Re-2,Hr.className=xi.name,$i[ae]=Hr):(Xt($i,ae,Nr),$i[ae].overloadTable[Re-2]=Hr),Ht([],kn,Ga=>{var Vs=$t(Nr,Ga,xi,Dt,jt,Jt);return $i[ae].overloadTable===void 0?(Vs.argCount=Re-2,$i[ae]=Vs):$i[ae].overloadTable[Re-2]=Vs,[]}),[]})},Xn=[],En=[0,1,,1,null,1,!0,1,!1,1],Mn=le=>{le>9&&--En[le+1]===0&&(En[le]=void 0,Xn.push(le))},pn={toValue:le=>(le||Le(`Cannot use deleted val. handle = ${le}`),En[le]),toHandle:le=>{switch(le){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const ae=Xn.pop()||En.length;return En[ae]=le,En[ae+1]=1,ae}}}},rn={name:"emscripten::val",fromWireType:le=>{var ae=pn.toValue(le);return Mn(le),ae},toWireType:(le,ae)=>pn.toHandle(ae),argPackAdvance:tt,readValueFromPointer:ui,destructorFunction:null},yi=le=>mt(le,rn),Li=(le,ae)=>{switch(ae){case 4:return function(Re){return this.fromWireType(N[Re>>2])};case 8:return function(Re){return this.fromWireType(z[Re>>3])};default:throw new TypeError(`invalid float width (${ae}): ${le}`)}},Wn=(le,ae,Re)=>{ae=K(ae),mt(le,{name:ae,fromWireType:Ze=>Ze,toWireType:(Ze,pt)=>pt,argPackAdvance:tt,readValueFromPointer:Li(ae,Re),destructorFunction:null})},Oi=(le,ae,Re,Ze,pt)=>{ae=K(ae);const Dt=Ze===0;let jt=Jt=>Jt;if(Dt){var Mt=32-8*Re;jt=Jt=>Jt<<Mt>>>Mt,pt=jt(pt)}mt(le,{name:ae,fromWireType:jt,toWireType:(Jt,yn)=>yn,argPackAdvance:tt,readValueFromPointer:Ge(ae,Re,Ze!==0),destructorFunction:null})},ya=(le,ae,Re)=>{var Ze=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array],pt=Ze[ae];function Dt(jt){var Mt=R[jt>>2],Jt=R[jt+4>>2];return new pt(M.buffer,Jt,Mt)}Re=K(Re),mt(le,{name:Re,fromWireType:Dt,argPackAdvance:tt,readValueFromPointer:Dt},{ignoreDuplicateRegistrations:!0})},Ji=(le,ae,Re,Ze)=>{if(!(Ze>0))return 0;for(var pt=Re,Dt=Re+Ze-1,jt=0;jt<le.length;++jt){var Mt=le.charCodeAt(jt);if(Mt>=55296&&Mt<=57343){var Jt=le.charCodeAt(++jt);Mt=65536+((Mt&1023)<<10)|Jt&1023}if(Mt<=127){if(Re>=Dt)break;ae[Re++]=Mt}else if(Mt<=2047){if(Re+1>=Dt)break;ae[Re++]=192|Mt>>6,ae[Re++]=128|Mt&63}else if(Mt<=65535){if(Re+2>=Dt)break;ae[Re++]=224|Mt>>12,ae[Re++]=128|Mt>>6&63,ae[Re++]=128|Mt&63}else{if(Re+3>=Dt)break;ae[Re++]=240|Mt>>18,ae[Re++]=128|Mt>>12&63,ae[Re++]=128|Mt>>6&63,ae[Re++]=128|Mt&63}}return ae[Re]=0,Re-pt},Xo=(le,ae,Re)=>Ji(le,S,ae,Re),Bs=le=>{for(var ae=0,Re=0;Re<le.length;++Re){var Ze=le.charCodeAt(Re);Ze<=127?ae++:Ze<=2047?ae+=2:Ze>=55296&&Ze<=57343?(ae+=4,++Re):ae+=3}return ae},ao=typeof TextDecoder<"u"?new TextDecoder:void 0,so=(le,ae=0,Re=NaN)=>{for(var Ze=ae+Re,pt=ae;le[pt]&&!(pt>=Ze);)++pt;if(pt-ae>16&&le.buffer&&ao)return ao.decode(le.subarray(ae,pt));for(var Dt="";ae<pt;){var jt=le[ae++];if(!(jt&128)){Dt+=String.fromCharCode(jt);continue}var Mt=le[ae++]&63;if((jt&224)==192){Dt+=String.fromCharCode((jt&31)<<6|Mt);continue}var Jt=le[ae++]&63;if((jt&240)==224?jt=(jt&15)<<12|Mt<<6|Jt:jt=(jt&7)<<18|Mt<<12|Jt<<6|le[ae++]&63,jt<65536)Dt+=String.fromCharCode(jt);else{var yn=jt-65536;Dt+=String.fromCharCode(55296|yn>>10,56320|yn&1023)}}return Dt},In=(le,ae)=>le?so(S,le,ae):"",zs=(le,ae)=>{ae=K(ae),mt(le,{name:ae,fromWireType(Re){for(var Ze=R[Re>>2],pt=Re+4,Dt,jt,Mt=pt,jt=0;jt<=Ze;++jt){var Jt=pt+jt;if(jt==Ze||S[Jt]==0){var yn=Jt-Mt,kn=In(Mt,yn);Dt===void 0?Dt=kn:(Dt+="\0",Dt+=kn),Mt=Jt+1}}return ls(Re),Dt},toWireType(Re,Ze){Ze instanceof ArrayBuffer&&(Ze=new Uint8Array(Ze));var pt,Dt=typeof Ze=="string";Dt||ArrayBuffer.isView(Ze)&&Ze.BYTES_PER_ELEMENT==1||Le("Cannot pass non-string to std::string"),Dt?pt=Bs(Ze):pt=Ze.length;var jt=xr(4+pt+1),Mt=jt+4;return R[jt>>2]=pt,Dt?Xo(Ze,Mt,pt+1):S.set(Ze,Mt),Re!==null&&Re.push(ls,jt),jt},argPackAdvance:tt,readValueFromPointer:ui,destructorFunction(Re){ls(Re)}})},Ha=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Va=(le,ae)=>{for(var Re=le>>1,Ze=Re+ae/2,pt=Re;!(pt>=Ze)&&C[pt];)++pt;if(pt-Re>16&&Ha)return Ha.decode(C.subarray(Re,pt));for(var Dt="",jt=Re;!(jt>=Ze);++jt){var Mt=C[jt];if(Mt==0)break;Dt+=String.fromCharCode(Mt)}return Dt},xa=(le,ae,Re)=>{if(Re??=2147483647,Re<2)return 0;Re-=2;for(var Ze=ae,pt=Re<le.length*2?Re/2:le.length,Dt=0;Dt<pt;++Dt){var jt=le.charCodeAt(Dt);A[ae>>1]=jt,ae+=2}return A[ae>>1]=0,ae-Ze},oo=le=>le.length*2,js=(le,ae)=>{for(var Re=0,Ze="";!(Re>=ae/4);){var pt=D[le+Re*4>>2];if(pt==0)break;if(++Re,pt>=65536){var Dt=pt-65536;Ze+=String.fromCharCode(55296|Dt>>10,56320|Dt&1023)}else Ze+=String.fromCharCode(pt)}return Ze},Ro=(le,ae,Re)=>{if(Re??=2147483647,Re<4)return 0;for(var Ze=ae,pt=Ze+Re-4,Dt=0;Dt<le.length;++Dt){var jt=le.charCodeAt(Dt);if(jt>=55296&&jt<=57343){var Mt=le.charCodeAt(++Dt);jt=65536+((jt&1023)<<10)|Mt&1023}if(D[ae>>2]=jt,ae+=4,ae+4>pt)break}return D[ae>>2]=0,ae-Ze},E=le=>{for(var ae=0,Re=0;Re<le.length;++Re){var Ze=le.charCodeAt(Re);Ze>=55296&&Ze<=57343&&++Re,ae+=4}return ae},L=(le,ae,Re)=>{Re=K(Re);var Ze,pt,Dt,jt;ae===2?(Ze=Va,pt=xa,jt=oo,Dt=Mt=>C[Mt>>1]):ae===4&&(Ze=js,pt=Ro,jt=E,Dt=Mt=>R[Mt>>2]),mt(le,{name:Re,fromWireType:Mt=>{for(var Jt=R[Mt>>2],yn,kn=Mt+4,xi=0;xi<=Jt;++xi){var Nr=Mt+4+xi*ae;if(xi==Jt||Dt(Nr)==0){var Hr=Nr-kn,$i=Ze(kn,Hr);yn===void 0?yn=$i:(yn+="\0",yn+=$i),kn=Nr+ae}}return ls(Mt),yn},toWireType:(Mt,Jt)=>{typeof Jt!="string"&&Le(`Cannot pass non-string to C++ string type ${Re}`);var yn=jt(Jt),kn=xr(4+yn+ae);return R[kn>>2]=yn/ae,pt(Jt,kn+4,yn+ae),Mt!==null&&Mt.push(ls,kn),kn},argPackAdvance:tt,readValueFromPointer:ui,destructorFunction(Mt){ls(Mt)}})},J=(le,ae)=>{ae=K(ae),mt(le,{isVoid:!0,name:ae,argPackAdvance:0,fromWireType:()=>{},toWireType:(Re,Ze)=>{}})},ne=(le,ae)=>{var Re=fe[le];return Re===void 0&&Le(`${ae} has unknown type ${St(le)}`),Re},xe=(le,ae,Re)=>{var Ze=[],pt=le.toWireType(Ze,Re);return Ze.length&&(R[ae>>2]=pn.toHandle(Ze)),pt},Ke=(le,ae,Re)=>(le=pn.toValue(le),ae=ne(ae,"emval::as"),xe(ae,Re,le)),et={},Lt=le=>{var ae=et[le];return ae===void 0?K(le):ae},zt=[],mn=(le,ae,Re,Ze,pt)=>(le=zt[le],ae=pn.toValue(ae),Re=Lt(Re),le(ae,ae[Re],Ze,pt)),_n=le=>{var ae=zt.length;return zt.push(le),ae},Si=(le,ae)=>{for(var Re=new Array(le),Ze=0;Ze<le;++Ze)Re[Ze]=ne(R[ae+Ze*4>>2],`parameter ${Ze}`);return Re},An=(le,ae,Re)=>{var Ze=Si(le,ae),pt=Ze.shift();le--;var Dt=`return function (obj, func, destructorsRef, args) {
`,jt=0,Mt=[];Re===0&&Mt.push("obj");for(var Jt=["retType"],yn=[pt],kn=0;kn<le;++kn)Mt.push(`arg${kn}`),Jt.push(`argType${kn}`),yn.push(Ze[kn]),Dt+=`  var arg${kn} = argType${kn}.readValueFromPointer(args${jt?"+"+jt:""});
`,jt+=Ze[kn].argPackAdvance;var xi=Re===1?"new func":"func.call";Dt+=`  var rv = ${xi}(${Mt.join(", ")});
`,pt.isVoid||(Jt.push("emval_returnValue"),yn.push(xe),Dt+=`  return emval_returnValue(retType, destructorsRef, rv);
`),Dt+=`};
`;var Nr=new Function(...Jt,Dt)(...yn),Hr=`methodCaller<(${Ze.map($i=>$i.name).join(", ")}) => ${pt.name}>`;return _n(vt(Hr,Nr))},ni=(le,ae)=>(le=pn.toValue(le),ae=pn.toValue(ae),pn.toHandle(le[ae])),Er=le=>{le>9&&(En[le+1]+=1)},wi=le=>pn.toHandle(Lt(le)),ji=le=>{var ae=pn.toValue(le);un(ae),Mn(le)},Pi=(le,ae)=>{le=ne(le,"_emval_take_value");var Re=le.readValueFromPointer(ae);return pn.toHandle(Re)},fi=()=>1073741824,Da=(le,ae)=>Math.ceil(le/ae)*ae,Ll=le=>{var ae=_.buffer,Re=(le-ae.byteLength+65535)/65536|0;try{return _.grow(Re),B(),1}catch{}},Ko=le=>{var ae=S.length;le>>>=0;var Re=fi();if(le>Re)return!1;for(var Ze=1;Ze<=4;Ze*=2){var pt=ae*(1+.2/Ze);pt=Math.min(pt,le+100663296);var Dt=Math.min(Re,Da(Math.max(le,pt),65536)),jt=Ll(Dt);if(jt)return!0}return!1};$e(),st(),ee(),n.noExitRuntime&&n.noExitRuntime,n.print&&n.print,n.printErr&&(p=n.printErr),n.wasmBinary&&(x=n.wasmBinary),n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,n.addOnPostRun=Ie;var os={n:Pe,q:He,m:Je,u:xt,x:at,w:Yt,k:wn,s:yi,l:Wn,c:Oi,a:ya,t:zs,f:L,v:J,h:Ke,o:mn,b:Mn,p:An,i:ni,g:Er,j:wi,d:ji,e:Pi,r:Ko},Ei=await ze();Ei.z;var ep=Ei.A,xr=Ei.C,ls=Ei.D;function Nc(){if(F>0){Y=Nc;return}if(G(),F>0){Y=Nc;return}function le(){n.calledRun=!0,!w&&(H(),i(n),n.onRuntimeInitialized?.(),W())}n.setStatus?(n.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>n.setStatus(""),1),le()},1)):le()}function Hs(){if(n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.shift()()}return Hs(),Nc(),e=a,e};function yTe(t){return new Worker("/assets/SplatSortWorker-Brdia2wg.js",{type:"module",name:t?.name})}const vs=[];for(let t=0;t<256;++t)vs.push((t+256).toString(16).slice(1));function xTe(t,e=0){return(vs[t[e+0]]+vs[t[e+1]]+vs[t[e+2]]+vs[t[e+3]]+"-"+vs[t[e+4]]+vs[t[e+5]]+"-"+vs[t[e+6]]+vs[t[e+7]]+"-"+vs[t[e+8]]+vs[t[e+9]]+"-"+vs[t[e+10]]+vs[t[e+11]]+vs[t[e+12]]+vs[t[e+13]]+vs[t[e+14]]+vs[t[e+15]]).toLowerCase()}let RD;const _Te=new Uint8Array(16);function STe(){if(!RD){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");RD=crypto.getRandomValues.bind(crypto)}return RD(_Te)}const wTe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),P6={randomUUID:wTe};function rQ(t,e,n){if(P6.randomUUID&&!t)return P6.randomUUID();t=t||{};const i=t.random??t.rng?.()??STe();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,xTe(i)}const ETe=SC({numGaussians:0,viewport:[640,480],near:1,far:100,depthTest:!0,depthWrite:!1,transparent:!0,textureBuffer:null,textureT_camera_groups:null,transitionInState:0,projectionMatrixCustom:new Ot},`precision highp usampler2D; // Most important: ints must be 32-bit.
  precision mediump float;

  // Index from the splat sorter.
  attribute uint sortedIndex;

  // Buffers for splat data; each Gaussian gets 4 floats and 4 int32s. We just
  // copy quadjr for this.
  uniform usampler2D textureBuffer;

  // We could also use a uniform to store transforms, but this would be more
  // limiting in terms of the # of groups we can have.
  uniform sampler2D textureT_camera_groups;

  // Various other uniforms...
  uniform uint numGaussians;
  uniform vec2 viewport;
  uniform float near;
  uniform float far;
  uniform mat4 projectionMatrixCustom;

  // Fade in state between [0, 1].
  uniform float transitionInState;

  out vec4 vRgba;
  out vec2 vPosition;

  // Function to fetch and construct the i-th transform matrix using texelFetch
  mat4 getGroupTransform(uint i) {
    // Calculate the base index for the i-th transform.
    uint baseIndex = i * 3u;

    // Fetch the texels that represent the first 3 rows of the transform. We
    // choose to use row-major here, since it lets us exclude the fourth row of
    // the matrix.
    vec4 row0 = texelFetch(textureT_camera_groups, ivec2(baseIndex + 0u, 0), 0);
    vec4 row1 = texelFetch(textureT_camera_groups, ivec2(baseIndex + 1u, 0), 0);
    vec4 row2 = texelFetch(textureT_camera_groups, ivec2(baseIndex + 2u, 0), 0);

    // Construct the mat4 with the fetched rows.
    mat4 transform = mat4(row0, row1, row2, vec4(0.0, 0.0, 0.0, 1.0));
    return transpose(transform);
  }

  void main () {
    // Get position + scale from float buffer.
    ivec2 texSize = textureSize(textureBuffer, 0);
    uint texStart = sortedIndex << 1u;
    ivec2 texPos0 = ivec2(texStart % uint(texSize.x), texStart / uint(texSize.x));


    // Fetch from textures.
    uvec4 floatBufferData = texelFetch(textureBuffer, texPos0, 0);
    mat4 T_camera_group = getGroupTransform(floatBufferData.w);

    // Any early return will discard the fragment.
    gl_Position = vec4(0.0, 0.0, 2.0, 1.0);

    // Get center wrt camera. modelViewMatrix is T_cam_world.
    vec3 center = uintBitsToFloat(floatBufferData.xyz);
    vec4 c_cam = T_camera_group * vec4(center, 1);
    if (-c_cam.z < near || -c_cam.z > far)
      return;
    vec4 pos2d = projectionMatrixCustom * c_cam;
    float clip = 1.1 * pos2d.w;
    if (pos2d.x < -clip || pos2d.x > clip || pos2d.y < -clip || pos2d.y > clip)
      return;

    // Read covariance terms.
    ivec2 texPos1 = ivec2((texStart + 1u) % uint(texSize.x), (texStart + 1u) / uint(texSize.x));
    uvec4 intBufferData = texelFetch(textureBuffer, texPos1, 0);

    // Get covariance terms from int buffer.
    uint rgbaUint32 = intBufferData.w;
    vec2 triu01 = unpackHalf2x16(intBufferData.x);
    vec2 triu23 = unpackHalf2x16(intBufferData.y);
    vec2 triu45 = unpackHalf2x16(intBufferData.z);

    // Transition in.
    float startTime = 0.8 * float(sortedIndex) / float(numGaussians);
    float cov_scale = smoothstep(startTime, startTime + 0.2, transitionInState);

    // Extract focal lengths from projection matrix
    // In perspective projection: P[0][0] = 2*near/(right-left) = fx/width for symmetric frustum
    // So fx = P[0][0] * viewport.x / 2.0, fy = P[1][1] * viewport.y / 2.0
    float fx = projectionMatrixCustom[0][0] * viewport.x / 2.0;
    float fy = projectionMatrixCustom[1][1] * viewport.y / 2.0;

    // Do the actual splatting.
    mat3 cov3d = mat3(
        triu01.x, triu01.y, triu23.x,
        triu01.y, triu23.y, triu45.x,
        triu23.x, triu45.x, triu45.y
    );
    mat3 J = mat3(
        // Matrices are column-major.
        fx / c_cam.z, 0., 0.0,
        0., fy / c_cam.z, 0.0,
        -(fx * c_cam.x) / (c_cam.z * c_cam.z), -(fy * c_cam.y) / (c_cam.z * c_cam.z), 0.
    );
    mat3 A = J * mat3(T_camera_group);
    mat3 cov_proj = A * cov3d * transpose(A);
    float diag1 = cov_proj[0][0] + 0.3;
    float offDiag = cov_proj[0][1];
    float diag2 = cov_proj[1][1] + 0.3;

    // Eigendecomposition.
    float mid = 0.5 * (diag1 + diag2);
    float radius = length(vec2((diag1 - diag2) / 2.0, offDiag));
    float lambda1 = mid + radius;
    float lambda2 = mid - radius;
    if (lambda2 < 0.0)
      return;
    vec2 diagonalVector = normalize(vec2(offDiag, lambda1 - diag1));
    vec2 v1 = min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector;
    vec2 v2 = min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x);

    vRgba = vec4(
      float(rgbaUint32 & uint(0xFF)) / 255.0,
      float((rgbaUint32 >> uint(8)) & uint(0xFF)) / 255.0,
      float((rgbaUint32 >> uint(16)) & uint(0xFF)) / 255.0,
      float(rgbaUint32 >> uint(24)) / 255.0
    );

    // Throw the Gaussian off the screen if it's too close, too far, or too small.
    float weightedDeterminant = vRgba.a * (diag1 * diag2 - offDiag * offDiag);
    if (weightedDeterminant < 0.25)
      return;
    vPosition = position.xy;

    gl_Position = vec4(
        vec2(pos2d) / pos2d.w
            + position.x * v1 / viewport * 2.0
            + position.y * v2 / viewport * 2.0, pos2d.z / pos2d.w, 1.);
  }
`,`precision mediump float;

  uniform vec2 viewport;

  in vec4 vRgba;
  in vec2 vPosition;

  void main () {
    float A = -dot(vPosition, vPosition);
    if (A < -4.0) discard;
    float B = exp(A) * vRgba.a;
    if (B < 0.01) discard;  // alphaTest.
    gl_FragColor = vec4(vRgba.rgb, B);
  }`);function U6(t,e,n){const i=t.length/8,r=new H_;r.instanceCount=i,r.setIndex(new Nn(new Uint32Array([0,2,1,0,3,2]),1)),r.setAttribute("position",new Nn(new Float32Array([-2,-2,2,-2,2,2,-2,2]),2));const a=new of(new Uint32Array(i),1);a.setUsage(V1),r.setAttribute("sortedIndex",a);const s=Math.min(i*2,n),o=Math.ceil(i*2/s),l=new Uint32Array(s*o*4);l.set(t);const c=new rs(l,s,o,jv,wc);c.internalFormat="RGBA32UI",c.needsUpdate=!0;const u=new Float32Array(e*12),f=new rs(u,e*12/4,1,$r,yr);f.internalFormat="RGBA32F",f.needsUpdate=!0;const h=new ETe;return h.textureBuffer=c,h.textureT_camera_groups=f,h.numGaussians=i,{geometry:r,material:h,textureBuffer:c,textureWidth:s,textureHeight:o,sortedIndexAttribute:a,textureT_camera_groups:f,rowMajorT_camera_groups:u,numGaussians:i,numGroups:e}}function MTe(){const t=Ee.useRef({});return Ee.useState(()=>Y_(e=>({groupBufferFromId:{},nodeRefFromId:t,setBuffer:(n,i)=>e(r=>({groupBufferFromId:{...r.groupBufferFromId,[n]:i}})),removeBuffer:n=>e(i=>{const{[n]:r,...a}=i.groupBufferFromId;return{groupBufferFromId:a}})})))[0]}const Q_=Ee.createContext(null);function TTe({children:t}){const e=MTe();return k.jsxs(Q_.Provider,{value:{useGaussianSplatStore:e,updateCamera:Ee.useRef(null),meshPropsRef:Ee.useRef(null)},children:[k.jsx(CTe,{}),t]})}const ATe=Ee.forwardRef(function({buffer:e,children:n},i){const r=Ee.useContext(Q_),a=r.useGaussianSplatStore(c=>c.setBuffer),s=r.useGaussianSplatStore(c=>c.removeBuffer),o=r.useGaussianSplatStore(c=>c.nodeRefFromId),l=Ee.useMemo(()=>rQ(),[]);return Ee.useEffect(()=>()=>{s(l),delete o.current[l]},[l,s,o]),Ee.useEffect(()=>{a(l,e)},[l,e,a]),k.jsx("group",{ref:c=>{c!==null&&(i!==null&&("current"in i?i.current=c:i(c)),o.current[l]=c)},children:n})});function CTe(){const e=Ee.useContext(Q_).useGaussianSplatStore(n=>n.groupBufferFromId);return Object.keys(e).length>0?k.jsx(RTe,{}):null}function RTe(){const t=Ee.useContext(Q_),e=t.useGaussianSplatStore(R=>R.groupBufferFromId),n=t.useGaussianSplatStore(R=>R.nodeRefFromId),i=Ri(R=>R.gl).capabilities.maxTextureSize,r=Ee.useRef(null),a=Ee.useRef(null),s=Ee.useRef(null),o=Ee.useRef(!0),l=Ee.useRef(!1),[,c]=Ee.useReducer(R=>R+1,0),u=DTe(e),f=Ee.useCallback(R=>{r.current&&r.current.postMessage(R)},[]),h=!s.current||u.gaussianBuffer.length!==s.current.gaussianBuffer.length||!kTe(u.gaussianBuffer,s.current.gaussianBuffer),d=s.current&&(u.numGaussians!==s.current.numGaussians||u.numGroups!==s.current.numGroups);if(o.current)a.current=U6(u.gaussianBuffer,u.numGroups,i),r.current=new yTe,r.current.onmessage=R=>{const N=R.data.sortedIndices;a.current&&(N.length===a.current.numGaussians&&(a.current.sortedIndexAttribute.set(N),a.current.sortedIndexAttribute.needsUpdate=!0),l.current||(a.current.material.uniforms.numGaussians.value=a.current.numGaussians,a.current.textureBuffer.needsUpdate=!0,l.current=!0))},f({setBuffer:u.gaussianBuffer,setGroupIndices:u.groupIndices}),s.current=u,o.current=!1;else if(h&&a.current){if(d){const R=a.current;a.current=U6(u.gaussianBuffer,u.numGroups,i),R.textureBuffer.dispose(),R.geometry.dispose(),R.material.dispose(),R.textureT_camera_groups.dispose(),f({updateBuffer:u.gaussianBuffer,updateGroupIndices:u.groupIndices}),a.current.material.uniforms.transitionInState.value=1,a.current.material.uniforms.numGaussians.value=u.numGaussians,a.current.textureBuffer.needsUpdate=!0,c()}else{const R=a.current.textureBuffer.image.data,N=new Uint32Array(R.length);N.set(u.gaussianBuffer),R.set(N),a.current.textureBuffer.needsUpdate=!0,f({updateBuffer:u.gaussianBuffer,updateGroupIndices:u.groupIndices}),a.current.material.uniforms.transitionInState.value=1}s.current=u}t.meshPropsRef.current=a.current,Ee.useEffect(()=>()=>{a.current&&(a.current.textureBuffer.dispose(),a.current.geometry.dispose(),a.current.material.dispose(),a.current.textureT_camera_groups.dispose()),r.current&&r.current.postMessage({close:!0})},[]);const g=Ee.useRef(null),b=Ee.useMemo(()=>new Ot,[]),y=Ee.useRef(new Float32Array(u.numGroups*4)),p=Ee.useRef(new Float32Array(0)),x=Ee.useRef([]);y.current.length!==u.numGroups*4&&(y.current=new Float32Array(u.numGroups*4));const _=Ee.useRef({fovY:0,aspect:0,near:0,far:0}),w=Ee.useRef(new Ot().makePerspective(-1,1,1,-1,.1,1e3)),M=Ee.useRef(null),S=Ee.useRef(0),A=Ee.useRef(0);h&&(A.current+=1),Ee.useEffect(()=>{S.current!==A.current&&(S.current=A.current,(async()=>M.current?M.current.setBuffer(u.gaussianBuffer,u.groupIndices):M.current=new(await vTe()).Sorter(u.gaussianBuffer,u.groupIndices))())},[u.gaussianBuffer,u.groupIndices]);const C=Ee.useCallback(function(N,U,j,z){const q=a.current;if(q===null)return;N.updateMatrixWorld(!0),N.updateProjectionMatrix();const B=N.fov*Math.PI/180,G=U/j;if(q.material===void 0)return;const H=q.material.uniforms;H.near.value=N.near,H.far.value=N.far,H.viewport.value=[U,j];const W=y.current,F=x.current;p.current.length!==q.rowMajorT_camera_groups.length&&(p.current=q.rowMajorT_camera_groups.slice().fill(0));const Y=p.current,Z=N.matrixWorldInverse,V=[];let de=!1;for(const[ke,Ne]of Object.keys(e).entries()){const Ue=n.current[Ne];if(Ue===void 0)continue;b.copy(Z).multiply(Ue.matrixWorld);const ze=b.elements;W.set([ze[2],ze[6],ze[10],ze[14]],ke*4);const pe=b.transpose().elements;q.rowMajorT_camera_groups.set(pe.slice(0,12),ke*12);const Fe=Ue.visible&&Ue.parent!==null;V.push(Fe&&F[ke]===!0),F[ke]!==Fe&&(F[ke]=Fe,de=!0)}const se=!q.rowMajorT_camera_groups.every((ke,Ne)=>ke===Y[Ne]);if(se)if(z&&M.current!==null){const ke=M.current.sort(W);q.sortedIndexAttribute.set(ke),q.sortedIndexAttribute.needsUpdate=!0}else f({setTz_camera_groups:W});if(se||de){for(const[ke,Ne]of V.entries())Ne||(q.rowMajorT_camera_groups[ke*12+3]=1e10,q.rowMajorT_camera_groups[ke*12+7]=1e10,q.rowMajorT_camera_groups[ke*12+11]=1e10);Y.set(q.rowMajorT_camera_groups),q.textureT_camera_groups.needsUpdate=!0}q.material.uniforms.projectionMatrixCustom.value.copy(w.current);const oe=N.near,ue=N.far,_e=_.current;if(B!==_e.fovY||G!==_e.aspect||oe!==_e.near||ue!==_e.far){const ke=Math.tan(B/2),Ne=oe*ke,Ue=-Ne,ze=Ne*G,pe=-ze;w.current.makePerspective(pe,ze,Ne,Ue,oe,ue),_e.fovY=B,_e.aspect=G,_e.near=oe,_e.far=ue}},[e,n,b,f]);t.updateCamera.current=C,ra((R,N)=>{const U=g.current,j=a.current;if(U===null||j===null||r.current===null||j.rowMajorT_camera_groups.length===0)return;const z=j.material.uniforms;z.transitionInState.value=Math.min(z.transitionInState.value+N*2,1),C(R.camera,R.viewport.dpr*R.size.width,R.viewport.dpr*R.size.height,!1)},-100);const D=a.current;return k.jsx("mesh",{ref:g,geometry:D.geometry,material:D.material,renderOrder:1e4})}function kTe(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function DTe(t){let e=0;for(const o of Object.values(t))e+=o.length;const n=e/8,i=new Uint32Array(e),r=new Uint32Array(n);let a=0;for(const[o,l]of Object.values(t).entries()){r.fill(o,a/8,(a+l.length)/8),i.set(l,a);for(let c=0;c<l.length;c+=8)i[a+c+3]=o;a+=l.length}const s=Object.keys(t).length;return{numGaussians:n,gaussianBuffer:i,numGroups:s,groupIndices:r}}const Ls=I.createContext({folderDepth:0,setValue:()=>{},messageSender:()=>{},GuiContainer:()=>{throw new Error("GuiComponentContext not initialized")}});function aQ(t,e){if(t===e)return!0;if(!t||!e)return t===e;const n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(const r of n)if(!(r in e))return!1;return!0}var UU="_11mcxao0",sQ="_11mcxao1";function MC(t){if(t!==null){if(Array.isArray(t)){const[e,n,i]=t;return`#${e.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}return t}}function F6(t){return`rgb(${Math.round(t[0])}, ${Math.round(t[1])}, ${Math.round(t[2])})`}function B6(t){return`rgba(${Math.round(t[0])}, ${Math.round(t[1])}, ${Math.round(t[2])}, ${(t[3]/255).toFixed(4)})`}function Rx(t){const e=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(e)return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])];const n=t.match(/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/);if(n){const i=n[1];let r,a,s;return i.length===3?(r=parseInt(i[0]+i[0],16),a=parseInt(i[1]+i[1],16),s=parseInt(i[2]+i[2],16)):(r=parseInt(i.substring(0,2),16),a=parseInt(i.substring(2,4),16),s=parseInt(i.substring(4,6),16)),[r,a,s]}return null}function bE(t){const e=t.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);if(e)return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),Math.round(parseFloat(e[4])*255)];const n=t.match(/^#([0-9A-Fa-f]{3,8})$/);if(n){const r=n[1];if(r.length===4)return[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];if(r.length===8)return[parseInt(r.substring(0,2),16),parseInt(r.substring(2,4),16),parseInt(r.substring(4,6),16),parseInt(r.substring(6,8),16)]}const i=Rx(t);return i?[...i,255]:null}function kD(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function DD(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function OTe({uuid:t,props:{visible:e,disabled:n,label:i,color:r,_icon_html:a}}){const{messageSender:s}=Ee.useContext(Ls);return e??!0?k.jsx(ut,{mx:"xs",pb:"0.5em",children:k.jsx(As,{id:t,fullWidth:!0,color:MC(r),onClick:()=>s({type:"GuiUpdateMessage",uuid:t,updates:{value:!0}}),style:{height:"2em"},disabled:n??!1,size:"sm",leftSection:a===null?void 0:k.jsx("div",{className:UU,dangerouslySetInnerHTML:{__html:a}}),children:i})}):null}function Su({uuid:t,label:e,hint:n,children:i}){const{folderDepth:r}=I.useContext(Ls);return n!=null&&(i=k.jsx(Or,{zIndex:100,label:n,multiline:!0,style:{width:"15rem"},withArrow:!0,openDelay:500,withinPortal:!0,children:k.jsx(ut,{children:i})})),e!==void 0&&(i=k.jsx(ITe,{uuid:t,label:e,input:i,folderDepth:r})),k.jsx(ut,{pb:"0.5em",px:"xs",children:i})}function ITe(t){return k.jsxs(ph,{align:"center",children:[k.jsx(ut,{pr:"xs",style:{width:`${7.25-t.folderDepth*.6375}em`,flexShrink:0,position:"relative"},children:k.jsx(hu,{c:"dimmed",style:{fontSize:"0.875em",fontWeight:"450",lineHeight:"1.375em",letterSpacing:"-0.75px",width:"100%",boxSizing:"content-box"},unselectable:"off",children:k.jsx("label",{htmlFor:t.uuid,children:t.label})})}),k.jsx(ut,{style:{flexGrow:1},children:t.input})]})}function oQ(t){return k.jsx(ph,{justify:"space-between",columnGap:"0.5em",children:[...Array(t.n).keys()].map(e=>k.jsx(ag,{id:e===0?t.uuid:void 0,value:t.value[e],onChange:n=>{const i=[...t.value];i[e]=n===""?0:Number(n),t.onChange(i)},size:"xs",styles:{root:{flexGrow:1,width:0},input:{paddingLeft:"0.5em",paddingRight:"1.75em",textAlign:"right",height:"1.875em",minHeight:"1.875em"},controls:{height:"1.25em",width:"0.825em"}},rightSectionWidth:"1em",decimalScale:t.precision,step:t.step,min:t.min===null?void 0:t.min[e],max:t.max===null?void 0:t.max[e],stepHoldDelay:500,stepHoldInterval:n=>Math.max(1e3/n**2,25),disabled:t.disabled},e))})}function NTe({uuid:t,value:e,props:{label:n,hint:i,visible:r,disabled:a,min:s,max:o,precision:l,step:c,_marks:u}}){const{setValue:f}=Ee.useContext(Ls);if(!r)return null;const h=g=>f(t,g),d=k.jsxs(ph,{justify:"space-between",children:[k.jsx(OA,{id:t,className:u===null?sQ:void 0,size:"xs",thumbSize:0,radius:"xs",style:{flexGrow:1},styles:g=>({thumb:{height:"0.75rem",width:"0.5rem",background:g.colors[g.primaryColor][6]},trackContainer:{zIndex:3,position:"relative"},markLabel:{transform:"translate(-50%, 0.05rem)",fontSize:"0.6rem",textAlign:"center"},mark:{transform:"scale(2)"}}),pt:"0.3em",pb:"0.2em",showLabelOnHover:!1,min:s,max:o,step:c??void 0,precision:l,value:e,onChange:h,marks:u===null?[{value:s,label:`${s.toFixed(6).replace(/\.?0+$/,"")}`},{value:o,label:`${o.toFixed(6).replace(/\.?0+$/,"")}`}]:u,disabled:a}),k.jsx(ag,{value:e,onChange:g=>{g!==""&&h(Number(g))},size:"xs",min:s,max:o,hideControls:!0,step:c??void 0,style:{width:"3rem"},styles:{input:{padding:"0.375em",letterSpacing:"-0.5px",minHeight:"1.875em",height:"1.875em"}},ml:"xs"})]});return k.jsx(Su,{uuid:t,hint:i,label:n,children:d})}function LTe({uuid:t,value:e,props:{visible:n,label:i,hint:r,disabled:a,precision:s,min:o,max:l,step:c}}){const{setValue:u}=I.useContext(Ls);return n?k.jsx(Su,{uuid:t,hint:r,label:i,children:k.jsx(ag,{id:t,value:e,decimalScale:s,min:o??void 0,max:l??void 0,step:c,size:"xs",onChange:f=>{f!==""&&u(t,f)},styles:{input:{minHeight:"1.625rem",height:"1.625rem"},controls:{height:"1.625em",width:"0.825em"}},disabled:a,stepHoldDelay:500,stepHoldInterval:f=>Math.max(1e3/f**2,25)})}):null}function PTe({uuid:t,value:e,props:{hint:n,label:i,disabled:r,visible:a,multiline:s}}){const{setValue:o}=I.useContext(Ls);return a?k.jsx(Su,{uuid:t,hint:n,label:i,children:s?k.jsx(yA,{value:e,size:"xs",onChange:l=>{o(t,l.target.value)},styles:{input:{padding:"0 0.5em"}},disabled:r,minRows:2,maxRows:6,autosize:!0,resize:"vertical"}):k.jsx(og,{value:e,size:"xs",onChange:l=>{o(t,l.target.value)},styles:{input:{minHeight:"1.625rem",height:"1.625rem",padding:"0 0.5em"}},disabled:r})}):null}function UTe({uuid:t,value:e,props:{disabled:n,visible:i,hint:r,label:a}}){const{setValue:s}=I.useContext(Ls);if(!i)return null;let o=k.jsx(mh,{id:t,checked:e,size:"xs",onChange:l=>{s(t,l.target.checked)},disabled:n});return r!=null&&(o=k.jsx(Or,{zIndex:100,label:r,multiline:!0,style:{width:"15rem"},withArrow:!0,openDelay:500,withinPortal:!0,children:k.jsx(ut,{style:{display:"inline-block"},children:o})})),k.jsx(Su,{uuid:t,label:a,children:o})}function FTe({uuid:t,value:e,props:{hint:n,label:i,visible:r,disabled:a,min:s,max:o,step:l,precision:c}}){const{setValue:u}=I.useContext(Ls);return r?k.jsx(Su,{uuid:t,hint:n,label:i,children:k.jsx(oQ,{uuid:t,n:2,value:e,onChange:f=>u(t,f),min:s,max:o,step:l,precision:c,disabled:a})}):null}function BTe({uuid:t,value:e,props:{hint:n,label:i,visible:r,disabled:a,min:s,max:o,step:l,precision:c}}){const{setValue:u}=I.useContext(Ls);return r?k.jsx(Su,{uuid:t,hint:n,label:i,children:k.jsx(oQ,{uuid:t,n:3,value:e,onChange:f=>u(t,f),min:s,max:o,step:l,precision:c,disabled:a})}):null}function zTe({uuid:t,value:e,props:{hint:n,label:i,disabled:r,visible:a,options:s}}){const{setValue:o}=I.useContext(Ls);return a?k.jsx(Su,{uuid:t,hint:n,label:i,children:k.jsx(Pv,{id:t,radius:"xs",value:e,data:s,onChange:l=>l!==null&&o(t,l),disabled:r,searchable:!0,maxDropdownHeight:400,size:"xs",rightSectionWidth:"1.2em",styles:{input:{padding:"0.5em",letterSpacing:"-0.5px",minHeight:"1.625rem",height:"1.625rem"}},comboboxProps:{zIndex:1e3}})}):null}/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var jTe={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ki=(t,e,n,i)=>{const r=I.forwardRef(({color:a="currentColor",size:s=24,stroke:o=2,title:l,className:c,children:u,...f},h)=>I.createElement("svg",{ref:h,...jTe[t],width:s,height:s,className:["tabler-icon",`tabler-icon-${e}`,c].join(" "),...t==="filled"?{fill:a}:{strokeWidth:o,stroke:a},...f},[l&&I.createElement("title",{key:"svg-title"},l),...i.map(([d,g])=>I.createElement(d,g)),...Array.isArray(u)?u:[u]]));return r.displayName=`${n}`,r};/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const HTe=[["path",{d:"M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M6 4v4",key:"svg-1"}],["path",{d:"M6 12v8",key:"svg-2"}],["path",{d:"M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-3"}],["path",{d:"M12 4v10",key:"svg-4"}],["path",{d:"M12 18v2",key:"svg-5"}],["path",{d:"M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M18 4v1",key:"svg-7"}],["path",{d:"M18 9v11",key:"svg-8"}]],VTe=Ki("outline","adjustments","Adjustments",HTe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const GTe=[["path",{d:"M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1",key:"svg-0"}]],WTe=Ki("outline","arrow-back","ArrowBack",GTe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const qTe=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],XTe=Ki("outline","brand-github","BrandGithub",qTe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const KTe=[["path",{d:"M6 10l6 6l6 -6h-12",key:"svg-0"}]],YTe=Ki("outline","caret-down","CaretDown",KTe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const JTe=[["path",{d:"M10 18l6 -6l-6 -6v12",key:"svg-0"}]],$Te=Ki("outline","caret-right","CaretRight",JTe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZTe=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],FU=Ki("outline","check","Check",ZTe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const QTe=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],eAe=Ki("outline","chevron-down","ChevronDown",QTe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const tAe=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],nAe=Ki("outline","chevron-left","ChevronLeft",tAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const iAe=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],rAe=Ki("outline","chevron-right","ChevronRight",iAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const aAe=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],sAe=Ki("outline","chevron-up","ChevronUp",aAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const oAe=[["path",{d:"M11 18.004h-4.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.388 0 2.585 .82 3.138 2.007",key:"svg-0"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-1"}]],lAe=Ki("outline","cloud-check","CloudCheck",oAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const cAe=[["path",{d:"M11 7l6 6",key:"svg-0"}],["path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z",key:"svg-1"}]],lQ=Ki("outline","color-picker","ColorPicker",cAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const uAe=[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],fAe=Ki("outline","copy","Copy",uAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const hAe=[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]],dAe=Ki("outline","device-floppy","DeviceFloppy",hAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const pAe=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],mAe=Ki("outline","download","Download",pAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const gAe=[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],bAe=Ki("outline","eye-off","EyeOff",gAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const vAe=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M13.048 17.942a9.298 9.298 0 0 1 -1.048 .058c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6a17.986 17.986 0 0 1 -1.362 1.975",key:"svg-1"}],["path",{d:"M22 22l-5 -5",key:"svg-2"}],["path",{d:"M17 22l5 -5",key:"svg-3"}]],yAe=Ki("outline","eye-x","EyeX",vAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const xAe=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],_Ae=Ki("outline","eye","Eye",xAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const SAe=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 17h6",key:"svg-2"}],["path",{d:"M9 13h6",key:"svg-3"}]],wAe=Ki("outline","file-description","FileDescription",SAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const EAe=[["path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2",key:"svg-0"}],["path",{d:"M19 12h2l-9 -9l-9 9h2v7a2 2 0 0 0 2 2h5.5",key:"svg-1"}],["path",{d:"M16 19h6",key:"svg-2"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-3"}]],MAe=Ki("outline","home-move","HomeMove",EAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const TAe=[["path",{d:"M2 6m0 2a2 2 0 0 1 2 -2h16a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-16a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M6 10l0 .01",key:"svg-1"}],["path",{d:"M10 10l0 .01",key:"svg-2"}],["path",{d:"M14 10l0 .01",key:"svg-3"}],["path",{d:"M18 10l0 .01",key:"svg-4"}],["path",{d:"M6 14l0 .01",key:"svg-5"}],["path",{d:"M18 14l0 .01",key:"svg-6"}],["path",{d:"M10 14l4 .01",key:"svg-7"}]],AAe=Ki("outline","keyboard","Keyboard",TAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const CAe=[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}]],cQ=Ki("outline","maximize","Maximize",CAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const RAe=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],kAe=Ki("outline","pencil","Pencil",RAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const DAe=[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]],OAe=Ki("outline","photo","Photo",DAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const IAe=[["path",{d:"M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-1"}]],NAe=Ki("outline","player-pause","PlayerPause",IAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const LAe=[["path",{d:"M20 16l-4 4",key:"svg-0"}],["path",{d:"M7 12l5 5l-1.5 1.5a3.536 3.536 0 1 1 -5 -5l1.5 -1.5z",key:"svg-1"}],["path",{d:"M17 12l-5 -5l1.5 -1.5a3.536 3.536 0 1 1 5 5l-1.5 1.5z",key:"svg-2"}],["path",{d:"M3 21l2.5 -2.5",key:"svg-3"}],["path",{d:"M18.5 5.5l2.5 -2.5",key:"svg-4"}],["path",{d:"M10 11l-2 2",key:"svg-5"}],["path",{d:"M13 14l-2 2",key:"svg-6"}],["path",{d:"M16 16l4 4",key:"svg-7"}]],PAe=Ki("outline","plug-connected-x","PlugConnectedX",LAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const UAe=[["path",{d:"M8 4h1a1 1 0 0 1 1 1v1m-.297 3.711a1 1 0 0 1 -.703 .289h-4a1 1 0 0 1 -1 -1v-4c0 -.275 .11 -.524 .29 -.705",key:"svg-0"}],["path",{d:"M7 17v.01",key:"svg-1"}],["path",{d:"M14 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M7 7v.01",key:"svg-3"}],["path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M17 7v.01",key:"svg-5"}],["path",{d:"M20 14v.01",key:"svg-6"}],["path",{d:"M14 14v3",key:"svg-7"}],["path",{d:"M14 20h3",key:"svg-8"}],["path",{d:"M3 3l18 18",key:"svg-9"}]],FAe=Ki("outline","qrcode-off","QrcodeOff",UAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const BAe=[["path",{d:"M4 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M7 17l0 .01",key:"svg-1"}],["path",{d:"M14 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M7 7l0 .01",key:"svg-3"}],["path",{d:"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M17 7l0 .01",key:"svg-5"}],["path",{d:"M14 14l3 0",key:"svg-6"}],["path",{d:"M20 14l0 .01",key:"svg-7"}],["path",{d:"M14 14l0 3",key:"svg-8"}],["path",{d:"M14 20l3 0",key:"svg-9"}],["path",{d:"M17 17l3 0",key:"svg-10"}],["path",{d:"M20 17l0 3",key:"svg-11"}]],zAe=Ki("outline","qrcode","Qrcode",BAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const jAe=[["path",{d:"M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}],["path",{d:"M8.7 10.7l6.6 -3.4",key:"svg-3"}],["path",{d:"M8.7 13.3l6.6 3.4",key:"svg-4"}]],HAe=Ki("outline","share","Share",jAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const VAe=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],GAe=Ki("outline","x","X",VAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const WAe=[["path",{d:"M9 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z",key:"svg-0"}],["path",{d:"M17 4h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h2a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2z",key:"svg-1"}]],qAe=Ki("filled","player-pause-filled","PlayerPauseFilled",WAe);/**
 * @license @tabler/icons-react v3.35.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const XAe=[["path",{d:"M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z",key:"svg-0"}]],KAe=Ki("filled","player-play-filled","PlayerPlayFilled",XAe);function YAe({uuid:t,value:e,props:{label:n,hint:i,disabled:r,visible:a}}){const{setValue:s}=I.useContext(Ls),[o,l]=I.useState(F6(e));return I.useEffect(()=>{const c=Rx(o);(!c||!kD(c,e))&&l(F6(e))},[e]),a?k.jsx(Su,{uuid:t,hint:i,label:n,children:k.jsx(Nv,{disabled:r,size:"xs",value:o,format:"rgb",eyeDropperIcon:k.jsx(lQ,{size:18,stroke:1.5}),popoverProps:{zIndex:1e3},styles:{input:{height:"1.625rem",minHeight:"1.625rem"}},onChange:c=>{if(l(c),c.startsWith("rgb(")){const u=Rx(c);u&&!kD(u,e)&&s(t,u)}},onKeyDown:c=>{if(c.key==="Enter"){const u=Rx(o);u&&s(t,u)}},onBlur:()=>{const c=Rx(o);c&&!kD(c,e)&&s(t,c)}})}):null}function JAe({uuid:t,value:e,props:{label:n,hint:i,disabled:r,visible:a}}){const{setValue:s}=I.useContext(Ls),[o,l]=I.useState(B6(e));return I.useEffect(()=>{const c=bE(o);(!c||!DD(c,e))&&l(B6(e))},[e,o]),a?k.jsx(Su,{uuid:t,hint:i,label:n,children:k.jsx(Nv,{disabled:r,size:"xs",value:o,format:"rgba",eyeDropperIcon:k.jsx(lQ,{size:18,stroke:1.5}),popoverProps:{zIndex:1e3},styles:{input:{height:"1.625rem",minHeight:"1.625rem"}},onChange:c=>{if(l(c),c.startsWith("rgba(")){const u=bE(c);u&&!DD(u,e)&&s(t,u)}},onKeyDown:c=>{if(c.key==="Enter"){const u=bE(o);u&&s(t,u)}},onBlur:()=>{const c=bE(o);c&&!DD(c,e)&&s(t,c)}})}):null}function $Ae({uuid:t,props:{hint:e,label:n,visible:i,disabled:r,options:a}}){const{messageSender:s}=I.useContext(Ls);return i?k.jsx(Su,{uuid:t,hint:e,label:n,children:k.jsx(ph,{justify:"space-between",columnGap:"xs",children:a.map((o,l)=>k.jsx(As,{onClick:()=>s({type:"GuiUpdateMessage",uuid:t,updates:{value:o}}),style:{flexGrow:1,wuuidth:0},disabled:r,size:"compact-xs",variant:"outline",children:o},l))})}):null}const SI={},uQ=Ee.createContext(SI);function fQ(t){const e=Ee.useContext(uQ);return Ee.useMemo(function(){return typeof t=="function"?t(e):{...e,...t}},[e,t])}function ZAe(t){let e;return t.disableParentContext?e=typeof t.components=="function"?t.components(SI):t.components||SI:e=fQ(t.components),Ee.createElement(uQ.Provider,{value:e},t.children)}const QAe=Object.freeze(Object.defineProperty({__proto__:null,MDXProvider:ZAe,useMDXComponents:fQ},Symbol.toStringTag,{value:"Module"}));function bc(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?z6(t.position):"start"in t||"end"in t?z6(t):"line"in t||"column"in t?wI(t):""}function wI(t){return j6(t&&t.line)+":"+j6(t&&t.column)}function z6(t){return wI(t&&t.start)+"-"+wI(t&&t.end)}function j6(t){return t&&typeof t=="number"?t:1}class tr extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof e=="string"?r=e:!a.cause&&e&&(s=!0,r=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?a.ruleId=i:(a.source=i.slice(0,l),a.ruleId=i.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=bc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tr.prototype.file="";tr.prototype.name="";tr.prototype.reason="";tr.prototype.message="";tr.prototype.stack="";tr.prototype.column=void 0;tr.prototype.line=void 0;tr.prototype.ancestors=void 0;tr.prototype.cause=void 0;tr.prototype.fatal=void 0;tr.prototype.place=void 0;tr.prototype.ruleId=void 0;tr.prototype.source=void 0;const Uu={basename:eCe,dirname:tCe,extname:nCe,join:iCe,sep:"/"};function eCe(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');eS(t);let n=0,i=-1,r=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(a){n=r+1;break}}else i<0&&(a=!0,i=r+1);return i<0?"":t.slice(n,i)}if(e===t)return"";let s=-1,o=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(a){n=r+1;break}}else s<0&&(a=!0,s=r+1),o>-1&&(t.codePointAt(r)===e.codePointAt(o--)?o<0&&(i=r):(o=-1,i=s));return n===i?i=s:i<0&&(i=t.length),t.slice(n,i)}function tCe(t){if(eS(t),t.length===0)return".";let e=-1,n=t.length,i;for(;--n;)if(t.codePointAt(n)===47){if(i){e=n;break}}else i||(i=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function nCe(t){eS(t);let e=t.length,n=-1,i=0,r=-1,a=0,s;for(;e--;){const o=t.codePointAt(e);if(o===47){if(s){i=e+1;break}continue}n<0&&(s=!0,n=e+1),o===46?r<0?r=e:a!==1&&(a=1):r>-1&&(a=-1)}return r<0||n<0||a===0||a===1&&r===n-1&&r===i+1?"":t.slice(r,n)}function iCe(...t){let e=-1,n;for(;++e<t.length;)eS(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":rCe(n)}function rCe(t){eS(t);const e=t.codePointAt(0)===47;let n=aCe(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function aCe(t,e){let n="",i=0,r=-1,a=0,s=-1,o,l;for(;++s<=t.length;){if(s<t.length)o=t.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(r===s-1||a===1))if(r!==s-1&&a===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",i=0):(n=n.slice(0,l),i=n.length-1-n.lastIndexOf("/")),r=s,a=0;continue}}else if(n.length>0){n="",i=0,r=s,a=0;continue}}e&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(r+1,s):n=t.slice(r+1,s),i=s-r-1;r=s,a=0}else o===46&&a>-1?a++:a=-1}return n}function eS(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const sCe={cwd:oCe};function oCe(){return"/"}function EI(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function lCe(t){if(typeof t=="string")t=new URL(t);else if(!EI(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return cCe(t)}function cCe(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const i=e.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const OD=["history","path","basename","stem","extname","dirname"];class hQ{constructor(e){let n;e?EI(e)?n={path:e}:typeof e=="string"||uCe(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":sCe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<OD.length;){const a=OD[i];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let r;for(r in n)OD.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?Uu.basename(this.path):void 0}set basename(e){ND(e,"basename"),ID(e,"basename"),this.path=Uu.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Uu.dirname(this.path):void 0}set dirname(e){H6(this.basename,"dirname"),this.path=Uu.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Uu.extname(this.path):void 0}set extname(e){if(ID(e,"extname"),H6(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Uu.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){EI(e)&&(e=lCe(e)),ND(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Uu.basename(this.path,this.extname):void 0}set stem(e){ND(e,"stem"),ID(e,"stem"),this.path=Uu.join(this.dirname||"",e+(this.extname||""))}fail(e,n,i){const r=this.message(e,n,i);throw r.fatal=!0,r}info(e,n,i){const r=this.message(e,n,i);return r.fatal=void 0,r}message(e,n,i){const r=new tr(e,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function ID(t,e){if(t&&t.includes(Uu.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Uu.sep+"`")}function ND(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function H6(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function uCe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const fCe=["md","markdown","mdown","mkdn","mkd","mdwn","mkdown","ron"],hCe=fCe.map(function(t){return"."+t});function dCe(t,e){const n=pCe(t)?t:new hQ(t),{format:i,...r}=e||{};return{file:n,options:{format:i==="md"||i==="mdx"?i:n.extname&&(r.mdExtensions||hCe).includes(n.extname)?"md":"mdx",...r}}}function pCe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}const mCe=/[$_\p{ID_Start}]/u,gCe=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,bCe=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,vCe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yCe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dQ={};function Gc(t){return t?mCe.test(String.fromCodePoint(t)):!1}function ax(t,e){const i=(e||dQ).jsx?bCe:gCe;return t?i.test(String.fromCodePoint(t)):!1}function ef(t,e){return((e||dQ).jsx?yCe:vCe).test(t)}class xCe{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:e=>this.replacement=e}}replace(e,n,i,r){e&&n&&(i!=null?e[n][i]=r:e[n]=r)}remove(e,n,i){e&&n&&(i!=null?e[n].splice(i,1):delete e[n])}}class _Ce extends xCe{constructor(e,n){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:i=>this.replacement=i},this.enter=e,this.leave=n}visit(e,n,i,r){if(e){if(this.enter){const s=this.should_skip,o=this.should_remove,l=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,e,n,i,r),this.replacement&&(e=this.replacement,this.replace(n,i,r,e)),this.should_remove&&this.remove(n,i,r);const c=this.should_skip,u=this.should_remove;if(this.should_skip=s,this.should_remove=o,this.replacement=l,c)return e;if(u)return null}let a;for(a in e){const s=e[a];if(s&&typeof s=="object")if(Array.isArray(s)){const o=s;for(let l=0;l<o.length;l+=1){const c=o[l];V6(c)&&(this.visit(c,e,a,l)||l--)}}else V6(s)&&this.visit(s,e,a,null)}if(this.leave){const s=this.replacement,o=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,e,n,i,r),this.replacement&&(e=this.replacement,this.replace(n,i,r,e)),this.should_remove&&this.remove(n,i,r);const l=this.should_remove;if(this.replacement=s,this.should_remove=o,l)return null}}return e}}function V6(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"}function S0(t,{enter:e,leave:n}){return new _Ce(e,n).visit(t,null)}const LD=/@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g;function SCe(t,e){const n=e||{};let i=n.runtime==="automatic";const r={},a={};S0(t,{enter(s){if(s.type==="Program"){const o=s.comments||[];let l=-1;for(;++l<o.length;){LD.lastIndex=0;let c=LD.exec(o[l].value);for(;c;)r[c[1]]=c[2],c=LD.exec(o[l].value)}if(r.jsxRuntime)if(r.jsxRuntime==="automatic"){if(i=!0,r.jsx)throw new Error("Unexpected `@jsx` pragma w/ automatic runtime");if(r.jsxFrag)throw new Error("Unexpected `@jsxFrag` pragma w/ automatic runtime")}else if(r.jsxRuntime==="classic"){if(i=!1,r.jsxImportSource)throw new Error("Unexpected `@jsxImportSource` w/ classic runtime")}else throw new Error("Unexpected `jsxRuntime` `"+r.jsxRuntime+"`, expected `automatic` or `classic`")}},leave(s){if(s.type==="Program"){const b=[];if(a.fragment&&b.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"Fragment"},local:{type:"Identifier",name:"_Fragment"}}),a.jsx&&b.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsx"},local:{type:"Identifier",name:"_jsx"}}),a.jsxs&&b.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsxs"},local:{type:"Identifier",name:"_jsxs"}}),a.jsxDEV&&b.push({type:"ImportSpecifier",imported:{type:"Identifier",name:"jsxDEV"},local:{type:"Identifier",name:"_jsxDEV"}}),b.length>0){let y=0;for(;y<s.body.length;){const p=s.body[y];if("directive"in p&&p.directive)y++;else break}s.body.splice(y,0,{type:"ImportDeclaration",specifiers:b,source:{type:"Literal",value:(r.jsxImportSource||n.importSource||"react")+(n.development?"/jsx-dev-runtime":"/jsx-runtime")}})}}if(s.type!=="JSXElement"&&s.type!=="JSXFragment")return;const o=[];let l=-1;for(;++l<s.children.length;){const b=s.children[l];if(b.type==="JSXExpressionContainer")b.expression.type!=="JSXEmptyExpression"&&o.push(b.expression);else if(b.type==="JSXText"){const y=b.value.replace(/\t/g," ").replace(/ *(\r?\n|\r) */g,`
`).replace(/\n+/g,`
`).replace(/\n+$/,"").replace(/^\n+/,"").replace(/\n/g," ");if(y){const p={type:"Literal",value:y};f1(b,p),o.push(p)}}else b.type!=="JSXElement"&&b.type!=="JSXFragment"&&b.type,o.push(b)}let c;const u=[];let f=[],h;if(s.type==="JSXElement"){if(c=cT(s.openingElement.name),c.type==="Identifier"&&/^[a-z]/.test(c.name)){const x={type:"Literal",value:c.name};f1(c,x),c=x}let b;const y=s.openingElement.attributes;let p=-1;for(;++p<y.length;){const x=y[p];if(x.type==="JSXSpreadAttribute")x.argument.type==="ObjectExpression"?u.push(...x.argument.properties):u.push({type:"SpreadElement",argument:x.argument}),b=!0;else{const _=wCe(x);if(i&&_.key.type==="Identifier"&&_.key.name==="key"){if(b)throw new Error("Expected `key` to come before any spread expressions");const w=_.value;w.type!=="AssignmentPattern"&&w.type!=="ArrayPattern"&&w.type!=="ObjectPattern"&&w.type,h=w}else u.push(_)}}}else i?(a.fragment=!0,c={type:"Identifier",name:"_Fragment"}):c=G6(r.jsxFrag||n.pragmaFrag||"React.Fragment");i?o.length>0&&u.push({type:"Property",key:{type:"Identifier",name:"children"},value:o.length>1?{type:"ArrayExpression",elements:o}:o[0],kind:"init",method:!1,shorthand:!1,computed:!1}):f=o;let d;if(i){f.push({type:"ObjectExpression",properties:u}),h?f.push(h):n.development&&f.push({type:"Identifier",name:"undefined"});const b=o.length>1;if(n.development){a.jsxDEV=!0,d={type:"Identifier",name:"_jsxDEV"},f.push({type:"Literal",value:b});const y={type:"ObjectExpression",properties:[{type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"fileName"},value:{type:"Literal",value:n.filePath||"<source.js>"}}]};s.loc&&y.properties.push({type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"lineNumber"},value:{type:"Literal",value:s.loc.start.line}},{type:"Property",method:!1,shorthand:!1,computed:!1,kind:"init",key:{type:"Identifier",name:"columnNumber"},value:{type:"Literal",value:s.loc.start.column+1}}),f.push(y,{type:"ThisExpression"})}else b?(a.jsxs=!0,d={type:"Identifier",name:"_jsxs"}):(a.jsx=!0,d={type:"Identifier",name:"_jsx"})}else u.length>0?f.unshift({type:"ObjectExpression",properties:u}):f.length>0&&f.unshift({type:"Literal",value:null}),d=G6(r.jsx||n.pragma||"React.createElement");f.unshift(c);const g={type:"CallExpression",callee:d,arguments:f,optional:!1};f1(s,g),this.replace(g)}})}function wCe(t){let e;if(t.value)if(t.value.type==="JSXExpressionContainer"){const i=t.value.expression;i.type,e=i}else{const i=t.value;i.type!=="JSXElement"&&i.type,e=i,delete e.raw}else e={type:"Literal",value:!0};const n={type:"Property",key:cT(t.name),value:e,kind:"init",method:!1,shorthand:!1,computed:!1};return f1(t,n),n}function cT(t){let e;if(t.type==="JSXMemberExpression"){const n=cT(t.property);e={type:"MemberExpression",object:cT(t.object),property:n,computed:n.type==="Literal",optional:!1}}else t.type==="JSXNamespacedName"?e={type:"Literal",value:t.namespace.name+":"+t.name.name}:e=ef(t.name)?{type:"Identifier",name:t.name}:{type:"Literal",value:t.name};return f1(t,e),e}function G6(t){const e=t.split(".");let n=-1,i;for(;++n<e.length;){const r=ef(e[n])?{type:"Identifier",name:e[n]}:{type:"Literal",value:e[n]};i=i?{type:"MemberExpression",object:i,property:r,computed:!!(n&&r.type==="Literal"),optional:!1}:r}return i}function f1(t,e){const n=["start","end","loc","range","comments"];let i=-1;for(;++i<n.length;){const r=n[i];r in t&&(e[r]=t[r])}}function ECe(t){return function(e,n){SCe(e,{filePath:n.history[0],...t})}}var pQ={exports:{}},MCe={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},vE={exports:{}},W6;function MI(){return W6||(W6=1,function(t,e){(function(n,i){i(e)})(Nm,function(n){var i=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],r=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],a="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏０-９＿･",s="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ",o={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},l="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",c={5:l,"5module":l+" export import",6:l+" const class extends export import super"},u=/^in(stanceof)?$/,f=new RegExp("["+s+"]"),h=new RegExp("["+s+a+"]");function d(E,L){for(var J=65536,ne=0;ne<L.length;ne+=2){if(J+=L[ne],J>E)return!1;if(J+=L[ne+1],J>=E)return!0}return!1}function g(E,L){return E<65?E===36:E<91?!0:E<97?E===95:E<123?!0:E<=65535?E>=170&&f.test(String.fromCharCode(E)):L===!1?!1:d(E,r)}function b(E,L){return E<48?E===36:E<58?!0:E<65?!1:E<91?!0:E<97?E===95:E<123?!0:E<=65535?E>=170&&h.test(String.fromCharCode(E)):L===!1?!1:d(E,r)||d(E,i)}var y=function(L,J){J===void 0&&(J={}),this.label=L,this.keyword=J.keyword,this.beforeExpr=!!J.beforeExpr,this.startsExpr=!!J.startsExpr,this.isLoop=!!J.isLoop,this.isAssign=!!J.isAssign,this.prefix=!!J.prefix,this.postfix=!!J.postfix,this.binop=J.binop||null,this.updateContext=null};function p(E,L){return new y(E,{beforeExpr:!0,binop:L})}var x={beforeExpr:!0},_={startsExpr:!0},w={};function M(E,L){return L===void 0&&(L={}),L.keyword=E,w[E]=new y(E,L)}var S={num:new y("num",_),regexp:new y("regexp",_),string:new y("string",_),name:new y("name",_),privateId:new y("privateId",_),eof:new y("eof"),bracketL:new y("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new y("]"),braceL:new y("{",{beforeExpr:!0,startsExpr:!0}),braceR:new y("}"),parenL:new y("(",{beforeExpr:!0,startsExpr:!0}),parenR:new y(")"),comma:new y(",",x),semi:new y(";",x),colon:new y(":",x),dot:new y("."),question:new y("?",x),questionDot:new y("?."),arrow:new y("=>",x),template:new y("template"),invalidTemplate:new y("invalidTemplate"),ellipsis:new y("...",x),backQuote:new y("`",_),dollarBraceL:new y("${",{beforeExpr:!0,startsExpr:!0}),eq:new y("=",{beforeExpr:!0,isAssign:!0}),assign:new y("_=",{beforeExpr:!0,isAssign:!0}),incDec:new y("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new y("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:p("||",1),logicalAND:p("&&",2),bitwiseOR:p("|",3),bitwiseXOR:p("^",4),bitwiseAND:p("&",5),equality:p("==/!=/===/!==",6),relational:p("</>/<=/>=",7),bitShift:p("<</>>/>>>",8),plusMin:new y("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:p("%",10),star:p("*",10),slash:p("/",10),starstar:new y("**",{beforeExpr:!0}),coalesce:p("??",1),_break:M("break"),_case:M("case",x),_catch:M("catch"),_continue:M("continue"),_debugger:M("debugger"),_default:M("default",x),_do:M("do",{isLoop:!0,beforeExpr:!0}),_else:M("else",x),_finally:M("finally"),_for:M("for",{isLoop:!0}),_function:M("function",_),_if:M("if"),_return:M("return",x),_switch:M("switch"),_throw:M("throw",x),_try:M("try"),_var:M("var"),_const:M("const"),_while:M("while",{isLoop:!0}),_with:M("with"),_new:M("new",{beforeExpr:!0,startsExpr:!0}),_this:M("this",_),_super:M("super",_),_class:M("class",_),_extends:M("extends",x),_export:M("export"),_import:M("import",_),_null:M("null",_),_true:M("true",_),_false:M("false",_),_in:M("in",{beforeExpr:!0,binop:7}),_instanceof:M("instanceof",{beforeExpr:!0,binop:7}),_typeof:M("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:M("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:M("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},A=/\r\n?|\n|\u2028|\u2029/,C=new RegExp(A.source,"g");function D(E){return E===10||E===13||E===8232||E===8233}function R(E,L,J){J===void 0&&(J=E.length);for(var ne=L;ne<J;ne++){var xe=E.charCodeAt(ne);if(D(xe))return ne<J-1&&xe===13&&E.charCodeAt(ne+1)===10?ne+2:ne+1}return-1}var N=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,U=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,j=Object.prototype,z=j.hasOwnProperty,q=j.toString,B=Object.hasOwn||function(E,L){return z.call(E,L)},G=Array.isArray||function(E){return q.call(E)==="[object Array]"},H=Object.create(null);function W(E){return H[E]||(H[E]=new RegExp("^(?:"+E.replace(/ /g,"|")+")$"))}function F(E){return E<=65535?String.fromCharCode(E):(E-=65536,String.fromCharCode((E>>10)+55296,(E&1023)+56320))}var Y=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Z=function(L,J){this.line=L,this.column=J};Z.prototype.offset=function(L){return new Z(this.line,this.column+L)};var V=function(L,J,ne){this.start=J,this.end=ne,L.sourceFile!==null&&(this.source=L.sourceFile)};function de(E,L){for(var J=1,ne=0;;){var xe=R(E,ne,L);if(xe<0)return new Z(J,L-ne);++J,ne=xe}}var se={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},oe=!1;function ue(E){var L={};for(var J in se)L[J]=E&&B(E,J)?E[J]:se[J];if(L.ecmaVersion==="latest"?L.ecmaVersion=1e8:L.ecmaVersion==null?(!oe&&typeof console=="object"&&console.warn&&(oe=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
Defaulting to 2020, but this will stop working in the future.`)),L.ecmaVersion=11):L.ecmaVersion>=2015&&(L.ecmaVersion-=2009),L.allowReserved==null&&(L.allowReserved=L.ecmaVersion<5),(!E||E.allowHashBang==null)&&(L.allowHashBang=L.ecmaVersion>=14),G(L.onToken)){var ne=L.onToken;L.onToken=function(xe){return ne.push(xe)}}return G(L.onComment)&&(L.onComment=_e(L,L.onComment)),L}function _e(E,L){return function(J,ne,xe,Ke,et,Lt){var zt={type:J?"Block":"Line",value:ne,start:xe,end:Ke};E.locations&&(zt.loc=new V(this,et,Lt)),E.ranges&&(zt.range=[xe,Ke]),L.push(zt)}}var ke=1,Ne=2,Ue=4,ze=8,pe=16,Fe=32,Ie=64,qe=128,we=256,Te=512,Ae=ke|Ne|we;function Pe(E,L){return Ne|(E?Ue:0)|(L?ze:0)}var He=0,$e=1,ie=2,K=3,ce=4,fe=5,me=function(L,J,ne){this.options=L=ue(L),this.sourceFile=L.sourceFile,this.keywords=W(c[L.ecmaVersion>=6?6:L.sourceType==="module"?"5module":5]);var xe="";L.allowReserved!==!0&&(xe=o[L.ecmaVersion>=6?6:L.ecmaVersion===5?5:3],L.sourceType==="module"&&(xe+=" await")),this.reservedWords=W(xe);var Ke=(xe?xe+" ":"")+o.strict;this.reservedWordsStrict=W(Ke),this.reservedWordsStrictBind=W(Ke+" "+o.strictBind),this.input=String(J),this.containsEsc=!1,ne?(this.pos=ne,this.lineStart=this.input.lastIndexOf(`
`,ne-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(A).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=S.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=L.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&L.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(ke),this.regexpState=null,this.privateNameStack=[]},$={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};me.prototype.parse=function(){var L=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(L)},$.inFunction.get=function(){return(this.currentVarScope().flags&Ne)>0},$.inGenerator.get=function(){return(this.currentVarScope().flags&ze)>0},$.inAsync.get=function(){return(this.currentVarScope().flags&Ue)>0},$.canAwait.get=function(){for(var E=this.scopeStack.length-1;E>=0;E--){var L=this.scopeStack[E],J=L.flags;if(J&(we|Te))return!1;if(J&Ne)return(J&Ue)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},$.allowSuper.get=function(){var E=this.currentThisScope(),L=E.flags;return(L&Ie)>0||this.options.allowSuperOutsideMethod},$.allowDirectSuper.get=function(){return(this.currentThisScope().flags&qe)>0},$.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},$.allowNewDotTarget.get=function(){for(var E=this.scopeStack.length-1;E>=0;E--){var L=this.scopeStack[E],J=L.flags;if(J&(we|Te)||J&Ne&&!(J&pe))return!0}return!1},$.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&we)>0},me.extend=function(){for(var L=[],J=arguments.length;J--;)L[J]=arguments[J];for(var ne=this,xe=0;xe<L.length;xe++)ne=L[xe](ne);return ne},me.parse=function(L,J){return new this(J,L).parse()},me.parseExpressionAt=function(L,J,ne){var xe=new this(ne,L,J);return xe.nextToken(),xe.parseExpression()},me.tokenizer=function(L,J){return new this(J,L)},Object.defineProperties(me.prototype,$);var Le=me.prototype,Xe=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Le.strictDirective=function(E){if(this.options.ecmaVersion<5)return!1;for(;;){U.lastIndex=E,E+=U.exec(this.input)[0].length;var L=Xe.exec(this.input.slice(E));if(!L)return!1;if((L[1]||L[2])==="use strict"){U.lastIndex=E+L[0].length;var J=U.exec(this.input),ne=J.index+J[0].length,xe=this.input.charAt(ne);return xe===";"||xe==="}"||A.test(J[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(xe)||xe==="!"&&this.input.charAt(ne+1)==="=")}E+=L[0].length,U.lastIndex=E,E+=U.exec(this.input)[0].length,this.input[E]===";"&&E++}},Le.eat=function(E){return this.type===E?(this.next(),!0):!1},Le.isContextual=function(E){return this.type===S.name&&this.value===E&&!this.containsEsc},Le.eatContextual=function(E){return this.isContextual(E)?(this.next(),!0):!1},Le.expectContextual=function(E){this.eatContextual(E)||this.unexpected()},Le.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||A.test(this.input.slice(this.lastTokEnd,this.start))},Le.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Le.semicolon=function(){!this.eat(S.semi)&&!this.insertSemicolon()&&this.unexpected()},Le.afterTrailingComma=function(E,L){if(this.type===E)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),L||this.next(),!0},Le.expect=function(E){this.eat(E)||this.unexpected()},Le.unexpected=function(E){this.raise(E??this.start,"Unexpected token")};var mt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Le.checkPatternErrors=function(E,L){if(E){E.trailingComma>-1&&this.raiseRecoverable(E.trailingComma,"Comma is not permitted after the rest element");var J=L?E.parenthesizedAssign:E.parenthesizedBind;J>-1&&this.raiseRecoverable(J,L?"Assigning to rvalue":"Parenthesized pattern")}},Le.checkExpressionErrors=function(E,L){if(!E)return!1;var J=E.shorthandAssign,ne=E.doubleProto;if(!L)return J>=0||ne>=0;J>=0&&this.raise(J,"Shorthand property assignments are valid only in destructuring patterns"),ne>=0&&this.raiseRecoverable(ne,"Redefinition of __proto__ property")},Le.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Le.isSimpleAssignTarget=function(E){return E.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(E.expression):E.type==="Identifier"||E.type==="MemberExpression"};var Ge=me.prototype;Ge.parseTopLevel=function(E){var L=Object.create(null);for(E.body||(E.body=[]);this.type!==S.eof;){var J=this.parseStatement(null,!0,L);E.body.push(J)}if(this.inModule)for(var ne=0,xe=Object.keys(this.undefinedExports);ne<xe.length;ne+=1){var Ke=xe[ne];this.raiseRecoverable(this.undefinedExports[Ke].start,"Export '"+Ke+"' is not defined")}return this.adaptDirectivePrologue(E.body),this.next(),E.sourceType=this.options.sourceType,this.finishNode(E,"Program")};var Je={kind:"loop"},tt={kind:"switch"};Ge.isLet=function(E){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;U.lastIndex=this.pos;var L=U.exec(this.input),J=this.pos+L[0].length,ne=this.input.charCodeAt(J);if(ne===91||ne===92)return!0;if(E)return!1;if(ne===123||ne>55295&&ne<56320)return!0;if(g(ne,!0)){for(var xe=J+1;b(ne=this.input.charCodeAt(xe),!0);)++xe;if(ne===92||ne>55295&&ne<56320)return!0;var Ke=this.input.slice(J,xe);if(!u.test(Ke))return!0}return!1},Ge.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;U.lastIndex=this.pos;var E=U.exec(this.input),L=this.pos+E[0].length,J;return!A.test(this.input.slice(this.pos,L))&&this.input.slice(L,L+8)==="function"&&(L+8===this.input.length||!(b(J=this.input.charCodeAt(L+8))||J>55295&&J<56320))},Ge.isUsingKeyword=function(E,L){if(this.options.ecmaVersion<17||!this.isContextual(E?"await":"using"))return!1;U.lastIndex=this.pos;var J=U.exec(this.input),ne=this.pos+J[0].length;if(A.test(this.input.slice(this.pos,ne)))return!1;if(E){var xe=ne+5,Ke;if(this.input.slice(ne,xe)!=="using"||xe===this.input.length||b(Ke=this.input.charCodeAt(xe))||Ke>55295&&Ke<56320)return!1;U.lastIndex=xe;var et=U.exec(this.input);if(et&&A.test(this.input.slice(xe,xe+et[0].length)))return!1}if(L){var Lt=ne+2,zt;if(this.input.slice(ne,Lt)==="of"&&(Lt===this.input.length||!b(zt=this.input.charCodeAt(Lt))&&!(zt>55295&&zt<56320)))return!1}var mn=this.input.charCodeAt(ne);return g(mn,!0)||mn===92},Ge.isAwaitUsing=function(E){return this.isUsingKeyword(!0,E)},Ge.isUsing=function(E){return this.isUsingKeyword(!1,E)},Ge.parseStatement=function(E,L,J){var ne=this.type,xe=this.startNode(),Ke;switch(this.isLet(E)&&(ne=S._var,Ke="let"),ne){case S._break:case S._continue:return this.parseBreakContinueStatement(xe,ne.keyword);case S._debugger:return this.parseDebuggerStatement(xe);case S._do:return this.parseDoStatement(xe);case S._for:return this.parseForStatement(xe);case S._function:return E&&(this.strict||E!=="if"&&E!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(xe,!1,!E);case S._class:return E&&this.unexpected(),this.parseClass(xe,!0);case S._if:return this.parseIfStatement(xe);case S._return:return this.parseReturnStatement(xe);case S._switch:return this.parseSwitchStatement(xe);case S._throw:return this.parseThrowStatement(xe);case S._try:return this.parseTryStatement(xe);case S._const:case S._var:return Ke=Ke||this.value,E&&Ke!=="var"&&this.unexpected(),this.parseVarStatement(xe,Ke);case S._while:return this.parseWhileStatement(xe);case S._with:return this.parseWithStatement(xe);case S.braceL:return this.parseBlock(!0,xe);case S.semi:return this.parseEmptyStatement(xe);case S._export:case S._import:if(this.options.ecmaVersion>10&&ne===S._import){U.lastIndex=this.pos;var et=U.exec(this.input),Lt=this.pos+et[0].length,zt=this.input.charCodeAt(Lt);if(zt===40||zt===46)return this.parseExpressionStatement(xe,this.parseExpression())}return this.options.allowImportExportEverywhere||(L||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),ne===S._import?this.parseImport(xe):this.parseExport(xe,J);default:if(this.isAsyncFunction())return E&&this.unexpected(),this.next(),this.parseFunctionStatement(xe,!0,!E);var mn=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(mn)return L&&this.options.sourceType==="script"&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),mn==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(xe,!1,mn),this.semicolon(),this.finishNode(xe,"VariableDeclaration");var _n=this.value,Si=this.parseExpression();return ne===S.name&&Si.type==="Identifier"&&this.eat(S.colon)?this.parseLabeledStatement(xe,_n,Si,E):this.parseExpressionStatement(xe,Si)}},Ge.parseBreakContinueStatement=function(E,L){var J=L==="break";this.next(),this.eat(S.semi)||this.insertSemicolon()?E.label=null:this.type!==S.name?this.unexpected():(E.label=this.parseIdent(),this.semicolon());for(var ne=0;ne<this.labels.length;++ne){var xe=this.labels[ne];if((E.label==null||xe.name===E.label.name)&&(xe.kind!=null&&(J||xe.kind==="loop")||E.label&&J))break}return ne===this.labels.length&&this.raise(E.start,"Unsyntactic "+L),this.finishNode(E,J?"BreakStatement":"ContinueStatement")},Ge.parseDebuggerStatement=function(E){return this.next(),this.semicolon(),this.finishNode(E,"DebuggerStatement")},Ge.parseDoStatement=function(E){return this.next(),this.labels.push(Je),E.body=this.parseStatement("do"),this.labels.pop(),this.expect(S._while),E.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(S.semi):this.semicolon(),this.finishNode(E,"DoWhileStatement")},Ge.parseForStatement=function(E){this.next();var L=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Je),this.enterScope(0),this.expect(S.parenL),this.type===S.semi)return L>-1&&this.unexpected(L),this.parseFor(E,null);var J=this.isLet();if(this.type===S._var||this.type===S._const||J){var ne=this.startNode(),xe=J?"let":this.value;return this.next(),this.parseVar(ne,!0,xe),this.finishNode(ne,"VariableDeclaration"),this.parseForAfterInit(E,ne,L)}var Ke=this.isContextual("let"),et=!1,Lt=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(Lt){var zt=this.startNode();return this.next(),Lt==="await using"&&this.next(),this.parseVar(zt,!0,Lt),this.finishNode(zt,"VariableDeclaration"),this.parseForAfterInit(E,zt,L)}var mn=this.containsEsc,_n=new mt,Si=this.start,An=L>-1?this.parseExprSubscripts(_n,"await"):this.parseExpression(!0,_n);return this.type===S._in||(et=this.options.ecmaVersion>=6&&this.isContextual("of"))?(L>-1?(this.type===S._in&&this.unexpected(L),E.await=!0):et&&this.options.ecmaVersion>=8&&(An.start===Si&&!mn&&An.type==="Identifier"&&An.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(E.await=!1)),Ke&&et&&this.raise(An.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(An,!1,_n),this.checkLValPattern(An),this.parseForIn(E,An)):(this.checkExpressionErrors(_n,!0),L>-1&&this.unexpected(L),this.parseFor(E,An))},Ge.parseForAfterInit=function(E,L,J){return(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&L.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===S._in?J>-1&&this.unexpected(J):E.await=J>-1),this.parseForIn(E,L)):(J>-1&&this.unexpected(J),this.parseFor(E,L))},Ge.parseFunctionStatement=function(E,L,J){return this.next(),this.parseFunction(E,Tt|(J?0:bt),!1,L)},Ge.parseIfStatement=function(E){return this.next(),E.test=this.parseParenExpression(),E.consequent=this.parseStatement("if"),E.alternate=this.eat(S._else)?this.parseStatement("if"):null,this.finishNode(E,"IfStatement")},Ge.parseReturnStatement=function(E){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(S.semi)||this.insertSemicolon()?E.argument=null:(E.argument=this.parseExpression(),this.semicolon()),this.finishNode(E,"ReturnStatement")},Ge.parseSwitchStatement=function(E){this.next(),E.discriminant=this.parseParenExpression(),E.cases=[],this.expect(S.braceL),this.labels.push(tt),this.enterScope(0);for(var L,J=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var ne=this.type===S._case;L&&this.finishNode(L,"SwitchCase"),E.cases.push(L=this.startNode()),L.consequent=[],this.next(),ne?L.test=this.parseExpression():(J&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),J=!0,L.test=null),this.expect(S.colon)}else L||this.unexpected(),L.consequent.push(this.parseStatement(null));return this.exitScope(),L&&this.finishNode(L,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(E,"SwitchStatement")},Ge.parseThrowStatement=function(E){return this.next(),A.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),E.argument=this.parseExpression(),this.semicolon(),this.finishNode(E,"ThrowStatement")};var xt=[];Ge.parseCatchClauseParam=function(){var E=this.parseBindingAtom(),L=E.type==="Identifier";return this.enterScope(L?Fe:0),this.checkLValPattern(E,L?ce:ie),this.expect(S.parenR),E},Ge.parseTryStatement=function(E){if(this.next(),E.block=this.parseBlock(),E.handler=null,this.type===S._catch){var L=this.startNode();this.next(),this.eat(S.parenL)?L.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),L.param=null,this.enterScope(0)),L.body=this.parseBlock(!1),this.exitScope(),E.handler=this.finishNode(L,"CatchClause")}return E.finalizer=this.eat(S._finally)?this.parseBlock():null,!E.handler&&!E.finalizer&&this.raise(E.start,"Missing catch or finally clause"),this.finishNode(E,"TryStatement")},Ge.parseVarStatement=function(E,L,J){return this.next(),this.parseVar(E,!1,L,J),this.semicolon(),this.finishNode(E,"VariableDeclaration")},Ge.parseWhileStatement=function(E){return this.next(),E.test=this.parseParenExpression(),this.labels.push(Je),E.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(E,"WhileStatement")},Ge.parseWithStatement=function(E){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),E.object=this.parseParenExpression(),E.body=this.parseStatement("with"),this.finishNode(E,"WithStatement")},Ge.parseEmptyStatement=function(E){return this.next(),this.finishNode(E,"EmptyStatement")},Ge.parseLabeledStatement=function(E,L,J,ne){for(var xe=0,Ke=this.labels;xe<Ke.length;xe+=1){var et=Ke[xe];et.name===L&&this.raise(J.start,"Label '"+L+"' is already declared")}for(var Lt=this.type.isLoop?"loop":this.type===S._switch?"switch":null,zt=this.labels.length-1;zt>=0;zt--){var mn=this.labels[zt];if(mn.statementStart===E.start)mn.statementStart=this.start,mn.kind=Lt;else break}return this.labels.push({name:L,kind:Lt,statementStart:this.start}),E.body=this.parseStatement(ne?ne.indexOf("label")===-1?ne+"label":ne:"label"),this.labels.pop(),E.label=J,this.finishNode(E,"LabeledStatement")},Ge.parseExpressionStatement=function(E,L){return E.expression=L,this.semicolon(),this.finishNode(E,"ExpressionStatement")},Ge.parseBlock=function(E,L,J){for(E===void 0&&(E=!0),L===void 0&&(L=this.startNode()),L.body=[],this.expect(S.braceL),E&&this.enterScope(0);this.type!==S.braceR;){var ne=this.parseStatement(null);L.body.push(ne)}return J&&(this.strict=!1),this.next(),E&&this.exitScope(),this.finishNode(L,"BlockStatement")},Ge.parseFor=function(E,L){return E.init=L,this.expect(S.semi),E.test=this.type===S.semi?null:this.parseExpression(),this.expect(S.semi),E.update=this.type===S.parenR?null:this.parseExpression(),this.expect(S.parenR),E.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(E,"ForStatement")},Ge.parseForIn=function(E,L){var J=this.type===S._in;return this.next(),L.type==="VariableDeclaration"&&L.declarations[0].init!=null&&(!J||this.options.ecmaVersion<8||this.strict||L.kind!=="var"||L.declarations[0].id.type!=="Identifier")&&this.raise(L.start,(J?"for-in":"for-of")+" loop variable declaration may not have an initializer"),E.left=L,E.right=J?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),E.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(E,J?"ForInStatement":"ForOfStatement")},Ge.parseVar=function(E,L,J,ne){for(E.declarations=[],E.kind=J;;){var xe=this.startNode();if(this.parseVarId(xe,J),this.eat(S.eq)?xe.init=this.parseMaybeAssign(L):!ne&&J==="const"&&!(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!ne&&(J==="using"||J==="await using")&&this.options.ecmaVersion>=17&&this.type!==S._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+J+" declaration"):!ne&&xe.id.type!=="Identifier"&&!(L&&(this.type===S._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):xe.init=null,E.declarations.push(this.finishNode(xe,"VariableDeclarator")),!this.eat(S.comma))break}return E},Ge.parseVarId=function(E,L){E.id=L==="using"||L==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(E.id,L==="var"?$e:ie,!1)};var Tt=1,bt=2,Rt=4;Ge.parseFunction=function(E,L,J,ne,xe){this.initFunction(E),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!ne)&&(this.type===S.star&&L&bt&&this.unexpected(),E.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(E.async=!!ne),L&Tt&&(E.id=L&Rt&&this.type!==S.name?null:this.parseIdent(),E.id&&!(L&bt)&&this.checkLValSimple(E.id,this.strict||E.generator||E.async?this.treatFunctionsAsVar?$e:ie:K));var Ke=this.yieldPos,et=this.awaitPos,Lt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Pe(E.async,E.generator)),L&Tt||(E.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(E),this.parseFunctionBody(E,J,!1,xe),this.yieldPos=Ke,this.awaitPos=et,this.awaitIdentPos=Lt,this.finishNode(E,L&Tt?"FunctionDeclaration":"FunctionExpression")},Ge.parseFunctionParams=function(E){this.expect(S.parenL),E.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Ge.parseClass=function(E,L){this.next();var J=this.strict;this.strict=!0,this.parseClassId(E,L),this.parseClassSuper(E);var ne=this.enterClassBody(),xe=this.startNode(),Ke=!1;for(xe.body=[],this.expect(S.braceL);this.type!==S.braceR;){var et=this.parseClassElement(E.superClass!==null);et&&(xe.body.push(et),et.type==="MethodDefinition"&&et.kind==="constructor"?(Ke&&this.raiseRecoverable(et.start,"Duplicate constructor in the same class"),Ke=!0):et.key&&et.key.type==="PrivateIdentifier"&&Oe(ne,et)&&this.raiseRecoverable(et.key.start,"Identifier '#"+et.key.name+"' has already been declared"))}return this.strict=J,this.next(),E.body=this.finishNode(xe,"ClassBody"),this.exitClassBody(),this.finishNode(E,L?"ClassDeclaration":"ClassExpression")},Ge.parseClassElement=function(E){if(this.eat(S.semi))return null;var L=this.options.ecmaVersion,J=this.startNode(),ne="",xe=!1,Ke=!1,et="method",Lt=!1;if(this.eatContextual("static")){if(L>=13&&this.eat(S.braceL))return this.parseClassStaticBlock(J),J;this.isClassElementNameStart()||this.type===S.star?Lt=!0:ne="static"}if(J.static=Lt,!ne&&L>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===S.star)&&!this.canInsertSemicolon()?Ke=!0:ne="async"),!ne&&(L>=9||!Ke)&&this.eat(S.star)&&(xe=!0),!ne&&!Ke&&!xe){var zt=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?et=zt:ne=zt)}if(ne?(J.computed=!1,J.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),J.key.name=ne,this.finishNode(J.key,"Identifier")):this.parseClassElementName(J),L<13||this.type===S.parenL||et!=="method"||xe||Ke){var mn=!J.static&&Ve(J,"constructor"),_n=mn&&E;mn&&et!=="method"&&this.raise(J.key.start,"Constructor can't have get/set modifier"),J.kind=mn?"constructor":et,this.parseClassMethod(J,xe,Ke,_n)}else this.parseClassField(J);return J},Ge.isClassElementNameStart=function(){return this.type===S.name||this.type===S.privateId||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword},Ge.parseClassElementName=function(E){this.type===S.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),E.computed=!1,E.key=this.parsePrivateIdent()):this.parsePropertyName(E)},Ge.parseClassMethod=function(E,L,J,ne){var xe=E.key;E.kind==="constructor"?(L&&this.raise(xe.start,"Constructor can't be a generator"),J&&this.raise(xe.start,"Constructor can't be an async method")):E.static&&Ve(E,"prototype")&&this.raise(xe.start,"Classes may not have a static property named prototype");var Ke=E.value=this.parseMethod(L,J,ne);return E.kind==="get"&&Ke.params.length!==0&&this.raiseRecoverable(Ke.start,"getter should have no params"),E.kind==="set"&&Ke.params.length!==1&&this.raiseRecoverable(Ke.start,"setter should have exactly one param"),E.kind==="set"&&Ke.params[0].type==="RestElement"&&this.raiseRecoverable(Ke.params[0].start,"Setter cannot use rest params"),this.finishNode(E,"MethodDefinition")},Ge.parseClassField=function(E){return Ve(E,"constructor")?this.raise(E.key.start,"Classes can't have a field named 'constructor'"):E.static&&Ve(E,"prototype")&&this.raise(E.key.start,"Classes can't have a static field named 'prototype'"),this.eat(S.eq)?(this.enterScope(Te|Ie),E.value=this.parseMaybeAssign(),this.exitScope()):E.value=null,this.semicolon(),this.finishNode(E,"PropertyDefinition")},Ge.parseClassStaticBlock=function(E){E.body=[];var L=this.labels;for(this.labels=[],this.enterScope(we|Ie);this.type!==S.braceR;){var J=this.parseStatement(null);E.body.push(J)}return this.next(),this.exitScope(),this.labels=L,this.finishNode(E,"StaticBlock")},Ge.parseClassId=function(E,L){this.type===S.name?(E.id=this.parseIdent(),L&&this.checkLValSimple(E.id,ie,!1)):(L===!0&&this.unexpected(),E.id=null)},Ge.parseClassSuper=function(E){E.superClass=this.eat(S._extends)?this.parseExprSubscripts(null,!1):null},Ge.enterClassBody=function(){var E={declared:Object.create(null),used:[]};return this.privateNameStack.push(E),E.declared},Ge.exitClassBody=function(){var E=this.privateNameStack.pop(),L=E.declared,J=E.used;if(this.options.checkPrivateFields)for(var ne=this.privateNameStack.length,xe=ne===0?null:this.privateNameStack[ne-1],Ke=0;Ke<J.length;++Ke){var et=J[Ke];B(L,et.name)||(xe?xe.used.push(et):this.raiseRecoverable(et.start,"Private field '#"+et.name+"' must be declared in an enclosing class"))}};function Oe(E,L){var J=L.key.name,ne=E[J],xe="true";return L.type==="MethodDefinition"&&(L.kind==="get"||L.kind==="set")&&(xe=(L.static?"s":"i")+L.kind),ne==="iget"&&xe==="iset"||ne==="iset"&&xe==="iget"||ne==="sget"&&xe==="sset"||ne==="sset"&&xe==="sget"?(E[J]="true",!1):ne?!0:(E[J]=xe,!1)}function Ve(E,L){var J=E.computed,ne=E.key;return!J&&(ne.type==="Identifier"&&ne.name===L||ne.type==="Literal"&&ne.value===L)}Ge.parseExportAllDeclaration=function(E,L){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(E.exported=this.parseModuleExportName(),this.checkExport(L,E.exported,this.lastTokStart)):E.exported=null),this.expectContextual("from"),this.type!==S.string&&this.unexpected(),E.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(E.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(E,"ExportAllDeclaration")},Ge.parseExport=function(E,L){if(this.next(),this.eat(S.star))return this.parseExportAllDeclaration(E,L);if(this.eat(S._default))return this.checkExport(L,"default",this.lastTokStart),E.declaration=this.parseExportDefaultDeclaration(),this.finishNode(E,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())E.declaration=this.parseExportDeclaration(E),E.declaration.type==="VariableDeclaration"?this.checkVariableExport(L,E.declaration.declarations):this.checkExport(L,E.declaration.id,E.declaration.id.start),E.specifiers=[],E.source=null,this.options.ecmaVersion>=16&&(E.attributes=[]);else{if(E.declaration=null,E.specifiers=this.parseExportSpecifiers(L),this.eatContextual("from"))this.type!==S.string&&this.unexpected(),E.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(E.attributes=this.parseWithClause());else{for(var J=0,ne=E.specifiers;J<ne.length;J+=1){var xe=ne[J];this.checkUnreserved(xe.local),this.checkLocalExport(xe.local),xe.local.type==="Literal"&&this.raise(xe.local.start,"A string literal cannot be used as an exported binding without `from`.")}E.source=null,this.options.ecmaVersion>=16&&(E.attributes=[])}this.semicolon()}return this.finishNode(E,"ExportNamedDeclaration")},Ge.parseExportDeclaration=function(E){return this.parseStatement(null)},Ge.parseExportDefaultDeclaration=function(){var E;if(this.type===S._function||(E=this.isAsyncFunction())){var L=this.startNode();return this.next(),E&&this.next(),this.parseFunction(L,Tt|Rt,!1,E)}else if(this.type===S._class){var J=this.startNode();return this.parseClass(J,"nullableID")}else{var ne=this.parseMaybeAssign();return this.semicolon(),ne}},Ge.checkExport=function(E,L,J){E&&(typeof L!="string"&&(L=L.type==="Identifier"?L.name:L.value),B(E,L)&&this.raiseRecoverable(J,"Duplicate export '"+L+"'"),E[L]=!0)},Ge.checkPatternExport=function(E,L){var J=L.type;if(J==="Identifier")this.checkExport(E,L,L.start);else if(J==="ObjectPattern")for(var ne=0,xe=L.properties;ne<xe.length;ne+=1){var Ke=xe[ne];this.checkPatternExport(E,Ke)}else if(J==="ArrayPattern")for(var et=0,Lt=L.elements;et<Lt.length;et+=1){var zt=Lt[et];zt&&this.checkPatternExport(E,zt)}else J==="Property"?this.checkPatternExport(E,L.value):J==="AssignmentPattern"?this.checkPatternExport(E,L.left):J==="RestElement"&&this.checkPatternExport(E,L.argument)},Ge.checkVariableExport=function(E,L){if(E)for(var J=0,ne=L;J<ne.length;J+=1){var xe=ne[J];this.checkPatternExport(E,xe.id)}},Ge.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},Ge.parseExportSpecifier=function(E){var L=this.startNode();return L.local=this.parseModuleExportName(),L.exported=this.eatContextual("as")?this.parseModuleExportName():L.local,this.checkExport(E,L.exported,L.exported.start),this.finishNode(L,"ExportSpecifier")},Ge.parseExportSpecifiers=function(E){var L=[],J=!0;for(this.expect(S.braceL);!this.eat(S.braceR);){if(J)J=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;L.push(this.parseExportSpecifier(E))}return L},Ge.parseImport=function(E){return this.next(),this.type===S.string?(E.specifiers=xt,E.source=this.parseExprAtom()):(E.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),E.source=this.type===S.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(E.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(E,"ImportDeclaration")},Ge.parseImportSpecifier=function(){var E=this.startNode();return E.imported=this.parseModuleExportName(),this.eatContextual("as")?E.local=this.parseIdent():(this.checkUnreserved(E.imported),E.local=E.imported),this.checkLValSimple(E.local,ie),this.finishNode(E,"ImportSpecifier")},Ge.parseImportDefaultSpecifier=function(){var E=this.startNode();return E.local=this.parseIdent(),this.checkLValSimple(E.local,ie),this.finishNode(E,"ImportDefaultSpecifier")},Ge.parseImportNamespaceSpecifier=function(){var E=this.startNode();return this.next(),this.expectContextual("as"),E.local=this.parseIdent(),this.checkLValSimple(E.local,ie),this.finishNode(E,"ImportNamespaceSpecifier")},Ge.parseImportSpecifiers=function(){var E=[],L=!0;if(this.type===S.name&&(E.push(this.parseImportDefaultSpecifier()),!this.eat(S.comma)))return E;if(this.type===S.star)return E.push(this.parseImportNamespaceSpecifier()),E;for(this.expect(S.braceL);!this.eat(S.braceR);){if(L)L=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;E.push(this.parseImportSpecifier())}return E},Ge.parseWithClause=function(){var E=[];if(!this.eat(S._with))return E;this.expect(S.braceL);for(var L={},J=!0;!this.eat(S.braceR);){if(J)J=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var ne=this.parseImportAttribute(),xe=ne.key.type==="Identifier"?ne.key.name:ne.key.value;B(L,xe)&&this.raiseRecoverable(ne.key.start,"Duplicate attribute key '"+xe+"'"),L[xe]=!0,E.push(ne)}return E},Ge.parseImportAttribute=function(){var E=this.startNode();return E.key=this.type===S.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(S.colon),this.type!==S.string&&this.unexpected(),E.value=this.parseExprAtom(),this.finishNode(E,"ImportAttribute")},Ge.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===S.string){var E=this.parseLiteral(this.value);return Y.test(E.value)&&this.raise(E.start,"An export name cannot include a lone surrogate."),E}return this.parseIdent(!0)},Ge.adaptDirectivePrologue=function(E){for(var L=0;L<E.length&&this.isDirectiveCandidate(E[L]);++L)E[L].directive=E[L].expression.raw.slice(1,-1)},Ge.isDirectiveCandidate=function(E){return this.options.ecmaVersion>=5&&E.type==="ExpressionStatement"&&E.expression.type==="Literal"&&typeof E.expression.value=="string"&&(this.input[E.start]==='"'||this.input[E.start]==="'")};var ht=me.prototype;ht.toAssignable=function(E,L,J){if(this.options.ecmaVersion>=6&&E)switch(E.type){case"Identifier":this.inAsync&&E.name==="await"&&this.raise(E.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":E.type="ObjectPattern",J&&this.checkPatternErrors(J,!0);for(var ne=0,xe=E.properties;ne<xe.length;ne+=1){var Ke=xe[ne];this.toAssignable(Ke,L),Ke.type==="RestElement"&&(Ke.argument.type==="ArrayPattern"||Ke.argument.type==="ObjectPattern")&&this.raise(Ke.argument.start,"Unexpected token")}break;case"Property":E.kind!=="init"&&this.raise(E.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(E.value,L);break;case"ArrayExpression":E.type="ArrayPattern",J&&this.checkPatternErrors(J,!0),this.toAssignableList(E.elements,L);break;case"SpreadElement":E.type="RestElement",this.toAssignable(E.argument,L),E.argument.type==="AssignmentPattern"&&this.raise(E.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":E.operator!=="="&&this.raise(E.left.end,"Only '=' operator can be used for specifying default value."),E.type="AssignmentPattern",delete E.operator,this.toAssignable(E.left,L);break;case"ParenthesizedExpression":this.toAssignable(E.expression,L,J);break;case"ChainExpression":this.raiseRecoverable(E.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!L)break;default:this.raise(E.start,"Assigning to rvalue")}else J&&this.checkPatternErrors(J,!0);return E},ht.toAssignableList=function(E,L){for(var J=E.length,ne=0;ne<J;ne++){var xe=E[ne];xe&&this.toAssignable(xe,L)}if(J){var Ke=E[J-1];this.options.ecmaVersion===6&&L&&Ke&&Ke.type==="RestElement"&&Ke.argument.type!=="Identifier"&&this.unexpected(Ke.argument.start)}return E},ht.parseSpread=function(E){var L=this.startNode();return this.next(),L.argument=this.parseMaybeAssign(!1,E),this.finishNode(L,"SpreadElement")},ht.parseRestBinding=function(){var E=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==S.name&&this.unexpected(),E.argument=this.parseBindingAtom(),this.finishNode(E,"RestElement")},ht.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case S.bracketL:var E=this.startNode();return this.next(),E.elements=this.parseBindingList(S.bracketR,!0,!0),this.finishNode(E,"ArrayPattern");case S.braceL:return this.parseObj(!0)}return this.parseIdent()},ht.parseBindingList=function(E,L,J,ne){for(var xe=[],Ke=!0;!this.eat(E);)if(Ke?Ke=!1:this.expect(S.comma),L&&this.type===S.comma)xe.push(null);else{if(J&&this.afterTrailingComma(E))break;if(this.type===S.ellipsis){var et=this.parseRestBinding();this.parseBindingListItem(et),xe.push(et),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(E);break}else xe.push(this.parseAssignableListItem(ne))}return xe},ht.parseAssignableListItem=function(E){var L=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(L),L},ht.parseBindingListItem=function(E){return E},ht.parseMaybeDefault=function(E,L,J){if(J=J||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(S.eq))return J;var ne=this.startNodeAt(E,L);return ne.left=J,ne.right=this.parseMaybeAssign(),this.finishNode(ne,"AssignmentPattern")},ht.checkLValSimple=function(E,L,J){L===void 0&&(L=He);var ne=L!==He;switch(E.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(E.name)&&this.raiseRecoverable(E.start,(ne?"Binding ":"Assigning to ")+E.name+" in strict mode"),ne&&(L===ie&&E.name==="let"&&this.raiseRecoverable(E.start,"let is disallowed as a lexically bound name"),J&&(B(J,E.name)&&this.raiseRecoverable(E.start,"Argument name clash"),J[E.name]=!0),L!==fe&&this.declareName(E.name,L,E.start));break;case"ChainExpression":this.raiseRecoverable(E.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":ne&&this.raiseRecoverable(E.start,"Binding member expression");break;case"ParenthesizedExpression":return ne&&this.raiseRecoverable(E.start,"Binding parenthesized expression"),this.checkLValSimple(E.expression,L,J);default:this.raise(E.start,(ne?"Binding":"Assigning to")+" rvalue")}},ht.checkLValPattern=function(E,L,J){switch(L===void 0&&(L=He),E.type){case"ObjectPattern":for(var ne=0,xe=E.properties;ne<xe.length;ne+=1){var Ke=xe[ne];this.checkLValInnerPattern(Ke,L,J)}break;case"ArrayPattern":for(var et=0,Lt=E.elements;et<Lt.length;et+=1){var zt=Lt[et];zt&&this.checkLValInnerPattern(zt,L,J)}break;default:this.checkLValSimple(E,L,J)}},ht.checkLValInnerPattern=function(E,L,J){switch(L===void 0&&(L=He),E.type){case"Property":this.checkLValInnerPattern(E.value,L,J);break;case"AssignmentPattern":this.checkLValPattern(E.left,L,J);break;case"RestElement":this.checkLValPattern(E.argument,L,J);break;default:this.checkLValPattern(E,L,J)}};var Ft=function(L,J,ne,xe,Ke){this.token=L,this.isExpr=!!J,this.preserveSpace=!!ne,this.override=xe,this.generator=!!Ke},st={b_stat:new Ft("{",!1),b_expr:new Ft("{",!0),b_tmpl:new Ft("${",!1),p_stat:new Ft("(",!1),p_expr:new Ft("(",!0),q_tmpl:new Ft("`",!0,!0,function(E){return E.tryReadTemplateToken()}),f_stat:new Ft("function",!1),f_expr:new Ft("function",!0),f_expr_gen:new Ft("function",!0,!1,null,!0),f_gen:new Ft("function",!1,!1,null,!0)},it=me.prototype;it.initialContext=function(){return[st.b_stat]},it.curContext=function(){return this.context[this.context.length-1]},it.braceIsBlock=function(E){var L=this.curContext();return L===st.f_expr||L===st.f_stat?!0:E===S.colon&&(L===st.b_stat||L===st.b_expr)?!L.isExpr:E===S._return||E===S.name&&this.exprAllowed?A.test(this.input.slice(this.lastTokEnd,this.start)):E===S._else||E===S.semi||E===S.eof||E===S.parenR||E===S.arrow?!0:E===S.braceL?L===st.b_stat:E===S._var||E===S._const||E===S.name?!1:!this.exprAllowed},it.inGeneratorContext=function(){for(var E=this.context.length-1;E>=1;E--){var L=this.context[E];if(L.token==="function")return L.generator}return!1},it.updateContext=function(E){var L,J=this.type;J.keyword&&E===S.dot?this.exprAllowed=!1:(L=J.updateContext)?L.call(this,E):this.exprAllowed=J.beforeExpr},it.overrideContext=function(E){this.curContext()!==E&&(this.context[this.context.length-1]=E)},S.parenR.updateContext=S.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var E=this.context.pop();E===st.b_stat&&this.curContext().token==="function"&&(E=this.context.pop()),this.exprAllowed=!E.isExpr},S.braceL.updateContext=function(E){this.context.push(this.braceIsBlock(E)?st.b_stat:st.b_expr),this.exprAllowed=!0},S.dollarBraceL.updateContext=function(){this.context.push(st.b_tmpl),this.exprAllowed=!0},S.parenL.updateContext=function(E){var L=E===S._if||E===S._for||E===S._with||E===S._while;this.context.push(L?st.p_stat:st.p_expr),this.exprAllowed=!0},S.incDec.updateContext=function(){},S._function.updateContext=S._class.updateContext=function(E){E.beforeExpr&&E!==S._else&&!(E===S.semi&&this.curContext()!==st.p_stat)&&!(E===S._return&&A.test(this.input.slice(this.lastTokEnd,this.start)))&&!((E===S.colon||E===S.braceL)&&this.curContext()===st.b_stat)?this.context.push(st.f_expr):this.context.push(st.f_stat),this.exprAllowed=!1},S.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},S.backQuote.updateContext=function(){this.curContext()===st.q_tmpl?this.context.pop():this.context.push(st.q_tmpl),this.exprAllowed=!1},S.star.updateContext=function(E){if(E===S._function){var L=this.context.length-1;this.context[L]===st.f_expr?this.context[L]=st.f_expr_gen:this.context[L]=st.f_gen}this.exprAllowed=!0},S.name.updateContext=function(E){var L=!1;this.options.ecmaVersion>=6&&E!==S.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(L=!0),this.exprAllowed=L};var vt=me.prototype;vt.checkPropClash=function(E,L,J){if(!(this.options.ecmaVersion>=9&&E.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(E.computed||E.method||E.shorthand))){var ne=E.key,xe;switch(ne.type){case"Identifier":xe=ne.name;break;case"Literal":xe=String(ne.value);break;default:return}var Ke=E.kind;if(this.options.ecmaVersion>=6){xe==="__proto__"&&Ke==="init"&&(L.proto&&(J?J.doubleProto<0&&(J.doubleProto=ne.start):this.raiseRecoverable(ne.start,"Redefinition of __proto__ property")),L.proto=!0);return}xe="$"+xe;var et=L[xe];if(et){var Lt;Ke==="init"?Lt=this.strict&&et.init||et.get||et.set:Lt=et.init||et[Ke],Lt&&this.raiseRecoverable(ne.start,"Redefinition of property")}else et=L[xe]={init:!1,get:!1,set:!1};et[Ke]=!0}},vt.parseExpression=function(E,L){var J=this.start,ne=this.startLoc,xe=this.parseMaybeAssign(E,L);if(this.type===S.comma){var Ke=this.startNodeAt(J,ne);for(Ke.expressions=[xe];this.eat(S.comma);)Ke.expressions.push(this.parseMaybeAssign(E,L));return this.finishNode(Ke,"SequenceExpression")}return xe},vt.parseMaybeAssign=function(E,L,J){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(E);this.exprAllowed=!1}var ne=!1,xe=-1,Ke=-1,et=-1;L?(xe=L.parenthesizedAssign,Ke=L.trailingComma,et=L.doubleProto,L.parenthesizedAssign=L.trailingComma=-1):(L=new mt,ne=!0);var Lt=this.start,zt=this.startLoc;(this.type===S.parenL||this.type===S.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=E==="await");var mn=this.parseMaybeConditional(E,L);if(J&&(mn=J.call(this,mn,Lt,zt)),this.type.isAssign){var _n=this.startNodeAt(Lt,zt);return _n.operator=this.value,this.type===S.eq&&(mn=this.toAssignable(mn,!1,L)),ne||(L.parenthesizedAssign=L.trailingComma=L.doubleProto=-1),L.shorthandAssign>=mn.start&&(L.shorthandAssign=-1),this.type===S.eq?this.checkLValPattern(mn):this.checkLValSimple(mn),_n.left=mn,this.next(),_n.right=this.parseMaybeAssign(E),et>-1&&(L.doubleProto=et),this.finishNode(_n,"AssignmentExpression")}else ne&&this.checkExpressionErrors(L,!0);return xe>-1&&(L.parenthesizedAssign=xe),Ke>-1&&(L.trailingComma=Ke),mn},vt.parseMaybeConditional=function(E,L){var J=this.start,ne=this.startLoc,xe=this.parseExprOps(E,L);if(this.checkExpressionErrors(L))return xe;if(this.eat(S.question)){var Ke=this.startNodeAt(J,ne);return Ke.test=xe,Ke.consequent=this.parseMaybeAssign(),this.expect(S.colon),Ke.alternate=this.parseMaybeAssign(E),this.finishNode(Ke,"ConditionalExpression")}return xe},vt.parseExprOps=function(E,L){var J=this.start,ne=this.startLoc,xe=this.parseMaybeUnary(L,!1,!1,E);return this.checkExpressionErrors(L)||xe.start===J&&xe.type==="ArrowFunctionExpression"?xe:this.parseExprOp(xe,J,ne,-1,E)},vt.parseExprOp=function(E,L,J,ne,xe){var Ke=this.type.binop;if(Ke!=null&&(!xe||this.type!==S._in)&&Ke>ne){var et=this.type===S.logicalOR||this.type===S.logicalAND,Lt=this.type===S.coalesce;Lt&&(Ke=S.logicalAND.binop);var zt=this.value;this.next();var mn=this.start,_n=this.startLoc,Si=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,xe),mn,_n,Ke,xe),An=this.buildBinary(L,J,E,Si,zt,et||Lt);return(et&&this.type===S.coalesce||Lt&&(this.type===S.logicalOR||this.type===S.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(An,L,J,ne,xe)}return E},vt.buildBinary=function(E,L,J,ne,xe,Ke){ne.type==="PrivateIdentifier"&&this.raise(ne.start,"Private identifier can only be left side of binary expression");var et=this.startNodeAt(E,L);return et.left=J,et.operator=xe,et.right=ne,this.finishNode(et,Ke?"LogicalExpression":"BinaryExpression")},vt.parseMaybeUnary=function(E,L,J,ne){var xe=this.start,Ke=this.startLoc,et;if(this.isContextual("await")&&this.canAwait)et=this.parseAwait(ne),L=!0;else if(this.type.prefix){var Lt=this.startNode(),zt=this.type===S.incDec;Lt.operator=this.value,Lt.prefix=!0,this.next(),Lt.argument=this.parseMaybeUnary(null,!0,zt,ne),this.checkExpressionErrors(E,!0),zt?this.checkLValSimple(Lt.argument):this.strict&&Lt.operator==="delete"&&Kt(Lt.argument)?this.raiseRecoverable(Lt.start,"Deleting local variable in strict mode"):Lt.operator==="delete"&&Xt(Lt.argument)?this.raiseRecoverable(Lt.start,"Private fields can not be deleted"):L=!0,et=this.finishNode(Lt,zt?"UpdateExpression":"UnaryExpression")}else if(!L&&this.type===S.privateId)(ne||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),et=this.parsePrivateIdent(),this.type!==S._in&&this.unexpected();else{if(et=this.parseExprSubscripts(E,ne),this.checkExpressionErrors(E))return et;for(;this.type.postfix&&!this.canInsertSemicolon();){var mn=this.startNodeAt(xe,Ke);mn.operator=this.value,mn.prefix=!1,mn.argument=et,this.checkLValSimple(et),this.next(),et=this.finishNode(mn,"UpdateExpression")}}if(!J&&this.eat(S.starstar))if(L)this.unexpected(this.lastTokStart);else return this.buildBinary(xe,Ke,et,this.parseMaybeUnary(null,!1,!1,ne),"**",!1);else return et};function Kt(E){return E.type==="Identifier"||E.type==="ParenthesizedExpression"&&Kt(E.expression)}function Xt(E){return E.type==="MemberExpression"&&E.property.type==="PrivateIdentifier"||E.type==="ChainExpression"&&Xt(E.expression)||E.type==="ParenthesizedExpression"&&Xt(E.expression)}vt.parseExprSubscripts=function(E,L){var J=this.start,ne=this.startLoc,xe=this.parseExprAtom(E,L);if(xe.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return xe;var Ke=this.parseSubscripts(xe,J,ne,!1,L);return E&&Ke.type==="MemberExpression"&&(E.parenthesizedAssign>=Ke.start&&(E.parenthesizedAssign=-1),E.parenthesizedBind>=Ke.start&&(E.parenthesizedBind=-1),E.trailingComma>=Ke.start&&(E.trailingComma=-1)),Ke},vt.parseSubscripts=function(E,L,J,ne,xe){for(var Ke=this.options.ecmaVersion>=8&&E.type==="Identifier"&&E.name==="async"&&this.lastTokEnd===E.end&&!this.canInsertSemicolon()&&E.end-E.start===5&&this.potentialArrowAt===E.start,et=!1;;){var Lt=this.parseSubscript(E,L,J,ne,Ke,et,xe);if(Lt.optional&&(et=!0),Lt===E||Lt.type==="ArrowFunctionExpression"){if(et){var zt=this.startNodeAt(L,J);zt.expression=Lt,Lt=this.finishNode(zt,"ChainExpression")}return Lt}E=Lt}},vt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(S.arrow)},vt.parseSubscriptAsyncArrow=function(E,L,J,ne){return this.parseArrowExpression(this.startNodeAt(E,L),J,!0,ne)},vt.parseSubscript=function(E,L,J,ne,xe,Ke,et){var Lt=this.options.ecmaVersion>=11,zt=Lt&&this.eat(S.questionDot);ne&&zt&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var mn=this.eat(S.bracketL);if(mn||zt&&this.type!==S.parenL&&this.type!==S.backQuote||this.eat(S.dot)){var _n=this.startNodeAt(L,J);_n.object=E,mn?(_n.property=this.parseExpression(),this.expect(S.bracketR)):this.type===S.privateId&&E.type!=="Super"?_n.property=this.parsePrivateIdent():_n.property=this.parseIdent(this.options.allowReserved!=="never"),_n.computed=!!mn,Lt&&(_n.optional=zt),E=this.finishNode(_n,"MemberExpression")}else if(!ne&&this.eat(S.parenL)){var Si=new mt,An=this.yieldPos,ni=this.awaitPos,Er=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var wi=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1,Si);if(xe&&!zt&&this.shouldParseAsyncArrow())return this.checkPatternErrors(Si,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=An,this.awaitPos=ni,this.awaitIdentPos=Er,this.parseSubscriptAsyncArrow(L,J,wi,et);this.checkExpressionErrors(Si,!0),this.yieldPos=An||this.yieldPos,this.awaitPos=ni||this.awaitPos,this.awaitIdentPos=Er||this.awaitIdentPos;var ji=this.startNodeAt(L,J);ji.callee=E,ji.arguments=wi,Lt&&(ji.optional=zt),E=this.finishNode(ji,"CallExpression")}else if(this.type===S.backQuote){(zt||Ke)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Pi=this.startNodeAt(L,J);Pi.tag=E,Pi.quasi=this.parseTemplate({isTagged:!0}),E=this.finishNode(Pi,"TaggedTemplateExpression")}return E},vt.parseExprAtom=function(E,L,J){this.type===S.slash&&this.readRegexp();var ne,xe=this.potentialArrowAt===this.start;switch(this.type){case S._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),ne=this.startNode(),this.next(),this.type===S.parenL&&!this.allowDirectSuper&&this.raise(ne.start,"super() call outside constructor of a subclass"),this.type!==S.dot&&this.type!==S.bracketL&&this.type!==S.parenL&&this.unexpected(),this.finishNode(ne,"Super");case S._this:return ne=this.startNode(),this.next(),this.finishNode(ne,"ThisExpression");case S.name:var Ke=this.start,et=this.startLoc,Lt=this.containsEsc,zt=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Lt&&zt.name==="async"&&!this.canInsertSemicolon()&&this.eat(S._function))return this.overrideContext(st.f_expr),this.parseFunction(this.startNodeAt(Ke,et),0,!1,!0,L);if(xe&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt(Ke,et),[zt],!1,L);if(this.options.ecmaVersion>=8&&zt.name==="async"&&this.type===S.name&&!Lt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return zt=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(S.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(Ke,et),[zt],!0,L)}return zt;case S.regexp:var mn=this.value;return ne=this.parseLiteral(mn.value),ne.regex={pattern:mn.pattern,flags:mn.flags},ne;case S.num:case S.string:return this.parseLiteral(this.value);case S._null:case S._true:case S._false:return ne=this.startNode(),ne.value=this.type===S._null?null:this.type===S._true,ne.raw=this.type.keyword,this.next(),this.finishNode(ne,"Literal");case S.parenL:var _n=this.start,Si=this.parseParenAndDistinguishExpression(xe,L);return E&&(E.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Si)&&(E.parenthesizedAssign=_n),E.parenthesizedBind<0&&(E.parenthesizedBind=_n)),Si;case S.bracketL:return ne=this.startNode(),this.next(),ne.elements=this.parseExprList(S.bracketR,!0,!0,E),this.finishNode(ne,"ArrayExpression");case S.braceL:return this.overrideContext(st.b_expr),this.parseObj(!1,E);case S._function:return ne=this.startNode(),this.next(),this.parseFunction(ne,0);case S._class:return this.parseClass(this.startNode(),!1);case S._new:return this.parseNew();case S.backQuote:return this.parseTemplate();case S._import:return this.options.ecmaVersion>=11?this.parseExprImport(J):this.unexpected();default:return this.parseExprAtomDefault()}},vt.parseExprAtomDefault=function(){this.unexpected()},vt.parseExprImport=function(E){var L=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===S.parenL&&!E)return this.parseDynamicImport(L);if(this.type===S.dot){var J=this.startNodeAt(L.start,L.loc&&L.loc.start);return J.name="import",L.meta=this.finishNode(J,"Identifier"),this.parseImportMeta(L)}else this.unexpected()},vt.parseDynamicImport=function(E){if(this.next(),E.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(S.parenR)?E.options=null:(this.expect(S.comma),this.afterTrailingComma(S.parenR)?E.options=null:(E.options=this.parseMaybeAssign(),this.eat(S.parenR)||(this.expect(S.comma),this.afterTrailingComma(S.parenR)||this.unexpected())));else if(!this.eat(S.parenR)){var L=this.start;this.eat(S.comma)&&this.eat(S.parenR)?this.raiseRecoverable(L,"Trailing comma is not allowed in import()"):this.unexpected(L)}return this.finishNode(E,"ImportExpression")},vt.parseImportMeta=function(E){this.next();var L=this.containsEsc;return E.property=this.parseIdent(!0),E.property.name!=="meta"&&this.raiseRecoverable(E.property.start,"The only valid meta property for import is 'import.meta'"),L&&this.raiseRecoverable(E.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(E.start,"Cannot use 'import.meta' outside a module"),this.finishNode(E,"MetaProperty")},vt.parseLiteral=function(E){var L=this.startNode();return L.value=E,L.raw=this.input.slice(this.start,this.end),L.raw.charCodeAt(L.raw.length-1)===110&&(L.bigint=L.value!=null?L.value.toString():L.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(L,"Literal")},vt.parseParenExpression=function(){this.expect(S.parenL);var E=this.parseExpression();return this.expect(S.parenR),E},vt.shouldParseArrow=function(E){return!this.canInsertSemicolon()},vt.parseParenAndDistinguishExpression=function(E,L){var J=this.start,ne=this.startLoc,xe,Ke=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var et=this.start,Lt=this.startLoc,zt=[],mn=!0,_n=!1,Si=new mt,An=this.yieldPos,ni=this.awaitPos,Er;for(this.yieldPos=0,this.awaitPos=0;this.type!==S.parenR;)if(mn?mn=!1:this.expect(S.comma),Ke&&this.afterTrailingComma(S.parenR,!0)){_n=!0;break}else if(this.type===S.ellipsis){Er=this.start,zt.push(this.parseParenItem(this.parseRestBinding())),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else zt.push(this.parseMaybeAssign(!1,Si,this.parseParenItem));var wi=this.lastTokEnd,ji=this.lastTokEndLoc;if(this.expect(S.parenR),E&&this.shouldParseArrow(zt)&&this.eat(S.arrow))return this.checkPatternErrors(Si,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=An,this.awaitPos=ni,this.parseParenArrowList(J,ne,zt,L);(!zt.length||_n)&&this.unexpected(this.lastTokStart),Er&&this.unexpected(Er),this.checkExpressionErrors(Si,!0),this.yieldPos=An||this.yieldPos,this.awaitPos=ni||this.awaitPos,zt.length>1?(xe=this.startNodeAt(et,Lt),xe.expressions=zt,this.finishNodeAt(xe,"SequenceExpression",wi,ji)):xe=zt[0]}else xe=this.parseParenExpression();if(this.options.preserveParens){var Pi=this.startNodeAt(J,ne);return Pi.expression=xe,this.finishNode(Pi,"ParenthesizedExpression")}else return xe},vt.parseParenItem=function(E){return E},vt.parseParenArrowList=function(E,L,J,ne){return this.parseArrowExpression(this.startNodeAt(E,L),J,!1,ne)};var cn=[];vt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var E=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===S.dot){var L=this.startNodeAt(E.start,E.loc&&E.loc.start);L.name="new",E.meta=this.finishNode(L,"Identifier"),this.next();var J=this.containsEsc;return E.property=this.parseIdent(!0),E.property.name!=="target"&&this.raiseRecoverable(E.property.start,"The only valid meta property for new is 'new.target'"),J&&this.raiseRecoverable(E.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(E.start,"'new.target' can only be used in functions and class static block"),this.finishNode(E,"MetaProperty")}var ne=this.start,xe=this.startLoc;return E.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),ne,xe,!0,!1),this.eat(S.parenL)?E.arguments=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1):E.arguments=cn,this.finishNode(E,"NewExpression")},vt.parseTemplateElement=function(E){var L=E.isTagged,J=this.startNode();return this.type===S.invalidTemplate?(L||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),J.value={raw:this.value.replace(/\r\n?/g,`
`),cooked:null}):J.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
`),cooked:this.value},this.next(),J.tail=this.type===S.backQuote,this.finishNode(J,"TemplateElement")},vt.parseTemplate=function(E){E===void 0&&(E={});var L=E.isTagged;L===void 0&&(L=!1);var J=this.startNode();this.next(),J.expressions=[];var ne=this.parseTemplateElement({isTagged:L});for(J.quasis=[ne];!ne.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),J.expressions.push(this.parseExpression()),this.expect(S.braceR),J.quasis.push(ne=this.parseTemplateElement({isTagged:L}));return this.next(),this.finishNode(J,"TemplateLiteral")},vt.isAsyncProp=function(E){return!E.computed&&E.key.type==="Identifier"&&E.key.name==="async"&&(this.type===S.name||this.type===S.num||this.type===S.string||this.type===S.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===S.star)&&!A.test(this.input.slice(this.lastTokEnd,this.start))},vt.parseObj=function(E,L){var J=this.startNode(),ne=!0,xe={};for(J.properties=[],this.next();!this.eat(S.braceR);){if(ne)ne=!1;else if(this.expect(S.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(S.braceR))break;var Ke=this.parseProperty(E,L);E||this.checkPropClash(Ke,xe,L),J.properties.push(Ke)}return this.finishNode(J,E?"ObjectPattern":"ObjectExpression")},vt.parseProperty=function(E,L){var J=this.startNode(),ne,xe,Ke,et;if(this.options.ecmaVersion>=9&&this.eat(S.ellipsis))return E?(J.argument=this.parseIdent(!1),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(J,"RestElement")):(J.argument=this.parseMaybeAssign(!1,L),this.type===S.comma&&L&&L.trailingComma<0&&(L.trailingComma=this.start),this.finishNode(J,"SpreadElement"));this.options.ecmaVersion>=6&&(J.method=!1,J.shorthand=!1,(E||L)&&(Ke=this.start,et=this.startLoc),E||(ne=this.eat(S.star)));var Lt=this.containsEsc;return this.parsePropertyName(J),!E&&!Lt&&this.options.ecmaVersion>=8&&!ne&&this.isAsyncProp(J)?(xe=!0,ne=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(J)):xe=!1,this.parsePropertyValue(J,E,ne,xe,Ke,et,L,Lt),this.finishNode(J,"Property")},vt.parseGetterSetter=function(E){var L=E.key.name;this.parsePropertyName(E),E.value=this.parseMethod(!1),E.kind=L;var J=E.kind==="get"?0:1;if(E.value.params.length!==J){var ne=E.value.start;E.kind==="get"?this.raiseRecoverable(ne,"getter should have no params"):this.raiseRecoverable(ne,"setter should have exactly one param")}else E.kind==="set"&&E.value.params[0].type==="RestElement"&&this.raiseRecoverable(E.value.params[0].start,"Setter cannot use rest params")},vt.parsePropertyValue=function(E,L,J,ne,xe,Ke,et,Lt){(J||ne)&&this.type===S.colon&&this.unexpected(),this.eat(S.colon)?(E.value=L?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,et),E.kind="init"):this.options.ecmaVersion>=6&&this.type===S.parenL?(L&&this.unexpected(),E.method=!0,E.value=this.parseMethod(J,ne),E.kind="init"):!L&&!Lt&&this.options.ecmaVersion>=5&&!E.computed&&E.key.type==="Identifier"&&(E.key.name==="get"||E.key.name==="set")&&this.type!==S.comma&&this.type!==S.braceR&&this.type!==S.eq?((J||ne)&&this.unexpected(),this.parseGetterSetter(E)):this.options.ecmaVersion>=6&&!E.computed&&E.key.type==="Identifier"?((J||ne)&&this.unexpected(),this.checkUnreserved(E.key),E.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=xe),L?E.value=this.parseMaybeDefault(xe,Ke,this.copyNode(E.key)):this.type===S.eq&&et?(et.shorthandAssign<0&&(et.shorthandAssign=this.start),E.value=this.parseMaybeDefault(xe,Ke,this.copyNode(E.key))):E.value=this.copyNode(E.key),E.kind="init",E.shorthand=!0):this.unexpected()},vt.parsePropertyName=function(E){if(this.options.ecmaVersion>=6){if(this.eat(S.bracketL))return E.computed=!0,E.key=this.parseMaybeAssign(),this.expect(S.bracketR),E.key;E.computed=!1}return E.key=this.type===S.num||this.type===S.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},vt.initFunction=function(E){E.id=null,this.options.ecmaVersion>=6&&(E.generator=E.expression=!1),this.options.ecmaVersion>=8&&(E.async=!1)},vt.parseMethod=function(E,L,J){var ne=this.startNode(),xe=this.yieldPos,Ke=this.awaitPos,et=this.awaitIdentPos;return this.initFunction(ne),this.options.ecmaVersion>=6&&(ne.generator=E),this.options.ecmaVersion>=8&&(ne.async=!!L),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Pe(L,ne.generator)|Ie|(J?qe:0)),this.expect(S.parenL),ne.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(ne,!1,!0,!1),this.yieldPos=xe,this.awaitPos=Ke,this.awaitIdentPos=et,this.finishNode(ne,"FunctionExpression")},vt.parseArrowExpression=function(E,L,J,ne){var xe=this.yieldPos,Ke=this.awaitPos,et=this.awaitIdentPos;return this.enterScope(Pe(J,!1)|pe),this.initFunction(E),this.options.ecmaVersion>=8&&(E.async=!!J),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,E.params=this.toAssignableList(L,!0),this.parseFunctionBody(E,!0,!1,ne),this.yieldPos=xe,this.awaitPos=Ke,this.awaitIdentPos=et,this.finishNode(E,"ArrowFunctionExpression")},vt.parseFunctionBody=function(E,L,J,ne){var xe=L&&this.type!==S.braceL,Ke=this.strict,et=!1;if(xe)E.body=this.parseMaybeAssign(ne),E.expression=!0,this.checkParams(E,!1);else{var Lt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(E.params);(!Ke||Lt)&&(et=this.strictDirective(this.end),et&&Lt&&this.raiseRecoverable(E.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var zt=this.labels;this.labels=[],et&&(this.strict=!0),this.checkParams(E,!Ke&&!et&&!L&&!J&&this.isSimpleParamList(E.params)),this.strict&&E.id&&this.checkLValSimple(E.id,fe),E.body=this.parseBlock(!1,void 0,et&&!Ke),E.expression=!1,this.adaptDirectivePrologue(E.body.body),this.labels=zt}this.exitScope()},vt.isSimpleParamList=function(E){for(var L=0,J=E;L<J.length;L+=1){var ne=J[L];if(ne.type!=="Identifier")return!1}return!0},vt.checkParams=function(E,L){for(var J=Object.create(null),ne=0,xe=E.params;ne<xe.length;ne+=1){var Ke=xe[ne];this.checkLValInnerPattern(Ke,$e,L?null:J)}},vt.parseExprList=function(E,L,J,ne){for(var xe=[],Ke=!0;!this.eat(E);){if(Ke)Ke=!1;else if(this.expect(S.comma),L&&this.afterTrailingComma(E))break;var et=void 0;J&&this.type===S.comma?et=null:this.type===S.ellipsis?(et=this.parseSpread(ne),ne&&this.type===S.comma&&ne.trailingComma<0&&(ne.trailingComma=this.start)):et=this.parseMaybeAssign(!1,ne),xe.push(et)}return xe},vt.checkUnreserved=function(E){var L=E.start,J=E.end,ne=E.name;if(this.inGenerator&&ne==="yield"&&this.raiseRecoverable(L,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&ne==="await"&&this.raiseRecoverable(L,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&Ae)&&ne==="arguments"&&this.raiseRecoverable(L,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(ne==="arguments"||ne==="await")&&this.raise(L,"Cannot use "+ne+" in class static initialization block"),this.keywords.test(ne)&&this.raise(L,"Unexpected keyword '"+ne+"'"),!(this.options.ecmaVersion<6&&this.input.slice(L,J).indexOf("\\")!==-1)){var xe=this.strict?this.reservedWordsStrict:this.reservedWords;xe.test(ne)&&(!this.inAsync&&ne==="await"&&this.raiseRecoverable(L,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(L,"The keyword '"+ne+"' is reserved"))}},vt.parseIdent=function(E){var L=this.parseIdentNode();return this.next(!!E),this.finishNode(L,"Identifier"),E||(this.checkUnreserved(L),L.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=L.start)),L},vt.parseIdentNode=function(){var E=this.startNode();return this.type===S.name?E.name=this.value:this.type.keyword?(E.name=this.type.keyword,(E.name==="class"||E.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=S.name):this.unexpected(),E},vt.parsePrivateIdent=function(){var E=this.startNode();return this.type===S.privateId?E.name=this.value:this.unexpected(),this.next(),this.finishNode(E,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(E.start,"Private field '#"+E.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(E)),E},vt.parseYield=function(E){this.yieldPos||(this.yieldPos=this.start);var L=this.startNode();return this.next(),this.type===S.semi||this.canInsertSemicolon()||this.type!==S.star&&!this.type.startsExpr?(L.delegate=!1,L.argument=null):(L.delegate=this.eat(S.star),L.argument=this.parseMaybeAssign(E)),this.finishNode(L,"YieldExpression")},vt.parseAwait=function(E){this.awaitPos||(this.awaitPos=this.start);var L=this.startNode();return this.next(),L.argument=this.parseMaybeUnary(null,!0,!1,E),this.finishNode(L,"AwaitExpression")};var Gn=me.prototype;Gn.raise=function(E,L){var J=de(this.input,E);L+=" ("+J.line+":"+J.column+")",this.sourceFile&&(L+=" in "+this.sourceFile);var ne=new SyntaxError(L);throw ne.pos=E,ne.loc=J,ne.raisedAt=this.pos,ne},Gn.raiseRecoverable=Gn.raise,Gn.curPosition=function(){if(this.options.locations)return new Z(this.curLine,this.pos-this.lineStart)};var bn=me.prototype,Jn=function(L){this.flags=L,this.var=[],this.lexical=[],this.functions=[]};bn.enterScope=function(E){this.scopeStack.push(new Jn(E))},bn.exitScope=function(){this.scopeStack.pop()},bn.treatFunctionsAsVarInScope=function(E){return E.flags&Ne||!this.inModule&&E.flags&ke},bn.declareName=function(E,L,J){var ne=!1;if(L===ie){var xe=this.currentScope();ne=xe.lexical.indexOf(E)>-1||xe.functions.indexOf(E)>-1||xe.var.indexOf(E)>-1,xe.lexical.push(E),this.inModule&&xe.flags&ke&&delete this.undefinedExports[E]}else if(L===ce){var Ke=this.currentScope();Ke.lexical.push(E)}else if(L===K){var et=this.currentScope();this.treatFunctionsAsVar?ne=et.lexical.indexOf(E)>-1:ne=et.lexical.indexOf(E)>-1||et.var.indexOf(E)>-1,et.functions.push(E)}else for(var Lt=this.scopeStack.length-1;Lt>=0;--Lt){var zt=this.scopeStack[Lt];if(zt.lexical.indexOf(E)>-1&&!(zt.flags&Fe&&zt.lexical[0]===E)||!this.treatFunctionsAsVarInScope(zt)&&zt.functions.indexOf(E)>-1){ne=!0;break}if(zt.var.push(E),this.inModule&&zt.flags&ke&&delete this.undefinedExports[E],zt.flags&Ae)break}ne&&this.raiseRecoverable(J,"Identifier '"+E+"' has already been declared")},bn.checkLocalExport=function(E){this.scopeStack[0].lexical.indexOf(E.name)===-1&&this.scopeStack[0].var.indexOf(E.name)===-1&&(this.undefinedExports[E.name]=E)},bn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},bn.currentVarScope=function(){for(var E=this.scopeStack.length-1;;E--){var L=this.scopeStack[E];if(L.flags&(Ae|Te|we))return L}},bn.currentThisScope=function(){for(var E=this.scopeStack.length-1;;E--){var L=this.scopeStack[E];if(L.flags&(Ae|Te|we)&&!(L.flags&pe))return L}};var ai=function(L,J,ne){this.type="",this.start=J,this.end=0,L.options.locations&&(this.loc=new V(L,ne)),L.options.directSourceFile&&(this.sourceFile=L.options.directSourceFile),L.options.ranges&&(this.range=[J,0])},vi=me.prototype;vi.startNode=function(){return new ai(this,this.start,this.startLoc)},vi.startNodeAt=function(E,L){return new ai(this,E,L)};function Yn(E,L,J,ne){return E.type=L,E.end=J,this.options.locations&&(E.loc.end=ne),this.options.ranges&&(E.range[1]=J),E}vi.finishNode=function(E,L){return Yn.call(this,E,L,this.lastTokEnd,this.lastTokEndLoc)},vi.finishNodeAt=function(E,L,J,ne){return Yn.call(this,E,L,J,ne)},vi.copyNode=function(E){var L=new ai(this,E.start,this.startLoc);for(var J in E)L[J]=E[J];return L};var Yi="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",ci="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",hn=ci+" Extended_Pictographic",ui=hn,$n=ui+" EBase EComp EMod EPres ExtPict",re=$n,ge=re,je={9:ci,10:hn,11:ui,12:$n,13:re,14:ge},rt="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",dt={9:"",10:"",11:"",12:"",13:"",14:rt},ot="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",kt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ee=kt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ye=ee+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ce=ye+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",De=Ce+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ve=De+" "+Yi,_t={9:kt,10:ee,11:ye,12:Ce,13:De,14:ve},lt={};function yt(E){var L=lt[E]={binary:W(je[E]+" "+ot),binaryOfStrings:W(dt[E]),nonBinary:{General_Category:W(ot),Script:W(_t[E])}};L.nonBinary.Script_Extensions=L.nonBinary.Script,L.nonBinary.gc=L.nonBinary.General_Category,L.nonBinary.sc=L.nonBinary.Script,L.nonBinary.scx=L.nonBinary.Script_Extensions}for(var St=0,Nt=[9,10,11,12,13,14];St<Nt.length;St+=1){var Ht=Nt[St];yt(Ht)}var at=me.prototype,nn=function(L,J){this.parent=L,this.base=J||this};nn.prototype.separatedFrom=function(L){for(var J=this;J;J=J.parent)for(var ne=L;ne;ne=ne.parent)if(J.base===ne.base&&J!==ne)return!0;return!1},nn.prototype.sibling=function(){return new nn(this.parent,this.base)};var un=function(L){this.parser=L,this.validFlags="gim"+(L.options.ecmaVersion>=6?"uy":"")+(L.options.ecmaVersion>=9?"s":"")+(L.options.ecmaVersion>=13?"d":"")+(L.options.ecmaVersion>=15?"v":""),this.unicodeProperties=lt[L.options.ecmaVersion>=14?14:L.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};un.prototype.reset=function(L,J,ne){var xe=ne.indexOf("v")!==-1,Ke=ne.indexOf("u")!==-1;this.start=L|0,this.source=J+"",this.flags=ne,xe&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=Ke&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=Ke&&this.parser.options.ecmaVersion>=9)},un.prototype.raise=function(L){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+L)},un.prototype.at=function(L,J){J===void 0&&(J=!1);var ne=this.source,xe=ne.length;if(L>=xe)return-1;var Ke=ne.charCodeAt(L);if(!(J||this.switchU)||Ke<=55295||Ke>=57344||L+1>=xe)return Ke;var et=ne.charCodeAt(L+1);return et>=56320&&et<=57343?(Ke<<10)+et-56613888:Ke},un.prototype.nextIndex=function(L,J){J===void 0&&(J=!1);var ne=this.source,xe=ne.length;if(L>=xe)return xe;var Ke=ne.charCodeAt(L),et;return!(J||this.switchU)||Ke<=55295||Ke>=57344||L+1>=xe||(et=ne.charCodeAt(L+1))<56320||et>57343?L+1:L+2},un.prototype.current=function(L){return L===void 0&&(L=!1),this.at(this.pos,L)},un.prototype.lookahead=function(L){return L===void 0&&(L=!1),this.at(this.nextIndex(this.pos,L),L)},un.prototype.advance=function(L){L===void 0&&(L=!1),this.pos=this.nextIndex(this.pos,L)},un.prototype.eat=function(L,J){return J===void 0&&(J=!1),this.current(J)===L?(this.advance(J),!0):!1},un.prototype.eatChars=function(L,J){J===void 0&&(J=!1);for(var ne=this.pos,xe=0,Ke=L;xe<Ke.length;xe+=1){var et=Ke[xe],Lt=this.at(ne,J);if(Lt===-1||Lt!==et)return!1;ne=this.nextIndex(ne,J)}return this.pos=ne,!0},at.validateRegExpFlags=function(E){for(var L=E.validFlags,J=E.flags,ne=!1,xe=!1,Ke=0;Ke<J.length;Ke++){var et=J.charAt(Ke);L.indexOf(et)===-1&&this.raise(E.start,"Invalid regular expression flag"),J.indexOf(et,Ke+1)>-1&&this.raise(E.start,"Duplicate regular expression flag"),et==="u"&&(ne=!0),et==="v"&&(xe=!0)}this.options.ecmaVersion>=15&&ne&&xe&&this.raise(E.start,"Invalid regular expression flag")};function dn(E){for(var L in E)return!0;return!1}at.validateRegExpPattern=function(E){this.regexp_pattern(E),!E.switchN&&this.options.ecmaVersion>=9&&dn(E.groupNames)&&(E.switchN=!0,this.regexp_pattern(E))},at.regexp_pattern=function(E){E.pos=0,E.lastIntValue=0,E.lastStringValue="",E.lastAssertionIsQuantifiable=!1,E.numCapturingParens=0,E.maxBackReference=0,E.groupNames=Object.create(null),E.backReferenceNames.length=0,E.branchID=null,this.regexp_disjunction(E),E.pos!==E.source.length&&(E.eat(41)&&E.raise("Unmatched ')'"),(E.eat(93)||E.eat(125))&&E.raise("Lone quantifier brackets")),E.maxBackReference>E.numCapturingParens&&E.raise("Invalid escape");for(var L=0,J=E.backReferenceNames;L<J.length;L+=1){var ne=J[L];E.groupNames[ne]||E.raise("Invalid named capture referenced")}},at.regexp_disjunction=function(E){var L=this.options.ecmaVersion>=16;for(L&&(E.branchID=new nn(E.branchID,null)),this.regexp_alternative(E);E.eat(124);)L&&(E.branchID=E.branchID.sibling()),this.regexp_alternative(E);L&&(E.branchID=E.branchID.parent),this.regexp_eatQuantifier(E,!0)&&E.raise("Nothing to repeat"),E.eat(123)&&E.raise("Lone quantifier brackets")},at.regexp_alternative=function(E){for(;E.pos<E.source.length&&this.regexp_eatTerm(E););},at.regexp_eatTerm=function(E){return this.regexp_eatAssertion(E)?(E.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(E)&&E.switchU&&E.raise("Invalid quantifier"),!0):(E.switchU?this.regexp_eatAtom(E):this.regexp_eatExtendedAtom(E))?(this.regexp_eatQuantifier(E),!0):!1},at.regexp_eatAssertion=function(E){var L=E.pos;if(E.lastAssertionIsQuantifiable=!1,E.eat(94)||E.eat(36))return!0;if(E.eat(92)){if(E.eat(66)||E.eat(98))return!0;E.pos=L}if(E.eat(40)&&E.eat(63)){var J=!1;if(this.options.ecmaVersion>=9&&(J=E.eat(60)),E.eat(61)||E.eat(33))return this.regexp_disjunction(E),E.eat(41)||E.raise("Unterminated group"),E.lastAssertionIsQuantifiable=!J,!0}return E.pos=L,!1},at.regexp_eatQuantifier=function(E,L){return L===void 0&&(L=!1),this.regexp_eatQuantifierPrefix(E,L)?(E.eat(63),!0):!1},at.regexp_eatQuantifierPrefix=function(E,L){return E.eat(42)||E.eat(43)||E.eat(63)||this.regexp_eatBracedQuantifier(E,L)},at.regexp_eatBracedQuantifier=function(E,L){var J=E.pos;if(E.eat(123)){var ne=0,xe=-1;if(this.regexp_eatDecimalDigits(E)&&(ne=E.lastIntValue,E.eat(44)&&this.regexp_eatDecimalDigits(E)&&(xe=E.lastIntValue),E.eat(125)))return xe!==-1&&xe<ne&&!L&&E.raise("numbers out of order in {} quantifier"),!0;E.switchU&&!L&&E.raise("Incomplete quantifier"),E.pos=J}return!1},at.regexp_eatAtom=function(E){return this.regexp_eatPatternCharacters(E)||E.eat(46)||this.regexp_eatReverseSolidusAtomEscape(E)||this.regexp_eatCharacterClass(E)||this.regexp_eatUncapturingGroup(E)||this.regexp_eatCapturingGroup(E)},at.regexp_eatReverseSolidusAtomEscape=function(E){var L=E.pos;if(E.eat(92)){if(this.regexp_eatAtomEscape(E))return!0;E.pos=L}return!1},at.regexp_eatUncapturingGroup=function(E){var L=E.pos;if(E.eat(40)){if(E.eat(63)){if(this.options.ecmaVersion>=16){var J=this.regexp_eatModifiers(E),ne=E.eat(45);if(J||ne){for(var xe=0;xe<J.length;xe++){var Ke=J.charAt(xe);J.indexOf(Ke,xe+1)>-1&&E.raise("Duplicate regular expression modifiers")}if(ne){var et=this.regexp_eatModifiers(E);!J&&!et&&E.current()===58&&E.raise("Invalid regular expression modifiers");for(var Lt=0;Lt<et.length;Lt++){var zt=et.charAt(Lt);(et.indexOf(zt,Lt+1)>-1||J.indexOf(zt)>-1)&&E.raise("Duplicate regular expression modifiers")}}}}if(E.eat(58)){if(this.regexp_disjunction(E),E.eat(41))return!0;E.raise("Unterminated group")}}E.pos=L}return!1},at.regexp_eatCapturingGroup=function(E){if(E.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(E):E.current()===63&&E.raise("Invalid group"),this.regexp_disjunction(E),E.eat(41))return E.numCapturingParens+=1,!0;E.raise("Unterminated group")}return!1},at.regexp_eatModifiers=function(E){for(var L="",J=0;(J=E.current())!==-1&&On(J);)L+=F(J),E.advance();return L};function On(E){return E===105||E===109||E===115}at.regexp_eatExtendedAtom=function(E){return E.eat(46)||this.regexp_eatReverseSolidusAtomEscape(E)||this.regexp_eatCharacterClass(E)||this.regexp_eatUncapturingGroup(E)||this.regexp_eatCapturingGroup(E)||this.regexp_eatInvalidBracedQuantifier(E)||this.regexp_eatExtendedPatternCharacter(E)},at.regexp_eatInvalidBracedQuantifier=function(E){return this.regexp_eatBracedQuantifier(E,!0)&&E.raise("Nothing to repeat"),!1},at.regexp_eatSyntaxCharacter=function(E){var L=E.current();return $t(L)?(E.lastIntValue=L,E.advance(),!0):!1};function $t(E){return E===36||E>=40&&E<=43||E===46||E===63||E>=91&&E<=94||E>=123&&E<=125}at.regexp_eatPatternCharacters=function(E){for(var L=E.pos,J=0;(J=E.current())!==-1&&!$t(J);)E.advance();return E.pos!==L},at.regexp_eatExtendedPatternCharacter=function(E){var L=E.current();return L!==-1&&L!==36&&!(L>=40&&L<=43)&&L!==46&&L!==63&&L!==91&&L!==94&&L!==124?(E.advance(),!0):!1},at.regexp_groupSpecifier=function(E){if(E.eat(63)){this.regexp_eatGroupName(E)||E.raise("Invalid group");var L=this.options.ecmaVersion>=16,J=E.groupNames[E.lastStringValue];if(J)if(L)for(var ne=0,xe=J;ne<xe.length;ne+=1){var Ke=xe[ne];Ke.separatedFrom(E.branchID)||E.raise("Duplicate capture group name")}else E.raise("Duplicate capture group name");L?(J||(E.groupNames[E.lastStringValue]=[])).push(E.branchID):E.groupNames[E.lastStringValue]=!0}},at.regexp_eatGroupName=function(E){if(E.lastStringValue="",E.eat(60)){if(this.regexp_eatRegExpIdentifierName(E)&&E.eat(62))return!0;E.raise("Invalid capture group name")}return!1},at.regexp_eatRegExpIdentifierName=function(E){if(E.lastStringValue="",this.regexp_eatRegExpIdentifierStart(E)){for(E.lastStringValue+=F(E.lastIntValue);this.regexp_eatRegExpIdentifierPart(E);)E.lastStringValue+=F(E.lastIntValue);return!0}return!1},at.regexp_eatRegExpIdentifierStart=function(E){var L=E.pos,J=this.options.ecmaVersion>=11,ne=E.current(J);return E.advance(J),ne===92&&this.regexp_eatRegExpUnicodeEscapeSequence(E,J)&&(ne=E.lastIntValue),Yt(ne)?(E.lastIntValue=ne,!0):(E.pos=L,!1)};function Yt(E){return g(E,!0)||E===36||E===95}at.regexp_eatRegExpIdentifierPart=function(E){var L=E.pos,J=this.options.ecmaVersion>=11,ne=E.current(J);return E.advance(J),ne===92&&this.regexp_eatRegExpUnicodeEscapeSequence(E,J)&&(ne=E.lastIntValue),Pn(ne)?(E.lastIntValue=ne,!0):(E.pos=L,!1)};function Pn(E){return b(E,!0)||E===36||E===95||E===8204||E===8205}at.regexp_eatAtomEscape=function(E){return this.regexp_eatBackReference(E)||this.regexp_eatCharacterClassEscape(E)||this.regexp_eatCharacterEscape(E)||E.switchN&&this.regexp_eatKGroupName(E)?!0:(E.switchU&&(E.current()===99&&E.raise("Invalid unicode escape"),E.raise("Invalid escape")),!1)},at.regexp_eatBackReference=function(E){var L=E.pos;if(this.regexp_eatDecimalEscape(E)){var J=E.lastIntValue;if(E.switchU)return J>E.maxBackReference&&(E.maxBackReference=J),!0;if(J<=E.numCapturingParens)return!0;E.pos=L}return!1},at.regexp_eatKGroupName=function(E){if(E.eat(107)){if(this.regexp_eatGroupName(E))return E.backReferenceNames.push(E.lastStringValue),!0;E.raise("Invalid named reference")}return!1},at.regexp_eatCharacterEscape=function(E){return this.regexp_eatControlEscape(E)||this.regexp_eatCControlLetter(E)||this.regexp_eatZero(E)||this.regexp_eatHexEscapeSequence(E)||this.regexp_eatRegExpUnicodeEscapeSequence(E,!1)||!E.switchU&&this.regexp_eatLegacyOctalEscapeSequence(E)||this.regexp_eatIdentityEscape(E)},at.regexp_eatCControlLetter=function(E){var L=E.pos;if(E.eat(99)){if(this.regexp_eatControlLetter(E))return!0;E.pos=L}return!1},at.regexp_eatZero=function(E){return E.current()===48&&!Ji(E.lookahead())?(E.lastIntValue=0,E.advance(),!0):!1},at.regexp_eatControlEscape=function(E){var L=E.current();return L===116?(E.lastIntValue=9,E.advance(),!0):L===110?(E.lastIntValue=10,E.advance(),!0):L===118?(E.lastIntValue=11,E.advance(),!0):L===102?(E.lastIntValue=12,E.advance(),!0):L===114?(E.lastIntValue=13,E.advance(),!0):!1},at.regexp_eatControlLetter=function(E){var L=E.current();return wn(L)?(E.lastIntValue=L%32,E.advance(),!0):!1};function wn(E){return E>=65&&E<=90||E>=97&&E<=122}at.regexp_eatRegExpUnicodeEscapeSequence=function(E,L){L===void 0&&(L=!1);var J=E.pos,ne=L||E.switchU;if(E.eat(117)){if(this.regexp_eatFixedHexDigits(E,4)){var xe=E.lastIntValue;if(ne&&xe>=55296&&xe<=56319){var Ke=E.pos;if(E.eat(92)&&E.eat(117)&&this.regexp_eatFixedHexDigits(E,4)){var et=E.lastIntValue;if(et>=56320&&et<=57343)return E.lastIntValue=(xe-55296)*1024+(et-56320)+65536,!0}E.pos=Ke,E.lastIntValue=xe}return!0}if(ne&&E.eat(123)&&this.regexp_eatHexDigits(E)&&E.eat(125)&&Xn(E.lastIntValue))return!0;ne&&E.raise("Invalid unicode escape"),E.pos=J}return!1};function Xn(E){return E>=0&&E<=1114111}at.regexp_eatIdentityEscape=function(E){if(E.switchU)return this.regexp_eatSyntaxCharacter(E)?!0:E.eat(47)?(E.lastIntValue=47,!0):!1;var L=E.current();return L!==99&&(!E.switchN||L!==107)?(E.lastIntValue=L,E.advance(),!0):!1},at.regexp_eatDecimalEscape=function(E){E.lastIntValue=0;var L=E.current();if(L>=49&&L<=57){do E.lastIntValue=10*E.lastIntValue+(L-48),E.advance();while((L=E.current())>=48&&L<=57);return!0}return!1};var En=0,Mn=1,pn=2;at.regexp_eatCharacterClassEscape=function(E){var L=E.current();if(rn(L))return E.lastIntValue=-1,E.advance(),Mn;var J=!1;if(E.switchU&&this.options.ecmaVersion>=9&&((J=L===80)||L===112)){E.lastIntValue=-1,E.advance();var ne;if(E.eat(123)&&(ne=this.regexp_eatUnicodePropertyValueExpression(E))&&E.eat(125))return J&&ne===pn&&E.raise("Invalid property name"),ne;E.raise("Invalid property name")}return En};function rn(E){return E===100||E===68||E===115||E===83||E===119||E===87}at.regexp_eatUnicodePropertyValueExpression=function(E){var L=E.pos;if(this.regexp_eatUnicodePropertyName(E)&&E.eat(61)){var J=E.lastStringValue;if(this.regexp_eatUnicodePropertyValue(E)){var ne=E.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(E,J,ne),Mn}}if(E.pos=L,this.regexp_eatLoneUnicodePropertyNameOrValue(E)){var xe=E.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(E,xe)}return En},at.regexp_validateUnicodePropertyNameAndValue=function(E,L,J){B(E.unicodeProperties.nonBinary,L)||E.raise("Invalid property name"),E.unicodeProperties.nonBinary[L].test(J)||E.raise("Invalid property value")},at.regexp_validateUnicodePropertyNameOrValue=function(E,L){if(E.unicodeProperties.binary.test(L))return Mn;if(E.switchV&&E.unicodeProperties.binaryOfStrings.test(L))return pn;E.raise("Invalid property name")},at.regexp_eatUnicodePropertyName=function(E){var L=0;for(E.lastStringValue="";yi(L=E.current());)E.lastStringValue+=F(L),E.advance();return E.lastStringValue!==""};function yi(E){return wn(E)||E===95}at.regexp_eatUnicodePropertyValue=function(E){var L=0;for(E.lastStringValue="";Li(L=E.current());)E.lastStringValue+=F(L),E.advance();return E.lastStringValue!==""};function Li(E){return yi(E)||Ji(E)}at.regexp_eatLoneUnicodePropertyNameOrValue=function(E){return this.regexp_eatUnicodePropertyValue(E)},at.regexp_eatCharacterClass=function(E){if(E.eat(91)){var L=E.eat(94),J=this.regexp_classContents(E);return E.eat(93)||E.raise("Unterminated character class"),L&&J===pn&&E.raise("Negated character class may contain strings"),!0}return!1},at.regexp_classContents=function(E){return E.current()===93?Mn:E.switchV?this.regexp_classSetExpression(E):(this.regexp_nonEmptyClassRanges(E),Mn)},at.regexp_nonEmptyClassRanges=function(E){for(;this.regexp_eatClassAtom(E);){var L=E.lastIntValue;if(E.eat(45)&&this.regexp_eatClassAtom(E)){var J=E.lastIntValue;E.switchU&&(L===-1||J===-1)&&E.raise("Invalid character class"),L!==-1&&J!==-1&&L>J&&E.raise("Range out of order in character class")}}},at.regexp_eatClassAtom=function(E){var L=E.pos;if(E.eat(92)){if(this.regexp_eatClassEscape(E))return!0;if(E.switchU){var J=E.current();(J===99||ao(J))&&E.raise("Invalid class escape"),E.raise("Invalid escape")}E.pos=L}var ne=E.current();return ne!==93?(E.lastIntValue=ne,E.advance(),!0):!1},at.regexp_eatClassEscape=function(E){var L=E.pos;if(E.eat(98))return E.lastIntValue=8,!0;if(E.switchU&&E.eat(45))return E.lastIntValue=45,!0;if(!E.switchU&&E.eat(99)){if(this.regexp_eatClassControlLetter(E))return!0;E.pos=L}return this.regexp_eatCharacterClassEscape(E)||this.regexp_eatCharacterEscape(E)},at.regexp_classSetExpression=function(E){var L=Mn,J;if(!this.regexp_eatClassSetRange(E))if(J=this.regexp_eatClassSetOperand(E)){J===pn&&(L=pn);for(var ne=E.pos;E.eatChars([38,38]);){if(E.current()!==38&&(J=this.regexp_eatClassSetOperand(E))){J!==pn&&(L=Mn);continue}E.raise("Invalid character in character class")}if(ne!==E.pos)return L;for(;E.eatChars([45,45]);)this.regexp_eatClassSetOperand(E)||E.raise("Invalid character in character class");if(ne!==E.pos)return L}else E.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(E)){if(J=this.regexp_eatClassSetOperand(E),!J)return L;J===pn&&(L=pn)}},at.regexp_eatClassSetRange=function(E){var L=E.pos;if(this.regexp_eatClassSetCharacter(E)){var J=E.lastIntValue;if(E.eat(45)&&this.regexp_eatClassSetCharacter(E)){var ne=E.lastIntValue;return J!==-1&&ne!==-1&&J>ne&&E.raise("Range out of order in character class"),!0}E.pos=L}return!1},at.regexp_eatClassSetOperand=function(E){return this.regexp_eatClassSetCharacter(E)?Mn:this.regexp_eatClassStringDisjunction(E)||this.regexp_eatNestedClass(E)},at.regexp_eatNestedClass=function(E){var L=E.pos;if(E.eat(91)){var J=E.eat(94),ne=this.regexp_classContents(E);if(E.eat(93))return J&&ne===pn&&E.raise("Negated character class may contain strings"),ne;E.pos=L}if(E.eat(92)){var xe=this.regexp_eatCharacterClassEscape(E);if(xe)return xe;E.pos=L}return null},at.regexp_eatClassStringDisjunction=function(E){var L=E.pos;if(E.eatChars([92,113])){if(E.eat(123)){var J=this.regexp_classStringDisjunctionContents(E);if(E.eat(125))return J}else E.raise("Invalid escape");E.pos=L}return null},at.regexp_classStringDisjunctionContents=function(E){for(var L=this.regexp_classString(E);E.eat(124);)this.regexp_classString(E)===pn&&(L=pn);return L},at.regexp_classString=function(E){for(var L=0;this.regexp_eatClassSetCharacter(E);)L++;return L===1?Mn:pn},at.regexp_eatClassSetCharacter=function(E){var L=E.pos;if(E.eat(92))return this.regexp_eatCharacterEscape(E)||this.regexp_eatClassSetReservedPunctuator(E)?!0:E.eat(98)?(E.lastIntValue=8,!0):(E.pos=L,!1);var J=E.current();return J<0||J===E.lookahead()&&Wn(J)||Oi(J)?!1:(E.advance(),E.lastIntValue=J,!0)};function Wn(E){return E===33||E>=35&&E<=38||E>=42&&E<=44||E===46||E>=58&&E<=64||E===94||E===96||E===126}function Oi(E){return E===40||E===41||E===45||E===47||E>=91&&E<=93||E>=123&&E<=125}at.regexp_eatClassSetReservedPunctuator=function(E){var L=E.current();return ya(L)?(E.lastIntValue=L,E.advance(),!0):!1};function ya(E){return E===33||E===35||E===37||E===38||E===44||E===45||E>=58&&E<=62||E===64||E===96||E===126}at.regexp_eatClassControlLetter=function(E){var L=E.current();return Ji(L)||L===95?(E.lastIntValue=L%32,E.advance(),!0):!1},at.regexp_eatHexEscapeSequence=function(E){var L=E.pos;if(E.eat(120)){if(this.regexp_eatFixedHexDigits(E,2))return!0;E.switchU&&E.raise("Invalid escape"),E.pos=L}return!1},at.regexp_eatDecimalDigits=function(E){var L=E.pos,J=0;for(E.lastIntValue=0;Ji(J=E.current());)E.lastIntValue=10*E.lastIntValue+(J-48),E.advance();return E.pos!==L};function Ji(E){return E>=48&&E<=57}at.regexp_eatHexDigits=function(E){var L=E.pos,J=0;for(E.lastIntValue=0;Xo(J=E.current());)E.lastIntValue=16*E.lastIntValue+Bs(J),E.advance();return E.pos!==L};function Xo(E){return E>=48&&E<=57||E>=65&&E<=70||E>=97&&E<=102}function Bs(E){return E>=65&&E<=70?10+(E-65):E>=97&&E<=102?10+(E-97):E-48}at.regexp_eatLegacyOctalEscapeSequence=function(E){if(this.regexp_eatOctalDigit(E)){var L=E.lastIntValue;if(this.regexp_eatOctalDigit(E)){var J=E.lastIntValue;L<=3&&this.regexp_eatOctalDigit(E)?E.lastIntValue=L*64+J*8+E.lastIntValue:E.lastIntValue=L*8+J}else E.lastIntValue=L;return!0}return!1},at.regexp_eatOctalDigit=function(E){var L=E.current();return ao(L)?(E.lastIntValue=L-48,E.advance(),!0):(E.lastIntValue=0,!1)};function ao(E){return E>=48&&E<=55}at.regexp_eatFixedHexDigits=function(E,L){var J=E.pos;E.lastIntValue=0;for(var ne=0;ne<L;++ne){var xe=E.current();if(!Xo(xe))return E.pos=J,!1;E.lastIntValue=16*E.lastIntValue+Bs(xe),E.advance()}return!0};var so=function(L){this.type=L.type,this.value=L.value,this.start=L.start,this.end=L.end,L.options.locations&&(this.loc=new V(L,L.startLoc,L.endLoc)),L.options.ranges&&(this.range=[L.start,L.end])},In=me.prototype;In.next=function(E){!E&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new so(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},In.getToken=function(){return this.next(),new so(this)},typeof Symbol<"u"&&(In[Symbol.iterator]=function(){var E=this;return{next:function(){var L=E.getToken();return{done:L.type===S.eof,value:L}}}}),In.nextToken=function(){var E=this.curContext();if((!E||!E.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(S.eof);if(E.override)return E.override(this);this.readToken(this.fullCharCodeAtPos())},In.readToken=function(E){return g(E,this.options.ecmaVersion>=6)||E===92?this.readWord():this.getTokenFromCode(E)},In.fullCharCodeAtPos=function(){var E=this.input.charCodeAt(this.pos);if(E<=55295||E>=56320)return E;var L=this.input.charCodeAt(this.pos+1);return L<=56319||L>=57344?E:(E<<10)+L-56613888},In.skipBlockComment=function(){var E=this.options.onComment&&this.curPosition(),L=this.pos,J=this.input.indexOf("*/",this.pos+=2);if(J===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=J+2,this.options.locations)for(var ne=void 0,xe=L;(ne=R(this.input,xe,this.pos))>-1;)++this.curLine,xe=this.lineStart=ne;this.options.onComment&&this.options.onComment(!0,this.input.slice(L+2,J),L,this.pos,E,this.curPosition())},In.skipLineComment=function(E){for(var L=this.pos,J=this.options.onComment&&this.curPosition(),ne=this.input.charCodeAt(this.pos+=E);this.pos<this.input.length&&!D(ne);)ne=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(L+E,this.pos),L,this.pos,J,this.curPosition())},In.skipSpace=function(){e:for(;this.pos<this.input.length;){var E=this.input.charCodeAt(this.pos);switch(E){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(E>8&&E<14||E>=5760&&N.test(String.fromCharCode(E)))++this.pos;else break e}}},In.finishToken=function(E,L){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var J=this.type;this.type=E,this.value=L,this.updateContext(J)},In.readToken_dot=function(){var E=this.input.charCodeAt(this.pos+1);if(E>=48&&E<=57)return this.readNumber(!0);var L=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&E===46&&L===46?(this.pos+=3,this.finishToken(S.ellipsis)):(++this.pos,this.finishToken(S.dot))},In.readToken_slash=function(){var E=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):E===61?this.finishOp(S.assign,2):this.finishOp(S.slash,1)},In.readToken_mult_modulo_exp=function(E){var L=this.input.charCodeAt(this.pos+1),J=1,ne=E===42?S.star:S.modulo;return this.options.ecmaVersion>=7&&E===42&&L===42&&(++J,ne=S.starstar,L=this.input.charCodeAt(this.pos+2)),L===61?this.finishOp(S.assign,J+1):this.finishOp(ne,J)},In.readToken_pipe_amp=function(E){var L=this.input.charCodeAt(this.pos+1);if(L===E){if(this.options.ecmaVersion>=12){var J=this.input.charCodeAt(this.pos+2);if(J===61)return this.finishOp(S.assign,3)}return this.finishOp(E===124?S.logicalOR:S.logicalAND,2)}return L===61?this.finishOp(S.assign,2):this.finishOp(E===124?S.bitwiseOR:S.bitwiseAND,1)},In.readToken_caret=function(){var E=this.input.charCodeAt(this.pos+1);return E===61?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},In.readToken_plus_min=function(E){var L=this.input.charCodeAt(this.pos+1);return L===E?L===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||A.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(S.incDec,2):L===61?this.finishOp(S.assign,2):this.finishOp(S.plusMin,1)},In.readToken_lt_gt=function(E){var L=this.input.charCodeAt(this.pos+1),J=1;return L===E?(J=E===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+J)===61?this.finishOp(S.assign,J+1):this.finishOp(S.bitShift,J)):L===33&&E===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(L===61&&(J=2),this.finishOp(S.relational,J))},In.readToken_eq_excl=function(E){var L=this.input.charCodeAt(this.pos+1);return L===61?this.finishOp(S.equality,this.input.charCodeAt(this.pos+2)===61?3:2):E===61&&L===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(S.arrow)):this.finishOp(E===61?S.eq:S.prefix,1)},In.readToken_question=function(){var E=this.options.ecmaVersion;if(E>=11){var L=this.input.charCodeAt(this.pos+1);if(L===46){var J=this.input.charCodeAt(this.pos+2);if(J<48||J>57)return this.finishOp(S.questionDot,2)}if(L===63){if(E>=12){var ne=this.input.charCodeAt(this.pos+2);if(ne===61)return this.finishOp(S.assign,3)}return this.finishOp(S.coalesce,2)}}return this.finishOp(S.question,1)},In.readToken_numberSign=function(){var E=this.options.ecmaVersion,L=35;if(E>=13&&(++this.pos,L=this.fullCharCodeAtPos(),g(L,!0)||L===92))return this.finishToken(S.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+F(L)+"'")},In.getTokenFromCode=function(E){switch(E){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(S.parenL);case 41:return++this.pos,this.finishToken(S.parenR);case 59:return++this.pos,this.finishToken(S.semi);case 44:return++this.pos,this.finishToken(S.comma);case 91:return++this.pos,this.finishToken(S.bracketL);case 93:return++this.pos,this.finishToken(S.bracketR);case 123:return++this.pos,this.finishToken(S.braceL);case 125:return++this.pos,this.finishToken(S.braceR);case 58:return++this.pos,this.finishToken(S.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(S.backQuote);case 48:var L=this.input.charCodeAt(this.pos+1);if(L===120||L===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(L===111||L===79)return this.readRadixNumber(8);if(L===98||L===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(E);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(E);case 124:case 38:return this.readToken_pipe_amp(E);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(E);case 60:case 62:return this.readToken_lt_gt(E);case 61:case 33:return this.readToken_eq_excl(E);case 63:return this.readToken_question();case 126:return this.finishOp(S.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+F(E)+"'")},In.finishOp=function(E,L){var J=this.input.slice(this.pos,this.pos+L);return this.pos+=L,this.finishToken(E,J)},In.readRegexp=function(){for(var E,L,J=this.pos;;){this.pos>=this.input.length&&this.raise(J,"Unterminated regular expression");var ne=this.input.charAt(this.pos);if(A.test(ne)&&this.raise(J,"Unterminated regular expression"),E)E=!1;else{if(ne==="[")L=!0;else if(ne==="]"&&L)L=!1;else if(ne==="/"&&!L)break;E=ne==="\\"}++this.pos}var xe=this.input.slice(J,this.pos);++this.pos;var Ke=this.pos,et=this.readWord1();this.containsEsc&&this.unexpected(Ke);var Lt=this.regexpState||(this.regexpState=new un(this));Lt.reset(J,xe,et),this.validateRegExpFlags(Lt),this.validateRegExpPattern(Lt);var zt=null;try{zt=new RegExp(xe,et)}catch{}return this.finishToken(S.regexp,{pattern:xe,flags:et,value:zt})},In.readInt=function(E,L,J){for(var ne=this.options.ecmaVersion>=12&&L===void 0,xe=J&&this.input.charCodeAt(this.pos)===48,Ke=this.pos,et=0,Lt=0,zt=0,mn=L??1/0;zt<mn;++zt,++this.pos){var _n=this.input.charCodeAt(this.pos),Si=void 0;if(ne&&_n===95){xe&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),Lt===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),zt===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),Lt=_n;continue}if(_n>=97?Si=_n-97+10:_n>=65?Si=_n-65+10:_n>=48&&_n<=57?Si=_n-48:Si=1/0,Si>=E)break;Lt=_n,et=et*E+Si}return ne&&Lt===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===Ke||L!=null&&this.pos-Ke!==L?null:et};function zs(E,L){return L?parseInt(E,8):parseFloat(E.replace(/_/g,""))}function Ha(E){return typeof BigInt!="function"?null:BigInt(E.replace(/_/g,""))}In.readRadixNumber=function(E){var L=this.pos;this.pos+=2;var J=this.readInt(E);return J==null&&this.raise(this.start+2,"Expected number in radix "+E),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(J=Ha(this.input.slice(L,this.pos)),++this.pos):g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,J)},In.readNumber=function(E){var L=this.pos;!E&&this.readInt(10,void 0,!0)===null&&this.raise(L,"Invalid number");var J=this.pos-L>=2&&this.input.charCodeAt(L)===48;J&&this.strict&&this.raise(L,"Invalid number");var ne=this.input.charCodeAt(this.pos);if(!J&&!E&&this.options.ecmaVersion>=11&&ne===110){var xe=Ha(this.input.slice(L,this.pos));return++this.pos,g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,xe)}J&&/[89]/.test(this.input.slice(L,this.pos))&&(J=!1),ne===46&&!J&&(++this.pos,this.readInt(10),ne=this.input.charCodeAt(this.pos)),(ne===69||ne===101)&&!J&&(ne=this.input.charCodeAt(++this.pos),(ne===43||ne===45)&&++this.pos,this.readInt(10)===null&&this.raise(L,"Invalid number")),g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var Ke=zs(this.input.slice(L,this.pos),J);return this.finishToken(S.num,Ke)},In.readCodePoint=function(){var E=this.input.charCodeAt(this.pos),L;if(E===123){this.options.ecmaVersion<6&&this.unexpected();var J=++this.pos;L=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,L>1114111&&this.invalidStringToken(J,"Code point out of bounds")}else L=this.readHexChar(4);return L},In.readString=function(E){for(var L="",J=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var ne=this.input.charCodeAt(this.pos);if(ne===E)break;ne===92?(L+=this.input.slice(J,this.pos),L+=this.readEscapedChar(!1),J=this.pos):ne===8232||ne===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(D(ne)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return L+=this.input.slice(J,this.pos++),this.finishToken(S.string,L)};var Va={};In.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(E){if(E===Va)this.readInvalidTemplateToken();else throw E}this.inTemplateElement=!1},In.invalidStringToken=function(E,L){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Va;this.raise(E,L)},In.readTmplToken=function(){for(var E="",L=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var J=this.input.charCodeAt(this.pos);if(J===96||J===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===S.template||this.type===S.invalidTemplate)?J===36?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote)):(E+=this.input.slice(L,this.pos),this.finishToken(S.template,E));if(J===92)E+=this.input.slice(L,this.pos),E+=this.readEscapedChar(!0),L=this.pos;else if(D(J)){switch(E+=this.input.slice(L,this.pos),++this.pos,J){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:E+=`
`;break;default:E+=String.fromCharCode(J);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),L=this.pos}else++this.pos}},In.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(S.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
`&&++this.pos;case`
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},In.readEscapedChar=function(E){var L=this.input.charCodeAt(++this.pos);switch(++this.pos,L){case 110:return`
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return F(this.readCodePoint());case 116:return"	";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),E){var J=this.pos-1;this.invalidStringToken(J,"Invalid escape sequence in template string")}default:if(L>=48&&L<=55){var ne=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],xe=parseInt(ne,8);return xe>255&&(ne=ne.slice(0,-1),xe=parseInt(ne,8)),this.pos+=ne.length-1,L=this.input.charCodeAt(this.pos),(ne!=="0"||L===56||L===57)&&(this.strict||E)&&this.invalidStringToken(this.pos-1-ne.length,E?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(xe)}return D(L)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(L)}},In.readHexChar=function(E){var L=this.pos,J=this.readInt(16,E);return J===null&&this.invalidStringToken(L,"Bad character escape sequence"),J},In.readWord1=function(){this.containsEsc=!1;for(var E="",L=!0,J=this.pos,ne=this.options.ecmaVersion>=6;this.pos<this.input.length;){var xe=this.fullCharCodeAtPos();if(b(xe,ne))this.pos+=xe<=65535?1:2;else if(xe===92){this.containsEsc=!0,E+=this.input.slice(J,this.pos);var Ke=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var et=this.readCodePoint();(L?g:b)(et,ne)||this.invalidStringToken(Ke,"Invalid Unicode escape"),E+=F(et),J=this.pos}else break;L=!1}return E+this.input.slice(J,this.pos)},In.readWord=function(){var E=this.readWord1(),L=S.name;return this.keywords.test(E)&&(L=w[E]),this.finishToken(L,E)};var xa="8.15.0";me.acorn={Parser:me,version:xa,defaultOptions:se,Position:Z,SourceLocation:V,getLineInfo:de,Node:ai,TokenType:y,tokTypes:S,keywordTypes:w,TokContext:Ft,tokContexts:st,isIdentifierChar:b,isIdentifierStart:g,Token:so,isNewLine:D,lineBreak:A,lineBreakG:C,nonASCIIwhitespace:N};function oo(E,L){return me.parse(E,L)}function js(E,L,J){return me.parseExpressionAt(E,L,J)}function Ro(E,L){return me.tokenizer(E,L)}n.Node=ai,n.Parser=me,n.Position=Z,n.SourceLocation=V,n.TokContext=Ft,n.Token=so,n.TokenType=y,n.defaultOptions=se,n.getLineInfo=de,n.isIdentifierChar=b,n.isIdentifierStart=g,n.isNewLine=D,n.keywordTypes=w,n.lineBreak=A,n.lineBreakG=C,n.nonASCIIwhitespace=N,n.parse=oo,n.parseExpressionAt=js,n.tokContexts=st,n.tokTypes=S,n.tokenizer=Ro,n.version=xa})}(vE,vE.exports)),vE.exports}(function(t){const e=MCe,n=/^[\da-fA-F]+$/,i=/^\d+$/,r=new WeakMap;function a(l){l=l.Parser.acorn||l;let c=r.get(l);if(!c){const u=l.tokTypes,f=l.TokContext,h=l.TokenType,d=new f("<tag",!1),g=new f("</tag",!1),b=new f("<tag>...</tag>",!0,!0),y={tc_oTag:d,tc_cTag:g,tc_expr:b},p={jsxName:new h("jsxName"),jsxText:new h("jsxText",{beforeExpr:!0}),jsxTagStart:new h("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new h("jsxTagEnd")};p.jsxTagStart.updateContext=function(){this.context.push(b),this.context.push(d),this.exprAllowed=!1},p.jsxTagEnd.updateContext=function(x){let _=this.context.pop();_===d&&x===u.slash||_===g?(this.context.pop(),this.exprAllowed=this.curContext()===b):this.exprAllowed=!0},c={tokContexts:y,tokTypes:p},r.set(l,c)}return c}function s(l){if(!l)return l;if(l.type==="JSXIdentifier")return l.name;if(l.type==="JSXNamespacedName")return l.namespace.name+":"+l.name.name;if(l.type==="JSXMemberExpression")return s(l.object)+"."+s(l.property)}t.exports=function(l){return l=l||{},function(c){return o({allowNamespaces:l.allowNamespaces!==!1,allowNamespacedObjects:!!l.allowNamespacedObjects},c)}},Object.defineProperty(t.exports,"tokTypes",{get:function(){return a(MI()).tokTypes},configurable:!0,enumerable:!0});function o(l,c){const u=c.acorn||MI(),f=a(u),h=u.tokTypes,d=f.tokTypes,g=u.tokContexts,b=f.tokContexts.tc_oTag,y=f.tokContexts.tc_cTag,p=f.tokContexts.tc_expr,x=u.isNewLine,_=u.isIdentifierStart,w=u.isIdentifierChar;return class extends c{static get acornJsx(){return f}jsx_readToken(){let M="",S=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let A=this.input.charCodeAt(this.pos);switch(A){case 60:case 123:return this.pos===this.start?A===60&&this.exprAllowed?(++this.pos,this.finishToken(d.jsxTagStart)):this.getTokenFromCode(A):(M+=this.input.slice(S,this.pos),this.finishToken(d.jsxText,M));case 38:M+=this.input.slice(S,this.pos),M+=this.jsx_readEntity(),S=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(A===62?"&gt;":"&rbrace;")+'` or `{"'+this.input[this.pos]+'"}`?');default:x(A)?(M+=this.input.slice(S,this.pos),M+=this.jsx_readNewLine(!0),S=this.pos):++this.pos}}}jsx_readNewLine(M){let S=this.input.charCodeAt(this.pos),A;return++this.pos,S===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,A=M?`
`:`\r
`):A=String.fromCharCode(S),this.options.locations&&(++this.curLine,this.lineStart=this.pos),A}jsx_readString(M){let S="",A=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let C=this.input.charCodeAt(this.pos);if(C===M)break;C===38?(S+=this.input.slice(A,this.pos),S+=this.jsx_readEntity(),A=this.pos):x(C)?(S+=this.input.slice(A,this.pos),S+=this.jsx_readNewLine(!1),A=this.pos):++this.pos}return S+=this.input.slice(A,this.pos++),this.finishToken(h.string,S)}jsx_readEntity(){let M="",S=0,A,C=this.input[this.pos];C!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let D=++this.pos;for(;this.pos<this.input.length&&S++<10;){if(C=this.input[this.pos++],C===";"){M[0]==="#"?M[1]==="x"?(M=M.substr(2),n.test(M)&&(A=String.fromCharCode(parseInt(M,16)))):(M=M.substr(1),i.test(M)&&(A=String.fromCharCode(parseInt(M,10)))):A=e[M];break}M+=C}return A||(this.pos=D,"&")}jsx_readWord(){let M,S=this.pos;do M=this.input.charCodeAt(++this.pos);while(w(M)||M===45);return this.finishToken(d.jsxName,this.input.slice(S,this.pos))}jsx_parseIdentifier(){let M=this.startNode();return this.type===d.jsxName?M.name=this.value:this.type.keyword?M.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(M,"JSXIdentifier")}jsx_parseNamespacedName(){let M=this.start,S=this.startLoc,A=this.jsx_parseIdentifier();if(!l.allowNamespaces||!this.eat(h.colon))return A;var C=this.startNodeAt(M,S);return C.namespace=A,C.name=this.jsx_parseIdentifier(),this.finishNode(C,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===d.jsxTagEnd)return"";let M=this.start,S=this.startLoc,A=this.jsx_parseNamespacedName();for(this.type===h.dot&&A.type==="JSXNamespacedName"&&!l.allowNamespacedObjects&&this.unexpected();this.eat(h.dot);){let C=this.startNodeAt(M,S);C.object=A,C.property=this.jsx_parseIdentifier(),A=this.finishNode(C,"JSXMemberExpression")}return A}jsx_parseAttributeValue(){switch(this.type){case h.braceL:let M=this.jsx_parseExpressionContainer();return M.expression.type==="JSXEmptyExpression"&&this.raise(M.start,"JSX attributes must only be assigned a non-empty expression"),M;case d.jsxTagStart:case h.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let M=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(M,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let M=this.startNode();return this.next(),M.expression=this.type===h.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(h.braceR),this.finishNode(M,"JSXExpressionContainer")}jsx_parseAttribute(){let M=this.startNode();return this.eat(h.braceL)?(this.expect(h.ellipsis),M.argument=this.parseMaybeAssign(),this.expect(h.braceR),this.finishNode(M,"JSXSpreadAttribute")):(M.name=this.jsx_parseNamespacedName(),M.value=this.eat(h.eq)?this.jsx_parseAttributeValue():null,this.finishNode(M,"JSXAttribute"))}jsx_parseOpeningElementAt(M,S){let A=this.startNodeAt(M,S);A.attributes=[];let C=this.jsx_parseElementName();for(C&&(A.name=C);this.type!==h.slash&&this.type!==d.jsxTagEnd;)A.attributes.push(this.jsx_parseAttribute());return A.selfClosing=this.eat(h.slash),this.expect(d.jsxTagEnd),this.finishNode(A,C?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(M,S){let A=this.startNodeAt(M,S),C=this.jsx_parseElementName();return C&&(A.name=C),this.expect(d.jsxTagEnd),this.finishNode(A,C?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(M,S){let A=this.startNodeAt(M,S),C=[],D=this.jsx_parseOpeningElementAt(M,S),R=null;if(!D.selfClosing){e:for(;;)switch(this.type){case d.jsxTagStart:if(M=this.start,S=this.startLoc,this.next(),this.eat(h.slash)){R=this.jsx_parseClosingElementAt(M,S);break e}C.push(this.jsx_parseElementAt(M,S));break;case d.jsxText:C.push(this.parseExprAtom());break;case h.braceL:C.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(R.name)!==s(D.name)&&this.raise(R.start,"Expected corresponding JSX closing tag for <"+s(D.name)+">")}let N=D.name?"Element":"Fragment";return A["opening"+N]=D,A["closing"+N]=R,A.children=C,this.type===h.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(A,"JSX"+N)}jsx_parseText(){let M=this.parseLiteral(this.value);return M.type="JSXText",M}jsx_parseElement(){let M=this.start,S=this.startLoc;return this.next(),this.jsx_parseElementAt(M,S)}parseExprAtom(M){return this.type===d.jsxText?this.jsx_parseText():this.type===d.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(M)}readToken(M){let S=this.curContext();if(S===p)return this.jsx_readToken();if(S===b||S===y){if(_(M))return this.jsx_readWord();if(M==62)return++this.pos,this.finishToken(d.jsxTagEnd);if((M===34||M===39)&&S==b)return this.jsx_readString(M)}return M===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(d.jsxTagStart)):super.readToken(M)}updateContext(M){if(this.type==h.braceL){var S=this.curContext();S==b?this.context.push(g.b_expr):S==p?this.context.push(g.b_tmpl):super.updateContext(M),this.exprAllowed=!0}else if(this.type===h.slash&&M===d.jsxTagStart)this.context.length-=2,this.context.push(y),this.exprAllowed=!1;else return super.updateContext(M)}}}})(pQ);var TCe=pQ.exports;const mQ=Mc(TCe),{stringify:ACe}=JSON;if(!String.prototype.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!String.prototype.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");const yE={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},Qc=17,CCe={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:Qc,ClassExpression:Qc,FunctionExpression:Qc,ObjectExpression:Qc,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function Ab(t,e){const{generator:n}=t;if(t.write("("),e!=null&&e.length>0){n[e[0].type](e[0],t);const{length:i}=e;for(let r=1;r<i;r++){const a=e[r];t.write(", "),n[a.type](a,t)}}t.write(")")}function gQ(t,e,n,i){const r=t.expressionsPrecedence[e.type];if(r===Qc)return!0;const a=t.expressionsPrecedence[n.type];return r!==a?!i&&r===15&&a===14&&n.operator==="**"||r<a:r!==13&&r!==14?!1:e.operator==="**"&&n.operator==="**"?!i:r===13&&a===13&&(e.operator==="??"||n.operator==="??")?!0:i?yE[e.operator]<=yE[n.operator]:yE[e.operator]<yE[n.operator]}function xE(t,e,n,i){const{generator:r}=t;gQ(t,e,n,i)?(t.write("("),r[e.type](e,t),t.write(")")):r[e.type](e,t)}function RCe(t,e,n,i){const r=e.split(`
`),a=r.length-1;if(t.write(r[0].trim()),a>0){t.write(i);for(let s=1;s<a;s++)t.write(n+r[s].trim()+i);t.write(n+r[a].trim())}}function go(t,e,n,i){const{length:r}=e;for(let a=0;a<r;a++){const s=e[a];t.write(n),s.type[0]==="L"?t.write("// "+s.value.trim()+`
`,s):(t.write("/*"),RCe(t,s.value,n,i),t.write("*/"+i))}}function kCe(t){let e=t;for(;e!=null;){const{type:n}=e;if(n[0]==="C"&&n[1]==="a")return!0;if(n[0]==="M"&&n[1]==="e"&&n[2]==="m")e=e.object;else return!1}}function PD(t,e){const{generator:n}=t,{declarations:i}=e;t.write(e.kind+" ");const{length:r}=i;if(r>0){n.VariableDeclarator(i[0],t);for(let a=1;a<r;a++)t.write(", "),n.VariableDeclarator(i[a],t)}}let q6,X6,K6,Y6,J6,$6;const bQ={Program(t,e){const n=e.indent.repeat(e.indentLevel),{lineEnd:i,writeComments:r}=e;r&&t.comments!=null&&go(e,t.comments,n,i);const a=t.body,{length:s}=a;for(let o=0;o<s;o++){const l=a[o];r&&l.comments!=null&&go(e,l.comments,n,i),e.write(n),this[l.type](l,e),e.write(i)}r&&t.trailingComments!=null&&go(e,t.trailingComments,n,i)},BlockStatement:$6=function(t,e){const n=e.indent.repeat(e.indentLevel++),{lineEnd:i,writeComments:r}=e,a=n+e.indent;e.write("{");const s=t.body;if(s!=null&&s.length>0){e.write(i),r&&t.comments!=null&&go(e,t.comments,a,i);const{length:o}=s;for(let l=0;l<o;l++){const c=s[l];r&&c.comments!=null&&go(e,c.comments,a,i),e.write(a),this[c.type](c,e),e.write(i)}e.write(n)}else r&&t.comments!=null&&(e.write(i),go(e,t.comments,a,i),e.write(n));r&&t.trailingComments!=null&&go(e,t.trailingComments,a,i),e.write("}"),e.indentLevel--},ClassBody:$6,StaticBlock(t,e){e.write("static "),this.BlockStatement(t,e)},EmptyStatement(t,e){e.write(";")},ExpressionStatement(t,e){const n=e.expressionsPrecedence[t.expression.type];n===Qc||n===3&&t.expression.left.type[0]==="O"?(e.write("("),this[t.expression.type](t.expression,e),e.write(")")):this[t.expression.type](t.expression,e),e.write(";")},IfStatement(t,e){e.write("if ("),this[t.test.type](t.test,e),e.write(") "),this[t.consequent.type](t.consequent,e),t.alternate!=null&&(e.write(" else "),this[t.alternate.type](t.alternate,e))},LabeledStatement(t,e){this[t.label.type](t.label,e),e.write(": "),this[t.body.type](t.body,e)},BreakStatement(t,e){e.write("break"),t.label!=null&&(e.write(" "),this[t.label.type](t.label,e)),e.write(";")},ContinueStatement(t,e){e.write("continue"),t.label!=null&&(e.write(" "),this[t.label.type](t.label,e)),e.write(";")},WithStatement(t,e){e.write("with ("),this[t.object.type](t.object,e),e.write(") "),this[t.body.type](t.body,e)},SwitchStatement(t,e){const n=e.indent.repeat(e.indentLevel++),{lineEnd:i,writeComments:r}=e;e.indentLevel++;const a=n+e.indent,s=a+e.indent;e.write("switch ("),this[t.discriminant.type](t.discriminant,e),e.write(") {"+i);const{cases:o}=t,{length:l}=o;for(let c=0;c<l;c++){const u=o[c];r&&u.comments!=null&&go(e,u.comments,a,i),u.test?(e.write(a+"case "),this[u.test.type](u.test,e),e.write(":"+i)):e.write(a+"default:"+i);const{consequent:f}=u,{length:h}=f;for(let d=0;d<h;d++){const g=f[d];r&&g.comments!=null&&go(e,g.comments,s,i),e.write(s),this[g.type](g,e),e.write(i)}}e.indentLevel-=2,e.write(n+"}")},ReturnStatement(t,e){e.write("return"),t.argument&&(e.write(" "),this[t.argument.type](t.argument,e)),e.write(";")},ThrowStatement(t,e){e.write("throw "),this[t.argument.type](t.argument,e),e.write(";")},TryStatement(t,e){if(e.write("try "),this[t.block.type](t.block,e),t.handler){const{handler:n}=t;n.param==null?e.write(" catch "):(e.write(" catch ("),this[n.param.type](n.param,e),e.write(") ")),this[n.body.type](n.body,e)}t.finalizer&&(e.write(" finally "),this[t.finalizer.type](t.finalizer,e))},WhileStatement(t,e){e.write("while ("),this[t.test.type](t.test,e),e.write(") "),this[t.body.type](t.body,e)},DoWhileStatement(t,e){e.write("do "),this[t.body.type](t.body,e),e.write(" while ("),this[t.test.type](t.test,e),e.write(");")},ForStatement(t,e){if(e.write("for ("),t.init!=null){const{init:n}=t;n.type[0]==="V"?PD(e,n):this[n.type](n,e)}e.write("; "),t.test&&this[t.test.type](t.test,e),e.write("; "),t.update&&this[t.update.type](t.update,e),e.write(") "),this[t.body.type](t.body,e)},ForInStatement:q6=function(t,e){e.write(`for ${t.await?"await ":""}(`);const{left:n}=t;n.type[0]==="V"?PD(e,n):this[n.type](n,e),e.write(t.type[3]==="I"?" in ":" of "),this[t.right.type](t.right,e),e.write(") "),this[t.body.type](t.body,e)},ForOfStatement:q6,DebuggerStatement(t,e){e.write("debugger;",t)},FunctionDeclaration:X6=function(t,e){e.write((t.async?"async ":"")+(t.generator?"function* ":"function ")+(t.id?t.id.name:""),t),Ab(e,t.params),e.write(" "),this[t.body.type](t.body,e)},FunctionExpression:X6,VariableDeclaration(t,e){PD(e,t),e.write(";")},VariableDeclarator(t,e){this[t.id.type](t.id,e),t.init!=null&&(e.write(" = "),this[t.init.type](t.init,e))},ClassDeclaration(t,e){if(e.write("class "+(t.id?`${t.id.name} `:""),t),t.superClass){e.write("extends ");const{superClass:n}=t,{type:i}=n,r=e.expressionsPrecedence[i];(i[0]!=="C"||i[1]!=="l"||i[5]!=="E")&&(r===Qc||r<e.expressionsPrecedence.ClassExpression)?(e.write("("),this[t.superClass.type](n,e),e.write(")")):this[n.type](n,e),e.write(" ")}this.ClassBody(t.body,e)},ImportDeclaration(t,e){e.write("import ");const{specifiers:n,attributes:i}=t,{length:r}=n;let a=0;if(r>0){for(;a<r;){a>0&&e.write(", ");const s=n[a],o=s.type[6];if(o==="D")e.write(s.local.name,s),a++;else if(o==="N")e.write("* as "+s.local.name,s),a++;else break}if(a<r){for(e.write("{");;){const s=n[a],{name:o}=s.imported;if(e.write(o,s),o!==s.local.name&&e.write(" as "+s.local.name),++a<r)e.write(", ");else break}e.write("}")}e.write(" from ")}if(this.Literal(t.source,e),i&&i.length>0){e.write(" with { ");for(let s=0;s<i.length;s++)this.ImportAttribute(i[s],e),s<i.length-1&&e.write(", ");e.write(" }")}e.write(";")},ImportAttribute(t,e){this.Identifier(t.key,e),e.write(": "),this.Literal(t.value,e)},ImportExpression(t,e){e.write("import("),this[t.source.type](t.source,e),e.write(")")},ExportDefaultDeclaration(t,e){e.write("export default "),this[t.declaration.type](t.declaration,e),e.expressionsPrecedence[t.declaration.type]!=null&&t.declaration.type[0]!=="F"&&e.write(";")},ExportNamedDeclaration(t,e){if(e.write("export "),t.declaration)this[t.declaration.type](t.declaration,e);else{e.write("{");const{specifiers:n}=t,{length:i}=n;if(i>0)for(let r=0;;){const a=n[r],{name:s}=a.local;if(e.write(s,a),s!==a.exported.name&&e.write(" as "+a.exported.name),++r<i)e.write(", ");else break}if(e.write("}"),t.source&&(e.write(" from "),this.Literal(t.source,e)),t.attributes&&t.attributes.length>0){e.write(" with { ");for(let r=0;r<t.attributes.length;r++)this.ImportAttribute(t.attributes[r],e),r<t.attributes.length-1&&e.write(", ");e.write(" }")}e.write(";")}},ExportAllDeclaration(t,e){if(t.exported!=null?e.write("export * as "+t.exported.name+" from "):e.write("export * from "),this.Literal(t.source,e),t.attributes&&t.attributes.length>0){e.write(" with { ");for(let n=0;n<t.attributes.length;n++)this.ImportAttribute(t.attributes[n],e),n<t.attributes.length-1&&e.write(", ");e.write(" }")}e.write(";")},MethodDefinition(t,e){t.static&&e.write("static ");const n=t.kind[0];(n==="g"||n==="s")&&e.write(t.kind+" "),t.value.async&&e.write("async "),t.value.generator&&e.write("*"),t.computed?(e.write("["),this[t.key.type](t.key,e),e.write("]")):this[t.key.type](t.key,e),Ab(e,t.value.params),e.write(" "),this[t.value.body.type](t.value.body,e)},ClassExpression(t,e){this.ClassDeclaration(t,e)},ArrowFunctionExpression(t,e){e.write(t.async?"async ":"",t);const{params:n}=t;n!=null&&(n.length===1&&n[0].type[0]==="I"?e.write(n[0].name,n[0]):Ab(e,t.params)),e.write(" => "),t.body.type[0]==="O"?(e.write("("),this.ObjectExpression(t.body,e),e.write(")")):this[t.body.type](t.body,e)},ThisExpression(t,e){e.write("this",t)},Super(t,e){e.write("super",t)},RestElement:K6=function(t,e){e.write("..."),this[t.argument.type](t.argument,e)},SpreadElement:K6,YieldExpression(t,e){e.write(t.delegate?"yield*":"yield"),t.argument&&(e.write(" "),this[t.argument.type](t.argument,e))},AwaitExpression(t,e){e.write("await ",t),xE(e,t.argument,t)},TemplateLiteral(t,e){const{quasis:n,expressions:i}=t;e.write("`");const{length:r}=i;for(let s=0;s<r;s++){const o=i[s],l=n[s];e.write(l.value.raw,l),e.write("${"),this[o.type](o,e),e.write("}")}const a=n[n.length-1];e.write(a.value.raw,a),e.write("`")},TemplateElement(t,e){e.write(t.value.raw,t)},TaggedTemplateExpression(t,e){xE(e,t.tag,t),this[t.quasi.type](t.quasi,e)},ArrayExpression:J6=function(t,e){if(e.write("["),t.elements.length>0){const{elements:n}=t,{length:i}=n;for(let r=0;;){const a=n[r];if(a!=null&&this[a.type](a,e),++r<i)e.write(", ");else{a==null&&e.write(", ");break}}}e.write("]")},ArrayPattern:J6,ObjectExpression(t,e){const n=e.indent.repeat(e.indentLevel++),{lineEnd:i,writeComments:r}=e,a=n+e.indent;if(e.write("{"),t.properties.length>0){e.write(i),r&&t.comments!=null&&go(e,t.comments,a,i);const s=","+i,{properties:o}=t,{length:l}=o;for(let c=0;;){const u=o[c];if(r&&u.comments!=null&&go(e,u.comments,a,i),e.write(a),this[u.type](u,e),++c<l)e.write(s);else break}e.write(i),r&&t.trailingComments!=null&&go(e,t.trailingComments,a,i),e.write(n+"}")}else r?t.comments!=null?(e.write(i),go(e,t.comments,a,i),t.trailingComments!=null&&go(e,t.trailingComments,a,i),e.write(n+"}")):t.trailingComments!=null?(e.write(i),go(e,t.trailingComments,a,i),e.write(n+"}")):e.write("}"):e.write("}");e.indentLevel--},Property(t,e){t.method||t.kind[0]!=="i"?this.MethodDefinition(t,e):(t.shorthand||(t.computed?(e.write("["),this[t.key.type](t.key,e),e.write("]")):this[t.key.type](t.key,e),e.write(": ")),this[t.value.type](t.value,e))},PropertyDefinition(t,e){if(t.static&&e.write("static "),t.computed&&e.write("["),this[t.key.type](t.key,e),t.computed&&e.write("]"),t.value==null){t.key.type[0]!=="F"&&e.write(";");return}e.write(" = "),this[t.value.type](t.value,e),e.write(";")},ObjectPattern(t,e){if(e.write("{"),t.properties.length>0){const{properties:n}=t,{length:i}=n;for(let r=0;this[n[r].type](n[r],e),++r<i;)e.write(", ")}e.write("}")},SequenceExpression(t,e){Ab(e,t.expressions)},UnaryExpression(t,e){if(t.prefix){const{operator:n,argument:i,argument:{type:r}}=t;e.write(n);const a=gQ(e,i,t);!a&&(n.length>1||r[0]==="U"&&(r[1]==="n"||r[1]==="p")&&i.prefix&&i.operator[0]===n&&(n==="+"||n==="-"))&&e.write(" "),a?(e.write(n.length>1?" (":"("),this[r](i,e),e.write(")")):this[r](i,e)}else this[t.argument.type](t.argument,e),e.write(t.operator)},UpdateExpression(t,e){t.prefix?(e.write(t.operator),this[t.argument.type](t.argument,e)):(this[t.argument.type](t.argument,e),e.write(t.operator))},AssignmentExpression(t,e){this[t.left.type](t.left,e),e.write(" "+t.operator+" "),this[t.right.type](t.right,e)},AssignmentPattern(t,e){this[t.left.type](t.left,e),e.write(" = "),this[t.right.type](t.right,e)},BinaryExpression:Y6=function(t,e){const n=t.operator==="in";n&&e.write("("),xE(e,t.left,t,!1),e.write(" "+t.operator+" "),xE(e,t.right,t,!0),n&&e.write(")")},LogicalExpression:Y6,ConditionalExpression(t,e){const{test:n}=t,i=e.expressionsPrecedence[n.type];i===Qc||i<=e.expressionsPrecedence.ConditionalExpression?(e.write("("),this[n.type](n,e),e.write(")")):this[n.type](n,e),e.write(" ? "),this[t.consequent.type](t.consequent,e),e.write(" : "),this[t.alternate.type](t.alternate,e)},NewExpression(t,e){e.write("new ");const n=e.expressionsPrecedence[t.callee.type];n===Qc||n<e.expressionsPrecedence.CallExpression||kCe(t.callee)?(e.write("("),this[t.callee.type](t.callee,e),e.write(")")):this[t.callee.type](t.callee,e),Ab(e,t.arguments)},CallExpression(t,e){const n=e.expressionsPrecedence[t.callee.type];n===Qc||n<e.expressionsPrecedence.CallExpression?(e.write("("),this[t.callee.type](t.callee,e),e.write(")")):this[t.callee.type](t.callee,e),t.optional&&e.write("?."),Ab(e,t.arguments)},ChainExpression(t,e){this[t.expression.type](t.expression,e)},MemberExpression(t,e){const n=e.expressionsPrecedence[t.object.type];n===Qc||n<e.expressionsPrecedence.MemberExpression?(e.write("("),this[t.object.type](t.object,e),e.write(")")):this[t.object.type](t.object,e),t.computed?(t.optional&&e.write("?."),e.write("["),this[t.property.type](t.property,e),e.write("]")):(t.optional?e.write("?."):e.write("."),this[t.property.type](t.property,e))},MetaProperty(t,e){e.write(t.meta.name+"."+t.property.name,t)},Identifier(t,e){e.write(t.name,t)},PrivateIdentifier(t,e){e.write(`#${t.name}`,t)},Literal(t,e){t.raw!=null?e.write(t.raw,t):t.regex!=null?this.RegExpLiteral(t,e):t.bigint!=null?e.write(t.bigint+"n",t):e.write(ACe(t.value),t)},RegExpLiteral(t,e){const{regex:n}=t;e.write(`/${n.pattern}/${n.flags}`,t)}},DCe={};class OCe{constructor(e){const n=e??DCe;this.output="",n.output!=null?(this.output=n.output,this.write=this.writeToStream):this.output="",this.generator=n.generator!=null?n.generator:bQ,this.expressionsPrecedence=n.expressionsPrecedence!=null?n.expressionsPrecedence:CCe,this.indent=n.indent!=null?n.indent:"  ",this.lineEnd=n.lineEnd!=null?n.lineEnd:`
`,this.indentLevel=n.startingIndentLevel!=null?n.startingIndentLevel:0,this.writeComments=n.comments?n.comments:!1,n.sourceMap!=null&&(this.write=n.output==null?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=n.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split(`
`).length-1,this.mapping={original:null,generated:this,name:void 0,source:n.sourceMap.file||n.sourceMap._file})}write(e){this.output+=e}writeToStream(e){this.output.write(e)}writeAndMap(e,n){this.output+=e,this.map(e,n)}writeToStreamAndMap(e,n){this.output.write(e),this.map(e,n)}map(e,n){if(n!=null){const{type:a}=n;if(a[0]==="L"&&a[2]==="n"){this.column=0,this.line++;return}if(n.loc!=null){const{mapping:s}=this;s.original=n.loc.start,s.name=n.name,this.sourceMap.addMapping(s)}if(a[0]==="T"&&a[8]==="E"||a[0]==="L"&&a[1]==="i"&&typeof n.value=="string"){const{length:s}=e;let{column:o,line:l}=this;for(let c=0;c<s;c++)e[c]===`
`?(o=0,l++):o++;this.column=o,this.line=l;return}}const{length:i}=e,{lineEnd:r}=this;i>0&&(this.lineEndSize>0&&(r.length===1?e[i-1]===r:e.endsWith(r))?(this.line+=this.lineEndSize,this.column=0):this.column+=i)}toString(){return this.output}}function ICe(t,e){const n=new OCe(e);return n.generator[t.type](t,n),n.output}const NCe={};function LCe(t,e){const{SourceMapGenerator:n,filePath:i,handlers:r}=e||NCe,a=n?new n({file:i||"<unknown>.js"}):void 0,s=ICe(t,{comments:!0,generator:{...bQ,...r},sourceMap:a||void 0}),o=a?a.toJSON():void 0;return{value:s,map:o}}const PCe={JSXAttribute:UCe,JSXClosingElement:FCe,JSXClosingFragment:BCe,JSXElement:zCe,JSXEmptyExpression:jCe,JSXExpressionContainer:HCe,JSXFragment:VCe,JSXIdentifier:GCe,JSXMemberExpression:WCe,JSXNamespacedName:qCe,JSXOpeningElement:XCe,JSXOpeningFragment:KCe,JSXSpreadAttribute:YCe,JSXText:JCe};function UCe(t,e){this[t.name.type](t.name,e),t.value!==null&&t.value!==void 0&&(e.write("="),t.value.type==="Literal"?e.write('"'+vQ(String(t.value.value)).replace(/"/g,"&quot;")+'"',t):this[t.value.type](t.value,e))}function FCe(t,e){e.write("</"),this[t.name.type](t.name,e),e.write(">")}function BCe(t,e){e.write("</>",t)}function zCe(t,e){let n=-1;if(this[t.openingElement.type](t.openingElement,e),t.children)for(;++n<t.children.length;){const i=t.children[n];if(i.type==="JSXSpreadChild")throw new Error("JSX spread children are not supported");this[i.type](i,e)}t.closingElement&&this[t.closingElement.type](t.closingElement,e)}function jCe(){}function HCe(t,e){e.write("{"),this[t.expression.type](t.expression,e),e.write("}")}function VCe(t,e){let n=-1;if(this[t.openingFragment.type](t.openingFragment,e),t.children)for(;++n<t.children.length;){const i=t.children[n];if(i.type==="JSXSpreadChild")throw new Error("JSX spread children are not supported");this[i.type](i,e)}this[t.closingFragment.type](t.closingFragment,e)}function GCe(t,e){e.write(t.name,t)}function WCe(t,e){this[t.object.type](t.object,e),e.write("."),this[t.property.type](t.property,e)}function qCe(t,e){this[t.namespace.type](t.namespace,e),e.write(":"),this[t.name.type](t.name,e)}function XCe(t,e){let n=-1;if(e.write("<"),this[t.name.type](t.name,e),t.attributes)for(;++n<t.attributes.length;)e.write(" "),this[t.attributes[n].type](t.attributes[n],e);e.write(t.selfClosing?" />":">")}function KCe(t,e){e.write("<>",t)}function YCe(t,e){e.write("{"),this.SpreadElement(t,e),e.write("}")}function JCe(t,e){e.write(vQ(t.value).replace(/[<>{}]/g,$Ce),t)}function vQ(t){return t.replace(/&(?=[#a-z])/gi,"&amp;")}function $Ce(t){return t==="<"?"&lt;":t===">"?"&gt;":t==="{"?"&#123;":"&#125;"}function ZCe(){const t=this.data(),e=t.settings||(t.settings={}),n=e.handlers||(e.handlers={});(e.plugins||(e.plugins=[])).push(mQ()),Object.assign(n,PCe)}function QCe(t){const e=this;this.compiler=n;function n(i,r){const a={...e.data("settings"),...t},s=LCe(i,{SourceMapGenerator:a.SourceMapGenerator,filePath:r.path||"unknown.js",handlers:a.handlers});return r.map=s.map,s.value}}function eRe(t,e){const n={type:"Block",value:t.value};e.inherit(t,n),e.comments.push(n);const i={type:"JSXEmptyExpression",comments:[Object.assign({},n,{leading:!1,trailing:!0})]};e.patch(t,i);const r={type:"JSXExpressionContainer",expression:i};return e.patch(t,r),r}function tRe(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}class tS{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}tS.prototype.normal={};tS.prototype.property={};tS.prototype.space=void 0;function yQ(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new tS(n,i,e)}function TI(t){return t.toLowerCase()}class qo{constructor(e,n){this.attribute=n,this.property=e}}qo.prototype.attribute="";qo.prototype.booleanish=!1;qo.prototype.boolean=!1;qo.prototype.commaOrSpaceSeparated=!1;qo.prototype.commaSeparated=!1;qo.prototype.defined=!1;qo.prototype.mustUseProperty=!1;qo.prototype.number=!1;qo.prototype.overloadedBoolean=!1;qo.prototype.property="";qo.prototype.spaceSeparated=!1;qo.prototype.space=void 0;let nRe=0;const ri=fg(),Ea=fg(),AI=fg(),Wt=fg(),kr=fg(),w0=fg(),ul=fg();function fg(){return 2**++nRe}const CI=Object.freeze(Object.defineProperty({__proto__:null,boolean:ri,booleanish:Ea,commaOrSpaceSeparated:ul,commaSeparated:w0,number:Wt,overloadedBoolean:AI,spaceSeparated:kr},Symbol.toStringTag,{value:"Module"})),UD=Object.keys(CI);class BU extends qo{constructor(e,n,i,r){let a=-1;if(super(e,n),Z6(this,"space",r),typeof i=="number")for(;++a<UD.length;){const s=UD[a];Z6(this,UD[a],(i&CI[s])===CI[s])}}}BU.prototype.defined=!0;function Z6(t,e,n){n&&(t[e]=n)}function Qv(t){const e={},n={};for(const[i,r]of Object.entries(t.properties)){const a=new BU(i,t.transform(t.attributes||{},i),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),e[i]=a,n[TI(i)]=i,n[TI(a.attribute)]=i}return new tS(e,n,t.space)}const xQ=Qv({properties:{ariaActiveDescendant:null,ariaAtomic:Ea,ariaAutoComplete:null,ariaBusy:Ea,ariaChecked:Ea,ariaColCount:Wt,ariaColIndex:Wt,ariaColSpan:Wt,ariaControls:kr,ariaCurrent:null,ariaDescribedBy:kr,ariaDetails:null,ariaDisabled:Ea,ariaDropEffect:kr,ariaErrorMessage:null,ariaExpanded:Ea,ariaFlowTo:kr,ariaGrabbed:Ea,ariaHasPopup:null,ariaHidden:Ea,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kr,ariaLevel:Wt,ariaLive:null,ariaModal:Ea,ariaMultiLine:Ea,ariaMultiSelectable:Ea,ariaOrientation:null,ariaOwns:kr,ariaPlaceholder:null,ariaPosInSet:Wt,ariaPressed:Ea,ariaReadOnly:Ea,ariaRelevant:null,ariaRequired:Ea,ariaRoleDescription:kr,ariaRowCount:Wt,ariaRowIndex:Wt,ariaRowSpan:Wt,ariaSelected:Ea,ariaSetSize:Wt,ariaSort:null,ariaValueMax:Wt,ariaValueMin:Wt,ariaValueNow:Wt,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function _Q(t,e){return e in t?t[e]:e}function SQ(t,e){return _Q(t,e.toLowerCase())}const iRe=Qv({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:w0,acceptCharset:kr,accessKey:kr,action:null,allow:null,allowFullScreen:ri,allowPaymentRequest:ri,allowUserMedia:ri,alt:null,as:null,async:ri,autoCapitalize:null,autoComplete:kr,autoFocus:ri,autoPlay:ri,blocking:kr,capture:null,charSet:null,checked:ri,cite:null,className:kr,cols:Wt,colSpan:null,content:null,contentEditable:Ea,controls:ri,controlsList:kr,coords:Wt|w0,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ri,defer:ri,dir:null,dirName:null,disabled:ri,download:AI,draggable:Ea,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ri,formTarget:null,headers:kr,height:Wt,hidden:AI,high:Wt,href:null,hrefLang:null,htmlFor:kr,httpEquiv:kr,id:null,imageSizes:null,imageSrcSet:null,inert:ri,inputMode:null,integrity:null,is:null,isMap:ri,itemId:null,itemProp:kr,itemRef:kr,itemScope:ri,itemType:kr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ri,low:Wt,manifest:null,max:null,maxLength:Wt,media:null,method:null,min:null,minLength:Wt,multiple:ri,muted:ri,name:null,nonce:null,noModule:ri,noValidate:ri,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ri,optimum:Wt,pattern:null,ping:kr,placeholder:null,playsInline:ri,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ri,referrerPolicy:null,rel:kr,required:ri,reversed:ri,rows:Wt,rowSpan:Wt,sandbox:kr,scope:null,scoped:ri,seamless:ri,selected:ri,shadowRootClonable:ri,shadowRootDelegatesFocus:ri,shadowRootMode:null,shape:null,size:Wt,sizes:null,slot:null,span:Wt,spellCheck:Ea,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Wt,step:null,style:null,tabIndex:Wt,target:null,title:null,translate:null,type:null,typeMustMatch:ri,useMap:null,value:Ea,width:Wt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kr,axis:null,background:null,bgColor:null,border:Wt,borderColor:null,bottomMargin:Wt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ri,declare:ri,event:null,face:null,frame:null,frameBorder:null,hSpace:Wt,leftMargin:Wt,link:null,longDesc:null,lowSrc:null,marginHeight:Wt,marginWidth:Wt,noResize:ri,noHref:ri,noShade:ri,noWrap:ri,object:null,profile:null,prompt:null,rev:null,rightMargin:Wt,rules:null,scheme:null,scrolling:Ea,standby:null,summary:null,text:null,topMargin:Wt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Wt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ri,disableRemotePlayback:ri,prefix:null,property:null,results:Wt,security:null,unselectable:null},space:"html",transform:SQ}),rRe=Qv({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ul,accentHeight:Wt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Wt,amplitude:Wt,arabicForm:null,ascent:Wt,attributeName:null,attributeType:null,azimuth:Wt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Wt,by:null,calcMode:null,capHeight:Wt,className:kr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Wt,diffuseConstant:Wt,direction:null,display:null,dur:null,divisor:Wt,dominantBaseline:null,download:ri,dx:null,dy:null,edgeMode:null,editable:null,elevation:Wt,enableBackground:null,end:null,event:null,exponent:Wt,externalResourcesRequired:null,fill:null,fillOpacity:Wt,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:w0,g2:w0,glyphName:w0,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Wt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Wt,horizOriginX:Wt,horizOriginY:Wt,id:null,ideographic:Wt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Wt,k:Wt,k1:Wt,k2:Wt,k3:Wt,k4:Wt,kernelMatrix:ul,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Wt,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Wt,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Wt,overlineThickness:Wt,paintOrder:null,panose1:null,path:null,pathLength:Wt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Wt,pointsAtY:Wt,pointsAtZ:Wt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ul,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ul,rev:ul,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ul,requiredFeatures:ul,requiredFonts:ul,requiredFormats:ul,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Wt,specularExponent:Wt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Wt,strikethroughThickness:Wt,string:null,stroke:null,strokeDashArray:ul,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Wt,strokeOpacity:Wt,strokeWidth:null,style:null,surfaceScale:Wt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ul,tabIndex:Wt,tableValues:null,target:null,targetX:Wt,targetY:Wt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ul,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Wt,underlineThickness:Wt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Wt,values:null,vAlphabetic:Wt,vMathematical:Wt,vectorEffect:null,vHanging:Wt,vIdeographic:Wt,version:null,vertAdvY:Wt,vertOriginX:Wt,vertOriginY:Wt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Wt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_Q}),wQ=Qv({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),EQ=Qv({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:SQ}),MQ=Qv({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),aRe={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"},sRe=/[A-Z]/g,Q6=/-[a-z]/g,oRe=/^data[-\w.:]+$/i;function lRe(t,e){const n=TI(e);let i=e,r=qo;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oRe.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(Q6,uRe);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!Q6.test(a)){let s=a.replace(sRe,cRe);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}r=BU}return new r(i,e)}function cRe(t){return"-"+t.toLowerCase()}function uRe(t){return t.charAt(1).toUpperCase()}const fRe=yQ([xQ,iRe,wQ,EQ,MQ],"html"),zU=yQ([xQ,rRe,wQ,EQ,MQ],"svg");function hRe(t){return t.join(" ").trim()}var jU={},eH=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dRe=/\n/g,pRe=/^\s*/,mRe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,gRe=/^:\s*/,bRe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vRe=/^[;\s]*/,yRe=/^\s+|\s+$/g,xRe=`
`,tH="/",nH="*",Qp="",_Re="comment",SRe="declaration",wRe=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,i=1;function r(g){var b=g.match(dRe);b&&(n+=b.length);var y=g.lastIndexOf(xRe);i=~y?g.length-y:i+g.length}function a(){var g={line:n,column:i};return function(b){return b.position=new s(g),c(),b}}function s(g){this.start=g,this.end={line:n,column:i},this.source=e.source}s.prototype.content=t;function o(g){var b=new Error(e.source+":"+n+":"+i+": "+g);if(b.reason=g,b.filename=e.source,b.line=n,b.column=i,b.source=t,!e.silent)throw b}function l(g){var b=g.exec(t);if(b){var y=b[0];return r(y),t=t.slice(y.length),b}}function c(){l(pRe)}function u(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=a();if(!(tH!=t.charAt(0)||nH!=t.charAt(1))){for(var b=2;Qp!=t.charAt(b)&&(nH!=t.charAt(b)||tH!=t.charAt(b+1));)++b;if(b+=2,Qp===t.charAt(b-1))return o("End of comment missing");var y=t.slice(2,b-2);return i+=2,r(y),t=t.slice(b),i+=2,g({type:_Re,comment:y})}}function h(){var g=a(),b=l(mRe);if(b){if(f(),!l(gRe))return o("property missing ':'");var y=l(bRe),p=g({type:SRe,property:iH(b[0].replace(eH,Qp)),value:y?iH(y[0].replace(eH,Qp)):Qp});return l(vRe),p}}function d(){var g=[];u(g);for(var b;b=h();)b!==!1&&(g.push(b),u(g));return g}return c(),d()};function iH(t){return t?t.replace(yRe,Qp):Qp}var ERe=Nm&&Nm.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jU,"__esModule",{value:!0});jU.default=TRe;var MRe=ERe(wRe);function TRe(t,e){var n=null;if(!t||typeof t!="string")return n;var i=(0,MRe.default)(t),r=typeof e=="function";return i.forEach(function(a){if(a.type==="declaration"){var s=a.property,o=a.value;r?e(s,o,a):o&&(n=n||{},n[s]=o)}}),n}var TC={};Object.defineProperty(TC,"__esModule",{value:!0});TC.camelCase=void 0;var ARe=/^--[a-zA-Z0-9_-]+$/,CRe=/-([a-z])/g,RRe=/^[^-]+$/,kRe=/^-(webkit|moz|ms|o|khtml)-/,DRe=/^-(ms)-/,ORe=function(t){return!t||RRe.test(t)||ARe.test(t)},IRe=function(t,e){return e.toUpperCase()},rH=function(t,e){return"".concat(e,"-")},NRe=function(t,e){return e===void 0&&(e={}),ORe(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(DRe,rH):t=t.replace(kRe,rH),t.replace(CRe,IRe))};TC.camelCase=NRe;var LRe=Nm&&Nm.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},PRe=LRe(jU),URe=TC;function RI(t,e){var n={};return!t||typeof t!="string"||(0,PRe.default)(t,function(i,r){i&&r&&(n[(0,URe.camelCase)(i,e)]=r)}),n}RI.default=RI;var FRe=RI;const BRe=Mc(FRe),kI={}.hasOwnProperty,zRe=/[A-Z]/g,jRe=new Set(["td","th"]);function HRe(t,e){const n=e.schema;let i=n;const r=t.properties||{};n.space==="html"&&t.tagName.toLowerCase()==="svg"&&(i=zU,e.schema=i);const a=e.all(t),s=[];let o,l,c;for(o in r)if(kI.call(r,o)){let f=r[o];const h=lRe(i,o);let d;if(f==null||f===!1||typeof f=="number"&&Number.isNaN(f)||!f&&h.boolean)continue;if(o=e.elementAttributeNameCase==="react"&&h.space?aRe[h.property]||h.property:h.attribute,Array.isArray(f)&&(f=h.commaSeparated?tRe(f):hRe(f)),o==="style"){let g=typeof f=="object"?f:VRe(String(f),t.tagName);e.stylePropertyNameCase==="css"&&(g=GRe(g));const b=[];let y;for(y in g)kI.call(g,y)&&b.push({type:"Property",method:!1,shorthand:!1,computed:!1,key:ef(y)?{type:"Identifier",name:y}:{type:"Literal",value:y},value:{type:"Literal",value:String(g[y])},kind:"init"});c=b,d={type:"JSXExpressionContainer",expression:{type:"ObjectExpression",properties:b}}}else if(f===!0)d=null;else if(e.tableCellAlignToStyle&&jRe.has(t.tagName)&&o==="align"){l=String(f);continue}else d={type:"Literal",value:String(f)};ef(o,{jsx:!0})?s.push({type:"JSXAttribute",name:{type:"JSXIdentifier",name:o},value:d}):s.push({type:"JSXSpreadAttribute",argument:{type:"ObjectExpression",properties:[{type:"Property",method:!1,shorthand:!1,computed:!1,key:{type:"Literal",value:String(o)},value:d||{type:"Literal",value:!0},kind:"init"}]}})}if(l!==void 0){c||(c=[],s.push({type:"JSXAttribute",name:{type:"JSXIdentifier",name:"style"},value:{type:"JSXExpressionContainer",expression:{type:"ObjectExpression",properties:c}}}));const f=e.stylePropertyNameCase==="css"?TQ("textAlign"):"textAlign";c.push({type:"Property",method:!1,shorthand:!1,computed:!1,key:ef(f)?{type:"Identifier",name:f}:{type:"Literal",value:f},value:{type:"Literal",value:l},kind:"init"})}e.schema=n;const u={type:"JSXElement",openingElement:{type:"JSXOpeningElement",attributes:s,name:e.createJsxElementName(t.tagName),selfClosing:a.length===0},closingElement:a.length>0?{type:"JSXClosingElement",name:e.createJsxElementName(t.tagName)}:null,children:a};return e.inherit(t,u),u}function VRe(t,e){try{return BRe(t,{reactCompat:!0})}catch(n){const i=n;throw new Error("Could not parse `style` attribute on `"+e+"`",{cause:i})}}function GRe(t){const e={};let n;for(n in t)kI.call(t,n)&&(e[TQ(n)]=t[n]);return e}function TQ(t){let e=t.replace(zRe,WRe);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function WRe(t){return"-"+t.toLowerCase()}const qRe={}.hasOwnProperty,XRe=[];function uT(t,e){const n=e?[...e].sort(HU):XRe;n.length>0&&AQ(t,{comments:n,index:0})}function AQ(t,e){if(e.index===e.comments.length)return;const n=[],i=[];let r;for(r in t)if(qRe.call(t,r)){const s=t[r];if(s&&typeof s=="object"&&r!=="comments")if(Array.isArray(s)){let o=-1;for(;++o<s.length;)s[o]&&typeof s[o].type=="string"&&n.push(s[o])}else typeof s.type=="string"&&n.push(s)}n.sort(HU),i.push(...aH(e,t,!1,{leading:!0,trailing:!1}));let a=-1;for(;++a<n.length;)AQ(n[a],e);i.push(...aH(e,t,!0,{leading:!1,trailing:n.length>0})),i.length>0&&(t.comments=i)}function aH(t,e,n,i){const r=[];for(;t.comments[t.index]&&HU(t.comments[t.index],e,n)<1;)r.push(Object.assign({},t.comments[t.index++],i));return r}function HU(t,e,n){const i=n?"end":"start";return t.range&&e.range?t.range[0]-e.range[n?1:0]:t.loc&&t.loc.start&&e.loc&&e.loc[i]?t.loc.start.line-e.loc[i].line||t.loc.start.column-e.loc[i].column:"start"in t&&i in e?t.start-e[i]:Number.NaN}function sH(t,e){const n=t.data&&t.data.estree,i=n&&n.comments||[];let r;n&&(e.comments.push(...i),uT(n,n.comments),r=n.body[0]&&n.body[0].type==="ExpressionStatement"&&n.body[0].expression||void 0),r||(r={type:"JSXEmptyExpression"},e.patch(t,r));const a={type:"JSXExpressionContainer",expression:r};return e.inherit(t,a),a}function oH(t,e){const n=e.schema;let i=n;const r=t.attributes||[];let a=-1;t.name&&n.space==="html"&&t.name.toLowerCase()==="svg"&&(i=zU,e.schema=i);const s=e.all(t),o=[];for(;++a<r.length;){const c=r[a],u=c.value;let f;if(c.type==="mdxJsxAttribute"){if(u==null)f=null;else if(typeof u=="object"){const d=u.data&&u.data.estree,g=d&&d.comments||[];let b;d&&(e.comments.push(...g),uT(d,d.comments),b=d.body[0]&&d.body[0].type==="ExpressionStatement"&&d.body[0].expression||void 0),f={type:"JSXExpressionContainer",expression:b||{type:"JSXEmptyExpression"}},e.inherit(u,f)}else f={type:"Literal",value:String(u)};const h={type:"JSXAttribute",name:e.createJsxAttributeName(c.name),value:f};e.inherit(c,h),o.push(h)}else{const h=c.data&&c.data.estree,d=h&&h.comments||[];let g;h&&(e.comments.push(...d),uT(h,h.comments),g=h.body[0]&&h.body[0].type==="ExpressionStatement"&&h.body[0].expression&&h.body[0].expression.type==="ObjectExpression"&&h.body[0].expression.properties&&h.body[0].expression.properties[0]&&h.body[0].expression.properties[0].type==="SpreadElement"&&h.body[0].expression.properties[0].argument||void 0);const b={type:"JSXSpreadAttribute",argument:g||{type:"ObjectExpression",properties:[]}};e.inherit(c,b),o.push(b)}}e.schema=n;const l=t.name?{type:"JSXElement",openingElement:{type:"JSXOpeningElement",attributes:o,name:e.createJsxElementName(t.name),selfClosing:s.length===0},closingElement:s.length>0?{type:"JSXClosingElement",name:e.createJsxElementName(t.name)}:null,children:s}:{type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:s};return e.inherit(t,l),l}function KRe(t,e){const n=t.data&&t.data.estree,i=n&&n.comments||[];n&&(e.comments.push(...i),uT(n,i),e.esm.push(...n.body))}const YRe=/[ \t\n\f\r]/g;function JRe(t){return typeof t=="object"?t.type==="text"?lH(t.value):!1:lH(t)}function lH(t){return t.replace(YRe,"")===""}function $Re(t,e){const n=e.all(t),i=[];let r=-1,a;for(;++r<n.length;){const o=n[r];o.type==="JSXExpressionContainer"&&o.expression.type==="Literal"&&JRe(String(o.expression.value))?a&&a.push(o):(a&&i.push(...a),i.push(o),a=[])}const s={type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:i};return e.inherit(t,s),s}function ZRe(t,e){const n=String(t.value||"");if(n){const i={type:"Literal",value:n};e.inherit(t,i);const r={type:"JSXExpressionContainer",expression:i};return e.patch(t,r),r}}const QRe={comment:eRe,doctype:e3e,element:HRe,mdxFlowExpression:sH,mdxJsxFlowElement:oH,mdxJsxTextElement:oH,mdxTextExpression:sH,mdxjsEsm:KRe,root:$Re,text:ZRe};function e3e(){}const CQ=kQ("end"),RQ=kQ("start");function kQ(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function DQ(t){const e=RQ(t),n=CQ(t);if(e&&n)return{start:e,end:n}}const cH={}.hasOwnProperty;function t3e(t,e){const n=e||{};function i(r,...a){let s=i.invalid;const o=i.handlers;if(r&&cH.call(r,t)){const l=String(r[t]);s=cH.call(o,l)?o[l]:i.unknown}if(s)return s.call(this,r,...a)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const n3e={}.hasOwnProperty,i3e=new Set(["table","tbody","thead","tfoot","tr"]);function r3e(t){const e=t3e("type",{invalid:a3e,unknown:s3e,handlers:{...QRe,...t.handlers}});return{elementAttributeNameCase:t.elementAttributeNameCase||"react",schema:t.space==="svg"?zU:fRe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1,comments:[],esm:[],all:o3e,createJsxAttributeName:c3e,createJsxElementName:u3e,handle:n,inherit:l3e,patch:OQ};function n(i){return e(i,this)}}function a3e(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function s3e(t){throw new Error("Cannot handle unknown node `"+t.type+"`")}function o3e(t){const e=t.children||[];let n=-1;const i=[],r=this.schema.space==="html"&&t.type==="element"&&i3e.has(t.tagName.toLowerCase());for(;++n<e.length;){const a=e[n];if(r&&a.type==="text"&&a.value===`
`)continue;const s=this.handle(a);Array.isArray(s)?i.push(...s):s&&i.push(s)}return i}function l3e(t,e){const n=t.data;let i,r;if(OQ(t,e),n){for(r in n)n3e.call(n,r)&&r!=="estree"&&(i||(i={}),i[r]=n[r]);i&&(e.data=i)}}function OQ(t,e){const n=DQ(t);n&&n.start.offset!==void 0&&n.end.offset!==void 0&&(e.start=n.start.offset,e.end=n.end.offset,e.loc={start:{line:n.start.line,column:n.start.column-1},end:{line:n.end.line,column:n.end.column-1}},e.range=[n.start.offset,n.end.offset])}function c3e(t){const e=IQ(t);if(e.type==="JSXMemberExpression")throw new Error("Member expressions in attribute names are not supported");return e}function u3e(t){return IQ(t)}function IQ(t){if(t.includes(".")){const e=t.split(".");let n=e.shift(),i={type:"JSXIdentifier",name:n};for(;n=e.shift();)i={type:"JSXMemberExpression",object:i,property:{type:"JSXIdentifier",name:n}};return i}if(t.includes(":")){const e=t.split(":");return{type:"JSXNamespacedName",namespace:{type:"JSXIdentifier",name:e[0]},name:{type:"JSXIdentifier",name:e[1]}}}return{type:"JSXIdentifier",name:t}}function f3e(t,e){const n=r3e(e||{});let i=n.handle(t);const r=n.esm;if(i){i.type!=="JSXFragment"&&i.type!=="JSXElement"&&(i={type:"JSXFragment",openingFragment:{type:"JSXOpeningFragment"},closingFragment:{type:"JSXClosingFragment"},children:[i]},n.patch(t,i));const s={type:"ExpressionStatement",expression:i};n.patch(t,s),r.push(s)}const a={type:"Program",body:r,sourceType:"module",comments:n.comments};return n.patch(t,a),a}function h3e(t){return function(e){return f3e(e,t)}}function d3e(){return{enter:{mdxFlowExpression:m3e,mdxTextExpression:g3e},exit:{mdxFlowExpression:uH,mdxFlowExpressionChunk:fH,mdxTextExpression:uH,mdxTextExpressionChunk:fH}}}function p3e(){return{handlers:{mdxFlowExpression:hH,mdxTextExpression:hH},unsafe:[{character:"{",inConstruct:["phrasing"]},{atBreak:!0,character:"{"}]}}function m3e(t){this.enter({type:"mdxFlowExpression",value:""},t),this.buffer()}function g3e(t){this.enter({type:"mdxTextExpression",value:""},t),this.buffer()}function uH(t){const e=this.resume(),n=t.estree,i=this.stack[this.stack.length-1];i.type==="mdxFlowExpression"||i.type,this.exit(t),i.value=e,n&&(i.data={estree:n})}function fH(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}function hH(t,e,n){const i=t.value||"";return"{"+n.indentLines(i,function(a,s,o){return(s===0||o?"":"  ")+a})+"}"}function fT(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(e);for(;r!==-1;)i++,r=n.indexOf(e,r+e.length);return i}const b3e=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],dH={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function NQ(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=48&&e<=57}function v3e(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}function y3e(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=122||e>=65&&e<=90}function pH(t){return y3e(t)||NQ(t)}const mH=document.createElement("i");function Z1(t){const e="&"+t+";";mH.innerHTML=e;const n=mH.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}const x3e=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function _3e(t,e){const n=e||{},i=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,r=[];let a=0,s=-1,o="",l,c;n.position&&("start"in n.position||"indent"in n.position?(c=n.position.indent,l=n.position.start):l=n.position);let u=(l?l.line:0)||1,f=(l?l.column:0)||1,h=g(),d;for(a--;++a<=t.length;)if(d===10&&(f=(c?c[s]:0)||1),d=t.charCodeAt(a),d===38){const p=t.charCodeAt(a+1);if(p===9||p===10||p===12||p===32||p===38||p===60||Number.isNaN(p)||i&&p===i){o+=String.fromCharCode(d),f++;continue}const x=a+1;let _=x,w=x,M;if(p===35){w=++_;const j=t.charCodeAt(w);j===88||j===120?(M="hexadecimal",w=++_):M="decimal"}else M="named";let S="",A="",C="";const D=M==="named"?pH:M==="decimal"?NQ:v3e;for(w--;++w<=t.length;){const j=t.charCodeAt(w);if(!D(j))break;C+=String.fromCharCode(j),M==="named"&&b3e.includes(C)&&(S=C,A=Z1(C))}let R=t.charCodeAt(w)===59;if(R){w++;const j=M==="named"?Z1(C):!1;j&&(S=C,A=j)}let N=1+w-x,U="";if(!(!R&&n.nonTerminated===!1))if(!C)M!=="named"&&b(4,N);else if(M==="named"){if(R&&!A)b(5,1);else if(S!==C&&(w=_+S.length,N=1+w-_,R=!1),!R){const j=S?1:3;if(n.attribute){const z=t.charCodeAt(w);z===61?(b(j,N),A=""):pH(z)?A="":b(j,N)}else b(j,N)}U=A}else{R||b(2,N);let j=Number.parseInt(C,M==="hexadecimal"?16:10);if(S3e(j))b(7,N),U="�";else if(j in dH)b(6,N),U=dH[j];else{let z="";w3e(j)&&b(6,N),j>65535&&(j-=65536,z+=String.fromCharCode(j>>>10|55296),j=56320|j&1023),U=z+String.fromCharCode(j)}}if(U){y(),h=g(),a=w-1,f+=w-x+1,r.push(U);const j=g();j.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,U,{start:h,end:j},t.slice(x-1,w)),h=j}else C=t.slice(x-1,w),o+=C,f+=C.length,a=w-1}else d===10&&(u++,s++,f=0),Number.isNaN(d)?y():(o+=String.fromCharCode(d),f++);return r.join("");function g(){return{line:u,column:f,offset:a+((l?l.offset:0)||0)}}function b(p,x){let _;n.warning&&(_=g(),_.column+=x,_.offset+=x,n.warning.call(n.warningContext||void 0,x3e[p],_,p))}function y(){o&&(r.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:h,end:g()}),o="")}}function S3e(t){return t>=55296&&t<=57343||t>1114111}function w3e(t){return t>=1&&t<=8||t===11||t>=13&&t<=31||t>=127&&t<=159||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534}const E3e=/["&'<>`]/g,M3e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,T3e=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,A3e=/[|\\{}()[\]^$+*?.]/g,gH=new WeakMap;function C3e(t,e){if(t=t.replace(e.subset?R3e(e.subset):E3e,i),e.subset||e.escapeOnly)return t;return t.replace(M3e,n).replace(T3e,i);function n(r,a,s){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(a+2),e)}function i(r,a,s){return e.format(r.charCodeAt(0),s.charCodeAt(a+1),e)}}function R3e(t){let e=gH.get(t);return e||(e=k3e(t),gH.set(t,e)),e}function k3e(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(A3e,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function D3e(t){return"&#x"+t.toString(16).toUpperCase()+";"}function O3e(t,e){return C3e(t,Object.assign({format:D3e},e))}const LQ="  ";function I3e(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:i,mdxJsxFlowTagClosingMarker:r,mdxJsxFlowTagAttribute:f,mdxJsxFlowTagExpressionAttribute:h,mdxJsxFlowTagAttributeValueLiteral:t,mdxJsxFlowTagAttributeValueExpression:t,mdxJsxFlowTagSelfClosingMarker:s,mdxJsxTextTag:i,mdxJsxTextTagClosingMarker:r,mdxJsxTextTagAttribute:f,mdxJsxTextTagExpressionAttribute:h,mdxJsxTextTagAttributeValueLiteral:t,mdxJsxTextTagAttributeValueExpression:t,mdxJsxTextTagSelfClosingMarker:s},exit:{mdxJsxFlowTagClosingMarker:o,mdxJsxFlowTagNamePrimary:l,mdxJsxFlowTagNameMember:c,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:d,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:g,mdxJsxFlowTagAttributeNameLocal:b,mdxJsxFlowTagAttributeValueLiteral:y,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:p,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:x,mdxJsxFlowTag:_,mdxJsxTextTagClosingMarker:o,mdxJsxTextTagNamePrimary:l,mdxJsxTextTagNameMember:c,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:d,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:g,mdxJsxTextTagAttributeNameLocal:b,mdxJsxTextTagAttributeValueLiteral:y,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:p,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:x,mdxJsxTextTag:_}};function t(){this.buffer()}function e(A){return{line:A.line,column:A.column,offset:A.offset}}function n(A){this.config.enter.data.call(this,A),this.config.exit.data.call(this,A)}function i(A){const C={name:void 0,attributes:[],close:!1,selfClosing:!1,start:A.start,end:A.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=C,this.buffer()}function r(A){if(this.data.mdxJsxTagStack.length===0)throw new tr("Unexpected closing slash `/` in tag, expected an open tag first",{start:A.start,end:A.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function a(A){if(this.data.mdxJsxTag.close)throw new tr("Unexpected attribute in closing tag, expected the end of the tag",{start:A.start,end:A.end},"mdast-util-mdx-jsx:unexpected-attribute")}function s(A){if(this.data.mdxJsxTag.close)throw new tr("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:A.start,end:A.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function o(){const A=this.data.mdxJsxTag;A.close=!0}function l(A){const C=this.data.mdxJsxTag;C.name=this.sliceSerialize(A)}function c(A){const C=this.data.mdxJsxTag;C.name+="."+this.sliceSerialize(A)}function u(A){const C=this.data.mdxJsxTag;C.name+=":"+this.sliceSerialize(A)}function f(A){const C=this.data.mdxJsxTag;a.call(this,A),C.attributes.push({type:"mdxJsxAttribute",name:"",value:null,position:{start:e(A.start),end:void 0}})}function h(A){const C=this.data.mdxJsxTag;a.call(this,A),C.attributes.push({type:"mdxJsxExpressionAttribute",value:"",position:{start:e(A.start),end:void 0}}),this.buffer()}function d(A){const C=this.data.mdxJsxTag,D=C.attributes[C.attributes.length-1];D.type;const R=A.estree;D.value=this.resume(),D.position,D.position.end=e(A.end),R&&(D.data={estree:R})}function g(A){const C=this.data.mdxJsxTag,D=C.attributes[C.attributes.length-1];D.type,D.name=this.sliceSerialize(A),D.position,D.position.end=e(A.end)}function b(A){const C=this.data.mdxJsxTag,D=C.attributes[C.attributes.length-1];D.type,D.name+=":"+this.sliceSerialize(A),D.position,D.position.end=e(A.end)}function y(A){const C=this.data.mdxJsxTag,D=C.attributes[C.attributes.length-1];D.value=_3e(this.resume(),{nonTerminated:!1}),D.position,D.position.end=e(A.end)}function p(A){const C=this.data.mdxJsxTag,D=C.attributes[C.attributes.length-1];D.type;const R={type:"mdxJsxAttributeValueExpression",value:this.resume()},N=A.estree;N&&(R.data={estree:N}),D.value=R,D.position,D.position.end=e(A.end)}function x(){const A=this.data.mdxJsxTag;A.selfClosing=!0}function _(A){const C=this.data.mdxJsxTag,D=this.data.mdxJsxTagStack,R=D[D.length-1];if(C.close&&R.name!==C.name)throw new tr("Unexpected closing tag `"+S(C)+"`, expected corresponding closing tag for `"+S(R)+"` ("+bc(R)+")",{start:A.start,end:A.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),C.close?D.pop():this.enter({type:A.type==="mdxJsxTextTag"?"mdxJsxTextElement":"mdxJsxFlowElement",name:C.name||null,attributes:C.attributes,children:[]},A,w),C.selfClosing||C.close?this.exit(A,M):D.push(C)}function w(A,C){const D=this.data.mdxJsxTagStack,R=D[D.length-1],N=A?" before the end of `"+A.type+"`":"",U=A?{start:A.start,end:A.end}:void 0;throw new tr("Expected a closing tag for `"+S(R)+"` ("+bc({start:C.start,end:C.end})+")"+N,U,"mdast-util-mdx-jsx:end-tag-mismatch")}function M(A,C){const D=this.data.mdxJsxTag;throw new tr("Expected the closing tag `"+S(D)+"` either after the end of `"+C.type+"` ("+bc(C.end)+") or another opening tag after the start of `"+C.type+"` ("+bc(C.start)+")",{start:A.start,end:A.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function S(A){return"<"+(A.close?"/":"")+(A.name||"")+">"}}function N3e(t){const e=t||{},n=e.quote||'"',i=e.quoteSmart||!1,r=e.tightSelfClosing||!1,a=e.printWidth||Number.POSITIVE_INFINITY,s=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return o.peek=P3e,{handlers:{mdxJsxFlowElement:o,mdxJsxTextElement:o},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function o(l,c,u,f){const h=l.type==="mdxJsxFlowElement",d=l.name?!l.children||l.children.length===0:!1,g=PQ(u),b=UQ(g),y=u.createTracker(f),p=u.createTracker(f),x=[],_=(h?b:"")+"<"+(l.name||""),w=u.enter(l.type);if(y.move(_),p.move(_),l.attributes&&l.attributes.length>0){if(!l.name)throw new Error("Cannot serialize fragment w/ attributes");let D=-1;for(;++D<l.attributes.length;){const R=l.attributes[D];let N;if(R.type==="mdxJsxExpressionAttribute")N="{"+(R.value||"")+"}";else{if(!R.name)throw new Error("Cannot serialize attribute w/o name");const U=R.value,j=R.name;let z="";if(U!=null)if(typeof U=="object")z="{"+(U.value||"")+"}";else{const q=i&&fT(U,n)>fT(U,s)?s:n;z=q+O3e(U,{subset:[q]})+q}N=j+(z?"=":"")+z}x.push(N)}}let M=!1;const S=x.join(" ");h&&(/\r?\n|\r/.test(S)||y.current().now.column+S.length+(d?r?2:3:1)>a)&&(M=!0);let A=y,C=_;if(M){A=p;let D=-1;for(;++D<x.length;)x[D]=b+LQ+x[D];C+=A.move(`
`+x.join(`
`)+`
`+b)}else S&&(C+=A.move(" "+S));return d&&(C+=A.move((r||M?"":" ")+"/")),C+=A.move(">"),l.children&&l.children.length>0&&(l.type==="mdxJsxTextElement"?C+=A.move(u.containerPhrasing(l,{...A.current(),before:">",after:"<"})):(A.shift(2),C+=A.move(`
`),C+=A.move(L3e(l,u,A.current())),C+=A.move(`
`))),d||(C+=A.move((h?b:"")+"</"+(l.name||"")+">")),w(),C}}function L3e(t,e,n){const i=e.indexStack,r=t.children,a=e.createTracker(n),s=UQ(PQ(e)),o=[];let l=-1;for(i.push(-1);++l<r.length;){const c=r[l];i[i.length-1]=l;const u={before:`
`,after:`
`,...a.current()},f=e.handle(c,t,e,u),h=c.type==="mdxJsxFlowElement"?f:e.indentLines(f,function(d,g,b){return(b?"":s)+d});o.push(a.move(h)),c.type!=="list"&&(e.bulletLastUsed=void 0),l<r.length-1&&o.push(a.move(`

`))}return i.pop(),o.join("")}function PQ(t){let e=0,n=t.stack.length;for(;--n>-1;){const i=t.stack[n];if(i==="blockquote"||i==="listItem")break;i==="mdxJsxFlowElement"&&e++}return e}function UQ(t){return LQ.repeat(t)}function P3e(){return"<"}function U3e(){return{enter:{mdxjsEsm:B3e},exit:{mdxjsEsm:z3e,mdxjsEsmData:j3e}}}function F3e(){return{handlers:{mdxjsEsm:H3e}}}function B3e(t){this.enter({type:"mdxjsEsm",value:""},t),this.buffer()}function z3e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(t);const i=t.estree;n.value=e,i&&(n.data={estree:i})}function j3e(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}function H3e(t){return t.value||""}function V3e(){return[d3e(),I3e(),U3e()]}function G3e(t){return{extensions:[p3e(),N3e(t),F3e()]}}var W3e=MI();const eo=Zd(/[A-Za-z]/),io=Zd(/[\dA-Za-z]/),q3e=Zd(/[#-'*+\--9=?A-Z^-~]/);function hT(t){return t!==null&&(t<32||t===127)}const DI=Zd(/\d/),X3e=Zd(/[\dA-Fa-f]/),K3e=Zd(/[!-/:-@[-`{-~]/);function gn(t){return t!==null&&t<-2}function Bi(t){return t!==null&&(t<0||t===32)}function ti(t){return t===-2||t===-1||t===32}const AC=Zd(new RegExp("\\p{P}|\\p{S}","u")),yo=Zd(/\s/);function Zd(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Di(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return ti(l)?(t.enter(n),o(l)):e(l)}function o(l){return ti(l)&&a++<r?(t.consume(l),o):(t.exit(n),e(l))}}const Y3e={}.hasOwnProperty,J3e=Symbol("continue"),FD=Symbol("exit"),$3e=Symbol("skip");function Z3e(t,e){let n,i;typeof e=="function"?n=e:e&&typeof e=="object"&&(e.enter&&(n=e.enter),e.leave&&(i=e.leave)),r(t,void 0,void 0,[])();function r(a,s,o,l){return BD(a)&&(c.displayName="node ("+a.type+")"),c;function c(){const u=n?bH(n(a,s,o,l)):[];if(u[0]===FD)return u;if(u[0]!==$3e){let f;for(f in a)if(Y3e.call(a,f)&&a[f]&&typeof a[f]=="object"&&f!=="data"&&f!=="position"){const h=l.concat(a),d=a[f];if(Array.isArray(d)){const g=d;let b=0;for(;b>-1&&b<g.length;){const y=g[b];if(BD(y)){const p=r(y,f,b,h)();if(p[0]===FD)return p;b=typeof p[1]=="number"?p[1]:b+1}else b++}}else if(BD(d)){const g=r(d,f,void 0,h)();if(g[0]===FD)return g}}}return i?bH(i(a,s,o,l)):u}}}function bH(t){return Array.isArray(t)?t:typeof t=="number"?[J3e,t]:[t]}function BD(t){return!!(t&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.length>0)}function FQ(t,e){const n=e.prefix||"",i=e.suffix||"",r=Object.assign({},e.acornOptions),a=[],s=[],o=r.onComment,l=r.onToken;let c=!1,u,f;const h=Object.assign({},r,{onComment:a,preserveParens:!0});l&&(h.onToken=s);const d=Q3e(t,e.tokenTypes),g=d.value,b=n+g+i,y=e.expression&&vH(g);if(y&&!e.allowEmpty)throw new tr("Unexpected empty expression",{place:x(0),ruleId:"unexpected-empty-expression",source:"micromark-extension-mdx-expression"});try{u=e.expression&&!y?e.acorn.parseExpressionAt(b,0,h):e.acorn.parse(b,h)}catch(_){const w=_,M=x(w.pos);w.message=String(w.message).replace(/ \(\d+:\d+\)$/,""),w.pos=M.offset,w.loc={line:M.line,column:M.column-1},f=w,c=w.raisedAt>=n.length+g.length||w.message==="Unterminated comment"}if(u&&e.expression&&!y)if(vH(b.slice(u.end,b.length-i.length)))u={type:"Program",start:0,end:n.length+g.length,body:[{type:"ExpressionStatement",expression:u,start:0,end:n.length+g.length}],sourceType:"module",comments:[]};else{const _=x(u.end),w=new Error("Unexpected content after expression");w.pos=_.offset,w.loc={line:_.line,column:_.column-1},f=w,u=void 0}if(u){if(u.comments=a,Z3e(u,function(_,w,M,S){let A=S[S.length-1],C=w;_.type==="ParenthesizedExpression"&&A&&C&&(typeof M=="number"&&(A=A[C],C=M),A[C]=_.expression),p(_)}),Array.isArray(o))o.push(...a);else if(typeof o=="function")for(const _ of a)o(_.type==="Block",_.value,_.start,_.end,_.loc.start,_.loc.end);for(const _ of s)_.end<=n.length||_.start-n.length>=g.length||(p(_),Array.isArray(l)?l.push(_):l(_))}return{estree:u,error:f,swallow:c};function p(_){const w=x(_.start),M=x(_.end);_.start=w.offset,_.end=M.offset,_.loc={start:{line:w.line,column:w.column-1,offset:w.offset},end:{line:M.line,column:M.column-1,offset:M.offset}},_.range=[_.start,_.end]}function x(_){let w=_-n.length;w<0?w=0:w>g.length&&(w=g.length);let M=eke(d.stops,w);return M||(M={line:e.start.line,column:e.start.column,offset:e.start.offset}),M}}function vH(t){return/^\s*$/.test(t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,""))}function Q3e(t,e){const n={value:"",stops:[]};let i=-1;for(;++i<t.length;){const r=t[i];if(r[0]==="enter"){const a=r[1].type;if(a==="lineEnding"||e.includes(a)){const s=r[2].sliceStream(r[1]);for(;s.length>0&&s[0]===-1;)s.shift();const o=tke(s);n.stops.push([n.value.length,r[1].start]),n.value+=o,n.stops.push([n.value.length,r[1].end])}}}return n}function eke(t,e){let n=0;for(;n<t.length&&t[n][0]<=e;)n+=1;if(n===0)return;const[i,r]=t[n-1],a=e-i;return{line:r.line,column:r.column+a,offset:r.offset+a}}function tke(t){let e=-1;const n=[];let i;for(;++e<t.length;){const r=t[e];let a;if(typeof r=="string")a=r;else switch(r){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a="	";break}case-1:{if(i)continue;a=" ";break}default:a=String.fromCharCode(r)}i=r===-2,n.push(a)}return n.join("")}function $f(t){const e=t||{},n=e.loc||{},i=e.range||[void 0,void 0],r=yH(n.start,i[0]||e.start),a=yH(n.end,i[1]||e.end);if(r&&a)return{start:r,end:a}}function yH(t,e){if(t&&typeof t=="object"){const n="line"in t?zD(t.line):void 0,i="column"in t?zD(t.column):void 0;if(n&&i!==void 0)return{line:n,column:i+1,offset:zD(e)}}}function zD(t){return typeof t=="number"&&t>-1?t:void 0}const nke=2,i0="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",ike="#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",rke="#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",xH="#unexpected-type-in-code-expected-an-object-spread-spread",ake="#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",ske="#could-not-parse-expression-with-acorn";function dT(t,e,n,i,r,a,s,o,l,c,u){const f=this,h=this.events.length+3;let d=0,g,b;return y;function y(w){return t.enter(n),t.enter(i),t.consume(w),t.exit(i),g=f.now(),p}function p(w){if(w===null){if(b)throw b;const M=new tr("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:f.now(),ruleId:"unexpected-eof",source:"micromark-extension-mdx-expression"});throw M.url=i0+ike,M}if(gn(w))return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),_;if(w===125&&d===0){const M=a?oke.call(f,a,s,r,h,g,c||!1,l||!1):{type:"ok",estree:void 0};if(M.type==="ok"){t.enter(i),t.consume(w),t.exit(i);const S=t.exit(n);return o&&M.estree&&Object.assign(S,{estree:M.estree}),e}return b=M.message,t.enter(r),t.consume(w),x}return t.enter(r),x(w)}function x(w){return w===125&&d===0||w===null||gn(w)?(t.exit(r),p(w)):(w===123&&!a?d+=1:w===125&&(d-=1),t.consume(w),x)}function _(w){const M=f.now();if(M.line!==g.line&&!u&&f.parser.lazy[M.line]){const S=new tr("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:f.now(),ruleId:"unexpected-lazy",source:"micromark-extension-mdx-expression"});throw S.url=i0+rke,S}return ti(w)?Di(t,p,"linePrefix",nke+1)(w):p(w)}}function oke(t,e,n,i,r,a,s){const o=FQ(this.events.slice(i),{acorn:t,tokenTypes:[n],acornOptions:e,start:r,expression:!0,allowEmpty:a,prefix:s?"({":"",suffix:s?"})":""}),l=o.estree;if(s&&l){const c=l.body[0];if(c.type!=="ExpressionStatement"||c.expression.type!=="ObjectExpression"){const u=$f(c),f=new tr("Unexpected `"+c.type+"` in code: expected an object spread (`{...spread}`)",{place:u.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw f.url=i0+xH,f}if(c.expression.properties[1]){const u=$f(c.expression.properties[1]),f=new tr("Unexpected extra content in spread: only a single spread is supported",{place:u.start,ruleId:"spread-extra",source:"micromark-extension-mdx-expression"});throw f.url=i0+ake,f}if(c.expression.properties[0]&&c.expression.properties[0].type!=="SpreadElement"){const u=$f(c.expression.properties[0]),f=new tr("Unexpected `"+c.expression.properties[0].type+"` in code: only spread elements are supported",{place:u.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw f.url=i0+xH,f}}if(o.error){const c=new tr("Could not parse expression with acorn",{cause:o.error,place:{line:o.error.loc.line,column:o.error.loc.column+1,offset:o.error.pos},ruleId:"acorn",source:"micromark-extension-mdx-expression"});return c.url=i0+ske,{type:"nok",message:c}}return{type:"ok",estree:l}}function lke(t){const e=t||{},n=e.addResult,i=e.acorn,r=e.spread;let a=e.allowEmpty,s;if(a==null&&(a=!0),i){if(!i.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");s=Object.assign({ecmaVersion:2024,sourceType:"module"},e.acornOptions)}else if(e.acornOptions||e.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:"mdxFlowExpression",tokenize:o,concrete:!0}},text:{123:{name:"mdxTextExpression",tokenize:l}}};function o(c,u,f){const h=this;return d;function d(p){return g(p)}function g(p){return dT.call(h,c,b,"mdxFlowExpression","mdxFlowExpressionMarker","mdxFlowExpressionChunk",i,s,n,r,a)(p)}function b(p){return ti(p)?Di(c,y,"whitespace")(p):y(p)}function y(p){const x=h.parser.constructs.flow[60],w=(Array.isArray(x)?x:x?[x]:[]).find(function(M){return M.name==="mdxJsxFlowTag"});return p===60&&w?c.attempt(w,y,f)(p):p===null||gn(p)?u(p):f(p)}}function l(c,u){const f=this;return h;function h(d){return dT.call(f,c,u,"mdxTextExpression","mdxTextExpressionMarker","mdxTextExpressionChunk",i,s,n,r,a,!0)(d)}}}const _H="https://github.com/micromark/micromark-extension-mdx-jsx";function BQ(t,e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y,p,x,_,w,M,S,A,C,D,R,N,U,j,z,q){const B=this;let G,H;return W;function W($){return t.enter(o),t.enter(l),t.consume($),t.exit(l),F}function F($){return Bi($)?n($):(G=Y,K($))}function Y($){if($===47)return t.enter(c),t.consume($),t.exit(c),G=Z,K;if($===62)return ie($);if($!==null&&$>=0&&Gc($))return t.enter(f),t.enter(h),t.consume($),V;me($,"before name","a character that can start a name, such as a letter, `$`, or `_`"+($===33?" (note: to create a comment in MDX, use `{/* text */}`)":""))}function Z($){if($===62)return ie($);if($!==null&&$>=0&&Gc($))return t.enter(f),t.enter(h),t.consume($),V;me($,"before name","a character that can start a name, such as a letter, `$`, or `_`"+($===42||$===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function V($){if($!==null&&$>=0&&ax($,{jsx:!0}))return t.consume($),V;if($===46||$===47||$===58||$===62||$===123||Bi($)||yo($))return t.exit(h),G=de,K($);me($,"in name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+($===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function de($){if($===46)return t.enter(d),t.consume($),t.exit(d),G=se,K;if($===58)return t.enter(b),t.consume($),t.exit(b),G=_e,K;if($===47||$===62||$===123||$!==null&&$>=0&&Gc($))return t.exit(f),Ue($);me($,"after name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function se($){if($!==null&&$>=0&&Gc($))return t.enter(g),t.consume($),oe;me($,"before member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function oe($){if($!==null&&$>=0&&ax($,{jsx:!0}))return t.consume($),oe;if($===46||$===47||$===62||$===123||Bi($)||yo($))return t.exit(g),G=ue,K($);me($,"in member name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+($===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function ue($){if($===46)return t.enter(d),t.consume($),t.exit(d),G=se,K;if($===47||$===62||$===123||$!==null&&$>=0&&Gc($))return t.exit(f),Ue($);me($,"after member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e($){if($!==null&&$>=0&&Gc($))return t.enter(y),t.consume($),ke;me($,"before local name","a character that can start a name, such as a letter, `$`, or `_`"+($===43||$!==null&&$>46&&$<58?" (note: to create a link in MDX, use `[text](url)`)":""))}function ke($){if($!==null&&$>=0&&ax($,{jsx:!0}))return t.consume($),ke;if($===47||$===62||$===123||Bi($)||yo($))return t.exit(y),G=Ne,K($);me($,"in local name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ne($){if($===47||$===62||$===123||$!==null&&$>=0&&Gc($))return t.exit(f),Ue($);me($,"after local name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ue($){if($===47)return t.enter(u),t.consume($),t.exit(u),G=$e,K;if($===62)return ie($);if($===123)return dT.call(B,t,ze,p,x,_,i,r,a,!0,!1,s)($);if($!==null&&$>=0&&Gc($))return t.enter(w),t.enter(M),t.enter(S),t.consume($),pe;me($,"before attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ze($){return G=Ue,K($)}function pe($){if($!==null&&$>=0&&ax($,{jsx:!0}))return t.consume($),pe;if($===47||$===58||$===61||$===62||$===123||Bi($)||yo($))return t.exit(S),G=Fe,K($);me($,"in attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function Fe($){if($===58)return t.enter(A),t.consume($),t.exit(A),G=Ie,K;if($===61)return t.exit(M),t.enter(D),t.consume($),t.exit(D),G=Te,K;if($===47||$===62||$===123||Bi($)||yo($)||$!==null&&$>=0&&Gc($))return t.exit(M),t.exit(w),G=Ue,K($);me($,"after attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ie($){if($!==null&&$>=0&&Gc($))return t.enter(C),t.consume($),qe;me($,"before local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function qe($){if($!==null&&$>=0&&ax($,{jsx:!0}))return t.consume($),qe;if($===47||$===61||$===62||$===123||Bi($)||yo($))return t.exit(C),t.exit(M),G=we,K($);me($,"in local attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function we($){if($===61)return t.enter(D),t.consume($),t.exit(D),G=Te,K;if($===47||$===62||$===123||$!==null&&$>=0&&Gc($))return t.exit(w),Ue($);me($,"after local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Te($){if($===34||$===39)return t.enter(R),t.enter(N),t.consume($),t.exit(N),H=$,Pe;if($===123)return dT.call(B,t,Ae,j,z,q,i,r,a,!1,!1,s)($);me($,"before attribute value","a character that can start an attribute value, such as `\"`, `'`, or `{`"+($===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":""))}function Ae($){return t.exit(w),G=Ue,K($)}function Pe($){return $===null&&me($,"in attribute value","a corresponding closing quote `"+String.fromCodePoint(H)+"`"),$===H?(t.enter(N),t.consume($),t.exit(N),t.exit(R),t.exit(w),H=void 0,G=Ue,K):gn($)?(G=Pe,K($)):(t.enter(U),He($))}function He($){return $===null||$===H||gn($)?(t.exit(U),Pe($)):(t.consume($),He)}function $e($){if($===62)return ie($);me($,"after self-closing slash","`>` to end the tag"+($===42||$===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function ie($){return t.enter(l),t.consume($),t.exit(l),t.exit(o),e}function K($){return gn($)?(t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),fe):ti($)||yo($)?(t.enter("esWhitespace"),ce($)):G($)}function ce($){return gn($)?(t.exit("esWhitespace"),K($)):ti($)||yo($)?(t.consume($),ce):(t.exit("esWhitespace"),G($))}function fe($){if(!s&&B.parser.lazy[B.now().line]){const Le=new tr("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",B.now(),"micromark-extension-mdx-jsx:unexpected-lazy");throw Le.url=_H+"#unexpected-lazy-line-in-container-expected-line-to-be",Le}return K($)}function me($,Le,Xe){const mt=new tr("Unexpected "+($===null?"end of file":"character `"+($===96?"` ` `":String.fromCodePoint($))+"` ("+cke($)+")")+" "+Le+", expected "+Xe,B.now(),"micromark-extension-mdx-jsx:unexpected-"+($===null?"eof":"character"));throw mt.url=_H+($===null?"#unexpected-end-of-file-at-expected-expect":"#unexpected-character-at-expected-expect"),mt}}function cke(t){return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function uke(t,e){return{name:"mdxJsxTextTag",tokenize:n};function n(i,r,a){return BQ.call(this,i,r,a,t,e.acornOptions,e.addResult,!0,"mdxJsxTextTag","mdxJsxTextTagMarker","mdxJsxTextTagClosingMarker","mdxJsxTextTagSelfClosingMarker","mdxJsxTextTagName","mdxJsxTextTagNamePrimary","mdxJsxTextTagNameMemberMarker","mdxJsxTextTagNameMember","mdxJsxTextTagNamePrefixMarker","mdxJsxTextTagNameLocal","mdxJsxTextTagExpressionAttribute","mdxJsxTextTagExpressionAttributeMarker","mdxJsxTextTagExpressionAttributeValue","mdxJsxTextTagAttribute","mdxJsxTextTagAttributeName","mdxJsxTextTagAttributeNamePrimary","mdxJsxTextTagAttributeNamePrefixMarker","mdxJsxTextTagAttributeNameLocal","mdxJsxTextTagAttributeInitializerMarker","mdxJsxTextTagAttributeValueLiteral","mdxJsxTextTagAttributeValueLiteralMarker","mdxJsxTextTagAttributeValueLiteralValue","mdxJsxTextTagAttributeValueExpression","mdxJsxTextTagAttributeValueExpressionMarker","mdxJsxTextTagAttributeValueExpressionValue")}}function fke(t,e){return{concrete:!0,name:"mdxJsxFlowTag",tokenize:n};function n(i,r,a){const s=this;return o;function o(f){return l(f)}function l(f){return BQ.call(s,i,c,a,t,e.acornOptions,e.addResult,!1,"mdxJsxFlowTag","mdxJsxFlowTagMarker","mdxJsxFlowTagClosingMarker","mdxJsxFlowTagSelfClosingMarker","mdxJsxFlowTagName","mdxJsxFlowTagNamePrimary","mdxJsxFlowTagNameMemberMarker","mdxJsxFlowTagNameMember","mdxJsxFlowTagNamePrefixMarker","mdxJsxFlowTagNameLocal","mdxJsxFlowTagExpressionAttribute","mdxJsxFlowTagExpressionAttributeMarker","mdxJsxFlowTagExpressionAttributeValue","mdxJsxFlowTagAttribute","mdxJsxFlowTagAttributeName","mdxJsxFlowTagAttributeNamePrimary","mdxJsxFlowTagAttributeNamePrefixMarker","mdxJsxFlowTagAttributeNameLocal","mdxJsxFlowTagAttributeInitializerMarker","mdxJsxFlowTagAttributeValueLiteral","mdxJsxFlowTagAttributeValueLiteralMarker","mdxJsxFlowTagAttributeValueLiteralValue","mdxJsxFlowTagAttributeValueExpression","mdxJsxFlowTagAttributeValueExpressionMarker","mdxJsxFlowTagAttributeValueExpressionValue")(f)}function c(f){return ti(f)?Di(i,u,"whitespace")(f):u(f)}function u(f){const h=s.parser.constructs.flow[123],d=Array.isArray(h)?h:h?[h]:[];let g;for(const b of d)if(b.name==="mdxFlowExpression"){g=b;break}return f===60?o(f):f===123&&g?i.attempt(g,u,a)(f):f===null||gn(f)?r(f):a(f)}}}function hke(t){const e=t||{},n=e.acorn;let i;if(n){if(!n.parse||!n.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");i=Object.assign({ecmaVersion:2024,sourceType:"module"},e.acornOptions,{locations:!0})}else if(e.acornOptions||e.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:fke(n||void 0,{acornOptions:i,addResult:e.addResult||void 0})},text:{60:uke(n||void 0,{acornOptions:i,addResult:e.addResult||void 0})}}}function dke(){return{disable:{null:["autolink","codeIndented","htmlFlow","htmlText"]}}}function El(t,e,n,i){const r=t.length;let a=0,s;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)s=Array.from(i),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);a<i.length;)s=i.slice(a,a+1e4),s.unshift(e,0),t.splice(...s),a+=1e4,e+=1e4}function oc(t,e){return t.length>0?(El(t,t.length,0,e),t):e}function hv(t){if(t===null||Bi(t)||yo(t))return 1;if(AC(t))return 2}function CC(t,e,n){const i=[];let r=-1;for(;++r<t.length;){const a=t[r].resolveAll;a&&!i.includes(a)&&(e=a(e,n),i.push(a))}return e}const OI={name:"attention",resolveAll:pke,tokenize:mke};function pke(t,e){let n=-1,i,r,a,s,o,l,c,u;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[i][1].end},h={...t[n][1].start};SH(f,-l),SH(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[i][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:h},a={type:l>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},t[i][1].end={...s.start},t[n][1].start={...o.end},c=[],t[i][1].end.offset-t[i][1].start.offset&&(c=oc(c,[["enter",t[i][1],e],["exit",t[i][1],e]])),c=oc(c,[["enter",r,e],["enter",s,e],["exit",s,e],["enter",a,e]]),c=oc(c,CC(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),c=oc(c,[["exit",a,e],["enter",o,e],["exit",o,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=oc(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,El(t,i-1,n-i+3,c),n=i+c.length-u-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function mke(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=hv(i);let a;return s;function s(l){return a=l,t.enter("attentionSequence"),o(l)}function o(l){if(l===a)return t.consume(l),o;const c=t.exit("attentionSequence"),u=hv(l),f=!u||u===2&&r||n.includes(l),h=!r||r===2&&u||n.includes(i);return c._open=!!(a===42?f:f&&(r||!h)),c._close=!!(a===42?h:h&&(u||!f)),e(l)}}function SH(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const gke={name:"autolink",tokenize:bke};function bke(t,e,n){let i=0;return r;function r(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(d){return eo(d)?(t.consume(d),s):d===64?n(d):c(d)}function s(d){return d===43||d===45||d===46||io(d)?(i=1,o(d)):c(d)}function o(d){return d===58?(t.consume(d),i=0,l):(d===43||d===45||d===46||io(d))&&i++<32?(t.consume(d),o):(i=0,c(d))}function l(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||hT(d)?n(d):(t.consume(d),l)}function c(d){return d===64?(t.consume(d),u):q3e(d)?(t.consume(d),c):n(d)}function u(d){return io(d)?f(d):n(d)}function f(d){return d===46?(t.consume(d),i=0,u):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):h(d)}function h(d){if((d===45||io(d))&&i++<63){const g=d===45?h:f;return t.consume(d),g}return n(d)}}const ey={partial:!0,tokenize:vke};function vke(t,e,n){return i;function i(a){return ti(a)?Di(t,r,"linePrefix")(a):r(a)}function r(a){return a===null||gn(a)?e(a):n(a)}}const zQ={continuation:{tokenize:xke},exit:_ke,name:"blockQuote",tokenize:yke};function yke(t,e,n){const i=this;return r;function r(s){if(s===62){const o=i.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),a}return n(s)}function a(s){return ti(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function xke(t,e,n){const i=this;return r;function r(s){return ti(s)?Di(t,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return t.attempt(zQ,e,n)(s)}}function _ke(t){t.exit("blockQuote")}const jQ={name:"characterEscape",tokenize:Ske};function Ske(t,e,n){return i;function i(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),r}function r(a){return K3e(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(a)}}const HQ={name:"characterReference",tokenize:wke};function wke(t,e,n){const i=this;let r=0,a,s;return o;function o(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),a=31,s=io,u(f))}function c(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,s=X3e,u):(t.enter("characterReferenceValue"),a=7,s=DI,u(f))}function u(f){if(f===59&&r){const h=t.exit("characterReferenceValue");return s===io&&!Z1(i.sliceSerialize(h))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&r++<a?(t.consume(f),u):n(f)}}const wH={partial:!0,tokenize:Mke},EH={concrete:!0,name:"codeFenced",tokenize:Eke};function Eke(t,e,n){const i=this,r={partial:!0,tokenize:M};let a=0,s=0,o;return l;function l(S){return c(S)}function c(S){const A=i.events[i.events.length-1];return a=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,o=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===o?(s++,t.consume(S),u):s<3?n(S):(t.exit("codeFencedFenceSequence"),ti(S)?Di(t,f,"whitespace")(S):f(S))}function f(S){return S===null||gn(S)?(t.exit("codeFencedFence"),i.interrupt?e(S):t.check(wH,b,w)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||gn(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):ti(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Di(t,d,"whitespace")(S)):S===96&&S===o?n(S):(t.consume(S),h)}function d(S){return S===null||gn(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||gn(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===o?n(S):(t.consume(S),g)}function b(S){return t.attempt(r,w,y)(S)}function y(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),p}function p(S){return a>0&&ti(S)?Di(t,x,"linePrefix",a+1)(S):x(S)}function x(S){return S===null||gn(S)?t.check(wH,b,w)(S):(t.enter("codeFlowValue"),_(S))}function _(S){return S===null||gn(S)?(t.exit("codeFlowValue"),x(S)):(t.consume(S),_)}function w(S){return t.exit("codeFenced"),e(S)}function M(S,A,C){let D=0;return R;function R(q){return S.enter("lineEnding"),S.consume(q),S.exit("lineEnding"),N}function N(q){return S.enter("codeFencedFence"),ti(q)?Di(S,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):U(q)}function U(q){return q===o?(S.enter("codeFencedFenceSequence"),j(q)):C(q)}function j(q){return q===o?(D++,S.consume(q),j):D>=s?(S.exit("codeFencedFenceSequence"),ti(q)?Di(S,z,"whitespace")(q):z(q)):C(q)}function z(q){return q===null||gn(q)?(S.exit("codeFencedFence"),A(q)):C(q)}}}function Mke(t,e,n){const i=this;return r;function r(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a)}function a(s){return i.parser.lazy[i.now().line]?n(s):e(s)}}const jD={name:"codeIndented",tokenize:Ake},Tke={partial:!0,tokenize:Cke};function Ake(t,e,n){const i=this;return r;function r(c){return t.enter("codeIndented"),Di(t,a,"linePrefix",5)(c)}function a(c){const u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):gn(c)?t.attempt(Tke,s,l)(c):(t.enter("codeFlowValue"),o(c))}function o(c){return c===null||gn(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),o)}function l(c){return t.exit("codeIndented"),e(c)}}function Cke(t,e,n){const i=this;return r;function r(s){return i.parser.lazy[i.now().line]?n(s):gn(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r):Di(t,a,"linePrefix",5)(s)}function a(s){const o=i.events[i.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):gn(s)?r(s):n(s)}}const Rke={name:"codeText",previous:Dke,resolve:kke,tokenize:Oke};function kke(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="codeTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function Dke(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Oke(t,e,n){let i=0,r,a;return s;function s(f){return t.enter("codeText"),t.enter("codeTextSequence"),o(f)}function o(f){return f===96?(t.consume(f),i++,o):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(a=t.enter("codeTextSequence"),r=0,u(f)):gn(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||gn(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),c)}function u(f){return f===96?(t.consume(f),r++,u):r===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(a.type="codeTextData",c(f))}}class Ike{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const r=n||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&sx(this.left,i),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sx(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sx(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);sx(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);sx(this.left,n.reverse())}}}function sx(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function VQ(t){const e={};let n=-1,i,r,a,s,o,l,c;const u=new Ike(t);for(;++n<u.length;){for(;n in e;)n=e[n];if(i=u.get(n),n&&i[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,Nke(u,n)),n=e[n],c=!0);else if(i[1]._container){for(a=n,r=void 0;a--;)if(s=u.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(r&&(u.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;r&&(i[1].end={...u.get(r)[1].start},o=u.slice(r,n),o.unshift(i),u.splice(r,n-r+1,o))}}return El(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Nke(t,e){const n=t.get(e)[1],i=t.get(e)[2];let r=e-1;const a=[];let s=n._tokenizer;s||(s=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],c={};let u,f,h=-1,d=n,g=0,b=0;const y=[b];for(;d;){for(;t.get(++r)[1]!==d;);a.push(r),d._tokenizer||(u=i.sliceStream(d),d.next||u.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(b=h+1,y.push(b),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),h=y.length;h--;){const p=o.slice(y[h],y[h+1]),x=a.pop();l.push([x,x+p.length-1]),t.splice(x,2,p)}for(l.reverse(),h=-1;++h<l.length;)c[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return c}const Lke={resolve:Uke,tokenize:Fke},Pke={partial:!0,tokenize:Bke};function Uke(t){return VQ(t),t}function Fke(t,e){let n;return i;function i(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),r(o)}function r(o){return o===null?a(o):gn(o)?t.check(Pke,s,a)(o):(t.consume(o),r)}function a(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function s(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function Bke(t,e,n){const i=this;return r;function r(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Di(t,a,"linePrefix")}function a(s){if(s===null||gn(s))return n(s);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(s):t.interrupt(i.parser.constructs.flow,n,e)(s)}}function GQ(t,e,n,i,r,a,s,o,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(p){return p===60?(t.enter(i),t.enter(r),t.enter(a),t.consume(p),t.exit(a),h):p===null||p===32||p===41||hT(p)?n(p):(t.enter(i),t.enter(s),t.enter(o),t.enter("chunkString",{contentType:"string"}),b(p))}function h(p){return p===62?(t.enter(a),t.consume(p),t.exit(a),t.exit(r),t.exit(i),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===62?(t.exit("chunkString"),t.exit(o),h(p)):p===null||p===60||gn(p)?n(p):(t.consume(p),p===92?g:d)}function g(p){return p===60||p===62||p===92?(t.consume(p),d):d(p)}function b(p){return!u&&(p===null||p===41||Bi(p))?(t.exit("chunkString"),t.exit(o),t.exit(s),t.exit(i),e(p)):u<c&&p===40?(t.consume(p),u++,b):p===41?(t.consume(p),u--,b):p===null||p===32||p===40||hT(p)?n(p):(t.consume(p),p===92?y:b)}function y(p){return p===40||p===41||p===92?(t.consume(p),b):b(p)}}function WQ(t,e,n,i,r,a){const s=this;let o=0,l;return c;function c(d){return t.enter(i),t.enter(r),t.consume(d),t.exit(r),t.enter(a),u}function u(d){return o>999||d===null||d===91||d===93&&!l||d===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(t.exit(a),t.enter(r),t.consume(d),t.exit(r),t.exit(i),e):gn(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||gn(d)||o++>999?(t.exit("chunkString"),u(d)):(t.consume(d),l||(l=!ti(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(t.consume(d),o++,f):f(d)}}function qQ(t,e,n,i,r,a){let s;return o;function o(h){return h===34||h===39||h===40?(t.enter(i),t.enter(r),t.consume(h),t.exit(r),s=h===40?41:h,l):n(h)}function l(h){return h===s?(t.enter(r),t.consume(h),t.exit(r),t.exit(i),e):(t.enter(a),c(h))}function c(h){return h===s?(t.exit(a),l(s)):h===null?n(h):gn(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),Di(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||gn(h)?(t.exit("chunkString"),c(h)):(t.consume(h),h===92?f:u)}function f(h){return h===s||h===92?(t.consume(h),u):u(h)}}function h1(t,e){let n;return i;function i(r){return gn(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):ti(r)?Di(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}function du(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const zke={name:"definition",tokenize:Hke},jke={partial:!0,tokenize:Vke};function Hke(t,e,n){const i=this;let r;return a;function a(d){return t.enter("definition"),s(d)}function s(d){return WQ.call(i,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return r=du(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return Bi(d)?h1(t,c)(d):c(d)}function c(d){return GQ(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return t.attempt(jke,f,f)(d)}function f(d){return ti(d)?Di(t,h,"whitespace")(d):h(d)}function h(d){return d===null||gn(d)?(t.exit("definition"),i.parser.defined.push(r),e(d)):n(d)}}function Vke(t,e,n){return i;function i(o){return Bi(o)?h1(t,r)(o):n(o)}function r(o){return qQ(t,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ti(o)?Di(t,s,"whitespace")(o):s(o)}function s(o){return o===null||gn(o)?e(o):n(o)}}const Gke={name:"hardBreakEscape",tokenize:Wke};function Wke(t,e,n){return i;function i(a){return t.enter("hardBreakEscape"),t.consume(a),r}function r(a){return gn(a)?(t.exit("hardBreakEscape"),e(a)):n(a)}}const qke={name:"headingAtx",resolve:Xke,tokenize:Kke};function Xke(t,e){let n=t.length-2,i=3,r,a;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},a={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},El(t,i,n-i+1,[["enter",r,e],["enter",a,e],["exit",a,e],["exit",r,e]])),t}function Kke(t,e,n){let i=0;return r;function r(u){return t.enter("atxHeading"),a(u)}function a(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&i++<6?(t.consume(u),s):u===null||Bi(u)?(t.exit("atxHeadingSequence"),o(u)):n(u)}function o(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||gn(u)?(t.exit("atxHeading"),e(u)):ti(u)?Di(t,o,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),o(u))}function c(u){return u===null||u===35||Bi(u)?(t.exit("atxHeadingText"),o(u)):(t.consume(u),c)}}const Yke=["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"],MH=["pre","script","style","textarea"],Jke={concrete:!0,name:"htmlFlow",resolveTo:Qke,tokenize:eDe},$ke={partial:!0,tokenize:nDe},Zke={partial:!0,tokenize:tDe};function Qke(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function eDe(t,e,n){const i=this;let r,a,s,o,l;return c;function c(V){return u(V)}function u(V){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(V),f}function f(V){return V===33?(t.consume(V),h):V===47?(t.consume(V),a=!0,b):V===63?(t.consume(V),r=3,i.interrupt?e:F):eo(V)?(t.consume(V),s=String.fromCharCode(V),y):n(V)}function h(V){return V===45?(t.consume(V),r=2,d):V===91?(t.consume(V),r=5,o=0,g):eo(V)?(t.consume(V),r=4,i.interrupt?e:F):n(V)}function d(V){return V===45?(t.consume(V),i.interrupt?e:F):n(V)}function g(V){const de="CDATA[";return V===de.charCodeAt(o++)?(t.consume(V),o===de.length?i.interrupt?e:U:g):n(V)}function b(V){return eo(V)?(t.consume(V),s=String.fromCharCode(V),y):n(V)}function y(V){if(V===null||V===47||V===62||Bi(V)){const de=V===47,se=s.toLowerCase();return!de&&!a&&MH.includes(se)?(r=1,i.interrupt?e(V):U(V)):Yke.includes(s.toLowerCase())?(r=6,de?(t.consume(V),p):i.interrupt?e(V):U(V)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(V):a?x(V):_(V))}return V===45||io(V)?(t.consume(V),s+=String.fromCharCode(V),y):n(V)}function p(V){return V===62?(t.consume(V),i.interrupt?e:U):n(V)}function x(V){return ti(V)?(t.consume(V),x):R(V)}function _(V){return V===47?(t.consume(V),R):V===58||V===95||eo(V)?(t.consume(V),w):ti(V)?(t.consume(V),_):R(V)}function w(V){return V===45||V===46||V===58||V===95||io(V)?(t.consume(V),w):M(V)}function M(V){return V===61?(t.consume(V),S):ti(V)?(t.consume(V),M):_(V)}function S(V){return V===null||V===60||V===61||V===62||V===96?n(V):V===34||V===39?(t.consume(V),l=V,A):ti(V)?(t.consume(V),S):C(V)}function A(V){return V===l?(t.consume(V),l=null,D):V===null||gn(V)?n(V):(t.consume(V),A)}function C(V){return V===null||V===34||V===39||V===47||V===60||V===61||V===62||V===96||Bi(V)?M(V):(t.consume(V),C)}function D(V){return V===47||V===62||ti(V)?_(V):n(V)}function R(V){return V===62?(t.consume(V),N):n(V)}function N(V){return V===null||gn(V)?U(V):ti(V)?(t.consume(V),N):n(V)}function U(V){return V===45&&r===2?(t.consume(V),B):V===60&&r===1?(t.consume(V),G):V===62&&r===4?(t.consume(V),Y):V===63&&r===3?(t.consume(V),F):V===93&&r===5?(t.consume(V),W):gn(V)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check($ke,Z,j)(V)):V===null||gn(V)?(t.exit("htmlFlowData"),j(V)):(t.consume(V),U)}function j(V){return t.check(Zke,z,Z)(V)}function z(V){return t.enter("lineEnding"),t.consume(V),t.exit("lineEnding"),q}function q(V){return V===null||gn(V)?j(V):(t.enter("htmlFlowData"),U(V))}function B(V){return V===45?(t.consume(V),F):U(V)}function G(V){return V===47?(t.consume(V),s="",H):U(V)}function H(V){if(V===62){const de=s.toLowerCase();return MH.includes(de)?(t.consume(V),Y):U(V)}return eo(V)&&s.length<8?(t.consume(V),s+=String.fromCharCode(V),H):U(V)}function W(V){return V===93?(t.consume(V),F):U(V)}function F(V){return V===62?(t.consume(V),Y):V===45&&r===2?(t.consume(V),F):U(V)}function Y(V){return V===null||gn(V)?(t.exit("htmlFlowData"),Z(V)):(t.consume(V),Y)}function Z(V){return t.exit("htmlFlow"),e(V)}}function tDe(t,e,n){const i=this;return r;function r(s){return gn(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),a):n(s)}function a(s){return i.parser.lazy[i.now().line]?n(s):e(s)}}function nDe(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(ey,e,n)}}const iDe={name:"htmlText",tokenize:rDe};function rDe(t,e,n){const i=this;let r,a,s;return o;function o(F){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(F),l}function l(F){return F===33?(t.consume(F),c):F===47?(t.consume(F),M):F===63?(t.consume(F),_):eo(F)?(t.consume(F),C):n(F)}function c(F){return F===45?(t.consume(F),u):F===91?(t.consume(F),a=0,g):eo(F)?(t.consume(F),x):n(F)}function u(F){return F===45?(t.consume(F),d):n(F)}function f(F){return F===null?n(F):F===45?(t.consume(F),h):gn(F)?(s=f,G(F)):(t.consume(F),f)}function h(F){return F===45?(t.consume(F),d):f(F)}function d(F){return F===62?B(F):F===45?h(F):f(F)}function g(F){const Y="CDATA[";return F===Y.charCodeAt(a++)?(t.consume(F),a===Y.length?b:g):n(F)}function b(F){return F===null?n(F):F===93?(t.consume(F),y):gn(F)?(s=b,G(F)):(t.consume(F),b)}function y(F){return F===93?(t.consume(F),p):b(F)}function p(F){return F===62?B(F):F===93?(t.consume(F),p):b(F)}function x(F){return F===null||F===62?B(F):gn(F)?(s=x,G(F)):(t.consume(F),x)}function _(F){return F===null?n(F):F===63?(t.consume(F),w):gn(F)?(s=_,G(F)):(t.consume(F),_)}function w(F){return F===62?B(F):_(F)}function M(F){return eo(F)?(t.consume(F),S):n(F)}function S(F){return F===45||io(F)?(t.consume(F),S):A(F)}function A(F){return gn(F)?(s=A,G(F)):ti(F)?(t.consume(F),A):B(F)}function C(F){return F===45||io(F)?(t.consume(F),C):F===47||F===62||Bi(F)?D(F):n(F)}function D(F){return F===47?(t.consume(F),B):F===58||F===95||eo(F)?(t.consume(F),R):gn(F)?(s=D,G(F)):ti(F)?(t.consume(F),D):B(F)}function R(F){return F===45||F===46||F===58||F===95||io(F)?(t.consume(F),R):N(F)}function N(F){return F===61?(t.consume(F),U):gn(F)?(s=N,G(F)):ti(F)?(t.consume(F),N):D(F)}function U(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(t.consume(F),r=F,j):gn(F)?(s=U,G(F)):ti(F)?(t.consume(F),U):(t.consume(F),z)}function j(F){return F===r?(t.consume(F),r=void 0,q):F===null?n(F):gn(F)?(s=j,G(F)):(t.consume(F),j)}function z(F){return F===null||F===34||F===39||F===60||F===61||F===96?n(F):F===47||F===62||Bi(F)?D(F):(t.consume(F),z)}function q(F){return F===47||F===62||Bi(F)?D(F):n(F)}function B(F){return F===62?(t.consume(F),t.exit("htmlTextData"),t.exit("htmlText"),e):n(F)}function G(F){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(F),t.exit("lineEnding"),H}function H(F){return ti(F)?Di(t,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):W(F)}function W(F){return t.enter("htmlTextData"),s(F)}}const VU={name:"labelEnd",resolveAll:lDe,resolveTo:cDe,tokenize:uDe},aDe={tokenize:fDe},sDe={tokenize:hDe},oDe={tokenize:dDe};function lDe(t){let e=-1;const n=[];for(;++e<t.length;){const i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return t.length!==n.length&&El(t,0,t.length,n),t}function cDe(t,e){let n=t.length,i=0,r,a,s,o;for(;n--;)if(r=t[n][1],a){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(a=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(s=n);const l={type:t[a][1].type==="labelLink"?"link":"image",start:{...t[a][1].start},end:{...t[t.length-1][1].end}},c={type:"label",start:{...t[a][1].start},end:{...t[s][1].end}},u={type:"labelText",start:{...t[a+i+2][1].end},end:{...t[s-2][1].start}};return o=[["enter",l,e],["enter",c,e]],o=oc(o,t.slice(a+1,a+i+3)),o=oc(o,[["enter",u,e]]),o=oc(o,CC(e.parser.constructs.insideSpan.null,t.slice(a+i+4,s-3),e)),o=oc(o,[["exit",u,e],t[s-2],t[s-1],["exit",c,e]]),o=oc(o,t.slice(s+1)),o=oc(o,[["exit",l,e]]),El(t,a,t.length,o),t}function uDe(t,e,n){const i=this;let r=i.events.length,a,s;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){a=i.events[r][1];break}return o;function o(h){return a?a._inactive?f(h):(s=i.parser.defined.includes(du(i.sliceSerialize({start:a.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelEnd"),l):n(h)}function l(h){return h===40?t.attempt(aDe,u,s?u:f)(h):h===91?t.attempt(sDe,u,s?c:f)(h):s?u(h):f(h)}function c(h){return t.attempt(oDe,u,f)(h)}function u(h){return e(h)}function f(h){return a._balanced=!0,n(h)}}function fDe(t,e,n){return i;function i(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),r}function r(f){return Bi(f)?h1(t,a)(f):a(f)}function a(f){return f===41?u(f):GQ(t,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Bi(f)?h1(t,l)(f):u(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?qQ(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Bi(f)?h1(t,u)(f):u(f)}function u(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function hDe(t,e,n){const i=this;return r;function r(o){return WQ.call(i,t,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return i.parser.defined.includes(du(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function s(o){return n(o)}}function dDe(t,e,n){return i;function i(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),r}function r(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):n(a)}}const pDe={name:"labelStartImage",resolveAll:VU.resolveAll,tokenize:mDe};function mDe(t,e,n){const i=this;return r;function r(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),a}function a(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):e(o)}}const gDe={name:"labelStartLink",resolveAll:VU.resolveAll,tokenize:bDe};function bDe(t,e,n){const i=this;return r;function r(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(s):e(s)}}const HD={name:"lineEnding",tokenize:vDe};function vDe(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Di(t,e,"linePrefix")}}const xM={name:"thematicBreak",tokenize:yDe};function yDe(t,e,n){let i=0,r;return a;function a(c){return t.enter("thematicBreak"),s(c)}function s(c){return r=c,o(c)}function o(c){return c===r?(t.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||gn(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===r?(t.consume(c),i++,l):(t.exit("thematicBreakSequence"),ti(c)?Di(t,o,"whitespace")(c):o(c))}}const No={continuation:{tokenize:wDe},exit:MDe,name:"list",tokenize:SDe},xDe={partial:!0,tokenize:TDe},_De={partial:!0,tokenize:EDe};function SDe(t,e,n){const i=this,r=i.events[i.events.length-1];let a=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return o;function o(d){const g=i.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||d===i.containerState.marker:DI(d)){if(i.containerState.type||(i.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(xM,n,c)(d):c(d);if(!i.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return DI(d)&&++s<10?(t.consume(d),l):(!i.interrupt||s<2)&&(i.containerState.marker?d===i.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),c(d)):n(d)}function c(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||d,t.check(ey,i.interrupt?n:u,t.attempt(xDe,h,f))}function u(d){return i.containerState.initialBlankLine=!0,a++,h(d)}function f(d){return ti(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return i.containerState.size=a+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function wDe(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(ey,r,a);function r(o){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Di(t,e,"listItemIndent",i.containerState.size+1)(o)}function a(o){return i.containerState.furtherBlankLines||!ti(o)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,s(o)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(_De,e,s)(o))}function s(o){return i.containerState._closeFlow=!0,i.interrupt=void 0,Di(t,t.attempt(No,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function EDe(t,e,n){const i=this;return Di(t,r,"listItemIndent",i.containerState.size+1);function r(a){const s=i.events[i.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===i.containerState.size?e(a):n(a)}}function MDe(t){t.exit(this.containerState.type)}function TDe(t,e,n){const i=this;return Di(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(a){const s=i.events[i.events.length-1];return!ti(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):n(a)}}const TH={name:"setextUnderline",resolveTo:ADe,tokenize:CDe};function ADe(t,e){let n=t.length,i,r,a;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!a&&t[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",a?(t.splice(r,0,["enter",s,e]),t.splice(a+1,0,["exit",t[i][1],e]),t[i][1].end={...t[a][1].end}):t[i][1]=s,t.push(["exit",s,e]),t}function CDe(t,e,n){const i=this;let r;return a;function a(c){let u=i.events.length,f;for(;u--;)if(i.events[u][1].type!=="lineEnding"&&i.events[u][1].type!=="linePrefix"&&i.events[u][1].type!=="content"){f=i.events[u][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||f)?(t.enter("setextHeadingLine"),r=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===r?(t.consume(c),o):(t.exit("setextHeadingLineSequence"),ti(c)?Di(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||gn(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const RDe={tokenize:ODe,partial:!0},AH="https://github.com/micromark/micromark-extension-mdxjs-esm",kDe=new Set(["ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ImportDeclaration"]);function DDe(t){const e={tokenize:r,concrete:!0};if(!t||!t.acorn||!t.acorn.parse)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");const n=t.acorn,i=Object.assign({ecmaVersion:2024,sourceType:"module"},t.acornOptions,{locations:!0});return{flow:{101:e,105:e}};function r(a,s,o){const l=this,c=l.parser.definedModuleSpecifiers||(l.parser.definedModuleSpecifiers=[]),u=this.events.length+1;let f="";return l.interrupt?o:h;function h(x){return l.now().column>1?o(x):(a.enter("mdxjsEsm"),a.enter("mdxjsEsmData"),a.consume(x),f+=String.fromCharCode(x),d)}function d(x){return eo(x)?(a.consume(x),f+=String.fromCharCode(x),d):(f==="import"||f==="export")&&x===32?(a.consume(x),g):o(x)}function g(x){return x===null||gn(x)?(a.exit("mdxjsEsmData"),b(x)):(a.consume(x),g)}function b(x){return x===null?p(x):gn(x)?a.check(RDe,p,y)(x):(a.enter("mdxjsEsmData"),g(x))}function y(x){return a.enter("lineEnding"),a.consume(x),a.exit("lineEnding"),b}function p(x){const _=FQ(l.events.slice(u),{acorn:n,acornOptions:i,tokenTypes:["mdxjsEsmData"],prefix:c.length>0?"var "+c.join(",")+`
`:""});if(_.error){if(x!==null&&_.swallow)return y(x);const M=new tr("Could not parse import/exports with acorn",{cause:_.error,place:{line:_.error.loc.line,column:_.error.loc.column+1,offset:_.error.pos},ruleId:"acorn",source:"micromark-extension-mdxjs-esm"});throw M.url=AH+"#could-not-parse-importexports-with-acorn",M}c.length>0&&_.estree.body.shift();let w=-1;for(;++w<_.estree.body.length;){const M=_.estree.body[w];if(!kDe.has(M.type)){const S=new tr("Unexpected `"+M.type+"` in code: only import/exports are supported",{place:$f(M),ruleId:"non-esm",source:"micromark-extension-mdxjs-esm"});throw S.url=AH+"#unexpected-type-in-code-only-importexports-are-supported",S}if(M.type==="ImportDeclaration"&&!l.interrupt){let S=-1;for(;++S<M.specifiers.length;){const A=M.specifiers[S];c.push(A.local.name)}}}return Object.assign(a.exit("mdxjsEsm"),t.addResult?{estree:_.estree}:void 0),s(x)}}}function ODe(t,e,n){return i;function i(r){return t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),t.attempt(ey,e,n)}}const CH={}.hasOwnProperty;function GU(t){const e={};let n=-1;for(;++n<t.length;)IDe(e,t[n]);return e}function IDe(t,e){let n;for(n in e){const r=(CH.call(t,n)?t[n]:void 0)||(t[n]={}),a=e[n];let s;if(a)for(s in a){CH.call(r,s)||(r[s]=[]);const o=a[s];NDe(r[s],Array.isArray(o)?o:o?[o]:[])}}}function NDe(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);El(t,0,0,i)}function LDe(t){const e=Object.assign({acorn:W3e.Parser.extend(mQ()),acornOptions:{ecmaVersion:2024,sourceType:"module"},addResult:!0},t);return GU([DDe(e),lke(e),hke(e),dke()])}const PDe={};function UDe(t){const e=this,n=t||PDe,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),s=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(LDe(n)),a.push(V3e()),s.push(G3e(n))}const FDe={};function WU(t,e){const n=FDe,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return XQ(t,i,r)}function XQ(t,e,n){if(BDe(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return RH(t.children,e,n)}return Array.isArray(t)?RH(t,e,n):""}function RH(t,e,n){const i=[];let r=-1;for(;++r<t.length;)i[r]=XQ(t[r],e,n);return i.join("")}function BDe(t){return!!(t&&typeof t=="object")}function KQ(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ty(t){const e=[];let n=-1,i=0,r=0;for(;++n<t.length;){const a=t.charCodeAt(n);let s="";if(a===37&&io(t.charCodeAt(n+1))&&io(t.charCodeAt(n+2)))r=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=t.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),r=1):s="�"}else s=String.fromCharCode(a);s&&(e.push(t.slice(i,n),encodeURIComponent(s)),i=n+r+1,s=""),r&&(n+=r,r=0)}return e.join("")+t.slice(i)}const zDe={tokenize:jDe};function jDe(t){const e=t.attempt(this.parser.constructs.contentInitial,i,r);let n;return e;function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Di(t,e,"linePrefix")}function r(o){return t.enter("paragraph"),a(o)}function a(o){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(o)}function s(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return gn(o)?(t.consume(o),t.exit("chunkText"),a):(t.consume(o),s)}}const HDe={tokenize:VDe},kH={tokenize:GDe};function VDe(t){const e=this,n=[];let i=0,r,a,s;return o;function o(_){if(i<n.length){const w=n[i];return e.containerState=w[1],t.attempt(w[0].continuation,l,c)(_)}return c(_)}function l(_){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&x();const w=e.events.length;let M=w,S;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){S=e.events[M][1].end;break}p(i);let A=w;for(;A<e.events.length;)e.events[A][1].end={...S},A++;return El(e.events,M+1,0,e.events.slice(w)),e.events.length=A,c(_)}return o(_)}function c(_){if(i===n.length){if(!r)return h(_);if(r.currentConstruct&&r.currentConstruct.concrete)return g(_);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(kH,u,f)(_)}function u(_){return r&&x(),p(i),h(_)}function f(_){return e.parser.lazy[e.now().line]=i!==n.length,s=e.now().offset,g(_)}function h(_){return e.containerState={},t.attempt(kH,d,g)(_)}function d(_){return i++,n.push([e.currentConstruct,e.containerState]),h(_)}function g(_){if(_===null){r&&x(),p(0),t.consume(_);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:a}),b(_)}function b(_){if(_===null){y(t.exit("chunkFlow"),!0),p(0),t.consume(_);return}return gn(_)?(t.consume(_),y(t.exit("chunkFlow")),i=0,e.interrupt=void 0,o):(t.consume(_),b)}function y(_,w){const M=e.sliceStream(_);if(w&&M.push(null),_.previous=a,a&&(a.next=_),a=_,r.defineSkip(_.start),r.write(M),e.parser.lazy[_.start.line]){let S=r.events.length;for(;S--;)if(r.events[S][1].start.offset<s&&(!r.events[S][1].end||r.events[S][1].end.offset>s))return;const A=e.events.length;let C=A,D,R;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){if(D){R=e.events[C][1].end;break}D=!0}for(p(i),S=A;S<e.events.length;)e.events[S][1].end={...R},S++;El(e.events,C+1,0,e.events.slice(A)),e.events.length=S}}function p(_){let w=n.length;for(;w-- >_;){const M=n[w];e.containerState=M[1],M[0].exit.call(e,t)}n.length=_}function x(){r.write([null]),a=void 0,r=void 0,e.containerState._closeFlow=void 0}}function GDe(t,e,n){return Di(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const WDe={tokenize:qDe};function qDe(t){const e=this,n=t.attempt(ey,i,t.attempt(this.parser.constructs.flowInitial,r,Di(t,t.attempt(this.parser.constructs.flow,r,t.attempt(Lke,r)),"linePrefix")));return n;function i(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const XDe={resolveAll:JQ()},KDe=YQ("string"),YDe=YQ("text");function YQ(t){return{resolveAll:JQ(t==="text"?JDe:void 0),tokenize:e};function e(n){const i=this,r=this.parser.constructs[t],a=n.attempt(r,s,o);return s;function s(u){return c(u)?a(u):o(u)}function o(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),a(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=r[u];let h=-1;if(f)for(;++h<f.length;){const d=f[h];if(!d.previous||d.previous.call(i,i.previous))return!0}return!1}}}function JQ(t){return e;function e(n,i){let r=-1,a;for(;++r<=n.length;)a===void 0?n[r]&&n[r][1].type==="data"&&(a=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==a+2&&(n[a][1].end=n[r-1][1].end,n.splice(a+2,r-a-2),r=a+2),a=void 0);return t?t(n,i):n}}function JDe(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const i=t[n-1][1],r=e.sliceStream(i);let a=r.length,s=-1,o=0,l;for(;a--;){const c=r[a];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(c===-2)l=!0,o++;else if(c!==-1){a++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const c={type:n===t.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:i.start._bufferIndex+s,_index:i.start._index+a,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}const $De={42:No,43:No,45:No,48:No,49:No,50:No,51:No,52:No,53:No,54:No,55:No,56:No,57:No,62:zQ},ZDe={91:zke},QDe={[-2]:jD,[-1]:jD,32:jD},e8e={35:qke,42:xM,45:[TH,xM],60:Jke,61:TH,95:xM,96:EH,126:EH},t8e={38:HQ,92:jQ},n8e={[-5]:HD,[-4]:HD,[-3]:HD,33:pDe,38:HQ,42:OI,60:[gke,iDe],91:gDe,92:[Gke,jQ],93:VU,95:OI,96:Rke},i8e={null:[OI,XDe]},r8e={null:[42,95]},a8e={null:[]},s8e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:r8e,contentInitial:ZDe,disable:a8e,document:$De,flow:e8e,flowInitial:QDe,insideSpan:i8e,string:t8e,text:n8e},Symbol.toStringTag,{value:"Module"}));function o8e(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},a=[];let s=[],o=[];const l={attempt:A(M),check:A(S),consume:x,enter:_,exit:w,interrupt:A(S,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:h,sliceStream:d,write:f};let u=e.tokenize.call(c,l);return e.resolveAll&&a.push(e),c;function f(N){return s=oc(s,N),y(),s[s.length-1]!==null?[]:(C(e,0),c.events=CC(a,c.events,c),c.events)}function h(N,U){return c8e(d(N),U)}function d(N){return l8e(s,N)}function g(){const{_bufferIndex:N,_index:U,line:j,column:z,offset:q}=i;return{_bufferIndex:N,_index:U,line:j,column:z,offset:q}}function b(N){r[N.line]=N.column,R()}function y(){let N;for(;i._index<s.length;){const U=s[i._index];if(typeof U=="string")for(N=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===N&&i._bufferIndex<U.length;)p(U.charCodeAt(i._bufferIndex));else p(U)}}function p(N){u=u(N)}function x(N){gn(N)?(i.line++,i.column=1,i.offset+=N===-3?2:1,R()):N!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===s[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=N}function _(N,U){const j=U||{};return j.type=N,j.start=g(),c.events.push(["enter",j,c]),o.push(j),j}function w(N){const U=o.pop();return U.end=g(),c.events.push(["exit",U,c]),U}function M(N,U){C(N,U.from)}function S(N,U){U.restore()}function A(N,U){return j;function j(z,q,B){let G,H,W,F;return Array.isArray(z)?Z(z):"tokenize"in z?Z([z]):Y(z);function Y(oe){return ue;function ue(_e){const ke=_e!==null&&oe[_e],Ne=_e!==null&&oe.null,Ue=[...Array.isArray(ke)?ke:ke?[ke]:[],...Array.isArray(Ne)?Ne:Ne?[Ne]:[]];return Z(Ue)(_e)}}function Z(oe){return G=oe,H=0,oe.length===0?B:V(oe[H])}function V(oe){return ue;function ue(_e){return F=D(),W=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?se():oe.tokenize.call(U?Object.assign(Object.create(c),U):c,l,de,se)(_e)}}function de(oe){return N(W,F),q}function se(oe){return F.restore(),++H<G.length?V(G[H]):B}}}function C(N,U){N.resolveAll&&!a.includes(N)&&a.push(N),N.resolve&&El(c.events,U,c.events.length-U,N.resolve(c.events.slice(U),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function D(){const N=g(),U=c.previous,j=c.currentConstruct,z=c.events.length,q=Array.from(o);return{from:z,restore:B};function B(){i=N,c.previous=U,c.currentConstruct=j,c.events.length=z,o=q,R()}}function R(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function l8e(t,e){const n=e.start._index,i=e.start._bufferIndex,r=e.end._index,a=e.end._bufferIndex;let s;if(n===r)s=[t[n].slice(i,a)];else{if(s=t.slice(n,r),i>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(i):s.shift()}a>0&&s.push(t[r].slice(0,a))}return s}function c8e(t,e){let n=-1;const i=[];let r;for(;++n<t.length;){const a=t[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
`;break}case-3:{s=`\r
`;break}case-2:{s=e?" ":"	";break}case-1:{if(!e&&r)continue;s=" ";break}default:s=String.fromCharCode(a)}r=a===-2,i.push(s)}return i.join("")}function u8e(t){const i={constructs:GU([s8e,...(t||{}).extensions||[]]),content:r(zDe),defined:[],document:r(HDe),flow:r(WDe),lazy:{},string:r(KDe),text:r(YDe)};return i;function r(a){return s;function s(o){return o8e(i,a,o)}}}function f8e(t){for(;!VQ(t););return t}const DH=/[\0\t\n\r]/g;function h8e(){let t=1,e="",n=!0,i;return r;function r(a,s,o){const l=[];let c,u,f,h,d;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,e="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(DH.lastIndex=f,c=DH.exec(a),h=c&&c.index!==void 0?c.index:a.length,d=a.charCodeAt(h),!c){e=a.slice(f);break}if(d===10&&f===h&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),f<h&&(l.push(a.slice(f,h)),t+=h-f),d){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:i=!0,t=1}f=h+1}return o&&(i&&l.push(-5),e&&l.push(e),l.push(null)),l}}const d8e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function p8e(t){return t.replace(d8e,m8e)}function m8e(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),a=r===120||r===88;return KQ(n.slice(a?2:1),a?16:10)}return Z1(n)||t}const $Q={}.hasOwnProperty;function g8e(t,e,n){return typeof e!="string"&&(n=e,e=void 0),b8e(n)(f8e(u8e(n).document().write(h8e()(t,e,!0))))}function b8e(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ae),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(Ie),blockQuote:a(Ne),characterEscape:D,characterReference:D,codeFenced:a(Ue),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(Ue,s),codeText:a(ze,s),codeTextData:D,data:D,codeFlowValue:D,definition:a(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(Fe),hardBreakEscape:a(qe),hardBreakTrailing:a(qe),htmlFlow:a(we,s),htmlFlowData:D,htmlText:a(we,s),htmlTextData:D,image:a(Te),label:s,link:a(Ae),listItem:a(He),listItemValue:h,listOrdered:a(Pe,f),listUnordered:a(Pe),paragraph:a($e),reference:V,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Ie),strong:a(ie),thematicBreak:a(ce)},exit:{atxHeading:l(),atxHeadingSequence:M,autolink:l(),autolinkEmail:ke,autolinkProtocol:_e,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:oe,characterReference:ue,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:l(p),codeText:l(q),codeTextData:R,data:R,definition:l(),definitionDestinationString:w,definitionLabelString:x,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(j),htmlFlowData:R,htmlText:l(z),htmlTextData:R,image:l(G),label:W,labelText:H,lineEnding:N,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:de,resourceDestinationString:F,resourceTitleString:Y,resource:Z,setextHeading:l(C),setextHeadingLineSequence:A,setextHeadingText:S,strong:l(),thematicBreak:l()}};ZQ(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(fe){let me={type:"root",children:[]};const $={stack:[me],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:n},Le=[];let Xe=-1;for(;++Xe<fe.length;)if(fe[Xe][1].type==="listOrdered"||fe[Xe][1].type==="listUnordered")if(fe[Xe][0]==="enter")Le.push(Xe);else{const mt=Le.pop();Xe=r(fe,mt,Xe)}for(Xe=-1;++Xe<fe.length;){const mt=e[fe[Xe][0]];$Q.call(mt,fe[Xe][1].type)&&mt[fe[Xe][1].type].call(Object.assign({sliceSerialize:fe[Xe][2].sliceSerialize},$),fe[Xe][1])}if($.tokenStack.length>0){const mt=$.tokenStack[$.tokenStack.length-1];(mt[1]||OH).call($,void 0,mt[0])}for(me.position={start:Zh(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:Zh(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<e.transforms.length;)me=e.transforms[Xe](me)||me;return me}function r(fe,me,$){let Le=me-1,Xe=-1,mt=!1,Ge,Je,tt,xt;for(;++Le<=$;){const Tt=fe[Le];switch(Tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Tt[0]==="enter"?Xe++:Xe--,xt=void 0;break}case"lineEndingBlank":{Tt[0]==="enter"&&(Ge&&!xt&&!Xe&&!tt&&(tt=Le),xt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xt=void 0}if(!Xe&&Tt[0]==="enter"&&Tt[1].type==="listItemPrefix"||Xe===-1&&Tt[0]==="exit"&&(Tt[1].type==="listUnordered"||Tt[1].type==="listOrdered")){if(Ge){let bt=Le;for(Je=void 0;bt--;){const Rt=fe[bt];if(Rt[1].type==="lineEnding"||Rt[1].type==="lineEndingBlank"){if(Rt[0]==="exit")continue;Je&&(fe[Je][1].type="lineEndingBlank",mt=!0),Rt[1].type="lineEnding",Je=bt}else if(!(Rt[1].type==="linePrefix"||Rt[1].type==="blockQuotePrefix"||Rt[1].type==="blockQuotePrefixWhitespace"||Rt[1].type==="blockQuoteMarker"||Rt[1].type==="listItemIndent"))break}tt&&(!Je||tt<Je)&&(Ge._spread=!0),Ge.end=Object.assign({},Je?fe[Je][1].start:Tt[1].end),fe.splice(Je||Le,0,["exit",Ge,Tt[2]]),Le++,$++}if(Tt[1].type==="listItemPrefix"){const bt={type:"listItem",_spread:!1,start:Object.assign({},Tt[1].start),end:void 0};Ge=bt,fe.splice(Le,0,["enter",bt,Tt[2]]),Le++,$++,tt=void 0,xt=!0}}}return fe[me][1]._spread=mt,$}function a(fe,me){return $;function $(Le){o.call(this,fe(Le),Le),me&&me.call(this,Le)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(fe,me,$){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([me,$||void 0]),fe.position={start:Zh(me.start),end:void 0}}function l(fe){return me;function me($){fe&&fe.call(this,$),c.call(this,$)}}function c(fe,me){const $=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==fe.type&&(me?me.call(this,fe,Le[0]):(Le[1]||OH).call(this,fe,Le[0]));else throw new Error("Cannot close `"+fe.type+"` ("+bc({start:fe.start,end:fe.end})+"): it’s not open");$.position.end=Zh(fe.end)}function u(){return WU(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(fe){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function d(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.lang=fe}function g(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.meta=fe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function p(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe.replace(/(\r?\n|\r)$/g,"")}function x(fe){const me=this.resume(),$=this.stack[this.stack.length-1];$.label=me,$.identifier=du(this.sliceSerialize(fe)).toLowerCase()}function _(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.title=fe}function w(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.url=fe}function M(fe){const me=this.stack[this.stack.length-1];if(!me.depth){const $=this.sliceSerialize(fe).length;me.depth=$}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function D(fe){const $=this.stack[this.stack.length-1].children;let Le=$[$.length-1];(!Le||Le.type!=="text")&&(Le=K(),Le.position={start:Zh(fe.start),end:void 0},$.push(Le)),this.stack.push(Le)}function R(fe){const me=this.stack.pop();me.value+=this.sliceSerialize(fe),me.position.end=Zh(fe.end)}function N(fe){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $=me.children[me.children.length-1];$.position.end=Zh(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(me.type)&&(D.call(this,fe),R.call(this,fe))}function U(){this.data.atHardBreak=!0}function j(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe}function z(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe}function q(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe}function B(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=me,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function G(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=me,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function H(fe){const me=this.sliceSerialize(fe),$=this.stack[this.stack.length-2];$.label=p8e(me),$.identifier=du(me).toLowerCase()}function W(){const fe=this.stack[this.stack.length-1],me=this.resume(),$=this.stack[this.stack.length-1];if(this.data.inReference=!0,$.type==="link"){const Le=fe.children;$.children=Le}else $.alt=me}function F(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.url=fe}function Y(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.title=fe}function Z(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function de(fe){const me=this.resume(),$=this.stack[this.stack.length-1];$.label=me,$.identifier=du(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function se(fe){this.data.characterReferenceType=fe.type}function oe(fe){const me=this.sliceSerialize(fe),$=this.data.characterReferenceType;let Le;$?(Le=KQ(me,$==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=Z1(me);const Xe=this.stack[this.stack.length-1];Xe.value+=Le}function ue(fe){const me=this.stack.pop();me.position.end=Zh(fe.end)}function _e(fe){R.call(this,fe);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(fe)}function ke(fe){R.call(this,fe);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(fe)}function Ne(){return{type:"blockquote",children:[]}}function Ue(){return{type:"code",lang:null,meta:null,value:""}}function ze(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Fe(){return{type:"emphasis",children:[]}}function Ie(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function we(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function Pe(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function He(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function $e(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function K(){return{type:"text",value:""}}function ce(){return{type:"thematicBreak"}}}function Zh(t){return{line:t.line,column:t.column,offset:t.offset}}function ZQ(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?ZQ(t,i):v8e(t,i)}}function v8e(t,e){let n;for(n in e)if($Q.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function OH(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+bc({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+bc({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+bc({start:e.start,end:e.end})+") is still open")}function y8e(t){const e=this;e.parser=n;function n(i){return g8e(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function x8e(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function _8e(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
`}]}function S8e(t,e){const n=e.value?e.value+`
`:"",i={};e.lang&&(i.className=["language-"+e.lang]);let r={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(r.data={meta:e.meta}),t.patch(e,r),r=t.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},t.patch(e,r),r}function w8e(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function E8e(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function M8e(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=ty(i.toLowerCase()),a=t.footnoteOrder.indexOf(i);let s,o=t.footnoteCounts.get(i);o===void 0?(o=0,t.footnoteOrder.push(i),s=t.footnoteOrder.length):s=a+1,o+=1,t.footnoteCounts.set(i,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,c),t.applyData(e,c)}function T8e(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function A8e(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function QQ(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=t.all(e),a=r[0];a&&a.type==="text"?a.value="["+a.value:r.unshift({type:"text",value:"["});const s=r[r.length-1];return s&&s.type==="text"?s.value+=i:r.push({type:"text",value:i}),r}function C8e(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return QQ(t,e);const r={src:ty(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,a),t.applyData(e,a)}function R8e(t,e){const n={src:ty(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function k8e(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function D8e(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return QQ(t,e);const r={href:ty(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const a={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,a),t.applyData(e,a)}function O8e(t,e){const n={href:ty(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function I8e(t,e,n){const i=t.all(e),r=n?N8e(n):eee(e),a={},s=[];if(typeof e.checked=="boolean"){const u=i[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},i.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<i.length;){const u=i[o];(r||o!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
`}),u.type==="element"&&u.tagName==="p"&&!r?s.push(...u.children):s.push(u)}const l=i[i.length-1];l&&(r||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:a,children:s};return t.patch(e,c),t.applyData(e,c)}function N8e(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let i=-1;for(;!e&&++i<n.length;)e=eee(n[i])}return e}function eee(t){const e=t.spread;return e??t.children.length>1}function L8e(t,e){const n={},i=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r<i.length;){const s=i[r];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function P8e(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function U8e(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function F8e(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function B8e(t,e){const n=t.all(e),i=n.shift(),r=[];if(i){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(e.children[0],s),r.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=RQ(e.children[1]),l=CQ(e.children[e.children.length-1]);o&&l&&(s.position={start:o,end:l}),r.push(s)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,a),t.applyData(e,a)}function z8e(t,e,n){const i=n?n.children:void 0,a=(i?i.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<o;){const f=e.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let g={type:"element",tagName:a,properties:h,children:[]};f&&(g.children=t.all(f),t.patch(f,g),g=t.applyData(f,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,u),t.applyData(e,u)}function j8e(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const IH=9,NH=32;function H8e(t){const e=String(t),n=/\r?\n|\r/g;let i=n.exec(e),r=0;const a=[];for(;i;)a.push(LH(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(e);return a.push(LH(e.slice(r),r>0,!1)),a.join("")}function LH(t,e,n){let i=0,r=t.length;if(e){let a=t.codePointAt(i);for(;a===IH||a===NH;)i++,a=t.codePointAt(i)}if(n){let a=t.codePointAt(r-1);for(;a===IH||a===NH;)r--,a=t.codePointAt(r-1)}return r>i?t.slice(i,r):""}function V8e(t,e){const n={type:"text",value:H8e(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function G8e(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const W8e={blockquote:x8e,break:_8e,code:S8e,delete:w8e,emphasis:E8e,footnoteReference:M8e,heading:T8e,html:A8e,imageReference:C8e,image:R8e,inlineCode:k8e,linkReference:D8e,link:O8e,listItem:I8e,list:L8e,paragraph:P8e,root:U8e,strong:F8e,table:B8e,tableCell:j8e,tableRow:z8e,text:V8e,thematicBreak:G8e,toml:_E,yaml:_E,definition:_E,footnoteDefinition:_E};function _E(){}const tee=-1,RC=0,d1=1,pT=2,qU=3,XU=4,KU=5,YU=6,nee=7,iee=8,PH=typeof self=="object"?self:globalThis,q8e=(t,e)=>{const n=(r,a)=>(t.set(a,r),r),i=r=>{if(t.has(r))return t.get(r);const[a,s]=e[r];switch(a){case RC:case tee:return n(s,r);case d1:{const o=n([],r);for(const l of s)o.push(i(l));return o}case pT:{const o=n({},r);for(const[l,c]of s)o[i(l)]=i(c);return o}case qU:return n(new Date(s),r);case XU:{const{source:o,flags:l}=s;return n(new RegExp(o,l),r)}case KU:{const o=n(new Map,r);for(const[l,c]of s)o.set(i(l),i(c));return o}case YU:{const o=n(new Set,r);for(const l of s)o.add(i(l));return o}case nee:{const{name:o,message:l}=s;return n(new PH[o](l),r)}case iee:return n(BigInt(s),r);case"BigInt":return n(Object(BigInt(s)),r);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(new PH[a](s),r)};return i},UH=t=>q8e(new Map,t)(0),Cb="",{toString:X8e}={},{keys:K8e}=Object,ox=t=>{const e=typeof t;if(e!=="object"||!t)return[RC,e];const n=X8e.call(t).slice(8,-1);switch(n){case"Array":return[d1,Cb];case"Object":return[pT,Cb];case"Date":return[qU,Cb];case"RegExp":return[XU,Cb];case"Map":return[KU,Cb];case"Set":return[YU,Cb];case"DataView":return[d1,n]}return n.includes("Array")?[d1,n]:n.includes("Error")?[nee,n]:[pT,n]},SE=([t,e])=>t===RC&&(e==="function"||e==="symbol"),Y8e=(t,e,n,i)=>{const r=(s,o)=>{const l=i.push(s)-1;return n.set(o,l),l},a=s=>{if(n.has(s))return n.get(s);let[o,l]=ox(s);switch(o){case RC:{let u=s;switch(l){case"bigint":o=iee,u=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return r([tee],s)}return r([o,u],s)}case d1:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),r([l,[...h]],s)}const u=[],f=r([o,u],s);for(const h of s)u.push(a(h));return f}case pT:{if(l)switch(l){case"BigInt":return r([l,s.toString()],s);case"Boolean":case"Number":case"String":return r([l,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const u=[],f=r([o,u],s);for(const h of K8e(s))(t||!SE(ox(s[h])))&&u.push([a(h),a(s[h])]);return f}case qU:return r([o,s.toISOString()],s);case XU:{const{source:u,flags:f}=s;return r([o,{source:u,flags:f}],s)}case KU:{const u=[],f=r([o,u],s);for(const[h,d]of s)(t||!(SE(ox(h))||SE(ox(d))))&&u.push([a(h),a(d)]);return f}case YU:{const u=[],f=r([o,u],s);for(const h of s)(t||!SE(ox(h)))&&u.push(a(h));return f}}const{message:c}=s;return r([o,{name:l,message:c}],s)};return a},FH=(t,{json:e,lossy:n}={})=>{const i=[];return Y8e(!(e||n),!!e,new Map,i)(t),i},mT=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?UH(FH(t,e)):structuredClone(t):(t,e)=>UH(FH(t,e));function J8e(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function $8e(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Z8e(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||J8e,i=t.options.footnoteBackLabel||$8e,r=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<t.footnoteOrder.length;){const c=t.footnoteById.get(t.footnoteOrder[l]);if(!c)continue;const u=t.all(c),f=String(c.identifier).toUpperCase(),h=ty(f.toLowerCase());let d=0;const g=[],b=t.footnoteCounts.get(f);for(;b!==void 0&&++d<=b;){g.length>0&&g.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,d);typeof x=="string"&&(x={type:"text",value:x}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(l,d),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else u.push(...g);const p={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:t.wrap(u,!0)};t.patch(c,p),o.push(p)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...mT(s),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
`}]}}const kC=function(t){if(t==null)return nOe;if(typeof t=="function")return DC(t);if(typeof t=="object")return Array.isArray(t)?Q8e(t):eOe(t);if(typeof t=="string")return tOe(t);throw new Error("Expected function, string, or object as test")};function Q8e(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=kC(t[n]);return DC(i);function i(...r){let a=-1;for(;++a<e.length;)if(e[a].apply(this,r))return!0;return!1}}function eOe(t){const e=t;return DC(n);function n(i){const r=i;let a;for(a in t)if(r[a]!==e[a])return!1;return!0}}function tOe(t){return DC(e);function e(n){return n&&n.type===t}}function DC(t){return e;function e(n,i,r){return!!(iOe(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function nOe(){return!0}function iOe(t){return t!==null&&typeof t=="object"&&"type"in t}const ree=[],rOe=!0,II=!1,aOe="skip";function aee(t,e,n,i){let r;typeof e=="function"&&typeof n!="function"?(i=n,n=e):r=e;const a=kC(r),s=i?-1:1;o(t,void 0,[])();function o(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=ree,g,b,y;if((!e||a(l,c,u[u.length-1]||void 0))&&(d=sOe(n(l,u)),d[0]===II))return d;if("children"in l&&l.children){const p=l;if(p.children&&d[0]!==aOe)for(b=(i?p.children.length:-1)+s,y=u.concat(p);b>-1&&b<p.children.length;){const x=p.children[b];if(g=o(x,b,y)(),g[0]===II)return g;b=typeof g[1]=="number"?g[1]:b+s}}return d}}}function sOe(t){return Array.isArray(t)?t:typeof t=="number"?[rOe,t]:t==null?ree:[t]}function nS(t,e,n,i){let r,a,s;typeof e=="function"&&typeof n!="function"?(a=void 0,s=e,r=n):(a=e,s=n,r=i),aee(t,a,o,r);function o(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return s(l,f,u)}}const NI={}.hasOwnProperty,oOe={};function lOe(t,e){const n=e||oOe,i=new Map,r=new Map,a=new Map,s={...W8e,...n.handlers},o={all:c,applyData:uOe,definitionById:i,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:s,one:l,options:n,patch:cOe,wrap:hOe};return nS(t,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?i:r,h=String(u.identifier).toUpperCase();f.has(h)||f.set(h,u)}}),o;function l(u,f){const h=u.type,d=o.handlers[h];if(NI.call(o.handlers,h)&&d)return d(o,u,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in u){const{children:b,...y}=u,p=mT(y);return p.children=o.all(u),p}return mT(u)}return(o.options.unknownHandler||fOe)(o,u,f)}function c(u){const f=[];if("children"in u){const h=u.children;let d=-1;for(;++d<h.length;){const g=o.one(h[d],u);if(g){if(d&&h[d-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=BH(g.value)),!Array.isArray(g)&&g.type==="element")){const b=g.children[0];b&&b.type==="text"&&(b.value=BH(b.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function cOe(t,e){t.position&&(e.position=DQ(t))}function uOe(t,e){let n=e;if(t&&t.data){const i=t.data.hName,r=t.data.hChildren,a=t.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const s="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,mT(a)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function fOe(t,e){const n=e.data||{},i="value"in e&&!(NI.call(n,"hProperties")||NI.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function hOe(t,e){const n=[];let i=-1;for(e&&n.push({type:"text",value:`
`});++i<t.length;)i&&n.push({type:"text",value:`
`}),n.push(t[i]);return e&&t.length>0&&n.push({type:"text",value:`
`}),n}function BH(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function zH(t,e){const n=lOe(t,e),i=n.one(t,void 0),r=Z8e(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&a.children.push({type:"text",value:`
`},r),a}function dOe(t,e){return t&&"run"in t?async function(n,i){const r=zH(n,{file:i,...e});await t.run(r,i)}:function(n,i){return zH(n,{file:i,...t||e})}}function jH(t){if(t)throw t}var _M=Object.prototype.hasOwnProperty,see=Object.prototype.toString,HH=Object.defineProperty,VH=Object.getOwnPropertyDescriptor,GH=function(e){return typeof Array.isArray=="function"?Array.isArray(e):see.call(e)==="[object Array]"},WH=function(e){if(!e||see.call(e)!=="[object Object]")return!1;var n=_M.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&_M.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;var r;for(r in e);return typeof r>"u"||_M.call(e,r)},qH=function(e,n){HH&&n.name==="__proto__"?HH(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},XH=function(e,n){if(n==="__proto__")if(_M.call(e,n)){if(VH)return VH(e,n).value}else return;return e[n]},pOe=function t(){var e,n,i,r,a,s,o=arguments[0],l=1,c=arguments.length,u=!1;for(typeof o=="boolean"&&(u=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<c;++l)if(e=arguments[l],e!=null)for(n in e)i=XH(o,n),r=XH(e,n),o!==r&&(u&&r&&(WH(r)||(a=GH(r)))?(a?(a=!1,s=i&&GH(i)?i:[]):s=i&&WH(i)?i:{},qH(o,{name:n,newValue:t(u,s,r)})):typeof r<"u"&&qH(o,{name:n,newValue:r}));return o};const VD=Mc(pOe);function LI(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function mOe(){const t=[],e={run:n,use:i};return e;function n(...r){let a=-1;const s=r.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...r);function o(l,...c){const u=t[++a];let f=-1;if(l){s(l);return}for(;++f<r.length;)(c[f]===null||c[f]===void 0)&&(c[f]=r[f]);r=c,u?gOe(u,o)(...c):s(null,...c)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function gOe(t,e){let n;return i;function i(...s){const o=t.length>s.length;let l;o&&s.push(r);try{l=t.apply(this,s)}catch(c){const u=c;if(o&&n)throw u;return r(u)}o||(l&&l.then&&typeof l.then=="function"?l.then(a,r):l instanceof Error?r(l):a(l))}function r(s,...o){n||(n=!0,e(s,...o))}function a(s){r(null,s)}}const bOe=function(t){const i=this.constructor.prototype,r=i[t],a=function(){return r.apply(a,arguments)};return Object.setPrototypeOf(a,i),a},vOe={}.hasOwnProperty;class JU extends bOe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=mOe()}copy(){const e=new JU;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];e.use(...i)}return e.data(VD(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(qD("data",this.frozen),this.namespace[e]=n,this):vOe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(qD("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=wE(e),i=this.parser||this.Parser;return GD("parse",i),i(String(n),n)}process(e,n){const i=this;return this.freeze(),GD("process",this.parser||this.Parser),WD("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(a,s){const o=wE(e),l=i.parse(o);i.run(l,o,function(u,f,h){if(u||!f||!h)return c(u);const d=f,g=i.stringify(d,h);_Oe(g)?h.value=g:h.result=g,c(u,h)});function c(u,f){u||!f?s(u):a?a(f):n(void 0,f)}}}processSync(e){let n=!1,i;return this.freeze(),GD("processSync",this.parser||this.Parser),WD("processSync",this.compiler||this.Compiler),this.process(e,r),YH("processSync","process",n),i;function r(a,s){n=!0,jH(a),i=s}}run(e,n,i){KH(e),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?a(void 0,i):new Promise(a);function a(s,o){const l=wE(n);r.run(e,l,c);function c(u,f,h){const d=f||e;u?o(u):s?s(d):i(void 0,d,h)}}}runSync(e,n){let i=!1,r;return this.run(e,n,a),YH("runSync","run",i),r;function a(s,o){jH(s),r=o,i=!0}}stringify(e,n){this.freeze();const i=wE(n),r=this.compiler||this.Compiler;return WD("stringify",r),KH(e),r(e,i)}use(e,...n){const i=this.attachers,r=this.namespace;if(qD("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(r.settings=VD(!0,r.settings,c.settings))}function o(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];a(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,h=-1;for(;++f<i.length;)if(i[f][0]===c){h=f;break}if(h===-1)i.push([c,...u]);else if(u.length>0){let[d,...g]=u;const b=i[h][1];LI(b)&&LI(d)&&(d=VD(!0,b,d)),i[h]=[c,d,...g]}}}}const yOe=new JU().freeze();function GD(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function WD(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function qD(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function KH(t){if(!LI(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function YH(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function wE(t){return xOe(t)?t:new hQ(t)}function xOe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function _Oe(t){return typeof t=="string"||SOe(t)}function SOe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function sd(t,e){const n=["start","end","loc","range"];let i=-1;for(;++i<n.length;){const r=n[i];r in t&&(e[r]=t[r])}}function $U(t,e){let n=-1;const i=[],r=[];let a;for(;++n<t.length;){const s=t[n];s.type==="ImportNamespaceSpecifier"?a=s:r.push(s)}if(a){const s={type:"VariableDeclarator",id:a.local,init:e};sd(a,s),i.push(s)}return i.push({type:"VariableDeclarator",id:{type:"ObjectPattern",properties:r.map(function(s){let o=s.type==="ImportSpecifier"?s.imported:s.type==="ExportSpecifier"?s.exported:{type:"Identifier",name:"default"},l=s.local;s.type==="ExportSpecifier"&&(l=o,o=s.local),l.type;const c={type:"Property",kind:"init",shorthand:o.type==="Identifier"&&l.type==="Identifier"&&o.name===l.name,method:!1,computed:!1,key:o,value:l};return sd(s,c),c})},init:a?{type:"Identifier",name:a.local.name}:e}),i}function Od(t){let e=-1,n;for(;++e<t.length;){const i=t[e],r=typeof i=="string"&&ef(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};n=n?{type:"MemberExpression",object:n,property:r,computed:r.type==="Literal",optional:!1}:r}return n.type,n}function JH(t){let e=-1,n;for(;++e<t.length;){const i=t[e];typeof i=="string"&&ef(i,{jsx:!0});const r={type:"JSXIdentifier",name:i};n=n?{type:"JSXMemberExpression",object:n,property:r}:r}return n}function wOe(t){const{outputFormat:e}=t||{};return function(n){if(n.comments&&(n.comments=n.comments.filter(function(i){return!i.data?._mdxIsPragmaComment})),e==="function-body"){let i=0;for(;i<n.body.length;){const a=n.body[i];if("directive"in a&&a.directive)i++;else break}const r=n.body[i];r&&r.type==="ImportDeclaration"&&typeof r.source.value=="string"&&/\/jsx-(dev-)?runtime$/.test(r.source.value)&&(n.body[i]={type:"VariableDeclaration",kind:"const",declarations:$U(r.specifiers,Od(["arguments",0]))})}}}function oee(){const t=[{block:!1,defined:[]}];return{enter:e,exit:n,scopes:t};function e(a){if(a.type==="ArrowFunctionExpression"){t.push({block:!1,defined:[]});for(const s of a.params)r(s,!1)}else if(a.type==="BlockStatement"||a.type==="DoWhileStatement"||a.type==="ForInStatement"||a.type==="ForOfStatement"||a.type==="ForStatement"||a.type==="WhileStatement")t.push({block:!0,defined:[]});else if(a.type==="CatchClause")t.push({block:!0,defined:[]}),a.param&&r(a.param,!0);else if(a.type==="ClassDeclaration")i(a.id.name,!1);else if(a.type==="FunctionDeclaration"){i(a.id.name,!1),t.push({block:!1,defined:[]});for(const s of a.params)r(s,!1)}else if(a.type==="FunctionExpression"){a.id&&i(a.id.name,!1),t.push({block:!1,defined:[]});for(const s of a.params)r(s,!1)}else if(a.type==="ImportDeclaration")for(const s of a.specifiers)i(s.local.name,!1);else if(a.type==="VariableDeclaration")for(const s of a.declarations)r(s.id,a.kind!=="var")}function n(a){if(a.type==="ArrowFunctionExpression"||a.type==="FunctionDeclaration"||a.type==="FunctionExpression"){const s=t.pop();s.block}else if(a.type==="BlockStatement"||a.type==="CatchClause"||a.type==="DoWhileStatement"||a.type==="ForInStatement"||a.type==="ForOfStatement"||a.type==="ForStatement"||a.type==="WhileStatement"){const s=t.pop();s.block}}function i(a,s){let o=t.length,l;for(;o--&&(l=t[o],!(s||!l.block)););l.defined.push(a)}function r(a,s){if(a.type==="ArrayPattern")for(const o of a.elements)o&&r(o,s);else if(a.type==="AssignmentPattern")r(a.left,s);else if(a.type==="Identifier")i(a.name,s);else if(a.type==="ObjectPattern")for(const o of a.properties)o.type==="Property"?r(o.value,s):(o.type,r(o,s));else a.type,r(a.argument,s)}}function EOe(t){return t.type==="FunctionDeclaration"?{...t,type:"FunctionExpression"}:(t.type,{...t,type:"ClassExpression"})}function MOe(t){return t.type==="FunctionDeclaration"||t.type==="ClassDeclaration"||t.type==="VariableDeclaration"}function TOe(t){const e=t.baseUrl||void 0,n=typeof e=="object"?e.href:e,i=t.outputFormat||"program",r=t.pragma===void 0?"React.createElement":t.pragma,a=t.pragmaFrag===void 0?"React.Fragment":t.pragmaFrag,s=t.pragmaImportSource||"react",o=t.jsxImportSource||"react",l=t.jsxRuntime||"automatic";return function(u,f){const h=[],d=[];let g=0,b,y,p;if(l==="classic"&&a&&EE(u,"@jsxFrag",a),l==="classic"&&r&&EE(u,"@jsx",r),l==="automatic"&&o&&EE(u,"@jsxImportSource",o),EE(u,"@jsxRuntime",l),l==="classic"&&s){if(!r)throw new Error("Missing `pragma` in classic runtime with `pragmaImportSource`");M({type:"ImportDeclaration",specifiers:[{type:"ImportDefaultSpecifier",local:{type:"Identifier",name:r.split(".")[0]}}],source:{type:"Literal",value:s}})}for(p of u.body)if(p.type==="ExportDefaultDeclaration")b&&f.fail("Unexpected duplicate layout, expected a single layout (previous: "+bc($f(b))+")",{ancestors:[u,p],place:$f(p),ruleId:"duplicate-layout",source:"recma-document"}),b=p,d.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"MDXLayout"},init:MOe(p.declaration)?EOe(p.declaration):p.declaration}]});else if(p.type==="ExportNamedDeclaration"&&p.source){const S=p.source;p.specifiers=p.specifiers.filter(function(A){if(A.exported.type==="Identifier"&&A.exported.name==="default"){b&&f.fail("Unexpected duplicate layout, expected a single layout (previous: "+bc($f(b))+")",{ancestors:[u,p,A],place:$f(p),ruleId:"duplicate-layout",source:"recma-document"}),b=A;const C=[];if(A.local.type==="Identifier"&&A.local.name==="default")C.push({type:"ImportDefaultSpecifier",local:{type:"Identifier",name:"MDXLayout"}});else{const N={type:"ImportSpecifier",imported:A.local,local:{type:"Identifier",name:"MDXLayout"}};sd(A.local,N),C.push(N)}const D={type:"Literal",value:S.value};sd(S,D);const R={type:"ImportDeclaration",specifiers:C,source:D};return sd(A,R),M(R),!1}return!0}),p.specifiers.length>0&&w(p)}else p.type==="ExportNamedDeclaration"||p.type==="ExportAllDeclaration"?w(p):p.type==="ImportDeclaration"?M(p):p.type==="ExpressionStatement"&&(p.expression.type==="JSXElement"||p.expression.type==="JSXFragment")?(y=!0,d.push(...c(p.expression,i,!!b))):d.push(p);y||d.push(...c(void 0,i,!!b)),h.push(["MDXContent","default"]),i==="function-body"&&d.push({type:"ReturnStatement",argument:{type:"ObjectExpression",properties:[...Array.from({length:g}).map(function(S,A){return{type:"SpreadElement",argument:{type:"Identifier",name:"_exportAll"+(A+1)}}}),...h.map(function(S){return{type:"Property",kind:"init",method:!1,computed:!1,shorthand:typeof S=="string",key:{type:"Identifier",name:typeof S=="string"?S:S[1]},value:{type:"Identifier",name:typeof S=="string"?S:S[0]}}})]}}),u.body=d;let x=!1,_=!1;(n||i==="function-body")&&S0(u,{enter(S){if((S.type==="ExportAllDeclaration"||S.type==="ExportNamedDeclaration"||S.type==="ImportDeclaration")&&S.source){let A=S.source.value;try{new URL(A)}catch{(A.startsWith("/")||A.startsWith("./")||A.startsWith("../"))&&(A=new URL(A,n).href)}const C={type:"Literal",value:A};sd(S.source,C),S.source=C;return}if(S.type==="ImportExpression"){_=!0;const A={type:"CallExpression",callee:{type:"Identifier",name:"_resolveDynamicMdxSpecifier"},arguments:[S.source],optional:!1};S.source=A;return}if(S.type==="MemberExpression"&&"object"in S&&S.object.type==="MetaProperty"&&S.property.type==="Identifier"&&S.object.meta.name==="import"&&S.object.property.name==="meta"&&S.property.name==="url"){x=!0;const A={type:"Identifier",name:"_importMetaUrl"};sd(S,A),this.replace(A)}}}),_&&(n||(x=!0),u.body.push(AOe(n?{type:"Literal",value:n}:{type:"Identifier",name:"_importMetaUrl"}))),x&&u.body.unshift(...COe());function w(S){if(S.type==="ExportNamedDeclaration"){if(S.declaration){const A=oee();S0(S,{enter(C){A.enter(C),(C.type==="ArrowFunctionExpression"||C.type==="FunctionDeclaration"||C.type==="FunctionExpression")&&(this.skip(),A.exit(C))},leave:A.exit}),h.push(...A.scopes[0].defined)}for(p of S.specifiers)p.exported.type==="Identifier"?h.push(p.exported.name):(p.exported.value,h.push(p.exported.value))}M(S)}function M(S){let A,C;if(i==="function-body")if(S.type==="ImportDeclaration"||S.type==="ExportAllDeclaration"||S.type==="ExportNamedDeclaration"&&S.source){S.source;const D={type:"ImportExpression",source:S.source};sd(S,D),C={type:"AwaitExpression",argument:D},(S.type==="ImportDeclaration"||S.type==="ExportNamedDeclaration")&&S.specifiers.length===0?A={type:"ExpressionStatement",expression:C}:A={type:"VariableDeclaration",kind:"const",declarations:S.type==="ExportAllDeclaration"?[{type:"VariableDeclarator",id:{type:"Identifier",name:"_exportAll"+ ++g},init:C}]:$U(S.specifiers,C)}}else if(S.declaration)A=S.declaration;else{const D=[];for(const R of S.specifiers)R.exported.type==="Identifier"&&R.local.type==="Identifier"&&R.local.name!==R.exported.name&&D.push({type:"VariableDeclarator",id:R.exported,init:R.local});D.length>0&&(A={type:"VariableDeclaration",kind:"const",declarations:D})}else A=S;A&&d.push(A)}};function c(u,f,h){let g={type:"JSXElement",openingElement:{type:"JSXOpeningElement",name:{type:"JSXIdentifier",name:"MDXLayout"},attributes:[{type:"JSXSpreadAttribute",argument:{type:"Identifier",name:"props"}}],selfClosing:!1},closingElement:{type:"JSXClosingElement",name:{type:"JSXIdentifier",name:"MDXLayout"}},children:[{type:"JSXElement",openingElement:{type:"JSXOpeningElement",name:{type:"JSXIdentifier",name:"_createMdxContent"},attributes:[{type:"JSXSpreadAttribute",argument:{type:"Identifier",name:"props"}}],selfClosing:!0},closingElement:null,children:[]}]};h||(g={type:"ConditionalExpression",test:{type:"Identifier",name:"MDXLayout"},consequent:g,alternate:{type:"CallExpression",callee:{type:"Identifier",name:"_createMdxContent"},arguments:[{type:"Identifier",name:"props"}],optional:!1}});let b=u||{type:"Identifier",name:"undefined"};b.type==="JSXFragment"&&b.children.length===1&&b.children[0].type==="JSXElement"&&(b=b.children[0]);let y=!1;S0(b,{enter(x){if(x.type==="ArrowFunctionExpression"||x.type==="FunctionDeclaration"||x.type==="FunctionExpression")return this.skip();(x.type==="AwaitExpression"||x.type==="ForOfStatement"&&x.await)&&(y=!0)}});const p={type:"FunctionDeclaration",id:{type:"Identifier",name:"MDXContent"},params:[{type:"AssignmentPattern",left:{type:"Identifier",name:"props"},right:{type:"ObjectExpression",properties:[]}}],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:g}]}};return[{type:"FunctionDeclaration",async:y,id:{type:"Identifier",name:"_createMdxContent"},params:[{type:"Identifier",name:"props"}],body:{type:"BlockStatement",body:[{type:"ReturnStatement",argument:b}]}},f==="program"?{type:"ExportDefaultDeclaration",declaration:p}:p]}}function EE(t,e,n){t.comments?.unshift({type:"Block",value:e+" "+n,data:{_mdxIsPragmaComment:!0}})}function AOe(t){return{type:"FunctionDeclaration",id:{type:"Identifier",name:"_resolveDynamicMdxSpecifier"},generator:!1,async:!1,params:[{type:"Identifier",name:"d"}],body:{type:"BlockStatement",body:[{type:"IfStatement",test:{type:"BinaryExpression",left:{type:"UnaryExpression",operator:"typeof",prefix:!0,argument:{type:"Identifier",name:"d"}},operator:"!==",right:{type:"Literal",value:"string"}},consequent:{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}},alternate:null},{type:"TryStatement",block:{type:"BlockStatement",body:[{type:"ExpressionStatement",expression:{type:"NewExpression",callee:{type:"Identifier",name:"URL"},arguments:[{type:"Identifier",name:"d"}]}},{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}}]},handler:{type:"CatchClause",param:null,body:{type:"BlockStatement",body:[]}},finalizer:null},{type:"IfStatement",test:{type:"LogicalExpression",left:{type:"LogicalExpression",left:{type:"CallExpression",callee:Od(["d","startsWith"]),arguments:[{type:"Literal",value:"/"}],optional:!1},operator:"||",right:{type:"CallExpression",callee:Od(["d","startsWith"]),arguments:[{type:"Literal",value:"./"}],optional:!1}},operator:"||",right:{type:"CallExpression",callee:Od(["d","startsWith"]),arguments:[{type:"Literal",value:"../"}],optional:!1}},consequent:{type:"ReturnStatement",argument:{type:"MemberExpression",object:{type:"NewExpression",callee:{type:"Identifier",name:"URL"},arguments:[{type:"Identifier",name:"d"},t]},property:{type:"Identifier",name:"href"},computed:!1,optional:!1}},alternate:null},{type:"ReturnStatement",argument:{type:"Identifier",name:"d"}}]}}}function COe(){return[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"_importMetaUrl"},init:Od(["arguments",0,"baseUrl"])}],kind:"const"},{type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:!0,argument:{type:"Identifier",name:"_importMetaUrl"}},consequent:{type:"ThrowStatement",argument:{type:"NewExpression",callee:{type:"Identifier",name:"Error"},arguments:[{type:"Literal",value:"Unexpected missing `options.baseUrl` needed to support `export … from`, `import`, or `import.meta.url` when generating `function-body`"}]}},alternate:null}]}function $H(t){let e=-1,n;for(;++e<t.length;){const i=t[e];n=n?{type:"BinaryExpression",left:n,operator:"+",right:i}:i}return n}function ROe(t){const{development:e,outputFormat:n,providerImportSource:i}=t;return function(r,a){const s=oee(),o=[];let l=!1,c=!1;if(S0(r,{enter(u){s.enter(u),(u.type==="FunctionDeclaration"||u.type==="FunctionExpression"||u.type==="ArrowFunctionExpression")&&(o.push({components:[],idToInvalidComponentName:new Map,node:u,objects:[],references:{},tags:[]}),Rb(u,"MDXContent")&&!XD(s.scopes,"MDXLayout")&&o[0].components.push("MDXLayout"));const f=o[0];if(!(!f||!Rb(f.node,"_createMdxContent")&&!i)&&u.type==="JSXElement"){let h=u.openingElement.name;if(h.type==="JSXMemberExpression"){const d=[];for(;h.type==="JSXMemberExpression";)d.unshift(h.property.name),h=h.object;d.unshift(h.name);const g=d.join("."),b=h.name,y=XD(s.scopes,b);!Object.hasOwn(f.references,g)&&(!y||o.length===1&&o[0].node.type==="FunctionDeclaration"&&Rb(o[0].node,"_createMdxContent"))&&(f.references[g]={component:!0,node:u}),!f.objects.includes(b)&&!y&&f.objects.push(b)}else if(h.type!=="JSXNamespacedName"){if(ef(h.name)&&!/^[a-z]/.test(h.name)){const d=h.name;XD(s.scopes,d)||(d!=="MDXLayout"&&!Object.hasOwn(f.references,d)&&(f.references[d]={component:!0,node:u}),f.components.includes(d)||f.components.push(d))}else if(!(u.data&&u.data._mdxExplicitJsx)){const d=h.name;f.tags.includes(d)||f.tags.push(d);let g=["_components",d];if(ef(d)===!1){let b=f.idToInvalidComponentName.get(d);b===void 0&&(b=`_component${f.idToInvalidComponentName.size}`,f.idToInvalidComponentName.set(d,b)),g=[b]}u.openingElement.name=JH(g),u.closingElement&&(u.closingElement.name=JH(g))}}}},leave(u){s.exit(u);const f=[],h=[],d=[],g=[];if(u.type==="FunctionDeclaration"||u.type==="FunctionExpression"||u.type==="ArrowFunctionExpression"){const b=o[o.length-1];let y;for(y of b.tags.sort())f.push({type:"Property",kind:"init",key:ef(y)?{type:"Identifier",name:y}:{type:"Literal",value:y},value:{type:"Literal",value:y},method:!1,shorthand:!1,computed:!1});h.push(...b.components);for(y of b.objects)h.includes(y)||h.push(y);h.sort();const p=[];if(f.length>0||h.length>0||b.idToInvalidComponentName.size>0){if(i&&(l=!0,d.push({type:"CallExpression",callee:{type:"Identifier",name:"_provideComponents"},arguments:[],optional:!1})),(Rb(b.node,"MDXContent")||Rb(b.node,"_createMdxContent"))&&d.push(Od(["props","components"])),f.length>0||d.length>1)for(const A of d)f.push({type:"SpreadElement",argument:A});let M=f.length>0?{type:"ObjectExpression",properties:f}:{type:"LogicalExpression",operator:"||",left:d[0],right:{type:"ObjectExpression",properties:[]}},S;if(h.length>0&&(S={type:"ObjectPattern",properties:h.map(function(A){return{type:"Property",kind:"init",key:{type:"Identifier",name:A==="MDXLayout"?"wrapper":A},value:{type:"Identifier",name:A},method:!1,shorthand:A!=="MDXLayout",computed:!1}})}),b.tags.length>0&&(g.push({type:"VariableDeclarator",id:{type:"Identifier",name:"_components"},init:M}),M={type:"Identifier",name:"_components"}),Rb(b.node,"_createMdxContent"))for(const[A,C]of[...b.idToInvalidComponentName].sort(function([D],[R]){return D.localeCompare(R)}))g.push({type:"VariableDeclarator",id:{type:"Identifier",name:C},init:{type:"MemberExpression",object:{type:"Identifier",name:"_components"},property:{type:"Literal",value:A},computed:!0,optional:!1}});S&&g.push({type:"VariableDeclarator",id:S,init:M}),g.length>0&&p.push({type:"VariableDeclaration",kind:"const",declarations:g})}let x;for(x in b.references)if(Object.hasOwn(b.references,x)){const M=x.split(".");let S=0;for(;++S<M.length;){const A=M.slice(0,S).join(".");Object.hasOwn(b.references,A)||(b.references[A]={component:!1,node:b.references[x].node})}}const _=Object.keys(b.references).sort();let w=-1;for(;++w<_.length;){const M=_[w],S=b.references[M],A=bc($f(S.node)),C=[{type:"Literal",value:M},{type:"Literal",value:S.component}];c=!0,e&&A&&C.push({type:"Literal",value:A}),p.push({type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:!0,argument:Od(M.split("."))},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"_missingMdxReference"},arguments:C,optional:!1}},alternate:void 0})}p.length>0&&(u.body.type!=="BlockStatement"&&(u.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:u.body}]}),u.body.body.unshift(...p)),o.pop()}}}),l&&i&&r.body.unshift(kOe(i,n)),c){const u=[{type:"Literal",value:"Expected "},{type:"ConditionalExpression",test:{type:"Identifier",name:"component"},consequent:{type:"Literal",value:"component"},alternate:{type:"Literal",value:"object"}},{type:"Literal",value:" `"},{type:"Identifier",name:"id"},{type:"Literal",value:"` to be defined: you likely forgot to import, pass, or provide it."}],f=[{type:"Identifier",name:"id"},{type:"Identifier",name:"component"}];e&&(u.push({type:"ConditionalExpression",test:{type:"Identifier",name:"place"},consequent:$H([{type:"Literal",value:"\nIt’s referenced in your code at `"},{type:"Identifier",name:"place"},{type:"Literal",value:(a.path?"` in `"+a.path:"")+"`"}]),alternate:{type:"Literal",value:""}}),f.push({type:"Identifier",name:"place"})),r.body.push({type:"FunctionDeclaration",id:{type:"Identifier",name:"_missingMdxReference"},generator:!1,async:!1,params:f,body:{type:"BlockStatement",body:[{type:"ThrowStatement",argument:{type:"NewExpression",callee:{type:"Identifier",name:"Error"},arguments:[$H(u)]}}]}})}n==="function-body"&&r.body.unshift({type:"ExpressionStatement",expression:{type:"Literal",value:"use strict"},directive:"use strict"})}}function kOe(t,e){const n=[{type:"ImportSpecifier",imported:{type:"Identifier",name:"useMDXComponents"},local:{type:"Identifier",name:"_provideComponents"}}];return e==="function-body"?{type:"VariableDeclaration",kind:"const",declarations:$U(n,Od(["arguments",0]))}:{type:"ImportDeclaration",specifiers:n,source:{type:"Literal",value:t}}}function Rb(t,e){return!!(t&&"id"in t&&t.id&&t.id.name===e)}function XD(t,e){let n=t.length;for(;n--;)if(t[n].defined.includes(e))return!0;return!1}function DOe(){return function(t){nS(t,"raw",function(e,n,i){if(i&&typeof n=="number")return i.children.splice(n,1),n})}}const OOe=/\s+/g,IOe=/[\t\n\v\f\r ]+/g;function NOe(t,e){e?typeof e=="string"&&(e={style:e}):e={};const n=e.preserveLineEndings?LOe:POe;return String(t).replace(e.style==="html"?IOe:OOe,e.trim?UOe(n):n)}function LOe(t){const e=/\r?\n|\r/.exec(t);return e?e[0]:" "}function POe(){return" "}function UOe(t){return e;function e(n,i,r){return i===0||i+n.length===r.length?"":t(n)}}function FOe(){return function(t){nS(t,function(e,n,i){let r=-1,a=!0,s=!1;if(i&&typeof n=="number"&&e.type==="paragraph"){const o=e.children;for(;++r<o.length;){const l=o[r];if(l.type==="mdxJsxTextElement"||l.type==="mdxTextExpression")s=!0;else if(!(l.type==="text"&&NOe(l.value,{style:"html",trim:!0})==="")){a=!1;break}}if(a&&s){r=-1;const l=[];for(;++r<o.length;){const c=o[r];c.type==="mdxJsxTextElement"&&(c.type="mdxJsxFlowElement"),c.type==="mdxTextExpression"&&(c.type="mdxFlowExpression"),c.type==="text"&&/^[\t\r\n ]+$/.test(String(c.value))||l.push(c)}return i.children.splice(n,1,...l),n}}if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement"){const o=e.data||(e.data={});o._mdxExplicitJsx=!0}(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression"||e.type==="mdxjsEsm")&&e.data&&e.data.estree&&S0(e.data.estree,{enter(o){if(o.type==="JSXElement"){const l=o.data||(o.data={});l._mdxExplicitJsx=!0}}})})}}const BOe=["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"];let ZH=!1;function zOe(t){const e=t||{};e.format,(e.jsxRuntime==="classic"||e.pragma||e.pragmaFrag||e.pragmaImportSource)&&!ZH&&(ZH=!0,console.warn("Unexpected deprecated option `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource`; see <https://mdxjs.com/migrating/v3/> on how to migrate"));const n=yOe().use(y8e);e.format!=="md"&&n.use(UDe);const i=e.remarkRehypeOptions||{};return n.use(FOe).use(e.remarkPlugins||[]).use(dOe,{...i,allowDangerousHtml:!0,passThrough:[...i.passThrough||[],...BOe]}).use(e.rehypePlugins||[]),e.format==="md"&&n.use(DOe),n.use(h3e,e).use(TOe,e).use(ROe,e),e.jsx||n.use(ECe,e).use(wOe,e),n.use(ZCe).use(QCe,e).use(e.recmaPlugins||[]),n}function jOe(t,e){const{file:n,options:i}=dCe(t,e);return zOe(i).process(n)}function HOe(t){const{Fragment:e,baseUrl:n,development:i,jsx:r,jsxDEV:a,jsxs:s,useMDXComponents:o,...l}=t||{};if(!e)throw new Error("Expected `Fragment` given to `evaluate`");if(i){if(!a)throw new Error("Expected `jsxDEV` given to `evaluate`")}else{if(!r)throw new Error("Expected `jsx` given to `evaluate`");if(!s)throw new Error("Expected `jsxs` given to `evaluate`")}return{compiletime:{...l,development:i,outputFormat:"function-body",providerImportSource:o?"#":void 0},runtime:{Fragment:e,baseUrl:n,jsx:r,jsxDEV:a,jsxs:s,useMDXComponents:o}}}const VOe=Object.getPrototypeOf(lee).constructor;async function lee(t,e){return new VOe(String(t))(e)}async function GOe(t,e){const{compiletime:n,runtime:i}=HOe(e);return lee(await jOe(t,n),i)}function WOe(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qOe(t,e,n){const r=kC((n||{}).ignore||[]),a=XOe(e);let s=-1;for(;++s<a.length;)aee(t,"text",o);function o(c,u){let f=-1,h;for(;++f<u.length;){const d=u[f],g=h?h.children:void 0;if(r(d,g?g.indexOf(d):void 0,h))return;h=d}if(h)return l(c,u)}function l(c,u){const f=u[u.length-1],h=a[s][0],d=a[s][1];let g=0;const y=f.children.indexOf(c);let p=!1,x=[];h.lastIndex=0;let _=h.exec(c.value);for(;_;){const w=_.index,M={index:_.index,input:_.input,stack:[...u,c]};let S=d(..._,M);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?h.lastIndex=w+1:(g!==w&&x.push({type:"text",value:c.value.slice(g,w)}),Array.isArray(S)?x.push(...S):S&&x.push(S),g=w+_[0].length,p=!0),!h.global)break;_=h.exec(c.value)}return p?(g<c.value.length&&x.push({type:"text",value:c.value.slice(g)}),f.children.splice(y,1,...x)):x=[c],y+x.length}}function XOe(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<n.length;){const r=n[i];e.push([KOe(r[0]),YOe(r[1])])}return e}function KOe(t){return typeof t=="string"?new RegExp(WOe(t),"g"):t}function YOe(t){return typeof t=="function"?t:function(){return t}}const KD="phrasing",YD=["autolink","link","image","label"];function JOe(){return{transforms:[iIe],enter:{literalAutolink:ZOe,literalAutolinkEmail:JD,literalAutolinkHttp:JD,literalAutolinkWww:JD},exit:{literalAutolink:nIe,literalAutolinkEmail:tIe,literalAutolinkHttp:QOe,literalAutolinkWww:eIe}}}function $Oe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:KD,notInConstruct:YD},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:KD,notInConstruct:YD},{character:":",before:"[ps]",after:"\\/",inConstruct:KD,notInConstruct:YD}]}}function ZOe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function JD(t){this.config.enter.autolinkProtocol.call(this,t)}function QOe(t){this.config.exit.autolinkProtocol.call(this,t)}function eIe(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function tIe(t){this.config.exit.autolinkEmail.call(this,t)}function nIe(t){this.exit(t)}function iIe(t){qOe(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rIe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),aIe]],{ignore:["link","linkReference"]})}function rIe(t,e,n,i,r){let a="";if(!cee(r)||(/^w/i.test(e)&&(n=e+n,e="",a="http://"),!sIe(n)))return!1;const s=oIe(n+i);if(!s[0])return!1;const o={type:"link",title:null,url:a+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function aIe(t,e,n,i){return!cee(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function sIe(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function oIe(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],i=n.indexOf(")");const r=fT(t,"(");let a=fT(t,")");for(;i!==-1&&r>a;)t+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),a++;return[t,n]}function cee(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||yo(n)||AC(n))&&(!e||n!==47)}uee.peek=gIe;function lIe(){this.buffer()}function cIe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function uIe(){this.buffer()}function fIe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function hIe(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=du(this.sliceSerialize(t)).toLowerCase(),n.label=e}function dIe(t){this.exit(t)}function pIe(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=du(this.sliceSerialize(t)).toLowerCase(),n.label=e}function mIe(t){this.exit(t)}function gIe(){return"["}function uee(t,e,n,i){const r=n.createTracker(i);let a=r.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return a+=r.move(n.safe(n.associationId(t),{after:"]",before:a})),o(),s(),a+=r.move("]"),a}function bIe(){return{enter:{gfmFootnoteCallString:lIe,gfmFootnoteCall:cIe,gfmFootnoteDefinitionLabelString:uIe,gfmFootnoteDefinition:fIe},exit:{gfmFootnoteCallString:hIe,gfmFootnoteCall:dIe,gfmFootnoteDefinitionLabelString:pIe,gfmFootnoteDefinition:mIe}}}function vIe(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:uee},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,a,s){const o=a.createTracker(s);let l=o.move("[^");const c=a.enter("footnoteDefinition"),u=a.enter("label");return l+=o.move(a.safe(a.associationId(i),{before:l,after:"]"})),u(),l+=o.move("]:"),i.children&&i.children.length>0&&(o.shift(4),l+=o.move((e?`
`:" ")+a.indentLines(a.containerFlow(i,o.current()),e?fee:yIe))),c(),l}}function yIe(t,e,n){return e===0?t:fee(t,e,n)}function fee(t,e,n){return(n?"":"    ")+t}const xIe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];hee.peek=MIe;function _Ie(){return{canContainEols:["delete"],enter:{strikethrough:wIe},exit:{strikethrough:EIe}}}function SIe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xIe}],handlers:{delete:hee}}}function wIe(t){this.enter({type:"delete",children:[]},t)}function EIe(t){this.exit(t)}function hee(t,e,n,i){const r=n.createTracker(i),a=n.enter("strikethrough");let s=r.move("~~");return s+=n.containerPhrasing(t,{...r.current(),before:s,after:"~"}),s+=r.move("~~"),a(),s}function MIe(){return"~"}function TIe(t){return t.length}function AIe(t,e){const n=e||{},i=(n.align||[]).concat(),r=n.stringLength||TIe,a=[],s=[],o=[],l=[];let c=0,u=-1;for(;++u<t.length;){const b=[],y=[];let p=-1;for(t[u].length>c&&(c=t[u].length);++p<t[u].length;){const x=CIe(t[u][p]);if(n.alignDelimiters!==!1){const _=r(x);y[p]=_,(l[p]===void 0||_>l[p])&&(l[p]=_)}b.push(x)}s[u]=b,o[u]=y}let f=-1;if(typeof i=="object"&&"length"in i)for(;++f<c;)a[f]=QH(i[f]);else{const b=QH(i);for(;++f<c;)a[f]=b}f=-1;const h=[],d=[];for(;++f<c;){const b=a[f];let y="",p="";b===99?(y=":",p=":"):b===108?y=":":b===114&&(p=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-p.length);const _=y+"-".repeat(x)+p;n.alignDelimiters!==!1&&(x=y.length+x+p.length,x>l[f]&&(l[f]=x),d[f]=x),h[f]=_}s.splice(1,0,h),o.splice(1,0,d),u=-1;const g=[];for(;++u<s.length;){const b=s[u],y=o[u];f=-1;const p=[];for(;++f<c;){const x=b[f]||"";let _="",w="";if(n.alignDelimiters!==!1){const M=l[f]-(y[f]||0),S=a[f];S===114?_=" ".repeat(M):S===99?M%2?(_=" ".repeat(M/2+.5),w=" ".repeat(M/2-.5)):(_=" ".repeat(M/2),w=_):w=" ".repeat(M)}n.delimiterStart!==!1&&!f&&p.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||f)&&p.push(" "),n.alignDelimiters!==!1&&p.push(_),p.push(x),n.alignDelimiters!==!1&&p.push(w),n.padding!==!1&&p.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&p.push("|")}g.push(n.delimiterEnd===!1?p.join("").replace(/ +$/,""):p.join(""))}return g.join(`
`)}function CIe(t){return t==null?"":String(t)}function QH(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function RIe(t,e,n,i){const r=n.enter("blockquote"),a=n.createTracker(i);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(t,a.current()),kIe);return r(),s}function kIe(t,e,n){return">"+(n?"":" ")+t}function DIe(t,e){return eV(t,e.inConstruct,!0)&&!eV(t,e.notInConstruct,!1)}function eV(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let i=-1;for(;++i<e.length;)if(t.includes(e[i]))return!0;return!1}function tV(t,e,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
`&&DIe(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
`}function OIe(t,e){const n=String(t);let i=n.indexOf(e),r=i,a=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++a>s&&(s=a):a=1,r=i+e.length,i=n.indexOf(e,r);return s}function IIe(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function NIe(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function LIe(t,e,n,i){const r=NIe(n),a=t.value||"",s=r==="`"?"GraveAccent":"Tilde";if(IIe(t,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,PIe);return f(),h}const o=n.createTracker(i),l=r.repeat(Math.max(OIe(a,r)+1,3)),c=n.enter("codeFenced");let u=o.move(l);if(t.lang){const f=n.enter(`codeFencedLang${s}`);u+=o.move(n.safe(t.lang,{before:u,after:" ",encode:["`"],...o.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${s}`);u+=o.move(" "),u+=o.move(n.safe(t.meta,{before:u,after:`
`,encode:["`"],...o.current()})),f()}return u+=o.move(`
`),a&&(u+=o.move(a+`
`)),u+=o.move(l),c(),u}function PIe(t,e,n){return(n?"":"    ")+t}function ZU(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function UIe(t,e,n,i){const r=ZU(n),a=r==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("[");return c+=l.move(n.safe(n.associationId(t),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(t.url,{before:c,after:t.title?" ":`
`,...l.current()}))),o(),t.title&&(o=n.enter(`title${a}`),c+=l.move(" "+r),c+=l.move(n.safe(t.title,{before:c,after:r,...l.current()})),c+=l.move(r),o()),s(),c}function FIe(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Q1(t){return"&#x"+t.toString(16).toUpperCase()+";"}function gT(t,e,n){const i=hv(t),r=hv(e);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}dee.peek=BIe;function dee(t,e,n,i){const r=FIe(n),a=n.enter("emphasis"),s=n.createTracker(i),o=s.move(r);let l=s.move(n.containerPhrasing(t,{after:r,before:o,...s.current()}));const c=l.charCodeAt(0),u=gT(i.before.charCodeAt(i.before.length-1),c,r);u.inside&&(l=Q1(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=gT(i.after.charCodeAt(0),f,r);h.inside&&(l=l.slice(0,-1)+Q1(f));const d=s.move(r);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+d}function BIe(t,e,n){return n.options.emphasis||"*"}function zIe(t,e){let n=!1;return nS(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,II}),!!((!t.depth||t.depth<3)&&WU(t)&&(e.options.setext||n))}function jIe(t,e,n,i){const r=Math.max(Math.min(6,t.depth||1),1),a=n.createTracker(i);if(zIe(t,n)){const u=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(t,{...a.current(),before:`
`,after:`
`});return f(),u(),h+`
`+(r===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
`))+1))}const s="#".repeat(r),o=n.enter("headingAtx"),l=n.enter("phrasing");a.move(s+" ");let c=n.containerPhrasing(t,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(c)&&(c=Q1(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),o(),c}pee.peek=HIe;function pee(t){return t.value||""}function HIe(){return"<"}mee.peek=VIe;function mee(t,e,n,i){const r=ZU(n),a=r==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const l=n.createTracker(i);let c=l.move("![");return c+=l.move(n.safe(t.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(t.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(t.url,{before:c,after:t.title?" ":")",...l.current()}))),o(),t.title&&(o=n.enter(`title${a}`),c+=l.move(" "+r),c+=l.move(n.safe(t.title,{before:c,after:r,...l.current()})),c+=l.move(r),o()),c+=l.move(")"),s(),c}function VIe(){return"!"}gee.peek=GIe;function gee(t,e,n,i){const r=t.referenceType,a=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(i);let l=o.move("![");const c=n.safe(t.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...o.current()});return s(),n.stack=u,a(),r==="full"||!c||c!==f?l+=o.move(f+"]"):r==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function GIe(){return"!"}bee.peek=WIe;function bee(t,e,n){let i=t.value||"",r="`",a=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++a<n.unsafe.length;){const s=n.unsafe[a],o=n.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(i);){let c=l.index;i.charCodeAt(c)===10&&i.charCodeAt(c-1)===13&&c--,i=i.slice(0,c)+" "+i.slice(l.index+1)}}return r+i+r}function WIe(){return"`"}function vee(t,e){const n=WU(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}yee.peek=qIe;function yee(t,e,n,i){const r=ZU(n),a=r==='"'?"Quote":"Apostrophe",s=n.createTracker(i);let o,l;if(vee(t,n)){const u=n.stack;n.stack=[],o=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),o(),n.stack=u,f}o=n.enter("link"),l=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(t,{before:c,after:"](",...s.current()})),c+=s.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(t.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(l=n.enter("destinationRaw"),c+=s.move(n.safe(t.url,{before:c,after:t.title?" ":")",...s.current()}))),l(),t.title&&(l=n.enter(`title${a}`),c+=s.move(" "+r),c+=s.move(n.safe(t.title,{before:c,after:r,...s.current()})),c+=s.move(r),l()),c+=s.move(")"),o(),c}function qIe(t,e,n){return vee(t,n)?"<":"["}xee.peek=XIe;function xee(t,e,n,i){const r=t.referenceType,a=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(i);let l=o.move("[");const c=n.containerPhrasing(t,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),s();const u=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...o.current()});return s(),n.stack=u,a(),r==="full"||!c||c!==f?l+=o.move(f+"]"):r==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function XIe(){return"["}function QU(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function KIe(t){const e=QU(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function YIe(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function _ee(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function JIe(t,e,n,i){const r=n.enter("list"),a=n.bulletCurrent;let s=t.ordered?YIe(n):QU(n);const o=t.ordered?s==="."?")":".":KIe(n);let l=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const u=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),_ee(n)===s&&u){let f=-1;for(;++f<t.children.length;){const h=t.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=o),n.bulletCurrent=s;const c=n.containerFlow(t,i);return n.bulletLastUsed=s,n.bulletCurrent=a,r(),c}function $Ie(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function ZIe(t,e,n,i){const r=$Ie(n);let a=n.bulletCurrent||QU(n);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(i);o.move(a+" ".repeat(s-a.length)),o.shift(s);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(t,o.current()),u);return l(),c;function u(f,h,d){return h?(d?"":" ".repeat(s))+f:(d?a:a+" ".repeat(s-a.length))+f}}function QIe(t,e,n,i){const r=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,i);return a(),r(),s}const eNe=kC(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tNe(t,e,n,i){return(t.children.some(function(s){return eNe(s)})?n.containerPhrasing:n.containerFlow).call(n,t,i)}function nNe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}See.peek=iNe;function See(t,e,n,i){const r=nNe(n),a=n.enter("strong"),s=n.createTracker(i),o=s.move(r+r);let l=s.move(n.containerPhrasing(t,{after:r,before:o,...s.current()}));const c=l.charCodeAt(0),u=gT(i.before.charCodeAt(i.before.length-1),c,r);u.inside&&(l=Q1(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=gT(i.after.charCodeAt(0),f,r);h.inside&&(l=l.slice(0,-1)+Q1(f));const d=s.move(r+r);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+d}function iNe(t,e,n){return n.options.strong||"*"}function rNe(t,e,n,i){return n.safe(t.value,i)}function aNe(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function sNe(t,e,n){const i=(_ee(n)+(n.options.ruleSpaces?" ":"")).repeat(aNe(n));return n.options.ruleSpaces?i.slice(0,-1):i}const wee={blockquote:RIe,break:tV,code:LIe,definition:UIe,emphasis:dee,hardBreak:tV,heading:jIe,html:pee,image:mee,imageReference:gee,inlineCode:bee,link:yee,linkReference:xee,list:JIe,listItem:ZIe,paragraph:QIe,root:tNe,strong:See,text:rNe,thematicBreak:sNe};function oNe(){return{enter:{table:lNe,tableData:nV,tableHeader:nV,tableRow:uNe},exit:{codeText:fNe,table:cNe,tableData:$D,tableHeader:$D,tableRow:$D}}}function lNe(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function cNe(t){this.exit(t),this.data.inTable=void 0}function uNe(t){this.enter({type:"tableRow",children:[]},t)}function $D(t){this.exit(t)}function nV(t){this.enter({type:"tableCell",children:[]},t)}function fNe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,hNe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function hNe(t,e){return e==="|"?e:t}function dNe(t){const e=t||{},n=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:s,tableCell:l,tableRow:o}};function s(d,g,b,y){return c(u(d,b,y),d.align)}function o(d,g,b,y){const p=f(d,b,y),x=c([p]);return x.slice(0,x.indexOf(`
`))}function l(d,g,b,y){const p=b.enter("tableCell"),x=b.enter("phrasing"),_=b.containerPhrasing(d,{...y,before:a,after:a});return x(),p(),_}function c(d,g){return AIe(d,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function u(d,g,b){const y=d.children;let p=-1;const x=[],_=g.enter("table");for(;++p<y.length;)x[p]=f(y[p],g,b);return _(),x}function f(d,g,b){const y=d.children;let p=-1;const x=[],_=g.enter("tableRow");for(;++p<y.length;)x[p]=l(y[p],d,g,b);return _(),x}function h(d,g,b){let y=wee.inlineCode(d,g,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function pNe(){return{exit:{taskListCheckValueChecked:iV,taskListCheckValueUnchecked:iV,paragraph:gNe}}}function mNe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bNe}}}function iV(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function gNe(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=e.children;let a=-1,s;for(;++a<r.length;){const o=r[a];if(o.type==="paragraph"){s=o;break}}s===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function bNe(t,e,n,i){const r=t.children[0],a=typeof t.checked=="boolean"&&r&&r.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",o=n.createTracker(i);a&&o.move(s);let l=wee.listItem(t,e,n,{...i,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+s}}function vNe(){return[JOe(),bIe(),_Ie(),oNe(),pNe()]}function yNe(t){return{extensions:[$Oe(),vIe(t),SIe(),dNe(t),mNe()]}}const xNe={tokenize:TNe,partial:!0},Eee={tokenize:ANe,partial:!0},Mee={tokenize:CNe,partial:!0},Tee={tokenize:RNe,partial:!0},_Ne={tokenize:kNe,partial:!0},Aee={name:"wwwAutolink",tokenize:ENe,previous:Ree},Cee={name:"protocolAutolink",tokenize:MNe,previous:kee},Mh={name:"emailAutolink",tokenize:wNe,previous:Dee},mf={};function SNe(){return{text:mf}}let Up=48;for(;Up<123;)mf[Up]=Mh,Up++,Up===58?Up=65:Up===91&&(Up=97);mf[43]=Mh;mf[45]=Mh;mf[46]=Mh;mf[95]=Mh;mf[72]=[Mh,Cee];mf[104]=[Mh,Cee];mf[87]=[Mh,Aee];mf[119]=[Mh,Aee];function wNe(t,e,n){const i=this;let r,a;return s;function s(f){return!PI(f)||!Dee.call(i,i.previous)||e4(i.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(f))}function o(f){return PI(f)?(t.consume(f),o):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check(_Ne,u,c)(f):f===45||f===95||io(f)?(a=!0,t.consume(f),l):u(f)}function c(f){return t.consume(f),r=!0,l}function u(f){return a&&r&&eo(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function ENe(t,e,n){const i=this;return r;function r(s){return s!==87&&s!==119||!Ree.call(i,i.previous)||e4(i.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(xNe,t.attempt(Eee,t.attempt(Mee,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function MNe(t,e,n){const i=this;let r="",a=!1;return s;function s(f){return(f===72||f===104)&&kee.call(i,i.previous)&&!e4(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),r+=String.fromCodePoint(f),t.consume(f),o):n(f)}function o(f){if(eo(f)&&r.length<5)return r+=String.fromCodePoint(f),t.consume(f),o;if(f===58){const h=r.toLowerCase();if(h==="http"||h==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),a?c:(a=!0,l)):n(f)}function c(f){return f===null||hT(f)||Bi(f)||yo(f)||AC(f)?n(f):t.attempt(Eee,t.attempt(Mee,u),n)(f)}function u(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function TNe(t,e,n){let i=0;return r;function r(s){return(s===87||s===119)&&i<3?(i++,t.consume(s),r):s===46&&i===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function ANe(t,e,n){let i,r,a;return s;function s(c){return c===46||c===95?t.check(Tee,l,o)(c):c===null||Bi(c)||yo(c)||c!==45&&AC(c)?l(c):(a=!0,t.consume(c),s)}function o(c){return c===95?i=!0:(r=i,i=void 0),t.consume(c),s}function l(c){return r||i||!a?n(c):e(c)}}function CNe(t,e){let n=0,i=0;return r;function r(s){return s===40?(n++,t.consume(s),r):s===41&&i<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(Tee,e,a)(s):s===null||Bi(s)||yo(s)?e(s):(t.consume(s),r)}function a(s){return s===41&&i++,t.consume(s),r}}function RNe(t,e,n){return i;function i(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),i):o===38?(t.consume(o),a):o===93?(t.consume(o),r):o===60||o===null||Bi(o)||yo(o)?e(o):n(o)}function r(o){return o===null||o===40||o===91||Bi(o)||yo(o)?e(o):i(o)}function a(o){return eo(o)?s(o):n(o)}function s(o){return o===59?(t.consume(o),i):eo(o)?(t.consume(o),s):n(o)}}function kNe(t,e,n){return i;function i(a){return t.consume(a),r}function r(a){return io(a)?n(a):e(a)}}function Ree(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Bi(t)}function kee(t){return!eo(t)}function Dee(t){return!(t===47||PI(t))}function PI(t){return t===43||t===45||t===46||t===95||io(t)}function e4(t){let e=t.length,n=!1;for(;e--;){const i=t[e][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const DNe={tokenize:BNe,partial:!0};function ONe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:PNe,continuation:{tokenize:UNe},exit:FNe}},text:{91:{name:"gfmFootnoteCall",tokenize:LNe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:INe,resolveTo:NNe}}}}function INe(t,e,n){const i=this;let r=i.events.length;const a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;r--;){const l=i.events[r][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return n(l);const c=du(i.sliceSerialize({start:s.end,end:i.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function NNe(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[t[n+1],t[n+2],["enter",i,e],t[n+3],t[n+4],["enter",r,e],["exit",r,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(n,t.length-n+1,...o),t}function LNe(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a=0,s;return o;function o(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(f){if(a>999||f===93&&!s||f===null||f===91||Bi(f))return n(f);if(f===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return r.includes(du(i.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return Bi(f)||(s=!0),a++,t.consume(f),f===92?u:c}function u(f){return f===91||f===92||f===93?(t.consume(f),a++,c):c(f)}}function PNe(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",u):n(g)}function u(g){if(s>999||g===93&&!o||g===null||g===91||Bi(g))return n(g);if(g===93){t.exit("chunkString");const b=t.exit("gfmFootnoteDefinitionLabelString");return a=du(i.sliceSerialize(b)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return Bi(g)||(o=!0),s++,t.consume(g),g===92?f:u}function f(g){return g===91||g===92||g===93?(t.consume(g),s++,u):u(g)}function h(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),r.includes(a)||r.push(a),Di(t,d,"gfmFootnoteDefinitionWhitespace")):n(g)}function d(g){return e(g)}}function UNe(t,e,n){return t.check(ey,e,t.attempt(DNe,e,n))}function FNe(t){t.exit("gfmFootnoteDefinition")}function BNe(t,e,n){const i=this;return Di(t,r,"gfmFootnoteDefinitionIndent",5);function r(a){const s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function zNe(t){let n=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:a,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let c=l;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[l][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[l][1].end)},f={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",u,o],["enter",s[c][1],o],["exit",s[c][1],o],["enter",f,o]],d=o.parser.constructs.insideSpan.null;d&&El(h,h.length,0,CC(d,s.slice(c+1,l),o)),El(h,h.length,0,[["exit",f,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",u,o]]),El(s,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function a(s,o,l){const c=this.previous,u=this.events;let f=0;return h;function h(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(s.enter("strikethroughSequenceTemporary"),d(g))}function d(g){const b=hv(c);if(g===126)return f>1?l(g):(s.consume(g),f++,d);if(f<2&&!n)return l(g);const y=s.exit("strikethroughSequenceTemporary"),p=hv(g);return y._open=!p||p===2&&!!b,y._close=!b||b===2&&!!p,o(g)}}}class jNe{constructor(){this.map=[]}add(e,n,i){HNe(this,e,n,i)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(const a of r)e.push(a);r=i.pop()}this.map.length=0}}function HNe(t,e,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<t.map.length;){if(t.map[r][0]===e){t.map[r][1]+=n,t.map[r][2].push(...i);return}r+=1}t.map.push([e,n,i])}}function VNe(t,e){let n=!1;const i=[];for(;e<t.length;){const r=t[e];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=i.length-1;i[a]=i[a]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return i}function GNe(){return{flow:{null:{name:"table",tokenize:WNe,resolveAll:qNe}}}}function WNe(t,e,n){const i=this;let r=0,a=0,s;return o;function o(R){let N=i.events.length-1;for(;N>-1;){const z=i.events[N][1].type;if(z==="lineEnding"||z==="linePrefix")N--;else break}const U=N>-1?i.events[N][1].type:null,j=U==="tableHead"||U==="tableRow"?S:l;return j===S&&i.parser.lazy[i.now().line]?n(R):j(R)}function l(R){return t.enter("tableHead"),t.enter("tableRow"),c(R)}function c(R){return R===124||(s=!0,a+=1),u(R)}function u(R){return R===null?n(R):gn(R)?a>1?(a=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),d):n(R):ti(R)?Di(t,u,"whitespace")(R):(a+=1,s&&(s=!1,r+=1),R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),s=!0,u):(t.enter("data"),f(R)))}function f(R){return R===null||R===124||Bi(R)?(t.exit("data"),u(R)):(t.consume(R),R===92?h:f)}function h(R){return R===92||R===124?(t.consume(R),f):f(R)}function d(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(t.enter("tableDelimiterRow"),s=!1,ti(R)?Di(t,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):g(R))}function g(R){return R===45||R===58?y(R):R===124?(s=!0,t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),b):M(R)}function b(R){return ti(R)?Di(t,y,"whitespace")(R):y(R)}function y(R){return R===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),p):R===45?(a+=1,p(R)):R===null||gn(R)?w(R):M(R)}function p(R){return R===45?(t.enter("tableDelimiterFiller"),x(R)):M(R)}function x(R){return R===45?(t.consume(R),x):R===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),_):(t.exit("tableDelimiterFiller"),_(R))}function _(R){return ti(R)?Di(t,w,"whitespace")(R):w(R)}function w(R){return R===124?g(R):R===null||gn(R)?!s||r!==a?M(R):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(R)):M(R)}function M(R){return n(R)}function S(R){return t.enter("tableRow"),A(R)}function A(R){return R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),A):R===null||gn(R)?(t.exit("tableRow"),e(R)):ti(R)?Di(t,A,"whitespace")(R):(t.enter("data"),C(R))}function C(R){return R===null||R===124||Bi(R)?(t.exit("data"),A(R)):(t.consume(R),R===92?D:C)}function D(R){return R===92||R===124?(t.consume(R),C):C(R)}}function qNe(t,e){let n=-1,i=!0,r=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,c,u,f;const h=new jNe;for(;++n<t.length;){const d=t[n],g=d[1];d[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(rV(h,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(i=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,e]])),r=g.type==="tableDelimiterRow"?2:u?3:1):r&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(i=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=ME(h,e,a,r,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(i?i=!1:(a[1]!==0&&(s[0]=s[1],f=ME(h,e,a,r,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(o=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,a[1]!==0?(s[0]=s[1],f=ME(h,e,a,r,n,f)):s[1]!==0&&(f=ME(h,e,s,r,n,f)),r=0):r&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&rV(h,e,l,c,u),h.consume(e.events),n=-1;++n<e.events.length;){const d=e.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=VNe(e.events,n))}return t}function ME(t,e,n,i,r,a){const s=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},Bb(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const l=Bb(e.events,n[1]);if(a={type:s,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const c=Bb(e.events,n[2]),u=Bb(e.events,n[3]),f={type:o,start:Object.assign({},c),end:Object.assign({},u)};if(t.add(n[2],0,[["enter",f,e]]),i!==2){const h=e.events[n[2]],d=e.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,b=n[3]-n[2]-1;t.add(g,b,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return r!==void 0&&(a.end=Object.assign({},Bb(e.events,r)),t.add(r,0,[["exit",a,e]]),a=void 0),a}function rV(t,e,n,i,r){const a=[],s=Bb(e.events,n);r&&(r.end=Object.assign({},s),a.push(["exit",r,e])),i.end=Object.assign({},s),a.push(["exit",i,e]),t.add(n+1,0,a)}function Bb(t,e){const n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}const XNe={name:"tasklistCheck",tokenize:YNe};function KNe(){return{text:{91:XNe}}}function YNe(t,e,n){const i=this;return r;function r(l){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),a)}function a(l){return Bi(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):n(l)}function o(l){return gn(l)?e(l):ti(l)?t.check({tokenize:JNe},e,n)(l):n(l)}}function JNe(t,e,n){return Di(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function $Ne(t){return GU([SNe(),ONe(),zNe(t),GNe(),KNe()])}const ZNe={};function QNe(t){const e=this,n=t||ZNe,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),s=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push($Ne(n)),a.push(vNe()),s.push(yNe(n))}const eLe=function(t){return tLe(t)};function tLe(t){return nLe(e);function e(n){return n&&n.type===t}}function nLe(t){return e;function e(n,...i){return!!(n&&typeof n=="object"&&"type"in n&&t.call(this,n,...i))}}const iLe=!0,aV=!1,rLe="skip",aLe=function(t,e,n,i){const r=eLe(e),a=1;s(t,void 0,[])();function s(o,l,c){const u=o&&typeof o=="object"?o:{};if(typeof u.type=="string"){const h=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(o.type+(h?"<"+h+">":""))+")"})}return f;function f(){let h=[],d,g,b;if(r(o,l,c[c.length-1]||null)&&(h=sLe(n(o,c)),h[0]===aV))return h;if(o.children&&h[0]!==rLe)for(g=-1+a,b=c.concat(o);g>-1&&g<o.children.length;){if(d=s(o.children[g],g,b)(),d[0]===aV)return d;g=typeof d[1]=="number"?d[1]:g+a}return h}}};function sLe(t){return Array.isArray(t)?t:typeof t=="number"?[iLe,t]:[t]}const oLe=function(t,e,n,i){aLe(t,e,r);function r(a,s){const o=s[s.length-1];return n(a,o?o.children.indexOf(a):null,o)}};function lLe(t){return"children"in t?Oee(t):"value"in t?t.value:""}function cLe(t){return t.type==="text"?t.value:"children"in t?Oee(t):""}function Oee(t){let e=-1;const n=[];for(;++e<t.children.length;)n[e]=cLe(t.children[e]);return n.join("")}function t4(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Iee(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function iS(){}var e_=.7,bT=1/e_,E0="\\s*([+-]?\\d+)\\s*",t_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uLe=/^#([0-9a-f]{3,8})$/,fLe=new RegExp(`^rgb\\(${E0},${E0},${E0}\\)$`),hLe=new RegExp(`^rgb\\(${tf},${tf},${tf}\\)$`),dLe=new RegExp(`^rgba\\(${E0},${E0},${E0},${t_}\\)$`),pLe=new RegExp(`^rgba\\(${tf},${tf},${tf},${t_}\\)$`),mLe=new RegExp(`^hsl\\(${t_},${tf},${tf}\\)$`),gLe=new RegExp(`^hsla\\(${t_},${tf},${tf},${t_}\\)$`),sV={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};t4(iS,OC,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:oV,formatHex:oV,formatHex8:bLe,formatHsl:vLe,formatRgb:lV,toString:lV});function oV(){return this.rgb().formatHex()}function bLe(){return this.rgb().formatHex8()}function vLe(){return Nee(this).formatHsl()}function lV(){return this.rgb().formatRgb()}function OC(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=uLe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?cV(e):n===3?new zo(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?TE(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?TE(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=fLe.exec(t))?new zo(e[1],e[2],e[3],1):(e=hLe.exec(t))?new zo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=dLe.exec(t))?TE(e[1],e[2],e[3],e[4]):(e=pLe.exec(t))?TE(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=mLe.exec(t))?hV(e[1],e[2]/100,e[3]/100,1):(e=gLe.exec(t))?hV(e[1],e[2]/100,e[3]/100,e[4]):sV.hasOwnProperty(t)?cV(sV[t]):t==="transparent"?new zo(NaN,NaN,NaN,0):null}function cV(t){return new zo(t>>16&255,t>>8&255,t&255,1)}function TE(t,e,n,i){return i<=0&&(t=e=n=NaN),new zo(t,e,n,i)}function yLe(t){return t instanceof iS||(t=OC(t)),t?(t=t.rgb(),new zo(t.r,t.g,t.b,t.opacity)):new zo}function xLe(t,e,n,i){return arguments.length===1?yLe(t):new zo(t,e,n,i??1)}function zo(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}t4(zo,xLe,Iee(iS,{brighter(t){return t=t==null?bT:Math.pow(bT,t),new zo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?e_:Math.pow(e_,t),new zo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new zo(Dm(this.r),Dm(this.g),Dm(this.b),vT(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:uV,formatHex:uV,formatHex8:_Le,formatRgb:fV,toString:fV}));function uV(){return`#${fm(this.r)}${fm(this.g)}${fm(this.b)}`}function _Le(){return`#${fm(this.r)}${fm(this.g)}${fm(this.b)}${fm((isNaN(this.opacity)?1:this.opacity)*255)}`}function fV(){const t=vT(this.opacity);return`${t===1?"rgb(":"rgba("}${Dm(this.r)}, ${Dm(this.g)}, ${Dm(this.b)}${t===1?")":`, ${t})`}`}function vT(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Dm(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function fm(t){return t=Dm(t),(t<16?"0":"")+t.toString(16)}function hV(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new iu(t,e,n,i)}function Nee(t){if(t instanceof iu)return new iu(t.h,t.s,t.l,t.opacity);if(t instanceof iS||(t=OC(t)),!t)return new iu;if(t instanceof iu)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),s=NaN,o=a-r,l=(a+r)/2;return o?(e===a?s=(n-i)/o+(n<i)*6:n===a?s=(i-e)/o+2:s=(e-n)/o+4,o/=l<.5?a+r:2-a-r,s*=60):o=l>0&&l<1?0:s,new iu(s,o,l,t.opacity)}function SLe(t,e,n,i){return arguments.length===1?Nee(t):new iu(t,e,n,i??1)}function iu(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}t4(iu,SLe,Iee(iS,{brighter(t){return t=t==null?bT:Math.pow(bT,t),new iu(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?e_:Math.pow(e_,t),new iu(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new zo(ZD(t>=240?t-240:t+120,r,i),ZD(t,r,i),ZD(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new iu(dV(this.h),AE(this.s),AE(this.l),vT(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 t=vT(this.opacity);return`${t===1?"hsl(":"hsla("}${dV(this.h)}, ${AE(this.s)*100}%, ${AE(this.l)*100}%${t===1?")":`, ${t})`}`}}));function dV(t){return t=(t||0)%360,t<0?t+360:t}function AE(t){return Math.max(0,Math.min(1,t||0))}function ZD(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function wLe(t){return t===void 0&&(t={customClassName:"gfm-color-chip"}),function(e){oLe(e,"element",function(n){if(n.tagName==="code"&&n.properties){var i=lLe(n),r=OC(i);r&&n.children.push({type:"element",tagName:"span",properties:{className:[t.customClassName],style:"background-color: "+r.formatHex()+";"},children:[]})}})}}function ELe(){return t=>{nS(t,"element",(e,n,i)=>{e.tagName==="code"&&i&&i.type==="element"&&i.tagName==="pre"&&(e.properties={block:!0,...e.properties})})}}function MLe(t){return k.jsx(hu,{...t})}function TLe(t){return k.jsx(Em,{...t})}function kb(t,e){return k.jsx(IA,{order:e,...t})}function pV(t,e,n){return t.className=="contains-task-list"?k.jsx(q0,{type:n,...t,listStyleType:"none",children:e}):k.jsx(q0,{type:n,...t,children:e})}function ALe(t,e){return k.jsx(q0.Item,{...t,children:e})}function CLe(t,e){return k.jsx(oP,{...t,children:e})}function RLe(t){return k.jsx(iP,{...t})}function kLe(t){return k.jsx("cite",{style:{display:"block",fontSize:"0.875rem",marginTop:"0.625rem",color:"#909296",overflow:"hidden",textOverflow:"ellipsis"},...t})}function DLe(t){return k.jsx(kc,{...t,highlightOnHover:!0,withColumnBorders:!0})}function OLe(t){return k.jsx(D_,{maw:240,mx:"auto",radius:"md",...t})}const ILe={p:t=>MLe(t),a:t=>TLe(t),h1:t=>kb(t,1),h2:t=>kb(t,2),h3:t=>kb(t,3),h4:t=>kb(t,4),h5:t=>kb(t,5),h6:t=>kb(t,6),ul:t=>pV(t,t.children??"","unordered"),ol:t=>pV(t,t.children??"","ordered"),li:t=>ALe(t,t.children??""),code:t=>CLe(t,t.children??""),pre:t=>k.jsx(k.Fragment,{children:t.children}),blockquote:t=>RLe(t),Cite:t=>kLe(t),table:t=>DLe(t),img:t=>OLe(t),"*":()=>k.jsx(k.Fragment,{})};async function NLe(t){const{default:e}=await GOe(t,{...Sre,...QAe,development:!1,remarkPlugins:[QNe],rehypePlugins:[ELe,wLe]});return e}function LLe(t){const[e,n]=I.useState(null);return I.useEffect(()=>{try{NLe(t.children??"").then(i=>{n(k.jsx(i,{components:ILe}))})}catch{n(k.jsx(IA,{order:2,children:"Error Parsing Markdown..."}))}},[t.children]),e}const PLe=I.createContext(null),QD={didCatch:!1,error:null};class ULe extends I.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=QD}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,i,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];(n=(i=this.props).onReset)===null||n===void 0||n.call(i,{args:a,reason:"imperative-api"}),this.setState(QD)}}componentDidCatch(e,n){var i,r;(i=(r=this.props).onError)===null||i===void 0||i.call(r,e,n)}componentDidUpdate(e,n){const{didCatch:i}=this.state,{resetKeys:r}=this.props;if(i&&n.error!==null&&FLe(e.resetKeys,r)){var a,s;(a=(s=this.props).onReset)===null||a===void 0||a.call(s,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(QD)}}render(){const{children:e,fallbackRender:n,FallbackComponent:i,fallback:r}=this.props,{didCatch:a,error:s}=this.state;let o=e;if(a){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")o=n(l);else if(i)o=I.createElement(i,l);else if(r!==void 0)o=r;else throw s}return I.createElement(PLe.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},o)}}function FLe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,i)=>!Object.is(n,e[i]))}function BLe({props:{visible:t,_markdown:e}}){return t?k.jsx(ut,{pb:"xs",px:"sm",style:{maxWidth:"95%"},children:k.jsx(ULe,{fallback:k.jsx(hu,{style:{textAlign:"center"},children:"Markdown Failed to Render"}),children:k.jsx(LLe,{children:e})})}):null}var n4="_3o7djo0",zLe="_3o7djo1",jLe="_3o7djo2";const mV=Ee.memo(function({jsonStr:e,aspectRatio:n,onExpand:i}){const[r,a]=Ee.useState(!1);if(e==="")return k.jsx("div",{});const s=JSON.parse(e);s.layout.uirevision="true";const{ref:o,width:l}=sX();s.layout.width=l,s.layout.height=l*n;const c=Ee.useRef(null);return Ee.useEffect(()=>{Plotly.react(c.current,s.data,s.layout,s.config)},[s]),k.jsxs(Ns,{ref:o,className:n4,withBorder:!0,style:{position:"relative"},onMouseEnter:i?()=>a(!0):void 0,onMouseLeave:i?()=>a(!1):void 0,children:[k.jsx("div",{ref:c}),i&&r&&k.jsx(Or,{label:"Expand plot",children:k.jsx(Dl,{onClick:i,variant:"subtle",color:"gray",size:"sm",style:{position:"absolute",bottom:8,right:8,backgroundColor:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(4px)",zIndex:1001},children:k.jsx(cQ,{size:14})})})]})});function HLe({props:{visible:t,_plotly_json_str:e,aspect:n}}){if(!t)return null;const[i,{open:r,close:a}]=_c(!1);return k.jsxs(ut,{children:[k.jsx(mV,{jsonStr:e,aspectRatio:n,onExpand:r}),k.jsx(Co,{opened:i,onClose:a,size:"xl",children:k.jsx(mV,{jsonStr:e,aspectRatio:n})})]})}var Lee={exports:{}};const VLe=!0,ja="u-",GLe="uplot",WLe=ja+"hz",qLe=ja+"vt",XLe=ja+"title",KLe=ja+"wrap",YLe=ja+"under",JLe=ja+"over",$Le=ja+"axis",em=ja+"off",ZLe=ja+"select",QLe=ja+"cursor-x",ePe=ja+"cursor-y",tPe=ja+"cursor-pt",nPe=ja+"legend",iPe=ja+"live",rPe=ja+"inline",aPe=ja+"series",sPe=ja+"marker",gV=ja+"label",oPe=ja+"value",kx="width",Dx="height",lx="top",bV="bottom",Db="left",e8="right",i4="#000",vV=i4+"0",t8="mousemove",yV="mousedown",n8="mouseup",xV="mouseenter",_V="mouseleave",SV="dblclick",lPe="resize",cPe="scroll",wV="change",yT="dppxchange",r4="--",ny=typeof window<"u",UI=ny?document:null,M0=ny?window:null,uPe=ny?navigator:null;let Qi,CE;function FI(){let t=devicePixelRatio;Qi!=t&&(Qi=t,CE&&zI(wV,CE,FI),CE=matchMedia(`(min-resolution: ${Qi-.001}dppx) and (max-resolution: ${Qi+.001}dppx)`),Om(wV,CE,FI),M0.dispatchEvent(new CustomEvent(yT)))}function fl(t,e){if(e!=null){let n=t.classList;!n.contains(e)&&n.add(e)}}function BI(t,e){let n=t.classList;n.contains(e)&&n.remove(e)}function Ur(t,e,n){t.style[e]=n+"px"}function qc(t,e,n,i){let r=UI.createElement(t);return e!=null&&fl(r,e),n?.insertBefore(r,i),r}function Jl(t,e){return qc("div",t,e)}const EV=new WeakMap;function Pu(t,e,n,i,r){let a="translate("+e+"px,"+n+"px)",s=EV.get(t);a!=s&&(t.style.transform=a,EV.set(t,a),e<0||n<0||e>i||n>r?fl(t,em):BI(t,em))}const MV=new WeakMap;function TV(t,e,n){let i=e+n,r=MV.get(t);i!=r&&(MV.set(t,i),t.style.background=e,t.style.borderColor=n)}const AV=new WeakMap;function CV(t,e,n,i){let r=e+""+n,a=AV.get(t);r!=a&&(AV.set(t,r),t.style.height=n+"px",t.style.width=e+"px",t.style.marginLeft=i?-e/2+"px":0,t.style.marginTop=i?-n/2+"px":0)}const a4={passive:!0},fPe={...a4,capture:!0};function Om(t,e,n,i){e.addEventListener(t,n,i?fPe:a4)}function zI(t,e,n,i){e.removeEventListener(t,n,a4)}ny&&FI();function Jc(t,e,n,i){let r;n=n||0,i=i||e.length-1;let a=i<=2147483647;for(;i-n>1;)r=a?n+i>>1:Ml((n+i)/2),e[r]<t?n=r:i=r;return t-e[n]<=e[i]-t?n:i}function Pee(t){return(n,i,r)=>{let a=-1,s=-1;for(let o=i;o<=r;o++)if(t(n[o])){a=o;break}for(let o=r;o>=i;o--)if(t(n[o])){s=o;break}return[a,s]}}const Uee=t=>t!=null,Fee=t=>t!=null&&t>0,IC=Pee(Uee),hPe=Pee(Fee);function dPe(t,e,n,i=0,r=!1){let a=r?hPe:IC,s=r?Fee:Uee;[e,n]=a(t,e,n);let o=t[e],l=t[e];if(e>-1)if(i==1)o=t[e],l=t[n];else if(i==-1)o=t[n],l=t[e];else for(let c=e;c<=n;c++){let u=t[c];s(u)&&(u<o?o=u:u>l&&(l=u))}return[o??_r,l??-_r]}function NC(t,e,n,i){let r=DV(t),a=DV(e);t==e&&(r==-1?(t*=n,e/=n):(t/=n,e*=n));let s=n==10?ah:Bee,o=r==1?Ml:nc,l=a==1?nc:Ml,c=o(s(La(t))),u=l(s(La(e))),f=dv(n,c),h=dv(n,u);return n==10&&(c<0&&(f=Sr(f,-c)),u<0&&(h=Sr(h,-u))),i||n==2?(t=f*r,e=h*a):(t=Vee(t,f),e=LC(e,h)),[t,e]}function s4(t,e,n,i){let r=NC(t,e,n,i);return t==0&&(r[0]=0),e==0&&(r[1]=0),r}const o4=.1,RV={mode:3,pad:o4},p1={pad:0,soft:null,mode:0},pPe={min:p1,max:p1};function xT(t,e,n,i){return PC(n)?kV(t,e,n):(p1.pad=n,p1.soft=i?0:null,p1.mode=i?3:0,kV(t,e,pPe))}function Xi(t,e){return t??e}function mPe(t,e,n){for(e=Xi(e,0),n=Xi(n,t.length-1);e<=n;){if(t[e]!=null)return!0;e++}return!1}function kV(t,e,n){let i=n.min,r=n.max,a=Xi(i.pad,0),s=Xi(r.pad,0),o=Xi(i.hard,-_r),l=Xi(r.hard,_r),c=Xi(i.soft,_r),u=Xi(r.soft,-_r),f=Xi(i.mode,0),h=Xi(r.mode,0),d=e-t,g=ah(d),b=Mo(La(t),La(e)),y=ah(b),p=La(y-g);(d<1e-24||p>10)&&(d=0,(t==0||e==0)&&(d=1e-24,f==2&&c!=_r&&(a=0),h==2&&u!=-_r&&(s=0)));let x=d||b||1e3,_=ah(x),w=dv(10,Ml(_)),M=x*(d==0?t==0?.1:1:a),S=Sr(Vee(t-M,w/10),24),A=t>=c&&(f==1||f==3&&S<=c||f==2&&S>=c)?c:_r,C=Mo(o,S<A&&t>=A?A:ru(A,S)),D=x*(d==0?e==0?.1:1:s),R=Sr(LC(e+D,w/10),24),N=e<=u&&(h==1||h==3&&R>=u||h==2&&R<=u)?u:-_r,U=ru(l,R>N&&e<=N?N:Mo(N,R));return C==U&&C==0&&(U=100),[C,U]}const gPe=new Intl.NumberFormat(ny?uPe.language:"en-US"),l4=t=>gPe.format(t),Il=Math,SM=Il.PI,La=Il.abs,Ml=Il.floor,Na=Il.round,nc=Il.ceil,ru=Il.min,Mo=Il.max,dv=Il.pow,DV=Il.sign,ah=Il.log10,Bee=Il.log2,bPe=(t,e=1)=>Il.sinh(t)*e,i8=(t,e=1)=>Il.asinh(t/e),_r=1/0;function OV(t){return(ah((t^t>>31)-(t>>31))|0)+1}function jI(t,e,n){return ru(Mo(t,e),n)}function zee(t){return typeof t=="function"}function Ii(t){return zee(t)?t:()=>t}const vPe=()=>{},jee=t=>t,Hee=(t,e)=>e,yPe=t=>null,IV=t=>!0,NV=(t,e)=>t==e,xPe=/\.\d*?(?=9{6,}|0{6,})/gm,Km=t=>{if(Wee(t)||jd.has(t))return t;const e=`${t}`,n=e.match(xPe);if(n==null)return t;let i=n[0].length-1;if(e.indexOf("e-")!=-1){let[r,a]=e.split("e");return+`${Km(r)}e${a}`}return Sr(t,i)};function Kp(t,e){return Km(Sr(Km(t/e))*e)}function LC(t,e){return Km(nc(Km(t/e))*e)}function Vee(t,e){return Km(Ml(Km(t/e))*e)}function Sr(t,e=0){if(Wee(t))return t;let n=10**e,i=t*n*(1+Number.EPSILON);return Na(i)/n}const jd=new Map;function Gee(t){return((""+t).split(".")[1]||"").length}function n_(t,e,n,i){let r=[],a=i.map(Gee);for(let s=e;s<n;s++){let o=La(s),l=Sr(dv(t,s),o);for(let c=0;c<i.length;c++){let u=t==10?+`${i[c]}e${s}`:i[c]*l,f=(s>=0?0:o)+(s>=a[c]?0:a[c]),h=t==10?u:Sr(u,f);r.push(h),jd.set(h,f)}}return r}const m1={},c4=[],pv=[null,null],od=Array.isArray,Wee=Number.isInteger,_Pe=t=>t===void 0;function LV(t){return typeof t=="string"}function PC(t){let e=!1;if(t!=null){let n=t.constructor;e=n==null||n==Object}return e}function SPe(t){return t!=null&&typeof t=="object"}const wPe=Object.getPrototypeOf(Uint8Array),qee="__proto__";function mv(t,e=PC){let n;if(od(t)){let i=t.find(r=>r!=null);if(od(i)||e(i)){n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=mv(t[r],e)}else n=t.slice()}else if(t instanceof wPe)n=t.slice();else if(e(t)){n={};for(let i in t)i!=qee&&(n[i]=mv(t[i],e))}else n=t;return n}function Ma(t){let e=arguments;for(let n=1;n<e.length;n++){let i=e[n];for(let r in i)r!=qee&&(PC(t[r])?Ma(t[r],mv(i[r])):t[r]=mv(i[r]))}return t}const EPe=0,MPe=1,TPe=2;function APe(t,e,n){for(let i=0,r,a=-1;i<e.length;i++){let s=e[i];if(s>a){for(r=s-1;r>=0&&t[r]==null;)t[r--]=null;for(r=s+1;r<n&&t[r]==null;)t[a=r++]=null}}}function CPe(t,e){if(DPe(t)){let s=t[0].slice();for(let o=1;o<t.length;o++)s.push(...t[o].slice(1));return OPe(s[0])||(s=kPe(s)),s}let n=new Set;for(let s=0;s<t.length;s++){let l=t[s][0],c=l.length;for(let u=0;u<c;u++)n.add(l[u])}let i=[Array.from(n).sort((s,o)=>s-o)],r=i[0].length,a=new Map;for(let s=0;s<r;s++)a.set(i[0][s],s);for(let s=0;s<t.length;s++){let o=t[s],l=o[0];for(let c=1;c<o.length;c++){let u=o[c],f=Array(r).fill(void 0),h=e?e[s][c]:MPe,d=[];for(let g=0;g<u.length;g++){let b=u[g],y=a.get(l[g]);b===null?h!=EPe&&(f[y]=b,h==TPe&&d.push(y)):f[y]=b}APe(f,d,r),i.push(f)}}return i}const RPe=typeof queueMicrotask>"u"?t=>Promise.resolve().then(t):queueMicrotask;function kPe(t){let e=t[0],n=e.length,i=Array(n);for(let a=0;a<i.length;a++)i[a]=a;i.sort((a,s)=>e[a]-e[s]);let r=[];for(let a=0;a<t.length;a++){let s=t[a],o=Array(n);for(let l=0;l<n;l++)o[l]=s[i[l]];r.push(o)}return r}function DPe(t){let e=t[0][0],n=e.length;for(let i=1;i<t.length;i++){let r=t[i][0];if(r.length!=n)return!1;if(r!=e){for(let a=0;a<n;a++)if(r[a]!=e[a])return!1}}return!0}function OPe(t,e=100){const n=t.length;if(n<=1)return!0;let i=0,r=n-1;for(;i<=r&&t[i]==null;)i++;for(;r>=i&&t[r]==null;)r--;if(r<=i)return!0;const a=Mo(1,Ml((r-i+1)/e));for(let s=t[i],o=i+a;o<=r;o+=a){const l=t[o];if(l!=null){if(l<=s)return!1;s=l}}return!0}const Xee=["January","February","March","April","May","June","July","August","September","October","November","December"],Kee=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Yee(t){return t.slice(0,3)}const IPe=Kee.map(Yee),NPe=Xee.map(Yee),LPe={MMMM:Xee,MMM:NPe,WWWW:Kee,WWW:IPe};function cx(t){return(t<10?"0":"")+t}function PPe(t){return(t<10?"00":t<100?"0":"")+t}const UPe={YYYY:t=>t.getFullYear(),YY:t=>(t.getFullYear()+"").slice(2),MMMM:(t,e)=>e.MMMM[t.getMonth()],MMM:(t,e)=>e.MMM[t.getMonth()],MM:t=>cx(t.getMonth()+1),M:t=>t.getMonth()+1,DD:t=>cx(t.getDate()),D:t=>t.getDate(),WWWW:(t,e)=>e.WWWW[t.getDay()],WWW:(t,e)=>e.WWW[t.getDay()],HH:t=>cx(t.getHours()),H:t=>t.getHours(),h:t=>{let e=t.getHours();return e==0?12:e>12?e-12:e},AA:t=>t.getHours()>=12?"PM":"AM",aa:t=>t.getHours()>=12?"pm":"am",a:t=>t.getHours()>=12?"p":"a",mm:t=>cx(t.getMinutes()),m:t=>t.getMinutes(),ss:t=>cx(t.getSeconds()),s:t=>t.getSeconds(),fff:t=>PPe(t.getMilliseconds())};function u4(t,e){e=e||LPe;let n=[],i=/\{([a-z]+)\}|[^{]+/gi,r;for(;r=i.exec(t);)n.push(r[0][0]=="{"?UPe[r[1]]:r[0]);return a=>{let s="";for(let o=0;o<n.length;o++)s+=typeof n[o]=="string"?n[o]:n[o](a,e);return s}}const FPe=new Intl.DateTimeFormat().resolvedOptions().timeZone;function BPe(t,e){let n;return e=="UTC"||e=="Etc/UTC"?n=new Date(+t+t.getTimezoneOffset()*6e4):e==FPe?n=t:(n=new Date(t.toLocaleString("en-US",{timeZone:e})),n.setMilliseconds(t.getMilliseconds())),n}const Jee=t=>t%1==0,_T=[1,2,2.5,5],zPe=n_(10,-32,0,_T),$ee=n_(10,0,32,_T),jPe=$ee.filter(Jee),Yp=zPe.concat($ee),f4=`
`,Zee="{YYYY}",PV=f4+Zee,Qee="{M}/{D}",Ox=f4+Qee,RE=Ox+"/{YY}",ete="{aa}",HPe="{h}:{mm}",zb=HPe+ete,UV=f4+zb,FV=":{ss}",sr=null;function tte(t){let e=t*1e3,n=e*60,i=n*60,r=i*24,a=r*30,s=r*365,l=(t==1?n_(10,0,3,_T).filter(Jee):n_(10,-3,0,_T)).concat([e,e*5,e*10,e*15,e*30,n,n*5,n*10,n*15,n*30,i,i*2,i*3,i*4,i*6,i*8,i*12,r,r*2,r*3,r*4,r*5,r*6,r*7,r*8,r*9,r*10,r*15,a,a*2,a*3,a*4,a*6,s,s*2,s*5,s*10,s*25,s*50,s*100]);const c=[[s,Zee,sr,sr,sr,sr,sr,sr,1],[r*28,"{MMM}",PV,sr,sr,sr,sr,sr,1],[r,Qee,PV,sr,sr,sr,sr,sr,1],[i,"{h}"+ete,RE,sr,Ox,sr,sr,sr,1],[n,zb,RE,sr,Ox,sr,sr,sr,1],[e,FV,RE+" "+zb,sr,Ox+" "+zb,sr,UV,sr,1],[t,FV+".{fff}",RE+" "+zb,sr,Ox+" "+zb,sr,UV,sr,1]];function u(f){return(h,d,g,b,y,p)=>{let x=[],_=y>=s,w=y>=a&&y<s,M=f(g),S=Sr(M*t,3),A=r8(M.getFullYear(),_?0:M.getMonth(),w||_?1:M.getDate()),C=Sr(A*t,3);if(w||_){let D=w?y/a:0,R=_?y/s:0,N=S==C?S:Sr(r8(A.getFullYear()+R,A.getMonth()+D,1)*t,3),U=new Date(Na(N/t)),j=U.getFullYear(),z=U.getMonth();for(let q=0;N<=b;q++){let B=r8(j+R*q,z+D*q,1),G=B-f(Sr(B*t,3));N=Sr((+B+G)*t,3),N<=b&&x.push(N)}}else{let D=y>=r?r:y,R=Ml(g)-Ml(S),N=C+R+LC(S-C,D);x.push(N);let U=f(N),j=U.getHours()+U.getMinutes()/n+U.getSeconds()/i,z=y/i,q=h.axes[d]._space,B=p/q;for(;N=Sr(N+y,t==1?0:3),!(N>b);)if(z>1){let G=Ml(Sr(j+z,6))%24,F=f(N).getHours()-G;F>1&&(F=-1),N-=F*i,j=(j+z)%24;let Y=x[x.length-1];Sr((N-Y)/y,3)*B>=.7&&x.push(N)}else x.push(N)}return x}}return[l,c,u]}const[VPe,GPe,WPe]=tte(1),[qPe,XPe,KPe]=tte(.001);n_(2,-53,53,[1]);function BV(t,e){return t.map(n=>n.map((i,r)=>r==0||r==8||i==null?i:e(r==1||n[8]==0?i:n[1]+i)))}function zV(t,e){return(n,i,r,a,s)=>{let o=e.find(g=>s>=g[0])||e[e.length-1],l,c,u,f,h,d;return i.map(g=>{let b=t(g),y=b.getFullYear(),p=b.getMonth(),x=b.getDate(),_=b.getHours(),w=b.getMinutes(),M=b.getSeconds(),S=y!=l&&o[2]||p!=c&&o[3]||x!=u&&o[4]||_!=f&&o[5]||w!=h&&o[6]||M!=d&&o[7]||o[1];return l=y,c=p,u=x,f=_,h=w,d=M,S(b)})}}function YPe(t,e){let n=u4(e);return(i,r,a,s,o)=>r.map(l=>n(t(l)))}function r8(t,e,n){return new Date(t,e,n)}function jV(t,e){return e(t)}const JPe="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function HV(t,e){return(n,i,r,a)=>a==null?r4:e(t(i))}function $Pe(t,e){let n=t.series[e];return n.width?n.stroke(t,e):n.points.width?n.points.stroke(t,e):null}function ZPe(t,e){return t.series[e].fill(t,e)}const QPe={show:!0,live:!0,isolate:!1,mount:vPe,markers:{show:!0,width:2,stroke:$Pe,fill:ZPe,dash:"solid"},idx:null,idxs:null,values:[]};function eUe(t,e){let n=t.cursor.points,i=Jl(),r=n.size(t,e);Ur(i,kx,r),Ur(i,Dx,r);let a=r/-2;Ur(i,"marginLeft",a),Ur(i,"marginTop",a);let s=n.width(t,e,r);return s&&Ur(i,"borderWidth",s),i}function tUe(t,e){let n=t.series[e].points;return n._fill||n._stroke}function nUe(t,e){let n=t.series[e].points;return n._stroke||n._fill}function iUe(t,e){return t.series[e].points.size}const a8=[0,0];function rUe(t,e,n){return a8[0]=e,a8[1]=n,a8}function kE(t,e,n,i=!0){return r=>{r.button==0&&(!i||r.target==e)&&n(r)}}function s8(t,e,n,i=!0){return r=>{(!i||r.target==e)&&n(r)}}const aUe={show:!0,x:!0,y:!0,lock:!1,move:rUe,points:{one:!1,show:eUe,size:iUe,width:0,stroke:nUe,fill:tUe},bind:{mousedown:kE,mouseup:kE,click:kE,dblclick:kE,mousemove:s8,mouseleave:s8,mouseenter:s8},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(t,e)=>{e.stopPropagation(),e.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(t,e,n,i,r)=>i-r,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},nte={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},h4=Ma({},nte,{filter:Hee}),ite=Ma({},h4,{size:10}),rte=Ma({},nte,{show:!1}),d4='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',ate="bold "+d4,ste=1.5,VV={show:!0,scale:"x",stroke:i4,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:ate,side:2,grid:h4,ticks:ite,border:rte,font:d4,lineGap:ste,rotate:0},sUe="Value",oUe="Time",GV={show:!0,scale:"x",auto:!1,sorted:1,min:_r,max:-_r,idxs:[]};function lUe(t,e,n,i,r){return e.map(a=>a==null?"":l4(a))}function cUe(t,e,n,i,r,a,s){let o=[],l=jd.get(r)||0;n=s?n:Sr(LC(n,r),l);for(let c=n;c<=i;c=Sr(c+r,l))o.push(Object.is(c,-0)?0:c);return o}function HI(t,e,n,i,r,a,s){const o=[],l=t.scales[t.axes[e].scale].log,c=l==10?ah:Bee,u=Ml(c(n));r=dv(l,u),l==10&&(r=Yp[Jc(r,Yp)]);let f=n,h=r*l;l==10&&(h=Yp[Jc(h,Yp)]);do o.push(f),f=f+r,l==10&&!jd.has(f)&&(f=Sr(f,jd.get(r))),f>=h&&(r=f,h=r*l,l==10&&(h=Yp[Jc(h,Yp)]));while(f<=i);return o}function uUe(t,e,n,i,r,a,s){let l=t.scales[t.axes[e].scale].asinh,c=i>l?HI(t,e,Mo(l,n),i,r):[l],u=i>=0&&n<=0?[0]:[];return(n<-l?HI(t,e,Mo(l,-i),-n,r):[l]).reverse().map(h=>-h).concat(u,c)}const ote=/./,fUe=/[12357]/,hUe=/[125]/,WV=/1/,VI=(t,e,n,i)=>t.map((r,a)=>e==4&&r==0||a%i==0&&n.test(r.toExponential()[r<0?1:0])?r:null);function dUe(t,e,n,i,r){let a=t.axes[n],s=a.scale,o=t.scales[s],l=t.valToPos,c=a._space,u=l(10,s),f=l(9,s)-u>=c?ote:l(7,s)-u>=c?fUe:l(5,s)-u>=c?hUe:WV;if(f==WV){let h=La(l(1,s)-u);if(h<c)return VI(e.slice().reverse(),o.distr,f,nc(c/h)).reverse()}return VI(e,o.distr,f,1)}function pUe(t,e,n,i,r){let a=t.axes[n],s=a.scale,o=a._space,l=t.valToPos,c=La(l(1,s)-l(2,s));return c<o?VI(e.slice().reverse(),3,ote,nc(o/c)).reverse():e}function mUe(t,e,n,i){return i==null?r4:e==null?"":l4(e)}const qV={show:!0,scale:"y",stroke:i4,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:ate,side:3,grid:h4,ticks:ite,border:rte,font:d4,lineGap:ste,rotate:0};function gUe(t,e){let n=3+(t||1)*2;return Sr(n*e,3)}function bUe(t,e){let{scale:n,idxs:i}=t.series[0],r=t._data[0],a=t.valToPos(r[i[0]],n,!0),s=t.valToPos(r[i[1]],n,!0),o=La(s-a),l=t.series[e],c=o/(l.points.space*Qi);return i[1]-i[0]<=c}const XV={scale:null,auto:!0,sorted:0,min:_r,max:-_r},lte=(t,e,n,i,r)=>r,KV={show:!0,auto:!0,sorted:0,gaps:lte,alpha:1,facets:[Ma({},XV,{scale:"x"}),Ma({},XV,{scale:"y"})]},YV={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:lte,alpha:1,points:{show:bUe,filter:null},values:null,min:_r,max:-_r,idxs:[],path:null,clip:null};function vUe(t,e,n,i,r){return n/10}const cte={time:VLe,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},yUe=Ma({},cte,{time:!1,ori:1}),JV={};function ute(t,e){let n=JV[t];return n||(n={key:t,plots:[],sub(i){n.plots.push(i)},unsub(i){n.plots=n.plots.filter(r=>r!=i)},pub(i,r,a,s,o,l,c){for(let u=0;u<n.plots.length;u++)n.plots[u]!=r&&n.plots[u].pub(i,r,a,s,o,l,c)}},t!=null&&(JV[t]=n)),n}const gv=1,GI=2;function hg(t,e,n){const i=t.mode,r=t.series[e],a=i==2?t._data[e]:t._data,s=t.scales,o=t.bbox;let l=a[0],c=i==2?a[1]:a[e],u=i==2?s[r.facets[0].scale]:s[t.series[0].scale],f=i==2?s[r.facets[1].scale]:s[r.scale],h=o.left,d=o.top,g=o.width,b=o.height,y=t.valToPosH,p=t.valToPosV;return u.ori==0?n(r,l,c,u,f,y,p,h,d,g,b,FC,iy,zC,hte,pte):n(r,l,c,u,f,p,y,d,h,b,g,BC,ry,g4,dte,mte)}function p4(t,e){let n=0,i=0,r=Xi(t.bands,c4);for(let a=0;a<r.length;a++){let s=r[a];s.series[0]==e?n=s.dir:s.series[1]==e&&(s.dir==1?i|=1:i|=2)}return[n,i==1?-1:i==2?1:i==3?2:0]}function xUe(t,e,n,i,r){let a=t.mode,s=t.series[e],o=a==2?s.facets[1].scale:s.scale,l=t.scales[o];return r==-1?l.min:r==1?l.max:l.distr==3?l.dir==1?l.min:l.max:0}function sh(t,e,n,i,r,a){return hg(t,e,(s,o,l,c,u,f,h,d,g,b,y)=>{let p=s.pxRound;const x=c.dir*(c.ori==0?1:-1),_=c.ori==0?iy:ry;let w,M;x==1?(w=n,M=i):(w=i,M=n);let S=p(f(o[w],c,b,d)),A=p(h(l[w],u,y,g)),C=p(f(o[M],c,b,d)),D=p(h(a==1?u.max:u.min,u,y,g)),R=new Path2D(r);return _(R,C,D),_(R,S,D),_(R,S,A),R})}function UC(t,e,n,i,r,a){let s=null;if(t.length>0){s=new Path2D;const o=e==0?zC:g4;let l=n;for(let f=0;f<t.length;f++){let h=t[f];if(h[1]>h[0]){let d=h[0]-l;d>0&&o(s,l,i,d,i+a),l=h[1]}}let c=n+r-l,u=10;c>0&&o(s,l,i-u/2,c,i+a+u)}return s}function _Ue(t,e,n){let i=t[t.length-1];i&&i[0]==e?i[1]=n:t.push([e,n])}function m4(t,e,n,i,r,a,s){let o=[],l=t.length;for(let c=r==1?n:i;c>=n&&c<=i;c+=r)if(e[c]===null){let f=c,h=c;if(r==1)for(;++c<=i&&e[c]===null;)h=c;else for(;--c>=n&&e[c]===null;)h=c;let d=a(t[f]),g=h==f?d:a(t[h]),b=f-r;d=s<=0&&b>=0&&b<l?a(t[b]):d;let p=h+r;g=s>=0&&p>=0&&p<l?a(t[p]):g,g>=d&&o.push([d,g])}return o}function $V(t){return t==0?jee:t==1?Na:e=>Kp(e,t)}function fte(t){let e=t==0?FC:BC,n=t==0?(r,a,s,o,l,c)=>{r.arcTo(a,s,o,l,c)}:(r,a,s,o,l,c)=>{r.arcTo(s,a,l,o,c)},i=t==0?(r,a,s,o,l)=>{r.rect(a,s,o,l)}:(r,a,s,o,l)=>{r.rect(s,a,l,o)};return(r,a,s,o,l,c=0,u=0)=>{c==0&&u==0?i(r,a,s,o,l):(c=ru(c,o/2,l/2),u=ru(u,o/2,l/2),e(r,a+c,s),n(r,a+o,s,a+o,s+l,c),n(r,a+o,s+l,a,s+l,u),n(r,a,s+l,a,s,u),n(r,a,s,a+o,s,c),r.closePath())}}const FC=(t,e,n)=>{t.moveTo(e,n)},BC=(t,e,n)=>{t.moveTo(n,e)},iy=(t,e,n)=>{t.lineTo(e,n)},ry=(t,e,n)=>{t.lineTo(n,e)},zC=fte(0),g4=fte(1),hte=(t,e,n,i,r,a)=>{t.arc(e,n,i,r,a)},dte=(t,e,n,i,r,a)=>{t.arc(n,e,i,r,a)},pte=(t,e,n,i,r,a,s)=>{t.bezierCurveTo(e,n,i,r,a,s)},mte=(t,e,n,i,r,a,s)=>{t.bezierCurveTo(n,e,r,i,s,a)};function gte(t){return(e,n,i,r,a)=>hg(e,n,(s,o,l,c,u,f,h,d,g,b,y)=>{let{pxRound:p,points:x}=s,_,w;c.ori==0?(_=FC,w=hte):(_=BC,w=dte);const M=Sr(x.width*Qi,3);let S=(x.size-x.width)/2*Qi,A=Sr(S*2,3),C=new Path2D,D=new Path2D,{left:R,top:N,width:U,height:j}=e.bbox;zC(D,R-A,N-A,U+A*2,j+A*2);const z=q=>{if(l[q]!=null){let B=p(f(o[q],c,b,d)),G=p(h(l[q],u,y,g));_(C,B+S,G),w(C,B,G,S,0,SM*2)}};if(a)a.forEach(z);else for(let q=i;q<=r;q++)z(q);return{stroke:M>0?C:null,fill:C,clip:D,flags:gv|GI}})}function bte(t){return(e,n,i,r,a,s)=>{i!=r&&(a!=i&&s!=i&&t(e,n,i),a!=r&&s!=r&&t(e,n,r),t(e,n,s))}}const SUe=bte(iy),wUe=bte(ry);function vte(t){const e=Xi(t?.alignGaps,0);return(n,i,r,a)=>hg(n,i,(s,o,l,c,u,f,h,d,g,b,y)=>{[r,a]=IC(l,r,a);let p=s.pxRound,x=j=>p(f(j,c,b,d)),_=j=>p(h(j,u,y,g)),w,M;c.ori==0?(w=iy,M=SUe):(w=ry,M=wUe);const S=c.dir*(c.ori==0?1:-1),A={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:gv},C=A.stroke;let D=!1;if(a-r>=b*4){let j=V=>n.posToVal(V,c.key,!0),z=null,q=null,B,G,H,W=x(o[S==1?r:a]),F=x(o[r]),Y=x(o[a]),Z=j(S==1?F+1:Y-1);for(let V=S==1?r:a;V>=r&&V<=a;V+=S){let de=o[V],oe=(S==1?de<Z:de>Z)?W:x(de),ue=l[V];oe==W?ue!=null?(G=ue,z==null?(w(C,oe,_(G)),B=z=q=G):G<z?z=G:G>q&&(q=G)):ue===null&&(D=!0):(z!=null&&M(C,W,_(z),_(q),_(B),_(G)),ue!=null?(G=ue,w(C,oe,_(G)),z=q=B=G):(z=q=null,ue===null&&(D=!0)),W=oe,Z=j(W+S))}z!=null&&z!=q&&H!=W&&M(C,W,_(z),_(q),_(B),_(G))}else for(let j=S==1?r:a;j>=r&&j<=a;j+=S){let z=l[j];z===null?D=!0:z!=null&&w(C,x(o[j]),_(z))}let[N,U]=p4(n,i);if(s.fill!=null||N!=0){let j=A.fill=new Path2D(C),z=s.fillTo(n,i,s.min,s.max,N),q=_(z),B=x(o[r]),G=x(o[a]);S==-1&&([G,B]=[B,G]),w(j,G,q),w(j,B,q)}if(!s.spanGaps){let j=[];D&&j.push(...m4(o,l,r,a,S,x,e)),A.gaps=j=s.gaps(n,i,r,a,j),A.clip=UC(j,c.ori,d,g,b,y)}return U!=0&&(A.band=U==2?[sh(n,i,r,a,C,-1),sh(n,i,r,a,C,1)]:sh(n,i,r,a,C,U)),A})}function EUe(t){const e=Xi(t.align,1),n=Xi(t.ascDesc,!1),i=Xi(t.alignGaps,0),r=Xi(t.extend,!1);return(a,s,o,l)=>hg(a,s,(c,u,f,h,d,g,b,y,p,x,_)=>{[o,l]=IC(f,o,l);let w=c.pxRound,{left:M,width:S}=a.bbox,A=F=>w(g(F,h,x,y)),C=F=>w(b(F,d,_,p)),D=h.ori==0?iy:ry;const R={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:gv},N=R.stroke,U=h.dir*(h.ori==0?1:-1);let j=C(f[U==1?o:l]),z=A(u[U==1?o:l]),q=z,B=z;r&&e==-1&&(B=M,D(N,B,j)),D(N,z,j);for(let F=U==1?o:l;F>=o&&F<=l;F+=U){let Y=f[F];if(Y==null)continue;let Z=A(u[F]),V=C(Y);e==1?D(N,Z,j):D(N,q,V),D(N,Z,V),j=V,q=Z}let G=q;r&&e==1&&(G=M+S,D(N,G,j));let[H,W]=p4(a,s);if(c.fill!=null||H!=0){let F=R.fill=new Path2D(N),Y=c.fillTo(a,s,c.min,c.max,H),Z=C(Y);D(F,G,Z),D(F,B,Z)}if(!c.spanGaps){let F=[];F.push(...m4(u,f,o,l,U,A,i));let Y=c.width*Qi/2,Z=n||e==1?Y:-Y,V=n||e==-1?-Y:Y;F.forEach(de=>{de[0]+=Z,de[1]+=V}),R.gaps=F=c.gaps(a,s,o,l,F),R.clip=UC(F,h.ori,y,p,x,_)}return W!=0&&(R.band=W==2?[sh(a,s,o,l,N,-1),sh(a,s,o,l,N,1)]:sh(a,s,o,l,N,W)),R})}function ZV(t,e,n,i,r,a,s=_r){if(t.length>1){let o=null;for(let l=0,c=1/0;l<t.length;l++)if(e[l]!==void 0){if(o!=null){let u=La(t[l]-t[o]);u<c&&(c=u,s=La(n(t[l],i,r,a)-n(t[o],i,r,a)))}o=l}}return s}function MUe(t){t=t||m1;const e=Xi(t.size,[.6,_r,1]),n=t.align||0,i=t.gap||0;let r=t.radius;r=r==null?[0,0]:typeof r=="number"?[r,0]:r;const a=Ii(r),s=1-e[0],o=Xi(e[1],_r),l=Xi(e[2],1),c=Xi(t.disp,m1),u=Xi(t.each,d=>{}),{fill:f,stroke:h}=c;return(d,g,b,y)=>hg(d,g,(p,x,_,w,M,S,A,C,D,R,N)=>{let U=p.pxRound,j=n,z=i*Qi,q=o*Qi,B=l*Qi,G,H;w.ori==0?[G,H]=a(d,g):[H,G]=a(d,g);const W=w.dir*(w.ori==0?1:-1);let F=w.ori==0?zC:g4,Y=w.ori==0?u:(ce,fe,me,$,Le,Xe,mt)=>{u(ce,fe,me,Le,$,mt,Xe)},Z=Xi(d.bands,c4).find(ce=>ce.series[0]==g),V=Z!=null?Z.dir:0,de=p.fillTo(d,g,p.min,p.max,V),se=U(A(de,M,N,D)),oe,ue,_e,ke=R,Ne=U(p.width*Qi),Ue=!1,ze=null,pe=null,Fe=null,Ie=null;f!=null&&(Ne==0||h!=null)&&(Ue=!0,ze=f.values(d,g,b,y),pe=new Map,new Set(ze).forEach(ce=>{ce!=null&&pe.set(ce,new Path2D)}),Ne>0&&(Fe=h.values(d,g,b,y),Ie=new Map,new Set(Fe).forEach(ce=>{ce!=null&&Ie.set(ce,new Path2D)})));let{x0:qe,size:we}=c;if(qe!=null&&we!=null){j=1,x=qe.values(d,g,b,y),qe.unit==2&&(x=x.map(me=>d.posToVal(C+me*R,w.key,!0)));let ce=we.values(d,g,b,y);we.unit==2?ue=ce[0]*R:ue=S(ce[0],w,R,C)-S(0,w,R,C),ke=ZV(x,_,S,w,R,C,ke),_e=ke-ue+z}else ke=ZV(x,_,S,w,R,C,ke),_e=ke*s+z,ue=ke-_e;_e<1&&(_e=0),Ne>=ue/2&&(Ne=0),_e<5&&(U=jee);let Te=_e>0,Ae=ke-_e-(Te?Ne:0);ue=U(jI(Ae,B,q)),oe=(j==0?ue/2:j==W?0:ue)-j*W*((j==0?z/2:0)+(Te?Ne/2:0));const Pe={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},He=Ue?null:new Path2D;let $e=null;if(Z!=null)$e=d.data[Z.series[1]];else{let{y0:ce,y1:fe}=c;ce!=null&&fe!=null&&(_=fe.values(d,g,b,y),$e=ce.values(d,g,b,y))}let ie=G*ue,K=H*ue;for(let ce=W==1?b:y;ce>=b&&ce<=y;ce+=W){let fe=_[ce];if(fe==null)continue;if($e!=null){let tt=$e[ce]??0;if(fe-tt==0)continue;se=A(tt,M,N,D)}let me=w.distr!=2||c!=null?x[ce]:ce,$=S(me,w,R,C),Le=A(Xi(fe,de),M,N,D),Xe=U($-oe),mt=U(Mo(Le,se)),Ge=U(ru(Le,se)),Je=mt-Ge;if(fe!=null){let tt=fe<0?K:ie,xt=fe<0?ie:K;Ue?(Ne>0&&Fe[ce]!=null&&F(Ie.get(Fe[ce]),Xe,Ge+Ml(Ne/2),ue,Mo(0,Je-Ne),tt,xt),ze[ce]!=null&&F(pe.get(ze[ce]),Xe,Ge+Ml(Ne/2),ue,Mo(0,Je-Ne),tt,xt)):F(He,Xe,Ge+Ml(Ne/2),ue,Mo(0,Je-Ne),tt,xt),Y(d,g,ce,Xe-Ne/2,Ge,ue+Ne,Je)}}return Ne>0?Pe.stroke=Ue?Ie:He:Ue||(Pe._fill=p.width==0?p._fill:p._stroke??p._fill,Pe.width=0),Pe.fill=Ue?pe:He,Pe})}function TUe(t,e){const n=Xi(e?.alignGaps,0);return(i,r,a,s)=>hg(i,r,(o,l,c,u,f,h,d,g,b,y,p)=>{[a,s]=IC(c,a,s);let x=o.pxRound,_=G=>x(h(G,u,y,g)),w=G=>x(d(G,f,p,b)),M,S,A;u.ori==0?(M=FC,A=iy,S=pte):(M=BC,A=ry,S=mte);const C=u.dir*(u.ori==0?1:-1);let D=_(l[C==1?a:s]),R=D,N=[],U=[];for(let G=C==1?a:s;G>=a&&G<=s;G+=C)if(c[G]!=null){let W=l[G],F=_(W);N.push(R=F),U.push(w(c[G]))}const j={stroke:t(N,U,M,A,S,x),fill:null,clip:null,band:null,gaps:null,flags:gv},z=j.stroke;let[q,B]=p4(i,r);if(o.fill!=null||q!=0){let G=j.fill=new Path2D(z),H=o.fillTo(i,r,o.min,o.max,q),W=w(H);A(G,R,W),A(G,D,W)}if(!o.spanGaps){let G=[];G.push(...m4(l,c,a,s,C,_,n)),j.gaps=G=o.gaps(i,r,a,s,G),j.clip=UC(G,u.ori,g,b,y,p)}return B!=0&&(j.band=B==2?[sh(i,r,a,s,z,-1),sh(i,r,a,s,z,1)]:sh(i,r,a,s,z,B)),j})}function AUe(t){return TUe(CUe,t)}function CUe(t,e,n,i,r,a){const s=t.length;if(s<2)return null;const o=new Path2D;if(n(o,t[0],e[0]),s==2)i(o,t[1],e[1]);else{let l=Array(s),c=Array(s-1),u=Array(s-1),f=Array(s-1);for(let h=0;h<s-1;h++)u[h]=e[h+1]-e[h],f[h]=t[h+1]-t[h],c[h]=u[h]/f[h];l[0]=c[0];for(let h=1;h<s-1;h++)c[h]===0||c[h-1]===0||c[h-1]>0!=c[h]>0?l[h]=0:(l[h]=3*(f[h-1]+f[h])/((2*f[h]+f[h-1])/c[h-1]+(f[h]+2*f[h-1])/c[h]),isFinite(l[h])||(l[h]=0));l[s-1]=c[s-2];for(let h=0;h<s-1;h++)r(o,t[h]+f[h]/3,e[h]+l[h]*f[h]/3,t[h+1]-f[h]/3,e[h+1]-l[h+1]*f[h]/3,t[h+1],e[h+1])}return o}const WI=new Set;function QV(){for(let t of WI)t.syncRect(!0)}ny&&(Om(lPe,M0,QV),Om(cPe,M0,QV,!0),Om(yT,M0,()=>{ro.pxRatio=Qi}));const RUe=vte(),kUe=gte();function eG(t,e,n,i){return(i?[t[0],t[1]].concat(t.slice(2)):[t[0]].concat(t.slice(1))).map((a,s)=>qI(a,s,e,n))}function DUe(t,e){return t.map((n,i)=>i==0?{}:Ma({},e,n))}function qI(t,e,n,i){return Ma({},e==0?n:i,t)}function yte(t,e,n){return e==null?pv:[e,n]}const OUe=yte;function IUe(t,e,n){return e==null?pv:xT(e,n,o4,!0)}function xte(t,e,n,i){return e==null?pv:NC(e,n,t.scales[i].log,!1)}const NUe=xte;function _te(t,e,n,i){return e==null?pv:s4(e,n,t.scales[i].log,!1)}const LUe=_te;function PUe(t,e,n,i,r){let a=Mo(OV(t),OV(e)),s=e-t,o=Jc(r/i*s,n);do{let l=n[o],c=i*l/s;if(c>=r&&a+(l<5?jd.get(l):0)<=17)return[l,c]}while(++o<n.length);return[0,0]}function tG(t){let e,n;return t=t.replace(/(\d+)px/,(i,r)=>(e=Na((n=+r)*Qi))+"px"),[t,e,n]}function UUe(t){t.show&&[t.font,t.labelFont].forEach(e=>{let n=Sr(e[2]*Qi,1);e[0]=e[0].replace(/[0-9.]+px/,n+"px"),e[1]=n})}function ro(t,e,n){const i={mode:Xi(t.mode,1)},r=i.mode;function a(Q,he,Se,Me){let We=he.valToPct(Q);return Me+Se*(he.dir==-1?1-We:We)}function s(Q,he,Se,Me){let We=he.valToPct(Q);return Me+Se*(he.dir==-1?We:1-We)}function o(Q,he,Se,Me){return he.ori==0?a(Q,he,Se,Me):s(Q,he,Se,Me)}i.valToPosH=a,i.valToPosV=s;let l=!1;i.status=0;const c=i.root=Jl(GLe);if(t.id!=null&&(c.id=t.id),fl(c,t.class),t.title){let Q=Jl(XLe,c);Q.textContent=t.title}const u=qc("canvas"),f=i.ctx=u.getContext("2d"),h=Jl(KLe,c);Om("click",h,Q=>{Q.target===g&&(An!=zt||ni!=mn)&&wi.click(i,Q)},!0);const d=i.under=Jl(YLe,h);h.appendChild(u);const g=i.over=Jl(JLe,h);t=mv(t);const b=+Xi(t.pxAlign,1),y=$V(b);(t.plugins||[]).forEach(Q=>{Q.opts&&(t=Q.opts(i,t)||t)});const p=t.ms||.001,x=i.series=r==1?eG(t.series||[],GV,YV,!1):DUe(t.series||[null],KV),_=i.axes=eG(t.axes||[],VV,qV,!0),w=i.scales={},M=i.bands=t.bands||[];M.forEach(Q=>{Q.fill=Ii(Q.fill||null),Q.dir=Xi(Q.dir,-1)});const S=r==2?x[1].facets[0].scale:x[0].scale,A={axes:In,series:pn},C=(t.drawOrder||["axes","series"]).map(Q=>A[Q]);function D(Q){const he=Q.distr==3?Se=>ah(Se>0?Se:Q.clamp(i,Se,Q.min,Q.max,Q.key)):Q.distr==4?Se=>i8(Se,Q.asinh):Q.distr==100?Se=>Q.fwd(Se):Se=>Se;return Se=>{let Me=he(Se),{_min:We,_max:Ye}=Q,At=Ye-We;return(Me-We)/At}}function R(Q){let he=w[Q];if(he==null){let Se=(t.scales||m1)[Q]||m1;if(Se.from!=null){R(Se.from);let Me=Ma({},w[Se.from],Se,{key:Q});Me.valToPct=D(Me),w[Q]=Me}else{he=w[Q]=Ma({},Q==S?cte:yUe,Se),he.key=Q;let Me=he.time,We=he.range,Ye=od(We);if((Q!=S||r==2&&!Me)&&(Ye&&(We[0]==null||We[1]==null)&&(We={min:We[0]==null?RV:{mode:1,hard:We[0],soft:We[0]},max:We[1]==null?RV:{mode:1,hard:We[1],soft:We[1]}},Ye=!1),!Ye&&PC(We))){let At=We;We=(Bt,Gt,Qt)=>Gt==null?pv:xT(Gt,Qt,At)}he.range=Ii(We||(Me?OUe:Q==S?he.distr==3?NUe:he.distr==4?LUe:yte:he.distr==3?xte:he.distr==4?_te:IUe)),he.auto=Ii(Ye?!1:he.auto),he.clamp=Ii(he.clamp||vUe),he._min=he._max=null,he.valToPct=D(he)}}}R("x"),R("y"),r==1&&x.forEach(Q=>{R(Q.scale)}),_.forEach(Q=>{R(Q.scale)});for(let Q in t.scales)R(Q);const N=w[S],U=N.distr;let j,z;N.ori==0?(fl(c,WLe),j=a,z=s):(fl(c,qLe),j=s,z=a);const q={};for(let Q in w){let he=w[Q];(he.min!=null||he.max!=null)&&(q[Q]={min:he.min,max:he.max},he.min=he.max=null)}const B=t.tzDate||(Q=>new Date(Na(Q/p))),G=t.fmtDate||u4,H=p==1?WPe(B):KPe(B),W=zV(B,BV(p==1?GPe:XPe,G)),F=HV(B,jV(JPe,G)),Y=[],Z=i.legend=Ma({},QPe,t.legend),V=i.cursor=Ma({},aUe,{drag:{y:r==2}},t.cursor),de=Z.show,se=V.show,oe=Z.markers;Z.idxs=Y,oe.width=Ii(oe.width),oe.dash=Ii(oe.dash),oe.stroke=Ii(oe.stroke),oe.fill=Ii(oe.fill);let ue,_e,ke,Ne=[],Ue=[],ze,pe=!1,Fe={};if(Z.live){const Q=x[1]?x[1].values:null;pe=Q!=null,ze=pe?Q(i,1,0):{_:0};for(let he in ze)Fe[he]=r4}if(de)if(ue=qc("table",nPe,c),ke=qc("tbody",null,ue),Z.mount(i,ue),pe){_e=qc("thead",null,ue,ke);let Q=qc("tr",null,_e);qc("th",null,Q);for(var Ie in ze)qc("th",gV,Q).textContent=Ie}else fl(ue,rPe),Z.live&&fl(ue,iPe);const qe={show:!0},we={show:!1};function Te(Q,he){if(he==0&&(pe||!Z.live||r==2))return pv;let Se=[],Me=qc("tr",aPe,ke,ke.childNodes[he]);fl(Me,Q.class),Q.show||fl(Me,em);let We=qc("th",null,Me);if(oe.show){let Bt=Jl(sPe,We);if(he>0){let Gt=oe.width(i,he);Gt&&(Bt.style.border=Gt+"px "+oe.dash(i,he)+" "+oe.stroke(i,he)),Bt.style.background=oe.fill(i,he)}}let Ye=Jl(gV,We);Q.label instanceof HTMLElement?Ye.appendChild(Q.label):Ye.textContent=Q.label,he>0&&(oe.show||(Ye.style.color=Q.width>0?oe.stroke(i,he):oe.fill(i,he)),Pe("click",We,Bt=>{if(V._lock)return;Gn(Bt);let Gt=x.indexOf(Q);if((Bt.ctrlKey||Bt.metaKey)!=Z.isolate){let Qt=x.some((Zt,on)=>on>0&&on!=Gt&&Zt.show);x.forEach((Zt,on)=>{on>0&&Ei(on,Qt?on==Gt?qe:we:qe,!0,Lr.setSeries)})}else Ei(Gt,{show:!Q.show},!0,Lr.setSeries)},!1),ai&&Pe(xV,We,Bt=>{V._lock||(Gn(Bt),Ei(x.indexOf(Q),Re,!0,Lr.setSeries))},!1));for(var At in ze){let Bt=qc("td",oPe,Me);Bt.textContent="--",Se.push(Bt)}return[Me,Se]}const Ae=new Map;function Pe(Q,he,Se,Me=!0){const We=Ae.get(he)||{},Ye=V.bind[Q](i,he,Se,Me);Ye&&(Om(Q,he,We[Q]=Ye),Ae.set(he,We))}function He(Q,he,Se){const Me=Ae.get(he)||{};for(let We in Me)(Q==null||We==Q)&&(zI(We,he,Me[We]),delete Me[We]);Q==null&&Ae.delete(he)}let $e=0,ie=0,K=0,ce=0,fe=0,me=0,$=fe,Le=me,Xe=K,mt=ce,Ge=0,Je=0,tt=0,xt=0;i.bbox={};let Tt=!1,bt=!1,Rt=!1,Oe=!1,Ve=!1,ht=!1;function Ft(Q,he,Se){(Se||Q!=i.width||he!=i.height)&&st(Q,he),zs(!1),Rt=!0,bt=!0,js()}function st(Q,he){i.width=$e=K=Q,i.height=ie=ce=he,fe=me=0,Xt(),cn();let Se=i.bbox;Ge=Se.left=Kp(fe*Qi,.5),Je=Se.top=Kp(me*Qi,.5),tt=Se.width=Kp(K*Qi,.5),xt=Se.height=Kp(ce*Qi,.5)}const it=3;function vt(){let Q=!1,he=0;for(;!Q;){he++;let Se=ao(he),Me=so(he);Q=he==it||Se&&Me,Q||(st(i.width,i.height),bt=!0)}}function Kt({width:Q,height:he}){Ft(Q,he)}i.setSize=Kt;function Xt(){let Q=!1,he=!1,Se=!1,Me=!1;_.forEach((We,Ye)=>{if(We.show&&We._show){let{side:At,_size:Bt}=We,Gt=At%2,Qt=We.label!=null?We.labelSize:0,Zt=Bt+Qt;Zt>0&&(Gt?(K-=Zt,At==3?(fe+=Zt,Me=!0):Se=!0):(ce-=Zt,At==0?(me+=Zt,Q=!0):he=!0))}}),ge[0]=Q,ge[1]=Se,ge[2]=he,ge[3]=Me,K-=ot[1]+ot[3],fe+=ot[3],ce-=ot[2]+ot[0],me+=ot[0]}function cn(){let Q=fe+K,he=me+ce,Se=fe,Me=me;function We(Ye,At){switch(Ye){case 1:return Q+=At,Q-At;case 2:return he+=At,he-At;case 3:return Se-=At,Se+At;case 0:return Me-=At,Me+At}}_.forEach((Ye,At)=>{if(Ye.show&&Ye._show){let Bt=Ye.side;Ye._pos=We(Bt,Ye._size),Ye.label!=null&&(Ye._lpos=We(Bt,Ye.labelSize))}})}if(V.dataIdx==null){let Q=V.hover,he=Q.skip=new Set(Q.skip??[]);he.add(void 0);let Se=Q.prox=Ii(Q.prox),Me=Q.bias??=0;V.dataIdx=(We,Ye,At,Bt)=>{if(Ye==0)return At;let Gt=At,Qt=Se(We,Ye,At,Bt)??_r,Zt=Qt>=0&&Qt<_r,on=N.ori==0?K:ce,Un=V.left,hi=e[0],Hn=e[Ye];if(he.has(Hn[At])){Gt=null;let si=null,Cn=null,vn;if(Me==0||Me==-1)for(vn=At;si==null&&vn-- >0;)he.has(Hn[vn])||(si=vn);if(Me==0||Me==1)for(vn=At;Cn==null&&vn++<Hn.length;)he.has(Hn[vn])||(Cn=vn);if(si!=null||Cn!=null)if(Zt){let lr=si==null?-1/0:j(hi[si],N,on,0),Mr=Cn==null?1/0:j(hi[Cn],N,on,0),Zr=Un-lr,Zi=Mr-Un;Zr<=Zi?Zr<=Qt&&(Gt=si):Zi<=Qt&&(Gt=Cn)}else Gt=Cn==null?si:si==null?Cn:At-si<=Cn-At?si:Cn}else Zt&&La(Un-j(hi[At],N,on,0))>Qt&&(Gt=null);return Gt}}const Gn=Q=>{V.event=Q};V.idxs=Y,V._lock=!1;let bn=V.points;bn.show=Ii(bn.show),bn.size=Ii(bn.size),bn.stroke=Ii(bn.stroke),bn.width=Ii(bn.width),bn.fill=Ii(bn.fill);const Jn=i.focus=Ma({},t.focus||{alpha:.3},V.focus),ai=Jn.prox>=0,vi=ai&&bn.one;let Yn=[],Yi=[],ci=[];function hn(Q,he){let Se=bn.show(i,he);if(Se instanceof HTMLElement)return fl(Se,tPe),fl(Se,Q.class),Pu(Se,-10,-10,K,ce),g.insertBefore(Se,Yn[he]),Se}function ui(Q,he){if(r==1||he>0){let Se=r==1&&w[Q.scale].time,Me=Q.value;Q.value=Se?LV(Me)?HV(B,jV(Me,G)):Me||F:Me||mUe,Q.label=Q.label||(Se?oUe:sUe)}if(vi||he>0){Q.width=Q.width==null?1:Q.width,Q.paths=Q.paths||RUe||yPe,Q.fillTo=Ii(Q.fillTo||xUe),Q.pxAlign=+Xi(Q.pxAlign,b),Q.pxRound=$V(Q.pxAlign),Q.stroke=Ii(Q.stroke||null),Q.fill=Ii(Q.fill||null),Q._stroke=Q._fill=Q._paths=Q._focus=null;let Se=gUe(Mo(1,Q.width),1),Me=Q.points=Ma({},{size:Se,width:Mo(1,Se*.2),stroke:Q.stroke,space:Se*2,paths:kUe,_stroke:null,_fill:null},Q.points);Me.show=Ii(Me.show),Me.filter=Ii(Me.filter),Me.fill=Ii(Me.fill),Me.stroke=Ii(Me.stroke),Me.paths=Ii(Me.paths),Me.pxAlign=Q.pxAlign}if(de){let Se=Te(Q,he);Ne.splice(he,0,Se[0]),Ue.splice(he,0,Se[1]),Z.values.push(null)}if(se){Y.splice(he,0,null);let Se=null;vi?he==0&&(Se=hn(Q,he)):he>0&&(Se=hn(Q,he)),Yn.splice(he,0,Se),Yi.splice(he,0,0),ci.splice(he,0,0)}Vr("addSeries",he)}function $n(Q,he){he=he??x.length,Q=r==1?qI(Q,he,GV,YV):qI(Q,he,{},KV),x.splice(he,0,Q),ui(x[he],he)}i.addSeries=$n;function re(Q){if(x.splice(Q,1),de){Z.values.splice(Q,1),Ue.splice(Q,1);let he=Ne.splice(Q,1)[0];He(null,he.firstChild),he.remove()}se&&(Y.splice(Q,1),Yn.splice(Q,1)[0].remove(),Yi.splice(Q,1),ci.splice(Q,1)),Vr("delSeries",Q)}i.delSeries=re;const ge=[!1,!1,!1,!1];function je(Q,he){if(Q._show=Q.show,Q.show){let Se=Q.side%2,Me=w[Q.scale];Me==null&&(Q.scale=Se?x[1].scale:S,Me=w[Q.scale]);let We=Me.time;Q.size=Ii(Q.size),Q.space=Ii(Q.space),Q.rotate=Ii(Q.rotate),od(Q.incrs)&&Q.incrs.forEach(At=>{!jd.has(At)&&jd.set(At,Gee(At))}),Q.incrs=Ii(Q.incrs||(Me.distr==2?jPe:We?p==1?VPe:qPe:Yp)),Q.splits=Ii(Q.splits||(We&&Me.distr==1?H:Me.distr==3?HI:Me.distr==4?uUe:cUe)),Q.stroke=Ii(Q.stroke),Q.grid.stroke=Ii(Q.grid.stroke),Q.ticks.stroke=Ii(Q.ticks.stroke),Q.border.stroke=Ii(Q.border.stroke);let Ye=Q.values;Q.values=od(Ye)&&!od(Ye[0])?Ii(Ye):We?od(Ye)?zV(B,BV(Ye,G)):LV(Ye)?YPe(B,Ye):Ye||W:Ye||lUe,Q.filter=Ii(Q.filter||(Me.distr>=3&&Me.log==10?dUe:Me.distr==3&&Me.log==2?pUe:Hee)),Q.font=tG(Q.font),Q.labelFont=tG(Q.labelFont),Q._size=Q.size(i,null,he,0),Q._space=Q._rotate=Q._incrs=Q._found=Q._splits=Q._values=null,Q._size>0&&(ge[he]=!0,Q._el=Jl($Le,h))}}function rt(Q,he,Se,Me){let[We,Ye,At,Bt]=Se,Gt=he%2,Qt=0;return Gt==0&&(Bt||Ye)&&(Qt=he==0&&!We||he==2&&!At?Na(VV.size/3):0),Gt==1&&(We||At)&&(Qt=he==1&&!Ye||he==3&&!Bt?Na(qV.size/2):0),Qt}const dt=i.padding=(t.padding||[rt,rt,rt,rt]).map(Q=>Ii(Xi(Q,rt))),ot=i._padding=dt.map((Q,he)=>Q(i,he,ge,0));let kt,ee=null,ye=null;const Ce=r==1?x[0].idxs:null;let De=null,ve=!1;function _t(Q,he){if(e=Q??[],i.data=i._data=e,r==2){kt=0;for(let Se=1;Se<x.length;Se++)kt+=e[Se][0].length}else{e.length==0&&(i.data=i._data=e=[[]]),De=e[0],kt=De.length;let Se=e;if(U==2){Se=e.slice();let Me=Se[0]=Array(kt);for(let We=0;We<kt;We++)Me[We]=We}i._data=e=Se}if(zs(!0),Vr("setData"),U==2&&(Rt=!0),he!==!1){let Se=N;Se.auto(i,ve)?lt():os(S,Se.min,Se.max),Oe=Oe||V.left>=0,ht=!0,js()}}i.setData=_t;function lt(){ve=!0;let Q,he;r==1&&(kt>0?(ee=Ce[0]=0,ye=Ce[1]=kt-1,Q=e[0][ee],he=e[0][ye],U==2?(Q=ee,he=ye):Q==he&&(U==3?[Q,he]=NC(Q,Q,N.log,!1):U==4?[Q,he]=s4(Q,Q,N.log,!1):N.time?he=Q+Na(86400/p):[Q,he]=xT(Q,he,o4,!0))):(ee=Ce[0]=Q=null,ye=Ce[1]=he=null)),os(S,Q,he)}let yt,St,Nt,Ht,at,nn,un,dn,On,$t;function Yt(Q,he,Se,Me,We,Ye){Q??=vV,Se??=c4,Me??="butt",We??=vV,Ye??="round",Q!=yt&&(f.strokeStyle=yt=Q),We!=St&&(f.fillStyle=St=We),he!=Nt&&(f.lineWidth=Nt=he),Ye!=at&&(f.lineJoin=at=Ye),Me!=nn&&(f.lineCap=nn=Me),Se!=Ht&&f.setLineDash(Ht=Se)}function Pn(Q,he,Se,Me){he!=St&&(f.fillStyle=St=he),Q!=un&&(f.font=un=Q),Se!=dn&&(f.textAlign=dn=Se),Me!=On&&(f.textBaseline=On=Me)}function wn(Q,he,Se,Me,We=0){if(Me.length>0&&Q.auto(i,ve)&&(he==null||he.min==null)){let Ye=Xi(ee,0),At=Xi(ye,Me.length-1),Bt=Se.min==null?dPe(Me,Ye,At,We,Q.distr==3):[Se.min,Se.max];Q.min=ru(Q.min,Se.min=Bt[0]),Q.max=Mo(Q.max,Se.max=Bt[1])}}const Xn={min:null,max:null};function En(){for(let Me in w){let We=w[Me];q[Me]==null&&(We.min==null||q[S]!=null&&We.auto(i,ve))&&(q[Me]=Xn)}for(let Me in w){let We=w[Me];q[Me]==null&&We.from!=null&&q[We.from]!=null&&(q[Me]=Xn)}q[S]!=null&&zs(!0);let Q={};for(let Me in q){let We=q[Me];if(We!=null){let Ye=Q[Me]=mv(w[Me],SPe);if(We.min!=null)Ma(Ye,We);else if(Me!=S||r==2)if(kt==0&&Ye.from==null){let At=Ye.range(i,null,null,Me);Ye.min=At[0],Ye.max=At[1]}else Ye.min=_r,Ye.max=-_r}}if(kt>0){x.forEach((Me,We)=>{if(r==1){let Ye=Me.scale,At=q[Ye];if(At==null)return;let Bt=Q[Ye];if(We==0){let Gt=Bt.range(i,Bt.min,Bt.max,Ye);Bt.min=Gt[0],Bt.max=Gt[1],ee=Jc(Bt.min,e[0]),ye=Jc(Bt.max,e[0]),ye-ee>1&&(e[0][ee]<Bt.min&&ee++,e[0][ye]>Bt.max&&ye--),Me.min=De[ee],Me.max=De[ye]}else Me.show&&Me.auto&&wn(Bt,At,Me,e[We],Me.sorted);Me.idxs[0]=ee,Me.idxs[1]=ye}else if(We>0&&Me.show&&Me.auto){let[Ye,At]=Me.facets,Bt=Ye.scale,Gt=At.scale,[Qt,Zt]=e[We],on=Q[Bt],Un=Q[Gt];on!=null&&wn(on,q[Bt],Ye,Qt,Ye.sorted),Un!=null&&wn(Un,q[Gt],At,Zt,At.sorted),Me.min=At.min,Me.max=At.max}});for(let Me in Q){let We=Q[Me],Ye=q[Me];if(We.from==null&&(Ye==null||Ye.min==null)){let At=We.range(i,We.min==_r?null:We.min,We.max==-_r?null:We.max,Me);We.min=At[0],We.max=At[1]}}}for(let Me in Q){let We=Q[Me];if(We.from!=null){let Ye=Q[We.from];if(Ye.min==null)We.min=We.max=null;else{let At=We.range(i,Ye.min,Ye.max,Me);We.min=At[0],We.max=At[1]}}}let he={},Se=!1;for(let Me in Q){let We=Q[Me],Ye=w[Me];if(Ye.min!=We.min||Ye.max!=We.max){Ye.min=We.min,Ye.max=We.max;let At=Ye.distr;Ye._min=At==3?ah(Ye.min):At==4?i8(Ye.min,Ye.asinh):At==100?Ye.fwd(Ye.min):Ye.min,Ye._max=At==3?ah(Ye.max):At==4?i8(Ye.max,Ye.asinh):At==100?Ye.fwd(Ye.max):Ye.max,he[Me]=Se=!0}}if(Se){x.forEach((Me,We)=>{r==2?We>0&&he.y&&(Me._paths=null):he[Me.scale]&&(Me._paths=null)});for(let Me in he)Rt=!0,Vr("setScale",Me);se&&V.left>=0&&(Oe=ht=!0)}for(let Me in q)q[Me]=null}function Mn(Q){let he=jI(ee-1,0,kt-1),Se=jI(ye+1,0,kt-1);for(;Q[he]==null&&he>0;)he--;for(;Q[Se]==null&&Se<kt-1;)Se++;return[he,Se]}function pn(){if(kt>0){let Q=x.some(he=>he._focus)&&$t!=Jn.alpha;Q&&(f.globalAlpha=$t=Jn.alpha),x.forEach((he,Se)=>{if(Se>0&&he.show&&(rn(Se,!1),rn(Se,!0),he._paths==null)){let Me=$t;$t!=he.alpha&&(f.globalAlpha=$t=he.alpha);let We=r==2?[0,e[Se][0].length-1]:Mn(e[Se]);he._paths=he.paths(i,Se,We[0],We[1]),$t!=Me&&(f.globalAlpha=$t=Me)}}),x.forEach((he,Se)=>{if(Se>0&&he.show){let Me=$t;$t!=he.alpha&&(f.globalAlpha=$t=he.alpha),he._paths!=null&&yi(Se,!1);{let We=he._paths!=null?he._paths.gaps:null,Ye=he.points.show(i,Se,ee,ye,We),At=he.points.filter(i,Se,Ye,We);(Ye||At)&&(he.points._paths=he.points.paths(i,Se,ee,ye,At),yi(Se,!0))}$t!=Me&&(f.globalAlpha=$t=Me),Vr("drawSeries",Se)}}),Q&&(f.globalAlpha=$t=1)}}function rn(Q,he){let Se=he?x[Q].points:x[Q];Se._stroke=Se.stroke(i,Q),Se._fill=Se.fill(i,Q)}function yi(Q,he){let Se=he?x[Q].points:x[Q],{stroke:Me,fill:We,clip:Ye,flags:At,_stroke:Bt=Se._stroke,_fill:Gt=Se._fill,_width:Qt=Se.width}=Se._paths;Qt=Sr(Qt*Qi,3);let Zt=null,on=Qt%2/2;he&&Gt==null&&(Gt=Qt>0?"#fff":Bt);let Un=Se.pxAlign==1&&on>0;if(Un&&f.translate(on,on),!he){let hi=Ge-Qt/2,Hn=Je-Qt/2,si=tt+Qt,Cn=xt+Qt;Zt=new Path2D,Zt.rect(hi,Hn,si,Cn)}he?Oi(Bt,Qt,Se.dash,Se.cap,Gt,Me,We,At,Ye):Li(Q,Bt,Qt,Se.dash,Se.cap,Gt,Me,We,At,Zt,Ye),Un&&f.translate(-on,-on)}function Li(Q,he,Se,Me,We,Ye,At,Bt,Gt,Qt,Zt){let on=!1;Gt!=0&&M.forEach((Un,hi)=>{if(Un.series[0]==Q){let Hn=x[Un.series[1]],si=e[Un.series[1]],Cn=(Hn._paths||m1).band;od(Cn)&&(Cn=Un.dir==1?Cn[0]:Cn[1]);let vn,lr=null;Hn.show&&Cn&&mPe(si,ee,ye)?(lr=Un.fill(i,hi)||Ye,vn=Hn._paths.clip):Cn=null,Oi(he,Se,Me,We,lr,At,Bt,Gt,Qt,Zt,vn,Cn),on=!0}}),on||Oi(he,Se,Me,We,Ye,At,Bt,Gt,Qt,Zt)}const Wn=gv|GI;function Oi(Q,he,Se,Me,We,Ye,At,Bt,Gt,Qt,Zt,on){Yt(Q,he,Se,Me,We),(Gt||Qt||on)&&(f.save(),Gt&&f.clip(Gt),Qt&&f.clip(Qt)),on?(Bt&Wn)==Wn?(f.clip(on),Zt&&f.clip(Zt),Ji(We,At),ya(Q,Ye,he)):Bt&GI?(Ji(We,At),f.clip(on),ya(Q,Ye,he)):Bt&gv&&(f.save(),f.clip(on),Zt&&f.clip(Zt),Ji(We,At),f.restore(),ya(Q,Ye,he)):(Ji(We,At),ya(Q,Ye,he)),(Gt||Qt||on)&&f.restore()}function ya(Q,he,Se){Se>0&&(he instanceof Map?he.forEach((Me,We)=>{f.strokeStyle=yt=We,f.stroke(Me)}):he!=null&&Q&&f.stroke(he))}function Ji(Q,he){he instanceof Map?he.forEach((Se,Me)=>{f.fillStyle=St=Me,f.fill(Se)}):he!=null&&Q&&f.fill(he)}function Xo(Q,he,Se,Me){let We=_[Q],Ye;if(Me<=0)Ye=[0,0];else{let At=We._space=We.space(i,Q,he,Se,Me),Bt=We._incrs=We.incrs(i,Q,he,Se,Me,At);Ye=PUe(he,Se,Bt,Me,At)}return We._found=Ye}function Bs(Q,he,Se,Me,We,Ye,At,Bt,Gt,Qt){let Zt=At%2/2;b==1&&f.translate(Zt,Zt),Yt(Bt,At,Gt,Qt,Bt),f.beginPath();let on,Un,hi,Hn,si=We+(Me==0||Me==3?-Ye:Ye);Se==0?(Un=We,Hn=si):(on=We,hi=si);for(let Cn=0;Cn<Q.length;Cn++)he[Cn]!=null&&(Se==0?on=hi=Q[Cn]:Un=Hn=Q[Cn],f.moveTo(on,Un),f.lineTo(hi,Hn));f.stroke(),b==1&&f.translate(-Zt,-Zt)}function ao(Q){let he=!0;return _.forEach((Se,Me)=>{if(!Se.show)return;let We=w[Se.scale];if(We.min==null){Se._show&&(he=!1,Se._show=!1,zs(!1));return}else Se._show||(he=!1,Se._show=!0,zs(!1));let Ye=Se.side,At=Ye%2,{min:Bt,max:Gt}=We,[Qt,Zt]=Xo(Me,Bt,Gt,At==0?K:ce);if(Zt==0)return;let on=We.distr==2,Un=Se._splits=Se.splits(i,Me,Bt,Gt,Qt,Zt,on),hi=We.distr==2?Un.map(vn=>De[vn]):Un,Hn=We.distr==2?De[Un[1]]-De[Un[0]]:Qt,si=Se._values=Se.values(i,Se.filter(i,hi,Me,Zt,Hn),Me,Zt,Hn);Se._rotate=Ye==2?Se.rotate(i,si,Me,Zt):0;let Cn=Se._size;Se._size=nc(Se.size(i,si,Me,Q)),Cn!=null&&Se._size!=Cn&&(he=!1)}),he}function so(Q){let he=!0;return dt.forEach((Se,Me)=>{let We=Se(i,Me,ge,Q);We!=ot[Me]&&(he=!1),ot[Me]=We}),he}function In(){for(let Q=0;Q<_.length;Q++){let he=_[Q];if(!he.show||!he._show)continue;let Se=he.side,Me=Se%2,We,Ye,At=he.stroke(i,Q),Bt=Se==0||Se==3?-1:1,[Gt,Qt]=he._found;if(he.label!=null){let cr=he.labelGap*Bt,qs=Na((he._lpos+cr)*Qi);Pn(he.labelFont[0],At,"center",Se==2?lx:bV),f.save(),Me==1?(We=Ye=0,f.translate(qs,Na(Je+xt/2)),f.rotate((Se==3?-SM:SM)/2)):(We=Na(Ge+tt/2),Ye=qs);let hs=zee(he.label)?he.label(i,Q,Gt,Qt):he.label;f.fillText(hs,We,Ye),f.restore()}if(Qt==0)continue;let Zt=w[he.scale],on=Me==0?tt:xt,Un=Me==0?Ge:Je,hi=he._splits,Hn=Zt.distr==2?hi.map(cr=>De[cr]):hi,si=Zt.distr==2?De[hi[1]]-De[hi[0]]:Gt,Cn=he.ticks,vn=he.border,lr=Cn.show?Cn.size:0,Mr=Na(lr*Qi),Zr=Na((he.alignTo==2?he._size-lr-he.gap:he.gap)*Qi),Zi=he._rotate*-SM/180,Gr=y(he._pos*Qi),Gs=(Mr+Zr)*Bt,Wa=Gr+Gs;Ye=Me==0?Wa:0,We=Me==1?Wa:0;let Wr=he.font[0],co=he.align==1?Db:he.align==2?e8:Zi>0?Db:Zi<0?e8:Me==0?"center":Se==3?e8:Db,Jo=Zi||Me==1?"middle":Se==2?lx:bV;Pn(Wr,At,co,Jo);let uo=he.font[1]*he.lineGap,Ws=hi.map(cr=>y(o(cr,Zt,on,Un))),Tr=he._values;for(let cr=0;cr<Tr.length;cr++){let qs=Tr[cr];if(qs!=null){Me==0?We=Ws[cr]:Ye=Ws[cr],qs=""+qs;let hs=qs.indexOf(`
`)==-1?[qs]:qs.split(/\n/gm);for(let sa=0;sa<hs.length;sa++){let Pc=hs[sa];Zi?(f.save(),f.translate(We,Ye+sa*uo),f.rotate(Zi),f.fillText(Pc,0,0),f.restore()):f.fillText(Pc,We,Ye+sa*uo)}}}Cn.show&&Bs(Ws,Cn.filter(i,Hn,Q,Qt,si),Me,Se,Gr,Mr,Sr(Cn.width*Qi,3),Cn.stroke(i,Q),Cn.dash,Cn.cap);let $o=he.grid;$o.show&&Bs(Ws,$o.filter(i,Hn,Q,Qt,si),Me,Me==0?2:1,Me==0?Je:Ge,Me==0?xt:tt,Sr($o.width*Qi,3),$o.stroke(i,Q),$o.dash,$o.cap),vn.show&&Bs([Gr],[1],Me==0?1:0,Me==0?1:2,Me==1?Je:Ge,Me==1?xt:tt,Sr(vn.width*Qi,3),vn.stroke(i,Q),vn.dash,vn.cap)}Vr("drawAxes")}function zs(Q){x.forEach((he,Se)=>{Se>0&&(he._paths=null,Q&&(r==1?(he.min=null,he.max=null):he.facets.forEach(Me=>{Me.min=null,Me.max=null})))})}let Ha=!1,Va=!1,xa=[];function oo(){Va=!1;for(let Q=0;Q<xa.length;Q++)Vr(...xa[Q]);xa.length=0}function js(){Ha||(RPe(E),Ha=!0)}function Ro(Q,he=!1){Ha=!0,Va=he,Q(i),E(),he&&xa.length>0&&queueMicrotask(oo)}i.batch=Ro;function E(){if(Tt&&(En(),Tt=!1),Rt&&(vt(),Rt=!1),bt){if(Ur(d,Db,fe),Ur(d,lx,me),Ur(d,kx,K),Ur(d,Dx,ce),Ur(g,Db,fe),Ur(g,lx,me),Ur(g,kx,K),Ur(g,Dx,ce),Ur(h,kx,$e),Ur(h,Dx,ie),u.width=Na($e*Qi),u.height=Na(ie*Qi),_.forEach(({_el:Q,_show:he,_size:Se,_pos:Me,side:We})=>{if(Q!=null)if(he){let Ye=We===3||We===0?Se:0,At=We%2==1;Ur(Q,At?"left":"top",Me-Ye),Ur(Q,At?"width":"height",Se),Ur(Q,At?"top":"left",At?me:fe),Ur(Q,At?"height":"width",At?ce:K),BI(Q,em)}else fl(Q,em)}),yt=St=Nt=at=nn=un=dn=On=Ht=null,$t=1,cs(!0),fe!=$||me!=Le||K!=Xe||ce!=mt){zs(!1);let Q=K/Xe,he=ce/mt;if(se&&!Oe&&V.left>=0){V.left*=Q,V.top*=he,xe&&Pu(xe,Na(V.left),0,K,ce),Ke&&Pu(Ke,0,Na(V.top),K,ce);for(let Se=0;Se<Yn.length;Se++){let Me=Yn[Se];Me!=null&&(Yi[Se]*=Q,ci[Se]*=he,Pu(Me,nc(Yi[Se]),nc(ci[Se]),K,ce))}}if(fi.show&&!Ve&&fi.left>=0&&fi.width>0){fi.left*=Q,fi.width*=Q,fi.top*=he,fi.height*=he;for(let Se in gf)Ur(Da,Se,fi[Se])}$=fe,Le=me,Xe=K,mt=ce}Vr("setSize"),bt=!1}$e>0&&ie>0&&(f.clearRect(0,0,u.width,u.height),Vr("drawClear"),C.forEach(Q=>Q()),Vr("draw")),fi.show&&Ve&&(Ll(fi),Ve=!1),se&&Oe&&(Hr(null,!0,!1),Oe=!1),Z.show&&Z.live&&ht&&(xi(),ht=!1),l||(l=!0,i.status=1,Vr("ready")),ve=!1,Ha=!1}i.redraw=(Q,he)=>{Rt=he||!1,Q!==!1?os(S,N.min,N.max):js()};function L(Q,he){let Se=w[Q];if(Se.from==null){if(kt==0){let Me=Se.range(i,he.min,he.max,Q);he.min=Me[0],he.max=Me[1]}if(he.min>he.max){let Me=he.min;he.min=he.max,he.max=Me}if(kt>1&&he.min!=null&&he.max!=null&&he.max-he.min<1e-16)return;Q==S&&Se.distr==2&&kt>0&&(he.min=Jc(he.min,e[0]),he.max=Jc(he.max,e[0]),he.min==he.max&&he.max++),q[Q]=he,Tt=!0,js()}}i.setScale=L;let J,ne,xe,Ke,et,Lt,zt,mn,_n,Si,An,ni,Er=!1;const wi=V.drag;let ji=wi.x,Pi=wi.y;se&&(V.x&&(J=Jl(QLe,g)),V.y&&(ne=Jl(ePe,g)),N.ori==0?(xe=J,Ke=ne):(xe=ne,Ke=J),An=V.left,ni=V.top);const fi=i.select=Ma({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),Da=fi.show?Jl(ZLe,fi.over?g:d):null;function Ll(Q,he){if(fi.show){for(let Se in Q)fi[Se]=Q[Se],Se in gf&&Ur(Da,Se,Q[Se]);he!==!1&&Vr("setSelect")}}i.setSelect=Ll;function Ko(Q){if(x[Q].show)de&&BI(Ne[Q],em);else if(de&&fl(Ne[Q],em),se){let Se=vi?Yn[0]:Yn[Q];Se!=null&&Pu(Se,-10,-10,K,ce)}}function os(Q,he,Se){L(Q,{min:he,max:Se})}function Ei(Q,he,Se,Me){he.focus!=null&&Ze(Q),he.show!=null&&x.forEach((We,Ye)=>{Ye>0&&(Q==Ye||Q==null)&&(We.show=he.show,Ko(Ye),r==2?(os(We.facets[0].scale,null,null),os(We.facets[1].scale,null,null)):os(We.scale,null,null),js())}),Se!==!1&&Vr("setSeries",Q,he),Me&&Ah("setSeries",i,Q,he)}i.setSeries=Ei;function ep(Q,he){Ma(M[Q],he)}function xr(Q,he){Q.fill=Ii(Q.fill||null),Q.dir=Xi(Q.dir,-1),he=he??M.length,M.splice(he,0,Q)}function ls(Q){Q==null?M.length=0:M.splice(Q,1)}i.addBand=xr,i.setBand=ep,i.delBand=ls;function Nc(Q,he){x[Q].alpha=he,se&&Yn[Q]!=null&&(Yn[Q].style.opacity=he),de&&Ne[Q]&&(Ne[Q].style.opacity=he)}let Hs,le,ae;const Re={focus:!0};function Ze(Q){if(Q!=ae){let he=Q==null,Se=Jn.alpha!=1;x.forEach((Me,We)=>{if(r==1||We>0){let Ye=he||We==0||We==Q;Me._focus=he?null:Ye,Se&&Nc(We,Ye?1:Jn.alpha)}}),ae=Q,Se&&js()}}de&&ai&&Pe(_V,ue,Q=>{V._lock||(Gn(Q),ae!=null&&Ei(null,Re,!0,Lr.setSeries))});function pt(Q,he,Se){let Me=w[he];Se&&(Q=Q/Qi-(Me.ori==1?me:fe));let We=K;Me.ori==1&&(We=ce,Q=We-Q),Me.dir==-1&&(Q=We-Q);let Ye=Me._min,At=Me._max,Bt=Q/We,Gt=Ye+(At-Ye)*Bt,Qt=Me.distr;return Qt==3?dv(10,Gt):Qt==4?bPe(Gt,Me.asinh):Qt==100?Me.bwd(Gt):Gt}function Dt(Q,he){let Se=pt(Q,S,he);return Jc(Se,e[0],ee,ye)}i.valToIdx=Q=>Jc(Q,e[0]),i.posToIdx=Dt,i.posToVal=pt,i.valToPos=(Q,he,Se)=>w[he].ori==0?a(Q,w[he],Se?tt:K,Se?Ge:0):s(Q,w[he],Se?xt:ce,Se?Je:0),i.setCursor=(Q,he,Se)=>{An=Q.left,ni=Q.top,Hr(null,he,Se)};function jt(Q,he){Ur(Da,Db,fi.left=Q),Ur(Da,kx,fi.width=he)}function Mt(Q,he){Ur(Da,lx,fi.top=Q),Ur(Da,Dx,fi.height=he)}let Jt=N.ori==0?jt:Mt,yn=N.ori==1?jt:Mt;function kn(){if(de&&Z.live)for(let Q=r==2?1:0;Q<x.length;Q++){if(Q==0&&pe)continue;let he=Z.values[Q],Se=0;for(let Me in he)Ue[Q][Se++].firstChild.nodeValue=he[Me]}}function xi(Q,he){if(Q!=null&&(Q.idxs?Q.idxs.forEach((Se,Me)=>{Y[Me]=Se}):_Pe(Q.idx)||Y.fill(Q.idx),Z.idx=Y[0]),de&&Z.live){for(let Se=0;Se<x.length;Se++)(Se>0||r==1&&!pe)&&Nr(Se,Y[Se]);kn()}ht=!1,he!==!1&&Vr("setLegend")}i.setLegend=xi;function Nr(Q,he){let Se=x[Q],Me=Q==0&&U==2?De:e[Q],We;pe?We=Se.values(i,Q,he)??Fe:(We=Se.value(i,he==null?null:Me[he],Q,he),We=We==null?Fe:{_:We}),Z.values[Q]=We}function Hr(Q,he,Se){_n=An,Si=ni,[An,ni]=V.move(i,An,ni),V.left=An,V.top=ni,se&&(xe&&Pu(xe,Na(An),0,K,ce),Ke&&Pu(Ke,0,Na(ni),K,ce));let Me,We=ee>ye;Hs=_r,le=null;let Ye=N.ori==0?K:ce,At=N.ori==1?K:ce;if(An<0||kt==0||We){Me=V.idx=null;for(let Bt=0;Bt<x.length;Bt++){let Gt=Yn[Bt];Gt!=null&&Pu(Gt,-10,-10,K,ce)}ai&&Ei(null,Re,!0,Q==null&&Lr.setSeries),Z.live&&(Y.fill(Me),ht=!0)}else{let Bt,Gt,Qt;r==1&&(Bt=N.ori==0?An:ni,Gt=pt(Bt,S),Me=V.idx=Jc(Gt,e[0],ee,ye),Qt=j(e[0][Me],N,Ye,0));let Zt=-10,on=-10,Un=0,hi=0,Hn=!0,si="",Cn="";for(let vn=r==2?1:0;vn<x.length;vn++){let lr=x[vn],Mr=Y[vn],Zr=Mr==null?null:r==1?e[vn][Mr]:e[vn][1][Mr],Zi=V.dataIdx(i,vn,Me,Gt),Gr=Zi==null?null:r==1?e[vn][Zi]:e[vn][1][Zi];if(ht=ht||Gr!=Zr||Zi!=Mr,Y[vn]=Zi,vn>0&&lr.show){let Gs=Zi==null?-10:Zi==Me?Qt:j(r==1?e[0][Zi]:e[vn][0][Zi],N,Ye,0),Wa=Gr==null?-10:z(Gr,r==1?w[lr.scale]:w[lr.facets[1].scale],At,0);if(ai&&Gr!=null){let Wr=N.ori==1?An:ni,co=La(Jn.dist(i,vn,Zi,Wa,Wr));if(co<Hs){let Jo=Jn.bias;if(Jo!=0){let uo=pt(Wr,lr.scale),Ws=Gr>=0?1:-1,Tr=uo>=0?1:-1;Tr==Ws&&(Tr==1?Jo==1?Gr>=uo:Gr<=uo:Jo==1?Gr<=uo:Gr>=uo)&&(Hs=co,le=vn)}else Hs=co,le=vn}}if(ht||vi){let Wr,co;N.ori==0?(Wr=Gs,co=Wa):(Wr=Wa,co=Gs);let Jo,uo,Ws,Tr,$o,cr,qs=!0,hs=bn.bbox;if(hs!=null){qs=!1;let sa=hs(i,vn);Ws=sa.left,Tr=sa.top,Jo=sa.width,uo=sa.height}else Ws=Wr,Tr=co,Jo=uo=bn.size(i,vn);if(cr=bn.fill(i,vn),$o=bn.stroke(i,vn),vi)vn==le&&Hs<=Jn.prox&&(Zt=Ws,on=Tr,Un=Jo,hi=uo,Hn=qs,si=cr,Cn=$o);else{let sa=Yn[vn];sa!=null&&(Yi[vn]=Ws,ci[vn]=Tr,CV(sa,Jo,uo,qs),TV(sa,cr,$o),Pu(sa,nc(Ws),nc(Tr),K,ce))}}}}if(vi){let vn=Jn.prox,lr=ae==null?Hs<=vn:Hs>vn||le!=ae;if(ht||lr){let Mr=Yn[0];Mr!=null&&(Yi[0]=Zt,ci[0]=on,CV(Mr,Un,hi,Hn),TV(Mr,si,Cn),Pu(Mr,nc(Zt),nc(on),K,ce))}}}if(fi.show&&Er)if(Q!=null){let[Bt,Gt]=Lr.scales,[Qt,Zt]=Lr.match,[on,Un]=Q.cursor.sync.scales,hi=Q.cursor.drag;if(ji=hi._x,Pi=hi._y,ji||Pi){let{left:Hn,top:si,width:Cn,height:vn}=Q.select,lr=Q.scales[on].ori,Mr=Q.posToVal,Zr,Zi,Gr,Gs,Wa,Wr=Bt!=null&&Qt(Bt,on),co=Gt!=null&&Zt(Gt,Un);Wr&&ji?(lr==0?(Zr=Hn,Zi=Cn):(Zr=si,Zi=vn),Gr=w[Bt],Gs=j(Mr(Zr,on),Gr,Ye,0),Wa=j(Mr(Zr+Zi,on),Gr,Ye,0),Jt(ru(Gs,Wa),La(Wa-Gs))):Jt(0,Ye),co&&Pi?(lr==1?(Zr=Hn,Zi=Cn):(Zr=si,Zi=vn),Gr=w[Gt],Gs=z(Mr(Zr,Un),Gr,At,0),Wa=z(Mr(Zr+Zi,Un),Gr,At,0),yn(ru(Gs,Wa),La(Wa-Gs))):yn(0,At)}else us()}else{let Bt=La(_n-et),Gt=La(Si-Lt);if(N.ori==1){let Un=Bt;Bt=Gt,Gt=Un}ji=wi.x&&Bt>=wi.dist,Pi=wi.y&&Gt>=wi.dist;let Qt=wi.uni;Qt!=null?ji&&Pi&&(ji=Bt>=Qt,Pi=Gt>=Qt,!ji&&!Pi&&(Gt>Bt?Pi=!0:ji=!0)):wi.x&&wi.y&&(ji||Pi)&&(ji=Pi=!0);let Zt,on;ji&&(N.ori==0?(Zt=zt,on=An):(Zt=mn,on=ni),Jt(ru(Zt,on),La(on-Zt)),Pi||yn(0,At)),Pi&&(N.ori==1?(Zt=zt,on=An):(Zt=mn,on=ni),yn(ru(Zt,on),La(on-Zt)),ji||Jt(0,Ye)),!ji&&!Pi&&(Jt(0,0),yn(0,0))}if(wi._x=ji,wi._y=Pi,Q==null){if(Se){if(ay!=null){let[Bt,Gt]=Lr.scales;Lr.values[0]=Bt!=null?pt(N.ori==0?An:ni,Bt):null,Lr.values[1]=Gt!=null?pt(N.ori==1?An:ni,Gt):null}Ah(t8,i,An,ni,K,ce,Me)}if(ai){let Bt=Se&&Lr.setSeries,Gt=Jn.prox;ae==null?Hs<=Gt&&Ei(le,Re,!0,Bt):Hs>Gt?Ei(null,Re,!0,Bt):le!=ae&&Ei(le,Re,!0,Bt)}}ht&&(Z.idx=Me,xi()),he!==!1&&Vr("setCursor")}let $i=null;Object.defineProperty(i,"rect",{get(){return $i==null&&cs(!1),$i}});function cs(Q=!1){Q?$i=null:($i=g.getBoundingClientRect(),Vr("syncRect",$i))}function Ga(Q,he,Se,Me,We,Ye,At){V._lock||Er&&Q!=null&&Q.movementX==0&&Q.movementY==0||(Vs(Q,he,Se,Me,We,Ye,At,!1,Q!=null),Q!=null?Hr(null,!0,!0):Hr(he,!0,!1))}function Vs(Q,he,Se,Me,We,Ye,At,Bt,Gt){if($i==null&&cs(!1),Gn(Q),Q!=null)Se=Q.clientX-$i.left,Me=Q.clientY-$i.top;else{if(Se<0||Me<0){An=-10,ni=-10;return}let[Qt,Zt]=Lr.scales,on=he.cursor.sync,[Un,hi]=on.values,[Hn,si]=on.scales,[Cn,vn]=Lr.match,lr=he.axes[0].side%2==1,Mr=N.ori==0?K:ce,Zr=N.ori==1?K:ce,Zi=lr?Ye:We,Gr=lr?We:Ye,Gs=lr?Me:Se,Wa=lr?Se:Me;if(Hn!=null?Se=Cn(Qt,Hn)?o(Un,w[Qt],Mr,0):-10:Se=Mr*(Gs/Zi),si!=null?Me=vn(Zt,si)?o(hi,w[Zt],Zr,0):-10:Me=Zr*(Wa/Gr),N.ori==1){let Wr=Se;Se=Me,Me=Wr}}Gt&&(he==null||he.cursor.event.type==t8)&&((Se<=1||Se>=K-1)&&(Se=Kp(Se,K)),(Me<=1||Me>=ce-1)&&(Me=Kp(Me,ce))),Bt?(et=Se,Lt=Me,[zt,mn]=V.move(i,Se,Me)):(An=Se,ni=Me)}const gf={width:0,height:0,left:0,top:0};function us(){Ll(gf,!1)}let Yo,lo,bf,wu;function Lc(Q,he,Se,Me,We,Ye,At){Er=!0,ji=Pi=wi._x=wi._y=!1,Vs(Q,he,Se,Me,We,Ye,At,!0,!1),Q!=null&&(Pe(n8,UI,tp,!1),Ah(yV,i,zt,mn,K,ce,null));let{left:Bt,top:Gt,width:Qt,height:Zt}=fi;Yo=Bt,lo=Gt,bf=Qt,wu=Zt}function tp(Q,he,Se,Me,We,Ye,At){Er=wi._x=wi._y=!1,Vs(Q,he,Se,Me,We,Ye,At,!1,!0);let{left:Bt,top:Gt,width:Qt,height:Zt}=fi,on=Qt>0||Zt>0,Un=Yo!=Bt||lo!=Gt||bf!=Qt||wu!=Zt;if(on&&Un&&Ll(fi),wi.setScale&&on&&Un){let hi=Bt,Hn=Qt,si=Gt,Cn=Zt;if(N.ori==1&&(hi=Gt,Hn=Zt,si=Bt,Cn=Qt),ji&&os(S,pt(hi,S),pt(hi+Hn,S)),Pi)for(let vn in w){let lr=w[vn];vn!=S&&lr.from==null&&lr.min!=_r&&os(vn,pt(si+Cn,vn),pt(si,vn))}us()}else V.lock&&(V._lock=!V._lock,Hr(he,!0,Q!=null));Q!=null&&(He(n8,UI),Ah(n8,i,An,ni,K,ce,null))}function vf(Q,he,Se,Me,We,Ye,At){if(V._lock)return;Gn(Q);let Bt=Er;if(Er){let Gt=!0,Qt=!0,Zt=10,on,Un;N.ori==0?(on=ji,Un=Pi):(on=Pi,Un=ji),on&&Un&&(Gt=An<=Zt||An>=K-Zt,Qt=ni<=Zt||ni>=ce-Zt),on&&Gt&&(An=An<zt?0:K),Un&&Qt&&(ni=ni<mn?0:ce),Hr(null,!0,!0),Er=!1}An=-10,ni=-10,Y.fill(null),Hr(null,!0,!0),Bt&&(Er=Bt)}function Oa(Q,he,Se,Me,We,Ye,At){V._lock||(Gn(Q),lt(),us(),Q!=null&&Ah(SV,i,An,ni,K,ce,null))}function np(){_.forEach(UUe),Ft(i.width,i.height,!0)}Om(yT,M0,np);const yf={};yf.mousedown=Lc,yf.mousemove=Ga,yf.mouseup=tp,yf.dblclick=Oa,yf.setSeries=(Q,he,Se,Me)=>{let We=Lr.match[2];Se=We(i,he,Se),Se!=-1&&Ei(Se,Me,!0,!1)},se&&(Pe(yV,g,Lc),Pe(t8,g,Ga),Pe(xV,g,Q=>{Gn(Q),cs(!1)}),Pe(_V,g,vf),Pe(SV,g,Oa),WI.add(i),i.syncRect=cs);const Th=i.hooks=t.hooks||{};function Vr(Q,he,Se){Va?xa.push([Q,he,Se]):Q in Th&&Th[Q].forEach(Me=>{Me.call(null,i,he,Se)})}(t.plugins||[]).forEach(Q=>{for(let he in Q.hooks)Th[he]=(Th[he]||[]).concat(Q.hooks[he])});const pg=(Q,he,Se)=>Se,Lr=Ma({key:null,setSeries:!1,filters:{pub:IV,sub:IV},scales:[S,x[1]?x[1].scale:null],match:[NV,NV,pg],values:[null,null]},V.sync);Lr.match.length==2&&Lr.match.push(pg),V.sync=Lr;const ay=Lr.key,fs=ute(ay);function Ah(Q,he,Se,Me,We,Ye,At){Lr.filters.pub(Q,he,Se,Me,We,Ye,At)&&fs.pub(Q,he,Se,Me,We,Ye,At)}fs.sub(i);function sy(Q,he,Se,Me,We,Ye,At){Lr.filters.sub(Q,he,Se,Me,We,Ye,At)&&yf[Q](null,he,Se,Me,We,Ye,At)}i.pub=sy;function cS(){fs.unsub(i),WI.delete(i),Ae.clear(),zI(yT,M0,np),c.remove(),ue?.remove(),Vr("destroy")}i.destroy=cS;function mg(){Vr("init",t,e),_t(e||t.data,!1),q[S]?L(S,q[S]):lt(),Ve=fi.show&&(fi.width>0||fi.height>0),Oe=ht=!0,Ft(t.width,t.height)}return x.forEach(ui),_.forEach(je),n?n instanceof HTMLElement?(n.appendChild(c),mg()):n(i,mg):mg(),i}ro.assign=Ma;ro.fmtNum=l4;ro.rangeNum=xT;ro.rangeLog=NC;ro.rangeAsinh=s4;ro.orient=hg;ro.pxRatio=Qi;ro.join=CPe;ro.fmtDate=u4,ro.tzDate=BPe;ro.sync=ute;{ro.addGap=_Ue,ro.clipGaps=UC;let t=ro.paths={points:gte};t.linear=vte,t.stepped=EUe,t.bars=MUe,t.spline=AUe}const FUe=Object.freeze(Object.defineProperty({__proto__:null,default:ro},Symbol.toStringTag,{value:"Module"})),BUe=vre(FUe);(function(t,e){(function(i,r){t.exports=r(I,BUe)})(Nm,(n,i)=>(()=>{var r={"./common/index.ts":(l,c,u)=>{u.r(c),u.d(c,{dataMatch:()=>d,optionsUpdateState:()=>h});var f=function(g,b){var y={};for(var p in g)Object.prototype.hasOwnProperty.call(g,p)&&b.indexOf(p)<0&&(y[p]=g[p]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,p=Object.getOwnPropertySymbols(g);x<p.length;x++)b.indexOf(p[x])<0&&Object.prototype.propertyIsEnumerable.call(g,p[x])&&(y[p[x]]=g[p[x]]);return y};Object.is||Object.defineProperty(Object,"is",{value:function(b,y){return b===y&&(b!==0||1/b===1/y)||b!==b&&y!==y}});var h=function(b,y){var p=b.width,x=b.height,_=f(b,["width","height"]),w=y.width,M=y.height,S=f(y,["width","height"]),A="keep";if((x!==M||p!==w)&&(A="update"),Object.keys(_).length!==Object.keys(S).length)return"create";for(var C=0,D=Object.keys(_);C<D.length;C++){var R=D[C];if(!Object.is(_[R],S[R])){A="create";break}}return A},d=function(b,y){return b.length!==y.length?!1:b.every(function(p,x){var _=y[x];return p.length!==_.length?!1:p.every(function(w,M){return w===_[M]})})}},react:l=>{l.exports=n},uplot:l=>{l.exports=i}},a={};function s(l){var c=a[l];if(c!==void 0)return c.exports;var u=a[l]={exports:{}};return r[l](u,u.exports,s),u.exports}s.n=l=>{var c=l&&l.__esModule?()=>l.default:()=>l;return s.d(c,{a:c}),c},s.d=(l,c)=>{for(var u in c)s.o(c,u)&&!s.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:c[u]})},s.o=(l,c)=>Object.prototype.hasOwnProperty.call(l,c),s.r=l=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var o={};return(()=>{/*!*******************************!*\
  !*** ./react/uplot-react.tsx ***!
  \*******************************/s.r(o),s.d(o,{default:()=>d});var l=s("react"),c=s.n(l),u=s("uplot"),f=s.n(u),h=s("./common/index.ts");function d(g){var b=g.options,y=g.data,p=g.target,x=g.onDelete,_=g.onCreate,w=g.resetScales,M=w===void 0?!0:w,S=g.className,A=(0,l.useRef)(null),C=(0,l.useRef)(null),D=(0,l.useRef)(b),R=(0,l.useRef)(p),N=(0,l.useRef)(y),U=(0,l.useRef)(_),j=(0,l.useRef)(x);(0,l.useEffect)(function(){U.current=_,j.current=x});var z=(0,l.useCallback)(function(B){var G;B&&((G=j.current)===null||G===void 0||G.call(j,B),B.destroy(),A.current=null)},[]),q=(0,l.useCallback)(function(){var B,G=new(f())(D.current,N.current,R.current||C.current);A.current=G,(B=U.current)===null||B===void 0||B.call(U,G)},[]);return(0,l.useEffect)(function(){return q(),function(){z(A.current)}},[q,z]),(0,l.useEffect)(function(){if(D.current!==b){var B=(0,h.optionsUpdateState)(D.current,b);D.current=b,!A.current||B==="create"?(z(A.current),q()):B==="update"&&A.current.setSize({width:b.width,height:b.height})}},[b,q,z]),(0,l.useEffect)(function(){N.current!==y&&(A.current?(0,h.dataMatch)(N.current,y)||(M?A.current.setData(y,!0):(A.current.setData(y,!1),A.current.redraw())):(N.current=y,q()),N.current=y)},[y,M,q]),(0,l.useEffect)(function(){return R.current!==p&&(R.current=p,q()),function(){return z(A.current)}},[p,q,z]),p?null:c().createElement("div",{ref:C,className:S})}})(),o=o.default,o})())})(Lee);var zUe=Lee.exports;const jUe=Mc(zUe);function nG({props:t,onExpand:e}){const[n,i]=I.useState(!1),{ref:r,width:a}=sX(),s=va(),{colorScheme:o}=ig(),[l,c,u]=I.useMemo(()=>{const b=t.data.map(x=>new Float64Array(x.buffer.slice(x.byteOffset,x.byteOffset+x.byteLength)));let y=1/0,p=-1/0;for(const x of b[0])x<y&&(y=x),x>p&&(p=x);return[b,y,p]},[t.data]),f=I.useMemo(()=>{const b=o==="dark"?s.colors.gray[5]:s.colors.gray[7],y=o==="dark"?"rgba(255, 255, 255, 0.03)":s.colors.gray[2];let p=t.axes;return p==null?p=[{stroke:b,grid:{stroke:y,show:!0}},{stroke:b,grid:{stroke:y,show:!0}}]:p=p.map(x=>{if(x==null)return x;const _={...x};return _.stroke===void 0&&(_.stroke=b),_.grid===void 0?_.grid={stroke:y}:_.grid!==null&&_.grid.stroke===void 0&&(_.grid={..._.grid,stroke:y}),_.ticks===void 0?_.ticks={stroke:b}:_.ticks!==null&&_.ticks.stroke===void 0&&(_.ticks={..._.ticks,stroke:b}),_}),{width:a,height:a/t.aspect,title:t.title||void 0,mode:t.mode||void 0,series:t.series||[],cursor:t.cursor||void 0,bands:t.bands||void 0,scales:t.scales||void 0,axes:p,legend:t.legend||void 0,focus:t.focus||void 0,padding:[0,24,0,0]}},[a,t.aspect,t.title,t.mode,t.series,t.cursor,t.bands,t.scales,t.axes,t.legend,t.focus,o]),[h,d]=I.useState(),g=I.useRef({relMin:0,relMax:1});return I.useEffect(()=>{if(!h)return;const b=Object.keys(h.scales)[0],y=h.scales[b];if(y.auto===!1)return;const p=u-c;if(p!==0)return h.setScale(b,{min:c+g.current.relMin*p,max:c+g.current.relMax*p}),()=>{g.current={relMin:((y.min??0)-c)/p,relMax:((y.max??1)-c)/p}}},[c,u,h]),k.jsxs(Ns,{ref:r,className:`${n4} uplot-container`,withBorder:!0,style:{position:"relative"},onMouseEnter:e?()=>i(!0):void 0,onMouseLeave:e?()=>i(!1):void 0,children:[f&&k.jsx(jUe,{resetScales:!1,onCreate:b=>{d(b)},onDelete:()=>{d(void 0)},options:f,data:l},o),e&&n&&k.jsx(Or,{label:"Expand plot",children:k.jsx(Dl,{onClick:e,variant:"subtle",color:"gray",size:"sm",style:{position:"absolute",top:8,right:8,backgroundColor:o==="dark"?"rgba(255, 255, 255, 0.1)":"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(4px)"},children:k.jsx(cQ,{size:14})})})]})}function HUe(t){const[e,{open:n,close:i}]=_c(!1);return t.props.visible===!1?null:k.jsxs(ut,{children:[k.jsx(nG,{...t,onExpand:n}),k.jsx(Co,{opened:e,onClose:i,size:"xl",children:k.jsx(nG,{...t})})]})}function VUe({props:{_tab_labels:t,_tab_icons_html:e,_tab_container_ids:n,visible:i}}){const{GuiContainer:r}=I.useContext(Ls);return i?k.jsxs(Kf,{radius:"xs",defaultValue:"0",style:{marginTop:"-0.55em"},children:[k.jsx(Kf.List,{children:t.map((a,s)=>k.jsx(Kf.Tab,{value:s.toString(),styles:{tabSection:{marginRight:"0.5em"},tab:{padding:"0.75em"}},leftSection:e[s]===null?void 0:k.jsx("div",{className:UU,dangerouslySetInnerHTML:{__html:e[s]}}),children:a},s))}),n.map((a,s)=>k.jsx(Kf.Panel,{value:s.toString(),children:k.jsx(r,{containerUuid:a})},a))]}):null}function GUe({uuid:t,props:{label:e,visible:n,expand_by_default:i},nextGuiUuid:r}){const a=I.useContext(bi),[s,{toggle:o}]=_c(i),l=a.useGui(d=>d.guiUuidSetFromContainerUuid[t],aQ),c=I.useContext(Ls),u=l===void 0||Object.keys(l).length===0,f=a.useGui(d=>r==null?null:d.guiConfigFromUuid[r]?.type),h=s?sAe:eAe;return n?k.jsxs(Ns,{withBorder:!0,className:n4,mb:f==="GuiFolderMessage"?"md":void 0,children:[k.jsxs(Ns,{className:zLe,style:{cursor:u?void 0:"pointer"},onClick:o,children:[e,k.jsx(h,{className:jLe,style:{display:u?"none":void 0}})]}),k.jsx(hh,{in:s&&!u,children:k.jsx(ut,{pt:"0.2em",children:k.jsx(Ls.Provider,{value:{...c,folderDepth:c.folderDepth+1},children:k.jsx(c.GuiContainer,{containerUuid:t})})})}),k.jsx(hh,{in:!(s&&!u),children:k.jsx(ut,{p:"xs"})})]}):null}function WUe(t,e,n){return Math.max(e,Math.min(n,t))}function qUe({min:t,max:e,step:n=1,value:i,onChange:r,marks:a,fixedEndpoints:s=!1,minRange:o,precision:l=2,id:c,className:u,disabled:f=!1,pt:h,pb:d}){const[g,b]=I.useState(null),y=I.useRef(null),p=va(),{colorScheme:x}=ig(),_=D=>(D-t)/(e-t)*100,w=D=>{if(!y.current)return 0;const R=y.current.getBoundingClientRect(),U=(D-R.left)/R.width*(e-t)+t;return n?Math.round(U/n)*n:parseFloat(U.toFixed(l))},M=D=>{if(i.length===0)return-1;let R=1/0,N=0;return i.forEach((U,j)=>{const z=Math.abs(U-D);z<R&&(R=z,N=j)}),N},S=I.useCallback((D,R)=>{const N=[...i];N[R]=WUe(D,t,e);const U=o||n;R<N.length-1&&N[R]>N[R+1]-U&&(N[R]=N[R+1]-U),R>0&&N[R]<N[R-1]+U&&(N[R]=N[R-1]+U),!(s&&(R===0||R===N.length-1))&&r(N)},[i,r,t,e,n,o,s]),A=D=>{if(f||i.length===0)return;const R=w(D.clientX),N=M(R);if(N===-1)return;b(N);const U=z=>{const q=w(z.clientX);S(q,N)},j=()=>{b(null),document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j)};document.addEventListener("mousemove",U),document.addEventListener("mouseup",j)},C=(D,R)=>{if(D.stopPropagation(),f||i.length===0||R>=i.length)return;b(R);const N=j=>{const z=w(j.clientX);S(z,R)},U=()=>{b(null),document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",U)};document.addEventListener("mousemove",N),document.addEventListener("mouseup",U)};return k.jsx(ut,{id:c,className:`multi-slider ${u||""} ${f?"disabled":""}`,pt:h,pb:d,children:k.jsxs("div",{ref:y,className:"multi-slider-track-container",onMouseDown:A,children:[k.jsx("div",{className:"multi-slider-track"}),i.map((D,R)=>k.jsx(Or,{label:D.toFixed(l),opened:g===R,position:"top",offset:10,transitionProps:{transition:"fade",duration:0},withinPortal:!0,children:k.jsx("div",{className:`multi-slider-thumb ${g===R?"active":""}`,style:{left:`${_(D)}%`,backgroundColor:f?void 0:p.colors[p.primaryColor][x==="dark"?5:6]},onMouseDown:N=>C(N,R)})},`thumb-${R}`)),a&&a.map((D,R)=>k.jsxs("div",{className:"multi-slider-mark-wrapper",style:{left:`${_(D.value)}%`},children:[k.jsx("div",{className:"multi-slider-mark"}),D.label&&D.label!==null&&k.jsx("div",{className:"multi-slider-mark-label",children:D.label})]},`mark-${R}`))]})})}function XUe({uuid:t,value:e,props:{label:n,hint:i,visible:r,disabled:a,min:s,max:o,precision:l,step:c,_marks:u,fixed_endpoints:f,min_range:h}}){const{setValue:d}=Ee.useContext(Ls);if(!r)return null;const g=y=>d(t,y),b=k.jsx(ut,{px:"0.1em",children:k.jsx(qUe,{id:t,className:u===null?sQ:void 0,min:s,max:o,step:c??void 0,fixedEndpoints:f,precision:l,minRange:h??void 0,marks:u===null?[{value:s,label:`${s.toFixed(6).replace(/\.?0+$/,"")}`},{value:o,label:`${o.toFixed(6).replace(/\.?0+$/,"")}`}]:u,value:e,onChange:g,disabled:a})});return k.jsx(Su,{uuid:t,hint:i,label:n,children:b})}function KUe({uuid:t,props:{disabled:e,mime_type:n,color:i,_icon_html:r,label:a}}){const s=I.useContext(bi),o=Ee.useRef(null),{isUploading:l,upload:c}=YUe({viewer:s,componentUuid:t});return k.jsxs(ut,{mx:"xs",mb:"0.5em",children:[k.jsx("input",{type:"file",style:{display:"none"},id:`file_upload_${t}`,name:"file",accept:n,ref:o,onChange:u=>{const f=u.target;f.files&&c(f.files[0])}}),k.jsx(As,{id:t,fullWidth:!0,color:MC(i),onClick:()=>{o.current!==null&&(o.current.value=o.current.defaultValue,o.current.click())},style:{height:"2em"},disabled:e||l,size:"sm",leftSection:r===null?void 0:k.jsx("div",{className:UU,dangerouslySetInnerHTML:{__html:r}}),children:a})]})}function YUe({viewer:t,componentUuid:e}){const n=t.useGui(l=>l.updateUploadState),i=t.useGui(l=>l.uploadsInProgress[e]),r=i?.totalBytes,a=Ee.useMemo(()=>{if(r===void 0)return"";let l=r;const c=["B","K","M","G","T","P"];let u=0;for(;l>=100&&u<c.length-1;)l/=1024,u+=1;return`${l.toFixed(1)}${c[u]}`},[r]);Ee.useEffect(()=>{if(i===void 0)return;const{notificationId:l,filename:c}=i;if(i.uploadedBytes===0)ks.show({id:l,title:`Uploading ${c} (${a})`,message:k.jsx(af,{size:"sm",value:0}),autoClose:!1,withCloseButton:!1,loading:!0});else{const u=i.uploadedBytes/i.totalBytes,f=u===1;ks.update({id:l,title:`Uploading ${c} (${a})`,message:f?"File uploaded successfully.":k.jsx(af,{size:"sm",transitionDuration:10,value:100*u}),autoClose:f,withCloseButton:f,loading:!f,icon:f?k.jsx(FU,{}):void 0})}},[i,a]);const s=i!==void 0&&i.uploadedBytes<i.totalBytes;async function o(l){const c=t.mutable.current,u=512*1024,f=Math.ceil(l.size/u),h=rQ(),d="upload-"+h;n({componentId:e,uploadedBytes:0,totalBytes:l.size,filename:l.name,notificationId:d}),c.sendMessage({type:"FileTransferStartUpload",source_component_uuid:e,transfer_uuid:h,filename:l.name,mime_type:l.type,size_bytes:l.size,part_count:f});for(let g=0;g<f;g++){const b=g*u,y=(g+1)*u,x=await l.slice(b,y).arrayBuffer();c.sendMessage({type:"FileTransferPart",source_component_uuid:e,transfer_uuid:h,part_index:g,content:new Uint8Array(x)})}}return{isUploading:s,upload:o}}function JUe({value:t,props:{visible:e,color:n,animated:i}}){return e?k.jsx(ut,{pb:"xs",px:"xs",children:k.jsx(af,{radius:"xs",color:MC(n),value:t,animated:i,transitionDuration:0})}):null}function $Ue({props:t}){if(!t.visible)return null;const[e,n]=I.useState(null);return I.useEffect(()=>{if(t._data===null)n(null);else{const i=URL.createObjectURL(new Blob([t._data],{type:"image/"+t._format}));return n(i),()=>{URL.revokeObjectURL(i)}}},[t._data,t._format]),e===null?null:k.jsxs(ut,{px:"xs",children:[t.label===null?null:k.jsx(hu,{fz:"sm",style:{display:"block"},children:t.label}),k.jsx("img",{src:e,style:{maxWidth:"100%",height:"auto"}})]})}function ZUe({props:t}){return t.visible?k.jsx("div",{dangerouslySetInnerHTML:{__html:t.content}}):null}function b4({containerUuid:t}){const n=Ee.useContext(bi).useGui(a=>a.updateGuiProps),i=EC(50).send;function r(a,s){n(a,{value:s}),i({type:"GuiUpdateMessage",uuid:a,updates:{value:s}})}return k.jsx(Ls.Provider,{value:{folderDepth:0,GuiContainer:iG,messageSender:i,setValue:r},children:k.jsx(iG,{containerUuid:t})})}function iG({containerUuid:t}){const e=Ee.useContext(bi);e.useGui.getState().guiUuidSetFromContainerUuid[t]===void 0&&e.useGui.setState({...e.useGui.getState(),guiUuidSetFromContainerUuid:{...e.useGui.getState().guiUuidSetFromContainerUuid,[t]:{}}});const n=e.useGui(o=>o.guiUuidSetFromContainerUuid[t],aQ),i=[...Object.keys(n)],r=e.useGui(o=>o.guiOrderFromUuid);let a=i.map(o=>({uuid:o,order:r[o]}));return a=a.sort((o,l)=>o.order-l.order),k.jsx(ut,{pt:"xs",children:a.map((o,l)=>k.jsx(QUe,{guiUuid:o.uuid,nextGuiUuid:a[l+1]?.uuid??null},o.uuid))})}function QUe(t){const n=Ee.useContext(bi).useGui(i=>i.guiConfigFromUuid[t.guiUuid]);if(n===void 0)return console.error("Tried to render non-existent component",t.guiUuid),null;switch(n.type){case"GuiFolderMessage":return k.jsx(GUe,{...n,nextGuiUuid:t.nextGuiUuid});case"GuiTabGroupMessage":return k.jsx(VUe,{...n});case"GuiMarkdownMessage":return k.jsx(BLe,{...n});case"GuiHtmlMessage":return k.jsx(ZUe,{...n});case"GuiPlotlyMessage":return k.jsx(HLe,{...n});case"GuiUplotMessage":return k.jsx(HUe,{...n});case"GuiImageMessage":return k.jsx($Ue,{...n});case"GuiButtonMessage":return k.jsx(OTe,{...n});case"GuiUploadButtonMessage":return k.jsx(KUe,{...n});case"GuiSliderMessage":return k.jsx(NTe,{...n});case"GuiMultiSliderMessage":return k.jsx(XUe,{...n});case"GuiNumberMessage":return k.jsx(LTe,{...n});case"GuiTextMessage":return k.jsx(PTe,{...n});case"GuiCheckboxMessage":return k.jsx(UTe,{...n});case"GuiVector2Message":return k.jsx(FTe,{...n});case"GuiVector3Message":return k.jsx(BTe,{...n});case"GuiDropdownMessage":return k.jsx(zTe,{...n});case"GuiRgbMessage":return k.jsx(YAe,{...n});case"GuiRgbaMessage":return k.jsx(JAe,{...n});case"GuiButtonGroupMessage":return k.jsx($Ae,{...n});case"GuiProgressBarMessage":return k.jsx(JUe,{...n});default:e4e(n)}}function e4e(t){throw new Error("Unexpected object: "+t.type)}const t4e=I.forwardRef(function({points:e,color:n=16777215,vertexColors:i,linewidth:r,lineWidth:a,segments:s,dashed:o,...l},c){const u=Ri(b=>b.size),f=I.useMemo(()=>s?new TU:new CZ,[s]),[h]=I.useState(()=>new xC),d=3,g=I.useMemo(()=>{const b=s?new yC:new MU;if(b.setPositions(e),i){const y=new Float32Array(i).map(p=>p/255);n=16777215,b.setColors(y,d)}return b},[e,s,i,d]);return I.useLayoutEffect(()=>{f.computeLineDistances()},[e,f]),I.useLayoutEffect(()=>{o?h.defines.USE_DASH="":delete h.defines.USE_DASH,h.needsUpdate=!0},[o,h]),I.useEffect(()=>()=>{g.dispose(),h.dispose()},[g]),k.jsxs("primitive",{object:f,ref:c,...l,children:[k.jsx("primitive",{object:g,attach:"geometry"}),k.jsx("primitive",{object:h,attach:"material",color:n,vertexColors:!!i,resolution:[u.width,u.height],linewidth:r??a??1,dashed:o,transparent:!1,...l})]})}),n4e=I.forwardRef(function({props:e,children:n},i){const r=I.useMemo(()=>new Float32Array(e.points.buffer.slice(e.points.byteOffset,e.points.byteOffset+e.points.byteLength)),[e.points]),a=I.useMemo(()=>new Uint8Array(e.colors.buffer.slice(e.colors.byteOffset,e.colors.byteOffset+e.colors.byteLength)),[e.colors]),{color:s,vertexColors:o}=I.useMemo(()=>a.length===3?{color:a[0]<<16|a[1]<<8|a[2],vertexColors:void 0}:{color:void 0,vertexColors:a},[a]);return k.jsxs("group",{ref:i,children:[k.jsx(t4e,{points:r,lineWidth:e.line_width,color:s,vertexColors:o,segments:!0}),n]})}),rG={"shadow-camera-near":.001,"shadow-camera-far":500,"shadow-bias":-1e-5,"shadow-mapSize-width":1024,"shadow-mapSize-height":1024,"shadow-radius":4},o8=new Ot;class jC{constructor(e){e=e||{},this.zNear=e.webGL===!0?-1:0,this.vertices={near:[new te,new te,new te,new te],far:[new te,new te,new te,new te]},e.projectionMatrix!==void 0&&this.setFromProjectionMatrix(e.projectionMatrix,e.maxFar||1e4)}setFromProjectionMatrix(e,n){const i=this.zNear,r=e.elements[2*4+3]===0;return o8.copy(e).invert(),this.vertices.near[0].set(1,1,i),this.vertices.near[1].set(1,-1,i),this.vertices.near[2].set(-1,-1,i),this.vertices.near[3].set(-1,1,i),this.vertices.near.forEach(function(a){a.applyMatrix4(o8)}),this.vertices.far[0].set(1,1,1),this.vertices.far[1].set(1,-1,1),this.vertices.far[2].set(-1,-1,1),this.vertices.far[3].set(-1,1,1),this.vertices.far.forEach(function(a){a.applyMatrix4(o8);const s=Math.abs(a.z);r?a.z*=Math.min(n/s,1):a.multiplyScalar(Math.min(n/s,1))}),this.vertices}split(e,n){for(;e.length>n.length;)n.push(new jC);n.length=e.length;for(let i=0;i<e.length;i++){const r=n[i];if(i===0)for(let a=0;a<4;a++)r.vertices.near[a].copy(this.vertices.near[a]);else for(let a=0;a<4;a++)r.vertices.near[a].lerpVectors(this.vertices.near[a],this.vertices.far[a],e[i-1]);if(i===e.length-1)for(let a=0;a<4;a++)r.vertices.far[a].copy(this.vertices.far[a]);else for(let a=0;a<4;a++)r.vertices.far[a].lerpVectors(this.vertices.near[a],this.vertices.far[a],e[i])}}toSpace(e,n){for(let i=0;i<4;i++)n.vertices.near[i].copy(this.vertices.near[i]).applyMatrix4(e),n.vertices.far[i].copy(this.vertices.far[i]).applyMatrix4(e)}}const aG={lights_fragment_begin:`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );

vec3 geometryClearcoatNormal = vec3( 0.0 );

#ifdef USE_CLEARCOAT

	geometryClearcoatNormal = clearcoatNormal;

#endif

#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometryViewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		// Iridescence F0 approximation
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif

IncidentLight directLight;

#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )

	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif

	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {

		pointLight = pointLights[ i ];

		getPointLightInfo( pointLight, geometryPosition, directLight );

		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;

		#endif

		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	}
	#pragma unroll_loop_end

#endif

#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )

	SpotLight spotLight;
 	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;

	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif

	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {

		spotLight = spotLights[ i ];

		getSpotLightInfo( spotLight, geometryPosition, directLight );

  		// spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX

		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;

		#endif

		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	}
	#pragma unroll_loop_end

#endif

#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && defined( USE_CSM ) && defined( CSM_CASCADES )

	DirectionalLight directionalLight;
	float linearDepth = (vViewPosition.z) / (shadowFar - cameraNear);
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif

	#if defined( USE_SHADOWMAP ) && defined( CSM_FADE )
		vec2 cascade;
		float cascadeCenter;
		float closestEdge;
		float margin;
		float csmx;
		float csmy;

		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {

			directionalLight = directionalLights[ i ];
			getDirectionalLightInfo( directionalLight, directLight );

			#if ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
				// NOTE: Depth gets larger away from the camera.
				// cascade.x is closer, cascade.y is further
				cascade = CSM_cascades[ i ];
				cascadeCenter = ( cascade.x + cascade.y ) / 2.0;
				closestEdge = linearDepth < cascadeCenter ? cascade.x : cascade.y;
				margin = 0.25 * pow( closestEdge, 2.0 );
				csmx = cascade.x - margin / 2.0;
				csmy = cascade.y + margin / 2.0;
				if( linearDepth >= csmx && ( linearDepth < csmy || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 ) ) {

					float dist = min( linearDepth - csmx, csmy - linearDepth );
					float ratio = clamp( dist / margin, 0.0, 1.0 );

					vec3 prevColor = directLight.color;
					directionalLightShadow = directionalLightShadows[ i ];
					directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;

					bool shouldFadeLastCascade = UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth > cascadeCenter;
					directLight.color = mix( prevColor, directLight.color, shouldFadeLastCascade ? ratio : 1.0 );

					ReflectedLight prevLight = reflectedLight;
					RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

					bool shouldBlend = UNROLLED_LOOP_INDEX != CSM_CASCADES - 1 || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1 && linearDepth < cascadeCenter;
					float blendRatio = shouldBlend ? ratio : 1.0;

					reflectedLight.directDiffuse = mix( prevLight.directDiffuse, reflectedLight.directDiffuse, blendRatio );
					reflectedLight.directSpecular = mix( prevLight.directSpecular, reflectedLight.directSpecular, blendRatio );
					reflectedLight.indirectDiffuse = mix( prevLight.indirectDiffuse, reflectedLight.indirectDiffuse, blendRatio );
					reflectedLight.indirectSpecular = mix( prevLight.indirectSpecular, reflectedLight.indirectSpecular, blendRatio );

				}
			#endif

		}
		#pragma unroll_loop_end
	#elif defined (USE_SHADOWMAP)

		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {

			directionalLight = directionalLights[ i ];
			getDirectionalLightInfo( directionalLight, directLight );

			#if ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )

				directionalLightShadow = directionalLightShadows[ i ];
				if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y) directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;

				if(linearDepth >= CSM_cascades[UNROLLED_LOOP_INDEX].x && (linearDepth < CSM_cascades[UNROLLED_LOOP_INDEX].y || UNROLLED_LOOP_INDEX == CSM_CASCADES - 1)) RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

			#endif

		}
		#pragma unroll_loop_end

	#elif ( NUM_DIR_LIGHT_SHADOWS > 0 )
		// note: no loop here - all CSM lights are in fact one light only
		getDirectionalLightInfo( directionalLights[0], directLight );
		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	#endif

	#if ( NUM_DIR_LIGHTS > NUM_DIR_LIGHT_SHADOWS)
		// compute the lights not casting shadows (if any)

		#pragma unroll_loop_start
		for ( int i = NUM_DIR_LIGHT_SHADOWS; i < NUM_DIR_LIGHTS; i ++ ) {

			directionalLight = directionalLights[ i ];

			getDirectionalLightInfo( directionalLight, directLight );

			RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

		}
		#pragma unroll_loop_end

	#endif

#endif


#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) && !defined( USE_CSM ) && !defined( CSM_CASCADES )

	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif

	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {

		directionalLight = directionalLights[ i ];

		getDirectionalLightInfo( directionalLight, directLight );

		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif

		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	}
	#pragma unroll_loop_end

#endif

#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )

	RectAreaLight rectAreaLight;

	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {

		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );

	}
	#pragma unroll_loop_end

#endif

#if defined( RE_IndirectDiffuse )

	vec3 iblIrradiance = vec3( 0.0 );

	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );

	#if defined( USE_LIGHT_PROBES )

		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );

	#endif

	#if ( NUM_HEMI_LIGHTS > 0 )

		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {

			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );

		}
		#pragma unroll_loop_end

	#endif

#endif

#if defined( RE_IndirectSpecular )

	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );

#endif
`,lights_pars_begin:`
#if defined( USE_CSM ) && defined( CSM_CASCADES )
uniform vec2 CSM_cascades[CSM_CASCADES];
uniform float cameraNear;
uniform float shadowFar;
#endif
	`+ln.lights_pars_begin},sG=new Ot,l8=new jC({webGL:!0}),Uf=new te,ux=new rr,c8=[],u8=[],f8=new Ot,oG=new Ot,i4e=new te(0,1,0);class r4e{constructor(e){this.camera=e.camera,this.parent=e.parent,this.cascades=e.cascades||3,this.maxFar=e.maxFar||1e5,this.mode=e.mode||"practical",this.shadowMapSize=e.shadowMapSize||2048,this.shadowBias=e.shadowBias||1e-6,this.lightDirection=e.lightDirection||new te(1,-1,1).normalize(),this.lightIntensity=e.lightIntensity||3,this.lightNear=e.lightNear||1,this.lightFar=e.lightFar||2e3,this.lightMargin=e.lightMargin||200,this.customSplitsCallback=e.customSplitsCallback,this.fade=!1,this.mainFrustum=new jC({webGL:!0}),this.frustums=[],this.breaks=[],this.lights=[],this.shaders=new Map,this._createLights(),this.updateFrustums(),this._injectInclude()}_createLights(){for(let e=0;e<this.cascades;e++){const n=new dC(16777215,this.lightIntensity);n.castShadow=!0,n.shadow.mapSize.width=this.shadowMapSize,n.shadow.mapSize.height=this.shadowMapSize,n.shadow.camera.near=this.lightNear,n.shadow.camera.far=this.lightFar,n.shadow.bias=this.shadowBias,this.parent.add(n),this.parent.add(n.target),this.lights.push(n)}}_initCascades(){const e=this.camera;e.updateProjectionMatrix(),this.mainFrustum.setFromProjectionMatrix(e.projectionMatrix,this.maxFar),this.mainFrustum.split(this.breaks,this.frustums)}_updateShadowBounds(){const e=this.frustums;for(let n=0;n<e.length;n++){const r=this.lights[n].shadow.camera,a=this.frustums[n],s=a.vertices.near,o=a.vertices.far,l=o[0];let c;l.distanceTo(o[2])>l.distanceTo(s[2])?c=o[2]:c=s[2];let u=l.distanceTo(c);if(this.fade){const f=this.camera,h=Math.max(f.far,this.maxFar),d=a.vertices.far[0].z/(h-f.near),g=.25*Math.pow(d,2)*(h-f.near);u+=g}r.left=-u/2,r.right=u/2,r.top=u/2,r.bottom=-u/2,r.updateProjectionMatrix()}}_getBreaks(){const e=this.camera,n=Math.min(e.far,this.maxFar);switch(this.breaks.length=0,this.mode){case"uniform":i(this.cascades,e.near,n,this.breaks);break;case"logarithmic":r(this.cascades,e.near,n,this.breaks);break;case"practical":a(this.cascades,e.near,n,.5,this.breaks);break;case"custom":this.customSplitsCallback===void 0&&console.error("CSM: Custom split scheme callback not defined."),this.customSplitsCallback(this.cascades,e.near,n,this.breaks);break}function i(s,o,l,c){for(let u=1;u<s;u++)c.push((o+(l-o)*u/s)/l);c.push(1)}function r(s,o,l,c){for(let u=1;u<s;u++)c.push(o*(l/o)**(u/s)/l);c.push(1)}function a(s,o,l,c,u){c8.length=0,u8.length=0,r(s,o,l,u8),i(s,o,l,c8);for(let f=1;f<s;f++)u.push(gc.lerp(c8[f-1],u8[f-1],c));u.push(1)}}update(){const e=this.camera,n=this.frustums;f8.lookAt(new te,this.lightDirection,i4e),oG.copy(f8).invert();for(let i=0;i<n.length;i++){const r=this.lights[i],a=r.shadow.camera,s=(a.right-a.left)/this.shadowMapSize,o=(a.top-a.bottom)/this.shadowMapSize;sG.multiplyMatrices(oG,e.matrixWorld),n[i].toSpace(sG,l8);const l=l8.vertices.near,c=l8.vertices.far;ux.makeEmpty();for(let u=0;u<4;u++)ux.expandByPoint(l[u]),ux.expandByPoint(c[u]);ux.getCenter(Uf),Uf.z=ux.max.z+this.lightMargin,Uf.x=Math.floor(Uf.x/s)*s,Uf.y=Math.floor(Uf.y/o)*o,Uf.applyMatrix4(f8),r.position.copy(Uf),r.target.position.copy(Uf),r.target.position.x+=this.lightDirection.x,r.target.position.y+=this.lightDirection.y,r.target.position.z+=this.lightDirection.z}}_injectInclude(){ln.lights_fragment_begin=aG.lights_fragment_begin,ln.lights_pars_begin=aG.lights_pars_begin}setupMaterial(e){e.defines=e.defines||{},e.defines.USE_CSM=1,e.defines.CSM_CASCADES=this.cascades,this.fade&&(e.defines.CSM_FADE="");const n=[],i=this,r=this.shaders;e.onBeforeCompile=function(a){const s=Math.min(i.camera.far,i.maxFar);i._getExtendedBreaks(n),a.uniforms.CSM_cascades={value:n},a.uniforms.cameraNear={value:i.camera.near},a.uniforms.shadowFar={value:s},r.set(e,a)},r.set(e,null)}_updateUniforms(){const e=Math.min(this.camera.far,this.maxFar);this.shaders.forEach(function(i,r){if(i!==null){const a=i.uniforms;this._getExtendedBreaks(a.CSM_cascades.value),a.cameraNear.value=this.camera.near,a.shadowFar.value=e}!this.fade&&"CSM_FADE"in r.defines?(delete r.defines.CSM_FADE,r.needsUpdate=!0):this.fade&&!("CSM_FADE"in r.defines)&&(r.defines.CSM_FADE="",r.needsUpdate=!0)},this)}_getExtendedBreaks(e){for(;e.length<this.breaks.length;)e.push(new wt);e.length=this.breaks.length;for(let n=0;n<this.cascades;n++){const i=this.breaks[n],r=this.breaks[n-1]||0;e[n].x=r,e[n].y=i}}updateFrustums(){this._getBreaks(),this._initCascades(),this._updateShadowBounds(),this._updateUniforms()}remove(){for(let e=0;e<this.lights.length;e++)this.parent.remove(this.lights[e].target),this.parent.remove(this.lights[e])}dispose(){const e=this.shaders;e.forEach(function(n,i){delete i.onBeforeCompile,delete i.defines.USE_CSM,delete i.defines.CSM_CASCADES,delete i.defines.CSM_FADE,n!==null&&(delete n.uniforms.CSM_cascades,delete n.uniforms.cameraNear,delete n.uniforms.shadowFar),i.needsUpdate=!0}),e.clear()}}class a4e extends bl{constructor(e){super(),this.csm=e,this.displayFrustum=!0,this.displayPlanes=!0,this.displayShadowBounds=!0;const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new Dn;r.setIndex(new Nn(n,1)),r.setAttribute("position",new Nn(i,3,!1));const a=new Dc(r,new Us);this.add(a),this.frustumLines=a,this.cascadeLines=[],this.cascadePlanes=[],this.shadowLines=[]}updateVisibility(){const e=this.displayFrustum,n=this.displayPlanes,i=this.displayShadowBounds,r=this.frustumLines,a=this.cascadeLines,s=this.cascadePlanes,o=this.shadowLines;for(let l=0,c=a.length;l<c;l++){const u=a[l],f=s[l],h=o[l];u.visible=e,f.visible=e&&n,h.visible=i}r.visible=e}update(){const e=this.csm,n=e.camera,i=e.cascades,r=e.mainFrustum,a=e.frustums,s=e.lights,l=this.frustumLines.geometry.getAttribute("position"),c=this.cascadeLines,u=this.cascadePlanes,f=this.shadowLines;if(n===null)return;for(this.position.copy(n.position),this.quaternion.copy(n.quaternion),this.scale.copy(n.scale),this.updateMatrixWorld(!0);c.length>i;)this.remove(c.pop()),this.remove(u.pop()),this.remove(f.pop());for(;c.length<i;){const g=new tI(new rr,16711935),b=new Cs({transparent:!0,opacity:.1,depthWrite:!1,side:Kr}),y=new _i(new Ol,b),p=new bl,x=new tI(new rr,16711680);p.add(x),this.add(g),this.add(y),this.add(p),c.push(g),u.push(y),f.push(p)}for(let g=0;g<i;g++){const b=a[g],p=s[g].shadow.camera,x=b.vertices.far,_=c[g],w=u[g],M=f[g],S=M.children[0];_.box.min.copy(x[2]),_.box.max.copy(x[0]),_.box.max.z+=1e-4,w.position.addVectors(x[0],x[2]),w.position.multiplyScalar(.5),w.scale.subVectors(x[0],x[2]),w.scale.z=1e-4,this.remove(M),M.position.copy(p.position),M.quaternion.copy(p.quaternion),M.scale.copy(p.scale),M.updateMatrixWorld(!0),this.attach(M),S.box.min.set(p.bottom,p.left,-p.far),S.box.max.set(p.top,p.right,-p.near)}const h=r.vertices.near,d=r.vertices.far;l.setXYZ(0,d[0].x,d[0].y,d[0].z),l.setXYZ(1,d[3].x,d[3].y,d[3].z),l.setXYZ(2,d[2].x,d[2].y,d[2].z),l.setXYZ(3,d[1].x,d[1].y,d[1].z),l.setXYZ(4,h[0].x,h[0].y,h[0].z),l.setXYZ(5,h[3].x,h[3].y,h[3].z),l.setXYZ(6,h[2].x,h[2].y,h[2].z),l.setXYZ(7,h[1].x,h[1].y,h[1].z),l.needsUpdate=!0}dispose(){const e=this.frustumLines,n=this.cascadeLines,i=this.cascadePlanes,r=this.shadowLines;e.geometry.dispose(),e.material.dispose();const a=this.csm.cascades;for(let s=0;s<a;s++){const o=n[s],l=i[s],u=r[s].children[0];o.dispose(),l.geometry.dispose(),l.material.dispose(),u.dispose()}}}let lG="",cG="",DE=0;class s4e{instance;args;constructor(e){this.args=e,DE===0&&(lG=ln.lights_fragment_begin,cG=ln.lights_pars_begin)}attach(){this.instance||(this.instance=new r4e(this.args),DE++)}dispose(){this.instance&&(this.instance.remove(),this.instance.dispose(),this.instance=void 0,DE--,DE===0&&(ln.lights_fragment_begin=lG,ln.lights_pars_begin=cG))}}function uG(t){t.traverse(e=>{const n=e;n.isMesh&&n.material&&(Array.isArray(n.material)?n.material.forEach(i=>{i.needsUpdate=!0}):n.material.needsUpdate=!0)})}function XI({maxFar:t=20,shadowMapSize:e=1024,lightIntensity:n=.25,cascades:i=3,fade:r=!0,position:a=[0,0,0],shadowBias:s=-1e-5,lightFar:o=2e3,lightMargin:l=200,lightNear:c=1e-4,mode:u="practical",color:f=16777215,castShadow:h=!0,debug:d=!1}){return h?k.jsx(o4e,{maxFar:t,shadowMapSize:e,lightIntensity:n/i,cascades:i,fade:r,position:a,shadowBias:s,lightFar:o,lightMargin:l,lightNear:c,mode:u,color:f,debug:d},"csm-shadow"):k.jsx("directionalLight",{intensity:n,position:a,color:f!==void 0?new Ut(f):void 0})}function o4e({maxFar:t,shadowMapSize:e,lightIntensity:n,cascades:i,fade:r,position:a=[0,-1,0],shadowBias:s,lightFar:o,lightMargin:l,lightNear:c,mode:u,color:f,debug:h=!1}){const d=Ri(C=>C.camera),{scene:g}=Ri(),b=I.useMemo(()=>{let C=g;for(;C;){if(C instanceof Hv)return C;C=C.parent}throw new Error("Could not find scene object in r3f context!")},[g]),y=I.useMemo(()=>new te(-a[0],-a[1],-a[2]).normalize(),[a]),p=I.useRef(null),x=I.useRef(null),_=I.useMemo(()=>new te,[]),w=I.useMemo(()=>new te(0,0,0),[]),M=I.useMemo(()=>new te,[]),S=I.useMemo(()=>new s4e({camera:d,cascades:i,lightDirection:y.clone(),lightFar:o,lightIntensity:n,lightMargin:l,lightNear:c,maxFar:t,mode:u,parent:b,shadowBias:s,shadowMapSize:e}),[d,b,i,y,o,n,l,c,t,u,s,e]),A=I.useMemo(()=>new Ut(f),[f]);return I.useEffect(()=>{S.instance&&(S.instance.lights.forEach(C=>{C.color=A}),S.instance.fade=r??!1)},[S,A,r]),ra(()=>{!S.instance||!p.current||(p.current.getWorldPosition(_),M.subVectors(w,_).normalize(),S.instance.lightDirection.copy(M),S.instance.update(),x.current&&x.current.update())}),I.useEffect(()=>(uG(b),()=>{requestAnimationFrame(()=>{uG(b)})}),[b]),I.useEffect(()=>{if(S.attach(),S.instance&&S.instance.lights.forEach(C=>{C.color=A}),h&&S.instance){const C=new a4e(S.instance);C.displayFrustum=!0,C.displayPlanes=!0,C.displayShadowBounds=!0,C.updateVisibility(),b.add(C),x.current=C}return()=>{x.current&&(b.remove(x.current),x.current.traverse(C=>{if(C.geometry&&C.geometry.dispose(),C.material){const D=C.material;Array.isArray(D)?D.forEach(R=>R.dispose()):D.dispose()}}),x.current=null),S.dispose()}},[S,A,h,b]),k.jsx(k.Fragment,{children:k.jsx("group",{position:a,ref:p})})}const l4e=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useMemo(()=>Z_(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),a=Ee.useMemo(()=>{const l=new Dn;return l.setAttribute("position",new Nn(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),l.setIndex(new Nn(new Uint32Array(n.props.faces.buffer.slice(n.props.faces.byteOffset,n.props.faces.byteOffset+n.props.faces.byteLength)),1)),l.computeVertexNormals(),l.computeBoundingSphere(),l},[n.props.vertices.buffer,n.props.faces.buffer]);Ee.useEffect(()=>()=>{a&&a.dispose()},[a]),Ee.useEffect(()=>()=>{r&&r.dispose()},[r]);const s=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,o=Ee.useMemo(()=>s===0?null:new lg({opacity:s,color:0,depthWrite:!1}),[s]);return k.jsxs("mesh",{ref:i,geometry:a,material:r,scale:n.props.scale,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[k.jsx(Jf,{enableCreaseAngle:a.attributes.position.count<1024&&a.boundingSphere.radius>.1}),o&&s>0?k.jsx("mesh",{geometry:a,material:o,receiveShadow:!0}):null,e]})});let OE=null;const c4e=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useMemo(()=>Z_(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]);OE===null&&(OE=new Xd(1,1,1)),Ee.useEffect(()=>()=>{r&&r.dispose()},[r]);const a=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,s=Ee.useMemo(()=>a===0?null:new lg({opacity:a,color:0,depthWrite:!1}),[a]);return k.jsxs("group",{ref:i,children:[k.jsxs("mesh",{geometry:OE,scale:n.props.dimensions,material:r,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[k.jsx(Jf,{enableCreaseAngle:!0}),s&&a>0?k.jsx("mesh",{geometry:OE,material:s,receiveShadow:!0}):null]}),e]})}),h8=new Map,u4e=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useMemo(()=>Z_(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),a=Ee.useMemo(()=>(h8.has(n.props.subdivisions)||h8.set(n.props.subdivisions,new Gv(1,n.props.subdivisions)),h8.get(n.props.subdivisions)),[n.props.subdivisions]);Ee.useEffect(()=>()=>{a&&a.dispose()},[a]),Ee.useEffect(()=>()=>{r&&r.dispose()},[r]);const s=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,o=Ee.useMemo(()=>s===0?null:new lg({opacity:s,color:0,depthWrite:!1}),[s]);return k.jsxs("group",{ref:i,children:[k.jsxs("mesh",{ref:i,geometry:a,scale:n.props.radius,material:r,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[k.jsx(Jf,{}),o&&s>0?k.jsx("mesh",{geometry:a,material:o,receiveShadow:!0}):null]}),e]})}),f4e=Ee.forwardRef(function({children:e,...n},i){const r=Ee.useContext(bi),a=Ee.useMemo(()=>Z_(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),s=Ee.useRef(),{geometry:o,skeleton:l}=Ee.useMemo(()=>{const h=new Dn;h.setAttribute("position",new Nn(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),h.setIndex(new Nn(new Uint32Array(n.props.faces.buffer.slice(n.props.faces.byteOffset,n.props.faces.byteOffset+n.props.faces.byteLength)),1)),h.computeVertexNormals(),h.computeBoundingSphere();const d=new Float32Array(n.props.bone_wxyzs.buffer.slice(n.props.bone_wxyzs.byteOffset,n.props.bone_wxyzs.byteOffset+n.props.bone_wxyzs.byteLength)),g=new Float32Array(n.props.bone_positions.buffer.slice(n.props.bone_positions.byteOffset,n.props.bone_positions.byteOffset+n.props.bone_positions.byteLength)),b=[];s.current=b;for(let _=0;_<g.length/3;_++)b.push(new B_);const y=[],p=new Vn;b.forEach((_,w)=>{p.set(d[w*4+1],d[w*4+2],d[w*4+3],d[w*4+0]);const M=new Ot;M.makeRotationFromQuaternion(p),M.setPosition(g[w*3+0],g[w*3+1],g[w*3+2]),M.invert(),y.push(M),_.setRotationFromQuaternion(p),_.position.set(g[w*3+0],g[w*3+1],g[w*3+2])});const x=new Vv(b,y);return h.setAttribute("skinIndex",new Nn(new Uint16Array(n.props.skin_indices.buffer.slice(n.props.skin_indices.byteOffset,n.props.skin_indices.byteOffset+n.props.skin_indices.byteLength)),4)),h.setAttribute("skinWeight",new Nn(new Float32Array(n.props.skin_weights.buffer.slice(n.props.skin_weights.byteOffset,n.props.skin_weights.byteOffset+n.props.skin_weights.byteLength)),4)),x.init(),{geometry:h,skeleton:x}},[n.props.vertices.buffer,n.props.faces.buffer,n.props.skin_indices.buffer,n.props.skin_weights?.buffer,n.props.bone_wxyzs.buffer,n.props.bone_positions.buffer]),c=r.mutable.current;Ee.useEffect(()=>{const h=c.skinnedMeshState[n.name];return h.initialized=!1,()=>{l&&l.dispose(),o&&o.dispose()}},[l,o,n.name,c.skinnedMeshState]),Ee.useEffect(()=>()=>{a&&a.dispose()},[a]);const u=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,f=Ee.useMemo(()=>u===0?null:new lg({opacity:u,color:0,depthWrite:!1}),[u]);return ra(()=>{const h=c.skinnedMeshState[n.name],d=s.current;if(l!==void 0&&d!==void 0){if(!h.initialized){const g=c.nodeRefFromName[n.name];if(g===void 0)return;d.forEach(b=>{g.add(b)}),h.initialized=!0}h.dirty&&(d.forEach((g,b)=>{const y=h.poses[b].wxyz,p=h.poses[b].position;g.quaternion.set(y[1],y[2],y[3],y[0]),g.position.set(p[0],p[1],p[2])}),h.dirty=!1)}}),k.jsxs("skinnedMesh",{ref:i,geometry:o,material:a,skeleton:l,scale:n.props.scale,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,frustumCulled:!1,children:[k.jsx(Jf,{enableCreaseAngle:o.attributes.position.count<1024}),f&&u>0?k.jsx("skinnedMesh",{geometry:o,material:f,skeleton:l,receiveShadow:!0,frustumCulled:!1}):null,e]})});function d8(t,e,n){n[0]=t[0]>e[0]?e[0]:t[0],n[1]=t[1]<e[1]?e[1]:t[1],n[2]=t[2]>e[2]?e[2]:t[2],n[3]=t[3]<e[3]?e[3]:t[3],n[4]=t[4]>e[4]?e[4]:t[4],n[5]=t[5]<e[5]?e[5]:t[5]}function h4e(t,e,n){let i=!1;const r=t[0]>e[0]?e[0]:t[0],a=t[1]<e[1]?e[1]:t[1],s=t[2]>e[2]?e[2]:t[2],o=t[3]<e[3]?e[3]:t[3],l=t[4]>e[4]?e[4]:t[4],c=t[5]<e[5]?e[5]:t[5];return n[0]>r&&(n[0]=r,i=!0),n[1]<a&&(n[1]=a,i=!0),n[2]>s&&(n[2]=s,i=!0),n[3]<o&&(n[3]=o,i=!0),n[4]>l&&(n[4]=l,i=!0),n[5]<c&&(n[5]=c,i=!0),i}function d4e(t,e){return!(e[0]>t[0]||e[1]<t[1]||e[2]>t[2]||e[3]<t[3]||e[4]>t[4]||e[5]<t[5])}function p4e(t,e){let n=!1;return e[0]>t[0]&&(e[0]=t[0],n=!0),e[1]<t[1]&&(e[1]=t[1],n=!0),e[2]>t[2]&&(e[2]=t[2],n=!0),e[3]<t[3]&&(e[3]=t[3],n=!0),e[4]>t[4]&&(e[4]=t[4],n=!0),e[5]<t[5]&&(e[5]=t[5],n=!0),n}function IE(t,e){t[0]-=e,t[1]+=e,t[2]-=e,t[3]+=e,t[4]-=e,t[5]+=e}function Ob(t){const e=t[1]-t[0],n=t[3]-t[2],i=t[5]-t[4];return 2*(e*n+n*i+i*e)}function Fp(t,e){const n=t[0]>e[0]?e[0]:t[0],i=t[1]<e[1]?e[1]:t[1],r=t[2]>e[2]?e[2]:t[2],a=t[3]<e[3]?e[3]:t[3],s=t[4]>e[4]?e[4]:t[4],o=t[5]<e[5]?e[5]:t[5],l=i-n,c=a-r,u=o-s;return 2*(l*c+c*u+u*l)}function m4e(t){const e=t[1]-t[0],n=t[3]-t[2],i=t[5]-t[4];return e>n?e>i?0:2:n>i?1:2}function Ix(t,e){const n=t[0]-e[0],i=e[0]-t[1];let r=n>i?n:i;r<0&&(r=0);const a=t[2]-e[1],s=e[1]-t[3];let o=a>s?a:s;o<0&&(o=0);const l=t[4]-e[2],c=e[2]-t[5];let u=l>c?l:c;return u<0&&(u=0),r*r+o*o+u*u}function g4e(t,e){let n,i,r,a,s,o;const l=t[0]-e[0],c=e[0]-t[1];l>c?(n=l,i=c):(n=c,i=l),n<0&&(n=0);const u=t[2]-e[1],f=e[1]-t[3];u>f?(r=u,a=f):(r=f,a=u),r<0&&(r=0);const h=t[4]-e[2],d=e[2]-t[5];return h>d?(s=h,o=d):(s=d,o=h),s<0&&(s=0),{min:n*n+r*r+s*s,max:i*i+a*a+o*o}}let b4e=class{constructor(){this.array=[]}clear(){this.array=[]}push(e){const n=this.array,i=e.inheritedCost,r=n.length>6?n.length-6:0;let a;for(a=n.length-1;a>=r&&!(i<=n[a].inheritedCost);a--);a>n.length-7&&n.splice(a+1,0,e)}pop(){return this.array.pop()}},v4e=class{constructor(e=!1){this.root=null,this._sortedList=new b4e,this.count=0,this.highPrecision=e,this._typeArray=e?Float64Array:Float32Array}createFromArray(e,n,i,r=0){const a=n.length,s=this._typeArray;s!==(n[0].BYTES_PER_ELEMENT===4?Float32Array:Float64Array)&&console.warn("Different precision.");const o=new s(6);let l,c;this.root=u(0,a,null);function u(g,b,y){if(b===1){const w=n[g];r>0&&IE(w,r);const M={box:w,object:e[g],parent:y};return i&&i(M),M}const p=f(g,b);h();let x=d(g,b);(x===g||x===g+b)&&(x=g+(b>>1));const _={box:p,parent:y};return _.left=u(g,x-g,_),_.right=u(x,b-x+g,_),_}function f(g,b){const y=new s(6),p=g+b;y[0]=1/0,y[1]=-1/0,y[2]=1/0,y[3]=-1/0,y[4]=1/0,y[5]=-1/0,o[0]=1/0,o[1]=-1/0,o[2]=1/0,o[3]=-1/0,o[4]=1/0,o[5]=-1/0;for(let x=g;x<p;x++){const _=n[x],w=_[0],M=_[1],S=_[2],A=_[3],C=_[4],D=_[5];y[0]>w&&(y[0]=w),y[1]<M&&(y[1]=M),y[2]>S&&(y[2]=S),y[3]<A&&(y[3]=A),y[4]>C&&(y[4]=C),y[5]<D&&(y[5]=D);const R=(M+w)*.5,N=(A+S)*.5,U=(D+C)*.5;o[0]>R&&(o[0]=R),o[1]<R&&(o[1]=R),o[2]>N&&(o[2]=N),o[3]<N&&(o[3]=N),o[4]>U&&(o[4]=U),o[5]<U&&(o[5]=U)}return y[0]-=r,y[1]+=r,y[2]-=r,y[3]+=r,y[4]-=r,y[5]+=r,y}function h(){l=m4e(o)*2,c=(o[l]+o[l+1])*.5}function d(g,b){let y=g,p=g+b-1;for(;y<=p;){const x=n[y];if((x[l+1]+x[l])*.5>=c)for(;;){const _=n[p];if((_[l+1]+_[l])*.5<c){const w=e[y];e[y]=e[p],e[p]=w;const M=n[y];n[y]=n[p],n[p]=M,p--;break}if(p--,p<=y)return y}y++}return y}}insert(e,n,i){i>0&&IE(n,i);const r=this.createLeafNode(e,n);return this.root===null?this.root=r:this.insertLeaf(r),this.count++,r}insertRange(e,n,i,r){console.warn("Method not optimized yet. It just calls 'insert' N times.");const a=e.length,s=i>0?i:i?null:0;for(let o=0;o<a;o++){const l=this.insert(e[o],n[o],s??i[o]);r&&r(l)}}move(e,n){if(!e.parent||d4e(e.box,e.parent.box)){n>0&&IE(e.box,n);return}n>0&&IE(e.box,n);const i=this.delete(e);this.insertLeaf(e,i),this.count++}delete(e){const n=e.parent;if(n===null)return this.root=null,null;const i=n.parent,r=n.left===e?n.right:n.left;return r.parent=i,e.parent=null,i===null?(this.root=r,n):(i.left===n?i.left=r:i.right=r,this.refit(i),this.count--,n)}clear(){this.root=null}insertLeaf(e,n){const i=this.findBestSibling(e.box),r=i.parent;n===void 0?n=this.createInternalNode(r,i,e):(n.parent=r,n.left=i,n.right=e),i.parent=n,e.parent=n,r===null?this.root=n:r.left===i?r.left=n:r.right=n,this.refitAndRotate(e,i)}createLeafNode(e,n){return{box:n,object:e,parent:null}}createInternalNode(e,n,i){return{parent:e,left:n,right:i,box:new this._typeArray(6)}}findBestSibling(e){const n=this.root;let i=n,r=Fp(e,n.box);const a=Ob(e);if(n.object!==void 0)return n;const s=this._sortedList;s.clear();let o={node:n,inheritedCost:r-Ob(n.box)};do{const{node:l,inheritedCost:c}=o;if(a+c>=r)break;const u=l.left,f=l.right,h=Fp(e,u.box)+c,d=h-Ob(u.box),g=Fp(e,f.box)+c,b=g-Ob(f.box);if(h>g?r>g&&(i=f,r=g):r>h&&(i=u,r=h),b>d){if(a+d>=r||(u.object===void 0&&s.push({node:u,inheritedCost:d}),a+b>=r))continue;f.object===void 0&&s.push({node:f,inheritedCost:b})}else{if(a+b>=r||(f.object===void 0&&s.push({node:f,inheritedCost:b}),a+d>=r))continue;u.object===void 0&&s.push({node:u,inheritedCost:d})}}while(o=s.pop());return i}refit(e){for(d8(e.left.box,e.right.box,e.box);e=e.parent;)if(!h4e(e.left.box,e.right.box,e.box))return}refitAndRotate(e,n){const i=e.box;e=e.parent;const r=e.box;for(d8(i,n.box,r);e=e.parent;){const a=e.box;if(!p4e(i,a))return;const s=e.left,o=e.right,l=s.box,c=o.box;let u=null,f=null,h=0;if(o.object===void 0){const d=o.left,g=o.right,b=Ob(o.box),y=b-Fp(l,d.box),p=b-Fp(l,g.box);y>p?y>0&&(u=s,f=g,h=y):p>0&&(u=s,f=d,h=p)}if(s.object===void 0){const d=s.left,g=s.right,b=Ob(s.box),y=b-Fp(c,d.box),p=b-Fp(c,g.box);y>p?y>h&&(u=o,f=g):p>h&&(u=o,f=d)}u!==null&&this.swap(u,f)}}swap(e,n){const i=e.parent,r=n.parent,a=r.box;i.left===e?i.left=n:i.right=n,r.left===n?r.left=e:r.right=e,e.parent=r,n.parent=i,d8(r.left.box,r.right.box,a)}};const v4=0,y4e=1;let x4e=class{constructor(e,n){this.coordinateSystem=n,this.array=e?new Float64Array(24):new Float32Array(24)}setFromProjectionMatrix(e){if(this.updatePlane(0,e[3]+e[0],e[7]+e[4],e[11]+e[8],e[15]+e[12]),this.updatePlane(1,e[3]-e[0],e[7]-e[4],e[11]-e[8],e[15]-e[12]),this.updatePlane(2,e[3]-e[1],e[7]-e[5],e[11]-e[9],e[15]-e[13]),this.updatePlane(3,e[3]+e[1],e[7]+e[5],e[11]+e[9],e[15]+e[13]),this.updatePlane(4,e[3]-e[2],e[7]-e[6],e[11]-e[10],e[15]-e[14]),this.coordinateSystem===v4)this.updatePlane(5,e[3]+e[2],e[7]+e[6],e[11]+e[10],e[15]+e[14]);else if(this.coordinateSystem===y4e)this.updatePlane(5,e[2],e[6],e[10],e[14]);else throw new Error("Invalid coordinate system: "+this.coordinateSystem);return this}updatePlane(e,n,i,r,a){const s=this.array,o=e*4,l=Math.sqrt(n*n+i*i+r*r);s[o+0]=n/l,s[o+1]=i/l,s[o+2]=r/l,s[o+3]=a/l}intersectsBoxMask(e,n){const i=this.array;let r,a,s,o,l,c;for(let u=0;u<6;u++){if(!(n&32>>u))continue;const f=u*4,h=i[f+0],d=i[f+1],g=i[f+2],b=i[f+3];if(h>0?(r=e[1],o=e[0]):(r=e[0],o=e[1]),d>0?(a=e[3],l=e[2]):(a=e[2],l=e[3]),g>0?(s=e[5],c=e[4]):(s=e[4],c=e[5]),h*r+d*a+g*s<-b)return-1;h*o+d*l+g*c>-b&&(n^=32>>u)}return n}isIntersected(e,n){const i=this.array;for(let r=0;r<6;r++){if(!(n&32>>r))continue;const a=r*4,s=i[a+0],o=i[a+1],l=i[a+2],c=i[a+3],u=s>0?e[1]:e[0],f=o>0?e[3]:e[2],h=l>0?e[5]:e[4];if(s*u+o*f+l*h<-c)return!1}return!0}isIntersectedMargin(e,n,i){if(n===0)return!0;const r=this.array;for(let a=0;a<6;a++){if(!(n&32>>a))continue;const s=a*4,o=r[s+0],l=r[s+1],c=r[s+2],u=r[s+3],f=o>0?e[1]-i:e[0]+i,h=l>0?e[3]-i:e[2]+i,d=c>0?e[5]-i:e[4]+i;if(o*f+l*h+c*d<-u)return!1}return!0}};function fG(t,e,n,i,r,a){let s=i[0],o=e[0],l=n[0],c=(t[s]-o)*l,u=(t[s^1]-o)*l,f=c>0?c:0,h=u<1/0?u:1/0;return s=i[1],o=e[1],l=n[1],c=(t[s+2]-o)*l,c>h||(u=(t[s^3]-o)*l,f>u)||(f=c>f?c:f,h=u<h?u:h,s=i[2],o=e[2],l=n[2],c=(t[s+4]-o)*l,c>h)||(u=(t[s^5]-o)*l,f>u)?!1:(f=c>f?c:f,h=u<h?u:h,f<=a&&h>=r)}function hG(t,e){return t[1]>=e[0]&&e[1]>=t[0]&&t[3]>=e[2]&&e[3]>=t[2]&&t[5]>=e[4]&&e[5]>=t[4]}function _4e(t,e,n){return Ix(n,t)<=e*e}class S4e{constructor(e,n=v4){this._sign=new Uint8Array(3),this.builder=e;const i=e.highPrecision;this.frustum=new x4e(i,n),this._dirInv=i?new Float64Array(3):new Float32Array(3)}get root(){return this.builder.root}createFromArray(e,n,i,r){e?.length>0&&this.builder.createFromArray(e,n,i,r)}insert(e,n,i){return this.builder.insert(e,n,i)}insertRange(e,n,i,r){e?.length>0&&this.builder.insertRange(e,n,i,r)}move(e,n){this.builder.move(e,n)}delete(e){return this.builder.delete(e)}clear(){this.builder.clear()}traverse(e){if(this.root===null)return;n(this.root,0);function n(i,r){if(i.object!==void 0){e(i,r);return}e(i,r)||(n(i.left,r+1),n(i.right,r+1))}}intersectsRay(e,n,i,r=0,a=1/0){if(this.root===null)return!1;const s=this._dirInv,o=this._sign;return s[0]=1/e[0],s[1]=1/e[1],s[2]=1/e[2],o[0]=s[0]<0?1:0,o[1]=s[1]<0?1:0,o[2]=s[2]<0?1:0,l(this.root);function l(c){return fG(c.box,n,s,o,r,a)?c.object!==void 0?i(c.object):l(c.left)||l(c.right):!1}}intersectsBox(e,n){if(this.root===null)return!1;return i(this.root);function i(r){return hG(e,r.box)?r.object!==void 0?n(r.object):i(r.left)||i(r.right):!1}}intersectsSphere(e,n,i){if(this.root===null)return!1;return r(this.root);function r(a){return _4e(e,n,a.box)?a.object!==void 0?i(a.object):r(a.left)||r(a.right):!1}}isNodeIntersected(e,n){const i=e.box;let r;for(;r=e.parent;){const s=r.left===e?r.right:r.left;if(a(s))return!0;e=r}return!1;function a(s){return hG(i,s.box)?s.object!==void 0?n(s.object):a(s.left)||a(s.right):!1}}rayIntersections(e,n,i,r=0,a=1/0){if(this.root===null)return;const s=this._dirInv,o=this._sign;s[0]=1/e[0],s[1]=1/e[1],s[2]=1/e[2],o[0]=s[0]<0?1:0,o[1]=s[1]<0?1:0,o[2]=s[2]<0?1:0,l(this.root);function l(c){if(fG(c.box,n,s,o,r,a)){if(c.object!==void 0){i(c.object);return}l(c.left),l(c.right)}}}frustumCulling(e,n){if(this.root===null)return;const i=this.frustum.setFromProjectionMatrix(e);r(this.root,63);function r(s,o){if(s.object!==void 0){i.isIntersected(s.box,o)&&n(s,i,o);return}if(o=i.intersectsBoxMask(s.box,o),!(o<0)){if(o===0){a(s.left),a(s.right);return}r(s.left,o),r(s.right,o)}}function a(s){if(s.object!==void 0){n(s,i,0);return}a(s.left),a(s.right)}}frustumCullingLOD(e,n,i,r){if(this.root===null)return;const a=this.frustum.setFromProjectionMatrix(e);s(this.root,63,null);function s(c,u,f){const h=c.box;if(f===null&&(f=l(h)),c.object!==void 0){a.isIntersected(h,u)&&r(c,f,a,u);return}if(u=a.intersectsBoxMask(h,u),!(u<0)){if(u===0){o(c.left,f),o(c.right,f);return}s(c.left,u,f),s(c.right,u,f)}}function o(c,u){if(u===null&&(u=l(c.box)),c.object!==void 0){r(c,u,a,0);return}o(c.left,u),o(c.right,u)}function l(c){const{min:u,max:f}=g4e(c,n);for(let h=i.length-1;h>0;h--)if(f>=i[h])return u>=i[h]?h:null;return 0}}closestPointToPoint(e,n){if(this.root===null)return;let i=1/0;return r(this.root),Math.sqrt(i);function r(a){if(a.object!==void 0){if(n){const l=n(a.object)??Ix(a.box,e);l<i&&(i=l)}else i=Ix(a.box,e);return}const s=Ix(a.left.box,e),o=Ix(a.right.box,e);s<o?s<i&&(r(a.left),o<i&&r(a.right)):o<i&&(r(a.right),s<i&&r(a.left))}}}function dG(t,e){return e[0]=t.x,e[1]=t.y,e[2]=t.z,e}function pG(t,e){const n=t.min,i=t.max;return e[0]=n.x,e[1]=i.x,e[2]=n.y,e[3]=i.y,e[4]=n.z,e[5]=i.z,e}class Ste{constructor(e,n,i){if(this.isInstanceEntity=!0,this.position=new te,this.scale=new te(1,1,1),this.quaternion=new Vn,this.id=n,this.owner=e,i){const r=this.quaternion,a=this.rotation=new mi;a._onChange(()=>r.setFromEuler(a,!1)),r._onChange(()=>a.setFromQuaternion(r,void 0,!1))}}get visible(){return this.owner.getVisibilityAt(this.id)}set visible(e){this.owner.setVisibilityAt(this.id,e)}get active(){return this.owner.getActiveAt(this.id)}set active(e){this.owner.setActiveAt(this.id,e)}get color(){return this.owner.getColorAt(this.id)}set color(e){this.owner.setColorAt(this.id,e)}get opacity(){return this.owner.getOpacityAt(this.id)}set opacity(e){this.owner.setOpacityAt(this.id,e)}get morph(){return this.owner.getMorphAt(this.id)}set morph(e){this.owner.setMorphAt(this.id,e)}get matrix(){return this.owner.getMatrixAt(this.id)}get matrixWorld(){return this.matrix.premultiply(this.owner.matrixWorld)}setMatrixIdentity(){const e=this.owner,n=e.matricesTexture._data,i=this.id,r=i*16;n[r+0]=1,n[r+1]=0,n[r+2]=0,n[r+3]=0,n[r+4]=0,n[r+5]=1,n[r+6]=0,n[r+7]=0,n[r+8]=0,n[r+9]=0,n[r+10]=1,n[r+11]=0,n[r+12]=0,n[r+13]=0,n[r+14]=0,n[r+15]=1,e.matricesTexture.enqueueUpdate(i)}updateMatrix(){const e=this.owner,n=this.position,i=this.quaternion,r=this.scale,a=e.matricesTexture._data,s=this.id,o=s*16,l=i._x,c=i._y,u=i._z,f=i._w,h=l+l,d=c+c,g=u+u,b=l*h,y=l*d,p=l*g,x=c*d,_=c*g,w=u*g,M=f*h,S=f*d,A=f*g,C=r.x,D=r.y,R=r.z;a[o+0]=(1-(x+w))*C,a[o+1]=(y+A)*C,a[o+2]=(p-S)*C,a[o+3]=0,a[o+4]=(y-A)*D,a[o+5]=(1-(b+w))*D,a[o+6]=(_+M)*D,a[o+7]=0,a[o+8]=(p+S)*R,a[o+9]=(_-M)*R,a[o+10]=(1-(b+x))*R,a[o+11]=0,a[o+12]=n.x,a[o+13]=n.y,a[o+14]=n.z,a[o+15]=1,e.matricesTexture.enqueueUpdate(s),e.bvh&&e.autoUpdateBVH&&e.bvh.move(s)}updateMatrixPosition(){const e=this.owner,n=this.position,i=e.matricesTexture._data,r=this.id,a=r*16;i[a+12]=n.x,i[a+13]=n.y,i[a+14]=n.z,e.matricesTexture.enqueueUpdate(r),e.bvh&&e.autoUpdateBVH&&e.bvh.move(r)}getUniform(e,n){return this.owner.getUniformAt(this.id,e,n)}updateBones(e=!0,n){this.owner.setBonesAt(this.id,e,n)}setUniform(e,n){this.owner.setUniformAt(this.id,e,n)}copyTo(e){e.position.copy(this.position),e.scale.copy(this.scale),e.quaternion.copy(this.quaternion),this.rotation&&e.rotation.copy(this.rotation)}applyMatrix4(e){return this.matrix.premultiply(e).decompose(this.position,this.quaternion,this.scale),this}applyQuaternion(e){return this.quaternion.premultiply(e),this}rotateOnAxis(e,n){return NE.setFromAxisAngle(e,n),this.quaternion.multiply(NE),this}rotateOnWorldAxis(e,n){return NE.setFromAxisAngle(e,n),this.quaternion.premultiply(NE),this}rotateX(e){return this.rotateOnAxis(gG,e)}rotateY(e){return this.rotateOnAxis(bG,e)}rotateZ(e){return this.rotateOnAxis(vG,e)}translateOnAxis(e,n){return mG.copy(e).applyQuaternion(this.quaternion),this.position.add(mG.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(gG,e)}translateY(e){return this.translateOnAxis(bG,e)}translateZ(e){return this.translateOnAxis(vG,e)}remove(){return this.owner.removeInstances(this.id),this}}const NE=new Vn,mG=new te,gG=new te(1,0,0),bG=new te(0,1,0),vG=new te(0,0,1);class w4e{constructor(e,n=0,i=!1,r=!0){this.nodesMap=new Map,this.LODsMap=new Map,this._geoBoundingSphere=null,this._sphereTarget=null,this.target=e,this.accurateCulling=r,this._margin=n;const a=e._geometry;if(a.boundingBox||a.computeBoundingBox(),this.geoBoundingBox=a.boundingBox,i){a.boundingSphere||a.computeBoundingSphere();const s=a.boundingSphere.center;s.x===0&&s.y===0&&s.z===0?(this._geoBoundingSphere=a.boundingSphere,this._sphereTarget={centerX:0,centerY:0,centerZ:0,maxScale:0}):(console.warn('"getBoxFromSphere" is ignored because geometry is not centered.'),i=!1)}this.bvh=new S4e(new v4e,v4),this._origin=new Float32Array(3),this._dir=new Float32Array(3),this._cameraPos=new Float32Array(3),this._getBoxFromSphere=i}create(){const e=this.target._instancesCount,n=this.target._instancesArrayCount,i=new Array(e),r=new Uint32Array(e);let a=0;this.clear();for(let s=0;s<n;s++)this.target.getActiveAt(s)&&(i[a]=this.getBox(s,new Float32Array(6)),r[a]=s,a++);this.bvh.createFromArray(r,i,s=>{this.nodesMap.set(s.object,s)},this._margin)}insert(e){const n=this.bvh.insert(e,this.getBox(e,new Float32Array(6)),this._margin);this.nodesMap.set(e,n)}insertRange(e){const n=e.length,i=new Array(n);for(let r=0;r<n;r++)i[r]=this.getBox(e[r],new Float32Array(6));this.bvh.insertRange(e,i,this._margin,r=>{this.nodesMap.set(r.object,r)})}move(e){const n=this.nodesMap.get(e);n&&(this.getBox(e,n.box),this.bvh.move(n,this._margin))}delete(e){const n=this.nodesMap.get(e);n&&(this.bvh.delete(n),this.nodesMap.delete(e))}clear(){this.bvh.clear(),this.nodesMap.clear()}frustumCulling(e,n){this._margin>0&&this.accurateCulling?this.bvh.frustumCulling(e.elements,(i,r,a)=>{r.isIntersectedMargin(i.box,a,this._margin)&&n(i)}):this.bvh.frustumCulling(e.elements,n)}frustumCullingLOD(e,n,i,r){this.LODsMap.has(i)||this.LODsMap.set(i,new Float32Array(i.length));const a=this.LODsMap.get(i);for(let o=0;o<i.length;o++)a[o]=i[o].distance;const s=this._cameraPos;s[0]=n.x,s[1]=n.y,s[2]=n.z,this._margin>0&&this.accurateCulling?this.bvh.frustumCullingLOD(e.elements,s,a,(o,l,c,u)=>{c.isIntersectedMargin(o.box,u,this._margin)&&r(o,l)}):this.bvh.frustumCullingLOD(e.elements,s,a,r)}raycast(e,n){const i=e.ray,r=this._origin,a=this._dir;dG(i.origin,r),dG(i.direction,a),this.bvh.rayIntersections(a,r,n,e.near,e.far)}intersectBox(e,n){this._boxArray||(this._boxArray=new Float32Array(6));const i=this._boxArray;return pG(e,i),this.bvh.intersectsBox(i,n)}getBox(e,n){if(this._getBoxFromSphere){const i=this.target.matricesTexture._data,{centerX:r,centerY:a,centerZ:s,maxScale:o}=this.getSphereFromMatrix_centeredGeometry(e,i,this._sphereTarget),l=this._geoBoundingSphere.radius*o;n[0]=r-l,n[1]=r+l,n[2]=a-l,n[3]=a+l,n[4]=s-l,n[5]=s+l}else yG.copy(this.geoBoundingBox).applyMatrix4(this.target.getMatrixAt(e)),pG(yG,n);return n}getSphereFromMatrix_centeredGeometry(e,n,i){const r=e*16,a=n[r+0],s=n[r+1],o=n[r+2],l=n[r+4],c=n[r+5],u=n[r+6],f=n[r+8],h=n[r+9],d=n[r+10],g=a*a+s*s+o*o,b=l*l+c*c+u*u,y=f*f+h*h+d*d;return i.maxScale=Math.sqrt(Math.max(g,b,y)),i.centerX=n[r+12],i.centerY=n[r+13],i.centerZ=n[r+14],i}}const yG=new rr;class E4e extends C${constructor(e,n,i,r,a,s=1){const o=e.createBuffer();super(o,n,i,r,a.length/i),this.isGLInstancedBufferAttribute=!0,this._needsUpdate=!1,this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s,this.array=a,this._cacheArray=a,e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,a,e.DYNAMIC_DRAW)}update(e,n){if(!this._needsUpdate||n===0)return;const i=e.getContext();i.bindBuffer(i.ARRAY_BUFFER,this.buffer),this.array===this._cacheArray?i.bufferSubData(i.ARRAY_BUFFER,0,this.array,0,n):(i.bufferData(i.ARRAY_BUFFER,this.array,i.DYNAMIC_DRAW),this._cacheArray=this.array),this._needsUpdate=!1}clone(){return this}}let HC=null,ST=null;const p8={};function M4e(t){var e;return((e=ST.get(t))==null?void 0:e())??HC(t)}function T4e(t){if(ST.has(t))return;const e={};ST.set(t,()=>{if(t.isMeshDistanceMaterial){const n=HC(t);e.light=n.light}return e})}function A4e(t,e,n){const i=e.properties;HC=i.get;const r=`${!!t.colorsTexture}_${t._useOpacity}_${!!t.boneTexture}_${!!t.uniformsTexture}`;p8[r]??(p8[r]=new WeakMap),ST=p8[r],i.get=M4e,T4e(n)}function C4e(t){t.properties.get=HC}function wte(t,e){return Math.max(e,Math.ceil(Math.sqrt(t/e))*e)}function R4e(t,e,n,i){e===3&&(console.warn('"channels" cannot be 3. Set to 4. More info: https://github.com/mrdoob/three.js/pull/23228'),e=4);const r=wte(i,n),a=new t(r*r*e),s=t.name.includes("Float"),o=t.name.includes("Uint"),l=s?yr:o?wc:Bv;let c;switch(e){case 1:c=s?wh:zv;break;case 2:c=s?zA:P_;break;case 4:c=s?$r:jv;break}return{array:a,size:r,type:l,format:c}}let wT=class extends rs{constructor(e,n,i,r,a,s){n===3&&(n=4);const{array:o,format:l,size:c,type:u}=R4e(e,n,i,r);super(o,c,c,l,u),this.partialUpdate=!0,this.maxUpdateCalls=1/0,this._utils=null,this._needsUpdate=!0,this._lastWidth=-1,this._data=o,this._channels=n,this._pixelsPerInstance=i,this._stride=i*n,this._rowToUpdate=new Array(c),this._uniformMap=a,this._fetchUniformsInFragmentShader=s,this.needsUpdate=!0}resize(e){const n=wte(e,this._pixelsPerInstance);if(n===this.image.width)return;const i=this._data,r=this._channels;this._rowToUpdate.length=n;const a=i.constructor,s=new a(n*n*r),o=Math.min(i.length,s.length);s.set(new a(i.buffer,0,o)),this.dispose(),this.image={data:s,height:n,width:n},this._data=s}enqueueUpdate(e){if(this._needsUpdate=!0,!this.partialUpdate)return;const n=this.image.width/this._pixelsPerInstance,i=Math.floor(e/n);this._rowToUpdate[i]=!0}bindToProgram(e,n,i,r,a){if(!r[a])return;r[a].value=this;const s=this.getSlot(i,a);if(s===void 0)return;const o=e.properties.get(this);e.state.bindTexture(n.TEXTURE_2D,o.__webglTexture,n.TEXTURE0+s)}update(e,n,i){const r=e.properties.get(this),a=r.__version!==this.version;if(!this._needsUpdate&&!a)return;const s=this._lastWidth!==this.image.width;if(!r.__webglTexture||s)e.initTexture(this);else{const o=this.getSlot(n,i)??e.capabilities.maxTextures-1;this.partialUpdate?this.updatePartial(r,e,o):this.updateFull(r,e,o),r.__version=this.version}this._lastWidth=this.image.width,this._needsUpdate=!1}getSlot(e,n){var i;return(i=e[n])==null?void 0:i.cache[0]}updateFull(e,n,i){this.updateRows(e,n,[{row:0,count:this.image.height}],i)}updatePartial(e,n,i){const r=this.getUpdateRowsInfo();r.length!==0&&(r.length>this.maxUpdateCalls?this.updateFull(e,n,i):this.updateRows(e,n,r,i),this._rowToUpdate.fill(!1))}getUpdateRowsInfo(){const e=this._rowToUpdate,n=[];for(let i=0,r=e.length;i<r;i++)if(e[i]){const a=i;for(;i<r&&e[i];i++);n.push({row:a,count:i-a})}return n}updateRows(e,n,i,r){var a;const s=n.getContext();this._utils??(this._utils=new gU(s,n.extensions,n.capabilities));const o=this._utils.convert(this.format),l=this._utils.convert(this.type),{data:c,width:u}=this.image,f=this._channels;n.state.activeTexture(s.TEXTURE0+r),n.state.bindTexture(s.TEXTURE_2D,e.__webglTexture,s.TEXTURE0+r);const h=pi.getPrimaries(pi.workingColorSpace),d=this.colorSpace===tu?null:pi.getPrimaries(this.colorSpace),g=this.colorSpace===tu||h===d?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,this.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,this.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,g);for(const{count:b,row:y}of i)s.texSubImage2D(s.TEXTURE_2D,0,0,y,u,b,o,l,c,y*u*f);(a=this.onUpdate)==null||a.call(this,this)}setUniformAt(e,n,i){const{offset:r,size:a}=this._uniformMap.get(n),s=this._stride;a===1?this._data[e*s+r]=i:i.toArray(this._data,e*s+r)}getUniformAt(e,n,i){const{offset:r,size:a}=this._uniformMap.get(n),s=this._stride;return a===1?this._data[e*s+r]:i.fromArray(this._data,e*s+r)}getUniformsGLSL(e,n,i){const r=this.getUniformsVertexGLSL(e,n,i),a=this.getUniformsFragmentGLSL(e,n,i);return{vertex:r,fragment:a}}getUniformsVertexGLSL(e,n,i){if(this._fetchUniformsInFragmentShader)return`
        flat varying ${i} ez_v${n}; 
        void main() {
          ez_v${n} = ${n};`;const r=this.texelsFetchGLSL(e,n),a=this.getFromTexelsGLSL(),{assignVarying:s,declareVarying:o}=this.getVarying();return`
      uniform highp sampler2D ${e};  
      ${o}
      void main() {
        ${r}
        ${a}
        ${s}`}getUniformsFragmentGLSL(e,n,i){if(!this._fetchUniformsInFragmentShader){const{declareVarying:s,getVarying:o}=this.getVarying();return`
      ${s}
      void main() {
        ${o}`}const r=this.texelsFetchGLSL(e,`ez_v${n}`),a=this.getFromTexelsGLSL();return`
      uniform highp sampler2D ${e};  
      flat varying ${i} ez_v${n};
      void main() {
        ${r}
        ${a}`}texelsFetchGLSL(e,n){const i=this._pixelsPerInstance;let r=`
      int size = textureSize(${e}, 0).x;
      int j = int(${n}) * ${i};
      int x = j % size;
      int y = j / size;
    `;for(let a=0;a<i;a++)r+=`vec4 ez_texel${a} = texelFetch(${e}, ivec2(x + ${a}, y), 0);
`;return r}getFromTexelsGLSL(){const e=this._uniformMap;let n="";for(const[i,{type:r,offset:a,size:s}]of e){const o=Math.floor(a/this._channels);if(r==="mat3")n+=`mat3 ${i} = mat3(ez_texel${o}.rgb, vec3(ez_texel${o}.a, ez_texel${o+1}.rg), vec3(ez_texel${o+1}.ba, ez_texel${o+2}.r));
`;else if(r==="mat4")n+=`mat4 ${i} = mat4(ez_texel${o}, ez_texel${o+1}, ez_texel${o+2}, ez_texel${o+3});
`;else{const l=this.getUniformComponents(a,s);n+=`${r} ${i} = ez_texel${o}.${l};
`}}return n}getVarying(){const e=this._uniformMap;let n="",i="",r="";for(const[a,{type:s}]of e)n+=`flat varying ${s} ez_v${a};
`,i+=`ez_v${a} = ${a};
`,r+=`${s} ${a} = ez_v${a};
`;return{declareVarying:n,assignVarying:i,getVarying:r}}getUniformComponents(e,n){const i=e%this._channels;let r="";for(let a=0;a<n;a++)r+=k4e[i+a];return r}copy(e){return super.copy(e),this.partialUpdate=e.partialUpdate,this.maxUpdateCalls=e.maxUpdateCalls,this._channels=e._channels,this._pixelsPerInstance=e._pixelsPerInstance,this._stride=e._stride,this._rowToUpdate=e._rowToUpdate,this._uniformMap=e._uniformMap,this._fetchUniformsInFragmentShader=e._fetchUniformsInFragmentShader,this}};const k4e=["r","g","b","a"];let Rn=class extends _i{constructor(e,n,i={},r){if(!e)throw new Error('"geometry" is mandatory.');if(!n)throw new Error('"material" is mandatory.');const{allowsEuler:a,renderer:s,createEntities:o}=i;super(e,null),this.type="InstancedMesh2",this.isInstancedMesh2=!0,this.instances=null,this.instanceIndex=null,this.colorsTexture=null,this.morphTexture=null,this.boneTexture=null,this.uniformsTexture=null,this.boundingBox=null,this.boundingSphere=null,this.bvh=null,this.customSort=null,this.raycastOnlyFrustum=!1,this.LODinfo=null,this.autoUpdate=!0,this.bindMode=F1,this.bindMatrix=null,this.bindMatrixInverse=null,this.skeleton=null,this.autoUpdateBVH=!0,this.onFrustumEnter=null,this._renderer=null,this._instancesCount=0,this._instancesArrayCount=0,this._perObjectFrustumCulled=!0,this._sortObjects=!1,this._indexArrayNeedsUpdate=!1,this._useOpacity=!1,this._currentMaterial=null,this._customProgramCacheKeyBase=null,this._onBeforeCompileBase=null,this._freeIds=[],this.isInstancedMesh=!0,this.instanceMatrix=new of(new Float32Array(0),16),this.instanceColor=null,this._customProgramCacheKey=()=>`ez_${!!this.colorsTexture}_${this._useOpacity}_${!!this.boneTexture}_${!!this.uniformsTexture}_${this._customProgramCacheKeyBase.call(this._currentMaterial)}`,this._onBeforeCompile=(c,u)=>{if(this._onBeforeCompileBase&&this._onBeforeCompileBase.call(this._currentMaterial,c,u),c.defines??(c.defines={}),c.defines.USE_INSTANCING_INDIRECT="",c.uniforms.matricesTexture={value:this.matricesTexture},this.uniformsTexture){c.uniforms.uniformsTexture={value:this.uniformsTexture};const{vertex:f,fragment:h}=this.uniformsTexture.getUniformsGLSL("uniformsTexture","instanceIndex","uint");c.vertexShader=c.vertexShader.replace("void main() {",f),c.fragmentShader=c.fragmentShader.replace("void main() {",h)}this.colorsTexture&&c.fragmentShader.includes("#include <color_pars_fragment>")&&(c.defines.USE_INSTANCING_COLOR_INDIRECT="",c.uniforms.colorsTexture={value:this.colorsTexture},c.vertexShader=c.vertexShader.replace("<color_vertex>","<instanced_color_vertex>"),c.vertexColors&&(c.defines.USE_VERTEX_COLOR=""),this._useOpacity?c.defines.USE_COLOR_ALPHA="":c.defines.USE_COLOR=""),this.boneTexture&&(c.defines.USE_SKINNING="",c.defines.USE_INSTANCING_SKINNING="",c.uniforms.bindMatrix={value:this.bindMatrix},c.uniforms.bindMatrixInverse={value:this.bindMatrixInverse},c.uniforms.bonesPerInstance={value:this.skeleton.bones.length},c.uniforms.boneTexture={value:this.boneTexture})};const l=i.capacity>0?i.capacity:D4e;this._renderer=s,this._capacity=l,this._parentLOD=r,this._geometry=e,this.material=n,this._allowsEuler=a??!1,this._tempInstance=new Ste(this,-1,a),this.availabilityArray=r?.availabilityArray??new Array(l*2),this._createEntities=o,this.initLastRenderInfo(),this.initIndexAttribute(),this.initMatricesTexture()}get capacity(){return this._capacity}get instancesCount(){return this._instancesCount}get perObjectFrustumCulled(){return this._perObjectFrustumCulled}set perObjectFrustumCulled(e){this._perObjectFrustumCulled=e,this._indexArrayNeedsUpdate=!0}get sortObjects(){return this._sortObjects}set sortObjects(e){this._sortObjects=e,this._indexArrayNeedsUpdate=!0}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.patchGeometry(e)}onBeforeShadow(e,n,i,r,a,s,o){this.patchMaterial(e,s),this.updateTextures(e,s);const l=e.info.render.frame;this.instanceIndex&&this.autoUpdate&&!this.frustumCullingAlreadyPerformed(l,i,r)&&this.performFrustumCulling(r,i),this.count!==0&&(this.instanceIndex.update(this._renderer,this.count),this.bindTextures(e,s))}onBeforeRender(e,n,i,r,a,s){if(this.patchMaterial(e,a),this.updateTextures(e,a),!this.instanceIndex){this._renderer=e;return}const o=e.info.render.frame;this.autoUpdate&&!this.frustumCullingAlreadyPerformed(o,i,null)&&this.performFrustumCulling(i),this.count!==0&&(this.instanceIndex.update(this._renderer,this.count),this.bindTextures(e,a))}onAfterShadow(e,n,i,r,a,s,o){this.unpatchMaterial(e,s)}onAfterRender(e,n,i,r,a,s){this.unpatchMaterial(e,a),!(this.instanceIndex||s&&!this.isLastGroup(s.materialIndex))&&this.initIndexAttribute()}updateTextures(e,n){var i,r,a;const s=e.properties.get(n);this.matricesTexture.update(e,s,"matricesTexture"),(i=this.colorsTexture)==null||i.update(e,s,"colorsTexture"),(r=this.uniformsTexture)==null||r.update(e,s,"uniformsTexture"),(a=this.boneTexture)==null||a.update(e,s,"boneTexture")}bindTextures(e,n){var i,r,a;const s=e.properties.get(n),o=s.uniforms;if(!o)return;const l=s.currentProgram,c=l?.program;if(!c)return;const u=e.getContext(),f=l.getUniforms().map,h=u.getParameter(u.CURRENT_PROGRAM);e.state.useProgram(c),this.matricesTexture.bindToProgram(e,u,f,o,"matricesTexture"),(i=this.colorsTexture)==null||i.bindToProgram(e,u,f,o,"colorsTexture"),(r=this.uniformsTexture)==null||r.bindToProgram(e,u,f,o,"uniformsTexture"),(a=this.boneTexture)==null||a.bindToProgram(e,u,f,o,"boneTexture"),e.state.useProgram(h)}isLastGroup(e){const n=this.material;for(let i=n.length-1;i>=e;i--)if(n[i].visible)return i===e}initIndexAttribute(){if(!this._renderer){this.count=0;return}const e=this._renderer.getContext(),n=this._capacity,i=new Uint32Array(n);for(let r=0;r<n;r++)i[r]=r;this.instanceIndex=new E4e(e,e.UNSIGNED_INT,1,4,i),this._geometry.setAttribute("instanceIndex",this.instanceIndex)}initLastRenderInfo(){this._parentLOD||(this._lastRenderInfo={frame:-1,camera:null,shadowCamera:null})}initMatricesTexture(){this._parentLOD||(this.matricesTexture=new wT(Float32Array,4,4,this._capacity))}initColorsTexture(){this._parentLOD||(this.colorsTexture=new wT(Float32Array,4,1,this._capacity),this.colorsTexture.colorSpace=pi.workingColorSpace,this.colorsTexture._data.fill(1),this.materialsNeedsUpdate())}materialsNeedsUpdate(){if(this.material.isMaterial){this.material.needsUpdate=!0;return}for(const e of this.material)e.needsUpdate=!0}patchGeometry(e){const n=e.getAttribute("instanceIndex");if(n){if(n===this.instanceIndex)return;console.warn("The geometry has been cloned because it was already used."),e=e.clone(),e.deleteAttribute("instanceIndex")}this.instanceIndex&&e.setAttribute("instanceIndex",this.instanceIndex)}patchMaterial(e,n){this._currentMaterial=n,this._customProgramCacheKeyBase=n.customProgramCacheKey,this._onBeforeCompileBase=n.onBeforeCompile,n.customProgramCacheKey=this._customProgramCacheKey,n.onBeforeCompile=this._onBeforeCompile,A4e(this,e,n)}unpatchMaterial(e,n){this._currentMaterial=null,C4e(e),n.onBeforeCompile=this._onBeforeCompileBase,n.customProgramCacheKey=this._customProgramCacheKeyBase,this._onBeforeCompileBase=null,this._customProgramCacheKeyBase=null}computeBVH(e={}){this.bvh||(this.bvh=new w4e(this,e.margin,e.getBBoxFromBSphere,e.accurateCulling)),this.bvh.clear(),this.bvh.create()}disposeBVH(){this.bvh=null}setMatrixAt(e,n){if(n.toArray(this.matricesTexture._data,e*16),this.instances){const i=this.instances[e];n.decompose(i.position,i.quaternion,i.scale)}this.matricesTexture.enqueueUpdate(e),this.bvh&&this.autoUpdateBVH&&this.bvh.move(e)}getMatrixAt(e,n=O4e){return n.fromArray(this.matricesTexture._data,e*16)}getPositionAt(e,n=I4e){const i=e*16,r=this.matricesTexture._data;return n.x=r[i+12],n.y=r[i+13],n.z=r[i+14],n}getPositionAndMaxScaleOnAxisAt(e,n){const i=e*16,r=this.matricesTexture._data,a=r[i+0],s=r[i+1],o=r[i+2],l=a*a+s*s+o*o,c=r[i+4],u=r[i+5],f=r[i+6],h=c*c+u*u+f*f,d=r[i+8],g=r[i+9],b=r[i+10],y=d*d+g*g+b*b;return n.x=r[i+12],n.y=r[i+13],n.z=r[i+14],Math.sqrt(Math.max(l,h,y))}applyMatrixAtToSphere(e,n,i,r){const a=e*16,s=this.matricesTexture._data,o=s[a+0],l=s[a+1],c=s[a+2],u=s[a+3],f=s[a+4],h=s[a+5],d=s[a+6],g=s[a+7],b=s[a+8],y=s[a+9],p=s[a+10],x=s[a+11],_=s[a+12],w=s[a+13],M=s[a+14],S=s[a+15],A=n.center,C=i.x,D=i.y,R=i.z,N=1/(u*C+g*D+x*R+S);A.x=(o*C+f*D+b*R+_)*N,A.y=(l*C+h*D+y*R+w)*N,A.z=(c*C+d*D+p*R+M)*N;const U=o*o+l*l+c*c,j=f*f+h*h+d*d,z=b*b+y*y+p*p;n.radius=r*Math.sqrt(Math.max(U,j,z))}setVisibilityAt(e,n){this.availabilityArray[e*2]=n,this._indexArrayNeedsUpdate=!0}getVisibilityAt(e){return this.availabilityArray[e*2]}setActiveAt(e,n){this.availabilityArray[e*2+1]=n,this._indexArrayNeedsUpdate=!0}getActiveAt(e){return this.availabilityArray[e*2+1]}getActiveAndVisibilityAt(e){const n=e*2,i=this.availabilityArray;return i[n]&&i[n+1]}setActiveAndVisibilityAt(e,n){const i=e*2,r=this.availabilityArray;r[i]=n,r[i+1]=n,this._indexArrayNeedsUpdate=!0}setColorAt(e,n){this.colorsTexture===null&&this.initColorsTexture(),n.isColor?n.toArray(this.colorsTexture._data,e*4):SG.set(n).toArray(this.colorsTexture._data,e*4),this.colorsTexture.enqueueUpdate(e)}getColorAt(e,n=SG){return n.fromArray(this.colorsTexture._data,e*4)}setOpacityAt(e,n){this._useOpacity||(this.colorsTexture===null?this.initColorsTexture():this.materialsNeedsUpdate(),this._useOpacity=!0),this.colorsTexture._data[e*4+3]=n,this.colorsTexture.enqueueUpdate(e)}getOpacityAt(e){return this._useOpacity?this.colorsTexture._data[e*4+3]:1}copyTo(e,n){this.getMatrixAt(e,n.matrix).decompose(n.position,n.quaternion,n.scale)}computeBoundingBox(){const e=this._geometry,n=this._instancesArrayCount;this.boundingBox??(this.boundingBox=new rr),e.boundingBox===null&&e.computeBoundingBox();const i=e.boundingBox,r=this.boundingBox;r.makeEmpty();for(let a=0;a<n;a++)this.getActiveAt(a)&&(xG.copy(i).applyMatrix4(this.getMatrixAt(a)),r.union(xG))}computeBoundingSphere(){const e=this._geometry,n=this._instancesArrayCount;this.boundingSphere??(this.boundingSphere=new Ir),e.boundingSphere===null&&e.computeBoundingSphere();const i=e.boundingSphere,r=this.boundingSphere;r.makeEmpty();for(let a=0;a<n;a++)this.getActiveAt(a)&&(_G.copy(i).applyMatrix4(this.getMatrixAt(a)),r.union(_G))}clone(e){const n={capacity:this._capacity,renderer:this._renderer,allowsEuler:this._allowsEuler,createEntities:this._createEntities};return new this.constructor(this.geometry,this.material,n).copy(this,e)}copy(e,n){return super.copy(e,n),this.count=e._capacity,this._instancesCount=e._instancesCount,this._instancesArrayCount=e._instancesArrayCount,this._capacity=e._capacity,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this.matricesTexture=e.matricesTexture.clone(),this.matricesTexture.image.data=this.matricesTexture.image.data.slice(),e.colorsTexture!==null&&(this.colorsTexture=e.colorsTexture.clone(),this.colorsTexture.image.data=this.colorsTexture.image.data.slice()),e.uniformsTexture!==null&&(this.uniformsTexture=e.uniformsTexture.clone(),this.uniformsTexture.image.data=this.uniformsTexture.image.data.slice()),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone(),this.morphTexture.image.data=this.morphTexture.image.data.slice()),e.boneTexture!==null&&(this.boneTexture=e.boneTexture.clone(),this.boneTexture.image.data=this.boneTexture.image.data.slice()),this}dispose(){var e,n,i,r;this.dispatchEvent({type:"dispose"}),this.matricesTexture.dispose(),(e=this.colorsTexture)==null||e.dispose(),(n=this.morphTexture)==null||n.dispose(),(i=this.boneTexture)==null||i.dispose(),(r=this.uniformsTexture)==null||r.dispose()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMatrixInverse&&(this.bindMode===F1?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===kP?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("Unrecognized bindMode: "+this.bindMode))}};const D4e=1e3,xG=new rr,_G=new Ir,O4e=new Ot,SG=new Ut,I4e=new te;Rn.prototype.resizeBuffers=function(t){var e;const n=this._capacity;this._capacity=t;const i=Math.min(t,n);if(this.instanceIndex){const r=new Uint32Array(t);r.set(new Uint32Array(this.instanceIndex.array.buffer,0,i)),this.instanceIndex.array=r}if(this.LODinfo){for(const r of this.LODinfo.objects)if(r._capacity=t,r.instanceIndex){const a=new Uint32Array(t);a.set(new Uint32Array(r.instanceIndex.array.buffer,0,i)),r.instanceIndex.array=a}}if(this.availabilityArray.length=t*2,this.matricesTexture.resize(t),this.colorsTexture&&(this.colorsTexture.resize(t),t>n&&this.colorsTexture._data.fill(1,n*4)),this.morphTexture){const r=this.morphTexture.image.data,a=r.length/n;this.morphTexture.dispose(),this.morphTexture=new rs(new Float32Array(a*t),a,t,wh,yr),this.morphTexture.image.data.set(r)}return(e=this.uniformsTexture)==null||e.resize(t),this};Rn.prototype.setInstancesArrayCount=function(t){if(t<this._instancesArrayCount){const n=this.bvh;if(n)for(let i=this._instancesArrayCount-1;i>=t;i--)this.getActiveAt(i)&&n.delete(i);this._instancesArrayCount=t;return}if(t>this._capacity){let n=this._capacity+(this._capacity>>1)+512;for(;n<t;)n+=(n>>1)+512;this.resizeBuffers(n)}const e=this._instancesArrayCount;this._instancesArrayCount=t,this._createEntities&&this.createEntities(e)};function Ete(t,e){return t.depth-e.depth}function Mte(t,e){return e.depth-t.depth}class N4e{constructor(){this.array=[],this.pool=[]}push(e,n){const i=this.pool,r=this.array,a=r.length;a>=i.length&&i.push({depth:null,index:null,depthSort:null});const s=i[a];s.depth=e,s.index=n,r.push(s)}reset(){this.array.length=0}}const ET=new Kd,cu=new N4e,Ym=new Ot,T0=new Ot,VC=new te,rS=new te,A0=new te,L4e=new te,eu=new Ir;Rn.prototype.performFrustumCulling=function(t,e=t){const n=this._parentLOD??this,i=n.LODinfo;let r;if(i){r=t!==e?i.shadowRender??i.render:i.render;for(const a of i.objects)a.count=0}else n.count=0;n._instancesArrayCount!==0&&(r?.levels.length>0?n.frustumCullingLOD(r,t,e):n.frustumCulling(t))};Rn.prototype.frustumCullingAlreadyPerformed=function(t,e,n){const i=this._lastRenderInfo;return i.frame===t&&i.camera===e&&i.shadowCamera===n?!0:(i.frame=t,i.camera=e,i.shadowCamera=n,!1)};Rn.prototype.frustumCulling=function(t){var e;const n=this._sortObjects,i=this._perObjectFrustumCulled,r=this.instanceIndex.array;if(this.instanceIndex._needsUpdate=!0,!i&&!n){this.updateIndexArray();return}if(n&&(T0.copy(this.matrixWorld).invert(),rS.setFromMatrixPosition(t.matrixWorld).applyMatrix4(T0),VC.set(0,0,-1).transformDirection(t.matrixWorld).transformDirection(T0)),i?(Ym.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse).multiply(this.matrixWorld),this.bvh?this.BVHCulling(t):this.linearCulling(t)):this.updateRenderList(),n){const a=this.customSort;a===null?cu.array.sort((e=this.material)!=null&&e.transparent?Mte:Ete):a(cu.array);const s=cu.array,o=s.length;for(let l=0;l<o;l++)r[l]=s[l].index;this.count=o,cu.reset()}};Rn.prototype.updateIndexArray=function(){if(!this._indexArrayNeedsUpdate)return;const t=this.instanceIndex.array,e=this._instancesArrayCount;let n=0;for(let i=0;i<e;i++)this.getActiveAndVisibilityAt(i)&&(t[n++]=i);this.count=n,this._indexArrayNeedsUpdate=!1};Rn.prototype.updateRenderList=function(){const t=this._instancesArrayCount;for(let e=0;e<t;e++)if(this.getActiveAndVisibilityAt(e)){const n=this.getPositionAt(e).sub(rS).dot(VC);cu.push(n,e)}};Rn.prototype.BVHCulling=function(t){const e=this.instanceIndex.array,n=this._instancesArrayCount,i=this._sortObjects,r=this.onFrustumEnter;let a=0;this.bvh.frustumCulling(Ym,s=>{const o=s.object;if(o<n&&this.getVisibilityAt(o)&&(!r||r(o,t)))if(i){const l=this.getPositionAt(o).sub(rS).dot(VC);cu.push(l,o)}else e[a++]=o}),this.count=a};Rn.prototype.linearCulling=function(t){const e=this.instanceIndex.array;this.geometry.boundingSphere||this.geometry.computeBoundingSphere();const n=this._geometry.boundingSphere,i=n.radius,r=n.center,a=this._instancesArrayCount,s=r.x===0&&r.y===0&&r.z===0,o=this._sortObjects,l=this.onFrustumEnter;let c=0;ET.setFromProjectionMatrix(Ym);for(let u=0;u<a;u++)if(this.getActiveAndVisibilityAt(u)){if(s){const f=this.getPositionAndMaxScaleOnAxisAt(u,eu.center);eu.radius=i*f}else this.applyMatrixAtToSphere(u,eu,r,i);if(ET.intersectsSphere(eu)&&(!l||l(u,t)))if(o){const f=L4e.subVectors(eu.center,rS).dot(VC);cu.push(f,u)}else e[c++]=u}this.count=c};Rn.prototype.frustumCullingLOD=function(t,e,n){var i,r;const{count:a,levels:s}=t,o=e===n&&this._sortObjects;for(let c=0;c<s.length;c++)a[c]=0,s[c].object.instanceIndex&&(s[c].object.instanceIndex._needsUpdate=!0);Ym.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse).multiply(this.matrixWorld),T0.copy(this.matrixWorld).invert(),rS.setFromMatrixPosition(e.matrixWorld).applyMatrix4(T0),A0.setFromMatrixPosition(n.matrixWorld).applyMatrix4(T0);const l=t.levels.map(c=>c.object.instanceIndex.array);if(this.bvh?this.BVHCullingLOD(t,l,o,e,n):this.linearCullingLOD(t,l,o,e,n),o){const c=this.customSort,u=cu.array;let f=0,h=s[1].distance;c===null?u.sort((i=s[0].object.material)!=null&&i.transparent?Mte:Ete):c(u);for(let d=0,g=u.length;d<g;d++){const b=u[d];b.depth>h&&(f++,h=((r=s[f+1])==null?void 0:r.distance)??1/0),l[f][a[f]++]=b.index}cu.reset()}for(let c=0;c<s.length;c++){const u=s[c].object;u.count=a[c]}};Rn.prototype.BVHCullingLOD=function(t,e,n,i,r){const{count:a,levels:s}=t,o=this._instancesArrayCount,l=this.onFrustumEnter;n?this.bvh.frustumCulling(Ym,c=>{const u=c.object;if(u<o&&this.getVisibilityAt(u)&&(!l||l(u,i,r))){const f=this.getPositionAt(u).distanceToSquared(A0);cu.push(f,u)}}):this.bvh.frustumCullingLOD(Ym,A0,s,(c,u)=>{const f=c.object;if(f<o&&this.getVisibilityAt(f)){if(u===null){const h=this.getPositionAt(f).distanceToSquared(A0);u=this.getObjectLODIndexForDistance(s,h)}(!l||l(f,i,r,u))&&(e[u][a[u]++]=f)}})};Rn.prototype.linearCullingLOD=function(t,e,n,i,r){const{count:a,levels:s}=t;this.geometry.boundingSphere||this.geometry.computeBoundingSphere();const o=this._geometry.boundingSphere,l=o.radius,c=o.center,u=this._instancesArrayCount,f=c.x===0&&c.y===0&&c.z===0,h=this.onFrustumEnter;ET.setFromProjectionMatrix(Ym);for(let d=0;d<u;d++)if(this.getActiveAndVisibilityAt(d)){if(f){const g=this.getPositionAndMaxScaleOnAxisAt(d,eu.center);eu.radius=l*g}else this.applyMatrixAtToSphere(d,eu,c,l);if(ET.intersectsSphere(eu))if(n){if(!h||h(d,i,r))continue;const g=eu.center.distanceToSquared(A0);cu.push(g,d)}else{const g=eu.center.distanceToSquared(A0),b=this.getObjectLODIndexForDistance(s,g);(!h||h(d,i,r,b))&&(e[b][a[b]++]=d)}}};Rn.prototype.clearTempInstance=function(t){const e=this._tempInstance;return e.id=t,this.clearInstance(e)};Rn.prototype.clearTempInstancePosition=function(t){const e=this._tempInstance;return e.id=t,e.position.set(0,0,0),e};Rn.prototype.clearInstance=function(t){return t.position.set(0,0,0),t.scale.set(1,1,1),t.quaternion.identity(),t};Rn.prototype.updateInstances=function(t){const e=this._instancesArrayCount,n=this.instances;for(let i=0;i<e;i++){if(!this.getActiveAt(i))continue;const r=n?n[i]:this.clearTempInstance(i);t(r,i),r.updateMatrix()}return this};Rn.prototype.updateInstancesPosition=function(t){const e=this._instancesArrayCount,n=this.instances;for(let i=0;i<e;i++){if(!this.getActiveAt(i))continue;const r=n?n[i]:this.clearTempInstancePosition(i);t(r,i),r.updateMatrixPosition()}return this};Rn.prototype.createEntities=function(t){const e=this._instancesArrayCount;if(!this.instances)this.instances=new Array(e);else if(this.instances.length<e)this.instances.length=e;else return this;const n=this.instances;for(let i=t;i<e;i++)n[i]||(n[i]=new Ste(this,i,this._allowsEuler));return this};Rn.prototype.addInstances=function(t,e){!e&&this.bvh&&console.warn("InstancedMesh2: if `computeBVH()` has already been called, it is better to valorize the instances in the `onCreation` callback for better performance.");const n=this._freeIds;if(n.length>0){let a=-1;const s=Math.min(n.length,t),o=n.length-s;for(let l=n.length-1;l>=o;l--){const c=n[l];c>a&&(a=c),this.addInstance(c,e)}n.length-=s,t-=s,this._instancesArrayCount=Math.max(a+1,this._instancesArrayCount)}const i=this._instancesArrayCount,r=i+t;this.setInstancesArrayCount(r);for(let a=i;a<r;a++)this.addInstance(a,e);return this};Rn.prototype.addInstance=function(t,e){var n;this._instancesCount++,this.setActiveAndVisibilityAt(t,!0);const i=this.instances?this.clearInstance(this.instances[t]):this.clearTempInstance(t);e?(e(i,t),i.updateMatrix()):i.setMatrixIdentity(),(n=this.bvh)==null||n.insert(t)};Rn.prototype.removeInstances=function(...t){const e=this._freeIds,n=this.bvh;for(const i of t)i<this._instancesArrayCount&&this.getActiveAt(i)&&(this.setActiveAt(i,!1),e.push(i),n?.delete(i),this._instancesCount--);for(let i=this._instancesArrayCount-1;i>=0&&!this.getActiveAt(i);i--)this._instancesArrayCount--;return this};Rn.prototype.clearInstances=function(){var t;if(this._instancesCount=0,this._instancesArrayCount=0,this._freeIds.length=0,(t=this.bvh)==null||t.clear(),this.LODinfo)for(const e of this.LODinfo.objects)e.count=0;return this};Rn.prototype.getObjectLODIndexForDistance=function(t,e){for(let n=t.length-1;n>0;n--){const i=t[n],r=i.distance-i.distance*i.hysteresis;if(e>=r)return n}return 0};Rn.prototype.setFirstLODDistance=function(t){if(this._parentLOD)throw new Error("Cannot create LOD for this InstancedMesh2.");return this.LODinfo||(this.LODinfo={render:null,shadowRender:null,objects:[this]}),this.LODinfo.render||(this.LODinfo.render={levels:[{distance:t,hysteresis:0,object:this}],count:[0]}),this};Rn.prototype.addLOD=function(t,e,n=0,i=0){var r;if(this._parentLOD)throw new Error("Cannot create LOD for this InstancedMesh2.");if(!((r=this.LODinfo)!=null&&r.render)&&n===0)throw new Error('Cannot set distance to 0 for the first LOD. Call "setFirstLODDistance" method before use "addLOD".');return this.setFirstLODDistance(0),this.addLevel(this.LODinfo.render,t,e,n,i),this};Rn.prototype.addShadowLOD=function(t,e=0,n=0){if(this._parentLOD)throw new Error("Cannot create LOD for this InstancedMesh2.");this.LODinfo||(this.LODinfo={render:null,shadowRender:null,objects:[this]}),this.LODinfo.shadowRender||(this.LODinfo.shadowRender={levels:[],count:[]});const i=this.addLevel(this.LODinfo.shadowRender,t,null,e,n);return i.castShadow=!0,this.castShadow=!0,this};Rn.prototype.addLevel=function(t,e,n,i,r){const a=this.LODinfo.objects,s=t.levels;let o,l;i=i**2;const c=a.findIndex(u=>u.geometry===e);if(c===-1){const u={capacity:this._capacity,renderer:this._renderer};l=new Rn(e,n??new ss,u,this),l.frustumCulled=!1,this.patchLevel(l),a.push(l),this.add(l)}else l=a[c],n&&(l.material=n);for(o=0;o<s.length&&!(i<s[o].distance);o++);return s.splice(o,0,{distance:i,hysteresis:r,object:l}),t.count.push(0),l};Rn.prototype.updateLevel=function(t,e,n,i){if(!t)throw new Error("Render list is invalid.");const r=t.levels[e];if(!r)throw new Error("Cannot update an empty LOD.");if(n!=null&&!Number.isNaN(n)){const a=n**2;r.distance=a}return i!=null&&!Number.isNaN(i)&&(r.hysteresis=i),this};Rn.prototype.updateLOD=function(t,e,n){var i;const r=(i=this==null?void 0:this.LODinfo)==null?void 0:i.render;if(t===0)throw new Error("Cannot change distance for LOD0. It is the main mesh and must stay at 0.");return this.updateLevel(r,t,e,n)};Rn.prototype.updateShadowLOD=function(t,e,n){var i;return this.updateLevel((i=this.LODinfo)==null?void 0:i.shadowRender,t,e,n)};Rn.prototype.updateAllLevels=function(t,e,n){var i;if(!(t!=null&&t.levels))throw new Error("Invalid LOD list.");const r=t.levels,a=((i=this.LODinfo)==null?void 0:i.render)===t,s=a?1:0;a&&(r[0].distance=0);const o=e?.length>0;let l=[];o&&(l=a&&e[0]===0?e.slice(1,Math.min(r.length,e.length)):e.slice(0,Math.min(r.length-s,e.length)),l.every((u,f)=>{if(f>0&&u<=l[f-1])throw new Error(`LOD distances must be strictly increasing: d[${f-1}]=${l[f-1]} < d[${f}]=${u}`);return!0}));const c=o?l.length:r.length-s;for(let u=0;u<c;u++){const f=o?l[u]:void 0,h=Array.isArray(n)?n[u]:n;this.updateLevel(t,s+u,f,h)}return this};Rn.prototype.updateAllLOD=function(t,e){var n;return this.updateAllLevels((n=this.LODinfo)==null?void 0:n.render,t,e)};Rn.prototype.updateAllShadowLOD=function(t,e){var n;return this.updateAllLevels((n=this.LODinfo)==null?void 0:n.shadowRender,t,e)};Rn.prototype.disposeLOD=function(t){t.geometry.dispose();const e=t.material;if(Array.isArray(e))for(const n of e)n.dispose();else e.dispose()};Rn.prototype.removeLOD=function(t,e=!0){var n,i,r,a,s,o;const l=this.LODinfo,c=l?.render;if(!(c!=null&&c.levels))throw new Error("Invalid LOD list.");const u=c.levels.length;if(t<0||t>=u)throw new Error("Level index OOB");if(u>1&&t===0)throw new Error("Cannot remove LOD0 while others exist");const[f]=c.levels.splice(t,1);(i=(n=c.count)==null?void 0:n.splice)==null||i.call(n,t,1),c.levels.length<=1&&(l.render=null);const h=f.object,d=(r=this.LODinfo)==null?void 0:r.shadowRender;if(d!=null&&d.levels&&t<d.levels.length&&(d.levels.splice(t,1),(s=(a=d.count)==null?void 0:a.splice)==null||s.call(a,t,1),d.levels.length===0&&(this.LODinfo.shadowRender=null)),e&&h!==this)try{this.remove(h);const g=((o=l.objects)==null?void 0:o.indexOf(h))??-1;g!==-1&&l.objects.splice(g,1),this.disposeLOD(h)}catch(g){console.error(g)}return this};Rn.prototype.patchLevel=function(t){Object.defineProperty(t,"renderOrder",{get(){return this._parentLOD.renderOrder}}),Object.defineProperty(t,"_lastRenderInfo",{get(){return this._parentLOD._lastRenderInfo}}),Object.defineProperty(t,"matricesTexture",{get(){return this._parentLOD.matricesTexture}}),Object.defineProperty(t,"colorsTexture",{get(){return this._parentLOD.colorsTexture}}),Object.defineProperty(t,"uniformsTexture",{get(){return this._parentLOD.uniformsTexture}}),Object.defineProperty(t,"morphTexture",{get(){return this._parentLOD.morphTexture}}),Object.defineProperty(t,"boneTexture",{get(){return this._parentLOD.boneTexture}}),Object.defineProperty(t,"skeleton",{get(){return this._parentLOD.skeleton}}),Object.defineProperty(t,"bindMatrixInverse",{get(){return this._parentLOD.bindMatrixInverse}}),Object.defineProperty(t,"bindMatrix",{get(){return this._parentLOD.bindMatrix}})};const P4e=new _i;Rn.prototype.getMorphAt=function(t,e=P4e){const n=e.morphTargetInfluences,i=this.morphTexture.source.data.data,r=n.length+1,a=t*r+1;for(let s=0;s<n.length;s++)n[s]=i[a+s];return e};Rn.prototype.setMorphAt=function(t,e){const n=e.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&!this._parentLOD&&(this.morphTexture=new rs(new Float32Array(i*this._capacity),i,this._capacity,wh,yr));const r=this.morphTexture.source.data.data;let a=0;for(const l of n)a+=l;const s=this._geometry.morphTargetsRelative?1:1-a,o=i*t;r[o]=s,r.set(n,o+1),this.morphTexture.needsUpdate=!0};const m8=[],MT=new _i,U4e=new pf,wG=new te,EG=new te,MG=new Ot,TG=new Ir;Rn.prototype.raycast=function(t,e){if(this._parentLOD||!this.material||this._instancesArrayCount===0||!this.instanceIndex)return;MT.geometry=this._geometry,MT.material=this.material;const n=t.ray,i=t.near,r=t.far;MG.copy(this.matrixWorld).invert(),EG.setFromMatrixScale(this.matrixWorld),wG.copy(t.ray.direction).multiply(EG);const a=wG.length();t.ray=U4e.copy(t.ray).applyMatrix4(MG),t.near/=a,t.far/=a,this.raycastInstances(t,e),t.ray=n,t.near=i,t.far=r};Rn.prototype.raycastInstances=function(t,e){if(this.bvh)this.bvh.raycast(t,n=>this.checkObjectIntersection(t,n,e));else{if(this.boundingSphere===null&&this.computeBoundingSphere(),TG.copy(this.boundingSphere),!t.ray.intersectsSphere(TG))return;const n=this.instanceIndex.array,i=this.raycastOnlyFrustum&&this._perObjectFrustumCulled?this.count:this._instancesArrayCount;for(let r=0;r<i;r++)this.checkObjectIntersection(t,n[r],e)}};Rn.prototype.checkObjectIntersection=function(t,e,n){if(!(e>this._instancesArrayCount||!this.getActiveAndVisibilityAt(e))){this.getMatrixAt(e,MT.matrixWorld),MT.raycast(t,m8);for(const i of m8)i.instanceId=e,i.object=this,n.push(i);m8.length=0}};Rn.prototype.initSkeleton=function(t,e=!0){if(t&&this.skeleton!==t&&!this._parentLOD){const n=t.bones;if(this.skeleton=t,this.bindMatrix=new Ot,this.bindMatrixInverse=new Ot,this.boneTexture=new wT(Float32Array,4,4*n.length,this._capacity),e)for(const i of n)i.matrixAutoUpdate=!1,i.matrixWorldAutoUpdate=!1;this.materialsNeedsUpdate()}};Rn.prototype.setBonesAt=function(t,e=!0,n){const i=this.skeleton;if(!i)throw new Error('"setBonesAt" cannot be called before "initSkeleton"');const r=i.bones,a=i.boneInverses;for(let s=0,o=r.length;s<o;s++){const l=r[s];e&&(n!=null&&n.has(l.name)||l.updateMatrix(),l.matrixWorld.multiplyMatrices(l.parent.matrixWorld,l.matrix)),this.multiplyBoneMatricesAt(t,s,l.matrixWorld,a[s])}this.boneTexture.enqueueUpdate(t)};Rn.prototype.multiplyBoneMatricesAt=function(t,e,n,i){const r=(t*this.skeleton.bones.length+e)*16,a=n.elements,s=i.elements,o=this.boneTexture._data,l=a[0],c=a[4],u=a[8],f=a[12],h=a[1],d=a[5],g=a[9],b=a[13],y=a[2],p=a[6],x=a[10],_=a[14],w=a[3],M=a[7],S=a[11],A=a[15],C=s[0],D=s[4],R=s[8],N=s[12],U=s[1],j=s[5],z=s[9],q=s[13],B=s[2],G=s[6],H=s[10],W=s[14],F=s[3],Y=s[7],Z=s[11],V=s[15];o[r+0]=l*C+c*U+u*B+f*F,o[r+4]=l*D+c*j+u*G+f*Y,o[r+8]=l*R+c*z+u*H+f*Z,o[r+12]=l*N+c*q+u*W+f*V,o[r+1]=h*C+d*U+g*B+b*F,o[r+5]=h*D+d*j+g*G+b*Y,o[r+9]=h*R+d*z+g*H+b*Z,o[r+13]=h*N+d*q+g*W+b*V,o[r+2]=y*C+p*U+x*B+_*F,o[r+6]=y*D+p*j+x*G+_*Y,o[r+10]=y*R+p*z+x*H+_*Z,o[r+14]=y*N+p*q+x*W+_*V,o[r+3]=w*C+M*U+S*B+A*F,o[r+7]=w*D+M*j+S*G+A*Y,o[r+11]=w*R+M*z+S*H+A*Z,o[r+15]=w*N+M*q+S*W+A*V};Rn.prototype.getUniformAt=function(t,e,n){if(!this.uniformsTexture)throw new Error(`Before get/set uniform, it's necessary to use "initUniformsPerInstance".`);return this.uniformsTexture.getUniformAt(t,e,n)};Rn.prototype.setUniformAt=function(t,e,n){if(!this.uniformsTexture)throw new Error(`Before get/set uniform, it's necessary to use "initUniformsPerInstance".`);this.uniformsTexture.setUniformAt(t,e,n),this.uniformsTexture.enqueueUpdate(t)};Rn.prototype.initUniformsPerInstance=function(t){if(!this._parentLOD){const{channels:e,pixelsPerInstance:n,uniformMap:i,fetchInFragmentShader:r}=this.getUniformSchemaResult(t);this.uniformsTexture=new wT(Float32Array,e,n,this._capacity,i,r),this.materialsNeedsUpdate()}};Rn.prototype.getUniformSchemaResult=function(t){let e=0;const n=new Map,i=[],r=t.vertex??{},a=t.fragment??{};let s=!0;for(const c in r){const u=r[c],f=this.getUniformSize(u);e+=f,i.push({name:c,type:u,size:f}),s=!1}for(const c in a)if(!r[c]){const u=a[c],f=this.getUniformSize(u);e+=f,i.push({name:c,type:u,size:f})}i.sort((c,u)=>u.size-c.size);const o=[];for(const{name:c,size:u,type:f}of i){const h=this.getUniformOffset(u,o);n.set(c,{offset:h,size:u,type:f})}const l=Math.ceil(e/4);return{channels:Math.min(e,4),pixelsPerInstance:l,uniformMap:n,fetchInFragmentShader:s}};Rn.prototype.getUniformOffset=function(t,e){if(t<4){for(let i=0;i<e.length;i++)if(e[i]+t<=4){const r=i*4+e[i];return e[i]+=t,r}}const n=e.length*4;for(;t>0;t-=4)e.push(t);return n};Rn.prototype.getUniformSize=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;case"mat3":return 9;case"mat4":return 16;default:throw new Error(`Invalid uniform type: ${t}`)}};var F4e=`#ifdef USE_INSTANCING_INDIRECT\r
  attribute uint instanceIndex;\r
  uniform highp sampler2D matricesTexture;  

  mat4 getInstancedMatrix() {\r
    int size = textureSize( matricesTexture, 0 ).x;\r
    int j = int( instanceIndex ) * 4;\r
    int x = j % size;\r
    int y = j / size;\r
    vec4 v1 = texelFetch( matricesTexture, ivec2( x, y ), 0 );\r
    vec4 v2 = texelFetch( matricesTexture, ivec2( x + 1, y ), 0 );\r
    vec4 v3 = texelFetch( matricesTexture, ivec2( x + 2, y ), 0 );\r
    vec4 v4 = texelFetch( matricesTexture, ivec2( x + 3, y ), 0 );\r
    return mat4( v1, v2, v3, v4 );\r
  }\r
#endif`,B4e=`#ifdef USE_INSTANCING_COLOR_INDIRECT\r
  uniform highp sampler2D colorsTexture;

  #ifdef USE_COLOR_ALPHA\r
    vec4 getColorTexture() {\r
      int size = textureSize( colorsTexture, 0 ).x;\r
      int j = int( instanceIndex );\r
      int x = j % size;\r
      int y = j / size;\r
      return texelFetch( colorsTexture, ivec2( x, y ), 0 );\r
    }\r
  #else\r
    vec3 getColorTexture() {\r
      int size = textureSize( colorsTexture, 0 ).x;\r
      int j = int( instanceIndex );\r
      int x = j % size;\r
      int y = j / size;\r
      return texelFetch( colorsTexture, ivec2( x, y ), 0 ).rgb;\r
    }\r
  #endif\r
#endif`,z4e=`#ifdef USE_INSTANCING_INDIRECT\r
  mat4 instanceMatrix = getInstancedMatrix();

  #ifdef USE_INSTANCING_COLOR_INDIRECT\r
    vColor *= getColorTexture();\r
  #endif\r
#endif`,j4e=`#ifdef USE_INSTANCING_COLOR_INDIRECT\r
  #ifdef USE_VERTEX_COLOR\r
    vColor = color;\r
  #else\r
    #ifdef USE_COLOR_ALPHA\r
      vColor = vec4( 1.0 );\r
    #else\r
      vColor = vec3( 1.0 );\r
    #endif\r
  #endif\r
#endif`,H4e=`#ifdef USE_SKINNING\r
  uniform mat4 bindMatrix;\r
  uniform mat4 bindMatrixInverse;\r
  uniform highp sampler2D boneTexture;

  #ifdef USE_INSTANCING_SKINNING\r
    uniform int bonesPerInstance;\r
  #endif

  mat4 getBoneMatrix( const in float i ) {\r
    int size = textureSize( boneTexture, 0 ).x;

    #ifdef USE_INSTANCING_SKINNING\r
      int j = ( bonesPerInstance * int( instanceIndex ) + int( i ) ) * 4;\r
    #else\r
      int j = int( i ) * 4;\r
    #endif

    int x = j % size;\r
    int y = j / size;\r
    vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\r
    vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\r
    vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\r
    vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\r
    return mat4( v1, v2, v3, v4 );\r
  }\r
#endif`;ln.instanced_pars_vertex=F4e;ln.instanced_color_pars_vertex=B4e;ln.instanced_vertex=z4e;ln.instanced_color_vertex=j4e;function y4(t){return t.replace("#ifdef USE_INSTANCING","#if defined USE_INSTANCING || defined USE_INSTANCING_INDIRECT")}ln.project_vertex=y4(ln.project_vertex);ln.worldpos_vertex=y4(ln.worldpos_vertex);ln.defaultnormal_vertex=y4(ln.defaultnormal_vertex);ln.batching_pars_vertex=ln.batching_pars_vertex.concat(`
#include <instanced_pars_vertex>`);ln.color_pars_vertex=ln.color_pars_vertex.concat(`
#include <instanced_color_pars_vertex>`);ln.batching_vertex=ln.batching_vertex.concat(`
#include <instanced_vertex>`);ln.skinning_pars_vertex=H4e;ln.morphinstance_vertex&&(ln.morphinstance_vertex=ln.morphinstance_vertex.replaceAll("gl_InstanceID","instanceIndex"));(function(){var t="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuec;G:Qdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq;i28Adbk:Bhdhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;C:kjjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8AarcUf9cb83ibarc8Wf9cb83ibarcyf9cb83ibarcaf9cb83ibarcKf9cb83ibarczf9cb83ibar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzarc;qofcKfhHarc;qofczfhOcbhAincdhCcbhodnavci6mbaH9cb83ibaO9cb83ibar9cb83i;yoar9cb83i;qoadaAfgoybbhXcbhQincbhwcbhLdninaoalfhKaoybbgYaX7aLVhLawcP0meaKhoaYhXawcefgwaQfai6mbkkcbhXarc;qofhwincwh8AcwhEdnaLaX93gocFeGg3cs0mbclhEa3ci0mba3cb9hcethEkdnaocw4cFeGg3cs0mbclh8Aa3ci0mba3cb9hceth8Aka8AaEfh3awydbh5cwh8AcwhEdnaocz4cFeGg8Ecs0mbclhEa8Eci0mba8Ecb9hcethEka3a5fh3dnaocFFFFb0mbclh8AaocFFF8F0mbaocFFFr0ceth8Akawa3aEfa8AfBdbawclfhwaXcefgXcw9hmbkaKhoaYhXaQczfgQai6mbkcbhocehwazhLinawaoaLydbarc;qofaocdtfydb6EhoaLclfhLawcefgwcw9hmbkcihCkcbh3arc;qlfcbcjdz:xjjjb8Aarc;alfcwfcbBdbar9cb83i;alaoclth8Fadhaaqhhakh5inarc;qlfadcba3cufgoaoa30Eal2falz:wjjjb8Aaiahaiah6Ehgdnaqaia39Ra3aqfai6EgYcsfc9WGgoaY9nmbarc;qofaYfcbaoaY9Rz:xjjjb8Akada3al2fh8Jcbh8Kina8Ka8FVcl4hQarc;alfa8Kcdtfh8LaAh8Mcbh8Nina8NaAfhwdndndndndndna8KPldebidkasa8Mc98GgLfhoa5aLfh8Aarc;qlfawc98GgLfRbbhXcwhwinaoRbbawtaXVhXaocefhoawcwfgwca9hmbkaYTmla8Ncith8Ea8JaLfhEcbhKinaERbbhLcwhoa8AhwinawRbbaotaLVhLawcefhwaocwfgoca9hmbkarc;qofaKfaLaX7aQ93a8E486bba8Aalfh8AaEalfhEaLhXaKcefgKaY9hmbxlkkaYTmia8Mc9:Ghoa8NcitcwGhEarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhLarc;qofhwaghXinawa5aofRbbcwtaaaofRbbVg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbaoalfhoawcefhwa8AhLa3aXcufgX9hmbxikkaYTmda8Jawfhoarc;qlfawfRbbhLarc;qofhwaghXinawaoRbbg8AaL9RgLcetaLcKtcK91cr4786bbawcefhwaoalfhoa8AhLa3aXcufgX9hmbxdkkaYTmeka8LydbhEcbhKarc;qofhoincdhLcbhwinaLaoawfRbbcb9hfhLawcefgwcz9hmbkclhXcbhwinaXaoawfRbbcd0fhXawcefgwcz9hmbkcwh8Acbhwina8AaoawfRbbcP0fh8Aawcefgwcz9hmbkaLaXaLaX6Egwa8Aawa8A6Egwczawcz6EaEfhEaoczfhoaKczfgKaY6mbka8LaEBdbka8Mcefh8Ma8Ncefg8Ncl9hmbka8Kcefg8KaC9hmbkaaamfhaahaxfhha5amfh5a3axfg3ai6mbkcbhocehwaPhLinawaoaLydbarc;alfaocdtfydb6EhoaLclfhLawcefgXhwaCaX9hmbkaraAcd4fa8FcdVaoaocdSE86bbaAclfgAal6mbkkabaefh8Kabcefhoalcd4gecbaDEhkadcefhOarc;abfceVhHcbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aa8Kao9Rak6mdadamal2gwfhxcbh8JaOawfhzaocbakz:xjjjbghakfh5aqaiam9Ramaqfai6Egscsfgocl4cifcd4hCaoc9WGg8LThPindndndndndndndndndndnaDTmbara8Jcd4fRbbgLciGPlbedlbkasTmdaxa8Jfhoarc;abfa8JfRbbhLarc;qofhwashXinawaoRbbg8AaL9RgLcetaLcKtcK91cr4786bbawcefhwaoalfhoa8AhLaXcufgXmbxikkasTmia8JcitcwGhEarc;abfa8JceVfRbbcwtarc;abfa8Jc9:GgofRbbVhLaxaofhoarc;qofhwashXinawao8Vbbg8AaL9RgLcetaLcztcz91cs47cFFiGaE486bbawcefhwaoalfhoa8AhLaXcufgXmbxdkkaHa8Jc98GgEfhoazaEfh8Aarc;abfaEfRbbhXcwhwinaoRbbawtaXVhXaocefhoawcwfgwca9hmbkasTmbaLcl4hYa8JcitcKGh3axaEfhEcbhKinaERbbhLcwhoa8AhwinawRbbaotaLVhLawcefhwaocwfgoca9hmbkarc;qofaKfaLaX7aY93a3486bba8Aalfh8AaEalfhEaLhXaKcefgKas9hmbkkaDmbcbhoxlka8LTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8L9pmdxbkkdnavmbcehoxikcbhEaChKaChYinarc;qofaEfgocwf8Pibhyao8Pibh8PcdhLcbhwinaLaoawfRbbcb9hfhLawcefgwcz9hmbkclhXcbhwinaXaoawfRbbcd0fhXawcefgwcz9hmbkcwh8Acbhwina8AaoawfRbbcP0fh8Aawcefgwcz9hmbkaLaXaLaX6Egoa8Aaoa8A6Egoczaocz6EaYfhYaocucbaya8P:e9cb9sEgwaoaw6EaKfhKaEczfgEa8L9pmdxbkkaha8Jcd4fgoaoRbbcda8JcetcoGtV86bbxikdnaKas6mbaYas6mbaha8Jcd4fgoaoRbbcia8JcetcoGtV86bba8Ka59Ras6mra5arc;qofasz:wjjjbasfh5xikaKaY9phokaha8Jcd4fgwawRbbaoa8JcetcoGtV86bbka8Ka59RaC6mla5cbaCz:xjjjbgAaCfhYdndna8LmbaPhoxekdna8KaY9RcK9pmbaPhoxekaocdtc:q1jjbfcj1jjbaDEg5ydxggcetc;:FFFeGh8Fcuh3cuagtcu7cFeGhacbh8Marc;qofhLinarc;qofa8MfhQczhEdndndnagPDbeeeeeeedekcucbaQcwf8PibaQ8Pib:e9cb9sEhExekcbhoa8FhEinaEaaaLaofRbb9nfhEaocefgocz9hmbkkcih8Ecbh8Ainczhwdndndna5a8AcdtfydbgKPDbeeeeeeedekcucbaQcwf8PibaQ8Pib:e9cb9sEhwxekaKcetc;:FFFeGhwcuaKtcu7cFeGhXcbhoinawaXaLaofRbb9nfhwaocefgocz9hmbkkdndnawaE6mbaKa39hmeawaE9hmea5a8EcdtfydbcwSmeka8Ah8EawhEka8Acefg8Aci9hmbkaAa8Mco4fgoaoRbba8Ea8Mci4coGtV86bbdndndna5a8Ecdtfydbg3PDdbbbbbbbebkdncwa39Tg8ETmbcua3tcu7hwdndna3ceSmbcbh8NaLhQinaQhoa8Eh8AcbhXinaoRbbgEawcFeGgKaEaK6EaXa3tVhXaocefhoa8Acufg8AmbkaYaX86bbaQa8EfhQaYcefhYa8Na8Efg8Ncz6mbxdkkcbh8NaLhQinaQhoa8Eh8AcbhXinaoRbbgEawcFeGgKaEaK6EaXcetVhXaocefhoa8Acufg8AmbkaYaX:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaQa8EfhQaYcefhYa8Na8Efg8Ncz6mbkkcbhoinaYaLaofRbbgX86bbaYaXawcFeG9pfhYaocefgocz9hmbxikkdna3ceSmbinaYcb86bbaYcefhYxbkkinaYcb86bbaYcefhYxbkkaYaQ8Pbb83bbaYcwfaQcwf8Pbb83bbaYczfhYka8Mczfg8Ma8L9pgomeaLczfhLa8KaY9RcK9pmbkkaoTmlaYh5aYTmlka8Jcefg8Jal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma5hoa5mbkcbhwxdkdna8Kao9RakalfgwcKcaaDEgLawaL0EgX9pmbcbhwxdkdnawaL9pmbaocbaXaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoaraez:wjjjbaefhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;C:kjjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;C:kjjbk:Ese5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd;m:kjjbgrc;GeV86bbalc;abfcFecjez:xjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc;i1jjbfydbcdtfydbh3aLaoc;e1jjbfydbcdtfydbh8AaLaoc;a1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc;a1jjbfydbcdtfydbgKTaLavc;e1jjbfydbcdtfydbg8AceSGaLavc;i1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavc:W1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkdnaeaP9nmbcbhvxekcbhvinaeavfavc:W1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:kjjbk:Adewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb;m:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkdnaoar9nmbcbskaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b0Ec:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A0Ec:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk:Ylvdud99due99iudnaeTmbceaicufgvthocuaitcu7:Zhrcuavtcu7:Zhwcbhvadcl9hhDcbhqindndnalcwfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikdndnalIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohdxekcjjjj94hdkadai9Rcd9TgxaifhidndnalclfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEarNJbbbZMgk:lJbbb9p9DTmbak:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgkJbbbbakJbbbb9GEgkJbbjZakJbbjZ9FEawNJbbbZMgk:lJbbb9p9DTmbak:Ohmxekcjjjj94hmkadaifhiaoamVhmdndnaDmbabavfgPai86bbaPcifam86bbaPcdfad86bbaPcefax86bbxekabaqfgPai87ebaPcofam87ebaPclfad87ebaPcdfax87ebkalczfhlavclfhvaqcwfhqaecufgembkkk;YqdXui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AcbhodnadTmbcbhoaiTmbdndnabaeSmbaehrxekavcuadcdtgwadcFFFFi0Ecbyd;q:kjjbHjjjjbbgrBd:SeavceBd:mdaraeawz:wjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaradaiavc:Sefz:pjjjbavyd:GehDadci9Ugqcbyd;q:kjjbHjjjjbbheavc:Sefavyd:mdgkcdtfaeBdbavakcefgwBd:mdaecbaqz:xjjjbhxavc:SefawcdtfcuaicdtaicFFFFi0Ecbyd;q:kjjbHjjjjbbgmBdbavakcdfgPBd:mdalc;ebfhsaDheamhwinawalIdbasaeydbgzcwazcw6EcdtfIdbMUdbaeclfheawclfhwaicufgimbkavc:SefaPcdtfcuaqcdtadcFFFF970Ecbyd;q:kjjbHjjjjbbgPBdbdnadci6mbarheaPhwaqhiinawamaeydbcdtfIdbamaeclfydbcdtfIdbMamaecwfydbcdtfIdbMUdbaecxfheawclfhwaicufgimbkkakcifhoalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhzcbhwcbhXcehQinaehLcihkarawci2gKcdtfgeydbhsaeclfydbhdabaXcx2fgicwfaecwfydbgYBdbaiclfadBdbaiasBdbaxawfce86bbaOaYBdwaOadBdlaOasBdbaPawcdtfcbBdbdnazTmbcihkaLhiinaOakcdtfaiydbgeBdbakaeaY9haeas9haead9hGGfhkaiclfhiazcufgzmbkkaXcefhXcbhzinaCaAarazaKfcdtfydbcdtgifydbcdtfgYheaDaifgdydbgshidnasTmbdninaeydbawSmeaeclfheaicufgiTmdxbkkaeaYascdtfc98fydbBdbadadydbcufBdbkazcefgzci9hmbkdndnakTmbcuhwJbbbbh8Acbhdavyd:KehYavyd:OehKindndnaDaOadcdtfydbcdtgzfydbgembadcefhdxekadcs0hiamazfgsIdbhEasalcbadcefgdaiEcdtfIdbaHaecwaecw6EcdtfIdbMg3Udba3aE:th3aecdthiaKaYazfydbcdtfheinaPaeydbgzcdtfgsa3asIdbMgEUdbaEa8Aa8AaE9DgsEh8AazawasEhwaeclfheaic98fgimbkkadak9hmbkawcu9hmekaQaq9pmdindnaxaQfRbbmbaQhwxdkaqaQcefgQ9hmbxikkakczakcz6EhzaOheaLhOawcu9hmbkkaocdtavc:Seffc98fhedninaoTmeaeydbcbyd;u:kjjbH:bjjjbbaec98fheaocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd;q:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic;K1jjbz:ojjjbkQbabaeadaic;m:jjjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:Vvioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:kjjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:kjjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkclhvdninavc98Smealcxfavfydbcbyd;u:kjjbH:bjjjbbavc98fhvxbkkalc;Waf8Kjjjjbk:Jwliuo99iud9:cbhv8Jjjjjbca9Rgoczfcwfcbyd:8:kjjbBdbaocb8Pd:0:kjjb83izaocwfcbyd;i:kjjbBdbaocb8Pd;a:kjjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:kjjbgeabcifc98GfgbBd;y:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:kjjbgeabcrfc94GfgbBd;y:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;y:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;y:kjjbfgdBd;y:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk;Qddbcjwk;mdbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;mqkzebbbebbbdbbb9G:vbb",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(t),{}).then(function(d){n=d.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function r(d){for(var g=new Uint8Array(d.length),b=0;b<d.length;++b){var y=d.charCodeAt(b);g[b]=y>96?y-97:y>64?y-39:y+4}for(var p=0,b=0;b<d.length;++b)g[p++]=g[b]<60?e[g[b]]:(g[b]-60)*64+g[++b];return g.buffer.slice(0,p)}function a(d){if(!d)throw new Error("Assertion failed")}function s(d){return new Uint8Array(d.buffer,d.byteOffset,d.byteLength)}function o(d,g,b,y){var p=n.exports.sbrk,x=p(g.length*4),_=p(b*4),w=new Uint8Array(n.exports.memory.buffer),M=s(g);w.set(M,x),y&&y(x,x,g.length,b);var S=d(_,x,g.length,b);w=new Uint8Array(n.exports.memory.buffer);var A=new Uint32Array(b);new Uint8Array(A.buffer).set(w.subarray(_,_+b*4)),M.set(w.subarray(x,x+g.length*4)),p(x-p(0));for(var C=0;C<g.length;++C)g[C]=A[g[C]];return[A,S]}function l(d,g,b,y){var p=n.exports.sbrk,x=p(b*4),_=p(b*y),w=new Uint8Array(n.exports.memory.buffer);w.set(s(g),_),d(x,_,b,y),w=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(b);return new Uint8Array(M.buffer).set(w.subarray(x,x+b*4)),p(x-p(0)),M}function c(d,g,b,y,p,x,_){var w=n.exports.sbrk,M=w(g),S=w(y*p),A=new Uint8Array(n.exports.memory.buffer);A.set(s(b),S);var C=d(M,g,S,y,p,x,_),D=new Uint8Array(C);return D.set(A.subarray(M,M+C)),w(M-w(0)),D}function u(d){for(var g=0,b=0;b<d.length;++b){var y=d[b];g=g<y?y:g}return g}function f(d,g){if(a(g==2||g==4),g==4)return new Uint32Array(d.buffer,d.byteOffset,d.byteLength/4);var b=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/2);return new Uint32Array(b)}function h(d,g,b,y,p,x,_){var w=n.exports.sbrk,M=w(b*y),S=w(b*x),A=new Uint8Array(n.exports.memory.buffer);A.set(s(g),S),d(M,b,y,p,S,_);var C=new Uint8Array(b*y);return C.set(A.subarray(M,M+b*y)),w(M-w(0)),C}return{ready:i,supported:!0,reorderMesh:function(d,g,b){var y=g?b?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return o(n.exports.meshopt_optimizeVertexFetchRemap,d,u(d)+1,y)},reorderPoints:function(d,g){return a(d instanceof Float32Array),a(d.length%g==0),a(g>=3),l(n.exports.meshopt_spatialSortRemap,d,d.length/g,g*4)},encodeVertexBuffer:function(d,g,b){a(b>0&&b<=256),a(b%4==0);var y=n.exports.meshopt_encodeVertexBufferBound(g,b);return c(n.exports.meshopt_encodeVertexBuffer,y,d,g,b)},encodeVertexBufferLevel:function(d,g,b,y,p){a(b>0&&b<=256),a(b%4==0),a(y>=0&&y<=3),a(p===void 0||p==0||p==1);var x=n.exports.meshopt_encodeVertexBufferBound(g,b);return c(n.exports.meshopt_encodeVertexBufferLevel,x,d,g,b,y,p||0)},encodeIndexBuffer:function(d,g,b){a(b==2||b==4),a(g%3==0);var y=f(d,b),p=n.exports.meshopt_encodeIndexBufferBound(g,u(y)+1);return c(n.exports.meshopt_encodeIndexBuffer,p,y,g,4)},encodeIndexSequence:function(d,g,b){a(b==2||b==4);var y=f(d,b),p=n.exports.meshopt_encodeIndexSequenceBound(g,u(y)+1);return c(n.exports.meshopt_encodeIndexSequence,p,y,g,4)},encodeGltfBuffer:function(d,g,b,y){var p={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return a(p[y]),p[y](d,g,b)},encodeFilterOct:function(d,g,b,y){return a(b==4||b==8),a(y>=1&&y<=16),h(n.exports.meshopt_encodeFilterOct,d,g,b,y,16)},encodeFilterQuat:function(d,g,b,y){return a(b==8),a(y>=4&&y<=16),h(n.exports.meshopt_encodeFilterQuat,d,g,b,y,16)},encodeFilterExp:function(d,g,b,y,p){a(b>0&&b%4==0),a(y>=1&&y<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return h(n.exports.meshopt_encodeFilterExp,d,g,b,y,b,p?x[p]:1)},encodeFilterColor:function(d,g,b,y){return a(b==4||b==8),a(y>=2&&y<=16),h(n.exports.meshopt_encodeFilterColor,d,g,b,y,16)}}})();(function(){var t="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuec:W:Odkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;BZkdbk;jYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbhodnawTmbaxa8Acd4fRbbhokaocFeGh5cbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q1jjbfcj1jjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bbarcwf9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfag9c8F1:NghcKtc8F91aicdfa8J9c8N1:Nfg8KRbbG86bbarcVfcba8KahcjeGcr4fghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fag9c8F1:NgicKtc8F91aha8J9c8N1:NfghRbbG86bbarc96fcbahaicjeGcr4fgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbb83bbarcwfaicwf8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbcbaocl49Rh8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E93aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:XseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K1jjbgeabcifc98GfgbBd:K1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk81dbcjwk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:Kwkl8WNbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuec:q:6dkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq;Ctklbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:183lYud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxavaialfgmar9Rgoad;8qbbcj;abad9Uc;WFbGcjdadca0EhPdndndnadTmbaoadfhscbhzinaeaz9nmdamax9RaD6miabazad2fhHaxaDfhOaPaeaz9RazaPfae6EgAcsfgocl4cifcd4hCavcj;cbfaoc9WGgXcetfhQavcj;cbfaXci2fhLavcj;cbfaXfhKcbhYaoc;ab6h8AincbhodnawTmbaxaYcd4fRbbhokaocFeGhEcbh3avcj;cbfh5indndndndnaEa3cet4ciGgoc9:fPdebdkamaO9RaX6mwavcj;cbfa3aX2faOaX;8qbbaOaAfhOxdkavcj;cbfa3aX2fcbaX;8kbxekamaO9RaC6moaoclVcbawEhraOaCfhocbhidna8Ambamao9Rc;Gb6mbcbhlina5alfhidndndndndndnaOalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaiczfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaoclffahc:q:yjjbfRbbfhoxikaicafaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaaaocwffahc:q:yjjbfRbbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaaaocdffahc:q:yjjbfRbbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaoclffaqc:q:yjjbfRbbfhoxikaic8Wfaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngicitc:q1jjbfpbibaic:q:yjjbfRbbgipsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spklbaiaocwffaqc:q:yjjbfRbbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitc:q1jjbfpbibaic:q:yjjbfRbbgipsaoRbegqcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqc:q:yjjbfRbbfhokalc;abfhialcjefaX0meaihlamao9Rc;Fb0mbkkdnaiaX9pmbaici4hlinamao9RcK6mwa5aifhqdndndndndndnaOaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLg8Ecdp:mea8EpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9og8Fpxiiiiiiiiiiiiiiiip8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaoclffahc:q:yjjbfRbbfhoxikaqaopbbwaopbbbg8Eclp:mea8EpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9og8Fpxssssssssssssssssp8Jg8Ep5b9cjF;8;4;W;G;ab9:9cU1:Ngacitc:q1jjbfpbibaac:q:yjjbfRbbgapsa8Ep5e9cjF;8;4;W;G;ab9:9cU1:Nghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPa8Fa8Ep9spkbbaaaocwffahc:q:yjjbfRbbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbgacitc:q1jjbfpbibaac:q:yjjbfRbbgapsaoRbeghcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPpkbbaaaocdffahc:q:yjjbfRbbfhokalcdfhlaiczfgiaX6mbkkaohOaoTmoka5aXfh5a3cefg3cl9hmbkdndndndnawTmbasaYcd4fRbbglciGPlbedwbkaXTmdavcjdfaYfhlavaYfpbdbhgcbhoinalavcj;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep9Ta8Epxeeeeeeeeeeeeeeeeg8Fp9op9Hp9rg8Eagp9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8LaypmwDKYqk8AExm35Ps8E8Fg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Uggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp9Uggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp9Uggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9Abbbaladfglaga8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Ecep9Ta8Ea8Fp9op9Hp9rg8Ep9Ug8Fp9Abbbaladfgla8Fa8Ea8Epmlvorlvorlvorlvorp9Ug8Fp9Abbbaladfgla8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9Ug8Fp9Abbbaladfgla8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9Uggp9AbbbaladfhlaoczfgoaX6mbxikkaXTmeavcjdfaYfhlavaYfpbdbhgcbhoinalavcj;cbfaofpblbg8JaKaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaQaofpblbg8MaLaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Ecep:nea8Epxebebebebebebebebg8Fp9op:bep9rg8Eagp:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8LaypmwDKYqk8AExm35Ps8E8Fg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeggp9Abbbaladfglaga8Ea8Epmlvorlvorlvorlvorp:oeggp9Abbbaladfglaga8Ea8EpmwDqkwDqkwDqkwDqkp:oeggp9Abbbaladfglaga8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9Abbbaladfglaga8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Ecep:nea8Ea8Fp9op:bep9rg8Ep:oeg8Fp9Abbbaladfgla8Fa8Ea8Epmlvorlvorlvorlvorp:oeg8Fp9Abbbaladfgla8Fa8Ea8EpmwDqkwDqkwDqkwDqkp:oeg8Fp9Abbbaladfgla8Fa8Ea8EpmxmPsxmPsxmPsxmPsp:oeggp9AbbbaladfhlaoczfgoaX6mbxdkkaXTmbcbhocbalcl4gl9Rc8FGhiavcjdfaYfhravaYfpbdbh8Finaravcj;cbfaofpblbggaKaofpblbg8JpmbzeHdOiAlCvXoQrLg8KaQaofpblbg8LaLaofpblbg8MpmbzeHdOiAlCvXoQrLg8NpmbezHdiOAlvCXorQLg8Eaip:Rea8Ealp:Sep9qg8Ea8Fp9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Fa8Ka8NpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Faga8JpmwKDYq8AkEx3m5P8Es8Fgga8La8MpmwKDYq8AkEx3m5P8Es8Fg8JpmbezHdiOAlvCXorQLg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9Abbbaradfgra8Faga8JpmwDKYqk8AExm35Ps8E8Fg8Eaip:Rea8Ealp:Sep9qg8Ep9rg8Fp9Abbbaradfgra8Fa8Ea8Epmlvorlvorlvorlvorp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmwDqkwDqkwDqkwDqkp9rg8Fp9Abbbaradfgra8Fa8Ea8EpmxmPsxmPsxmPsxmPsp9rg8Fp9AbbbaradfhraoczfgoaX6mbkkaYclfgYad6mbkaHavcjdfaAad2;8qbbavavcjdfaAcufad2fad;8qbbaAazfhzc9:hoaOhxaOmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdaPaeao9RaoaPfae6Eaofgoae6mbkaial9Rhxkcbc99amax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbk:TseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiaPfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaOfhiazaOfhxxekaxcbalRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhAascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhzaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkaOhlxekalcefhlkaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDclfaO87ebaDcdfaz87ebxekabarcdtfgDaABdbaDcwfaOBdbaDclfazBdbkavc;abfaocitfgDazBdbaDaABdlavaicdtfaABdbavc;abfaocefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfaocdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnaecvfal9nmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:2Pliur97eue978Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskaipxFubbFubbFubbFubbgxpklbdnalTmbcbhvabhdinadczfgmampbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblbaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgopklbaiaopklbaiabalcitfgdaeciGglcitgv;8qbbaiaxpkladnalTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraipblaaDaopmlvorxmPsCXQL358E8Fp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgPp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;MeawaqawaPp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkadaiav;8qbbkk;Iwllue97euo978Jjjjjbca9Rhidnaec98GglTmbcbhvabhoinaocKfpxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81ZaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qp;6ep;NegxaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meaxarczp:Sep;6ep;Megmamp;Meaxaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgxp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgPp9oamaxp;Mearp;Keczp:Rep9qgmaDaxp;Mearp;KeaPp9oaqaxp;Mearp;Keczp:Rep9qgrpmwDKYqk8AExm35Ps8E8FgDp5eakclp:RegxpEi:T:j83ibawaDp5baxpEd:T:j83ibaocwfamarpmbezHdiOAlvCXorQLgrp5eaxpEe:T:j83ibaoarp5baxpEb:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiczfpxbbbbbbbbbbbbbbbbgxpklbaiaxpklbaiabalcitfgoaeciGgvcitgw;8qbbdnavTmbaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81ZaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkpxibbbibbbibbbibbbp9qp;6ep;NegxaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meaxarczp:Sep;6ep;Megmamp;Meaxaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgxp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgPp9oamaxp;Mearp;Keczp:Rep9qgmaDaxp;Mearp;KeaPp9oaqaxp;Mearp;Keczp:Rep9qgrpmwDKYqk8AExm35Ps8E8FgDp5eakclp:RegxpEi:T:j83iKaiaDp5baxpEd:T:j83izaiamarpmbezHdiOAlvCXorQLgrp5eaxpEe:T:j83iwaiarp5baxpEb:T:j83ibkaoaiaw;8qbbkk;uddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaic8WfpxbbbbbbbbbbbbbbbbgopklbaicafaopklbaiczfaopklbaiaopklbaiabavcdtfgdalciGgecdtgv;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkadaiav;8qbbkk:CPvdue97euw97eu8Jjjjjbc8W9Rhiaec98Ghldndnadcl9hmbaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadpbbbhradpxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpkbbadczfhdaoclfgoal6mbkkalaeSmeaiavpklaaicafabalcdtfgdaeciGglcdtgo;8qbbaiavpklbdnalTmbaipblahraipxbbuJbbuJbbuJbbuJaipblbarcKp:Tep9qgwcep:Seawp9qgDcdp:SeaDp9qgDclp:SeaDp9qgqp;6ep;NegDarcwp:RecKp:SegkarpxFbbbFbbbFbbbFbbbgxp9ogmp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gPp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oaDamakp:Xearczp:RecKp:Segrp:Uep;6ep;MeaPp;Keaxp9op9qaDamakarp:Uep:Xep;6ep;MeaPp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qaDaqawcep:Rep9oawpxebbbebbbebbbebbbp9op9qp;6ep;MeaPp;KecKp:Rep9qpklakadaicafao;8qbbskaipxbbbbbbbbbbbbbbbbgvpklbdnalTmbcbhoabhdinadczfgspxbFu9hbFu9hbFu9hbFu9hadpbbbgDaspbbbgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblbp9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpkbbadaxarpmbezHdiOAlvCXorQLpkbbadcafhdaoclfgoal6mbkkalaeSmbaiczfpxbbbbbbbbbbbbbbbbgrpklbaiarpklbaiabalcitfgdaeciGglcitgo;8qbbaiavpkladnalTmbaipxbFu9hbFu9hbFu9hbFu9haipblbgDaipblzgPpmlvorxmPsCXQL358E8Fgmczp:Teaipblap9qgrcep:Searp9qgwcdp:Seawp9qgwclp:Seawp9qgwcwp:Seawp9qgqp;6ep;NegwaDaPpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbgPp9ogkaDczp:Segxp:Ueamczp:Reczp:Segmp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gDp;KeaPp9oawakaxamp:Uep:Xep;6ep;MeaDp;Keczp:Rep9qgxawaqarcep:Rep9oarpxebbbebbbebbbebbbp9op9qp;6ep;MeaDp;Keczp:Reawamakp:Uep;6ep;MeaDp;KeaPp9op9qgrpmwDKYqk8AExm35Ps8E8FpklzaiaxarpmbezHdiOAlvCXorQLpklbkadaiao;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(n)?o(e):o(t),a,s=WebAssembly.instantiate(r,{}).then(function(p){a=p.instance,a.exports.__wasm_call_ctors()});function o(p){for(var x=new Uint8Array(p.length),_=0;_<p.length;++_){var w=p.charCodeAt(_);x[_]=w>96?w-97:w>64?w-39:w+4}for(var M=0,_=0;_<p.length;++_)x[M++]=x[_]<60?i[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,M)}function l(p,x,_,w,M,S,A){var C=p.exports.sbrk,D=w+3&-4,R=C(D*M),N=C(S.length),U=new Uint8Array(p.exports.memory.buffer);U.set(S,N);var j=x(R,w,M,N,S.length);if(j==0&&A&&A(R,D,M),_.set(U.subarray(R,R+w*M)),C(R-C(0)),j!=0)throw new Error("Malformed buffer data: "+j)}var c={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],h=0;function d(p){var x={object:new Worker(p),pending:0,requests:{}};return x.object.onmessage=function(_){var w=_.data;x.pending-=w.count,x.requests[w.id][w.action](w.value),delete x.requests[w.id]},x}function g(p){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+y.name+";"+l.toString()+y.toString(),_=new Blob([x],{type:"text/javascript"}),w=URL.createObjectURL(_),M=f.length;M<p;++M)f[M]=d(w);for(var M=p;M<f.length;++M)f[M].object.postMessage({});f.length=p,URL.revokeObjectURL(w)}function b(p,x,_,w,M){for(var S=f[0],A=1;A<f.length;++A)f[A].pending<S.pending&&(S=f[A]);return new Promise(function(C,D){var R=new Uint8Array(_),N=++h;S.pending+=p,S.requests[N]={resolve:C,reject:D},S.object.postMessage({id:N,count:p,size:x,source:R,mode:w,filter:M},[R.buffer])})}function y(p){var x=p.data;if(!x.id)return self.close();self.ready.then(function(_){try{var w=new Uint8Array(x.count*x.size);l(_,_.exports[x.mode],w,x.count,x.size,x.source,_.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:w},[w.buffer])}catch(M){self.postMessage({id:x.id,count:x.count,action:"reject",value:M})}})}return{ready:s,supported:!0,useWorkers:function(p){g(p)},decodeVertexBuffer:function(p,x,_,w,M){l(a,a.exports.meshopt_decodeVertexBuffer,p,x,_,w,a.exports[c[M]])},decodeIndexBuffer:function(p,x,_,w){l(a,a.exports.meshopt_decodeIndexBuffer,p,x,_,w)},decodeIndexSequence:function(p,x,_,w){l(a,a.exports.meshopt_decodeIndexSequence,p,x,_,w)},decodeGltfBuffer:function(p,x,_,w,M,S){l(a,a.exports[u[M]],p,x,_,w,a.exports[c[S]])},decodeGltfBufferAsync:function(p,x,_,w,M){return f.length>0?b(p,x,_,u[w],c[M]):s.then(function(){var S=new Uint8Array(p*x);return l(a,a.exports[u[w]],S,p,x,_,a.exports[c[M]]),S})}}})();var V4e=function(){var t="b9H79Tebbbe:Gez9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuiXCdilvorlwiDqkxmPbssbelve9Weiiviebeoweuec:G:Pdkr;7eko9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95br8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bw8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbDQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bqX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbkQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bxX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbma9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbPl79IV9RbsDwebcekdOAq:d;OeCdbk:J1eo3ue99euE99Cue9:8Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:rjjjb8AdnabaeSmbabaeadcdtz:qjjjb8AkdnamcdGTmbalcrfci4gHcbyd1:jjjbHjjjjbbheasc:Cefasyd;8egOcdtfaeBdbasaOcefBd;8eaecbaHz:rjjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd1:jjjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egCcdtfaHBdbasaCcefBd;8eaHcFeaOz:rjjjbhQdnadTmbaecufhLcbhKindndnaQabaXcdtfgYydbgCc:v;t;h;Ev2aLGgOcdtfgAydbgHcuSmbceheinazaHcdtfydbaCSmdaOaefhHaecefheaQaHaLGgOcdtfgAydbgHcu9hmbkkazaKcdtfaCBdbaAaKBdbaKhHaKcefhKkaYaHBdbaXcefgXad9hmbkkaQcbyd:m:jjjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:jjjbHjjjjbbhKasc:Cefasyd;8egecdtfaKBdbasaKBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:jjjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:jjjbHjjjjbbhCasc:Cefasyd;8egHcdtfaCBdbasaHcefBd;8ea3cbyd1:jjjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8eaCaYaialavazasc:Cefz:djjjbalcbyd1:jjjbHjjjjbbh5asc:Cefasyd;8egHcdtfa5BdbasaHcefBd;8ea3cbyd1:jjjbHjjjjbbhHasc:Cefasyd;8egOcdtfaHBdbasaOcefBd;8ea3cbyd1:jjjbHjjjjbbhOasc:Cefasyd;8egAcdtfaOBdbasaAcefBd;8eaHcFeaez:rjjjbh8EaOcFeaez:rjjjbh8FdnalTmbaEcwfhaindnaKa8AgOcefg8AcdtfydbgAaKaOcdtgefydbgHSmbaAaH9RhhaEaHcitfhga8Faefh8Ja8Eaefh8KcbhQindndnagaQcitfydbgLaO9hmba8KaOBdba8JaOBdbxekdnaKaLcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgAfydbaOSmeaHae9Rh8Maecu7aHfhXaaaAfhHcbheinaXaeSmeaecefheaHydbhAaHcwfhHaAaO9hmbkaea8M6meka8Fa8LfgeaOaLaeydbcuSEBdba8KaLaOa8KydbcuSEBdbkaQcefgQah9hmbkka8Aal9hmbkaChHaYhOa8FhAa8EhQcbheindndnaeaHydbgL9hmbdnaeaOydbgL9hmbaQydbhLdnaAydbgXcu9hmbaLcu9hmba5aefcb86bbxikdnaXcuSmbaLcuSmbaeaXSmbaCaXcdtfydbaCaLcdtfydb9hmba5aefcd86bbxika5aefh8KdnaeaXSmbaeaLSmba8Kce86bbxika8Kcl86bbxdkdnaeaYaLcdtgXfydb9hmbdnaAydbg8KcuSmbaea8KSmbaQydbghcuSmbaeahSmba8FaXfydbggcuSmbagaLSmba8EaXfydbgXcuSmbaXaLSmbdnaCa8KcdtfydbgLaCaXcdtfydb9hmbaLaCahcdtfydbgXSmbaXaCagcdtfydb9hmba5aefcd86bbxlka5aefcl86bbxika5aefcl86bbxdka5aefcl86bbxeka5aefa5aLfRbb86bbkaHclfhHaOclfhOaAclfhAaQclfhQalaecefge9hmbkdnamcaGTmbaEcwfh8Jcbh8Nindndna5a8NfgyRbbg8Pc9:fPibebekdndndnaCa8Ncdtfydbgea8N9hmbdnaqmbcbhgxdkdnazTmbcbhga8NheinagaqazaecdtgefydbfRbbcdGce4VhgaYaefydbgea8N9hmbxikkcbhga8NheinagaqaefRbbcdGce4VhgaYaecdtfydbgea8N9hmbxdkka5aefRbbhexeka8NheindnaKaecdtgafgeclfydbgHaeydbgeSmbaHae9Rh8AaEaecitfh8MaCaafh8Lcbh8Kina8Ma8KcitfydbgXhednindnaKaecdtgLfgeclfydbgHaeydbgeSmbdnaCaEaecitgOfydbcdtfydba8LydbgQ9hmbcehexikaHae9Rhhaecu7aHfhAa8JaOfhHcbheinaAaeSmeaecefheaHydbhOaHcwfhHaCaOcdtfydbaQ9hmbkaeah6hexdkaYaLfydbgeaX9hmbkcbhekagaece7Vhga8Kcefg8Ka8A9hmbkkaYaafydbgea8N9hmbka8PciagceGEhekayae86bbka8Ncefg8Nal9hmbkkdnaqTmbdndnazTmbazheaChHalhOindnaqaeydbfRbbceGTmba5aHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaChealhHindnaqRbbceGTmba5aeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaChealhOa5hHindna5aeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmba5healhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbhIcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbhaasc:Cefasyd;8egecdtfaaBdbasaecefBd;8easc:qefcbBdbas9cb83i1eaaaialavazasc1efz:ejjjbh8RdndnaDmbcbh8Scbh8Lxekcbh8LawhecbhHindnaeIdbJbbbb9ETmbasa8LcdtfaHBdba8Lcefh8LkaeclfheaDaHcefgH9hmbkcua8Lal2gecdtaecFFFFi0Ecbyd1:jjjbHjjjjbbh8Sasc:Cefasyd;8egecdtfa8SBdbasaecefBd;8ealTmbdna8Lmbcbh8Lxekarcd4hXdnazTmba8Lcdth8KcbhLa8ShKinaoazaLcdtfydbaX2cdtfhQasheaKhHa8LhOinaHaQaeydbcdtgAfIdbawaAfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKa8KfhKaLcefgLal9hmbxdkka8Lcdth8KcbhLa8ShKinaoaLaX2cdtfhQasheaKhHa8LhOinaHaQaeydbcdtgAfIdbawaAfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKa8KfhKaLcefgLal9hmbkkcualc8S2gHalc;D;O;f8U0EgAcbyd1:jjjbHjjjjbbheasc:Cefasyd;8egOcdtfaeBdbasaOcefBd;8eaecbaHz:rjjjbhycbhqcbh8Ndna8LTmbcbhIaAcbyd1:jjjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8ea8NcbaHz:rjjjb8Acua8Lal2gecltgHaecFFFFb0Ecbyd1:jjjbHjjjjbbhqasc:Cefasyd;8egecdtfaqBdbasaecefBd;8eaqcbaHz:rjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:jjjbHjjjjbbhIasc:Cefasyd;8egHcdtfaIBdbasaHcefBd;8eaIcbaez:rjjjb8AkdnadTmbcbhQabhHinaaaHclfydbgLcx2fgeIdbaaaHydbgKcx2fgOIdbgR:tg8UaaaHcwfydbgXcx2fgAIdlaOIdlg8V:tg8WNaAIdbaR:tg8XaeIdla8V:tg8YN:tg8Zh80aeIdwaOIdwg81:tgBa8XNaAIdwa81:tg83a8UN:tgUh8Xa8Ya83Na8WaBN:tg8Yh8Udna8Za8ZNa8Ya8YNaUaUNMM:rgBJbbbb9EgOTmba8ZaB:vh80aUaB:vh8Xa8YaB:vh8UkayaCaKcdtfydbgAc8S2fgea8UaB:rg8Wa8UNNg85aeIdbMUdbaea8Xa8Wa8XNg86Ng87aeIdlMUdlaea80a8Wa80Ng83Ng88aeIdwMUdwaea86a8UNg86aeIdxMUdxaea83a8UNg89aeIdzMUdzaea83a8XNg8:aeIdCMUdCaea8Ua8Wa80a81Na8UaRNa8Va8XNMM:mgZNg83Ng8UaeIdKMUdKaea8Xa83Ng8XaeId3MUd3aea80a83Ng80aeIdaMUdaaea83aZNg83aeId8KMUd8Kaea8WaeIdyMUdyayaCaLcdtfydbgLc8S2fgea85aeIdbMUdbaea87aeIdlMUdlaea88aeIdwMUdwaea86aeIdxMUdxaea89aeIdzMUdzaea8:aeIdCMUdCaea8UaeIdKMUdKaea8XaeId3MUd3aea80aeIdaMUdaaea83aeId8KMUd8Kaea8WaeIdyMUdyayaCaXcdtfydbgKc8S2fgea85aeIdbMUdbaea87aeIdlMUdlaea88aeIdwMUdwaea86aeIdxMUdxaea89aeIdzMUdzaea8:aeIdCMUdCaea8UaeIdKMUdKaea8XaeId3MUd3aea80aeIdaMUdaaea83aeId8KMUd8Kaea8WaeIdyMUdydnaITmbdnaOTmba8ZaB:vh8ZaUaB:vhUa8YaB:vh8YkaIaAcltfgeaBJbbbZNg8UaUNg8WaeIdlMUdlaea8Ua8ZNg8XaeIdwMUdwaea8Ua8YNg80aeIdbMUdbaea8UaR:ma8YNaUa8VN:ta81a8ZN:tNg8UaeIdxMUdxaIaLcltfgea8WaeIdlMUdlaea8XaeIdwMUdwaea80aeIdbMUdbaea8UaeIdxMUdxaIaKcltfgea8WaeIdlMUdlaea8XaeIdwMUdwaea80aeIdbMUdbaea8UaeIdxMUdxkaHcxfhHaQcifgQad6mbkkdnalTmbJ;n;m;m89J:v:;;w8ZamczGEh8YcbhOaChAaahHayheindnaOaAydb9hmbaecxfgQaQIdbJbbbbMUdbaeczfgQaQIdbJbbbbMUdbaecCfgQaQIdbJbbbbMUdbaea8YaecyfgQIdbg8ZNg8UaeIdbMUdbaeclfgLa8UaLIdbMUdbaecwfgLa8UaLIdbMUdbaecKfgLaLIdbaHIdbg8Xa8UN:tUdbaHcwfIdbh8Waec3fgLaLIdba8UaHclfIdbg80N:tUdbaecafgLaLIdba8Ua8WN:tUdbaec8KfgLIdbhUaQa8Za8UMUdbaLaUa8Ua8Wa8WNa8Xa8XNa80a80NMMNMUdbkaAclfhAaHcxfhHaec8SfhealaOcefgO9hmbkkdnadTmbcbhXabhKinabaXcdtfhLcbhHina5aLaHc:G1jjbfydbcdtfydbgOfRbbhedndna5aKaHfydbgAfRbbgQc99fcFeGcpe0mbaec99fcFeGc;:e6mekdnaQcufcFeGce0mba8EaAcdtfydbaO9hmekdnaecufcFeGce0mba8FaOcdtfydbaA9hmekJbbacJbbacJbbbZaecFeGceSEaQcFeGceSEh88aaaOcx2fgeIdwaaaAcx2fgQIdwgB:tg80:mh86aeIdlaQIdlg83:tg8Z:mh89aeIdbaQIdbgR:tgU:mh8:dnaaaLaHc:K1jjbfydbcdtfydbcx2fgeIdwaB:tg8Va80a80NaUaUNa8Za8ZNMMg8YNa8Va80NaeIdbaR:tg81aUNa8ZaeIdla83:tg85NMMg8Wa80N:tg8Xa8XNa81a8YNa8WaUN:tg8Ua8UNa85a8YNa8Wa8ZN:tg8Wa8WNMM:rg87Jbbbb9ETmba8Xa87:vh8Xa8Wa87:vh8Wa8Ua87:vh8Uka88a8Y:rNg8Ya8XaBNa8UaRNa83a8WNMM:mgZNg87aZNhZa8Xa87Nhna8Wa87Nhca8Ua87Nh9ca8Ya8XNg87a8WNhJa87a8UNh9ea8Ya8WNgTa8UNhSa8Xa87Nh87a8WaTNhTa8Ua8Ya8UNNh9hdnaUa85Na81a89NMg8Xa8XNa8Za8VNa85a86NMg8Ua8UNa80a81Na8Va8:NMg8Wa8WNMM:rg80Jbbbb9ETmba8Xa80:vh8Xa8Wa80:vh8Wa8Ua80:vh8UkayaCaAcdtfydbc8S2fgeaeIdba9ha8Ua88a80:rNg80a8UNNMgUMUdbaeaTa8Wa80a8WNg8VNMg81aeIdlMUdlaea87a8Xa80a8XNg8ZNMg85aeIdwMUdwaeaSa8Va8UNMg8VaeIdxMUdxaea9ea8Za8UNMg87aeIdzMUdzaeaJa8Za8WNMg8ZaeIdCMUdCaea9ca8Ua80a8XaBNa8UaRNa83a8WNMMgB:mNg80NMg8UaeIdKMUdKaeaca8Wa80NMg8WaeId3MUd3aeana8Xa80NMg8XaeIdaMUdaaeaZaBa80N:tg80aeId8KMUd8Kaea8YJbbbbMg8YaeIdyMUdyayaCaOcdtfydbc8S2fgeaUaeIdbMUdbaea81aeIdlMUdlaea85aeIdwMUdwaea8VaeIdxMUdxaea87aeIdzMUdzaea8ZaeIdCMUdCaea8UaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea80aeId8KMUd8Kaea8YaeIdyMUdykaHclfgHcx9hmbkaKcxfhKaXcifgXad6mbka8LTmbcbhKinJbbbbh8YaaabaKcdtfgeclfydbgXcx2fgHIdwaaaeydbg8Kcx2fgOIdwg81:tg8Wa8WNaHIdbaOIdbg85:tg8Xa8XNaHIdlaOIdlg87:tg80a80NMMgRaaaecwfydbghcx2fgeIdwa81:tg8ZNa8Wa8Wa8ZNa8XaeIdba85:tgUNa80aeIdla87:tgBNMMg8UN:tJbbbbJbbjZaRa8Za8ZNaUaUNaBaBNMMg8VNa8Ua8UN:tg83:va83Jbbbb9BEg83Nh89a8Va8WNa8Za8UN:ta83Nh8:aRaBNa80a8UN:ta83NhZa8Va80NaBa8UN:ta83NhnaRaUNa8Xa8UN:ta83Nhca8Va8XNaUa8UN:ta83Nh9ca8XaBNaUa80N:tg8Ua8UNa80a8ZNaBa8WN:tg8Ua8UNa8WaUNa8Za8XN:tg8Ua8UNMM:rJbbbZNh8Ua8Sa8Ka8L2ggcdtfhHa8Saha8L2gEcdtfhOa8SaXa8L2g8JcdtfhAa81:mhJa87:mh9ea85:mhTcbhQa8LhLJbbbbhBJbbbbh83JbbbbhRJbbbbh8VJbbbbh81Jbbbbh85Jbbbbh87Jbbbbh88Jbbbbh86inascjdfaQfgecwfa8Ua8:aAIdbaHIdbg8Z:tg80Na89aOIdba8Z:tgUNMg8WNUdbaeclfa8Uana80NaZaUNMg8XNUdbaea8Ua9ca80NacaUNMg80NUdbaecxfa8UaJa8WNa9ea8XNa8ZaTa80NMMMg8ZNUdba8Ua8Wa8XNNa8VMh8Va8Ua8Wa80NNa81Mh81a8Ua8Xa80NNa85Mh85a8Ua8Za8ZNNa8YMh8Ya8Ua8Wa8ZNNaBMhBa8Ua8Xa8ZNNa83Mh83a8Ua80a8ZNNaRMhRa8Ua8Wa8WNNa87Mh87a8Ua8Xa8XNNa88Mh88a8Ua80a80NNa86Mh86aHclfhHaAclfhAaOclfhOaQczfhQaLcufgLmbka8Na8Kc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdya8NaXc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdya8Nahc8S2fgea86aeIdbMUdbaea88aeIdlMUdlaea87aeIdwMUdwaea85aeIdxMUdxaea81aeIdzMUdzaea8VaeIdCMUdCaeaRaeIdKMUdKaea83aeId3MUd3aeaBaeIdaMUdaaea8YaeId8KMUd8Kaea8UaeIdyMUdyaqagcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaqa8JcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaqaEcltfhLcbhHa8LhAinaLaHfgeascjdfaHfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkaKcifgKad6mbkkcbhOdndnamcwGg9imbJbbbbh85cbh6cbh9kcbh0xekcbh6a3cbyd1:jjjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ecua0alabadaCz:fjjjbgAcltaAcjjjjiGEcbyd1:jjjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ea9kaAa0aaalz:gjjjbJFFuuh85aATmba9kheaAhHinaeIdbg8Ua85a85a8U9EEh85aeclfheaHcufgHmbkaAh6kasydNeh9mdnalTmba9mclfhea9mydbhAa5hHalhQcbhOincbaeydbgLaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaLhAaQcufgQmbkaOce4hOkcuadaO9Rcifg9ncx2a9nc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ecua9ncdta9ncFFFFi0Ecbyd1:jjjbHjjjjbbh9oasc:Cefasyd;8egecdtfa9oBdbasaecefBd;8ea3cbyd1:jjjbHjjjjbbhDasc:Cefasyd;8egecdtfaDBdbasaecefBd;8ealcbyd1:jjjbHjjjjbbh9pasc:Cefasyd;8egecdtfa9pBdbasaecefBd;8eaxaxNa8RJbbjZamclGEgnanN:vh88Jbbbbh86dnadak9nmbdna9nci6mbasyd:yeh9qa8Lclth9ra8Pcwfh9sJbbbbh87Jbbbbh86inascNefabadalaCz:cjjjbabh8Kcbh8Mcbh3inaba3cdtfhgcbheindnaCa8KaefydbgOcdtgXfydbgAaCagaec:W1jjbfydbcdtfydbgHcdtghfydbgQSmba5aHfRbbgKcv2a5aOfRbbgLfc;a1jjbfRbbg8JaLcv2aKfgEc;a1jjbfRbbg8AVcFeGTmbdnaQaA9nmbaEc;G1jjbfRbbcFeGmekdnaLcufcFeGce0mbaKTmba8EaXfydbaH9hmekdnaLTmbaKcufcFeGce0mba8FahfydbaO9hmeka8Pa8Mcx2fgAaHaOa8AcFeGgQEBdlaAaOaHaQEBdbaAaQa8JGcb9hBdwa8Mcefh8Mkaeclfgecx9hmbkdna3cifg3ad9pmba8Kcxfh8Ka8Mcifa9n9nmekka8MTmdcbhhinayaCa8Pahcx2fgKydbgQcdtgAfydbc8S2fgeIdwaaaKydlgLcx2fgHIdwg8XNaeIdzaHIdbg80NaeIdaMg8Ua8UMMa8XNaeIdlaHIdlg8ZNaeIdCa8XNaeId3Mg8Ua8UMMa8ZNaeIdba80NaeIdxa8ZNaeIdKMg8Ua8UMMa80NaeId8KMMM:lh8UJbbbbJbbjZaeIdyg8W:va8WJbbbb9BEh8WdndnaKydwg8KmbJFFuuh81xekJbbbbJbbjZayaCaLcdtfydbc8S2fgeIdygU:vaUJbbbb9BEaeIdwaaaQcx2fgHIdwgUNaeIdzaHIdbg8YNaeIdaMgBaBMMaUNaeIdlaHIdlgBNaeIdCaUNaeId3MgUaUMMaBNaeIdba8YNaeIdxaBNaeIdKMgUaUMMa8YNaeId8KMMM:lNh81ka8Wa8UNh8Vdna8LTmba8NaQc8S2fgHIdwa8XNaHIdza80NaHIdaMg8Ua8UMMa8XNaHIdla8ZNaHIdCa8XNaHId3Mg8Ua8UMMa8ZNaHIdba80NaHIdxa8ZNaHIdKMg8Ua8UMMa80NaHId8KMMMh8UaqaQa8L2ggcltfheaHIdyhUa8SaLa8L2gEcdtfgXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkdndna8KmbJbbbbh8Wxeka8NaLc8S2fgOIdwaaaQcx2fgeIdwg8YNaOIdzaeIdbgBNaOIdaMg8Wa8WMMa8YNaOIdlaeIdlg83NaOIdCa8YNaOId3Mg8Wa8WMMa83NaOIdbaBNaOIdxa83NaOIdKMg8Wa8WMMaBNaOId8KMMMh8Wa8SagcdtfhHaqaEcltfheaOIdyhRa8LhOinaHIdbgUaUaRNaecxfIdba8YaecwfIdbNaBaeIdbNa83aeclfIdbNMMMgUaUM:tNa8WMh8WaHclfhHaeczfheaOcufgOmbka8W:lh8Wka8Va8U:lMh8Va81a8WMh81dndndna5aQfRbbc9:fPdbedkdna8Fa8Ea8EaAfydbaLSEaYaAfydbgXcdtfydbgAcu9hmbaYaLcdtfydbhAka8NaXc8S2fgOIdwaaaAcx2fgeIdwg8XNaOIdzaeIdbg80NaOIdaMg8Ua8UMMa8XNaOIdlaeIdlg8ZNaOIdCa8XNaOId3Mg8Ua8UMMa8ZNaOIdba80NaOIdxa8ZNaOIdKMg8Ua8UMMa80NaOId8KMMMh8Ua8SaAa8L2ggcdtfhHaqaXa8L2gEcltfheaOIdyhUa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbkdndna8KmbJbbbbh8Wxeka8NaAc8S2fgOIdwaaaXcx2fgeIdwg80NaOIdzaeIdbg8ZNaOIdaMg8Wa8WMMa80NaOIdlaeIdlgUNaOIdCa80NaOId3Mg8Wa8WMMaUNaOIdba8ZNaOIdxaUNaOIdKMg8Wa8WMMa8ZNaOId8KMMMh8Wa8SaEcdtfhHaqagcltfheaOIdyh8Ya8LhOinaHIdbg8Xa8Xa8YNaecxfIdba80aecwfIdbNa8ZaeIdbNaUaeclfIdbNMMMg8Xa8XM:tNa8WMh8WaHclfhHaeczfheaOcufgOmbka8W:lh8Wka8Va8U:lMh8Va81a8WMh81xdkaYaAfydbgAaQSmbina8NaAc8S2fgHIdwa8XNaHIdza80NaHIdaMg8Ua8UMMa8XNaHIdla8ZNaHIdCa8XNaHId3Mg8Ua8UMMa8ZNaHIdba80NaHIdxa8ZNaHIdKMg8Ua8UMMa80NaHId8KMMMh8UaqaAa8L2cltfheaHIdyhUaXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba8XaecwfIdbNa80aeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbka8Va8U:lMh8VaYaAcdtfydbgAaQ9hmbkka5aLfRbbci9hmba8KTmbaYaLcdtfydbgAaLSmba8SagcdtfhXaaaQcx2fgeIdbh8XaeIdwh80aeIdlh8Zina8NaAc8S2fgHIdwa80NaHIdza8XNaHIdaMg8Ua8UMMa80NaHIdla8ZNaHIdCa80NaHId3Mg8Ua8UMMa8ZNaHIdba8XNaHIdxa8ZNaHIdKMg8Ua8UMMa8XNaHId8KMMMh8UaqaAa8L2cltfheaHIdyhUaXhHa8LhOinaHIdbg8Wa8WaUNaecxfIdba80aecwfIdbNa8XaeIdbNa8ZaeclfIdbNMMMg8Wa8WM:tNa8UMh8UaHclfhHaeczfheaOcufgOmbka81a8U:lMh81aYaAcdtfydbgAaL9hmbkkaKa81a8Va81a8V9DgeEUdwaKaQaLaea8Kcb9hGgeEBdlaKaLaQaeEBdbahcefgha8M9hmbkascjdfcbcj;qbz:rjjjb8Aa9shea8MhHinascjdfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgOydbhAaOaHBdbaAaHfhHaeclfgecj;qb9hmbkcbhea9shHinascjdfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdba9oaOcdtfaeBdbaHcxfhHa8Maecefge9hmbkadak9RgOci9Uh9tdnalTmbcbheaDhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ua9pcbalz:rjjjbh3aOcO9Uh9va9tce4h9wcbh8Acbh8Jdnina8Pa9oa8Jcdtfydbcx2fgEIdwg8Ua889Emea8Aa9t9pmeJFFuuh8Wdna9wa8M9pmba8Pa9oa9wcdtfydbcx2fIdwJbb;aZNh8Wkdna8Ua8W9ETmba8Ua869ETmba8Aa9v0mdkdna3aCaEydlghcdtg9xfydbgAfg9yRbba3aCaEydbg8Kcdtg9zfydbgefg9ARbbVmba5a8KfRbbh9Bdna9maecdtfgHclfydbgOaHydbgHSmbaOaH9RhQaaaAcx2fhKaaaecx2fhXa9qaHcitfhecbhHcehgdnindnaDaeydbcdtfydbgOaASmbaDaeclfydbcdtfydbgLaASmbaOaLSmbaaaLcx2fgLIdbaaaOcx2fgOIdbg8X:tg8UaXIdlaOIdlg80:tg8YNaXIdba8X:tgBaLIdla80:tg8WN:tg8Za8UaKIdla80:tg83NaKIdba8X:tgRa8WN:tg80Na8WaXIdwaOIdwgU:tg8VNa8YaLIdwaU:tg8XN:tg8Ya8WaKIdwaU:tg81Na83a8XN:tg8WNa8XaBNa8Va8UN:tgUa8XaRNa81a8UN:tg8UNMMa8Za8ZNa8Ya8YNaUaUNMMa80a80Na8Wa8WNa8Ua8UNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaQ6hgaQaH9hmbkkagceGTmba9wcefh9wxekdndndndna9Bc9:fPdebdka8KheinaDaecdtgefahBdbaYaefydbgea8K9hmbxikkdna8Fa8Ea8Ea9zfydbahSEaYa9zfydbg8Kcdtfydbgecu9hmbaYa9xfydbhekaDa9zfahBdbaehhkaDa8KcdtfahBdbka9Ace86bba9yce86bbaEIdwg8Ua86a86a8U9DEh86a9ucefh9ucecda9BceSEa8Afh8Aka8Jcefg8Ja8M9hmbkka9uTmddnalTmbcbhLcbhXindnaDaXcdtgefydbgOaXSmbaCaOcdtfydbh8KdnaXaCaefydb9hghmbaya8Kc8S2fgeayaXc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyaITmbaIa8KcltfgeaIaXcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxka8LTmba8NaOc8S2fgea8NaXc8S2ggfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9raO2hKaqhHa8LhAinaHaKfgeaHaLfgOIdbaeIdbMUdbaeclfgQaOclfIdbaQIdbMUdbaecwfgQaOcwfIdbaQIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbkahmbJbbbbJbbjZayagfgeIdyg8U:va8UJbbbb9BEaeIdwaaa8Kcx2fgHIdwg8UNaeIdzaHIdbg8WNaeIdaMg8Xa8XMMa8UNaeIdlaHIdlg8XNaeIdCa8UNaeId3Mg8Ua8UMMa8XNaeIdba8WNaeIdxa8XNaeIdKMg8Ua8UMMa8WNaeId8KMMM:lNg8Ua87a87a8U9DEh87kaLa9rfhLaXcefgXal9hmbkcbhHa8EheindnaeydbgOcuSmbdnaHaDaOcdtgAfydbgO9hmbcuhOa8EaAfydbgAcuSmbaDaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHa8FheindnaeydbgOcuSmbdnaHaDaOcdtgAfydbgO9hmbcuhOa8FaAfydbgAcuSmbaDaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkka87a86a8LEh87cbhHabhecbhOindnaCaDaeydbcdtfydbgLcdtfydbgAaCaDaeclfydbcdtfydbgKcdtfydbgQSmbaAaCaDaecwfydbcdtfydbg8KcdtfydbgXSmbaQaXSmbabaHcdtfgAaLBdbaAcwfa8KBdbaAclfaKBdbaHcifhHkaecxfheaOcifgOad6mbkdndna9imbaHhdxekdnaHak0mbaHhdxekdna85a879FmbaHhdxekJFFuuh85cbhdabhecbhOindna9ka0aeydbgAcdtfydbcdtfIdbg8Ua879ETmbaeclf8Pdbh9CabadcdtfgQaABdbaQclfa9C83dba8Ua85a85a8U9EEh85adcifhdkaecxfheaOcifgOaH6mbkkadak0mbxdkkascNefabadalaCz:cjjjbkdndnadak0mbadhOxekdna9imbadhOxekdna85a889FmbadhOxekcehLina85Jbb;aZNg8Ua88a8Ua889DEh8XJbbbbh8Udna6Tmba9khea6hHinaeIdbg8Wa8Ua8Wa8X9FEa8Ua8Wa8U9EEh8UaeclfheaHcufgHmbkkJFFuuh85cbhOabhecbhHindna9ka0aeydbgAcdtfydbcdtfIdbg8Wa8X9ETmbaeclf8Pdbh9CabaOcdtfgQaABdbaQclfa9C83dba8Wa85a85a8W9EEh85aOcifhOkaecxfheaHcifgHad6mbkdnaLaOad9hVceGmbadhOxdka8Ua86a86a8U9DEh86aOak9nmecbhLaOhda85a889FmbkkdnamcjjjjdGTmba9pcbalz:rjjjbhLdnaOTmbabheaOhHinaLaeydbgAfa5aAfRbbcl9h86bbaeclfheaHcufgHmbkkascNefabaOalaCz:cjjjbalTmbcbhQasyd:yehgindnaLaQfRbbTmbdna5aQfRbbgecl0mbceaetcQGmekdnaCaQcdtgKfydbgeaQSmbaaaQcx2fgHaaaecx2fge8Pdb83dbaHcwfaecwfydbBdbxekayaQc8S2fgeIdyg8Ua8UJL:3;rUNg8UMh88aeIdwa8UMhRaeIdla8UMh8VaeIdba8UMhUaeIdaa8UaaaQcx2fg8KIdwg89N:th81aeId3a8Ua8KIdlg8:N:th85aeIdKa8KIdbgZa8UN:th8YJbbbbhcaeIdCJbbbbMh87aeIdzJbbbbMhBaeIdxJbbbbMh83dndna8LTmbaQhAinJbbbba88a8NaAc8S2fgHIdyg8U:va8UJbbbb9BEh8UaqaAa8L2cltfheaHIdaa88Na81Mh81aHId3a88Na85Mh85aHIdKa88Na8YMh8YaHIdCa88Na87Mh87aHIdza88NaBMhBaHIdxa88Na83Mh83aHIdwa88NaRMhRaHIdla88Na8VMh8VaHIdba88NaUMhUa8LhHina81aecxfIdbg8ZaecwfIdbg8WNa8UN:th81a85a8ZaeclfIdbg8XNa8UN:th85a87a8Wa8XNa8UN:th87aUaeIdbg80a80Na8UN:thUa8Ya8Za80Na8UN:th8YaBa8Wa80Na8UN:thBa83a8Xa80Na8UN:th83aRa8Wa8WNa8UN:thRa8Va8Xa8XNa8UN:th8VaeczfheaHcufgHmbkaYaAcdtfydbgAaQ9hmbkaITmbaIaQcltfgeIdxhTaeIdwh9caeIdlhJaeIdbh8UxekJbbbbhTJbbbbh9cJbbbbhJJbbbbh8UkaBaU:vg8Xa8YNa81:ta87aBa83aU:vg8WN:tg81a8Va83a8WN:tg8Z:vg80a8Wa8YNa85:tg8VN:th85a9ca8Ua8XN:taJa8Ua8WN:tg83a80N:tg87aRaBa8XN:ta81a80N:tgB:vgR:mh81a83a8Z:vg9c:mhJdnJbbbba8Ua8UaU:vg9eN:ta83a9cN:ta87aRN:tg83:la88J:983:g81Ng8U9ETmba81a85NaJa8VNa9ea8YNaT:tMMa83:vhckaU:la8U9ETmba8Z:la8U9ETmbaB:la8U9ETmba9e:macNa8X:ma81acNa85aB:vMg85Na8W:maJacNa80:ma85Na8Va8Z:vMMg87Na8Y:maU:vMMMh88a9maKfgeclfydbgHaeydbge9RhXagaecitfhKJbbbbh8UdnaHaeSghmbJbbbbh8UaKheaXhAinaaaeclfydbcx2fgHIdwa89:tg8Wa8WNaHIdbaZ:tg8Wa8WNaHIdla8::tg8Wa8WNMMg8Waaaeydbcx2fgHIdwa89:tg8Xa8XNaHIdbaZ:tg8Xa8XNaHIdla8::tg8Xa8XNMMg8Xa8Ua8Ua8X9DEg8Ua8Ua8W9DEh8UaecwfheaAcufgAmbkka85a89:tg8Wa8WNa88aZ:tg8Wa8WNa87a8::tg8Wa8WNMMa8U:rg8Ua8UN9EmbdnahmbcbhAcehhdninaaaKclfydbcx2fgeIdbaaaKydbcx2fgHIdbg8X:tg8Ua8:aHIdlg80:tg8YNaZa8X:tgBaeIdla80:tg8WN:tg8Za8Ua87a80:tg83Na88a8X:tgRa8WN:tg80Na8Wa89aHIdwgU:tg8VNa8YaeIdwaU:tg8XN:tg8Ya8Wa85aU:tg81Na83a8XN:tg8WNa8XaBNa8Va8UN:tgUa8XaRNa81a8UN:tg8UNMMa8Za8ZNa8Ya8YNaUaUNMMa80a80Na8Wa8WNa8Ua8UNMMN:rJbbj8:N9FmeaKcwfhKaAcefgAaX6hhaXaA9hmbkkahceGmeka8Ka85Udwa8Ka87Udla8Ka88UdbkaQcefgQal9hmbkdndna8LTmba8LclthYa8Lcdth8KcbhKa8ShXindnaLaKfRbbTmba5aKfRbbclSmbJbbbbJbbjZa8NaKc8S2fIdyg8U:va8UJbbbb9BEh8UaaaCaKcdtfydbcx2fhHaqheaXhAa8LhQinaAa8UaecwfIdbaHIdwNaeIdbaHIdbNaeclfIdbaHIdlNMMaecxfIdbMNUdbaeczfheaAclfhAaQcufgQmbkkaqaYfhqaXa8KfhXaKcefgKal9hmbkarcd4hXavcd4hYasId:qeh8UasId:meh8WasId1eh8XazTmea8Lcdth8KcbhKindnaLaKfRbbTmbaiazaKcdtfydbgCaY2cdtfgeaaaKcx2fgHIdba8RNa8XMUdbaeaHIdla8RNa8WMUdlaeaHIdwa8RNa8UMUdwaoaCaX2cdtfhQashea8ShHa8LhCinaQaeydbcdtgAfaHIdbawaAfIdb:vUdbaeclfheaHclfhHaCcufgCmbkka8Sa8Kfh8SaKcefgKal9hmbxikkavcd4hCasId:qeh8UasId:meh8WasId1eh8XdnazTmbazheindna9pRbbTmbaiaeydbaC2cdtfgHaaIdba8RNa8XMUdbaHaaclfIdba8RNa8WMUdlaHaacwfIdba8RNa8UMUdwka9pcefh9paeclfheaacxfhaalcufglmbxikkaCcdtheindna9pRbbTmbaiaaIdba8RNa8XMUdbaiclfaaclfIdba8RNa8WMUdbaicwfaacwfIdba8RNa8UMUdbka9pcefh9paacxfhaaiaefhialcufglmbxdkka8Lcdth8KcbhKindnaLaKfRbbTmbaiaKaY2cdtfgeaaaKcx2fgHIdba8RNa8XMUdbaeaHIdla8RNa8WMUdlaeaHIdwa8RNa8UMUdwaoaKaX2cdtfhQashea8ShHa8LhCinaQaeydbcdtgAfaHIdbawaAfIdb:vUdbaeclfheaHclfhHaCcufgCmbkka8Sa8Kfh8SaKcefgKal9hmbkkdnamcjjjjlGTmbazmbaOTmbcbhLabheina5aeydbgAfRbbc3thKaecwfgXydbhHdndna8EaAcdtg8KfydbaeclfgYydbgCSmbcbhQa8FaCcdtfydbaA9hmekcjjjj94hQkaeaKaQVaAVBdba5aCfRbbc3thKdndna8EaCcdtfydbaHSmbcbhQa8FaHcdtfydbaC9hmekcjjjj94hQkaYaKaQVaCVBdba5aHfRbbc3thQdndna8EaHcdtfydbaASmbcbhCa8Fa8KfydbaH9hmekcjjjj94hCkaXaQaCVaHVBdbaecxfheaLcifgLaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPana86:rNUdbkasyd;8egecdtasc:Ceffc98fhHdninaeTmeaHydbcbyd:m:jjjbH:bjjjbbaHc98fhHaecufhexbkkascj;sbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:rjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:jjjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:rjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:jjjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkawclfhwabclfhbaiaDcefgD9hmbkkk:hrdvuv998Jjjjjbca9Rgoczfcwfcbyd11jjbBdbaocb8Pdj1jjb83izaocwfcbydN1jjbBdbaocb8Pd:m1jjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:ZlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvc:G1jjbfydbcdtfydbcdtfydbhodnabalawavfydbcdtfydbgqcdtfgkydbgvaqSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnabaocdtfgkydbgvaoSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnabavfgDydbgvaxSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhvabhocbhkindndnavalydbgq9hmbdnavaoydbgq9hmbaoakBdbakcefhkxdkaoabaqcdtfydbBdbxekaoabaqcdtfydbBdbkaoclfhoalclfhlaeavcefgv9hmbkakk;Jiilud99duabcbaecltz:rjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakclfgxaqaxIdbMUdbakcwfgxaDaxIdbMUdbakcxfgkakIdbJbbjZMUdbaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhraehkinarcxfgoIdbhDaocbBdbararIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbarclfgoaDaoIdbNUdbarcwfgoaDaoIdbNUdbarczfhrakcufgkmbkkdnalTmbinavadydbcltfgrcxfgkaicwfIdbarcwfIdb:tgDaDNaiIdbarIdb:tgDaDNaiclfIdbarclfIdb:tgDaDNMMgDakIdbgqaqaD9DEUdbadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhrinabarIdbUdbarczfhrabclfhbaecufgembkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:p8Koque99due99iuq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:rjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:jjjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhHdndninashYaHhXaPhrakg8AaQ9pmeaXar9Rcd9imeavaXcufavaX9iEarcefavar9kEhzdnalTmbazcuf:YhwdnaoTmbcbhOaihPaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhHxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhHxekcjjjj94hHkaHcqthHdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaHasVhHdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaHascCtVhHkaPaHBdbaPclfhPavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhPindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhHxekcjjjj94hHkaHcCthHdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascqtaHVhHdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskaOaHasVBdbavcxfhvaOclfhOaPcufgPmbkkcbhOdnadTmbaehvcbhPinaOaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgs9haiavydbcdtfydbgAaH9haAas9hGGfhOavcxfhvaPcifgPad6mbkkaYhsaOhkaXhHazhPdnaOaQ9nmbaOhsa8AhkazhHarhPkdndnaKcl0mbdnaY:Zgwa8A:ZgC:taz:YgEar:Y:tg3aEaX:Y:tg5aO:Zg8EaL:tNNNawaL:ta5NaCa8E:tNaCaL:ta3Na8Eaw:tNM:vaEMJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPaHfcd9ThvkaKcefgKcs9hmbxdkka8AhkarhPkdndndnakmbJbbjZhwcbhicdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgravcFFFFi0Ecbyd1:jjjbHjjjjbbgzBdCaqciBd2aqamcbyd1:jjjbHjjjjbbgXBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihHaxhPindndnaoaOfRbbceGTmbaOcjjjjlVhsxekdndnaPclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascqthsdndnaPcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkasaAVhsdndnaPIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkasaAcCtVhskaHasBdbaHclfhHaPcxfhPalaOcefgO9hmbxikkazcFearz:rjjjb8AcbhrcbhvxdkaxhOaihPalhHindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohsxekcjjjj94hskascCthsdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqtasVhsdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaPasaAVBdbaOcxfhOaPclfhPaHcufgHmbkkazcFearz:rjjjbhAavcufhocbhrcbhzindndndnaAaiazcdtgKfydbgHcm4aH7c:v;t;h;Ev2gvcs4av7aoGgPcdtfgsydbgOcuSmbcehvinaiaOcdtgOfydbaHSmdaPavfhOavcefhvaAaOaoGgPcdtfgsydbgOcu9hmbkkasazBdbarhvarcefhrxekaXaOfydbhvkaXaKfavBdbazcefgzal9hmbkcuarc8S2gOarc;D;O;f8U0EhvkcbhAaqavcbyd1:jjjbHjjjjbbgvBd3aqcvBd2avcbaOz:rjjjbhOdnadTmbaehiinJbbnnJbbjZaXaiydbgHcdtfydbgvaXaiclfydbgPcdtfydbgzSavaXaicwfydbgscdtfydbgKSGgoEh8FdnaxaPcx2fgPIdbaxaHcx2fgHIdbg8E:tgCaxascx2fgsIdlaHIdlg3:tgwNasIdba8E:tgEaPIdla3:tgaN:tgLaLNaaasIdwaHIdwg5:tghNawaPIdwa5:tgaN:tgwawNaaaENahaCN:tgCaCNMM:rgEJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNgaMUdbavaCaEaCNghNggavIdlMUdlavaLaEaLNg8FNg8JavIdwMUdwavahawNghavIdxMUdxava8FawNg8KavIdzMUdzava8FaCNg8FavIdCMUdCavawaEaLa5Nawa8ENa3aCNMM:mg3Ng8ENgwavIdKMUdKavaCa8ENgCavId3MUd3avaLa8ENgLavIdaMUdaava8Ea3Ng8EavId8KMUd8KavaEavIdyMUdydnaombaOazc8S2fgvaaavIdbMUdbavagavIdlMUdlava8JavIdwMUdwavahavIdxMUdxava8KavIdzMUdzava8FavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava8EavId8KMUd8KavaEavIdyMUdyaOaKc8S2fgvaaavIdbMUdbavagavIdlMUdlava8JavIdwMUdwavahavIdxMUdxava8KavIdzMUdzava8FavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava8EavId8KMUd8KavaEavIdyMUdykaicxfhiaAcifgAad6mbkkcbhHaqcuarcdtgvarcFFFFi0Egicbyd1:jjjbHjjjjbbgPBdaaqcoBd2aqaicbyd1:jjjbHjjjjbbgiBd8KaqcrBd2aPcFeavz:rjjjbhzdnalTmbaXhPinJbbbbJbbjZaOaPydbgsc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnazascdtgvfgsydbcuSmbaiavfIdbaw9ETmekasaHBdbaiavfawUdbkaPclfhPaxcxfhxalaHcefgH9hmbkkJbbbbhwdnarTmbinaiIdbgCawawaC9DEhwaiclfhiarcufgrmbkkakcd4akfhOcehiinaigvcethiavaO6mbkcbhiaqcuavcdtgOavcFFFFi0Ecbyd1:jjjbHjjjjbbgPBdyaPcFeaOz:rjjjbhsdnadTmbavcufhAcbhrcbhxindnaXaeaxcdtfgvydbcdtfydbgiaXavclfydbcdtfydbgOSmbaiaXavcwfydbcdtfydbgvSmbaOavSmbazavcdtfydbhHdndnazaOcdtfydbgvazaicdtfydbgi9pmbavaH9pmbaHhlaihoavhHxekdnaHai9pmbaHav9pmbaihlavhoxekavhlaHhoaihHkabarcx2fgvaHBdbavcwfaoBdbavclfalBdbdnasaoc:3F;N8N2alc:F:b:DD27aHc;D;O:B8J27aAGgOcdtfgvydbgicuSmbcehPinaPhvdnabaicx2fgiydbaH9hmbaiydlal9hmbaiydwaoSmikavcefhPasaOavfaAGgOcdtfgvydbgicu9hmbkkavarBdbarcefhrkaxcifgxad6mbkarci2hikdnaDmbcwhvxdkaw:rhwcwhvkaDawUdbkavcdthvdninavTmeavc98fgvaqcxffydbcbyd:m:jjjbH:bjjjbbxbkkaqc;Wbf8Kjjjjbaik:2ldwue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:rjjjb8AdnabaeSmbabaeadcdtz:qjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:jjjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbhkarcxfaryd2gxcdtgmfakBdbaraxcefgPBd2akaialavcbcbz:ejjjb8AarcxfaPcdtfaDcbyd1:jjjbHjjjjbbgvBdbaraxcdfgiBd2arcxfaicdtfcuavalaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:jjjbHjjjjbbgiBdbaiaeavakalz:gjjjbdnadTmbaoaoNhocbhwabhlcbhkindnaiavalydbgecdtfydbcdtfIdbao9ETmbalclf8PdbhsabawcdtfgqaeBdbaqclfas83dbawcifhwkalcxfhlakcifgkad6mbkkaxcifhlamarcxffcwfhkdninalTmeakydbcbyd:m:jjjbH:bjjjbbakc98fhkalcufhlxbkkarc;Wbf8Kjjjjbawk:FCoDud99rue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:rjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:jjjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:jjjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:rjjjbh3cbh5cbhPindna3axaPcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5aPcefgPad9hmbxdkkazcFeasz:rjjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa5:ZghaH:tNNNaOaH:taaNa8Aah:tNa8AaH:ta8FNahaO:tNM:va8EMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd1:jjjbHjjjjbbg5BdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:rjjjbh3cbhDcbhYindndndna3axaYcdtgKfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbcehiinaxaecdtgefydbaCSmdamaifheaicefhia3aeaAGgmcdtfgEydbgecu9hmbkkaEaYBdbaDhiaDcefhDxeka5aefydbhika5aKfaiBdbaYcefgYad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:rjjjb8AcbhDcbhekawaecbyd1:jjjbHjjjjbbgeBd3awcvBd2aecbaiz:rjjjbhEavcd4hKdnadTmbdnalTmbaKcdth3a5hCaqhealhmadhAinaEaCydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaecxfheama3fhmaAcufgAmbxdkka5hmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd1:jjjbHjjjjbbgeBdaawcoBd2awaicbyd1:jjjbHjjjjbbg3Bd8KaecFeaYz:rjjjbhxdnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8AaKcdthPalheina8Aaec;81jjbalEgmIdwaEa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndnaxaAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka5clfh5aqcxfhqaeaPfheadaCcefgC9hmbkkabaxaYz:qjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd:m:jjjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Ydidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:rjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcifc98GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcrfc94GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:jjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:jjjbfgdBd:q:jjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iedbcjwk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1Dkxebbbdbbb:GNbb",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(t),{}).then(function(p){n=p.instance,n.exports.__wasm_call_ctors()});function r(p){for(var x=new Uint8Array(p.length),_=0;_<p.length;++_){var w=p.charCodeAt(_);x[_]=w>96?w-97:w>64?w-39:w+4}for(var M=0,_=0;_<p.length;++_)x[M++]=x[_]<60?e[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,M)}function a(p){if(!p)throw new Error("Assertion failed")}function s(p){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}function o(p,x,_){var w=n.exports.sbrk,M=w(x.length*4),S=w(_*4),A=new Uint8Array(n.exports.memory.buffer),C=s(x);A.set(C,M);var D=p(S,M,x.length,_);A=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(_);new Uint8Array(R.buffer).set(A.subarray(S,S+_*4)),C.set(A.subarray(M,M+x.length*4)),w(M-w(0));for(var N=0;N<x.length;++N)x[N]=R[x[N]];return[R,D]}function l(p){for(var x=0,_=0;_<p.length;++_){var w=p[_];x=x<w?w:x}return x}function c(p,x,_,w,M,S,A,C,D){var R=n.exports.sbrk,N=R(4),U=R(_*4),j=R(M*S),z=R(_*4),q=new Uint8Array(n.exports.memory.buffer);q.set(s(w),j),q.set(s(x),z);var B=p(U,z,_,j,M,S,A,C,D,N);q=new Uint8Array(n.exports.memory.buffer);var G=new Uint32Array(B);s(G).set(q.subarray(U,U+B*4));var H=new Float32Array(1);return s(H).set(q.subarray(N,N+4)),R(N-R(0)),[G,H[0]]}function u(p,x,_,w,M,S,A,C,D,R,N,U,j){var z=n.exports.sbrk,q=z(4),B=z(_*4),G=z(M*S),H=z(M*C),W=z(D.length*4),F=z(_*4),Y=R?z(M):0,Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(w),G),Z.set(s(A),H),Z.set(s(D),W),Z.set(s(x),F),R&&Z.set(s(R),Y);var V=p(B,F,_,G,M,S,H,C,W,D.length,Y,N,U,j,q);Z=new Uint8Array(n.exports.memory.buffer);var de=new Uint32Array(V);s(de).set(Z.subarray(B,B+V*4));var se=new Float32Array(1);return s(se).set(Z.subarray(q,q+4)),z(q-z(0)),[de,se[0]]}function f(p,x,_,w,M,S,A,C,D,R,N,U,j){var z=n.exports.sbrk,q=z(4),B=z(M*S),G=z(M*C),H=z(D.length*4),W=z(_*4),F=R?z(M):0,Y=new Uint8Array(n.exports.memory.buffer);Y.set(s(w),B),Y.set(s(A),G),Y.set(s(D),H),Y.set(s(x),W),R&&Y.set(s(R),F);var Z=p(W,_,B,M,S,G,C,H,D.length,F,N,U,j,q);Y=new Uint8Array(n.exports.memory.buffer),s(x).set(Y.subarray(W,W+Z*4)),s(w).set(Y.subarray(B,B+M*S)),s(A).set(Y.subarray(G,G+M*C));var V=new Float32Array(1);return s(V).set(Y.subarray(q,q+4)),z(q-z(0)),[Z,V[0]]}function h(p,x,_,w){var M=n.exports.sbrk,S=M(_*w),A=new Uint8Array(n.exports.memory.buffer);A.set(s(x),S);var C=p(S,_,w);return M(S-M(0)),C}function d(p,x,_,w,M,S,A,C){var D=n.exports.sbrk,R=D(C*4),N=D(_*w),U=D(_*S),j=new Uint8Array(n.exports.memory.buffer);j.set(s(x),N),M&&j.set(s(M),U);var z=p(R,N,_,w,U,S,A,C);j=new Uint8Array(n.exports.memory.buffer);var q=new Uint32Array(z);return s(q).set(j.subarray(R,R+z*4)),D(R-D(0)),q}function g(p,x,_,w,M,S,A,C,D){var R=n.exports.sbrk,N=R(4),U=R(_*4),j=R(M*S),z=R(_*4),q=A?R(M):0,B=new Uint8Array(n.exports.memory.buffer);B.set(s(w),j),B.set(s(x),z),A&&B.set(s(A),q);var G=p(U,z,_,j,M,S,q,C,D,N);B=new Uint8Array(n.exports.memory.buffer);var H=new Uint32Array(G);s(H).set(B.subarray(U,U+G*4));var W=new Float32Array(1);return s(W).set(B.subarray(N,N+4)),R(N-R(0)),[H,W[0]]}function b(p,x,_,w,M,S,A){var C=n.exports.sbrk,D=C(_*4),R=C(M*S),N=C(_*4),U=new Uint8Array(n.exports.memory.buffer);U.set(s(w),R),U.set(s(x),N);var j=p(D,N,_,R,M,S,A);U=new Uint8Array(n.exports.memory.buffer);var z=new Uint32Array(j);return s(z).set(U.subarray(D,D+j*4)),C(D-C(0)),z}var y={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(p){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0);var x=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p);return o(n.exports.meshopt_optimizeVertexFetchRemap,x,l(p)+1)},simplify:function(p,x,_,w,M,S){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w>=0&&w<=p.length),a(w%3==0),a(M>=0);for(var A=0,C=0;C<(S?S.length:0);++C)a(S[C]in y),A|=y[S[C]];var D=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),R=c(n.exports.meshopt_simplify,D,p.length,x,x.length/_,_*4,w,M,A);return R[0]=p instanceof Uint32Array?R[0]:new p.constructor(R[0]),R},simplifyWithAttributes:function(p,x,_,w,M,S,A,C,D,R){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w instanceof Float32Array),a(w.length==M*(x.length/_)),a(M>=0),a(A==null||A instanceof Uint8Array),a(A==null||A.length==x.length/_),a(C>=0&&C<=p.length),a(C%3==0),a(D>=0),a(Array.isArray(S)),a(M>=S.length),a(S.length<=32);for(var N=0;N<S.length;++N)a(S[N]>=0);for(var U=0,N=0;N<(R?R.length:0);++N)a(R[N]in y),U|=y[R[N]];var j=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),z=u(n.exports.meshopt_simplifyWithAttributes,j,p.length,x,x.length/_,_*4,w,M*4,new Float32Array(S),A,C,D,U);return z[0]=p instanceof Uint32Array?z[0]:new p.constructor(z[0]),z},simplifyWithUpdate:function(p,x,_,w,M,S,A,C,D,R){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w instanceof Float32Array),a(w.length==M*(x.length/_)),a(M>=0),a(A==null||A instanceof Uint8Array),a(A==null||A.length==x.length/_),a(C>=0&&C<=p.length),a(C%3==0),a(D>=0),a(Array.isArray(S)),a(M>=S.length),a(S.length<=32);for(var N=0;N<S.length;++N)a(S[N]>=0);for(var U=0,N=0;N<(R?R.length:0);++N)a(R[N]in y),U|=y[R[N]];var j=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),z=f(n.exports.meshopt_simplifyWithUpdate,j,p.length,x,x.length/_,_*4,w,M*4,new Float32Array(S),A,C,D,U);if(p!==j)for(var N=0;N<z[0];++N)p[N]=j[N];return z},getScale:function(p,x){return a(p instanceof Float32Array),a(p.length%x==0),a(x>=3),h(n.exports.meshopt_simplifyScale,p,p.length/x,x*4)},simplifyPoints:function(p,x,_,w,M,S){return a(p instanceof Float32Array),a(p.length%x==0),a(x>=3),a(_>=0&&_<=p.length/x),w?(a(w instanceof Float32Array),a(w.length%M==0),a(M>=3),a(p.length/x==w.length/M),d(n.exports.meshopt_simplifyPoints,p,p.length/x,x*4,w,M*4,S,_)):d(n.exports.meshopt_simplifyPoints,p,p.length/x,x*4,void 0,0,0,_)},simplifySloppy:function(p,x,_,w,M,S){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w==null||w instanceof Uint8Array),a(w==null||w.length==x.length/_),a(M>=0&&M<=p.length),a(M%3==0),a(S>=0);var A=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),C=g(n.exports.meshopt_simplifySloppy,A,p.length,x,x.length/_,_*4,w,M,S);return C[0]=p instanceof Uint32Array?C[0]:new p.constructor(C[0]),C},simplifyPrune:function(p,x,_,w){a(p instanceof Uint32Array||p instanceof Int32Array||p instanceof Uint16Array||p instanceof Int16Array),a(p.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w>=0);var M=p.BYTES_PER_ELEMENT==4?p:new Uint32Array(p),S=b(n.exports.meshopt_simplifyPrune,M,p.length,x,x.length/_,_*4,w);return S=p instanceof Uint32Array?S:new p.constructor(S),S}}}();(function(){var t="b9H79TebbbeVx9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gvuuuuueu9Gwuuuuuuuub9Gxuuuuuuuuuuuueu9Gkuuuuuuuuuu99eu9Gouuuuuub9Gruuuuuuub9GluuuubiAOdilvorwDqqDkbiibeilve9Weiiviebeoweuec;G:Odkr;qeDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bqL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbkl79IV9RbxDwebcekdszq:x9DOdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:w8KDPue99eux99dui99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:ojjjb8Adndnalcb9imbaoal9nmbamcuaocdtaocFFFFi0Egscbyd;u1jjbHjjjjbbgzBd:CwamceBd;8wamascbyd;u1jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;u1jjbHjjjjbbgOBd:KwamciBd;8waihsalhAinazasydbcdtfcbBdbasclfhsaAcufgAmbkaihsalhAinazasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkaihsalhCcbhXindnazasydbcdtgQfgAydbcb9imbaHaQfaXBdbaAaAydbgQcjjjj94VBdbaQaXfhXkasclfhsaCcufgCmbkalci9UhLdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhXaHaAydbcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaXcdtfgXaXydbgXcefBdbaOaXcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaihsalhAindnazasydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaHaCfgCaCydbaQ9RBdbkasclfhsaAcufgAmbxdkkamcuaocdtgsaocFFFFi0EgAcbyd;u1jjbHjjjjbbgzBd:CwamceBd;8wamaAcbyd;u1jjbHjjjjbbgHBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;u1jjbHjjjjbbgOBd:KwamciBd;8wazcbasz:ojjjbhXalci9UhLaihsalhAinaXasydbcdtfgCaCydbcefBdbasclfhsaAcufgAmbkdnaoTmbcbhsaHhAaXhCaohQinaAasBdbaAclfhAaCydbasfhsaCclfhCaQcufgQmbkkdnalci6mbcbhsaihAinaAcwfydbhCaAclfydbhQaHaAydbcdtfgKaKydbgKcefBdbaOaKcdtfasBdbaHaQcdtfgQaQydbgQcefBdbaOaQcdtfasBdbaHaCcdtfgCaCydbgCcefBdbaOaCcdtfasBdbaAcxfhAaLascefgs9hmbkkaoTmbcbhsaohAinaHasfgCaCydbaXasfydb9RBdbasclfhsaAcufgAmbkkamaLcbyd;u1jjbHjjjjbbgsBd:OwamclBd;8wascbaLz:ojjjbhYamcuaLcK2alcjjjjd0Ecbyd;u1jjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihAa8AhsaLhrJbbbbh5inavaAclfydbaK2cdtfgCIdlh8EavaAydbaK2cdtfgXIdlhEavaAcwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgasaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbasclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyascxfa8EaE:tg8Eagah:tggNa8FaE:tg8Faaah:tgaN:tgEJbbbbJbbjZa8Ja8K:tg8Ja8FNa8La8K:tg8Ka8EN:tghahNaEaENaaa8KNaga8JN:tgEaENMM:rg8K:va8KJbbbb9BEg8ENUdbasczfaEa8ENUdbascCfaha8ENUdbascwfa8Maya8NMMJbbnn:vUdba5a8KMh5aAcxfhAascKfhsarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;u1jjbHjjjjbbgCBd:WwamcoBd;8waEaq:ZNhEdna3mbcbhsaChAinaAasBdbaAclfhAaLascefgs9hmbkkaE:rhhcuh8PamcuaLcltalcFFFFd0Ecbyd;u1jjbHjjjjbbgIBd:0wamcrBd;8wcbaIa8AaCaLz:djjjb8AJFFuuhyJFFuuh8RJFFuuh8Sdnalci6gXmbJFFuuh8Sa8AhsaLhAJFFuuh8RJFFuuhyinascwfIdbgEayayaE9EEhyasclfIdbgEa8Ra8RaE9EEh8RasIdbgEa8Sa8SaE9EEh8SascKfhsaAcufgAmbkkahJbbbZNhgamaocetgscuaocu9kEcbyd;u1jjbHjjjjbbgABd:4waAcFeasz:ojjjbhCdnaXmbcbhAJFFuuhEa8Ahscuh8PinascwfIdbay:tghahNasIdba8S:tghahNasclfIdba8R:tghahNMM:rghaEa8PcuSahaE9DVgXEhEaAa8PaXEh8PascKfhsaLaAcefgA9hmbkkamczfcbcjwz:ojjjb8Aamcwf9cb83ibam9cb83ibagaxNhRJbbjZak:th8Ncbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YJbbbbh8ZJbbbbh80cbh81cbhPinJbbbbhEdna8UTmbJbbjZa8U:Z:vhEkJbbbbhhdna80a80Na8Ya8YNa8Za8ZNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8XaENh5a8WaENh8Fa8VaENhaa8PhQdndndndndna8UaPVTmbamydwgBTmea80ahNh8Ja8ZahNh8La8YahNh8Maeamydbcdtfh83cbh3JFFuuhEcvhXcuhQindnaza83a3cdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAindndnaCaiaAydbgKcx2fgsclfydbgrcetf8Vebcs4aCasydbgLcetf8Vebcs4faCascwfydbglcetf8Vebcs4fgombcbhsxekcehsazaLcdtfydbgLceSmbcehsazarcdtfydbgrceSmbcehsazalcdtfydbglceSmbdnarcdSaLcdSfalcdSfcd6mbaocefhsxekaocdfhskdnasaX9kmba8AaKcK2fgLIdwa5:thhaLIdla8F:th8KaLIdbaa:th8EdndnakJbbbb9DTmba8E:lg8Ea8K:lg8Ka8Ea8K9EEg8Kah:lgha8Kah9EEag:vJbbjZMhhxekahahNa8Ea8ENa8Ka8KNMM:rag:va8NNJbbjZMJ9VO:d86JbbjZaLIdCa8JNaLIdxa8MNa8LaLIdzNMMakN:tghahJ9VO:d869DENhhkaKaQasaX6ahaE9DVgLEhQasaXaLEhXahaEaLEhEkaAclfhAavcufgvmbkka3cefg3aB9hmbkkaQcu9hmekama5Ud:ODama8FUd:KDamaaUd:GDamcuBd:qDamcFFF;7rBdjDaIcba8AaYamc:GDfakJbbbb9Damc:qDfamcjDfz:ejjjbamyd:qDhQdndnaxJbbbb9ETmba8UaD6mbaQcuSmeceh3amIdjDaR9EmixdkaQcu9hmekdna8UTmbdnamydlgza8Uci2fgsciGTmbadasfcba8Uazcu7fciGcefz:ojjjb8AkabaPcltfgzam8Pib83dbazcwfamcwf8Pib83dbaPcefhPkc3hzinazc98Smvamc:Cwfazfydbcbyd;y1jjbH:bjjjbbazc98fhzxbkkcbh3a8Uaq9pmbamydwaCaiaQcx2fgsydbcetf8Vebcs4aCascwfydbcetf8Vebcs4faCasclfydbcetf8Vebcs4ffaw9nmekcbhscbhAdna81TmbcbhAamczfhXinamczfaAcdtfaXydbgLBdbaXclfhXaAaYaLfRbbTfhAa81cufg81mbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDaAc;8eaAclfc:bd6Eh81inamcjDfasfcFFF;7rBdbasclfgscz9hmbka81cdthBdnalTmbaeaXcdtfhocbhrindnazaoarcdtfydbcdtgsfydbgvTmbaOaHasfydbcdtfhAcuhLcuhsinazaiaAydbgKcx2fgXclfydbcdtfydbazaXydbcdtfydbfazaXcwfydbcdtfydbfgXasaXas6gXEhsaKaLaXEhLaAclfhAavcufgvmbkaLcuSmba8AaLcK2fgAIdway:tgEaENaAIdba8S:tgEaENaAIdla8R:tgEaENMM:rhEcbhAindndnasamc:qDfaAfgvydbgX6mbasaX9hmeaEamcjDfaAfIdb9FTmekavasBdbamc:GDfaAfaLBdbamcjDfaAfaEUdbxdkaAclfgAcz9hmbkkarcefgral9hmbkkamczfaBfhLcbhscbhAindnamc:GDfasfydbgXcuSmbaLaAcdtfaXBdbaAcefhAkasclfgscz9hmbkaAa81fg81TmbJFFuuhhcuhKamczfhsa81hvcuhLina8AasydbgXcK2fgAIdway:tgEaENaAIdba8S:tgEaENaAIdla8R:tgEaENMM:rhEdndnazaiaXcx2fgAclfydbcdtfydbazaAydbcdtfydbfazaAcwfydbcdtfydbfgAaL6mbaAaL9hmeaEah9DTmekaEhhaAhLaXhKkasclfhsavcufgvmbkaKcuSmbaKhQkdnamaiaQcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YJbbbbh8ZJbbbbh80kcbhXinaOaHaraXcdtfydbcdtgAfydbcdtfgKhsazaAfgvydbgLhAdnaLTmbdninasydbaQSmeasclfhsaAcufgATmdxbkkasaKaLcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaQcK2fgsIdbhEasIdlhhasIdwh8KasIdxh8EasIdzh5asIdCh8FaYaQfce86bba80a8FMh80a8Za5Mh8Za8Ya8EMh8Ya8Xa8KMh8Xa8WahMh8Wa8VaEMh8Vamydxh8Uxbkkamc:WDf8KjjjjbaPk;Vvivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbararydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark:;idiud99dndnabaecitfgwydlgDciGgqciSmbinabcbaDcd4gDalaqcdtfIdbawIdb:tgkJbbbb9FEgwaecefgefadaialavaoarz:ejjjbak:larIdb9FTmdabawaD7aefgecitfgwydlgDciGgqci9hmbkkabaecitfgeclfhbdnavmbcuhwindnaiaeydbgDfRbbmbadaDcK2fgqIdwalIdw:tgkakNaqIdbalIdb:tgkakNaqIdlalIdl:tgkakNMM:rgkarIdb9DTmbarakUdbaoaDBdbkaecwfheawcefgwabydbcd46mbxdkkcuhwindnaiaeydbgDfRbbmbadaDcK2fgqIdbalIdb:t:lgkaqIdlalIdl:t:lgxakax9EEgkaqIdwalIdw:t:lgxakax9EEgkarIdb9DTmbarakUdbaoaDBdbkaecwfheawcefgwabydbcd46mbkkk;llevudnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0abydxaq9pVakVgDce9hmbavawcltfgxab8Pdb83dbaxcwfabcwfgx8Pdb83dbdnaxydbgqTmbaoabydbcdtfhxaqhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkdnabydxglci2gsabydlgxfgkciGTmbarakfcbalaxcu7fciGcefz:ojjjb8Aabydxci2hsabydlhxabydwhqkab9cb83dwababydbaqfBdbabascifc98GaxfBdlaP8Vebhscbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk8LbabaeadaialavaoarawaDaDaqJbbbbz:cjjjbk;Nkovud99euv99eul998Jjjjjbc:W;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:W:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaoc8Wfawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeaocbBd8Sao9cb83iKao9cb83izaoczfaoc8Wfawci2cxaoc8Sfcbcrz1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:W:qefawcxaoc8Sfcbciz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:W:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:W:qefheaoc8WfhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabaxUd8KabasUdaabazUd3abaCaxaPN:tUdKabaXasaPN:tUdCabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabae86b8UdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabav86bRdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:W;aef8Kjjjjbk;Iwwvul99iud99eue99eul998Jjjjjbcje9Rgr8Kjjjjbavcd4hwaicd4hDdndnaoTmbarc;abfcbaocdtgvz:ojjjb8Aarc;Gbfcbavz:ojjjb8AarhvarcafhiaohqinavcFFF97BdbaicFFF;7rBdbaiclfhiavclfhvaqcufgqmbkdnadTmbcbhkinaeakaD2cdtfgvIdwhxavIdlhmavIdbhPalakaw2cdtfIdbhsarc;abfhzarhiarc;GbfhHarcafhqcj1jjbhvaohOinasavcwfIdbaxNavIdbaPNavclfIdbamNMMgAMhCakhXdnaAas:tgAaqIdbgQ9DgLmbaHydbhXkaHaXBdbakhXdnaCaiIdbgK9EmbazydbhXaKhCkazaXBdbaiaCUdbaqaAaQaLEUdbavcxfhvaqclfhqaHclfhHaiclfhiazclfhzaOcufgOmbkakcefgkad9hmbkkadThkJbbbbhCcbhXarc;abfhvarc;Gbfhicbhqinalavydbgzaw2cdtfIdbalaiydbgHaw2cdtfIdbaeazaD2cdtfgzIdwaeaHaD2cdtfgHIdw:tgsasNazIdbaHIdb:tgsasNazIdlaHIdl:tgsasNMM:rMMgsaCasaC9EgzEhCaqaXazEhXaiclfhiavclfhvaoaqcefgq9hmbkaCJbbbZNhKxekadThkcbhXJbbbbhKkJbbbbhCdnaearc;abfaXcdtgifydbgqaD2cdtfgvIdwaearc;GbfaifydbgzaD2cdtfgiIdwgm:tgsasNavIdbaiIdbgY:tgAaANavIdlaiIdlgP:tgQaQNMM:rgxJbbbb9ETmbaxalaqaw2cdtfIdbMalazaw2cdtfIdb:taxaxM:vhCkasaCNamMhmaQaCNaPMhPaAaCNaYMhYdnakmbaDcdthvawcdthiindnalIdbg8AaecwfIdbam:tgCaCNaeIdbaY:tgsasNaeclfIdbaP:tgAaANMM:rgQMgEaK9ETmbJbbbbhxdnaQJbbbb9ETmbaEaK:taQaQM:vhxkaxaCNamMhmaxaANaPMhPaxasNaYMhYa8AaKaQMMJbbbZNhKkaeavfhealaifhladcufgdmbkkabaKUdxabamUdwabaPUdlabaYUdbarcjef8Kjjjjbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Reeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrz1jjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk:3lequ8JjjjjbcjP9Rgl8Kjjjjbcbhvalcjxfcbaiz:ojjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjxfaDcefRbbfRbb9RcFeGci6aoalcjxfaDRbbfRbb9RcFeGci6faoalcjxfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:rjjjb8Aakalcjxffaocefgo86bbaxalcjxffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjxffao86bbarcifhravcefgvad9hmbkalcFeaicetz:ojjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkcetfgw8UebgDcu9kmbawax87ebaocjlfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjlfaDz:njjjb8AalcjPf8Kjjjjbk9teiucbcbyd;C1jjbgeabcifc98GfgbBd;C1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;teeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk:3eedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdxaialBdwaialBdlaialBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;C1jjbgeabcrfc94GfgbBd;C1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;C1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;C1jjbfgdBd;C1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkk9Tdbcjwk9ubbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;uwkxebbbdbbb9GNbb",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(t),{}).then(function(b){n=b.instance,n.exports.__wasm_call_ctors()});function r(b){for(var y=new Uint8Array(b.length),p=0;p<b.length;++p){var x=b.charCodeAt(p);y[p]=x>96?x-97:x>64?x-39:x+4}for(var _=0,p=0;p<b.length;++p)y[_++]=y[p]<60?e[y[p]]:(y[p]-60)*64+y[++p];return y.buffer.slice(0,_)}function a(b){if(!b)throw new Error("Assertion failed")}function s(b){return new Uint8Array(b.buffer,b.byteOffset,b.byteLength)}var o=48,l=16;function c(b,y){var p=b.meshlets[y*4+0],x=b.meshlets[y*4+1],_=b.meshlets[y*4+2],w=b.meshlets[y*4+3];return{vertices:b.vertices.subarray(p,p+_),triangles:b.triangles.subarray(x,x+w*3)}}function u(b,y,p,x,_,w,M){var S=n.exports.sbrk,A=n.exports.meshopt_buildMeshletsBound(b.length,_,w),C=S(A*l),D=S(A*_*4),R=S(A*w*3),N=S(b.byteLength),U=S(y.byteLength),j=new Uint8Array(n.exports.memory.buffer);j.set(s(b),N),j.set(s(y),U);var z=n.exports.meshopt_buildMeshlets(C,D,R,N,b.length,U,p,x,_,w,M);j=new Uint8Array(n.exports.memory.buffer);for(var q=j.subarray(C,C+z*l),B=new Uint32Array(q.buffer,q.byteOffset,q.byteLength/4).slice(),G=0;G<z;++G){var H=B[G*4+0],W=B[G*4+1],p=B[G*4+2],F=B[G*4+3];n.exports.meshopt_optimizeMeshlet(D+H*4,R+W,F,p)}var Y=B[(z-1)*4+0],Z=B[(z-1)*4+1],V=B[(z-1)*4+2],de=B[(z-1)*4+3],se=Y+V,oe=Z+(de*3+3&-4),ue={meshlets:B,vertices:new Uint32Array(j.buffer,D,se).slice(),triangles:new Uint8Array(j.buffer,R,oe*3).slice(),meshletCount:z};return S(C-S(0)),ue}function f(b){var y=new Float32Array(n.exports.memory.buffer,b,o/4);return{centerX:y[0],centerY:y[1],centerZ:y[2],radius:y[3],coneApexX:y[4],coneApexY:y[5],coneApexZ:y[6],coneAxisX:y[7],coneAxisY:y[8],coneAxisZ:y[9],coneCutoff:y[10]}}function h(b,y,p,x){var _=n.exports.sbrk,w=[],M=_(y.byteLength),S=_(b.vertices.byteLength),A=_(b.triangles.byteLength),C=_(o),D=new Uint8Array(n.exports.memory.buffer);D.set(s(y),M),D.set(s(b.vertices),S),D.set(s(b.triangles),A);for(var R=0;R<b.meshletCount;++R){var N=b.meshlets[R*4+0],U=b.meshlets[R*4+0+1],j=b.meshlets[R*4+0+3];n.exports.meshopt_computeMeshletBounds(C,S+N*4,A+U,j,M,p,x),w.push(f(C))}return _(M-_(0)),w}function d(b,y,p,x){var _=n.exports.sbrk,w=_(o),M=_(b.byteLength),S=_(y.byteLength),A=new Uint8Array(n.exports.memory.buffer);A.set(s(b),M),A.set(s(y),S),n.exports.meshopt_computeClusterBounds(w,M,b.length,S,p,x);var C=f(w);return _(w-_(0)),C}function g(b,y,p,x,_){var w=n.exports.sbrk,M=w(o),S=w(b.byteLength),A=x?w(x.byteLength):0,C=new Uint8Array(n.exports.memory.buffer);C.set(s(b),S),x&&C.set(s(x),A),n.exports.meshopt_computeSphereBounds(M,S,y,p,A,x?_:0);var D=f(M);return w(M-w(0)),D}return{ready:i,supported:!0,buildMeshlets:function(b,y,p,x,_,w){a(b.length%3==0),a(y instanceof Float32Array),a(y.length%p==0),a(p>=3),a(x<=256||x>0),a(_<=512),a(_%4==0),w=w||0;var M=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return u(M,y,y.length/p,p*4,x,_,w)},extractMeshlet:function(b,y){return a(y>=0&&y<b.meshletCount),c(b,y)},computeClusterBounds:function(b,y,p){a(b.length%3==0),a(b.length/3<=512),a(y instanceof Float32Array),a(y.length%p==0),a(p>=3);var x=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return d(x,y,y.length/p,p*4)},computeMeshletBounds:function(b,y,p){return a(b.meshletCount!=0),a(y instanceof Float32Array),a(y.length%p==0),a(p>=3),h(b,y,y.length/p,p*4)},computeSphereBounds:function(b,y,p,x){return a(b instanceof Float32Array),a(b.length%y==0),a(y>=3),a(!p||p instanceof Float32Array),a(!p||p.length%x==0),a(!p||x>=1),a(!p||b.length/y==p.length/x),x=x||0,g(b,b.length/y,y*4,p,x*4)}}})();function G4e(t,e,n,i){if(!t||!e||i==="off")return{geometries:[],materials:[]};let r=[],a=[];if(e.computeBoundingSphere(),i==="auto"){const l=e.boundingSphere.radius,c=e.attributes.position.count;let u=[];if(c<256)return{geometries:[],materials:[]};c<1024?(r=[.25],u=[2]):c<8192?(r=[.5,.25],u=[1,8]):(r=[8192/c,2048/c,512/c],u=[1,2,8]);const f=Math.sqrt(l+1e-5);a=u.map(h=>h*f)}else r=i.map(l=>l[1]),a=i.map(l=>l[0]);const s=[],o=[];return r.forEach((l,c)=>{const u=Math.floor(e.index.array.length*l/3)*3,f=e.clone(),h=V4e.simplify(new Uint32Array(f.index.array),new Float32Array(f.attributes.position.array),3,u,.02,["LockBorder"])[0];f.index.array.set(h),f.index.needsUpdate=!0,f.setDrawRange(0,h.length);const d=Array.isArray(n)?n.map(g=>g.clone()):n.clone();t.addLOD(f,d,a[c]),s.push(f),Array.isArray(d)?o.push(...d):o.push(d)}),{geometries:s,materials:o}}const Tte=Ee.forwardRef(function(e,n){const[i,r]=Ee.useState(null);Ee.useImperativeHandle(n,()=>i,[i]);const a=I.useMemo(()=>new te,[]),s=I.useMemo(()=>new Vn,[]),o=I.useMemo(()=>new te(1,1,1),[]),l=Ri(c=>c.gl);return I.useEffect(()=>{const c=e.batched_positions.byteLength/(3*Float32Array.BYTES_PER_ELEMENT),u=new Rn(e.geometry.clone(),e.material,{capacity:c,renderer:l});u.frustumCulled=!1;let f=[],h=[];if(e.lod!=="off"){const d=G4e(u,e.geometry,e.material,e.lod);f=d.geometries,h=d.materials}return r(u),()=>{u.disposeBVH(),u.dispose(),f.forEach(d=>d.dispose()),h.forEach(d=>d.dispose())}},[e.geometry,e.lod,e.material]),I.useEffect(()=>{if(!i)return;const c=e.batched_positions.byteLength/(3*Float32Array.BYTES_PER_ELEMENT);i.instancesCount!==c&&(i.capacity<c&&i.resizeBuffers(c),i.clearInstances(),i.addInstances(c,()=>{}));const u=new DataView(e.batched_positions.buffer,e.batched_positions.byteOffset,e.batched_positions.byteLength),f=new DataView(e.batched_wxyzs.buffer,e.batched_wxyzs.byteOffset,e.batched_wxyzs.byteLength),h=e.batched_scales?new DataView(e.batched_scales.buffer,e.batched_scales.byteOffset,e.batched_scales.byteLength):null;i.updateInstances((d,g)=>{const b=g*3*4%e.batched_positions.byteLength,y=g*4*4%e.batched_wxyzs.byteLength;if(a.set(u.getFloat32(b,!0),u.getFloat32(b+4,!0),u.getFloat32(b+8,!0)),s.set(f.getFloat32(y+4,!0),f.getFloat32(y+8,!0),f.getFloat32(y+12,!0),f.getFloat32(y,!0)),h&&e.batched_scales)if(e.batched_scales.byteLength===e.batched_wxyzs.byteLength/4*3){const p=g*3*4%e.batched_scales.byteLength;o.set(h.getFloat32(p,!0),h.getFloat32(p+4,!0),h.getFloat32(p+8,!0))}else{const p=g*4%e.batched_scales.byteLength,x=h.getFloat32(p,!0);o.setScalar(x)}else o.set(1,1,1);d.position.copy(a),d.quaternion.copy(s),d.scale.copy(o)})},[e.batched_positions,e.batched_wxyzs,e.batched_scales,i]),Ee.useEffect(()=>{i!==null&&(e.clickable||i.instancesCount>5e4?i.computeBVH({margin:i.geometry.boundingSphere.radius*.2}):i.disposeBVH())},[e.clickable,i]),Ee.useEffect(()=>{if(i===null||e.batched_colors===null||e.batched_colors.byteLength!==3)return;const c=new Ut(e.batched_colors[0]/255,e.batched_colors[1]/255,e.batched_colors[2]/255);for(let u=0;u<i.instancesCount;u++)i.setColorAt(u,c)},[e.batched_colors,i,e.batched_positions.byteLength]),Ee.useEffect(()=>{if(!(i===null||e.batched_colors===null)&&e.batched_colors.byteLength!==3){if(e.batched_colors.byteLength!==i.instancesCount*3){console.error(`Invalid batched_colors length: ${e.batched_colors.byteLength}, expected 3 or ${i.instancesCount*3}`);return}for(let c=0;c<i.instancesCount;c++){const u=new Ut(e.batched_colors[c*3]/255,e.batched_colors[c*3+1]/255,e.batched_colors[c*3+2]/255);i.setColorAt(c,u)}}},[e.batched_colors,i]),I.useEffect(()=>{i&&(i.castShadow=e.cast_shadow,i.receiveShadow=e.receive_shadow,i.LODinfo&&i.LODinfo.objects&&i.LODinfo.objects.forEach(c=>{c.castShadow=e.cast_shadow,c.receiveShadow=e.receive_shadow}))},[e.cast_shadow,e.receive_shadow,i]),k.jsxs(k.Fragment,{children:[i&&k.jsx("primitive",{object:i}),e.clickable&&k.jsx(yM,{geometry:e.geometry,batched_positions:e.batched_positions,batched_wxyzs:e.batched_wxyzs,batched_scales:e.batched_scales})]})}),W4e=Ee.forwardRef(function({children:e,...n},i){const a=Ee.useContext(bi).useSceneTree(l=>l[n.name]?.clickable)??!1,s=I.useMemo(()=>{const l=Z_({material:n.props.material,wireframe:n.props.wireframe,opacity:n.props.opacity,flat_shading:n.props.flat_shading,side:n.props.side});return n.props.opacity!==null&&n.props.opacity<1&&(l.transparent=!0),l},[n.props.material,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),o=I.useMemo(()=>{const l=new Dn;return l.setAttribute("position",new Nn(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),l.setIndex(new Nn(new Uint32Array(n.props.faces.buffer.slice(n.props.faces.byteOffset,n.props.faces.byteOffset+n.props.faces.byteLength)),1)),l.computeVertexNormals(),l.computeBoundingSphere(),l},[n.props.vertices.buffer,n.props.faces.buffer]);return k.jsxs("group",{ref:i,children:[k.jsx(Tte,{geometry:o,material:s,batched_positions:n.props.batched_positions,batched_wxyzs:n.props.batched_wxyzs,batched_scales:n.props.batched_scales,batched_colors:n.props.batched_colors,lod:n.props.lod,cast_shadow:n.props.cast_shadow,receive_shadow:n.props.receive_shadow,clickable:a}),e]})}),Ate=new KEe;Ate.setDecoderPath("https://www.gstatic.com/draco/v1/decoders/");function q4e(t){t instanceof _i&&(t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(e=>{L6(e)}):L6(t.material)))}function Cte(t){const[e,n]=Ee.useState(),[i,r]=Ee.useState([]),a=Ee.useRef(null);return Ee.useEffect(()=>{const s=new fEe;return s.setDRACOLoader(Ate),s.parse(new Uint8Array(t).buffer,"",o=>{o.animations&&o.animations.length&&(a.current=new A$(o.scene),o.animations.forEach(c=>{a.current.clipAction(c).play()}));const l=[];o?.scene.traverse(c=>{c instanceof _i&&(c.geometry.computeVertexNormals(),c.geometry.computeBoundingSphere(),l.push(c))}),r(l),n(o)},o=>{console.log("Error loading GLB!"),console.log(o)}),()=>{a.current&&a.current.stopAllAction(),e&&e.scene.traverse(q4e)}},[t]),{gltf:e,meshes:i,mixerRef:a}}const X4e=Ee.forwardRef(function({children:e,...n},i){const{gltf:r,meshes:a,mixerRef:s}=Cte(n.props.glb_data);Ee.useEffect(()=>{r&&r.scene.traverse(b=>{b instanceof _i&&(b.castShadow=n.props.cast_shadow,b.receiveShadow=n.props.receive_shadow===!0)})},[r,n.props.cast_shadow,n.props.receive_shadow]),ra((b,y)=>{s.current?.update(y)});const o=Ri(b=>b.gl),l=Ee.useMemo(()=>o.getDrawingBufferSize(new wt),[o]),c=Ee.useMemo(()=>{const b=new PU({side:Ra});return b.thickness=10,b.color=new Ut(16514816),b.opacity=.8,b.size=l,b.transparent=!0,b.screenspace=!0,b.toneMapped=!0,b},[l]),u=Ee.useRef(null),f=Ee.useContext(Zv);ra(()=>{u.current!==null&&(u.current.visible=f.state.current.isHovered)});const h=f.clickable,d=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,g=Ee.useMemo(()=>d===0?null:new lg({opacity:d,color:0,depthWrite:!1}),[d]);return r?k.jsxs("group",{ref:i,children:[k.jsx("primitive",{object:r.scene,scale:n.props.scale}),g&&d>0?k.jsx("group",{scale:n.props.scale,children:a.map((b,y)=>k.jsx("mesh",{geometry:b.geometry,material:g,receiveShadow:!0,position:b.position,rotation:b.rotation,scale:b.scale},`shadow-${y}`))}):null,h?k.jsx("group",{ref:u,visible:!1,children:a.map((b,y)=>k.jsx("mesh",{geometry:b.geometry,material:c},y))}):null,e]}):null}),K4e=Ee.forwardRef(function({children:e,...n},i){const a=Ee.useContext(bi).useSceneTree(c=>c[n.name]?.clickable)??!1,{gltf:s}=Cte(n.props.glb_data),{geometry:o,material:l}=I.useMemo(()=>{if(!s)return{geometry:null,material:null};const c=[],u=[];s.scene.traverse(d=>{d instanceof _i&&d.parent&&(d.geometry.applyMatrix4(d.matrixWorld),c.push(d.geometry),u.push(d.material))});const f=c.length===1?c[0].clone():Xwe(c),h=u.length===1?u[0]:u;return{geometry:f,material:h}},[s]);return!o||!l?null:k.jsxs("group",{ref:i,children:[k.jsx(Tte,{geometry:o,material:l,batched_positions:n.props.batched_positions,batched_wxyzs:n.props.batched_wxyzs,batched_scales:n.props.batched_scales,batched_colors:null,lod:n.props.lod,cast_shadow:n.props.cast_shadow,receive_shadow:n.props.receive_shadow,clickable:a}),e]})});function Y4e(t,e){const n=new wt;return n.x=(e[0]+.5)/t.mutable.current.canvas.clientWidth,n.y=(e[1]+.5)/t.mutable.current.canvas.clientHeight,n}function ql(t){return t[0]<<16|t[1]<<8|t[2]}function J4e(t){return Ee.useContext(bi).useSceneTree(i=>i[t.name]?.labelVisible)?k.jsx(Jv,{children:k.jsx("span",{style:{backgroundColor:"rgba(240, 240, 240, 0.9)",color:"#333",borderRadius:"0.2rem",userSelect:"none",padding:"0.1em 0.2em"},children:t.name})}):null}function g8(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=[];for(let i=0;i<e.byteLength;i+=12)n.push([e.getFloat32(i,!0),e.getFloat32(i+4,!0),e.getFloat32(i+8,!0)]);return n}function $4e(t,e,n){if(t===void 0)return{makeObject:()=>null};switch(t.type){case"FrameMessage":return{makeObject:(i,r)=>k.jsx(fTe,{ref:i,showAxes:t.props.show_axes,axesLength:t.props.axes_length,axesRadius:t.props.axes_radius,originRadius:t.props.origin_radius,originColor:ql(t.props.origin_color),children:r})};case"BatchedAxesMessage":return{makeObject:(i,r)=>k.jsx(hTe,{ref:i,batched_wxyzs:t.props.batched_wxyzs,batched_positions:t.props.batched_positions,batched_scales:t.props.batched_scales,axes_length:t.props.axes_length,axes_radius:t.props.axes_radius,children:r}),computeClickInstanceIndexFromInstanceId:i=>Math.floor(i/3)};case"GridMessage":{const i=new Vn().setFromEuler(t.props.plane=="xz"?new mi(0,0,0):t.props.plane=="xy"?new mi(Math.PI/2,0,0):t.props.plane=="yx"?new mi(0,Math.PI/2,Math.PI/2):t.props.plane=="yz"?new mi(0,0,Math.PI/2):t.props.plane=="zx"?new mi(0,Math.PI/2,0):new mi(-Math.PI/2,0,-Math.PI/2)),r=new Vn().setFromEuler(new mi(-Math.PI/2,0,0)).premultiply(i);let a;if(t.props.shadow_opacity>0){const s=t.props.infinite_grid?1e4:t.props.width,o=t.props.infinite_grid?1e4:t.props.height;a=k.jsxs("mesh",{receiveShadow:!0,position:[0,0,-.01],quaternion:r,children:[k.jsx("planeGeometry",{args:[s,o]}),k.jsx("shadowMaterial",{opacity:t.props.shadow_opacity,color:0,depthWrite:!1})]})}else a=null;return{makeObject:(s,o)=>k.jsxs("group",{ref:s,children:[k.jsx(VZ,{args:[t.props.width,t.props.height],side:Kr,cellColor:ql(t.props.cell_color),cellThickness:t.props.cell_thickness,cellSize:t.props.cell_size,sectionColor:ql(t.props.section_color),sectionThickness:t.props.section_thickness,sectionSize:t.props.section_size,infiniteGrid:t.props.infinite_grid,fadeDistance:t.props.fade_distance,fadeStrength:t.props.fade_strength,fadeFrom:t.props.fade_from==="camera"?1:0,quaternion:i}),a,o]})}}case"PointCloudMessage":return{makeObject:(i,r)=>k.jsx(uTe,{ref:i,...t,children:r})};case"SkinnedMeshMessage":return{makeObject:(i,r)=>k.jsx(f4e,{ref:i,...t,children:r})};case"MeshMessage":return{makeObject:(i,r)=>k.jsx(l4e,{ref:i,...t,children:r})};case"BoxMessage":return{makeObject:(i,r)=>k.jsx(c4e,{ref:i,...t,children:r})};case"IcosphereMessage":return{makeObject:(i,r)=>k.jsx(u4e,{ref:i,...t,children:r})};case"BatchedMeshesMessage":return{makeObject:(i,r)=>k.jsx(W4e,{ref:i,...t,children:r}),computeClickInstanceIndexFromInstanceId:t.type==="BatchedMeshesMessage"?i=>i:void 0};case"CameraFrustumMessage":return{makeObject:(i,r)=>k.jsx(bTe,{ref:i,...t,children:r})};case"TransformControlsMessage":{const{send:i,flush:r}=tQ(e,50);let a=!1;return{makeObject:(s,o)=>k.jsx("group",{onClick:l=>l.stopPropagation(),children:k.jsx(QZ,{ref:s,scale:t.props.scale,lineWidth:t.props.line_width,fixed:t.props.fixed,activeAxes:t.props.active_axes,disableAxes:t.props.disable_axes,disableSliders:t.props.disable_sliders,disableRotations:t.props.disable_rotations,disableScaling:!0,translationLimits:t.props.translation_limits,rotationLimits:t.props.rotation_limits,depthTest:t.props.depth_test,opacity:t.props.opacity,onDragStart:()=>{a=!0,e.mutable.current.sendMessage({type:"TransformControlsDragStartMessage",name:t.name})},onDrag:l=>{const c=new Vn;c.setFromRotationMatrix(l);const u=new te().setFromMatrixPosition(l),f=[c.w,c.x,c.y,c.z],h=u.toArray();e.sceneTreeActions.updateNodeAttributes(t.name,{wxyz:f,position:h}),i({type:"TransformControlsUpdateMessage",name:t.name,wxyz:f,position:h})},onDragEnd:()=>{a&&(a=!1,r(),e.mutable.current.sendMessage({type:"TransformControlsDragEndMessage",name:t.name}))},children:o})}),unmountWhenInvisible:!0}}case"LabelMessage":return{makeObject:(i,r)=>k.jsx(mTe,{ref:i,...t,children:r}),unmountWhenInvisible:!1};case"Gui3DMessage":return{makeObject:(i,r)=>k.jsxs("group",{ref:i,children:[k.jsx(Jv,{children:k.jsx(n,{children:k.jsx(Ns,{style:{width:"18em",fontSize:"0.875em",marginLeft:"0.5em",marginTop:"0.5em"},shadow:"0 0 0.8em 0 rgba(0,0,0,0.1)",pb:"0.25em",onPointerDown:a=>{a.stopPropagation()},children:k.jsx(b4,{containerUuid:t.props.container_uuid})})})}),r]}),unmountWhenInvisible:!0};case"ImageMessage":return{makeObject:(i,r)=>k.jsx(dTe,{ref:i,...t,children:r})};case"GlbMessage":return{makeObject:(i,r)=>k.jsx(X4e,{ref:i,...t,children:r})};case"BatchedGlbMessage":return{makeObject:(i,r)=>k.jsx(K4e,{ref:i,...t,children:r}),computeClickInstanceIndexFromInstanceId:i=>i};case"LineSegmentsMessage":return{makeObject:(i,r)=>k.jsx(n4e,{ref:i,...t,children:r})};case"CatmullRomSplineMessage":return{makeObject:(i,r)=>k.jsxs("group",{ref:i,children:[k.jsx(rMe,{points:g8(t.props.points),closed:t.props.closed,curveType:t.props.curve_type,tension:t.props.tension,lineWidth:t.props.line_width,color:ql(t.props.color),segments:t.props.segments??void 0}),r]})};case"CubicBezierSplineMessage":return{makeObject:(i,r)=>{const a=g8(t.props.points),s=g8(t.props.control_points);return k.jsxs("group",{ref:i,children:[[...Array(a.length-1).keys()].map(o=>k.jsx(iMe,{start:a[o],end:a[o+1],midA:s[2*o],midB:s[2*o+1],lineWidth:t.props.line_width,color:ql(t.props.color),segments:t.props.segments??void 0},o)),r]})}};case"GaussianSplatsMessage":return{makeObject:(i,r)=>k.jsx(ATe,{ref:i,buffer:new Uint32Array(t.props.buffer.buffer.slice(t.props.buffer.byteOffset,t.props.buffer.byteOffset+t.props.buffer.byteLength)),children:r})};case"DirectionalLightMessage":return{makeObject:(i,r)=>k.jsxs("group",{ref:i,children:[k.jsx(XI,{lightIntensity:t.props.intensity,color:ql(t.props.color),castShadow:t.props.cast_shadow}),r]}),unmountWhenInvisible:!0};case"AmbientLightMessage":return{makeObject:(i,r)=>k.jsx("ambientLight",{ref:i,intensity:t.props.intensity,color:ql(t.props.color),children:r})};case"HemisphereLightMessage":return{makeObject:(i,r)=>k.jsx("hemisphereLight",{ref:i,intensity:t.props.intensity,color:ql(t.props.sky_color),groundColor:ql(t.props.ground_color),children:r})};case"PointLightMessage":return{makeObject:(i,r)=>k.jsx("pointLight",{ref:i,intensity:t.props.intensity,color:ql(t.props.color),distance:t.props.distance,decay:t.props.decay,castShadow:t.props.cast_shadow,...rG,children:r})};case"RectAreaLightMessage":return{makeObject:(i,r)=>k.jsx("rectAreaLight",{ref:i,intensity:t.props.intensity,color:ql(t.props.color),width:t.props.width,height:t.props.height,children:r})};case"SpotLightMessage":return{makeObject:(i,r)=>k.jsx("spotLight",{ref:i,intensity:t.props.intensity,color:ql(t.props.color),distance:t.props.distance,angle:t.props.angle,penumbra:t.props.penumbra,decay:t.props.decay,castShadow:t.props.cast_shadow,...rG,children:r})};default:return console.log("Received message did not match any known types:",t),{makeObject:()=>null}}}function Rte(t){const e=Ee.useContext(bi),n=e.useSceneTree(w=>w[t.name]?.message),i=eZ(),r=e.sceneTreeActions.updateNodeAttributes,{makeObject:a,unmountWhenInvisible:s,computeClickInstanceIndexFromInstanceId:o}=Ee.useMemo(()=>$4e(n,e,i),[n,e,i]),[l,c]=Ee.useState(!1),u=e.useSceneTree(w=>w[t.name]?.clickable)??!1,f=Ee.useRef(null),h=Ee.useRef(),d=Ee.useMemo(()=>k.jsx(Z4e,{name:t.name}),[]),g=e.mutable.current,b=Ee.useMemo(()=>a===void 0?null:a(w=>{f.current=w,g.nodeRefFromName[t.name]=f.current},d),[a,d]);function y(){return e.useSceneTree.getState()[t.name]?.effectiveVisibility??!1}Ee.useEffect(()=>{r(t.name,{poseUpdateState:"needsUpdate"})},[b]),ra(()=>{const w=e.useSceneTree.getState()[t.name];if(s){const M=y();M&&l&&(f.current!==null&&(f.current.visible=!1),r(t.name,{poseUpdateState:"needsUpdate"}),c(!1)),!M&&!l&&c(!0)}if(f.current!==null&&w!==void 0&&(f.current.visible=w.overrideVisibility??w.visibility??!0,w.poseUpdateState=="needsUpdate")){if(r(t.name,{poseUpdateState:"updated"}),n.type!=="LabelMessage"){const S=w.wxyz??[1,0,0,0];f.current.quaternion.set(S[1],S[2],S[3],S[0])}const M=w.position??[0,0,0];f.current.position.set(M[0],M[1],M[2]),f.current.matrixAutoUpdate||f.current.updateMatrix(),f.current.matrixWorldAutoUpdate||f.current.updateMatrixWorld()}},-1e3);const p=EC(50).send,x=Ee.useRef({isHovered:!1,instanceId:null});!u&&x.current.isHovered&&(x.current.isHovered=!1,g.hoveredElementsCount--,g.hoveredElementsCount===0&&(document.body.style.cursor="auto")),I.useEffect(()=>()=>{x.current.isHovered&&(g.hoveredElementsCount--,g.hoveredElementsCount===0&&(document.body.style.cursor="auto"))});const _=Ee.useRef({dragging:!1,startClientX:0,startClientY:0});return b===void 0||l?null:k.jsx(k.Fragment,{children:k.jsx("group",{ref:h,onPointerDown:u?w=>{if(!y())return;w.stopPropagation();const M=_.current,S=g.canvas.getBoundingClientRect();M.startClientX=w.clientX-S.left,M.startClientY=w.clientY-S.top,M.dragging=!1}:void 0,onPointerMove:u?w=>{if(!y())return;w.stopPropagation();const M=_.current,S=g.canvas.getBoundingClientRect(),A=w.clientX-S.left-M.startClientX,C=w.clientY-S.top-M.startClientY;Math.abs(A)<=3&&Math.abs(C)<=3||(M.dragging=!0)}:void 0,onPointerUp:u?w=>{if(!y()||(w.stopPropagation(),_.current.dragging))return;const S=eQ(e,w.ray),A=g.canvas.getBoundingClientRect(),C=Y4e(e,[w.clientX-A.left,w.clientY-A.top]);p({type:"SceneNodeClickMessage",name:t.name,instance_index:o===void 0?null:o(w.instanceId),ray_origin:[S.origin.x,S.origin.y,S.origin.z],ray_direction:[S.direction.x,S.direction.y,S.direction.z],screen_pos:[C.x,C.y]})}:void 0,onPointerOver:u?w=>{y()&&(w.stopPropagation(),x.current.isHovered=!0,x.current.instanceId=w.instanceId??null,g.hoveredElementsCount++,g.hoveredElementsCount===1&&(document.body.style.cursor="pointer"))}:void 0,onPointerOut:u?()=>{y()&&(x.current.isHovered=!1,x.current.instanceId=null,g.hoveredElementsCount--,g.hoveredElementsCount===0&&(document.body.style.cursor="auto"))}:void 0,children:k.jsx(Zv.Provider,{value:{state:x,clickable:u},children:b})})})}function Z4e(t){const n=Ee.useContext(bi).useSceneTree(i=>i[t.name]?.children,$_);return k.jsxs(k.Fragment,{children:[n&&n.map(i=>k.jsx(Rte,{name:i},i)),k.jsx(J4e,{name:t.name})]})}var GC={},kte={L:1,M:0,Q:3,H:2},Dte={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Q4e=Dte;function Ote(t){this.mode=Q4e.MODE_8BIT_BYTE,this.data=t}Ote.prototype={getLength:function(t){return this.data.length},write:function(t){for(var e=0;e<this.data.length;e++)t.put(this.data.charCodeAt(e),8)}};var e9e=Ote,LE=kte;function Hu(t,e){this.totalCount=t,this.dataCount=e}Hu.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Hu.getRSBlocks=function(t,e){var n=Hu.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var i=n.length/3,r=new Array,a=0;a<i;a++)for(var s=n[a*3+0],o=n[a*3+1],l=n[a*3+2],c=0;c<s;c++)r.push(new Hu(o,l));return r};Hu.getRsBlockTable=function(t,e){switch(e){case LE.L:return Hu.RS_BLOCK_TABLE[(t-1)*4+0];case LE.M:return Hu.RS_BLOCK_TABLE[(t-1)*4+1];case LE.Q:return Hu.RS_BLOCK_TABLE[(t-1)*4+2];case LE.H:return Hu.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};var t9e=Hu;function Ite(){this.buffer=new Array,this.length=0}Ite.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var n=0;n<e;n++)this.putBit((t>>>e-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var n9e=Ite,au={glog:function(t){if(t<1)throw new Error("glog("+t+")");return au.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return au.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ms=0;Ms<8;Ms++)au.EXP_TABLE[Ms]=1<<Ms;for(var Ms=8;Ms<256;Ms++)au.EXP_TABLE[Ms]=au.EXP_TABLE[Ms-4]^au.EXP_TABLE[Ms-5]^au.EXP_TABLE[Ms-6]^au.EXP_TABLE[Ms-8];for(var Ms=0;Ms<255;Ms++)au.LOG_TABLE[au.EXP_TABLE[Ms]]=Ms;var Nte=au,Bp=Nte;function wM(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var n=0;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(var i=0;i<t.length-n;i++)this.num[i]=t[i+n]}wM.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),n=0;n<this.getLength();n++)for(var i=0;i<t.getLength();i++)e[n+i]^=Bp.gexp(Bp.glog(this.get(n))+Bp.glog(t.get(i)));return new wM(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Bp.glog(this.get(0))-Bp.glog(t.get(0)),n=new Array(this.getLength()),i=0;i<this.getLength();i++)n[i]=this.get(i);for(var i=0;i<t.getLength();i++)n[i]^=Bp.gexp(Bp.glog(t.get(i))+e);return new wM(n,0).mod(t)}};var Lte=wM,Xl=Dte,AG=Lte,i9e=Nte,Qh={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ys={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;ys.getBCHDigit(e)-ys.getBCHDigit(ys.G15)>=0;)e^=ys.G15<<ys.getBCHDigit(e)-ys.getBCHDigit(ys.G15);return(t<<10|e)^ys.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;ys.getBCHDigit(e)-ys.getBCHDigit(ys.G18)>=0;)e^=ys.G18<<ys.getBCHDigit(e)-ys.getBCHDigit(ys.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return ys.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case Qh.PATTERN000:return(e+n)%2==0;case Qh.PATTERN001:return e%2==0;case Qh.PATTERN010:return n%3==0;case Qh.PATTERN011:return(e+n)%3==0;case Qh.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case Qh.PATTERN101:return e*n%2+e*n%3==0;case Qh.PATTERN110:return(e*n%2+e*n%3)%2==0;case Qh.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new AG([1],0),n=0;n<t;n++)e=e.multiply(new AG([1,i9e.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Xl.MODE_NUMBER:return 10;case Xl.MODE_ALPHA_NUM:return 9;case Xl.MODE_8BIT_BYTE:return 8;case Xl.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Xl.MODE_NUMBER:return 12;case Xl.MODE_ALPHA_NUM:return 11;case Xl.MODE_8BIT_BYTE:return 16;case Xl.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Xl.MODE_NUMBER:return 14;case Xl.MODE_ALPHA_NUM:return 13;case Xl.MODE_8BIT_BYTE:return 16;case Xl.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,i=0;i<e;i++)for(var r=0;r<e;r++){for(var a=0,s=t.isDark(i,r),o=-1;o<=1;o++)if(!(i+o<0||e<=i+o))for(var l=-1;l<=1;l++)r+l<0||e<=r+l||o==0&&l==0||s==t.isDark(i+o,r+l)&&a++;a>5&&(n+=3+a-5)}for(var i=0;i<e-1;i++)for(var r=0;r<e-1;r++){var c=0;t.isDark(i,r)&&c++,t.isDark(i+1,r)&&c++,t.isDark(i,r+1)&&c++,t.isDark(i+1,r+1)&&c++,(c==0||c==4)&&(n+=3)}for(var i=0;i<e;i++)for(var r=0;r<e-6;r++)t.isDark(i,r)&&!t.isDark(i,r+1)&&t.isDark(i,r+2)&&t.isDark(i,r+3)&&t.isDark(i,r+4)&&!t.isDark(i,r+5)&&t.isDark(i,r+6)&&(n+=40);for(var r=0;r<e;r++)for(var i=0;i<e-6;i++)t.isDark(i,r)&&!t.isDark(i+1,r)&&t.isDark(i+2,r)&&t.isDark(i+3,r)&&t.isDark(i+4,r)&&!t.isDark(i+5,r)&&t.isDark(i+6,r)&&(n+=40);for(var u=0,r=0;r<e;r++)for(var i=0;i<e;i++)t.isDark(i,r)&&u++;var f=Math.abs(100*u/e/e-50)/5;return n+=f*10,n}},r9e=ys,a9e=e9e,Pte=t9e,Ute=n9e,Qd=r9e,s9e=Lte;function Wu(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var Nl=Wu.prototype;Nl.addData=function(t){var e=new a9e(t);this.dataList.push(e),this.dataCache=null};Nl.isDark=function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]};Nl.getModuleCount=function(){return this.moduleCount};Nl.make=function(){if(this.typeNumber<1){var t=1;for(t=1;t<40;t++){for(var e=Pte.getRSBlocks(t,this.errorCorrectLevel),n=new Ute,i=0,r=0;r<e.length;r++)i+=e[r].dataCount;for(var r=0;r<this.dataList.length;r++){var a=this.dataList[r];n.put(a.mode,4),n.put(a.getLength(),Qd.getLengthInBits(a.mode,t)),a.write(n)}if(n.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())};Nl.makeImpl=function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Wu.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)};Nl.setupPositionProbePattern=function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)};Nl.getBestMaskPattern=function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=Qd.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e};Nl.createMovieClip=function(t,e,n){var i=t.createEmptyMovieClip(e,n),r=1;this.make();for(var a=0;a<this.modules.length;a++)for(var s=a*r,o=0;o<this.modules[a].length;o++){var l=o*r,c=this.modules[a][o];c&&(i.beginFill(0,100),i.moveTo(l,s),i.lineTo(l+r,s),i.lineTo(l+r,s+r),i.lineTo(l,s+r),i.endFill())}return i};Nl.setupTimingPattern=function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)};Nl.setupPositionAdjustPattern=function(){for(var t=Qd.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var i=t[e],r=t[n];if(this.modules[i][r]==null)for(var a=-2;a<=2;a++)for(var s=-2;s<=2;s++)a==-2||a==2||s==-2||s==2||a==0&&s==0?this.modules[i+a][r+s]=!0:this.modules[i+a][r+s]=!1}};Nl.setupTypeNumber=function(t){for(var e=Qd.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(var n=0;n<18;n++){var i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}};Nl.setupTypeInfo=function(t,e){for(var n=this.errorCorrectLevel<<3|e,i=Qd.getBCHTypeInfo(n),r=0;r<15;r++){var a=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(var r=0;r<15;r++){var a=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t};Nl.mapData=function(t,e){for(var n=-1,i=this.moduleCount-1,r=7,a=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var o=0;o<2;o++)if(this.modules[i][s-o]==null){var l=!1;a<t.length&&(l=(t[a]>>>r&1)==1);var c=Qd.getMask(e,i,s-o);c&&(l=!l),this.modules[i][s-o]=l,r--,r==-1&&(a++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}};Wu.PAD0=236;Wu.PAD1=17;Wu.createData=function(t,e,n){for(var i=Pte.getRSBlocks(t,e),r=new Ute,a=0;a<n.length;a++){var s=n[a];r.put(s.mode,4),r.put(s.getLength(),Qd.getLengthInBits(s.mode,t)),s.write(r)}for(var o=0,a=0;a<i.length;a++)o+=i[a].dataCount;if(r.getLengthInBits()>o*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+o*8+")");for(r.getLengthInBits()+4<=o*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=o*8||(r.put(Wu.PAD0,8),r.getLengthInBits()>=o*8));)r.put(Wu.PAD1,8);return Wu.createBytes(r,i)};Wu.createBytes=function(t,e){for(var n=0,i=0,r=0,a=new Array(e.length),s=new Array(e.length),o=0;o<e.length;o++){var l=e[o].dataCount,c=e[o].totalCount-l;i=Math.max(i,l),r=Math.max(r,c),a[o]=new Array(l);for(var u=0;u<a[o].length;u++)a[o][u]=255&t.buffer[u+n];n+=l;var f=Qd.getErrorCorrectPolynomial(c),h=new s9e(a[o],f.getLength()-1),d=h.mod(f);s[o]=new Array(f.getLength()-1);for(var u=0;u<s[o].length;u++){var g=u+d.getLength()-s[o].length;s[o][u]=g>=0?d.get(g):0}}for(var b=0,u=0;u<e.length;u++)b+=e[u].totalCount;for(var y=new Array(b),p=0,u=0;u<i;u++)for(var o=0;o<e.length;o++)u<a[o].length&&(y[p++]=a[o][u]);for(var u=0;u<r;u++)for(var o=0;o<e.length;o++)u<s[o].length&&(y[p++]=s[o][u]);return y};var o9e=Wu,x4={};Object.defineProperty(x4,"__esModule",{value:!0});var l9e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c9e=hX,Kl=Bte(c9e),Fte=I,PE=Bte(Fte);function Bte(t){return t&&t.__esModule?t:{default:t}}function u9e(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}var f9e={bgColor:Kl.default.oneOfType([Kl.default.object,Kl.default.string]).isRequired,bgD:Kl.default.string.isRequired,fgColor:Kl.default.oneOfType([Kl.default.object,Kl.default.string]).isRequired,fgD:Kl.default.string.isRequired,size:Kl.default.number.isRequired,title:Kl.default.string,viewBoxSize:Kl.default.number.isRequired,xmlns:Kl.default.string},_4=(0,Fte.forwardRef)(function(t,e){var n=t.bgColor,i=t.bgD,r=t.fgD,a=t.fgColor,s=t.size,o=t.title,l=t.viewBoxSize,c=t.xmlns,u=c===void 0?"http://www.w3.org/2000/svg":c,f=u9e(t,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return PE.default.createElement("svg",l9e({},f,{height:s,ref:e,viewBox:"0 0 "+l+" "+l,width:s,xmlns:u}),o?PE.default.createElement("title",null,o):null,PE.default.createElement("path",{d:i,fill:n}),PE.default.createElement("path",{d:r,fill:a}))});_4.displayName="QRCodeSvg";_4.propTypes=f9e;x4.default=_4;Object.defineProperty(GC,"__esModule",{value:!0});GC.QRCode=void 0;var h9e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},d9e=hX,Ff=aS(d9e),p9e=kte,m9e=aS(p9e),g9e=o9e,b9e=aS(g9e),zte=I,v9e=aS(zte),y9e=x4,x9e=aS(y9e);function aS(t){return t&&t.__esModule?t:{default:t}}function _9e(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}var S9e={bgColor:Ff.default.oneOfType([Ff.default.object,Ff.default.string]),fgColor:Ff.default.oneOfType([Ff.default.object,Ff.default.string]),level:Ff.default.string,size:Ff.default.number,value:Ff.default.string.isRequired},WC=(0,zte.forwardRef)(function(t,e){var n=t.bgColor,i=n===void 0?"#FFFFFF":n,r=t.fgColor,a=r===void 0?"#000000":r,s=t.level,o=s===void 0?"L":s,l=t.size,c=l===void 0?256:l,u=t.value,f=_9e(t,["bgColor","fgColor","level","size","value"]),h=new b9e.default(-1,m9e.default[o]);h.addData(u),h.make();var d=h.modules;return v9e.default.createElement(x9e.default,h9e({},f,{bgColor:i,bgD:d.map(function(g,b){return g.map(function(y,p){return y?"":"M "+p+" "+b+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:a,fgD:d.map(function(g,b){return g.map(function(y,p){return y?"M "+p+" "+b+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:e,size:c,viewBoxSize:d.length}))});GC.QRCode=WC;WC.displayName="QRCode";WC.propTypes=S9e;var w9e=GC.default=WC,E9e="z8daqr0",M9e="z8daqr1",CG="z8daqr2",T9e="z8daqr3",A9e="z8daqr4";function C9e(t){if(!/^[0-9a-zA-Z-]+$/.test(t))throw new Error(`[@mantine/use-form] Form name "${t}" is invalid, it should contain only letters, numbers and dashes`)}const R9e=typeof window<"u"?I.useLayoutEffect:I.useEffect;function gs(t,e){R9e(()=>{if(t)return window.addEventListener(t,e),()=>window.removeEventListener(t,e)},[t])}function k9e(t,e){t&&C9e(t),gs(`mantine-form:${t}:set-field-value`,n=>e.setFieldValue(n.detail.path,n.detail.value)),gs(`mantine-form:${t}:set-values`,n=>e.setValues(n.detail)),gs(`mantine-form:${t}:set-initial-values`,n=>e.setInitialValues(n.detail)),gs(`mantine-form:${t}:set-errors`,n=>e.setErrors(n.detail)),gs(`mantine-form:${t}:set-field-error`,n=>e.setFieldError(n.detail.path,n.detail.error)),gs(`mantine-form:${t}:clear-field-error`,n=>e.clearFieldError(n.detail)),gs(`mantine-form:${t}:clear-errors`,e.clearErrors),gs(`mantine-form:${t}:reset`,e.reset),gs(`mantine-form:${t}:validate`,e.validate),gs(`mantine-form:${t}:validate-field`,n=>e.validateField(n.detail)),gs(`mantine-form:${t}:reorder-list-item`,n=>e.reorderListItem(n.detail.path,n.detail.payload)),gs(`mantine-form:${t}:remove-list-item`,n=>e.removeListItem(n.detail.path,n.detail.index)),gs(`mantine-form:${t}:insert-list-item`,n=>e.insertListItem(n.detail.path,n.detail.item,n.detail.index)),gs(`mantine-form:${t}:set-dirty`,n=>e.setDirty(n.detail)),gs(`mantine-form:${t}:set-touched`,n=>e.setTouched(n.detail)),gs(`mantine-form:${t}:reset-dirty`,n=>e.resetDirty(n.detail)),gs(`mantine-form:${t}:reset-touched`,e.resetTouched)}function D9e(t){return e=>{if(!e)t(e);else if(typeof e=="function")t(e);else if(typeof e=="object"&&"nativeEvent"in e){const{currentTarget:n}=e;n instanceof HTMLInputElement?n.type==="checkbox"?t(n.checked):t(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&t(n.value)}else t(e)}}function KI(t){return t===null||typeof t!="object"?{}:Object.keys(t).reduce((e,n)=>{const i=t[n];return i!=null&&i!==!1&&(e[n]=i),e},{})}function O9e(t){const[e,n]=I.useState(KI(t)),i=I.useRef(e),r=I.useCallback(l=>{n(c=>{const u=KI(typeof l=="function"?l(c):l);return i.current=u,u})},[]),a=I.useCallback(()=>r({}),[]),s=I.useCallback(l=>{i.current[l]!==void 0&&r(c=>{const u={...c};return delete u[l],u})},[e]),o=I.useCallback((l,c)=>{c==null||c===!1?s(l):i.current[l]!==c&&r(u=>({...u,[l]:c}))},[e]);return{errorsState:e,setErrors:r,clearErrors:a,setFieldError:o,clearFieldError:s}}function YI(t,e){if(e===null||typeof e!="object")return{};const n={...e};return Object.keys(e).forEach(i=>{i.includes(`${String(t)}.`)&&delete n[i]}),n}function RG(t,e){const n=t.substring(e.length+1).split(".")[0];return parseInt(n,10)}function kG(t,e,n,i){if(e===void 0)return n;const r=`${String(t)}`;let a=n;i===-1&&(a=YI(`${r}.${e}`,a));const s={...a},o=new Set;return Object.entries(a).filter(([l])=>{if(!l.startsWith(`${r}.`))return!1;const c=RG(l,r);return Number.isNaN(c)?!1:c>=e}).forEach(([l,c])=>{const u=RG(l,r),f=l.replace(`${r}.${u}`,`${r}.${u+i}`);s[f]=c,o.add(f),o.has(l)||delete s[l]}),s}function I9e(t,{from:e,to:n},i){const r=`${t}.${e}`,a=`${t}.${n}`,s={...i},o=new Set;return Object.keys(i).forEach(l=>{if(o.has(l))return;let c,u;if(l.startsWith(r)?(c=l,u=l.replace(r,a)):l.startsWith(a)&&(c=l.replace(a,r),u=l),c&&u){const f=s[c],h=s[u];h===void 0?delete s[c]:s[c]=h,f===void 0?delete s[u]:s[u]=f,o.add(c),o.add(u)}}),s}function DG(t,e,n){typeof n.value=="object"&&(n.value=r0(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function r0(t){if(typeof t!="object")return t;var e=0,n,i,r,a=Object.prototype.toString.call(t);if(a==="[object Object]"?r=Object.create(t.__proto__||null):a==="[object Array]"?r=Array(t.length):a==="[object Set]"?(r=new Set,t.forEach(function(s){r.add(r0(s))})):a==="[object Map]"?(r=new Map,t.forEach(function(s,o){r.set(r0(o),r0(s))})):a==="[object Date]"?r=new Date(+t):a==="[object RegExp]"?r=new RegExp(t.source,t.flags):a==="[object DataView]"?r=new t.constructor(r0(t.buffer)):a==="[object ArrayBuffer]"?r=t.slice(0):a.slice(-6)==="Array]"&&(r=new t.constructor(t)),r){for(i=Object.getOwnPropertySymbols(t);e<i.length;e++)DG(r,i[e],Object.getOwnPropertyDescriptor(t,i[e]));for(e=0,i=Object.getOwnPropertyNames(t);e<i.length;e++)Object.hasOwnProperty.call(r,n=i[e])&&r[n]===t[n]||DG(r,n,Object.getOwnPropertyDescriptor(t,n))}return r||t}function jte(t){return typeof t!="string"?[]:t.split(".")}function Aa(t,e){const n=jte(t);if(n.length===0||typeof e!="object"||e===null)return;let i=e[n[0]];for(let r=1;r<n.length&&i!=null;r+=1)i=i[n[r]];return i}function sS(t,e,n){const i=jte(t);if(i.length===0)return n;const r=r0(n);if(i.length===1)return r[i[0]]=e,r;let a=r[i[0]];for(let s=1;s<i.length-1;s+=1){if(a===void 0)return r;a=a[i[s]]}return a[i[i.length-1]]=e,r}function N9e(t,{from:e,to:n},i){const r=Aa(t,i);if(!Array.isArray(r))return i;const a=[...r],s=r[e];return a.splice(e,1),a.splice(n,0,s),sS(t,a,i)}function L9e(t,e,n,i){const r=Aa(t,i);if(!Array.isArray(r))return i;const a=[...r];return a.splice(typeof n=="number"?n:a.length,0,e),sS(t,a,i)}function P9e(t,e,n){const i=Aa(t,n);return Array.isArray(i)?sS(t,i.filter((r,a)=>a!==e),n):n}function U9e(t,e,n,i){const r=Aa(t,i);if(!Array.isArray(r)||r.length<=n)return i;const a=[...r];return a[n]=e,sS(t,a,i)}function F9e({$values:t,$errors:e,$status:n}){const i=I.useCallback((o,l)=>{n.clearFieldDirty(o),e.setErrors(c=>I9e(o,l,c)),t.setValues({values:N9e(o,l,t.refValues.current),updateState:!0})},[]),r=I.useCallback((o,l)=>{n.clearFieldDirty(o),e.setErrors(c=>kG(o,l,c,-1)),t.setValues({values:P9e(o,l,t.refValues.current),updateState:!0})},[]),a=I.useCallback((o,l,c)=>{n.clearFieldDirty(o),e.setErrors(u=>kG(o,c,u,1)),t.setValues({values:L9e(o,l,c,t.refValues.current),updateState:!0})},[]),s=I.useCallback((o,l,c)=>{n.clearFieldDirty(o),t.setValues({values:U9e(o,c,l,t.refValues.current),updateState:!0})},[]);return{reorderListItem:i,removeListItem:r,insertListItem:a,replaceListItem:s}}var B9e=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r,a;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),i=a.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;for(r=i;r--!==0;){var s=a[r];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const UE=Mc(B9e);function fx(t,e){const n=Object.keys(t);if(typeof e=="string"){const i=n.filter(r=>r.startsWith(`${e}.`));return t[e]||i.some(r=>t[r])||!1}return n.some(i=>t[i])}function z9e({initialDirty:t,initialTouched:e,mode:n,$values:i}){const[r,a]=I.useState(e),[s,o]=I.useState(t),l=I.useRef(e),c=I.useRef(t),u=I.useCallback(S=>{const A=typeof S=="function"?S(l.current):S;l.current=A,n==="controlled"&&a(A)},[]),f=I.useCallback((S,A=!1)=>{const C=typeof S=="function"?S(c.current):S;c.current=C,(n==="controlled"||A)&&o(C)},[]),h=I.useCallback(()=>u({}),[]),d=I.useCallback(S=>{const A=S?{...i.refValues.current,...S}:i.refValues.current;i.setValuesSnapshot(A),f({})},[]),g=I.useCallback((S,A)=>{u(C=>fx(C,S)===A?C:{...C,[S]:A})},[]),b=I.useCallback((S,A,C)=>{f(D=>fx(D,S)===A?D:{...D,[S]:A},C)},[]),y=I.useCallback((S,A)=>{const C=fx(c.current,S),D=!UE(Aa(S,i.getValuesSnapshot()),A),R=YI(S,c.current);R[S]=D,f(R,C!==D)},[]),p=I.useCallback(S=>fx(l.current,S),[]),x=I.useCallback(S=>f(A=>{if(typeof S!="string")return A;const C=YI(S,A);return delete C[S],UE(C,A)?A:C}),[]),_=I.useCallback(S=>{if(S){const C=Aa(S,c.current);if(typeof C=="boolean")return C;const D=Aa(S,i.refValues.current),R=Aa(S,i.valuesSnapshot.current);return!UE(D,R)}return Object.keys(c.current).length>0?fx(c.current):!UE(i.refValues.current,i.valuesSnapshot.current)},[]),w=I.useCallback(()=>c.current,[]),M=I.useCallback(()=>l.current,[]);return{touchedState:r,dirtyState:s,touchedRef:l,dirtyRef:c,setTouched:u,setDirty:f,resetDirty:d,resetTouched:h,isTouched:p,setFieldTouched:g,setFieldDirty:b,setTouchedState:a,setDirtyState:o,clearFieldDirty:x,isDirty:_,getDirty:w,getTouched:M,setCalculatedFieldDirty:y}}function j9e({initialValues:t,onValuesChange:e,mode:n}){const i=I.useRef(!1),[r,a]=I.useState(t||{}),s=I.useRef(r),o=I.useRef(r),l=I.useCallback(({values:y,subscribers:p,updateState:x=!0,mergeWithPreviousValues:_=!0})=>{const w=s.current,M=y instanceof Function?y(s.current):y,S=_?{...w,...M}:M;s.current=S,x&&(a(S),n==="uncontrolled"&&(s.current=S)),e?.(S,w),p?.filter(Boolean).forEach(A=>A({updatedValues:S,previousValues:w}))},[e]),c=I.useCallback(y=>{const p=Aa(y.path,s.current),x=y.value instanceof Function?y.value(p):y.value;if(p!==x){const _=s.current,w=sS(y.path,x,s.current);l({values:w,updateState:y.updateState}),y.subscribers?.filter(Boolean).forEach(M=>M({path:y.path,updatedValues:w,previousValues:_}))}},[l]),u=I.useCallback(y=>{o.current=y},[]),f=I.useCallback((y,p)=>{i.current||(i.current=!0,l({values:y,updateState:n==="controlled"}),u(y),p())},[l]),h=I.useCallback(()=>{l({values:o.current,updateState:!0,mergeWithPreviousValues:!1})},[l]),d=I.useCallback(()=>s.current,[]),g=I.useCallback(()=>o.current,[]),b=I.useCallback((y,p)=>{const x=Aa(y,o.current);typeof x>"u"||c({path:y,value:x,updateState:n==="controlled",subscribers:p})},[c,n]);return{initialized:i,stateValues:r,refValues:s,valuesSnapshot:o,setValues:l,setFieldValue:c,resetValues:h,setValuesSnapshot:u,initialize:f,getValues:d,getValuesSnapshot:g,resetField:b}}function H9e({$status:t,cascadeUpdates:e}){const n=I.useRef({}),i=I.useCallback((a,s)=>{I.useEffect(()=>(n.current[a]=n.current[a]||[],n.current[a].push(s),()=>{n.current[a]=n.current[a].filter(o=>o!==s)}),[s])},[]),r=I.useCallback(a=>{const s=n.current[a]?.map(o=>l=>o({previousValue:Aa(a,l.previousValues),value:Aa(a,l.updatedValues),touched:t.isTouched(a),dirty:t.isDirty(a)}))??[];if(e)for(const o in n.current)(o.startsWith(`${a}.`)||a.startsWith(`${o}.`))&&s.push(...n.current[o].map(l=>c=>l({previousValue:Aa(o,c.previousValues),value:Aa(o,c.updatedValues),touched:t.isTouched(o),dirty:t.isDirty(o)})));return s},[]);return{subscribers:n,watch:i,getFieldSubscribers:r}}function OG(t,e){return t?`${t}-${e.toString()}`:e.toString()}const FE=Symbol("root-rule");function IG(t){const e=KI(t);return{hasErrors:Object.keys(e).length>0,errors:e}}function JI(t,e,n="",i={}){return typeof t!="object"||t===null?i:Object.keys(t).reduce((r,a)=>{const s=t[a],o=`${n===""?"":`${n}.`}${a}`,l=Aa(o,e);let c=!1;return typeof s=="function"&&(r[o]=s(l,e,o)),typeof s=="object"&&Array.isArray(l)&&(c=!0,l.forEach((u,f)=>JI(s,e,`${o}.${f}`,r)),FE in s&&(r[o]=s[FE](l,e,o))),typeof s=="object"&&typeof l=="object"&&l!==null&&(c||JI(s,e,o,r),FE in s&&(r[o]=s[FE](l,e,o))),r},i)}function $I(t,e){return IG(typeof t=="function"?t(e):JI(t,e))}function BE(t,e,n){if(typeof t!="string")return{hasError:!1,error:null};const i=$I(e,n),r=Object.keys(i.errors).find(a=>t.split(".").every((s,o)=>s===a.split(".")[o]));return{hasError:!!r,error:r?i.errors[r]:null}}const V9e="__MANTINE_FORM_INDEX__";function NG(t,e){return e?typeof e=="boolean"?e:Array.isArray(e)?e.includes(t.replace(/[.][0-9]+/g,`.${V9e}`)):!1:!1}function G9e({name:t,mode:e="controlled",initialValues:n,initialErrors:i={},initialDirty:r={},initialTouched:a={},clearInputErrorOnChange:s=!0,validateInputOnChange:o=!1,validateInputOnBlur:l=!1,onValuesChange:c,transformValues:u=y=>y,enhanceGetInputProps:f,validate:h,onSubmitPreventDefault:d="always",touchTrigger:g="change",cascadeUpdates:b=!1}={}){const y=O9e(i),p=j9e({initialValues:n,onValuesChange:c,mode:e}),x=z9e({initialDirty:r,initialTouched:a,$values:p,mode:e}),_=F9e({$values:p,$errors:y,$status:x}),w=H9e({$status:x,cascadeUpdates:b}),[M,S]=I.useState(0),[A,C]=I.useState({}),[D,R]=I.useState(!1),N=I.useCallback(()=>{p.resetValues(),y.clearErrors(),x.resetDirty(),x.resetTouched(),e==="uncontrolled"&&S(ue=>ue+1)},[]),U=I.useCallback(ue=>{s&&y.clearErrors(),e==="uncontrolled"&&S(_e=>_e+1),Object.keys(w.subscribers.current).forEach(_e=>{const ke=Aa(_e,p.refValues.current),Ne=Aa(_e,ue);ke!==Ne&&w.getFieldSubscribers(_e).forEach(Ue=>Ue({previousValues:ue,updatedValues:p.refValues.current}))})},[s]),j=I.useCallback(ue=>{const _e=p.refValues.current;p.initialize(ue,()=>e==="uncontrolled"&&S(ke=>ke+1)),U(_e)},[U]),z=I.useCallback((ue,_e,ke)=>{const Ne=NG(ue,o),Ue=_e instanceof Function?_e(Aa(ue,p.refValues.current)):_e;x.setCalculatedFieldDirty(ue,Ue),g==="change"&&x.setFieldTouched(ue,!0),!Ne&&s&&y.clearFieldError(ue),p.setFieldValue({path:ue,value:_e,updateState:e==="controlled",subscribers:[...w.getFieldSubscribers(ue),Ne?ze=>{const pe=BE(ue,h,ze.updatedValues);pe.hasError?y.setFieldError(ue,pe.error):y.clearFieldError(ue)}:null,ke?.forceUpdate!==!1&&e!=="controlled"?()=>C(ze=>({...ze,[ue]:(ze[ue]||0)+1})):null]})},[c,h]),q=I.useCallback(ue=>{const _e=p.refValues.current;p.setValues({values:ue,updateState:e==="controlled"}),U(_e)},[c,U]),B=I.useCallback(()=>{const ue=$I(h,p.refValues.current);return y.setErrors(ue.errors),ue},[h]),G=I.useCallback(ue=>{const _e=BE(ue,h,p.refValues.current);return _e.hasError?y.setFieldError(ue,_e.error):y.clearFieldError(ue),_e},[h]),H=(ue,{type:_e="input",withError:ke=!0,withFocus:Ne=!0,...Ue}={})=>{const pe={onChange:D9e(Fe=>z(ue,Fe,{forceUpdate:!1})),"data-path":OG(t,ue)};return ke&&(pe.error=y.errorsState[ue]),_e==="checkbox"?pe[e==="controlled"?"checked":"defaultChecked"]=Aa(ue,p.refValues.current):pe[e==="controlled"?"value":"defaultValue"]=Aa(ue,p.refValues.current),Ne&&(pe.onFocus=()=>x.setFieldTouched(ue,!0),pe.onBlur=()=>{if(NG(ue,l)){const Fe=BE(ue,h,p.refValues.current);Fe.hasError?y.setFieldError(ue,Fe.error):y.clearFieldError(ue)}}),Object.assign(pe,f?.({inputProps:pe,field:ue,options:{type:_e,withError:ke,withFocus:Ne,...Ue},form:oe}))},W=(ue,_e)=>ke=>{d==="always"&&ke?.preventDefault();const Ne=B();if(Ne.hasErrors)d==="validation-failed"&&ke?.preventDefault(),_e?.(Ne.errors,p.refValues.current,ke);else{const Ue=ue?.(u(p.refValues.current),ke);Ue instanceof Promise&&(R(!0),Ue.finally(()=>R(!1)))}},F=ue=>u(ue||p.refValues.current),Y=I.useCallback(ue=>{ue.preventDefault(),N()},[]),Z=I.useCallback(ue=>ue?!BE(ue,h,p.refValues.current).hasError:!$I(h,p.refValues.current).hasErrors,[h]),V=ue=>`${M}-${String(ue)}-${A[String(ue)]||0}`,de=I.useCallback(ue=>document.querySelector(`[data-path="${OG(t,ue)}"]`),[]),se=I.useCallback(ue=>{p.resetField(ue,[e!=="controlled"?()=>C(_e=>({..._e,[ue]:(_e[ue]||0)+1})):null])},[p.resetField,e,C]),oe={watch:w.watch,initialized:p.initialized.current,values:e==="uncontrolled"?p.refValues.current:p.stateValues,getValues:p.getValues,getInitialValues:p.getValuesSnapshot,setInitialValues:p.setValuesSnapshot,resetField:se,initialize:j,setValues:q,setFieldValue:z,submitting:D,setSubmitting:R,errors:y.errorsState,setErrors:y.setErrors,setFieldError:y.setFieldError,clearFieldError:y.clearFieldError,clearErrors:y.clearErrors,resetDirty:x.resetDirty,setTouched:x.setTouched,setDirty:x.setDirty,isTouched:x.isTouched,resetTouched:x.resetTouched,isDirty:x.isDirty,getTouched:x.getTouched,getDirty:x.getDirty,reorderListItem:_.reorderListItem,insertListItem:_.insertListItem,removeListItem:_.removeListItem,replaceListItem:_.replaceListItem,reset:N,validate:B,validateField:G,getInputProps:H,onSubmit:W,onReset:Y,isValid:Z,getTransformedValues:F,key:V,getInputNode:de};return k9e(t,oe),oe}function W9e({nodeName:t,closePopoverFn:e}){const n=Ee.useContext(bi),i=n.useSceneTree(f=>f[t]?.message),r=n.sceneTreeActions.updateSceneNodeProps;if(i===void 0)return null;function a(f){return f==Number.POSITIVE_INFINITY?"Infinity":JSON.stringify(f)}function s(f){return f==="Infinity"?Number.POSITIVE_INFINITY:JSON.parse(f)}const o=i.props,l=Object.fromEntries(Object.entries(o).filter(([,f])=>!(f instanceof Uint8Array)).map(([f,h])=>[f,a(h)])),c=G9e({initialValues:{...l},validate:{...Object.fromEntries(Object.keys(l).map(f=>[f,h=>{try{return s(h),null}catch{return"Invalid JSON"}}]))}}),u=f=>{Object.entries(f).forEach(([h,d])=>{if(d!==l[h])try{const g=s(d);r(t,{[h]:g}),c.setFieldValue(h,a(g))}catch(g){console.error("Failed to parse JSON:",g)}})};return k.jsxs(ut,{className:M9e,component:"form",onSubmit:c.onSubmit(u),w:"15em",children:[k.jsxs(ut,{children:[k.jsxs(ut,{style:{display:"flex",alignItems:"center"},children:[k.jsxs(ut,{style:{fontWeight:"500",flexGrow:"1"},fz:"sm",children:[i.type.replace("Message","").replace(/([a-z])(\d[A-Z])/g,"$1 $2").replace(/([a-z])([A-Z])/g,"$1 $2").trim()," ","Props"]}),k.jsx(Or,{label:"Close props",children:k.jsx(GAe,{style:{cursor:"pointer",width:"1em",height:"1em",display:"block",opacity:"0.7"},onClick:f=>{f.stopPropagation(),e()}})})]}),k.jsx(ut,{style:{opacity:"0.5"},fz:"xs",children:t})]}),k.jsx(Ac.Autosize,{mah:"30vh",scrollbarSize:6,offsetScrollbars:"present",type:"auto",children:k.jsx(ut,{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:Object.entries(o).map(([f,h])=>{if(h instanceof Uint8Array||f.startsWith("_"))return null;const d=c.values[f]!==l[f];return k.jsxs(ph,{align:"center",children:[k.jsx(ut,{style:{flexGrow:"1"},fz:"xs",children:f.charAt(0).toUpperCase()+f.slice(1).split("_").join(" ")}),k.jsx(ph,{gap:"xs",style:{width:"9em"},children:(()=>{try{const g=s(c.values[f]);if(f.toLowerCase().includes("color")&&Array.isArray(g)&&g.length===3&&g.every(y=>typeof y=="number")){const y=(x,_,w)=>{const M=S=>{const A=Math.round(S).toString(16);return A.length===1?"0"+A:A};return"#"+M(x)+M(_)+M(w)},p=x=>{const _=parseInt(x.slice(1,3),16),w=parseInt(x.slice(3,5),16),M=parseInt(x.slice(5,7),16);return[_,w,M]};return k.jsx(Nv,{size:"xs",styles:{input:{height:"1.625rem",minHeight:"1.625rem"}},style:{width:"100%"},value:y(g[0],g[1],g[2]),onChange:x=>{const _=p(x);c.setFieldValue(f,a(_)),c.onSubmit(u)()},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),c.onSubmit(u)())}})}}catch{}return k.jsx(og,{size:"xs",styles:{input:{height:"1.625rem",minHeight:"1.625rem",width:"100%"}},style:{width:"100%"},...c.getInputProps(f),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),c.onSubmit(u)())},rightSection:k.jsx(dAe,{style:{width:"1rem",height:"1rem",opacity:d?1:.3,cursor:d?"pointer":"default"},onClick:()=>{d&&c.onSubmit(u)()}})})})()})]},f)})})}),k.jsx(ut,{style:{opacity:"0.4",marginTop:"0.25rem"},fz:"xs",children:"Updates from the server will overwrite local changes."})]})}function q9e(){const e=Ee.useContext(bi).useSceneTree(n=>n[""].children,$_);return k.jsx(Ac,{className:E9e,children:k.jsx(K9e,{children:k.jsx(X9e,{children:e.map(n=>k.jsx(Y9e,{nodeName:n,indentCount:0},n))})})})}const Hte=Ee.createContext(null),Vte=Ee.createContext(null);function X9e({children:t}){const e=Ee.useRef(!1),n=Ee.useRef(!1),i=a=>{e.current=!0,n.current=a},r=()=>{e.current=!1};return Ee.useEffect(()=>(window.addEventListener("mouseup",r),()=>{window.removeEventListener("mouseup",r)}),[r]),k.jsx(Hte.Provider,{value:{paintingRef:e,paintValueRef:n,startPainting:i,stopPainting:r},children:t})}function K9e({children:t}){const[e,n]=Ee.useState(null);return k.jsx(Vte.Provider,{value:{openPopoverNodeName:e,setOpenPopoverNodeName:n},children:t})}const Y9e=Ee.memo(function t(e){const n=Ee.useContext(bi),i=va(),{colorScheme:r}=ig(),{paintingRef:a,paintValueRef:s,startPainting:o}=Ee.useContext(Hte),{openPopoverNodeName:l,setOpenPopoverNodeName:c}=Ee.useContext(Vte),u=C=>{C.stopPropagation();const D=!_;o(D),n.sceneTreeActions.updateNodeAttributes(e.nodeName,{overrideVisibility:D})},f=()=>{a.current&&n.sceneTreeActions.updateNodeAttributes(e.nodeName,{overrideVisibility:s.current})},h=n.useSceneTree(C=>C[e.nodeName]?.children,$_),d=(h?.length??0)>0,[g,{toggle:b}]=_c(!1),y=C=>{n.sceneTreeActions.updateNodeAttributes(e.nodeName,{labelVisible:C})},p=n.useSceneTree(C=>C[e.nodeName]?.visibility)??!0,x=n.useSceneTree(C=>C[e.nodeName]?.overrideVisibility),_=x!==void 0?x:p,w=n.useSceneTree(C=>C[e.nodeName]?.effectiveVisibility)??!1;Ee.useEffect(()=>()=>{y(!1)},[]);const M=_?_Ae:bAe,S=()=>{c(null)},A=()=>{l===e.nodeName?c(null):c(e.nodeName)};return k.jsxs(k.Fragment,{children:[k.jsxs(ut,{className:T9e,style:{cursor:d?"pointer":void 0},onClick:d?b:void 0,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[new Array(e.indentCount).fill(null).map((C,D)=>k.jsx(ut,{className:A9e},D)),k.jsx(ut,{style:{opacity:d?.7:.1},children:g?k.jsx(YTe,{style:{height:"1em",width:"1em",transform:"translateY(0.1em)"}}):k.jsx($Te,{style:{height:"1em",width:"1em",transform:"translateY(0.1em)"}})}),k.jsx(ut,{style:{width:"1.5em",height:"1.5em"},children:k.jsx(Or,{label:"Toggle visibility override",children:k.jsx(M,{style:{cursor:"pointer",opacity:w?.85:.25,width:"1.5em",height:"1.5em",display:"block",...x!==void 0&&{color:i.colors[i.primaryColor][r==="dark"?4:6],filter:`drop-shadow(0 0 2px ${i.colors[i.primaryColor][r==="dark"?4:6]}30)`}},onMouseDown:u,onMouseEnter:f})})}),k.jsxs(ut,{style:{flexGrow:"1",userSelect:"none",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[k.jsx("span",{style:{opacity:"0.3"},children:"/"}),e.nodeName.split("/").at(-1)]}),x!==void 0?k.jsx(ut,{className:CG,style:{width:"1.25em",height:"1.25em",display:"block",transition:"opacity 0.2s",marginRight:"0.25em"},children:k.jsx(Or,{label:"Clear visibility override",children:k.jsx(yAe,{style:{cursor:"pointer",width:"1.25em",height:"1.25em",display:"block",opacity:.7,color:i.colors[i.primaryColor][r==="dark"?4:6],filter:`drop-shadow(0 0 2px ${i.colors[i.primaryColor][r==="dark"?4:6]}30)`},onClick:C=>{C.stopPropagation(),n.sceneTreeActions.updateNodeAttributes(e.nodeName,{overrideVisibility:void 0})}})})}):null,k.jsxs(Ho,{position:"bottom",withArrow:!0,shadow:"sm",arrowSize:10,opened:l===e.nodeName,onDismiss:S,middlewares:{flip:!0,shift:!0},withinPortal:!0,children:[k.jsx(Ho.Target,{children:k.jsx(ut,{className:CG,style:{width:"1.25em",height:"1.25em",display:"block",transition:"opacity 0.2s"},children:k.jsx(Or,{label:"Local props",children:k.jsx(kAe,{style:{cursor:"pointer",width:"1.25em",height:"1.25em",display:"block"},onClick:C=>{C.stopPropagation(),A()}})})})}),k.jsx(Ho.Dropdown,{onMouseDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation(),children:k.jsx(W9e,{nodeName:e.nodeName,closePopoverFn:S})})]})]}),g?h?.map(C=>k.jsx(t,{nodeName:C,indentCount:e.indentCount+1},C)):null]})});function J9e({devSettingsStore:t}){const e=Ee.useContext(bi),n=t(u=>u.showStats),i=e.useGui(u=>u.theme.show_logo),r=t(u=>u.fixedDpr),a=t(u=>u.logCamera),s=t(u=>u.enableOrbitCrosshair),o=e.useGui(u=>u.theme.dark_mode),l=u=>{e.useGui.setState({theme:{...e.useGui.getState().theme,dark_mode:u}})},c=u=>{e.useGui.setState({theme:{...e.useGui.getState().theme,show_logo:u}})};return k.jsx(Ns,{withBorder:!0,p:"xs",children:k.jsxs(Mm,{gap:"xs",children:[k.jsx(pd,{radius:"xs",label:"Dark Mode",checked:o,onChange:u=>l(u.currentTarget.checked),size:"xs"}),k.jsx(pd,{radius:"xs",label:"WebGL Stats",checked:n,onChange:u=>t.setState({showStats:u.currentTarget.checked}),size:"xs"}),k.jsx(pd,{radius:"xs",label:"Show Viser Logo",checked:i,onChange:u=>c(u.currentTarget.checked),size:"xs"}),k.jsx(Or,{label:k.jsxs(k.Fragment,{children:["Log camera position and orientation to the",k.jsx("br",{}),"Javascript console."]}),refProp:"rootRef",children:k.jsx(pd,{radius:"xs",label:"Log Camera to Console",checked:a,onChange:u=>t.setState({logCamera:u.currentTarget.checked}),size:"xs"})}),k.jsx(Or,{label:k.jsxs(k.Fragment,{children:["Show crosshair at look-at point",k.jsx("br",{}),"when moving camera."]}),refProp:"rootRef",children:k.jsx(pd,{radius:"xs",label:"Show Orbit Crosshair",checked:s,onChange:u=>t.setState({enableOrbitCrosshair:u.currentTarget.checked}),size:"xs"})}),k.jsx(Or,{label:k.jsxs(k.Fragment,{children:["Device pixel ratio for rendering.",k.jsx("br",{}),"Default (adaptive) behavior dynamically",k.jsx("br",{}),"reduces resolution to maintain framerates."]}),children:k.jsx(Pv,{label:"Device Pixel Ratio",placeholder:"Adaptive",value:r?.toString()??"",onChange:u=>t.setState({fixedDpr:u?parseFloat(u):null}),data:[{value:"",label:"Adaptive"},{value:"0.5",label:"0.5"},{value:"1",label:"1.0"},{value:"1.5",label:"1.5"},{value:"2",label:"2.0"}],size:"xs",radius:"xs",clearable:!1})})]})})}const $9e=Ee.memo(q9e);function Z9e(){const t=Ee.useContext(bi),e=t.mutable.current,n=t.useGui(a=>a.theme.control_width),[i,r]=Ee.useState(!1);return k.jsx(k.Fragment,{children:k.jsxs(Mm,{gap:"xs",mt:"0.3em",children:[k.jsx(Or,{label:"Server URL",position:"top-start",children:k.jsx(og,{leftSection:k.jsx(D_,{src:"./logo.svg",style:{width:"1rem",height:"auto",filter:"grayscale(100%) opacity(0.3)"}}),leftSectionWidth:"1.8rem",defaultValue:t.useGui(a=>a.server),onBlur:a=>t.useGui.setState({server:a.currentTarget.value}),onKeyDown:a=>{a.key==="Enter"&&(a.currentTarget.blur(),a.currentTarget.focus())}})}),k.jsxs(G0,{gap:"0.5em",children:[k.jsx(As,{onClick:async()=>{if("showSaveFilePicker"in window&&(()=>{try{return window.self===window.top}catch{return!1}})()){const s=window.showSaveFilePicker({suggestedName:"render.png",types:[{accept:{"image/png":[".png"]}}]});e.canvas?.toBlob(async o=>{if(o===null){console.error("Export failed");return}const c=await(await s).createWritable();await c.write(o),await c.close()})}else e.canvas?.toBlob(s=>{if(s===null){console.error("Export failed");return}const o=URL.createObjectURL(s),l=document.createElement("a");l.href=o;const c="render.png";l.download=c,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(o)})},flex:1,leftSection:n==="small"?void 0:k.jsx(OAe,{size:"1rem"}),px:"0",style:{height:"1.875rem"},children:"Save Canvas"}),k.jsx(As,{onClick:()=>{e.resetCameraView()},flex:1,leftSection:n==="small"?void 0:k.jsx(MAe,{size:"1rem"}),px:"0",style:{height:"1.875rem"},children:"Reset View"})]}),k.jsxs(G0,{gap:"md",children:[k.jsx(Or,{label:k.jsxs(k.Fragment,{children:["Show tool for setting the look-at point and",k.jsx("br",{}),"up direction of the camera.",k.jsx("br",{}),k.jsx("br",{}),"This can be used to set the origin of the",k.jsx("br",{}),"camera's orbit controls."]}),refProp:"rootRef",position:"top-start",children:k.jsx(mh,{radius:"xs",label:"Orbit Origin Tool",onChange:a=>{t.useGui.setState({showOrbitOriginTool:a.currentTarget.checked})},styles:{label:{paddingLeft:"8px",letterSpacing:"-0.3px"},root:{flex:1}},size:"sm"})}),k.jsx(mh,{radius:"xs",label:"Dev Settings",onChange:a=>{r(a.currentTarget.checked)},styles:{label:{paddingLeft:"8px",letterSpacing:"-0.3px"},root:{flex:1}},size:"sm"})]}),k.jsx(ut,{mt:"-0.4em",children:k.jsx(hh,{in:i,children:k.jsx(ut,{mt:"0.4em",children:k.jsx(J9e,{devSettingsStore:t.useDevSettings})})})}),k.jsx(rg,{}),k.jsxs(ut,{children:[k.jsx(Or,{label:k.jsxs(k.Fragment,{children:["Hierarchical view of all objects in the 3D scene.",k.jsx("br",{}),"Use to override visibility and properties."]}),position:"top-start",children:k.jsx(hu,{style:{fontWeight:500},fz:"sm",children:"Scene tree"})}),k.jsx($9e,{})]})]})})}const qC=Ee.createContext(null);function hm({children:t}){const e=Ee.useRef(null),[n,{toggle:i}]=_c(!0);return k.jsx(qC.Provider,{value:{wrapperRef:e,expanded:n,toggleExpanded:i},children:k.jsx(k.Fragment,{children:k.jsx(Ns,{radius:"0",shadow:"0 0 1em 0 rgba(0,0,0,0.1)",style:{boxSizing:"border-box",zIndex:10,position:"fixed",bottom:0,right:0,margin:0,minHeight:"3.5em",maxHeight:"60%",width:"20em",transition:"height 0.3s linear"},component:Ac.Autosize,ref:e,children:k.jsx(ut,{style:{width:"20em"},children:t})})})})}hm.Handle=function({children:e}){const n=Ee.useContext(qC);return k.jsx(ut,{style:{cursor:"pointer",position:"relative",fontWeight:400,userSelect:"none",display:"flex",alignItems:"center",padding:"0 0.8em",height:"3.5em"},onClick:()=>{n.toggleExpanded()},children:e})};hm.Contents=function({children:e}){const n=Ee.useContext(qC);return k.jsxs(hh,{in:n.expanded,children:[k.jsx(rg,{mx:"xs"}),e]})};hm.HideWhenCollapsed=function({children:e}){return Ee.useContext(qC)?.expanded??!0?e:null};const Q9e={move:"touchmove",end:"touchend"},eFe={move:"mousemove",end:"mouseup"};function tFe(t){return t.type==="touchmove"}function nFe(t){return t.type==="mousemove"}const XC=Ee.createContext(null);function dm({children:t,width:e}){const n=Ee.useRef(null),[i,{toggle:r}]=_c(!0),[a,s]=Ee.useState(800),o=Ee.useRef({dragging:!1,startPosX:0,startPosY:0,startClientX:0,startClientY:0}),l=Ee.useRef({}),c=(d,g,b)=>Math.abs(d+g/2)<Math.abs(d-b+g/2)?d:d-b,u=15;function f(d,g){const b=n.current;if(b===null)return[d,g];const y=b.parentElement;if(y===null)return[d,g];let p=d,x=g;return p=Math.min(p,y.clientWidth-b.clientWidth-u),p=Math.max(p,u),x=Math.min(x,y.clientHeight-b.clientHeight-u),x=Math.max(x,u),b.style.top=`${x.toString()}px`,b.style.left=`${p.toString()}px`,[c(p,b.clientWidth,y.clientWidth),c(x,b.clientHeight,y.clientHeight)]}Ee.useEffect(()=>{const d=n.current;if(d===null)return;const g=d.parentElement;if(g===null)return;const b=new ResizeObserver(()=>{l.current.x===void 0&&(l.current.x=c(d.offsetLeft,d.clientWidth,g.clientWidth)),l.current.y===void 0&&(l.current.y=c(d.offsetTop,d.clientHeight,g.clientHeight));const y=g.clientHeight-u*2;a!==y&&s(y);let p=l.current.x,x=l.current.y;for(;p<0;)p+=g.clientWidth;for(;x<0;)x+=g.clientHeight;f(p,x)});return b.observe(d),b.observe(g),()=>{b.disconnect()}});const h=d=>{const g=o.current,b=n.current;if(!b)return;d.type=="touchstart"?(d=d,g.startClientX=d.touches[0].clientX,g.startClientY=d.touches[0].clientY):(d=d,g.startClientX=d.clientX,g.startClientY=d.clientY),g.startPosX=b.offsetLeft,g.startPosY=b.offsetTop;const y=d.type=="touchstart"?Q9e:eFe;function p(x){let _=0,w=0;if(tFe(x)?(x=x,_=x.touches[0].clientX-g.startClientX,w=x.touches[0].clientY-g.startClientY):nFe(x)&&(x=x,_=x.clientX-g.startClientX,w=x.clientY-g.startClientY),Math.abs(_)<=3&&Math.abs(w)<=3)return;g.dragging=!0;const M=g.startPosX+_,S=g.startPosY+w;[l.current.x,l.current.y]=f(M,S)}window.addEventListener(y.move,p),window.addEventListener(y.end,()=>{d.type=="touchstart"&&(g.dragging=!1),window.removeEventListener(y.move,p)},{once:!0})};return k.jsx(XC.Provider,{value:{wrapperRef:n,expanded:i,width:e,maxHeight:a,toggleExpanded:r,dragHandler:h,dragInfo:o},children:k.jsx(Ns,{radius:"xs",shadow:"0.1em 0 1em 0 rgba(0,0,0,0.1)",style:{boxSizing:"border-box",width:e,zIndex:10,position:"absolute",top:"1em",right:"1em",margin:0,"& .expandIcon":{transform:"rotate(0)"},overflow:"hidden"},ref:n,children:t})})}dm.Handle=function({children:e}){const n=Ee.useContext(XC);return k.jsx(k.Fragment,{children:k.jsx(ut,{style:{borderRadius:"0.2em 0.2em 0 0",lineHeight:"1.5em",cursor:"pointer",position:"relative",fontWeight:400,userSelect:"none",display:"flex",alignItems:"center",padding:"0 0.75em",height:"2.75em"},onClick:()=>{const i=n.dragInfo.current;if(i.dragging){i.dragging=!1;return}n.toggleExpanded()},onTouchStart:i=>{n.dragHandler(i)},onMouseDown:i=>{n.dragHandler(i)},children:e})})};dm.Contents=function({children:e}){const n=Ee.useContext(XC);return k.jsxs(hh,{in:n.expanded,children:[k.jsx(rg,{mx:"xs"}),k.jsx(Ac.Autosize,{mah:n.maxHeight,children:k.jsx(ut,{style:{width:n.width},children:e})})]})};dm.HideWhenCollapsed=function({children:e}){return Ee.useContext(XC)?.expanded??!0?e:null};const Gte=Ee.createContext(null);function g1({children:t,collapsible:e,width:n}){const[i,{toggle:r}]=_c(!1),a=k.jsx(ut,{style:s=>({position:"absolute",top:0,right:i?"0em":"-3em",transitionProperty:"right",transitionDuration:"0.5s",transitionDelay:"0.25s",borderBottomLeftRadius:"0.5em",backgroundColor:ig().colorScheme=="dark"?s.colors.dark[5]:s.colors.gray[2],padding:"0.5em"}),children:k.jsx(Dl,{onClick:s=>{s.stopPropagation(),r()},children:k.jsx(Or,{zIndex:100,label:"Show sidebar",children:k.jsx(nAe,{})})})});return k.jsxs(Gte.Provider,{value:{collapsible:e,toggleCollapsed:r},children:[a,k.jsx(Ns,{shadow:"0 0 1em 0 rgba(0,0,0,0.1)",style:{width:i?0:n,boxSizing:"content-box",transition:"width 0.5s 0s",zIndex:8}}),k.jsx(Ns,{radius:0,style:{width:i?0:n,top:0,bottom:0,right:0,position:"absolute",boxSizing:"content-box",transition:"width 0.5s 0s",zIndex:20},children:k.jsx(ut,{style:{width:n,height:"100%",display:"flex",flexDirection:"column"},children:t})})]})}g1.Handle=function({children:e}){const{toggleCollapsed:n,collapsible:i}=Ee.useContext(Gte),r=k.jsx(Dl,{onClick:a=>{a.stopPropagation(),n()},children:k.jsx(Or,{zIndex:100,label:"Collapse sidebar",children:k.jsx(rAe,{stroke:1.625})})});return k.jsxs(k.Fragment,{children:[k.jsxs(ut,{p:"xs",style:{lineHeight:"1.5em",fontWeight:400,position:"relative",zIndex:20,alignItems:"center",display:"flex",flexDirection:"row"},children:[e,i?r:null]}),k.jsx(rg,{mx:"xs"})]})};g1.Contents=function({children:e}){return k.jsx(Ac,{style:{flexGrow:1},children:e})};const iFe="root",rFe=Ee.memo(b4);function aFe(t){const e=va(),n=uL(`(max-width: ${e.breakpoints.xs})`),i=Ee.useContext(bi),r=i.useGui(f=>Object.keys(f.guiUuidSetFromContainerUuid.root??{}).length>0),[a,{toggle:s}]=_c(!1),o=i.useGui(f=>f.theme.control_width),l=o=="small"?"16em":o=="medium"?"20em":o=="large"?"24em":null,c=k.jsx(Dl,{onClick:f=>{f.stopPropagation(),s()},style:{display:r?void 0:"none",transform:"translateY(0.05em)"},children:k.jsx(Or,{zIndex:100,label:a?"Return to GUI":"Configuration & diagnostics",withinPortal:!0,children:a?k.jsx(WTe,{stroke:1.625}):k.jsx(VTe,{stroke:1.625})})}),u=k.jsxs(k.Fragment,{children:[k.jsx(hh,{in:!r||a,children:k.jsx(ut,{p:"xs",pt:"0.375em",children:k.jsx(Z9e,{})})}),k.jsx(hh,{in:r&&!a,keepMounted:!0,children:k.jsx(rFe,{containerUuid:iFe})})]});return n?k.jsxs(hm,{children:[k.jsxs(hm.Handle,{children:[k.jsx(b8,{}),k.jsxs(hm.HideWhenCollapsed,{children:[k.jsx(v8,{}),c]})]}),k.jsx(hm.Contents,{children:u})]}):t.control_layout==="floating"?k.jsxs(dm,{width:l,children:[k.jsxs(dm.Handle,{children:[k.jsx(b8,{}),k.jsxs(dm.HideWhenCollapsed,{children:[k.jsx(v8,{}),c]})]}),k.jsx(dm.Contents,{children:u})]}):k.jsxs(g1,{width:l,collapsible:t.control_layout==="collapsible",children:[k.jsxs(g1.Handle,{children:[k.jsx(b8,{}),k.jsx(v8,{}),c]}),k.jsx(g1.Contents,{children:u})]})}function b8(){const{useGui:t}=Ee.useContext(bi),e=t(i=>i.websocketState),n=t(i=>i.label);return k.jsxs(k.Fragment,{children:[k.jsx("div",{style:{width:"1.1em"}})," ",k.jsx(Sl,{transition:"skew-down",mounted:e==="connected",children:i=>k.jsx(lAe,{color:"#0b0",style:{position:"absolute",width:"1.25em",height:"1.25em",...i}})}),k.jsx(Sl,{transition:"skew-down",mounted:e==="reconnecting",children:i=>k.jsx(Wd,{size:"xs",type:"dots",color:"red",style:{position:"absolute",...i}})}),k.jsx(Sl,{transition:"skew-down",mounted:e==="inactive",children:i=>k.jsx(NAe,{color:"var(--mantine-color-red-filled)",style:{position:"absolute",width:"1.25em",height:"1.25em",...i}})}),k.jsx(ut,{px:"xs",style:{flexGrow:1,letterSpacing:"-0.5px"},pt:"0.1em",children:n!==""?n:e==="connected"?"Connected":e==="reconnecting"?"Connecting...":"Inactive"})]})}function v8(){const t=Ee.useContext(bi),e=t.mutable.current,n=t.useGui(d=>d.websocketState==="connected"),i=t.useGui(d=>d.shareUrl),r=t.useGui(d=>d.setShareUrl),[a,s]=Ee.useState(!1),[o,{open:l,close:c}]=_c(!1),[u,{toggle:f}]=_c();Ee.useEffect(()=>{i!==null&&s(!1)},[i]),Ee.useEffect(()=>{!n&&o&&c()},[n,o]);const h=ig().colorScheme;return t.useGui(d=>d.theme).show_share_button===!1?null:k.jsxs(k.Fragment,{children:[k.jsx(Or,{zIndex:100,label:n?"Share":"Share (needs connection)",withinPortal:!0,children:k.jsx(Dl,{onClick:d=>{d.stopPropagation(),l()},style:{transform:"translateY(0.05em)"},disabled:!n,children:k.jsx(HAe,{stroke:2,height:"1.125em",width:"1.125em"})})}),k.jsxs(Co,{title:"Share",opened:o,onClose:c,withCloseButton:!1,zIndex:100,withinPortal:!0,onClick:d=>d.stopPropagation(),onMouseDown:d=>d.stopPropagation(),onMouseMove:d=>d.stopPropagation(),onMouseUp:d=>d.stopPropagation(),styles:{title:{fontWeight:600}},children:[i===null?k.jsx(k.Fragment,{children:a?k.jsx(Mm,{mb:"xl",children:k.jsx(Wd,{size:"xl",mx:"auto",type:"dots"})}):k.jsxs(Mm,{mb:"md",children:[k.jsx(hu,{children:"Create a public, shareable URL to this Viser instance."}),k.jsx(As,{fullWidth:!0,onClick:()=>{e.sendMessage({type:"ShareUrlRequest"}),s(!0)},children:"Request Share URL"})]})}):k.jsxs(k.Fragment,{children:[k.jsx(hu,{children:"Share URL is connected."}),k.jsxs(Mm,{gap:"xs",my:"md",children:[k.jsx(og,{value:i}),k.jsxs(ph,{justify:"space-between",columnGap:"0.5em",align:"center",children:[k.jsx(bY,{value:i,children:({copied:d,copy:g})=>k.jsx(As,{style:{width:"50%"},leftSection:d?k.jsx(FU,{height:"1.375em",width:"1.375em"}):k.jsx(fAe,{height:"1.375em",width:"1.375em"}),onClick:g,variant:d?"outline":"filled",children:d?"Copied!":"Copy URL"})}),k.jsx(As,{style:{flexGrow:1},leftSection:u?k.jsx(FAe,{}):k.jsx(zAe,{}),onClick:f,children:"QR Code"}),k.jsx(Or,{zIndex:100,label:"Disconnect",withinPortal:!0,children:k.jsx(As,{color:"red",onClick:()=>{e.sendMessage({type:"ShareUrlDisconnect"}),r(null)},children:k.jsx(PAe,{})})})]}),k.jsx(hh,{in:u,children:k.jsx(w9e,{value:i,fgColor:h==="dark"?"#ffffff":"#000000",bgColor:"rgba(0,0,0,0)",level:"M",style:{width:"100%",height:"auto",margin:"1em auto 0 auto"}})})]})]}),k.jsxs(hu,{size:"xs",children:["Share links are experimental and bandwidth-limited. Problems? Consider"," ",k.jsx(Em,{href:"https://github.com/nerfstudio-project/viser/issues",children:"reporting on GitHub"}),"."]})]})]})}var jn,LG,a0,TT;(function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CIELab="CIELab",t.CMYK="CMYK"})(jn||(jn={})),function(t){t.ANALOGOUS="ANALOGOUS",t.COMPLEMENTARY="COMPLEMENTARY",t.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",t.TRIADIC="TRIADIC",t.TETRADIC="TETRADIC",t.SQUARE="SQUARE"}(LG||(LG={})),function(t){t.ADDITIVE="ADDITIVE",t.SUBTRACTIVE="SUBTRACTIVE"}(a0||(a0={})),function(t){t.black="#000000",t.silver="#C0C0C0",t.gray="#808080",t.white="#FFFFFF",t.maroon="#800000",t.red="#FF0000",t.purple="#800080",t.fuchsia="#FF00FF",t.green="#008000",t.lime="#00FF00",t.olive="#808000",t.yellow="#FFFF00",t.navy="#000080",t.blue="#0000FF",t.teal="#008080",t.aqua="#00FFFF",t.orange="#FFA500",t.aliceblue="#F0F8FF",t.antiquewhite="#FAEBD7",t.aquamarine="#7FFFD4",t.azure="#F0FFFF",t.beige="#F5F5DC",t.bisque="#FFE4C4",t.blanchedalmond="#FFEBCD",t.blueviolet="#8A2BE2",t.brown="#A52A2A",t.burlywood="#DEB887",t.cadetblue="#5F9EA0",t.chartreuse="#7FFF00",t.chocolate="#D2691E",t.coral="#FF7F50",t.cornflowerblue="#6495ED",t.cornsilk="#FFF8DC",t.crimson="#DC143C",t.cyan="#00FFFF",t.darkblue="#00008B",t.darkcyan="#008B8B",t.darkgoldenrod="#B8860B",t.darkgray="#A9A9A9",t.darkgreen="#006400",t.darkgrey="#A9A9A9",t.darkkhaki="#BDB76B",t.darkmagenta="#8B008B",t.darkolivegreen="#556B2F",t.darkorange="#FF8C00",t.darkorchid="#9932CC",t.darkred="#8B0000",t.darksalmon="#E9967A",t.darkseagreen="#8FBC8F",t.darkslateblue="#483D8B",t.darkslategray="#2F4F4F",t.darkslategrey="#2F4F4F",t.darkturquoise="#00CED1",t.darkviolet="#9400D3",t.deeppink="#FF1493",t.deepskyblue="#00BFFF",t.dimgray="#696969",t.dimgrey="#696969",t.dodgerblue="#1E90FF",t.firebrick="#B22222",t.floralwhite="#FFFAF0",t.forestgreen="#228B22",t.gainsboro="#DCDCDC",t.ghostwhite="#F8F8FF",t.gold="#FFD700",t.goldenrod="#DAA520",t.greenyellow="#ADFF2F",t.grey="#808080",t.honeydew="#F0FFF0",t.hotpink="#FF69B4",t.indianred="#CD5C5C",t.indigo="#4B0082",t.ivory="#FFFFF0",t.khaki="#F0E68C",t.lavender="#E6E6FA",t.lavenderblush="#FFF0F5",t.lawngreen="#7CFC00",t.lemonchiffon="#FFFACD",t.lightblue="#ADD8E6",t.lightcoral="#F08080",t.lightcyan="#E0FFFF",t.lightgoldenrodyellow="#FAFAD2",t.lightgray="#D3D3D3",t.lightgreen="#90EE90",t.lightgrey="#D3D3D3",t.lightpink="#FFB6C1",t.lightsalmon="#FFA07A",t.lightseagreen="#20B2AA",t.lightskyblue="#87CEFA",t.lightslategray="#778899",t.lightslategrey="#778899",t.lightsteelblue="#B0C4DE",t.lightyellow="#FFFFE0",t.limegreen="#32CD32",t.linen="#FAF0E6",t.magenta="#FF00FF",t.mediumaquamarine="#66CDAA",t.mediumblue="#0000CD",t.mediumorchid="#BA55D3",t.mediumpurple="#9370DB",t.mediumseagreen="#3CB371",t.mediumslateblue="#7B68EE",t.mediumspringgreen="#00FA9A",t.mediumturquoise="#48D1CC",t.mediumvioletred="#C71585",t.midnightblue="#191970",t.mintcream="#F5FFFA",t.mistyrose="#FFE4E1",t.moccasin="#FFE4B5",t.navajowhite="#FFDEAD",t.oldlace="#FDF5E6",t.olivedrab="#6B8E23",t.orangered="#FF4500",t.orchid="#DA70D6",t.palegoldenrod="#EEE8AA",t.palegreen="#98FB98",t.paleturquoise="#AFEEEE",t.palevioletred="#DB7093",t.papayawhip="#FFEFD5",t.peachpuff="#FFDAB9",t.peru="#CD853F",t.pink="#FFC0CB",t.plum="#DDA0DD",t.powderblue="#B0E0E6",t.rosybrown="#BC8F8F",t.royalblue="#4169E1",t.saddlebrown="#8B4513",t.salmon="#FA8072",t.sandybrown="#F4A460",t.seagreen="#2E8B57",t.seashell="#FFF5EE",t.sienna="#A0522D",t.skyblue="#87CEEB",t.slateblue="#6A5ACD",t.slategray="#708090",t.slategrey="#708090",t.snow="#FFFAFA",t.springgreen="#00FF7F",t.steelblue="#4682B4",t.tan="#D2B48C",t.thistle="#D8BFD8",t.tomato="#FF6347",t.turquoise="#40E0D0",t.violet="#EE82EE",t.wheat="#F5DEB3",t.whitesmoke="#F5F5F5",t.yellowgreen="#9ACD32",t.rebeccapurple="#663399"}(TT||(TT={}));const Wte=Object.keys(TT),sFe={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},ZI={BGR:jn.RGB,ABGR:jn.RGB,HLS:jn.HSL,AHLS:jn.HSL,LAB:jn.CIELab,ALAB:jn.CIELab,CKMY:jn.CMYK,ACKMY:jn.CMYK};var PG;(function(t){t.NUMBER="number",t.BOOLEAN="boolean"})(PG||(PG={}));const jb={[jn.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[jn.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[jn.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[jn.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[jn.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},oFe=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,dg=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,QI=/^0x([a-f\d]{1,2})$/i,lFe=/\{(\d+)\}/g,cFe="The provided string color doesn't have a correct format",uFe="The provided color object doesn't have the proper keys or format";var ml,uu,eN;(function(t){t.NONE="none",t.DEGREES="deg",t.GRADIANS="grad",t.RADIANS="rad",t.TURNS="turn"})(ml||(ml={})),function(t){t.NONE="none",t.PERCENT="percent"}(uu||(uu={})),function(t){t.DEVICE_CMYK="device-cmyk",t.CMYK="cmyk"}(eN||(eN={}));ml.NONE,uu.NONE,uu.NONE,uu.PERCENT,uu.NONE,eN.DEVICE_CMYK;const xo=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),oS=t=>+`${t}`.replace(dg,"$1"),Im=t=>dg.test(`${t}`)?oS(t):Math.min(+t,100),zE=t=>(t.length===1&&(t+=t),parseInt(t,16)),jE=t=>{const e=xn(t,0).toString(16).toUpperCase();return e.length===1?`0x0${e}`:`0x${e}`},pm=(t,e=!1)=>!e&&dg.test(t)?Math.min(255*oS(t)/100,255):QI.test(t)?(t.length===3&&(t+=t.slice(-1)),e?xn(t)/255:xn(t)):Math.min(+t,e?1:255),AT=t=>dg.test(t)?C0(125*oS(t)/100,-125,125):C0(+t,-125,125),Sd=t=>Math.min(dg.test(t)?oS(t)/100:+t,1),qte=t=>[...t].sort().join("").toUpperCase(),xn=(t,e=6)=>{const n=Math.pow(10,e);return Math.round(+t*n)/n},C0=(t,e,n)=>Math.max(e,Math.min(t,n)),Xte=t=>{if(typeof t=="string"){const e=t.match(oFe),n=+e[1];switch(e[2]){case ml.RADIANS:t=xn(180*n/Math.PI);break;case ml.TURNS:t=xn(360*n);break;case ml.GRADIANS:t=xn(.9*n);break;case ml.DEGREES:default:t=n}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},fFe=(t,e)=>{let n;switch(e){case ml.RADIANS:n=xn((i=>i*Math.PI/180)(t));break;case ml.TURNS:n=xn(t/360);break;case ml.GRADIANS:n=xn(10/9*t);break;case ml.DEGREES:case ml.NONE:default:n=t}return n},Kte=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],hFe=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],R0=Kte.map(t=>t.reduce((e,n)=>e+n,0)),y8=(t,e,n)=>(n<0&&(n+=6),n>=6&&(n-=6),xn(n<1?255*((e-t)*n+t):n<3?255*e:n<4?255*((e-t)*(4-n)+t):255*t)),dFe=t=>t<=.04045?t/12.92:((t+.055)/1.055)**2.4,pFe=t=>t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055,Yte=(t,e,n,i)=>{const r=[0,0,0],a=[t,e,n];return i.forEach((s,o)=>{s.forEach((l,c)=>{r[o]+=l*a[c]})}),r},ld=(t,e,n)=>{e/=100;const i=(n/=100)<=.5?n*(e+1):n+e-n*e,r=2*n-i;return{R:y8(r,i,(t/=60)+2),G:y8(r,i,t),B:y8(r,i,t-2)}},tN=(t,e,n,i=1)=>{t/=255,e/=255,n/=255,i=Math.min(i,1);const r=Math.max(t,e,n),a=Math.min(t,e,n),s=r-a;let o=0,l=0;const c=(r+a)/2;if(s!==0){switch(r){case t:o=(e-n)/s%6;break;case e:o=(n-t)/s+2;break;case n:o=(t-e)/s+4}o=xn(60*o),o<0&&(o+=360),l=s/(1-Math.abs(2*c-1))}return{H:o,S:xn(100*l),L:xn(100*c),A:i}},CT=(t,e,n)=>{const i=[t/255,e/255,n/255].map(dFe),r=Yte(i[0],i[1],i[2],Kte),a=((s,o,l)=>{const c=h=>h>.008856451679035631?Math.cbrt(h):h/.12841854934601665+.13793103448275862,u=c(s/R0[0]),f=c(o/R0[1]);return[116*f-16,500*(u-f),200*(f-c(l/R0[2]))]})(r[0],r[1],r[2]);return{L:a[0],a:a[1],b:a[2]}},Jte=(t,e,n)=>{const i=((a,s,o)=>{const l=h=>h>.20689655172413793?h**3:.12841854934601665*(h-.13793103448275862),c=(a+16)/116,u=s/500,f=o/200;return[R0[0]*l(c+u),R0[1]*l(c),R0[2]*l(c-f)]})(t,e,n),r=Yte(i[0],i[1],i[2],hFe).map(pFe);return{R:C0(255*r[0],0,255),G:C0(255*r[1],0,255),B:C0(255*r[2],0,255)}},$te=(t,e,n,i)=>({R:xn(255*(1-t)*(i=1-i)),G:xn(255*(1-e)*i),B:xn(255*(1-n)*i)}),mFe=(t,e,n)=>{t/=255,e/=255,n/=255;const i=1-Math.max(t,e,n),r=1-i,a=r&&(r-e)/r,s=r&&(r-n)/r;return{C:xn(100*(r&&(r-t)/r)),M:xn(100*a),Y:xn(100*s),K:xn(100*i)}},x8=t=>t?", ":",",hx=(t,e)=>{const n=qte(Object.keys(t));return sFe[ZI[n]].reduce((i,r,a)=>{const s=t[r];return s!==void 0&&i.push(e(s,a)),i},[])},dx=(t,e)=>t.replace(lFe,(n,i)=>`${e[+i-1]}`),HE=(t,e,n=!1)=>{const{alphaUnit:i,legacyCSS:r,decimals:a}=e;return i!==uu.PERCENT||r&&!n?xn(t,a):`${xn(100*t,a)}%`},tc={[jn.HEX]:t=>{const e=hx(t,i=>(r=>{let a=xn(r,0).toString(16).toUpperCase();return a.length===1&&(a=`0${a}`),a})(xn(i))),n=e.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return dx(n,e)},[jn.RGB]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,rgbUnit:a}=e,s=x8(r),o=hx(t,(c,u)=>a===uu.PERCENT&&u<3?`${((f,h)=>xn(f/255*100,h))(c,n)}%`:u===3?HE(c,e):xn(c,n)),l=i?o.length===4?`rgba({1}${s}{2}${s}{3}${s}{4})`:`rgb({1}${s}{2}${s}{3})`:o.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return dx(l,o)},[jn.HSL]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,anglesUnit:a}=e,s=x8(r),o=hx(t,(c,u)=>u===0&&a!==ml.NONE?`${xn(fFe(c,a),n)}${a}`:u===3?HE(c,e):xn(c,n)),l=i?o.length===4?`hsla({1}${s}{2}%${s}{3}%${s}{4})`:`hsl({1}${s}{2}%${s}{3}%)`:o.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return dx(l,o)},[jn.CIELab]:(t,e)=>{const{decimals:n,labUnit:i}=e,r=hx(t,(s,o)=>{if(o===0){const l=xn(Im(s),n);return i===uu.PERCENT?`${l}%`:`${l}`}return o<3?i===uu.PERCENT?`${((l,c)=>xn(l/125*100,c))(s,n)}%`:xn(s,n):HE(s,e,!0)}),a=r.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return dx(a,r)},[jn.CMYK]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,cmykUnit:a,cmykFunction:s}=e,o=x8(r),l=hx(t,(u,f)=>a===uu.PERCENT&&f<4?`${xn(u,n)}%`:f===4?HE(u,e):xn(u/100,n)),c=i?l.length===5?`${s}({1}${o}{2}${o}{3}${o}{4}${o}{5})`:`${s}({1}${o}{2}${o}{3}${o}{4})`:l.length===5?`${s}({1} {2} {3} {4} / {5})`:`${s}({1} {2} {3} {4})`;return dx(c,l)}},Zf=t=>(typeof t=="string"&&(t=dg.test(t)?oS(t)/100:+t),isNaN(+t)||t>1?1:xn(t)),Zte=t=>typeof t=="string"?(e=>{let n;if(Object.keys(jn).some(i=>{if(jb[i].test(e))return n=i,!0}),!n&&~Wte.indexOf(e)&&(n=jn.HEX),!n)throw new Error(cFe);return n})(t):(e=>{let n,i=!1;const r=qte(Object.keys(e));if(ZI[r]&&(n=ZI[r]),n&&n===jn.RGB){const a=Object.entries(e).some(o=>!QI.test(`${o[1]}`)),s=Object.entries(e).some(o=>!(dg.test(`${o[1]}`)||!QI.test(`${o[1]}`)&&!isNaN(+o[1])&&+o[1]<=255));a&&s&&(i=!0),a||(n=jn.HEX)}if(!n||i)throw new Error(uFe);return n})(t),gFe={[jn.HEX](t){const e=(~Wte.indexOf(t)?TT[t]:t).match(jb.HEX),n={R:zE(e[1]||e[5]),G:zE(e[2]||e[6]),B:zE(e[3]||e[7])},i=e[4]||e[8];return i!==void 0&&(n.A=zE(i)/255),n},[jn.RGB](t){const e=t.match(jb.RGB),n=pm(e[1]||e[5]),i=pm(e[2]||e[6]),r=pm(e[3]||e[7]),a=e[4]||e[8],s={R:Math.min(n,255),G:Math.min(i,255),B:Math.min(r,255)};return a!==void 0&&(s.A=Zf(a)),s},[jn.HSL](t){const e=t.match(jb.HSL),n=Xte(e[1]||e[5]),i=Im(e[2]||e[6]),r=Im(e[3]||e[7]),a=e[4]||e[8],s=ld(n,i,r);return a!==void 0&&(s.A=Zf(a)),s},[jn.CIELab](t){const e=t.match(jb.CIELab),n=Im(e[1]),i=AT(e[2]),r=AT(e[3]),a=e[4],s=Jte(n,i,r);return a!==void 0&&(s.A=Zf(a)),s},[jn.CMYK](t){const e=t.match(jb.CMYK),n=Sd(e[1]||e[6]),i=Sd(e[2]||e[7]),r=Sd(e[3]||e[8]),a=Sd(e[4]||e[9]),s=e[5]||e[10],o=$te(n,i,r,a);return s!==void 0&&(o.A=Zf(s)),o}},bFe={[jn.HEX](t){const e={R:pm(`${t.R}`),G:pm(`${t.G}`),B:pm(`${t.B}`)};return xo(t,"A")&&(e.A=Math.min(pm(`${t.A}`,!0),1)),e},[jn.RGB](t){return this.HEX(t)},[jn.HSL](t){const e=Im(`${t.S}`),n=Im(`${t.L}`),i=ld(Xte(t.H),e,n);return xo(t,"A")&&(i.A=Zf(t.A)),i},[jn.CIELab](t){const e=Im(`${t.L}`),n=AT(`${t.a}`),i=AT(`${t.b}`),r=Jte(e,n,i);return xo(t,"A")&&(r.A=Zf(t.A)),r},[jn.CMYK](t){const e=Sd(`${t.C}`),n=Sd(`${t.M}`),i=Sd(`${t.Y}`),r=Sd(`${t.K}`),a=$te(e,n,i,r);return xo(t,"A")&&(a.A=Zf(t.A)),a}},vFe=(t,e=Zte(t))=>typeof t=="string"?gFe[e](t):bFe[e](t),ws={[jn.HEX]:t=>({R:jE(t.R),G:jE(t.G),B:jE(t.B)}),HEXA(t){const e=ws.HEX(t);return e.A=xo(t,"A")?jE(255*t.A):"0xFF",e},[jn.RGB](t,e){const n=yFe(t,e);return xo(n,"A")&&delete n.A,n},RGBA(t,e){const n=ws.RGB(t,e);return n.A=xo(t,"A")?xn(t.A):1,n},[jn.HSL](t,e){const n=tN(t.R,t.G,t.B);return delete n.A,xFe(n,e)},HSLA(t,e){const n=ws.HSL(t,e);return n.A=xo(t,"A")?xn(t.A,e):1,n},[jn.CIELab](t,e){const n=CT(t.R,t.G,t.B);return _Fe(n,e)},CIELabA(t,e){const n=ws.CIELab(t,e);return n.A=xo(t,"A")?xn(t.A,e):1,n},[jn.CMYK]:(t,e)=>SFe(mFe(t.R,t.G,t.B),e),CMYKA(t,e){const n=ws.CMYK(t,e);return n.A=xo(t,"A")?xn(t.A,e):1,n}};jn.HEX+"",jn.RGB+"",jn.HSL+"",jn.CIELab+"";jn.HEX+"",jn.RGB+"",jn.HSL+"",jn.CIELab+"";const yFe=(t,e)=>({R:xn(t.R,e),G:xn(t.G,e),B:xn(t.B,e),...xo(t,"A")?{A:xn(t.A,e)}:{}}),xFe=(t,e)=>({H:xn(t.H,e),S:xn(t.S,e),L:xn(t.L,e),...xo(t,"A")?{A:xn(t.A,e)}:{}}),_Fe=(t,e)=>({L:xn(t.L,e),a:xn(t.a,e),b:xn(t.b,e)}),SFe=(t,e)=>({C:xn(t.C,e),M:xn(t.M,e),Y:xn(t.Y,e),K:xn(t.K,e)});var Qte=Symbol.for("immer-nothing"),UG=Symbol.for("immer-draftable"),or=Symbol.for("immer-state");function fc(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var bv=Object.getPrototypeOf;function vv(t){return!!t&&!!t[or]}function bh(t){return t?ene(t)||Array.isArray(t)||!!t[UG]||!!t.constructor?.[UG]||YC(t)||JC(t):!1}var wFe=Object.prototype.constructor.toString();function ene(t){if(!t||typeof t!="object")return!1;const e=bv(t);if(e===null)return!0;const n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===wFe}function i_(t,e){KC(t)===0?Reflect.ownKeys(t).forEach(n=>{e(n,t[n],t)}):t.forEach((n,i)=>e(i,n,t))}function KC(t){const e=t[or];return e?e.type_:Array.isArray(t)?1:YC(t)?2:JC(t)?3:0}function nN(t,e){return KC(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function tne(t,e,n){const i=KC(t);i===2?t.set(e,n):i===3?t.add(n):t[e]=n}function EFe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function YC(t){return t instanceof Map}function JC(t){return t instanceof Set}function Ja(t){return t.copy_||t.base_}function iN(t,e){if(YC(t))return new Map(t);if(JC(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=ene(t);if(e===!0||e==="class_only"&&!n){const i=Object.getOwnPropertyDescriptors(t);delete i[or];let r=Reflect.ownKeys(i);for(let a=0;a<r.length;a++){const s=r[a],o=i[s];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(i[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[s]})}return Object.create(bv(t),i)}else{const i=bv(t);if(i!==null&&n)return{...t};const r=Object.create(i);return Object.assign(r,t)}}function S4(t,e=!1){return $C(t)||vv(t)||!bh(t)||(KC(t)>1&&(t.set=t.add=t.clear=t.delete=MFe),Object.freeze(t),e&&Object.entries(t).forEach(([n,i])=>S4(i,!0))),t}function MFe(){fc(2)}function $C(t){return Object.isFrozen(t)}var rN={};function Jm(t){const e=rN[t];return e||fc(0,t),e}function TFe(t,e){rN[t]||(rN[t]=e)}var r_;function RT(){return r_}function AFe(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function FG(t,e){e&&(Jm("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function aN(t){sN(t),t.drafts_.forEach(CFe),t.drafts_=null}function sN(t){t===r_&&(r_=t.parent_)}function BG(t){return r_=AFe(r_,t)}function CFe(t){const e=t[or];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function zG(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];return t!==void 0&&t!==n?(n[or].modified_&&(aN(e),fc(4)),bh(t)&&(t=kT(e,t),e.parent_||DT(e,t)),e.patches_&&Jm("Patches").generateReplacementPatches_(n[or].base_,t,e.patches_,e.inversePatches_)):t=kT(e,n,[]),aN(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Qte?t:void 0}function kT(t,e,n){if($C(e))return e;const i=e[or];if(!i)return i_(e,(r,a)=>jG(t,i,e,r,a,n)),e;if(i.scope_!==t)return e;if(!i.modified_)return DT(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const r=i.copy_;let a=r,s=!1;i.type_===3&&(a=new Set(r),r.clear(),s=!0),i_(a,(o,l)=>jG(t,i,r,o,l,n,s)),DT(t,r,!1),n&&t.patches_&&Jm("Patches").generatePatches_(i,n,t.patches_,t.inversePatches_)}return i.copy_}function jG(t,e,n,i,r,a,s){if(vv(r)){const o=a&&e&&e.type_!==3&&!nN(e.assigned_,i)?a.concat(i):void 0,l=kT(t,r,o);if(tne(n,i,l),vv(l))t.canAutoFreeze_=!1;else return}else s&&n.add(r);if(bh(r)&&!$C(r)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;kT(t,r),(!e||!e.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,i)&&DT(t,r)}}function DT(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&S4(e,n)}function RFe(t,e){const n=Array.isArray(t),i={type_:n?1:0,scope_:e?e.scope_:RT(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=i,a=w4;n&&(r=[i],a=a_);const{revoke:s,proxy:o}=Proxy.revocable(r,a);return i.draft_=o,i.revoke_=s,o}var w4={get(t,e){if(e===or)return t;const n=Ja(t);if(!nN(n,e))return kFe(t,n,e);const i=n[e];return t.finalized_||!bh(i)?i:i===_8(t.base_,e)?(S8(t),t.copy_[e]=s_(i,t)):i},has(t,e){return e in Ja(t)},ownKeys(t){return Reflect.ownKeys(Ja(t))},set(t,e,n){const i=nne(Ja(t),e);if(i?.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const r=_8(Ja(t),e),a=r?.[or];if(a&&a.base_===n)return t.copy_[e]=n,t.assigned_[e]=!1,!0;if(EFe(n,r)&&(n!==void 0||nN(t.base_,e)))return!0;S8(t),zf(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_[e]=!0),!0},deleteProperty(t,e){return _8(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,S8(t),zf(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=Ja(t),i=Reflect.getOwnPropertyDescriptor(n,e);return i&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:i.enumerable,value:n[e]}},defineProperty(){fc(11)},getPrototypeOf(t){return bv(t.base_)},setPrototypeOf(){fc(12)}},a_={};i_(w4,(t,e)=>{a_[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});a_.deleteProperty=function(t,e){return a_.set.call(this,t,e,void 0)};a_.set=function(t,e,n){return w4.set.call(this,t[0],e,n,t[0])};function _8(t,e){const n=t[or];return(n?Ja(n):t)[e]}function kFe(t,e,n){const i=nne(e,n);return i?"value"in i?i.value:i.get?.call(t.draft_):void 0}function nne(t,e){if(!(e in t))return;let n=bv(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=bv(n)}}function zf(t){t.modified_||(t.modified_=!0,t.parent_&&zf(t.parent_))}function S8(t){t.copy_||(t.copy_=iN(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var DFe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,n,i)=>{if(typeof e=="function"&&typeof n!="function"){const a=n;n=e;const s=this;return function(l=a,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&fc(6),i!==void 0&&typeof i!="function"&&fc(7);let r;if(bh(e)){const a=BG(this),s=s_(e,void 0);let o=!0;try{r=n(s),o=!1}finally{o?aN(a):sN(a)}return FG(a,i),zG(r,a)}else if(!e||typeof e!="object"){if(r=n(e),r===void 0&&(r=e),r===Qte&&(r=void 0),this.autoFreeze_&&S4(r,!0),i){const a=[],s=[];Jm("Patches").generateReplacementPatches_(e,r,a,s),i(a,s)}return r}else fc(1,e)},this.produceWithPatches=(e,n)=>{if(typeof e=="function")return(s,...o)=>this.produceWithPatches(s,l=>e(l,...o));let i,r;return[this.produce(e,n,(s,o)=>{i=s,r=o}),i,r]},typeof t?.autoFreeze=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof t?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){bh(t)||fc(8),vv(t)&&(t=OFe(t));const e=BG(this),n=s_(t,void 0);return n[or].isManual_=!0,sN(e),n}finishDraft(t,e){const n=t&&t[or];(!n||!n.isManual_)&&fc(9);const{scope_:i}=n;return FG(i,e),zG(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const r=e[n];if(r.path.length===0&&r.op==="replace"){t=r.value;break}}n>-1&&(e=e.slice(n+1));const i=Jm("Patches").applyPatches_;return vv(t)?i(t,e):this.produce(t,r=>i(r,e))}};function s_(t,e){const n=YC(t)?Jm("MapSet").proxyMap_(t,e):JC(t)?Jm("MapSet").proxySet_(t,e):RFe(t,e);return(e?e.scope_:RT()).drafts_.push(n),n}function OFe(t){return vv(t)||fc(10,t),ine(t)}function ine(t){if(!bh(t)||$C(t))return t;const e=t[or];let n;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=iN(t,e.scope_.immer_.useStrictShallowCopy_)}else n=iN(t,!0);return i_(n,(i,r)=>{tne(n,i,ine(r))}),e&&(e.finalized_=!1),n}function IFe(){class t extends Map{constructor(l,c){super(),this[or]={type_:2,parent_:c,scope_:c?c.scope_:RT(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:l,draft_:this,isManual_:!1,revoked_:!1}}get size(){return Ja(this[or]).size}has(l){return Ja(this[or]).has(l)}set(l,c){const u=this[or];return s(u),(!Ja(u).has(l)||Ja(u).get(l)!==c)&&(n(u),zf(u),u.assigned_.set(l,!0),u.copy_.set(l,c),u.assigned_.set(l,!0)),this}delete(l){if(!this.has(l))return!1;const c=this[or];return s(c),n(c),zf(c),c.base_.has(l)?c.assigned_.set(l,!1):c.assigned_.delete(l),c.copy_.delete(l),!0}clear(){const l=this[or];s(l),Ja(l).size&&(n(l),zf(l),l.assigned_=new Map,i_(l.base_,c=>{l.assigned_.set(c,!1)}),l.copy_.clear())}forEach(l,c){const u=this[or];Ja(u).forEach((f,h,d)=>{l.call(c,this.get(h),h,this)})}get(l){const c=this[or];s(c);const u=Ja(c).get(l);if(c.finalized_||!bh(u)||u!==c.base_.get(l))return u;const f=s_(u,c);return n(c),c.copy_.set(l,f),f}keys(){return Ja(this[or]).keys()}values(){const l=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const c=l.next();return c.done?c:{done:!1,value:this.get(c.value)}}}}entries(){const l=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const c=l.next();if(c.done)return c;const u=this.get(c.value);return{done:!1,value:[c.value,u]}}}}[Symbol.iterator](){return this.entries()}}function e(o,l){return new t(o,l)}function n(o){o.copy_||(o.assigned_=new Map,o.copy_=new Map(o.base_))}class i extends Set{constructor(l,c){super(),this[or]={type_:3,parent_:c,scope_:c?c.scope_:RT(),modified_:!1,finalized_:!1,copy_:void 0,base_:l,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return Ja(this[or]).size}has(l){const c=this[or];return s(c),c.copy_?!!(c.copy_.has(l)||c.drafts_.has(l)&&c.copy_.has(c.drafts_.get(l))):c.base_.has(l)}add(l){const c=this[or];return s(c),this.has(l)||(a(c),zf(c),c.copy_.add(l)),this}delete(l){if(!this.has(l))return!1;const c=this[or];return s(c),a(c),zf(c),c.copy_.delete(l)||(c.drafts_.has(l)?c.copy_.delete(c.drafts_.get(l)):!1)}clear(){const l=this[or];s(l),Ja(l).size&&(a(l),zf(l),l.copy_.clear())}values(){const l=this[or];return s(l),a(l),l.copy_.values()}entries(){const l=this[or];return s(l),a(l),l.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(l,c){const u=this.values();let f=u.next();for(;!f.done;)l.call(c,f.value,f.value,this),f=u.next()}}function r(o,l){return new i(o,l)}function a(o){o.copy_||(o.copy_=new Set,o.base_.forEach(l=>{if(bh(l)){const c=s_(l,o);o.drafts_.set(l,c),o.copy_.add(c)}else o.copy_.add(l)}))}function s(o){o.revoked_&&fc(3,JSON.stringify(Ja(o)))}TFe("MapSet",{proxyMap_:e,proxySet_:r})}var Rl=new DFe,NFe=Rl.produce;Rl.produceWithPatches.bind(Rl);Rl.setAutoFreeze.bind(Rl);Rl.setUseStrictShallowCopy.bind(Rl);Rl.applyPatches.bind(Rl);Rl.createDraft.bind(Rl);Rl.finishDraft.bind(Rl);const LFe=t=>(e,n,i)=>(i.setState=(r,a,...s)=>{const o=typeof r=="function"?NFe(r):r;return e(o,a,...s)},t(i.setState,n,i)),PFe=LFe,UFe=new URLSearchParams(window.location.search),FFe=UFe.get("hideViserLogo")!==null,zp={theme:{type:"ThemeConfigurationMessage",titlebar_content:null,control_layout:"floating",control_width:"medium",dark_mode:!1,show_logo:!FFe,show_share_button:!0,colors:null},label:"",server:"ws://localhost:8080",shareUrl:null,websocketState:"inactive",backgroundAvailable:!1,showOrbitOriginTool:!1,guiUuidSetFromContainerUuid:{root:{}},modals:[],guiOrderFromUuid:{},guiConfigFromUuid:{},uploadsInProgress:{}};function BFe(t){return Ee.useState(()=>Y_(PFe(e=>({...zp,server:t,setTheme:n=>e(i=>{i.theme=n}),setShareUrl:n=>e(i=>{i.shareUrl=n}),addGui:n=>e(i=>{i.guiOrderFromUuid[n.uuid]=n.props.order,i.guiConfigFromUuid[n.uuid]=n,n.container_uuid in i.guiUuidSetFromContainerUuid||(i.guiUuidSetFromContainerUuid[n.container_uuid]={}),i.guiUuidSetFromContainerUuid[n.container_uuid][n.uuid]=!0}),addModal:n=>e(i=>{i.modals.push(n)}),removeModal:n=>e(i=>{i.modals=i.modals.filter(r=>r.uuid!==n)}),removeGui:n=>e(i=>{const r=i.guiConfigFromUuid[n];if(r==null){console.warn("(OK) Tried to remove non-existent component",n);return}delete i.guiUuidSetFromContainerUuid[r.container_uuid][n],delete i.guiOrderFromUuid[n],delete i.guiConfigFromUuid[n],Object.keys(i.guiUuidSetFromContainerUuid[r.container_uuid]).length==0&&delete i.guiUuidSetFromContainerUuid[r.container_uuid]}),resetGui:()=>e(n=>{n.shareUrl=zp.shareUrl,n.guiUuidSetFromContainerUuid=zp.guiUuidSetFromContainerUuid,n.modals=zp.modals,n.guiOrderFromUuid=zp.guiOrderFromUuid,n.guiConfigFromUuid=zp.guiConfigFromUuid,n.uploadsInProgress=zp.uploadsInProgress}),updateUploadState:n=>e(i=>{const{componentId:r,...a}=n;i.uploadsInProgress[r]={...i.uploadsInProgress[r],...a}}),updateGuiProps:(n,i)=>{e(r=>{const a=r.guiConfigFromUuid[n];if(a===void 0){console.error(`Tried to update non-existent component '${n}' with`,i);return}for(const[s,o]of Object.entries(i))s==="value"?r.guiConfigFromUuid[n].value=o:s in a.props?a.props[s]=o:console.error(`Tried to update nonexistent property '${s}' of GUI element ${n}!`)})}}))))[0]}const EM="websocket";function zFe(t){const e=new URLSearchParams(window.location.search),n=window.location.host.includes(t.replace("ws://","").replace("/",""))||window.location.host.includes(t.replace("wss://","").replace("/",""));n&&e.has(EM)?e.delete(EM):n||e.set(EM,t),window.history.replaceState(null,"Viser",e.size===0?window.location.href.split("?")[0]:"?"+Array.from(e.entries()).map(([i,r])=>`${i}=${r}`).join("&"))}function jFe(t){return new Worker("/assets/WebsocketClientWorker-CnHoAe7_.js",{type:"module",name:t?.name})}var HG=function(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,a;i<r;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))},HFe=function(){function t(e,n,i){this.name=e,this.version=n,this.os=i,this.type="browser"}return t}(),VFe=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),GFe=function(){function t(e,n,i,r){this.name=e,this.version=n,this.os=i,this.bot=r,this.type="bot-device"}return t}(),WFe=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),qFe=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),XFe=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,KFe=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,VG=3,YFe=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",XFe]],GG=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function rne(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new qFe:typeof navigator<"u"?$Fe(navigator.userAgent):QFe()}function JFe(t){return t!==""&&YFe.reduce(function(e,n){var i=n[0],r=n[1];if(e)return e;var a=r.exec(t);return!!a&&[i,a]},!1)}function $Fe(t){var e=JFe(t);if(!e)return null;var n=e[0],i=e[1];if(n==="searchbot")return new WFe;var r=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);r?r.length<VG&&(r=HG(HG([],r,!0),eBe(VG-r.length),!0)):r=[];var a=r.join("."),s=ZFe(t),o=KFe.exec(t);return o&&o[1]?new GFe(n,a,s,o[1]):new HFe(n,a,s)}function ZFe(t){for(var e=0,n=GG.length;e<n;e++){var i=GG[e],r=i[0],a=i[1],s=a.exec(t);if(s)return r}return null}function QFe(){var t=typeof process<"u"&&process.version;return t?new VFe(process.version.slice(1)):null}function eBe(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}function tBe(){const t=I.useContext(bi),e=t.mutable.current,n=t.useGui(o=>o.server),i=t.useGui(o=>o.websocketState==="connected"),r=Ee.useRef(!1),a=Ee.useRef(!1),s=()=>{r.current=!0};I.useEffect(()=>(document.readyState==="complete"?r.current=!0:window.addEventListener("load",s),()=>{window.removeEventListener("load",s)}),[]),I.useEffect(()=>{if(!n||!i||!r.current||a.current)return;const o=new URL(window.location.href),l={};o.searchParams.forEach((f,h)=>{l[h]=f});const c=rne(),u={type:"BrowserInfoMessage",user_agent:navigator.userAgent,browser_name:c?.name||"",browser_version:c?.version||"",os_name:c?.os||null,url:window.location.href,origin:window.location.origin,pathname:window.location.pathname,search_params:l,screen_width:window.screen.width,screen_height:window.screen.height};e.sendMessage(u),a.current=!0},[n,i,r])}function nBe(){const t=I.useContext(bi),e=t.mutable.current,n=t.useGui(a=>a.server),i=t.useGui(a=>a.resetGui),r=t.sceneTreeActions.resetScene;return tBe(),zFe(n),Ee.useEffect(()=>{const a=new jFe;let s=!1,o=null;function l(u){a.postMessage(u)}function c(){const u=!s&&document.hasFocus();s||t.useGui.setState({websocketState:u?"reconnecting":"inactive"}),u&&o===null?(l({type:"retry"}),o=setInterval(()=>{l({type:"retry"})},1e3)):!u&&o!==null&&(clearInterval(o),o=null)}return window.addEventListener("focus",c),window.addEventListener("blur",c),a.onmessage=u=>{const f=u.data;f.type==="connected"?(s=!0,i(),r(),t.useGui.setState({websocketState:"connected"}),c(),e.sendMessage=h=>{l({type:"send",message:h})}):f.type==="closed"?(s=!1,i(),c(),e.sendMessage=h=>{console.log(`Tried to send ${h.type} but websocket is not connected!`)},f.versionMismatch&&ks.show({id:"version-mismatch",title:"Connection rejected",message:`${f.closeReason}.`,color:"red",autoClose:5e3,withCloseButton:!0})):f.type==="message_batch"&&e.messageQueue.push(...f.messages)},l({type:"set_server",server:n}),()=>{window.removeEventListener("focus",c),window.removeEventListener("blur",c),o!==null&&clearInterval(o),l({type:"close"}),e.sendMessage=u=>console.log(`Tried to send ${u.type} but websocket is not connected!`),t.useGui.setState({websocketState:"inactive"})}},[n,i,r]),null}function iBe(t){throw new Error("Didn't expect to get here",t)}function ane(t){let e=null;switch(t){case null:break;case"GitHub":e=XTe;break;case"Description":e=wAe;break;case"Keyboard":e=AAe;break;default:iBe(t)}return e}function rBe(t){const e=ane(t.icon);return k.jsx(As,{component:"a",variant:"default",size:"compact-sm",href:t.href||void 0,target:"_blank",leftSection:e===null?null:k.jsx(e,{size:"1em"}),ml:"xs",color:"gray",children:t.text})}function aBe(t){const e=ane(t.icon);return k.jsx(As,{m:"sm",component:"a",variant:"default",href:t.href||void 0,target:"_blank",leftSection:e===null?null:k.jsx(e,{size:"1.5em"}),ml:"sm",color:"gray",children:t.text})}function sBe(t,e){let n;t.image_url_dark==null||e==="light"?n=t.image_url_light:n=t.image_url_dark;const i=k.jsx("img",{src:n,alt:t.image_alt,style:{height:"1.8em",margin:"0 0.5em"}});return t.href==null?i:k.jsx("a",{style:{display:"block",height:"1.8em"},href:t.href,children:i})}function oBe(){const e=I.useContext(bi).useGui(o=>o.theme.titlebar_content),n=ig().colorScheme,[i,r]=_c(!1);if(e==null)return null;const a=e.buttons,s=e.image;return k.jsx(ut,{style:{height:"3.2em",margin:0,border:"0",zIndex:10},children:k.jsxs(Ns,{shadow:"0 0 0.8em 0 rgba(0,0,0,0.1)",style:{height:"100%"},children:[k.jsxs(dP,{fluid:!0,style:()=>({height:"100%",display:"flex",alignItems:"center"}),children:[k.jsx(G0,{style:()=>({marginRight:"auto"}),children:s!==null?sBe(s,n):null}),k.jsx(G0,{display:{base:"none",xs:"flex"},style:()=>({flexWrap:"nowrap",overflowX:"scroll",msOverflowStyle:"none",scrollbarWidth:"none"}),children:a?.map((o,l)=>I.createElement(rBe,{...o,key:l}))}),k.jsx(rP,{size:"sm",opened:i,onClick:r.toggle,title:i?"Close navigation":"Open navigation",display:{base:"block",xs:"none"}})]}),k.jsx(PL,{children:k.jsx(Ns,{display:{base:"flex",xs:"none"},radius:"0",style:{flexDirection:"column",position:"absolute",top:"3.2em",zIndex:2e3,height:i?"calc(100vh - 2.375em)":"0",width:"100vw",transition:"all 0.5s",overflow:i?"scroll":"hidden",padding:i?"1rem":"0"},children:a?.map((o,l)=>I.createElement(aBe,{...o,key:l}))})})]})})}function lBe(){return I.useContext(bi).useGui(i=>i.modals,$_).map((i,r)=>k.jsx(cBe,{conf:i,index:r},i.uuid))}function cBe({conf:t,index:e}){return k.jsx(Co,{opened:!0,title:t.title,onClose:()=>{},withCloseButton:!1,centered:!0,zIndex:100+e,children:k.jsx(b4,{containerUuid:t.uuid})})}const E4={message:{type:"FrameMessage",name:"",props:{show_axes:!1,axes_length:.5,axes_radius:.0125,origin_radius:.025,origin_color:[236,236,0]}},children:["/WorldAxes"],clickable:!1,visibility:!0,effectiveVisibility:!0,wxyz:(()=>{const t=new Vn().setFromEuler(new mi(Math.PI/2,Math.PI,-Math.PI/2));return[t.w,t.x,t.y,t.z]})()},sne={message:{type:"FrameMessage",name:"/WorldAxes",props:{show_axes:!0,axes_length:.5,axes_radius:.0125,origin_radius:.025,origin_color:[236,236,0]}},children:[],clickable:!1,visibility:!0,effectiveVisibility:!0};function uBe(t,e){const n={addSceneNode:i=>{const r=t.getState(),a=r[i.name],s=i.name.split("/").slice(0,-1).join("/"),o=r[s],l={[i.name]:{...a,message:i,children:a?.children??[],clickable:a?.clickable??!1,labelVisible:a?.labelVisible??!1,effectiveVisibility:a?.effectiveVisibility??!0}};o&&!o.children.includes(i.name)&&(l[s]={...o,children:[...o.children,i.name]}),a&&delete e[i.name],t.setState(l)},removeSceneNode:i=>{const r=t.getState(),a=[];function s(u){a.push(u);const f=r[u];f&&f.children.forEach(s)}s(i);const o={};a.forEach(u=>{o[u]=void 0,delete e[u]});const l=i.split("/").slice(0,-1).join("/"),c=r[l];c&&(o[l]={...c,children:c.children.filter(u=>u!==i)}),t.setState(o)},updateSceneNodeProps:(i,r)=>{const a=t.getState()[i];if(a===void 0)return console.error(`Attempted to update props of non-existent node ${i}`,r),{};t.setState({[i]:{...a,message:{...a.message,props:{...a.message.props,...r}}}})},resetScene:()=>{t.setState({"":E4,"/WorldAxes":sne},!0)},updateNodeAttributes:(i,r)=>{const a=t.getState()[i];if(a===void 0){console.log(`(OK) Attempted to update attributes of non-existent node ${i}`,r);return}let s=!1;for(const o in r)if(a[o]!==r[o]){s=!0;break}s&&(t.setState({[i]:{...a,...r}}),("visibility"in r||"overrideVisibility"in r)&&n.computeEffectiveVisibility(i))},computeEffectiveVisibility:i=>{const r=t.getState(),a=r[i];if(!a)return;const s=i.split("/").slice(0,-1).join("/"),o=r[s],l=s===""?!0:o?.effectiveVisibility??!0,c=a.overrideVisibility??a.visibility??!0,u=l&&c,f={[i]:{...a,effectiveVisibility:u}};function h(d,g){const b=r[d];b&&b.children.forEach(y=>{const p=r[y];if(!p)return;const x=p.overrideVisibility??p.visibility??!0,_=g&&x;f[y]={...p,effectiveVisibility:_},h(y,_)})}h(i,u),t.setState(f)}};return n}function fBe(t){return Ee.useState(()=>{const e=Y_(()=>({"":E4,"/WorldAxes":sne})),n=uBe(e,t);return{store:e,actions:n}})[0]}function hBe(){return Ee.useState(()=>Y_(()=>({enableDefaultLights:!0,enableDefaultLightsShadows:!0,environmentMap:{type:"EnvironmentMapMessage",hdri:"city",background:!1,background_blurriness:0,background_intensity:1,background_wxyz:[1,0,0,0],environment_intensity:1,environment_wxyz:[1,0,0,0]}})))[0]}function dBe(){return Ee.useState(()=>{const t=new URLSearchParams(window.location.search),e=t.get("showStats")!==null,n=t.get("fixedDpr"),i=n?parseFloat(n):null,r=t.get("logCamera")!==null;return Y_(()=>({showStats:e,fixedDpr:i,logCamera:r,enableOrbitCrosshair:!0}))})[0]}function px(t,e,n){return Object.keys(t[e]).reduce((i,r)=>(i[r]=`var(--mantine-${n}-${r})`,i),{})}function WG(t,e){return t in e.breakpoints?e.breakpoints[t]:EO(t)}function pBe(t){const e=MX(aA,t),n=px(e,"fontSizes","font-size"),i=px(e,"lineHeights","line-height"),r=px(e,"shadows","shadow"),a=px(e,"radius","radius"),s=px(e,"spacing","spacing"),o=Object.keys(e.headings.sizes).reduce((c,u)=>(c[u]={fontSize:`var(--mantine-${u}-font-size)`,lineHeight:`var(--mantine-${u}-line-height)`,fontWeight:`var(--mantine-${u}-font-weight)`},c),{}),l=Object.keys(e.colors).reduce((c,u)=>(c[u]={0:`var(--mantine-color-${u}-0)`,1:`var(--mantine-color-${u}-1)`,2:`var(--mantine-color-${u}-2)`,3:`var(--mantine-color-${u}-3)`,4:`var(--mantine-color-${u}-4)`,5:`var(--mantine-color-${u}-5)`,6:`var(--mantine-color-${u}-6)`,7:`var(--mantine-color-${u}-7)`,8:`var(--mantine-color-${u}-8)`,9:`var(--mantine-color-${u}-9)`,filled:`var(--mantine-color-${u}-filled)`,filledHover:`var(--mantine-color-${u}-filled-hover)`,light:`var(--mantine-color-${u}-light)`,lightHover:`var(--mantine-color-${u}-light-hover)`,lightColor:`var(--mantine-color-${u}-light-color)`,outline:`var(--mantine-color-${u}-outline)`,outlineHover:`var(--mantine-color-${u}-outline-hover)`},c),{primary:"var(--mantine-primary-color-filled)",primaryColors:{0:"var(--mantine-primary-color-0)",1:"var(--mantine-primary-color-1)",2:"var(--mantine-primary-color-2)",3:"var(--mantine-primary-color-3)",4:"var(--mantine-primary-color-4)",5:"var(--mantine-primary-color-5)",6:"var(--mantine-primary-color-6)",7:"var(--mantine-primary-color-7)",8:"var(--mantine-primary-color-8)",9:"var(--mantine-primary-color-9)",filled:"var(--mantine-primary-color-filled)",filledHover:"var(--mantine-primary-color-filled-hover)",light:"var(--mantine-primary-color-light)",lightHover:"var(--mantine-primary-color-light-hover)",lightColor:"var(--mantine-primary-color-light-color)",outline:"var(--mantine-primary-color-outline)",outlineHover:"var(--mantine-primary-color-outline-hover)"},white:"var(--mantine-color-white)",black:"var(--mantine-color-black)",text:"var(--mantine-color-text)",body:"var(--mantine-color-body)",error:"var(--mantine-color-error)",placeholder:"var(--mantine-color-placeholder)",anchor:"var(--mantine-color-anchor)",default:"var(--mantine-color-default)",defaultHover:"var(--mantine-color-default-hover)",defaultColor:"var(--mantine-color-default-color)",defaultBorder:"var(--mantine-color-default-border)",dimmed:"var(--mantine-color-dimmed)",disabledBody:"var(--mantine-color-disabled)",disabledText:"var(--mantine-color-disabled-color)",disabledBorder:"var(--mantine-color-disabled-border)"});return{scale:"var(--mantine-scale)",cursorType:"var(--mantine-cursor-type)",webkitFontSmoothing:"var(--mantine-webkit-font-smoothing)",mozFontSmoothing:"var(--mantine-moz-font-smoothing)",lineHeight:"var(--mantine-line-height)",fontFamily:"var(--mantine-font-family)",fontFamilyMonospace:"var(--mantine-font-family-monospace)",fontFamilyHeadings:"var(--mantine-font-family-headings)",headingFontWeight:"var(--mantine-heading-font-weight)",radiusDefault:"var(--mantine-radius-default)",breakpoints:e.breakpoints,fontSizes:n,lineHeights:i,shadows:r,radius:a,headings:o,spacing:s,colors:l,rtlSelector:'[dir="rtl"] &',darkSelector:'[data-mantine-color-scheme="dark"] &',lightSelector:'[data-mantine-color-scheme="light"] &',smallerThan:c=>`(max-width: ${WG(c,e)})`,largerThan:c=>`(min-width: ${WG(c,e)})`}}const one={fontFamily:"Inter",autoContrast:!0,components:{Checkbox:mh.extend({defaultProps:{radius:"xs"}}),ColorInput:Nv.extend({defaultProps:{radius:"xs"}}),Select:Pv.extend({defaultProps:{radius:"sm"}}),Textarea:yA.extend({defaultProps:{radius:"xs"}}),TextInput:og.extend({defaultProps:{radius:"xs"}}),NumberInput:ag.extend({defaultProps:{radius:"xs"}}),Paper:Ns.extend({defaultProps:{radius:"xs",shadow:"0"}}),ActionIcon:Dl.extend({defaultProps:{variant:"subtle",color:"gray",radius:"xs"}}),Button:As.extend({defaultProps:{radius:"xs",styles:{label:{fontWeight:450}}}})}};pBe(one);const mBe=new Set(["CameraFrustumMessage","GlbMessage","FrameMessage","BatchedAxesMessage","GridMessage","LabelMessage","Gui3DMessage","PointCloudMessage","DirectionalLightMessage","AmbientLightMessage","HemisphereLightMessage","PointLightMessage","RectAreaLightMessage","SpotLightMessage","MeshMessage","BoxMessage","IcosphereMessage","SkinnedMeshMessage","BatchedMeshesMessage","BatchedGlbMessage","TransformControlsMessage","ImageMessage","LineSegmentsMessage","CatmullRomSplineMessage","CubicBezierSplineMessage","GaussianSplatsMessage"]);function gBe(t){return mBe.has(t.type)}const bBe=new Set(["GuiFolderMessage","GuiMarkdownMessage","GuiHtmlMessage","GuiProgressBarMessage","GuiPlotlyMessage","GuiUplotMessage","GuiImageMessage","GuiTabGroupMessage","GuiButtonMessage","GuiUploadButtonMessage","GuiSliderMessage","GuiMultiSliderMessage","GuiNumberMessage","GuiRgbMessage","GuiRgbaMessage","GuiCheckboxMessage","GuiVector2Message","GuiVector3Message","GuiTextMessage","GuiDropdownMessage","GuiButtonGroupMessage"]);function vBe(t){return bBe.has(t.type)}function yBe(){const t=I.useContext(bi),e=t.mutable.current,n=t.sceneTreeActions.updateSceneNodeProps,i=t.sceneTreeActions.removeSceneNode,r=t.sceneTreeActions.addSceneNode,a=t.useGui(b=>b.setTheme),s=t.useGui(b=>b.setShareUrl),o=t.useGui(b=>b.addGui),l=t.useGui(b=>b.addModal),c=t.useGui(b=>b.removeModal),u=t.useGui(b=>b.removeGui),f=t.useGui(b=>b.updateGuiProps),h=t.useGui(b=>b.updateUploadState);function d(b){const y=t.useSceneTree.getState()[b.name],p=t.useSceneTree.getState(),x=b.name.split("/").slice(0,-1).join("/");p[x]?.message===void 0&&(d({...E4.message,name:x}),t.sceneTreeActions.updateNodeAttributes(x,{visibility:!0})),r(b),b!==y?.message&&t.sceneTreeActions.updateNodeAttributes(b.name,{poseUpdateState:"waitForMakeObject"})}const g=xBe();return b=>{if(vBe(b)){o(b);return}if(gBe(b)){if(b.type==="SkinnedMeshMessage"){e.skinnedMeshState[b.name]={initialized:!1,dirty:!1,poses:[]};const y=new Float32Array(b.props.bone_wxyzs.buffer.slice(b.props.bone_wxyzs.byteOffset,b.props.bone_wxyzs.byteOffset+b.props.bone_wxyzs.byteLength)),p=new Float32Array(b.props.bone_positions.buffer.slice(b.props.bone_positions.byteOffset,b.props.bone_positions.byteOffset+b.props.bone_positions.byteLength));for(let x=0;x<b.props.bone_wxyzs.length;x++)e.skinnedMeshState[b.name].poses.push({wxyz:[y[4*x],y[4*x+1],y[4*x+2],y[4*x+3]],position:[p[3*x],p[3*x+1],p[3*x+2]]})}d(b);return}switch(b.type){case"SceneNodeUpdateMessage":{n(b.name,b.updates);return}case"ShareUrlUpdated":{s(b.share_url);return}case"GetRenderRequestMessage":{e.getRenderRequest=b,e.getRenderRequestState="triggered";return}case"SetGuiPanelLabelMessage":{t.useGui.setState({label:b.label??""});return}case"ThemeConfigurationMessage":{a(b);return}case"RunJavascriptMessage":{new Function(b.source)();return}case"NotificationMessage":{console.log(b.uuid,b.props.loading),(b.mode==="show"?ks.show:ks.update)({id:b.uuid,title:b.props.title,message:b.props.body,withCloseButton:b.props.with_close_button,loading:b.props.loading,autoClose:b.props.auto_close_seconds===null?!1:b.props.auto_close_seconds*1e3,color:MC(b.props.color)});return}case"RemoveNotificationMessage":{ks.hide(b.uuid);return}case"ScenePointerEnableMessage":{e.scenePointerInfo.enabled=b.enable?b.event_type:!1,e.scenePointerInfo.keyboard=b.keyboard,b.keyboard||(e.canvas.style.cursor=b.enable?"pointer":"auto");return}case"EnvironmentMapMessage":{t.useEnvironment.setState({environmentMap:b});return}case"EnableLightsMessage":{t.useEnvironment.setState({enableDefaultLights:b.enabled,enableDefaultLightsShadows:b.cast_shadow});return}case"GuiModalMessage":{l(b);return}case"GuiCloseModalMessage":{c(b.uuid);return}case"SetBoneOrientationMessage":{const y=e.skinnedMeshState;y[b.name].poses[b.bone_index].wxyz=b.wxyz,y[b.name].dirty=!0;break}case"SetBonePositionMessage":{const y=e.skinnedMeshState;y[b.name].poses[b.bone_index].position=b.position,y[b.name].dirty=!0;break}case"SetCameraLookAtMessage":{const y=e.cameraControl,p=Yf(t),x=new te(b.look_at[0],b.look_at[1],b.look_at[2]);x.applyMatrix4(p),y.setTarget(x.x,x.y,x.z,!1);return}case"SetCameraUpDirectionMessage":{const y=e.camera,p=e.cameraControl,x=Yf(t),_=new te(b.position[0],b.position[1],b.position[2]).normalize().applyQuaternion(new Vn().setFromRotationMatrix(x));y.up.set(_.x,_.y,_.z);const w=new te;p.getPosition(w),p.updateCameraUp(),p.setPosition(w.x,w.y,w.z,!1);return}case"SetCameraPositionMessage":{const y=e.cameraControl,p=new te(b.position[0],b.position[1],b.position[2]),x=Yf(t);p.applyMatrix4(x),y.setPosition(p.x,p.y,p.z);return}case"SetCameraFovMessage":{const y=e.camera;y.setFocalLength(.5*y.getFilmHeight()/Math.tan(b.fov/2)),e.sendCamera!==null&&e.sendCamera();return}case"SetCameraNearMessage":{const y=e.camera;y.near=b.near,y.updateProjectionMatrix();return}case"SetCameraFarMessage":{const y=e.camera;y.far=b.far,y.updateProjectionMatrix();return}case"SetOrientationMessage":{const y=t.useSceneTree.getState()[b.name],p=y?.poseUpdateState!=="waitForMakeObject"?"needsUpdate":y?.poseUpdateState||"needsUpdate";return{targetNode:b.name,updates:{wxyz:b.wxyz,poseUpdateState:p}}}case"SetPositionMessage":{const y=t.useSceneTree.getState()[b.name],p=y?.poseUpdateState!=="waitForMakeObject"?"needsUpdate":y?.poseUpdateState||"needsUpdate";return{targetNode:b.name,updates:{position:b.position,poseUpdateState:p}}}case"SetSceneNodeVisibilityMessage":return{targetNode:b.name,updates:{visibility:b.visible}};case"BackgroundImageMessage":{if(b.rgb_data!==null){const y=URL.createObjectURL(new Blob([b.rgb_data],{type:"image/"+b.format}));new lv().load(y,p=>{URL.revokeObjectURL(y);const x=e.backgroundMaterial.uniforms.colorMap.value;e.backgroundMaterial.uniforms.colorMap.value=p,CD(x)&&x.dispose()}),e.backgroundMaterial.uniforms.enabled.value=!0}else{const y=e.backgroundMaterial.uniforms.colorMap.value;CD(y)&&y.dispose(),e.backgroundMaterial.uniforms.enabled.value=!1}if(e.backgroundMaterial.uniforms.hasDepth.value=b.depth_data!==null,b.depth_data!==null){const y=URL.createObjectURL(new Blob([b.depth_data],{type:"image/"+b.format}));new lv().load(y,p=>{URL.revokeObjectURL(y);const x=e.backgroundMaterial?.uniforms.depthMap.value;e.backgroundMaterial.uniforms.depthMap.value=p,CD(x)&&x.dispose()})}return}case"RemoveSceneNodeMessage":{console.log("Removing scene node:",b.name);const y=t.useSceneTree.getState();if(!(b.name in y)){console.log("(OK) Skipping scene node removal for "+b.name);return}i(b.name),e.skinnedMeshState[b.name]!==void 0&&delete e.skinnedMeshState[b.name];return}case"SetSceneNodeClickableMessage":return{targetNode:b.name,updates:{clickable:b.clickable}};case"GuiUpdateMessage":{f(b.uuid,b.updates);return}case"GuiRemoveMessage":{u(b.uuid);return}case"FileTransferStartDownload":case"FileTransferPart":{g(b);return}case"FileTransferPartAck":{h({componentId:b.source_component_uuid,uploadedBytes:b.transferred_bytes,totalBytes:b.total_bytes});return}default:{console.log("Received message did not match any known types:",b);return}}}}function xBe(){const t=Ee.useRef({});return e=>{const n="download-"+e.transfer_uuid;switch(e.type){case"FileTransferStartDownload":{let s=e.size_bytes;const o=["B","K","M","G","T","P"];let l=0;for(;s>=100&&l<o.length-1;)s/=1024,l+=1;t.current[e.transfer_uuid]={metadata:e,notificationId:n,parts:[],bytesDownloaded:0,displayFilesize:`${s.toFixed(1)}${o[l]}`};break}case"FileTransferPart":{const s=t.current[e.transfer_uuid];e.part_index!=s.parts.length&&console.error("A file download message was received out of order!"),s.parts.push(e),s.bytesDownloaded+=e.content.length;break}}const i=t.current[e.transfer_uuid],r=100*i.bytesDownloaded/i.metadata.size_bytes,a=i.bytesDownloaded==i.metadata.size_bytes;if((i.bytesDownloaded==0?ks.show:ks.update)({title:(a?"Received ":"Receiving ")+`${i.metadata.filename} (${i.displayFilesize})`,message:k.jsx(af,{size:"sm",value:r}),id:n,autoClose:a&&i.metadata.save_immediately,withCloseButton:a,loading:!a,icon:a?k.jsx(FU,{}):void 0}),a){const s=window.URL.createObjectURL(new Blob(i.parts.sort((o,l)=>o.part_index-l.part_index).map(o=>o.content),{type:i.metadata.mime_type}));if(i.metadata.save_immediately){const o=document.createElement("a");o.href=s,o.download=i.metadata.filename,o.click(),o.remove(),delete t.current[e.transfer_uuid],URL.revokeObjectURL(s)}else ks.update({id:n,title:"",message:k.jsx(k.Fragment,{children:k.jsx("a",{href:s,download:i.metadata.filename,children:k.jsx(As,{leftSection:k.jsx(mAe,{size:14}),variant:"light",size:"sm",mt:"0.05em",style:{width:"100%"},children:`${i.metadata.filename} (${i.displayFilesize})`})})}),autoClose:!1,onClose:()=>{URL.revokeObjectURL(s),delete t.current[e.transfer_uuid]}})}}}function _Be(){const t=yBe(),e=I.useContext(bi),n=e.mutable.current,i=n.messageQueue,r=Ee.useContext(Q_),a=Ri(s=>s.gl);return ra(()=>{if(n.getRenderRequestState==="triggered")n.getRenderRequestState="pause";else if(n.getRenderRequestState==="pause"){const s=n.getRenderRequest.position,o=n.getRenderRequest.wxyz,l=n.getRenderRequest.fov,c=n.getRenderRequest.width,u=n.getRenderRequest.height,f=Yf(e),h=new ta(gc.radToDeg(l),c/u,.01,1e3);h.position.set(...s).applyMatrix4(f),h.setRotationFromQuaternion(new Vn(o[1],o[2],o[3],o[0]).premultiply(new Vn().setFromRotationMatrix(f)).multiply(new Vn().setFromAxisAngle(new te(1,0,0),Math.PI)));const d=r.meshPropsRef.current,g=d!==null?d.sortedIndexAttribute.array.slice():null;r.updateCamera.current!==null&&r.updateCamera.current(h,c,u,!0);const b=a.getSize(new wt),y=a.getClearColor(new Ut),p=a.getClearAlpha();a.setSize(c,u),a.setClearColor(16777215),a.setClearAlpha(n.getRenderRequest.format=="image/png"?0:1),a.render(n.scene,h);const x=a.domElement,_=document.createElement("canvas");_.width=c,_.height=u,_.getContext("2d").drawImage(x,0,0,c,u),a.setSize(b.x,b.y),a.setClearColor(y),a.setClearAlpha(p),g!==null&&d!==null&&(d.sortedIndexAttribute.array=g,d.sortedIndexAttribute.needsUpdate=!0),n.getRenderRequestState="in_progress",_.toBlob(async M=>{n.sendMessage({type:"GetRenderResponseMessage",payload:new Uint8Array(await M.arrayBuffer())}),n.getRenderRequestState="ready"},n.getRenderRequest.format)}if(n.getRenderRequestState==="ready"){const s=i.findIndex(h=>h.type==="GetRenderRequestMessage"),o=s!==-1?s+1:i.length,c=i.splice(0,o).map(t).reduce((h,d)=>d===void 0?h:{...h,[d.targetNode]:{...h[d.targetNode],...d.updates}},{}),u=e.useSceneTree.getState(),f={};for(const[h,d]of Object.entries(c)){if(!(h in u)){console.log(`(OK) Tried to update non-existent scene node ${h}`);continue}f[h]={...u[h],...d}}e.useSceneTree.setState(f);for(const[h,d]of Object.entries(c))"visibility"in d&&e.sceneTreeActions.computeEffectiveVisibility(h)}},-1e5),null}new TextEncoder;const SBe=4096;function lne(t,e,n){let i=e;const r=i+n,a=[];let s="";for(;i<r;){const o=t[i++];if(!(o&128))a.push(o);else if((o&224)===192){const l=t[i++]&63;a.push((o&31)<<6|l)}else if((o&240)===224){const l=t[i++]&63,c=t[i++]&63;a.push((o&31)<<12|l<<6|c)}else if((o&248)===240){const l=t[i++]&63,c=t[i++]&63,u=t[i++]&63;let f=(o&7)<<18|l<<12|c<<6|u;f>65535&&(f-=65536,a.push(f>>>10&1023|55296),f=56320|f&1023),a.push(f)}else a.push(o);a.length>=SBe&&(s+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(s+=String.fromCharCode(...a)),s}const wBe=new TextDecoder,EBe=200;function MBe(t,e,n){const i=t.subarray(e,e+n);return wBe.decode(i)}function TBe(t,e,n){return n>EBe?MBe(t,e,n):lne(t,e,n)}class VE{constructor(e,n){this.type=e,this.data=n}}class dl extends Error{constructor(e){super(e);const n=Object.create(dl.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:dl.name})}}const mx=4294967295;function ABe(t,e,n){const i=Math.floor(n/4294967296),r=n;t.setUint32(e,i),t.setUint32(e+4,r)}function cne(t,e){const n=t.getInt32(e),i=t.getUint32(e+4);return n*4294967296+i}function CBe(t,e){const n=t.getUint32(e),i=t.getUint32(e+4);return n*4294967296+i}const RBe=-1,kBe=4294967296-1,DBe=17179869184-1;function OBe({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=DBe)if(e===0&&t<=kBe){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,i=t&4294967295,r=new Uint8Array(8),a=new DataView(r.buffer);return a.setUint32(0,e<<2|n&3),a.setUint32(4,i),r}else{const n=new Uint8Array(12),i=new DataView(n.buffer);return i.setUint32(0,e),ABe(i,4,t),n}}function IBe(t){const e=t.getTime(),n=Math.floor(e/1e3),i=(e-n*1e3)*1e6,r=Math.floor(i/1e9);return{sec:n+r,nsec:i-r*1e9}}function NBe(t){if(t instanceof Date){const e=IBe(t);return OBe(e)}else return null}function LBe(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),i=e.getUint32(4),r=(n&3)*4294967296+i,a=n>>>2;return{sec:r,nsec:a}}case 12:{const n=cne(e,4),i=e.getUint32(0);return{sec:n,nsec:i}}default:throw new dl(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function PBe(t){const e=LBe(t);return new Date(e.sec*1e3+e.nsec/1e6)}const UBe={type:RBe,encode:NBe,decode:PBe};class oN{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(UBe)}register({type:e,encode:n,decode:i}){if(e>=0)this.encoders[e]=n,this.decoders[e]=i;else{const r=-1-e;this.builtInEncoders[r]=n,this.builtInDecoders[r]=i}}tryToEncode(e,n){for(let i=0;i<this.builtInEncoders.length;i++){const r=this.builtInEncoders[i];if(r!=null){const a=r(e,n);if(a!=null){const s=-1-i;return new VE(s,a)}}}for(let i=0;i<this.encoders.length;i++){const r=this.encoders[i];if(r!=null){const a=r(e,n);if(a!=null){const s=i;return new VE(s,a)}}}return e instanceof VE?e:null}decode(e,n,i){const r=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return r?r(e,n,i):new VE(n,e)}}oN.defaultCodec=new oN;function FBe(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function qG(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):FBe(t)?new Uint8Array(t):Uint8Array.from(t)}function w8(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const BBe=16,zBe=16;class jBe{constructor(e=BBe,n=zBe){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=n,this.caches=[];for(let i=0;i<this.maxKeyLength;i++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,n,i){const r=this.caches[i-1];e:for(const a of r){const s=a.bytes;for(let o=0;o<i;o++)if(s[o]!==e[n+o])continue e;return a.str}return null}store(e,n){const i=this.caches[e.length-1],r={bytes:e,str:n};i.length>=this.maxLengthPerKey?i[Math.random()*i.length|0]=r:i.push(r)}decode(e,n,i){const r=this.find(e,n,i);if(r!=null)return this.hit++,r;this.miss++;const a=lne(e,n,i),s=Uint8Array.prototype.slice.call(e,n,n+i);return this.store(s,a),a}}const lN="array",b1="map_key",une="map_value",HBe=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new dl("The type of key must be string or number but "+typeof t)};class VBe{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const n=this.getUninitializedStateFromPool();n.type=lN,n.position=0,n.size=e,n.array=new Array(e)}pushMapState(e){const n=this.getUninitializedStateFromPool();n.type=b1,n.readCount=0,n.size=e,n.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===lN){const i=e;i.size=0,i.array=void 0,i.position=0,i.type=void 0}if(e.type===b1||e.type===une){const i=e;i.size=0,i.map=void 0,i.readCount=0,i.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const gx=-1,M4=new DataView(new ArrayBuffer(0)),GBe=new Uint8Array(M4.buffer);try{M4.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const XG=new RangeError("Insufficient data"),WBe=new jBe;class ZC{constructor(e){this.totalPos=0,this.pos=0,this.view=M4,this.bytes=GBe,this.headByte=gx,this.stack=new VBe,this.entered=!1,this.extensionCodec=e?.extensionCodec??oN.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??mx,this.maxBinLength=e?.maxBinLength??mx,this.maxArrayLength=e?.maxArrayLength??mx,this.maxMapLength=e?.maxMapLength??mx,this.maxExtLength=e?.maxExtLength??mx,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:WBe,this.mapKeyConverter=e?.mapKeyConverter??HBe}clone(){return new ZC({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=gx,this.stack.reset()}setBuffer(e){const n=qG(e);this.bytes=n,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===gx&&!this.hasRemaining(1))this.setBuffer(e);else{const n=this.bytes.subarray(this.pos),i=qG(e),r=new Uint8Array(n.length+i.length);r.set(n),r.set(i,n.length),this.setBuffer(r)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:n,pos:i}=this;return new RangeError(`Extra ${n.byteLength-i} of ${n.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let n=!1,i;for await(const o of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);try{i=this.doDecodeSync(),n=!0}catch(l){if(!(l instanceof RangeError))throw l}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return i}const{headByte:r,pos:a,totalPos:s}=this;throw new RangeError(`Insufficient data in parsing ${w8(r)} at ${s} (${a} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,n){if(this.entered){yield*this.clone().decodeMultiAsync(e,n);return}try{this.entered=!0;let i=n,r=-1;for await(const a of e){if(n&&r===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(a),i&&(r=this.readArraySize(),i=!1,this.complete());try{for(;yield this.doDecodeSync(),--r!==0;);}catch(s){if(!(s instanceof RangeError))throw s}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let n;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){const r=e-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e<160){const r=e-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{const r=e-160;n=this.decodeString(r,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){const r=this.lookU8();n=this.decodeString(r,1)}else if(e===218){const r=this.lookU16();n=this.decodeString(r,2)}else if(e===219){const r=this.lookU32();n=this.decodeString(r,4)}else if(e===220){const r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===221){const r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===222){const r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===223){const r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===196){const r=this.lookU8();n=this.decodeBinary(r,1)}else if(e===197){const r=this.lookU16();n=this.decodeBinary(r,2)}else if(e===198){const r=this.lookU32();n=this.decodeBinary(r,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){const r=this.lookU8();n=this.decodeExtension(r,1)}else if(e===200){const r=this.lookU16();n=this.decodeExtension(r,2)}else if(e===201){const r=this.lookU32();n=this.decodeExtension(r,4)}else throw new dl(`Unrecognized type byte: ${w8(e)}`);this.complete();const i=this.stack;for(;i.length>0;){const r=i.top();if(r.type===lN)if(r.array[r.position]=n,r.position++,r.position===r.size)n=r.array,i.release(r);else continue e;else if(r.type===b1){if(n==="__proto__")throw new dl("The key __proto__ is not allowed");r.key=this.mapKeyConverter(n),r.type=une;continue e}else if(r.map[r.key]=n,r.readCount++,r.readCount===r.size)n=r.map,i.release(r);else{r.key=null,r.type=b1;continue e}}return n}}readHeadByte(){return this.headByte===gx&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=gx}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new dl(`Unrecognized array type byte: ${w8(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new dl(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new dl(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)}decodeUtf8String(e,n){if(e>this.maxStrLength)throw new dl(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+n+e)throw XG;const i=this.pos+n;let r;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?r=this.keyDecoder.decode(this.bytes,i,e):r=TBe(this.bytes,i,e),this.pos+=n+e,r}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===b1:!1}decodeBinary(e,n){if(e>this.maxBinLength)throw new dl(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+n))throw XG;const i=this.pos+n,r=this.bytes.subarray(i,i+e);return this.pos+=n+e,r}decodeExtension(e,n){if(e>this.maxExtLength)throw new dl(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const i=this.view.getInt8(this.pos+n),r=this.decodeBinary(e,n+1);return this.extensionCodec.decode(r,i,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=CBe(this.view,this.pos);return this.pos+=8,e}readI64(){const e=cne(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function qBe(t,e){return new ZC(e).decode(t)}function XBe(t){return t[Symbol.asyncIterator]!=null}async function*KBe(t){const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)return;yield i}}finally{e.releaseLock()}}function YBe(t){return XBe(t)?t:KBe(t)}async function JBe(t,e){const n=YBe(t);return new ZC(e).decodeAsync(n)}var KG={},$Be=function(t,e,n,i,r){var a=new Worker(KG[e]||(KG[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(s){var o=s.data,l=o.$e$;if(l){var c=new Error(l[0]);c.code=l[1],c.stack=l[2],r(c,null)}else r(null,o)},a.postMessage(n,i),a},wo=Uint8Array,mm=Uint16Array,fne=Int32Array,T4=new wo([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]),A4=new wo([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]),hne=new wo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),dne=function(t,e){for(var n=new mm(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];for(var r=new fne(n[30]),i=1;i<30;++i)for(var a=n[i];a<n[i+1];++a)r[a]=a-n[i]<<5|i;return{b:n,r}},pne=dne(T4,2),C4=pne.b,ZBe=pne.r;C4[28]=258,ZBe[258]=28;var QBe=dne(A4,0),mne=QBe.b,OT=new mm(32768);for(var zr=0;zr<32768;++zr){var ed=(zr&43690)>>1|(zr&21845)<<1;ed=(ed&52428)>>2|(ed&13107)<<2,ed=(ed&61680)>>4|(ed&3855)<<4,OT[zr]=((ed&65280)>>8|(ed&255)<<8)>>1}var k0=function(t,e,n){for(var i=t.length,r=0,a=new mm(e);r<i;++r)t[r]&&++a[t[r]-1];var s=new mm(e);for(r=1;r<e;++r)s[r]=s[r-1]+a[r-1]<<1;var o;if(n){o=new mm(1<<e);var l=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],f=s[t[r]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)o[OT[f]>>l]=c}else for(o=new mm(i),r=0;r<i;++r)t[r]&&(o[r]=OT[s[t[r]-1]++]>>15-t[r]);return o},lS=new wo(288);for(var zr=0;zr<144;++zr)lS[zr]=8;for(var zr=144;zr<256;++zr)lS[zr]=9;for(var zr=256;zr<280;++zr)lS[zr]=7;for(var zr=280;zr<288;++zr)lS[zr]=8;var gne=new wo(32);for(var zr=0;zr<32;++zr)gne[zr]=5;var bne=k0(lS,9,1),vne=k0(gne,5,1),MM=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},$l=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(e&7)&n},TM=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},yne=function(t){return(t+7)/8|0},xne=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new wo(t.subarray(e,n))},_ne=["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"],Za=function(t,e,n){var i=new Error(e||_ne[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,Za),!n)throw i;return i},QC=function(t,e,n,i){var r=t.length,a=i?i.length:0;if(!r||e.f&&!e.l)return n||new wo(0);var s=!n,o=s||e.i!=2,l=e.i;s&&(n=new wo(r*3));var c=function(Ue){var ze=n.length;if(Ue>ze){var pe=new wo(Math.max(ze*2,Ue));pe.set(n),n=pe}},u=e.f||0,f=e.p||0,h=e.b||0,d=e.l,g=e.d,b=e.m,y=e.n,p=r*8;do{if(!d){u=$l(t,f,1);var x=$l(t,f+1,3);if(f+=3,x)if(x==1)d=bne,g=vne,b=9,y=5;else if(x==2){var S=$l(t,f,31)+257,A=$l(t,f+10,15)+4,C=S+$l(t,f+5,31)+1;f+=14;for(var D=new wo(C),R=new wo(19),N=0;N<A;++N)R[hne[N]]=$l(t,f+N*3,7);f+=A*3;for(var U=MM(R),j=(1<<U)-1,z=k0(R,U,1),N=0;N<C;){var q=z[$l(t,f,j)];f+=q&15;var _=q>>4;if(_<16)D[N++]=_;else{var B=0,G=0;for(_==16?(G=3+$l(t,f,3),f+=2,B=D[N-1]):_==17?(G=3+$l(t,f,7),f+=3):_==18&&(G=11+$l(t,f,127),f+=7);G--;)D[N++]=B}}var H=D.subarray(0,S),W=D.subarray(S);b=MM(H),y=MM(W),d=k0(H,b,1),g=k0(W,y,1)}else Za(1);else{var _=yne(f)+4,w=t[_-4]|t[_-3]<<8,M=_+w;if(M>r){l&&Za(0);break}o&&c(h+w),n.set(t.subarray(_,M),h),e.b=h+=w,e.p=f=M*8,e.f=u;continue}if(f>p){l&&Za(0);break}}o&&c(h+131072);for(var F=(1<<b)-1,Y=(1<<y)-1,Z=f;;Z=f){var B=d[TM(t,f)&F],V=B>>4;if(f+=B&15,f>p){l&&Za(0);break}if(B||Za(2),V<256)n[h++]=V;else if(V==256){Z=f,d=null;break}else{var de=V-254;if(V>264){var N=V-257,se=T4[N];de=$l(t,f,(1<<se)-1)+C4[N],f+=se}var oe=g[TM(t,f)&Y],ue=oe>>4;oe||Za(3),f+=oe&15;var W=mne[ue];if(ue>3){var se=A4[ue];W+=TM(t,f)&(1<<se)-1,f+=se}if(f>p){l&&Za(0);break}o&&c(h+131072);var _e=h+de;if(h<W){var ke=a-W,Ne=Math.min(W,_e);for(ke+h<0&&Za(3);h<Ne;++h)n[h]=i[ke+h]}for(;h<_e;++h)n[h]=n[h-W]}}e.l=d,e.p=Z,e.b=h,e.f=u,d&&(u=1,e.m=b,e.d=g,e.n=y)}while(!u);return h!=n.length&&s?xne(n,0,h):n.subarray(0,h)},eze=new wo(0),tze=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},YG=function(t,e,n){for(var i=t(),r=t.toString(),a=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<i.length;++s){var o=i[s],l=a[s];if(typeof o=="function"){e+=";"+l+"=";var c=o.toString();if(o.prototype)if(c.indexOf("[native code]")!=-1){var u=c.indexOf(" ",8)+1;e+=c.slice(u,c.indexOf("(",u))}else{e+=c;for(var f in o.prototype)e+=";"+l+".prototype."+f+"="+o.prototype[f].toString()}else e+=c}else n[l]=o}return e},GE=[],nze=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},ize=function(t,e,n,i){if(!GE[n]){for(var r="",a={},s=t.length-1,o=0;o<s;++o)r=YG(t[o],r,a);GE[n]={c:YG(t[s],r,a),e:a}}var l=tze({},GE[n].e);return $Be(GE[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,l,nze(l),i)},R4=function(){return[wo,mm,fne,T4,A4,hne,C4,mne,bne,vne,OT,_ne,k0,MM,$l,TM,yne,xne,Za,QC,Mne,eR,k4]},rze=function(){return[Sne,wne]},aze=function(){return[Ene]},eR=function(t){return postMessage(t,[t.buffer])},k4=function(t){return t&&{out:t.size&&new wo(t.size),dictionary:t.dictionary}},D4=function(t,e,n,i,r,a){var s=ize(n,i,r,function(o,l){s.terminate(),a(o,l)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},Sne=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&Za(6,"invalid gzip data");var e=t[3],n=10;e&4&&(n+=(t[10]|t[11]<<8)+2);for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[n++]);return n+(e&2)},wne=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Ene=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&Za(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&Za(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2};function sze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Za(7),D4(t,e,[R4],function(i){return eR(Mne(i.data[0],k4(i.data[1])))},1,n)}function Mne(t,e){return QC(t,{i:2},e&&e.out,e&&e.dictionary)}function oze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Za(7),D4(t,e,[R4,rze,function(){return[JG]}],function(i){return eR(JG(i.data[0],i.data[1]))},3,n)}function JG(t,e){var n=Sne(t);return n+8>t.length&&Za(6,"invalid gzip data"),QC(t.subarray(n,-8),{i:2},e&&e.out||new wo(wne(t)),e&&e.dictionary)}function lze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Za(7),D4(t,e,[R4,aze,function(){return[$G]}],function(i){return eR($G(i.data[0],k4(i.data[1])))},5,n)}function $G(t,e){return QC(t.subarray(Ene(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function cze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Za(7),t[0]==31&&t[1]==139&&t[2]==8?oze(t,e,n):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?sze(t,e,n):lze(t,e,n)}var uze=typeof TextDecoder<"u"&&new TextDecoder,fze=0;try{uze.decode(eze,{stream:!0}),fze=1}catch{}async function hze(t,e){const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch the file: ${n.statusText}`);return new Promise(i=>{const r=parseInt(n.headers.get("Content-Length"));if(typeof DecompressionStream>"u")console.log("DecompressionStream is unavailable. Using fallback."),e({downloaded:.1*r,total:r}),n.arrayBuffer().then(a=>{e({downloaded:.8*r,total:r}),cze(new Uint8Array(a),(s,o)=>{e({downloaded:1*r,total:r}),i(qBe(o))})});else{let a=0;const s=new TransformStream({transform(o,l){a+=o.length,e({downloaded:a,total:r}),l.enqueue(o)}});JBe(n.body.pipeThrough(s).pipeThrough(new DecompressionStream("gzip"))).then(o=>i(o))}})}function dze({fileUrl:t}){const e=I.useContext(bi),n=e.mutable.current,i=e.useGui(_=>_.theme.dark_mode),[r,a]=I.useState({downloaded:0,total:0}),[s,o]=I.useState("1x"),[l,c]=I.useState(!1),[u,f]=I.useState(null);function h(){const _=e.useSceneTree.getState();Object.keys(_).forEach(w=>{if(w==="")return;const M=_[w],S=M?.message;S!==void 0&&(S.type!=="FrameMessage"||S.props.show_axes)?e.sceneTreeActions.updateNodeAttributes(w,{visibility:!1,wxyz:[1,0,0,0],position:[0,0,0]}):M!==void 0&&e.sceneTreeActions.updateNodeAttributes(w,{wxyz:[1,0,0,0],position:[0,0,0]})})}const[d,g]=I.useState(0),b=va();I.useEffect(()=>{hze(t,a).then(_=>{console.log("File loaded! Saved with Viser version:",_.viserVersion),f(_)})},[]);const y=I.useRef({currentTime:0,currentIndex:0}),p=I.useCallback(()=>{if(u===null)return;const _=y.current;for(_.currentIndex==0&&h();_.currentIndex<u.messages.length&&u.messages[_.currentIndex][0]<=_.currentTime;_.currentIndex++){const w=u.messages[_.currentIndex][1];n.messageQueue.push(w)}_.currentTime>=u.durationSeconds&&(_.currentIndex=0,_.currentTime=u.messages[0][0]),g(_.currentTime)},[u]);I.useEffect(()=>{const _=parseFloat(s);if(u!==null&&!l){let w=Date.now();const M=setInterval(()=>{const S=Date.now();y.current.currentTime+=(S-w)/1e3*_,w=S,p(),y.current.currentIndex===u.messages.length&&u.durationSeconds===0&&clearInterval(M)},1e3/120);return()=>clearInterval(M)}},[p,u,l,s,n.messageQueue,g]),I.useEffect(()=>{function _(w){w.code==="Space"&&c(!l)}return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[l]);const x=I.useCallback(_=>{_<y.current.currentTime&&(h(),y.current.currentIndex=0),y.current.currentTime=_,g(_),c(!0),p()},[u]);return u===null?k.jsx("div",{style:{position:"fixed",zIndex:1,top:0,bottom:0,left:0,right:0,backgroundColor:i?b.colors.dark[9]:"#fff"},children:k.jsx(af,{value:r.downloaded/r.total*100,radius:0,transitionDuration:0})}):k.jsxs(Ns,{radius:"xs",shadow:"0.1em 0 1em 0 rgba(0,0,0,0.1)",style:{position:"fixed",bottom:"1em",left:"50%",transform:"translateX(-50%)",width:"25em",maxWidth:"95%",zIndex:1,padding:"0.5em",display:u.durationSeconds===0?"none":"flex",alignItems:"center",justifyContent:"space-between",gap:"0.375em"},children:[k.jsx(Dl,{size:"md",variant:"subtle",onClick:()=>c(!l),children:l?k.jsx(KAe,{height:"1.125em",width:"1.125em"}):k.jsx(qAe,{height:"1.125em",width:"1.125em"})}),k.jsx(ag,{size:"xs",hideControls:!0,value:d.toFixed(1),step:.01,styles:{wrapper:{width:"3.1em"},input:{padding:"0.2em",fontFamily:b.fontFamilyMonospace,textAlign:"center"}},onChange:_=>x(typeof _=="number"?_:parseFloat(_))}),k.jsx(OA,{thumbSize:0,radius:"xs",step:1e-4,style:{flexGrow:1},min:0,max:u.durationSeconds,value:d,onChange:x,styles:{thumb:{display:"none"}}}),k.jsx(Or,{zIndex:10,label:"Playback speed",withinPortal:!0,children:k.jsx(Pv,{size:"xs",value:s,onChange:_=>_===null?null:o(_),radius:"xs",data:["0.5x","1x","2x","4x","8x"],styles:{wrapper:{width:"3.25em"}},comboboxProps:{zIndex:5,width:"5.25em"}})})]})}function pze(){return I.useEffect(()=>{const t=rne();if(t===null||t.version===null)console.log("Failed to detect browser"),ks.show({title:"Could not detect browser version",message:"Your browser version could not be detected. It may not be supported.",autoClose:!1,color:"red"});else{const e=parseFloat(t.version);console.log(`Detected ${t.name} version ${e}`),(t.name==="chrome"&&e<91||t.name==="edge"&&e<91||t.name==="firefox"&&e<89||t.name==="opera"&&e<77||t.name==="safari"&&e<16.4)&&ks.show({title:"Unsuppported browser",message:`Your browser (${t.name.slice(0,1).toUpperCase()+t.name.slice(1)}/${t.version}) is outdated, which may cause problems. Consider updating.`,autoClose:!1,color:"red"})}}),null}function ZG({children:t,title:e,width:n,height:i,fill:r=!1}){return k.jsxs("div",{style:{width:r?"100vw":`${n}px`,height:r?"100vh":`${i}px`,borderRadius:"10px",overflow:"hidden",border:"1px solid rgba(0,0,0,0.2)",backgroundColor:"white",transform:"translateX(-50%) translateY(-50%)",top:"50%",left:"50%",position:"absolute"},children:[k.jsxs("div",{style:{height:"36px",backgroundColor:"#f6f6f6",borderBottom:"1px solid rgba(0,0,0,0.075)",display:"flex",alignItems:"center",paddingLeft:"12px",gap:"8px"},children:[k.jsx("div",{style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:"#ff5f57"}}),k.jsx("div",{style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:"#febc2e"}}),k.jsx("div",{style:{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:"#28c840"}}),k.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",color:"#000",opacity:.4,fontSize:"14px",fontFamily:"-apple-system, BlinkMacSystemFont, sans-serif",fontWeight:500},children:e})]}),k.jsx("div",{style:{height:"calc(100% - 36px)"},children:t})]})}const mze="1.0.20",QG=[{login:"brentyi",html_url:"https://github.com/brentyi"},{login:"kerrj",html_url:"https://github.com/kerrj"},{login:"chungmin99",html_url:"https://github.com/chungmin99"},{login:"tancik",html_url:"https://github.com/tancik"},{login:"jonahbedouch",html_url:"https://github.com/jonahbedouch"},{login:"hangg7",html_url:"https://github.com/hangg7"},{login:"BrianSantoso",html_url:"https://github.com/BrianSantoso"},{login:"origamiman72",html_url:"https://github.com/origamiman72"},{login:"ginazhouhuiwu",html_url:"https://github.com/ginazhouhuiwu"},{login:"sea-bass",html_url:"https://github.com/sea-bass"},{login:"jkulhanek",html_url:"https://github.com/jkulhanek"},{login:"ethanweber",html_url:"https://github.com/ethanweber"},{login:"zerolover",html_url:"https://github.com/zerolover"},{login:"beckyfeng08",html_url:"https://github.com/beckyfeng08"},{login:"vye16",html_url:"https://github.com/vye16"},{login:"AdamRashid96",html_url:"https://github.com/AdamRashid96"},{login:"slecleach",html_url:"https://github.com/slecleach"},{login:"pritzza",html_url:"https://github.com/pritzza"},{login:"yzslab",html_url:"https://github.com/yzslab"},{login:"kikislater",html_url:"https://github.com/kikislater"},{login:"simonbethke",html_url:"https://github.com/simonbethke"},{login:"swnakamura",html_url:"https://github.com/swnakamura"},{login:"rowoflo",html_url:"https://github.com/rowoflo"},{login:"MosesEbere",html_url:"https://github.com/MosesEbere"},{login:"nlml",html_url:"https://github.com/nlml"},{login:"kdexd",html_url:"https://github.com/kdexd"},{login:"ojh6404",html_url:"https://github.com/ojh6404"},{login:"hongsukchoi",html_url:"https://github.com/hongsukchoi"},{login:"mcallisterdavid",html_url:"https://github.com/mcallisterdavid"},{login:"david-dorf",html_url:"https://github.com/david-dorf"},{login:"cvachha",html_url:"https://github.com/cvachha"},{login:"ArthurAllshire",html_url:"https://github.com/ArthurAllshire"},{login:"escontra",html_url:"https://github.com/escontra"},{login:"alberthli",html_url:"https://github.com/alberthli"},{login:"atonderski",html_url:"https://github.com/atonderski"}],gze=({children:t})=>{const e=Ee.useContext(bi),[n,i]=Ee.useState(null),r=Ee.useRef(new Map),a=Ee.useRef(new Map),s=Ee.useRef(new Set),[o,l]=Ee.useState(new Set),c=Ee.useRef(new Map),u=Ee.useRef(new Set),f=Ee.useRef(0),h=Ee.useMemo(()=>new Vn,[]),d=Ee.useMemo(()=>new Vn,[]),g=Ee.useMemo(()=>new Kd,[]),b=Ee.useMemo(()=>new Ot,[]),y=Ee.useMemo(()=>new te,[]),p=Ee.useMemo(()=>new te,[]),x=Ee.useMemo(()=>new te,[]),_=Ee.useMemo(()=>new Ol(1,1),[]);Ee.useEffect(()=>{const N=new bl;return i(N),()=>{r.current.forEach(U=>{N.remove(U),U.dispose()})}},[]);const w=Ee.useCallback((N,U,j,z,q,B,G,H)=>{if(!n)return;let W=r.current.get(j);W||(W=new CU,W.renderOrder=1e4,r.current.set(j,W),n.add(W)),W.add(N),u.current.add(W);const F=U.split("/").slice(0,-1).join("/"),Y=`bg-${j}-${f.current++}`;c.current.set(Y,Ee.createRef()),l(V=>new Set([...V,Y]));const Z=_I(z,q,B);a.current.set(N,{nodeName:U,parentName:F,depthTest:j,batchedText:W,backgroundInstanceId:Y,backgroundDepthTest:j,fontSizeMode:z,fontScreenScale:q,fontSceneHeight:B,baseFontSize:Z,anchorX:G,anchorY:H})},[n]),M=Ee.useCallback(N=>{const U=a.current.get(N);U&&(U.batchedText.remove(N),u.current.add(U.batchedText),c.current.delete(U.backgroundInstanceId),l(j=>{const z=new Set(j);return z.delete(U.backgroundInstanceId),z}),a.current.delete(N))},[]),S=Ee.useCallback(()=>{r.current.forEach(N=>{u.current.add(N)})},[]),A=Ee.useCallback(N=>{const U=a.current.get(N);U&&u.current.add(U.batchedText)},[]),C=Ee.useCallback((N,U,j,z,q,B,G)=>{const H=a.current.get(N);if(!H)return;if(H.depthTest!==U){const F=H.nodeName;M(N),w(N,F,U,j,z,q,B,G);return}const W=_I(j,z,q);H.fontSizeMode=j,H.fontScreenScale=z,H.fontSceneHeight=q,H.baseFontSize=W,H.anchorX=B,H.anchorY=G,N.anchorX=B,N.anchorY=G,u.current.add(H.batchedText)},[w,M]),D=Ee.useMemo(()=>({registerText:w,unregisterText:M,updateText:C,syncBatchedText:S,syncText:A}),[w,M,C,S,A]);ra(({camera:N})=>{n&&(u.current.forEach(U=>{U.sync()}),u.current.clear(),b.multiplyMatrices(N.projectionMatrix,N.matrixWorldInverse),g.setFromProjectionMatrix(b),sTe(n,N,h,d),r.current.forEach((U,j)=>{s.current.has(U)||aTe(U,j)&&s.current.add(U)}),a.current.forEach((U,j)=>{try{const z=e.mutable.current.nodeRefFromName[U.parentName],q=e.useSceneTree.getState()[U.nodeName];if(z&&q){const B=j.position;B.set(...q.position??[0,0,0]),B.applyMatrix4(z.matrixWorld);const G=q.effectiveVisibility??!1;G?j.fillOpacity=1:j.fillOpacity=0;let H=O6,W=I6;if(U.fontSizeMode==="screen"){p.copy(j.position),p.applyMatrix4(n.matrixWorld);const Y=oTe(N,p,x);j.fontSize=U.baseFontSize*Y,H=O6*Y*U.fontScreenScale,W=I6*Y*U.fontScreenScale}else j.fontSize=U.baseFontSize;const F=c.current.get(U.backgroundInstanceId);if(F?.current){const Y=F.current;if(G&&j.textRenderInfo){const Z=j.textRenderInfo.blockBounds,V=j.textRenderInfo.visibleBounds;if(Z&&V){const[de,se,oe,ue]=Z,[_e,ke,Ne,Ue]=V,ze=Ne-_e,pe=Ue-ke,Fe=ze+H,Ie=pe+W,qe=_e-H/2,we=Ne+H/2,Te=ke-W/2,Ae=Ue+W/2;let Pe=0;U.anchorX==="left"?Pe=de:U.anchorX==="right"?Pe=oe:Pe=(de+oe)/2;let He=0;U.anchorY==="top"?He=ue:U.anchorY==="bottom"?He=se:He=(se+ue)/2;const $e=(qe+we)/2,ie=(Te+Ae)/2,K=$e-Pe,ce=ie-He;y.set(K,ce,0),y.applyQuaternion(d),Y.position.copy(j.position),Y.position.add(y),Y.scale.set(Fe,Ie,1),Y.quaternion.copy(d)}}else Y.scale.set(0,0,0)}}else{j.fillOpacity=0;const B=c.current.get(U.backgroundInstanceId);B?.current&&B.current.scale.set(0,0,0)}j.quaternion.copy(d)}catch(z){console.error("[BatchedLabelManager] Error updating text:",z)}}))});const R=Ee.useMemo(()=>{const N=new Map;return N.set(!0,[]),N.set(!1,[]),o.forEach(U=>{const j=U.startsWith("bg-true"),z=N.get(j);z&&z.push(U)}),N},[o]);return k.jsxs(nQ.Provider,{value:D,children:[n&&k.jsx("primitive",{object:n}),k.jsxs(lT,{frustumCulled:!1,children:[k.jsx("primitive",{object:_,attach:"geometry"}),k.jsx("meshBasicMaterial",{color:k6,transparent:!0,opacity:D6,depthTest:!0,depthWrite:!1,toneMapped:!1}),R.get(!0)?.map(N=>{const U=c.current.get(N);return k.jsx(sc,{ref:U,renderOrder:1e4},N)})]}),k.jsxs(lT,{frustumCulled:!1,renderOrder:9999,children:[k.jsx("primitive",{object:_,attach:"geometry"}),k.jsx("meshBasicMaterial",{color:k6,transparent:!0,opacity:D6,depthTest:!1,depthWrite:!1,toneMapped:!1}),R.get(!1)?.map(N=>{const U=c.current.get(N);return k.jsx(sc,{ref:U},N)})]}),t]})};function cN(t,e){const n=new wt;return n.x=2*((e[0]+.5)/t.mutable.current.canvas.clientWidth)-1,n.y=1-2*((e[1]+.5)/t.mutable.current.canvas.clientHeight),n.x<1&&n.x>-1&&n.y<1&&n.y>-1?n:null}function uN(t,e){const n=new wt;return n.x=(e[0]+.5)/t.mutable.current.canvas.clientWidth,n.y=(e[1]+.5)/t.mutable.current.canvas.clientHeight,n}const bze=()=>{let t=window.location.href;return t=t.replace("http://","ws://"),t=t.replace("https://","wss://"),t=t.split("?")[0],t.endsWith("/")&&(t=t.slice(0,-1)),t},vze=()=>ra(()=>null,1e3);function yze(){const t=new URLSearchParams(window.location.search),e=t.get("dummyWindowDimensions"),n=t.get("dummyWindowTitle")??"localhost:8080",i=k.jsx("div",{style:{width:"100%",height:"100%",position:"relative",display:"flex",flexDirection:"column"},children:k.jsx(xze,{})});if(!e)return i;if(e==="fill")return k.jsx(ZG,{title:n,width:window.innerWidth,height:window.innerHeight,fill:!0,children:i});const[r,a]=e.split("x").map(Number);return isNaN(r)||isNaN(a)?i:k.jsx(ZG,{title:n,width:r,height:a,children:i})}function xze(){const t=new URLSearchParams(window.location.search).getAll(EM),e=t.length>=1?t[0]:bze(),n=new URLSearchParams(window.location.search),i=n.get("playbackPath"),r=n.get("darkMode")!==null,a=i===null?"websocket":"file_playback",s={},o=Ee.useRef({sendMessage:i==null?h=>console.log(`Tried to send ${h.type} but websocket is not connected!`):()=>null,sendCamera:null,resetCameraView:null,canvas:null,canvas2d:null,scene:null,camera:null,backgroundMaterial:null,cameraControl:null,nodeRefFromName:s,messageQueue:[],getRenderRequestState:"ready",getRenderRequest:null,scenePointerInfo:{enabled:!1,keyboard:null,dragStart:[0,0],dragEnd:[0,0],isDragging:!1,isKeyDown:!1},skinnedMeshState:{},hoveredElementsCount:0}),l=fBe(o.current.nodeRefFromName),c=hBe(),u=dBe(),f={messageSource:a,useSceneTree:l.store,sceneTreeActions:l.actions,useEnvironment:c,useGui:BFe(e),useDevSettings:u,mutable:o};return r&&(f.useGui.getState().theme.dark_mode=r),k.jsx(bi.Provider,{value:f,children:k.jsxs(_ze,{children:[a==="websocket"&&k.jsx(nBe,{}),a==="file_playback"&&k.jsx(dze,{fileUrl:i})]})})}function _ze({children:t}){const e=Ee.useContext(bi),n=e.useGui(u=>u.theme.dark_mode),i=e.useGui(u=>u.theme.colors),r=e.useGui(u=>u.theme.control_layout),a=e.useGui(u=>u.theme.show_logo),s=e.useDevSettings(u=>u.showStats),{messageSource:o}=e,l=I.useMemo(()=>({...one,...i===null?{}:{colors:{custom:i},primaryColor:"custom"}}),[i]),c=I.useMemo(()=>k.jsxs(k.Fragment,{children:[k.jsx(Rze,{}),k.jsx(Eze,{children:k.jsx(_Be,{})})]}),[]);return k.jsx(k.Fragment,{children:k.jsxs(RX,{theme:l,defaultColorScheme:n?"dark":"light",colorSchemeManager:{get:u=>u,set:()=>null,subscribe:()=>null,unsubscribe:()=>null,clear:()=>null},children:[t,k.jsx(Sze,{darkMode:n}),k.jsx(wze,{}),k.jsx(pze,{}),k.jsx(lBe,{}),k.jsxs(ut,{style:{width:"100%",height:"100%",display:"flex",position:"relative",flexDirection:"column"},children:[k.jsx(oBe,{}),k.jsxs(ut,{style:{width:"100%",position:"relative",flexGrow:1,overflow:"hidden",display:"flex"},children:[k.jsxs(ut,{style:u=>({backgroundColor:n?u.colors.dark[9]:"#fff",flexGrow:1,overflow:"hidden",height:"100%"}),children:[c,a&&o==="websocket"&&k.jsx(Oze,{})]}),o==="websocket"&&k.jsx(aFe,{control_layout:r})]})]}),s&&k.jsx(p2e,{className:"stats-panel"})]})})}function Sze(t){const e=ig();return I.useEffect(()=>{e.setColorScheme(t.darkMode?"dark":"light")},[t.darkMode]),null}function wze(){return k.jsx(Sh,{position:"top-left",limit:10,containerWidth:"20em",withinPortal:!1,styles:{root:{boxShadow:"0.1em 0 1em 0 rgba(0,0,0,0.1) !important",position:"absolute",top:"1em",left:"1em",pointerEvents:"none"},notification:{pointerEvents:"all"}}})}function Eze({children:t}){const e=Ee.useContext(bi),n=EC(20).send,i=va(),{ref:r,inView:a}=_oe(),s=I.useMemo(()=>k.jsx(nTe,{}),[]);I.useEffect(()=>(document.addEventListener("keydown",o),document.addEventListener("keyup",l),()=>{document.removeEventListener("keydown",o),document.removeEventListener("keyup",l)}),[]);const o=b=>{const{mutable:y}=e,p=y.current.scenePointerInfo;p.enabled!==!1&&(p.keyboard==="ctrl"&&b.ctrlKey||p.keyboard==="shift"&&b.shiftKey||p.keyboard==="alt"&&b.altKey||p.keyboard==="meta"&&b.metaKey)&&(p.isKeyDown=!0,y.current.canvas.style.cursor="pointer")},l=b=>{const{mutable:y}=e,p=y.current.scenePointerInfo;p.enabled!==!1&&p.isKeyDown&&(p.isKeyDown=!1,y.current.canvas.style.cursor="auto")},c=b=>{const{mutable:y}=e;y.current.scenePointerInfo.keyboard==="ctrl"&&b.ctrlKey&&(b.preventDefault(),b.stopPropagation())},u=b=>{const{mutable:y}=e,p=y.current.scenePointerInfo;if(p.enabled===!1||p.keyboard&&!p.isKeyDown)return;const x=y.current.canvas.getBoundingClientRect();if(p.dragStart=[b.clientX-x.left,b.clientY-x.top],p.dragEnd=p.dragStart,cN(e,p.dragEnd)===null||p.isDragging)return;p.isDragging=!0,y.current.cameraControl.enabled=!1;const _=y.current.canvas2d.getContext("2d");_.clearRect(0,0,_.canvas.width,_.canvas.height)},f=b=>{const{mutable:y}=e,p=y.current.scenePointerInfo;if(p.enabled===!1||!p.isDragging)return;const x=y.current.canvas.getBoundingClientRect(),_=[b.clientX-x.left,b.clientY-x.top];if(cN(e,_)!==null&&(p.dragEnd=_,!(Math.abs(p.dragEnd[0]-p.dragStart[0])<=3&&Math.abs(p.dragEnd[1]-p.dragStart[1])<=3)&&p.enabled==="rect-select")){const w=y.current.canvas2d.getContext("2d");w.clearRect(0,0,w.canvas.width,w.canvas.height),w.beginPath(),w.fillStyle=i.primaryColor,w.strokeStyle="blue",w.globalAlpha=.2,w.fillRect(p.dragStart[0],p.dragStart[1],p.dragEnd[0]-p.dragStart[0],p.dragEnd[1]-p.dragStart[1]),w.globalAlpha=1,w.stroke()}},h=()=>{const{mutable:b}=e,y=b.current.scenePointerInfo;if(b.current.cameraControl.enabled=!0,y.enabled===!1||!y.isDragging)return;const p=b.current.canvas2d.getContext("2d");p.clearRect(0,0,p.canvas.width,p.canvas.height),y.enabled==="click"?Mze(e,y.dragEnd,n):y.enabled==="rect-select"&&Tze(e,y,n),y.isDragging=!1},d=e.useDevSettings(b=>b.fixedDpr),g=Ee.useMemo(()=>k.jsxs(k.Fragment,{children:[k.jsx(kze,{}),k.jsx(Dze,{}),s,k.jsxs(TTe,{children:[k.jsx(Cze,{}),t,k.jsx(gze,{children:k.jsx(Rte,{name:""})})]}),k.jsx(Aze,{})]}),[t,s]);return k.jsx("div",{ref:r,style:{position:"relative",zIndex:0,width:"100%",height:"100%"},children:k.jsxs(Uwe,{camera:{position:[-3,3,-3],near:.01,far:1e3},gl:{preserveDrawingBuffer:!0},style:{width:"100%",height:"100%"},ref:b=>e.mutable.current.canvas=b,onPointerDown:u,onPointerMove:f,onPointerUp:h,onContextMenu:c,shadows:!0,dpr:d??void 0,children:[!a&&k.jsx(vze,{}),g]})})}function Mze(t,e,n){const i=new V_,r=cN(t,e);if(r===null)return;i.setFromCamera(r,t.mutable.current.camera);const a=eQ(t,i.ray),s=uN(t,e);n({type:"ScenePointerMessage",event_type:"click",ray_origin:[a.origin.x,a.origin.y,a.origin.z],ray_direction:[a.direction.x,a.direction.y,a.direction.z],screen_pos:[[s.x,s.y]]})}function Tze(t,e,n){const i=uN(t,e.dragStart),r=uN(t,e.dragEnd),a=Math.min(i.x,r.x),s=Math.max(i.x,r.x),o=Math.min(i.y,r.y),l=Math.max(i.y,r.y);n({type:"ScenePointerMessage",event_type:"rect-select",ray_origin:null,ray_direction:null,screen_pos:[[a,o],[s,l]]})}function Aze(){const t=Ee.useContext(bi),e=t.useEnvironment(s=>s.enableDefaultLights),n=t.useEnvironment(s=>s.enableDefaultLightsShadows),i=t.useEnvironment(s=>s.environmentMap),r=t.useSceneTree(s=>s[""]?.wxyz??[1,0,0,0],$_),a=I.useMemo(()=>{if(i.hdri===null)return null;const s={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},o=new Vn(r[1],r[2],r[3],r[0]),l=o.clone().invert(),c=new mi().setFromQuaternion(new Vn(i.background_wxyz[1],i.background_wxyz[2],i.background_wxyz[3],i.background_wxyz[0]).premultiply(o).multiply(l)),u=new mi().setFromQuaternion(new Vn(i.environment_wxyz[1],i.environment_wxyz[2],i.environment_wxyz[3],i.environment_wxyz[0]).premultiply(o).multiply(l));return k.jsx(N2e,{files:`hdri/${s[i.hdri]}`,background:i.background,backgroundBlurriness:i.background_blurriness,backgroundIntensity:i.background_intensity,backgroundRotation:c,environmentIntensity:i.environment_intensity,environmentRotation:u})},[i,r]);return e?k.jsxs(k.Fragment,{children:[k.jsx(XI,{lightIntensity:3,position:[-.2,1,-.2],cascades:3,castShadow:n}),k.jsx(XI,{lightIntensity:.4,position:[0,-1,0],castShadow:!1}),a]}):a}function Cze(){const t=Ee.useContext(bi),e=Ri(i=>i.setDpr);return t.useDevSettings(i=>i.fixedDpr)!==null?null:k.jsx(P2e,{factor:1,step:.2,bounds:i=>{const r=Math.min(i*.75,85);return[Math.max(r*.5,38),r]},onChange:({factor:i,fps:r,refreshrate:a})=>{const s=window.devicePixelRatio*(.2+.8*i);console.log(`[Performance] Setting DPR to ${s}; FPS=${r}/${a}`),e(s)}})}function Rze(){const t=Ee.useContext(bi);return I.useEffect(()=>{const e=t.mutable.current.canvas2d,n=new ResizeObserver(i=>{const{width:r,height:a}=i[0].contentRect;e.width=r,e.height=a});return n.observe(e),()=>n.disconnect()},[]),k.jsx("canvas",{ref:e=>t.mutable.current.canvas2d=e,style:{position:"absolute",zIndex:1,width:"100%",height:"100%",pointerEvents:"none"}})}function kze(){const t=I.useMemo(()=>({vert:`
    varying vec2 vUv;
    void main() {
      vUv = uv;
      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
    }
    `,frag:`
    #include <packing>
    precision highp float;
    precision highp int;

    varying vec2 vUv;
    uniform sampler2D colorMap;
    uniform sampler2D depthMap;
    uniform float cameraNear;
    uniform float cameraFar;
    uniform bool enabled;
    uniform bool hasDepth;

    float readDepth(sampler2D depthMap, vec2 coord) {
      vec4 rgbPacked = texture(depthMap, coord);
      // Important: BGR format, because buffer was encoded using OpenCV.
      float depth = rgbPacked.b * 0.00255 + rgbPacked.g * 0.6528 + rgbPacked.r * 167.1168;
      return depth;
    }

    void main() {
      if (!enabled) {
        discard;
      }
      vec4 color = texture(colorMap, vUv);
      gl_FragColor = vec4(color.rgb, 1.0);

      float bufDepth;
      if(hasDepth){
        float depth = readDepth(depthMap, vUv);
        bufDepth = viewZToPerspectiveDepth(-depth, cameraNear, cameraFar);
      } else {
        bufDepth = 1.0;
      }
      gl_FragDepth = bufDepth;
    }
    `}),[]),e=I.useMemo(()=>new ss({fragmentShader:t.frag,vertexShader:t.vert,uniforms:{enabled:{value:!1},depthMap:{value:null},colorMap:{value:null},cameraNear:{value:null},cameraFar:{value:null},hasDepth:{value:!1}}}),[t]),{mutable:n}=Ee.useContext(bi);n.current.backgroundMaterial=e;const i=Ee.useRef(null);return ra(({camera:r})=>{if(!(r instanceof ta)){console.error("Camera is not a perspective camera, cannot render background image.");return}const a=i.current,s=r.getWorldDirection(new te);a.position.copy(r.position).addScaledVector(s,1),a.quaternion.copy(r.quaternion);const o=r.getFocalLength();a.scale.set(r.getFilmWidth()/o,r.getFilmHeight()/o,1),e.uniforms.cameraNear.value=r.near,e.uniforms.cameraFar.value=r.far}),k.jsx("mesh",{ref:i,material:e,children:k.jsx("planeGeometry",{attach:"geometry",args:[1,1]})})}function Dze(){const{mutable:t}=Ee.useContext(bi);return t.current.scene=Ri(e=>e.scene),t.current.camera=Ri(e=>e.camera),null}function Oze(){const[t,{open:e,close:n}]=_c(!1);return k.jsxs(k.Fragment,{children:[k.jsx(Or,{label:`Viser ${mze}`,children:k.jsx(ut,{style:{position:"absolute",bottom:"1em",left:"1em",cursor:"pointer"},component:"a",onClick:e,title:"About Viser",children:k.jsx(D_,{src:"./logo.svg",style:{width:"2.5em",height:"auto"}})})}),k.jsxs(Co,{opened:t,onClose:n,withCloseButton:!1,size:"xl",style:{textAlign:"center"},trapFocus:!1,children:[k.jsx(ut,{pt:"lg",pb:"xs",children:"Viser is a 3D visualization toolkit developed at UC Berkeley."}),k.jsxs(ut,{pb:"lg",children:[k.jsx(Em,{href:"https://viser.studio/main",target:"_blank",style:{fontWeight:"600"},children:"Documentation"}),"  •  ",k.jsx(Em,{href:"https://github.com/nerfstudio-project/viser",target:"_blank",style:{fontWeight:"600"},children:"GitHub"})]}),k.jsx(rg,{}),k.jsxs(ut,{style:{textAlign:"left",maxHeight:"120px",overflowY:"auto",lineHeight:"1",fontSize:"0.8rem",opacity:"0.75"},px:"md",pt:"sm",children:["Thanks to our contributors!"," ",QG.map((i,r)=>k.jsxs("span",{children:[k.jsx(Em,{href:i.html_url,target:"_blank",style:{textDecoration:"none",fontSize:"0.75rem"},children:i.login}),r<QG.length-1&&", "]},i.login))]})]})]})}IFe();moe.createRoot(document.getElementById("root")).render(k.jsx(yze,{}));
