function QG(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 Fm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function bre(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 e7={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 vre=Symbol.for("react.transitional.element"),yre=Symbol.for("react.fragment");function t7(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:vre,type:t,key:i,ref:e!==void 0?e:null,props:n}}IT.Fragment=yre;IT.jsx=t7;IT.jsxs=t7;e7.exports=IT;var k=e7.exports;const xre=Rc(k),_re=QG({__proto__:null,default:xre},[k]);var n7={exports:{}},NT={},i7={exports:{}},r7={};/**
 * @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(F,V){var H=F.length;F.push(V);e:for(;0<H;){var W=H-1>>>1,B=F[W];if(0<r(B,V))F[W]=V,F[H]=B,H=W;else break e}}function n(F){return F.length===0?null:F[0]}function i(F){if(F.length===0)return null;var V=F[0],H=F.pop();if(H!==V){F[0]=H;e:for(var W=0,B=F.length,J=B>>>1;W<J;){var Z=2*(W+1)-1,G=F[Z],de=Z+1,oe=F[de];if(0>r(G,H))de<B&&0>r(oe,G)?(F[W]=oe,F[de]=H,W=de):(F[W]=G,F[Z]=H,W=Z);else if(de<B&&0>r(oe,H))F[W]=oe,F[de]=H,W=de;else break e}}return V}function r(F,V){var H=F.sortIndex-V.sortIndex;return H!==0?H:F.id-V.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,m=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function w(F){for(var V=n(c);V!==null;){if(V.callback===null)i(c);else if(V.startTime<=F)i(c),V.sortIndex=V.expirationTime,e(l,V);else break;V=n(c)}}function M(F){if(b=!1,w(F),!g)if(n(l)!==null)g=!0,S||(S=!0,U());else{var V=n(c);V!==null&&q(M,V.startTime-F)}}var S=!1,A=-1,C=5,D=-1;function R(){return y?!0:!(t.unstable_now()-D<C)}function L(){if(y=!1,S){var F=t.unstable_now();D=F;var V=!0;try{e:{g=!1,b&&(b=!1,x(A),A=-1),d=!0;var H=h;try{t:{for(w(F),f=n(l);f!==null&&!(f.expirationTime>F&&R());){var W=f.callback;if(typeof W=="function"){f.callback=null,h=f.priorityLevel;var B=W(f.expirationTime<=F);if(F=t.unstable_now(),typeof B=="function"){f.callback=B,w(F),V=!0;break t}f===n(l)&&i(l),w(F)}else i(l);f=n(l)}if(f!==null)V=!0;else{var J=n(c);J!==null&&q(M,J.startTime-F),V=!1}}break e}finally{f=null,h=H,d=!1}V=void 0}}finally{V?U():S=!1}}}var U;if(typeof _=="function")U=function(){_(L)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,z=j.port2;j.port1.onmessage=L,U=function(){z.postMessage(null)}}else U=function(){m(L,0)};function q(F,V){A=m(function(){F(t.unstable_now())},V)}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(F){F.callback=null},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(F){switch(h){case 1:case 2:case 3:var V=3;break;default:V=h}var H=h;h=V;try{return F()}finally{h=H}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(F,V){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var H=h;h=F;try{return V()}finally{h=H}},t.unstable_scheduleCallback=function(F,V,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,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=H+B,F={id:u++,callback:V,priorityLevel:F,startTime:H,expirationTime:B,sortIndex:-1},H>W?(F.sortIndex=H,e(c,F),n(l)===null&&F===n(c)&&(b?(x(A),A=-1):b=!0,q(M,H-W))):(F.sortIndex=B,e(l,F),g||d||(g=!0,S||(S=!0,U()))),F},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(F){var V=h;return function(){var H=h;h=V;try{return F.apply(this,arguments)}finally{h=H}}}})(r7);i7.exports=r7;var Sre=i7.exports,a7={exports:{}},fi={};/**
 * @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"),wre=Symbol.for("react.portal"),Ere=Symbol.for("react.fragment"),Mre=Symbol.for("react.strict_mode"),Tre=Symbol.for("react.profiler"),Are=Symbol.for("react.consumer"),Cre=Symbol.for("react.context"),Rre=Symbol.for("react.forward_ref"),kre=Symbol.for("react.suspense"),Dre=Symbol.for("react.memo"),s7=Symbol.for("react.lazy"),V9=Symbol.iterator;function Ore(t){return t===null||typeof t!="object"?null:(t=V9&&t[V9]||t["@@iterator"],typeof t=="function"?t:null)}var o7={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},l7=Object.assign,c7={};function Sv(t,e,n){this.props=t,this.context=e,this.refs=c7,this.updater=n||o7}Sv.prototype.isReactComponent={};Sv.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")};Sv.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function u7(){}u7.prototype=Sv.prototype;function hN(t,e,n){this.props=t,this.context=e,this.refs=c7,this.updater=n||o7}var dN=hN.prototype=new u7;dN.constructor=hN;l7(dN,Sv.prototype);dN.isPureReactComponent=!0;var G9=Array.isArray,$r={H:null,A:null,T:null,S:null,V:null},f7=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 Ire(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 Nre(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?Nre(""+t.key):e.toString(36)}function q9(){}function Lre(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 Pb(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 wre:s=!0;break;case s7:return s=t._init,Pb(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,"$&/")+"/"),Pb(r,e,n,"",function(c){return c})):r!=null&&(mN(r)&&(r=Ire(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+=Pb(i,e,n,a,r);else if(l=Ore(t),typeof l=="function")for(t=l.call(t),l=0;!(i=t.next()).done;)i=i.value,a=o+JR(i,l++),s+=Pb(i,e,n,a,r);else if(a==="object"){if(typeof t.then=="function")return Pb(Lre(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 Pb(t,i,"","",function(a){return e.call(n,a,r++)}),i}function Pre(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 Ure(){}fi.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}};fi.Component=Sv;fi.Fragment=Ere;fi.Profiler=Tre;fi.PureComponent=hN;fi.StrictMode=Mre;fi.Suspense=kre;fi.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$r;fi.__COMPILER_RUNTIME={__proto__:null,c:function(t){return $r.H.useMemoCache(t)}};fi.cache=function(t){return function(){return t.apply(null,arguments)}};fi.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=l7({},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)!f7.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)};fi.createContext=function(t){return t={$$typeof:Cre,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:Are,_context:t},t};fi.createElement=function(t,e,n){var i,r={},a=null;if(e!=null)for(i in e.key!==void 0&&(a=""+e.key),e)f7.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)};fi.createRef=function(){return{current:null}};fi.forwardRef=function(t){return{$$typeof:Rre,render:t}};fi.isValidElement=mN;fi.lazy=function(t){return{$$typeof:s7,_payload:{_status:-1,_result:t},_init:Pre}};fi.memo=function(t,e){return{$$typeof:Dre,type:t,compare:e===void 0?null:e}};fi.startTransition=function(t){var e=$r.T,n={};$r.T=n;try{var i=t(),r=$r.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(Ure,X9)}catch(a){X9(a)}finally{$r.T=e}};fi.unstable_useCacheRefresh=function(){return $r.H.useCacheRefresh()};fi.use=function(t){return $r.H.use(t)};fi.useActionState=function(t,e,n){return $r.H.useActionState(t,e,n)};fi.useCallback=function(t,e){return $r.H.useCallback(t,e)};fi.useContext=function(t){return $r.H.useContext(t)};fi.useDebugValue=function(){};fi.useDeferredValue=function(t,e){return $r.H.useDeferredValue(t,e)};fi.useEffect=function(t,e,n){var i=$r.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};fi.useId=function(){return $r.H.useId()};fi.useImperativeHandle=function(t,e,n){return $r.H.useImperativeHandle(t,e,n)};fi.useInsertionEffect=function(t,e){return $r.H.useInsertionEffect(t,e)};fi.useLayoutEffect=function(t,e){return $r.H.useLayoutEffect(t,e)};fi.useMemo=function(t,e){return $r.H.useMemo(t,e)};fi.useOptimistic=function(t,e){return $r.H.useOptimistic(t,e)};fi.useReducer=function(t,e,n){return $r.H.useReducer(t,e,n)};fi.useRef=function(t){return $r.H.useRef(t)};fi.useState=function(t){return $r.H.useState(t)};fi.useSyncExternalStore=function(t,e,n){return $r.H.useSyncExternalStore(t,e,n)};fi.useTransition=function(){return $r.H.useTransition()};fi.version="19.1.1";a7.exports=fi;var I=a7.exports;const Ce=Rc(I),h7=QG({__proto__:null,default:Ce},[I]);var d7={exports:{}},Co={};/**
 * @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 Fre=I;function p7(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 Gh(){}var Mo={d:{f:Gh,r:function(){throw Error(p7(522))},D:Gh,C:Gh,L:Gh,m:Gh,X:Gh,S:Gh,M:Gh},p:0,findDOMNode:null},Bre=Symbol.for("react.portal");function zre(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Bre,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Lx=Fre.__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:""}Co.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Mo;Co.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(p7(299));return zre(t,e,null,n)};Co.flushSync=function(t){var e=Lx.T,n=Mo.p;try{if(Lx.T=null,Mo.p=2,t)return t()}finally{Lx.T=e,Mo.p=n,Mo.d.f()}};Co.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Mo.d.C(t,e))};Co.prefetchDNS=function(t){typeof t=="string"&&Mo.d.D(t)};Co.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"?Mo.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):n==="script"&&Mo.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Co.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);Mo.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&&Mo.d.M(t)};Co.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);Mo.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})}};Co.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=LT(e.as,e.crossOrigin);Mo.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 Mo.d.m(t)};Co.requestFormReset=function(t){Mo.d.r(t)};Co.unstable_batchedUpdates=function(t,e){return t(e)};Co.useFormState=function(t,e,n){return Lx.H.useFormState(t,e,n)};Co.useFormStatus=function(){return Lx.H.useHostTransitionStatus()};Co.version="19.1.1";function m7(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(m7)}catch(t){console.error(t)}}m7(),d7.exports=Co;var l_=d7.exports;const vx=Rc(l_);/**
 * @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 za=Sre,g7=I,jre=l_;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 b7(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c_(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 v7(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(c_(t)!==t)throw Error(It(188))}function Hre(t){var e=t.alternate;if(!e){if(e=c_(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 y7(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=y7(t),e!==null)return e;t=t.sibling}return null}var Gr=Object.assign,Vre=Symbol.for("react.element"),US=Symbol.for("react.transitional.element"),yx=Symbol.for("react.portal"),Wb=Symbol.for("react.fragment"),x7=Symbol.for("react.strict_mode"),E8=Symbol.for("react.profiler"),Gre=Symbol.for("react.provider"),_7=Symbol.for("react.consumer"),qf=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"),od=Symbol.for("react.lazy"),A8=Symbol.for("react.activity"),Wre=Symbol.for("react.memo_cache_sentinel"),Y9=Symbol.iterator;function My(t){return t===null||typeof t!="object"?null:(t=Y9&&t[Y9]||t["@@iterator"],typeof t=="function"?t:null)}var qre=Symbol.for("react.client.reference");function C8(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===qre?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Wb:return"Fragment";case E8:return"Profiler";case x7:return"StrictMode";case M8:return"Suspense";case T8:return"SuspenseList";case A8:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case yx:return"Portal";case qf:return(t.displayName||"Context")+".Provider";case _7: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 od:e=t._payload,t=t._init;try{return C8(t(e))}catch{}}return null}var xx=Array.isArray,Bn=g7.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ir=jre.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xm={pending:!1,data:null,method:null,action:null},R8=[],qb=-1;function df(t){return{current:t}}function as(t){0>qb||(t.current=R8[qb],R8[qb]=null,qb--)}function Zr(t,e){qb++,R8[qb]=t.current,t.current=e}var $u=df(null),y1=df(null),Ad=df(null),AM=df(null);function CM(t,e){switch(Zr(Ad,e),Zr(y1,t),Zr($u,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=Fq(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}as($u),Zr($u,t)}function N0(){as($u),as(y1),as(Ad)}function k8(t){t.memoizedState!==null&&Zr(AM,t);var e=$u.current,n=Fq(e,t.type);e!==n&&(Zr(y1,t),Zr($u,n))}function RM(t){y1.current===t&&(as($u),as(y1)),AM.current===t&&(as(AM),R1._currentValue=xm)}var D8=Object.prototype.hasOwnProperty,vN=za.unstable_scheduleCallback,$R=za.unstable_cancelCallback,Xre=za.unstable_shouldYield,Kre=za.unstable_requestPaint,Zu=za.unstable_now,Yre=za.unstable_getCurrentPriorityLevel,S7=za.unstable_ImmediatePriority,w7=za.unstable_UserBlockingPriority,kM=za.unstable_NormalPriority,Jre=za.unstable_LowPriority,E7=za.unstable_IdlePriority,$re=za.log,Zre=za.unstable_setDisableYieldValue,u_=null,xl=null;function xd(t){if(typeof $re=="function"&&Zre(t),xl&&typeof xl.setStrictMode=="function")try{xl.setStrictMode(u_,t)}catch{}}var _l=Math.clz32?Math.clz32:tae,Qre=Math.log,eae=Math.LN2;function tae(t){return t>>>=0,t===0?32:31-(Qre(t)/eae|0)|0}var FS=256,BS=4194304;function Wp(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=Wp(i):(s&=o,s!==0?r=Wp(s):n||(n=o&~t,n!==0&&(r=Wp(n))))):(o=i&~a,o!==0?r=Wp(o):s!==0?r=Wp(s):n||(n=i&~t,n!==0&&(r=Wp(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 f_(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function nae(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 M7(){var t=FS;return FS<<=1,!(FS&4194048)&&(FS=256),t}function T7(){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 h_(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function iae(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-_l(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&&A7(t,i,0),a!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=a&~(s&~e))}function A7(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-_l(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function C7(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-_l(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 R7(){var t=ir.p;return t!==0?t:(t=window.event,t===void 0?32:Kq(t.type))}function rae(t,e){var n=ir.p;try{return ir.p=t,e()}finally{ir.p=n}}var qd=Math.random().toString(36).slice(2),no="__reactFiber$"+qd,Go="__reactProps$"+qd,wv="__reactContainer$"+qd,O8="__reactEvents$"+qd,aae="__reactListeners$"+qd,sae="__reactHandles$"+qd,J9="__reactResources$"+qd,d_="__reactMarker$"+qd;function _N(t){delete t[no],delete t[Go],delete t[O8],delete t[aae],delete t[sae]}function Xb(t){var e=t[no];if(e)return e;for(var n=t.parentNode;n;){if(e=n[wv]||n[no]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=iB(t);t!==null;){if(n=t[no])return n;t=iB(t)}return e}t=n,n=t.parentNode}return null}function Ev(t){if(t=t[no]||t[wv]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function _x(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(It(33))}function c0(t){var e=t[J9];return e||(e=t[J9]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ns(t){t[d_]=!0}var k7=new Set,D7={};function tg(t,e){L0(t,e),L0(t+"Capture",e)}function L0(t,e){for(D7[t]=e,t=0;t<e.length;t++)k7.add(e[t])}var oae=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 lae(t){return D8.call(Z9,t)?!0:D8.call($9,t)?!1:oae.test(t)?Z9[t]=!0:($9[t]=!0,!1)}function WE(t,e,n){if(lae(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 Df(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 Ub(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:"")?Ub(n):""}function cae(t){switch(t.tag){case 26:case 27:case 5:return Ub(t.type);case 16:return Ub("Lazy");case 13:return Ub("Suspense");case 19:return Ub("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 Ub("Activity");default:return""}}function eF(t){try{var e="";do e+=cae(t),t=t.return;while(t);return e}catch(n){return`
Error generating stack: `+n.message+`
`+n.stack}}function sc(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function O7(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function uae(t){var e=O7(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=uae(t))}function I7(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=O7(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 fae=/[\n"\\]/g;function fc(t){return t.replace(fae,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=""+sc(e)):t.value!==""+sc(e)&&(t.value=""+sc(e)):s!=="submit"&&s!=="reset"||t.removeAttribute("value"),e!=null?N8(t,s,sc(e)):n!=null?N8(t,s,sc(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=""+sc(o):t.removeAttribute("name")}function N7(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?""+sc(n):"",e=e!=null?""+sc(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 u0(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=""+sc(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 L7(t,e,n){if(e!=null&&(e=""+sc(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+sc(n):""}function P7(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(It(92));if(xx(i)){if(1<i.length)throw Error(It(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=sc(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function P0(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var hae=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||hae.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function U7(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 dae=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"]]),pae=/^[\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 pae.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 Kb=null,f0=null;function nF(t){var e=Ev(t);if(e&&(t=e.stateNode)){var n=t[Go]||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="'+fc(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Go]||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&&I7(i)}break e;case"textarea":L7(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&u0(t,!!n.multiple,e,!1)}}}var n3=!1;function F7(t,e,n){if(n3)return t(e,n);n3=!0;try{var i=t(e);return i}finally{if(n3=!1,(Kb!==null||f0!==null)&&(qT(),Kb&&(e=Kb,t=f0,f0=Kb=null,nF(e),t)))for(e=0;e<t.length;e++)nF(t[e])}}function x1(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Go]||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 uh=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),P8=!1;if(uh)try{var Ty={};Object.defineProperty(Ty,"passive",{get:function(){P8=!0}}),window.addEventListener("test",Ty,Ty),window.removeEventListener("test",Ty,Ty)}catch{P8=!1}var _d=null,EN=null,XE=null;function B7(){if(XE)return XE;var t,e=EN,n=e.length,i,r="value"in _d?_d.value:_d.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 qo(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 Gr(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 ng={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},UT=qo(ng),p_=Gr({},ng,{view:0,detail:0}),mae=qo(p_),i3,r3,Ay,FT=Gr({},p_,{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!==Ay&&(Ay&&t.type==="mousemove"?(i3=t.screenX-Ay.screenX,r3=t.screenY-Ay.screenY):r3=i3=0,Ay=t),i3)},movementY:function(t){return"movementY"in t?t.movementY:r3}}),rF=qo(FT),gae=Gr({},FT,{dataTransfer:0}),bae=qo(gae),vae=Gr({},p_,{relatedTarget:0}),a3=qo(vae),yae=Gr({},ng,{animationName:0,elapsedTime:0,pseudoElement:0}),xae=qo(yae),_ae=Gr({},ng,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Sae=qo(_ae),wae=Gr({},ng,{data:0}),aF=qo(wae),Eae={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mae={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"},Tae={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Aae(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Tae[t])?!!e[t]:!1}function MN(){return Aae}var Cae=Gr({},p_,{key:function(t){if(t.key){var e=Eae[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"?Mae[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}}),Rae=qo(Cae),kae=Gr({},FT,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sF=qo(kae),Dae=Gr({},p_,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:MN}),Oae=qo(Dae),Iae=Gr({},ng,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nae=qo(Iae),Lae=Gr({},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}),Pae=qo(Lae),Uae=Gr({},ng,{newState:0,oldState:0}),Fae=qo(Uae),Bae=[9,13,27,32],TN=uh&&"CompositionEvent"in window,Px=null;uh&&"documentMode"in document&&(Px=document.documentMode);var zae=uh&&"TextEvent"in window&&!Px,z7=uh&&(!TN||Px&&8<Px&&11>=Px),oF=" ",lF=!1;function j7(t,e){switch(t){case"keyup":return Bae.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function H7(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Yb=!1;function jae(t,e){switch(t){case"compositionend":return H7(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 Hae(t,e){if(Yb)return t==="compositionend"||!TN&&j7(t,e)?(t=B7(),XE=EN=_d=null,Yb=!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 z7&&e.locale!=="ko"?null:e.data;default:return null}}var Vae={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"?!!Vae[t.type]:e==="textarea"}function V7(t,e,n,i){Kb?f0?f0.push(i):f0=[i]:Kb=i,e=JM(e,"onChange"),0<e.length&&(n=new UT("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var Ux=null,_1=null;function Gae(t){Lq(t,0)}function BT(t){var e=_x(t);if(I7(e))return t}function uF(t,e){if(t==="change")return e}var G7=!1;if(uh){var s3;if(uh){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;G7=s3&&(!document.documentMode||9<document.documentMode)}function hF(){Ux&&(Ux.detachEvent("onpropertychange",W7),_1=Ux=null)}function W7(t){if(t.propertyName==="value"&&BT(_1)){var e=[];V7(e,_1,t,wN(t)),F7(Gae,e)}}function Wae(t,e,n){t==="focusin"?(hF(),Ux=e,_1=n,Ux.attachEvent("onpropertychange",W7)):t==="focusout"&&hF()}function qae(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return BT(_1)}function Xae(t,e){if(t==="click")return BT(e)}function Kae(t,e){if(t==="input"||t==="change")return BT(e)}function Yae(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Al=typeof Object.is=="function"?Object.is:Yae;function S1(t,e){if(Al(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)||!Al(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 q7(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?q7(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function X7(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 Jae=uh&&"documentMode"in document&&11>=document.documentMode,Jb=null,U8=null,Fx=null,F8=!1;function mF(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;F8||Jb==null||Jb!==OM(i)||(i=Jb,"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}),Fx&&S1(Fx,i)||(Fx=i,i=JM(U8,"onSelect"),0<i.length&&(e=new UT("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Jb)))}function Sp(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var $b={animationend:Sp("Animation","AnimationEnd"),animationiteration:Sp("Animation","AnimationIteration"),animationstart:Sp("Animation","AnimationStart"),transitionrun:Sp("Transition","TransitionRun"),transitionstart:Sp("Transition","TransitionStart"),transitioncancel:Sp("Transition","TransitionCancel"),transitionend:Sp("Transition","TransitionEnd")},l3={},K7={};uh&&(K7=document.createElement("div").style,"AnimationEvent"in window||(delete $b.animationend.animation,delete $b.animationiteration.animation,delete $b.animationstart.animation),"TransitionEvent"in window||delete $b.transitionend.transition);function ig(t){if(l3[t])return l3[t];if(!$b[t])return t;var e=$b[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in K7)return l3[t]=e[n];return t}var Y7=ig("animationend"),J7=ig("animationiteration"),$7=ig("animationstart"),$ae=ig("transitionrun"),Zae=ig("transitionstart"),Qae=ig("transitioncancel"),Z7=ig("transitionend"),Q7=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 wu(t,e){Q7.set(t,e),tg(e,[t])}var gF=new WeakMap;function hc(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 nc=[],Zb=0,CN=0;function zT(){for(var t=Zb,e=CN=Zb=0;e<t;){var n=nc[e];nc[e++]=null;var i=nc[e];nc[e++]=null;var r=nc[e];nc[e++]=null;var a=nc[e];if(nc[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&&eW(n,r,a)}}function jT(t,e,n,i){nc[Zb++]=t,nc[Zb++]=e,nc[Zb++]=n,nc[Zb++]=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 Mv(t,e){return jT(t,null,null,e),IM(t)}function eW(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-_l(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<Kx)throw Kx=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 Qb={};function ese(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 gl(t,e,n,i){return new ese(t,e,n,i)}function kN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function nh(t,e){var n=t.alternate;return n===null?(n=gl(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 tW(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=noe(t,n,$u.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case A8:return t=gl(31,n,e,r),t.elementType=A8,t.lanes=a,t;case Wb:return _m(n.children,r,a,e);case x7:s=8,r|=24;break;case E8:return t=gl(12,n,e,r|2),t.elementType=E8,t.lanes=a,t;case M8:return t=gl(13,n,e,r),t.elementType=M8,t.lanes=a,t;case T8:return t=gl(19,n,e,r),t.elementType=T8,t.lanes=a,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Gre:case qf:s=10;break e;case _7:s=9;break e;case gN:s=11;break e;case bN:s=14;break e;case od:s=16,i=null;break e}s=29,n=Error(It(130,t===null?"null":typeof t,"")),i=null}return e=gl(s,n,e,r),e.elementType=t,e.type=i,e.lanes=a,e}function _m(t,e,n,i){return t=gl(7,t,i,e),t.lanes=n,t}function c3(t,e,n){return t=gl(6,t,null,e),t.lanes=n,t}function u3(t,e,n){return e=gl(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var e0=[],t0=0,NM=null,LM=0,oc=[],lc=0,Sm=null,Xf=1,Kf="";function qp(t,e){e0[t0++]=LM,e0[t0++]=NM,NM=t,LM=e}function nW(t,e,n){oc[lc++]=Xf,oc[lc++]=Kf,oc[lc++]=Sm,Sm=t;var i=Xf;t=Kf;var r=32-_l(i)-1;i&=~(1<<r),n+=1;var a=32-_l(e)+r;if(30<a){var s=r-r%5;a=(i&(1<<s)-1).toString(32),i>>=s,r-=s,Xf=1<<32-_l(e)+r|n<<r|i,Kf=a+t}else Xf=1<<a|n<<r|i,Kf=t}function DN(t){t.return!==null&&(qp(t,1),nW(t,1,0))}function ON(t){for(;t===NM;)NM=e0[--t0],e0[t0]=null,LM=e0[--t0],e0[t0]=null;for(;t===Sm;)Sm=oc[--lc],oc[lc]=null,Kf=oc[--lc],oc[lc]=null,Xf=oc[--lc],oc[lc]=null}var So=null,pa=null,er=!1,wm=null,Vu=!1,z8=Error(It(519));function Bm(t){var e=Error(It(418,""));throw w1(hc(e,t)),z8}function bF(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[no]=t,e[Go]=i,n){case"dialog":Ci("cancel",e),Ci("close",e);break;case"iframe":case"object":case"embed":Ci("load",e);break;case"video":case"audio":for(n=0;n<T1.length;n++)Ci(T1[n],e);break;case"source":Ci("error",e);break;case"img":case"image":case"link":Ci("error",e),Ci("load",e);break;case"details":Ci("toggle",e);break;case"input":Ci("invalid",e),N7(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),DM(e);break;case"select":Ci("invalid",e);break;case"textarea":Ci("invalid",e),P7(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||Uq(e.textContent,n)?(i.popover!=null&&(Ci("beforetoggle",e),Ci("toggle",e)),i.onScroll!=null&&Ci("scroll",e),i.onScrollEnd!=null&&Ci("scrollend",e),i.onClick!=null&&(e.onclick=YT),e=!0):e=!1,e||Bm(t)}function vF(t){for(So=t.return;So;)switch(So.tag){case 5:case 13:Vu=!1;return;case 27:case 3:Vu=!0;return;default:So=So.return}}function Cy(t){if(t!==So)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&&pa&&Bm(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){pa=gu(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}pa=null}}else e===27?(e=pa,Xd(t.type)?(t=mO,mO=null,pa=t):pa=e):pa=So?gu(t.stateNode.nextSibling):null;return!0}function m_(){pa=So=null,er=!1}function yF(){var t=wm;return t!==null&&(Fo===null?Fo=t:Fo.push.apply(Fo,t),wm=null),t}function w1(t){wm===null?wm=[t]:wm.push(t)}var j8=df(null),rg=null,Yf=null;function dd(t,e,n){Zr(j8,e._currentValue),e._currentValue=n}function ih(t){t._currentValue=j8.current,as(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 g_(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;Al(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(R1):t=[R1])}r=r.return}t!==null&&V8(e,t,n,i),e.flags|=262144}function PM(t){for(t=t.firstContext;t!==null;){if(!Al(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function zm(t){rg=t,Yf=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function io(t){return iW(rg,t)}function HS(t,e){return rg===null&&zm(t),iW(t,e)}function iW(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},Yf===null){if(t===null)throw Error(It(308));Yf=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Yf=Yf.next=e;return n}var tse=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()})}},nse=za.unstable_scheduleCallback,ise=za.unstable_NormalPriority,Fa={$$typeof:qf,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function IN(){return{controller:new tse,data:new Map,refCount:0}}function b_(t){t.refCount--,t.refCount===0&&nse(ise,function(){t.controller.abort()})}var Bx=null,G8=0,U0=0,h0=null;function rse(t,e){if(Bx===null){var n=Bx=[];G8=0,U0=nL(),h0={status:"pending",value:void 0,then:function(i){n.push(i)}}}return G8++,e.then(xF,xF),e}function xF(){if(--G8===0&&Bx!==null){h0!==null&&(h0.status="fulfilled");var t=Bx;Bx=null,U0=0,h0=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function ase(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=Bn.S;Bn.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&rse(t,e),_F!==null&&_F(t,e)};var Em=df(null);function NN(){var t=Em.current;return t!==null?t:Lr.pooledCache}function JE(t,e){e===null?Zr(Em,Em.current):Zr(Em,e.pool)}function rW(){var t=NN();return t===null?null:{parent:Fa._currentValue,pool:t}}var v_=Error(It(460)),aW=Error(It(474)),HT=Error(It(542)),W8={then:function(){}};function SF(t){return t=t.status,t==="fulfilled"||t==="rejected"}function VS(){}function sW(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=Lr,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 zx=e,v_}}var zx=null;function wF(){if(zx===null)throw Error(It(459));var t=zx;return zx=null,t}function EF(t){if(t===v_||t===HT)throw Error(It(483))}var ld=!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 Cd(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Rd(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,gr&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=IM(t),eW(t,null,n),e}return jT(t,i,e,n),IM(t)}function jx(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,C7(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 Hx(){if(X8){var t=h0;if(t!==null)throw t}}function Vx(t,e,n,i){X8=!1;var r=t.updateQueue;ld=!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?(ji&h)===h:(i&h)===h){h!==0&&h===U0&&(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=Gr({},f,h);break e;case 2:ld=!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),Bd|=s,t.lanes=s,t.memoizedState=f}}function oW(t,e){if(typeof t!="function")throw Error(It(191,t));t.call(e)}function lW(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)oW(n[t],e)}var F0=df(null),UM=df(0);function MF(t,e){t=dh,Zr(UM,t),Zr(F0,e),dh=t|e.baseLanes}function K8(){Zr(UM,dh),Zr(F0,F0.current)}function PN(){dh=UM.current,as(F0),as(UM)}var Ud=0,yi=null,_r=null,Ca=null,FM=!1,d0=!1,jm=!1,BM=0,E1=0,p0=null,sse=0;function ba(){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(!Al(t[n],e[n]))return!1;return!0}function FN(t,e,n,i,r,a){return Ud=a,yi=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Bn.H=t===null||t.memoizedState===null?BW:zW,jm=!1,a=n(i,r),jm=!1,d0&&(a=uW(e,n,i,r)),cW(t),a}function cW(t){Bn.H=zM;var e=_r!==null&&_r.next!==null;if(Ud=0,Ca=_r=yi=null,FM=!1,E1=0,p0=null,e)throw Error(It(300));t===null||is||(t=t.dependencies,t!==null&&PM(t)&&(is=!0))}function uW(t,e,n,i){yi=t;var r=0;do{if(d0&&(p0=null),E1=0,d0=!1,25<=r)throw Error(It(301));if(r+=1,Ca=_r=null,t.updateQueue!=null){var a=t.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}Bn.H=dse,a=e(n,i)}while(d0);return a}function ose(){var t=Bn.H,e=t.useState()[0];return e=typeof e.then=="function"?y_(e):e,t=t.useState()[0],(_r!==null?_r.memoizedState:null)!==t&&(yi.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}Ud=0,Ca=_r=yi=null,d0=!1,E1=BM=0,p0=null}function Po(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ca===null?yi.memoizedState=Ca=t:Ca=Ca.next=t,Ca}function ka(){if(_r===null){var t=yi.alternate;t=t!==null?t.memoizedState:null}else t=_r.next;var e=Ca===null?yi.memoizedState:Ca.next;if(e!==null)Ca=e,_r=t;else{if(t===null)throw yi.alternate===null?Error(It(467)):Error(It(310));_r=t,t={memoizedState:_r.memoizedState,baseState:_r.baseState,baseQueue:_r.baseQueue,queue:_r.queue,next:null},Ca===null?yi.memoizedState=Ca=t:Ca=Ca.next=t}return Ca}function HN(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function y_(t){var e=E1;return E1+=1,p0===null&&(p0=[]),t=sW(p0,t,e),e=yi,(Ca===null?e.memoizedState:Ca.next)===null&&(e=e.alternate,Bn.H=e===null||e.memoizedState===null?BW:zW),t}function VT(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return y_(t);if(t.$$typeof===qf)return io(t)}throw Error(It(438,String(t)))}function VN(t){var e=null,n=yi.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=yi.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(),yi.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]=Wre;return e.index++,n}function fh(t,e){return typeof e=="function"?e(t):e}function $E(t){var e=ka();return GN(e,_r,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?(ji&f)===f:(Ud&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===U0&&(u=!0);else if((Ud&h)===h){c=c.next,h===U0&&(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,yi.lanes|=h,Bd|=h;f=c.action,jm&&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,yi.lanes|=f,Bd|=f;c=c.next}while(c!==null&&c!==e);if(l===null?s=a:l.next=o,!Al(a,t.memoizedState)&&(is=!0,u&&(n=h0,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=ka(),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);Al(a,e.memoizedState)||(is=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a}return[a,i]}function fW(t,e,n){var i=yi,r=ka(),a=er;if(a){if(n===void 0)throw Error(It(407));n=n()}else n=e();var s=!Al((_r||r).memoizedState,n);s&&(r.memoizedState=n,is=!0),r=r.queue;var o=pW.bind(null,i,r,t);if(x_(2048,8,o,[t]),r.getSnapshot!==e||s||Ca!==null&&Ca.memoizedState.tag&1){if(i.flags|=2048,B0(9,GT(),dW.bind(null,i,r,n,e),null),Lr===null)throw Error(It(349));a||Ud&124||hW(i,e,n)}return n}function hW(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=yi.updateQueue,e===null?(e=HN(),yi.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function dW(t,e,n,i){e.value=n,e.getSnapshot=i,mW(e)&&gW(t)}function pW(t,e,n){return n(function(){mW(e)&&gW(t)})}function mW(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Al(t,n)}catch{return!0}}function gW(t){var e=Mv(t,2);e!==null&&wl(e,t,2)}function Y8(t){var e=Po();if(typeof t=="function"){var n=t;if(t=n(),jm){xd(!0);try{n()}finally{xd(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fh,lastRenderedState:t},e}function bW(t,e,n,i){return t.baseState=n,GN(t,_r,typeof i=="function"?i:fh)}function lse(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)}};Bn.T!==null?n(!0):a.isTransition=!1,i(a),n=e.pending,n===null?(a.next=e.pending=a,vW(e,a)):(a.next=n.next,e.pending=n.next=a)}}function vW(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var a=Bn.T,s={};Bn.T=s;try{var o=n(r,i),l=Bn.S;l!==null&&l(s,o),TF(t,e,o)}catch(c){J8(t,e,c)}finally{Bn.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,yW(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,vW(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,yW(e),e=e.next;while(e!==i)}t.action=null}function yW(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function xW(t,e){return e}function CF(t,e){if(er){var n=Lr.formState;if(n!==null){e:{var i=yi;if(er){if(pa){t:{for(var r=pa,a=Vu;r.nodeType!==8;){if(!a){r=null;break t}if(r=gu(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){pa=gu(r.nextSibling),i=r.data==="F!";break e}}Bm(i)}i=!1}i&&(e=n[0])}}return n=Po(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xW,lastRenderedState:e},n.queue=i,n=PW.bind(null,yi,i),i.dispatch=n,i=Y8(!1),a=KN.bind(null,yi,!1,i.queue),i=Po(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=lse.bind(null,yi,r,a,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function RF(t){var e=ka();return _W(e,_r,t)}function _W(t,e,n){if(e=GN(t,e,xW)[0],t=$E(fh)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=y_(e)}catch(s){throw s===v_?HT:s}else i=e;e=ka();var r=e.queue,a=r.dispatch;return n!==e.memoizedState&&(yi.flags|=2048,B0(9,GT(),cse.bind(null,r,n),null)),[i,a,t]}function cse(t,e){t.action=e}function kF(t){var e=ka(),n=_r;if(n!==null)return _W(e,n,t);ka(),e=e.memoizedState,n=ka();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function B0(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=yi.updateQueue,e===null&&(e=HN(),yi.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 SW(){return ka().memoizedState}function ZE(t,e,n,i){var r=Po();i=i===void 0?null:i,yi.flags|=t,r.memoizedState=B0(1|e,GT(),n,i)}function x_(t,e,n,i){var r=ka();i=i===void 0?null:i;var a=r.memoizedState.inst;_r!==null&&i!==null&&UN(i,_r.memoizedState.deps)?r.memoizedState=B0(e,a,n,i):(yi.flags|=t,r.memoizedState=B0(1|e,a,n,i))}function DF(t,e){ZE(8390656,8,t,e)}function wW(t,e){x_(2048,8,t,e)}function EW(t,e){return x_(4,2,t,e)}function MW(t,e){return x_(4,4,t,e)}function TW(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 AW(t,e,n){n=n!=null?n.concat([t]):null,x_(4,4,TW.bind(null,e,t),n)}function WN(){}function CW(t,e){var n=ka();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 RW(t,e){var n=ka();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&UN(e,i[1]))return i[0];if(i=t(),jm){xd(!0);try{t()}finally{xd(!1)}}return n.memoizedState=[i,e],i}function qN(t,e,n){return n===void 0||Ud&1073741824?t.memoizedState=e:(t.memoizedState=n,t=yq(),yi.lanes|=t,Bd|=t,n)}function kW(t,e,n,i){return Al(n,e)?n:F0.current!==null?(t=qN(t,n,i),Al(t,e)||(is=!0),t):Ud&42?(t=yq(),yi.lanes|=t,Bd|=t,e):(is=!0,t.memoizedState=n)}function DW(t,e,n,i,r){var a=ir.p;ir.p=a!==0&&8>a?a:8;var s=Bn.T,o={};Bn.T=o,KN(t,!1,e,n);try{var l=r(),c=Bn.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=ase(l,i);Gx(t,e,u,Sl(t))}else Gx(t,e,i,Sl(t))}catch(f){Gx(t,e,{then:function(){},status:"rejected",reason:f},Sl())}finally{ir.p=a,Bn.T=s}}function use(){}function $8(t,e,n,i){if(t.tag!==5)throw Error(It(476));var r=OW(t).queue;DW(t,r,e,xm,n===null?use:function(){return IW(t),n(i)})}function OW(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:xm,baseState:xm,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fh,lastRenderedState:xm},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fh,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function IW(t){var e=OW(t).next.queue;Gx(t,e,{},Sl())}function XN(){return io(R1)}function NW(){return ka().memoizedState}function LW(){return ka().memoizedState}function fse(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Sl();t=Cd(n);var i=Rd(e,t,n);i!==null&&(wl(i,e,n),jx(i,e,n)),e={cache:IN()},t.payload=e;return}e=e.return}}function hse(t,e,n){var i=Sl();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},WT(t)?UW(e,n):(n=RN(t,e,n,i),n!==null&&(wl(n,t,i),FW(n,e,i)))}function PW(t,e,n){var i=Sl();Gx(t,e,n,i)}function Gx(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(WT(t))UW(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,Al(o,s))return jT(t,e,r,0),Lr===null&&zT(),!1}catch{}finally{}if(n=RN(t,e,r,i),n!==null)return wl(n,t,i),FW(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&&wl(e,t,2)}function WT(t){var e=t.alternate;return t===yi||e!==null&&e===yi}function UW(t,e){d0=FM=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function FW(t,e,n){if(n&4194048){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,C7(t,n)}}var zM={readContext:io,use:VT,useCallback:ba,useContext:ba,useEffect:ba,useImperativeHandle:ba,useLayoutEffect:ba,useInsertionEffect:ba,useMemo:ba,useReducer:ba,useRef:ba,useState:ba,useDebugValue:ba,useDeferredValue:ba,useTransition:ba,useSyncExternalStore:ba,useId:ba,useHostTransitionStatus:ba,useFormState:ba,useActionState:ba,useOptimistic:ba,useMemoCache:ba,useCacheRefresh:ba},BW={readContext:io,use:VT,useCallback:function(t,e){return Po().memoizedState=[t,e===void 0?null:e],t},useContext:io,useEffect:DF,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,ZE(4194308,4,TW.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=Po();e=e===void 0?null:e;var i=t();if(jm){xd(!0);try{t()}finally{xd(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Po();if(n!==void 0){var r=n(e);if(jm){xd(!0);try{n(e)}finally{xd(!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=hse.bind(null,yi,t),[i.memoizedState,t]},useRef:function(t){var e=Po();return t={current:t},e.memoizedState=t},useState:function(t){t=Y8(t);var e=t.queue,n=PW.bind(null,yi,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:WN,useDeferredValue:function(t,e){var n=Po();return qN(n,t,e)},useTransition:function(){var t=Y8(!1);return t=DW.bind(null,yi,t.queue,!0,!1),Po().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=yi,r=Po();if(er){if(n===void 0)throw Error(It(407));n=n()}else{if(n=e(),Lr===null)throw Error(It(349));ji&124||hW(i,e,n)}r.memoizedState=n;var a={value:n,getSnapshot:e};return r.queue=a,DF(pW.bind(null,i,a,t),[t]),i.flags|=2048,B0(9,GT(),dW.bind(null,i,a,n,e),null),n},useId:function(){var t=Po(),e=Lr.identifierPrefix;if(er){var n=Kf,i=Xf;n=(i&~(1<<32-_l(i)-1)).toString(32)+n,e="«"+e+"R"+n,n=BM++,0<n&&(e+="H"+n.toString(32)),e+="»"}else n=sse++,e="«"+e+"r"+n.toString(32)+"»";return t.memoizedState=e},useHostTransitionStatus:XN,useFormState:CF,useActionState:CF,useOptimistic:function(t){var e=Po();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,yi,!0,n),n.dispatch=e,[t,e]},useMemoCache:VN,useCacheRefresh:function(){return Po().memoizedState=fse.bind(null,yi)}},zW={readContext:io,use:VT,useCallback:CW,useContext:io,useEffect:wW,useImperativeHandle:AW,useInsertionEffect:EW,useLayoutEffect:MW,useMemo:RW,useReducer:$E,useRef:SW,useState:function(){return $E(fh)},useDebugValue:WN,useDeferredValue:function(t,e){var n=ka();return kW(n,_r.memoizedState,t,e)},useTransition:function(){var t=$E(fh)[0],e=ka().memoizedState;return[typeof t=="boolean"?t:y_(t),e]},useSyncExternalStore:fW,useId:NW,useHostTransitionStatus:XN,useFormState:RF,useActionState:RF,useOptimistic:function(t,e){var n=ka();return bW(n,_r,t,e)},useMemoCache:VN,useCacheRefresh:LW},dse={readContext:io,use:VT,useCallback:CW,useContext:io,useEffect:wW,useImperativeHandle:AW,useInsertionEffect:EW,useLayoutEffect:MW,useMemo:RW,useReducer:h3,useRef:SW,useState:function(){return h3(fh)},useDebugValue:WN,useDeferredValue:function(t,e){var n=ka();return _r===null?qN(n,t,e):kW(n,_r.memoizedState,t,e)},useTransition:function(){var t=h3(fh)[0],e=ka().memoizedState;return[typeof t=="boolean"?t:y_(t),e]},useSyncExternalStore:fW,useId:NW,useHostTransitionStatus:XN,useFormState:kF,useActionState:kF,useOptimistic:function(t,e){var n=ka();return _r!==null?bW(n,_r,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:VN,useCacheRefresh:LW},m0=null,M1=0;function GS(t){var e=M1;return M1+=1,m0===null&&(m0=[]),sW(m0,t,e)}function Ry(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function WS(t,e){throw e.$$typeof===Vre?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 jW(t){function e(m,x){if(t){var _=m.deletions;_===null?(m.deletions=[x],m.flags|=16):_.push(x)}}function n(m,x){if(!t)return null;for(;x!==null;)e(m,x),x=x.sibling;return null}function i(m){for(var x=new Map;m!==null;)m.key!==null?x.set(m.key,m):x.set(m.index,m),m=m.sibling;return x}function r(m,x){return m=nh(m,x),m.index=0,m.sibling=null,m}function a(m,x,_){return m.index=_,t?(_=m.alternate,_!==null?(_=_.index,_<x?(m.flags|=67108866,x):_):(m.flags|=67108866,x)):(m.flags|=1048576,x)}function s(m){return t&&m.alternate===null&&(m.flags|=67108866),m}function o(m,x,_,w){return x===null||x.tag!==6?(x=c3(_,m.mode,w),x.return=m,x):(x=r(x,_),x.return=m,x)}function l(m,x,_,w){var M=_.type;return M===Wb?u(m,x,_.props.children,w,_.key):x!==null&&(x.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===od&&OF(M)===x.type)?(x=r(x,_.props),Ry(x,_),x.return=m,x):(x=YE(_.type,_.key,_.props,null,m.mode,w),Ry(x,_),x.return=m,x)}function c(m,x,_,w){return x===null||x.tag!==4||x.stateNode.containerInfo!==_.containerInfo||x.stateNode.implementation!==_.implementation?(x=u3(_,m.mode,w),x.return=m,x):(x=r(x,_.children||[]),x.return=m,x)}function u(m,x,_,w,M){return x===null||x.tag!==7?(x=_m(_,m.mode,w,M),x.return=m,x):(x=r(x,_),x.return=m,x)}function f(m,x,_){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=c3(""+x,m.mode,_),x.return=m,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case US:return _=YE(x.type,x.key,x.props,null,m.mode,_),Ry(_,x),_.return=m,_;case yx:return x=u3(x,m.mode,_),x.return=m,x;case od:var w=x._init;return x=w(x._payload),f(m,x,_)}if(xx(x)||My(x))return x=_m(x,m.mode,_,null),x.return=m,x;if(typeof x.then=="function")return f(m,GS(x),_);if(x.$$typeof===qf)return f(m,HS(m,x),_);WS(m,x)}return null}function h(m,x,_,w){var M=x!==null?x.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return M!==null?null:o(m,x,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case US:return _.key===M?l(m,x,_,w):null;case yx:return _.key===M?c(m,x,_,w):null;case od:return M=_._init,_=M(_._payload),h(m,x,_,w)}if(xx(_)||My(_))return M!==null?null:u(m,x,_,w,null);if(typeof _.then=="function")return h(m,x,GS(_),w);if(_.$$typeof===qf)return h(m,x,HS(m,_),w);WS(m,_)}return null}function d(m,x,_,w,M){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return m=m.get(_)||null,o(x,m,""+w,M);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case US:return m=m.get(w.key===null?_:w.key)||null,l(x,m,w,M);case yx:return m=m.get(w.key===null?_:w.key)||null,c(x,m,w,M);case od:var S=w._init;return w=S(w._payload),d(m,x,_,w,M)}if(xx(w)||My(w))return m=m.get(_)||null,u(x,m,w,M,null);if(typeof w.then=="function")return d(m,x,_,GS(w),M);if(w.$$typeof===qf)return d(m,x,_,HS(x,w),M);WS(x,w)}return null}function g(m,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(m,A,_[C],w);if(R===null){A===null&&(A=D);break}t&&A&&R.alternate===null&&e(m,A),x=a(R,x,C),S===null?M=R:S.sibling=R,S=R,A=D}if(C===_.length)return n(m,A),er&&qp(m,C),M;if(A===null){for(;C<_.length;C++)A=f(m,_[C],w),A!==null&&(x=a(A,x,C),S===null?M=A:S.sibling=A,S=A);return er&&qp(m,C),M}for(A=i(A);C<_.length;C++)D=d(A,m,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(L){return e(m,L)}),er&&qp(m,C),M}function b(m,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 L=h(m,A,R.value,w);if(L===null){A===null&&(A=D);break}t&&A&&L.alternate===null&&e(m,A),x=a(L,x,C),S===null?M=L:S.sibling=L,S=L,A=D}if(R.done)return n(m,A),er&&qp(m,C),M;if(A===null){for(;!R.done;C++,R=_.next())R=f(m,R.value,w),R!==null&&(x=a(R,x,C),S===null?M=R:S.sibling=R,S=R);return er&&qp(m,C),M}for(A=i(A);!R.done;C++,R=_.next())R=d(A,m,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(m,U)}),er&&qp(m,C),M}function y(m,x,_,w){if(typeof _=="object"&&_!==null&&_.type===Wb&&_.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===Wb){if(x.tag===7){n(m,x.sibling),w=r(x,_.props.children),w.return=m,m=w;break e}}else if(x.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===od&&OF(M)===x.type){n(m,x.sibling),w=r(x,_.props),Ry(w,_),w.return=m,m=w;break e}n(m,x);break}else e(m,x);x=x.sibling}_.type===Wb?(w=_m(_.props.children,m.mode,w,_.key),w.return=m,m=w):(w=YE(_.type,_.key,_.props,null,m.mode,w),Ry(w,_),w.return=m,m=w)}return s(m);case yx:e:{for(M=_.key;x!==null;){if(x.key===M)if(x.tag===4&&x.stateNode.containerInfo===_.containerInfo&&x.stateNode.implementation===_.implementation){n(m,x.sibling),w=r(x,_.children||[]),w.return=m,m=w;break e}else{n(m,x);break}else e(m,x);x=x.sibling}w=u3(_,m.mode,w),w.return=m,m=w}return s(m);case od:return M=_._init,_=M(_._payload),y(m,x,_,w)}if(xx(_))return g(m,x,_,w);if(My(_)){if(M=My(_),typeof M!="function")throw Error(It(150));return _=M.call(_),b(m,x,_,w)}if(typeof _.then=="function")return y(m,x,GS(_),w);if(_.$$typeof===qf)return y(m,x,HS(m,_),w);WS(m,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,x!==null&&x.tag===6?(n(m,x.sibling),w=r(x,_),w.return=m,m=w):(n(m,x),w=c3(_,m.mode,w),w.return=m,m=w),s(m)):n(m,x)}return function(m,x,_,w){try{M1=0;var M=y(m,x,_,w);return m0=null,M}catch(A){if(A===v_||A===HT)throw A;var S=gl(29,A,null,m.mode);return S.lanes=w,S.return=m,S}finally{}}}var z0=jW(!0),HW=jW(!1),Sc=df(null),Qu=null;function pd(t){var e=t.alternate;Zr(Ba,Ba.current&1),Zr(Sc,t),Qu===null&&(e===null||F0.current!==null||e.memoizedState!==null)&&(Qu=t)}function VW(t){if(t.tag===22){if(Zr(Ba,Ba.current),Zr(Sc,t),Qu===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Qu=t)}}else md()}function md(){Zr(Ba,Ba.current),Zr(Sc,Sc.current)}function Jf(t){as(Sc),Qu===t&&(Qu=null),as(Ba)}var Ba=df(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:Gr({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Z8={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=Sl(),r=Cd(i);r.payload=e,n!=null&&(r.callback=n),e=Rd(t,r,i),e!==null&&(wl(e,t,i),jx(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=Sl(),r=Cd(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Rd(t,r,i),e!==null&&(wl(e,t,i),jx(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Sl(),i=Cd(n);i.tag=2,e!=null&&(i.callback=e),e=Rd(t,i,n),e!==null&&(wl(e,t,n),jx(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?!S1(n,i)||!S1(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 Hm(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=Gr({},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 GW(t){HM(t)}function WW(t){console.error(t)}function qW(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=Cd(n),n.tag=3,n.payload={element:null},n.callback=function(){VM(t,e)},n}function XW(t){return t=Cd(t),t.tag=3,t}function KW(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"&&(kd===null?kd=new Set([this]):kd.add(this));var o=i.stack;this.componentDidCatch(i.value,{componentStack:o!==null?o:""})})}function pse(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&g_(e,n,r,!0),n=Sc.current,n!==null){switch(n.tag){case 13:return Qu===null?oO():n.alternate===null&&ma===0&&(ma=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=Sc.current,e!==null?(!(e.flags&65536)&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==z8&&(t=Error(It(422),{cause:i}),w1(hc(t,n)))):(i!==z8&&(e=Error(It(423),{cause:i}),w1(hc(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=hc(i,n),r=Q8(t.stateNode,i,r),f3(t,r),ma!==4&&(ma=2)),!1;var a=Error(It(520),{cause:i});if(a=hc(a,n),Xx===null?Xx=[a]:Xx.push(a),ma!==4&&(ma=2),e===null)return!0;i=hc(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"&&(kd===null||!kd.has(a))))return n.flags|=65536,r&=-r,n.lanes|=r,r=XW(r),KW(r,t,n,i),f3(n,r),!1}n=n.return}while(n!==null);return!1}var YW=Error(It(461)),is=!1;function Ss(t,e,n,i){e.child=t===null?HW(e,null,n,i):z0(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 zm(e),i=FN(t,e,n,s,a,r),o=BN(),t!==null&&!is?(zN(t,e,r),hh(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,JW(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:S1,n(s,i)&&t.ref===e.ref)return hh(t,e,r)}return e.flags|=1,t=nh(a,i),t.ref=e.ref,t.return=e,e.child=t}function JW(t,e,n,i,r){if(t!==null){var a=t.memoizedProps;if(S1(a,i)&&t.ref===e.ref)if(is=!1,e.pendingProps=i=a,YN(t,r))t.flags&131072&&(is=!0);else return e.lanes=t.lanes,hh(t,e,r)}return eO(t,e,n,i,r)}function $W(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(),VW(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),md(),e.memoizedState=null):(t!==null&&JE(e,null),K8(),md());return Ss(t,e,r,n),e.child}function FF(t,e,n,i){var r=NN();return r=r===null?null:{parent:Fa._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&JE(e,null),K8(),VW(e),t!==null&&g_(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 zm(e),n=FN(t,e,n,i,void 0,r),i=BN(),t!==null&&!is?(zN(t,e,r),hh(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 zm(e),e.updateQueue=null,n=uW(e,i,n,r),cW(t),i=BN(),t!==null&&!is?(zN(t,e,a),hh(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(zm(e),e.stateNode===null){var a=Qb,s=n.contextType;typeof s=="object"&&s!==null&&(a=io(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?io(s):Qb,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),Vx(e,i,a,r),Hx(),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=Hm(n,o);a.props=l;var c=a.context,u=n.contextType;s=Qb,typeof u=="object"&&u!==null&&(s=io(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),ld=!1;var h=e.memoizedState;a.state=h,Vx(e,i,a,r),Hx(),c=e.memoizedState,o||h!==c||ld?(typeof f=="function"&&(d3(e,n,f,i),c=e.memoizedState),(l=ld||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=Hm(n,s),a.props=u,f=e.pendingProps,h=a.context,c=n.contextType,l=Qb,typeof c=="object"&&c!==null&&(l=io(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),ld=!1,h=e.memoizedState,a.state=h,Vx(e,i,a,r),Hx();var d=e.memoizedState;s!==f||h!==d||ld||t!==null&&t.dependencies!==null&&PM(t.dependencies)?(typeof o=="function"&&(d3(e,n,o,i),d=e.memoizedState),(u=ld||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=z0(e,t.child,null,r),e.child=z0(e,null,n,r)):Ss(t,e,n,r),e.memoizedState=a.state,t=e.child):t=hh(t,e,r),t}function jF(t,e,n,i){return m_(),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:rW()}}function g3(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=mc),t}function ZW(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:(Ba.current&2)!==0),s&&(r=!0,e.flags&=-129),s=(e.flags&32)!==0,e.flags&=-33,t===null){if(er){if(r?pd(e):md(),er){var o=pa,l;if(l=o){e:{for(l=o,o=Vu;l.nodeType!==8;){if(!o){o=null;break e}if(l=gu(l.nextSibling),l===null){o=null;break e}}o=l}o!==null?(e.memoizedState={dehydrated:o,treeContext:Sm!==null?{id:Xf,overflow:Kf}:null,retryLane:536870912,hydrationErrors:null},l=gl(18,null,null,0),l.stateNode=o,l.return=e,e.child=l,So=e,pa=null,l=!0):l=!1}l||Bm(e)}if(o=e.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return pO(o)?e.lanes=32:e.lanes=536870912,null;Jf(e)}return o=i.children,i=i.fallback,r?(md(),r=e.mode,o=GM({mode:"hidden",children:o},r),i=_m(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):(pd(e),tO(e,o))}if(l=t.memoizedState,l!==null&&(o=l.dehydrated,o!==null)){if(a)e.flags&256?(pd(e),e.flags&=-257,e=b3(t,e,n)):e.memoizedState!==null?(md(),e.child=t.child,e.flags|=128,e=null):(md(),r=i.fallback,o=e.mode,i=GM({mode:"visible",children:i.children},o),r=_m(r,o,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,z0(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(pd(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,w1({value:i,source:null,stack:null}),e=b3(t,e,n)}else if(is||g_(t,e,n,!1),s=(n&t.childLanes)!==0,is||s){if(s=Lr,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,Mv(t,i),wl(s,t,i),YW;o.data==="$?"||oO(),e=b3(t,e,n)}else o.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,pa=gu(o.nextSibling),So=e,er=!0,wm=null,Vu=!1,t!==null&&(oc[lc++]=Xf,oc[lc++]=Kf,oc[lc++]=Sm,Xf=t.id,Kf=t.overflow,Sm=e),e=tO(e,i.children),e.flags|=4096);return e}return r?(md(),r=i.fallback,o=e.mode,l=t.child,c=l.sibling,i=nh(l,{mode:"hidden",children:i.children}),i.subtreeFlags=l.subtreeFlags&65011712,c!==null?r=nh(c,r):(r=_m(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=Fa._currentValue,l=l.parent!==c?{parent:c,pool:c}:l):l=rW(),o={baseLanes:o.baseLanes|n,cachePool:l}),r.memoizedState=o,r.childLanes=g3(t,s,n),e.memoizedState=p3,i):(pd(e),n=t.child,t=n.sibling,n=nh(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=gl(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function b3(t,e,n){return z0(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 QW(t,e,n){var i=e.pendingProps,r=i.revealOrder,a=i.tail;if(Ss(t,e,i.children,n),i=Ba.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(Zr(Ba,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 hh(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Bd|=e.lanes,!(n&e.childLanes))if(t!==null){if(g_(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=nh(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=nh(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 mse(t,e,n){switch(e.tag){case 3:CM(e,e.stateNode.containerInfo),dd(e,Fa,t.memoizedState.cache),m_();break;case 27:case 5:k8(e);break;case 4:CM(e,e.stateNode.containerInfo);break;case 10:dd(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(pd(e),e.flags|=128,null):n&e.child.childLanes?ZW(t,e,n):(pd(e),t=hh(t,e,n),t!==null?t.sibling:null);pd(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(g_(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return QW(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Zr(Ba,Ba.current),i)break;return null;case 22:case 23:return e.lanes=0,$W(t,e,n);case 24:dd(e,Fa,t.memoizedState.cache)}return hh(t,e,n)}function eq(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)is=!0;else{if(!YN(t,n)&&!(e.flags&128))return is=!1,mse(t,e,n);is=!!(t.flags&131072)}else is=!1,er&&e.flags&1048576&&nW(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=Hm(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=Hm(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),Vx(e,i,null,n);var s=e.memoizedState;if(i=s.cache,dd(e,Fa,i),i!==a.cache&&V8(e,[Fa],n,!0),Hx(),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=hc(Error(It(424)),e),w1(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(pa=gu(t.firstChild),So=e,er=!0,wm=null,Vu=!0,n=HW(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(m_(),i===r){e=hh(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(Ad.current).createElement(n),i[no]=e,i[Go]=t,Rs(i,n,t),ns(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=zq(e.type,e.pendingProps,Ad.current),So=e,Vu=!0,r=pa,Xd(e.type)?(mO=r,pa=gu(i.firstChild)):pa=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=pa)&&(i=Vse(i,e.type,e.pendingProps,Vu),i!==null?(e.stateNode=i,So=e,pa=gu(i.firstChild),Vu=!1,r=!0):r=!1),r||Bm(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,ose,null,null,n),R1._currentValue=r),QE(t,e),Ss(t,e,i,n),e.child;case 6:return t===null&&er&&((t=n=pa)&&(n=Gse(n,e.pendingProps,Vu),n!==null?(e.stateNode=n,So=e,pa=null,t=!0):t=!1),t||Bm(e)),null;case 13:return ZW(t,e,n);case 4:return CM(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=z0(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,dd(e,e.type,i.value),Ss(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,zm(e),r=io(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 JW(t,e,e.type,e.pendingProps,n);case 19:return QW(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=nh(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return $W(t,e,n);case 24:return zm(e),i=io(Fa),t===null?(r=NN(),r===null&&(r=Lr,a=IN(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=n),r=a),e.memoizedState={parent:i,cache:r},LN(e),dd(e,Fa,r)):(t.lanes&n&&(q8(t,e),Vx(e,null,null,n),Hx()),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),dd(e,Fa,i)):(i=a.cache,dd(e,Fa,i),i!==r.cache&&V8(e,[Fa],n,!0))),Ss(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(It(156,e.tag))}function Of(t){t.flags|=4}function VF(t,e){if(e.type!=="stylesheet"||e.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!Vq(e)){if(e=Sc.current,e!==null&&((ji&4194048)===ji?Qu!==null:(ji&62914560)!==ji&&!(ji&536870912)||e!==Qu))throw zx=W8,aW;t.flags|=8192}}function qS(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?T7():536870912,t.lanes|=e,j0|=e)}function ky(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 na(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 gse(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 na(e),null;case 1:return na(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),ih(Fa),N0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Cy(e)?Of(e):t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,yF())),na(e),null;case 26:return n=e.memoizedState,t===null?(Of(e),n!==null?(na(e),VF(e,n)):(na(e),e.flags&=-16777217)):n?n!==t.memoizedState?(Of(e),na(e),VF(e,n)):(na(e),e.flags&=-16777217):(t.memoizedProps!==i&&Of(e),na(e),e.flags&=-16777217),null;case 27:RM(e),n=Ad.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Of(e);else{if(!i){if(e.stateNode===null)throw Error(It(166));return na(e),null}t=$u.current,Cy(e)?bF(e):(t=zq(r,i,n),e.stateNode=t,Of(e))}return na(e),null;case 5:if(RM(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Of(e);else{if(!i){if(e.stateNode===null)throw Error(It(166));return na(e),null}if(t=$u.current,Cy(e))bF(e);else{switch(r=$M(Ad.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[no]=e,t[Go]=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&&Of(e)}}return na(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&Of(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(It(166));if(t=Ad.current,Cy(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=So,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[no]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Uq(t.nodeValue,n)),t||Bm(e)}else t=$M(t).createTextNode(i),t[no]=e,e.stateNode=t}return na(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=Cy(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[no]=e}else m_(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;na(e),r=!1}else r=yF(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(Jf(e),e):(Jf(e),null)}if(Jf(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),na(e),null;case 4:return N0(),t===null&&iL(e.stateNode.containerInfo),na(e),null;case 10:return ih(e.type),na(e),null;case 19:if(as(Ba),r=e.memoizedState,r===null)return na(e),null;if(i=(e.flags&128)!==0,a=r.rendering,a===null)if(i)ky(r,!1);else{if(ma!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=jM(t),a!==null){for(e.flags|=128,ky(r,!1),t=a.updateQueue,e.updateQueue=t,qS(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)tW(n,t),n=n.sibling;return Zr(Ba,Ba.current&1|2),e.child}t=t.sibling}r.tail!==null&&Zu()>qM&&(e.flags|=128,i=!0,ky(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),ky(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!er)return na(e),null}else 2*Zu()-r.renderingStartTime>qM&&n!==536870912&&(e.flags|=128,i=!0,ky(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=Zu(),e.sibling=null,t=Ba.current,Zr(Ba,i?t&1|2:t&1),e):(na(e),null);case 22:case 23:return Jf(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)&&(na(e),e.subtreeFlags&6&&(e.flags|=8192)):na(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&&as(Em),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),ih(Fa),na(e),null;case 25:return null;case 30:return null}throw Error(It(156,e.tag))}function bse(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 ih(Fa),N0(),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(Jf(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(It(340));m_()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return as(Ba),null;case 4:return N0(),null;case 10:return ih(e.type),null;case 22:case 23:return Jf(e),PN(),t!==null&&as(Em),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return ih(Fa),null;case 25:return null;default:return null}}function tq(t,e){switch(ON(e),e.tag){case 3:ih(Fa),N0();break;case 26:case 27:case 5:RM(e);break;case 4:N0();break;case 13:Jf(e);break;case 19:as(Ba);break;case 10:ih(e.type);break;case 22:case 23:Jf(e),PN(),t!==null&&as(Em);break;case 24:ih(Fa)}}function __(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){Tr(e,e.return,o)}}function Fd(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){Tr(r,l,u)}}}i=i.next}while(i!==a)}}catch(u){Tr(e,e.return,u)}}function nq(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{lW(e,n)}catch(i){Tr(t,t.return,i)}}}function iq(t,e,n){n.props=Hm(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){Tr(t,e,i)}}function Wx(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){Tr(t,e,r)}}function Ku(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Tr(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){Tr(t,e,r)}else n.current=null}function rq(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){Tr(t,t.return,r)}}function y3(t,e,n){try{var i=t.stateNode;Fse(i,t.type,n,e),i[Go]=e}catch(r){Tr(t,t.return,r)}}function aq(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Xd(t.type)||t.tag===4}function x3(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||aq(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&&Xd(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&&Xd(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&&Xd(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 sq(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[no]=t,e[Go]=n}catch(a){Tr(t,t.return,a)}}var Gf=!1,ya=!1,_3=!1,GF=typeof WeakSet=="function"?WeakSet:Set,es=null;function vse(t,e){if(t=t.containerInfo,uO=t2,t=X7(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,es=e;es!==null;)if(e=es,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,es=t;else for(;es!==null;){switch(e=es,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=Hm(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(g,a),i.__reactInternalSnapshotBeforeUpdate=t}catch(b){Tr(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,es=t;break}es=e.return}}function oq(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Wh(t,n),i&4&&__(5,n);break;case 1:if(Wh(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(s){Tr(n,n.return,s)}else{var r=Hm(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(s){Tr(n,n.return,s)}}i&64&&nq(n),i&512&&Wx(n,n.return);break;case 3:if(Wh(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{lW(t,e)}catch(s){Tr(n,n.return,s)}}break;case 27:e===null&&i&4&&sq(n);case 26:case 5:Wh(t,n),e===null&&i&4&&rq(n),i&512&&Wx(n,n.return);break;case 12:Wh(t,n);break;case 13:Wh(t,n),i&4&&uq(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=Ase.bind(null,n),Wse(t,n))));break;case 22:if(i=n.memoizedState!==null||Gf,!i){e=e!==null&&e.memoizedState!==null||ya,r=Gf;var a=ya;Gf=i,(ya=e)&&!a?ad(t,n,(n.subtreeFlags&8772)!==0):Wh(t,n),Gf=r,ya=a}break;case 30:break;default:Wh(t,n)}}function lq(t){var e=t.alternate;e!==null&&(t.alternate=null,lq(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 Kr=null,Uo=!1;function If(t,e,n){for(n=n.child;n!==null;)cq(t,e,n),n=n.sibling}function cq(t,e,n){if(xl&&typeof xl.onCommitFiberUnmount=="function")try{xl.onCommitFiberUnmount(u_,n)}catch{}switch(n.tag){case 26:ya||Ku(n,e),If(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ya||Ku(n,e);var i=Kr,r=Uo;Xd(n.type)&&(Kr=n.stateNode,Uo=!1),If(t,e,n),Yx(n.stateNode),Kr=i,Uo=r;break;case 5:ya||Ku(n,e);case 6:if(i=Kr,r=Uo,Kr=null,If(t,e,n),Kr=i,Uo=r,Kr!==null)if(Uo)try{(Kr.nodeType===9?Kr.body:Kr.nodeName==="HTML"?Kr.ownerDocument.body:Kr).removeChild(n.stateNode)}catch(a){Tr(n,e,a)}else try{Kr.removeChild(n.stateNode)}catch(a){Tr(n,e,a)}break;case 18:Kr!==null&&(Uo?(t=Kr,nB(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),O1(t)):nB(Kr,n.stateNode));break;case 4:i=Kr,r=Uo,Kr=n.stateNode.containerInfo,Uo=!0,If(t,e,n),Kr=i,Uo=r;break;case 0:case 11:case 14:case 15:ya||Fd(2,n,e),ya||Fd(4,n,e),If(t,e,n);break;case 1:ya||(Ku(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&iq(n,e,i)),If(t,e,n);break;case 21:If(t,e,n);break;case 22:ya=(i=ya)||n.memoizedState!==null,If(t,e,n),ya=i;break;default:If(t,e,n)}}function uq(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{O1(t)}catch(n){Tr(e,e.return,n)}}function yse(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=yse(t);e.forEach(function(i){var r=Cse.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function ol(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(Xd(o.type)){Kr=o.stateNode,Uo=!1;break e}break;case 5:Kr=o.stateNode,Uo=!1;break e;case 3:case 4:Kr=o.stateNode.containerInfo,Uo=!0;break e}o=o.return}if(Kr===null)throw Error(It(160));cq(a,s,r),Kr=null,Uo=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)fq(e,t),e=e.sibling}var Qc=null;function fq(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ol(e,t),ll(t),i&4&&(Fd(3,t,t.return),__(3,t),Fd(5,t,t.return));break;case 1:ol(e,t),ll(t),i&512&&(ya||n===null||Ku(n,n.return)),i&64&&Gf&&(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=Qc;if(ol(e,t),ll(t),i&512&&(ya||n===null||Ku(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[d_]||a[no]||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[no]=t,ns(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[no]=t,ns(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:ol(e,t),ll(t),i&512&&(ya||n===null||Ku(n,n.return)),n!==null&&i&4&&y3(t,t.memoizedProps,n.memoizedProps);break;case 5:if(ol(e,t),ll(t),i&512&&(ya||n===null||Ku(n,n.return)),t.flags&32){r=t.stateNode;try{P0(r,"")}catch(d){Tr(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(ol(e,t),ll(t),i&4){if(t.stateNode===null)throw Error(It(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(d){Tr(t,t.return,d)}}break;case 3:if(nM=null,r=Qc,Qc=ZM(e.containerInfo),ol(e,t),Qc=r,ll(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{O1(e.containerInfo)}catch(d){Tr(t,t.return,d)}_3&&(_3=!1,hq(t));break;case 4:i=Qc,Qc=ZM(t.stateNode.containerInfo),ol(e,t),ll(t),Qc=i;break;case 12:ol(e,t),ll(t);break;case 13:ol(e,t),ll(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eL=Zu()),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=Gf,u=ya;if(Gf=c||r,ya=u||l,ol(e,t),ya=u,Gf=c,ll(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||l||Gf||ya||Xp(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){Tr(l,l.return,d)}}}else if(e.tag===6){if(n===null){l=e;try{l.stateNode.nodeValue=r?"":l.memoizedProps}catch(d){Tr(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:ol(e,t),ll(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,S3(t,i)));break;case 30:break;case 21:break;default:ol(e,t),ll(t)}}function ll(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(aq(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&&(P0(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){Tr(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function hq(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;hq(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Wh(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)oq(t,e.alternate,e),e=e.sibling}function Xp(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Fd(4,e,e.return),Xp(e);break;case 1:Ku(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&iq(e,e.return,n),Xp(e);break;case 27:Yx(e.stateNode);case 26:case 5:Ku(e,e.return),Xp(e);break;case 22:e.memoizedState===null&&Xp(e);break;case 30:Xp(e);break;default:Xp(e)}t=t.sibling}}function ad(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:ad(r,a,n),__(4,a);break;case 1:if(ad(r,a,n),i=a,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){Tr(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++)oW(l[r],o)}catch(c){Tr(i,i.return,c)}}n&&s&64&&nq(a),Wx(a,a.return);break;case 27:sq(a);case 26:case 5:ad(r,a,n),n&&i===null&&s&4&&rq(a),Wx(a,a.return);break;case 12:ad(r,a,n);break;case 13:ad(r,a,n),n&&s&4&&uq(r,a);break;case 22:a.memoizedState===null&&ad(r,a,n),Wx(a,a.return);break;case 30:break;default:ad(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&&b_(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&&b_(t))}function Iu(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)dq(t,e,n,i),e=e.sibling}function dq(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Iu(t,e,n,i),r&2048&&__(9,e);break;case 1:Iu(t,e,n,i);break;case 3:Iu(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&&b_(t)));break;case 12:if(r&2048){Iu(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){Tr(e,e.return,l)}}else Iu(t,e,n,i);break;case 13:Iu(t,e,n,i);break;case 23:break;case 22:a=e.stateNode,s=e.alternate,e.memoizedState!==null?a._visibility&2?Iu(t,e,n,i):qx(t,e):a._visibility&2?Iu(t,e,n,i):(a._visibility|=2,Fb(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&JN(s,e);break;case 24:Iu(t,e,n,i),r&2048&&$N(e.alternate,e);break;default:Iu(t,e,n,i)}}function Fb(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:Fb(a,s,o,l,r),__(8,s);break;case 23:break;case 22:var u=s.stateNode;s.memoizedState!==null?u._visibility&2?Fb(a,s,o,l,r):qx(a,s):(u._visibility|=2,Fb(a,s,o,l,r)),r&&c&2048&&JN(s.alternate,s);break;case 24:Fb(a,s,o,l,r),r&&c&2048&&$N(s.alternate,s);break;default:Fb(a,s,o,l,r)}e=e.sibling}}function qx(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:qx(n,i),r&2048&&JN(i.alternate,i);break;case 24:qx(n,i),r&2048&&$N(i.alternate,i);break;default:qx(n,i)}e=e.sibling}}var Sx=8192;function Hg(t){if(t.subtreeFlags&Sx)for(t=t.child;t!==null;)pq(t),t=t.sibling}function pq(t){switch(t.tag){case 26:Hg(t),t.flags&Sx&&t.memoizedState!==null&&roe(Qc,t.memoizedState,t.memoizedProps);break;case 5:Hg(t);break;case 3:case 4:var e=Qc;Qc=ZM(t.stateNode.containerInfo),Hg(t),Qc=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=Sx,Sx=16777216,Hg(t),Sx=e):Hg(t));break;default:Hg(t)}}function mq(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 Dy(t){var e=t.deletions;if(t.flags&16){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];es=i,bq(i,t)}mq(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)gq(t),t=t.sibling}function gq(t){switch(t.tag){case 0:case 11:case 15:Dy(t),t.flags&2048&&Fd(9,t,t.return);break;case 3:Dy(t);break;case 12:Dy(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)):Dy(t);break;default:Dy(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];es=i,bq(i,t)}mq(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Fd(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 bq(t,e){for(;es!==null;){var n=es;switch(n.tag){case 0:case 11:case 15:Fd(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:b_(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,es=i;else e:for(n=t;es!==null;){i=es;var r=i.sibling,a=i.return;if(lq(i),i===n){es=null;break e}if(r!==null){r.return=a,es=r;break e}es=a}}}var xse={getCacheForType:function(t){var e=io(Fa),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},_se=typeof WeakMap=="function"?WeakMap:Map,gr=0,Lr=null,Ri=null,ji=0,mr=0,pl=null,Sd=!1,Tv=!1,ZN=!1,dh=0,ma=0,Bd=0,Mm=0,QN=0,mc=0,j0=0,Xx=null,Fo=null,iO=!1,eL=0,qM=1/0,XM=null,kd=null,Ts=0,Dd=null,H0=null,g0=0,rO=0,aO=null,vq=null,Kx=0,sO=null;function Sl(){if(gr&2&&ji!==0)return ji&-ji;if(Bn.T!==null){var t=U0;return t!==0?t:nL()}return R7()}function yq(){mc===0&&(mc=!(ji&536870912)||er?M7():536870912);var t=Sc.current;return t!==null&&(t.flags|=32),mc}function wl(t,e,n){(t===Lr&&(mr===2||mr===9)||t.cancelPendingCommit!==null)&&(V0(t,0),wd(t,ji,mc,!1)),h_(t,n),(!(gr&2)||t!==Lr)&&(t===Lr&&(!(gr&2)&&(Mm|=n),ma===4&&wd(t,ji,mc,!1)),pf(t))}function xq(t,e,n){if(gr&6)throw Error(It(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||f_(t,e),r=i?Ese(t,e):w3(t,e,!0),a=i;do{if(r===0){Tv&&!i&&wd(t,e,0,!1);break}else{if(n=t.current.alternate,a&&!Sse(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=Xx;var l=o.current.memoizedState.isDehydrated;if(l&&(V0(o,s).flags|=256),s=w3(o,s,!1),s!==2){if(ZN&&!l){o.errorRecoveryDisabledLanes|=a,Mm|=a,r=4;break e}a=Fo,Fo=r,a!==null&&(Fo===null?Fo=a:Fo.push.apply(Fo,a))}r=s}if(a=!1,r!==2)continue}}if(r===1){V0(t,0),wd(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:wd(i,e,mc,!Sd);break e;case 2:Fo=null;break;case 3:case 5:break;default:throw Error(It(329))}if((e&62914560)===e&&(r=eL+300-Zu(),10<r)){if(wd(i,e,mc,!Sd),PT(i,0,!0)!==0)break e;i.timeoutHandle=Bq(WF.bind(null,i,n,Fo,XM,iO,e,mc,Mm,j0,Sd,a,2,-0,0),r);break e}WF(i,n,Fo,XM,iO,e,mc,Mm,j0,Sd,a,0,-0,0)}}break}while(!0);pf(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)&&(C1={stylesheets:null,count:0,unsuspend:ioe},pq(e),f=aoe(),f!==null)){t.cancelPendingCommit=f(XF.bind(null,t,e,a,n,i,r,s,o,l,u,1,h,d)),wd(t,a,s,!c);return}XF(t,e,a,n,i,r,s,o,l)}function Sse(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(!Al(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 wd(t,e,n,i){e&=~QN,e&=~Mm,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var a=31-_l(r),s=1<<a;i[a]=-1,r&=~s}n!==0&&A7(t,n,e)}function qT(){return gr&6?!0:(S_(0),!1)}function tL(){if(Ri!==null){if(mr===0)var t=Ri.return;else t=Ri,Yf=rg=null,jN(t),m0=null,M1=0,t=Ri;for(;t!==null;)tq(t.alternate,t),t=t.return;Ri=null}}function V0(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,zse(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),tL(),Lr=t,Ri=n=nh(t.current,null),ji=e,mr=0,pl=null,Sd=!1,Tv=f_(t,e),ZN=!1,j0=mc=QN=Mm=Bd=ma=0,Fo=Xx=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-_l(i),a=1<<r;e|=t[r],i&=~a}return dh=e,zT(),n}function _q(t,e){yi=null,Bn.H=zM,e===v_||e===HT?(e=wF(),mr=3):e===aW?(e=wF(),mr=4):mr=e===YW?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,pl=e,Ri===null&&(ma=1,VM(t,hc(e,t.current)))}function Sq(){var t=Bn.H;return Bn.H=zM,t===null?zM:t}function wq(){var t=Bn.A;return Bn.A=xse,t}function oO(){ma=4,Sd||(ji&4194048)!==ji&&Sc.current!==null||(Tv=!0),!(Bd&134217727)&&!(Mm&134217727)||Lr===null||wd(Lr,ji,mc,!1)}function w3(t,e,n){var i=gr;gr|=2;var r=Sq(),a=wq();(Lr!==t||ji!==e)&&(XM=null,V0(t,e)),e=!1;var s=ma;e:do try{if(mr!==0&&Ri!==null){var o=Ri,l=pl;switch(mr){case 8:tL(),s=6;break e;case 3:case 2:case 9:case 6:Sc.current===null&&(e=!0);var c=mr;if(mr=0,pl=null,n0(t,o,l,c),n&&Tv){s=0;break e}break;default:c=mr,mr=0,pl=null,n0(t,o,l,c)}}wse(),s=ma;break}catch(u){_q(t,u)}while(!0);return e&&t.shellSuspendCounter++,Yf=rg=null,gr=i,Bn.H=r,Bn.A=a,Ri===null&&(Lr=null,ji=0,zT()),s}function wse(){for(;Ri!==null;)Eq(Ri)}function Ese(t,e){var n=gr;gr|=2;var i=Sq(),r=wq();Lr!==t||ji!==e?(XM=null,qM=Zu()+500,V0(t,e)):Tv=f_(t,e);e:do try{if(mr!==0&&Ri!==null){e=Ri;var a=pl;t:switch(mr){case 1:mr=0,pl=null,n0(t,e,a,1);break;case 2:case 9:if(SF(a)){mr=0,pl=null,qF(e);break}e=function(){mr!==2&&mr!==9||Lr!==t||(mr=7),pf(t)},a.then(e,e);break e;case 3:mr=7;break e;case 4:mr=5;break e;case 7:SF(a)?(mr=0,pl=null,qF(e)):(mr=0,pl=null,n0(t,e,a,7));break;case 5:var s=null;switch(Ri.tag){case 26:s=Ri.memoizedState;case 5:case 27:var o=Ri;if(!s||Vq(s)){mr=0,pl=null;var l=o.sibling;if(l!==null)Ri=l;else{var c=o.return;c!==null?(Ri=c,XT(c)):Ri=null}break t}}mr=0,pl=null,n0(t,e,a,5);break;case 6:mr=0,pl=null,n0(t,e,a,6);break;case 8:tL(),ma=6;break e;default:throw Error(It(462))}}Mse();break}catch(u){_q(t,u)}while(!0);return Yf=rg=null,Bn.H=i,Bn.A=r,gr=n,Ri!==null?0:(Lr=null,ji=0,zT(),ma)}function Mse(){for(;Ri!==null&&!Xre();)Eq(Ri)}function Eq(t){var e=eq(t.alternate,t,dh);t.memoizedProps=t.pendingProps,e===null?XT(t):Ri=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,ji);break;case 11:e=BF(n,e,e.pendingProps,e.type.render,e.ref,ji);break;case 5:jN(e);default:tq(n,e),e=Ri=tW(e,dh),e=eq(n,e,dh)}t.memoizedProps=t.pendingProps,e===null?XT(t):Ri=e}function n0(t,e,n,i){Yf=rg=null,jN(e),m0=null,M1=0;var r=e.return;try{if(pse(t,r,e,n,ji)){ma=1,VM(t,hc(n,t.current)),Ri=null;return}}catch(a){if(r!==null)throw Ri=r,a;ma=1,VM(t,hc(n,t.current)),Ri=null;return}e.flags&32768?(er||i===1?t=!0:Tv||ji&536870912?t=!1:(Sd=t=!0,(i===2||i===9||i===3||i===6)&&(i=Sc.current,i!==null&&i.tag===13&&(i.flags|=16384))),Mq(e,t)):XT(e)}function XT(t){var e=t;do{if(e.flags&32768){Mq(e,Sd);return}t=e.return;var n=gse(e.alternate,e,dh);if(n!==null){Ri=n;return}if(e=e.sibling,e!==null){Ri=e;return}Ri=e=t}while(e!==null);ma===0&&(ma=5)}function Mq(t,e){do{var n=bse(t.alternate,t);if(n!==null){n.flags&=32767,Ri=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Ri=t;return}Ri=t=n}while(t!==null);ma=6,Ri=null}function XF(t,e,n,i,r,a,s,o,l){t.cancelPendingCommit=null;do KT();while(Ts!==0);if(gr&6)throw Error(It(327));if(e!==null){if(e===t.current)throw Error(It(177));if(a=e.lanes|e.childLanes,a|=CN,iae(t,n,a,s,o,l),t===Lr&&(Ri=Lr=null,ji=0),H0=e,Dd=t,g0=n,rO=a,aO=r,vq=i,e.subtreeFlags&10256||e.flags&10256?(t.callbackNode=null,t.callbackPriority=0,Rse(kM,function(){return kq(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,e.subtreeFlags&13878||i){i=Bn.T,Bn.T=null,r=ir.p,ir.p=2,s=gr,gr|=4;try{vse(t,e,n)}finally{gr=s,ir.p=r,Bn.T=i}}Ts=1,Tq(),Aq(),Cq()}}function Tq(){if(Ts===1){Ts=0;var t=Dd,e=H0,n=(e.flags&13878)!==0;if(e.subtreeFlags&13878||n){n=Bn.T,Bn.T=null;var i=ir.p;ir.p=2;var r=gr;gr|=4;try{fq(e,t);var a=fO,s=X7(t.containerInfo),o=a.focusedElem,l=a.selectionRange;if(s!==o&&o&&o.ownerDocument&&q7(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 m=pF(o,b),x=pF(o,y);if(m&&x&&(d.rangeCount!==1||d.anchorNode!==m.node||d.anchorOffset!==m.offset||d.focusNode!==x.node||d.focusOffset!==x.offset)){var _=f.createRange();_.setStart(m.node,m.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{gr=r,ir.p=i,Bn.T=n}}t.current=e,Ts=2}}function Aq(){if(Ts===2){Ts=0;var t=Dd,e=H0,n=(e.flags&8772)!==0;if(e.subtreeFlags&8772||n){n=Bn.T,Bn.T=null;var i=ir.p;ir.p=2;var r=gr;gr|=4;try{oq(t,e.alternate,e)}finally{gr=r,ir.p=i,Bn.T=n}}Ts=3}}function Cq(){if(Ts===4||Ts===3){Ts=0,Kre();var t=Dd,e=H0,n=g0,i=vq;e.subtreeFlags&10256||e.flags&10256?Ts=5:(Ts=0,H0=Dd=null,Rq(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(kd=null),xN(n),e=e.stateNode,xl&&typeof xl.onCommitFiberRoot=="function")try{xl.onCommitFiberRoot(u_,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Bn.T,r=ir.p,ir.p=2,Bn.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{Bn.T=e,ir.p=r}}g0&3&&KT(),pf(t),r=t.pendingLanes,n&4194090&&r&42?t===sO?Kx++:(Kx=0,sO=t):Kx=0,S_(0)}}function Rq(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,b_(e)))}function KT(t){return Tq(),Aq(),Cq(),kq()}function kq(){if(Ts!==5)return!1;var t=Dd,e=rO;rO=0;var n=xN(g0),i=Bn.T,r=ir.p;try{ir.p=32>n?32:n,Bn.T=null,n=aO,aO=null;var a=Dd,s=g0;if(Ts=0,H0=Dd=null,g0=0,gr&6)throw Error(It(331));var o=gr;if(gr|=4,gq(a.current),dq(a,a.current,s,n),gr=o,S_(0,!1),xl&&typeof xl.onPostCommitFiberRoot=="function")try{xl.onPostCommitFiberRoot(u_,a)}catch{}return!0}finally{ir.p=r,Bn.T=i,Rq(t,e)}}function KF(t,e,n){e=hc(n,e),e=Q8(t.stateNode,e,2),t=Rd(t,e,2),t!==null&&(h_(t,2),pf(t))}function Tr(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"&&(kd===null||!kd.has(i))){t=hc(n,t),n=XW(2),i=Rd(e,n,2),i!==null&&(KW(n,i,e,t),h_(i,2),pf(i));break}}e=e.return}}function E3(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new _se;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=Tse.bind(null,t,e,n),e.then(t,t))}function Tse(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Lr===t&&(ji&n)===n&&(ma===4||ma===3&&(ji&62914560)===ji&&300>Zu()-eL?!(gr&2)&&V0(t,0):QN|=n,j0===ji&&(j0=0)),pf(t)}function Dq(t,e){e===0&&(e=T7()),t=Mv(t,e),t!==null&&(h_(t,e),pf(t))}function Ase(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Dq(t,n)}function Cse(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),Dq(t,n)}function Rse(t,e){return vN(t,e)}var KM=null,Bb=null,lO=!1,YM=!1,M3=!1,Tm=0;function pf(t){t!==Bb&&t.next===null&&(Bb===null?KM=Bb=t:Bb=Bb.next=t),YM=!0,lO||(lO=!0,Dse())}function S_(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-_l(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=ji,a=PT(i,i===Lr?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(a&3)||f_(i,a)||(n=!0,YF(i,a));i=i.next}while(n);M3=!1}}function kse(){Oq()}function Oq(){YM=lO=!1;var t=0;Tm!==0&&(Bse()&&(t=Tm),Tm=0);for(var e=Zu(),n=null,i=KM;i!==null;){var r=i.next,a=Iq(i,e);a===0?(i.next=null,n===null?KM=r:n.next=r,r===null&&(Bb=n)):(n=i,(t!==0||a&3)&&(YM=!0)),i=r}S_(t)}function Iq(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,a=t.pendingLanes&-62914561;0<a;){var s=31-_l(a),o=1<<s,l=r[s];l===-1?(!(o&n)||o&i)&&(r[s]=nae(o,e)):l<=e&&(t.expiredLanes|=o),a&=~o}if(e=Lr,n=ji,n=PT(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(mr===2||mr===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&$R(i),t.callbackNode=null,t.callbackPriority=0;if(!(n&3)||f_(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&$R(i),xN(n)){case 2:case 8:n=w7;break;case 32:n=kM;break;case 268435456:n=E7;break;default:n=kM}return i=Nq.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 Nq(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=ji;return i=PT(t,t===Lr?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(xq(t,i,e),Iq(t,Zu()),t.callbackNode!=null&&t.callbackNode===n?Nq.bind(null,t):null)}function YF(t,e){if(KT())return null;xq(t,e,!0)}function Dse(){jse(function(){gr&6?vN(S7,kse):Oq()})}function nL(){return Tm===0&&(Tm=M7()),Tm}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 Ose(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var a=JF((r[Go]||null).action),s=i.submitter;s&&(e=(e=s[Go]||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(Tm!==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],Ise=A3.toLowerCase(),Nse=A3[0].toUpperCase()+A3.slice(1);wu(Ise,"on"+Nse)}wu(Y7,"onAnimationEnd");wu(J7,"onAnimationIteration");wu($7,"onAnimationStart");wu("dblclick","onDoubleClick");wu("focusin","onFocus");wu("focusout","onBlur");wu($ae,"onTransitionRun");wu(Zae,"onTransitionStart");wu(Qae,"onTransitionCancel");wu(Z7,"onTransitionEnd");L0("onMouseEnter",["mouseout","mouseover"]);L0("onMouseLeave",["mouseout","mouseover"]);L0("onPointerEnter",["pointerout","pointerover"]);L0("onPointerLeave",["pointerout","pointerover"]);tg("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));tg("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));tg("onBeforeInput",["compositionend","keypress","textInput","paste"]);tg("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));tg("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));tg("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var T1="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(" "),Lse=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(T1));function Lq(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 Ci(t,e){var n=e[O8];n===void 0&&(n=e[O8]=new Set);var i=t+"__bubble";n.has(i)||(Pq(e,t,2,!1),n.add(i))}function C3(t,e,n){var i=0;e&&(i|=4),Pq(n,t,i,e)}var XS="_reactListening"+Math.random().toString(36).slice(2);function iL(t){if(!t[XS]){t[XS]=!0,k7.forEach(function(n){n!=="selectionchange"&&(Lse.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 Pq(t,e,n,i){switch(Kq(e)){case 2:var r=loe;break;case 8:r=coe;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=Xb(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}F7(function(){var c=a,u=wN(n),f=[];e:{var h=Q7.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=Rae;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=bae;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=Oae;break;case Y7:case J7:case $7:d=xae;break;case Z7:d=Nae;break;case"scroll":case"scrollend":d=mae;break;case"wheel":d=Pae;break;case"copy":case"cut":case"paste":d=Sae;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=Fae}var b=(e&4)!==0,y=!b&&(t==="scroll"||t==="scrollend"),m=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||m===null||(w=x1(x,m),w!=null&&b.push(A1(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)&&(Xb(g)||g[wv]))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?Xb(g):null,g!==null&&(y=c_(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",m="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(b=sF,w="onPointerLeave",m="onPointerEnter",x="pointer"),y=d==null?h:_x(d),_=g==null?h:_x(g),h=new b(w,x+"leave",d,n,u),h.target=y,h.relatedTarget=_,w=null,Xb(u)===c&&(b=new b(m,x+"enter",g,n,u),b.target=_,b.relatedTarget=y,w=b),y=w,d&&g)t:{for(b=d,m=g,x=0,_=b;_;_=Vg(_))x++;for(_=0,w=m;w;w=Vg(w))_++;for(;0<x-_;)b=Vg(b),x--;for(;0<_-x;)m=Vg(m),_--;for(;x--;){if(b===m||m!==null&&b===m.alternate)break t;b=Vg(b),m=Vg(m)}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?_x(c):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var M=uF;else if(cF(h))if(G7)M=Kae;else{M=qae;var S=Wae}else d=h.nodeName,!d||d.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&SN(c.elementType)&&(M=uF):M=Xae;if(M&&(M=M(t,c))){V7(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?_x(c):window,t){case"focusin":(cF(S)||S.contentEditable==="true")&&(Jb=S,U8=c,Fx=null);break;case"focusout":Fx=U8=Jb=null;break;case"mousedown":F8=!0;break;case"contextmenu":case"mouseup":case"dragend":F8=!1,mF(f,n,u);break;case"selectionchange":if(Jae)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 Yb?j7(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(z7&&n.locale!=="ko"&&(Yb||C!=="onCompositionStart"?C==="onCompositionEnd"&&Yb&&(A=B7()):(_d=u,EN="value"in _d?_d.value:_d.textContent,Yb=!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=H7(n),A!==null&&(C.data=A)))),(A=zae?jae(t,n):Hae(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)),Ose(f,t,c,n,u)}Lq(f,e)})}function A1(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=x1(t,n),r!=null&&i.unshift(A1(t,r,a)),r=x1(t,e),r!=null&&i.push(A1(t,r,a))),t.tag===3)return i;t=t.return}return[]}function Vg(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=x1(n,a),c!=null&&s.unshift(A1(n,c,l))):r||(c=x1(n,a),c!=null&&s.push(A1(n,c,l)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var Pse=/\r\n?/g,Use=/\u0000|\uFFFD/g;function QF(t){return(typeof t=="string"?t:""+t).replace(Pse,`
`).replace(Use,"")}function Uq(t,e){return e=QF(e),QF(t)===e}function YT(){}function xr(t,e,n,i,r,a){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||P0(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&P0(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":U7(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"&&xr(t,e,"name",r.name,r,null),xr(t,e,"formEncType",r.formEncType,r,null),xr(t,e,"formMethod",r.formMethod,r,null),xr(t,e,"formTarget",r.formTarget,r,null)):(xr(t,e,"encType",r.encType,r,null),xr(t,e,"method",r.method,r,null),xr(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&&Ci("scroll",t);break;case"onScrollEnd":i!=null&&Ci("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":Ci("beforetoggle",t),Ci("toggle",t),WE(t,"popover",i);break;case"xlinkActuate":Df(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Df(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Df(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Df(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Df(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Df(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Df(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Df(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Df(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=dae.get(n)||n,WE(t,n,i))}}function cO(t,e,n,i,r,a){switch(n){case"style":U7(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"?P0(t,i):(typeof i=="number"||typeof i=="bigint")&&P0(t,""+i);break;case"onScroll":i!=null&&Ci("scroll",t);break;case"onScrollEnd":i!=null&&Ci("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(!D7.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[Go]||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":Ci("error",t),Ci("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:xr(t,e,a,s,n,null)}}r&&xr(t,e,"srcSet",n.srcSet,n,null),i&&xr(t,e,"src",n.src,n,null);return;case"input":Ci("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:xr(t,e,i,u,n,null)}}N7(t,a,o,l,c,s,r,!1),DM(t);return;case"select":Ci("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:xr(t,e,r,o,n,null)}e=a,n=s,t.multiple=!!i,e!=null?u0(t,!!i,e,!1):n!=null&&u0(t,!!i,n,!0);return;case"textarea":Ci("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:xr(t,e,s,o,n,null)}P7(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:xr(t,e,l,i,n,null)}return;case"dialog":Ci("beforetoggle",t),Ci("toggle",t),Ci("cancel",t),Ci("close",t);break;case"iframe":case"object":Ci("load",t);break;case"video":case"audio":for(i=0;i<T1.length;i++)Ci(T1[i],t);break;case"image":Ci("error",t),Ci("load",t);break;case"details":Ci("toggle",t);break;case"embed":case"source":case"link":Ci("error",t),Ci("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:xr(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&&xr(t,e,o,i,n,null))}function Fse(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)||xr(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&&xr(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)||xr(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&&xr(t,e,r,a,i,l)}e=o,n=s,i=d,h!=null?u0(t,!!n,h,!1):!!i!=!!n&&(e!=null?u0(t,!!n,e,!0):u0(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:xr(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&&xr(t,e,s,r,i,a)}L7(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:xr(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:xr(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)&&xr(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:xr(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 m in n)h=n[m],n.hasOwnProperty(m)&&h!=null&&!i.hasOwnProperty(m)&&xr(t,e,m,null,i,h);for(f in i)h=i[f],d=n[f],!i.hasOwnProperty(f)||h===d||h==null&&d==null||xr(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 Fq(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 Bse(){var t=window.event;return t&&t.type==="popstate"?t===k3?!1:(k3=t,!0):(k3=null,!1)}var Bq=typeof setTimeout=="function"?setTimeout:void 0,zse=typeof clearTimeout=="function"?clearTimeout:void 0,tB=typeof Promise=="function"?Promise:void 0,jse=typeof queueMicrotask=="function"?queueMicrotask:typeof tB<"u"?function(t){return tB.resolve(null).then(t).catch(Hse)}:Bq;function Hse(t){setTimeout(function(){throw t})}function Xd(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&&Yx(s.documentElement),n&2&&Yx(s.body),n&4)for(n=s.head,Yx(n),s=n.firstChild;s;){var o=s.nextSibling,l=s.nodeName;s[d_]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=o}}if(r===0){t.removeChild(a),O1(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=a}while(n);O1(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 Vse(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[d_])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=gu(t.nextSibling),t===null)break}return null}function Gse(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=gu(t.nextSibling),t===null))return null;return t}function pO(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function Wse(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 gu(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 zq(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 Yx(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);_N(t)}var wc=new Map,rB=new Set;function ZM(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var _h=ir.d;ir.d={f:qse,r:Xse,D:Kse,C:Yse,L:Jse,m:$se,X:Qse,S:Zse,M:eoe};function qse(){var t=_h.f(),e=qT();return t||e}function Xse(t){var e=Ev(t);e!==null&&e.tag===5&&e.type==="form"?IW(e):_h.r(t)}var Av=typeof document>"u"?null:document;function jq(t,e,n){var i=Av;if(i&&typeof e=="string"&&e){var r=fc(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),ns(e),i.head.appendChild(e)))}}function Kse(t){_h.D(t),jq("dns-prefetch",t,null)}function Yse(t,e){_h.C(t,e),jq("preconnect",t,e)}function Jse(t,e,n){_h.L(t,e,n);var i=Av;if(i&&t&&e){var r='link[rel="preload"][as="'+fc(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+fc(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+fc(n.imageSizes)+'"]')):r+='[href="'+fc(t)+'"]';var a=r;switch(e){case"style":a=G0(t);break;case"script":a=Cv(t)}wc.has(a)||(t=Gr({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),wc.set(a,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(w_(a))||e==="script"&&i.querySelector(E_(a))||(e=i.createElement("link"),Rs(e,"link",t),ns(e),i.head.appendChild(e)))}}function $se(t,e){_h.m(t,e);var n=Av;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+fc(i)+'"][href="'+fc(t)+'"]',a=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Cv(t)}if(!wc.has(a)&&(t=Gr({rel:"modulepreload",href:t},e),wc.set(a,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(E_(a)))return}i=n.createElement("link"),Rs(i,"link",t),ns(i),n.head.appendChild(i)}}}function Zse(t,e,n){_h.S(t,e,n);var i=Av;if(i&&t){var r=c0(i).hoistableStyles,a=G0(t);e=e||"default";var s=r.get(a);if(!s){var o={loading:0,preload:null};if(s=i.querySelector(w_(a)))o.loading=5;else{t=Gr({rel:"stylesheet",href:t,"data-precedence":e},n),(n=wc.get(a))&&rL(t,n);var l=s=i.createElement("link");ns(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 Qse(t,e){_h.X(t,e);var n=Av;if(n&&t){var i=c0(n).hoistableScripts,r=Cv(t),a=i.get(r);a||(a=n.querySelector(E_(r)),a||(t=Gr({src:t,async:!0},e),(e=wc.get(r))&&aL(t,e),a=n.createElement("script"),ns(a),Rs(a,"link",t),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},i.set(r,a))}}function eoe(t,e){_h.M(t,e);var n=Av;if(n&&t){var i=c0(n).hoistableScripts,r=Cv(t),a=i.get(r);a||(a=n.querySelector(E_(r)),a||(t=Gr({src:t,async:!0,type:"module"},e),(e=wc.get(r))&&aL(t,e),a=n.createElement("script"),ns(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=Ad.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=G0(n.href),n=c0(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=G0(n.href);var a=c0(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(w_(t)))&&!a._p&&(s.instance=a,s.state.loading=5),wc.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},wc.set(t,n),a||toe(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=Cv(n),n=c0(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 G0(t){return'href="'+fc(t)+'"'}function w_(t){return'link[rel="stylesheet"]['+t+"]"}function Hq(t){return Gr({},t,{"data-precedence":t.precedence,precedence:null})}function toe(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),ns(e),t.head.appendChild(e))}function Cv(t){return'[src="'+fc(t)+'"]'}function E_(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~="'+fc(n.href)+'"]');if(i)return e.instance=i,ns(i),i;var r=Gr({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ns(i),Rs(i,"style",r),tM(i,n.precedence,t),e.instance=i;case"stylesheet":r=G0(n.href);var a=t.querySelector(w_(r));if(a)return e.state.loading|=4,e.instance=a,ns(a),a;i=Hq(n),(r=wc.get(r))&&rL(i,r),a=(t.ownerDocument||t).createElement("link"),ns(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=Cv(n.src),(r=t.querySelector(E_(a)))?(e.instance=r,ns(r),r):(i=n,(r=wc.get(a))&&(i=Gr({},n),aL(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),ns(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[d_]||a[no]||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 noe(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 Vq(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}var C1=null;function ioe(){}function roe(t,e,n){if(C1===null)throw Error(It(475));var i=C1;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var r=G0(n.href),a=t.querySelector(w_(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,ns(a);return}a=t.ownerDocument||t,n=Hq(n),(r=wc.get(r))&&rL(n,r),a=a.createElement("link"),ns(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 aoe(){if(C1===null)throw Error(It(475));var t=C1;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(soe,t),e2=null,QM.call(t))}function soe(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 R1={$$typeof:qf,Provider:null,Consumer:null,_currentValue:xm,_currentValue2:xm,_threadCount:0};function ooe(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 Gq(t,e,n,i,r,a,s,o,l,c,u,f){return t=new ooe(t,e,n,s,o,l,c,f),e=1,a===!0&&(e|=24),a=gl(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 Wq(t){return t?(t=Qb,t):Qb}function qq(t,e,n,i,r,a){r=Wq(r),i.context===null?i.context=r:i.pendingContext=r,i=Cd(e),i.payload={element:n},a=a===void 0?null:a,a!==null&&(i.callback=a),n=Rd(t,i,e),n!==null&&(wl(n,t,e),jx(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 Xq(t){if(t.tag===13){var e=Mv(t,67108864);e!==null&&wl(e,t,67108864),sL(t,67108864)}}var t2=!0;function loe(t,e,n,i){var r=Bn.T;Bn.T=null;var a=ir.p;try{ir.p=2,oL(t,e,n,i)}finally{ir.p=a,Bn.T=r}}function coe(t,e,n,i){var r=Bn.T;Bn.T=null;var a=ir.p;try{ir.p=8,oL(t,e,n,i)}finally{ir.p=a,Bn.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(foe(r,t,e,n,i))i.stopPropagation();else if(uB(t,i),e&4&&-1<uoe.indexOf(t)){for(;r!==null;){var a=Ev(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var s=Wp(a.pendingLanes);if(s!==0){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var l=1<<31-_l(s);o.entanglements[1]|=l,s&=~l}pf(a),!(gr&6)&&(qM=Zu()+500,S_(0))}}break;case 13:o=Mv(a,2),o!==null&&wl(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=Xb(t),t!==null){var e=c_(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=v7(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 Kq(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(Yre()){case S7:return 2;case w7:return 8;case kM:case Jre:return 32;case E7:return 268435456;default:return 32}default:return 32}}var vO=!1,Od=null,Id=null,Nd=null,k1=new Map,D1=new Map,gd=[],uoe="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":Od=null;break;case"dragenter":case"dragleave":Id=null;break;case"mouseover":case"mouseout":Nd=null;break;case"pointerover":case"pointerout":k1.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":D1.delete(e.pointerId)}}function Oy(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=Ev(e),e!==null&&Xq(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function foe(t,e,n,i,r){switch(e){case"focusin":return Od=Oy(Od,t,e,n,i,r),!0;case"dragenter":return Id=Oy(Id,t,e,n,i,r),!0;case"mouseover":return Nd=Oy(Nd,t,e,n,i,r),!0;case"pointerover":var a=r.pointerId;return k1.set(a,Oy(k1.get(a)||null,t,e,n,i,r)),!0;case"gotpointercapture":return a=r.pointerId,D1.set(a,Oy(D1.get(a)||null,t,e,n,i,r)),!0}return!1}function Yq(t){var e=Xb(t.target);if(e!==null){var n=c_(e);if(n!==null){if(e=n.tag,e===13){if(e=v7(n),e!==null){t.blockedOn=e,rae(t.priority,function(){if(n.tag===13){var i=Sl();i=yN(i);var r=Mv(n,i);r!==null&&wl(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=Ev(n),e!==null&&Xq(e),t.blockedOn=n,!1;e.shift()}return!0}function fB(t,e,n){iM(t)&&n.delete(e)}function hoe(){vO=!1,Od!==null&&iM(Od)&&(Od=null),Id!==null&&iM(Id)&&(Id=null),Nd!==null&&iM(Nd)&&(Nd=null),k1.forEach(fB),D1.forEach(fB)}function KS(t,e){t.blockedOn===e&&(t.blockedOn=null,vO||(vO=!0,za.unstable_scheduleCallback(za.unstable_NormalPriority,hoe)))}var YS=null;function hB(t){YS!==t&&(YS=t,za.unstable_scheduleCallback(za.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=Ev(n);a!==null&&(t.splice(e,3),e-=3,$8(a,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function O1(t){function e(l){return KS(l,t)}Od!==null&&KS(Od,t),Id!==null&&KS(Id,t),Nd!==null&&KS(Nd,t),k1.forEach(e),D1.forEach(e);for(var n=0;n<gd.length;n++){var i=gd[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<gd.length&&(n=gd[0],n.blockedOn===null);)Yq(n),n.blockedOn===null&&gd.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[Go]||null;if(typeof a=="function")s||hB(n);else if(s){var o=null;if(a&&a.hasAttribute("formAction")){if(r=a,s=a[Go]||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=Sl();qq(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;qq(t.current,2,null,t,null,null),qT(),e[wv]=null}};function JT(t){this._internalRoot=t}JT.prototype.unstable_scheduleHydration=function(t){if(t){var e=R7();t={blockedOn:null,target:t,priority:e};for(var n=0;n<gd.length&&e!==0&&e<gd[n].priority;n++);gd.splice(n,0,t),n===0&&Yq(t)}};var dB=g7.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=Hre(e),t=t!==null?y7(t):null,t=t===null?null:t.stateNode,t};var doe={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:Bn,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var JS=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!JS.isDisabled&&JS.supportsFiber)try{u_=JS.inject(doe),xl=JS}catch{}}NT.createRoot=function(t,e){if(!b7(t))throw Error(It(299));var n=!1,i="",r=GW,a=WW,s=qW,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=Gq(t,1,!1,null,null,n,i,r,a,s,o,null),t[wv]=e.current,iL(t),new cL(e)};NT.hydrateRoot=function(t,e,n){if(!b7(t))throw Error(It(299));var i=!1,r="",a=GW,s=WW,o=qW,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=Gq(t,1,!0,e,n??null,i,r,a,s,o,l,c),e.context=Wq(null),n=e.current,i=Sl(),i=yN(i),r=Cd(i),r.callback=null,Rd(n,r,i),n=i,e.current.lanes=n,h_(e,n),pf(e),t[wv]=e.current,iL(t),new JT(e)};NT.version="19.1.1";function Jq(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jq)}catch(t){console.error(t)}}Jq(),n7.exports=NT;var $q=n7.exports;const poe=Rc($q);var yO=new Map,$S=new WeakMap,pB=0,moe=void 0;function goe(t){return t?($S.has(t)||(pB+=1,$S.set(t,pB.toString())),$S.get(t)):"0"}function boe(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?goe(t.root):t[e]}`).toString()}function voe(t){const e=boe(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 yoe(t,e,n={},i=moe){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}=voe(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 xoe({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 _=yoe(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,m=I.useRef(void 0);!f&&y&&!a&&!s&&m.current!==y&&(m.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 gc(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 Zq(t="mantine-"){return`${t}${Math.random().toString(36).slice(2,11)}`}function em(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=em(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 _oe=["mousedown","touchstart"];function Soe(t,e,n){const i=I.useRef(null),r=e||_oe;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 woe(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 Eoe(t,e){try{return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}catch{return t.addListener(e),()=>t.removeListener(e)}}function Moe(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:Moe(t));return I.useEffect(()=>{try{const a=window.matchMedia(t);return r(a.matches),Eoe(a,s=>r(s.matches))}catch{return}},[t]),i||!1}function Toe(t,e){return uL("(prefers-color-scheme: dark)",t==="dark",e)?"dark":"light"}const Rv=typeof document<"u"?I.useLayoutEffect:I.useEffect;function _c(t,e){const n=I.useRef(!1);I.useEffect(()=>()=>{n.current=!1},[]),I.useEffect(()=>{if(n.current)return t();n.current=!0},e)}function Qq({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 _c(()=>{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 Aoe=/input|select|textarea|button|object/,eX="a, input, select, textarea, button, object, [tabindex]";function Coe(t){return t.style.display==="none"}function Roe(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(Coe(n))return!1;n=n.parentNode}return!0}function tX(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(tX(t));return(Aoe.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||n)&&Roe(t)}function nX(t){const e=tX(t);return(Number.isNaN(e)||e>=0)&&xO(t)}function koe(t){return Array.from(t.querySelectorAll(eX)).filter(nX)}function Doe(t,e){const n=koe(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 Ooe(t=!0){const e=I.useRef(null),n=r=>{let a=r.querySelector("[data-autofocus]");if(!a){const s=Array.from(r.querySelectorAll(eX));a=s.find(nX)||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&&Doe(e.current,a)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t]),i}const Ioe=t=>(t+1)%1e6;function Noe(){const[,t]=I.useReducer(Ioe,0);return t}const Loe=Ce.useId||(()=>{});function Poe(){const t=Loe();return t?`mantine-${t.replace(/:/g,"")}`:""}function mf(t){const e=Poe(),[n,i]=I.useState(e);return Rv(()=>{i(Zq())},[]),typeof t=="string"?t:typeof window>"u"?e:n}function Uoe(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 iX(...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(iX(...t),t)}function rX(t){return{x:gc(t.x,0,1),y:gc(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=gc((w-S.left)/S.width,0,1);t({x:n==="ltr"?A:1-A,y:gc((M-S.top)/S.height,0,1)})}}})},h=()=>{document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("touchend",b)},d=()=>{document.removeEventListener("mousemove",m),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(),m(w)},m=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 Cl({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 Foe={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function Boe(t){const e=I.useRef(0),n=I.useRef(null),[i,r]=I.useState(Foe),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 aX(t){const[e,{width:n,height:i}]=Boe(t);return{ref:e,width:n,height:i}}function Ec(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 zoe(t){const e=I.useRef(void 0);return I.useEffect(()=>{e.current=t},[t]),e.current}function joe(){const[t,e]=I.useState(!1);Rv(()=>{e(typeof window<"u"&&!Hoe()&&"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 Hoe(){return navigator.userAgent.includes("OPR")}function Voe(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 Goe(t){return I.useSyncExternalStore(t.subscribe,()=>t.getState(),()=>t.getState())}function Woe(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 qoe=()=>Voe({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),ag=qoe(),Xoe=(t=ag)=>Goe(t);function kv(t,e){const n=t.getState(),i=e([...n.notifications,...n.queue]),r=Woe(i,n.defaultPosition,n.limit);t.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Koe(t,e=ag){const n=t.id||Zq();return kv(e,i=>t.id&&i.some(r=>r.id===t.id)?i:[...i,{...t,id:n}]),n}function sX(t,e=ag){return kv(e,n=>n.filter(i=>i.id===t?(i.onClose?.(i),!1):!0)),t}function Yoe(t,e=ag){return kv(e,n=>n.map(i=>i.id===t.id?{...i,...t}:i)),t.id}function Joe(t=ag){kv(t,()=>[])}function $oe(t=ag){kv(t,e=>e.slice(0,t.getState().limit))}const ks={show:Koe,hide:sX,update:Yoe,clean:Joe,cleanQueue:$oe,updateState:kv};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 oX(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,_O(t,e)}var lX={exports:{}},Zoe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Qoe=Zoe,ele=Qoe;function cX(){}function uX(){}uX.resetWarningCache=cX;var tle=function(){function t(i,r,a,s,o,l){if(l!==ele){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:uX,resetWarningCache:cX};return n.PropTypes=n,n};lX.exports=tle();var fX=lX.exports;const mB={disabled:!1},r2=Ce.createContext(null);var nle=function(e){return e.scrollTop},wx="unmounted",Kp="exited",Yp="entering",zb="entered",SO="exiting",Sh=function(t){oX(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=Kp,a.appearStatus=Yp):l=zb:i.unmountOnExit||i.mountOnEnter?l=wx:l=Kp,a.state={status:l},a.nextCallback=null,a}e.getDerivedStateFromProps=function(r,a){var s=r.in;return s&&a.status===wx?{status:Kp}: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!==Yp&&s!==zb&&(a=Yp):(s===Yp||s===zb)&&(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===Yp){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:vx.findDOMNode(this);s&&nle(s)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Kp&&this.setState({status:wx})},n.performEnter=function(r){var a=this,s=this.props.enter,o=this.context?this.context.isMounting:r,l=this.props.nodeRef?[o]:[vx.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:zb},function(){a.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Yp},function(){a.props.onEntering(c,u),a.onTransitionEnd(h,function(){a.safeSetState({status:zb},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:vx.findDOMNode(this);if(!a||mB.disabled){this.safeSetState({status:Kp},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:Kp},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:vx.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===wx)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 Ce.createElement(r2.Provider,{value:null},typeof s=="function"?s(r,o):Ce.cloneElement(Ce.Children.only(s),o))},e}(Ce.Component);Sh.contextType=r2;Sh.propTypes={};function Gg(){}Sh.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Gg,onEntering:Gg,onEntered:Gg,onExit:Gg,onExiting:Gg,onExited:Gg};Sh.UNMOUNTED=wx;Sh.EXITED=Kp;Sh.ENTERING=Yp;Sh.ENTERED=zb;Sh.EXITING=SO;function ile(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 rle(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 am(t,e,n){return n[e]!=null?n[e]:t.props[e]}function ale(t,e){return dL(t.children,function(n){return I.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:am(n,"appear",t),enter:am(n,"enter",t),exit:am(n,"exit",t)})})}function sle(t,e,n){var i=dL(t.children),r=rle(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:am(s,"exit",t),enter:am(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:am(s,"exit",t),enter:am(s,"enter",t)}))}}),r}var ole=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},lle={component:"div",childFactory:function(e){return e}},cd=function(t){oX(e,t);function e(i,r){var a;a=t.call(this,i,r)||this;var s=a.handleExited.bind(ile(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?ale(r,o):sle(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=ole(this.state.children).map(s);return delete o.appear,delete o.enter,delete o.exit,a===null?Ce.createElement(r2.Provider,{value:l},c):Ce.createElement(r2.Provider,{value:l},Ce.createElement(a,o,c))},e}(Ce.Component);cd.propTypes={};cd.defaultProps=lle;var Gu=function(){return Gu=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},Gu.apply(this,arguments)};function hX(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 cle(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",ule="with-scroll-bars-hidden",fle="--removed-body-scroll-bar-size";function D3(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function hle(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 dle=typeof window<"u"?I.useLayoutEffect:I.useEffect,gB=new WeakMap;function ple(t,e){var n=hle(null,function(i){return t.forEach(function(r){return D3(r,i)})});return dle(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 mle(t){return t}function gle(t,e){e===void 0&&(e=mle);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 ble(t){t===void 0&&(t={});var e=gle(null);return e.options=Gu({async:!0,ssr:!1},t),e}var dX=function(t){var e=t.sideCar,n=hX(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,Gu({},n))};dX.isSideCarExport=!0;function vle(t,e){return t.useMedium(e),dX}var pX=ble(),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,m=t.as,x=m===void 0?"div":m,_=t.gapMode,w=hX(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=h,S=ple([n,e]),A=Gu(Gu({},w),r);return I.createElement(I.Fragment,null,u&&I.createElement(M,{sideCar:pX,removeScrollBar:c,shards:f,noRelative:d,noIsolation:g,inert:b,setCallbacks:a,allowPinchZoom:!!y,lockRef:n,gapMode:_}),s?I.cloneElement(I.Children.only(o),Gu(Gu({},A),{ref:S})):I.createElement(x,Gu({},A,{className:l,ref:S}),o))});QT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};QT.classNames={fullWidth:aM,zeroRight:rM};var yle=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xle(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=yle();return e&&t.setAttribute("nonce",e),t}function _le(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Sle(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var wle=function(){var t=0,e=null;return{add:function(n){t==0&&(e=xle())&&(_le(e,n),Sle(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Ele=function(){var t=wle();return function(e,n){I.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},mX=function(){var t=Ele(),e=function(n){var i=n.styles,r=n.dynamic;return t(i,r),null};return e},Mle={left:0,top:0,right:0,gap:0},I3=function(t){return parseInt(t||"",10)||0},Tle=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)]},Ale=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Mle;var e=Tle(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])}},Cle=mX(),b0="data-scroll-locked",Rle=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(ule,` {
   overflow: hidden `).concat(i,`;
   padding-right: `).concat(o,"px ").concat(i,`;
  }
  body[`).concat(b0,`] {
    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(b0,`] {
    `).concat(fle,": ").concat(o,`px;
  }
`)},bB=function(){var t=parseInt(document.body.getAttribute(b0)||"0",10);return isFinite(t)?t:0},kle=function(){I.useEffect(function(){return document.body.setAttribute(b0,(bB()+1).toString()),function(){var t=bB()-1;t<=0?document.body.removeAttribute(b0):document.body.setAttribute(b0,t.toString())}},[])},Dle=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;kle();var a=I.useMemo(function(){return Ale(r)},[r]);return I.createElement(Cle,{styles:Rle(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 Wg=wO?{passive:!1}:!1,Ole=function(t){return t.tagName==="TEXTAREA"},gX=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ole(t)&&n[e]==="visible")},Ile=function(t){return gX(t,"overflowY")},Nle=function(t){return gX(t,"overflowX")},vB=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=bX(t,i);if(r){var a=vX(t,i),s=a[1],o=a[2];if(s>o)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Lle=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},Ple=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},bX=function(t,e){return t==="v"?Ile(e):Nle(e)},vX=function(t,e){return t==="v"?Lle(e):Ple(e)},Ule=function(t,e){return t==="h"&&e==="rtl"?-1:1},Fle=function(t,e,n,i,r){var a=Ule(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=vX(t,o),g=d[0],b=d[1],y=d[2],m=b-y-a*g;(g||m)&&bX(t,o)&&(f+=m,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},Ble=function(t,e){return t[0]===e[0]&&t[1]===e[1]},zle=function(t){return`
  .block-interactivity-`.concat(t,` {pointer-events: none;}
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},jle=0,qg=[];function Hle(t){var e=I.useRef([]),n=I.useRef([0,0]),i=I.useRef(),r=I.useState(jle++)[0],a=I.useState(mX)[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=cle([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 m=QS(b),x=n.current,_="deltaX"in b?b.deltaX:x[0]-m[0],w="deltaY"in b?b.deltaY:x[1]-m[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 Fle(D,y,b,D==="h"?_:w)},[]),l=I.useCallback(function(b){var y=b;if(!(!qg.length||qg[qg.length-1]!==a)){var m="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)&&Ble(M.delta,m)})[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,m,x){var _={name:b,delta:y,target:m,should:x,shadowParent:Vle(m)};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 qg.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Wg),document.addEventListener("touchmove",l,Wg),document.addEventListener("touchstart",u,Wg),function(){qg=qg.filter(function(b){return b!==a}),document.removeEventListener("wheel",l,Wg),document.removeEventListener("touchmove",l,Wg),document.removeEventListener("touchstart",u,Wg)}},[]);var d=t.removeScrollBar,g=t.inert;return I.createElement(I.Fragment,null,g?I.createElement(a,{styles:zle(r)}):null,d?I.createElement(Dle,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Vle(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const Gle=vle(pX,Hle);var a2=I.forwardRef(function(t,e){return I.createElement(QT,Gu({},t,{ref:e,sideCar:Gle}))});a2.classNames=QT.classNames;function ef(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 Wle(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function qle(t){return typeof t!="string"||!t.includes("var(--mantine-scale)")?t:t.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function Xle(t){const e=qle(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 yX(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=yX("rem",{shouldScale:!0}),EO=yX("em");function eA(t){return Object.keys(t).reduce((e,n)=>(t[n]!==void 0&&(e[n]=t[n]),e),{})}function xX(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 sg(t){return Array.isArray(t)||t===null?!1:typeof t=="object"?t.type!==I.Fragment:!1}function Eu(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 M_(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 Kle(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 Yle(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 Jle(t,e,n){return MO(t,n)===MO(e,n)}function $le({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=>Jle(o.currentTarget,g,t)),c=l.findIndex(g=>o.currentTarget===g),u=Yle(c,l,i),f=Kle(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 Zle={app:100,modal:200,popover:300,overlay:400,max:9999};function gf(t){return Zle[t]}const s2=()=>{};function Qle(t,e={active:!0}){return typeof t!="function"||!e.active?e.onKeyDown||s2:n=>{n.key==="Escape"&&(t(n),e.onTrigger?.())}}function ui(t,e="size",n=!0){if(t!==void 0)return xX(t)?n?Et(t):t:`var(--${e}-${t})`}function zd(t){return ui(t,"mantine-spacing")}function la(t){return t===void 0?"var(--mantine-radius-default)":ui(t,"mantine-radius")}function Ds(t){return ui(t,"mantine-font-size")}function _X(t){return ui(t,"mantine-line-height",!1)}function mL(t){if(t)return ui(t,"mantine-shadow",!1)}var ece={};function tce(){return typeof process<"u"&&ece?"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=Ce.version;return typeof Ce.version!="string"||e.startsWith("18.")?t?.ref:t?.props?.ref}function SX(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=SX(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function ls(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=SX(t))&&(i&&(i+=" "),i+=e);return i}const nce={};function ice(t){const e={};return t.forEach(n=>{Object.entries(n).forEach(([i,r])=>{e[i]?e[i]=ls(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||nce);return ice(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 Kd(){const t=I.useContext(gL);if(!t)throw new Error("[@mantine/core] MantineProvider was not found in tree");return t}function rce(){return Kd().cssVariablesResolver}function ace(){return Kd().classNamesPrefix}function iA(){return Kd().getStyleNonce}function sce(){return Kd().withStaticClasses}function oce(){return Kd().headless}function lce(){return Kd().stylesTransform?.sx}function cce(){return Kd().stylesTransform?.styles}function rA(){return Kd().env||"default"}function uce(t){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(t)}function fce(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 hce(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 dce(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 uce(t)?fce(t):t.startsWith("rgb")?hce(t):t.startsWith("hsl")?dce(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 I1(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 pce(t){const e=t.match(/oklch\((.*?)%\s/);return e?parseFloat(e[1]):null}function wX(t){if(t.startsWith("oklch("))return(pce(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 Iy(t,e=.179){return t.startsWith("var(")?!1:wX(t)>e}function ph({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:Iy(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:Iy(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:Iy(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][I1(e,n||"light")];return{color:i,value:o,shade:a,isThemeColor:s,isLight:Iy(o,e.luminanceThreshold),variable:r?`--mantine-color-${i}-${a}`:`--mantine-color-${i}-filled`}}return{color:t,value:t,isThemeColor:s,isLight:Iy(t,e.luminanceThreshold),shade:a,variable:void 0}}function sa(t,e){const n=ph({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=sa(n.from,e),r=sa(n.to,e);return`linear-gradient(${n.deg}deg, ${i} 0%, ${r} 100%)`}function ic(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 Xg=ic,mce=({color:t,theme:e,variant:n,gradient:i,autoContrast:r})=>{const a=ph({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:ic(o,.1),hover:ic(o,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${Et(1)} solid transparent`}}return{background:ic(t,.1),hover:ic(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:ic(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:ic(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:ic(o,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${Et(1)} solid transparent`}}return{background:"transparent",hover:ic(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)`}:{}},gce={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:gce,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:mce,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 bce({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 vce="[@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(vce);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 EX(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),yce=()=>I.useContext(vL)||aA;function _a(){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 MX({theme:t,children:e,inherit:n=!0}){const i=yce(),r=I.useMemo(()=>EX(n?i:aA,t),[t,i,n]);return k.jsx(vL.Provider,{value:r,children:e})}MX.displayName="@mantine/core/MantineThemeProvider";function xce(){const t=_a(),e=iA(),n=ef(t.breakpoints).reduce((i,r)=>{const a=t.breakpoints[r].includes("px"),s=Xle(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 Ny(t,e){return(Array.isArray(t)?t:[t]).reduce((i,r)=>`${r}{${i}}`,e)}function _ce(t,e){const n=U3(t.variables),i=n?Ny(e,n):"",r=U3(t.dark),a=U3(t.light),s=r?Ny(e===":host"?`${e}([data-mantine-color-scheme="dark"])`:`${e}[data-mantine-color-scheme="dark"]`,r):"",o=a?Ny(e===":host"?`${e}([data-mantine-color-scheme="light"])`:`${e}[data-mantine-color-scheme="light"]`,a):"";return`${i}

${s}

${o}`}function T_({color:t,theme:e,autoContrast:n}){return(typeof n=="boolean"?n:e.autoContrast)&&ph({color:t||e.primaryColor,theme:e}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function CB(t,e){return T_({color:t.colors[t.primaryColor][I1(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=I1(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`]:Xg(t.colors[e][o],.1),[`--mantine-color-${i}-light-hover`]:Xg(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`]:Xg(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=I1(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`]:Xg(t.colors[e][Math.max(0,a-2)],.15),[`--mantine-color-${i}-light-hover`]:Xg(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`]:Xg(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 Sce(t){return!!t&&typeof t=="object"&&"mantine-virtual-color"in t}function Kg(t,e,n){ef(e).forEach(i=>Object.assign(t,{[`--mantine-${n}-${i}`]:e[i]}))}const TX=t=>{const e=I1(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)"}};Kg(i.variables,t.breakpoints,"breakpoint"),Kg(i.variables,t.spacing,"spacing"),Kg(i.variables,t.fontSizes,"font-size"),Kg(i.variables,t.lineHeights,"line-height"),Kg(i.variables,t.shadows,"shadow"),Kg(i.variables,t.radius,"radius"),t.colors[t.primaryColor].forEach((a,s)=>{i.variables[`--mantine-primary-color-${s}`]=`var(--mantine-color-${t.primaryColor}-${s})`}),ef(t.colors).forEach(a=>{const s=t.colors[a];if(Sce(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 ef(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 wce({theme:t,generator:e}){const n=TX(t),i=e?.(t);return i?pL(n,i):n}const F3=TX(aA);function Ece(t){const e={variables:{},light:{},dark:{}};return ef(t.variables).forEach(n=>{F3.variables[n]!==t.variables[n]&&(e.variables[n]=t.variables[n])}),ef(t.light).forEach(n=>{F3.light[n]!==t.light[n]&&(e.light[n]=t.light[n])}),ef(t.dark).forEach(n=>{F3.dark[n]!==t.dark[n]&&(e.dark[n]=t.dark[n])}),e}function Mce(t){return`
  ${t}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
  ${t}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
`}function AX({cssVariablesSelector:t,deduplicateCssVariables:e}){const n=_a(),i=iA(),r=rce(),a=wce({theme:n,generator:r}),s=t===":root"&&e,o=s?Ece(a):a,l=_ce(o,t);return l?k.jsx("style",{"data-mantine-styles":!0,nonce:i?.(),dangerouslySetInnerHTML:{__html:`${l}${s?"":Mce(t)}`}}):null}AX.displayName="@mantine/CssVariables";function Yg(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 Tce({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||(Yg(u,n),s(u),t.set(u))},[t.set,o,i]),c=I.useCallback(()=>{s(e),Yg(e,n),t.clear()},[t.clear,e]);return I.useEffect(()=>(t.subscribe(l),t.unsubscribe),[t.subscribe,t.unsubscribe]),Rv(()=>{Yg(t.get(e),n)},[]),I.useEffect(()=>{if(i)return Yg(i,n),()=>{};i===void 0&&Yg(a,n),typeof window<"u"&&"matchMedia"in window&&(r.current=window.matchMedia("(prefers-color-scheme: dark)"));const u=f=>{a==="auto"&&Yg(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 Ace({respectReducedMotion:t,getRootElement:e}){Rv(()=>{t&&e()?.setAttribute("data-respect-reduced-motion","true")},[t])}function CX({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=bce(),defaultColorScheme:u="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:d,stylesTransform:g,env:b}){const{colorScheme:y,setColorScheme:m,clearColorScheme:x}=Tce({defaultColorScheme:u,forceColorScheme:d,manager:c,getRootElement:f});return Ace({respectReducedMotion:t?.respectReducedMotion||!1,getRootElement:f}),k.jsx(gL.Provider,{value:{colorScheme:y,setColorScheme:m,clearColorScheme:x,getRootElement:f,classNamesPrefix:l,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:o,withStaticClasses:i,stylesTransform:g,env:b},children:k.jsxs(MX,{theme:t,children:[s&&k.jsx(AX,{cssVariablesSelector:o,deduplicateCssVariables:a}),r&&k.jsx(xce,{}),e]})})}CX.displayName="@mantine/core/MantineProvider";function Dv({classNames:t,styles:e,props:n,stylesCtx:i}){const r=_a();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 Cce={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function Rce({theme:t,options:e,unstyled:n}){return ls(e?.focusable&&!n&&(t.focusClassName||Cce[t.focusRing]),e?.active&&!n&&t.activeClassName)}function kce({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 Dce({rootSelector:t,selector:e,className:n}){return t===e?n:void 0}function Oce({selector:t,classes:e,unstyled:n}){return n?void 0:e[t]}function Ice({themeName:t,classNamesPrefix:e,selector:n,withStaticClass:i}){return i===!1?[]:t.map(r=>`${e}-${r}-${n}`)}function Nce({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 Lce({options:t,classes:e,selector:n,unstyled:i}){return t?.variant&&!i?e[`${n}--${t.variant}`]:void 0}function Pce({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 ls(Rce({theme:t,options:e,unstyled:o||d}),Nce({theme:t,themeName:n,selector:i,props:u,stylesCtx:f}),Lce({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}),kce({selector:i,stylesCtx:f,options:e,props:u,theme:t}),Dce({rootSelector:c,selector:i,className:l}),Oce({selector:i,classes:s,unstyled:o||d}),h&&!d&&Ice({themeName:n,classNamesPrefix:r,selector:i,withStaticClass:e?.withStaticClass}),e?.className)}function Uce({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 Fce(t){return t.reduce((e,n)=>(n&&Object.keys(n).forEach(i=>{e[i]={...e[i],...eA(n[i])}}),e),{})}function Bce({vars:t,varsResolver:e,theme:n,props:i,stylesCtx:r,selector:a,themeName:s,headless:o}){return Fce([o?{}:e?.(n,i,r),...s.map(l=>n.components?.[l]?.vars?.(n,i,r)),t?.(n,i,r)])?.[a]}function zce({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&&Uce({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],...Bce({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 jce({props:t,stylesCtx:e,themeName:n}){const i=_a(),r=cce()?.();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=_a(),g=ace(),b=sce(),y=oce(),m=(Array.isArray(t)?t:[t]).filter(w=>w),{withStylesTransform:x,getTransformedStyles:_}=jce({props:n,stylesCtx:i,themeName:m});return(w,M)=>({className:Pce({theme:d,options:M,themeName:m,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:zce({theme:d,themeName:m,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 og({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=Toe("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=_a(),r=i.components[t]?.defaultProps,a=typeof r=="function"?r(i):r;return{...e,...a,...eA(n)}}function B3(t){return ef(t).reduce((e,n)=>t[n]!==void 0?`${e}${Wle(n)}:${t[n]};`:e,"").trim()}function Hce({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 RX(t){const e=iA();return k.jsx("style",{"data-mantine-styles":"inline",nonce:e?.(),dangerouslySetInnerHTML:{__html:Hce(t)}})}function A_(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:m,ps:x,bd:_,bdrs:w,bg:M,c:S,opacity:A,ff:C,fz:D,fw:R,lts:L,ta:U,lh:j,fs:z,tt:q,td:F,w:V,miw:H,maw:W,h:B,mih:J,mah:Z,bgsz:G,bgp:de,bgr:oe,bga:le,pos:ue,top:Se,left:Oe,bottom:Be,right:je,inset:He,display:pe,flex:ze,hiddenFrom:Ie,visibleFrom:qe,lightHidden:we,darkHidden:Me,sx:Ae,...Ne}=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:m,ps:x,bd:_,bg:M,c:S,opacity:A,ff:C,fz:D,fw:R,lts:L,ta:U,lh:j,fs:z,tt:q,td:F,w:V,miw:H,maw:W,h:B,mih:J,mah:Z,bgsz:G,bgp:de,bgr:oe,bga:le,pos:ue,top:Se,left:Oe,bottom:Be,right:je,inset:He,display:pe,flex:ze,bdrs:w,hiddenFrom:Ie,visibleFrom:qe,lightHidden:we,darkHidden:Me,sx:Ae}),rest:Ne}}const Vce={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=ph({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 Gce(t,e){const n=ph({color:t,theme:e});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:yL(t,e)}function Wce(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 qce(t){return typeof t=="string"&&t in DB?DB[t]:t}const Xce=["h1","h2","h3","h4","h5","h6"];function Kce(t,e){return typeof t=="string"&&t in e.fontSizes?`var(--mantine-font-size-${t})`:typeof t=="string"&&Xce.includes(t)?`var(--mantine-${t}-font-size)`:typeof t=="number"||typeof t=="string"?Et(t):t}function Yce(t){return t}const Jce=["h1","h2","h3","h4","h5","h6"];function $ce(t,e){return typeof t=="string"&&t in e.lineHeights?`var(--mantine-line-height-${t})`:typeof t=="string"&&Jce.includes(t)?`var(--mantine-${t}-line-height)`:t}function Zce(t,e){return typeof t=="string"&&t in e.radius?`var(--mantine-radius-${t})`:typeof t=="number"||typeof t=="string"?Et(t):t}function Qce(t){return typeof t=="number"?Et(t):t}function eue(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:Gce,fontSize:Kce,spacing:eue,radius:Zce,identity:Yce,size:Qce,lineHeight:$ce,fontFamily:qce,border:Wce};function OB(t){return t.replace("(min-width: ","").replace("em)","")}function tue({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 nue(t){if(typeof t!="object"||t===null)return!1;const e=Object.keys(t);return!(e.length===1&&e[0]==="base")}function iue(t){return typeof t=="object"&&t!==null?"base"in t?t.base:void 0:t}function rue(t){return typeof t=="object"&&t!==null?ef(t).filter(e=>e!=="base"):[]}function aue(t,e){return typeof t=="object"&&t!==null&&e in t?t[e]:t}function kX({styleProps:t,data:e,theme:n}){return tue(ef(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=iue(t[r]);if(!nue(t[r]))return s.forEach(c=>{i.inlineStyles[c]=z3[a.type](o,n)}),i;i.hasResponsiveStyles=!0;const l=rue(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](aue(t[r],u),n)}})}),i},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function DX(){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 OX(t){return t.startsWith("data-")?t:`data-${t}`}function sue(t){return Object.keys(t).reduce((e,n)=>{const i=t[n];return i===void 0||i===""||i===!1||i===null||(e[OX(n)]=t[n]),e},{})}function IX(t){return t?typeof t=="string"?{[OX(t)]:!0}:Array.isArray(t)?[...t].reduce((e,n)=>({...e,...IX(n)}),{}):sue(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 oue({theme:t,style:e,vars:n,styleProps:i}){const r=CO(e,t),a=CO(n,t);return{...r,...a,...i}}const NX=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=_a(),y=t||"div",{styleProps:m,rest:x}=A_(d),w=lce()?.()?.(m.sx),M=DX(),S=kX({styleProps:m,theme:b,data:Vce}),A={ref:g,style:oue({theme:b,style:e,vars:n,styleProps:S.inlineStyles}),className:ls(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":xX(s)?void 0:s||void 0,size:h,...IX(a),...x};return k.jsxs(k.Fragment,{children:[S.hasResponsiveStyles&&k.jsx(RX,{selector:`.${M}`,styles:S.styles,media:S.media}),typeof f=="function"?f(A):k.jsx(y,{...A})]})});NX.displayName="@mantine/core/Box";const ct=NX;function LX(t){return t}function tn(t){const e=I.forwardRef(t);return e.extend=LX,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 Dl(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=LX,e}const lue=I.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ov(){return I.useContext(lue)}function cue(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 Ly=typeof window<"u"&&window.requestAnimationFrame,IB=0,uue=t=>({height:0,overflow:"hidden",...t?{}:{display:"none"}});function fue({transitionDuration:t,transitionTimingFunction:e="ease",onTransitionEnd:n=()=>{},opened:i,keepMounted:r=!1}){const a=I.useRef(null),s=uue(r),[o,l]=I.useState(i?{}:s),c=g=>{l_.flushSync(()=>l(g))},u=g=>{c(b=>({...b,...g}))};function f(g){const b=t||cue(g);return{transition:`height ${b}ms ${e}, opacity ${b}ms ${e}`}}_c(()=>{typeof Ly=="function"&&Ly(i?()=>{u({willChange:"height",display:"block",overflow:"hidden"}),Ly(()=>{const g=j3(a);u({...f(g),height:g})})}:()=>{const g=j3(a);u({...f(g),willChange:"height",height:g}),Ly(()=>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 m=y[b],x={"aria-hidden":!i,...y,[b]:iX(a,m),onTransitionEnd:h,style:{boxSizing:"border-box",...g,...o}};return Ce.version.startsWith("18")?i||(x.inert=""):x.inert=!i,x}return d}const hue={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},mh=tn((t,e)=>{const{children:n,in:i,transitionDuration:r,transitionTimingFunction:a,style:s,onTransitionEnd:o,animateOpacity:l,keepMounted:c,...u}=Pt("Collapse",hue,t),f=_a(),h=ZT(),g=(f.respectReducedMotion?h:!1)?0:r,b=fue({opened:i,transitionDuration:g,transitionTimingFunction:a,onTransitionEnd:o,keepMounted:c});return g===0?i?k.jsx(ct,{...u,children:n}):null:k.jsx(ct,{...b({style:{opacity:i||!l?1:0,transition:l?`opacity ${g}ms ${a}`:"none",...xL(s,f)},ref:e,...u}),children:n})});mh.displayName="@mantine/core/Collapse";function oA(){return typeof window<"u"}function Iv(t){return PX(t)?(t.nodeName||"").toLowerCase():"#document"}function Ho(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function bf(t){var e;return(e=(PX(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function PX(t){return oA()?t instanceof Node||t instanceof Ho(t).Node:!1}function jr(t){return oA()?t instanceof Element||t instanceof Ho(t).Element:!1}function Rl(t){return oA()?t instanceof HTMLElement||t instanceof Ho(t).HTMLElement:!1}function RO(t){return!oA()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ho(t).ShadowRoot}const due=new Set(["inline","contents"]);function C_(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Mc(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!due.has(r)}const pue=new Set(["table","td","th"]);function mue(t){return pue.has(Iv(t))}const gue=[":popover-open",":modal"];function lA(t){return gue.some(e=>{try{return t.matches(e)}catch{return!1}})}const bue=["transform","translate","scale","rotate","perspective"],vue=["transform","translate","scale","rotate","perspective","filter"],yue=["paint","layout","strict","content"];function _L(t){const e=cA(),n=jr(t)?Mc(t):t;return bue.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)||vue.some(i=>(n.willChange||"").includes(i))||yue.some(i=>(n.contain||"").includes(i))}function xue(t){let e=gh(t);for(;Rl(e)&&!rh(e);){if(_L(e))return e;if(lA(e))return null;e=gh(e)}return null}function cA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _ue=new Set(["html","body","#document"]);function rh(t){return _ue.has(Iv(t))}function Mc(t){return Ho(t).getComputedStyle(t)}function uA(t){return jr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function gh(t){if(Iv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||RO(t)&&t.host||bf(t);return RO(e)?e.host:e}function UX(t){const e=gh(t);return rh(e)?t.ownerDocument?t.ownerDocument.body:t.body:Rl(e)&&C_(e)?e:UX(e)}function ah(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=UX(t),a=r===((i=t.ownerDocument)==null?void 0:i.body),s=Ho(r);if(a){const o=kO(s);return e.concat(s,s.visualViewport||[],C_(r)?r:[],o&&n?ah(o):[])}return e.concat(r,ah(r,[],n))}function kO(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const Sue=["top","right","bottom","left"],yu=Math.min,eo=Math.max,l2=Math.round,nw=Math.floor,tf=t=>({x:t,y:t}),wue={left:"right",right:"left",bottom:"top",top:"bottom"},Eue={start:"end",end:"start"};function DO(t,e,n){return eo(t,yu(e,n))}function lf(t,e){return typeof t=="function"?t(e):t}function xu(t){return t.split("-")[0]}function Nv(t){return t.split("-")[1]}function SL(t){return t==="x"?"y":"x"}function wL(t){return t==="y"?"height":"width"}const Mue=new Set(["top","bottom"]);function fu(t){return Mue.has(xu(t))?"y":"x"}function EL(t){return SL(fu(t))}function Tue(t,e,n){n===void 0&&(n=!1);const i=Nv(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 Aue(t){const e=c2(t);return[OO(t),e,OO(e)]}function OO(t){return t.replace(/start|end/g,e=>Eue[e])}const NB=["left","right"],LB=["right","left"],Cue=["top","bottom"],Rue=["bottom","top"];function kue(t,e,n){switch(t){case"top":case"bottom":return n?e?LB:NB:e?NB:LB;case"left":case"right":return e?Cue:Rue;default:return[]}}function Due(t,e,n,i){const r=Nv(t);let a=kue(xu(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=>wue[e])}function Oue(t){return{top:0,right:0,bottom:0,left:0,...t}}function ML(t){return typeof t!="number"?Oue(t):{top:t,right:t,bottom:t,left:t}}function W0(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 Iue(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function Nue(){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 Lue(){return/apple/i.test(navigator.vendor)}function Pue(){return Iue().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Uue(){return Nue().includes("jsdom/")}const PB="data-floating-ui-focusable",Fue="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 N1(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 jb(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 Bue(t){return t.matches("html,body")}function sm(t){return t?.ownerDocument||document}function zue(t){return Rl(t)&&t.matches(Fue)}function jue(t){if(!t||Uue())return!0;try{return t.matches(":focus-visible")}catch{return!0}}function Hue(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 Vue(t){return"nativeEvent"in t}function IO(t,e){const n=["mouse","pen"];return n.push("",void 0),n.includes(t)}var Gue=typeof document<"u",Wue=function(){},nf=Gue?I.useLayoutEffect:Wue;const que={...h7};function iw(t){const e=I.useRef(t);return nf(()=>{e.current=t}),e}const Xue=que.useInsertionEffect,Kue=Xue||(t=>t());function Wu(t){const e=I.useRef(()=>{});return Kue(()=>{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=fu(e),s=EL(e),o=wL(s),l=xu(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(Nv(e)){case"start":d[s]-=h*(n&&c?-1:1);break;case"end":d[s]+=h*(n&&c?-1:1);break}return d}const Yue=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:m}=o[b],{x,y:_,data:w,reset:M}=await m({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 L1(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}=lf(e,t),g=ML(d),y=o[h?f==="floating"?"reference":"floating":f],m=W0(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=W0(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:x,offsetParent:_,strategy:l}):x);return{top:(m.top-M.top+g.top)/w.y,bottom:(M.bottom-m.bottom+g.bottom)/w.y,left:(m.left-M.left+g.left)/w.x,right:(M.right-m.right+g.right)/w.x}}const Jue=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}=lf(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",m=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=yu(f[m],D),L=yu(f[x],D),U=R,j=A-b[g]-L,z=A/2-b[g]/2+C,q=DO(U,z,j),F=!l.arrow&&Nv(r)!=null&&z!==q&&a.reference[g]/2-(z<U?R:L)-b[g]/2<0,V=F?z<U?z-U:z-j:0;return{[d]:h[d]+V,data:{[d]:q,centerOffset:z-q-V,...F&&{alignmentOffset:V}},reset:F}}}),$ue=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}=lf(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const m=xu(r),x=fu(o),_=xu(o)===o,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=h||(_||!b?[c2(o)]:Aue(o)),S=g!=="none";!h&&S&&M.push(...Due(o,b,g,w));const A=[o,...M],C=await L1(e,y),D=[];let R=((i=a.flip)==null?void 0:i.overflows)||[];if(u&&D.push(C[m]),f){const z=Tue(r,s,w);D.push(C[z[0]],C[z[1]])}if(R=[...R,{placement:r,overflows:D}],!D.every(z=>z<=0)){var L,U;const z=(((L=a.flip)==null?void 0:L.index)||0)+1,q=A[z];if(q&&(!(f==="alignment"?x!==fu(q):!1)||R.every(H=>fu(H.placement)===x?H.overflows[0]>0:!0)))return{data:{index:z,overflows:R},reset:{placement:q}};let F=(U=R.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:U.placement;if(!F)switch(d){case"bestFit":{var j;const V=(j=R.filter(H=>{if(S){const W=fu(H.placement);return W===x||W==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(W=>W>0).reduce((W,B)=>W+B,0)]).sort((H,W)=>H[1]-W[1])[0])==null?void 0:j[0];V&&(F=V);break}case"initialPlacement":F=o;break}if(r!==F)return{reset:{placement:F}}}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 Sue.some(e=>t[e]>=0)}const Zue=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=lf(t,e);switch(i){case"referenceHidden":{const a=await L1(e,{...r,elementContext:"reference"}),s=BB(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:zB(s)}}}case"escaped":{const a=await L1(e,{...r,altBoundary:!0}),s=BB(a,n.floating);return{data:{escapedOffsets:s,escaped:zB(s)}}}default:return{}}}}};function FX(t){const e=yu(...t.map(a=>a.left)),n=yu(...t.map(a=>a.top)),i=eo(...t.map(a=>a.right)),r=eo(...t.map(a=>a.bottom));return{x:e,y:n,width:i-e,height:r-n}}function Que(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=>W0(FX(r)))}const efe=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}=lf(t,e),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(i.reference))||[]),f=Que(u),h=W0(FX(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(fu(n)==="y"){const R=f[0],L=f[f.length-1],U=xu(n)==="top",j=R.top,z=L.bottom,q=U?R.left:L.left,F=U?R.right:L.right,V=F-q,H=z-j;return{top:j,bottom:z,left:q,right:F,width:V,height:H,x:q,y:j}}const y=xu(n)==="left",m=eo(...f.map(R=>R.right)),x=yu(...f.map(R=>R.left)),_=f.filter(R=>y?R.left===x:R.right===m),w=_[0].top,M=_[_.length-1].bottom,S=x,A=m,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}}:{}}}},BX=new Set(["left","top"]);async function tfe(t,e){const{placement:n,platform:i,elements:r}=t,a=await(i.isRTL==null?void 0:i.isRTL(r.floating)),s=xu(n),o=Nv(n),l=fu(n)==="y",c=BX.has(s)?-1:1,u=a&&l?-1:1,f=lf(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 nfe=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 tfe(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}}}}},ife=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:m,y:x}=y;return{x:m,y:x}}},...l}=lf(t,e),c={x:n,y:i},u=await L1(e,l),f=fu(xu(r)),h=SL(f);let d=c[h],g=c[f];if(a){const y=h==="y"?"top":"left",m=h==="y"?"bottom":"right",x=d+u[y],_=d-u[m];d=DO(x,d,_)}if(s){const y=f==="y"?"top":"left",m=f==="y"?"bottom":"right",x=g+u[y],_=g-u[m];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}}}}}},rfe=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}=lf(t,e),u={x:n,y:i},f=fu(r),h=SL(f);let d=u[h],g=u[f];const b=lf(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 m,x;const _=h==="y"?"width":"height",w=BX.has(xu(r)),M=a.reference[f]-a.floating[_]+(w&&((m=s.offset)==null?void 0:m[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}}}},afe=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}=lf(t,e),u=await L1(e,c),f=xu(r),h=Nv(r),d=fu(r)==="y",{width:g,height:b}=a.floating;let y,m;f==="top"||f==="bottom"?(y=f,m=h===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(m=f,y=h==="end"?"top":"bottom");const x=b-u.top-u.bottom,_=g-u.left-u.right,w=yu(b-u[y],x),M=yu(g-u[m],_),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=eo(u.left,0),L=eo(u.right,0),U=eo(u.top,0),j=eo(u.bottom,0);d?C=g-2*(R!==0||L!==0?R+L:eo(u.left,u.right)):A=b-2*(U!==0||j!==0?U+j:eo(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 zX(t){const e=Mc(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Rl(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 jr(t)?t:t.contextElement}function v0(t){const e=TL(t);if(!Rl(e))return tf(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:a}=zX(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 sfe=tf(0);function jX(t){const e=Ho(t);return!cA()||!e.visualViewport?sfe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ofe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ho(t)?!1:e}function Vm(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),a=TL(t);let s=tf(1);e&&(i?jr(i)&&(s=v0(i)):s=v0(t));const o=ofe(a,n,i)?jX(a):tf(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=Ho(a),d=i&&jr(i)?Ho(i):i;let g=h,b=kO(g);for(;b&&i&&d!==g;){const y=v0(b),m=b.getBoundingClientRect(),x=Mc(b),_=m.left+(b.clientLeft+parseFloat(x.paddingLeft))*y.x,w=m.top+(b.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=_,c+=w,g=Ho(b),b=kO(g)}}return W0({width:u,height:f,x:l,y:c})}function fA(t,e){const n=uA(t).scrollLeft;return e?e.left+n:Vm(bf(t)).left+n}function HX(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 lfe(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const a=r==="fixed",s=bf(i),o=e?lA(e.floating):!1;if(i===s||o&&a)return n;let l={scrollLeft:0,scrollTop:0},c=tf(1);const u=tf(0),f=Rl(i);if((f||!f&&!a)&&((Iv(i)!=="body"||C_(s))&&(l=uA(i)),Rl(i))){const d=Vm(i);c=v0(i),u.x=d.x+i.clientLeft,u.y=d.y+i.clientTop}const h=s&&!f&&!a?HX(s,l):tf(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 cfe(t){return Array.from(t.getClientRects())}function ufe(t){const e=bf(t),n=uA(t),i=t.ownerDocument.body,r=eo(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),a=eo(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+fA(t);const o=-n.scrollTop;return Mc(i).direction==="rtl"&&(s+=eo(e.clientWidth,i.clientWidth)-r),{width:r,height:a,x:s,y:o}}const jB=25;function ffe(t,e){const n=Ho(t),i=bf(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 hfe=new Set(["absolute","fixed"]);function dfe(t,e){const n=Vm(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,a=Rl(t)?v0(t):tf(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=ffe(t,n);else if(e==="document")i=ufe(bf(t));else if(jr(e))i=dfe(e,n);else{const r=jX(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return W0(i)}function VX(t,e){const n=gh(t);return n===e||!jr(n)||rh(n)?!1:Mc(n).position==="fixed"||VX(n,e)}function pfe(t,e){const n=e.get(t);if(n)return n;let i=ah(t,[],!1).filter(o=>jr(o)&&Iv(o)!=="body"),r=null;const a=Mc(t).position==="fixed";let s=a?gh(t):t;for(;jr(s)&&!rh(s);){const o=Mc(s),l=_L(s);!l&&o.position==="fixed"&&(r=null),(a?!l&&!r:!l&&o.position==="static"&&!!r&&hfe.has(r.position)||C_(s)&&!l&&VX(t,s))?i=i.filter(u=>u!==s):r=o,s=gh(s)}return e.set(t,i),i}function mfe(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const s=[...n==="clippingAncestors"?lA(e)?[]:pfe(e,this._c):[].concat(n),i],o=s[0],l=s.reduce((c,u)=>{const f=HB(e,u,r);return c.top=eo(f.top,c.top),c.right=yu(f.right,c.right),c.bottom=yu(f.bottom,c.bottom),c.left=eo(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 gfe(t){const{width:e,height:n}=zX(t);return{width:e,height:n}}function bfe(t,e,n){const i=Rl(e),r=bf(e),a=n==="fixed",s=Vm(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const l=tf(0);function c(){l.x=fA(r)}if(i||!i&&!a)if((Iv(e)!=="body"||C_(r))&&(o=uA(e)),i){const d=Vm(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?HX(r,o):tf(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 Mc(t).position==="static"}function VB(t,e){if(!Rl(t)||Mc(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return bf(t)===n&&(n=n.ownerDocument.body),n}function GX(t,e){const n=Ho(t);if(lA(t))return n;if(!Rl(t)){let r=gh(t);for(;r&&!rh(r);){if(jr(r)&&!V3(r))return r;r=gh(r)}return n}let i=VB(t,e);for(;i&&mue(i)&&V3(i);)i=VB(i,e);return i&&rh(i)&&V3(i)&&!_L(i)?n:i||xue(t)||n}const vfe=async function(t){const e=this.getOffsetParent||GX,n=this.getDimensions,i=await n(t.floating);return{reference:bfe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function yfe(t){return Mc(t).direction==="rtl"}const xfe={convertOffsetParentRelativeRectToViewportRelativeRect:lfe,getDocumentElement:bf,getClippingRect:mfe,getOffsetParent:GX,getElementRects:vfe,getClientRects:cfe,getDimensions:gfe,getScale:v0,isElement:jr,isRTL:yfe};function WX(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function _fe(t,e){let n=null,i;const r=bf(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)),m=nw(u),_={rootMargin:-g+"px "+-b+"px "+-y+"px "+-m+"px",threshold:eo(0,yu(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&&!WX(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?ah(c):[],...ah(e)]:[];u.forEach(m=>{r&&m.addEventListener("scroll",n,{passive:!0}),a&&m.addEventListener("resize",n)});const f=c&&o?_fe(c,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(m=>{let[x]=m;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?Vm(t):null;l&&y();function y(){const m=Vm(t);b&&!WX(b,m)&&n(),b=m,g=requestAnimationFrame(y)}return n(),()=>{var m;u.forEach(x=>{r&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),f?.(),(m=d)==null||m.disconnect(),d=null,l&&cancelAnimationFrame(g)}}const Sfe=nfe,wfe=ife,Efe=$ue,Mfe=afe,Tfe=Zue,GB=Jue,Afe=efe,Cfe=rfe,Rfe=(t,e,n)=>{const i=new Map,r={platform:xfe,...n},a={...r.platform,_c:i};return Yue(t,e,{...r,platform:a})};var kfe=typeof document<"u",Dfe=function(){},oM=kfe?I.useLayoutEffect:Dfe;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 qX(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function WB(t,e){const n=qX(t);return Math.round(e*n)/n}function G3(t){const e=I.useRef(t);return oM(()=>{e.current=t}),e}function Ofe(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,m]=I.useState(null),x=I.useCallback(H=>{H!==S.current&&(S.current=H,b(H))},[]),_=I.useCallback(H=>{H!==A.current&&(A.current=H,m(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),L=G3(r),U=G3(c),j=I.useCallback(()=>{if(!S.current||!A.current)return;const H={placement:e,strategy:n,middleware:h};L.current&&(H.platform=L.current),Rfe(S.current,A.current,H).then(W=>{const B={...W,isPositioned:U.current!==!1};z.current&&!u2(C.current,B)&&(C.current=B,l_.flushSync(()=>{f(B)}))})},[h,e,n,L,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,_]),F=I.useMemo(()=>({reference:w,floating:M}),[w,M]),V=I.useMemo(()=>{const H={position:n,left:0,top:0};if(!F.floating)return H;const W=WB(F.floating,u.x),B=WB(F.floating,u.y);return o?{...H,transform:"translate("+W+"px, "+B+"px)",...qX(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:B}},[n,o,F.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:j,refs:q,elements:F,floatingStyles:V}),[u,j,q,F,V])}const Ife=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):{}}}},XX=(t,e)=>({...Sfe(t),options:[t,e]}),AL=(t,e)=>({...wfe(t),options:[t,e]}),qB=(t,e)=>({...Cfe(t),options:[t,e]}),f2=(t,e)=>({...Efe(t),options:[t,e]}),Nfe=(t,e)=>({...Mfe(t),options:[t,e]}),Lfe=(t,e)=>({...Tfe(t),options:[t,e]}),Jx=(t,e)=>({...Afe(t),options:[t,e]}),KX=(t,e)=>({...Ife(t),options:[t,e]});function YX(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 Pfe="data-floating-ui-focusable",XB="active",KB="selected",Ufe={...h7};let YB=!1,Ffe=0;const JB=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Ffe++;function Bfe(){const[t,e]=I.useState(()=>YB?JB():void 0);return nf(()=>{t==null&&e(JB())},[]),I.useEffect(()=>{YB=!0},[]),t}const zfe=Ufe.useId,JX=zfe||Bfe;function jfe(){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 Hfe=I.createContext(null),Vfe=I.createContext(null),CL=()=>{var t;return((t=I.useContext(Hfe))==null?void 0:t.id)||null},RL=()=>I.useContext(Vfe);function kL(t){return"data-floating-ui-"+t}function Zl(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 Gfe(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),m=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),L=Wu(()=>{var V;const H=(V=r.current.openEvent)==null?void 0:V.type;return H?.includes("mouse")&&H!=="mousedown"});I.useEffect(()=>{if(!o)return;function V(H){let{open:W}=H;W||(Zl(w),Zl(S),A.current=!0,R.current=!1)}return a.on("openchange",V),()=>{a.off("openchange",V)}},[o,a]),I.useEffect(()=>{if(!o||!b.current||!n)return;function V(W){L()&&i(!1,W,"hover")}const H=sm(s.floating).documentElement;return H.addEventListener("mouseleave",V),()=>{H.removeEventListener("mouseleave",V)}},[s.floating,n,i,o,b,L]);const U=I.useCallback(function(V,H,W){H===void 0&&(H=!0),W===void 0&&(W="hover");const B=lM(y.current,"close",_.current);B&&!M.current?(Zl(w),w.current=window.setTimeout(()=>i(!1,V,W),B)):H&&(Zl(w),i(!1,V,W))},[y,i]),j=Wu(()=>{D.current(),M.current=void 0}),z=Wu(()=>{if(C.current){const V=sm(s.floating).body;V.style.pointerEvents="",V.removeAttribute($B),C.current=!1}}),q=Wu(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);I.useEffect(()=>{if(!o)return;function V(Z){if(Zl(w),A.current=!1,u&&!IO(_.current)||W3(x.current)>0&&!lM(y.current,"open"))return;const G=lM(y.current,"open",_.current);G?w.current=window.setTimeout(()=>{m.current||i(!0,Z,"hover")},G):n||i(!0,Z,"hover")}function H(Z){if(q()){z();return}D.current();const G=sm(s.floating);if(Zl(S),R.current=!1,b.current&&r.current.floatingContext){n||Zl(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 oe=M.current;G.addEventListener("mousemove",oe),D.current=()=>{G.removeEventListener("mousemove",oe)};return}(_.current==="touch"?!N1(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 B(){Zl(w)}function J(Z){q()||U(Z,!1)}if(jr(s.domReference)){const Z=s.domReference,G=s.floating;return n&&Z.addEventListener("mouseleave",W),h&&Z.addEventListener("mousemove",V,{once:!0}),Z.addEventListener("mouseenter",V),Z.addEventListener("mouseleave",H),G&&(G.addEventListener("mouseleave",W),G.addEventListener("mouseenter",B),G.addEventListener("mouseleave",J)),()=>{n&&Z.removeEventListener("mouseleave",W),h&&Z.removeEventListener("mousemove",V),Z.removeEventListener("mouseenter",V),Z.removeEventListener("mouseleave",H),G&&(G.removeEventListener("mouseleave",W),G.removeEventListener("mouseenter",B),G.removeEventListener("mouseleave",J))}}},[s,o,t,u,h,U,j,z,i,n,m,d,y,b,r,q,x]),nf(()=>{var V;if(o&&n&&(V=b.current)!=null&&(V=V.__options)!=null&&V.blockPointerEvents&&L()){C.current=!0;const W=s.floating;if(jr(s.domReference)&&W){var H;const B=sm(s.floating).body;B.setAttribute($B,"");const J=s.domReference,Z=d==null||(H=d.nodesRef.current.find(G=>G.id===g))==null||(H=H.context)==null?void 0:H.elements.floating;return Z&&(Z.style.pointerEvents=""),B.style.pointerEvents="none",J.style.pointerEvents="auto",W.style.pointerEvents="auto",()=>{B.style.pointerEvents="",J.style.pointerEvents="",W.style.pointerEvents=""}}}},[o,n,g,s,d,b,L]),nf(()=>{n||(_.current=void 0,R.current=!1,j(),z())},[n,j,z]),I.useEffect(()=>()=>{j(),Zl(w),Zl(S),z()},[o,s.domReference,j,z]);const F=I.useMemo(()=>{function V(H){_.current=H.pointerType}return{onPointerDown:V,onPointerEnter:V,onMouseMove(H){const{nativeEvent:W}=H;function B(){!A.current&&!m.current&&i(!0,W,"hover")}u&&!IO(_.current)||n||W3(x.current)===0||R.current&&H.movementX**2+H.movementY**2<2||(Zl(S),_.current==="touch"?B():(R.current=!0,S.current=window.setTimeout(B,W3(x.current))))}}},[u,i,n,m,x]);return I.useMemo(()=>o?{reference:F}:{},[o,F])}const LO=()=>{},$X=I.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:LO,setState:LO,isInstantPhase:!1}),Wfe=()=>I.useContext($X);function qfe(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 nf(()=>{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($X.Provider,{value:I.useMemo(()=>({...r,setState:a,setCurrentId:o}),[r,o]),children:e})}function Xfe(t,e){e===void 0&&(e={});const{open:n,onOpenChange:i,floatingId:r}=t,{id:a,enabled:s=!0}=e,o=a??r,l=Wfe(),{currentId:c,setCurrentId:u,initialDelay:f,setState:h,timeoutMs:d}=l;return nf(()=>{s&&c&&(h({delay:{open:1,close:lM(f,"close")}}),c!==o&&i(!1))},[s,o,i,h,c,f]),nf(()=>{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]),nf(()=>{s&&(u===LO||!n||u(o))},[s,n,u,o]),l}const Kfe={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Yfe={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 Jfe(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=Wu(typeof l=="function"?l:()=>!1),m=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=Wu(z=>{var q;if(!n||!s||!o||z.key!=="Escape"||A.current)return;const F=(q=a.current.floatingContext)==null?void 0:q.nodeId,V=b?sM(b.nodesRef.current,F):[];if(!_&&(z.stopPropagation(),V.length>0)){let H=!0;if(V.forEach(W=>{var B;if((B=W.context)!=null&&B.open&&!W.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}i(!1,Vue(z)?z.nativeEvent:z,"escape-key")}),D=Wu(z=>{var q;const F=()=>{var V;C(z),(V=jb(z))==null||V.removeEventListener("keydown",F)};(q=jb(z))==null||q.addEventListener("keydown",F)}),R=Wu(z=>{var q;const F=a.current.insideReactTree;a.current.insideReactTree=!1;const V=x.current;if(x.current=!1,c==="click"&&V||F||typeof m=="function"&&!m(z))return;const H=jb(z),W="["+kL("inert")+"]",B=sm(r.floating).querySelectorAll(W);let J=jr(H)?H:null;for(;J&&!rh(J);){const oe=gh(J);if(rh(oe)||!jr(oe))break;J=oe}if(B.length&&jr(H)&&!Bue(H)&&!N1(H,r.floating)&&Array.from(B).every(oe=>!N1(J,oe)))return;if(Rl(H)&&j){const oe=rh(H),le=Mc(H),ue=/auto|scroll/,Se=oe||ue.test(le.overflowX),Oe=oe||ue.test(le.overflowY),Be=Se&&H.clientWidth>0&&H.scrollWidth>H.clientWidth,je=Oe&&H.clientHeight>0&&H.scrollHeight>H.clientHeight,He=le.direction==="rtl",pe=je&&(He?z.offsetX<=H.offsetWidth-H.clientWidth:z.offsetX>H.clientWidth),ze=Be&&z.offsetY>H.clientHeight;if(pe||ze)return}const Z=(q=a.current.floatingContext)==null?void 0:q.nodeId,G=b&&sM(b.nodesRef.current,Z).some(oe=>{var le;return H3(z,(le=oe.context)==null?void 0:le.elements.floating)});if(H3(z,r.floating)||H3(z,r.domReference)||G)return;const de=b?sM(b.nodesRef.current,Z):[];if(de.length>0){let oe=!0;if(de.forEach(le=>{var ue;if((ue=le.context)!=null&&ue.open&&!le.context.dataRef.current.__outsidePressBubbles){oe=!1;return}}),!oe)return}i(!1,z,"outside-press")}),L=Wu(z=>{var q;const F=()=>{var V;R(z),(V=jb(z))==null||V.removeEventListener(c,F)};(q=jb(z))==null||q.addEventListener(c,F)});I.useEffect(()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=_,a.current.__outsidePressBubbles=w;let z=-1;function q(B){i(!1,B,"ancestor-scroll")}function F(){window.clearTimeout(z),A.current=!0}function V(){z=window.setTimeout(()=>{A.current=!1},cA()?5:0)}const H=sm(r.floating);o&&(H.addEventListener("keydown",M?D:C,M),H.addEventListener("compositionstart",F),H.addEventListener("compositionend",V)),m&&H.addEventListener(c,S?L:R,S);let W=[];return h&&(jr(r.domReference)&&(W=ah(r.domReference)),jr(r.floating)&&(W=W.concat(ah(r.floating))),!jr(r.reference)&&r.reference&&r.reference.contextElement&&(W=W.concat(ah(r.reference.contextElement)))),W=W.filter(B=>{var J;return B!==((J=H.defaultView)==null?void 0:J.visualViewport)}),W.forEach(B=>{B.addEventListener("scroll",q,{passive:!0})}),()=>{o&&(H.removeEventListener("keydown",M?D:C,M),H.removeEventListener("compositionstart",F),H.removeEventListener("compositionend",V)),m&&H.removeEventListener(c,S?L:R,S),W.forEach(B=>{B.removeEventListener("scroll",q)}),window.clearTimeout(z)}},[a,r,o,m,c,n,i,h,s,_,w,C,M,D,R,S,L]),I.useEffect(()=>{a.current.insideReactTree=!1},[a,m,c]);const U=I.useMemo(()=>({onKeyDown:C,...u&&{[Kfe[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},[Yfe[c]]:()=>{a.current.insideReactTree=!0}}),[C,c,a]);return I.useMemo(()=>s?{reference:U,floating:j}:{},[s,U,j])}function $fe(t){const{open:e=!1,onOpenChange:n,elements:i}=t,r=JX(),a=I.useRef({}),[s]=I.useState(()=>jfe()),o=CL()!=null,[l,c]=I.useState(i.reference),u=Wu((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=$fe({...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();nf(()=>{u&&(f.current=u)},[u]);const d=Ofe({...t,elements:{...r,...o&&{reference:o}}}),g=I.useCallback(_=>{const w=jr(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;l(w),d.refs.setReference(w)},[d.refs]),b=I.useCallback(_=>{(jr(_)||_===null)&&(f.current=_,s(_)),(jr(d.refs.reference.current)||d.refs.reference.current===null||_!==null&&!jr(_))&&d.refs.setReference(_)},[d.refs]),y=I.useMemo(()=>({...d.refs,setReference:b,setPositionReference:g,domReference:f}),[d.refs,b,g]),m=I.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),x=I.useMemo(()=>({...d,...i,refs:y,elements:m,nodeId:e}),[d,y,m,e,i]);return nf(()=>{i.dataRef.current.floatingContext=x;const _=h?.nodesRef.current.find(w=>w.id===e);_&&(_.context=x)}),I.useMemo(()=>({...d,context:x,refs:y,elements:m}),[d,y,m,x])}function q3(){return Pue()&&Lue()}function Zfe(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=Ho(s.domReference);function g(){!n&&Rl(s.domReference)&&s.domReference===UB(sm(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(()=>()=>{Zl(u)},[]);const h=I.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(d){if(c.current)return;const g=jb(d.nativeEvent);if(l&&jr(g)){if(q3()&&!d.relatedTarget){if(!f.current&&!zue(g))return}else if(!jue(g))return}i(!0,d.nativeEvent,"focus")},onBlur(d){c.current=!1;const g=d.relatedTarget,b=d.nativeEvent,y=jr(g)&&g.hasAttribute(kL("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var m;const x=UB(s.domReference?s.domReference.ownerDocument:document);!g&&x===s.domReference||N1((m=a.current.floatingContext)==null?void 0:m.refs.floating.current,x)||N1(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,[Pfe]:""},...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 Qfe(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 ehe=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function the(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=JX(),u=((n=a.domReference)==null?void 0:n.id)||c,f=I.useMemo(()=>{var x;return((x=Hue(a.floating))==null?void 0:x.id)||s},[a.floating,s]),h=(i=ehe.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]),m=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:m}:{},[o,b,y,m])}const[nhe,kc]=Eu("ScrollArea.Root component was not found in tree");function q0(t,e){const n=em(e);Rv(()=>{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 ihe=I.forwardRef((t,e)=>{const{style:n,...i}=t,r=kc(),[a,s]=I.useState(0),[o,l]=I.useState(0),c=!!(a&&o);return q0(r.scrollbarX,()=>{const u=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(u),l(u)}),q0(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}),rhe=I.forwardRef((t,e)=>{const n=kc(),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?k.jsx(ihe,{...t,ref:e}):null}),ahe={scrollHideDelay:1e3,type:"hover"},ZX=I.forwardRef((t,e)=>{const{type:n,scrollHideDelay:i,scrollbars:r,getStyles:a,...s}=Pt("ScrollAreaRoot",ahe,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),[m,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(nhe,{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(ct,{...s,ref:D,__vars:{"--sa-corner-width":r!=="xy"?"0px":`${m}px`,"--sa-corner-height":r!=="xy"?"0px":`${_}px`}})})});ZX.displayName="@mantine/core/ScrollAreaRoot";function QX(t,e){const n=t/e;return Number.isNaN(n)?0:n}function hA(t){const e=QX(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=(t.scrollbar.size-n)*e;return Math.max(i,18)}function eK(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 she(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=she(t,l);return eK([0,s],[0,o])(c)}function ohe(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 eK([l,c],f)(t)}function tK(t,e){return t>0&&t<e}function h2(t){return t?parseInt(t,10):0}function Am(t,e,{checkForDefaultPrevented:n=!0}={}){return i=>{t?.(i),(n===!1||!i.defaultPrevented)&&e?.(i)}}const[lhe,nK]=Eu("ScrollAreaScrollbar was not found in tree"),iK=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=kc(),[d,g]=I.useState(null),b=Ps(e,C=>g(C)),y=I.useRef(null),m=I.useRef(""),{viewport:x}=h,_=n.content-n.viewport,w=em(c),M=em(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]),q0(d,S),q0(h.content,S),k.jsx(lhe,{value:{scrollbar:d,hasThumb:i,onThumbChange:em(r),onThumbPointerUp:em(a),onThumbPositionChange:M,onThumbPointerDown:em(s)},children:k.jsx("div",{...f,ref:b,"data-mantine-scrollbar":!0,style:{position:"absolute",...f.style},onPointerDown:Am(t.onPointerDown,C=>{C.preventDefault(),C.button===0&&(C.target.setPointerCapture(C.pointerId),y.current=d.getBoundingClientRect(),m.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(C))}),onPointerMove:Am(t.onPointerMove,A),onPointerUp:Am(t.onPointerUp,C=>{const D=C.target;D.hasPointerCapture(C.pointerId)&&(C.preventDefault(),D.releasePointerCapture(C.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=m.current,y.current=null}})})}),rK=I.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,style:r,...a}=t,s=kc(),[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(iK,{"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),tK(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)}})}})});rK.displayName="@mantine/core/ScrollAreaScrollbarX";const aK=I.forwardRef((t,e)=>{const{sizes:n,onSizesChange:i,style:r,...a}=t,s=kc(),[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(iK,{...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),tK(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)}})}})});aK.displayName="@mantine/core/ScrollAreaScrollbarY";const dA=I.forwardRef((t,e)=>{const{orientation:n="vertical",...i}=t,{dir:r}=Ov(),a=kc(),s=I.useRef(null),o=I.useRef(0),[l,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=QX(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)=>ohe(d,o.current,l,g);return n==="horizontal"?k.jsx(rK,{...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(aK,{...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=kc(),{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 q0(n.viewport,l),q0(n.content,l),i||a?k.jsx(dA,{"data-state":a?"visible":"hidden",...r,ref:e}):null});OL.displayName="@mantine/core/ScrollAreaScrollbarAuto";const sK=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kc(),[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});sK.displayName="@mantine/core/ScrollAreaScrollbarHover";const che=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kc(),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:Am(t.onPointerEnter,()=>o("interacting")),onPointerLeave:Am(t.onPointerLeave,()=>o("idle"))}):null}),PO=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=kc(),{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(sK,{...i,ref:e,forceMount:n}):r.type==="scroll"?k.jsx(che,{...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 uhe(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 oK=I.forwardRef((t,e)=>{const{style:n,...i}=t,r=kc(),a=nK(),{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=uhe(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:Am(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:Am(t.onPointerUp,a.onThumbPointerUp)})});oK.displayName="@mantine/core/ScrollAreaThumb";const UO=I.forwardRef((t,e)=>{const{forceMount:n,...i}=t,r=nK();return n||r.hasThumb?k.jsx(oK,{ref:e,...i}):null});UO.displayName="@mantine/core/ScrollAreaThumb";const lK=I.forwardRef(({children:t,style:e,...n},i)=>{const r=kc(),a=Ps(i,r.onViewportChange);return k.jsx(ct,{...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})})});lK.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 cK={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},fhe=(t,{scrollbarSize:e,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":Et(e),"--scrollarea-over-scroll-behavior":n}}),Dc=tn((t,e)=>{const n=Pt("ScrollArea",cK,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:m,onBottomReached:x,onTopReached:_,overscrollBehavior:w,attributes:M,...S}=n,[A,C]=I.useState(!1),[D,R]=I.useState(!1),[L,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:fhe}),z=I.useRef(null),q=YX([d,z]);return I.useEffect(()=>{if(!z.current||y!=="present")return;const F=z.current,V=new ResizeObserver(()=>{const{scrollHeight:H,clientHeight:W,scrollWidth:B,clientWidth:J}=F;R(H>W),U(B>J)});return V.observe(F),()=>V.disconnect()},[z,y]),k.jsxs(ZX,{getStyles:j,type:u==="never"?"always":u,scrollHideDelay:f,ref:e,scrollbars:m,...j("root"),...S,children:[k.jsx(lK,{...h,...j("viewport",{style:h?.style}),ref:q,"data-offset-scrollbars":y===!0?"xy":y||void 0,"data-scrollbars":m||void 0,"data-horizontal-hidden":y==="present"&&!L?"true":void 0,"data-vertical-hidden":y==="present"&&!D?"true":void 0,onScroll:F=>{h?.onScroll?.(F),g?.({x:F.currentTarget.scrollLeft,y:F.currentTarget.scrollTop});const{scrollTop:V,scrollHeight:H,clientHeight:W}=F.currentTarget;V-(H-W)>=-.6&&x?.(),V===0&&_?.()},children:b}),(m==="xy"||m==="x")&&k.jsx(PO,{...j("scrollbar"),orientation:"horizontal","data-hidden":u==="never"||y==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:k.jsx(UO,{...j("thumb")})}),(m==="xy"||m==="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(rhe,{...j("corner"),"data-hovered":A||void 0,"data-hidden":u==="never"||void 0})]})});Dc.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:m,onBottomReached:x,onTopReached:_,onOverflowChange:w,...M}=Pt("ScrollAreaAutosize",cK,t),S=I.useRef(null),A=YX([u,S]),[C,D]=I.useState(!1),R=I.useRef(!1);return I.useEffect(()=>{if(!w)return;const L=S.current;if(!L)return;const U=()=>{const z=L.scrollHeight>L.clientHeight;z!==C&&(R.current?w?.(z):(R.current=!0,z&&w?.(!0)),D(z))};U();const j=new ResizeObserver(U);return j.observe(L),()=>j.disconnect()},[w,C]),k.jsx(ct,{...M,ref:e,style:[{display:"flex",overflow:"hidden"},y],children:k.jsx(ct,{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(Dc,{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:m,scrollbars:b,onBottomReached:x,onTopReached:_,"data-autosize":"true",children:n})})})});Dc.classes=IL;NL.displayName="@mantine/core/ScrollAreaAutosize";NL.classes=IL;Dc.Autosize=NL;var uK={root:"m_87cf2631"};const hhe={__staticSelector:"UnstyledButton"},cf=Dl((t,e)=>{const n=Pt("UnstyledButton",hhe,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:uK,className:i,style:c,classNames:o,styles:l,unstyled:s,attributes:u});return k.jsx(ct,{...h("root",{focusable:!0}),component:r,ref:e,type:r==="button"?"button":void 0,...f})});cf.classes=uK;cf.displayName="@mantine/core/UnstyledButton";var fK={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:fK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:c});return k.jsx(ct,{component:"span",ref:e,...f("root"),...u})});LL.classes=fK;LL.displayName="@mantine/core/VisuallyHidden";var hK={root:"m_1b7284a3"};const dhe=(t,{radius:e,shadow:n})=>({root:{"--paper-radius":e===void 0?void 0:la(e),"--paper-shadow":mL(n)}}),Ns=Dl((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:hK,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:c,varsResolver:dhe});return k.jsx(ct,{ref:e,mod:[{"data-with-border":l},d],...y("root"),variant:h,...b})});Ns.classes=hK;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 phe={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function mhe({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",[phe[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}=Ov();return a?k.jsx("div",{...c,ref:u,style:{...l,...mhe({position:t,arrowSize:e,arrowOffset:n,arrowRadius:i,arrowPosition:r,dir:f,arrowX:s,arrowY:o})}}):null});d2.displayName="@mantine/core/FloatingArrow";function dK(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 pK={root:"m_9814e45f"};const ghe={zIndex:gf("modal")},bhe=(t,{gradient:e,color:n,backgroundOpacity:i,blur:r,radius:a,zIndex:s})=>({root:{"--overlay-bg":e||(n!==void 0||i!==void 0)&&ic(n||"#000",i??.6)||void 0,"--overlay-filter":r?`blur(${Et(r)})`:void 0,"--overlay-radius":a===void 0?void 0:la(a),"--overlay-z-index":s?.toString()}}),pA=Dl((t,e)=>{const n=Pt("Overlay",ghe,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:m,mod:x,attributes:_,...w}=n,M=Tn({name:"Overlay",props:n,classes:pK,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:_,vars:l,varsResolver:bhe});return k.jsx(ct,{ref:e,...M("root"),mod:[{center:u,fixed:c},x],...w,children:f})});pA.classes=pK;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 vhe({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 yhe={reuseTargetNode:!0},PL=tn((t,e)=>{const{children:n,target:i,reuseTargetNode:r,...a}=Pt("Portal",yhe,t),[s,o]=I.useState(!1),l=I.useRef(null);return Rv(()=>(o(!0),l.current=vhe({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:l_.createPortal(k.jsx(k.Fragment,{children:n}),l.current)});PL.displayName="@mantine/core/Portal";const jd=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}));jd.displayName="@mantine/core/OptionalPortal";const Py=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:{...Py("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Py("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Py("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Py("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Py("top"),common:{transformOrigin:"top right"}}},nz={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function xhe({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 _he({duration:t,exitDuration:e,timingFunction:n,mounted:i,onEnter:r,onExit:a,onEntered:s,onExited:o,enterDelay:l,exitDelay:c}){const u=_a(),f=ZT(),h=u.respectReducedMotion?f:!1,[d,g]=I.useState(h?0:t),[b,y]=I.useState(i?"entered":"exited"),m=I.useRef(-1),x=I.useRef(-1),_=I.useRef(-1);function w(){window.clearTimeout(m.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(()=>{vx.flushSync(()=>{y(A?"pre-entering":"pre-exiting")}),_.current=requestAnimationFrame(()=>{typeof C=="function"&&C(),y(A?"entering":"exiting"),m.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 _c(()=>{S(i)},[i]),I.useEffect(()=>()=>{w()},[]),{transitionDuration:d,transitionStatus:b,transitionTimingFunction:n||"ease"}}function Tc({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}=_he({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(xhe({transition:e,duration:g,state:b,timingFunction:y}))})}Tc.displayName="@mantine/core/Transition";const[She,mK]=Eu("Popover component was not found in the tree");function mA({children:t,active:e=!0,refProp:n="ref",innerRef:i}){const r=Ooe(e),a=Ps(r,i);return sg(t)?I.cloneElement(t,{[n]:a}):t}function gK(t){return k.jsx(LL,{tabIndex:-1,"data-autofocus":!0,...t})}mA.displayName="@mantine/core/FocusTrap";gK.displayName="@mantine/core/FocusTrapInitialFocus";mA.InitialFocus=gK;var bK={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=mK(),d=Qq({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(jd,{...h.portalProps,withinPortal:h.withinPortal,children:k.jsx(Tc,{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(ct,{...g,...f,variant:l,onKeyDownCapture:Qle(()=>{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=bK;UL.displayName="@mantine/core/PopoverDropdown";const whe={refProp:"ref",popupType:"dialog"},vK=tn((t,e)=>{const{children:n,refProp:i,popupType:r,...a}=Pt("PopoverTarget",whe,t);if(!sg(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=mK(),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:ls(o.targetProps.className,s.className,n.props.className),[i]:l,...o.controlled?null:{onClick:()=>{o.onToggle(),n.props.onClick?.()}}})});vK.displayName="@mantine/core/PopoverTarget";function Ehe(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 Mhe(t,e,n){const i=Ehe(t.middlewares),r=[XX(t.offset),Lfe()];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"?Jx():Jx(i.inline)),r.push(KX({element:t.arrowRef,padding:t.arrowOffset})),(i.size||t.width==="target")&&r.push(Nfe({...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 The(t){const e=rA(),[n,i]=Cl({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:Mhe(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]),_c(()=>{t.onPositionChange?.(o.placement),t.positionRef.current=o.placement},[o.placement,t.preventPositionChangeWhenVisible]),_c(()=>{n!==r.current&&(n?t.onOpen?.():t.onClose?.()),r.current=n},[n,t.onClose,t.onOpen]),_c(()=>{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 Ahe={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:gf("popover"),__staticSelector:"Popover",width:"max-content"},Che=(t,{radius:e,shadow:n})=>({dropdown:{"--popover-radius":e===void 0?void 0:la(e),"--popover-shadow":mL(n)}});function Vo(t){const e=Pt("Popover",Ahe,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:m,unstyled:x,classNames:_,styles:w,closeOnClickOutside:M,withinPortal:S,portalProps:A,closeOnEscape:C,clickOutsideEvents:D,trapFocus:R,onClose:L,onDismiss:U,onOpen:j,onChange:z,zIndex:q,radius:F,shadow:V,id:H,defaultOpened:W,__staticSelector:B,withRoles:J,disabled:Z,returnFocus:G,variant:de,keepMounted:oe,vars:le,floatingStrategy:ue,withOverlay:Se,overlayProps:Oe,hideDetached:Be,attributes:je,preventPositionChangeWhenVisible:He,...pe}=e,ze=Tn({name:B,props:e,classes:bK,classNames:_,styles:w,unstyled:x,attributes:je,rootSelector:"dropdown",vars:le,varsResolver:Che}),{resolvedStyles:Ie}=Dv({classNames:_,styles:w,props:e}),[qe,we]=I.useState(o??W??!1),Me=I.useRef(i),Ae=I.useRef(null),[Ne,Ue]=I.useState(null),[Qe,ae]=I.useState(null),{dir:K}=Ov(),ce=rA(),he=mf(H),me=The({middlewares:h,width:f,position:dK(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:L,onDismiss:U,strategy:ue,dropdownVisible:qe,setDropdownVisible:we,positionRef:Me,disabled:Z,preventPositionChangeWhenVisible:He,keepMounted:oe});Soe(()=>{M&&(me.onClose(),U?.())},D,[Ne,Qe]);const $=I.useCallback(Ge=>{Ue(Ge),me.floating.refs.setReference(Ge)},[me.floating.refs.setReference]),Ve=I.useCallback(Ge=>{ae(Ge),me.floating.refs.setFloating(Ge)},[me.floating.refs.setFloating]),Xe=I.useCallback(()=>{l?.onExited?.(),c?.(),we(!1),He||(Me.current=i)},[l?.onExited,c,He,i]),mt=I.useCallback(()=>{l?.onEntered?.(),u?.()},[l?.onEntered,u]);return k.jsxs(She,{value:{returnFocus:G,disabled:Z,controlled:me.controlled,reference:$,floating:Ve,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:m,placement:me.floating.placement,trapFocus:R,withinPortal:S,portalProps:A,zIndex:q,radius:F,shadow:V,closeOnEscape:C,onDismiss:U,onClose:me.onClose,onToggle:me.onToggle,getTargetId:()=>`${he}-target`,getDropdownId:()=>`${he}-dropdown`,withRoles:J,targetProps:pe,__staticSelector:B,classNames:_,styles:w,unstyled:x,variant:de,keepMounted:oe,getStyles:ze,resolvedStyles:Ie,floatingStrategy:ue,referenceHidden:Be&&ce!=="test"?me.floating.middlewareData.hide?.referenceHidden:!1},children:[n,Se&&k.jsx(Tc,{transition:"fade",mounted:me.opened,duration:l?.duration||250,exitDuration:l?.exitDuration||250,children:Ge=>k.jsx(jd,{withinPortal:S,children:k.jsx(pA,{...Oe,...ze("overlay",{className:Oe?.className,style:[Ge,Oe?.style]})})})})]})}Vo.Target=vK;Vo.Dropdown=UL;Vo.displayName="@mantine/core/Popover";Vo.extend=t=>t;var hu={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 yK=I.forwardRef(({className:t,...e},n)=>k.jsxs(ct,{component:"span",className:ls(hu.barsLoader,t),...e,ref:n,children:[k.jsx("span",{className:hu.bar}),k.jsx("span",{className:hu.bar}),k.jsx("span",{className:hu.bar})]}));yK.displayName="@mantine/core/Bars";const xK=I.forwardRef(({className:t,...e},n)=>k.jsxs(ct,{component:"span",className:ls(hu.dotsLoader,t),...e,ref:n,children:[k.jsx("span",{className:hu.dot}),k.jsx("span",{className:hu.dot}),k.jsx("span",{className:hu.dot})]}));xK.displayName="@mantine/core/Dots";const _K=I.forwardRef(({className:t,...e},n)=>k.jsx(ct,{component:"span",className:ls(hu.ovalLoader,t),...e,ref:n}));_K.displayName="@mantine/core/Oval";const SK={bars:yK,oval:_K,dots:xK},Rhe={loaders:SK,type:"oval"},khe=(t,{size:e,color:n})=>({root:{"--loader-size":ui(e,"loader-size"),"--loader-color":n?sa(n,t):void 0}}),Yd=tn((t,e)=>{const n=Pt("Loader",Rhe,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,m=Tn({name:"Loader",props:n,classes:hu,className:o,style:l,classNames:c,styles:u,unstyled:f,attributes:b,vars:s,varsResolver:khe});return g?k.jsx(ct,{...m("root"),ref:e,...y,children:g}):k.jsx(ct,{...m("root"),ref:e,component:h[a],variant:d,size:i,...y})});Yd.defaultLoaders=SK;Yd.classes=hu;Yd.displayName="@mantine/core/Loader";var Lv={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const iz={orientation:"horizontal"},Dhe=(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:Lv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:c,varsResolver:Dhe,rootSelector:"group"});return k.jsx(ct,{...b("group"),ref:e,variant:f,mod:[{"data-orientation":l},h],role:"group",...g})});FL.classes=Lv;FL.displayName="@mantine/core/ActionIconGroup";const Ohe=(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":ui(s,"section-height"),"--section-padding-x":ui(s,"section-padding-x"),"--section-fz":Ds(s),"--section-radius":e===void 0?void 0:la(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:Lv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:Ohe,rootSelector:"groupSection"});return k.jsx(ct,{...b("groupSection"),ref:e,variant:c,...g})});BL.classes=Lv;BL.displayName="@mantine/core/ActionIconGroupSection";const Ihe=(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":ui(e,"ai-size"),"--ai-radius":n===void 0?void 0:la(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}}},Ol=Dl((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:m,disabled:x,"data-disabled":_,autoContrast:w,mod:M,attributes:S,...A}=n,C=Tn({name:["ActionIcon",g],props:n,className:i,style:l,classes:Lv,classNames:s,styles:o,unstyled:r,attributes:S,vars:y,varsResolver:Ihe});return k.jsxs(cf,{...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(Tc,{mounted:c,transition:"slide-down",duration:150,children:D=>k.jsx(ct,{component:"span",...C("loader",{style:D}),"aria-hidden":!0,children:k.jsx(Yd,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...u})})}),k.jsx(ct,{component:"span",mod:{loading:c},...C("icon"),children:m})]})});Ol.classes=Lv;Ol.displayName="@mantine/core/ActionIcon";Ol.Group=FL;Ol.GroupSection=BL;const wK=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"})}));wK.displayName="@mantine/core/CloseIcon";var EK={root:"m_86a44da5","root--subtle":"m_220c80f2"};const Nhe={variant:"subtle"},Lhe=(t,{size:e,radius:n,iconSize:i})=>({root:{"--cb-size":ui(e,"cb-size"),"--cb-radius":n===void 0?void 0:la(n),"--cb-icon-size":Et(i)}}),R_=Dl((t,e)=>{const n=Pt("CloseButton",Nhe,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:m,__staticSelector:x,..._}=n,w=Tn({name:x||"CloseButton",props:n,className:o,style:c,classes:EK,classNames:l,styles:u,unstyled:f,attributes:m,vars:a,varsResolver:Lhe});return k.jsxs(cf,{ref:e,..._,unstyled:f,variant:g,disabled:d,mod:[{disabled:d||h},y],...w("root",{variant:g,active:!d&&!h}),children:[b||k.jsx(wK,{}),r]})});R_.classes=EK;R_.displayName="@mantine/core/CloseButton";function Phe(t){return I.Children.toArray(t).filter(Boolean)}var MK={root:"m_4081bf90"};const Uhe={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},Fhe=(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":zd(i),"--group-align":r,"--group-justify":a,"--group-wrap":s}}),X0=tn((t,e)=>{const n=Pt("Group",Uhe,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:m,mod:x,attributes:_,...w}=n,M=Phe(l),S=M.length,A=zd(c??"md"),D={childWidth:`calc(${100/S}% - (${A} - ${A} / ${S}))`},R=Tn({name:"Group",props:n,stylesCtx:D,className:r,style:a,classes:MK,classNames:i,styles:s,unstyled:o,attributes:_,vars:b,varsResolver:Fhe});return k.jsx(ct,{...R("root"),ref:e,variant:y,mod:[{grow:d},x],size:m,...w,children:M})});X0.classes=MK;X0.displayName="@mantine/core/Group";const[Bhe,wh]=Eu("ModalBase component was not found in tree");function zhe({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 jhe({id:t,transitionProps:e,opened:n,trapFocus:i,closeOnEscape:r,onClose:a,returnFocus:s}){const o=mf(t),[l,c]=I.useState(!1),[u,f]=I.useState(!1),h=typeof e?.duration=="number"?e?.duration:200,d=zhe({opened:n,transitionDuration:h});return Uoe("keydown",g=>{g.key==="Escape"&&r&&!g.isComposing&&n&&g.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&a()},{capture:!0}),Qq({opened:n,shouldReturnFocus:i&&s}),{_id:o,titleMounted:l,bodyMounted:u,shouldLockScroll:d,setTitleMounted:c,setBodyMounted:f}}const TK=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:m,__vars:x,unstyled:_,removeScrollProps:w,...M},S)=>{const{_id:A,titleMounted:C,bodyMounted:D,shouldLockScroll:R,setTitleMounted:L,setBodyMounted:U}=jhe({id:i,transitionProps:r,opened:e,trapFocus:o,closeOnEscape:l,onClose:n,returnFocus:c}),{key:j,...z}=w||{};return k.jsx(jd,{...h,withinPortal:f,children:k.jsx(Bhe,{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:L,setBodyMounted:U,trapFocus:o,closeOnEscape:l,zIndex:b,unstyled:_},children:k.jsx(a2,{enabled:R&&d,...z,children:k.jsx(ct,{ref:S,...M,__vars:{...x,"--mb-z-index":(b||gf("modal")).toString(),"--mb-shadow":mL(y),"--mb-padding":zd(m)},children:g})},j)})})});TK.displayName="@mantine/core/ModalBase";function Hhe(){const t=wh();return I.useEffect(()=>(t.setBodyMounted(!0),()=>t.setBodyMounted(!1)),[]),t.getBodyId()}var K0={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const AK=I.forwardRef(({className:t,...e},n)=>{const i=Hhe(),r=wh();return k.jsx(ct,{ref:n,...e,id:i,className:ls({[K0.body]:!r.unstyled},t)})});AK.displayName="@mantine/core/ModalBaseBody";const CK=I.forwardRef(({className:t,onClick:e,...n},i)=>{const r=wh();return k.jsx(R_,{ref:i,...n,onClick:a=>{r.onClose(),e?.(a)},className:ls({[K0.close]:!r.unstyled},t),unstyled:r.unstyled})});CK.displayName="@mantine/core/ModalBaseCloseButton";const RK=I.forwardRef(({transitionProps:t,className:e,innerProps:n,onKeyDown:i,style:r,...a},s)=>{const o=wh();return k.jsx(Tc,{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:ls({[K0.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:ls({[K0.content]:!o.unstyled},e),unstyled:o.unstyled,children:a.children})})})})});RK.displayName="@mantine/core/ModalBaseContent";const kK=I.forwardRef(({className:t,...e},n)=>{const i=wh();return k.jsx(ct,{component:"header",ref:n,className:ls({[K0.header]:!i.unstyled},t),...e})});kK.displayName="@mantine/core/ModalBaseHeader";const Vhe={duration:200,timingFunction:"ease",transition:"fade"};function Ghe(t){const e=wh();return{...Vhe,...e.transitionProps,...t}}const DK=I.forwardRef(({onClick:t,transitionProps:e,style:n,visible:i,...r},a)=>{const s=wh(),o=Ghe(e);return k.jsx(Tc,{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})})});DK.displayName="@mantine/core/ModalBaseOverlay";function Whe(){const t=wh();return I.useEffect(()=>(t.setTitleMounted(!0),()=>t.setTitleMounted(!1)),[]),t.getTitleId()}const OK=I.forwardRef(({className:t,...e},n)=>{const i=Whe(),r=wh();return k.jsx(ct,{component:"h2",ref:n,className:ls({[K0.title]:!r.unstyled},t),...e,id:i})});OK.displayName="@mantine/core/ModalBaseTitle";function qhe({children:t}){return k.jsx(k.Fragment,{children:t})}const[Xhe,Khe]=M_({size:"sm"}),IK=tn((t,e)=>{const n=Pt("InputClearButton",null,t),{size:i,variant:r,vars:a,classNames:s,styles:o,...l}=n,c=Khe(),{resolvedClassNames:u,resolvedStyles:f}=Dv({classNames:s,styles:o,props:n});return k.jsx(R_,{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})});IK.displayName="@mantine/core/InputClearButton";const Yhe={xs:7,sm:8,md:10,lg:12,xl:15};function Jhe({__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:Yhe[r]},children:[a,n||i]}):n||a||i}const[$he,k_]=M_({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Oc={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 Zhe=(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=k_(),y=Tn({name:["InputWrapper",u],props:n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:h,rootSelector:"description",vars:l,varsResolver:Zhe}),m=f&&b?.getStyles||y;return k.jsx(ct,{component:"p",ref:e,variant:d,size:c,...m("description",b?.getStyles?{className:r,style:a}:void 0),...g})});gA.classes=Oc;gA.displayName="@mantine/core/InputDescription";const Qhe=(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:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:u,rootSelector:"error",vars:l,varsResolver:Qhe}),y=k_(),m=h&&y?.getStyles||b;return k.jsx(ct,{component:"p",ref:e,variant:d,size:c,...m("error",y?.getStyles?{className:r,style:a}:void 0),...g})});bA.classes=Oc;bA.displayName="@mantine/core/InputError";const rz={labelElement:"label"},ede=(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:m,attributes:x,..._}=Pt("InputLabel",rz,n),w=Tn({name:["InputWrapper",b],props:n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:x,rootSelector:"label",vars:l,varsResolver:ede}),M=k_(),S=M?.getStyles||w;return k.jsxs(ct,{...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},m],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=Oc;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:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,rootSelector:"placeholder"});return k.jsx(ct,{...b("placeholder"),mod:[{error:!!f},h],component:"span",variant:u,ref:e,...g})});zL.classes=Oc;zL.displayName="@mantine/core/InputPlaceholder";function tde(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 nde={labelElement:"label",inputContainer:t=>t,inputWrapperOrder:["label","description","input","error"]},ide=(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",nde,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:m,descriptionProps:x,errorProps:_,labelElement:w,children:M,withAsterisk:S,id:A,required:C,__stylesApiProps:D,mod:R,attributes:L,...U}=n,j=Tn({name:["InputWrapper",f],props:D||n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:L,vars:l,varsResolver:ide}),z={size:c,variant:u,__staticSelector:f},q=mf(A),F=typeof S=="boolean"?S:C,V=_?.id||`${q}-error`,H=x?.id||`${q}-description`,W=q,B=!!b&&typeof b!="boolean",J=!!y,Z=`${B?V:""} ${J?H:""}`,G=Z.trim().length>0?Z.trim():void 0,de=m?.id||`${q}-label`,oe=g&&k.jsx(vA,{labelElement:w,id:de,htmlFor:W,required:F,...z,...m,children:g},"label"),le=J&&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"),Se=B&&I.createElement(bA,{..._,...z,size:_?.size||z.size,key:"error",id:_?.id||V},b),Oe=d.map(Be=>{switch(Be){case"label":return oe;case"input":return ue;case"description":return le;case"error":return Se;default:return null}});return k.jsx($he,{value:{getStyles:j,describedBy:G,inputId:W,labelId:de,...tde(d,{hasDescription:J,hasError:B})},children:k.jsx(ct,{ref:e,variant:u,size:c,mod:[{error:!!b},R],...j("root"),...U,children:Oe})})});jL.classes=Oc;jL.displayName="@mantine/core/InputWrapper";const rde={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},ade=(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":ui(e.size,"input-height"),"--input-fz":Ds(e.size),"--input-radius":e.radius===void 0?void 0:la(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?ui(e.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":e.leftSectionPointerEvents,"--input-right-section-pointer-events":e.rightSectionPointerEvents}}),ga=Dl((t,e)=>{const n=Pt("Input",rde,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:m,rightSection:x,rightSectionProps:_,rightSectionWidth:w,rightSectionPointerEvents:M,leftSectionPointerEvents:S,variant:A,vars:C,pointer:D,multiline:R,radius:L,id:U,withAria:j,withErrorStyles:z,mod:q,inputSize:F,attributes:V,__clearSection:H,__clearable:W,__defaultRightSection:B,...J}=n,{styleProps:Z,rest:G}=A_(J),de=k_(),oe={offsetBottom:de?.offsetBottom,offsetTop:de?.offsetTop},le=Tn({name:["Input",c],props:u||n,classes:Oc,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:V,stylesCtx:oe,rootSelector:"wrapper",vars:C,varsResolver:ade}),ue=j?{required:l,disabled:g,"aria-invalid":!!d,"aria-describedby":de?.describedBy,id:de?.inputId||U}:{},Se=Jhe({__clearable:W,__clearSection:H,rightSection:x,__defaultRightSection:B,size:f});return k.jsx(Xhe,{value:{size:f||"sm"},children:k.jsxs(ct,{...le("wrapper"),...Z,...h,mod:[{error:!!d&&z,pointer:D,disabled:g,multiline:R,"data-with-right-section":!!Se,"data-with-left-section":!!b},q],variant:A,size:f,children:[b&&k.jsx("div",{...y,"data-position":"left",...le("section",{className:y?.className,style:y?.style}),children:b}),k.jsx(ct,{component:"input",...G,...ue,ref:e,required:l,mod:{disabled:g,error:!!d&&z},variant:A,__size:F,...le("input")}),Se&&k.jsx("div",{..._,"data-position":"right",...le("section",{className:_?.className,style:_?.style}),children:Se})]})})});ga.classes=Oc;ga.Wrapper=jL;ga.Label=vA;ga.Error=bA;ga.Description=gA;ga.Placeholder=zL;ga.ClearButton=IK;ga.displayName="@mantine/core/Input";function NK(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:m,id:x,size:_,style:w,inputContainer:M,inputWrapperOrder:S,withAsterisk:A,variant:C,vars:D,mod:R,attributes:L,...U}=i,{styleProps:j,rest:z}=A_(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:L,...m};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:L}}}const sde={__staticSelector:"InputBase",withAria:!0,size:"sm"},Mu=Dl((t,e)=>{const{inputProps:n,wrapperProps:i,...r}=NK("InputBase",sde,t);return k.jsx(ga.Wrapper,{...i,children:k.jsx(ga,{...n,...r,ref:e})})});Mu.classes={...ga.classes,...ga.Wrapper.classes};Mu.displayName="@mantine/core/InputBase";const ode={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 LK={root:"m_8bffd616"};const bh=Dl((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,...m}=n,x=Tn({name:"Flex",classes:LK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l}),_=_a(),w=DX(),M=kX({styleProps:{gap:c,rowGap:u,columnGap:f,align:h,justify:d,wrap:g,direction:b},theme:_,data:ode});return k.jsxs(k.Fragment,{children:[M.hasResponsiveStyles&&k.jsx(RX,{selector:`.${w}`,styles:M.styles,media:M.media}),k.jsx(ct,{ref:e,...x("root",{className:w,style:eA(M.inlineStyles)}),...m})]})});bh.classes=LK;bh.displayName="@mantine/core/Flex";var PK={root:"m_b6d8b162"};function lde(t){if(t==="start")return"start";if(t==="end"||t)return"end"}const cde={inherit:!1},ude=(t,{variant:e,lineClamp:n,gradient:i,size:r,color:a})=>({root:{"--text-fz":Ds(r),"--text-lh":_X(r),"--text-gradient":e==="gradient"?TO(i,t):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":a?sa(a,t):void 0}}),bu=Dl((t,e)=>{const n=Pt("Text",cde,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:m,size:x,attributes:_,...w}=n,M=Tn({name:["Text",c],props:n,classes:PK,className:f,style:h,classNames:d,styles:g,unstyled:b,attributes:_,vars:u,varsResolver:ude});return k.jsx(ct,{...M("root",{focusable:!0}),ref:e,component:l?"span":"p",variant:y,mod:[{"data-truncate":lde(r),"data-line-clamp":typeof i=="number","data-inline":a,"data-inherit":s},m],size:x,...w})});bu.classes=PK;bu.displayName="@mantine/core/Text";var UK={root:"m_849cf0da"};const fde={underline:"hover"},Cm=Dl((t,e)=>{const{underline:n,className:i,unstyled:r,mod:a,...s}=Pt("Anchor",fde,t);return k.jsx(bu,{component:"a",ref:e,className:ls({[UK.root]:!r},i),...s,mod:[{underline:n},a],__staticSelector:"Anchor",unstyled:r})});Cm.classes=UK;Cm.displayName="@mantine/core/Anchor";function FK(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=>FK(e))}:t}function hde(t){return t?t.map(e=>FK(e)):[]}function BK(t){return t.reduce((e,n)=>"group"in n?{...e,...BK(n.items)}:(e[n.value]=n,e),{})}var Wo={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 dde={error:null},pde=(t,{size:e,color:n})=>({chevron:{"--combobox-chevron-size":ui(e,"combobox-chevron-size"),"--combobox-chevron-color":n?sa(n,t):void 0}}),HL=tn((t,e)=>{const n=Pt("ComboboxChevron",dde,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:Wo,props:n,style:a,className:s,classNames:o,styles:l,unstyled:c,vars:u,varsResolver:pde,rootSelector:"chevron"});return k.jsx(ct,{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=Wo;HL.displayName="@mantine/core/ComboboxChevron";const[mde,Ic]=Eu("Combobox component was not found in tree"),zK=I.forwardRef(({size:t,onMouseDown:e,onClick:n,onClear:i,...r},a)=>k.jsx(ga.ClearButton,{ref:a,tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:s=>{s.preventDefault(),e?.(s)},onClick:s=>{i(),n?.(s)}}));zK.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=Ic();return k.jsx(Vo.Dropdown,{...o,ref:e,role:"presentation","data-hidden":s||void 0,...l.getStyles("dropdown",{className:r,style:a,classNames:n,styles:i})})});VL.classes=Wo;VL.displayName="@mantine/core/ComboboxDropdown";const gde={refProp:"ref"},jK=tn((t,e)=>{const{children:n,refProp:i}=Pt("ComboboxDropdownTarget",gde,t);if(Ic(),!sg(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(Vo.Target,{ref:e,refProp:i,children:n})});jK.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=Ic();return k.jsx(ct,{ref:e,...l.getStyles("empty",{className:i,classNames:n,styles:a,style:r}),...o})});GL.classes=Wo;GL.displayName="@mantine/core/ComboboxEmpty";function WL({onKeyDown:t,withKeyboardNavigation:e,withAriaAttributes:n,withExpandedAttribute:i,targetType:r,autoComplete:a}){const s=Ic(),[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 bde={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},HK=tn((t,e)=>{const{children:n,refProp:i,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:s,targetType:o,autoComplete:l,...c}=Pt("ComboboxEventsTarget",bde,t);if(!sg(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=Ic(),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))})});HK.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=Ic();return k.jsx(ct,{ref:e,...l.getStyles("footer",{className:i,classNames:n,style:r,styles:a}),...o,onMouseDown:c=>{c.preventDefault()}})});qL.classes=Wo;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=Ic(),h=mf(c);return k.jsxs(ct,{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=Wo;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=Ic();return k.jsx(ct,{ref:e,...l.getStyles("header",{className:i,classNames:n,style:r,styles:a}),...o,onMouseDown:c=>{c.preventDefault()}})});KL.classes=Wo;KL.displayName="@mantine/core/ComboboxHeader";function VK({value:t,valuesDivider:e=",",...n}){return k.jsx("input",{type:"hidden",value:Array.isArray(t)?t.join(e):t||"",...n})}VK.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,m=Ic(),x=I.useId(),_=c||x;return k.jsx(ct,{...m.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():(m.onOptionSubmit?.(n.value,n),l?.(w))},onMouseDown:w=>{w.preventDefault(),f?.(w)},onMouseOver:w=>{m.resetSelectionOnOptionHover&&m.store.resetSelectedOption(),h?.(w)}})});YL.classes=Wo;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=Ic(),h=mf(o);return I.useEffect(()=>{f.store.setListId(h)},[h]),k.jsx(ct,{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=Wo;JL.displayName="@mantine/core/ComboboxOptions";const vde={withAriaAttributes:!0,withKeyboardNavigation:!0},$L=tn((t,e)=>{const n=Pt("ComboboxSearch",vde,t),{classNames:i,styles:r,unstyled:a,vars:s,withAriaAttributes:o,onKeyDown:l,withKeyboardNavigation:c,size:u,...f}=n,h=Ic(),d=h.getStyles("search"),g=WL({targetType:"input",withAriaAttributes:o,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:l,autoComplete:"off"});return k.jsx(ga,{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=Wo;$L.displayName="@mantine/core/ComboboxSearch";const yde={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},GK=tn((t,e)=>{const{children:n,refProp:i,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:s,targetType:o,autoComplete:l,...c}=Pt("ComboboxTarget",yde,t);if(!sg(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=Ic(),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(Vo.Target,{ref:Ps(e,u.store.targetRef),children:h})});GK.displayName="@mantine/core/ComboboxTarget";function xde(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 _de(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 Sde(t){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute("data-combobox-disabled"))return e;return-1}function WK({defaultOpened:t,opened:e,onOpenedChange:n,onDropdownClose:i,onDropdownOpen:r,loop:a=!0,scrollBehavior:s="instant"}={}){const[o,l]=Cl({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((F="unknown")=>{o||(l(!0),r?.(F))},[l,r,o]),m=I.useCallback((F="unknown")=>{o&&(l(!1),i?.(F))},[l,i,o]),x=I.useCallback((F="unknown")=>{o?m(F):y(F)},[m,y,o]),_=I.useCallback(()=>{const F=document.querySelector(`#${c.current} [data-combobox-selected]`);F?.removeAttribute("data-combobox-selected"),F?.removeAttribute("aria-selected")},[]),w=I.useCallback(F=>{const H=document.getElementById(c.current)?.querySelectorAll("[data-combobox-option]");if(!H)return null;const W=F>=H.length?0:F<0?H.length-1:F;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 F=document.querySelector(`#${c.current} [data-combobox-active]`);if(F){const V=document.querySelectorAll(`#${c.current} [data-combobox-option]`),H=Array.from(V).findIndex(W=>W===F);return w(H)}return w(0)},[w]),S=I.useCallback(()=>w(_de(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),a)),[w,a]),A=I.useCallback(()=>w(xde(u.current,document.querySelectorAll(`#${c.current} [data-combobox-option]`),a)),[w,a]),C=I.useCallback(()=>w(Sde(document.querySelectorAll(`#${c.current} [data-combobox-option]`))),[w]),D=I.useCallback((F="selected",V)=>{b.current=window.setTimeout(()=>{const H=document.querySelectorAll(`#${c.current} [data-combobox-option]`),W=Array.from(H).findIndex(B=>B.hasAttribute(`data-combobox-${F}`));u.current=W,V?.scrollIntoView&&H[W]?.scrollIntoView({block:"nearest",behavior:s})},0)},[]),R=I.useCallback(()=>{u.current=-1,_()},[_]),L=I.useCallback(()=>{document.querySelectorAll(`#${c.current} [data-combobox-option]`)?.[u.current]?.click()},[]),U=I.useCallback(F=>{c.current=F},[]),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:m,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:L,searchRef:f,focusSearchInput:j,targetRef:h,focusTarget:z}}const wde={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},Ede=(t,{size:e,dropdownPadding:n})=>({options:{"--combobox-option-fz":Ds(e),"--combobox-option-padding":ui(e,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:Et(n),"--combobox-option-fz":Ds(e),"--combobox-option-padding":ui(e,"combobox-option-padding")}});function Sr(t){const e=Pt("Combobox",wde,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,m=WK(),x=s||m,_=Tn({name:d||"Combobox",classes:Wo,props:e,classNames:n,styles:i,unstyled:r,attributes:b,vars:o,varsResolver:Ede}),w=()=>{c?.(),x.closeDropdown()};return k.jsx(mde,{value:{getStyles:_,store:x,onOptionSubmit:l,size:u,resetSelectionOnOptionHover:h,readOnly:g},children:k.jsx(Vo,{opened:x.dropdownOpened,preventPositionChangeWhenVisible:!0,...y,onChange:M=>!M&&w(),withRoles:!1,unstyled:r,children:a})})}const Mde=t=>t;Sr.extend=Mde;Sr.classes=Wo;Sr.displayName="@mantine/core/Combobox";Sr.Target=GK;Sr.Dropdown=VL;Sr.Options=JL;Sr.Option=YL;Sr.Search=$L;Sr.Empty=GL;Sr.Chevron=HL;Sr.Footer=qL;Sr.Header=KL;Sr.EventsTarget=HK;Sr.DropdownTarget=jK;Sr.Group=XL;Sr.ClearButton=zK;Sr.HiddenInput=VK;var qK={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const XK=qK,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:m,vars:x,mod:_,attributes:w,...M},S)=>{const A=Tn({name:t,props:e,className:n,style:m,classes:qK,classNames:i,styles:r,unstyled:a,attributes:w});return k.jsx(ct,{...A("root"),ref:S,__vars:{"--label-fz":Ds(h),"--label-lh":ui(h,"label-lh")},mod:[{"label-position":d},_],variant:y,size:h,...M,children:k.jsxs(ct,{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(ct,{component:b,htmlFor:b==="label"?c:void 0,...A("label"),"data-disabled":u||void 0,children:o}),l&&k.jsx(ga.Description,{size:h,__inheritStyles:!1,...A("description"),children:l}),f&&typeof f!="boolean"&&k.jsx(ga.Error,{size:h,__inheritStyles:!1,...A("error"),children:f})]})]})})});ZL.displayName="@mantine/core/InlineInput";const KK=I.createContext(null),Tde=KK.Provider,YK=()=>I.useContext(KK),[Ade,Cde]=M_();var JK={card:"m_26775b0a"};const Rde={withBorder:!0},kde=(t,{radius:e})=>({card:{"--card-radius":la(e)}}),QL=tn((t,e)=>{const n=Pt("CheckboxCard",Rde,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,...m}=n,x=Tn({name:"CheckboxCard",classes:JK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l,varsResolver:kde,rootSelector:"card"}),_=YK(),w=typeof c=="boolean"?c:_?_.value.includes(h||""):void 0,[M,S]=Cl({value:w,defaultValue:g,finalValue:!1,onChange:b});return k.jsx(Ade,{value:{checked:M},children:k.jsx(cf,{ref:e,mod:[{"with-border":f,checked:M},u],...x("card"),...m,role:"checkbox","aria-checked":M,onClick:A=>{d?.(A),_?.onChange(h||""),S(!M)}})})});QL.displayName="@mantine/core/CheckboxCard";QL.classes=JK;function $K({children:t,role:e}){const n=k_();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]=Cl({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(Tde,{value:{value:u,onChange:h,size:a},children:k.jsx(ga.Wrapper,{size:a,ref:e,...s,...c,labelElement:"div",__staticSelector:"CheckboxGroup",children:k.jsx($K,{role:"group",children:o})})})});eP.classes=ga.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 ZK({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 QK={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const Dde={icon:ZK,variant:"filled"},Ode=(t,{radius:e,color:n,size:i,iconColor:r,variant:a,autoContrast:s})=>{const o=ph({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":ui(i,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:la(e),"--checkbox-color":a==="outline"?l:sa(n,t),"--checkbox-icon-color":r?sa(r,t):sA(s,t)?T_({color:n,theme:t,autoContrast:s}):void 0}}},nP=tn((t,e)=>{const n=Pt("CheckboxIndicator",Dde,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:m,disabled:x,attributes:_,...w}=n,M=Tn({name:"CheckboxIndicator",classes:QK,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:_,vars:l,varsResolver:Ode,rootSelector:"indicator"}),S=Cde(),A=typeof b=="boolean"||typeof u=="boolean"?b||u:S?.checked||!1;return k.jsx(ct,{ref:e,...M("indicator",{variant:m}),variant:m,mod:[{checked:A,disabled:x},y],...w,children:k.jsx(c,{indeterminate:u,...M("icon")})})});nP.displayName="@mantine/core/CheckboxIndicator";nP.classes=QK;var eY={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const Ide={labelPosition:"right",icon:ZK,variant:"filled"},Nde=(t,{radius:e,color:n,size:i,iconColor:r,variant:a,autoContrast:s})=>{const o=ph({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":ui(i,"checkbox-size"),"--checkbox-radius":e===void 0?void 0:la(e),"--checkbox-color":a==="outline"?l:sa(n,t),"--checkbox-icon-color":r?sa(r,t):sA(s,t)?T_({color:n,theme:t,autoContrast:s}):void 0}}},vh=tn((t,e)=>{const n=Pt("Checkbox",Ide,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:m,error:x,disabled:_,variant:w,indeterminate:M,icon:S,rootRef:A,iconColor:C,onChange:D,autoContrast:R,mod:L,attributes:U,...j}=n,z=YK(),q=h||z?.size,F=Tn({name:"Checkbox",props:n,classes:eY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:U,vars:l,varsResolver:Nde}),{styleProps:V,rest:H}=A_(j),W=mf(f),B=z?{checked:z.value.includes(H.value),onChange:G=>{z.onChange(G),D?.(G)}}:{},J=I.useRef(null),Z=e||J;return I.useEffect(()=>{Z&&"current"in Z&&Z.current&&(Z.current.indeterminate=M||!1)},[M,Z]),k.jsx(ZL,{...F("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:W,size:q,labelPosition:y,label:u,description:m,error:x,disabled:_,classNames:i,styles:s,unstyled:o,"data-checked":B.checked||b||void 0,variant:w,ref:A,mod:L,...V,...g,children:k.jsxs(ct,{...F("inner"),mod:{"data-label-position":y},children:[k.jsx(ct,{component:"input",id:W,ref:Z,checked:b,disabled:_,mod:{error:!!x,indeterminate:M},...F("input",{focusable:!0,variant:w}),onChange:D,...H,...B,type:"checkbox"}),k.jsx(S,{indeterminate:M,...F("icon")})]})})});vh.classes={...eY,...XK};vh.displayName="@mantine/core/Checkbox";vh.Group=eP;vh.Indicator=nP;vh.Card=QL;function P1(t){return"group"in t}function tY({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;P1(s)&&r.push({group:s.group,items:tY({options:s.items,search:e,limit:n-r.length})}),P1(s)||s.label.toLowerCase().includes(i)&&r.push(s)}return r}function Lde(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 nY(t,e=new Set){if(Array.isArray(t))for(const n of t)if(P1(n))nY(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 Pde(t,e){return Array.isArray(t)?t.includes(e):t===e}function iY({data:t,withCheckIcon:e,value:n,checkIconPosition:i,unstyled:r,renderOption:a}){if(!P1(t)){const o=Pde(n,t.value),l=e&&o&&k.jsx(tP,{className:Wo.optionsDropdownCheckIcon}),c=k.jsxs(k.Fragment,{children:[i==="left"&&l,k.jsx("span",{children:t.label}),i==="right"&&l]});return k.jsx(Sr.Option,{value:t.value,disabled:t.disabled,className:ls({[Wo.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(iY,{data:o,value:n,unstyled:r,withCheckIcon:e,checkIconPosition:i,renderOption:a},o.value));return k.jsx(Sr.Group,{label:t.group,children:s})}function Ude({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":m}){nY(t);const _=typeof r=="string"?(i||tY)({options:t,search:l?r:"",limit:a??1/0}):t,w=Lde(_),M=_.map(S=>k.jsx(iY,{data:S,withCheckIcon:c,value:u,checkIconPosition:f,unstyled:d,renderOption:b},P1(S)?S.group:S.value));return k.jsx(Sr.Dropdown,{hidden:e||n&&w,"data-composed":!0,children:k.jsxs(Sr.Options,{labelledBy:g,"aria-label":m,children:[o?k.jsx(Dc.Autosize,{mah:s??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...y,children:M}):M,w&&h&&k.jsx(Sr.Empty,{children:h})]})})}var rY={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const Fde={iconSize:48},Bde=(t,{color:e,iconSize:n,radius:i})=>{const r=ph({color:e||t.primaryColor,theme:t,colorScheme:"dark"}),a=ph({color:e||t.primaryColor,theme:t,colorScheme:"light"});return{root:{"--bq-bg-light":ic(a.value,.07),"--bq-bg-dark":ic(r.value,.06),"--bq-bd":sa(e,t),"--bq-icon-size":Et(n),"--bq-radius":la(i)}}},iP=tn((t,e)=>{const n=Pt("Blockquote",Fde,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:rY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:Bde});return k.jsxs(ct,{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=rY;iP.displayName="@mantine/core/Blockquote";var aY={root:"m_fea6bf1a",burger:"m_d4fb9cad"};const zde=(t,{color:e,size:n,lineSize:i,transitionDuration:r,transitionTimingFunction:a})=>({root:{"--burger-color":e?sa(e,t):void 0,"--burger-size":ui(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:aY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:zde});return k.jsxs(cf,{...y("root"),ref:e,...b,children:[k.jsx(ct,{mod:["reduce-motion",{opened:c}],...y("burger")}),u]})});rP.classes=aY;rP.displayName="@mantine/core/Burger";var Pv={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"},jde=(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:Pv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:c,varsResolver:jde,rootSelector:"group"});return k.jsx(ct,{...b("group"),ref:e,variant:f,mod:[{"data-orientation":l},h],role:"group",...g})});aP.classes=Pv;aP.displayName="@mantine/core/ButtonGroup";const Hde=(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":ui(s,"section-height"),"--section-padding-x":ui(s,"section-padding-x"),"--section-fz":s?.includes("compact")?Ds(s.replace("compact-","")):Ds(s),"--section-radius":e===void 0?void 0:la(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:Pv,className:i,style:r,classNames:a,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:Hde,rootSelector:"groupSection"});return k.jsx(ct,{...b("groupSection"),ref:e,variant:c,...g})});sP.classes=Pv;sP.displayName="@mantine/core/ButtonGroupSection";const Vde={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${Et(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},Gde=(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":ui(a,"button-height"),"--button-padding-x":ui(a,"button-padding-x"),"--button-fz":a?.includes("compact")?Ds(a.replace("compact-","")):Ds(a),"--button-radius":e===void 0?void 0:la(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=Dl((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:m,styles:x,unstyled:_,"data-disabled":w,autoContrast:M,mod:S,attributes:A,...C}=n,D=Tn({name:"Button",props:n,classes:Pv,className:a,style:i,classNames:m,styles:x,unstyled:_,attributes:A,vars:r,varsResolver:Gde}),R=!!c,L=!!u;return k.jsxs(cf,{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":L},S],...C,children:[typeof g=="boolean"&&k.jsx(Tc,{mounted:g,transition:Vde,duration:150,children:U=>k.jsx(ct,{component:"span",...D("loader",{style:U}),"aria-hidden":!0,children:k.jsx(Yd,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...b})})}),k.jsxs("span",{...D("inner"),children:[c&&k.jsx(ct,{component:"span",...D("section"),mod:{position:"left"},children:c}),k.jsx(ct,{component:"span",mod:{loading:g},...D("label"),children:l}),u&&k.jsx(ct,{component:"span",...D("section"),mod:{position:"right"},children:u})]})]})});As.classes=Pv;As.displayName="@mantine/core/Button";As.Group=aP;As.GroupSection=sP;var sY={root:"m_b183c0a2"};const Wde=(t,{color:e})=>({root:{"--code-bg":e?sa(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:sY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:Wde});return k.jsx(ct,{component:u?"pre":"code",variant:f,ref:e,mod:[{block:u},h],...b("root"),...g,dir:"ltr"})});oP.classes=sY;oP.displayName="@mantine/core/Code";var oY={root:"m_de3d2490",colorOverlay:"m_862f3d1b",shadowOverlay:"m_98ae7f22",alphaOverlay:"m_95709ac0",childrenOverlay:"m_93e74e3"};const sz={withShadow:!0},qde=(t,{radius:e,size:n})=>({root:{"--cs-radius":e===void 0?void 0:la(e),"--cs-size":Et(n)}}),D_=Dl((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),m=Tn({name:"ColorSwatch",props:n,classes:oY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:l,varsResolver:qde});return k.jsxs(ct,{ref:e,variant:g,size:u,...m("root",{focusable:!0}),...y,children:[k.jsx("span",{...m("alphaOverlay")}),h&&k.jsx("span",{...m("shadowOverlay")}),k.jsx("span",{...m("colorOverlay",{style:{backgroundColor:c}})}),k.jsx("span",{...m("childrenOverlay"),children:d})]})});D_.classes=oY;D_.displayName="@mantine/core/ColorSwatch";const[Xde,lP]=M_(null),cP=I.forwardRef(({position:t,...e},n)=>k.jsx(ct,{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:m="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=_a(),[L,U]=I.useState({y:0,x:b/f}),j=I.useRef(L),z=W=>h?Math.round(W*f):W*f,{ref:q}=fL(({x:W,y:B})=>{j.current={x:W,y:B},c?.(z(W))},{onScrubEnd:()=>{const{x:W}=j.current;u?.(z(W)),_?.()},onScrubStart:x});_c(()=>{U({y:0,x:b/f})},[b]);const F=(W,B)=>{W.preventDefault();const J=rX(B);c?.(z(J.x)),u?.(z(J.x))},V=W=>{switch(W.key){case"ArrowRight":{F(W,{x:L.x+.05,y:L.y});break}case"ArrowLeft":{F(W,{x:L.x-.05,y:L.y});break}}},H=y.map((W,B)=>I.createElement("div",{...D("sliderOverlay"),style:W,key:B}));return k.jsxs(ct,{...S,ref:Ps(q,e),...D("slider"),role:"slider","aria-valuenow":b,"aria-valuemax":f,"aria-valuemin":0,tabIndex:g?0:-1,onKeyDown:V,"data-focus-ring":R.focusRing,__vars:{"--cp-thumb-size":`var(--cp-thumb-size-${d})`},children:[H,k.jsx(cP,{position:L,...D("thumb",{style:{top:Et(1),background:m}})})]})});fP.displayName="@mantine/core/ColorSlider";function bc(t,e=0,n=10**e){return Math.round(n*t)/n}function Kde({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 Yde={grad:360/400,turn:360,rad:360/(Math.PI*2)};function Jde(t,e="deg"){return Number(t)*(Yde[e]||1)}const $de=/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=$de.exec(t);return e?Kde({h:Jde(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:bc(60*(s<0?s+6:s),3),s:bc(r?a/r*100:0,3),v:bc(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 Zde(t){const e=t[0]==="#"?t.slice(1):t,n=s=>bc(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 Qde=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function lz(t){const e=Qde.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 lY={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},epe={hex:BO,hexa:Zde,rgb:lz,rgba:lz,hsl:oz,hsla:oz};function Ex(t){for(const[,e]of Object.entries(lY))if(e.test(t))return!0;return!1}function om(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(lY))if(i.test(e))return epe[n](e);return{h:0,s:0,v:0,a:1}}const cY=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?.(bc(o,2)),onChangeEnd:o=>r?.(bc(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`}]})});cY.displayName="@mantine/core/AlphaSlider";function uY({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:bc([s,c,l,l,u,s][f]*255),g:bc([u,s,s,c,l,l][f]*255),b:bc([l,l,u,s,s,c][f]*255),a:bc(i,2)}}function cz(t,e){const{r:n,g:i,b:r,a}=uY(t);return e?`rgba(${n}, ${i}, ${r}, ${bc(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}%, ${bc(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 fY(t){const{r:e,g:n,b:i}=uY(t);return`#${cM(e)}${cM(n)}${cM(i)}`}function tpe(t){const e=Math.round(t.a*255);return`${fY(t)}${cM(e)}`}const Y3={hex:fY,hexa:t=>tpe(t),rgb:t=>cz(t,!1),rgba:t=>cz(t,!0),hsl:t=>uz(t,!1),hsla:t=>uz(t,!0)};function eu(t,e){return e?t in Y3?Y3[t](e):Y3.hex(e):"#000000"}const hY=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`}]})});hY.displayName="@mantine/core/HueSlider";function dY({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=rX(_);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)})},m=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(ct,{...f("saturation"),ref:b,...u,role:"slider","aria-label":r,"aria-valuenow":h.x,"aria-valuetext":eu("rgba",i),tabIndex:a?0:-1,onKeyDown:m,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}})})]})}dY.displayName="@mantine/core/Saturation";const pY=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(D_,{...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:wX(d)<.5?"white":"black"})));return k.jsx(ct,{...f.getStyles("swatches"),ref:u,...c,children:h})});pY.displayName="@mantine/core/Swatches";const npe={swatchesPerRow:7,withPicker:!0,focusable:!0,size:"md",__staticSelector:"ColorPicker"},ipe=(t,{size:e,swatchesPerRow:n})=>({wrapper:{"--cp-preview-size":ui(e,"cp-preview-size"),"--cp-width":ui(e,"cp-width"),"--cp-body-spacing":zd(e),"--cp-swatch-size":`${100/n}%`,"--cp-thumb-size":ui(e,"cp-thumb-size"),"--cp-saturation-height":ui(e,"cp-saturation-height")}}),hP=tn((t,e)=>{const n=Pt("ColorPicker",npe,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:m,alphaLabel:x,focusable:_,swatches:w,swatchesPerRow:M,fullWidth:S,onColorSwatchClick:A,__staticSelector:C,mod:D,attributes:R,...L}=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:ipe}),j=I.useRef(c||"hex"),z=I.useRef(""),q=I.useRef(-1),F=I.useRef(!1),V=c==="hexa"||c==="rgba"||c==="hsla",[H,W,B]=Cl({value:u,defaultValue:f,finalValue:"#FFFFFF",onChange:h}),[J,Z]=I.useState(om(H)),G=()=>{window.clearTimeout(q.current),F.current=!0},de=()=>{window.clearTimeout(q.current),q.current=window.setTimeout(()=>{F.current=!1},200)},oe=le=>{Z(ue=>{const Se={...ue,...le};return z.current=eu(j.current,Se),Se}),W(z.current)};return _c(()=>{typeof u=="string"&&Ex(u)&&!F.current&&Z(om(u))},[u]),_c(()=>{j.current=c||"hex",W(eu(j.current,J))},[c]),k.jsx(Xde,{value:{getStyles:U,unstyled:o},children:k.jsxs(ct,{ref:e,...U("wrapper"),size:b,mod:[{"full-width":S},D],...L,children:[g&&k.jsxs(k.Fragment,{children:[k.jsx(dY,{value:J,onChange:oe,onChangeEnd:({s:le,v:ue})=>d?.(eu(j.current,{...J,s:le,v:ue})),color:H,size:b,focusable:_,saturationLabel:y,onScrubStart:G,onScrubEnd:de}),k.jsxs("div",{...U("body"),children:[k.jsxs("div",{...U("sliders"),children:[k.jsx(hY,{value:J.h,onChange:le=>oe({h:le}),onChangeEnd:le=>d?.(eu(j.current,{...J,h:le})),size:b,focusable:_,"aria-label":m,onScrubStart:G,onScrubEnd:de}),V&&k.jsx(cY,{value:J.a,onChange:le=>oe({a:le}),onChangeEnd:le=>{d?.(eu(j.current,{...J,a:le}))},size:b,color:eu("hex",J),focusable:_,"aria-label":x,onScrubStart:G,onScrubEnd:de})]}),V&&k.jsx(D_,{color:H,radius:"sm",size:"var(--cp-preview-size)",...U("preview")})]})]}),Array.isArray(w)&&k.jsx(pY,{data:w,swatchesPerRow:M,focusable:_,setValue:W,value:H,onChangeEnd:le=>{const ue=eu(c,om(le));A?.(ue),d?.(ue),B||Z(om(le))}})]})})});hP.classes=uP;hP.displayName="@mantine/core/ColorPicker";function rpe({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},ape=(t,{size:e})=>({eyeDropperIcon:{"--ci-eye-dropper-icon-size":ui(e,"ci-eye-dropper-icon-size")},colorPreview:{"--ci-preview-size":ui(e,"ci-preview-size")}}),Uv=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:m,onClick:x,onFocus:_,onBlur:w,inputProps:M,format:S="hex",wrapperProps:A,readOnly:C,withPicker:D,swatches:R,disabled:L,leftSection:U,rightSection:j,swatchesPerRow:z,...q}=NK("ColorInput",hz,t),F=Tn({name:"ColorInput",props:n,classes:fz,classNames:i,styles:r,unstyled:a,rootSelector:"wrapper",vars:n.vars,varsResolver:ape}),{resolvedClassNames:V,resolvedStyles:H}=Dv({classNames:i,styles:r,props:n}),[W,B]=I.useState(!1),[J,Z]=I.useState(""),[G,de]=Cl({value:g,defaultValue:b,finalValue:"",onChange:y}),{supported:oe,open:le}=joe(),ue=k.jsx(Ol,{...d,...F("eyeDropperButton",{className:d?.className,style:d?.style}),variant:"subtle",color:"gray",size:M.size,unstyled:a,onClick:()=>le().then(je=>{if(je?.sRGBHex){const He=eu(S,om(je.sRGBHex));de(He),m?.(He)}}).catch(()=>{}),children:f||k.jsx(rpe,{...F("eyeDropperIcon")})}),Se=je=>{_?.(je),B(!0)},Oe=je=>{o&&de(J),w?.(je),B(!1)},Be=je=>{x?.(je),B(!0)};return I.useEffect(()=>{(Ex(G)||G.trim()==="")&&Z(G)},[G]),_c(()=>{Ex(G)&&de(eu(S,om(G)))},[S]),k.jsx(ga.Wrapper,{...A,classNames:V,styles:H,__staticSelector:"ColorInput",children:k.jsxs(Vo,{__staticSelector:"ColorInput",position:"bottom-start",offset:5,opened:W,...l,classNames:V,styles:H,unstyled:a,withRoles:!1,disabled:C||D===!1&&(!Array.isArray(R)||R.length===0),children:[k.jsx(Vo.Target,{children:k.jsx(ga,{autoComplete:"off",...q,...M,classNames:V,styles:H,disabled:L,ref:e,__staticSelector:"ColorInput",onFocus:Se,onBlur:Oe,onClick:Be,spellCheck:!1,value:G,onChange:je=>{const He=je.currentTarget.value;de(He),Ex(He)&&m?.(eu(S,om(He)))},leftSection:U||(c?k.jsx(D_,{color:Ex(G)?G:"#fff",size:"var(--ci-preview-size)",...F("colorPreview")}):null),readOnly:s||C,pointer:s,unstyled:a,rightSection:j||(u&&!L&&!C&&oe?ue:null)})}),k.jsx(Vo.Dropdown,{onMouseDown:je=>je.preventDefault(),className:fz.dropdown,children:k.jsx(hP,{__staticSelector:"ColorInput",value:G,onChange:de,onChangeEnd:m,format:S,swatches:R,swatchesPerRow:z,withPicker:D,size:M.size,focusable:!1,unstyled:a,styles:H,classNames:V,onColorSwatchClick:()=>h&&B(!1),attributes:A.attributes})})]})})});Uv.classes=Mu.classes;Uv.displayName="@mantine/core/ColorInput";var mY={root:"m_7485cace"};const spe=(t,{size:e,fluid:n})=>({root:{"--container-size":n?void 0:ui(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:mY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:f,vars:l,varsResolver:spe});return k.jsx(ct,{ref:e,mod:[{fluid:c,strategy:h||"block"},u],...g("root"),...d})});dP.classes=mY;dP.displayName="@mantine/core/Container";const ope={timeout:1e3};function gY(t){const{children:e,timeout:n,value:i,...r}=Pt("CopyButton",ope,t),a=woe({timeout:n}),s=()=>a.copy(i);return k.jsx(k.Fragment,{children:e({copy:s,copied:a.copied,...r})})}gY.displayName="@mantine/core/CopyButton";var bY={root:"m_3eebeb36",label:"m_9e365f20"};const lpe={orientation:"horizontal"},cpe=(t,{color:e,variant:n,size:i})=>({root:{"--divider-color":e?sa(e,t):void 0,"--divider-border-style":n,"--divider-size":ui(i,"divider-size")}}),lg=tn((t,e)=>{const n=Pt("Divider",lpe,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:bY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:cpe});return k.jsx(ct,{ref:e,mod:[{orientation:u,"with-label":!!f},d],...y("root"),...b,role:"separator",children:f&&k.jsx(ct,{component:"span",mod:{position:h},...y("label"),children:f})})});lg.classes=bY;lg.displayName="@mantine/core/Divider";var vY={root:"m_9e117634"};const upe=(t,{radius:e,fit:n})=>({root:{"--image-radius":e===void 0?void 0:la(e),"--image-object-fit":n}}),O_=Dl((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,[m,x]=I.useState(!u);I.useEffect(()=>x(!u),[u]);const _=Tn({name:"Image",classes:vY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:l,varsResolver:upe});return m&&d?k.jsx(ct,{component:"img",ref:e,src:d,..._("root"),onError:c,mod:["fallback",g],...y}):k.jsx(ct,{component:"img",ref:e,..._("root"),src:u,onError:w=>{c?.(w),x(!0)},mod:g,...y})});O_.classes=vY;O_.displayName="@mantine/core/Image";var fpe=I.useLayoutEffect,hpe=function(e){var n=Ce.useRef(e);return fpe(function(){n.current=e}),n},dz=function(e,n){if(typeof e=="function"){e(n);return}e.current=n},dpe=function(e,n){var i=Ce.useRef();return Ce.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"},ppe=function(e){Object.keys(pz).forEach(function(n){e.style.setProperty(n,pz[n],"important")})},mz=ppe,mo=null,gz=function(e,n){var i=e.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?i+n.borderSize:i-n.paddingSize};function mpe(t,e,n,i){n===void 0&&(n=1),i===void 0&&(i=1/0),mo||(mo=document.createElement("textarea"),mo.setAttribute("tabindex","-1"),mo.setAttribute("aria-hidden","true"),mz(mo)),mo.parentNode===null&&document.body.appendChild(mo);var r=t.paddingSize,a=t.borderSize,s=t.sizingStyle,o=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;mo.style[d]=s[d]}),mz(mo),mo.value=e;var l=gz(mo,t);mo.value=e,l=gz(mo,t),mo.value="x";var c=mo.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(){},gpe=function(e,n){return e.reduce(function(i,r){return i[r]=n[r],i},{})},bpe=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],vpe=!!document.documentElement.currentStyle,ype=function(e){var n=window.getComputedStyle(e);if(n===null)return null;var i=gpe(bpe,n),r=i.boxSizing;if(r==="")return null;vpe&&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}},xpe=ype;function pP(t,e,n){var i=hpe(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 _pe=function(e,n){pP(document.body,"reset",function(i){e.current.form===i.target&&n(i)})},Spe=function(e){pP(window,"resize",e)},wpe=function(e){pP(document.fonts,"loadingdone",e)},Epe=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Mpe=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,Epe),f=u.value!==void 0,h=I.useRef(null),d=dpe(h,n),g=I.useRef(0),b=I.useRef(),y=function(){var _=h.current,w=i&&b.current?b.current:xpe(_);if(w){b.current=w;var M=mpe(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}))}},m=function(_){f||y(),o(_)};return I.useLayoutEffect(y),_pe(h,function(){if(!f){var x=h.current.value;requestAnimationFrame(function(){var _=h.current;_&&x!==_.value&&y()})}}),Spe(y),wpe(y),I.createElement("textarea",Is({},u,{onChange:m,ref:d}))},Tpe=I.forwardRef(Mpe);const Ape={size:"sm"},yA=tn((t,e)=>{const{autosize:n,maxRows:i,minRows:r,__staticSelector:a,resize:s,...o}=Pt("Textarea",Ape,t),l=n&&tce()!=="test",c=l?{maxRows:i,minRows:r}:{};return k.jsx(Mu,{component:l?Tpe:"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=Mu.classes;yA.displayName="@mantine/core/Textarea";const[Cpe,Rpe]=Eu("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=Rpe(),d=l||h.icon,g={classNames:i,styles:s};return k.jsx(ct,{...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 kpe={type:"unordered"},Dpe=(t,{size:e,spacing:n})=>({root:{"--list-fz":Ds(e),"--list-lh":_X(e),"--list-spacing":zd(n)}}),Y0=tn((t,e)=>{const n=Pt("List",kpe,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:m,...x}=n,_=Tn({name:"List",classes:mP,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:m,vars:l,varsResolver:Dpe});return k.jsx(Cpe,{value:{center:g,icon:h,getStyles:_},children:k.jsx(ct,{..._("root",{style:{listStyleType:b}}),component:u==="unordered"?"ul":"ol",mod:[{"with-padding":f},y],ref:e,...x,children:c})})});Y0.classes=mP;Y0.displayName="@mantine/core/List";Y0.Item=gP;const[Ope,Fv]=Eu("Modal component was not found in tree");var Eh={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=Fv();return k.jsx(AK,{ref:e,...c.getStyles("body",{classNames:i,style:a,styles:s,className:r}),...l})});xA.classes=Eh;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=Fv();return k.jsx(CK,{ref:e,...c.getStyles("close",{classNames:i,style:a,styles:s,className:r}),...l})});_A.classes=Eh;_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=Fv(),h=f.scrollAreaComponent||qhe;return k.jsx(RK,{...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=Eh;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=Fv();return k.jsx(kK,{ref:e,...c.getStyles("header",{classNames:i,style:a,styles:s,className:r}),...l})});wA.classes=Eh;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=Fv();return k.jsx(DK,{ref:e,...c.getStyles("overlay",{classNames:i,style:a,styles:s,className:r}),...l})});EA.classes=Eh;EA.displayName="@mantine/core/ModalOverlay";const Ipe={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:gf("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},Npe=(t,{radius:e,size:n,yOffset:i,xOffset:r})=>({root:{"--modal-radius":e===void 0?void 0:la(e),"--modal-size":ui(n,"modal-size"),"--modal-y-offset":Et(i),"--modal-x-offset":Et(r)}}),MA=tn((t,e)=>{const n=Pt("ModalRoot",Ipe,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,...m}=n,x=Tn({name:b,classes:Eh,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:y,vars:l,varsResolver:Npe});return k.jsx(Ope,{value:{yOffset:c,scrollAreaComponent:u,getStyles:x,fullScreen:h},children:k.jsx(TK,{ref:e,...x("root"),"data-full-screen":h||void 0,"data-centered":d||void 0,"data-offset-scrollbars":u===Dc.Autosize||void 0,unstyled:o,...m})})});MA.classes=Eh;MA.displayName="@mantine/core/ModalRoot";const[Lpe,Ppe]=M_();function yY({children:t}){const[e,n]=I.useState([]),[i,r]=I.useState(gf("modal"));return k.jsx(Lpe,{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})}yY.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=Fv();return k.jsx(OK,{ref:e,...c.getStyles("title",{classNames:i,style:a,styles:s,className:r}),...l})});TA.classes=Eh;TA.displayName="@mantine/core/ModalTitle";const Upe={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:gf("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Ro=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",Upe,t),d=Ppe(),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||gf("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})]})]})});Ro.classes=Eh;Ro.displayName="@mantine/core/Modal";Ro.Root=MA;Ro.Overlay=EA;Ro.Content=SA;Ro.Body=xA;Ro.Header=wA;Ro.Title=TA;Ro.CloseButton=_A;Ro.Stack=yY;var xY={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const Fpe={withCloseButton:!0},Bpe=(t,{radius:e,color:n})=>({root:{"--notification-radius":e===void 0?void 0:la(e),"--notification-color":n?sa(n,t):void 0}}),bP=tn((t,e)=>{const n=Pt("Notification",Fpe,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:m,variant:x,vars:_,mod:w,loaderProps:M,role:S,attributes:A,...C}=n,D=Tn({name:"Notification",classes:xY,props:n,className:i,style:b,classNames:g,styles:y,unstyled:m,attributes:A,vars:_,varsResolver:Bpe});return k.jsxs(ct,{...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(Yd,{size:28,color:r,...M,...D("loader")}),k.jsxs("div",{...D("body"),children:[c&&k.jsx("div",{...D("title"),children:c}),k.jsx(ct,{...D("description"),mod:{"data-with-title":!!c},children:f})]}),o&&k.jsx(R_,{iconSize:16,color:"gray",...d,unstyled:m,onClick:h,...D("closeButton")})]})});bP.classes=xY;bP.displayName="@mantine/core/Notification";function _Y(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 U1;(function(t){t.event="event",t.props="prop"})(U1||(U1={}));function bd(){}function zpe(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 F1(t){return!!(t||"").match(/\d/)}function y0(t){return t==null}function jpe(t){return typeof t=="number"&&isNaN(t)}function SY(t){return y0(t)||jpe(t)||typeof t=="number"&&!isFinite(t)}function wY(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Hpe(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 Vpe(t,e,n){var i=Hpe(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 Gpe(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 Wpe(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 EY(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 MY(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,m){return b.length>m?(Number(b[0])+Number(y)).toString()+b.substring(1,b.length):y+b},u[0]));var h=EY(u[1]||"",e,n),d=o?"-":"",g=i?".":"";return""+d+f+g+h}function tm(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 TY=zpe(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}}}),qpe=function(t,e){var n=Math.min(t.selectionStart,e);return{from:{start:n,end:t.selectionEnd},to:{start:n,end:e}}};function Xpe(t,e,n){return Math.min(Math.max(t,e),n)}function J3(t){return Math.max(t.selectionStart,t.selectionEnd)}function Kpe(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ype(t){return{from:{start:0,end:0},to:{start:0,end:t.length},lastValue:""}}function Jpe(t){var e=t.currentValue,n=t.formattedValue,i=t.currentValueIndex,r=t.formattedValueIndex;return e[i]===n[r]}function $pe(t,e,n,i,r,a,s){s===void 0&&(s=Jpe);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 m=i;m<c&&(h[m]===-1||!a(n[m]));)m++;var x=m===c||h[m]===-1?u:h[m];for(m=i-1;m>0&&h[m]===-1;)m--;var _=m===-1||h[m]===-1?0:h[m]+1;return _>x?x:i-_<x-i?_:x}function xz(t,e,n,i){var r=t.length;if(e=Xpe(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 Zpe(t){for(var e=Array.from({length:t.length+1}).map(function(){return!0}),n=0,i=e.length;n<i;n++)e[n]=!!(F1(t[n])||F1(t[n-1]));return e}function AY(t,e,n,i,r,a){a===void 0&&(a=bd);var s=Gpe(function(g,b){var y,m;return SY(g)?(m="",y=""):typeof g=="number"||b?(m=typeof g=="number"?MY(g):g,y=i(m)):(m=r(g,void 0),y=i(m)),{formattedValue:y,numAsString:m}}),o=I.useState(function(){return s(y0(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;y0(t)&&(f=l.numAsString,h=!0);var d=s(f,h);return I.useMemo(function(){c(d)},[d.formattedValue]),[l,u]}function Qpe(t){return t.replace(/[^0-9]/g,"")}function eme(t){return t}function tme(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=eme);var o=t.removeFormatting;o===void 0&&(o=Qpe);var l=t.defaultValue,c=t.valueIsNumericString,u=t.onValueChange,f=t.isAllowed,h=t.onChange;h===void 0&&(h=bd);var d=t.onKeyDown;d===void 0&&(d=bd);var g=t.onMouseUp;g===void 0&&(g=bd);var b=t.onFocus;b===void 0&&(b=bd);var y=t.onBlur;y===void 0&&(y=bd);var m=t.value,x=t.getCaretBoundary;x===void 0&&(x=Zpe);var _=t.isValidInputCharacter;_===void 0&&(_=F1);var w=t.isCharacterSame,M=_Y(t,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),S=AY(m,l,!!c,s,o,u),A=S[0],C=A.formattedValue,D=A.numAsString,R=S[1],L=I.useRef(),U=I.useRef({formattedValue:C,numAsString:D}),j=function(we,Me){U.current={formattedValue:we.formattedValue,numAsString:we.value},R(we,Me)},z=I.useState(!1),q=z[0],F=z[1],V=I.useRef(null),H=I.useRef({setCaretTimeout:null,focusTimeout:null});I.useEffect(function(){return F(!0),function(){clearTimeout(H.current.setCaretTimeout),clearTimeout(H.current.focusTimeout)}},[]);var W=s,B=function(we,Me){var Ae=parseFloat(Me);return{formattedValue:we,value:Me,floatValue:isNaN(Ae)?void 0:Ae}},J=function(we,Me,Ae){we.selectionStart===0&&we.selectionEnd===we.value.length||(tm(we,Me),H.current.setCaretTimeout=setTimeout(function(){we.value===Ae&&we.selectionStart!==Me&&tm(we,Me)},0))},Z=function(we,Me,Ae){return xz(we,Me,x(we),Ae)},G=function(we,Me,Ae){var Ne=x(Me),Ue=$pe(Me,C,we,Ae,Ne,_,w);return Ue=xz(Me,Ue,Ne),Ue},de=function(we){var Me=we.formattedValue;Me===void 0&&(Me="");var Ae=we.input,Ne=we.source,Ue=we.event,Qe=we.numAsString,ae;if(Ae){var K=we.inputValue||Ae.value,ce=J3(Ae);Ae.value=Me,ae=G(K,Me,ce),ae!==void 0&&J(Ae,ae,Me)}Me!==C&&j(B(Me,Qe),{event:Ue,source:Ne})};I.useEffect(function(){var we=U.current,Me=we.formattedValue,Ae=we.numAsString;(C!==Me||D!==Ae)&&j(B(C,D),{event:void 0,source:U1.props})},[C,D]);var oe=V.current?J3(V.current):void 0,le=typeof window<"u"?I.useLayoutEffect:I.useEffect;le(function(){var we=V.current;if(C!==U.current.formattedValue&&we){var Me=G(U.current.formattedValue,C,oe);we.value=C,J(we,Me,C)}},[C]);var ue=function(we,Me,Ae){var Ne=Me.target,Ue=L.current?qpe(L.current,Ne.selectionEnd):TY(C,we),Qe=Object.assign(Object.assign({},Ue),{lastValue:C}),ae=o(we,Qe),K=W(ae);if(ae=o(K,void 0),f&&!f(B(K,ae))){var ce=Me.target,he=J3(ce),me=G(we,C,he);return ce.value=C,J(ce,me,C),!1}return de({formattedValue:K,numAsString:ae,inputValue:we,event:Me,source:Ae,input:Me.target}),!0},Se=function(we,Me){Me===void 0&&(Me=0);var Ae=we.selectionStart,Ne=we.selectionEnd;L.current={selectionStart:Ae,selectionEnd:Ne+Me}},Oe=function(we){var Me=we.target,Ae=Me.value,Ne=ue(Ae,we,U1.event);Ne&&h(we),L.current=void 0},Be=function(we){var Me=we.target,Ae=we.key,Ne=Me.selectionStart,Ue=Me.selectionEnd,Qe=Me.value;Qe===void 0&&(Qe="");var ae;Ae==="ArrowLeft"||Ae==="Backspace"?ae=Math.max(Ne-1,0):Ae==="ArrowRight"?ae=Math.min(Ne+1,Qe.length):Ae==="Delete"&&(ae=Ne);var K=0;Ae==="Delete"&&Ne===Ue&&(K=1);var ce=Ae==="ArrowLeft"||Ae==="ArrowRight";if(ae===void 0||Ne!==Ue&&!ce){d(we),Se(Me,K);return}var he=ae;if(ce){var me=Ae==="ArrowLeft"?"left":"right";he=Z(Qe,ae,me),he!==ae&&we.preventDefault()}else Ae==="Delete"&&!_(Qe[ae])?he=Z(Qe,ae,"right"):Ae==="Backspace"&&!_(Qe[ae])&&(he=Z(Qe,ae,"left"));he!==ae&&J(Me,he,Qe),d(we),Se(Me,K)},je=function(we){var Me=we.target,Ae=function(){var Ne=Me.selectionStart,Ue=Me.selectionEnd,Qe=Me.value;if(Qe===void 0&&(Qe=""),Ne===Ue){var ae=Z(Qe,Ne);ae!==Ne&&J(Me,ae,Qe)}};Ae(),requestAnimationFrame(function(){Ae()}),g(we),Se(Me)},He=function(we){we.persist&&we.persist();var Me=we.target,Ae=we.currentTarget;V.current=Me,H.current.focusTimeout=setTimeout(function(){var Ne=Me.selectionStart,Ue=Me.selectionEnd,Qe=Me.value;Qe===void 0&&(Qe="");var ae=Z(Qe,Ne);ae!==Ne&&!(Ne===0&&Ue===Qe.length)&&J(Me,ae,Qe),b(Object.assign(Object.assign({},we),{currentTarget:Ae}))},0)},pe=function(we){V.current=null,clearTimeout(H.current.focusTimeout),clearTimeout(H.current.setCaretTimeout),y(we)},ze=q&&Kpe()?"numeric":void 0,Ie=Object.assign({inputMode:ze},M,{type:e,value:C,onChange:Oe,onKeyDown:Be,onMouseUp:je,onFocus:He,onBlur:pe});if(n==="text")return r?Ce.createElement(Ce.Fragment,null,r(C,M)||null):Ce.createElement("span",Object.assign({},M,{ref:a}),C);if(i){var qe=i;return Ce.createElement(qe,Object.assign({},Ie,{ref:a}))}return Ce.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=EY(g,n,!!i)),c&&(d=Vpe(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 nme(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 ime(t,e){return new RegExp("(^-)|[0-9]|"+wY(t),"g")}function rme(t,e,n){return t===""?!0:!e?.match(/\d/)&&!n?.match(/\d/)&&typeof t=="string"&&!isNaN(Number(t))}function ame(t,e,n){var i;e===void 0&&(e=Ype(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(F1(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 m=function(V,H,W){var B=!1,J=!1;a.startsWith("-")?B=!1:V.startsWith("--")?(B=!1,J=!0):s.startsWith("-")&&V.length===s.length?B=!1:V[0]==="-"&&(B=!0);var Z=B?1:0;return J&&(Z=2),Z&&(V=V.substring(Z),H-=Z,W-=Z),{value:V,start:H,end:W,hasNegation:B}},x=m(t,u,f),_=x.hasNegation;i=x,t=i.value,u=i.start,f=i.end;var w=m(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,L=t.length-s.length;t.endsWith(s)?R=L:(f>L||f>t.length-s.length)&&(R=f),t=t.substring(0,R),t=nme(_?"-"+t:t,r),t=(t.match(ime(g))||[]).join("");var U=t.indexOf(g);t=t.replace(new RegExp(wY(g),"g"),function(V,H){return H===U?".":""});var j=vP(t,r),z=j.beforeDecimal,q=j.afterDecimal,F=j.addNegation;return c.end-c.start<l.end-l.start&&z===""&&b&&!parseFloat(q)&&(t=F?"-":""),t}function sme(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 ome(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 lme(t){t=ome(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var e=t.suffix,n=t.allowNegative,i=t.allowLeadingZeros,r=t.onKeyDown;r===void 0&&(r=bd);var a=t.onBlur;a===void 0&&(a=bd);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=_Y(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),b=AA(t),y=b.decimalSeparator,m=b.allowedDecimalSeparators,x=function(F){return _z(F,t)},_=function(F,V){return ame(F,V,t)},w=y0(f)?u:f,M=h??rme(w,c,e);y0(f)?y0(u)||(M=M||typeof u=="number"):M=M||typeof f=="number";var S=function(F){return SY(F)?F:(typeof F=="number"&&(F=MY(F)),M&&typeof o=="number"?yz(F,o,!!l):F)},A=AY(S(f),S(u),!!M,x,_,d),C=A[0],D=C.numAsString,R=C.formattedValue,L=A[1],U=function(F){var V=F.target,H=F.key,W=V.selectionStart,B=V.selectionEnd,J=V.value;if(J===void 0&&(J=""),(H==="Backspace"||H==="Delete")&&B<c.length){F.preventDefault();return}if(W!==B){r(F);return}H==="Backspace"&&J[0]==="-"&&W===c.length+1&&n&&tm(V,1),o&&l&&(H==="Backspace"&&J[W-1]===y?(tm(V,W-1),F.preventDefault()):H==="Delete"&&J[W]===y&&F.preventDefault()),m?.includes(H)&&J[W]===y&&tm(V,W+1);var Z=s===!0?",":s;H==="Backspace"&&J[W-1]===Z&&tm(V,W-1),H==="Delete"&&J[W]===Z&&tm(V,W+1),r(F)},j=function(F){var V=D;if(V.match(/\d/g)||(V=""),i||(V=Wpe(V)),l&&o&&(V=yz(V,o,l)),V!==D){var H=_z(V,t);L({formattedValue:H,value:V,floatValue:parseFloat(V)},{event:F,source:U1.event})}a(F)},z=function(F){return F===y?!0:F1(F)},q=function(F){var V=F.currentValue,H=F.lastValue,W=F.formattedValue,B=F.currentValueIndex,J=F.formattedValueIndex,Z=V[B],G=W[J],de=TY(H,V),oe=de.to,le=function(ue){return _(ue).indexOf(".")+c.length};return f===0&&l&&o&&V[oe.start]===y&&le(V)<B&&le(W)>J?!1:B>=oe.start&&B<oe.end&&m&&m.includes(Z)&&G===y?!0:Z===G};return Object.assign(Object.assign({},g),{value:R,valueIsNumericString:!1,isValidInputCharacter:z,isCharacterSame:q,onValueChange:L,format:x,removeFormatting:_,getCaretBoundary:function(F){return sme(F,t)},onKeyDown:U,onBlur:j})}function cme(t){var e=lme(t);return Ce.createElement(tme,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 ume=/^(0\.0*|-0(\.0*)?)$/,fme=/^-?0\d+(\.\d+)?\.?$/,hme=/\.\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 dme(t){return t.toString().replace(".","").length}function pme(t,e){return(typeof t=="number"?t<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(t)))&&!Number.isNaN(t)&&dme(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 mme={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},gme=(t,{size:e})=>({controls:{"--ni-chevron-size":ui(e,"ni-chevron-size")}});function bme(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:gc(r,n,e)}const cg=tn((t,e)=>{const n=Pt("NumberInput",mme,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:m,clampBehavior:x,onBlur:_,allowDecimal:w,decimalScale:M,onKeyDown:S,onKeyDownCapture:A,handlersRef:C,startValue:D,disabled:R,rightSectionPointerEvents:L,allowNegative:U,readOnly:j,size:z,rightSectionWidth:q,stepHoldInterval:F,stepHoldDelay:V,allowLeadingZeros:H,withKeyboardEvents:W,trimLeadingZeroesOnBlur:B,attributes:J,...Z}=n,G=Tn({name:"NumberInput",classes:zO,props:n,classNames:r,styles:a,unstyled:s,attributes:J,vars:o,varsResolver:gme}),{resolvedClassNames:de,resolvedStyles:oe}=Dv({classNames:r,styles:a,props:n}),[le,ue]=Cl({value:u,defaultValue:f,finalValue:"",onChange:l}),Se=V!==void 0&&F!==void 0,Oe=I.useRef(null),Be=I.useRef(null),je=I.useRef(0),He=(ce,he)=>{he.source==="event"&&ue(pme(ce.floatValue,ce.value)&&!ume.test(ce.value)&&!(H&&fme.test(ce.value))&&!hme.test(ce.value)?ce.floatValue:ce.value),c?.(ce,he)},pe=ce=>{const he=String(ce).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return he?Math.max(0,(he[1]?he[1].length:0)-(he[2]?+he[2]:0)):0},ze=ce=>{Oe.current&&typeof ce<"u"&&Oe.current.setSelectionRange(ce,ce)},Ie=I.useRef(s2);Ie.current=()=>{if(!$3(le))return;let ce;const he=pe(le),me=pe(g),$=Math.max(he,me),Ve=10**$;if(!jO(le)&&(typeof le!="number"||Number.isNaN(le)))ce=gc(D,d,h);else if(h!==void 0){const mt=(Math.round(Number(le)*Ve)+Math.round(g*Ve))/Ve;ce=mt<=h?mt:h}else ce=(Math.round(Number(le)*Ve)+Math.round(g*Ve))/Ve;const Xe=ce.toFixed($);ue(parseFloat(Xe)),c?.({floatValue:parseFloat(Xe),formattedValue:Xe,value:Xe},{source:"increment"}),setTimeout(()=>ze(Oe.current?.value.length),0)};const qe=I.useRef(s2);qe.current=()=>{if(!$3(le))return;let ce;const he=d!==void 0?d:U?Number.MIN_SAFE_INTEGER:0,me=pe(le),$=pe(g),Ve=Math.max(me,$),Xe=10**Ve;if(!jO(le)&&typeof le!="number"||Number.isNaN(le))ce=gc(D,he,h);else{const Ge=(Math.round(Number(le)*Xe)-Math.round(g*Xe))/Xe;ce=he!==void 0&&Ge<he?he:Ge}const mt=ce.toFixed(Ve);ue(parseFloat(mt)),c?.({floatValue:parseFloat(mt),formattedValue:mt,value:mt},{source:"decrement"}),setTimeout(()=>ze(Oe.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?.()))},Me=ce=>{if(A?.(ce),ce.key==="Backspace"){const he=Oe.current;he&&he.selectionStart===0&&he.selectionStart===he.selectionEnd&&(ce.preventDefault(),window.setTimeout(()=>ze(0),0))}},Ae=ce=>{let he=le;x==="blur"&&typeof he=="number"&&(he=gc(he,d,h)),B&&typeof he=="string"&&pe(he)<15&&(he=bme(he,h,d)),le!==he&&ue(he),_?.(ce)};i2(C,{increment:Ie.current,decrement:qe.current});const Ne=ce=>{ce?Ie.current?.():qe.current?.(),je.current+=1},Ue=ce=>{if(Ne(ce),Se){const he=typeof F=="number"?F:F(je.current);Be.current=window.setTimeout(()=>Ue(ce),he)}},Qe=(ce,he)=>{ce.preventDefault(),Oe.current?.focus(),Ne(he),Se&&(Be.current=window.setTimeout(()=>Ue(he),V))},ae=()=>{Be.current&&window.clearTimeout(Be.current),Be.current=null,je.current=0},K=k.jsxs("div",{...G("controls"),children:[k.jsx(cf,{...G("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof le=="number"&&h!==void 0&&le>=h,mod:{direction:"up"},onMouseDown:ce=>ce.preventDefault(),onPointerDown:ce=>{Qe(ce,!0)},onPointerUp:ae,onPointerLeave:ae,children:k.jsx(Sz,{direction:"up"})}),k.jsx(cf,{...G("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof le=="number"&&d!==void 0&&le<=d,mod:{direction:"down"},onMouseDown:ce=>ce.preventDefault(),onPointerDown:ce=>{Qe(ce,!1)},onPointerUp:ae,onPointerLeave:ae,children:k.jsx(Sz,{direction:"down"})})]});return k.jsx(Mu,{component:cme,allowNegative:U,className:ls(zO.root,i),size:z,...Z,readOnly:j,disabled:R,value:le,getInputRef:Ps(e,Oe),onValueChange:He,rightSection:b||j||!$3(le)?y:y||K,classNames:de,styles:oe,unstyled:s,__staticSelector:"NumberInput",decimalScale:w?M:0,onKeyDown:we,onKeyDownCapture:Me,rightSectionPointerEvents:L??(R?"none":void 0),rightSectionWidth:q??`var(--ni-right-section-width-${z||"sm"})`,allowLeadingZeros:H,onBlur:Ae,attributes:J,isAllowed:ce=>x==="strict"?m?m(ce)&&wz(ce.floatValue,d,h):wz(ce.floatValue,d,h):m?m(ce):!0})});cg.classes={...Mu.classes,...zO};cg.displayName="@mantine/core/NumberInput";const[vme,CY]=Eu("Progress.Root component was not found in tree");var I_={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=CY();return k.jsx(ct,{ref:e,...l.getStyles("label",{className:i,style:r,classNames:n,styles:a}),...o})});yP.classes=I_;yP.displayName="@mantine/core/ProgressLabel";const yme=(t,{size:e,radius:n,transitionDuration:i})=>({root:{"--progress-size":ui(e,"progress-size"),"--progress-radius":n===void 0?void 0:la(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:I_,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:h,vars:l,varsResolver:yme});return k.jsx(vme,{value:{getStyles:b,autoContrast:c},children:k.jsx(ct,{ref:e,mod:[{orientation:f},d],...b("root"),...g})})});CA.classes=I_;CA.displayName="@mantine/core/ProgressRoot";const xme={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",xme,t),g=CY(),b=_a(),y=l?{role:"progressbar","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":o,"aria-valuetext":`${o}%`}:{};return k.jsx(ct,{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":sa(c,b),"--progress-label-color":sA(g.autoContrast,b)?T_({color:c,theme:b,autoContrast:g.autoContrast}):void 0}})});RA.classes=I_;RA.displayName="@mantine/core/ProgressSection";const uf=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}=Dv({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})})});uf.classes=I_;uf.displayName="@mantine/core/Progress";uf.Section=RA;uf.Root=CA;uf.Label=yP;const _me={duration:100,transition:"fade"};function Ez(t,e){return{..._me,...e,...t}}function Sme({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=ah(c.floating.current);return y.forEach(m=>{m.addEventListener("scroll",u)}),()=>{b.removeEventListener("mousemove",g),y.forEach(m=>{m.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 wme={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:gf("popover")},Eme=(t,{radius:e,color:n})=>({tooltip:{"--tooltip-radius":e===void 0?void 0:la(e),"--tooltip-bg":n?sa(n,t):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),xP=tn((t,e)=>{const n=Pt("TooltipFloating",wme,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:m,disabled:x,defaultOpened:_,variant:w,vars:M,portalProps:S,attributes:A,...C}=n,D=_a(),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:Eme}),{handleMouseMove:L,x:U,y:j,opened:z,boundaryRef:q,floating:F,setOpened:V}=Sme({offset:g,position:b,defaultOpened:_});if(!sg(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,B=Z=>{W.onMouseEnter?.(Z),L(Z),V(!0)},J=Z=>{W.onMouseLeave?.(Z),V(!1)};return k.jsxs(k.Fragment,{children:[k.jsx(jd,{...S,withinPortal:a,children:k.jsx(ct,{...C,...R("tooltip",{style:{...xL(s,D),zIndex:m,display:!x&&z?"block":"none",top:(j&&Math.round(j))??"",left:(U&&Math.round(U))??""}}),variant:w,ref:F,mod:{multiline:y},children:d})}),I.cloneElement(i,{...W,[r]:H,onMouseEnter:B,onMouseLeave:J})]})});xP.classes=kA;xP.displayName="@mantine/core/TooltipFloating";const RY=I.createContext(!1),Mme=RY.Provider,Tme=()=>I.useContext(RY),Ame={openDelay:0,closeDelay:0};function _P(t){const{openDelay:e,closeDelay:n,children:i}=Pt("TooltipGroup",Ame,t);return k.jsx(Mme,{value:!0,children:k.jsx(qfe,{delay:{open:e,close:n},children:i})})}_P.displayName="@mantine/core/TooltipGroup";_P.extend=t=>t;function Cme(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 Rme(t){const e=Cme(t.middlewares),n=[XX(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(KX({element:t.arrowRef,padding:t.arrowOffset})),e.inline?n.push(typeof e.inline=="boolean"?Jx():Jx(e.inline)):t.inline&&n.push(Jx()),n}function kme(t){const[e,n]=I.useState(t.defaultOpened),r=typeof t.opened=="boolean"?t.opened:e,a=Tme(),s=mf(),o=I.useCallback(M=>{n(M),M&&m(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:Rme(t),whileElementsMounted:NO}),{delay:b,currentId:y,setCurrentId:m}=Xfe(u,{id:s}),{getReferenceProps:x,getFloatingProps:_}=Qfe([Gfe(u,{enabled:t.events?.hover,delay:a?b:{open:t.openDelay,close:t.closeDelay},mouseOnly:!t.events?.touch}),Zfe(u,{enabled:t.events?.focus,visibleOnly:!0}),the(u,{role:"tooltip"}),Jfe(u,{enabled:typeof t.opened>"u"})]);_c(()=>{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:gf("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},Dme=(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:la(e),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}},Pr=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:m,style:x,className:_,withArrow:w,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,offset:D,transitionProps:R,multiline:L,events:U,zIndex:j,disabled:z,positionDependencies:q,onClick:F,onMouseEnter:V,onMouseLeave:H,inline:W,variant:B,keepMounted:J,vars:Z,portalProps:G,mod:de,floatingStrategy:oe,middlewares:le,autoContrast:ue,attributes:Se,target:Oe,...Be}=Pt("Tooltip",Mz,n),{dir:je}=Ov(),He=I.useRef(null),pe=kme({position:dK(je,r),closeDelay:l,openDelay:o,onPositionChange:c,opened:u,defaultOpened:f,events:U,arrowRef:He,arrowOffset:S,offset:typeof D=="number"?D+(w?M/2:0):D,positionDependencies:[...q,Oe??i],inline:W,strategy:oe,middlewares:le});I.useEffect(()=>{const Ae=Oe instanceof HTMLElement?Oe:typeof Oe=="string"?document.querySelector(Oe):Oe?.current||null;Ae&&pe.reference(Ae)},[Oe,pe]);const ze=Tn({name:"Tooltip",props:n,classes:kA,className:_,style:x,classNames:b,styles:y,unstyled:m,attributes:Se,rootSelector:"tooltip",vars:Z,varsResolver:Dme});if(!Oe&&!sg(i))return null;if(Oe){const Ae=Ez(R,{duration:100,transition:"fade"});return k.jsx(k.Fragment,{children:k.jsx(jd,{...G,withinPortal:h,children:k.jsx(Tc,{...Ae,keepMounted:J,mounted:!z&&!!pe.opened,duration:pe.isGroupPhase?10:Ae.duration,children:Ne=>k.jsxs(ct,{...Be,"data-fixed":oe==="fixed"||void 0,variant:B,mod:[{multiline:L},de],...pe.getFloatingProps({ref:pe.floating,className:ze("tooltip").className,style:{...ze("tooltip").style,...Ne,zIndex:j,top:pe.y??0,left:pe.x??0}}),children:[s,k.jsx(d2,{ref:He,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:w,position:pe.placement,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,...ze("arrow")})]})})})})}const Ie=i,qe=Ie.props,we=Ps(pe.reference,tA(Ie),e),Me=Ez(R,{duration:100,transition:"fade"});return k.jsxs(k.Fragment,{children:[k.jsx(jd,{...G,withinPortal:h,children:k.jsx(Tc,{...Me,keepMounted:J,mounted:!z&&!!pe.opened,duration:pe.isGroupPhase?10:Me.duration,children:Ae=>k.jsxs(ct,{...Be,"data-fixed":oe==="fixed"||void 0,variant:B,mod:[{multiline:L},de],...pe.getFloatingProps({ref:pe.floating,className:ze("tooltip").className,style:{...ze("tooltip").style,...Ae,zIndex:j,top:pe.y??0,left:pe.x??0}}),children:[s,k.jsx(d2,{ref:He,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:w,position:pe.placement,arrowSize:M,arrowOffset:S,arrowRadius:A,arrowPosition:C,...ze("arrow")})]})})}),I.cloneElement(Ie,pe.getReferenceProps({onClick:F,onMouseEnter:V,onMouseLeave:H,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:ls(_,qe.className),...qe,[a]:we}))]})});Pr.classes=kA;Pr.displayName="@mantine/core/Tooltip";Pr.Floating=xP;Pr.Group=_P;const Ome={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},Bv=tn((t,e)=>{const n=Pt("Select",Ome,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:m,selectFirstOptionOnChange:x,onOptionSubmit:_,comboboxProps:w,readOnly:M,disabled:S,filter:A,limit:C,withScrollArea:D,maxDropdownHeight:R,size:L,searchable:U,rightSection:j,checkIconPosition:z,withCheckIcon:q,nothingFoundMessage:F,name:V,form:H,searchValue:W,defaultSearchValue:B,onSearchChange:J,allowDeselect:Z,error:G,rightSectionPointerEvents:de,id:oe,clearable:le,clearButtonProps:ue,hiddenInputProps:Se,renderOption:Oe,onClear:Be,autoComplete:je,scrollAreaProps:He,__defaultRightSection:pe,__clearSection:ze,__clearable:Ie,chevronColor:qe,autoSelectOnBlur:we,attributes:Me,...Ae}=n,Ne=I.useMemo(()=>hde(b),[b]),Ue=I.useRef({}),Qe=I.useMemo(()=>BK(Ne),[Ne]),ae=mf(oe),[K,ce,he]=Cl({value:y,defaultValue:m,finalValue:null,onChange:g}),me=typeof K=="string"?K in Qe?Qe[K]:Ue.current[K]:void 0,$=zoe(me),[Ve,Xe,mt]=Cl({value:W,defaultValue:B,finalValue:me?me.label:"",onChange:J}),Ge=WK({opened:o,defaultOpened:l,onDropdownOpen:()=>{u?.(),Ge.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(Ge.resetSelectedOption,0)}}),Je=kt=>{Xe(kt),Ge.resetSelectedOption()},{resolvedClassNames:Ye,resolvedStyles:vt}=Dv({props:n,styles:r,classNames:i});I.useEffect(()=>{x&&Ge.selectFirstOption()},[x,Ve]),I.useEffect(()=>{y===null&&Je(""),typeof y=="string"&&me&&($?.value!==me.value||$?.label!==me.label)&&Je(me.label)},[y,me]),I.useEffect(()=>{!he&&!mt&&Je(typeof K=="string"?K in Qe?Qe[K]?.label:Ue.current[K]?.label||"":"")},[Qe,K]),I.useEffect(()=>{K&&K in Qe&&(Ue.current[K]=Qe[K])},[Qe,K]);const Mt=k.jsx(Sr.ClearButton,{...ue,onClear:()=>{ce(null,null),Je(""),Be?.()}}),gt=le&&!!K&&!S&&!M;return k.jsxs(k.Fragment,{children:[k.jsxs(Sr,{store:Ge,__staticSelector:"Select",classNames:Ye,styles:vt,unstyled:a,readOnly:M,size:L,attributes:Me,keepMounted:we,onOptionSubmit:kt=>{_?.(kt);const Re=Z&&Qe[kt].value===K?null:Qe[kt],Le=Re?Re.value:null;Le!==K&&ce(Le,Re),!he&&Je(typeof Le=="string"&&Re?.label||""),Ge.closeDropdown()},...w,children:[k.jsx(Sr.Target,{targetType:U?"input":"button",autoComplete:je,children:k.jsx(Mu,{id:ae,ref:e,__defaultRightSection:k.jsx(Sr.Chevron,{size:L,error:G,unstyled:a,color:qe}),__clearSection:Mt,__clearable:gt,rightSection:j,rightSectionPointerEvents:de||"none",...Ae,size:L,__staticSelector:"Select",disabled:S,readOnly:M||!U,value:Ve,onChange:kt=>{Je(kt.currentTarget.value),Ge.openDropdown(),x&&Ge.selectFirstOption()},onFocus:kt=>{U&&Ge.openDropdown(),f?.(kt)},onBlur:kt=>{we&&Ge.clickSelectedOption(),U&&Ge.closeDropdown();const Re=typeof K=="string"&&(K in Qe?Qe[K]:Ue.current[K]);Je(Re&&Re.label||""),h?.(kt)},onClick:kt=>{U?Ge.openDropdown():Ge.toggleDropdown(),d?.(kt)},classNames:Ye,styles:vt,unstyled:a,pointer:!U,error:G,attributes:Me})}),k.jsx(Ude,{data:Ne,hidden:M||S,filter:A,search:Ve,limit:C,hiddenWhenEmpty:!F,withScrollArea:D,maxDropdownHeight:R,filterOptions:!!U&&me?.label!==Ve,value:K,checkIconPosition:z,withCheckIcon:q,nothingFoundMessage:F,unstyled:a,labelId:Ae.label?`${ae}-label`:void 0,"aria-label":Ae.label?void 0:Ae["aria-label"],renderOption:Oe,scrollAreaProps:He})]}),k.jsx(Sr.HiddenInput,{value:K,name:V,form:H,disabled:S,...Se})]})});Bv.classes={...Mu.classes,...Sr.classes};Bv.displayName="@mantine/core/Select";const[Ime,DA]=Eu("SliderProvider was not found in tree"),kY=I.forwardRef(({size:t,disabled:e,variant:n,color:i,thumbSize:r,radius:a,...s},o)=>{const{getStyles:l}=DA();return k.jsx(ct,{tabIndex:-1,variant:n,size:t,ref:o,...l("root"),...s})});kY.displayName="@mantine/core/SliderRoot";const DY=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},m)=>{const{getStyles:x}=DA(),[_,w]=I.useState(!1),M=c||a||_||d&&g;return k.jsxs(ct,{tabIndex:0,role:"slider","aria-label":u,"aria-valuemax":t,"aria-valuemin":e,"aria-valuenow":n,ref:m,__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(Tc,{mounted:r!=null&&!!M,transition:"fade",duration:0,...l,children:S=>k.jsx("div",{...x("label",{style:S}),children:r})})]})});DY.displayName="@mantine/core/SliderThumb";function OY({value:t,min:e,max:n}){const i=(t-e)/(n-e)*100;return Math.min(Math.max(i,0),100)}function Nme({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 IY({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(ct,{...o("markWrapper"),__vars:{"--mark-offset":`${OY({value:c.value,min:e,max:n})}%`},key:u},k.jsx(ct,{...o("mark"),mod:{filled:Nme({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})}IY.displayName="@mantine/core/SliderMarks";function NY({filled:t,children:e,offset:n,disabled:i,marksOffset:r,inverted:a,containerProps:s,...o}){const{getStyles:l}=DA();return k.jsx(ct,{...l("trackContainer"),mod:{disabled:i},...s,children:k.jsxs(ct,{...l("track"),mod:{inverted:a,disabled:i},children:[k.jsx(ct,{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(IY,{...o,offset:r,disabled:i,inverted:a})]})})}NY.displayName="@mantine/core/SliderTrack";function Lme({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 Pme(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 LY={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 Ume={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"},Fme=(t,{size:e,color:n,thumbSize:i,radius:r})=>({root:{"--slider-size":ui(e,"slider-size"),"--slider-color":n?sa(n,t):void 0,"--slider-radius":r===void 0?void 0:la(r),"--slider-thumb-size":i!==void 0?Et(i):"calc(var(--slider-size) * 2)"}}),OA=tn((t,e)=>{const n=Pt("Slider",Ume,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:m,labelTransitionProps:x,labelAlwaysOn:_,thumbLabel:w,showLabelOnHover:M,thumbChildren:S,disabled:A,unstyled:C,scale:D,inverted:R,className:L,style:U,vars:j,hiddenInputProps:z,restrictToMarks:q,thumbProps:F,attributes:V,...H}=n,W=Tn({name:"Slider",props:n,classes:LY,classNames:i,className:L,styles:r,style:U,attributes:V,vars:j,varsResolver:Fme,unstyled:C}),{dir:B}=Ov(),[J,Z]=I.useState(!1),[G,de]=Cl({value:typeof a=="number"?gc(a,c,u):a,defaultValue:typeof g=="number"?gc(g,c,u):g,finalValue:gc(0,c,u),onChange:s}),oe=I.useRef(G),le=I.useRef(o);I.useEffect(()=>{le.current=o},[o]);const ue=I.useRef(null),Se=I.useRef(null),[Oe,Be]=f||[c,u],je=OY({value:G,min:Oe,max:Be}),He=D(G),pe=typeof m=="function"?m(He):m,ze=d??Pme(h),Ie=I.useCallback(({x:Ue})=>{if(!A){const Qe=Lme({value:Ue,min:Oe,max:Be,step:h,precision:ze}),ae=gc(Qe,c,u);de(q&&y?.length?wB(ae,y.map(K=>K.value)):ae),oe.current=ae}},[A,c,u,Oe,Be,h,ze,de,y,q]),qe=I.useCallback(()=>{if(!A&&le.current){const Ue=q&&y?.length?wB(oe.current,y.map(Qe=>Qe.value)):oe.current;le.current(Ue)}},[A,y,q]),{ref:we,active:Me}=fL(Ie,{onScrubEnd:qe},B),Ae=I.useCallback(Ue=>{!A&&le.current&&le.current(Ue)},[A]),Ne=Ue=>{if(!A)switch(Ue.key){case"ArrowUp":{if(Ue.preventDefault(),Se.current?.focus(),q&&y){const ae=Z3(G,y);de(ae),Ae(ae);break}const Qe=aw(Math.min(Math.max(G+h,c),u),ze);de(Qe),Ae(Qe);break}case"ArrowRight":{if(Ue.preventDefault(),Se.current?.focus(),q&&y){const ae=B==="rtl"?Q3(G,y):Z3(G,y);de(ae),Ae(ae);break}const Qe=aw(Math.min(Math.max(B==="rtl"?G-h:G+h,c),u),ze);de(Qe),Ae(Qe);break}case"ArrowDown":{if(Ue.preventDefault(),Se.current?.focus(),q&&y){const ae=Q3(G,y);de(ae),Ae(ae);break}const Qe=aw(Math.min(Math.max(G-h,c),u),ze);de(Qe),Ae(Qe);break}case"ArrowLeft":{if(Ue.preventDefault(),Se.current?.focus(),q&&y){const ae=B==="rtl"?Z3(G,y):Q3(G,y);de(ae),Ae(ae);break}const Qe=aw(Math.min(Math.max(B==="rtl"?G+h:G-h,c),u),ze);de(Qe),Ae(Qe);break}case"Home":{if(Ue.preventDefault(),Se.current?.focus(),q&&y){de(Tz(y)),Ae(Tz(y));break}de(c),Ae(c);break}case"End":{if(Ue.preventDefault(),Se.current?.focus(),q&&y){de(Az(y)),Ae(Az(y));break}de(u),Ae(u);break}}};return k.jsx(Ime,{value:{getStyles:W},children:k.jsxs(kY,{...H,ref:Ps(e,ue),onKeyDownCapture:Ne,onMouseDownCapture:()=>ue.current?.focus(),size:l,disabled:A,children:[k.jsx(NY,{inverted:R,offset:0,filled:je,marks:y,min:Oe,max:Be,value:He,disabled:A,containerProps:{ref:we,onMouseEnter:M?()=>Z(!0):void 0,onMouseLeave:M?()=>Z(!1):void 0},children:k.jsx(DY,{max:Be,min:Oe,value:He,position:je,dragging:Me,label:pe,ref:Se,labelTransitionProps:x,labelAlwaysOn:_,thumbLabel:w,showLabelOnHover:M,isHovered:J,disabled:A,...F,children:S})}),k.jsx("input",{type:"hidden",name:b,value:He,...z})]})})});OA.classes=LY;OA.displayName="@mantine/core/Slider";var PY={root:"m_6d731127"};const Bme={gap:"md",align:"stretch",justify:"flex-start"},zme=(t,{gap:e,align:n,justify:i})=>({root:{"--stack-gap":zd(e),"--stack-align":n,"--stack-justify":i}}),Rm=tn((t,e)=>{const n=Pt("Stack",Bme,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:PY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:d,vars:l,varsResolver:zme});return k.jsx(ct,{ref:e,...b("root"),variant:h,...g})});Rm.classes=PY;Rm.displayName="@mantine/core/Stack";const UY=I.createContext(null),jme=UY.Provider,Hme=()=>I.useContext(UY),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]=Cl({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(jme,{value:{value:u,onChange:h,size:a},children:k.jsx(ga.Wrapper,{size:a,ref:e,...s,...c,labelElement:"div",__staticSelector:"SwitchGroup",children:k.jsx($K,{role:"group",children:o})})})});SP.classes=ga.Wrapper.classes;SP.displayName="@mantine/core/SwitchGroup";var FY={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const Vme={labelPosition:"right",withThumbIndicator:!0},Gme=(t,{radius:e,color:n,size:i})=>({root:{"--switch-radius":e===void 0?void 0:la(e),"--switch-height":ui(i,"switch-height"),"--switch-width":ui(i,"switch-width"),"--switch-thumb-size":ui(i,"switch-thumb-size"),"--switch-label-font-size":ui(i,"switch-label-font-size"),"--switch-track-label-padding":ui(i,"switch-track-label-padding"),"--switch-color":n?sa(n,t):void 0}}),vd=tn((t,e)=>{const n=Pt("Switch",Vme,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:m,checked:x,defaultChecked:_,onChange:w,labelPosition:M,description:S,error:A,disabled:C,variant:D,rootRef:R,mod:L,withThumbIndicator:U,attributes:j,...z}=n,q=Hme(),F=g||q?.size,V=Tn({name:"Switch",props:n,classes:FY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:j,vars:l,varsResolver:Gme}),{styleProps:H,rest:W}=A_(z),B=mf(d),J=q?{checked:q.value.includes(W.value),onChange:q.onChange}:{},[Z,G]=Cl({value:J.checked??x,defaultValue:_,finalValue:!1});return k.jsxs(ZL,{...V("root"),__staticSelector:"Switch",__stylesApiProps:n,id:B,size:F,labelPosition:M,label:u,description:S,error:A,disabled:C,bodyElement:"label",labelElement:"span",classNames:i,styles:s,unstyled:o,"data-checked":J.checked||x||void 0,variant:D,ref:R,mod:L,...H,...y,children:[k.jsx("input",{...W,disabled:C,checked:Z,"data-checked":J.checked||x||void 0,onChange:de=>{q?J.onChange?.(de):w?.(de),G(de.currentTarget.checked)},id:B,ref:e,type:"checkbox",role:"switch",...V("input")}),k.jsxs(ct,{"aria-hidden":"true",component:"span",mod:{error:A,"label-position":M,"without-labels":!h&&!f},...V("track"),children:[k.jsx(ct,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":U&&!m},...V("thumb"),children:m}),k.jsx("span",{...V("trackLabel"),children:Z?h:f})]})]})});vd.classes={...FY,...XK};vd.displayName="@mantine/core/Switch";vd.Group=SP;const[Wme,qme]=Eu("Table component was not found in the tree");var N_={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 Xme(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 ug(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=qme();return k.jsx(ct,{component:t,ref:a,...Xme(h,e),...h.getStyles(t,{className:l,classNames:o,style:c,styles:u,props:s}),...f})});return i.displayName=`@mantine/core/${n}`,i.classes=N_,i}const HO=ug("th",{columnBorder:!0}),BY=ug("td",{columnBorder:!0}),uM=ug("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),zY=ug("thead",{stickyHeader:!0}),jY=ug("tbody"),HY=ug("tfoot"),VY=ug("caption",{captionSide:!0});function wP({data:t}){return k.jsxs(k.Fragment,{children:[t.caption&&k.jsx(VY,{children:t.caption}),t.head&&k.jsx(zY,{children:k.jsx(uM,{children:t.head.map((e,n)=>k.jsx(HO,{children:e},n))})}),t.body&&k.jsx(jY,{children:t.body.map((e,n)=>k.jsx(uM,{children:e.map((i,r)=>k.jsx(BY,{children:i},r))},n))}),t.foot&&k.jsx(HY,{children:k.jsx(uM,{children:t.foot.map((e,n)=>k.jsx(HO,{children:e},n))})})]})}wP.displayName="@mantine/core/TableDataRenderer";const Kme={type:"scrollarea"},Yme=(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",Kme,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:N_,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:g,vars:l,varsResolver:Yme,rootSelector:"scrollContainer"});return k.jsx(ct,{component:h==="scrollarea"?Dc:"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=N_;EP.displayName="@mantine/core/TableScrollContainer";const Jme={withRowBorders:!0,verticalSpacing:7},$me=(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":zd(i),"--table-vertical-spacing":zd(r),"--table-border-color":a?sa(a,t):void 0,"--table-striped-color":l&&s?sa(s,t):void 0,"--table-highlight-on-hover-color":c&&o?sa(o,t):void 0,"--table-sticky-header-offset":f?Et(u):void 0}}),Nc=tn((t,e)=>{const n=Pt("Table",Jme,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:m,withTableBorder:x,borderColor:_,layout:w,variant:M,data:S,children:A,stickyHeader:C,stickyHeaderOffset:D,mod:R,tabularNums:L,attributes:U,...j}=n,z=Tn({name:"Table",props:n,className:r,style:a,classes:N_,classNames:i,styles:s,unstyled:o,attributes:U,rootSelector:"table",vars:l,varsResolver:$me});return k.jsx(Wme,{value:{getStyles:z,stickyHeader:C,striped:g===!0?"odd":g||void 0,highlightOnHover:b,withColumnBorders:y,withRowBorders:m,captionSide:f||"bottom"},children:k.jsx(ct,{component:"table",variant:M,ref:e,mod:[{"data-with-table-border":x,"data-tabular-nums":L},R],...z("table"),...j,children:A||!!S&&k.jsx(wP,{data:S})})})});Nc.classes=N_;Nc.displayName="@mantine/core/Table";Nc.Td=BY;Nc.Th=HO;Nc.Tr=uM;Nc.Thead=zY;Nc.Tbody=jY;Nc.Tfoot=HY;Nc.Caption=VY;Nc.ScrollContainer=EP;Nc.DataRenderer=wP;const[Zme,MP]=Eu("Tabs component was not found in the tree");var L_={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(ct,{...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=L_;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(ct,{...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=L_;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:m,...x}=n,_=_a(),{dir:w}=Ov(),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(cf,{...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:m!==void 0?m:S||M.value===null?0:-1,"aria-controls":M.getPanelId(o),onClick:A,__vars:{"--tabs-color":f?sa(f,_):void 0},onKeyDown:$le({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=L_;CP.displayName="@mantine/core/TabsTab";const Cz="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",Qme={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},ege=(t,{radius:e,color:n,autoContrast:i})=>({root:{"--tabs-radius":la(e),"--tabs-color":sa(n,t),"--tabs-text-color":sA(i,t)?T_({color:n,theme:t,autoContrast:i}):void 0}}),$f=tn((t,e)=>{const n=Pt("Tabs",Qme,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:m,classNames:x,styles:_,unstyled:w,className:M,style:S,vars:A,autoContrast:C,mod:D,attributes:R,...L}=n,U=mf(c),[j,z]=Cl({value:r,defaultValue:i,finalValue:null,onChange:a}),q=Tn({name:"Tabs",props:n,classes:L_,className:M,style:S,classNames:x,styles:_,unstyled:w,attributes:R,vars:A,varsResolver:ege});return k.jsx(Zme,{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:m,unstyled:w,getStyles:q},children:k.jsx(ct,{ref:e,id:U,variant:h,mod:[{orientation:s,inverted:s==="horizontal"&&b,placement:s==="vertical"&&y},D],...q("root"),...L,children:o})})});$f.classes=L_;$f.displayName="@mantine/core/Tabs";$f.Tab=CP;$f.Panel=AP;$f.List=TP;const fg=tn((t,e)=>{const n=Pt("TextInput",null,t);return k.jsx(Mu,{component:"input",ref:e,...n,__staticSelector:"TextInput"})});fg.classes=Mu.classes;fg.displayName="@mantine/core/TextInput";const tge=["h1","h2","h3","h4","h5","h6"],nge=["xs","sm","md","lg","xl"];function ige(t,e){const n=e!==void 0?e:`h${t}`;return tge.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:nge.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 GY={root:"m_8a5d1357"};const rge={order:1},age=(t,{order:e,size:n,lineClamp:i,textWrap:r})=>{const a=ige(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",rge,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,m=Tn({name:"Title",props:n,classes:GY,className:r,style:a,classNames:i,styles:s,unstyled:o,attributes:b,vars:c,varsResolver:age});return[1,2,3,4,5,6].includes(l)?k.jsx(ct,{...m("root"),component:`h${l}`,variant:f,ref:e,mod:[{order:l,"data-line-clamp":typeof h=="number"},g],size:u,...y}):null});IA.classes=GY;IA.displayName="@mantine/core/Title";const WY=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function sge(t,e){return t.reduce((n,i)=>(n[i.position||e].push(i),n),WY.reduce((n,i)=>(n[i]=[],n),{}))}const Rz={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},oge={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function lge({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:oge[s]},c={opacity:0,maxHeight:0,transform:Rz[s]};return{...o,...{entering:l,entered:l,exiting:c,exited:c}[t]}}function cge(t,e){return typeof e=="number"?e:e===!1||t===!1?!1:t}const qY=I.forwardRef(({data:t,onHide:e,autoClose:n,...i},r)=>{const{autoClose:a,message:s,...o}=t,l=cge(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})});qY.displayName="@mantine/notifications/NotificationContainer";var XY={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const uge=Sh,fge={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:gf("overlay"),store:ag,withinPortal:!0},hge=(t,{zIndex:e,containerWidth:n})=>({root:{"--notifications-z-index":e?.toString(),"--notifications-container-width":Et(n)}}),Mh=tn((t,e)=>{const n=Pt("Notifications",fge,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:m,withinPortal:x,..._}=n,w=_a(),M=Xoe(y),S=Noe(),A=ZT(),C=I.useRef({}),D=I.useRef(0),L=(w.respectReducedMotion?A:!1)?1:f,U=Tn({name:"Notifications",classes:XY,props:n,className:r,style:a,classNames:i,styles:s,unstyled:o,vars:l,varsResolver:hge});I.useEffect(()=>{y?.updateState(q=>({...q,limit:g||5,defaultPosition:c}))},[g,c]),_c(()=>{M.notifications.length>D.current&&setTimeout(()=>S(),0),D.current=M.notifications.length},[M.notifications]);const j=sge(M.notifications,c),z=WY.reduce((q,F)=>(q[F]=j[F].map(({style:V,...H})=>k.jsx(uge,{timeout:L,onEnter:()=>C.current[H.id].offsetHeight,nodeRef:{current:C.current[H.id]},children:W=>k.jsx(qY,{ref:B=>{B&&(C.current[H.id]=B)},data:H,onHide:B=>sX(B,y),autoClose:u,...U("notification",{style:{...lge({state:W,position:F,transitionDuration:L,maxHeight:d}),...V}})})},H.id)),q),{});return k.jsxs(jd,{withinPortal:x,...m,children:[k.jsx(ct,{...U("root"),"data-position":"top-center",ref:e,..._,children:k.jsx(cd,{children:z["top-center"]})}),k.jsx(ct,{...U("root"),"data-position":"top-left",..._,children:k.jsx(cd,{children:z["top-left"]})}),k.jsx(ct,{...U("root",{className:a2.classNames.fullWidth}),"data-position":"top-right",..._,children:k.jsx(cd,{children:z["top-right"]})}),k.jsx(ct,{...U("root",{className:a2.classNames.fullWidth}),"data-position":"bottom-right",..._,children:k.jsx(cd,{children:z["bottom-right"]})}),k.jsx(ct,{...U("root"),"data-position":"bottom-left",..._,children:k.jsx(cd,{children:z["bottom-left"]})}),k.jsx(ct,{...U("root"),"data-position":"bottom-center",..._,children:k.jsx(cd,{children:z["bottom-center"]})})]})});Mh.classes=XY;Mh.displayName="@mantine/notifications/Notifications";Mh.show=ks.show;Mh.hide=ks.hide;Mh.update=ks.update;Mh.clean=ks.clean;Mh.cleanQueue=ks.cleanQueue;Mh.updateState=ks.updateState;/**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */const zv="179",dge={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},pge={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},KY=0,VO=1,YY=2,mge=3,JY=0,NA=1,$x=2,Zc=3,_u=0,Da=1,Jr=2,rf=0,km=1,GO=2,WO=3,qO=4,$Y=5,yd=100,ZY=101,QY=102,eJ=103,tJ=104,nJ=200,iJ=201,rJ=202,aJ=203,p2=204,m2=205,sJ=206,oJ=207,lJ=208,cJ=209,uJ=210,fJ=211,hJ=212,dJ=213,pJ=214,g2=0,b2=1,v2=2,Gm=3,y2=4,x2=5,_2=6,S2=7,P_=0,mJ=1,gJ=2,af=0,bJ=1,vJ=2,yJ=3,RP=4,xJ=5,_J=6,SJ=7,B1="attached",kP="detached",Hd=300,ff=301,Vd=302,J0=303,z1=304,jv=306,Gd=1e3,xa=1001,$0=1002,ss=1003,LA=1004,gge=1004,lm=1005,bge=1005,Vi=1006,x0=1007,vge=1007,vc=1008,XO=1008,Ao=1009,PA=1010,UA=1011,Z0=1012,Hv=1013,Ac=1014,wr=1015,rs=1016,FA=1017,BA=1018,Q0=1020,DP=35902,OP=1021,IP=1022,Qr=1023,ev=1026,tv=1027,Th=1028,Vv=1029,zA=1030,U_=1031,yge=1032,Gv=1033,Zx=33776,Qx=33777,e1=33778,t1=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,n1=36492,G2=36494,W2=36495,NP=36283,q2=36284,X2=36285,K2=36286,wJ=2200,EJ=2201,MJ=2202,nv=2300,iv=2301,fM=2302,cm=2400,um=2401,j1=2402,jA=2500,LP=2501,TJ=0,PP=1,Y2=2,AJ=3200,UP=3201,xge=3202,_ge=3203,Jd=0,CJ=1,su="",Es="srgb",Su="srgb-linear",H1="linear",pr="srgb",Sge=0,Jp=7680,wge=7681,Ege=7682,Mge=7683,Tge=34055,Age=34056,Cge=5386,Rge=512,kge=513,Dge=514,Oge=515,Ige=516,Nge=517,Lge=518,KO=519,RJ=512,kJ=513,DJ=514,FP=515,OJ=516,IJ=517,NJ=518,LJ=519,V1=35044,G1=35048,Pge=35040,Uge=35045,Fge=35049,Bge=35041,zge=35046,jge=35050,Hge=35042,Vge="100",YO="300 es",vl=2e3,rv=2001,Gge={COMPUTE:"compute",RENDER:"render"},Wge={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},qge={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};let vf=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 $s=["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 Dm=Math.PI/180,av=180/Math.PI;function El(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return($s[t&255]+$s[t>>8&255]+$s[t>>16&255]+$s[t>>24&255]+"-"+$s[e&255]+$s[e>>8&255]+"-"+$s[e>>16&15|64]+$s[e>>24&255]+"-"+$s[n&63|128]+$s[n>>8&255]+"-"+$s[n>>16&255]+$s[n>>24&255]+$s[i&255]+$s[i>>8&255]+$s[i>>16&255]+$s[i>>24&255]).toLowerCase()}function Pn(t,e,n){return Math.max(e,Math.min(n,t))}function BP(t,e){return(t%e+e)%e}function Xge(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function Kge(t,e,n){return t!==e?(n-t)/(e-t):0}function i1(t,e,n){return(1-n)*t+n*e}function Yge(t,e,n,i){return i1(t,e,1-Math.exp(-n*i))}function Jge(t,e=1){return e-Math.abs(BP(t,e*2)-e)}function $ge(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Zge(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function Qge(t,e){return t+Math.floor(Math.random()*(e-t+1))}function ebe(t,e){return t+Math.random()*(e-t)}function tbe(t){return t*(.5-Math.random())}function nbe(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 ibe(t){return t*Dm}function rbe(t){return t*av}function abe(t){return(t&t-1)===0&&t!==0}function sbe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function obe(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function lbe(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 wo(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 ti(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 yc={DEG2RAD:Dm,RAD2DEG:av,generateUUID:El,clamp:Pn,euclideanModulo:BP,mapLinear:Xge,inverseLerp:Kge,lerp:i1,damp:Yge,pingpong:Jge,smoothstep:$ge,smootherstep:Zge,randInt:Qge,randFloat:ebe,randFloatSpread:tbe,seededRandom:nbe,degToRad:ibe,radToDeg:rbe,isPowerOfTwo:abe,ceilPowerOfTwo:sbe,floorPowerOfTwo:obe,setQuaternionFromProperEuler:lbe,normalize:ti,denormalize:wo};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=Pn(this.x,e.x,n.x),this.y=Pn(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=Pn(this.x,e,n),this.y=Pn(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Pn(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(Pn(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 qn{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 m=l*h+c*d+u*g+f*b,x=m>=0?1:-1,_=1-m*m;if(_>Number.EPSILON){const M=Math.sqrt(_),S=Math.atan2(M,m*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(Pn(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=Pn(this.x,e.x,n.x),this.y=Pn(this.y,e.y,n.y),this.z=Pn(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=Pn(this.x,e,n),this.y=Pn(this.y,e,n),this.z=Pn(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Pn(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(Pn(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 qn;class $n{constructor(e,n,i,r,a,s,o,l,c){$n.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],m=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*m+o*w+l*A,a[1]=c*b+u*x+f*M,a[4]=c*y+u*_+f*S,a[7]=c*m+u*w+f*A,a[2]=h*b+d*x+g*M,a[5]=h*y+d*_+g*S,a[8]=h*m+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 $n;function PJ(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const cbe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function i0(t,e){return new cbe[t](e)}function W1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function UJ(){const t=W1("canvas");return t.style.display="block",t}const Oz={};function _0(t){t in Oz||(Oz[t]=!0,console.warn(t))}function ube(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 $n().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Nz=new $n().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function fbe(){const t={enabled:!0,workingColorSpace:Su,spaces:{},convert:function(r,a,s){return this.enabled===!1||a===s||!a||!s||(this.spaces[a].transfer===pr&&(r.r=sh(r.r),r.g=sh(r.g),r.b=sh(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===pr&&(r.r=S0(r.r),r.g=S0(r.g),r.b=S0(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===su?H1: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 _0("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return _0("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({[Su]:{primaries:e,whitePoint:i,transfer:H1,toXYZ:Iz,fromXYZ:Nz,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Es},outputColorSpaceConfig:{drawingBufferColorSpace:Es}},[Es]:{primaries:e,whitePoint:i,transfer:pr,toXYZ:Iz,fromXYZ:Nz,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Es}}}),t}const bi=fbe();function sh(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function S0(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Jg;class FJ{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{Jg===void 0&&(Jg=W1("canvas")),Jg.width=e.width,Jg.height=e.height;const r=Jg.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Jg}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=W1("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]=sh(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(sh(n[i]/255)*255):n[i]=sh(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 hbe=0;class Ed{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hbe++}),this.uuid=El(),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?FJ.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 dbe=0;const ik=new te;class nr extends vf{constructor(e=nr.DEFAULT_IMAGE,n=nr.DEFAULT_MAPPING,i=xa,r=xa,a=Vi,s=vc,o=Qr,l=Ao,c=nr.DEFAULT_ANISOTROPY,u=su){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:dbe++}),this.uuid=El(),this.name="",this.source=new Ed(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 $n,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!==Hd)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Gd:e.x=e.x-Math.floor(e.x);break;case xa:e.x=e.x<0?0:1;break;case $0: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 Gd:e.y=e.y-Math.floor(e.y);break;case xa:e.y=e.y<0?0:1;break;case $0: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=Hd;nr.DEFAULT_ANISOTROPY=1;class ni{constructor(e=0,n=0,i=0,r=1){ni.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],m=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+m-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const _=(c+1)/2,w=(d+1)/2,M=(m+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+m-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=Pn(this.x,e.x,n.x),this.y=Pn(this.y,e.y,n.y),this.z=Pn(this.z,e.z,n.z),this.w=Pn(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=Pn(this.x,e,n),this.y=Pn(this.y,e,n),this.z=Pn(this.z,e,n),this.w=Pn(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Pn(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 vf{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Vi,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 ni(0,0,e,n),this.scissorTest=!1,this.viewport=new ni(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:Vi,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 Ed(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 Cc 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=ss,this.minFilter=ss,this.wrapR=xa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class pbe extends Cc{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=ss,this.minFilter=ss,this.wrapR=xa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class mbe extends Cc{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(Wc.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(Wc.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=Wc.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,Wc):Wc.fromBufferAttribute(a,s),Wc.applyMatrix4(e.matrixWorld),this.expandByPoint(Wc);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,Wc),Wc.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(Uy),ow.subVectors(this.max,Uy),$g.subVectors(e.a,Uy),Zg.subVectors(e.b,Uy),Qg.subVectors(e.c,Uy),qh.subVectors(Zg,$g),Xh.subVectors(Qg,Zg),wp.subVectors($g,Qg);let n=[0,-qh.z,qh.y,0,-Xh.z,Xh.y,0,-wp.z,wp.y,qh.z,0,-qh.x,Xh.z,0,-Xh.x,wp.z,0,-wp.x,-qh.y,qh.x,0,-Xh.y,Xh.x,0,-wp.y,wp.x,0];return!rk(n,$g,Zg,Qg,ow)||(n=[1,0,0,0,1,0,0,0,1],!rk(n,$g,Zg,Qg,ow))?!1:(lw.crossVectors(qh,Xh),n=[lw.x,lw.y,lw.z],rk(n,$g,Zg,Qg,ow))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Wc).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Wc).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:(Nf[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Nf[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Nf[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Nf[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Nf[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Nf[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Nf[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Nf[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Nf),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 Nf=[new te,new te,new te,new te,new te,new te,new te,new te],Wc=new te,sw=new rr,$g=new te,Zg=new te,Qg=new te,qh=new te,Xh=new te,wp=new te,Uy=new te,ow=new te,lw=new te,Ep=new te;function rk(t,e,n,i,r){for(let a=0,s=t.length-3;a<=s;a+=3){Ep.fromArray(t,a);const o=r.x*Math.abs(Ep.x)+r.y*Math.abs(Ep.y)+r.z*Math.abs(Ep.z),l=e.dot(Ep),c=n.dot(Ep),u=i.dot(Ep);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const gbe=new rr,Fy=new te,ak=new te;class Ur{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):gbe.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;Fy.subVectors(e,this.center);const n=Fy.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(Fy,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(Fy.copy(e.center).add(ak)),this.expandByPoint(Fy.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 Lf=new te,sk=new te,cw=new te,Kh=new te,ok=new te,uw=new te,lk=new te;class yf{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,Lf)),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=Lf.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Lf.copy(this.origin).addScaledVector(this.direction,n),Lf.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){sk.copy(e).add(n).multiplyScalar(.5),cw.copy(n).sub(e).normalize(),Kh.copy(this.origin).sub(sk);const a=e.distanceTo(n)*.5,s=-this.direction.dot(cw),o=Kh.dot(this.direction),l=-Kh.dot(cw),c=Kh.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){Lf.subVectors(e.center,this.origin);const i=Lf.dot(this.direction),r=Lf.dot(Lf)-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,Lf)!==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;Kh.subVectors(this.origin,e);const l=o*this.direction.dot(uw.crossVectors(Kh,uw));if(l<0)return null;const c=o*this.direction.dot(ok.cross(Kh));if(c<0||l+c>s)return null;const u=-o*Kh.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 Dt{constructor(e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y){Dt.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 m=this.elements;return m[0]=e,m[4]=n,m[8]=i,m[12]=r,m[1]=a,m[5]=s,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=f,m[14]=h,m[3]=d,m[7]=g,m[11]=b,m[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 Dt().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/eb.setFromMatrixColumn(e,0).length(),a=1/eb.setFromMatrixColumn(e,1).length(),s=1/eb.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(bbe,e,vbe)}lookAt(e,n,i){const r=this.elements;return cl.subVectors(e,n),cl.lengthSq()===0&&(cl.z=1),cl.normalize(),Yh.crossVectors(i,cl),Yh.lengthSq()===0&&(Math.abs(i.z)===1?cl.x+=1e-4:cl.z+=1e-4,cl.normalize(),Yh.crossVectors(i,cl)),Yh.normalize(),fw.crossVectors(cl,Yh),r[0]=Yh.x,r[4]=fw.x,r[8]=cl.x,r[1]=Yh.y,r[5]=fw.y,r[9]=cl.y,r[2]=Yh.z,r[6]=fw.z,r[10]=cl.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],m=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],L=r[5],U=r[9],j=r[13],z=r[2],q=r[6],F=r[10],V=r[14],H=r[3],W=r[7],B=r[11],J=r[15];return a[0]=s*S+o*R+l*z+c*H,a[4]=s*A+o*L+l*q+c*W,a[8]=s*C+o*U+l*F+c*B,a[12]=s*D+o*j+l*V+c*J,a[1]=u*S+f*R+h*z+d*H,a[5]=u*A+f*L+h*q+d*W,a[9]=u*C+f*U+h*F+d*B,a[13]=u*D+f*j+h*V+d*J,a[2]=g*S+b*R+y*z+m*H,a[6]=g*A+b*L+y*q+m*W,a[10]=g*C+b*U+y*F+m*B,a[14]=g*D+b*j+y*V+m*J,a[3]=x*S+_*R+w*z+M*H,a[7]=x*A+_*L+w*q+M*W,a[11]=x*C+_*U+w*F+M*B,a[15]=x*D+_*j+w*V+M*J,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],m=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)+m*(-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],m=e[15],x=f*y*c-b*h*c+b*l*d-o*y*d-f*l*m+o*h*m,_=g*h*c-u*y*c-g*l*d+s*y*d+u*l*m-s*h*m,w=u*b*c-g*f*c+g*o*d-s*b*d-u*o*m+s*f*m,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*m-i*h*m)*A,e[2]=(o*y*a-b*l*a+b*r*c-i*y*c-o*r*m+i*l*m)*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*m+n*h*m)*A,e[6]=(g*l*a-s*y*a-g*r*c+n*y*c+s*r*m-n*l*m)*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*m-n*f*m)*A,e[10]=(s*b*a-g*o*a+g*i*c-n*b*c-s*i*m+n*o*m)*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,m=o*f,x=l*c,_=l*u,w=l*f,M=i.x,S=i.y,A=i.z;return r[0]=(1-(b+m))*M,r[1]=(d+w)*M,r[2]=(g-_)*M,r[3]=0,r[4]=(d-w)*S,r[5]=(1-(h+m))*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=eb.set(r[0],r[1],r[2]).length();const s=eb.set(r[4],r[5],r[6]).length(),o=eb.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],qc.copy(this);const c=1/a,u=1/s,f=1/o;return qc.elements[0]*=c,qc.elements[1]*=c,qc.elements[2]*=c,qc.elements[4]*=u,qc.elements[5]*=u,qc.elements[6]*=u,qc.elements[8]*=f,qc.elements[9]*=f,qc.elements[10]*=f,n.setFromRotationMatrix(qc),i.x=a,i.y=s,i.z=o,this}makePerspective(e,n,i,r,a,s,o=vl,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===vl)g=-(s+a)/(s-a),b=-2*s*a/(s-a);else if(o===rv)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=vl,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===vl)g=-2/(s-a),b=-(s+a)/(s-a);else if(o===rv)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 eb=new te,qc=new Dt,bbe=new te(0,0,0),vbe=new te(1,1,1),Yh=new te,fw=new te,cl=new te,Lz=new Dt,Pz=new qn;class vi{constructor(e=0,n=0,i=0,r=vi.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(Pn(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(-Pn(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(Pn(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(-Pn(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(Pn(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(-Pn(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}}vi.DEFAULT_ORDER="XYZ";class sv{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 ybe=0;const Uz=new te,tb=new qn,Pf=new Dt,hw=new te,By=new te,xbe=new te,_be=new qn,Fz=new te(1,0,0),Bz=new te(0,1,0),zz=new te(0,0,1),jz={type:"added"},Sbe={type:"removed"},nb={type:"childadded",child:null},ck={type:"childremoved",child:null};class Pi extends vf{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:ybe++}),this.uuid=El(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Pi.DEFAULT_UP.clone();const e=new te,n=new vi,i=new qn,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 Dt},normalMatrix:{value:new $n}}),this.matrix=new Dt,this.matrixWorld=new Dt,this.matrixAutoUpdate=Pi.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Pi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new sv,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 tb.setFromAxisAngle(e,n),this.quaternion.multiply(tb),this}rotateOnWorldAxis(e,n){return tb.setFromAxisAngle(e,n),this.quaternion.premultiply(tb),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(Pf.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),By.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Pf.lookAt(By,hw,this.up):Pf.lookAt(hw,By,this.up),this.quaternion.setFromRotationMatrix(Pf),r&&(Pf.extractRotation(r.matrixWorld),tb.setFromRotationMatrix(Pf),this.quaternion.premultiply(tb.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),nb.child=e,this.dispatchEvent(nb),nb.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(Sbe),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),Pf.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Pf.multiply(e.parent.matrixWorld)),e.applyMatrix4(Pf),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(jz),nb.child=e,this.dispatchEvent(nb),nb.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(By,e,xbe),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(By,_be,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}}Pi.DEFAULT_UP=new te(0,1,0);Pi.DEFAULT_MATRIX_AUTO_UPDATE=!0;Pi.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Xc=new te,Uf=new te,uk=new te,Ff=new te,ib=new te,rb=new te,Hz=new te,fk=new te,hk=new te,dk=new te,pk=new ni,mk=new ni,gk=new ni;class Bo{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),Xc.subVectors(e,n),r.cross(Xc);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){Xc.subVectors(r,n),Uf.subVectors(i,n),uk.subVectors(e,n);const s=Xc.dot(Xc),o=Xc.dot(Uf),l=Xc.dot(uk),c=Uf.dot(Uf),u=Uf.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,Ff)===null?!1:Ff.x>=0&&Ff.y>=0&&Ff.x+Ff.y<=1}static getInterpolation(e,n,i,r,a,s,o,l){return this.getBarycoord(e,n,i,r,Ff)===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,Ff.x),l.addScaledVector(s,Ff.y),l.addScaledVector(o,Ff.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 Xc.subVectors(i,n),Uf.subVectors(e,n),Xc.cross(Uf).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 Xc.subVectors(this.c,this.b),Uf.subVectors(this.a,this.b),Xc.cross(Uf).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Bo.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Bo.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,a){return Bo.getInterpolation(e,this.a,this.b,this.c,n,i,r,a)}containsPoint(e){return Bo.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Bo.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;ib.subVectors(r,i),rb.subVectors(a,i),fk.subVectors(e,i);const l=ib.dot(fk),c=rb.dot(fk);if(l<=0&&c<=0)return n.copy(i);hk.subVectors(e,r);const u=ib.dot(hk),f=rb.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(ib,s);dk.subVectors(e,a);const d=ib.dot(dk),g=rb.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(rb,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 m=1/(y+b+h);return s=b*m,o=h*m,n.copy(i).addScaledVector(ib,s).addScaledVector(rb,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const BJ={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},Jh={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,bi.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=bi.workingColorSpace){return this.r=e,this.g=n,this.b=i,bi.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=bi.workingColorSpace){if(e=BP(e,1),n=Pn(n,0,1),i=Pn(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 bi.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=BJ[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=sh(e.r),this.g=sh(e.g),this.b=sh(e.b),this}copyLinearToSRGB(e){return this.r=S0(e.r),this.g=S0(e.g),this.b=S0(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Es){return bi.workingToColorSpace(Zs.copy(this),e),Math.round(Pn(Zs.r*255,0,255))*65536+Math.round(Pn(Zs.g*255,0,255))*256+Math.round(Pn(Zs.b*255,0,255))}getHexString(e=Es){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=bi.workingColorSpace){bi.workingToColorSpace(Zs.copy(this),n);const i=Zs.r,r=Zs.g,a=Zs.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=bi.workingColorSpace){return bi.workingToColorSpace(Zs.copy(this),n),e.r=Zs.r,e.g=Zs.g,e.b=Zs.b,e}getStyle(e=Es){bi.workingToColorSpace(Zs.copy(this),e);const n=Zs.r,i=Zs.g,r=Zs.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(Jh),this.setHSL(Jh.h+e,Jh.s+n,Jh.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(Jh),e.getHSL(dw);const i=i1(Jh.h,dw.h,n),r=i1(Jh.s,dw.s,n),a=i1(Jh.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 Zs=new Ut;Ut.NAMES=BJ;let wbe=0;class Oa extends vf{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:wbe++}),this.uuid=El(),this.name="",this.type="Material",this.blending=km,this.side=_u,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=p2,this.blendDst=m2,this.blendEquation=yd,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ut(0,0,0),this.blendAlpha=0,this.depthFunc=Gm,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=KO,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Jp,this.stencilZFail=Jp,this.stencilZPass=Jp,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!==km&&(i.blending=this.blending),this.side!==_u&&(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!==yd&&(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!==Gm&&(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!==Jp&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Jp&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Jp&&(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 Oa{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 vi,this.combine=P_,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 Wf=Ebe();function Ebe(){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 No(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Pn(t,-65504,65504),Wf.floatView[0]=t;const e=Wf.uint32View[0],n=e>>23&511;return Wf.baseTable[n]+((e&8388607)>>Wf.shiftTable[n])}function Mx(t){const e=t>>10;return Wf.uint32View[0]=Wf.mantissaTable[Wf.offsetTable[e]+(t&1023)]+Wf.exponentTable[e],Wf.floatView[0]}class fm{static toHalfFloat(e){return No(e)}static fromHalfFloat(e){return Mx(e)}}const Ma=new te,pw=new wt;let Mbe=0;class In{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:Mbe++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=V1,this.updateRanges=[],this.gpuType=wr,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++)Ma.fromBufferAttribute(this,n),Ma.applyMatrix3(e),this.setXYZ(n,Ma.x,Ma.y,Ma.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)Ma.fromBufferAttribute(this,n),Ma.applyMatrix4(e),this.setXYZ(n,Ma.x,Ma.y,Ma.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)Ma.fromBufferAttribute(this,n),Ma.applyNormalMatrix(e),this.setXYZ(n,Ma.x,Ma.y,Ma.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)Ma.fromBufferAttribute(this,n),Ma.transformDirection(e),this.setXYZ(n,Ma.x,Ma.y,Ma.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=wo(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=ti(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=wo(n,this.array)),n}setX(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=wo(n,this.array)),n}setY(e,n){return this.normalized&&(n=ti(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=wo(n,this.array)),n}setZ(e,n){return this.normalized&&(n=ti(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=wo(n,this.array)),n}setW(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(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=ti(n,this.array),i=ti(i,this.array),r=ti(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=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array),a=ti(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!==V1&&(e.usage=this.usage),e}}class Tbe extends In{constructor(e,n,i){super(new Int8Array(e),n,i)}}class Abe extends In{constructor(e,n,i){super(new Uint8Array(e),n,i)}}class Cbe extends In{constructor(e,n,i){super(new Uint8ClampedArray(e),n,i)}}class Rbe extends In{constructor(e,n,i){super(new Int16Array(e),n,i)}}class jP extends In{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class kbe extends In{constructor(e,n,i){super(new Int32Array(e),n,i)}}class HP extends In{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class zJ extends In{constructor(e,n,i){super(new Uint16Array(e),n,i),this.isFloat16BufferAttribute=!0}getX(e){let n=Mx(this.array[e*this.itemSize]);return this.normalized&&(n=wo(n,this.array)),n}setX(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize]=No(n),this}getY(e){let n=Mx(this.array[e*this.itemSize+1]);return this.normalized&&(n=wo(n,this.array)),n}setY(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+1]=No(n),this}getZ(e){let n=Mx(this.array[e*this.itemSize+2]);return this.normalized&&(n=wo(n,this.array)),n}setZ(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+2]=No(n),this}getW(e){let n=Mx(this.array[e*this.itemSize+3]);return this.normalized&&(n=wo(n,this.array)),n}setW(e,n){return this.normalized&&(n=ti(n,this.array)),this.array[e*this.itemSize+3]=No(n),this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array)),this.array[e+0]=No(n),this.array[e+1]=No(i),this}setXYZ(e,n,i,r){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array)),this.array[e+0]=No(n),this.array[e+1]=No(i),this.array[e+2]=No(r),this}setXYZW(e,n,i,r,a){return e*=this.itemSize,this.normalized&&(n=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array),a=ti(a,this.array)),this.array[e+0]=No(n),this.array[e+1]=No(i),this.array[e+2]=No(r),this.array[e+3]=No(a),this}}class mn extends In{constructor(e,n,i){super(new Float32Array(e),n,i)}}let Dbe=0;const Xl=new Dt,vk=new Pi,ab=new te,ul=new rr,zy=new rr,Za=new te;class On extends vf{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Dbe++}),this.uuid=El(),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(PJ(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 $n().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 Xl.makeRotationFromQuaternion(e),this.applyMatrix4(Xl),this}rotateX(e){return Xl.makeRotationX(e),this.applyMatrix4(Xl),this}rotateY(e){return Xl.makeRotationY(e),this.applyMatrix4(Xl),this}rotateZ(e){return Xl.makeRotationZ(e),this.applyMatrix4(Xl),this}translate(e,n,i){return Xl.makeTranslation(e,n,i),this.applyMatrix4(Xl),this}scale(e,n,i){return Xl.makeScale(e,n,i),this.applyMatrix4(Xl),this}lookAt(e){return vk.lookAt(e),vk.updateMatrix(),this.applyMatrix4(vk.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ab).negate(),this.translate(ab.x,ab.y,ab.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 mn(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];ul.setFromBufferAttribute(a),this.morphTargetsRelative?(Za.addVectors(this.boundingBox.min,ul.min),this.boundingBox.expandByPoint(Za),Za.addVectors(this.boundingBox.max,ul.max),this.boundingBox.expandByPoint(Za)):(this.boundingBox.expandByPoint(ul.min),this.boundingBox.expandByPoint(ul.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 Ur);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(ul.setFromBufferAttribute(e),n)for(let a=0,s=n.length;a<s;a++){const o=n[a];zy.setFromBufferAttribute(o),this.morphTargetsRelative?(Za.addVectors(ul.min,zy.min),ul.expandByPoint(Za),Za.addVectors(ul.max,zy.max),ul.expandByPoint(Za)):(ul.expandByPoint(zy.min),ul.expandByPoint(zy.max))}ul.getCenter(i);let r=0;for(let a=0,s=e.count;a<s;a++)Za.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(Za));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++)Za.fromBufferAttribute(o,c),l&&(ab.fromBufferAttribute(e,c),Za.add(ab)),r=Math.max(r,i.distanceToSquared(Za))}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 In(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 m(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 L=1/(d.x*g.y-g.x*d.y);isFinite(L)&&(b.copy(u).multiplyScalar(g.y).addScaledVector(f,-d.y).multiplyScalar(L),y.copy(f).multiplyScalar(d.x).addScaledVector(u,-g.x).multiplyScalar(L),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],L=R.start,U=R.count;for(let j=L,z=L+U;j<z;j+=3)m(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 L=w.dot(l[C])<0?-1:1;s.setXYZW(C,_.x,_.y,_.z,L)}for(let C=0,D=x.length;C<D;++C){const R=x[C],L=R.start,U=R.count;for(let j=L,z=L+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 In(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++)Za.fromBufferAttribute(e,n),Za.normalize(),e.setXYZ(n,Za.x,Za.y,Za.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 m=0;m<u;m++)h[g++]=c[d++]}return new In(h,u,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new On,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 Dt,Mp=new yf,mw=new Ur,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 Si extends Pi{constructor(e=new On,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),Mp.copy(e.ray).recast(e.near),!(mw.containsPoint(Mp.origin)===!1&&(Mp.intersectSphere(mw,Gz)===null||Mp.origin.distanceToSquared(Gz)>(e.far-e.near)**2))&&(Vz.copy(a).invert(),Mp.copy(e.ray).applyMatrix4(Vz),!(i.boundingBox!==null&&Mp.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Mp)))}_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],m=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,m,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,m=b;y<m;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],m=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,m,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,m=b;y<m;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 Obe(t,e,n,i,r,a,s,o){let l;if(e.side===Da?l=i.intersectTriangle(s,a,r,!0,o):l=i.intersectTriangle(r,a,s,e.side===_u,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=Obe(t,e,n,i,gw,bw,vw,Wz);if(u){const f=new te;Bo.getBarycoord(Wz,gw,bw,vw,f),r&&(u.uv=Bo.getInterpolatedAttribute(r,o,l,c,f,new wt)),a&&(u.uv1=Bo.getInterpolatedAttribute(a,o,l,c,f,new wt)),s&&(u.normal=Bo.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};Bo.getNormal(gw,bw,vw,h.normal),u.face=h,u.barycoord=f}return u}class $d extends On{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 mn(c,3)),this.setAttribute("normal",new mn(u,3)),this.setAttribute("uv",new mn(f,2));function g(b,y,m,x,_,w,M,S,A,C,D){const R=w/A,L=M/C,U=w/2,j=M/2,z=S/2,q=A+1,F=C+1;let V=0,H=0;const W=new te;for(let B=0;B<F;B++){const J=B*L-j;for(let Z=0;Z<q;Z++){const G=Z*R-U;W[b]=G*x,W[y]=J*_,W[m]=z,c.push(W.x,W.y,W.z),W[b]=0,W[y]=0,W[m]=S>0?1:-1,u.push(W.x,W.y,W.z),f.push(Z/A),f.push(1-B/C),V+=1}}for(let B=0;B<C;B++)for(let J=0;J<A;J++){const Z=h+J+q*B,G=h+J+q*(B+1),de=h+(J+1)+q*(B+1),oe=h+(J+1)+q*B;l.push(Z,G,oe),l.push(G,de,oe),H+=6}o.addGroup(d,H,D),d+=H,h+=V}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $d(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function ov(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 vo(t){const e={};for(let n=0;n<t.length;n++){const i=ov(t[n]);for(const r in i)e[r]=i[r]}return e}function Ibe(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function jJ(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:bi.workingColorSpace}const lv={clone:ov,merge:vo};var Nbe=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,Lbe=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class cs extends Oa{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Nbe,this.fragmentShader=Lbe,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=ov(e.uniforms),this.uniformsGroups=Ibe(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 Pi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Dt,this.projectionMatrix=new Dt,this.projectionMatrixInverse=new Dt,this.coordinateSystem=vl,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 $h=new te,qz=new wt,Xz=new wt;class ra 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=av*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Dm*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return av*2*Math.atan(Math.tan(Dm*.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){$h.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set($h.x,$h.y).multiplyScalar(-e/$h.z),$h.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set($h.x,$h.y).multiplyScalar(-e/$h.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(Dm*.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 sb=-90,ob=1;class HJ extends Pi{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new ra(sb,ob,e,n);r.layers=this.layers,this.add(r);const a=new ra(sb,ob,e,n);a.layers=this.layers,this.add(a);const s=new ra(sb,ob,e,n);s.layers=this.layers,this.add(s);const o=new ra(sb,ob,e,n);o.layers=this.layers,this.add(o);const l=new ra(sb,ob,e,n);l.layers=this.layers,this.add(l);const c=new ra(sb,ob,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===vl)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===rv)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 F_ extends nr{constructor(e=[],n=ff,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 Cc{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 F_(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 $d(5,5,5),a=new cs({name:"CubemapFromEquirect",uniforms:ov(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Da,blending:rf});a.uniforms.tEquirect.value=n;const s=new Si(r,a),o=n.minFilter;return n.minFilter===vc&&(n.minFilter=Vi),new HJ(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 yl extends Pi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Pbe={type:"move"};class hM{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new yl,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 yl,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 yl,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),m=this._getHandJoint(c,b);y!==null&&(m.matrix.fromArray(y.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=y.radius),m.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(Pbe)))}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 yl;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 Wv extends Pi{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 vi,this.environmentIntensity=1,this.environmentRotation=new vi,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 B_{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=V1,this.updateRanges=[],this.version=0,this.uuid=El()}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=El()),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=El()),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 go=new te;class zo{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++)go.fromBufferAttribute(this,n),go.applyMatrix4(e),this.setXYZ(n,go.x,go.y,go.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)go.fromBufferAttribute(this,n),go.applyNormalMatrix(e),this.setXYZ(n,go.x,go.y,go.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)go.fromBufferAttribute(this,n),go.transformDirection(e),this.setXYZ(n,go.x,go.y,go.z);return this}getComponent(e,n){let i=this.array[e*this.data.stride+this.offset+n];return this.normalized&&(i=wo(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=ti(i,this.array)),this.data.array[e*this.data.stride+this.offset+n]=i,this}setX(e,n){return this.normalized&&(n=ti(n,this.array)),this.data.array[e*this.data.stride+this.offset]=n,this}setY(e,n){return this.normalized&&(n=ti(n,this.array)),this.data.array[e*this.data.stride+this.offset+1]=n,this}setZ(e,n){return this.normalized&&(n=ti(n,this.array)),this.data.array[e*this.data.stride+this.offset+2]=n,this}setW(e,n){return this.normalized&&(n=ti(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=wo(n,this.array)),n}getY(e){let n=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(n=wo(n,this.array)),n}getZ(e){let n=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(n=wo(n,this.array)),n}getW(e){let n=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(n=wo(n,this.array)),n}setXY(e,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(n=ti(n,this.array),i=ti(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=ti(n,this.array),i=ti(i,this.array),r=ti(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=ti(n,this.array),i=ti(i,this.array),r=ti(r,this.array),a=ti(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 In(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 zo(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 Oa{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 lb;const jy=new te,cb=new te,ub=new te,fb=new wt,Hy=new wt,VJ=new Dt,Sw=new te,Vy=new te,ww=new te,Kz=new wt,xk=new wt,Yz=new wt;class GJ extends Pi{constructor(e=new GP){if(super(),this.isSprite=!0,this.type="Sprite",lb===void 0){lb=new On;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 B_(n,5);lb.setIndex([0,1,2,0,2,3]),lb.setAttribute("position",new zo(i,3,0,!1)),lb.setAttribute("uv",new zo(i,2,3,!1))}this.geometry=lb,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.'),cb.setFromMatrixScale(this.matrixWorld),VJ.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ub.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&cb.multiplyScalar(-ub.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),ub,s,cb,r,a),Ew(Vy.set(.5,-.5,0),ub,s,cb,r,a),Ew(ww.set(.5,.5,0),ub,s,cb,r,a),Kz.set(0,0),xk.set(1,0),Yz.set(1,1);let o=e.ray.intersectTriangle(Sw,Vy,ww,!1,jy);if(o===null&&(Ew(Vy.set(-.5,.5,0),ub,s,cb,r,a),xk.set(0,1),o=e.ray.intersectTriangle(Sw,ww,Vy,!1,jy),o===null))return;const l=e.ray.origin.distanceTo(jy);l<e.near||l>e.far||n.push({distance:l,point:jy.clone(),uv:Bo.getInterpolation(jy,Sw,Vy,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){fb.subVectors(t,n).addScalar(.5).multiply(i),r!==void 0?(Hy.x=a*fb.x-r*fb.y,Hy.y=r*fb.x+a*fb.y):Hy.copy(fb),t.copy(e),t.x+=Hy.x,t.y+=Hy.y,t.applyMatrix4(VJ)}const Mw=new te,Jz=new te;class WJ extends Pi{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 ni,Qz=new ni,Ube=new te,ej=new Dt,Tw=new te,_k=new Ur,tj=new Dt,Sk=new yf;let XA=class extends Si{constructor(e,n){super(e,n),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=B1,this.bindMatrix=new Dt,this.bindMatrixInverse=new Dt,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 Ur),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 ni,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===B1?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(Ube.copy($z).applyMatrix4(ej),s)}}return n.applyMatrix4(this.bindMatrixInverse)}};class z_ extends Pi{constructor(){super(),this.isBone=!0,this.type="Bone"}}class os extends nr{constructor(e=null,n=1,i=1,r,a,s,o,l,c=ss,u=ss,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 Dt,Fbe=new Dt;class qv{constructor(e=[],n=[]){this.uuid=El(),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 Dt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,n=this.bones.length;e<n;e++){const i=new Dt;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:Fbe;nj.multiplyMatrices(o,n[a]),nj.toArray(i,a*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new qv(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 os(n,e,e,Qr,wr);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 z_),this.bones.push(s),this.boneInverses.push(new Dt().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 hf extends In{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 hb=new Dt,ij=new Dt,Aw=[],rj=new rr,Bbe=new Dt,Gy=new Si,Wy=new Ur;class KA extends Si{constructor(e,n,i){super(e,n),this.isInstancedMesh=!0,this.instanceMatrix=new hf(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,Bbe)}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,hb),rj.copy(e.boundingBox).applyMatrix4(hb),this.boundingBox.union(rj)}computeBoundingSphere(){const e=this.geometry,n=this.count;this.boundingSphere===null&&(this.boundingSphere=new Ur),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<n;i++)this.getMatrixAt(i,hb),Wy.copy(e.boundingSphere).applyMatrix4(hb),this.boundingSphere.union(Wy)}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(Gy.geometry=this.geometry,Gy.material=this.material,Gy.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Wy.copy(this.boundingSphere),Wy.applyMatrix4(i),e.ray.intersectsSphere(Wy)!==!1))for(let a=0;a<r;a++){this.getMatrixAt(a,hb),ij.multiplyMatrices(i,hb),Gy.matrixWorld=ij,Gy.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 hf(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 os(new Float32Array(r*this.count),r,this.count,Th,wr));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,zbe=new te,jbe=new $n;class nu{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(zbe.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||jbe.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 Tp=new Ur,Hbe=new wt(.5,.5),Cw=new te;class Zd{constructor(e=new nu,n=new nu,i=new nu,r=new nu,a=new nu,s=new nu){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=vl,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],m=a[11],x=a[12],_=a[13],w=a[14],M=a[15];if(r[0].setComponents(c-s,d-u,m-g,M-x).normalize(),r[1].setComponents(c+s,d+u,m+g,M+x).normalize(),r[2].setComponents(c+o,d+f,m+b,M+_).normalize(),r[3].setComponents(c-o,d-f,m-b,M-_).normalize(),i)r[4].setComponents(l,h,y,w).normalize(),r[5].setComponents(c-l,d-h,m-y,M-w).normalize();else if(r[4].setComponents(c-l,d-h,m-y,M-w).normalize(),n===vl)r[5].setComponents(c+l,d+h,m+y,M+w).normalize();else if(n===rv)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(),Tp.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Tp.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Tp)}intersectsSprite(e){Tp.center.set(0,0,0);const n=Hbe.distanceTo(e.center);return Tp.radius=.7071067811865476+n,Tp.applyMatrix4(e.matrixWorld),this.intersectsSphere(Tp)}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 Nu=new Dt,Lu=new Zd;class YA{constructor(){this.coordinateSystem=vl}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(Nu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Lu.setFromProjectionMatrix(Nu,r.coordinateSystem,r.reversedDepth),Lu.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(Nu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Lu.setFromProjectionMatrix(Nu,r.coordinateSystem,r.reversedDepth),Lu.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(Nu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Lu.setFromProjectionMatrix(Nu,r.coordinateSystem,r.reversedDepth),Lu.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(Nu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Lu.setFromProjectionMatrix(Nu,r.coordinateSystem,r.reversedDepth),Lu.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(Nu.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),Lu.setFromProjectionMatrix(Nu,r.coordinateSystem,r.reversedDepth),Lu.containsPoint(e))return!0}return!1}clone(){return new YA}}function Ek(t,e){return t-e}function Vbe(t,e){return t.z-e.z}function Gbe(t,e){return e.z-t.z}class Wbe{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 Oo=new Dt,qbe=new Ut(1,1,1),aj=new Zd,Xbe=new YA,Rw=new rr,Ap=new Ur,qy=new te,sj=new te,Kbe=new te,Mk=new Wbe,Qs=new Si,kw=[];function Ybe(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 Cp(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 qJ=class extends Si{constructor(e,n,i=n*2,r){super(new On,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 os(n,e,e,Qr,wr);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Uint32Array(e*e),i=new os(n,e,e,Vv,Ac);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 os(n,e,e,Qr,wr);i.colorSpace=bi.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 In(u,l,c);n.setAttribute(a,f)}if(e.getIndex()!==null){const a=i>65535?new Uint32Array(r):new Uint16Array(r);n.setIndex(new In(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,Oo),this.getBoundingBoxAt(a,Rw).applyMatrix4(Oo),e.union(Rw)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ur);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,Oo),this.getBoundingSphereAt(a,Ap).applyMatrix4(Oo),e.union(Ap)}}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;Oo.identity().toArray(a.image.data,r*16),a.needsUpdate=!0;const s=this._colorsTexture;return s&&(qbe.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);Ybe(f,h,l);const d=f.itemSize;for(let g=f.count,b=c;g<b;g++){const y=l+g;for(let m=0;m<d;m++)h.setComponent(y,m,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(qy.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 Ur;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)),qy.fromBufferAttribute(o,f),l=Math.max(l,a.center.distanceToSquared(qy))}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);Cp(this._multiDrawCounts,r),Cp(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(),Cp(s.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),Cp(o.image.data,this._matricesTexture.image.data),l&&(l.dispose(),this._initColorsTexture(),Cp(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 On,this._initializeGeometry(a));const s=this.geometry;a.index&&Cp(a.index.array,s.index.array);for(const o in a.attributes)Cp(a.attributes[o].array,s.attributes[o].array)}raycast(e,n){const i=this._instanceInfo,r=this._geometryInfo,a=this.matrixWorld,s=this.geometry;Qs.material=this.material,Qs.geometry.index=s.index,Qs.geometry.attributes=s.attributes,Qs.geometry.boundingBox===null&&(Qs.geometry.boundingBox=new rr),Qs.geometry.boundingSphere===null&&(Qs.geometry.boundingSphere=new Ur);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];Qs.geometry.setDrawRange(u.start,u.count),this.getMatrixAt(o,Qs.matrixWorld).premultiply(a),this.getBoundingBoxAt(c,Qs.geometry.boundingBox),this.getBoundingSphereAt(c,Qs.geometry.boundingSphere),Qs.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}Qs.material=null,Qs.geometry.index=null,Qs.geometry.attributes={},Qs.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?Xbe:aj;h&&!i.isArrayCamera&&(Oo.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),aj.setFromProjectionMatrix(Oo,i.coordinateSystem,i.reversedDepth));let y=0;if(this.sortObjects){Oo.copy(this.matrixWorld).invert(),qy.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Oo),sj.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Oo);for(let _=0,w=l.length;_<w;_++)if(l[_].visible&&l[_].active){const M=l[_].geometryIndex;this.getMatrixAt(_,Oo),this.getBoundingSphereAt(M,Ap).applyMatrix4(Oo);let S=!1;if(h&&(S=!b.intersectsSphere(Ap,i)),!S){const A=f[M],C=Kbe.subVectors(Ap.center,qy).dot(sj);Mk.push(A.start,A.count,C,_)}}const m=Mk.list,x=this.customSort;x===null?m.sort(a.transparent?Gbe:Vbe):x.call(this,m,i);for(let _=0,w=m.length;_<w;_++){const M=m[_];c[y]=M.start*o,u[y]=M.count,g[y]=M.index,y++}Mk.reset()}else for(let m=0,x=l.length;m<x;m++)if(l[m].visible&&l[m].active){const _=l[m].geometryIndex;let w=!1;if(h&&(this.getMatrixAt(m,Oo),this.getBoundingSphereAt(_,Ap).applyMatrix4(Oo),w=!b.intersectsSphere(Ap,i)),!w){const M=f[_];c[y]=M.start*o,u[y]=M.count,g[y]=m,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 Oa{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 Dt,Xy=new yf,Dw=new Ur,Tk=new te,lj=new te;let yh=class extends Pi{constructor(e=new On,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 mn(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(),Xy.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 m=u.getX(b),x=u.getX(b+1),_=Ow(this,e,Xy,l,m,x,b);_&&n.push(_)}if(this.isLineLoop){const b=u.getX(g-1),y=u.getX(d),m=Ow(this,e,Xy,l,b,y,g-1);m&&n.push(m)}}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 m=Ow(this,e,Xy,l,b,b+1,b);m&&n.push(m)}if(this.isLineLoop){const b=Ow(this,e,Xy,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 Lc=class extends yh{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 mn(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}};class WP extends yh{constructor(e,n){super(e,n),this.isLineLoop=!0,this.type="LineLoop"}}class JA extends Oa{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 Dt,JO=new yf,Iw=new Ur,Nw=new te;class qP extends Pi{constructor(e=new On,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 XJ extends nr{constructor(e,n,i,r,a=Vi,s=Vi,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 Jbe extends XJ{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 $be extends nr{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=ss,this.minFilter=ss,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 Zbe extends $A{constructor(e,n,i,r,a,s){super(e,n,i,a,s),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=xa,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Qbe extends $A{constructor(e,n,i){super(void 0,e[0].width,e[0].height,n,i,ff),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class e0e 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=Ac,r,a,s,o=ss,l=ss,c,u=ev,f=1){if(u!==ev&&u!==tv)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 Ed(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 On{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,m=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,L=R*Math.PI*2,U=Math.sin(L),j=Math.cos(L);m.x=-M*j,m.y=w,m.z=M*U,o.push(m.x,m.y,m.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 L=D+R,U=D+R+1,j=x*b+R,z=x*b+R+1;s.push(L,U,j),s.push(U,z,j)}}}this.setIndex(s),this.setAttribute("position",new mn(o,3)),this.setAttribute("normal",new mn(l,3)),this.setAttribute("uv",new mn(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 On{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 mn(s,3)),this.setAttribute("normal",new mn(o,3)),this.setAttribute("uv",new mn(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 Wm extends On{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 m=0;x(),s===!1&&(e>0&&_(!0),n>0&&_(!1)),this.setIndex(u),this.setAttribute("position",new mn(f,3)),this.setAttribute("normal",new mn(h,3)),this.setAttribute("uv",new mn(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,L=R*(n-e)+e;for(let U=0;U<=r;U++){const j=U/r,z=j*l+o,q=Math.sin(z),F=Math.cos(z);M.x=L*q,M.y=-R*i+y,M.z=L*F,f.push(M.x,M.y,M.z),w.set(q,A,F).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],L=b[D+1][C],U=b[D+1][C+1],j=b[D][C+1];(e>0||D!==0)&&(u.push(R,L,j),S+=3),(n>0||D!==a-1)&&(u.push(L,U,j),S+=3)}c.addGroup(m,S,0),m+=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 L=g;for(let U=0;U<=r;U++){const z=U/r*l+o,q=Math.cos(z),F=Math.sin(z);A.x=D*F,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=F*.5*R+.5,d.push(S.x,S.y),g++}for(let U=0;U<r;U++){const j=M+U,z=L+U;w===!0?u.push(z,z+1,j):u.push(z+1,z,j),C+=3}c.addGroup(m,C,w===!0?1:2),m+=C}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Wm(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class j_ extends Wm{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 j_(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Qd extends On{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 mn(a,3)),this.setAttribute("normal",new mn(a.slice(),3)),this.setAttribute("uv",new mn(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),L=S-C;for(let U=0;U<=L;U++)U===0&&C===S?A[C][U]=D:A[C][U]=D.clone().lerp(R,U/L)}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=m(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 L=y(M);b(S,R+0,x,L),b(A,R+2,_,L),b(C,R+4,w,L)}}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 m(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 Qd(e.vertices,e.indices,e.radius,e.details)}}class eC extends Qd{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 Bo;class KJ extends On{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(Dm*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:m}=Uw;if(b.fromBufferAttribute(o,c[0]),y.fromBufferAttribute(o,c[1]),m.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(m.x*r)},${Math.round(m.y*r)},${Math.round(m.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 mn(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Tu{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 Dt;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(Pn(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(Pn(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 Tu{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 YJ 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 Tu{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 t0e(t,e){const n=1-t;return n*n*e}function n0e(t,e){return 2*(1-t)*t*e}function i0e(t,e){return t*t*e}function r1(t,e,n,i){return t0e(t,e)+n0e(t,n)+i0e(t,i)}function r0e(t,e){const n=1-t;return n*n*n*e}function a0e(t,e){const n=1-t;return 3*n*n*t*e}function s0e(t,e){return 3*(1-t)*t*t*e}function o0e(t,e){return t*t*t*e}function a1(t,e,n,i,r){return r0e(t,e)+a0e(t,n)+s0e(t,i)+o0e(t,r)}class JP extends Tu{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(a1(e,r.x,a.x,s.x,o.x),a1(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 Tu{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(a1(e,r.x,a.x,s.x,o.x),a1(e,r.y,a.y,s.y,o.y),a1(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 Tu{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 JJ extends Tu{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 Tu{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(r1(e,r.x,a.x,s.x),r1(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 Tu{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(r1(e,r.x,a.x,s.x),r1(e,r.y,a.y,s.y),r1(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 Tu{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:YJ,CatmullRomCurve3:YP,CubicBezierCurve:JP,CubicBezierCurve3:$P,EllipseCurve:tC,LineCurve:ZP,LineCurve3:JJ,QuadraticBezierCurve:QP,QuadraticBezierCurve3:eU,SplineCurve:tU});class $J extends Tu{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 $J{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 Om extends Q2{constructor(e){super(e),this.uuid=El(),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 l0e(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let a=ZJ(t,0,r,n,!0);const s=[];if(!a||a.next===a.prev)return s;let o,l,c;if(i&&(a=d0e(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 q1(a,s,n,o,l,c,0),s}function ZJ(t,e,n,i,r){let a;if(r===E0e(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&&cv(a,a.next)&&(K1(a),a=a.next),a}function qm(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(cv(n,n.next)||aa(n.prev,n,n.next)===0)){if(K1(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function q1(t,e,n,i,r,a,s){if(!t)return;!s&&a&&v0e(t,i,r,a);let o=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(a?u0e(t,i,r,a):c0e(t)){e.push(l.i,t.i,c.i),K1(t),t=c.next,o=c.next;continue}if(t=c,t===o){s?s===1?(t=f0e(qm(t),e),q1(t,e,n,i,r,a,2)):s===2&&h0e(t,e,n,i,r,a):q1(qm(t),e,n,i,r,a,1);break}}}function c0e(t){const e=t.prev,n=t,i=t.next;if(aa(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&&Tx(r,o,a,l,s,c,g.x,g.y)&&aa(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function u0e(t,e,n,i){const r=t.prev,a=t,s=t.next;if(aa(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),m=$O(d,g,e,n,i),x=$O(b,y,e,n,i);let _=t.prevZ,w=t.nextZ;for(;_&&_.z>=m&&w&&w.z<=x;){if(_.x>=d&&_.x<=b&&_.y>=g&&_.y<=y&&_!==r&&_!==s&&Tx(o,u,l,f,c,h,_.x,_.y)&&aa(_.prev,_,_.next)>=0||(_=_.prevZ,w.x>=d&&w.x<=b&&w.y>=g&&w.y<=y&&w!==r&&w!==s&&Tx(o,u,l,f,c,h,w.x,w.y)&&aa(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;_&&_.z>=m;){if(_.x>=d&&_.x<=b&&_.y>=g&&_.y<=y&&_!==r&&_!==s&&Tx(o,u,l,f,c,h,_.x,_.y)&&aa(_.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&&Tx(o,u,l,f,c,h,w.x,w.y)&&aa(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function f0e(t,e){let n=t;do{const i=n.prev,r=n.next.next;!cv(i,r)&&e$(i,n,n.next,r)&&X1(i,r)&&X1(r,i)&&(e.push(i.i,n.i,r.i),K1(n),K1(n.next),n=t=r),n=n.next}while(n!==t);return qm(n)}function h0e(t,e,n,i,r,a){let s=t;do{let o=s.next.next;for(;o!==s.prev;){if(s.i!==o.i&&_0e(s,o)){let l=t$(s,o);s=qm(s,s.next),l=qm(l,l.next),q1(s,e,n,i,r,a,0),q1(l,e,n,i,r,a,0);return}o=o.next}s=s.next}while(s!==t)}function d0e(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=ZJ(t,o,l,i,!1);c===c.next&&(c.steiner=!0),r.push(x0e(c))}r.sort(p0e);for(let a=0;a<r.length;a++)n=m0e(r[a],n);return n}function p0e(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 m0e(t,e){const n=g0e(t,e);if(!n)return e;const i=t$(n,t);return qm(i,i.next),qm(n,n.next)}function g0e(t,e){let n=e;const i=t.x,r=t.y;let a=-1/0,s;if(cv(t,n))return n;do{if(cv(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&&QJ(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);X1(n,t)&&(f<u||f===u&&(n.x>s.x||n.x===s.x&&b0e(s,n)))&&(s=n,u=f)}n=n.next}while(n!==o);return s}function b0e(t,e){return aa(t.prev,t,e.prev)<0&&aa(e.next,t,t.next)<0}function v0e(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,y0e(r)}function y0e(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 x0e(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 QJ(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 Tx(t,e,n,i,r,a,s,o){return!(t===s&&e===o)&&QJ(t,e,n,i,r,a,s,o)}function _0e(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!S0e(t,e)&&(X1(t,e)&&X1(e,t)&&w0e(t,e)&&(aa(t.prev,t,e.prev)||aa(t,e.prev,e))||cv(t,e)&&aa(t.prev,t,t.next)>0&&aa(e.prev,e,e.next)>0)}function aa(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function cv(t,e){return t.x===e.x&&t.y===e.y}function e$(t,e,n,i){const r=zw(aa(t,e,n)),a=zw(aa(t,e,i)),s=zw(aa(n,i,t)),o=zw(aa(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 S0e(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&&e$(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function X1(t,e){return aa(t.prev,t,t.next)<0?aa(t,e,t.next)>=0&&aa(t,t.prev,e)>=0:aa(t,e,t.prev)<0||aa(t,t.next,e)<0}function w0e(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 t$(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 K1(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 E0e(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 M0e{static triangulate(e,n,i=2){return l0e(e,n,i)}}class du{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 du.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=M0e.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 On{constructor(e=new Om([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 mn(r,3)),this.setAttribute("uv",new mn(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 m=n.extrudePath,x=n.UVGenerator!==void 0?n.UVGenerator:T0e;let _,w=!1,M,S,A,C;m&&(_=m.getSpacedPoints(u),w=!0,h=!1,M=m.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 L=D.holes;if(!du.isClockWise(R)){R=R.reverse();for(let ze=0,Ie=L.length;ze<Ie;ze++){const qe=L[ze];du.isClockWise(qe)&&(L[ze]=qe.reverse())}}function j(ze){const qe=10000000000000001e-36;let we=ze[0];for(let Me=1;Me<=ze.length;Me++){const Ae=Me%ze.length,Ne=ze[Ae],Ue=Ne.x-we.x,Qe=Ne.y-we.y,ae=Ue*Ue+Qe*Qe,K=Math.max(Math.abs(Ne.x),Math.abs(Ne.y),Math.abs(we.x),Math.abs(we.y)),ce=qe*K*K;if(ae<=ce){ze.splice(Ae,1),Me--;continue}we=Ne}}j(R),L.forEach(j);const z=L.length,q=R;for(let ze=0;ze<z;ze++){const Ie=L[ze];R=R.concat(Ie)}function F(ze,Ie,qe){return Ie||console.error("THREE.ExtrudeGeometry: vec does not exist"),ze.clone().addScaledVector(Ie,qe)}const V=R.length;function H(ze,Ie,qe){let we,Me,Ae;const Ne=ze.x-Ie.x,Ue=ze.y-Ie.y,Qe=qe.x-ze.x,ae=qe.y-ze.y,K=Ne*Ne+Ue*Ue,ce=Ne*ae-Ue*Qe;if(Math.abs(ce)>Number.EPSILON){const he=Math.sqrt(K),me=Math.sqrt(Qe*Qe+ae*ae),$=Ie.x-Ue/he,Ve=Ie.y+Ne/he,Xe=qe.x-ae/me,mt=qe.y+Qe/me,Ge=((Xe-$)*ae-(mt-Ve)*Qe)/(Ne*ae-Ue*Qe);we=$+Ne*Ge-ze.x,Me=Ve+Ue*Ge-ze.y;const Je=we*we+Me*Me;if(Je<=2)return new wt(we,Me);Ae=Math.sqrt(Je/2)}else{let he=!1;Ne>Number.EPSILON?Qe>Number.EPSILON&&(he=!0):Ne<-Number.EPSILON?Qe<-Number.EPSILON&&(he=!0):Math.sign(Ue)===Math.sign(ae)&&(he=!0),he?(we=-Ue,Me=Ne,Ae=Math.sqrt(K)):(we=Ne,Me=Ue,Ae=Math.sqrt(K/2))}return new wt(we/Ae,Me/Ae)}const W=[];for(let ze=0,Ie=q.length,qe=Ie-1,we=ze+1;ze<Ie;ze++,qe++,we++)qe===Ie&&(qe=0),we===Ie&&(we=0),W[ze]=H(q[ze],q[qe],q[we]);const B=[];let J,Z=W.concat();for(let ze=0,Ie=z;ze<Ie;ze++){const qe=L[ze];J=[];for(let we=0,Me=qe.length,Ae=Me-1,Ne=we+1;we<Me;we++,Ae++,Ne++)Ae===Me&&(Ae=0),Ne===Me&&(Ne=0),J[we]=H(qe[we],qe[Ae],qe[Ne]);B.push(J),Z=Z.concat(J)}let G;if(y===0)G=du.triangulateShape(q,L);else{const ze=[],Ie=[];for(let qe=0;qe<y;qe++){const we=qe/y,Me=d*Math.cos(we*Math.PI/2),Ae=g*Math.sin(we*Math.PI/2)+b;for(let Ne=0,Ue=q.length;Ne<Ue;Ne++){const Qe=F(q[Ne],W[Ne],Ae);Oe(Qe.x,Qe.y,-Me),we===0&&ze.push(Qe)}for(let Ne=0,Ue=z;Ne<Ue;Ne++){const Qe=L[Ne];J=B[Ne];const ae=[];for(let K=0,ce=Qe.length;K<ce;K++){const he=F(Qe[K],J[K],Ae);Oe(he.x,he.y,-Me),we===0&&ae.push(he)}we===0&&Ie.push(ae)}}G=du.triangulateShape(ze,Ie)}const de=G.length,oe=g+b;for(let ze=0;ze<V;ze++){const Ie=h?F(R[ze],Z[ze],oe):R[ze];w?(A.copy(M.normals[0]).multiplyScalar(Ie.x),S.copy(M.binormals[0]).multiplyScalar(Ie.y),C.copy(_[0]).add(A).add(S),Oe(C.x,C.y,C.z)):Oe(Ie.x,Ie.y,0)}for(let ze=1;ze<=u;ze++)for(let Ie=0;Ie<V;Ie++){const qe=h?F(R[Ie],Z[Ie],oe):R[Ie];w?(A.copy(M.normals[ze]).multiplyScalar(qe.x),S.copy(M.binormals[ze]).multiplyScalar(qe.y),C.copy(_[ze]).add(A).add(S),Oe(C.x,C.y,C.z)):Oe(qe.x,qe.y,f/u*ze)}for(let ze=y-1;ze>=0;ze--){const Ie=ze/y,qe=d*Math.cos(Ie*Math.PI/2),we=g*Math.sin(Ie*Math.PI/2)+b;for(let Me=0,Ae=q.length;Me<Ae;Me++){const Ne=F(q[Me],W[Me],we);Oe(Ne.x,Ne.y,f+qe)}for(let Me=0,Ae=L.length;Me<Ae;Me++){const Ne=L[Me];J=B[Me];for(let Ue=0,Qe=Ne.length;Ue<Qe;Ue++){const ae=F(Ne[Ue],J[Ue],we);w?Oe(ae.x,ae.y+_[u-1].y,_[u-1].x+qe):Oe(ae.x,ae.y,f+qe)}}}le(),ue();function le(){const ze=r.length/3;if(h){let Ie=0,qe=V*Ie;for(let we=0;we<de;we++){const Me=G[we];Be(Me[2]+qe,Me[1]+qe,Me[0]+qe)}Ie=u+y*2,qe=V*Ie;for(let we=0;we<de;we++){const Me=G[we];Be(Me[0]+qe,Me[1]+qe,Me[2]+qe)}}else{for(let Ie=0;Ie<de;Ie++){const qe=G[Ie];Be(qe[2],qe[1],qe[0])}for(let Ie=0;Ie<de;Ie++){const qe=G[Ie];Be(qe[0]+V*u,qe[1]+V*u,qe[2]+V*u)}}i.addGroup(ze,r.length/3-ze,0)}function ue(){const ze=r.length/3;let Ie=0;Se(q,Ie),Ie+=q.length;for(let qe=0,we=L.length;qe<we;qe++){const Me=L[qe];Se(Me,Ie),Ie+=Me.length}i.addGroup(ze,r.length/3-ze,1)}function Se(ze,Ie){let qe=ze.length;for(;--qe>=0;){const we=qe;let Me=qe-1;Me<0&&(Me=ze.length-1);for(let Ae=0,Ne=u+y*2;Ae<Ne;Ae++){const Ue=V*Ae,Qe=V*(Ae+1),ae=Ie+we+Ue,K=Ie+Me+Ue,ce=Ie+Me+Qe,he=Ie+we+Qe;je(ae,K,ce,he)}}}function Oe(ze,Ie,qe){l.push(ze),l.push(Ie),l.push(qe)}function Be(ze,Ie,qe){He(ze),He(Ie),He(qe);const we=r.length/3,Me=x.generateTopUV(i,r,we-3,we-2,we-1);pe(Me[0]),pe(Me[1]),pe(Me[2])}function je(ze,Ie,qe,we){He(ze),He(Ie),He(we),He(Ie),He(qe),He(we);const Me=r.length/3,Ae=x.generateSideWallUV(i,r,Me-6,Me-3,Me-2,Me-1);pe(Ae[0]),pe(Ae[1]),pe(Ae[3]),pe(Ae[1]),pe(Ae[2]),pe(Ae[3])}function He(ze){r.push(l[ze*3+0]),r.push(l[ze*3+1]),r.push(l[ze*3+2])}function pe(ze){a.push(ze.x),a.push(ze.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 A0e(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 T0e={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],m=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-m)]:[new wt(o,1-l),new wt(u,1-f),new wt(d,1-g),new wt(y,1-m)]}};function A0e(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 Xv extends Qd{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 Xv(e.radius,e.detail)}}class iC extends On{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=Pn(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,m=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:y=e[x+1].x-e[x].x,m=e[x+1].y-e[x].y,d.x=m*1,d.y=-y,d.z=m*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,m=e[x+1].y-e[x].y,d.x=m*1,d.y=-y,d.z=m*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 mn(s,3)),this.setAttribute("uv",new mn(o,2)),this.setAttribute("normal",new mn(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 H_ extends Qd{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 H_(e.radius,e.detail)}}class Il extends On{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 m=0;m<u;m++){const x=m*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-m/l)}}for(let m=0;m<l;m++)for(let x=0;x<o;x++){const _=x+c*m,w=x+c*(m+1),M=x+1+c*(m+1),S=x+1+c*m;d.push(_,w,S),d.push(w,M,S)}this.setIndex(d),this.setAttribute("position",new mn(g,3)),this.setAttribute("normal",new mn(b,3)),this.setAttribute("uv",new mn(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Il(e.width,e.height,e.widthSegments,e.heightSegments)}}class rC extends On{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 m=a+y/i*s;d.x=f*Math.cos(m),d.y=f*Math.sin(m),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 m=0;m<i;m++){const x=m+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 mn(l,3)),this.setAttribute("normal",new mn(c,3)),this.setAttribute("uv",new mn(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 On{constructor(e=new Om([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 mn(r,3)),this.setAttribute("normal",new mn(a,3)),this.setAttribute("uv",new mn(s,2));function c(u){const f=r.length/3,h=u.extractPoints(n);let d=h.shape;const g=h.holes;du.isClockWise(d)===!1&&(d=d.reverse());for(let y=0,m=g.length;y<m;y++){const x=g[y];du.isClockWise(x)===!0&&(g[y]=x.reverse())}const b=du.triangulateShape(d,g);for(let y=0,m=g.length;y<m;y++){const x=g[y];d=d.concat(x)}for(let y=0,m=d.length;y<m;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,m=b.length;y<m;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 C0e(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 C0e(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 Kv extends On{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 m=0;m<=i;m++){const x=[],_=m/i;let w=0;m===0&&s===0?w=.5/n:m===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 m=0;m<i;m++)for(let x=0;x<n;x++){const _=u[m][x+1],w=u[m][x],M=u[m+1][x],S=u[m+1][x+1];(m!==0||s>0)&&d.push(_,w,S),(m!==i-1||l<Math.PI)&&d.push(w,M,S)}this.setIndex(d),this.setAttribute("position",new mn(g,3)),this.setAttribute("normal",new mn(b,3)),this.setAttribute("uv",new mn(y,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Kv(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class sC extends Qd{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 On{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,m=(r+1)*(d-1)+g,x=(r+1)*d+g;s.push(b,y,x),s.push(y,m,x)}this.setIndex(s),this.setAttribute("position",new mn(o,3)),this.setAttribute("normal",new mn(l,3)),this.setAttribute("uv",new mn(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 On{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,m=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),m.addVectors(g,d),b.crossVectors(y,m),m.crossVectors(b,y),b.normalize(),m.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*m.x+C*b.x),f.y=d.y+(A*m.y+C*b.y),f.z=d.z+(A*m.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 mn(l,3)),this.setAttribute("normal",new mn(c,3)),this.setAttribute("uv",new mn(u,2));function x(_,w,M,S,A){const C=Math.cos(_),D=Math.sin(_),R=M/w*_,L=Math.cos(R);A.x=S*(2+L)*.5*C,A.y=S*(2+L)*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 On{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 mn(f,3)),this.setAttribute("normal",new mn(h,3)),this.setAttribute("uv",new mn(d,2));function b(){for(let _=0;_<n;_++)y(_);y(a===!1?n:0),x(),m()}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 m(){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 On{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 m=o.getX(g+y),x=o.getX(g+(y+1)%3);r.fromBufferAttribute(s,m),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 mn(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:$d,CapsuleGeometry:ZA,CircleGeometry:QA,ConeGeometry:j_,CylinderGeometry:Wm,DodecahedronGeometry:eC,EdgesGeometry:KJ,ExtrudeGeometry:nC,IcosahedronGeometry:Xv,LatheGeometry:iC,OctahedronGeometry:H_,PlaneGeometry:Il,PolyhedronGeometry:Qd,RingGeometry:rC,ShapeGeometry:aC,SphereGeometry:Kv,TetrahedronGeometry:sC,TorusGeometry:oC,TorusKnotGeometry:lC,TubeGeometry:cC,WireframeGeometry:nU});class hg extends Oa{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 n$ extends cs{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Yv extends Oa{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=Jd,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 vi,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 Pc extends Yv{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 Pn(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 i$ extends Oa{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=Jd,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 vi,this.combine=P_,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 Oa{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=Jd,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 r$ extends Oa{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Jd,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 a$ extends Oa{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=Jd,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 vi,this.combine=P_,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 Oa{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=AJ,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 Oa{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 s$ extends Oa{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=Jd,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 o$ 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 hm(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function l$(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function c$(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 R0e(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=hm(f,c.times.constructor),c.values=hm(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 k0e(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(m){return m.name===o.name&&m.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 m=u,x=f-u;b=o.values.slice(m,x)}else if(a>=o.times[g]){const m=g*f+u,x=m+f-u;b=o.values.slice(m,x)}else{const m=o.createInterpolant(),x=u,_=f-u;m.evaluate(a),b=m.resultBuffer.slice(x,_)}l==="quaternion"&&new qn().fromArray(b).normalize().conjugate().toArray(b);const y=c.times.length;for(let m=0;m<y;++m){const x=m*d+h;if(l==="quaternion")qn.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 D0e{static convertArray(e,n){return hm(e,n)}static isTypedArray(e){return l$(e)}static getKeyframeOrder(e){return c$(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 R0e(e,n,i,r,a)}static makeClipAdditive(e,n=0,i=e,r=30){return k0e(e,n,i,r)}}class Jv{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 u$ extends Jv{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:cm,endingEnd:cm}}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 um:a=e,o=2*n-i;break;case j1: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 um:s=e,l=2*i-n;break;case j1: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,m=-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]=m*s[u+M]+x*s[c+M]+_*s[l+M]+w*s[f+M];return a}}class rU extends Jv{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 f$ extends Jv{constructor(e,n,i,r){super(e,n,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Uc{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=hm(n,this.TimeBufferType),this.values=hm(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:hm(e.times,Array),values:hm(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new f$(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new rU(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new u$(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let n;switch(e){case nv:n=this.InterpolantFactoryMethodDiscrete;break;case iv: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 nv;case this.InterpolantFactoryMethodLinear:return iv;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&&l$(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}}Uc.prototype.ValueTypeName="";Uc.prototype.TimeBufferType=Float32Array;Uc.prototype.ValueBufferType=Float32Array;Uc.prototype.DefaultInterpolation=iv;class dg extends Uc{constructor(e,n,i){super(e,n,i)}}dg.prototype.ValueTypeName="bool";dg.prototype.ValueBufferType=Array;dg.prototype.DefaultInterpolation=nv;dg.prototype.InterpolantFactoryMethodLinear=void 0;dg.prototype.InterpolantFactoryMethodSmooth=void 0;class aU extends Uc{constructor(e,n,i,r){super(e,n,i,r)}}aU.prototype.ValueTypeName="color";class Xm extends Uc{constructor(e,n,i,r){super(e,n,i,r)}}Xm.prototype.ValueTypeName="number";class h$ extends Jv{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)qn.slerpFlat(a,0,s,c-o,s,c,l);return a}}class Km extends Uc{constructor(e,n,i,r){super(e,n,i,r)}InterpolantFactoryMethodLinear(e){return new h$(this.times,this.values,this.getValueSize(),e)}}Km.prototype.ValueTypeName="quaternion";Km.prototype.InterpolantFactoryMethodSmooth=void 0;class pg extends Uc{constructor(e,n,i){super(e,n,i)}}pg.prototype.ValueTypeName="string";pg.prototype.ValueBufferType=Array;pg.prototype.DefaultInterpolation=nv;pg.prototype.InterpolantFactoryMethodLinear=void 0;pg.prototype.InterpolantFactoryMethodSmooth=void 0;class Ym extends Uc{constructor(e,n,i,r){super(e,n,i,r)}}Ym.prototype.ValueTypeName="vector";class uv{constructor(e="",n=-1,i=[],r=jA){this.name=e,this.tracks=i,this.duration=n,this.blendMode=r,this.uuid=El(),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(I0e(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(Uc.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=c$(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 Xm(".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=[],m=[];iU(d,y,m,g),y.length!==0&&b.push(new f(h,y,m))}},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=[],m=[];for(let x=0;x!==h[g].morphTargets.length;++x){const _=h[g];y.push(_.time),m.push(_.morphTarget===b?1:0)}r.push(new Xm(".morphTargetInfluence["+b+"]",y,m))}l=d.length*s}else{const d=".bones["+n[f].name+"]";i(Ym,d+".position",h,"pos",r),i(Km,d+".quaternion",h,"rot",r),i(Ym,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 O0e(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Xm;case"vector":case"vector2":case"vector3":case"vector4":return Ym;case"color":return aU;case"quaternion":return Km;case"bool":case"boolean":return dg;case"string":return pg}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function I0e(t){if(t.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=O0e(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 Yu={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 d$=new hC;class Fs{constructor(e){this.manager=e!==void 0?e:d$,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 Bf={};class N0e 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=Yu.get(`file:${e}`);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{n&&n(a),this.manager.itemEnd(e)},0),a;if(Bf[e]!==void 0){Bf[e].push({onLoad:n,onProgress:i,onError:r});return}Bf[e]=[],Bf[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=Bf[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(m){x();function x(){f.read().then(({done:_,value:w})=>{if(_)m.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)}m.enqueue(w),x()}},_=>{m.error(_)})}}});return new Response(y)}else throw new N0e(`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=>{Yu.add(`file:${e}`,c);const u=Bf[e];delete Bf[e];for(let f=0,h=u.length;f<h;f++){const d=u[f];d.onLoad&&d.onLoad(c)}}).catch(c=>{const u=Bf[e];if(u===void 0)throw this.manager.itemError(e),c;delete Bf[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 L0e 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=uv.parse(e[i]);n.push(r)}return n}}class P0e 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=Vi),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=Vi),o.format=h.format,o.needsUpdate=!0,n&&n(o)},i,r);return o}}const db=new WeakMap;class Y1 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=Yu.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=db.get(s);f===void 0&&(f=[],db.set(s,f)),f.push({onLoad:n,onError:r})}return s}const o=W1("img");function l(){u(),n&&n(this);const f=db.get(this)||[];for(let h=0;h<f.length;h++){const d=f[h];d.onLoad&&d.onLoad(this)}db.delete(this),a.manager.itemEnd(e)}function c(f){u(),r&&r(f),Yu.remove(`image:${e}`);const h=db.get(this)||[];for(let d=0;d<h.length;d++){const g=h[d];g.onError&&g.onError(f)}db.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),Yu.add(`image:${e}`,o),a.manager.itemStart(e),o.src=e,o}}class p$ extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=new F_;a.colorSpace=Es;const s=new Y1(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 os,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:xa,s.wrapT=c.wrapT!==void 0?c.wrapT:xa,s.magFilter=c.magFilter!==void 0?c.magFilter:Vi,s.minFilter=c.minFilter!==void 0?c.minFilter:Vi,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=vc),c.mipmapCount===1&&(s.minFilter=Vi),c.generateMipmaps!==void 0&&(s.generateMipmaps=c.generateMipmaps),s.needsUpdate=!0,n&&n(s,c)},i,r),s}}class fv extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=new nr,s=new Y1(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 ep extends Pi{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 m$ extends ep{constructor(e,n,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Pi.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 Dt,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=Ao,this.map=null,this.mapPass=null,this.matrix=new Dt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Zd,this._frameExtents=new wt(1,1),this._viewportCount=1,this._viewports=[new ni(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 U0e extends oU{constructor(){super(new ra(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,i=av*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 ep{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(Pi.DEFAULT_UP),this.updateMatrix(),this.target=new Pi,this.distance=i,this.angle=r,this.penumbra=a,this.decay=s,this.map=null,this.shadow=new U0e}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 Dt,Ky=new te,Ok=new te;class F0e extends oU{constructor(){super(new ra(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new wt(4,2),this._viewportCount=6,this._viewports=[new ni(2,1,1,1),new ni(0,1,1,1),new ni(3,1,1,1),new ni(1,1,1,1),new ni(3,0,1,1),new ni(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()),Ky.setFromMatrixPosition(e.matrixWorld),i.position.copy(Ky),Ok.copy(i.position),Ok.add(this._cubeDirections[n]),i.up.copy(this._cubeUps[n]),i.lookAt(Ok),i.updateMatrixWorld(),r.makeTranslation(-Ky.x,-Ky.y,-Ky.z),_j.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_j,i.coordinateSystem,i.reversedDepth)}}class cU extends ep{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 F0e}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 Ah 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 B0e extends oU{constructor(){super(new Ah(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class dC extends ep{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Pi.DEFAULT_UP),this.updateMatrix(),this.target=new Pi,this.shadow=new B0e}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class g$ extends ep{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class b$ extends ep{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 v${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 y$ extends ep{constructor(e=new v$,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 ni().fromArray(s.value);break;case"m3":r.uniforms[a].value=new $n().fromArray(s.value);break;case"m4":r.uniforms[a].value=new Dt().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:hg,SpriteMaterial:GP,RawShaderMaterial:n$,ShaderMaterial:cs,PointsMaterial:JA,MeshPhysicalMaterial:Pc,MeshStandardMaterial:Yv,MeshPhongMaterial:i$,MeshToonMaterial:eT,MeshNormalMaterial:r$,MeshLambertMaterial:a$,MeshDepthMaterial:uC,MeshDistanceMaterial:fC,MeshBasicMaterial:Cs,MeshMatcapMaterial:s$,LineDashedMaterial:o$,LineBasicMaterial:Us,Material:Oa};return new n[e]}}class Ld{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 V_ extends On{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 x$ 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],m=a(d,y.buffer),x=i0(y.type,m),_=new B_(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],m=new Uint32Array(y).buffer;return i[g]=m,m}const s=e.isInstancedBufferGeometry?new V_:new On,o=e.data.index;if(o!==void 0){const d=i0(o.type,o.array);s.setIndex(new In(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 zo(y,g.itemSize,g.offset,g.normalized)}else{const y=i0(g.type,g.array),m=g.isInstancedBufferAttribute?hf:In;b=new m(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,m=g.length;y<m;y++){const x=g[y];let _;if(x.isInterleavedBufferAttribute){const w=r(e.data,x.data);_=new zo(w,x.itemSize,x.offset,x.normalized)}else{const w=i0(x.type,x.array);_=new In(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 Ur().fromJSON(h)),e.name&&(s.name=e.name),e.userData&&(s.userData=e.userData),s}}class z0e extends Fs{constructor(e){super(e)}load(e,n,i,r){const a=this,s=this.path===""?Ld.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===""?Ld.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 Om().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 qv().fromJSON(e[a],r);i[o.uuid]=o}return i}parseGeometries(e,n){const i={};if(e!==void 0){const r=new x$;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=uv.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:i0(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 Y1(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],m=o(y);m!==null&&(m instanceof HTMLImageElement?d.push(m):d.push(new os(m.data,m.width,m.height)))}r[f.uuid]=new Ed(d)}else{const d=o(f.url);r[f.uuid]=new Ed(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:i0(s.type,s.data),width:s.width,height:s.height}:null}if(e!==void 0&&e.length>0){r=new Y1(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 os(g.data,g.width,g.height)))}i[l.uuid]=new Ed(u)}else{const u=await a(l.url);i[l.uuid]=new Ed(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 F_,c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new os: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,j0e)),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 Wv,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 ra(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 Ah(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 g$(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 b$(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 m$(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=new y$().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 Si(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 hf(new Float32Array(d.array),16),g!==void 0&&(s.instanceColor=new hf(new Float32Array(g.array),g.itemSize));break;case"BatchedMesh":u=o(e.geometry),f=l(e.material),s=new qJ(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,m=null;return b.boundingBox!==void 0&&(y=new rr().fromJSON(b.boundingBox)),b.boundingSphere!==void 0&&(m=new Ur().fromJSON(b.boundingSphere)),{...b,boundingBox:y,boundingSphere:m}}),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 Ur().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(s.boundingBox=new rr().fromJSON(e.boundingBox));break;case"LOD":s=new WJ;break;case"Line":s=new yh(o(e.geometry),l(e.material));break;case"LineLoop":s=new WP(o(e.geometry),l(e.material));break;case"LineSegments":s=new Lc(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 GJ(l(e.material));break;case"Group":s=new yl;break;case"Bone":s=new z_;break;default:s=new Pi}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 Pi}})}}const j0e={UVMapping:Hd,CubeReflectionMapping:ff,CubeRefractionMapping:Vd,EquirectangularReflectionMapping:J0,EquirectangularRefractionMapping:z1,CubeUVReflectionMapping:jv},Sj={RepeatWrapping:Gd,ClampToEdgeWrapping:xa,MirroredRepeatWrapping:$0},wj={NearestFilter:ss,NearestMipmapNearestFilter:LA,NearestMipmapLinearFilter:lm,LinearFilter:Vi,LinearMipmapNearestFilter:x0,LinearMipmapLinearFilter:vc},Ik=new WeakMap;class _$ 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=Yu.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 Yu.add(`image-bitmap:${e}`,c),n&&n(c),a.manager.itemEnd(e),c}).catch(function(c){r&&r(c),Ik.set(l,c),Yu.remove(`image-bitmap:${e}`),a.manager.itemError(e),a.manager.itemEnd(e)});Yu.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 H0e 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 Dt,Mj=new Dt,Rp=new Dt;class V0e{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ra,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ra,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,Rp.copy(e.projectionMatrix);const r=n.eyeSep/2,a=r*n.near/n.focus,s=n.near*Math.tan(Dm*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,Rp.elements[0]=2*n.near/(l-o),Rp.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(Rp),o=-s*n.aspect-a,l=s*n.aspect-a,Rp.elements[0]=2*n.near/(l-o),Rp.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(Rp)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Mj),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Ej)}}class S$ extends ra{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 kp=new te,Nk=new qn,G0e=new te,Dp=new te,Op=new te;class W0e extends Pi{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(kp,Nk,G0e),Dp.set(0,0,-1).applyQuaternion(Nk),Op.set(0,1,0).applyQuaternion(Nk),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(kp.x,i),n.positionY.linearRampToValueAtTime(kp.y,i),n.positionZ.linearRampToValueAtTime(kp.z,i),n.forwardX.linearRampToValueAtTime(Dp.x,i),n.forwardY.linearRampToValueAtTime(Dp.y,i),n.forwardZ.linearRampToValueAtTime(Dp.z,i),n.upX.linearRampToValueAtTime(Op.x,i),n.upY.linearRampToValueAtTime(Op.y,i),n.upZ.linearRampToValueAtTime(Op.z,i)}else n.setPosition(kp.x,kp.y,kp.z),n.setOrientation(Dp.x,Dp.y,Dp.z,Op.x,Op.y,Op.z)}}class w$ extends Pi{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 Ip=new te,Tj=new qn,q0e=new te,Np=new te;class X0e extends w${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(Ip,Tj,q0e),Np.set(0,0,1).applyQuaternion(Tj);const n=this.panner;if(n.positionX){const i=this.context.currentTime+this.listener.timeDelta;n.positionX.linearRampToValueAtTime(Ip.x,i),n.positionY.linearRampToValueAtTime(Ip.y,i),n.positionZ.linearRampToValueAtTime(Ip.z,i),n.orientationX.linearRampToValueAtTime(Np.x,i),n.orientationY.linearRampToValueAtTime(Np.y,i),n.orientationZ.linearRampToValueAtTime(Np.z,i)}else n.setPosition(Ip.x,Ip.y,Ip.z),n.setOrientation(Np.x,Np.y,Np.z)}}class K0e{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 E${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){qn.slerpFlat(e,n,e,n,e,i,r)}_slerpAdditive(e,n,i,r,a){const s=this._workIndex*a;qn.multiplyQuaternionsFlat(e,s,e,n,e,i),qn.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="\\[\\]\\.:\\/",Y0e=new RegExp("["+hU+"]","g"),dU="[^"+hU+"]",J0e="[^"+hU.replace("\\.","")+"]",$0e=/((?:WC+[\/:])*)/.source.replace("WC",dU),Z0e=/(WCOD+)?/.source.replace("WCOD",J0e),Q0e=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",dU),eve=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",dU),tve=new RegExp("^"+$0e+Z0e+Q0e+eve+"$"),nve=["material","materials","bones","map"];class ive{constructor(e,n,i){const r=i||Bi.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 Bi{constructor(e,n,i){this.path=n,this.parsedPath=i||Bi.parseTrackName(n),this.node=Bi.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 Bi.Composite(e,n,i):new Bi(e,n,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Y0e,"")}static parseTrackName(e){const n=tve.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);nve.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=Bi.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}}Bi.Composite=ive;Bi.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Bi.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Bi.prototype.GetterByBindingType=[Bi.prototype._getValue_direct,Bi.prototype._getValue_array,Bi.prototype._getValue_arrayElement,Bi.prototype._getValue_toArray];Bi.prototype.SetterByBindingTypeAndVersioning=[[Bi.prototype._setValue_direct,Bi.prototype._setValue_direct_setNeedsUpdate,Bi.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Bi.prototype._setValue_array,Bi.prototype._setValue_array_setNeedsUpdate,Bi.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Bi.prototype._setValue_arrayElement,Bi.prototype._setValue_arrayElement_setNeedsUpdate,Bi.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Bi.prototype._setValue_fromArray,Bi.prototype._setValue_fromArray_setNeedsUpdate,Bi.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class rve{constructor(){this.isAnimationObjectGroup=!0,this.uuid=El(),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 Bi(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 m=0,x=s;m!==x;++m){const _=a[m],w=_[b];let M=_[g];_[g]=w,M===void 0&&(M=new Bi(h,i[m],r[m])),_[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],m=b[u];b[u]=y,b[f]=m}}}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,m=r;y!==m;++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 Bi(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 M${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:cm,endingEnd:cm};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=EJ,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===MJ;if(e===0)return a===-1?r:s&&(a&1)===1?n-r:r;if(i===wJ){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=um,r.endingEnd=um):(e?r.endingStart=this.zeroSlopeAtStart?um:cm:r.endingStart=j1,n?r.endingEnd=this.zeroSlopeAtEnd?um:cm:r.endingEnd=j1)}_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 ave=new Float32Array(1);class T$ extends vf{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 E$(Bi.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,ave),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"?uv.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 M$(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"?uv.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 sve 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 ove=0;class lve extends vf{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:ove++}),this.name="",this.usage=V1,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 B_{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 A${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 Dt;class G_{constructor(e,n,i=0,r=1/0){this.ray=new yf(e,n),this.near=i,this.far=r,this.camera=null,this.layers=new sv,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 cve{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=uve.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 uve(){this._document.hidden===!1&&this.reset()}class C${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=Pn(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(Pn(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class fve{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 hve{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,pb=new te,mb=new te,Lk=new te,dve=new te,pve=new te;class R${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=Pn(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=dve,i=pve){const r=10000000000000001e-32;let a,s;const o=this.start,l=e.start,c=this.end,u=e.end;pb.subVectors(c,o),mb.subVectors(u,l),Lk.subVectors(o,l);const f=pb.dot(pb),h=mb.dot(mb),d=mb.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=Pn(s,0,1);else{const g=pb.dot(Lk);if(h<=r)s=0,a=Pn(-g/f,0,1);else{const b=pb.dot(mb),y=f*h-b*b;y!==0?a=Pn((b*d-g*h)/y,0,1):a=0,s=(b*a+d)/h,s<0?(s=0,a=Pn(-g/f,0,1)):s>1&&(s=1,a=Pn((b-g)/f,0,1))}}return n.copy(o).add(pb.multiplyScalar(a)),i.copy(l).add(mb.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 mve extends Pi{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const i=new On,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 mn(r,3));const a=new Us({fog:!1,toneMapped:!1});this.cone=new Lc(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 Zh=new te,Vw=new Dt,Pk=new Dt;class gve extends Lc{constructor(e){const n=k$(e),i=new On,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 mn(r,3)),i.setAttribute("color",new mn(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),Zh.setFromMatrixPosition(Vw),r.setXYZ(s,Zh.x,Zh.y,Zh.z),Vw.multiplyMatrices(Pk,o.parent.matrixWorld),Zh.setFromMatrixPosition(Vw),r.setXYZ(s+1,Zh.x,Zh.y,Zh.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 k$(t){const e=[];t.isBone===!0&&e.push(t);for(let n=0;n<t.children.length;n++)e.push(...k$(t.children[n]));return e}class bve extends Si{constructor(e,n,i){const r=new Kv(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 vve=new te,Oj=new Ut,Ij=new Ut;class yve extends Pi{constructor(e,n,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const r=new H_(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 In(s,3)),this.add(new Si(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(vve.setFromMatrixPosition(this.light.matrixWorld).negate())}}class xve extends Lc{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 On;u.setAttribute("position",new mn(l,3)),u.setAttribute("color",new mn(c,3));const f=new Us({vertexColors:!0,toneMapped:!1});super(u,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class _ve extends Lc{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,m=Math.cos(b)*d;o.push(y,0,m),l.push(h.r,h.g,h.b),b=(g+1)/r*(Math.PI*2),y=Math.sin(b)*d,m=Math.cos(b)*d,o.push(y,0,m),l.push(h.r,h.g,h.b)}}const c=new On;c.setAttribute("position",new mn(o,3)),c.setAttribute("color",new mn(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 Sve extends Pi{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 On;r.setAttribute("position",new mn([-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 yh(r,a),this.add(this.lightPlane),r=new On,r.setAttribute("position",new mn([0,0,0,0,0,1],3)),this.targetLine=new yh(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,da=new GA;class wve extends Lc{constructor(e){const n=new On,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 mn(r,3)),n.setAttribute("color",new mn(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(da.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)a=1,s=0;else if(this.camera.coordinateSystem===vl)a=-1,s=1;else if(this.camera.coordinateSystem===rv)a=0,s=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);va("c",n,e,da,0,0,a),va("t",n,e,da,0,0,s),va("n1",n,e,da,-i,-r,a),va("n2",n,e,da,i,-r,a),va("n3",n,e,da,-i,r,a),va("n4",n,e,da,i,r,a),va("f1",n,e,da,-i,-r,s),va("f2",n,e,da,i,-r,s),va("f3",n,e,da,-i,r,s),va("f4",n,e,da,i,r,s),va("u1",n,e,da,i*.7,r*1.1,a),va("u2",n,e,da,-i*.7,r*1.1,a),va("u3",n,e,da,0,r*2,a),va("cf1",n,e,da,-i,0,s),va("cf2",n,e,da,i,0,s),va("cf3",n,e,da,0,-r,s),va("cf4",n,e,da,0,r,s),va("cn1",n,e,da,-i,0,a),va("cn2",n,e,da,i,0,a),va("cn3",n,e,da,0,-r,a),va("cn4",n,e,da,0,r,a),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function va(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 Eve extends Lc{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 On;a.setIndex(new In(i,1)),a.setAttribute("position",new In(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 Lc{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 On;a.setIndex(new In(i,1)),a.setAttribute("position",new mn(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 Mve extends yh{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 On;s.setAttribute("position",new mn(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 On;l.setAttribute("position",new mn(o,3)),l.computeBoundingSphere(),this.add(new Si(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 Tve extends Pi{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 On,Xw.setAttribute("position",new mn([0,0,0,0,1,0],3)),Uk=new j_(.5,1,5,1),Uk.translate(0,-.5,0)),this.position.copy(n),this.line=new yh(Xw,new Us({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Si(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 Ave extends Lc{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 On;r.setAttribute("position",new mn(n,3)),r.setAttribute("color",new mn(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 Cve{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(m){const x=[];for(let _=0,w=m.length;_<w;_++){const M=m[_],S=new Om;S.curves=M.curves,x.push(S)}return x}function i(m,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),m.y<A.y||m.y>C.y)continue;if(m.y===A.y){if(m.x===A.x)return!0}else{const L=R*(m.x-A.x)-D*(m.y-A.y);if(L===0)return!0;if(L<0)continue;w=!w}}else{if(m.y!==A.y)continue;if(C.x<=m.x&&m.x<=A.x||A.x<=m.x&&m.x<=C.x)return!0}}return w}const r=du.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 Om,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 m=0,x=a.length;m<x;m++)o=a[m],b=o.getPoints(),s=r(b),s=e?!s:s,s?(!u&&h[g]&&g++,h[g]={s:new Om,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 m=!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)):m=!0);C&&f[_].push(A)}}x>0&&m===!1&&(d=f)}let y;for(let m=0,x=h.length;m<x;m++){l=h[m].s,c.push(l),y=d[m];for(let _=0,w=y.length;_<w;_++)l.holes.push(y[_].h)}return c}}class Rve extends vf{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 kve(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 Dve(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 Ove(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=Ive(i);switch(n){case OP:return t*e;case Th:return t*e/r.components*r.byteLength;case Vv:return t*e/r.components*r.byteLength;case zA:return t*e*2/r.components*r.byteLength;case U_:return t*e*2/r.components*r.byteLength;case IP:return t*e*3/r.components*r.byteLength;case Qr:return t*e*4/r.components*r.byteLength;case Gv:return t*e*4/r.components*r.byteLength;case Zx:case Qx:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case e1:case t1: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 n1: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 Ive(t){switch(t){case Ao:case PA:return{byteLength:1,components:1};case Z0:case UA:case rs:return{byteLength:2,components:1};case FA:case BA:return{byteLength:2,components:4};case Ac:case Hv:case wr:return{byteLength:4,components:1};case DP:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}class Nve{static contain(e,n){return kve(e,n)}static cover(e,n){return Dve(e,n)}static fill(e){return Ove(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:zv}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=zv);/**
 * @license
 * Copyright 2010-2025 Three.js Authors
 * SPDX-License-Identifier: MIT
 */function D$(){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 Lve(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 Pve=`#ifdef USE_ALPHAHASH
	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,Uve=`#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`,Fve=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,Bve=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,zve=`#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`,jve=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,Hve=`#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`,Vve=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,Gve=`#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`,Wve=`#ifdef USE_BATCHING
	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
#endif`,qve=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
	vPosition = vec3( position );
#endif`,Xve=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,Kve=`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`,Yve=`#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`,Jve=`#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`,$ve=`#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`,Zve=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,Qve=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,eye=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,tye=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,nye=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,iye=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
	varying vec3 vColor;
#endif`,rye=`#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`,aye=`#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`,sye=`#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`,oye=`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`,lye=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,cye=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,uye=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
		emissiveColor = sRGBTransferEOTF( emissiveColor );
	#endif
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,fye=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,hye="gl_FragColor = linearToOutputTexel( gl_FragColor );",dye=`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 );
}`,pye=`#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`,mye=`#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`,gye=`#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`,bye=`#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`,vye=`#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`,yye=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,xye=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,_ye=`#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`,Sye=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,wye=`#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
}`,Eye=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,Mye=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,Tye=`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`,Aye=`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`,Cye=`#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`,Rye=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,kye=`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`,Dye=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,Oye=`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`,Iye=`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`,Nye=`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 );
}`,Lye=`
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`,Pye=`#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`,Uye=`#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`,Fye=`#if defined( USE_LOGDEPTHBUF )
	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,Bye=`#if defined( USE_LOGDEPTHBUF )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,zye=`#ifdef USE_LOGDEPTHBUF
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,jye=`#ifdef USE_LOGDEPTHBUF
	vFragDepth = 1.0 + gl_Position.w;
	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,Hye=`#ifdef USE_MAP
	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
	#ifdef DECODE_VIDEO_TEXTURE
		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
	#endif
	diffuseColor *= sampledDiffuseColor;
#endif`,Vye=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,Gye=`#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`,Wye=`#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`,qye=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
	metalnessFactor *= texelMetalness.b;
#endif`,Xye=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,Kye=`#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`,Yye=`#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`,Jye=`#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`,$ye=`#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`,Zye=`#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`,Qye=`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;`,exe=`#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`,txe=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,nxe=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,ixe=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,rxe=`#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`,axe=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,sxe=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,oxe=`#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`,lxe=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,cxe=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,uxe=`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 );
}`,fxe=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,hxe=`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;`,dxe=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,pxe=`#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`,mxe=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
	roughnessFactor *= texelRoughness.g;
#endif`,gxe=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,bxe=`#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`,vxe=`#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`,yxe=`#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`,xxe=`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;
}`,_xe=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,Sxe=`#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`,wxe=`#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`,Exe=`#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`,Mxe=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,Txe=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,Axe=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,Cxe=`#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; }`,Rxe=`#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`,kxe=`#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`,Dxe=`#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`,Oxe=`#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`,Ixe=`#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`,Nxe=`#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 Lxe=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,Pxe=`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>
}`,Uxe=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,Fxe=`#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>
}`,Bxe=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,zxe=`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>
}`,jxe=`#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;
}`,Hxe=`#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
}`,Vxe=`#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;
}`,Gxe=`#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 );
}`,Wxe=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,qxe=`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>
}`,Xxe=`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>
}`,Kxe=`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>
}`,Yxe=`#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>
}`,Jxe=`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>
}`,$xe=`#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>
}`,Zxe=`#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>
}`,Qxe=`#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;
}`,e1e=`#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>
}`,t1e=`#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
}`,n1e=`#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
}`,i1e=`#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>
}`,r1e=`#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>
}`,a1e=`#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
}`,s1e=`#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>
}`,o1e=`#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>
}`,l1e=`#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>
}`,c1e=`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>
}`,u1e=`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>
}`,f1e=`#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>
}`,h1e=`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>
}`,d1e=`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>
}`,p1e=`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>
}`,hn={alphahash_fragment:Pve,alphahash_pars_fragment:Uve,alphamap_fragment:Fve,alphamap_pars_fragment:Bve,alphatest_fragment:zve,alphatest_pars_fragment:jve,aomap_fragment:Hve,aomap_pars_fragment:Vve,batching_pars_vertex:Gve,batching_vertex:Wve,begin_vertex:qve,beginnormal_vertex:Xve,bsdfs:Kve,iridescence_fragment:Yve,bumpmap_pars_fragment:Jve,clipping_planes_fragment:$ve,clipping_planes_pars_fragment:Zve,clipping_planes_pars_vertex:Qve,clipping_planes_vertex:eye,color_fragment:tye,color_pars_fragment:nye,color_pars_vertex:iye,color_vertex:rye,common:aye,cube_uv_reflection_fragment:sye,defaultnormal_vertex:oye,displacementmap_pars_vertex:lye,displacementmap_vertex:cye,emissivemap_fragment:uye,emissivemap_pars_fragment:fye,colorspace_fragment:hye,colorspace_pars_fragment:dye,envmap_fragment:pye,envmap_common_pars_fragment:mye,envmap_pars_fragment:gye,envmap_pars_vertex:bye,envmap_physical_pars_fragment:Cye,envmap_vertex:vye,fog_vertex:yye,fog_pars_vertex:xye,fog_fragment:_ye,fog_pars_fragment:Sye,gradientmap_pars_fragment:wye,lightmap_pars_fragment:Eye,lights_lambert_fragment:Mye,lights_lambert_pars_fragment:Tye,lights_pars_begin:Aye,lights_toon_fragment:Rye,lights_toon_pars_fragment:kye,lights_phong_fragment:Dye,lights_phong_pars_fragment:Oye,lights_physical_fragment:Iye,lights_physical_pars_fragment:Nye,lights_fragment_begin:Lye,lights_fragment_maps:Pye,lights_fragment_end:Uye,logdepthbuf_fragment:Fye,logdepthbuf_pars_fragment:Bye,logdepthbuf_pars_vertex:zye,logdepthbuf_vertex:jye,map_fragment:Hye,map_pars_fragment:Vye,map_particle_fragment:Gye,map_particle_pars_fragment:Wye,metalnessmap_fragment:qye,metalnessmap_pars_fragment:Xye,morphinstance_vertex:Kye,morphcolor_vertex:Yye,morphnormal_vertex:Jye,morphtarget_pars_vertex:$ye,morphtarget_vertex:Zye,normal_fragment_begin:Qye,normal_fragment_maps:exe,normal_pars_fragment:txe,normal_pars_vertex:nxe,normal_vertex:ixe,normalmap_pars_fragment:rxe,clearcoat_normal_fragment_begin:axe,clearcoat_normal_fragment_maps:sxe,clearcoat_pars_fragment:oxe,iridescence_pars_fragment:lxe,opaque_fragment:cxe,packing:uxe,premultiplied_alpha_fragment:fxe,project_vertex:hxe,dithering_fragment:dxe,dithering_pars_fragment:pxe,roughnessmap_fragment:mxe,roughnessmap_pars_fragment:gxe,shadowmap_pars_fragment:bxe,shadowmap_pars_vertex:vxe,shadowmap_vertex:yxe,shadowmask_pars_fragment:xxe,skinbase_vertex:_xe,skinning_pars_vertex:Sxe,skinning_vertex:wxe,skinnormal_vertex:Exe,specularmap_fragment:Mxe,specularmap_pars_fragment:Txe,tonemapping_fragment:Axe,tonemapping_pars_fragment:Cxe,transmission_fragment:Rxe,transmission_pars_fragment:kxe,uv_pars_fragment:Dxe,uv_pars_vertex:Oxe,uv_vertex:Ixe,worldpos_vertex:Nxe,background_vert:Lxe,background_frag:Pxe,backgroundCube_vert:Uxe,backgroundCube_frag:Fxe,cube_vert:Bxe,cube_frag:zxe,depth_vert:jxe,depth_frag:Hxe,distanceRGBA_vert:Vxe,distanceRGBA_frag:Gxe,equirect_vert:Wxe,equirect_frag:qxe,linedashed_vert:Xxe,linedashed_frag:Kxe,meshbasic_vert:Yxe,meshbasic_frag:Jxe,meshlambert_vert:$xe,meshlambert_frag:Zxe,meshmatcap_vert:Qxe,meshmatcap_frag:e1e,meshnormal_vert:t1e,meshnormal_frag:n1e,meshphong_vert:i1e,meshphong_frag:r1e,meshphysical_vert:a1e,meshphysical_frag:s1e,meshtoon_vert:o1e,meshtoon_frag:l1e,points_vert:c1e,points_frag:u1e,shadow_vert:f1e,shadow_frag:h1e,sprite_vert:d1e,sprite_frag:p1e},en={common:{diffuse:{value:new Ut(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new $n},alphaMap:{value:null},alphaMapTransform:{value:new $n},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new $n}},envmap:{envMap:{value:null},envMapRotation:{value:new $n},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new $n}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new $n}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new $n},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new $n},normalScale:{value:new wt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new $n},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new $n}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new $n}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new $n}},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 $n},alphaTest:{value:0},uvTransform:{value:new $n}},sprite:{diffuse:{value:new Ut(16777215)},opacity:{value:1},center:{value:new wt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new $n},alphaMap:{value:null},alphaMapTransform:{value:new $n},alphaTest:{value:0}}},iu={basic:{uniforms:vo([en.common,en.specularmap,en.envmap,en.aomap,en.lightmap,en.fog]),vertexShader:hn.meshbasic_vert,fragmentShader:hn.meshbasic_frag},lambert:{uniforms:vo([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:hn.meshlambert_vert,fragmentShader:hn.meshlambert_frag},phong:{uniforms:vo([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:hn.meshphong_vert,fragmentShader:hn.meshphong_frag},standard:{uniforms:vo([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:hn.meshphysical_vert,fragmentShader:hn.meshphysical_frag},toon:{uniforms:vo([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:hn.meshtoon_vert,fragmentShader:hn.meshtoon_frag},matcap:{uniforms:vo([en.common,en.bumpmap,en.normalmap,en.displacementmap,en.fog,{matcap:{value:null}}]),vertexShader:hn.meshmatcap_vert,fragmentShader:hn.meshmatcap_frag},points:{uniforms:vo([en.points,en.fog]),vertexShader:hn.points_vert,fragmentShader:hn.points_frag},dashed:{uniforms:vo([en.common,en.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:hn.linedashed_vert,fragmentShader:hn.linedashed_frag},depth:{uniforms:vo([en.common,en.displacementmap]),vertexShader:hn.depth_vert,fragmentShader:hn.depth_frag},normal:{uniforms:vo([en.common,en.bumpmap,en.normalmap,en.displacementmap,{opacity:{value:1}}]),vertexShader:hn.meshnormal_vert,fragmentShader:hn.meshnormal_frag},sprite:{uniforms:vo([en.sprite,en.fog]),vertexShader:hn.sprite_vert,fragmentShader:hn.sprite_frag},background:{uniforms:{uvTransform:{value:new $n},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:hn.background_vert,fragmentShader:hn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new $n}},vertexShader:hn.backgroundCube_vert,fragmentShader:hn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:hn.cube_vert,fragmentShader:hn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:hn.equirect_vert,fragmentShader:hn.equirect_frag},distanceRGBA:{uniforms:vo([en.common,en.displacementmap,{referencePosition:{value:new te},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:hn.distanceRGBA_vert,fragmentShader:hn.distanceRGBA_frag},shadow:{uniforms:vo([en.lights,en.fog,{color:{value:new Ut(0)},opacity:{value:1}}]),vertexShader:hn.shadow_vert,fragmentShader:hn.shadow_frag}};iu.physical={uniforms:vo([iu.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new $n},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new $n},clearcoatNormalScale:{value:new wt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new $n},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new $n},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new $n},sheen:{value:0},sheenColor:{value:new Ut(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new $n},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new $n},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new $n},transmissionSamplerSize:{value:new wt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new $n},attenuationDistance:{value:0},attenuationColor:{value:new Ut(0)},specularColor:{value:new Ut(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new $n},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new $n},anisotropyVector:{value:new wt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new $n}}]),vertexShader:hn.meshphysical_vert,fragmentShader:hn.meshphysical_frag};const Kw={r:0,b:0,g:0},Lp=new vi,m1e=new Dt;function g1e(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?m(o,l):M&&M.isColor&&(m(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===jv)?(u===void 0&&(u=new Si(new $d(1,1,1),new cs({name:"BackgroundCubeMaterial",uniforms:ov(iu.backgroundCube.uniforms),vertexShader:iu.backgroundCube.vertexShader,fragmentShader:iu.backgroundCube.fragmentShader,side:Da,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)),Lp.copy(w.backgroundRotation),Lp.x*=-1,Lp.y*=-1,Lp.z*=-1,M.isCubeTexture&&M.isRenderTargetTexture===!1&&(Lp.y*=-1,Lp.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(m1e.makeRotationFromEuler(Lp)),u.material.toneMapped=bi.getTransfer(M.colorSpace)!==pr,(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 Si(new Il(2,2),new cs({name:"BackgroundMaterial",uniforms:ov(iu.background.uniforms),vertexShader:iu.background.vertexShader,fragmentShader:iu.background.fragmentShader,side:_u,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=bi.getTransfer(M.colorSpace)!==pr,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 m(_,w){_.getRGB(Kw,jJ(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,m(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(_){l=_,m(o,l)},render:b,addToRenderList:y,dispose:x}}function b1e(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=h(null);let a=r,s=!1;function o(R,L,U,j,z){let q=!1;const F=f(j,U,L);a!==F&&(a=F,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,L,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,L,U){const j=U.wireframe===!0;let z=i[R.id];z===void 0&&(z={},i[R.id]=z);let q=z[L.id];q===void 0&&(q={},z[L.id]=q);let F=q[j];return F===void 0&&(F=h(l()),q[j]=F),F}function h(R){const L=[],U=[],j=[];for(let z=0;z<n;z++)L[z]=0,U[z]=0,j[z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:U,attributeDivisors:j,object:R,attributes:{},index:null}}function d(R,L,U,j){const z=a.attributes,q=L.attributes;let F=0;const V=U.getAttributes();for(const H in V)if(V[H].location>=0){const B=z[H];let J=q[H];if(J===void 0&&(H==="instanceMatrix"&&R.instanceMatrix&&(J=R.instanceMatrix),H==="instanceColor"&&R.instanceColor&&(J=R.instanceColor)),B===void 0||B.attribute!==J||J&&B.data!==J.data)return!0;F++}return a.attributesNum!==F||a.index!==j}function g(R,L,U,j){const z={},q=L.attributes;let F=0;const V=U.getAttributes();for(const H in V)if(V[H].location>=0){let B=q[H];B===void 0&&(H==="instanceMatrix"&&R.instanceMatrix&&(B=R.instanceMatrix),H==="instanceColor"&&R.instanceColor&&(B=R.instanceColor));const J={};J.attribute=B,B&&B.data&&(J.data=B.data),z[H]=J,F++}a.attributes=z,a.attributesNum=F,a.index=j}function b(){const R=a.newAttributes;for(let L=0,U=R.length;L<U;L++)R[L]=0}function y(R){m(R,0)}function m(R,L){const U=a.newAttributes,j=a.enabledAttributes,z=a.attributeDivisors;U[R]=1,j[R]===0&&(t.enableVertexAttribArray(R),j[R]=1),z[R]!==L&&(t.vertexAttribDivisor(R,L),z[R]=L)}function x(){const R=a.newAttributes,L=a.enabledAttributes;for(let U=0,j=L.length;U<j;U++)L[U]!==R[U]&&(t.disableVertexAttribArray(U),L[U]=0)}function _(R,L,U,j,z,q,F){F===!0?t.vertexAttribIPointer(R,L,U,z,q):t.vertexAttribPointer(R,L,U,j,z,q)}function w(R,L,U,j){b();const z=j.attributes,q=U.getAttributes(),F=L.defaultAttributeValues;for(const V in q){const H=q[V];if(H.location>=0){let W=z[V];if(W===void 0&&(V==="instanceMatrix"&&R.instanceMatrix&&(W=R.instanceMatrix),V==="instanceColor"&&R.instanceColor&&(W=R.instanceColor)),W!==void 0){const B=W.normalized,J=W.itemSize,Z=e.get(W);if(Z===void 0)continue;const G=Z.buffer,de=Z.type,oe=Z.bytesPerElement,le=de===t.INT||de===t.UNSIGNED_INT||W.gpuType===Hv;if(W.isInterleavedBufferAttribute){const ue=W.data,Se=ue.stride,Oe=W.offset;if(ue.isInstancedInterleavedBuffer){for(let Be=0;Be<H.locationSize;Be++)m(H.location+Be,ue.meshPerAttribute);R.isInstancedMesh!==!0&&j._maxInstanceCount===void 0&&(j._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let Be=0;Be<H.locationSize;Be++)y(H.location+Be);t.bindBuffer(t.ARRAY_BUFFER,G);for(let Be=0;Be<H.locationSize;Be++)_(H.location+Be,J/H.locationSize,de,B,Se*oe,(Oe+J/H.locationSize*Be)*oe,le)}else{if(W.isInstancedBufferAttribute){for(let ue=0;ue<H.locationSize;ue++)m(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,G);for(let ue=0;ue<H.locationSize;ue++)_(H.location+ue,J/H.locationSize,de,B,J*oe,J/H.locationSize*ue*oe,le)}}else if(F!==void 0){const B=F[V];if(B!==void 0)switch(B.length){case 2:t.vertexAttrib2fv(H.location,B);break;case 3:t.vertexAttrib3fv(H.location,B);break;case 4:t.vertexAttrib4fv(H.location,B);break;default:t.vertexAttrib1fv(H.location,B)}}}}x()}function M(){C();for(const R in i){const L=i[R];for(const U in L){const j=L[U];for(const z in j)u(j[z].object),delete j[z];delete L[U]}delete i[R]}}function S(R){if(i[R.id]===void 0)return;const L=i[R.id];for(const U in L){const j=L[U];for(const z in j)u(j[z].object),delete j[z];delete L[U]}delete i[R.id]}function A(R){for(const L in i){const U=i[L];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 v1e(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 y1e(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!==Qr&&i.convert(A)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(A){const C=A===rs&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(A!==Ao&&i.convert(A)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&A!==wr&&!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),m=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:m,maxVertexUniforms:x,maxVaryings:_,maxFragmentUniforms:w,vertexTextures:M,maxSamples:S}}function x1e(t){const e=this;let n=null,i=0,r=!1,a=!1;const s=new nu,o=new $n,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,m=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=m.clippingState||null;l.value=w,w=u(g,h,_,d);for(let M=0;M!==_;++M)w[M]=n[M];m.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 m=d+b*4,x=h.matrixWorldInverse;o.getNormalMatrix(x),(y===null||y.length<m)&&(y=new Float32Array(m));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 _1e(t){let e=new WeakMap;function n(s,o){return o===J0?s.mapping=ff:o===z1&&(s.mapping=Vd),s}function i(s){if(s&&s.isTexture){const o=s.mapping;if(o===J0||o===z1)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 r0=4,Uj=[.125,.215,.35,.446,.526,.582],nm=20,Fk=new Ah,Fj=new Ut;let Bk=null,zk=0,jk=0,Hk=!1;const $p=(1+Math.sqrt(5))/2,gb=1/$p,Bj=[new te(-$p,gb,0),new te($p,gb,0),new te(-gb,0,$p),new te(gb,0,$p),new te(0,$p,-gb),new te(0,$p,gb),new te(-1,1,-1),new te(1,1,-1),new te(-1,1,1),new te(1,1,1)],S1e=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=S1e}=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===ff||e.mapping===Vd?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:Vi,minFilter:Vi,generateMipmaps:!1,type:rs,format:Qr,colorSpace:Su,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}=w1e(a)),this._blurMaterial=E1e(a,e,n)}return r}_compileMaterial(e){const n=new Si(this._lodPlanes[0],e);this._renderer.compile(n,Fk)}_sceneToCubeUV(e,n,i,r,a){const l=new ra(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=af,f.autoClear=!1,f.state.buffers.depth.getReversed()&&(f.setRenderTarget(r),f.clearDepth(),f.setRenderTarget(null));const b=new Cs({name:"PMREM.Background",side:Da,depthWrite:!1,depthTest:!1}),y=new Si(new $d,b);let m=!1;const x=e.background;x?x.isColor&&(b.color.copy(x),e.background=null,m=!0):(b.color.copy(Fj),m=!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),m&&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===ff||e.mapping===Vd;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 Si(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 Si(this._lodPlanes[r],c),h=c.uniforms,d=this._sizeLods[i]-1,g=isFinite(a)?Math.PI/(2*d):2*Math.PI/(2*nm-1),b=a/g,y=isFinite(a)?1+Math.floor(u*b):nm;y>nm&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${nm}`);const m=[];let x=0;for(let A=0;A<nm;++A){const C=A/b,D=Math.exp(-C*C/2);m.push(D),A===0?x+=D:A<y&&(x+=2*D)}for(let A=0;A<m.length;A++)m[A]=m[A]/x;h.envMap.value=e.texture,h.samples.value=y,h.weights.value=m,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>_-r0?r-_+r0:0),S=4*(this._cubeSize-w);Yw(n,M,S,3*w,2*w),l.setRenderTarget(n),l.render(f,Fk)}}function w1e(t){const e=[],n=[],i=[];let r=t;const a=t-r0+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-r0?l=Uj[s-t+r0-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,m=1,x=new Float32Array(b*g*d),_=new Float32Array(y*g*d),w=new Float32Array(m*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,m*g*S)}const M=new On;M.setAttribute("position",new In(x,b)),M.setAttribute("uv",new In(_,y)),M.setAttribute("faceIndex",new In(w,m)),e.push(M),r>r0&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function zj(t,e,n){const i=new Cc(t,e,n);return i.texture.mapping=jv,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 E1e(t,e,n){const i=new Float32Array(nm),r=new te(0,1,0);return new cs({name:"SphericalGaussianBlur",defines:{n:nm,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:rf,depthTest:!1,depthWrite:!1})}function jj(){return new cs({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:rf,depthTest:!1,depthWrite:!1})}function Hj(){return new cs({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:rf,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 M1e(t){let e=new WeakMap,n=null;function i(o){if(o&&o.isTexture){const l=o.mapping,c=l===J0||l===z1,u=l===ff||l===Vd;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 T1e(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&&_0("THREE.WebGLRenderer: "+i+" extension not supported."),r}}}function A1e(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(PJ(h)?HP:jP)(h,1);y.version=b;const m=a.get(f);m&&e.remove(m),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 C1e(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 m=0;m<g;m++)y+=d[m];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 m=0;m<h.length;m++)c(h[m]/s,d[m],b[m]);else{y.multiDrawElementsInstancedWEBGL(i,d,0,a,h,0,b,0,g);let m=0;for(let x=0;x<g;x++)m+=d[x]*b[x];n.update(m,i,1)}}this.setMode=r,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=u,this.renderMultiDrawInstances=f}function R1e(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 k1e(t,e,n){const i=new WeakMap,r=new ni;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||[],m=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=wr,A.needsUpdate=!0;const C=_*4;for(let R=0;R<f;R++){const L=y[R],U=m[R],j=x[R],z=w*M*4*R;for(let q=0;q<L.count;q++){const F=q*C;d===!0&&(r.fromBufferAttribute(L,q),S[z+F+0]=r.x,S[z+F+1]=r.y,S[z+F+2]=r.z,S[z+F+3]=0),g===!0&&(r.fromBufferAttribute(U,q),S[z+F+4]=r.x,S[z+F+5]=r.y,S[z+F+6]=r.z,S[z+F+7]=0),b===!0&&(r.fromBufferAttribute(j,q),S[z+F+8]=r.x,S[z+F+9]=r.y,S[z+F+10]=r.z,S[z+F+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 D1e(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 O$=new nr,Vj=new XP(1,1),I$=new HA,N$=new VA,L$=new F_,Gj=[],Wj=[],qj=new Float32Array(16),Xj=new Float32Array(9),Kj=new Float32Array(4);function $v(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 ja(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 Ha(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 O1e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function I1e(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(ja(n,e))return;t.uniform2fv(this.addr,e),Ha(n,e)}}function N1e(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(ja(n,e))return;t.uniform3fv(this.addr,e),Ha(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||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(ja(n,e))return;t.uniform4fv(this.addr,e),Ha(n,e)}}function P1e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(ja(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ha(n,e)}else{if(ja(n,i))return;Kj.set(i),t.uniformMatrix2fv(this.addr,!1,Kj),Ha(n,i)}}function U1e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(ja(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ha(n,e)}else{if(ja(n,i))return;Xj.set(i),t.uniformMatrix3fv(this.addr,!1,Xj),Ha(n,i)}}function F1e(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(ja(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ha(n,e)}else{if(ja(n,i))return;qj.set(i),t.uniformMatrix4fv(this.addr,!1,qj),Ha(n,i)}}function B1e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function z1e(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(ja(n,e))return;t.uniform2iv(this.addr,e),Ha(n,e)}}function j1e(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(ja(n,e))return;t.uniform3iv(this.addr,e),Ha(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||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(ja(n,e))return;t.uniform4iv(this.addr,e),Ha(n,e)}}function V1e(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function G1e(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(ja(n,e))return;t.uniform2uiv(this.addr,e),Ha(n,e)}}function W1e(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(ja(n,e))return;t.uniform3uiv(this.addr,e),Ha(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||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(ja(n,e))return;t.uniform4uiv(this.addr,e),Ha(n,e)}}function X1e(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=O$,n.setTexture2D(e||a,r)}function K1e(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||N$,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.setTextureCube(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.setTexture2DArray(e||I$,r)}function $1e(t){switch(t){case 5126:return O1e;case 35664:return I1e;case 35665:return N1e;case 35666:return L1e;case 35674:return P1e;case 35675:return U1e;case 35676:return F1e;case 5124:case 35670:return B1e;case 35667:case 35671:return z1e;case 35668:case 35672:return j1e;case 35669:case 35673:return H1e;case 5125:return V1e;case 36294:return G1e;case 36295:return W1e;case 36296:return q1e;case 35678:case 36198:case 36298:case 36306:case 35682:return X1e;case 35679:case 36299:case 36307:return K1e;case 35680:case 36300:case 36308:case 36293:return Y1e;case 36289:case 36303:case 36311:case 36292:return J1e}}function Z1e(t,e){t.uniform1fv(this.addr,e)}function Q1e(t,e){const n=$v(e,this.size,2);t.uniform2fv(this.addr,n)}function e_e(t,e){const n=$v(e,this.size,3);t.uniform3fv(this.addr,n)}function t_e(t,e){const n=$v(e,this.size,4);t.uniform4fv(this.addr,n)}function n_e(t,e){const n=$v(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function i_e(t,e){const n=$v(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function r_e(t,e){const n=$v(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function a_e(t,e){t.uniform1iv(this.addr,e)}function s_e(t,e){t.uniform2iv(this.addr,e)}function o_e(t,e){t.uniform3iv(this.addr,e)}function l_e(t,e){t.uniform4iv(this.addr,e)}function c_e(t,e){t.uniform1uiv(this.addr,e)}function u_e(t,e){t.uniform2uiv(this.addr,e)}function f_e(t,e){t.uniform3uiv(this.addr,e)}function h_e(t,e){t.uniform4uiv(this.addr,e)}function d_e(t,e,n){const i=this.cache,r=e.length,a=gC(n,r);ja(i,a)||(t.uniform1iv(this.addr,a),Ha(i,a));for(let s=0;s!==r;++s)n.setTexture2D(e[s]||O$,a[s])}function p_e(t,e,n){const i=this.cache,r=e.length,a=gC(n,r);ja(i,a)||(t.uniform1iv(this.addr,a),Ha(i,a));for(let s=0;s!==r;++s)n.setTexture3D(e[s]||N$,a[s])}function m_e(t,e,n){const i=this.cache,r=e.length,a=gC(n,r);ja(i,a)||(t.uniform1iv(this.addr,a),Ha(i,a));for(let s=0;s!==r;++s)n.setTextureCube(e[s]||L$,a[s])}function g_e(t,e,n){const i=this.cache,r=e.length,a=gC(n,r);ja(i,a)||(t.uniform1iv(this.addr,a),Ha(i,a));for(let s=0;s!==r;++s)n.setTexture2DArray(e[s]||I$,a[s])}function b_e(t){switch(t){case 5126:return Z1e;case 35664:return Q1e;case 35665:return e_e;case 35666:return t_e;case 35674:return n_e;case 35675:return i_e;case 35676:return r_e;case 5124:case 35670:return a_e;case 35667:case 35671:return s_e;case 35668:case 35672:return o_e;case 35669:case 35673:return l_e;case 5125:return c_e;case 36294:return u_e;case 36295:return f_e;case 36296:return h_e;case 35678:case 36198:case 36298:case 36306:case 35682:return d_e;case 35679:case 36299:case 36307:return p_e;case 35680:case 36300:case 36308:case 36293:return m_e;case 36289:case 36303:case 36311:case 36292:return g_e}}class v_e{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.setValue=$1e(n.type)}}class y_e{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=b_e(n.type)}}class x_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 __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 v_e(o,t,e):new y_e(o,t,e));break}else{let f=n.map[o];f===void 0&&(f=new x_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);__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 S_e=37297;let w_e=0;function E_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 $n;function M_e(t){bi._getMatrix($j,bi.workingColorSpace,t);const e=`mat3( ${$j.elements.map(n=>n.toFixed(4))} )`;switch(bi.getTransfer(t)){case H1:return[e,"LinearTransferOETF"];case pr: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+`

`+E_e(t.getShaderSource(e),o)}else return a}function T_e(t,e){const n=M_e(e);return[`vec4 ${t}( vec4 value ) {`,`	return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(`
`)}function A_e(t,e){let n;switch(e){case bJ:n="Linear";break;case vJ:n="Reinhard";break;case yJ:n="Cineon";break;case RP:n="ACESFilmic";break;case _J:n="AgX";break;case SJ:n="Neutral";break;case xJ: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 C_e(){bi.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 R_e(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ax).join(`
`)}function k_e(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(`
`)}function D_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 Ax(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 O_e=/^[ \t]*#include +<([\w\d./]+)>/gm;function rI(t){return t.replace(O_e,N_e)}const I_e=new Map;function N_e(t,e){let n=hn[e];if(n===void 0){const i=I_e.get(e);if(i!==void 0)n=hn[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 L_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(L_e,P_e)}function P_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 U_e(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===NA?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===$x?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===Zc&&(e="SHADOWMAP_TYPE_VSM"),e}function F_e(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case ff:case Vd:e="ENVMAP_TYPE_CUBE";break;case jv:e="ENVMAP_TYPE_CUBE_UV";break}return e}function B_e(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case Vd:e="ENVMAP_MODE_REFRACTION";break}return e}function z_e(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case P_:e="ENVMAP_BLENDING_MULTIPLY";break;case mJ:e="ENVMAP_BLENDING_MIX";break;case gJ:e="ENVMAP_BLENDING_ADD";break}return e}function j_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 H_e(t,e,n,i){const r=t.getContext(),a=n.defines;let s=n.vertexShader,o=n.fragmentShader;const l=U_e(n),c=F_e(n),u=B_e(n),f=z_e(n),h=j_e(n),d=R_e(n),g=k_e(a),b=r.createProgram();let y,m,x=n.glslVersion?"#version "+n.glslVersion+`
`:"";n.isRawShaderMaterial?(y=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(Ax).join(`
`),y.length>0&&(y+=`
`),m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(Ax).join(`
`),m.length>0&&(m+=`
`)):(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(Ax).join(`
`),m=[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!==af?"#define TONE_MAPPING":"",n.toneMapping!==af?hn.tonemapping_pars_fragment:"",n.toneMapping!==af?A_e("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",hn.colorspace_pars_fragment,T_e("linearToOutputTexel",n.outputColorSpace),C_e(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
`].filter(Ax).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,m=["#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(`
`)+`
`+m);const _=x+y+s,w=x+m+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(L){if(t.debug.checkShaderErrors){const U=r.getProgramInfoLog(b)||"",j=r.getShaderInfoLog(M)||"",z=r.getShaderInfoLog(S)||"",q=U.trim(),F=j.trim(),V=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 B=Zj(r,M,"vertex"),J=Zj(r,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(b,r.VALIDATE_STATUS)+`

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

Program Info Log: `+q+`
`+B+`
`+J)}else q!==""?console.warn("THREE.WebGLProgram: Program Info Log:",q):(F===""||V==="")&&(W=!1);W&&(L.diagnostics={runnable:H,programLog:q,vertexShader:{log:F,prefix:y},fragmentShader:{log:V,prefix:m}})}r.deleteShader(M),r.deleteShader(S),C=new dM(r,b),D=D_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,S_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=w_e++,this.cacheKey=e,this.usedTimes=1,this.program=b,this.vertexShader=M,this.fragmentShader=S,this}let V_e=0;class G_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 W_e(e),n.set(e,i)),i}}class W_e{constructor(e){this.id=V_e++,this.code=e,this.usedTimes=0}}function q_e(t,e,n,i,r,a,s){const o=new sv,l=new G_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,L,U,j){const z=U.fog,q=j.geometry,F=D.isMeshStandardMaterial?U.environment:null,V=(D.isMeshStandardMaterial?n:e).get(D.envMap||F),H=V&&V.mapping===jv?V.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 B=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,J=B!==void 0?B.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 G,de,oe,le;if(W){const un=iu[W];G=un.vertexShader,de=un.fragmentShader}else G=D.vertexShader,de=D.fragmentShader,l.update(D),oe=l.getVertexShaderID(D),le=l.getFragmentShaderID(D);const ue=t.getRenderTarget(),Se=t.state.buffers.depth.getReversed(),Oe=j.isInstancedMesh===!0,Be=j.isBatchedMesh===!0,je=!!D.map,He=!!D.matcap,pe=!!V,ze=!!D.aoMap,Ie=!!D.lightMap,qe=!!D.bumpMap,we=!!D.normalMap,Me=!!D.displacementMap,Ae=!!D.emissiveMap,Ne=!!D.metalnessMap,Ue=!!D.roughnessMap,Qe=D.anisotropy>0,ae=D.clearcoat>0,K=D.dispersion>0,ce=D.iridescence>0,he=D.sheen>0,me=D.transmission>0,$=Qe&&!!D.anisotropyMap,Ve=ae&&!!D.clearcoatMap,Xe=ae&&!!D.clearcoatNormalMap,mt=ae&&!!D.clearcoatRoughnessMap,Ge=ce&&!!D.iridescenceMap,Je=ce&&!!D.iridescenceThicknessMap,Ye=he&&!!D.sheenColorMap,vt=he&&!!D.sheenRoughnessMap,Mt=!!D.specularMap,gt=!!D.specularColorMap,kt=!!D.specularIntensityMap,Re=me&&!!D.transmissionMap,Le=me&&!!D.thicknessMap,ht=!!D.gradientMap,jt=!!D.alphaMap,st=D.alphaTest>0,it=!!D.alphaHash,bt=!!D.extensions;let Jt=af;D.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(Jt=t.toneMapping);const Kt={shaderID:W,shaderType:D.type,shaderName:D.name,vertexShader:G,fragmentShader:de,defines:D.defines,customVertexShaderID:oe,customFragmentShaderID:le,isRawShaderMaterial:D.isRawShaderMaterial===!0,glslVersion:D.glslVersion,precision:d,batching:Be,batchingColor:Be&&j._colorsTexture!==null,instancing:Oe,instancingColor:Oe&&j.instanceColor!==null,instancingMorph:Oe&&j.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:ue===null?t.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Su,alphaToCoverage:!!D.alphaToCoverage,map:je,matcap:He,envMap:pe,envMapMode:pe&&V.mapping,envMapCubeUVHeight:H,aoMap:ze,lightMap:Ie,bumpMap:qe,normalMap:we,displacementMap:h&&Me,emissiveMap:Ae,normalMapObjectSpace:we&&D.normalMapType===CJ,normalMapTangentSpace:we&&D.normalMapType===Jd,metalnessMap:Ne,roughnessMap:Ue,anisotropy:Qe,anisotropyMap:$,clearcoat:ae,clearcoatMap:Ve,clearcoatNormalMap:Xe,clearcoatRoughnessMap:mt,dispersion:K,iridescence:ce,iridescenceMap:Ge,iridescenceThicknessMap:Je,sheen:he,sheenColorMap:Ye,sheenRoughnessMap:vt,specularMap:Mt,specularColorMap:gt,specularIntensityMap:kt,transmission:me,transmissionMap:Re,thicknessMap:Le,gradientMap:ht,opaque:D.transparent===!1&&D.blending===km&&D.alphaToCoverage===!1,alphaMap:jt,alphaTest:st,alphaHash:it,combine:D.combine,mapUv:je&&b(D.map.channel),aoMapUv:ze&&b(D.aoMap.channel),lightMapUv:Ie&&b(D.lightMap.channel),bumpMapUv:qe&&b(D.bumpMap.channel),normalMapUv:we&&b(D.normalMap.channel),displacementMapUv:Me&&b(D.displacementMap.channel),emissiveMapUv:Ae&&b(D.emissiveMap.channel),metalnessMapUv:Ne&&b(D.metalnessMap.channel),roughnessMapUv:Ue&&b(D.roughnessMap.channel),anisotropyMapUv:$&&b(D.anisotropyMap.channel),clearcoatMapUv:Ve&&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:Ye&&b(D.sheenColorMap.channel),sheenRoughnessMapUv:vt&&b(D.sheenRoughnessMap.channel),specularMapUv:Mt&&b(D.specularMap.channel),specularColorMapUv:gt&&b(D.specularColorMap.channel),specularIntensityMapUv:kt&&b(D.specularIntensityMap.channel),transmissionMapUv:Re&&b(D.transmissionMap.channel),thicknessMapUv:Le&&b(D.thicknessMap.channel),alphaMapUv:jt&&b(D.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(we||Qe),vertexColors:D.vertexColors,vertexAlphas:D.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:j.isPoints===!0&&!!q.attributes.uv&&(je||jt),fog:!!z,useFog:D.fog===!0,fogExp2:!!z&&z.isFogExp2,flatShading:D.flatShading===!0&&D.wireframe===!1,sizeAttenuation:D.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Se,skinning:j.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:J,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&&L.length>0,shadowMapType:t.shadowMap.type,toneMapping:Jt,decodeVideoTexture:je&&D.map.isVideoTexture===!0&&bi.getTransfer(D.map.colorSpace)===pr,decodeVideoTextureEmissive:Ae&&D.emissiveMap.isVideoTexture===!0&&bi.getTransfer(D.emissiveMap.colorSpace)===pr,premultipliedAlpha:D.premultipliedAlpha,doubleSided:D.side===Jr,flipSided:D.side===Da,useDepthPacking:D.depthPacking>=0,depthPacking:D.depthPacking||0,index0AttributeName:D.index0AttributeName,extensionClipCullDistance:bt&&D.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(bt&&D.extensions.multiDraw===!0||Be)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:D.customProgramCacheKey()};return Kt.vertexUv1s=c.has(1),Kt.vertexUv2s=c.has(2),Kt.vertexUv3s=c.has(3),c.clear(),Kt}function m(D){const R=[];if(D.shaderID?R.push(D.shaderID):(R.push(D.customVertexShaderID),R.push(D.customFragmentShaderID)),D.defines!==void 0)for(const L in D.defines)R.push(L),R.push(D.defines[L]);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 L;if(R){const U=iu[R];L=lv.clone(U.uniforms)}else L=D.uniforms;return L}function M(D,R){let L;for(let U=0,j=u.length;U<j;U++){const z=u[U];if(z.cacheKey===R){L=z,++L.usedTimes;break}}return L===void 0&&(L=new H_e(t,R,D,a),u.push(L)),L}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:m,getUniforms:w,acquireProgram:M,releaseProgram:S,releaseShaderCache:A,programs:u,dispose:C}}function X_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 K_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 m=t[e];return m===void 0?(m={id:f.id,object:f,geometry:h,material:d,groupOrder:g,renderOrder:f.renderOrder,z:b,group:y},t[e]=m):(m.id=f.id,m.object=f,m.geometry=h,m.material=d,m.groupOrder=g,m.renderOrder=f.renderOrder,m.z=b,m.group=y),e++,m}function o(f,h,d,g,b,y){const m=s(f,h,d,g,b,y);d.transmission>0?i.push(m):d.transparent===!0?r.push(m):n.push(m)}function l(f,h,d,g,b,y){const m=s(f,h,d,g,b,y);d.transmission>0?i.unshift(m):d.transparent===!0?r.unshift(m):n.unshift(m)}function c(f,h){n.length>1&&n.sort(f||K_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 Y_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 J_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 $_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 Z_e=0;function Q_e(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function eSe(t){const e=new J_e,n=$_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 Dt,s=new Dt;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,m=0,x=0,_=0,w=0,M=0,S=0,A=0;c.sort(Q_e);for(let D=0,R=c.length;D<R;D++){const L=c[D],U=L.color,j=L.intensity,z=L.distance,q=L.shadow&&L.shadow.map?L.shadow.map.texture:null;if(L.isAmbientLight)u+=U.r*j,f+=U.g*j,h+=U.b*j;else if(L.isLightProbe){for(let F=0;F<9;F++)i.probe[F].addScaledVector(L.sh.coefficients[F],j);A++}else if(L.isDirectionalLight){const F=e.get(L);if(F.color.copy(L.color).multiplyScalar(L.intensity),L.castShadow){const V=L.shadow,H=n.get(L);H.shadowIntensity=V.intensity,H.shadowBias=V.bias,H.shadowNormalBias=V.normalBias,H.shadowRadius=V.radius,H.shadowMapSize=V.mapSize,i.directionalShadow[d]=H,i.directionalShadowMap[d]=q,i.directionalShadowMatrix[d]=L.shadow.matrix,x++}i.directional[d]=F,d++}else if(L.isSpotLight){const F=e.get(L);F.position.setFromMatrixPosition(L.matrixWorld),F.color.copy(U).multiplyScalar(j),F.distance=z,F.coneCos=Math.cos(L.angle),F.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),F.decay=L.decay,i.spot[b]=F;const V=L.shadow;if(L.map&&(i.spotLightMap[M]=L.map,M++,V.updateMatrices(L),L.castShadow&&S++),i.spotLightMatrix[b]=V.matrix,L.castShadow){const H=n.get(L);H.shadowIntensity=V.intensity,H.shadowBias=V.bias,H.shadowNormalBias=V.normalBias,H.shadowRadius=V.radius,H.shadowMapSize=V.mapSize,i.spotShadow[b]=H,i.spotShadowMap[b]=q,w++}b++}else if(L.isRectAreaLight){const F=e.get(L);F.color.copy(U).multiplyScalar(j),F.halfWidth.set(L.width*.5,0,0),F.halfHeight.set(0,L.height*.5,0),i.rectArea[y]=F,y++}else if(L.isPointLight){const F=e.get(L);if(F.color.copy(L.color).multiplyScalar(L.intensity),F.distance=L.distance,F.decay=L.decay,L.castShadow){const V=L.shadow,H=n.get(L);H.shadowIntensity=V.intensity,H.shadowBias=V.bias,H.shadowNormalBias=V.normalBias,H.shadowRadius=V.radius,H.shadowMapSize=V.mapSize,H.shadowCameraNear=V.camera.near,H.shadowCameraFar=V.camera.far,i.pointShadow[g]=H,i.pointShadowMap[g]=q,i.pointShadowMatrix[g]=L.shadow.matrix,_++}i.point[g]=F,g++}else if(L.isHemisphereLight){const F=e.get(L);F.skyColor.copy(L.color).multiplyScalar(j),F.groundColor.copy(L.groundColor).multiplyScalar(j),i.hemi[m]=F,m++}}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!==m||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=m,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=m,C.numDirectionalShadows=x,C.numPointShadows=_,C.numSpotShadows=w,C.numSpotMaps=M,C.numLightProbes=A,i.version=Z_e++)}function l(c,u){let f=0,h=0,d=0,g=0,b=0;const y=u.matrixWorldInverse;for(let m=0,x=c.length;m<x;m++){const _=c[m];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 eSe(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 tSe(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 nSe=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,iSe=`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 rSe(t,e,n){let i=new Zd;const r=new wt,a=new wt,s=new ni,o=new uC({depthPacking:UP}),l=new fC,c={},u=n.maxTextureSize,f={[_u]:Da,[Da]:_u,[Jr]:Jr},h=new cs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new wt},radius:{value:4}},vertexShader:nSe,fragmentShader:iSe}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const g=new On;g.setAttribute("position",new In(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new Si(g,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=NA;let m=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(),L=t.getActiveMipmapLevel(),U=t.state;U.setBlending(rf),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=m!==Zc&&this.type===Zc,z=m===Zc&&this.type!==Zc;for(let q=0,F=S.length;q<F;q++){const V=S[q],H=V.shadow;if(H===void 0){console.warn("THREE.WebGLShadowMap:",V,"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 J=this.type!==Zc?{minFilter:ss,magFilter:ss}:{};H.map!==null&&H.map.dispose(),H.map=new Cc(r.x,r.y,J),H.map.texture.name=V.name+".shadowMap",H.camera.updateProjectionMatrix()}t.setRenderTarget(H.map),t.clear();const B=H.getViewportCount();for(let J=0;J<B;J++){const Z=H.getViewport(J);s.set(a.x*Z.x,a.y*Z.y,a.x*Z.z,a.y*Z.w),U.viewport(s),H.updateMatrices(V,J),i=H.getFrustum(),w(A,C,H.camera,V,this.type)}H.isPointLightShadow!==!0&&this.type===Zc&&x(H,C),H.needsUpdate=!1}m=this.type,y.needsUpdate=!1,t.setRenderTarget(D,R,L)};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 Cc(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 L=C.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(L!==void 0)R=L;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===Zc?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===Zc)&&(!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 F=0,V=q.length;F<V;F++){const H=q[F],W=z[H.materialIndex];if(W&&W.visible){const B=_(S,W,D,R);S.onBeforeShadow(t,S,A,C,j,B,H),t.renderBufferDirect(C,null,j,B,S,H),S.onAfterShadow(t,S,A,C,j,B,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 aSe={[g2]:b2,[v2]:_2,[y2]:S2,[Gm]:x2,[b2]:g2,[_2]:v2,[S2]:y2,[x2]:Gm};function sSe(t,e){function n(){let Re=!1;const Le=new ni;let ht=null;const jt=new ni(0,0,0,0);return{setMask:function(st){ht!==st&&!Re&&(t.colorMask(st,st,st,st),ht=st)},setLocked:function(st){Re=st},setClear:function(st,it,bt,Jt,Kt){Kt===!0&&(st*=Jt,it*=Jt,bt*=Jt),Le.set(st,it,bt,Jt),jt.equals(Le)===!1&&(t.clearColor(st,it,bt,Jt),jt.copy(Le))},reset:function(){Re=!1,ht=null,jt.set(-1,0,0,0)}}}function i(){let Re=!1,Le=!1,ht=null,jt=null,st=null;return{setReversed:function(it){if(Le!==it){const bt=e.get("EXT_clip_control");it?bt.clipControlEXT(bt.LOWER_LEFT_EXT,bt.ZERO_TO_ONE_EXT):bt.clipControlEXT(bt.LOWER_LEFT_EXT,bt.NEGATIVE_ONE_TO_ONE_EXT),Le=it;const Jt=st;st=null,this.setClear(Jt)}},getReversed:function(){return Le},setTest:function(it){it?ue(t.DEPTH_TEST):Se(t.DEPTH_TEST)},setMask:function(it){ht!==it&&!Re&&(t.depthMask(it),ht=it)},setFunc:function(it){if(Le&&(it=aSe[it]),jt!==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 Gm: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)}jt=it}},setLocked:function(it){Re=it},setClear:function(it){st!==it&&(Le&&(it=1-it),t.clearDepth(it),st=it)},reset:function(){Re=!1,ht=null,jt=null,st=null,Le=!1}}}function r(){let Re=!1,Le=null,ht=null,jt=null,st=null,it=null,bt=null,Jt=null,Kt=null;return{setTest:function(un){Re||(un?ue(t.STENCIL_TEST):Se(t.STENCIL_TEST))},setMask:function(un){Le!==un&&!Re&&(t.stencilMask(un),Le=un)},setFunc:function(un,Vn,vn){(ht!==un||jt!==Vn||st!==vn)&&(t.stencilFunc(un,Vn,vn),ht=un,jt=Vn,st=vn)},setOp:function(un,Vn,vn){(it!==un||bt!==Vn||Jt!==vn)&&(t.stencilOp(un,Vn,vn),it=un,bt=Vn,Jt=vn)},setLocked:function(un){Re=un},setClear:function(un){Kt!==un&&(t.clearStencil(un),Kt=un)},reset:function(){Re=!1,Le=null,ht=null,jt=null,st=null,it=null,bt=null,Jt=null,Kt=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,m=null,x=null,_=null,w=null,M=null,S=null,A=new Ut(0,0,0),C=0,D=!1,R=null,L=null,U=null,j=null,z=null;const q=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let F=!1,V=0;const H=t.getParameter(t.VERSION);H.indexOf("WebGL")!==-1?(V=parseFloat(/^WebGL (\d)/.exec(H)[1]),F=V>=1):H.indexOf("OpenGL ES")!==-1&&(V=parseFloat(/^OpenGL ES (\d)/.exec(H)[1]),F=V>=2);let W=null,B={};const J=t.getParameter(t.SCISSOR_BOX),Z=t.getParameter(t.VIEWPORT),G=new ni().fromArray(J),de=new ni().fromArray(Z);function oe(Re,Le,ht,jt){const st=new Uint8Array(4),it=t.createTexture();t.bindTexture(Re,it),t.texParameteri(Re,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Re,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let bt=0;bt<ht;bt++)Re===t.TEXTURE_3D||Re===t.TEXTURE_2D_ARRAY?t.texImage3D(Le,0,t.RGBA,1,1,jt,0,t.RGBA,t.UNSIGNED_BYTE,st):t.texImage2D(Le+bt,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,st);return it}const le={};le[t.TEXTURE_2D]=oe(t.TEXTURE_2D,t.TEXTURE_2D,1),le[t.TEXTURE_CUBE_MAP]=oe(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),le[t.TEXTURE_2D_ARRAY]=oe(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),le[t.TEXTURE_3D]=oe(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(Gm),qe(!1),we(VO),ue(t.CULL_FACE),ze(rf);function ue(Re){u[Re]!==!0&&(t.enable(Re),u[Re]=!0)}function Se(Re){u[Re]!==!1&&(t.disable(Re),u[Re]=!1)}function Oe(Re,Le){return f[Re]!==Le?(t.bindFramebuffer(Re,Le),f[Re]=Le,Re===t.DRAW_FRAMEBUFFER&&(f[t.FRAMEBUFFER]=Le),Re===t.FRAMEBUFFER&&(f[t.DRAW_FRAMEBUFFER]=Le),!0):!1}function Be(Re,Le){let ht=d,jt=!1;if(Re){ht=h.get(Le),ht===void 0&&(ht=[],h.set(Le,ht));const st=Re.textures;if(ht.length!==st.length||ht[0]!==t.COLOR_ATTACHMENT0){for(let it=0,bt=st.length;it<bt;it++)ht[it]=t.COLOR_ATTACHMENT0+it;ht.length=st.length,jt=!0}}else ht[0]!==t.BACK&&(ht[0]=t.BACK,jt=!0);jt&&t.drawBuffers(ht)}function je(Re){return g!==Re?(t.useProgram(Re),g=Re,!0):!1}const He={[yd]:t.FUNC_ADD,[ZY]:t.FUNC_SUBTRACT,[QY]:t.FUNC_REVERSE_SUBTRACT};He[eJ]=t.MIN,He[tJ]=t.MAX;const pe={[nJ]:t.ZERO,[iJ]:t.ONE,[rJ]:t.SRC_COLOR,[p2]:t.SRC_ALPHA,[uJ]:t.SRC_ALPHA_SATURATE,[lJ]:t.DST_COLOR,[sJ]:t.DST_ALPHA,[aJ]:t.ONE_MINUS_SRC_COLOR,[m2]:t.ONE_MINUS_SRC_ALPHA,[cJ]:t.ONE_MINUS_DST_COLOR,[oJ]:t.ONE_MINUS_DST_ALPHA,[fJ]:t.CONSTANT_COLOR,[hJ]:t.ONE_MINUS_CONSTANT_COLOR,[dJ]:t.CONSTANT_ALPHA,[pJ]:t.ONE_MINUS_CONSTANT_ALPHA};function ze(Re,Le,ht,jt,st,it,bt,Jt,Kt,un){if(Re===rf){b===!0&&(Se(t.BLEND),b=!1);return}if(b===!1&&(ue(t.BLEND),b=!0),Re!==$Y){if(Re!==y||un!==D){if((m!==yd||w!==yd)&&(t.blendEquation(t.FUNC_ADD),m=yd,w=yd),un)switch(Re){case km: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: ",Re);break}else switch(Re){case km: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: ",Re);break}x=null,_=null,M=null,S=null,A.set(0,0,0),C=0,y=Re,D=un}return}st=st||Le,it=it||ht,bt=bt||jt,(Le!==m||st!==w)&&(t.blendEquationSeparate(He[Le],He[st]),m=Le,w=st),(ht!==x||jt!==_||it!==M||bt!==S)&&(t.blendFuncSeparate(pe[ht],pe[jt],pe[it],pe[bt]),x=ht,_=jt,M=it,S=bt),(Jt.equals(A)===!1||Kt!==C)&&(t.blendColor(Jt.r,Jt.g,Jt.b,Kt),A.copy(Jt),C=Kt),y=Re,D=!1}function Ie(Re,Le){Re.side===Jr?Se(t.CULL_FACE):ue(t.CULL_FACE);let ht=Re.side===Da;Le&&(ht=!ht),qe(ht),Re.blending===km&&Re.transparent===!1?ze(rf):ze(Re.blending,Re.blendEquation,Re.blendSrc,Re.blendDst,Re.blendEquationAlpha,Re.blendSrcAlpha,Re.blendDstAlpha,Re.blendColor,Re.blendAlpha,Re.premultipliedAlpha),s.setFunc(Re.depthFunc),s.setTest(Re.depthTest),s.setMask(Re.depthWrite),a.setMask(Re.colorWrite);const jt=Re.stencilWrite;o.setTest(jt),jt&&(o.setMask(Re.stencilWriteMask),o.setFunc(Re.stencilFunc,Re.stencilRef,Re.stencilFuncMask),o.setOp(Re.stencilFail,Re.stencilZFail,Re.stencilZPass)),Ae(Re.polygonOffset,Re.polygonOffsetFactor,Re.polygonOffsetUnits),Re.alphaToCoverage===!0?ue(t.SAMPLE_ALPHA_TO_COVERAGE):Se(t.SAMPLE_ALPHA_TO_COVERAGE)}function qe(Re){R!==Re&&(Re?t.frontFace(t.CW):t.frontFace(t.CCW),R=Re)}function we(Re){Re!==KY?(ue(t.CULL_FACE),Re!==L&&(Re===VO?t.cullFace(t.BACK):Re===YY?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):Se(t.CULL_FACE),L=Re}function Me(Re){Re!==U&&(F&&t.lineWidth(Re),U=Re)}function Ae(Re,Le,ht){Re?(ue(t.POLYGON_OFFSET_FILL),(j!==Le||z!==ht)&&(t.polygonOffset(Le,ht),j=Le,z=ht)):Se(t.POLYGON_OFFSET_FILL)}function Ne(Re){Re?ue(t.SCISSOR_TEST):Se(t.SCISSOR_TEST)}function Ue(Re){Re===void 0&&(Re=t.TEXTURE0+q-1),W!==Re&&(t.activeTexture(Re),W=Re)}function Qe(Re,Le,ht){ht===void 0&&(W===null?ht=t.TEXTURE0+q-1:ht=W);let jt=B[ht];jt===void 0&&(jt={type:void 0,texture:void 0},B[ht]=jt),(jt.type!==Re||jt.texture!==Le)&&(W!==ht&&(t.activeTexture(ht),W=ht),t.bindTexture(Re,Le||le[Re]),jt.type=Re,jt.texture=Le)}function ae(){const Re=B[W];Re!==void 0&&Re.type!==void 0&&(t.bindTexture(Re.type,null),Re.type=void 0,Re.texture=void 0)}function K(){try{t.compressedTexImage2D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function ce(){try{t.compressedTexImage3D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function he(){try{t.texSubImage2D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function me(){try{t.texSubImage3D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function $(){try{t.compressedTexSubImage2D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function Ve(){try{t.compressedTexSubImage3D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function Xe(){try{t.texStorage2D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function mt(){try{t.texStorage3D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function Ge(){try{t.texImage2D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function Je(){try{t.texImage3D(...arguments)}catch(Re){console.error("THREE.WebGLState:",Re)}}function Ye(Re){G.equals(Re)===!1&&(t.scissor(Re.x,Re.y,Re.z,Re.w),G.copy(Re))}function vt(Re){de.equals(Re)===!1&&(t.viewport(Re.x,Re.y,Re.z,Re.w),de.copy(Re))}function Mt(Re,Le){let ht=c.get(Le);ht===void 0&&(ht=new WeakMap,c.set(Le,ht));let jt=ht.get(Re);jt===void 0&&(jt=t.getUniformBlockIndex(Le,Re.name),ht.set(Re,jt))}function gt(Re,Le){const jt=c.get(Le).get(Re);l.get(Le)!==jt&&(t.uniformBlockBinding(Le,jt,Re.__bindingPointIndex),l.set(Le,jt))}function kt(){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,B={},f={},h=new WeakMap,d=[],g=null,b=!1,y=null,m=null,x=null,_=null,w=null,M=null,S=null,A=new Ut(0,0,0),C=0,D=!1,R=null,L=null,U=null,j=null,z=null,G.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:Se,bindFramebuffer:Oe,drawBuffers:Be,useProgram:je,setBlending:ze,setMaterial:Ie,setFlipSided:qe,setCullFace:we,setLineWidth:Me,setPolygonOffset:Ae,setScissorTest:Ne,activeTexture:Ue,bindTexture:Qe,unbindTexture:ae,compressedTexImage2D:K,compressedTexImage3D:ce,texImage2D:Ge,texImage3D:Je,updateUBOMapping:Mt,uniformBlockBinding:gt,texStorage2D:Xe,texStorage3D:mt,texSubImage2D:he,texSubImage3D:me,compressedTexSubImage2D:$,compressedTexSubImage3D:Ve,scissor:Ye,viewport:vt,reset:kt}}function oSe(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(ae,K){return d?new OffscreenCanvas(ae,K):W1("canvas")}function b(ae,K,ce){let he=1;const me=Qe(ae);if((me.width>ce||me.height>ce)&&(he=ce/Math.max(me.width,me.height)),he<1)if(typeof HTMLImageElement<"u"&&ae instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ae instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ae instanceof ImageBitmap||typeof VideoFrame<"u"&&ae instanceof VideoFrame){const $=Math.floor(he*me.width),Ve=Math.floor(he*me.height);f===void 0&&(f=g($,Ve));const Xe=K?g($,Ve):f;return Xe.width=$,Xe.height=Ve,Xe.getContext("2d").drawImage(ae,0,0,$,Ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+$+"x"+Ve+")."),Xe}else return"data"in ae&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),ae;return ae}function y(ae){return ae.generateMipmaps}function m(ae){t.generateMipmap(ae)}function x(ae){return ae.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:ae.isWebGL3DRenderTarget?t.TEXTURE_3D:ae.isWebGLArrayRenderTarget||ae.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function _(ae,K,ce,he,me=!1){if(ae!==null){if(t[ae]!==void 0)return t[ae];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ae+"'")}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 Ve=me?H1:bi.getTransfer(he);ce===t.FLOAT&&($=t.RGBA32F),ce===t.HALF_FLOAT&&($=t.RGBA16F),ce===t.UNSIGNED_BYTE&&($=Ve===pr?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(ae,K){let ce;return ae?K===null||K===Ac||K===Q0?ce=t.DEPTH24_STENCIL8:K===wr?ce=t.DEPTH32F_STENCIL8:K===Z0&&(ce=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):K===null||K===Ac||K===Q0?ce=t.DEPTH_COMPONENT24:K===wr?ce=t.DEPTH_COMPONENT32F:K===Z0&&(ce=t.DEPTH_COMPONENT16),ce}function M(ae,K){return y(ae)===!0||ae.isFramebufferTexture&&ae.minFilter!==ss&&ae.minFilter!==Vi?Math.log2(Math.max(K.width,K.height))+1:ae.mipmaps!==void 0&&ae.mipmaps.length>0?ae.mipmaps.length:ae.isCompressedTexture&&Array.isArray(ae.image)?K.mipmaps.length:1}function S(ae){const K=ae.target;K.removeEventListener("dispose",S),C(K),K.isVideoTexture&&u.delete(K)}function A(ae){const K=ae.target;K.removeEventListener("dispose",A),R(K)}function C(ae){const K=i.get(ae);if(K.__webglInit===void 0)return;const ce=ae.source,he=h.get(ce);if(he){const me=he[K.__cacheKey];me.usedTimes--,me.usedTimes===0&&D(ae),Object.keys(he).length===0&&h.delete(ce)}i.remove(ae)}function D(ae){const K=i.get(ae);t.deleteTexture(K.__webglTexture);const ce=ae.source,he=h.get(ce);delete he[K.__cacheKey],s.memory.textures--}function R(ae){const K=i.get(ae);if(ae.depthTexture&&(ae.depthTexture.dispose(),i.remove(ae.depthTexture)),ae.isWebGLCubeRenderTarget)for(let he=0;he<6;he++){if(Array.isArray(K.__webglFramebuffer[he]))for(let me=0;me<K.__webglFramebuffer[he].length;me++)t.deleteFramebuffer(K.__webglFramebuffer[he][me]);else t.deleteFramebuffer(K.__webglFramebuffer[he]);K.__webglDepthbuffer&&t.deleteRenderbuffer(K.__webglDepthbuffer[he])}else{if(Array.isArray(K.__webglFramebuffer))for(let he=0;he<K.__webglFramebuffer.length;he++)t.deleteFramebuffer(K.__webglFramebuffer[he]);else t.deleteFramebuffer(K.__webglFramebuffer);if(K.__webglDepthbuffer&&t.deleteRenderbuffer(K.__webglDepthbuffer),K.__webglMultisampledFramebuffer&&t.deleteFramebuffer(K.__webglMultisampledFramebuffer),K.__webglColorRenderbuffer)for(let he=0;he<K.__webglColorRenderbuffer.length;he++)K.__webglColorRenderbuffer[he]&&t.deleteRenderbuffer(K.__webglColorRenderbuffer[he]);K.__webglDepthRenderbuffer&&t.deleteRenderbuffer(K.__webglDepthRenderbuffer)}const ce=ae.textures;for(let he=0,me=ce.length;he<me;he++){const $=i.get(ce[he]);$.__webglTexture&&(t.deleteTexture($.__webglTexture),s.memory.textures--),i.remove(ce[he])}i.remove(ae)}let L=0;function U(){L=0}function j(){const ae=L;return ae>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+ae+" texture units while this GPU supports only "+r.maxTextures),L+=1,ae}function z(ae){const K=[];return K.push(ae.wrapS),K.push(ae.wrapT),K.push(ae.wrapR||0),K.push(ae.magFilter),K.push(ae.minFilter),K.push(ae.anisotropy),K.push(ae.internalFormat),K.push(ae.format),K.push(ae.type),K.push(ae.generateMipmaps),K.push(ae.premultiplyAlpha),K.push(ae.flipY),K.push(ae.unpackAlignment),K.push(ae.colorSpace),K.join()}function q(ae,K){const ce=i.get(ae);if(ae.isVideoTexture&&Ne(ae),ae.isRenderTargetTexture===!1&&ae.isExternalTexture!==!0&&ae.version>0&&ce.__version!==ae.version){const he=ae.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{le(ce,ae,K);return}}else ae.isExternalTexture&&(ce.__webglTexture=ae.sourceTexture?ae.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,ce.__webglTexture,t.TEXTURE0+K)}function F(ae,K){const ce=i.get(ae);if(ae.isRenderTargetTexture===!1&&ae.version>0&&ce.__version!==ae.version){le(ce,ae,K);return}n.bindTexture(t.TEXTURE_2D_ARRAY,ce.__webglTexture,t.TEXTURE0+K)}function V(ae,K){const ce=i.get(ae);if(ae.isRenderTargetTexture===!1&&ae.version>0&&ce.__version!==ae.version){le(ce,ae,K);return}n.bindTexture(t.TEXTURE_3D,ce.__webglTexture,t.TEXTURE0+K)}function H(ae,K){const ce=i.get(ae);if(ae.version>0&&ce.__version!==ae.version){ue(ce,ae,K);return}n.bindTexture(t.TEXTURE_CUBE_MAP,ce.__webglTexture,t.TEXTURE0+K)}const W={[Gd]:t.REPEAT,[xa]:t.CLAMP_TO_EDGE,[$0]:t.MIRRORED_REPEAT},B={[ss]:t.NEAREST,[LA]:t.NEAREST_MIPMAP_NEAREST,[lm]:t.NEAREST_MIPMAP_LINEAR,[Vi]:t.LINEAR,[x0]:t.LINEAR_MIPMAP_NEAREST,[vc]:t.LINEAR_MIPMAP_LINEAR},J={[RJ]:t.NEVER,[LJ]:t.ALWAYS,[kJ]:t.LESS,[FP]:t.LEQUAL,[DJ]:t.EQUAL,[NJ]:t.GEQUAL,[OJ]:t.GREATER,[IJ]:t.NOTEQUAL};function Z(ae,K){if(K.type===wr&&e.has("OES_texture_float_linear")===!1&&(K.magFilter===Vi||K.magFilter===x0||K.magFilter===lm||K.magFilter===vc||K.minFilter===Vi||K.minFilter===x0||K.minFilter===lm||K.minFilter===vc)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(ae,t.TEXTURE_WRAP_S,W[K.wrapS]),t.texParameteri(ae,t.TEXTURE_WRAP_T,W[K.wrapT]),(ae===t.TEXTURE_3D||ae===t.TEXTURE_2D_ARRAY)&&t.texParameteri(ae,t.TEXTURE_WRAP_R,W[K.wrapR]),t.texParameteri(ae,t.TEXTURE_MAG_FILTER,B[K.magFilter]),t.texParameteri(ae,t.TEXTURE_MIN_FILTER,B[K.minFilter]),K.compareFunction&&(t.texParameteri(ae,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(ae,t.TEXTURE_COMPARE_FUNC,J[K.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(K.magFilter===ss||K.minFilter!==lm&&K.minFilter!==vc||K.type===wr&&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(ae,ce.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(K.anisotropy,r.getMaxAnisotropy())),i.get(K).__currentAnisotropy=K.anisotropy}}}function G(ae,K){let ce=!1;ae.__webglInit===void 0&&(ae.__webglInit=!0,K.addEventListener("dispose",S));const he=K.source;let me=h.get(he);me===void 0&&(me={},h.set(he,me));const $=z(K);if($!==ae.__cacheKey){me[$]===void 0&&(me[$]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,ce=!0),me[$].usedTimes++;const Ve=me[ae.__cacheKey];Ve!==void 0&&(me[ae.__cacheKey].usedTimes--,Ve.usedTimes===0&&D(K)),ae.__cacheKey=$,ae.__webglTexture=me[$].texture}return ce}function de(ae,K,ce){return Math.floor(Math.floor(ae/ce)/K)}function oe(ae,K,ce,he){const $=ae.updateRanges;if($.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,K.width,K.height,ce,he,K.data);else{$.sort((Je,Ye)=>Je.start-Ye.start);let Ve=0;for(let Je=1;Je<$.length;Je++){const Ye=$[Ve],vt=$[Je],Mt=Ye.start+Ye.count,gt=de(vt.start,K.width,4),kt=de(Ye.start,K.width,4);vt.start<=Mt+1&&gt===kt&&de(vt.start+vt.count-1,K.width,4)===gt?Ye.count=Math.max(Ye.count,vt.start+vt.count-Ye.start):(++Ve,$[Ve]=vt)}$.length=Ve+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,Ye=$.length;Je<Ye;Je++){const vt=$[Je],Mt=Math.floor(vt.start/4),gt=Math.ceil(vt.count/4),kt=Mt%K.width,Re=Math.floor(Mt/K.width),Le=gt,ht=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,kt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Re),n.texSubImage2D(t.TEXTURE_2D,0,kt,Re,Le,ht,ce,he,K.data)}ae.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,Xe),t.pixelStorei(t.UNPACK_SKIP_PIXELS,mt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Ge)}}function le(ae,K,ce){let he=t.TEXTURE_2D;(K.isDataArrayTexture||K.isCompressedArrayTexture)&&(he=t.TEXTURE_2D_ARRAY),K.isData3DTexture&&(he=t.TEXTURE_3D);const me=G(ae,K),$=K.source;n.bindTexture(he,ae.__webglTexture,t.TEXTURE0+ce);const Ve=i.get($);if($.version!==Ve.__version||me===!0){n.activeTexture(t.TEXTURE0+ce);const Xe=bi.getPrimaries(bi.workingColorSpace),mt=K.colorSpace===su?null:bi.getPrimaries(K.colorSpace),Ge=K.colorSpace===su||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=Ue(K,Je);const Ye=a.convert(K.format,K.colorSpace),vt=a.convert(K.type);let Mt=_(K.internalFormat,Ye,vt,K.colorSpace,K.isVideoTexture);Z(he,K);let gt;const kt=K.mipmaps,Re=K.isVideoTexture!==!0,Le=Ve.__version===void 0||me===!0,ht=$.dataReady,jt=M(K,Je);if(K.isDepthTexture)Mt=w(K.format===tv,K.type),Le&&(Re?n.texStorage2D(t.TEXTURE_2D,1,Mt,Je.width,Je.height):n.texImage2D(t.TEXTURE_2D,0,Mt,Je.width,Je.height,0,Ye,vt,null));else if(K.isDataTexture)if(kt.length>0){Re&&Le&&n.texStorage2D(t.TEXTURE_2D,jt,Mt,kt[0].width,kt[0].height);for(let st=0,it=kt.length;st<it;st++)gt=kt[st],Re?ht&&n.texSubImage2D(t.TEXTURE_2D,st,0,0,gt.width,gt.height,Ye,vt,gt.data):n.texImage2D(t.TEXTURE_2D,st,Mt,gt.width,gt.height,0,Ye,vt,gt.data);K.generateMipmaps=!1}else Re?(Le&&n.texStorage2D(t.TEXTURE_2D,jt,Mt,Je.width,Je.height),ht&&oe(K,Je,Ye,vt)):n.texImage2D(t.TEXTURE_2D,0,Mt,Je.width,Je.height,0,Ye,vt,Je.data);else if(K.isCompressedTexture)if(K.isCompressedArrayTexture){Re&&Le&&n.texStorage3D(t.TEXTURE_2D_ARRAY,jt,Mt,kt[0].width,kt[0].height,Je.depth);for(let st=0,it=kt.length;st<it;st++)if(gt=kt[st],K.format!==Qr)if(Ye!==null)if(Re){if(ht)if(K.layerUpdates.size>0){const bt=nI(gt.width,gt.height,K.format,K.type);for(const Jt of K.layerUpdates){const Kt=gt.data.subarray(Jt*bt/gt.data.BYTES_PER_ELEMENT,(Jt+1)*bt/gt.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,st,0,0,Jt,gt.width,gt.height,1,Ye,Kt)}K.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,st,0,0,0,gt.width,gt.height,Je.depth,Ye,gt.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,st,Mt,gt.width,gt.height,Je.depth,0,gt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Re?ht&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,st,0,0,0,gt.width,gt.height,Je.depth,Ye,vt,gt.data):n.texImage3D(t.TEXTURE_2D_ARRAY,st,Mt,gt.width,gt.height,Je.depth,0,Ye,vt,gt.data)}else{Re&&Le&&n.texStorage2D(t.TEXTURE_2D,jt,Mt,kt[0].width,kt[0].height);for(let st=0,it=kt.length;st<it;st++)gt=kt[st],K.format!==Qr?Ye!==null?Re?ht&&n.compressedTexSubImage2D(t.TEXTURE_2D,st,0,0,gt.width,gt.height,Ye,gt.data):n.compressedTexImage2D(t.TEXTURE_2D,st,Mt,gt.width,gt.height,0,gt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Re?ht&&n.texSubImage2D(t.TEXTURE_2D,st,0,0,gt.width,gt.height,Ye,vt,gt.data):n.texImage2D(t.TEXTURE_2D,st,Mt,gt.width,gt.height,0,Ye,vt,gt.data)}else if(K.isDataArrayTexture)if(Re){if(Le&&n.texStorage3D(t.TEXTURE_2D_ARRAY,jt,Mt,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 bt=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,Ye,vt,bt)}K.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Je.width,Je.height,Je.depth,Ye,vt,Je.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Mt,Je.width,Je.height,Je.depth,0,Ye,vt,Je.data);else if(K.isData3DTexture)Re?(Le&&n.texStorage3D(t.TEXTURE_3D,jt,Mt,Je.width,Je.height,Je.depth),ht&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Je.width,Je.height,Je.depth,Ye,vt,Je.data)):n.texImage3D(t.TEXTURE_3D,0,Mt,Je.width,Je.height,Je.depth,0,Ye,vt,Je.data);else if(K.isFramebufferTexture){if(Le)if(Re)n.texStorage2D(t.TEXTURE_2D,jt,Mt,Je.width,Je.height);else{let st=Je.width,it=Je.height;for(let bt=0;bt<jt;bt++)n.texImage2D(t.TEXTURE_2D,bt,Mt,st,it,0,Ye,vt,null),st>>=1,it>>=1}}else if(kt.length>0){if(Re&&Le){const st=Qe(kt[0]);n.texStorage2D(t.TEXTURE_2D,jt,Mt,st.width,st.height)}for(let st=0,it=kt.length;st<it;st++)gt=kt[st],Re?ht&&n.texSubImage2D(t.TEXTURE_2D,st,0,0,Ye,vt,gt):n.texImage2D(t.TEXTURE_2D,st,Mt,Ye,vt,gt);K.generateMipmaps=!1}else if(Re){if(Le){const st=Qe(Je);n.texStorage2D(t.TEXTURE_2D,jt,Mt,st.width,st.height)}ht&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Ye,vt,Je)}else n.texImage2D(t.TEXTURE_2D,0,Mt,Ye,vt,Je);y(K)&&m(he),Ve.__version=$.version,K.onUpdate&&K.onUpdate(K)}ae.__version=K.version}function ue(ae,K,ce){if(K.image.length!==6)return;const he=G(ae,K),me=K.source;n.bindTexture(t.TEXTURE_CUBE_MAP,ae.__webglTexture,t.TEXTURE0+ce);const $=i.get(me);if(me.version!==$.__version||he===!0){n.activeTexture(t.TEXTURE0+ce);const Ve=bi.getPrimaries(bi.workingColorSpace),Xe=K.colorSpace===su?null:bi.getPrimaries(K.colorSpace),mt=K.colorSpace===su||Ve===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,Ye=[];for(let it=0;it<6;it++)!Ge&&!Je?Ye[it]=b(K.image[it],!0,r.maxCubemapSize):Ye[it]=Je?K.image[it].image:K.image[it],Ye[it]=Ue(K,Ye[it]);const vt=Ye[0],Mt=a.convert(K.format,K.colorSpace),gt=a.convert(K.type),kt=_(K.internalFormat,Mt,gt,K.colorSpace),Re=K.isVideoTexture!==!0,Le=$.__version===void 0||he===!0,ht=me.dataReady;let jt=M(K,vt);Z(t.TEXTURE_CUBE_MAP,K);let st;if(Ge){Re&&Le&&n.texStorage2D(t.TEXTURE_CUBE_MAP,jt,kt,vt.width,vt.height);for(let it=0;it<6;it++){st=Ye[it].mipmaps;for(let bt=0;bt<st.length;bt++){const Jt=st[bt];K.format!==Qr?Mt!==null?Re?ht&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt,0,0,Jt.width,Jt.height,Mt,Jt.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt,kt,Jt.width,Jt.height,0,Jt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Re?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt,0,0,Jt.width,Jt.height,Mt,gt,Jt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt,kt,Jt.width,Jt.height,0,Mt,gt,Jt.data)}}}else{if(st=K.mipmaps,Re&&Le){st.length>0&&jt++;const it=Qe(Ye[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,jt,kt,it.width,it.height)}for(let it=0;it<6;it++)if(Je){Re?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,Ye[it].width,Ye[it].height,Mt,gt,Ye[it].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,kt,Ye[it].width,Ye[it].height,0,Mt,gt,Ye[it].data);for(let bt=0;bt<st.length;bt++){const Kt=st[bt].image[it].image;Re?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt+1,0,0,Kt.width,Kt.height,Mt,gt,Kt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt+1,kt,Kt.width,Kt.height,0,Mt,gt,Kt.data)}}else{Re?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,Mt,gt,Ye[it]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,kt,Mt,gt,Ye[it]);for(let bt=0;bt<st.length;bt++){const Jt=st[bt];Re?ht&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt+1,0,0,Mt,gt,Jt.image[it]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,bt+1,kt,Mt,gt,Jt.image[it])}}}y(K)&&m(t.TEXTURE_CUBE_MAP),$.__version=me.version,K.onUpdate&&K.onUpdate(K)}ae.__version=K.version}function Se(ae,K,ce,he,me,$){const Ve=a.convert(ce.format,ce.colorSpace),Xe=a.convert(ce.type),mt=_(ce.internalFormat,Ve,Xe,ce.colorSpace),Ge=i.get(K),Je=i.get(ce);if(Je.__renderTarget=K,!Ge.__hasExternalTextures){const Ye=Math.max(1,K.width>>$),vt=Math.max(1,K.height>>$);me===t.TEXTURE_3D||me===t.TEXTURE_2D_ARRAY?n.texImage3D(me,$,mt,Ye,vt,K.depth,0,Ve,Xe,null):n.texImage2D(me,$,mt,Ye,vt,0,Ve,Xe,null)}n.bindFramebuffer(t.FRAMEBUFFER,ae),Ae(K)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,he,me,Je.__webglTexture,0,Me(K)):(me===t.TEXTURE_2D||me>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,he,me,Je.__webglTexture,$),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Oe(ae,K,ce){if(t.bindRenderbuffer(t.RENDERBUFFER,ae),K.depthBuffer){const he=K.depthTexture,me=he&&he.isDepthTexture?he.type:null,$=w(K.stencilBuffer,me),Ve=K.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Xe=Me(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,Ve,t.RENDERBUFFER,ae)}else{const he=K.textures;for(let me=0;me<he.length;me++){const $=he[me],Ve=a.convert($.format,$.colorSpace),Xe=a.convert($.type),mt=_($.internalFormat,Ve,Xe,$.colorSpace),Ge=Me(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 Be(ae,K){if(K&&K.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,ae),!(K.depthTexture&&K.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const he=i.get(K.depthTexture);he.__renderTarget=K,(!he.__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=he.__webglTexture,$=Me(K);if(K.depthTexture.format===ev)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===tv)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 je(ae){const K=i.get(ae),ce=ae.isWebGLCubeRenderTarget===!0;if(K.__boundDepthTexture!==ae.depthTexture){const he=ae.depthTexture;if(K.__depthDisposeCallback&&K.__depthDisposeCallback(),he){const me=()=>{delete K.__boundDepthTexture,delete K.__depthDisposeCallback,he.removeEventListener("dispose",me)};he.addEventListener("dispose",me),K.__depthDisposeCallback=me}K.__boundDepthTexture=he}if(ae.depthTexture&&!K.__autoAllocateDepthBuffer){if(ce)throw new Error("target.depthTexture not supported in Cube render targets");const he=ae.texture.mipmaps;he&&he.length>0?Be(K.__webglFramebuffer[0],ae):Be(K.__webglFramebuffer,ae)}else if(ce){K.__webglDepthbuffer=[];for(let he=0;he<6;he++)if(n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer[he]),K.__webglDepthbuffer[he]===void 0)K.__webglDepthbuffer[he]=t.createRenderbuffer(),Oe(K.__webglDepthbuffer[he],ae,!1);else{const me=ae.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,$=K.__webglDepthbuffer[he];t.bindRenderbuffer(t.RENDERBUFFER,$),t.framebufferRenderbuffer(t.FRAMEBUFFER,me,t.RENDERBUFFER,$)}}else{const he=ae.texture.mipmaps;if(he&&he.length>0?n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,K.__webglFramebuffer),K.__webglDepthbuffer===void 0)K.__webglDepthbuffer=t.createRenderbuffer(),Oe(K.__webglDepthbuffer,ae,!1);else{const me=ae.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 He(ae,K,ce){const he=i.get(ae);K!==void 0&&Se(he.__webglFramebuffer,ae,ae.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ce!==void 0&&je(ae)}function pe(ae){const K=ae.texture,ce=i.get(ae),he=i.get(K);ae.addEventListener("dispose",A);const me=ae.textures,$=ae.isWebGLCubeRenderTarget===!0,Ve=me.length>1;if(Ve||(he.__webglTexture===void 0&&(he.__webglTexture=t.createTexture()),he.__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(Ve)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(ae.samples>0&&Ae(ae)===!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),Ye=_(mt.internalFormat,Ge,Je,mt.colorSpace,ae.isXRRenderTarget===!0),vt=Me(ae);t.renderbufferStorageMultisample(t.RENDERBUFFER,vt,Ye,ae.width,ae.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Xe,t.RENDERBUFFER,ce.__webglColorRenderbuffer[Xe])}t.bindRenderbuffer(t.RENDERBUFFER,null),ae.depthBuffer&&(ce.__webglDepthRenderbuffer=t.createRenderbuffer(),Oe(ce.__webglDepthRenderbuffer,ae,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if($){n.bindTexture(t.TEXTURE_CUBE_MAP,he.__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++)Se(ce.__webglFramebuffer[Xe][mt],ae,K,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,mt);else Se(ce.__webglFramebuffer[Xe],ae,K,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+Xe,0);y(K)&&m(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(Ve){for(let Xe=0,mt=me.length;Xe<mt;Xe++){const Ge=me[Xe],Je=i.get(Ge);let Ye=t.TEXTURE_2D;(ae.isWebGL3DRenderTarget||ae.isWebGLArrayRenderTarget)&&(Ye=ae.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Ye,Je.__webglTexture),Z(Ye,Ge),Se(ce.__webglFramebuffer,ae,Ge,t.COLOR_ATTACHMENT0+Xe,Ye,0),y(Ge)&&m(Ye)}n.unbindTexture()}else{let Xe=t.TEXTURE_2D;if((ae.isWebGL3DRenderTarget||ae.isWebGLArrayRenderTarget)&&(Xe=ae.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Xe,he.__webglTexture),Z(Xe,K),K.mipmaps&&K.mipmaps.length>0)for(let mt=0;mt<K.mipmaps.length;mt++)Se(ce.__webglFramebuffer[mt],ae,K,t.COLOR_ATTACHMENT0,Xe,mt);else Se(ce.__webglFramebuffer,ae,K,t.COLOR_ATTACHMENT0,Xe,0);y(K)&&m(Xe),n.unbindTexture()}ae.depthBuffer&&je(ae)}function ze(ae){const K=ae.textures;for(let ce=0,he=K.length;ce<he;ce++){const me=K[ce];if(y(me)){const $=x(ae),Ve=i.get(me).__webglTexture;n.bindTexture($,Ve),m($),n.unbindTexture()}}}const Ie=[],qe=[];function we(ae){if(ae.samples>0){if(Ae(ae)===!1){const K=ae.textures,ce=ae.width,he=ae.height;let me=t.COLOR_BUFFER_BIT;const $=ae.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ve=i.get(ae),Xe=K.length>1;if(Xe)for(let Ge=0;Ge<K.length;Ge++)n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,Ve.__webglMultisampledFramebuffer);const mt=ae.texture.mipmaps;mt&&mt.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglFramebuffer);for(let Ge=0;Ge<K.length;Ge++){if(ae.resolveDepthBuffer&&(ae.depthBuffer&&(me|=t.DEPTH_BUFFER_BIT),ae.stencilBuffer&&ae.resolveStencilBuffer&&(me|=t.STENCIL_BUFFER_BIT)),Xe){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,Ve.__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,he,0,0,ce,he,me,t.NEAREST),l===!0&&(Ie.length=0,qe.length=0,Ie.push(t.COLOR_ATTACHMENT0+Ge),ae.depthBuffer&&ae.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,Ve.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.RENDERBUFFER,Ve.__webglColorRenderbuffer[Ge]);const Je=i.get(K[Ge]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,Ve.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+Ge,t.TEXTURE_2D,Je,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ve.__webglMultisampledFramebuffer)}else if(ae.depthBuffer&&ae.resolveDepthBuffer===!1&&l){const K=ae.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[K])}}}function Me(ae){return Math.min(r.maxSamples,ae.samples)}function Ae(ae){const K=i.get(ae);return ae.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&K.__useRenderToTexture!==!1}function Ne(ae){const K=s.render.frame;u.get(ae)!==K&&(u.set(ae,K),ae.update())}function Ue(ae,K){const ce=ae.colorSpace,he=ae.format,me=ae.type;return ae.isCompressedTexture===!0||ae.isVideoTexture===!0||ce!==Su&&ce!==su&&(bi.getTransfer(ce)===pr?(he!==Qr||me!==Ao)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ce)),K}function Qe(ae){return typeof HTMLImageElement<"u"&&ae instanceof HTMLImageElement?(c.width=ae.naturalWidth||ae.width,c.height=ae.naturalHeight||ae.height):typeof VideoFrame<"u"&&ae instanceof VideoFrame?(c.width=ae.displayWidth,c.height=ae.displayHeight):(c.width=ae.width,c.height=ae.height),c}this.allocateTextureUnit=j,this.resetTextureUnits=U,this.setTexture2D=q,this.setTexture2DArray=F,this.setTexture3D=V,this.setTextureCube=H,this.rebindTextures=He,this.setupRenderTarget=pe,this.updateRenderTargetMipmap=ze,this.updateMultisampleRenderTarget=we,this.setupDepthRenderbuffer=je,this.setupFrameBufferTexture=Se,this.useMultisampledRTT=Ae}function gU(t,e){function n(i,r=su){let a;const s=bi.getTransfer(r);if(i===Ao)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===Z0)return t.UNSIGNED_SHORT;if(i===Hv)return t.INT;if(i===Ac)return t.UNSIGNED_INT;if(i===wr)return t.FLOAT;if(i===rs)return t.HALF_FLOAT;if(i===OP)return t.ALPHA;if(i===IP)return t.RGB;if(i===Qr)return t.RGBA;if(i===ev)return t.DEPTH_COMPONENT;if(i===tv)return t.DEPTH_STENCIL;if(i===Th)return t.RED;if(i===Vv)return t.RED_INTEGER;if(i===zA)return t.RG;if(i===U_)return t.RG_INTEGER;if(i===Gv)return t.RGBA_INTEGER;if(i===Zx||i===Qx||i===e1||i===t1)if(s===pr)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(i===Zx)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Qx)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===e1)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===t1)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(i===Zx)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Qx)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===e1)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===t1)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===pr?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(i===R2)return s===pr?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===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===D2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===O2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===I2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===N2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===L2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===P2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===U2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===F2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===B2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===z2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===j2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===H2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===V2)return s===pr?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===n1||i===G2||i===W2)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(i===n1)return s===pr?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===n1)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===Q0?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}class P$ extends nr{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}}const lSe=`
void main() {

	gl_Position = vec4( position, 1.0 );

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

No matching component was found for:
  `)+p.join(" > ")}return null},Ti.getPublicRootInstance=function(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 27:case 5:return uy(p.child.stateNode);default:return p.child.stateNode}},Ti.injectIntoDevTools=function(){var p={bundleType:0,version:jne,rendererPackageName:Hne,currentDispatcherRef:Kn,findFiberByHostInstance:p9,reconcilerVersion:"19.0.0"};if(f9!==null&&(p.rendererConfig=f9),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")p=!1;else{var v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(v.isDisabled||!v.supportsFiber)p=!0;else{try{dy=v.inject(p),il=v}catch{}p=!!v.checkDCE}}return p},Ti.isAlreadyRendering=function(){return!1},Ti.observeVisibleRects=function(p,v,T,O){if(!fy)throw Error(r(363));p=sR(p,v);var P=fie(p,T,O).disconnect;return{disconnect:function(){P()}}},Ti.shouldError=function(){return null},Ti.shouldSuspend=function(){return!1},Ti.startHostTransition=function(p,v,T,O){if(p.tag!==5)throw Error(r(476));var P=re(p).queue;Y(p,P,v,Eg,T===null?i:function(){var X=re(p).next.queue;return En(p,X,{},el()),T(O)})},Ti.updateContainer=function(p,v,T,O){var P=v.current,X=el();return r9(P,X,p,v,T,O),X},Ti.updateContainerSync=function(p,v,T,O){return v.tag===0&&lp(),r9(v.current,2,p,v,T,O),2},Ti},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(X$);var VSe=X$.exports;q$.exports=VSe;var GSe=q$.exports;const WSe=Rc(GSe);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 J$(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const yU=J$(I.createContext(null));let $$=class extends I.Component{render(){return I.createElement(yU.Provider,{value:this._reactInternals},this.props.children)}};function Z$(){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 qSe=Symbol.for("react.context"),XSe=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===qSe;function KSe(){const t=Z$(),[e]=I.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;XSe(i)&&i!==yU&&!e.has(i)&&e.set(i,I.use(J$(i))),n=n.return}return e}function Q$(){const t=KSe();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($$,{...e})),[t])}function eZ(t){let e=t.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const tZ=t=>t&&t.isOrthographicCamera,YSe=t=>t&&t.hasOwnProperty("current"),JSe=t=>t!=null&&(typeof t=="string"||typeof t=="number"||t.isColor),W_=((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 W_(()=>void(e.current=t),[t]),e}function $Se(){const t=Z$(),e=Q$();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 ZSe({set:t}){return W_(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}const QSe=(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 nZ(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 bb(t){var e;return(e=t.__r3f)==null?void 0:e.root.getState()}const Yr={obj:t=>t===Object(t)&&!Yr.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(Yr.str(t)||Yr.num(t)||Yr.boo(t))return t===e;const a=Yr.obj(t);if(a&&i==="reference")return t===e;const s=Yr.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(!Yr.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(Yr.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 ewe(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 twe(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 iZ=["children","key","ref"];function nwe(t){const e={};for(const n in t)iZ.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:nwe(i),object:r,eventCount:0,handlers:{},isHidden:!1},r&&(r.__r3f=a)),a}function J1(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(Yr.str(e.props.attach)){if(l5.test(e.props.attach)){const r=e.props.attach.replace(l5,""),{root:a,key:s}=J1(t.object,r);Array.isArray(a[s])||(a[s]=[])}const{root:n,key:i}=J1(t.object,e.props.attach);e.previousAttach=n[i],n[i]=e.object}else Yr.fun(e.props.attach)&&(e.previousAttach=e.props.attach(t.object,e.object))}function rT(t,e){if(Yr.str(e.props.attach)){const{root:n,key:i}=J1(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=[...iZ,"args","dispose","attach","object","onUpdate","dispose"],c5=new Map;function iwe(t){let e=c5.get(t.constructor);try{e||(e=new t.constructor,c5.set(t.constructor,e))}catch{}return e}function rwe(t,e){const n={};for(const i in e)if(!sI.includes(i)&&!Yr.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}=J1(t.object,i);if(r.constructor&&r.constructor.length===0){const s=iwe(r);Yr.und(s)||(n[a]=s[a])}else n[a]=0}return n}const awe=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],swe=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function ou(t,e){var n;const i=t.__r3f,r=i&&eZ(i).getState(),a=i?.eventCount;for(const o in e){let l=e[o];if(sI.includes(o))continue;if(i&&swe.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}=J1(t,o);if(f instanceof sv&&l instanceof sv)f.mask=l.mask;else if(f instanceof Ut&&JSe(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&&awe.includes(u)&&(s=c[u])!=null&&s.isTexture&&c[u].format===Qr&&c[u].type===Ao&&(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&&Zv(i),t}function Zv(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 rZ(t,e){t.manual||(tZ(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 yo=t=>t?.isObject3D;function $w(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function aZ(t,e,n,i){const r=n.get(e);r&&(n.delete(e),n.size===0&&(t.delete(i),r.target.releasePointerCapture(i)))}function owe(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)=>{aZ(n.capturedMap,e,i,r)})}function lwe(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 m=0;m<d.length;m++){const x=bb(d[m]);x&&(x.raycaster.camera=void 0)}u.previousRoot||u.events.compute==null||u.events.compute(l,u);function g(m){const x=bb(m);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(m,!0):[]}let b=d.flatMap(g).sort((m,x)=>{const _=bb(m.object),w=bb(x.object);return!_||!w?m.distance-x.distance:w.events.priority-_.events.priority||m.distance-x.distance}).filter(m=>{const x=$w(m);return f.has(x)?!1:(f.add(x),!0)});u.events.filter&&(b=u.events.filter(b,u));for(const m of b){let x=m.object;for(;x;){var y;(y=x.__r3f)!=null&&y.eventCount&&h.push({...m,eventObject:x}),x=x.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let m of u.internal.capturedMap.get(l.pointerId).values())f.has($w(m.intersection))||h.push(m.intersection);return h}function r(l,c,u,f){if(l.length){const h={stopped:!1};for(const d of l){let g=bb(d.object);if(g||d.object.traverseAncestors(b=>{const y=bb(b);if(y)return g=y,!1}),g){const{raycaster:b,pointer:y,camera:m,internal:x}=g,_=new te(y.x,y.y,0).unproject(m),w=D=>{var R,L;return(R=(L=x.capturedMap.get(D))==null?void 0:L.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&&aZ(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:m,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),m=g?e(u):0;l==="onPointerDown"&&(h.initialClick=[u.offsetX,u.offsetY],h.initialHits=y.map(_=>_.eventObject)),g&&!y.length&&m<=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,m,x)}}return{handlePointer:o}}const u5=t=>!!(t!=null&&t.render),_U=I.createContext(null),cwe=(t,e)=>{const n=V$((o,l)=>{const c=new te,u=new te,f=new te;function h(m=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=m.getWorldPosition(c).distanceTo(f);if(tZ(m))return{width:w/m.zoom,height:M/m.zoom,top:S,left:A,factor:1,distance:D,aspect:C};{const R=m.fov*Math.PI/180,L=2*Math.tan(R/2)*D,U=L*(w/M);return{width:U,height:L,top:S,left:A,factor:w/U,distance:D,aspect:C}}}let d;const g=m=>o(x=>({performance:{...x.performance,current:m}})),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:(m=1)=>t(l(),m),advance:(m,x)=>e(m,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 m=l();d&&clearTimeout(d),m.performance.current!==m.performance.min&&g(m.performance.min),d=setTimeout(()=>g(l().performance.max),m.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:m=>o(x=>({...x,events:{...x.events,...m}})),setSize:(m,x,_=0,w=0)=>{const M=l().camera,S={width:m,height:x,top:_,left:w};o(A=>({size:S,viewport:{...A.viewport,...h(M,u,S)}}))},setDpr:m=>o(x=>{const _=nZ(m);return{viewport:{...x.viewport,dpr:_,initialDpr:x.viewport.initialDpr||_}}}),setFrameloop:(m="always")=>{const x=l().clock;x.stop(),x.elapsedTime=0,m!=="never"&&(x.start(),x.elapsedTime=0),o(()=>({frameloop:m}))},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:(m,x,_)=>{const w=l().internal;return w.priority=w.priority+(x>0?1:0),w.subscribers.push({ref:m,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!==m))}}}}}),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,rZ(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 ki(t=n=>n,e){return SU()(t,e)}function oa(t,e=0){const n=SU(),i=n.getState().internal.subscribe,r=xU(t);return W_(()=>i(r,e,n),[e,i,n]),null}const f5=new WeakMap,uwe=t=>{var e;return typeof t=="function"&&(t==null||(e=t.prototype)==null?void 0:e.constructor)===t};function sZ(t,e){return function(n,...i){let r;return uwe(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=>{yo(l?.scene)&&Object.assign(l,ewe(l.scene)),s(l)},e,l=>o(new Error(`Could not load ${a}: ${l?.message}`))))))}}function dv(t,e,n,i){const r=Array.isArray(e)?e:[e],a=zSe(sZ(n,i),[t,...r],{equal:Yr.equ});return Array.isArray(e)?a:a[0]}dv.preload=function(t,e,n){const i=Array.isArray(e)?e:[e];return jSe(sZ(n),[t,...i])};dv.clear=function(t,e){const n=Array.isArray(e)?e:[e];return HSe([t,...n])};function fwe(t){const e=WSe(t);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:I.version}),e}const oZ=0,pv={},hwe=/^three(?=[A-Z])/,vC=t=>`${t[0].toUpperCase()}${t.slice(1)}`;let dwe=0;const pwe=t=>typeof t=="function";function q_(t){if(pwe(t)){const e=`${dwe++}`;return pv[e]=t,e}else Object.assign(pv,t)}function lZ(t,e){const n=vC(t),i=pv[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 mwe(t,e,n){var i;return t=vC(t)in pv?t:t.replace(hwe,""),lZ(t,e),t==="primitive"&&(i=e.object)!=null&&i.__r3f&&delete e.object.__r3f,nT(e.object,n,t,e)}function gwe(t){if(!t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?rT(t.parent,t):yo(t.object)&&(t.object.visible=!1),t.isHidden=!0,Zv(t)}}function cZ(t){if(t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?iT(t.parent,t):yo(t.object)&&t.props.visible!==!1&&(t.object.visible=!0),t.isHidden=!1,Zv(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=pv[vC(e.type)];e.object=(r=e.props.object)!=null?r:new s(...(a=e.props.args)!=null?a:[]),e.object.__r3f=e}if(ou(e.object,e.props),e.props.attach)iT(t,e);else if(yo(e.object)&&yo(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);Zv(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 uZ(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):yo(e.object)&&yo(t.object)&&(t.object.remove(e.object),owe(eZ(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"&&uZ(e.object),n===void 0&&Zv(e)}function bwe(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 vwe(){for(const[n]of mM){const i=n.parent;if(i){n.props.attach?rT(i,n):yo(n.object)&&yo(i.object)&&i.object.remove(n.object);for(const r of n.children)r.props.attach?rT(n,r):yo(r.object)&&yo(n.object)&&n.object.remove(r.object)}n.isHidden&&cZ(n),n.object.__r3f&&delete n.object.__r3f,n.type!=="primitive"&&uZ(n.object)}for(const[n,i,r]of mM){n.props=i;const a=n.parent;if(a){var t,e;const s=pv[vC(n.type)];n.object=(t=n.props.object)!=null?t:new s(...(e=n.props.args)!=null?e:[]),n.object.__r3f=n,bwe(r,n.object),ou(n.object,n.props),n.props.attach?iT(a,n):yo(n.object)&&yo(a.object)&&a.object.add(n.object);for(const o of n.children)o.props.attach?iT(n,o):yo(o.object)&&yo(n.object)&&n.object.add(o.object);Zv(n)}}mM.length=0}const qk=()=>{},d5={};let Zw=oZ;const ywe=0,xwe=4,aT=fwe({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:mwe,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;lZ(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=rwe(t,i);Object.keys(u).length&&(Object.assign(t.props,u),ou(t.object,u))}(r.sibling===null||(r.flags&xwe)===ywe)&&vwe()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:t=>t?.object,prepareForCommit:()=>null,preparePortalMount:t=>nT(t.getState().scene,t,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:gwe,unhideInstance:cZ,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!==oZ)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(){}}),Jm=new Map,vb={objects:"shallow",strict:!1};function _we(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 Swe(t){const e=Jm.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||cwe(uI,m5),s=n||aT.createContainer(a,pM.ConcurrentRoot,null,!1,null,"",r,r,r,null);e||Jm.set(t,{fiber:s,store:a});let o,l,c=!1,u=null;return{async configure(f={}){let h;u=new Promise(J=>h=J);let{gl:d,size:g,scene:b,events:y,onCreated:m,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:L,onPointerMissed:U}=f,j=a.getState(),z=j.gl;if(!j.gl){const J={canvas:t,powerPreference:"high-performance",antialias:!0,alpha:!0},Z=typeof d=="function"?await d(J):d;u5(Z)?z=Z:z=new bU({...J,...d}),j.set({gl:z})}let q=j.raycaster;q||j.set({raycaster:q=new G_});const{params:F,...V}=R||{};if(Yr.equ(V,q,vb)||ou(q,{...V}),Yr.equ(F,q.params,vb)||ou(q,{params:{...q.params,...F}}),!j.camera||j.camera===l&&!Yr.equ(l,L,vb)){l=L;const J=L?.isCamera,Z=J?L:S?new Ah(0,0,0,0,.1,1e3):new ra(75,0,.1,1e3);J||(Z.position.z=5,L&&(ou(Z,L),Z.manual||("aspect"in L||"left"in L||"right"in L||"bottom"in L||"top"in L)&&(Z.manual=!0,Z.updateProjectionMatrix())),!j.camera&&!(L!=null&&L.rotation)&&Z.lookAt(0,0,0)),j.set({camera:Z}),q.camera=Z}if(!j.scene){let J;b!=null&&b.isScene?(J=b,nT(J,a,"",{})):(J=new Wv,nT(J,a,"",{}),b&&ou(J,b)),j.set({scene:J})}y&&!j.events.handlers&&j.set({events:y(a)});const H=_we(t,g);if(Yr.equ(H,j.size,vb)||j.setSize(H.width,H.height,H.top,H.left),C&&j.viewport.dpr!==nZ(C)&&j.setDpr(C),j.frameloop!==A&&j.setFrameloop(A),j.onPointerMissed||j.set({onPointerMissed:U}),D&&!Yr.equ(D,j.performance,vb)&&j.set(J=>({performance:{...J.performance,...D}})),!j.xr){var W;const J=(de,oe)=>{const le=a.getState();le.frameloop!=="never"&&m5(de,!0,le,oe)},Z=()=>{const de=a.getState();de.gl.xr.enabled=de.gl.xr.isPresenting,de.gl.xr.setAnimationLoop(de.gl.xr.isPresenting?J:null),de.gl.xr.isPresenting||uI(de)},G={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"&&G.connect(),j.set({xr:G})}if(z.shadowMap){const J=z.shadowMap.enabled,Z=z.shadowMap.type;if(z.shadowMap.enabled=!!x,Yr.boo(x))z.shadowMap.type=$x;else if(Yr.str(x)){var B;const G={basic:JY,percentage:NA,soft:$x,variance:Zc};z.shadowMap.type=(B=G[x])!=null?B:$x}else Yr.obj(x)&&Object.assign(z.shadowMap,x);(J!==z.shadowMap.enabled||Z!==z.shadowMap.type)&&(z.shadowMap.needsUpdate=!0)}return bi.enabled=!M,c||(z.outputColorSpace=_?Su:Es,z.toneMapping=w?af:RP),j.legacy!==M&&j.set(()=>({legacy:M})),j.linear!==_&&j.set(()=>({linear:_})),j.flat!==w&&j.set(()=>({flat:w})),d&&!Yr.fun(d)&&!u5(d)&&!Yr.equ(d,z,vb)&&ou(z,d),o=m,c=!0,h(),this},render(f){return!c&&!u&&this.configure(),u.then(()=>{aT.updateContainer(k.jsx(wwe,{store:a,children:f,onCreated:o,rootElement:t}),s,null,()=>{})}),a},unmount(){fZ(t)}}}function wwe({store:t,children:e,onCreated:n,rootElement:i}){return W_(()=>{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 fZ(t,e){const n=Jm.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(),twe(r.scene),Jm.delete(t)}catch{}},500)})}}function Ewe(t,e,n){return k.jsx(Mwe,{children:t,container:e,state:n})}function Mwe({state:t={},children:e,container:n}){const{events:i,size:r,...a}=t,s=SU(),[o]=I.useState(()=>new G_),[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&&rZ(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=V$((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 hZ(t,e){const n={callback:t};return e.add(n),()=>void e.delete(n)}const dZ=new Set,pZ=new Set,Twe=new Set,Awe=t=>hZ(t,dZ),Cwe=t=>hZ(t,pZ);function Xk(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function s1(t,e){switch(t){case"before":return Xk(dZ,e);case"after":return Xk(pZ,e);case"tail":return Xk(Twe,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,yb;function mZ(t){p5=requestAnimationFrame(mZ),sT=!0,Jk=0,s1("before",t),cI=!0;for(const n of Jm.values()){var e;yb=n.store.getState(),yb.internal.active&&(yb.frameloop==="always"||yb.internal.frames>0)&&!((e=yb.gl.xr)!=null&&e.isPresenting)&&(Jk+=lI(t,yb))}if(cI=!1,s1("after",t),Jk===0)return s1("tail",t),sT=!1,cancelAnimationFrame(p5)}function uI(t,e=1){var n;if(!t)return Jm.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(mZ)))}function m5(t,e=!0,n,i){if(e&&s1("before",t),n)lI(t,n,i);else for(const r of Jm.values())lI(t,r.store.getState());e&&s1("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 Rwe(t){const{handlePointer:e}=lwe(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 kwe({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 m=()=>{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&&!Nwe(o.current.lastBounds,R)&&s(o.current.lastBounds=R)};return[m,c?g5(m,c):m,l?g5(m,l):m]},[s,i,l,c]);function g(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(m=>m.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(m=>m.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=m=>{!m||m===o.current.element||(g(),o.current.element=m,o.current.scrollContainers=gZ(m),b())};return Owe(d,!!e),Dwe(h),I.useEffect(()=>{g(),b()},[e,d,h]),I.useEffect(()=>g,[]),[y,a,f]}function Dwe(t){I.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Owe(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 gZ(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,...gZ(t.parentElement)]}const Iwe=["x","y","top","bottom","left","right","width","height"],Nwe=(t,e)=>Iwe.every(n=>t[n]===e[n]);function Lwe({ref:t,children:e,fallback:n,resize:i,style:r,gl:a,events:s=Rwe,eventSource:o,eventPrefix:l,shadows:c,linear:u,flat:f,legacy:h,orthographic:d,frameloop:g,dpr:b,performance:y,raycaster:m,camera:x,scene:_,onPointerMissed:w,onCreated:M,...S}){I.useMemo(()=>q_(mSe),[]);const A=$Se(),[C,D]=kwe({scroll:!0,debounce:{scroll:50,resize:0},...i}),R=I.useRef(null),L=I.useRef(null);I.useImperativeHandle(t,()=>R.current);const U=xU(w),[j,z]=I.useState(!1),[q,F]=I.useState(!1);if(j)throw j;if(q)throw q;const V=I.useRef(null);W_(()=>{const W=R.current;if(D.width>0&&D.height>0&&W){V.current||(V.current=Swe(W));async function B(){await V.current.configure({gl:a,scene:_,events:s,shadows:c,linear:u,flat:f,legacy:h,orthographic:d,frameloop:g,dpr:b,performance:y,raycaster:m,camera:x,size:D,onPointerMissed:(...J)=>U.current==null?void 0:U.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(o?YSe(o)?o.current:o:L.current),l&&J.setEvents({compute:(Z,G)=>{const de=Z[l+"X"],oe=Z[l+"Y"];G.pointer.set(de/G.size.width*2-1,-(oe/G.size.height)*2+1),G.raycaster.setFromCamera(G.pointer,G.camera)}}),M?.(J)}}),V.current.render(k.jsx(A,{children:k.jsx(QSe,{set:F,children:k.jsx(I.Suspense,{fallback:k.jsx(ZSe,{set:z}),children:e??null})})}))}B()}}),I.useEffect(()=>{const W=R.current;if(W)return()=>fZ(W)},[]);const H=o?"none":"auto";return k.jsx("div",{ref:L,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 Pwe(t){return k.jsx($$,{children:k.jsx(Lwe,{...t})})}const X_=new te,EU=new te,Uwe=new te,b5=new wt;function Fwe(t,e,n){const i=X_.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 Bwe(t,e){const n=X_.setFromMatrixPosition(t.matrixWorld),i=EU.setFromMatrixPosition(e.matrixWorld),r=n.sub(i),a=e.getWorldDirection(Uwe);return r.angleTo(a)>Math.PI/2}function zwe(t,e,n,i){const r=X_.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 jwe(t,e){if(e instanceof Ah)return e.zoom;if(e instanceof ra){const n=X_.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 Hwe(t,e,n){if(e instanceof ra||e instanceof Ah){const i=X_.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 bZ(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 Vwe=(t=>e=>bZ(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Gwe=(t=>(e,n)=>bZ(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 Wwe(t){return t&&typeof t=="object"&&"current"in t}const Qv=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:m=[16777271,0],calculatePosition:x=Fwe,as:_="div",wrapperClass:w,pointerEvents:M="auto",...S},A)=>{const{gl:C,camera:D,scene:R,size:L,raycaster:U,events:j,viewport:z}=ki(),[q]=I.useState(()=>document.createElement(_)),F=I.useRef(null),V=I.useRef(null),H=I.useRef(0),W=I.useRef([0,0]),B=I.useRef(null),J=I.useRef(null),Z=o?.current||j.connected||C.domElement.parentNode,G=I.useRef(null),de=I.useRef(!1),oe=I.useMemo(()=>f&&f!=="blending"||Array.isArray(f)&&f.length&&Wwe(f[0]),[f]);I.useLayoutEffect(()=>{const Be=C.domElement;f&&f==="blending"?(Be.style.zIndex=`${Math.floor(m[0]/2)}`,Be.style.position="absolute",Be.style.pointerEvents="none"):(Be.style.zIndex=null,Be.style.position=null,Be.style.pointerEvents=null)},[f]),I.useLayoutEffect(()=>{if(V.current){const Be=F.current=$q.createRoot(q);if(R.updateMatrixWorld(),u)q.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const je=x(V.current,D,L);q.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${je[0]}px,${je[1]}px,0);transform-origin:0 0;`}return Z&&(r?Z.prepend(q):Z.appendChild(q)),()=>{Z&&Z.removeChild(q),Be.unmount()}}},[Z,u]),I.useLayoutEffect(()=>{w&&(q.className=w)},[w]);const le=I.useMemo(()=>u?{position:"absolute",top:0,left:0,width:L.width,height:L.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:a?"translate3d(-50%,-50%,0)":"none",...s&&{top:-L.height/2,left:-L.width/2,width:L.width,height:L.height},...n},[n,a,s,L,u]),ue=I.useMemo(()=>({position:"absolute",pointerEvents:M}),[M]);I.useLayoutEffect(()=>{if(de.current=!1,u){var Be;(Be=F.current)==null||Be.render(I.createElement("div",{ref:B,style:le},I.createElement("div",{ref:J,style:ue},I.createElement("div",{ref:A,className:i,style:n,children:t}))))}else{var je;(je=F.current)==null||je.render(I.createElement("div",{ref:A,style:le,className:i,children:t}))}});const Se=I.useRef(!0);oa(Be=>{if(V.current){D.updateMatrixWorld(),V.current.updateWorldMatrix(!0,!1);const je=u?W.current:x(V.current,D,L);if(u||Math.abs(H.current-D.zoom)>e||Math.abs(W.current[0]-je[0])>e||Math.abs(W.current[1]-je[1])>e){const He=Bwe(V.current,D);let pe=!1;oe&&(Array.isArray(f)?pe=f.map(we=>we.current):f!=="blending"&&(pe=[R]));const ze=Se.current;if(pe){const we=zwe(V.current,D,U,pe);Se.current=we&&!He}else Se.current=!He;ze!==Se.current&&(h?h(!Se.current):q.style.display=Se.current?"block":"none");const Ie=Math.floor(m[0]/2),qe=f?oe?[m[0],Ie]:[Ie-1,0]:m;if(q.style.zIndex=`${Hwe(V.current,D,qe)}`,u){const[we,Me]=[L.width/2,L.height/2],Ae=D.projectionMatrix.elements[5]*Me,{isOrthographicCamera:Ne,top:Ue,left:Qe,bottom:ae,right:K}=D,ce=Vwe(D.matrixWorldInverse),he=Ne?`scale(${Ae})translate(${fI(-(K+Qe)/2)}px,${fI((Ue+ae)/2)}px)`:`translateZ(${Ae}px)`;let me=V.current.matrixWorld;c&&(me=D.matrixWorldInverse.clone().transpose().copyPosition(me).scale(V.current.scale),me.elements[3]=me.elements[7]=me.elements[11]=0,me.elements[15]=1),q.style.width=L.width+"px",q.style.height=L.height+"px",q.style.perspective=Ne?"":`${Ae}px`,B.current&&J.current&&(B.current.style.transform=`${he}${ce}translate(${we}px,${Me}px)`,J.current.style.transform=Gwe(me,1/((l||10)/400)))}else{const we=l===void 0?1:jwe(V.current,D)*l;q.style.transform=`translate3d(${je[0]}px,${je[1]}px,0) scale(${we})`}W.current=je,H.current=D.zoom}}if(!oe&&G.current&&!de.current)if(u){if(B.current){const je=B.current.children[0];if(je!=null&&je.clientWidth&&je!=null&&je.clientHeight){const{isOrthographicCamera:He}=D;if(He||y)S.scale&&(Array.isArray(S.scale)?S.scale instanceof te?G.current.scale.copy(S.scale.clone().divideScalar(1)):G.current.scale.set(1/S.scale[0],1/S.scale[1],1/S.scale[2]):G.current.scale.setScalar(1/S.scale));else{const pe=(l||10)/400,ze=je.clientWidth*pe,Ie=je.clientHeight*pe;G.current.scale.set(ze,Ie,1)}de.current=!0}}}else{const je=q.children[0];if(je!=null&&je.clientWidth&&je!=null&&je.clientHeight){const He=1/z.factor,pe=je.clientWidth*He,ze=je.clientHeight*He;G.current.scale.set(pe,ze,1),de.current=!0}G.current.lookAt(Be.camera.position)}});const Oe=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:V}),f&&!oe&&I.createElement("mesh",{castShadow:d,receiveShadow:g,ref:G},y||I.createElement("planeGeometry",null),b||I.createElement("shaderMaterial",{side:Jr,vertexShader:Oe.vertexShader,fragmentShader:Oe.fragmentShader})))}),K_=parseInt(zv.replace(/\D+/g,"")),vZ=K_>=125?"uv1":"uv2",qwe=(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 On;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 In(a,n,i)}};function y5(t,e){if(e===TJ)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 Xwe(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),m=~~(b.y*i),x=~~(b.z*i);return`${y},${m},${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 m=3*b,x=r[0].fromBufferAttribute(f,m+0),_=r[1].fromBufferAttribute(f,m+1),w=r[2].fromBufferAttribute(f,m+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 In(d,3,!1);for(let b=0,y=f.count/3;b<y;b++){const m=3*b,x=r[0].fromBufferAttribute(f,m+0),_=r[1].fromBufferAttribute(f,m+1),w=r[2].fromBufferAttribute(f,m+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 L=C[D];o.dot(L)>n&&l.add(L)}l.normalize(),g.setXYZ(m+M,l.x,l.y,l.z)}}return u.setAttribute("normal",g),u}var dc=Uint8Array,Md=Uint16Array,hI=Uint32Array,yZ=new dc([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]),xZ=new dc([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]),Kwe=new dc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_Z=function(t,e){for(var n=new Md(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]},SZ=_Z(yZ,2),wZ=SZ[0],Ywe=SZ[1];wZ[28]=258,Ywe[258]=28;var Jwe=_Z(xZ,0),$we=Jwe[0],dI=new Md(32768);for(var Hr=0;Hr<32768;++Hr){var Qh=(Hr&43690)>>>1|(Hr&21845)<<1;Qh=(Qh&52428)>>>2|(Qh&13107)<<2,Qh=(Qh&61680)>>>4|(Qh&3855)<<4,dI[Hr]=((Qh&65280)>>>8|(Qh&255)<<8)>>>1}var o1=function(t,e,n){for(var i=t.length,r=0,a=new Md(e);r<i;++r)++a[t[r]-1];var s=new Md(e);for(r=0;r<e;++r)s[r]=s[r-1]+a[r-1]<<1;var o;if(n){o=new Md(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 Md(i),r=0;r<i;++r)t[r]&&(o[r]=dI[s[t[r]-1]++]>>>15-t[r]);return o},Y_=new dc(288);for(var Hr=0;Hr<144;++Hr)Y_[Hr]=8;for(var Hr=144;Hr<256;++Hr)Y_[Hr]=9;for(var Hr=256;Hr<280;++Hr)Y_[Hr]=7;for(var Hr=280;Hr<288;++Hr)Y_[Hr]=8;var EZ=new dc(32);for(var Hr=0;Hr<32;++Hr)EZ[Hr]=5;var Zwe=o1(Y_,9,1),Qwe=o1(EZ,5,1),Zk=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Kc=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)},eEe=function(t){return(t/8|0)+(t&7&&1)},tEe=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof Md?Md:t instanceof hI?hI:dc)(n-e);return i.set(t.subarray(e,n)),i},nEe=function(t,e,n){var i=t.length;if(!i||n&&!n.l&&i<5)return e||new dc(0);var r=!e||n,a=!n||n.i;n||(n={}),e||(e=new dc(i*3));var s=function(le){var ue=e.length;if(le>ue){var Se=new dc(Math.max(ue*2,le));Se.set(e),e=Se}},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=Kc(t,l,1);var b=Kc(t,l+1,3);if(l+=3,b)if(b==1)u=Zwe,f=Qwe,h=9,d=5;else if(b==2){var _=Kc(t,l,31)+257,w=Kc(t,l+10,15)+4,M=_+Kc(t,l+5,31)+1;l+=14;for(var S=new dc(M),A=new dc(19),C=0;C<w;++C)A[Kwe[C]]=Kc(t,l+C*3,7);l+=w*3;for(var D=Zk(A),R=(1<<D)-1,L=o1(A,D,1),C=0;C<M;){var U=L[Kc(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+Kc(t,l,3),l+=2,j=S[C-1]):y==17?(z=3+Kc(t,l,7),l+=3):y==18&&(z=11+Kc(t,l,127),l+=7);z--;)S[C++]=j}}var q=S.subarray(0,_),F=S.subarray(_);h=Zk(q),d=Zk(F),u=o1(q,h,1),f=o1(F,d,1)}else throw"invalid block type";else{var y=eEe(l)+4,m=t[y-4]|t[y-3]<<8,x=y+m;if(x>i){if(a)throw"unexpected EOF";break}r&&s(c+m),e.set(t.subarray(y,x),c),n.b=c+=m,n.p=l=x*8;continue}if(l>g){if(a)throw"unexpected EOF";break}}r&&s(c+131072);for(var V=(1<<h)-1,H=(1<<d)-1,W=l;;W=l){var j=u[Qk(t,l)&V],B=j>>>4;if(l+=j&15,l>g){if(a)throw"unexpected EOF";break}if(!j)throw"invalid length/literal";if(B<256)e[c++]=B;else if(B==256){W=l,u=null;break}else{var J=B-254;if(B>264){var C=B-257,Z=yZ[C];J=Kc(t,l,(1<<Z)-1)+wZ[C],l+=Z}var G=f[Qk(t,l)&H],de=G>>>4;if(!G)throw"invalid distance";l+=G&15;var F=$we[de];if(de>3){var Z=xZ[de];F+=Qk(t,l)&(1<<Z)-1,l+=Z}if(l>g){if(a)throw"unexpected EOF";break}r&&s(c+131072);for(var oe=c+J;c<oe;c+=4)e[c]=e[c-F],e[c+1]=e[c+1-F],e[c+2]=e[c+2-F],e[c+3]=e[c+3-F];c=oe}}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:tEe(e,0,c)},iEe=new dc(0),rEe=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 nEe((rEe(t),t.subarray(2,-4)),e)}var aEe=typeof TextDecoder<"u"&&new TextDecoder,sEe=0;try{aEe.decode(iEe,{stream:!0}),sEe=1}catch{}const oEe=t=>t&&t.isCubeTexture;class lEe extends Si{constructor(e,n){var i,r;const a=oEe(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 <${K_>=154?"colorspace_fragment":"encodings_fragment"}>
        }
        `,b={map:{value:e},height:{value:n?.height||15},radius:{value:n?.radius||100}},y=new Xv(1,16),m=new cs({uniforms:b,fragmentShader:g,vertexShader:d,side:Jr});super(y,m)}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 pm="srgb",oh="srgb-linear",x5=3001,cEe=3e3;class uEe extends Fs{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(n){return new mEe(n)}),this.register(function(n){return new gEe(n)}),this.register(function(n){return new MEe(n)}),this.register(function(n){return new TEe(n)}),this.register(function(n){return new AEe(n)}),this.register(function(n){return new vEe(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 pEe(n)}),this.register(function(n){return new SEe(n)}),this.register(function(n){return new bEe(n)}),this.register(function(n){return new EEe(n)}),this.register(function(n){return new wEe(n)}),this.register(function(n){return new hEe(n)}),this.register(function(n){return new CEe(n)}),this.register(function(n){return new REe(n)})}load(e,n,i,r){const a=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const c=Ld.extractUrlBase(e);s=Ld.resolveURL(c,this.path)}else s=Ld.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)))===MZ){try{s[Di.KHR_BINARY_GLTF]=new kEe(e)}catch(u){r&&r(u);return}a=JSON.parse(s[Di.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 VEe(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 Di.KHR_MATERIALS_UNLIT:s[u]=new dEe;break;case Di.KHR_DRACO_MESH_COMPRESSION:s[u]=new DEe(a,this.dracoLoader);break;case Di.KHR_TEXTURE_TRANSFORM:s[u]=new OEe;break;case Di.KHR_MESH_QUANTIZATION:s[u]=new IEe;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 fEe(){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 Di={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 hEe{constructor(e){this.parser=e,this.name=Di.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],oh);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,Hf(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 dEe{constructor(){this.name=Di.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],oh),e.opacity=s[3]}a.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",a.baseColorTexture,pm))}return Promise.all(r)}}class pEe{constructor(e){this.parser=e,this.name=Di.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 mEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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 gEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_DISPERSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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 bEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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 vEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_SHEEN}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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],oh)}return s.sheenRoughnessFactor!==void 0&&(n.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&a.push(i.assignTexture(n,"sheenColorMap",s.sheenColorTexture,pm)),s.sheenRoughnessTexture!==void 0&&a.push(i.assignTexture(n,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(a)}}class yEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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 xEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_VOLUME}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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],oh),Promise.all(a)}}class _Ee{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_IOR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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 SEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_SPECULAR}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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],oh),s.specularColorTexture!==void 0&&a.push(i.assignTexture(n,"specularColorMap",s.specularColorTexture,pm)),Promise.all(a)}}class wEe{constructor(e){this.parser=e,this.name=Di.EXT_MATERIALS_BUMP}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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 EEe{constructor(e){this.parser=e,this.name=Di.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const i=this.parser.json.materials[e];return!i.extensions||!i.extensions[this.name]?null:Pc}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 MEe{constructor(e){this.parser=e,this.name=Di.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 TEe{constructor(e){this.parser=e,this.name=Di.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 AEe{constructor(e){this.parser=e,this.name=Di.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 CEe{constructor(e){this.name=Di.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 REe{constructor(e){this.name=Di.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!==tc.TRIANGLES&&c.mode!==tc.TRIANGLE_STRIP&&c.mode!==tc.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 Dt,y=new te,m=new qn,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&&m.fromBufferAttribute(l.ROTATION,w),l.SCALE&&x.fromBufferAttribute(l.SCALE,w),_.setMatrixAt(w,b.compose(y,m,x));for(const w in l)if(w==="_COLOR_0"){const M=l[w];_.instanceColor=new hf(M.array,M.itemSize,M.normalized)}else w!=="TRANSLATION"&&w!=="ROTATION"&&w!=="SCALE"&&g.geometry.setAttribute(w,l[w]);Pi.prototype.copy.call(_,g),this.parser.assignFinalMaterial(_),d.push(_)}return u.isGroup?(u.clear(),u.add(...d),u):d[0]}))}}const MZ="glTF",Yy=12,_5={JSON:1313821514,BIN:5130562};class kEe{constructor(e){this.name=Di.KHR_BINARY_GLTF,this.content=null,this.body=null;const n=new DataView(e,0,Yy);if(this.header={magic:oT(new Uint8Array(e.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==MZ)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-Yy,r=new DataView(e,Yy);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,Yy+a,s);this.content=oT(l)}else if(o===_5.BIN){const l=Yy+a;this.body=e.slice(l,l+s)}a+=s}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class DEe{constructor(e,n){if(!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Di.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=w0[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,oh,h)})})}}class OEe{constructor(){this.name=Di.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 IEe{constructor(){this.name=Di.KHR_MESH_QUANTIZATION}}class TZ extends Jv{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,m=d-h,x=1-y,_=m-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+m*C}return a}}const NEe=new qn;class LEe extends TZ{interpolate_(e,n,i,r){const a=super.interpolate_(e,n,i,r);return NEe.fromArray(a).normalize().toArray(a),a}}const tc={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},w0={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},S5={9728:ss,9729:Vi,9984:LA,9985:x0,9986:lm,9987:vc},w5={33071:xa,33648:$0,10497:Gd},eD={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pI={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...K_>=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"},ed={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},PEe={CUBICSPLINE:void 0,LINEAR:iv,STEP:nv},tD={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function UEe(t){return t.DefaultMaterial===void 0&&(t.DefaultMaterial=new Yv({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:_u})),t.DefaultMaterial}function Up(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 Hf(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 FEe(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 BEe(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 zEe(t){let e;const n=t.extensions&&t.extensions[Di.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 jEe(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 HEe=new Dt;class VEe{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new fEe,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 fv(this.options.manager):this.textureLoader=new _$(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 Up(a,o,r),Hf(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[Di.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(a,s){i.load(Ld.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=w0[r.componentType],l=r.normalized===!0,c=new o(r.count*s);return Promise.resolve(new In(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=w0[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 m=Math.floor(h/d),x="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+m+":"+r.count;let _=n.cache.get(x);_||(b=new c(o,m*d,r.count*d/u),_=new B_(b,d/u),n.cache.add(x,_)),y=new zo(_,l,h%d/u,g)}else o===null?b=new c(r.count*l):b=new c(o,h,r.count*l),y=new In(b,l,g);if(r.sparse!==void 0){const m=eD.SCALAR,x=w0[r.sparse.indices.componentType],_=r.sparse.indices.byteOffset||0,w=r.sparse.values.byteOffset||0,M=new x(s[1],_,r.sparse.count*m),S=new c(s[2],w,r.sparse.count*l);o!==null&&(y=new In(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]||Vi,u.minFilter=S5[h.minFilter]||vc,u.wrapS=w5[h.wrapS]||Gd,u.wrapT=w5[h.wrapT]||Gd,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(Ld.resolveURL(f,a.path),g,void 0,d)})}).then(function(f){return c===!0&&o.revokeObjectURL(l),Hf(f,s),f.userData.mimeType=s.mimeType||jEe(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[Di.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[Di.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=a.associations.get(s);s=a.extensions[Di.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),a.associations.set(s,l)}}return r!==void 0&&(typeof r=="number"&&(r=r===x5?pm:oh),"colorSpace"in s?s.colorSpace=r:s.encoding=r===pm?x5:cEe),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,Oa.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,Oa.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 Yv}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[Di.KHR_MATERIALS_UNLIT]){const f=r[Di.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],oh),o.opacity=h[3]}f.baseColorTexture!==void 0&&c.push(n.assignTexture(o,"map",f.baseColorTexture,pm)),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=Jr);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],oh)}return a.emissiveTexture!==void 0&&s!==Cs&&c.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture,pm)),Promise.all(c).then(function(){const f=new s(o);return a.name&&(f.name=a.name),Hf(f,a),n.associations.set(f,{materials:e}),a.extensions&&Up(r,f,a),f})}createUniqueName(e){const n=Bi.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[Di.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=zEe(c),f=r[u];if(f)s.push(f.promise);else{let h;c.extensions&&c.extensions[Di.KHR_DRACO_MESH_COMPRESSION]?h=a(c):h=E5(new On,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?UEe(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 m;const x=c[d];if(y.mode===tc.TRIANGLES||y.mode===tc.TRIANGLE_STRIP||y.mode===tc.TRIANGLE_FAN||y.mode===void 0)m=a.isSkinnedMesh===!0?new XA(b,x):new Si(b,x),m.isSkinnedMesh===!0&&m.normalizeSkinWeights(),y.mode===tc.TRIANGLE_STRIP?m.geometry=y5(m.geometry,PP):y.mode===tc.TRIANGLE_FAN&&(m.geometry=y5(m.geometry,Y2));else if(y.mode===tc.LINES)m=new Lc(b,x);else if(y.mode===tc.LINE_STRIP)m=new yh(b,x);else if(y.mode===tc.LINE_LOOP)m=new WP(b,x);else if(y.mode===tc.POINTS)m=new qP(b,x);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+y.mode);Object.keys(m.geometry.morphAttributes).length>0&&BEe(m,a),m.name=n.createUniqueName(a.name||"mesh_"+e),Hf(m,a),y.extensions&&Up(r,m,y),n.assignFinalMaterial(m),f.push(m)}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&&Up(r,f[0],a),f[0];const h=new yl;a.extensions&&Up(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 ra(yc.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(n=new Ah(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(n.name=this.createUniqueName(i.name)),Hf(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 Dt;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 qv(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,m=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",m)),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],m=[];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++)m.push(D[R])}return new uv(a,void 0,m)})}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,HEe)});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 z_:c.length>1?u=new yl:c.length===1?u=c[0]:u=new Pi,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),Hf(u,a),a.extensions&&Up(i,u,a),a.matrix!==void 0){const f=new Dt;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 yl;i.name&&(a.name=r.createUniqueName(i.name)),Hf(a,i),i.extensions&&Up(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 Oa||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=[];ed[a.path]===ed.weights?e.traverse(function(h){h.morphTargetInfluences&&l.push(h.name?h.name:h.uuid)}):l.push(o);let c;switch(ed[a.path]){case ed.weights:c=Xm;break;case ed.rotation:c=Km;break;case ed.position:case ed.scale:c=Ym;break;default:switch(i.itemSize){case 1:c=Xm;break;case 2:case 3:default:c=Ym;break}break}const u=r.interpolation!==void 0?PEe[r.interpolation]:iv,f=this._getArrayFromAccessor(i);for(let h=0,d=l.length;h<d;h++){const g=new c(l[h]+"."+ed[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 Km?LEe:TZ;return new r(this.times,this.values,this.getValueSize()/3,i)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function GEe(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(w0[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(w0[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 Ur;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 Hf(t,e),GEe(t,e,n),Promise.all(r).then(function(){return e.targets!==void 0?FEe(t,e.targets,n):t})}class WEe extends sU{constructor(e){super(e),this.type=rs}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="",F=String.fromCharCode.apply(null,new Uint16Array(C.subarray(U,U+128)));for(;0>(j=F.indexOf(u))&&z<D&&U<C.byteLength;)q+=F,z+=F.length,U+=128,F+=String.fromCharCode.apply(null,new Uint16Array(C.subarray(U,U+128)));return-1<j?(C.pos+=z+j+1,q+F.slice(0,j)):!1},h=function(C){const D=/^#\?(\S+)/,R=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,L=/^\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,F;for((C.pos>=C.byteLength||!(q=f(C)))&&s(1,"no header found"),(F=q.match(D))||s(3,"bad initial token"),z.valid|=1,z.programtype=F[1],z.string+=q+`
`;q=f(C),q!==!1;){if(z.string+=q+`
`,q.charAt(0)==="#"){z.comments+=q+`
`;continue}if((F=q.match(R))&&(z.gamma=parseFloat(F[1])),(F=q.match(L))&&(z.exposure=parseFloat(F[1])),(F=q.match(U))&&(z.valid|=2,z.format=F[1]),(F=q.match(j))&&(z.valid|=4,z.height=parseInt(F[1],10),z.width=parseInt(F[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 L=D;if(L<8||L>32767||C[0]!==2||C[1]!==2||C[2]&128)return new Uint8Array(C);L!==(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*L,F=new Uint8Array(4),V=new Uint8Array(q);let H=R;for(;H>0&&z<C.byteLength;){z+4>C.byteLength&&s(1),F[0]=C[z++],F[1]=C[z++],F[2]=C[z++],F[3]=C[z++],(F[0]!=2||F[1]!=2||(F[2]<<8|F[3])!=L)&&s(3,"bad rgbe scanline format");let W=0,B;for(;W<q&&z<C.byteLength;){B=C[z++];const Z=B>128;if(Z&&(B-=128),(B===0||W+B>q)&&s(3,"bad scanline data"),Z){const G=C[z++];for(let de=0;de<B;de++)V[W++]=G}else V.set(C.subarray(z,z+B),W),W+=B,z+=B}const J=L;for(let Z=0;Z<J;Z++){let G=0;U[j]=V[Z+G],G+=L,U[j+1]=V[Z+G],G+=L,U[j+2]=V[Z+G],G+=L,U[j+3]=V[Z+G],j+=4}H--}return U},g=function(C,D,R,L){const U=C[D+3],j=Math.pow(2,U-128)/255;R[L+0]=C[D+0]*j,R[L+1]=C[D+1]*j,R[L+2]=C[D+2]*j,R[L+3]=1},b=function(C,D,R,L){const U=C[D+3],j=Math.pow(2,U-128)/255;R[L+0]=fm.toHalfFloat(Math.min(C[D+0]*j,65504)),R[L+1]=fm.toHalfFloat(Math.min(C[D+1]*j,65504)),R[L+2]=fm.toHalfFloat(Math.min(C[D+2]*j,65504)),R[L+3]=fm.toHalfFloat(1)},y=new Uint8Array(e);y.pos=0;const m=h(y),x=m.width,_=m.height,w=d(y.subarray(y.pos),x,_);let M,S,A;switch(this.type){case wr: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=wr;break;case rs: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=rs;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:x,height:_,data:M,header:m.string,gamma:m.gamma,exposure:m.exposure,type:S}}setDataType(e){return this.type=e,this}load(e,n,i,r){function a(s,o){switch(s.type){case wr:case rs:"colorSpace"in s?s.colorSpace="srgb-linear":s.encoding=3e3,s.minFilter=Vi,s.magFilter=Vi,s.generateMipmaps=!1,s.flipY=!0;break}n&&n(s,o)}return super.load(e,a,i,r)}}const Jy=K_>=152;class qEe extends sU{constructor(e){super(e),this.type=rs}parse(e){const D=Math.pow(2.7182818,2.2);function R(se,ge){for(var Pe=0,rt=0;rt<65536;++rt)(rt==0||se[rt>>3]&1<<(rt&7))&&(ge[Pe++]=rt);for(var dt=Pe-1;Pe<65536;)ge[Pe++]=0;return dt}function L(se){for(var ge=0;ge<16384;ge++)se[ge]={},se[ge].len=0,se[ge].lit=0,se[ge].p=null}const U={l:0,c:0,lc:0};function j(se,ge,Pe,rt,dt){for(;Pe<se;)ge=ge<<8|vt(rt,dt),Pe+=8;Pe-=se,U.l=ge>>Pe&(1<<se)-1,U.c=ge,U.lc=Pe}const z=new Array(59);function q(se){for(var ge=0;ge<=58;++ge)z[ge]=0;for(var ge=0;ge<65537;++ge)z[se[ge]]+=1;for(var Pe=0,ge=58;ge>0;--ge){var rt=Pe+z[ge]>>1;z[ge]=Pe,Pe=rt}for(var ge=0;ge<65537;++ge){var dt=se[ge];dt>0&&(se[ge]=dt|z[dt]++<<6)}}function F(se,ge,Pe,rt,dt,ot,At){for(var ee=Pe,xe=0,Te=0;dt<=ot;dt++){if(ee.value-Pe.value>rt)return!1;j(6,xe,Te,se,ee);var De=U.l;if(xe=U.c,Te=U.lc,At[dt]=De,De==63){if(ee.value-Pe.value>rt)throw"Something wrong with hufUnpackEncTable";j(8,xe,Te,se,ee);var ve=U.l+6;if(xe=U.c,Te=U.lc,dt+ve>ot+1)throw"Something wrong with hufUnpackEncTable";for(;ve--;)At[dt++]=0;dt--}else if(De>=59){var ve=De-59+2;if(dt+ve>ot+1)throw"Something wrong with hufUnpackEncTable";for(;ve--;)At[dt++]=0;dt--}}q(At)}function V(se){return se&63}function H(se){return se>>6}function W(se,ge,Pe,rt){for(;ge<=Pe;ge++){var dt=H(se[ge]),ot=V(se[ge]);if(dt>>ot)throw"Invalid table entry";if(ot>14){var At=rt[dt>>ot-14];if(At.len)throw"Invalid table entry";if(At.lit++,At.p){var ee=At.p;At.p=new Array(At.lit);for(var xe=0;xe<At.lit-1;++xe)At.p[xe]=ee[xe]}else At.p=new Array(1);At.p[At.lit-1]=ge}else if(ot)for(var Te=0,xe=1<<14-ot;xe>0;xe--){var At=rt[(dt<<14-ot)+Te];if(At.len||At.p)throw"Invalid table entry";At.len=ot,At.lit=ge,Te++}}return!0}const B={c:0,lc:0};function J(se,ge,Pe,rt){se=se<<8|vt(Pe,rt),ge+=8,B.c=se,B.lc=ge}const Z={c:0,lc:0};function G(se,ge,Pe,rt,dt,ot,At,ee,xe,Te){if(se==ge){rt<8&&(J(Pe,rt,dt,At),Pe=B.c,rt=B.lc),rt-=8;var De=Pe>>rt,De=new Uint8Array([De])[0];if(xe.value+De>Te)return!1;for(var ve=ee[xe.value-1];De-- >0;)ee[xe.value++]=ve}else if(xe.value<Te)ee[xe.value++]=se;else return!1;Z.c=Pe,Z.lc=rt}function de(se){return se&65535}function oe(se){var ge=de(se);return ge>32767?ge-65536:ge}const le={a:0,b:0};function ue(se,ge){var Pe=oe(se),rt=oe(ge),dt=rt,ot=Pe+(dt&1)+(dt>>1),At=ot,ee=ot-dt;le.a=At,le.b=ee}function Se(se,ge){var Pe=de(se),rt=de(ge),dt=Pe-(rt>>1)&65535,ot=rt+dt-32768&65535;le.a=ot,le.b=dt}function Oe(se,ge,Pe,rt,dt,ot,At){for(var ee=At<16384,xe=Pe>dt?dt:Pe,Te=1,De;Te<=xe;)Te<<=1;for(Te>>=1,De=Te,Te>>=1;Te>=1;){for(var ve=0,_t=ve+ot*(dt-De),ft=ot*Te,yt=ot*De,St=rt*Te,Nt=rt*De,qt,at,nn,pn;ve<=_t;ve+=yt){for(var dn=ve,Dn=ve+rt*(Pe-De);dn<=Dn;dn+=Nt){var $t=dn+St,Yt=dn+ft,Un=Yt+St;ee?(ue(se[dn+ge],se[Yt+ge]),qt=le.a,nn=le.b,ue(se[$t+ge],se[Un+ge]),at=le.a,pn=le.b,ue(qt,at),se[dn+ge]=le.a,se[$t+ge]=le.b,ue(nn,pn),se[Yt+ge]=le.a,se[Un+ge]=le.b):(Se(se[dn+ge],se[Yt+ge]),qt=le.a,nn=le.b,Se(se[$t+ge],se[Un+ge]),at=le.a,pn=le.b,Se(qt,at),se[dn+ge]=le.a,se[$t+ge]=le.b,Se(nn,pn),se[Yt+ge]=le.a,se[Un+ge]=le.b)}if(Pe&Te){var Yt=dn+ft;ee?ue(se[dn+ge],se[Yt+ge]):Se(se[dn+ge],se[Yt+ge]),qt=le.a,se[Yt+ge]=le.b,se[dn+ge]=qt}}if(dt&Te)for(var dn=ve,Dn=ve+rt*(Pe-De);dn<=Dn;dn+=Nt){var $t=dn+St;ee?ue(se[dn+ge],se[$t+ge]):Se(se[dn+ge],se[$t+ge]),qt=le.a,se[$t+ge]=le.b,se[dn+ge]=qt}De=Te,Te>>=1}return ve}function Be(se,ge,Pe,rt,dt,ot,At,ee,xe,Te){for(var De=0,ve=0,_t=ee,ft=Math.trunc(dt.value+(ot+7)/8);dt.value<ft;)for(J(De,ve,Pe,dt),De=B.c,ve=B.lc;ve>=14;){var yt=De>>ve-14&16383,St=ge[yt];if(St.len)ve-=St.len,G(St.lit,At,De,ve,Pe,rt,dt,xe,Te,_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 qt=V(se[St.p[Nt]]);ve<qt&&dt.value<ft;)J(De,ve,Pe,dt),De=B.c,ve=B.lc;if(ve>=qt&&H(se[St.p[Nt]])==(De>>ve-qt&(1<<qt)-1)){ve-=qt,G(St.p[Nt],At,De,ve,Pe,rt,dt,xe,Te,_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,G(St.lit,At,De,ve,Pe,rt,dt,xe,Te,_t),De=Z.c,ve=Z.lc;else throw"hufDecode issues"}return!0}function je(se,ge,Pe,rt,dt,ot){var At={value:0},ee=Pe.value,xe=Ye(ge,Pe),Te=Ye(ge,Pe);Pe.value+=4;var De=Ye(ge,Pe);if(Pe.value+=4,xe<0||xe>=65537||Te<0||Te>=65537)throw"Something wrong with HUF_ENCSIZE";var ve=new Array(65537),_t=new Array(16384);L(_t);var ft=rt-(Pe.value-ee);if(F(se,ge,Pe,ft,xe,Te,ve),De>8*(rt-(Pe.value-ee)))throw"Something wrong with hufUncompress";W(ve,xe,Te,_t),Be(ve,_t,se,ge,Pe,De,Te,ot,dt,At)}function He(se,ge,Pe){for(var rt=0;rt<Pe;++rt)ge[rt]=se[ge[rt]]}function pe(se){for(var ge=1;ge<se.length;ge++){var Pe=se[ge-1]+se[ge]-128;se[ge]=Pe}}function ze(se,ge){for(var Pe=0,rt=Math.floor((se.length+1)/2),dt=0,ot=se.length-1;!(dt>ot||(ge[dt++]=se[Pe++],dt>ot));)ge[dt++]=se[rt++]}function Ie(se){for(var ge=se.byteLength,Pe=new Array,rt=0,dt=new DataView(se);ge>0;){var ot=dt.getInt8(rt++);if(ot<0){var At=-ot;ge-=At+1;for(var ee=0;ee<At;ee++)Pe.push(dt.getUint8(rt++))}else{var At=ot;ge-=2;for(var xe=dt.getUint8(rt++),ee=0;ee<At+1;ee++)Pe.push(xe)}}return Pe}function qe(se,ge,Pe,rt,dt,ot){var $t=new DataView(ot.buffer),At=Pe[se.idx[0]].width,ee=Pe[se.idx[0]].height,xe=3,Te=Math.floor(At/8),De=Math.ceil(At/8),ve=Math.ceil(ee/8),_t=At-(De-1)*8,ft=ee-(ve-1)*8,yt={value:0},St=new Array(xe),Nt=new Array(xe),qt=new Array(xe),at=new Array(xe),nn=new Array(xe);for(let Nn=0;Nn<xe;++Nn)nn[Nn]=ge[se.idx[Nn]],St[Nn]=Nn<1?0:St[Nn-1]+De*ve,Nt[Nn]=new Float32Array(64),qt[Nn]=new Uint16Array(64),at[Nn]=new Uint16Array(De*64);for(let Nn=0;Nn<ve;++Nn){var pn=8;Nn==ve-1&&(pn=ft);var dn=8;for(let Sn=0;Sn<De;++Sn){Sn==De-1&&(dn=_t);for(let an=0;an<xe;++an)qt[an].fill(0),qt[an][0]=dt[St[an]++],we(yt,rt,qt[an]),Me(qt[an],Nt[an]),Ae(Nt[an]);Ne(Nt);for(let an=0;an<xe;++an)Ue(Nt[an],at[an],Sn*64)}let An=0;for(let Sn=0;Sn<xe;++Sn){const an=Pe[se.idx[Sn]].type;for(let di=8*Nn;di<8*Nn+pn;++di){An=nn[Sn][di];for(let Li=0;Li<Te;++Li){const Gn=Li*64+(di&7)*8;$t.setUint16(An+0*2*an,at[Sn][Gn+0],!0),$t.setUint16(An+1*2*an,at[Sn][Gn+1],!0),$t.setUint16(An+2*2*an,at[Sn][Gn+2],!0),$t.setUint16(An+3*2*an,at[Sn][Gn+3],!0),$t.setUint16(An+4*2*an,at[Sn][Gn+4],!0),$t.setUint16(An+5*2*an,at[Sn][Gn+5],!0),$t.setUint16(An+6*2*an,at[Sn][Gn+6],!0),$t.setUint16(An+7*2*an,at[Sn][Gn+7],!0),An+=8*2*an}}if(Te!=De)for(let di=8*Nn;di<8*Nn+pn;++di){const Li=nn[Sn][di]+8*Te*2*an,Gn=Te*64+(di&7)*8;for(let wi=0;wi<dn;++wi)$t.setUint16(Li+wi*2*an,at[Sn][Gn+wi],!0)}}}for(var Dn=new Uint16Array(At),$t=new DataView(ot.buffer),Yt=0;Yt<xe;++Yt){Pe[se.idx[Yt]].decoded=!0;var Un=Pe[se.idx[Yt]].type;if(Pe[Yt].type==2)for(var xn=0;xn<ee;++xn){const Nn=nn[Yt][xn];for(var Zn=0;Zn<At;++Zn)Dn[Zn]=$t.getUint16(Nn+Zn*2*Un,!0);for(var Zn=0;Zn<At;++Zn)$t.setFloat32(Nn+Zn*2*Un,Le(Dn[Zn]),!0)}}}function we(se,ge,Pe){for(var rt,dt=1;dt<64;)rt=ge[se.value],rt==65280?dt=64:rt>>8==255?dt+=rt&255:(Pe[dt]=rt,dt++),se.value++}function Me(se,ge){ge[0]=Le(se[0]),ge[1]=Le(se[1]),ge[2]=Le(se[5]),ge[3]=Le(se[6]),ge[4]=Le(se[14]),ge[5]=Le(se[15]),ge[6]=Le(se[27]),ge[7]=Le(se[28]),ge[8]=Le(se[2]),ge[9]=Le(se[4]),ge[10]=Le(se[7]),ge[11]=Le(se[13]),ge[12]=Le(se[16]),ge[13]=Le(se[26]),ge[14]=Le(se[29]),ge[15]=Le(se[42]),ge[16]=Le(se[3]),ge[17]=Le(se[8]),ge[18]=Le(se[12]),ge[19]=Le(se[17]),ge[20]=Le(se[25]),ge[21]=Le(se[30]),ge[22]=Le(se[41]),ge[23]=Le(se[43]),ge[24]=Le(se[9]),ge[25]=Le(se[11]),ge[26]=Le(se[18]),ge[27]=Le(se[24]),ge[28]=Le(se[31]),ge[29]=Le(se[40]),ge[30]=Le(se[44]),ge[31]=Le(se[53]),ge[32]=Le(se[10]),ge[33]=Le(se[19]),ge[34]=Le(se[23]),ge[35]=Le(se[32]),ge[36]=Le(se[39]),ge[37]=Le(se[45]),ge[38]=Le(se[52]),ge[39]=Le(se[54]),ge[40]=Le(se[20]),ge[41]=Le(se[22]),ge[42]=Le(se[33]),ge[43]=Le(se[38]),ge[44]=Le(se[46]),ge[45]=Le(se[51]),ge[46]=Le(se[55]),ge[47]=Le(se[60]),ge[48]=Le(se[21]),ge[49]=Le(se[34]),ge[50]=Le(se[37]),ge[51]=Le(se[47]),ge[52]=Le(se[50]),ge[53]=Le(se[56]),ge[54]=Le(se[59]),ge[55]=Le(se[61]),ge[56]=Le(se[35]),ge[57]=Le(se[36]),ge[58]=Le(se[48]),ge[59]=Le(se[49]),ge[60]=Le(se[57]),ge[61]=Le(se[58]),ge[62]=Le(se[62]),ge[63]=Le(se[63])}function Ae(se){const ge=.5*Math.cos(.7853975),Pe=.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),At=.5*Math.cos(3*3.14159/8),ee=.5*Math.cos(7*3.14159/16);for(var xe=new Array(4),Te=new Array(4),De=new Array(4),ve=new Array(4),_t=0;_t<8;++_t){var ft=_t*8;xe[0]=rt*se[ft+2],xe[1]=At*se[ft+2],xe[2]=rt*se[ft+6],xe[3]=At*se[ft+6],Te[0]=Pe*se[ft+1]+dt*se[ft+3]+ot*se[ft+5]+ee*se[ft+7],Te[1]=dt*se[ft+1]-ee*se[ft+3]-Pe*se[ft+5]-ot*se[ft+7],Te[2]=ot*se[ft+1]-Pe*se[ft+3]+ee*se[ft+5]+dt*se[ft+7],Te[3]=ee*se[ft+1]-ot*se[ft+3]+dt*se[ft+5]-Pe*se[ft+7],De[0]=ge*(se[ft+0]+se[ft+4]),De[3]=ge*(se[ft+0]-se[ft+4]),De[1]=xe[0]+xe[3],De[2]=xe[1]-xe[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],se[ft+0]=ve[0]+Te[0],se[ft+1]=ve[1]+Te[1],se[ft+2]=ve[2]+Te[2],se[ft+3]=ve[3]+Te[3],se[ft+4]=ve[3]-Te[3],se[ft+5]=ve[2]-Te[2],se[ft+6]=ve[1]-Te[1],se[ft+7]=ve[0]-Te[0]}for(var yt=0;yt<8;++yt)xe[0]=rt*se[16+yt],xe[1]=At*se[16+yt],xe[2]=rt*se[48+yt],xe[3]=At*se[48+yt],Te[0]=Pe*se[8+yt]+dt*se[24+yt]+ot*se[40+yt]+ee*se[56+yt],Te[1]=dt*se[8+yt]-ee*se[24+yt]-Pe*se[40+yt]-ot*se[56+yt],Te[2]=ot*se[8+yt]-Pe*se[24+yt]+ee*se[40+yt]+dt*se[56+yt],Te[3]=ee*se[8+yt]-ot*se[24+yt]+dt*se[40+yt]-Pe*se[56+yt],De[0]=ge*(se[yt]+se[32+yt]),De[3]=ge*(se[yt]-se[32+yt]),De[1]=xe[0]+xe[3],De[2]=xe[1]-xe[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],se[0+yt]=ve[0]+Te[0],se[8+yt]=ve[1]+Te[1],se[16+yt]=ve[2]+Te[2],se[24+yt]=ve[3]+Te[3],se[32+yt]=ve[3]-Te[3],se[40+yt]=ve[2]-Te[2],se[48+yt]=ve[1]-Te[1],se[56+yt]=ve[0]-Te[0]}function Ne(se){for(var ge=0;ge<64;++ge){var Pe=se[0][ge],rt=se[1][ge],dt=se[2][ge];se[0][ge]=Pe+1.5747*dt,se[1][ge]=Pe-.1873*rt-.4682*dt,se[2][ge]=Pe+1.8556*rt}}function Ue(se,ge,Pe){for(var rt=0;rt<64;++rt)ge[Pe+rt]=fm.toHalfFloat(Qe(se[rt]))}function Qe(se){return se<=1?Math.sign(se)*Math.pow(Math.abs(se),2.2):Math.sign(se)*Math.pow(D,Math.abs(se)-1)}function ae(se){return new DataView(se.array.buffer,se.offset.value,se.size)}function K(se){var ge=se.viewer.buffer.slice(se.offset.value,se.offset.value+se.size),Pe=new Uint8Array(Ie(ge)),rt=new Uint8Array(Pe.length);return pe(Pe),ze(Pe,rt),new DataView(rt.buffer)}function ce(se){var ge=se.array.slice(se.offset.value,se.offset.value+se.size),Pe=Qw(ge),rt=new Uint8Array(Pe.length);return pe(Pe),ze(Pe,rt),new DataView(rt.buffer)}function he(se){for(var ge=se.viewer,Pe={value:se.offset.value},rt=new Uint16Array(se.width*se.scanlineBlockSize*(se.channels*se.type)),dt=new Uint8Array(8192),ot=0,At=new Array(se.channels),ee=0;ee<se.channels;ee++)At[ee]={},At[ee].start=ot,At[ee].end=At[ee].start,At[ee].nx=se.width,At[ee].ny=se.lines,At[ee].size=se.type,ot+=At[ee].nx*At[ee].ny*At[ee].size;var xe=ht(ge,Pe),Te=ht(ge,Pe);if(Te>=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(xe<=Te)for(var ee=0;ee<Te-xe+1;ee++)dt[ee+xe]=Mt(ge,Pe);var De=new Uint16Array(65536),ve=R(dt,De),_t=Ye(ge,Pe);je(se.array,ge,Pe,_t,rt,ot);for(var ee=0;ee<se.channels;++ee)for(var ft=At[ee],yt=0;yt<At[ee].size;++yt)Oe(rt,ft.start+yt,ft.nx,ft.size,ft.ny,ft.nx*ft.size,ve);He(De,rt,ot);for(var St=0,Nt=new Uint8Array(rt.buffer.byteLength),qt=0;qt<se.lines;qt++)for(var at=0;at<se.channels;at++){var ft=At[at],nn=ft.nx*ft.size,pn=new Uint8Array(rt.buffer,ft.end*2,nn*2);Nt.set(pn,St),St+=nn*2,ft.end+=nn}return new DataView(Nt.buffer)}function me(se){var ge=se.array.slice(se.offset.value,se.offset.value+se.size),Pe=Qw(ge);const rt=se.lines*se.channels*se.width,dt=se.type==1?new Uint16Array(rt):new Uint32Array(rt);let ot=0,At=0;const ee=new Array(4);for(let xe=0;xe<se.lines;xe++)for(let Te=0;Te<se.channels;Te++){let De=0;switch(se.type){case 1:ee[0]=ot,ee[1]=ee[0]+se.width,ot=ee[1]+se.width;for(let ve=0;ve<se.width;++ve){const _t=Pe[ee[0]++]<<8|Pe[ee[1]++];De+=_t,dt[At]=De,At++}break;case 2:ee[0]=ot,ee[1]=ee[0]+se.width,ee[2]=ee[1]+se.width,ot=ee[2]+se.width;for(let ve=0;ve<se.width;++ve){const _t=Pe[ee[0]++]<<24|Pe[ee[1]++]<<16|Pe[ee[2]++]<<8;De+=_t,dt[At]=De,At++}break}}return new DataView(dt.buffer)}function $(se){var ge=se.viewer,Pe={value:se.offset.value},rt=new Uint8Array(se.width*se.lines*(se.channels*se.type*2)),dt={version:gt(ge,Pe),unknownUncompressedSize:gt(ge,Pe),unknownCompressedSize:gt(ge,Pe),acCompressedSize:gt(ge,Pe),dcCompressedSize:gt(ge,Pe),rleCompressedSize:gt(ge,Pe),rleUncompressedSize:gt(ge,Pe),rleRawSize:gt(ge,Pe),totalAcUncompressedCount:gt(ge,Pe),totalDcUncompressedCount:gt(ge,Pe),acCompression:gt(ge,Pe)};if(dt.version<2)throw"EXRLoader.parse: "+hi.compression+" version "+dt.version+" is unsupported";for(var ot=new Array,At=ht(ge,Pe)-2;At>0;){var ee=Ve(ge.buffer,Pe),xe=Mt(ge,Pe),Te=xe>>2&3,De=(xe>>4)-1,ve=new Int8Array([De])[0],_t=Mt(ge,Pe);ot.push({name:ee,index:ve,type:_t,compression:Te}),At-=ee.length+3}for(var ft=hi.channels,yt=new Array(se.channels),St=0;St<se.channels;++St){var Nt=yt[St]={},qt=ft[St];Nt.name=qt.name,Nt.compression=0,Nt.decoded=!1,Nt.type=qt.pixelType,Nt.pLinear=qt.pLinear,Nt.width=se.width,Nt.height=se.lines}for(var at={idx:new Array(3)},nn=0;nn<se.channels;++nn)for(var Nt=yt[nn],St=0;St<ot.length;++St){var pn=ot[St];Nt.name==pn.name&&(Nt.compression=pn.compression,pn.index>=0&&(at.idx[pn.index]=nn),Nt.offset=nn)}if(dt.acCompressedSize>0)switch(dt.acCompression){case 0:var $t=new Uint16Array(dt.totalAcUncompressedCount);je(se.array,ge,Pe,dt.acCompressedSize,$t,dt.totalAcUncompressedCount);break;case 1:var dn=se.array.slice(Pe.value,Pe.value+dt.totalAcUncompressedCount),Dn=Qw(dn),$t=new Uint16Array(Dn.buffer);Pe.value+=dt.totalAcUncompressedCount;break}if(dt.dcCompressedSize>0){var Yt={array:se.array,offset:Pe,size:dt.dcCompressedSize},Un=new Uint16Array(ce(Yt).buffer);Pe.value+=dt.dcCompressedSize}if(dt.rleRawSize>0){var dn=se.array.slice(Pe.value,Pe.value+dt.rleCompressedSize),Dn=Qw(dn),xn=Ie(Dn.buffer);Pe.value+=dt.rleCompressedSize}for(var Zn=0,Nn=new Array(yt.length),St=0;St<Nn.length;++St)Nn[St]=new Array;for(var An=0;An<se.lines;++An)for(var Sn=0;Sn<yt.length;++Sn)Nn[Sn].push(Zn),Zn+=yt[Sn].width*se.type*2;qe(at,Nn,yt,$t,Un,rt);for(var St=0;St<yt.length;++St){var Nt=yt[St];if(!Nt.decoded)switch(Nt.compression){case 2:for(var an=0,di=0,An=0;An<se.lines;++An){for(var Li=Nn[St][an],Gn=0;Gn<Nt.width;++Gn){for(var wi=0;wi<2*Nt.type;++wi)rt[Li++]=xn[di+wi*Nt.width*Nt.height];di++}an++}break;case 1:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(rt.buffer)}function Ve(se,ge){for(var Pe=new Uint8Array(se),rt=0;Pe[ge.value+rt]!=0;)rt+=1;var dt=new TextDecoder().decode(Pe.slice(ge.value,ge.value+rt));return ge.value=ge.value+rt+1,dt}function Xe(se,ge,Pe){var rt=new TextDecoder().decode(new Uint8Array(se).slice(ge.value,ge.value+Pe));return ge.value=ge.value+Pe,rt}function mt(se,ge){var Pe=Je(se,ge),rt=Ye(se,ge);return[Pe,rt]}function Ge(se,ge){var Pe=Ye(se,ge),rt=Ye(se,ge);return[Pe,rt]}function Je(se,ge){var Pe=se.getInt32(ge.value,!0);return ge.value=ge.value+4,Pe}function Ye(se,ge){var Pe=se.getUint32(ge.value,!0);return ge.value=ge.value+4,Pe}function vt(se,ge){var Pe=se[ge.value];return ge.value=ge.value+1,Pe}function Mt(se,ge){var Pe=se.getUint8(ge.value);return ge.value=ge.value+1,Pe}const gt=function(se,ge){let Pe;return"getBigInt64"in DataView.prototype?Pe=Number(se.getBigInt64(ge.value,!0)):Pe=se.getUint32(ge.value+4,!0)+Number(se.getUint32(ge.value,!0)<<32),ge.value+=8,Pe};function kt(se,ge){var Pe=se.getFloat32(ge.value,!0);return ge.value+=4,Pe}function Re(se,ge){return fm.toHalfFloat(kt(se,ge))}function Le(se){var ge=(se&31744)>>10,Pe=se&1023;return(se>>15?-1:1)*(ge?ge===31?Pe?NaN:1/0:Math.pow(2,ge-15)*(1+Pe/1024):6103515625e-14*(Pe/1024))}function ht(se,ge){var Pe=se.getUint16(ge.value,!0);return ge.value+=2,Pe}function jt(se,ge){return Le(ht(se,ge))}function st(se,ge,Pe,rt){for(var dt=Pe.value,ot=[];Pe.value<dt+rt-1;){var At=Ve(ge,Pe),ee=Je(se,Pe),xe=Mt(se,Pe);Pe.value+=3;var Te=Je(se,Pe),De=Je(se,Pe);ot.push({name:At,pixelType:ee,pLinear:xe,xSampling:Te,ySampling:De})}return Pe.value+=1,ot}function it(se,ge){var Pe=kt(se,ge),rt=kt(se,ge),dt=kt(se,ge),ot=kt(se,ge),At=kt(se,ge),ee=kt(se,ge),xe=kt(se,ge),Te=kt(se,ge);return{redX:Pe,redY:rt,greenX:dt,greenY:ot,blueX:At,blueY:ee,whiteX:xe,whiteY:Te}}function bt(se,ge){var Pe=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],rt=Mt(se,ge);return Pe[rt]}function Jt(se,ge){var Pe=Ye(se,ge),rt=Ye(se,ge),dt=Ye(se,ge),ot=Ye(se,ge);return{xMin:Pe,yMin:rt,xMax:dt,yMax:ot}}function Kt(se,ge){var Pe=["INCREASING_Y"],rt=Mt(se,ge);return Pe[rt]}function un(se,ge){var Pe=kt(se,ge),rt=kt(se,ge);return[Pe,rt]}function Vn(se,ge){var Pe=kt(se,ge),rt=kt(se,ge),dt=kt(se,ge);return[Pe,rt,dt]}function vn(se,ge,Pe,rt,dt){if(rt==="string"||rt==="stringvector"||rt==="iccProfile")return Xe(ge,Pe,dt);if(rt==="chlist")return st(se,ge,Pe,dt);if(rt==="chromaticities")return it(se,Pe);if(rt==="compression")return bt(se,Pe);if(rt==="box2i")return Jt(se,Pe);if(rt==="lineOrder")return Kt(se,Pe);if(rt==="float")return kt(se,Pe);if(rt==="v2f")return un(se,Pe);if(rt==="v3f")return Vn(se,Pe);if(rt==="int")return Je(se,Pe);if(rt==="rational")return mt(se,Pe);if(rt==="timecode")return Ge(se,Pe);if(rt==="preview")return Pe.value+=dt,"skipped";Pe.value+=dt}function Qn(se,ge,Pe){const rt={};if(se.getUint32(0,!0)!=20000630)throw"THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.";rt.version=se.getUint8(4);const dt=se.getUint8(5);rt.spec={singleTile:!!(dt&2),longName:!!(dt&4),deepFormat:!!(dt&8),multiPart:!!(dt&16)},Pe.value=8;for(var ot=!0;ot;){var At=Ve(ge,Pe);if(At==0)ot=!1;else{var ee=Ve(ge,Pe),xe=Ye(se,Pe),Te=vn(se,ge,Pe,ee,xe);Te===void 0?console.warn(`EXRLoader.parse: skipped unknown header attribute type '${ee}'.`):rt[At]=Te}}if(dt&-5)throw console.error("EXRHeader:",rt),"THREE.EXRLoader: provided file is currently unsupported.";return rt}function Yn(se,ge,Pe,rt,dt){const ot={size:0,viewer:ge,array:Pe,offset:rt,width:se.dataWindow.xMax-se.dataWindow.xMin+1,height:se.dataWindow.yMax-se.dataWindow.yMin+1,channels:se.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:se.channels[0].pixelType,uncompress:null,getter:null,format:null,[Jy?"colorSpace":"encoding"]:null};switch(se.compression){case"NO_COMPRESSION":ot.lines=1,ot.uncompress=ae;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=he;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: "+se.compression+" is unsupported"}if(ot.scanlineBlockSize=ot.lines,ot.type==1)switch(dt){case wr:ot.getter=jt,ot.inputSize=2;break;case rs:ot.getter=ht,ot.inputSize=2;break}else if(ot.type==2)switch(dt){case wr:ot.getter=kt,ot.inputSize=4;break;case rs:ot.getter=Re,ot.inputSize=4}else throw"EXRLoader.parse: unsupported pixelType "+ot.type+" for "+se.compression+".";ot.blockCount=(se.dataWindow.yMax+1)/ot.scanlineBlockSize;for(var At=0;At<ot.blockCount;At++)gt(ge,rt);ot.outputChannels=ot.channels==3?4:ot.channels;const ee=ot.width*ot.height*ot.outputChannels;switch(dt){case wr:ot.byteArray=new Float32Array(ee),ot.channels<ot.outputChannels&&ot.byteArray.fill(1,0,ee);break;case rs: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=Qr:ot.format=Th,Jy?ot.colorSpace="srgb-linear":ot.encoding=3e3,ot}const _i=new DataView(e),Xn=new Uint8Array(e),Ji={value:0},hi=Qn(_i,e,Ji),on=Yn(hi,_i,Xn,Ji,this.type),Ii={value:0},ri={R:0,G:1,B:2,A:3,Y:0};for(let se=0;se<on.height/on.scanlineBlockSize;se++){const ge=Ye(_i,Ji);on.size=Ye(_i,Ji),on.lines=ge+on.scanlineBlockSize>on.height?on.height-ge:on.scanlineBlockSize;const rt=on.size<on.lines*on.bytesPerLine?on.uncompress(on):ae(on);Ji.value+=on.size;for(let dt=0;dt<on.scanlineBlockSize;dt++){const ot=dt+se*on.scanlineBlockSize;if(ot>=on.height)break;for(let At=0;At<on.channels;At++){const ee=ri[hi.channels[At].name];for(let xe=0;xe<on.width;xe++){Ii.value=(dt*(on.channels*on.width)+At*on.width+xe)*on.inputSize;const Te=(on.height-1-ot)*(on.width*on.outputChannels)+xe*on.outputChannels+ee;on.byteArray[Te]=on.getter(rt,Ii)}}}}return{header:hi,width:on.width,height:on.height,data:on.byteArray,format:on.format,[Jy?"colorSpace":"encoding"]:on[Jy?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,n,i,r){function a(s,o){Jy?s.colorSpace=o.colorSpace:s.encoding=o.encoding,s.minFilter=Vi,s.magFilter=Vi,s.generateMipmaps=!1,s.flipY=!1,n&&n(s,o)}return super.load(e,a,i,r)}}const iD=new WeakMap;class XEe 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 On;e.index&&n.setIndex(new In(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 In(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=KEe.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 KEe(){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 m=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,m,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),m=s._malloc(b);o.GetAttributeDataArrayForAllPoints(l,f,y,b,m);const x=new u(s.HEAPF32.buffer,m,g).slice();return s._free(m),{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 V_{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 mn(e,3)),this.setAttribute("uv",new mn(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 zo(i,3,0)),this.setAttribute("instanceEnd",new zo(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 zo(r,n,0)),this.setAttribute("instanceColorEnd",new zo(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 Ur),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 cs{constructor(e){super({type:"LineMaterial",uniforms:lv.clone(lv.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 <${K_>=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 ni,T5=new te,A5=new te,ps=new ni,ms=new ni,Pu=new ni,aD=new te,sD=new Dt,xs=new R$,C5=new te,tE=new rr,nE=new Ur,Uu=new ni;let qu,Im;function R5(t,e,n){return Uu.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),Uu.multiplyScalar(1/Uu.w),Uu.x=Im/n.width,Uu.y=Im/n.height,Uu.applyMatrix4(t.projectionMatrixInverse),Uu.multiplyScalar(1/Uu.w),Math.abs(Math.max(Uu.x,Uu.y))}function YEe(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;qu.distanceSqToSegment(xs.start,xs.end,u,c),u.distanceTo(c)<Im*.5&&e.push({point:u,pointOnLine:c,distance:qu.origin.distanceTo(u),object:t,face:null,faceIndex:o,uv:null,[vZ]:null})}}function JEe(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;qu.at(1,Pu),Pu.w=1,Pu.applyMatrix4(e.matrixWorldInverse),Pu.applyMatrix4(i),Pu.multiplyScalar(1/Pu.w),Pu.x*=a.x/2,Pu.y*=a.y/2,Pu.z=0,aD.copy(Pu),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=yc.lerp(ps.z,ms.z,b),m=y>=-1&&y<=1,x=aD.distanceTo(C5)<Im*.5;if(m&&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;qu.distanceSqToSegment(xs.start,xs.end,w,_),n.push({point:w,pointOnLine:_,distance:qu.origin.distanceTo(w),object:t,face:null,faceIndex:h,uv:null,[vZ]:null})}}}class TU extends Si{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 zo(a,1,0)),e.setAttribute("instanceDistanceEnd",new zo(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;qu=e.ray;const s=this.matrixWorld,o=this.geometry,l=this.material;Im=l.linewidth+a,o.boundingSphere===null&&o.computeBoundingSphere(),nE.copy(o.boundingSphere).applyMatrix4(s);let c;if(i)c=Im*.5;else{const f=Math.max(r.near,nE.distanceToPoint(qu.origin));c=R5(r,f,l.resolution)}if(nE.radius+=c,qu.intersectsSphere(nE)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),tE.copy(o.boundingBox).applyMatrix4(s);let u;if(i)u=Im*.5;else{const f=Math.max(r.near,tE.distanceToPoint(qu.origin));u=R5(r,f,l.resolution)}tE.expandByScalar(u),qu.intersectsBox(tE)!==!1&&(i?YEe(this,n):JEe(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 AZ extends TU{constructor(e=new MU,n=new xC({color:Math.random()*16777215})){super(e,n),this.isLine2=!0,this.type="Line2"}}const $Ee=new te,ZEe=new te,QEe=new te,eMe=(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},tMe=(t,e,n,i=1)=>{const r=$Ee.set(t.x/n.width*2-1,-(t.y/n.height)*2+1,i);return r.unproject(e),r},CZ=(t,e,n,i)=>{const r=eMe(QEe.copy(t),n,i);let a=0;for(let s=0;s<2;++s){const o=ZEe.copy(r).setComponent(s,r.getComponent(s)+e),l=tMe(o,n,i,o.z);a=Math.max(a,t.distanceTo(l))}return a},$m=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=ki(m=>m.size),d=I.useMemo(()=>s?new TU:new AZ,[s]),[g]=I.useState(()=>new xC),b=(i==null||(u=i[0])==null?void 0:u.length)===4?4:3,y=I.useMemo(()=>{const m=s?new yC:new MU,x=e.map(_=>{const w=Array.isArray(_);return _ instanceof te||_ instanceof ni?[_.x,_.y,_.z]:_ instanceof wt?[_.x,_.y,0]:w&&_.length===3?[_[0],_[1],_[2]]:w&&_.length===2?[_[0],_[1],0]:_});if(m.setPositions(x.flat()),i){n=16777215;const _=i.map(w=>w instanceof Ut?w.toArray():w);m.setColors(_.flat(),b)}return m},[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)))}),nMe=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($m,Is({ref:o,points:l},s))}),iMe=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,m=Math.floor(b/g);d.push(h[m].clone().lerp(h[m+1],y))}return d.push(h[h.length-1]),d},[s,a]);return I.createElement($m,Is({ref:l,points:u,vertexColors:f},o))});function rMe(){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 aMe(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 RZ=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 RZ=function(){return t},t},sMe=0,oMe=0,oD=!1,l1=Object.create(null),c1=Object.create(null),gI=Object.create(null);function ey(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=aMe(t);r==null&&(r="#default");var s="workerModule"+ ++sMe,o=t.name||s,l=null;e=e&&e.map(function(u){return typeof u=="function"&&!u.workerModuleData&&(oD=!0,u=ey({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(!RZ())return a.apply(void 0,u);if(!l){l=k5(r,"registerModule",c.workerModuleData);var h=function(){l=null,c1[r].delete(h)};(c1[r]||(c1[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 lMe(t){c1[t]&&c1[t].forEach(function(e){e()}),l1[t]&&(l1[t].terminate(),delete l1[t])}function gM(t){var e=t.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function cMe(t){var e=l1[t];if(!e){var n=gM(rMe);e=l1[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=++oMe;gI[a]=function(s){s.success?i(s.result):r(new Error("Error in worker "+e+" call: "+s.error))},cMe(t).postMessage({messageId:a,action:e,data:n})})}function kZ(){var t=function(e){function n(W,B,J,Z,G,de,oe,le){var ue=1-oe;le.x=ue*ue*W+2*ue*oe*J+oe*oe*G,le.y=ue*ue*B+2*ue*oe*Z+oe*oe*de}function i(W,B,J,Z,G,de,oe,le,ue,Se){var Oe=1-ue;Se.x=Oe*Oe*Oe*W+3*Oe*Oe*ue*J+3*Oe*ue*ue*G+ue*ue*ue*oe,Se.y=Oe*Oe*Oe*B+3*Oe*Oe*ue*Z+3*Oe*ue*ue*de+ue*ue*ue*le}function r(W,B){for(var J=/([MLQCZ])([^MLQCZ]*)/g,Z,G,de,oe,le;Z=J.exec(W);){var ue=Z[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(Se){return parseFloat(Se)});switch(Z[1]){case"M":oe=G=ue[0],le=de=ue[1];break;case"L":(ue[0]!==oe||ue[1]!==le)&&B("L",oe,le,oe=ue[0],le=ue[1]);break;case"Q":{B("Q",oe,le,oe=ue[2],le=ue[3],ue[0],ue[1]);break}case"C":{B("C",oe,le,oe=ue[4],le=ue[5],ue[0],ue[1],ue[2],ue[3]);break}case"Z":(oe!==G||le!==de)&&B("L",oe,le,G,de);break}}}function a(W,B,J){J===void 0&&(J=16);var Z={x:0,y:0};r(W,function(G,de,oe,le,ue,Se,Oe,Be,je){switch(G){case"L":B(de,oe,le,ue);break;case"Q":{for(var He=de,pe=oe,ze=1;ze<J;ze++)n(de,oe,Se,Oe,le,ue,ze/(J-1),Z),B(He,pe,Z.x,Z.y),He=Z.x,pe=Z.y;break}case"C":{for(var Ie=de,qe=oe,we=1;we<J;we++)i(de,oe,Se,Oe,Be,je,le,ue,we/(J-1),Z),B(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,B){var J=W.getContext?W.getContext("webgl",c):W,Z=l.get(J);if(!Z){let Oe=function(Ie){var qe=de[Ie];if(!qe&&(qe=de[Ie]=J.getExtension(Ie),!qe))throw new Error(Ie+" not supported");return qe},Be=function(Ie,qe){var we=J.createShader(qe);return J.shaderSource(we,Ie),J.compileShader(we),we},je=function(Ie,qe,we,Me){if(!oe[Ie]){var Ae={},Ne={},Ue=J.createProgram();J.attachShader(Ue,Be(qe,J.VERTEX_SHADER)),J.attachShader(Ue,Be(we,J.FRAGMENT_SHADER)),J.linkProgram(Ue),oe[Ie]={program:Ue,transaction:function(ae){J.useProgram(Ue),ae({setUniform:function(ce,he){for(var me=[],$=arguments.length-2;$-- >0;)me[$]=arguments[$+2];var Ve=Ne[he]||(Ne[he]=J.getUniformLocation(Ue,he));J["uniform"+ce].apply(J,[Ve].concat(me))},setAttribute:function(ce,he,me,$,Ve){var Xe=Ae[ce];Xe||(Xe=Ae[ce]={buf:J.createBuffer(),loc:J.getAttribLocation(Ue,ce),data:null}),J.bindBuffer(J.ARRAY_BUFFER,Xe.buf),J.vertexAttribPointer(Xe.loc,he,J.FLOAT,!1,0,0),J.enableVertexAttribArray(Xe.loc),G?J.vertexAttribDivisor(Xe.loc,$):Oe("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Xe.loc,$),Ve!==Xe.data&&(J.bufferData(J.ARRAY_BUFFER,Ve,me),Xe.data=Ve)}})}}}oe[Ie].transaction(Me)},He=function(Ie,qe){ue++;try{J.activeTexture(J.TEXTURE0+ue);var we=le[Ie];we||(we=le[Ie]=J.createTexture(),J.bindTexture(J.TEXTURE_2D,we),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,J.NEAREST),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MAG_FILTER,J.NEAREST)),J.bindTexture(J.TEXTURE_2D,we),qe(we,ue)}finally{ue--}},pe=function(Ie,qe,we){var Me=J.createFramebuffer();Se.push(Me),J.bindFramebuffer(J.FRAMEBUFFER,Me),J.activeTexture(J.TEXTURE0+qe),J.bindTexture(J.TEXTURE_2D,Ie),J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,Ie,0);try{we(Me)}finally{J.deleteFramebuffer(Me),J.bindFramebuffer(J.FRAMEBUFFER,Se[--Se.length-1]||null)}},ze=function(){de={},oe={},le={},ue=-1,Se.length=0};var G=typeof WebGL2RenderingContext<"u"&&J instanceof WebGL2RenderingContext,de={},oe={},le={},ue=-1,Se=[];J.canvas.addEventListener("webglcontextlost",function(Ie){ze(),Ie.preventDefault()},!1),l.set(J,Z={gl:J,isWebGL2:G,getExtension:Oe,withProgram:je,withTexture:He,withTextureFramebuffer:pe,handleContextLoss:ze})}B(Z)}function f(W,B,J,Z,G,de,oe,le){oe===void 0&&(oe=15),le===void 0&&(le=null),u(W,function(ue){var Se=ue.gl,Oe=ue.withProgram,Be=ue.withTexture;Be("copy",function(je,He){Se.texImage2D(Se.TEXTURE_2D,0,Se.RGBA,G,de,0,Se.RGBA,Se.UNSIGNED_BYTE,B),Oe("copy",s,o,function(pe){var ze=pe.setUniform,Ie=pe.setAttribute;Ie("aUV",2,Se.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ze("1i","image",He),Se.bindFramebuffer(Se.FRAMEBUFFER,le||null),Se.disable(Se.BLEND),Se.colorMask(oe&8,oe&4,oe&2,oe&1),Se.viewport(J,Z,G,de),Se.scissor(J,Z,G,de),Se.drawArrays(Se.TRIANGLES,0,3)})})})}function h(W,B,J){var Z=W.width,G=W.height;u(W,function(de){var oe=de.gl,le=new Uint8Array(Z*G*4);oe.readPixels(0,0,Z,G,oe.RGBA,oe.UNSIGNED_BYTE,le),W.width=B,W.height=J,f(oe,le,0,0,Z,G)})}var d=Object.freeze({__proto__:null,withWebGLContext:u,renderImageData:f,resizeWebGLCanvasWithoutClearing:h});function g(W,B,J,Z,G,de){de===void 0&&(de=1);var oe=new Uint8Array(W*B),le=Z[2]-Z[0],ue=Z[3]-Z[1],Se=[];a(J,function(Ie,qe,we,Me){Se.push({x1:Ie,y1:qe,x2:we,y2:Me,minX:Math.min(Ie,we),minY:Math.min(qe,Me),maxX:Math.max(Ie,we),maxY:Math.max(qe,Me)})}),Se.sort(function(Ie,qe){return Ie.maxX-qe.maxX});for(var Oe=0;Oe<W;Oe++)for(var Be=0;Be<B;Be++){var je=pe(Z[0]+le*(Oe+.5)/W,Z[1]+ue*(Be+.5)/B),He=Math.pow(1-Math.abs(je)/G,de)/2;je<0&&(He=1-He),He=Math.max(0,Math.min(255,Math.round(He*255))),oe[Be*W+Oe]=He}return oe;function pe(Ie,qe){for(var we=1/0,Me=1/0,Ae=Se.length;Ae--;){var Ne=Se[Ae];if(Ne.maxX+Me<=Ie)break;if(Ie+Me>Ne.minX&&qe-Me<Ne.maxY&&qe+Me>Ne.minY){var Ue=m(Ie,qe,Ne.x1,Ne.y1,Ne.x2,Ne.y2);Ue<we&&(we=Ue,Me=Math.sqrt(we))}}return ze(Ie,qe)&&(Me=-Me),Me}function ze(Ie,qe){for(var we=0,Me=Se.length;Me--;){var Ae=Se[Me];if(Ae.maxX<=Ie)break;var Ne=Ae.y1>qe!=Ae.y2>qe&&Ie<(Ae.x2-Ae.x1)*(qe-Ae.y1)/(Ae.y2-Ae.y1)+Ae.x1;Ne&&(we+=Ae.y1<Ae.y2?1:-1)}return we!==0}}function b(W,B,J,Z,G,de,oe,le,ue,Se){de===void 0&&(de=1),le===void 0&&(le=0),ue===void 0&&(ue=0),Se===void 0&&(Se=0),y(W,B,J,Z,G,de,oe,null,le,ue,Se)}function y(W,B,J,Z,G,de,oe,le,ue,Se,Oe){de===void 0&&(de=1),ue===void 0&&(ue=0),Se===void 0&&(Se=0),Oe===void 0&&(Oe=0);for(var Be=g(W,B,J,Z,G,de),je=new Uint8Array(Be.length*4),He=0;He<Be.length;He++)je[He*4+Oe]=Be[He];f(oe,je,ue,Se,W,B,1<<3-Oe,le)}function m(W,B,J,Z,G,de){var oe=G-J,le=de-Z,ue=oe*oe+le*le,Se=ue?Math.max(0,Math.min(1,((W-J)*oe+(B-Z)*le)/ue)):0,Oe=W-(J+Se*oe),Be=B-(Z+Se*le);return Oe*Oe+Be*Be}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 L(W){if(!C&&!q(W))throw new Error("WebGL generation not supported")}function U(W,B,J,Z,G,de,oe){if(de===void 0&&(de=1),oe===void 0&&(oe=null),!oe&&(oe=A,!oe)){var le=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!le)throw new Error("OffscreenCanvas or DOM canvas not supported");oe=A=le.getContext("webgl",{depth:!1})}L(oe);var ue=new Uint8Array(W*B*4);u(oe,function(je){var He=je.gl,pe=je.withTexture,ze=je.withTextureFramebuffer;pe("readable",function(Ie,qe){He.texImage2D(He.TEXTURE_2D,0,He.RGBA,W,B,0,He.RGBA,He.UNSIGNED_BYTE,null),ze(Ie,qe,function(we){z(W,B,J,Z,G,de,He,we,0,0,0),He.readPixels(0,0,W,B,He.RGBA,He.UNSIGNED_BYTE,ue)})})});for(var Se=new Uint8Array(W*B),Oe=0,Be=0;Oe<ue.length;Oe+=4)Se[Be++]=ue[Oe];return Se}function j(W,B,J,Z,G,de,oe,le,ue,Se){de===void 0&&(de=1),le===void 0&&(le=0),ue===void 0&&(ue=0),Se===void 0&&(Se=0),z(W,B,J,Z,G,de,oe,null,le,ue,Se)}function z(W,B,J,Z,G,de,oe,le,ue,Se,Oe){de===void 0&&(de=1),ue===void 0&&(ue=0),Se===void 0&&(Se=0),Oe===void 0&&(Oe=0),L(oe);var Be=[];a(J,function(je,He,pe,ze){Be.push(je,He,pe,ze)}),Be=new Float32Array(Be),u(oe,function(je){var He=je.gl,pe=je.isWebGL2,ze=je.getExtension,Ie=je.withProgram,qe=je.withTexture,we=je.withTextureFramebuffer,Me=je.handleContextLoss;if(qe("rawDistances",function(Ae,Ne){(W!==Ae._lastWidth||B!==Ae._lastHeight)&&He.texImage2D(He.TEXTURE_2D,0,He.RGBA,Ae._lastWidth=W,Ae._lastHeight=B,0,He.RGBA,He.UNSIGNED_BYTE,null),Ie("main",_,w,function(Ue){var Qe=Ue.setAttribute,ae=Ue.setUniform,K=!pe&&ze("ANGLE_instanced_arrays"),ce=!pe&&ze("EXT_blend_minmax");Qe("aUV",2,He.STATIC_DRAW,0,S),Qe("aLineSegment",4,He.DYNAMIC_DRAW,1,Be),ae.apply(void 0,["4f","uGlyphBounds"].concat(Z)),ae("1f","uMaxDistance",G),ae("1f","uExponent",de),we(Ae,Ne,function(he){He.enable(He.BLEND),He.colorMask(!0,!0,!0,!0),He.viewport(0,0,W,B),He.scissor(0,0,W,B),He.blendFunc(He.ONE,He.ONE),He.blendEquationSeparate(He.FUNC_ADD,pe?He.MAX:ce.MAX_EXT),He.clear(He.COLOR_BUFFER_BIT),pe?He.drawArraysInstanced(He.TRIANGLES,0,3,Be.length/4):K.drawArraysInstancedANGLE(He.TRIANGLES,0,3,Be.length/4)})}),Ie("post",s,M,function(Ue){Ue.setAttribute("aUV",2,He.STATIC_DRAW,0,S),Ue.setUniform("1i","tex",Ne),He.bindFramebuffer(He.FRAMEBUFFER,le),He.disable(He.BLEND),He.colorMask(Oe===0,Oe===1,Oe===2,Oe===3),He.viewport(ue,Se,W,B),He.scissor(ue,Se,W,B),He.drawArrays(He.TRIANGLES,0,3)})}),He.isContextLost())throw Me(),new Error("webgl context lost")})}function q(W){var B=!W||W===A?D:W.canvas||W,J=R.get(B);if(J===void 0){C=!0;var Z=null;try{var G=[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);J=de&&G.length===de.length&&de.every(function(oe,le){return oe===G[le]}),J||(Z="bad trial run results",console.info(G,de))}catch(oe){J=!1,Z=oe.message}Z&&console.warn("WebGL SDF generation not supported:",Z),C=!1,R.set(B,J)}return J}var F=Object.freeze({__proto__:null,generate:U,generateIntoCanvas:j,generateIntoFramebuffer:z,isSupported:q});function V(W,B,J,Z,G,de){G===void 0&&(G=Math.max(Z[2]-Z[0],Z[3]-Z[1])/2),de===void 0&&(de=1);try{return U.apply(F,arguments)}catch(oe){return console.info("WebGL SDF generation failed, falling back to JS",oe),g.apply(x,arguments)}}function H(W,B,J,Z,G,de,oe,le,ue,Se){G===void 0&&(G=Math.max(Z[2]-Z[0],Z[3]-Z[1])/2),de===void 0&&(de=1),le===void 0&&(le=0),ue===void 0&&(ue=0),Se===void 0&&(Se=0);try{return j.apply(F,arguments)}catch(Oe){return console.info("WebGL SDF generation failed, falling back to JS",Oe),b.apply(x,arguments)}}return e.forEachPathCommand=r,e.generate=V,e.generateIntoCanvas=H,e.javascript=x,e.pathToLineSegments=a,e.webgl=F,e.webglUtils=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}function uMe(){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(Me,Ae){i[Me]=1<<Ae+1,r[i[Me]]=Me}),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 Me=function(Ne){if(n.hasOwnProperty(Ne)){var Ue=0;n[Ne].split(",").forEach(function(Qe){var ae=Qe.split("+"),K=ae[0],ce=ae[1];K=parseInt(K,36),ce=ce?parseInt(ce,36):0,u.set(Ue+=K,i[Ne]);for(var he=0;he<ce;he++)u.set(++Ue,i[Ne])})}};for(var Ae in n)Me(Ae)}}function h(Me){return f(),u.get(Me.codePointAt(0))||i.L}function d(Me){return r[h(Me)]}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(Me,Ae){var Ne=36,Ue=0,Qe=new Map,ae=Ae&&new Map,K;return Me.split(",").forEach(function ce(he){if(he.indexOf("+")!==-1)for(var me=+he;me--;)ce(K);else{K=he;var $=he.split(">"),Ve=$[0],Xe=$[1];Ve=String.fromCodePoint(Ue+=parseInt(Ve,Ne)),Xe=String.fromCodePoint(Ue+=parseInt(Xe,Ne)),Qe.set(Ve,Xe),Ae&&ae.set(Xe,Ve)}}),{map:Qe,reverseMap:ae}}var y,m,x;function _(){if(!y){var Me=b(g.pairs,!0),Ae=Me.map,Ne=Me.reverseMap;y=Ae,m=Ne,x=b(g.canonical,!1).map}}function w(Me){return _(),y.get(Me)||null}function M(Me){return _(),m.get(Me)||null}function S(Me){return _(),x.get(Me)||null}var A=i.L,C=i.R,D=i.EN,R=i.ES,L=i.ET,U=i.AN,j=i.CS,z=i.B,q=i.S,F=i.ON,V=i.BN,H=i.NSM,W=i.AL,B=i.LRO,J=i.RLO,Z=i.LRE,G=i.RLE,de=i.PDF,oe=i.LRI,le=i.RLI,ue=i.FSI,Se=i.PDI;function Oe(Me,Ae){for(var Ne=125,Ue=new Uint32Array(Me.length),Qe=0;Qe<Me.length;Qe++)Ue[Qe]=h(Me[Qe]);var ae=new Map;function K(br,Wr){var ur=Ue[br];Ue[br]=Wr,ae.set(ur,ae.get(ur)-1),ur&o&&ae.set(o,ae.get(o)-1),ae.set(Wr,(ae.get(Wr)||0)+1),Wr&o&&ae.set(o,(ae.get(o)||0)+1)}for(var ce=new Uint8Array(Me.length),he=new Map,me=[],$=null,Ve=0;Ve<Me.length;Ve++)$||me.push($={start:Ve,end:Me.length-1,level:Ae==="rtl"?1:Ae==="ltr"?0:Fc(Ve,!1)}),Ue[Ve]&z&&($.end=Ve,$=null);for(var Xe=G|Z|J|B|a|Se|de|z,mt=function(br){return br+(br&1?1:2)},Ge=function(br){return br+(br&1?2:1)},Je=0;Je<me.length;Je++){$=me[Je];var Ye=[{_level:$.level,_override:0,_isolate:0}],vt=void 0,Mt=0,gt=0,kt=0;ae.clear();for(var Re=$.start;Re<=$.end;Re++){var Le=Ue[Re];if(vt=Ye[Ye.length-1],ae.set(Le,(ae.get(Le)||0)+1),Le&o&&ae.set(o,(ae.get(o)||0)+1),Le&Xe)if(Le&(G|Z)){ce[Re]=vt._level;var ht=(Le===G?Ge:mt)(vt._level);ht<=Ne&&!Mt&&!gt?Ye.push({_level:ht,_override:0,_isolate:0}):Mt||gt++}else if(Le&(J|B)){ce[Re]=vt._level;var jt=(Le===J?Ge:mt)(vt._level);jt<=Ne&&!Mt&&!gt?Ye.push({_level:jt,_override:Le&J?C:A,_isolate:0}):Mt||gt++}else if(Le&a){Le&ue&&(Le=Fc(Re+1,!0)===1?le:oe),ce[Re]=vt._level,vt._override&&K(Re,vt._override);var st=(Le===le?Ge:mt)(vt._level);st<=Ne&&Mt===0&&gt===0?(kt++,Ye.push({_level:st,_override:0,_isolate:1,_isolInitIndex:Re})):Mt++}else if(Le&Se){if(Mt>0)Mt--;else if(kt>0){for(gt=0;!Ye[Ye.length-1]._isolate;)Ye.pop();var it=Ye[Ye.length-1]._isolInitIndex;it!=null&&(he.set(it,Re),he.set(Re,it)),Ye.pop(),kt--}vt=Ye[Ye.length-1],ce[Re]=vt._level,vt._override&&K(Re,vt._override)}else Le&de?(Mt===0&&(gt>0?gt--:!vt._isolate&&Ye.length>1&&(Ye.pop(),vt=Ye[Ye.length-1])),ce[Re]=vt._level):Le&z&&(ce[Re]=$.level);else ce[Re]=vt._level,vt._override&&Le!==V&&K(Re,vt._override)}for(var bt=[],Jt=null,Kt=$.start;Kt<=$.end;Kt++){var un=Ue[Kt];if(!(un&l)){var Vn=ce[Kt],vn=un&a,Qn=un===Se;Jt&&Vn===Jt._level?(Jt._end=Kt,Jt._endsWithIsolInit=vn):bt.push(Jt={_start:Kt,_end:Kt,_level:Vn,_startsWithPDI:Qn,_endsWithIsolInit:vn})}}for(var Yn=[],_i=0;_i<bt.length;_i++){var Xn=bt[_i];if(!Xn._startsWithPDI||Xn._startsWithPDI&&!he.has(Xn._start)){for(var Ji=[Jt=Xn],hi=void 0;Jt&&Jt._endsWithIsolInit&&(hi=he.get(Jt._end))!=null;)for(var on=_i+1;on<bt.length;on++)if(bt[on]._start===hi){Ji.push(Jt=bt[on]);break}for(var Ii=[],ri=0;ri<Ji.length;ri++)for(var se=Ji[ri],ge=se._start;ge<=se._end;ge++)Ii.push(ge);for(var Pe=ce[Ii[0]],rt=$.level,dt=Ii[0]-1;dt>=0;dt--)if(!(Ue[dt]&l)){rt=ce[dt];break}var ot=Ii[Ii.length-1],At=ce[ot],ee=$.level;if(!(Ue[ot]&a)){for(var xe=ot+1;xe<=$.end;xe++)if(!(Ue[xe]&l)){ee=ce[xe];break}}Yn.push({_seqIndices:Ii,_sosType:Math.max(rt,Pe)%2?C:A,_eosType:Math.max(ee,At)%2?C:A})}}for(var Te=0;Te<Yn.length;Te++){var De=Yn[Te],ve=De._seqIndices,_t=De._sosType,ft=De._eosType,yt=ce[ve[0]]&1?C:A;if(ae.get(H))for(var St=0;St<ve.length;St++){var Nt=ve[St];if(Ue[Nt]&H){for(var qt=_t,at=St-1;at>=0;at--)if(!(Ue[ve[at]]&l)){qt=Ue[ve[at]];break}K(Nt,qt&(a|Se)?F:qt)}}if(ae.get(D))for(var nn=0;nn<ve.length;nn++){var pn=ve[nn];if(Ue[pn]&D)for(var dn=nn-1;dn>=-1;dn--){var Dn=dn===-1?_t:Ue[ve[dn]];if(Dn&s){Dn===W&&K(pn,U);break}}}if(ae.get(W))for(var $t=0;$t<ve.length;$t++){var Yt=ve[$t];Ue[Yt]&W&&K(Yt,C)}if(ae.get(R)||ae.get(j))for(var Un=1;Un<ve.length-1;Un++){var xn=ve[Un];if(Ue[xn]&(R|j)){for(var Zn=0,Nn=0,An=Un-1;An>=0&&(Zn=Ue[ve[An]],!!(Zn&l));An--);for(var Sn=Un+1;Sn<ve.length&&(Nn=Ue[ve[Sn]],!!(Nn&l));Sn++);Zn===Nn&&(Ue[xn]===R?Zn===D:Zn&(D|U))&&K(xn,Zn)}}if(ae.get(D))for(var an=0;an<ve.length;an++){var di=ve[an];if(Ue[di]&D){for(var Li=an-1;Li>=0&&Ue[ve[Li]]&(L|l);Li--)K(ve[Li],D);for(an++;an<ve.length&&Ue[ve[an]]&(L|l|D);an++)Ue[ve[an]]!==D&&K(ve[an],D)}}if(ae.get(L)||ae.get(R)||ae.get(j))for(var Gn=0;Gn<ve.length;Gn++){var wi=ve[Gn];if(Ue[wi]&(L|R|j)){K(wi,F);for(var Sa=Gn-1;Sa>=0&&Ue[ve[Sa]]&l;Sa--)K(ve[Sa],F);for(var Gi=Gn+1;Gi<ve.length&&Ue[ve[Gi]]&l;Gi++)K(ve[Gi],F)}}if(ae.get(D))for(var Ko=0,Bs=_t;Ko<ve.length;Ko++){var ko=ve[Ko],us=Ue[ko];us&D?Bs===A&&K(ko,A):us&s&&(Bs=us)}if(ae.get(o)){var _n=C|D|U,Ga=_n|A,fs=[];{for(var Wa=[],$i=0;$i<ve.length;$i++)if(Ue[ve[$i]]&o){var so=Me[ve[$i]],zs=void 0;if(w(so)!==null)if(Wa.length<63)Wa.push({char:so,seqIndex:$i});else break;else if((zs=M(so))!==null)for(var js=Wa.length-1;js>=0;js--){var E=Wa[js].char;if(E===zs||E===M(S(so))||w(S(E))===so){fs.push([Wa[js].seqIndex,$i]),Wa.length=js;break}}}fs.sort(function(br,Wr){return br[0]-Wr[0]})}for(var N=0;N<fs.length;N++){for(var Y=fs[N],re=Y[0],ye=Y[1],$e=!1,tt=0,Lt=re+1;Lt<ye;Lt++){var zt=ve[Lt];if(Ue[zt]&Ga){$e=!0;var gn=Ue[zt]&_n?C:A;if(gn===yt){tt=gn;break}}}if($e&&!tt){tt=_t;for(var En=re-1;En>=0;En--){var Ei=ve[En];if(Ue[Ei]&Ga){var Cn=Ue[Ei]&_n?C:A;Cn!==yt?tt=Cn:tt=yt;break}}}if(tt){if(Ue[ve[re]]=Ue[ve[ye]]=tt,tt!==yt){for(var ai=re+1;ai<ve.length;ai++)if(!(Ue[ve[ai]]&l)){h(Me[ve[ai]])&H&&(Ue[ve[ai]]=tt);break}}if(tt!==yt){for(var Ar=ye+1;Ar<ve.length;Ar++)if(!(Ue[ve[Ar]]&l)){h(Me[ve[Ar]])&H&&(Ue[ve[Ar]]=tt);break}}}}for(var Mi=0;Mi<ve.length;Mi++)if(Ue[ve[Mi]]&o){for(var Hi=Mi,Ui=Mi,pi=_t,Ia=Mi-1;Ia>=0;Ia--)if(Ue[ve[Ia]]&l)Hi=Ia;else{pi=Ue[ve[Ia]]&_n?C:A;break}for(var Pl=ft,Yo=Mi+1;Yo<ve.length;Yo++)if(Ue[ve[Yo]]&(o|l))Ui=Yo;else{Pl=Ue[ve[Yo]]&_n?C:A;break}for(var Na=Hi;Na<=Ui;Na++)Ue[ve[Na]]=pi===Pl?pi:yt;Mi=Ui}}}for(var sr=$.start;sr<=$.end;sr++){var rp=ce[sr],Cr=Ue[sr];if(rp&1?Cr&(A|D|U)&&ce[sr]++:Cr&C?ce[sr]++:Cr&(U|D)&&(ce[sr]+=2),Cr&l&&(ce[sr]=sr===0?$.level:ce[sr-1]),sr===$.end||h(Me[sr])&(q|z))for(var Ul=sr;Ul>=0&&h(Me[Ul])&c;Ul--)ce[Ul]=$.level}}return{levels:ce,paragraphs:me};function Fc(br,Wr){for(var ur=br;ur<Me.length;ur++){var Vs=Ue[ur];if(Vs&(C|W))return 1;if(Vs&(z|A)||Wr&&Vs===Se)return 0;if(Vs&a){var qa=Hs(ur);ur=qa===-1?Me.length:qa}}return 0}function Hs(br){for(var Wr=1,ur=br+1;ur<Me.length;ur++){var Vs=Ue[ur];if(Vs&z)break;if(Vs&Se){if(--Wr===0)return ur}else Vs&a&&Wr++}return-1}}var Be="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",je;function He(){if(!je){var Me=b(Be,!0),Ae=Me.map,Ne=Me.reverseMap;Ne.forEach(function(Ue,Qe){Ae.set(Qe,Ue)}),je=Ae}}function pe(Me){return He(),je.get(Me)||null}function ze(Me,Ae,Ne,Ue){var Qe=Me.length;Ne=Math.max(0,Ne==null?0:+Ne),Ue=Math.min(Qe-1,Ue==null?Qe-1:+Ue);for(var ae=new Map,K=Ne;K<=Ue;K++)if(Ae[K]&1){var ce=pe(Me[K]);ce!==null&&ae.set(K,ce)}return ae}function Ie(Me,Ae,Ne,Ue){var Qe=Me.length;Ne=Math.max(0,Ne==null?0:+Ne),Ue=Math.min(Qe-1,Ue==null?Qe-1:+Ue);var ae=[];return Ae.paragraphs.forEach(function(K){var ce=Math.max(Ne,K.start),he=Math.min(Ue,K.end);if(ce<he){for(var me=Ae.levels.slice(ce,he+1),$=he;$>=ce&&h(Me[$])&c;$--)me[$]=K.level;for(var Ve=K.level,Xe=1/0,mt=0;mt<me.length;mt++){var Ge=me[mt];Ge>Ve&&(Ve=Ge),Ge<Xe&&(Xe=Ge|1)}for(var Je=Ve;Je>=Xe;Je--)for(var Ye=0;Ye<me.length;Ye++)if(me[Ye]>=Je){for(var vt=Ye;Ye+1<me.length&&me[Ye+1]>=Je;)Ye++;Ye>vt&&ae.push([vt+ce,Ye+ce])}}}),ae}function qe(Me,Ae,Ne,Ue){var Qe=we(Me,Ae,Ne,Ue),ae=[].concat(Me);return Qe.forEach(function(K,ce){ae[ce]=(Ae.levels[K]&1?pe(Me[K]):null)||Me[K]}),ae.join("")}function we(Me,Ae,Ne,Ue){for(var Qe=Ie(Me,Ae,Ne,Ue),ae=[],K=0;K<Me.length;K++)ae[K]=K;return Qe.forEach(function(ce){for(var he=ce[0],me=ce[1],$=ae.slice(he,me+1),Ve=$.length;Ve--;)ae[me-Ve]=$[Ve]}),ae}return e.closingToOpeningBracket=M,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=S,e.getEmbeddingLevels=Oe,e.getMirroredCharacter=pe,e.getMirroredCharactersMap=ze,e.getReorderSegments=Ie,e.getReorderedIndices=we,e.getReorderedString=qe,e.openingToClosingBracket=w,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return t}const DZ=/\bvoid\s+main\s*\(\s*\)\s*{/g;function bI(t){const e=/^[ \t]*#include +<([\w\d./]+)>/gm;function n(i,r){let a=hn[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 fMe(){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 Fp=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},hMe=Date.now(),D5=new WeakMap,O5=new Map;let dMe=1e10;function $1(t,e){const n=bMe(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=pMe(this,c,e,n);h=O5[f]=d}c.vertexShader=h.vertexShader,c.fragmentShader=h.fragmentShader,Fp(c.uniforms,this.uniforms),e.timeUniform&&(c.uniforms[e.timeUniform]={get value(){return Date.now()-hMe}}),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:dMe++}),u.uuid=fMe(),u.uniforms=Fp({},c.uniforms,e.uniforms),u.defines=Fp({},c.defines,e.defines),u.defines[`TROIKA_DERIVED_MATERIAL_${n}`]="",u.extensions=Fp({},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&&(Fp(this.extensions,c.extensions),Fp(this.defines,c.defines),Fp(this.uniforms,lv.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=$1(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=$1(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 pMe(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,m,x)=>/\battribute\s+vec[23]\s+$/.test(x.substr(0,m))?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(DZ,`
${n}
void troikaOrigMain${e}() {`),t+=`
void main() {
  ${i}
  troikaOrigMain${e}();
  ${r}
}`),t}function mMe(t,e){return t==="uniforms"?void 0:typeof e=="function"?e.toString():e}let gMe=0;const N5=new Map;function bMe(t){const e=JSON.stringify(t,mMe);let n=N5.get(e);return n==null&&N5.set(e,n=++gMe),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 vMe(){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 m=[];for(a=e.CFF.readIndex(r,a,m),d.FDArray=[],u=0;u<m.length-1;u++){var x=e.CFF.readDict(r,a+m[u],a+m[u+1]);e.CFF._readFDict(r,x,b),d.FDArray.push(x)}a+=m[m.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 m=y>>4,x=15&y;if(m!=15&&b.push(m),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 m;y=l.tables.length,u.push(g);var x=o.readUshort(r,g);x==0?m=e.cmap.parse0(r,g):x==4?m=e.cmap.parse4(r,g):x==6?m=e.cmap.parse6(r,g):x==12?m=e.cmap.parse12(r,g):console.debug("unknown format: "+x,h,d,g),l.tables.push(m)}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,m=(16&c.flags[u])!=0;y?(c.xs.push(m?o[l]:-o[l]),l++):m?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,m=(32&c.flags[u])!=0,y?(c.ys.push(m?o[l]:-o[l]),l++):m?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 m=0;m<y;m++){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=[],m=0;m<D;m++){var L=[];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),L.push({val1:U,val2:j})}u.matrix.push(L)}}}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 m=l.readUshort(r,s);s+=2,u.cDef=e._lctf.readClassDef(r,c+m),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 m=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[m],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:m]=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,m=0,x=0;x<b;x++){for(;r[a+m+(1+x)]==-1;)m++;g.chain[x]!=r[a+m+(1+x)]&&(y=!1)}if(y){for(r[a]=g.nglyph,x=0;x<b+m;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 L=f.lookupRec;for(S=0;S<L.length;S+=2){_=L[S];var U=o[L[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,m=0,x=0,_=0,w=0,M=0,S=0,A=0,C=0,D=0,R=0,L={val:0,size:0};g<r.length;){e.CFF.getCharString(r,g,L);var U=L.val;if(g+=L.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 F=c.shift();z?b+=F:y+=F,z=!z,e.U.P.lineTo(l,b,y)}else if(U=="o8"||U=="o24"){j=c.length;for(var V=0;V+6<=j;)m=b+c.shift(),x=y+c.shift(),_=m+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w+c.shift(),e.U.P.curveTo(l,m,x,_,w,b,y),V+=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,_=(m=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,m,x,_,w,D,R),e.U.P.curveTo(l,M,S,A,C,b,y)),U=="o1235"&&(m=b+c.shift(),x=y+c.shift(),_=m+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,m,x,_,w,D,R),e.U.P.curveTo(l,M,S,A,C,b,y)),U=="o1236"&&(m=b+c.shift(),x=y+c.shift(),_=m+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,m,x,_,w,D,R),e.U.P.curveTo(l,M,S,A,C,b,y)),U=="o1237"&&(m=b+c.shift(),x=y+c.shift(),_=m+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,m,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(),B=c.shift(),J=c.shift(),Z=e.CFF.glyphBySE(s,B),G=e.CFF.glyphBySE(s,J);e.U._drawCFF(s.CharStrings[Z],a,s,o,l),a.x=H,a.y=W,e.U._drawCFF(s.CharStrings[G],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);m=b+c.shift(),x=y+c.shift(),_=m+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w+c.shift(),e.U.P.curveTo(l,m,x,_,w,b,y)}else if(U=="o26")for(c.length%2&&(b+=c.shift());c.length>0;)m=b,x=y+c.shift(),b=_=m+c.shift(),y=(w=x+c.shift())+c.shift(),e.U.P.curveTo(l,m,x,_,w,b,y);else if(U=="o27")for(c.length%2&&(y+=c.shift());c.length>0;)x=y,_=(m=b+c.shift())+c.shift(),w=x+c.shift(),b=_+c.shift(),y=w,e.U.P.curveTo(l,m,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 oe=c.pop(),le=de.Subrs[oe+de.Bias];a.x=b,a.y=y,a.nStems=u,a.haveWidth=f,a.width=h,a.open=d,e.U._drawCFF(le,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,Se=(V=0,U=="o31");for(V+=ue-(j=-3&ue);V<j;)Se?(x=y,_=(m=b+c.shift())+c.shift(),y=(w=x+c.shift())+c.shift(),j-V==5?(b=_+c.shift(),V++):b=_,Se=!1):(m=b,x=y+c.shift(),_=m+c.shift(),w=x+c.shift(),b=_+c.shift(),j-V==5?(y=w+c.shift(),V++):y=w,Se=!0),e.U.P.curveTo(l,m,x,_,w,b,y),V+=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 yMe(){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 F=new i(z[30]);for(q=1;q<30;++q)for(var V=z[q];V<z[q+1];++V)F[V]=V-z[q]<<5|q;return[z,F]},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,F=0,V=new n(j);F<q;++F)++V[U[F]-1];var H,W=new n(j);for(F=0;F<j;++F)W[F]=W[F-1]+V[F-1]<<1;{H=new n(1<<j);var B=15-j;for(F=0;F<q;++F)if(U[F])for(var J=F<<4|U[F],Z=j-U[F],G=W[U[F]-1]++<<Z,de=G|(1<<Z)-1;G<=de;++G)H[h[G]>>>B]=J}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 m=new e(32);for(d=0;d<32;++d)m[d]=5;var x=b(y,9),_=b(m,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 F=!j||z,V=!z||z.i;z||(z={}),j||(j=new e(3*q));var H,W=function(vt){var Mt=j.length;if(vt>Mt){var gt=new e(Math.max(2*Mt,vt));gt.set(j),j=gt}},B=z.f||0,J=z.p||0,Z=z.b||0,G=z.l,de=z.d,oe=z.m,le=z.n,ue=8*q;do{if(!G){z.f=B=M(U,J,1);var Se=M(U,J+1,3);if(J+=3,!Se){var Oe=U[(Ne=((H=J)/8|0)+(7&H&&1)+4)-4]|U[Ne-3]<<8,Be=Ne+Oe;if(Be>q){V&&C(0);break}F&&W(Z+Oe),j.set(U.subarray(Ne,Be),Z),z.b=Z+=Oe,z.p=J=8*Be;continue}if(Se==1)G=x,de=_,oe=9,le=5;else if(Se==2){var je=M(U,J,31)+257,He=M(U,J+10,15)+4,pe=je+M(U,J+5,31)+1;J+=14;for(var ze=new e(pe),Ie=new e(19),qe=0;qe<He;++qe)Ie[s[qe]]=M(U,J+3*qe,7);J+=3*He;var we=w(Ie),Me=(1<<we)-1,Ae=b(Ie,we);for(qe=0;qe<pe;){var Ne,Ue=Ae[M(U,J,Me)];if(J+=15&Ue,(Ne=Ue>>>4)<16)ze[qe++]=Ne;else{var Qe=0,ae=0;for(Ne==16?(ae=3+M(U,J,3),J+=2,Qe=ze[qe-1]):Ne==17?(ae=3+M(U,J,7),J+=3):Ne==18&&(ae=11+M(U,J,127),J+=7);ae--;)ze[qe++]=Qe}}var K=ze.subarray(0,je),ce=ze.subarray(je);oe=w(K),le=w(ce),G=b(K,oe),de=b(ce,le)}else C(1);if(J>ue){V&&C(0);break}}F&&W(Z+131072);for(var he=(1<<oe)-1,me=(1<<le)-1,$=J;;$=J){var Ve=(Qe=G[S(U,J)&he])>>>4;if((J+=15&Qe)>ue){V&&C(0);break}if(Qe||C(2),Ve<256)j[Z++]=Ve;else{if(Ve==256){$=J,G=null;break}var Xe=Ve-254;if(Ve>264){var mt=r[qe=Ve-257];Xe=M(U,J,(1<<mt)-1)+c[qe],J+=mt}var Ge=de[S(U,J)&me],Je=Ge>>>4;if(Ge||C(3),J+=15&Ge,ce=f[Je],Je>3&&(mt=a[Je],ce+=S(U,J)&(1<<mt)-1,J+=mt),J>ue){V&&C(0);break}F&&W(Z+131072);for(var Ye=Z+Xe;Z<Ye;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=Ye}}z.l=G,z.p=$,z.b=Z,G&&(B=1,z.m=oe,z.d=de,z.n=le)}while(!B);return Z==j.length?j:function(vt,Mt,gt){(gt==null||gt>vt.length)&&(gt=vt.length);var kt=new(vt instanceof n?n:vt instanceof i?i:e)(gt-Mt);return kt.set(vt.subarray(Mt,gt)),kt}(j,0,Z)},R=new e(0),L=typeof TextDecoder<"u"&&new TextDecoder;try{L.decode(R,{stream:!0})}catch{}return t.convert_streams=function(U){var j=new DataView(U),z=0;function q(){var je=j.getUint16(z);return z+=2,je}function F(){var je=j.getUint32(z);return z+=4,je}function V(je){Oe.setUint16(Be,je),Be+=2}function H(je){Oe.setUint32(Be,je),Be+=4}for(var W={signature:F(),flavor:F(),length:F(),numTables:q(),reserved:q(),totalSfntSize:F(),majorVersion:q(),minorVersion:q(),metaOffset:F(),metaLength:F(),metaOrigLength:F(),privOffset:F(),privLength:F()},B=0;Math.pow(2,B)<=W.numTables;)B++;B--;for(var J=16*Math.pow(2,B),Z=16*W.numTables-J,G=12,de=[],oe=0;oe<W.numTables;oe++)de.push({tag:F(),offset:F(),compLength:F(),origLength:F(),origChecksum:F()}),G+=16;var le,ue=new Uint8Array(12+16*de.length+de.reduce(function(je,He){return je+He.origLength+4},0)),Se=ue.buffer,Oe=new DataView(Se),Be=0;return H(W.flavor),V(W.numTables),V(J),V(B),V(Z),de.forEach(function(je){H(je.tag),H(je.origChecksum),H(G),H(je.origLength),je.outOffset=G,(G+=je.origLength)%4!=0&&(G+=4-G%4)}),de.forEach(function(je){var He,pe=U.slice(je.offset,je.offset+je.compLength);if(je.compLength!=je.origLength){var ze=new Uint8Array(je.origLength);He=new Uint8Array(pe,2),D(He,ze)}else ze=new Uint8Array(pe);ue.set(ze,je.outOffset);var Ie=0;(G=je.outOffset+je.origLength)%4!=0&&(Ie=4-G%4),ue.set(new Uint8Array(Ie).buffer,je.outOffset+je.origLength),le=G+Ie}),Se.slice(0,le)},Object.defineProperty(t,"__esModule",{value:!0}),t}({}).convert_streams}function xMe(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(L=>{let[U,j]=L.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 m(A){const C=new Uint8Array(A.length);let D=c,R=h,L=-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[L]++):z&(r|c)&&(R===d||R===b)&&C[L]--:D&(a|c)&&(R===d||R===b)&&C[L]--,R=C[U]=q,D=z,L=U,j>65535&&U++)}return C}function x(A,C){const D=[];for(let L=0;L<C.length;L++){const U=C.codePointAt(L);U>65535&&L++,D.push(t.U.codeToGlyph(A,U))}const R=A.GSUB;if(R){const{lookupList:L,featureList:U}=R;let j;const z=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,q=[];U.forEach(F=>{if(z.test(F.tag))for(let V=0;V<F.tab.length;V++){if(q[F.tab[V]])continue;q[F.tab[V]]=!0;const H=L[F.tab[V]],W=/^(isol|init|fina|medi)$/.test(F.tag);W&&!j&&(j=m(C));for(let B=0;B<D.length;B++)(!j||!W||y[j[B]]===F.tag)&&t.U._applySubs(D,B,H,L)}})}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 F=q.lookupList;for(let V=0;V<F.length;V++){const H=F[V];for(let W=0;W<H.tabs.length;W++){const B=H.tabs[W];if(H.ltype===1){if(t._lctf.coverageIndex(B.coverage,z)!==-1&&B.pos){j(B.pos,R);break}}else if(H.ltype===2){let J=null,Z=L();if(Z!==-1){const G=t._lctf.coverageIndex(B.coverage,C[Z]);if(G!==-1){if(B.fmt===1){const de=B.pairsets[G];for(let oe=0;oe<de.length;oe++)de[oe].gid2===z&&(J=de[oe])}else if(B.fmt===2){const de=t.U._getGlyphClass(C[Z],B.classDef1),oe=t.U._getGlyphClass(z,B.classDef2);J=B.matrix[de][oe]}if(J){J.val1&&j(J.val1,Z),J.val2&&j(J.val2,R);break}}}}else if(H.ltype===4){const J=t._lctf.coverageIndex(B.markCoverage,z);if(J!==-1){const Z=L(U),G=Z===-1?-1:t._lctf.coverageIndex(B.baseCoverage,C[Z]);if(G!==-1){const de=B.markArray[J],oe=B.baseArray[G][de.markClass];D[R*3]=oe.x-de.x+D[Z*3]-D[Z*3+2],D[R*3+1]=oe.y-de.y+D[Z*3+1];break}}}else if(H.ltype===6){const J=t._lctf.coverageIndex(B.mark1Coverage,z);if(J!==-1){const Z=L();if(Z!==-1){const G=C[Z];if(w(A,G)===3){const de=t._lctf.coverageIndex(B.mark2Coverage,G);if(de!==-1){const oe=B.mark1Array[J],le=B.mark2Array[de][oe.markClass];D[R*3]=le.x-oe.x+D[Z*3]-D[Z*3+2],D[R*3+1]=le.y-oe.y+D[Z*3+1];break}}}}}}}}else if(A.kern&&!A.cff){const F=L();if(F!==-1){const V=A.kern.glyph1.indexOf(C[F]);if(V!==-1){const H=A.kern.rval[V].glyph2.indexOf(z);H!==-1&&(D[F*3+2]+=A.kern.rval[V].vals[H])}}}}return D;function L(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 F=0;F<3;F++)D[q*3+F]+=z[F]||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,L=A.head.unitsPerEm,U=M(D&&D.sTypoAscender,R&&R.ascender,L),j={unitsPerEm:L,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,F,V){let H=0;const W=1/j.unitsPerEm*q,B=x(A,z);let J=0;const Z=_(A,B);return B.forEach((G,de)=>{if(G!==-1){let oe=C[G];if(!oe){const{cmds:le,crds:ue}=t.U.glyphToPath(A,G);let Se="",Oe=0;for(let ze=0,Ie=le.length;ze<Ie;ze++){const qe=n[le[ze]];Se+=le[ze];for(let we=1;we<=qe;we++)Se+=(we>1?",":"")+ue[Oe++]}let Be,je,He,pe;if(ue.length){Be=je=1/0,He=pe=-1/0;for(let ze=0,Ie=ue.length;ze<Ie;ze+=2){let qe=ue[ze],we=ue[ze+1];qe<Be&&(Be=qe),we<je&&(je=we),qe>He&&(He=qe),we>pe&&(pe=we)}}else Be=He=je=pe=0;oe=C[G]={index:G,advanceWidth:A.hmtx.aWidth[G],xMin:Be,yMin:je,xMax:He,yMax:pe,path:Se}}V.call(null,oe,H+Z[de*3]*W,Z[de*3+1]*W,J),H+=Z[de*3+2]*W,F&&(H+=F*q)}J+=z.codePointAt(J)>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 _Me=ey({name:"Typr Font Parser",dependencies:[vMe,yMe,xMe],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 SMe(){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 m(_,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,""),L=new Map,U=new Uint8Array(_.length),j={},z={},q=new Array(_.length),F=new Map,V=!1;function H(J){var Z=b.get(J);return Z||(Z=fetch(R+"/"+J).then(function(G){if(!G.ok)throw new Error(G.statusText);return G.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(G){if(R!==h)return V||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+R+'", trying default CDN. '+G.message),V=!0),R=h,b.delete(J),H(J);throw G}),b.set(J,Z)),Z}for(var W=function(J){var Z=_.codePointAt(J),G=a(Z);q[J]=G,c[G]||F.has(G)||F.set(G,H(G).then(function(de){c[G]=de})),Z>65535&&(J++,B=J)},B=0;B<_.length;B++)W(B);return Promise.all(F.values()).then(function(){F.clear();for(var J=function(G){var de=_.codePointAt(G),oe=null,le=c[q[G]],ue=void 0;for(var Se in le){var Oe=z[Se];if(Oe===void 0&&(Oe=z[Se]=new RegExp(Se).test(S||"en")),Oe){for(var Be in ue=Se,le[Se])if(s(de,le[Se][Be])){oe=Be;break}break}}if(!oe){e:for(var je in le)if(je!==ue){for(var He in le[je])if(s(de,le[je][He])){oe=He;break e}}}oe||(console.debug("No font coverage for U+"+de.toString(16)),oe="latin"),q[G]=oe,u[oe]||F.has(oe)||F.set(oe,H("font-meta/"+oe+".json").then(function(pe){u[oe]=pe})),de>65535&&(G++,Z=G)},Z=0;Z<_.length;Z++)J(Z);return Promise.all(F.values())}).then(function(){for(var J,Z=null,G=0;G<_.length;G++){var de=_.codePointAt(G);if(Z&&(x(de)||d(Z).has(de)))U[G]=U[G-1];else{Z=u[q[G]];var oe=j[Z.id];if(!oe){var le=Z.typeforms,ue=y(le,A,"sans-serif"),Se=y(le[ue],C,"normal"),Oe=m((J=le[ue])===null||J===void 0?void 0:J[Se],D);oe=j[Z.id]=R+"/font-files/"+Z.id+"/"+ue+"."+Se+"."+Oe+".woff"}var Be=L.get(oe);Be==null&&(Be=L.size,L.set(oe,Be)),U[G]=Be}de>65535&&(G++,U[G]=U[G-1])}return{fontUrls:Array.from(L.keys()),chars:U}})},Object.defineProperty(t,"__esModule",{value:!0}),t}({})}function wMe(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,L=s.length;R<L;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:F}=c[j];if(!F||_(U,F)){const V=n[q];if(!V){a(q,()=>{C(R)});return}if(V.supportsCodePoint(U)){let H=b.get(V);typeof H!="number"&&(H=g.length,g.push(V),b.set(V,H)),d[R]=H,A=1;break}}}U>65535&&R+1<L&&(d[R+1]=d[R],R++,A===2&&(y[y.length-1][1]=R))}m()})()}else y.push([0,s.length-1]),m();function m(){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 L=0,U=R[1]-R[0];L<=U;L++)d[R[0]+L]=S[C++]+A;C++});let D=0;M.forEach((R,L)=>{a(R,U=>{g[L+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 EMe=ey({name:"FontResolver",dependencies:[wMe,_Me,SMe],init(t,e,n){return t(e,n())}});function MMe(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:m,weight:x,preResolvedFonts:_,unicodeFontsURL:w},M){const S=({chars:A,fonts:C})=>{let D,R;const L=[];for(let U=0;U<A.length;U++)A[U]!==R?(R=A[U],L.push(D={start:U,end:U,fontObj:C[A[U]]})):D.end=U;M(L)};_?S(_):t(g,S,{lang:b,fonts:y,style:m,weight:x,unicodeFontsURL:w})}function o({text:g="",font:b,lang:y,sdfGlyphSize:m=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:L="normal",overflowWrap:U="normal",anchorX:j=0,anchorY:z=0,metricsOnly:q=!1,unicodeFontsURL:F,preResolvedFonts:V=null,includeCaretPositions:H=!1,chunkedBoundsSize:W=8192,colorRanges:B=null},J){const Z=f(),G={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:F,preResolvedFonts:V},de=>{G.fontLoad=f()-Z;const oe=isFinite(A);let le=null,ue=null,Se=null,Oe=null,Be=null,je=null,He=null,pe=null,ze=0,Ie=0,qe=L!=="nowrap";const we=new Map,Me=f();let Ae=R,Ne=0,Ue=new h;const Qe=[Ue];de.forEach(me=>{const{fontObj:$}=me,{ascender:Ve,descender:Xe,unitsPerEm:mt,lineGap:Ge,capHeight:Je,xHeight:Ye}=$;let vt=we.get($);if(!vt){const Le=x/mt,ht=S==="normal"?(Ve-Xe+Ge)*Le:S*x,jt=(ht-(Ve-Xe)*Le)/2,st=Math.min(ht,(Ve-Xe)*Le),it=(Ve+Xe)/2*Le+st/2;vt={index:we.size,src:$.src,fontObj:$,fontSizeMult:Le,unitsPerEm:mt,ascender:Ve*Le,descender:Xe*Le,capHeight:Je*Le,xHeight:Ye*Le,lineHeight:ht,baseline:-jt-Ve*Le,caretTop:it,caretBottom:it-st},we.set($,vt)}const{fontSizeMult:Mt}=vt,gt=g.slice(me.start,me.end+1);let kt,Re;$.forEachGlyph(gt,x,M,(Le,ht,jt,st)=>{ht+=Ne,st+=me.start,kt=ht,Re=Le;const it=g.charAt(st),bt=Le.advanceWidth*Mt,Jt=Ue.count;let Kt;if("isEmpty"in Le||(Le.isWhitespace=!!it&&new RegExp(r).test(it),Le.canBreakAfter=!!it&&a.test(it),Le.isEmpty=Le.xMin===Le.xMax||Le.yMin===Le.yMax||i.test(it)),!Le.isWhitespace&&!Le.isEmpty&&Ie++,qe&&oe&&!Le.isWhitespace&&ht+bt+Ae>A&&Jt){if(Ue.glyphAt(Jt-1).glyphObj.canBreakAfter)Kt=new h,Ae=-ht;else for(let Vn=Jt;Vn--;)if(Vn===0&&U==="break-word"){Kt=new h,Ae=-ht;break}else if(Ue.glyphAt(Vn).glyphObj.canBreakAfter){Kt=Ue.splitAt(Vn+1);const vn=Kt.glyphAt(0).x;Ae-=vn;for(let Qn=Kt.count;Qn--;)Kt.glyphAt(Qn).x-=vn;break}Kt&&(Ue.isSoftWrapped=!0,Ue=Kt,Qe.push(Ue),ze=A)}let un=Ue.glyphAt(Ue.count);un.glyphObj=Le,un.x=ht+Ae,un.y=jt,un.width=bt,un.charIndex=st,un.fontData=vt,it===`
`&&(Ue=new h,Qe.push(Ue),Ae=-(ht+bt+M*x)+R)}),Ne=kt+Re.advanceWidth*Mt+M*x});let ae=0;Qe.forEach(me=>{let $=!0;for(let Ve=me.count;Ve--;){const Xe=me.glyphAt(Ve);$&&!Xe.glyphObj.isWhitespace&&(me.width=Xe.x+Xe.width,me.width>ze&&(ze=me.width),$=!1);let{lineHeight:mt,capHeight:Ge,xHeight:Je,baseline:Ye}=Xe.fontData;mt>me.lineHeight&&(me.lineHeight=mt);const vt=Ye-me.baseline;vt<0&&(me.baseline+=vt,me.cap+=vt,me.ex+=vt),me.cap=Math.max(me.cap,me.baseline+Ge),me.ex=Math.max(me.ex,me.baseline+Je)}me.baseline-=ae,me.cap-=ae,me.ex-=ae,ae+=me.lineHeight});let K=0,ce=0;if(j&&(typeof j=="number"?K=-j:typeof j=="string"&&(K=-ze*(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"?-Qe[0].baseline:z==="top-cap"?-Qe[0].cap:z==="top-ex"?-Qe[0].ex:z==="middle"?ae/2:z==="bottom"?ae:z==="bottom-baseline"?-Qe[Qe.length-1].baseline:c(z)*ae)),!q){const me=e.getEmbeddingLevels(g,C);le=new Uint16Array(Ie),ue=new Uint8Array(Ie),Se=new Float32Array(Ie*2),Oe={},He=[1/0,1/0,-1/0,-1/0],pe=[],H&&(je=new Float32Array(g.length*4)),B&&(Be=new Uint8Array(Ie*3));let $=0,Ve=-1,Xe=-1,mt,Ge;if(Qe.forEach((Je,Ye)=>{let{count:vt,width:Mt}=Je;if(vt>0){let gt=0;for(let st=vt;st--&&Je.glyphAt(st).glyphObj.isWhitespace;)gt++;let kt=0,Re=0;if(D==="center")kt=(ze-Mt)/2;else if(D==="right")kt=ze-Mt;else if(D==="justify"&&Je.isSoftWrapped){let st=0;for(let it=vt-gt;it--;)Je.glyphAt(it).glyphObj.isWhitespace&&st++;Re=(ze-Mt)/st}if(Re||kt){let st=0;for(let it=0;it<vt;it++){let bt=Je.glyphAt(it);const Jt=bt.glyphObj;bt.x+=kt+st,Re!==0&&Jt.isWhitespace&&it<vt-gt&&(st+=Re,bt.width+=Re)}}const Le=e.getReorderSegments(g,me,Je.glyphAt(0).charIndex,Je.glyphAt(Je.count-1).charIndex);for(let st=0;st<Le.length;st++){const[it,bt]=Le[st];let Jt=1/0,Kt=-1/0;for(let un=0;un<vt;un++)if(Je.glyphAt(un).charIndex>=it){let Vn=un,vn=un;for(;vn<vt;vn++){let Qn=Je.glyphAt(vn);if(Qn.charIndex>bt)break;vn<vt-gt&&(Jt=Math.min(Jt,Qn.x),Kt=Math.max(Kt,Qn.x+Qn.width))}for(let Qn=Vn;Qn<vn;Qn++){const Yn=Je.glyphAt(Qn);Yn.x=Kt-(Yn.x+Yn.width-Jt)}break}}let ht;const jt=st=>ht=st;for(let st=0;st<vt;st++){const it=Je.glyphAt(st);ht=it.glyphObj;const bt=ht.index,Jt=me.levels[it.charIndex]&1;if(Jt){const Kt=e.getMirroredCharacter(g[it.charIndex]);Kt&&it.fontData.fontObj.forEachGlyph(Kt,0,0,jt)}if(H){const{charIndex:Kt,fontData:un}=it,Vn=it.x+K,vn=it.x+it.width+K;je[Kt*4]=Jt?vn:Vn,je[Kt*4+1]=Jt?Vn:vn,je[Kt*4+2]=Je.baseline+un.caretBottom+ce,je[Kt*4+3]=Je.baseline+un.caretTop+ce;const Qn=Kt-Ve;Qn>1&&u(je,Ve,Qn),Ve=Kt}if(B){const{charIndex:Kt}=it;for(;Kt>Xe;)Xe++,B.hasOwnProperty(Xe)&&(Ge=B[Xe])}if(!ht.isWhitespace&&!ht.isEmpty){const Kt=$++,{fontSizeMult:un,src:Vn,index:vn}=it.fontData,Qn=Oe[Vn]||(Oe[Vn]={});Qn[bt]||(Qn[bt]={path:ht.path,pathBounds:[ht.xMin,ht.yMin,ht.xMax,ht.yMax]});const Yn=it.x+K,_i=it.y+Je.baseline+ce;Se[Kt*2]=Yn,Se[Kt*2+1]=_i;const Xn=Yn+ht.xMin*un,Ji=_i+ht.yMin*un,hi=Yn+ht.xMax*un,on=_i+ht.yMax*un;Xn<He[0]&&(He[0]=Xn),Ji<He[1]&&(He[1]=Ji),hi>He[2]&&(He[2]=hi),on>He[3]&&(He[3]=on),Kt%W===0&&(mt={start:Kt,end:Kt,rect:[1/0,1/0,-1/0,-1/0]},pe.push(mt)),mt.end++;const Ii=mt.rect;if(Xn<Ii[0]&&(Ii[0]=Xn),Ji<Ii[1]&&(Ii[1]=Ji),hi>Ii[2]&&(Ii[2]=hi),on>Ii[3]&&(Ii[3]=on),le[Kt]=bt,ue[Kt]=vn,B){const ri=Kt*3;Be[ri]=Ge>>16&255,Be[ri+1]=Ge>>8&255,Be[ri+2]=Ge&255}}}}}),je){const Je=g.length-Ve;Je>1&&u(je,Ve,Je)}}const he=[];we.forEach(({index:me,src:$,unitsPerEm:Ve,ascender:Xe,descender:mt,lineHeight:Ge,capHeight:Je,xHeight:Ye})=>{he[me]={src:$,unitsPerEm:Ve,ascender:Xe,descender:mt,lineHeight:Ge,capHeight:Je,xHeight:Ye}}),G.typesetting=f()-Me,J({glyphIds:le,glyphFontIndices:ue,glyphPositions:Se,glyphData:Oe,fontData:he,caretPositions:je,glyphColors:Be,chunkedBounds:pe,fontSize:x,topBaseline:ce+Qe[0].baseline,blockBounds:[K,ce-ae,K+ze,ce],visibleBounds:He,timings:G})})}function l(g,b){o({...g,metricsOnly:!0},y=>{const[m,x,_,w]=y.blockBounds;b({width:_-m,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 m=g[b*4],x=g[b*4+1],_=g[b*4+2],w=g[b*4+3],M=(x-m)/y;for(let S=0;S<y;S++){const A=(b+S)*4;g[A]=m+M*S,g[A+1]=m+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,m)=>(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 Nm=()=>(self.performance||Date).now(),_C=kZ();let L5;function TMe(t,e,n,i,r,a,s,o,l,c,u=!0){return u?CMe(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=[],AMe=5;let vI=0;function OZ(){const t=Nm();for(;bM.length&&Nm()-t<AMe;)bM.shift()();vI=bM.length?setTimeout(OZ,0):0}const CMe=(...t)=>new Promise((e,n)=>{bM.push(()=>{const i=Nm();try{_C.webgl.generateIntoCanvas(...t),e({timing:Nm()-i})}catch(r){n(r)}}),vI||(vI=setTimeout(OZ,0))}),RMe=4,kMe=2e3,P5={};let DMe=0;function U5(t,e,n,i,r,a,s,o,l,c){const u="TroikaTextSDFGenerator_JS_"+DMe++%RMe;let f=P5[u];return f||(f=P5[u]={workerModule:ey({name:u,workerId:u,dependencies:[kZ,Nm],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=Nm(),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+=Nm()-g,--f.requests===0&&(f.idleTimer=setTimeout(()=>{lMe(u)},kMe)),{timing:d}})}function OMe(t){t._warm||(_C.webgl.isSupported(t),t._warm=!0)}const IMe=_C.webglUtils.resizeWebGLCanvasWithoutClearing,Cx={unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},NMe=new Ut;function xb(){return(self.performance||Date).now()}const F5=Object.create(null);function LMe(t,e){t=UMe({},t);const n=xb(),i=[];if(t.font&&i.push({label:"user",src:FMe(t.font)}),t.font=i,t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||Cx.sdfGlyphSize,t.unicodeFontsURL=t.unicodeFontsURL||Cx.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=NMe.set(g).getHex()),h[d]=g}t.colorRanges=h}Object.freeze(t);const{textureWidth:r,sdfExponent:a}=Cx,{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,Vi,Vi),contextLost:!1,glyphsByFont:new Map},l.sdfTexture.generateMipmaps=!1,PMe(l)}const{sdfTexture:c,sdfCanvas:u}=l;LZ(t).then(h=>{const{glyphIds:d,glyphFontIndices:g,fontData:b,glyphPositions:y,fontSize:m,timings:x}=h,_=[],w=new Float32Array(d.length*4);let M=0,S=0;const A=xb(),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:F,unitsPerEm:V}=b[q];let H=C[q].get(j);if(!H){const{path:G,pathBounds:de}=h.glyphData[F][j],oe=Math.max(de[2]-de[0],de[3]-de[1])/s*(Cx.sdfMargin*s+.5),le=l.glyphCount++,ue=[de[0]-oe,de[1]-oe,de[2]+oe,de[3]+oe];C[q].set(j,H={path:G,atlasIndex:le,sdfViewBox:ue}),_.push(H)}const{sdfViewBox:W}=H,B=y[S++],J=y[S++],Z=m/V;w[M++]=B+W[0]*Z,w[M++]=J+W[1]*Z,w[M++]=B+W[2]*Z,w[M++]=J+W[3]*Z,d[z]=H.atlasIndex}),x.quads=(x.quads||0)+(xb()-A);const D=xb();x.sdf={};const R=u.height,L=Math.ceil(l.glyphCount/o),U=Math.pow(2,Math.ceil(Math.log2(L*s)));U>R&&(console.info(`Increasing SDF texture size ${R}->${U}`),IMe(u,r,U),c.dispose()),Promise.all(_.map(j=>IZ(j,l,t.gpuAccelerateSDF).then(({timing:z})=>{x.sdf[j.atlasIndex]=z}))).then(()=>{_.length&&!l.contextLost&&(NZ(l),c.needsUpdate=!0),x.sdfTotal=xb()-D,x.total=xb()-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||OMe(u)})}function IZ({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}=Cx,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 TMe(i,i,t,n,c,l,r,f,h,d,s)}function PMe(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(IZ(a,t,!0))})}),Promise.all(i).then(()=>{NZ(t),t.sdfTexture.needsUpdate=!0})})}function UMe(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}let iE;function FMe(t){return iE||(iE=typeof document>"u"?{}:document.createElement("a")),iE.href=t,iE.href}function NZ(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 BMe=ey({name:"Typesetter",dependencies:[MMe,EMe,uMe],init(t,e,n){return t(e,n())}}),LZ=ey({name:"Typesetter",dependencies:[BMe],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}});LZ.onMainThread;const B5={};function zMe(t){let e=B5[t];return e||(e=B5[t]=new Il(1,1,t,t).translate(.5,.5,0)),e}const vM="aTroikaGlyphBounds",u1="aTroikaGlyphIndex",jMe="aTroikaGlyphColor";class HMe extends V_{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 Ur,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=zMe(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(u1,n,1),this.updateAttributeData(jMe,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),m=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?-m:0),i.max.set(y,e[3],n<0?0:m)}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(u1).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 hf(n,i)),delete this._maxInstanceCount,this.dispose()):r&&this.deleteAttribute(e)}}const VMe=`
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;
`,GMe=`
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);
`,WMe=`
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;
}
`,qMe=`
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 PZ(t){const e=$1(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new wt},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new ni(0,0,0,0)},uTroikaClipRect:{value:new ni(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 $n},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:VMe,vertexTransform:GMe,fragmentDefs:WMe,fragmentColorTransform:qMe,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(DZ,`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:Jr,transparent:!0}),z5=8421504,j5=new Dt,rE=new te,lD=new te,$y=[],XMe=new te,cD="+x+y";function H5(t){return Array.isArray(t)?t[0]:t}let UZ=()=>{const t=new Si(new Il(1,1),AU);return UZ=()=>t,t},FZ=()=>{const t=new Si(new Il(1,1,32,1),AU);return FZ=()=>t,t};const KMe={type:"syncstart"},YMe={type:"synccomplete"},BZ=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],JMe=BZ.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class f1 extends Si{constructor(){const e=new HMe;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(KMe),LMe({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(YMe),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 PZ(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 m=this.clipRect;if(m&&Array.isArray(m)&&m.length===4)i.uTroikaClipRect.value.fromArray(m);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(XMe,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?FZ():UZ(),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,$y.length=0,s.raycast(e,$y);for(let u=0;u<$y.length;u++)$y[u].object=this,n.push($y[u])}}copy(e){const n=this.geometry;return super.copy(e),this.geometry=n,JMe.forEach(i=>{this[i]=e[i]}),this}clone(){return new this.constructor().copy(this)}}BZ.forEach(t=>{const e="_private_"+t;Object.defineProperty(f1.prototype,t,{get(){return this[e]},set(n){n!==this[e]&&(this[e]=n,this._needsSync=!0)}})});const $Me={type:"syncstart"},ZMe={type:"synccomplete"},a0="aTroikaTextBatchMemberIndex",yI=32,V5=new rr,G5=new Ut;class CU extends f1{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 f1?this.addText(e[n]):super.add(e[n]);return this}remove(...e){for(let n=0;n<e.length;n++)e[n]instanceof f1?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 QMe(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 os(new Float32Array(r),o,r/4/o,Qr,wr)}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:m,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,m.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($Me),Promise.all(n).then(()=>{const{geometry:i}=this,r=i.attributes;let a=r[a0]&&r[a0].array||new Uint16Array(0),s=r[u1]&&r[u1].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(a0,a,1),i.getAttribute(a0).setUsage(G1),i.updateAttributeData(u1,s,1),i.updateAttributeData(vM,o,4),this.updateBounds(),this.dispatchEvent(ZMe),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 QMe(t){const e="uTroikaMatricesTexture",n="uTroikaMatricesTextureSize";let i=$1(t,{chained:!0,uniforms:{[n]:{value:new wt},[e]:{value:null}},vertexDefs:`
      uniform highp sampler2D ${e};
      uniform vec2 ${n};
      attribute float ${a0};

      vec4 troikaBatchTexel(float offset) {
        offset += ${a0} * ${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=PZ(i),i=$1(i,{chained:!0,uniforms:{uTroikaIsOutline:{value:!1}},customRewriter(r){return["uTroikaTotalBounds","uTroikaClipRect","uTroikaPositionOffset","uTroikaEdgeOffset","uTroikaBlurRadius","uTroikaStrokeWidth","uTroikaStrokeColor","uTroikaStrokeOpacity","uTroikaFillOpacity","uTroikaCurveRadius","diffuse"].forEach(s=>{r=e2e(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 e2e({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 cs{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=lv.clone(this.uniforms)}},r.key=yc.generateUUID(),r}const t2e=()=>parseInt(zv.replace(/\D+/g,"")),zZ=t2e();/*!
 * camera-controls
 * https://github.com/yomotsu/camera-controls
 * (c) 2017 @yomotsu
 * Released under the MIT License.
 */const ia={LEFT:1,RIGHT:2,MIDDLE:4},ut=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}),_b={NONE:0,IN:1,OUT:-1};function Bp(t){return t.isPerspectiveCamera}function sd(t){return t.isOrthographicCamera}const td=Math.PI*2,W5=Math.PI/2,jZ=1e-5,Zy=Math.PI/180;function Jc(t,e,n){return Math.max(e,Math.min(n,t))}function Ir(t,e=jZ){return Math.abs(t)<e}function or(t,e,n=jZ){return Ir(t-e,n)}function q5(t,e){return Math.round(t/e)*e}function Qy(t){return isFinite(t)?t:t<0?-Number.MAX_VALUE:Number.MAX_VALUE}function ex(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=Jc(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,m=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=m-t.y,L=x-t.z,U=s.x-y,j=s.y-m,z=s.z-x;return D*U+R*j+L*z>0&&(s.x=y,s.y=m,s.z=x,n.x=(s.x-y)/a,n.y=(s.y-m)/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 sd(t)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}let n2e=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 i2e="3.1.0",sE=1/8,r2e=/Mac/.test((dD=globalThis?.navigator)===null||dD===void 0?void 0:dD.platform);let jn,K5,oE,pD,Io,oi,Ki,Sb,tx,Fu,Bu,zp,Y5,J5,fl,wb,Eb,$5,mD,Z5,gD,bD,lE,a2e=class xI extends n2e{static install(e){jn=e.THREE,K5=Object.freeze(new jn.Vector3(0,0,0)),oE=Object.freeze(new jn.Vector3(0,1,0)),pD=Object.freeze(new jn.Vector3(0,0,1)),Io=new jn.Vector2,oi=new jn.Vector3,Ki=new jn.Vector3,Sb=new jn.Vector3,tx=new jn.Vector3,Fu=new jn.Vector3,Bu=new jn.Vector3,zp=new jn.Vector3,Y5=new jn.Vector3,J5=new jn.Vector3,fl=new jn.Spherical,wb=new jn.Spherical,Eb=new jn.Box3,$5=new jn.Box3,mD=new jn.Sphere,Z5=new jn.Quaternion,gD=new jn.Quaternion,bD=new jn.Matrix4,lE=new jn.Raycaster}static get ACTION(){return ut}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=ut.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=_b.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new jn.Vector3,this._focalOffsetVelocity=new jn.Vector3,this._zoomVelocity={value:0},this._truckInternal=(m,x,_,w)=>{let M,S;if(Bp(this._camera)){const A=oi.copy(this._camera.position).sub(this._target),C=this._camera.getEffectiveFOV()*Zy,D=A.length()*Math.tan(C*.5);M=this.truckSpeed*m*D/this._elementRect.height,S=this.truckSpeed*x*D/this._elementRect.height}else if(sd(this._camera)){const A=this._camera;M=this.truckSpeed*m*(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=(m,x)=>{const _=td*this.azimuthRotateSpeed*m/this._elementRect.height,w=td*this.polarRotateSpeed*x/this._elementRect.height;this.rotate(_,w,!0)},this._dollyInternal=(m,x,_)=>{const w=Math.pow(.95,-m*this.dollySpeed),M=this._sphericalEnd.radius,S=this._sphericalEnd.radius*w,A=Jc(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(-m)},this._zoomInternal=(m,x,_)=>{const w=Math.pow(.95,m*this.dollySpeed),M=this._zoom,S=this._zoom*w;this.zoomTo(S,!0),this.dollyToCursor&&(this._changedZoom+=S-M,this._dollyControlCoord.set(x,_))},typeof jn>"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 jn.Quaternion().setFromUnitVectors(this._camera.up,oE),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=ut.NONE,this._target=new jn.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new jn.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new jn.Spherical().setFromVector3(oi.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 jn.Vector3,new jn.Vector3,new jn.Vector3,new jn.Vector3],this._updateNearPlaneCorners(),this._boundary=new jn.Box3(new jn.Vector3(-1/0,-1/0,-1/0),new jn.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 jn.Vector2,this.mouseButtons={left:ut.ROTATE,middle:ut.DOLLY,right:ut.TRUCK,wheel:Bp(this._camera)?ut.DOLLY:sd(this._camera)?ut.ZOOM:ut.NONE},this.touches={one:ut.TOUCH_ROTATE,two:Bp(this._camera)?ut.TOUCH_DOLLY_TRUCK:sd(this._camera)?ut.TOUCH_ZOOM_TRUCK:ut.NONE,three:ut.TOUCH_TRUCK};const i=new jn.Vector2,r=new jn.Vector2,a=new jn.Vector2,s=m=>{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=m.clientX/w.width,S=m.clientY/w.height;if(M<this._interactiveArea.left||M>this._interactiveArea.right||S<this._interactiveArea.top||S>this._interactiveArea.bottom)return}const x=m.pointerType!=="mouse"?null:(m.buttons&ia.LEFT)===ia.LEFT?ia.LEFT:(m.buttons&ia.MIDDLE)===ia.MIDDLE?ia.MIDDLE:(m.buttons&ia.RIGHT)===ia.RIGHT?ia.RIGHT:null;if(x!==null){const w=this._findPointerByMouseButton(x);w&&this._disposePointer(w)}if((m.buttons&ia.LEFT)===ia.LEFT&&this._lockedPointer)return;const _={pointerId:m.pointerId,clientX:m.clientX,clientY:m.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(m)},o=m=>{m.cancelable&&m.preventDefault();const x=m.pointerId,_=this._lockedPointer||this._findPointerById(x);if(_){if(_.clientX=m.clientX,_.clientY=m.clientY,_.deltaX=m.movementX,_.deltaY=m.movementY,this._state=0,m.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&&(m.buttons&ia.LEFT)===ia.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(m.buttons&ia.MIDDLE)===ia.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(m.buttons&ia.RIGHT)===ia.RIGHT&&(this._state=this._state|this.mouseButtons.right);d()}},l=m=>{const x=this._findPointerById(m.pointerId);if(!(x&&x===this._lockedPointer)){if(x&&this._disposePointer(x),m.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=ut.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=ut.NONE;g()}};let c=-1;const u=m=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===ut.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=m.clientX/S.width,C=m.clientY/S.height;if(A<this._interactiveArea.left||A>this._interactiveArea.right||C<this._interactiveArea.top||C>this._interactiveArea.bottom)return}if(m.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===ut.ROTATE||this.mouseButtons.wheel===ut.TRUCK){const S=performance.now();c-S<1e3&&this._getClientRect(this._elementRect),c=S}const x=r2e?-1:-3,_=m.deltaMode===1||m.ctrlKey?m.deltaY/x:m.deltaY/(x*10),w=this.dollyToCursor?(m.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,M=this.dollyToCursor?(m.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case ut.ROTATE:{this._rotateInternal(m.deltaX,m.deltaY),this._isUserControllingRotate=!0;break}case ut.TRUCK:{this._truckInternal(m.deltaX,m.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case ut.SCREEN_PAN:{this._truckInternal(m.deltaX,m.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case ut.OFFSET:{this._truckInternal(m.deltaX,m.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case ut.DOLLY:{this._dollyInternal(-_,w,M),this._isUserControllingDolly=!0;break}case ut.ZOOM:{this._zoomInternal(-_,w,M),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},f=m=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===xI.ACTION.NONE){const x=m instanceof PointerEvent?m.pointerId:0,_=this._findPointerById(x);_&&this._disposePointer(_),this._domElement.ownerDocument.removeEventListener("pointermove",o,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}m.preventDefault()}},h=m=>{if(!this._enabled)return;if(fD(this._activePointers,Io),this._getClientRect(this._elementRect),i.copy(Io),r.copy(Io),this._activePointers.length>=2){const _=Io.x-this._activePointers[1].clientX,w=Io.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,!m)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in m&&m.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&&(m.buttons&ia.LEFT)===ia.LEFT&&(this._state=this._state|this.mouseButtons.left),(m.buttons&ia.MIDDLE)===ia.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(m.buttons&ia.RIGHT)===ia.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&ut.ROTATE)===ut.ROTATE||(this._state&ut.TOUCH_ROTATE)===ut.TOUCH_ROTATE||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE||(this._state&ut.TOUCH_ZOOM_ROTATE)===ut.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&ut.TRUCK)===ut.TRUCK||(this._state&ut.SCREEN_PAN)===ut.SCREEN_PAN||(this._state&ut.TOUCH_TRUCK)===ut.TOUCH_TRUCK||(this._state&ut.TOUCH_SCREEN_PAN)===ut.TOUCH_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_ZOOM_TRUCK)===ut.TOUCH_ZOOM_TRUCK||(this._state&ut.TOUCH_ZOOM_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&ut.DOLLY)===ut.DOLLY||(this._state&ut.TOUCH_DOLLY)===ut.TOUCH_DOLLY||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&ut.ZOOM)===ut.ZOOM||(this._state&ut.TOUCH_ZOOM)===ut.TOUCH_ZOOM||(this._state&ut.TOUCH_ZOOM_TRUCK)===ut.TOUCH_ZOOM_TRUCK||(this._state&ut.TOUCH_ZOOM_SCREEN_PAN)===ut.TOUCH_ZOOM_SCREEN_PAN||(this._state&ut.TOUCH_ZOOM_OFFSET)===ut.TOUCH_ZOOM_OFFSET||(this._state&ut.TOUCH_ZOOM_ROTATE)===ut.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&ut.OFFSET)===ut.OFFSET||(this._state&ut.TOUCH_OFFSET)===ut.TOUCH_OFFSET||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET||(this._state&ut.TOUCH_ZOOM_OFFSET)===ut.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,Io);const x=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,_=x?-x.deltaX:r.x-Io.x,w=x?-x.deltaY:r.y-Io.y;if(r.copy(Io),((this._state&ut.ROTATE)===ut.ROTATE||(this._state&ut.TOUCH_ROTATE)===ut.TOUCH_ROTATE||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE||(this._state&ut.TOUCH_ZOOM_ROTATE)===ut.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(_,w),this._isUserControllingRotate=!0),(this._state&ut.DOLLY)===ut.DOLLY||(this._state&ut.ZOOM)===ut.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&ut.DOLLY)===ut.DOLLY?(this._dollyInternal(A*w*sE,M,S),this._isUserControllingDolly=!0):(this._zoomInternal(A*w*sE,M,S),this._isUserControllingZoom=!0)}if((this._state&ut.TOUCH_DOLLY)===ut.TOUCH_DOLLY||(this._state&ut.TOUCH_ZOOM)===ut.TOUCH_ZOOM||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_ZOOM_TRUCK)===ut.TOUCH_ZOOM_TRUCK||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_ZOOM_SCREEN_PAN)===ut.TOUCH_ZOOM_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET||(this._state&ut.TOUCH_ZOOM_OFFSET)===ut.TOUCH_ZOOM_OFFSET||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE||(this._state&ut.TOUCH_ZOOM_ROTATE)===ut.TOUCH_ZOOM_ROTATE){const M=Io.x-this._activePointers[1].clientX,S=Io.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&ut.TOUCH_DOLLY)===ut.TOUCH_DOLLY||(this._state&ut.TOUCH_DOLLY_ROTATE)===ut.TOUCH_DOLLY_ROTATE||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET?(this._dollyInternal(C*sE,D,R),this._isUserControllingDolly=!0):(this._zoomInternal(C*sE,D,R),this._isUserControllingZoom=!0)}((this._state&ut.TRUCK)===ut.TRUCK||(this._state&ut.TOUCH_TRUCK)===ut.TOUCH_TRUCK||(this._state&ut.TOUCH_DOLLY_TRUCK)===ut.TOUCH_DOLLY_TRUCK||(this._state&ut.TOUCH_ZOOM_TRUCK)===ut.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(_,w,!1,!1),this._isUserControllingTruck=!0),((this._state&ut.SCREEN_PAN)===ut.SCREEN_PAN||(this._state&ut.TOUCH_SCREEN_PAN)===ut.TOUCH_SCREEN_PAN||(this._state&ut.TOUCH_DOLLY_SCREEN_PAN)===ut.TOUCH_DOLLY_SCREEN_PAN||(this._state&ut.TOUCH_ZOOM_SCREEN_PAN)===ut.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(_,w,!1,!0),this._isUserControllingTruck=!0),((this._state&ut.OFFSET)===ut.OFFSET||(this._state&ut.TOUCH_OFFSET)===ut.TOUCH_OFFSET||(this._state&ut.TOUCH_DOLLY_OFFSET)===ut.TOUCH_DOLLY_OFFSET||(this._state&ut.TOUCH_ZOOM_OFFSET)===ut.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(_,w,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},g=()=>{fD(this._activePointers,Io),r.copy(Io),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 m,x,_;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(m=this._domElement)===null||m===void 0||m.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=m=>{this._domElement=m,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!==ut.NONE&&(this._state=ut.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=Jc(e.width,0,1),this._interactiveArea.height=Jc(e.height,0,1),this._interactiveArea.x=Jc(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Jc(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=Jc(e,this.minAzimuthAngle,this.maxAzimuthAngle),a=Jc(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||or(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&or(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=_b.NONE,this._changedDolly=0,this._dollyToNoClamp(Jc(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=or(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||or(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(a)}dollyInFixed(e,n=!1){this._targetEnd.add(this._getCameraDirection(tx).multiplyScalar(e)),n||this._target.copy(this._targetEnd);const i=!n||or(this._target.x,this._targetEnd.x,this.restThreshold)&&or(this._target.y,this._targetEnd.y,this.restThreshold)&&or(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=Jc(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,n||(this._zoom=this._zoomEnd);const i=!n||or(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(),Fu.setFromMatrixColumn(this._camera.matrix,0),Bu.setFromMatrixColumn(this._camera.matrix,1),Fu.multiplyScalar(e),Bu.multiplyScalar(-n);const r=oi.copy(Fu).add(Bu),a=Ki.copy(this._targetEnd).add(r);return this.moveTo(a.x,a.y,a.z,i)}forward(e,n=!1){oi.setFromMatrixColumn(this._camera.matrix,0),oi.crossVectors(this._camera.up,oi),oi.multiplyScalar(e);const i=Ki.copy(this._targetEnd).add(oi);return this.moveTo(i.x,i.y,i.z,n)}elevate(e,n=!1){return oi.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+oi.x,this._targetEnd.y+oi.y,this._targetEnd.z+oi.z,n)}moveTo(e,n,i,r=!1){this._isUserControllingTruck=!1;const a=oi.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||or(this._target.x,this._targetEnd.x,this.restThreshold)&&or(this._target.y,this._targetEnd.y,this.restThreshold)&&or(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}lookInDirectionOf(e,n,i,r=!1){const o=oi.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?Eb.copy(e):Eb.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=oi.setFromSpherical(this._sphericalEnd).normalize(),d=Z5.setFromUnitVectors(h,pD),g=or(Math.abs(h.y),1);g&&d.multiply(gD.setFromAxisAngle(oE,u)),d.multiply(this._yAxisUpSpaceInverse);const b=$5.makeEmpty();Ki.copy(c.min).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.min).setX(c.max.x).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.min).setY(c.max.y).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.max).setZ(c.min.z).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.min).setZ(c.max.z).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.max).setY(c.min.y).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.max).setX(c.min.x).applyQuaternion(d),b.expandByPoint(Ki),Ki.copy(c.max).applyQuaternion(d),b.expandByPoint(Ki),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(oi),m=b.getCenter(Ki).applyQuaternion(d);if(Bp(this._camera)){const x=this.getDistanceToFitBox(y.x,y.y,y.z,i);l.push(this.moveTo(m.x,m.y,m.z,n)),l.push(this.dollyTo(x,n)),l.push(this.setFocalOffset(0,0,0,n))}else if(sd(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(m.x,m.y,m.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)),Bp(this._camera)){const s=this.getDistanceToFitSphere(a.radius);i.push(this.dollyTo(s,n))}else if(sd(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=_b.NONE,this._changedDolly=0;const l=Ki.set(r,a,s),c=oi.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||or(this._target.x,this._targetEnd.x,this.restThreshold)&&or(this._target.y,this._targetEnd.y,this.restThreshold)&&or(this._target.z,this._targetEnd.z,this.restThreshold)&&or(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&or(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&or(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=_b.NONE,this._changedDolly=0;const a=oi.set(...e.target);if("spherical"in e)fl.set(...e.spherical);else{const f=Ki.set(...e.position);fl.setFromVector3(f.sub(a).applyQuaternion(this._yAxisUpSpace))}const s=Sb.set(...n.target);if("spherical"in n)wb.set(...n.spherical);else{const f=Ki.set(...n.position);wb.setFromVector3(f.sub(s).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(a.lerp(s,i));const o=wb.theta-fl.theta,l=wb.phi-fl.phi,c=wb.radius-fl.radius;this._sphericalEnd.set(fl.radius+c*i,fl.phi+l*i,fl.theta+o*i),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!r||or(this._target.x,this._targetEnd.x,this.restThreshold)&&or(this._target.y,this._targetEnd.y,this.restThreshold)&&or(this._target.z,this._targetEnd.z,this.restThreshold)&&or(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&or(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&or(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(oi),s=this.setLookAt(a.x,a.y,a.z,e,n,i,r);return this._sphericalEnd.phi=Jc(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||or(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&or(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&or(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}setOrbitPoint(e,n,i){this._camera.updateMatrixWorld(),Fu.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Bu.setFromMatrixColumn(this._camera.matrixWorldInverse,1),zp.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const r=oi.set(e,n,i),a=r.distanceTo(this._camera.position),s=r.sub(this._camera.position);Fu.multiplyScalar(s.x),Bu.multiplyScalar(s.y),zp.multiplyScalar(s.z),oi.copy(Fu).add(Bu).add(zp),oi.z=oi.z+a,this.dollyTo(a,!1),this.setFocalOffset(-oi.x,oi.y,-oi.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 jn.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()*Zy,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()*Zy,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 jn.Vector3).copy(n?this._targetEnd:this._target)}getPosition(e,n=!0){return(e&&e.isVector3?e:new jn.Vector3).setFromSpherical(n?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(n?this._targetEnd:this._target)}getSpherical(e,n=!0){return(e||new jn.Spherical).copy(n?this._sphericalEnd:this._spherical)}getFocalOffset(e,n=!0){return(e&&e.isVector3?e:new jn.Vector3).copy(n?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%td+td)%td,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=td),this._spherical.theta+=td*Math.round((this._sphericalEnd.theta-this._spherical.theta)/td),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(!or(this._camera.up.x,this._cameraUp0.x)||!or(this._camera.up.y,this._cameraUp0.y)||!or(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const i=this.getPosition(oi);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=oi.subVectors(this._target,this._camera.position).normalize(),n=Ki.crossVectors(e,this._camera.up);this._camera.up.crossVectors(n,e).normalize(),this._camera.updateMatrixWorld();const i=this.getPosition(oi);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(Ir(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(Ir(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(Ir(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(Ir(a.x)&&Ir(a.y)&&Ir(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(Ir(s.x)&&Ir(s.y)&&Ir(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(Ir(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(Bp(this._camera)&&this._changedDolly!==0){const f=this._spherical.radius-this._lastDistance,h=this._camera,d=this._getCameraDirection(tx),g=oi.copy(d).cross(h.up).normalize();g.lengthSq()===0&&(g.x=1);const b=Ki.crossVectors(g,d),y=this._sphericalEnd.radius*Math.tan(h.getEffectiveFOV()*Zy*.5),x=(this._sphericalEnd.radius-f-this._sphericalEnd.radius)/this._sphericalEnd.radius,_=Sb.copy(this._targetEnd).add(g.multiplyScalar(this._dollyControlCoord.x*y*h.aspect)).add(b.multiplyScalar(this._dollyControlCoord.y*y)),w=oi.copy(this._targetEnd).lerp(_,x),M=this._lastDollyDirection===_b.IN&&this._spherical.radius<=this.minDistance,S=this._lastDollyDirection===_b.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(M||S)){this._sphericalEnd.radius-=f,this._spherical.radius-=f;const C=Ki.copy(d).multiplyScalar(-f);w.add(C)}this._boundary.clampPoint(w,w);const A=Ki.subVectors(w,this._targetEnd);this._targetEnd.copy(w),this._target.add(A),this._changedDolly-=f,Ir(this._changedDolly)&&(this._changedDolly=0)}else if(sd(this._camera)&&this._changedZoom!==0){const f=this._zoom-this._lastZoom,h=this._camera,d=oi.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(h.near+h.far)/(h.near-h.far)).unproject(h),g=Ki.set(0,0,-1).applyQuaternion(h.quaternion),b=Sb.copy(d).add(g.multiplyScalar(-d.dot(h.up))),m=-(this._zoom-f-this._zoom)/this._zoom,x=this._getCameraDirection(tx),_=this._targetEnd.dot(x),w=oi.copy(this._targetEnd).lerp(b,m),M=w.dot(x),S=x.multiplyScalar(M-_);w.sub(S),this._boundary.clampPoint(w,w);const A=Ki.subVectors(w,this._targetEnd);this._targetEnd.copy(w),this._target.add(A),this._changedZoom-=f,Ir(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),(!Ir(this._focalOffset.x)||!Ir(this._focalOffset.y)||!Ir(this._focalOffset.z))&&(Fu.setFromMatrixColumn(this._camera.matrix,0),Bu.setFromMatrixColumn(this._camera.matrix,1),zp.setFromMatrixColumn(this._camera.matrix,2),Fu.multiplyScalar(this._focalOffset.x),Bu.multiplyScalar(-this._focalOffset.y),zp.multiplyScalar(this._focalOffset.z),oi.copy(Fu).add(Bu).add(zp),this._camera.position.add(oi),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),oi.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"}),Ir(n,this.restThreshold)&&Ir(i,this.restThreshold)&&Ir(r,this.restThreshold)&&Ir(a.x,this.restThreshold)&&Ir(a.y,this.restThreshold)&&Ir(a.z,this.restThreshold)&&Ir(s.x,this.restThreshold)&&Ir(s.y,this.restThreshold)&&Ir(s.z,this.restThreshold)&&Ir(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:Qy(this.maxDistance),minZoom:this.minZoom,maxZoom:Qy(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Qy(this.maxPolarAngle),minAzimuthAngle:Qy(this.minAzimuthAngle),maxAzimuthAngle:Qy(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:oi.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=ex(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=ex(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=ex(i.maxPolarAngle),this.minAzimuthAngle=ex(i.minAzimuthAngle),this.maxAzimuthAngle=ex(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),fl.setFromVector3(oi.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(fl.theta,fl.phi,n),this.dollyTo(fl.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",i2e),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=Ki.copy(n).add(e),o=this._boundary.clampPoint(a,Sb).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(Ki.copy(n).multiplyScalar(c)).add(o.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(Bp(this._camera)){const e=this._camera,n=e.near,i=e.getEffectiveFOV()*Zy,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(sd(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(tx);bD.lookAt(K5,i,this._camera.up);for(let r=0;r<4;r++){const a=Ki.copy(this._nearPlaneCorners[r]);a.applyMatrix4(bD);const s=Sb.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 jn.Sphere){const i=n,r=i.center;Eb.makeEmpty(),e.traverseVisible(s=>{s.isMesh&&Eb.expandByObject(s)}),Eb.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++)oi.fromBufferAttribute(u,f),a=Math.max(a,r.distanceToSquared(oi))}),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:m,...x}=t,_=n??a2e;I.useMemo(()=>{const q={Box3:rr,MathUtils:{clamp:yc.clamp},Matrix4:Dt,Quaternion:qn,Raycaster:G_,Sphere:Ur,Spherical:C$,Vector2:wt,Vector3:te,Vector4:ni};_.install({THREE:q}),q_({CameraControlsImpl:_})},[_]);const w=ki(q=>q.camera),M=ki(q=>q.gl),S=ki(q=>q.invalidate),A=ki(q=>q.events),C=ki(q=>q.setEvents),D=ki(q=>q.set),R=ki(q=>q.get),L=ki(q=>q.performance),U=i||w,j=r||A.connected||M.domElement,z=I.useMemo(()=>new _(U),[_,U]);return oa((q,F)=>{z.update(F)},-1),I.useEffect(()=>(z.connect(j),()=>void z.disconnect()),[j,z]),I.useEffect(()=>{function q(){S(),m&&L.regress()}const F=de=>{q(),s?.(de),g?.(de)},V=de=>{q(),o?.(de),y?.(de)},H=de=>{l?.(de),b?.(de)},W=de=>{q(),c?.(de),y?.(de)},B=de=>{q(),u?.(de),y?.(de)},J=de=>{q(),f?.(de),y?.(de)},Z=de=>{h?.(de)},G=de=>{d?.(de)};return z.addEventListener("controlstart",F),z.addEventListener("control",V),z.addEventListener("controlend",H),z.addEventListener("transitionstart",W),z.addEventListener("update",B),z.addEventListener("wake",J),z.addEventListener("rest",Z),z.addEventListener("sleep",G),()=>{z.removeEventListener("controlstart",F),z.removeEventListener("control",V),z.removeEventListener("controlend",H),z.removeEventListener("transitionstart",W),z.removeEventListener("update",B),z.removeEventListener("wake",J),z.removeEventListener("rest",Z),z.removeEventListener("sleep",G)}},[z,S,C,m,L,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))}),s2e=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 <${zZ>=154?"colorspace_fragment":"encodings_fragment"}>
    }
  `),HZ=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=Da,...d},g)=>{q_({GridMaterial:s2e});const b=I.useRef(null);I.useImperativeHandle(g,()=>b.current,[]);const y=new nu,m=new te(0,1,0),x=new te(0,0,0);oa(M=>{y.setFromNormalAndCoplanarPoint(m,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}))}),o2e="modulepreload",l2e=function(t){return"/"+t},e6={},c2e=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=l2e(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":o2e,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 VZ={exports:{}};(function(t,e){(function(n,i){t.exports=i()})(Fm,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,m=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,m),_.fillStyle=a,_.globalAlpha=.9,_.fillRect(g,b,y,m),{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,m,g,b,y-c,m),_.fillRect(g+y-c,b,c,m),_.fillStyle=a,_.globalAlpha=.9,_.fillRect(g+y-c,b,c,l((1-w/M)*m))}}},n})})(VZ);var u2e=VZ.exports;const f2e=Rc(u2e);function h2e(t,e=[],n){const[i,r]=I.useState();return I.useLayoutEffect(()=>{const a=t();return r(a),()=>void 0},e),i}function d2e({showPanel:t=0,className:e,parent:n}){const i=h2e(()=>new f2e,[]);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=Awe(()=>i.begin()),o=Cwe(()=>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 p2e(t){return typeof t=="function"}const n6=new Dt,i6=new Dt,cE=[],nx=new Si;class m2e extends yl{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;nx.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),nx.matrixWorld=i6,i.material instanceof Oa?nx.material.side=i.material.side:nx.material.side=i.material[0].side,nx.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 GZ=I.createContext(null),r6=new Dt,a6=new Dt,g2e=new Dt,s6=new te,o6=new qn,l6=new te,b2e=t=>t.isInstancedBufferAttribute,cc=I.forwardRef(({context:t,children:e,...n},i)=>{I.useMemo(()=>q_({PositionMesh:m2e}),[]);const r=I.useRef(null);I.useImperativeHandle(i,()=>r.current,[]);const{subscribe:a,getParent:s}=I.useContext(t||GZ);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(cc,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;_++)g2e.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,_])=>b2e(_))}),oa(()=>{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 m=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:G1}),I.createElement("instancedBufferAttribute",{attach:"instanceColor",args:[d,3],usage:G1}),p2e(e)?I.createElement(o.Provider,{value:m},e(l)):t?I.createElement(t.Provider,{value:m},e):I.createElement(GZ.Provider,{value:m},e))}),WZ=(t,e,n)=>{let i;switch(t){case Ao:i=new Uint8ClampedArray(e*n*4);break;case rs:i=new Uint16Array(e*n*4);break;case Ac: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 Hv:i=new Int32Array(e*n*4);break;case wr:i=new Float32Array(e*n*4);break;default:throw new Error("Unsupported data type")}return i};let uE;const v2e=(t,e,n,i)=>{if(uE!==void 0)return uE;const r=new Cc(1,1,i);e.setRenderTarget(r);const a=new Si(new Il,new Cs({color:16777215}));e.render(a,n),e.setRenderTarget(null);const s=WZ(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,m;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:Qr,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:Vi,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:Vi,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:xa,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:xa};if(this._material=e.material,e.renderer?this._renderer=e.renderer:(this._renderer=RU.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Wv,this._camera=new Ah,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(),!v2e(this._type,this._renderer,this._camera,x)){let _;switch(this._type){case rs:_=this._renderer.extensions.has("EXT_color_buffer_float")?wr:void 0;break}_!==void 0?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to ${wr}`),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 Si(new Il,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new Cc(this.width,this.height,x),this._renderTarget.texture.mapping=((y=e.renderTargetOptions)===null||y===void 0?void 0:y.mapping)!==void 0?(m=e.renderTargetOptions)===null||m===void 0?void 0:m.mapping:Hd}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=WZ(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 os(this.toArray(),this.width,this.height,Qr,this._type,e?.mapping||Hd,e?.wrapS||xa,e?.wrapT||xa,e?.magFilter||Vi,e?.minFilter||Vi,e?.anisotropy||1,Su);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 cs&&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 y2e=`
varying vec2 vUv;

void main() {
  vUv = uv;
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`,x2e=`
// 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 _2e extends cs{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:y2e,fragmentShader:x2e,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:rf,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 qZ extends Error{}class XZ extends Error{}const ix=(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`)},S2e=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=ix(r,"hdrgm:GainMapMin","0"),s=ix(r,"hdrgm:GainMapMax"),o=ix(r,"hdrgm:Gamma","1"),l=ix(r,"hdrgm:OffsetSDR","0.015625"),c=ix(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 w2e{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 m=0;for(let M=y;M<y+12*b;M+=12)a.getUint16(M,!h)===45057&&(m=a.getUint32(M+8,!h));const _=g+2+b*12+4,w=[];for(let M=_;M<_+m*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 E2e=async t=>{const e=S2e(t);if(!e)throw new XZ("Gain map XMP metadata not found");const i=await new w2e({extractFII:!0,extractNonFII:!0}).extract(t);if(i.length!==2)throw new qZ("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 KZ 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 _2e({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:rs,colorSpace:Su,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),Hd,xa,xa,Vi,XO,Qr,Ao,1,Su);u.flipY=c,u.needsUpdate=!0;const f=new nr(o,Hd,xa,xa,Vi,XO,Qr,Ao,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 M2e extends KZ{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,m=0,x=!0,_=0,w=0;const M=()=>{if(typeof a=="function"){const D=d+y+_,R=g+m+w,L=h&&b&&x;a(new ProgressEvent("progress",{lengthComputable:L,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,m=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 T2e extends KZ{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 E2e(l);c=h.sdr,u=h.gainMap,f=h.metadata}catch(h){if(h instanceof XZ||h instanceof qZ)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 Z1={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"},YZ="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",E0=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=Z1[n],e=YZ);const a=E0(t),{extension:s,isCubemap:o}=OU(t),l=IU(s);if(!l)throw new Error("useEnvironment: Unrecognized file extension: "+t);const c=ki(d=>d.gl);I.useLayoutEffect(()=>{if(s!=="webp"&&s!=="jpg"&&s!=="jpeg")return;function d(){dv.clear(l,a?[t]:t)}c.domElement.addEventListener("webglcontextlost",d,{once:!0})},[t,c.domElement]);const u=dv(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?ff:J0,f.colorSpace=i??(o?"srgb":"srgb-linear"),f}const A2e={files:kU,path:"",preset:void 0,extensions:void 0};wC.preload=t=>{const e={...A2e,...t};let{files:n,path:i=""}=e;const{preset:r,extensions:a}=e;r&&(DU(r),n=Z1[r],i=YZ);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);dv.preload(o,E0(n)?[n]:n,l=>{l.setPath==null||l.setPath(i),a&&a(l)})};const C2e={files:kU,preset:void 0};wC.clear=t=>{const e={...C2e,...t};let{files:n}=e;const{preset:i}=e;i&&(DU(i),n=Z1[i]);const{extension:r}=OU(n),a=IU(r);if(!a)throw new Error("useEnvironment: Unrecognized file extension: "+n);dv.clear(a,E0(n)?[n]:n)};function DU(t){if(!(t in Z1))throw new Error("Preset must be one of: "+Object.keys(Z1).join(", "))}function OU(t){var e;const n=E0(t)&&t.length===6,i=E0(t)&&t.length===3&&t.some(s=>s.endsWith("json")),r=E0(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"?p$:t==="hdr"?WEe:t==="exr"?qEe:t==="jpg"||t==="jpeg"?T2e:t==="webp"?M2e:null}const R2e=t=>t.current&&t.current.isScene,k2e=t=>R2e(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=k2e(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),ou(c,r),()=>{t!=="only"&&(c.environment=f),t&&(c.background=u),ou(c,h)}}function LU({scene:t,background:e=!1,map:n,...i}){const r=ki(a=>a.scene);return I.useLayoutEffect(()=>{if(n)return NU(e,t,r,n,i)}),null}function JZ({background:t=!1,scene:e,blur:n,backgroundBlurriness:i,backgroundIntensity:r,backgroundRotation:a,environmentIntensity:s,environmentRotation:o,...l}){const c=wC(l),u=ki(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 D2e({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:m}){const x=ki(C=>C.gl),_=ki(C=>C.scene),w=I.useRef(null),[M]=I.useState(()=>new Wv),S=I.useMemo(()=>{const C=new VP(i);return C.texture.type=rs,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 oa(()=>{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,Ewe(I.createElement(I.Fragment,null,t,I.createElement("cubeCamera",{ref:w,args:[e,n,S]}),g||y?I.createElement(JZ,{background:!0,files:g,preset:y,path:b,extensions:m}):a?I.createElement(LU,{background:!0,map:a,extensions:m}):null),M))}function O2e(t){var e,n,i,r;const a=wC(t),s=t.map||a;I.useMemo(()=>q_({GroundProjectedEnvImpl:lEe}),[]),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 I2e(t){return t.ground?I.createElement(O2e,t):t.map?I.createElement(LU,t):t.children?I.createElement(D2e,t):I.createElement(JZ,t)}const N2e=I.createContext(null);function L2e({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 m=Symbol();return d.subscriptions.set(m,y.current),()=>void d.subscriptions.delete(m)}}));let b=0;return oa(()=>{const{frames:y,averages:m}=d;if(!d.fallback&&m.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),m[d.index++%t]=d.fps,m.length===t){const[_,w]=s(d.refreshrate),M=m.filter(A=>A>=w),S=m.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(N2e.Provider,{value:d},f)}const P2e={},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:()=>{(P2e?"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},U2e=t=>t?u6(t):u6,$Z={},{useDebugValue:F2e}=Ce,{useSyncExternalStoreWithSelector:B2e}=H$;let f6=!1;const z2e=t=>t;function j2e(t,e=z2e,n){($Z?"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=B2e(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return F2e(i),i}const h6=t=>{($Z?"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"?U2e(t):t,n=(i,r)=>j2e(e,i,r);return Object.assign(n,e),n},J_=t=>t?h6(t):h6,$_=I.createContext(null),fE=new te,d6=new te,H2e=(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))},V2e=new te(0,1,0),p6=new Dt,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:m}=I.useContext($_),x=ki(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 Dt().extractRotation(w.current.matrixWorld),B=H.point.clone(),J=new te().setFromMatrixPosition(w.current.matrixWorld),Z=t.clone().applyMatrix4(W).normalize();M.current={clickPoint:B,dir:Z},S.current=n.current[e],g({component:"Arrow",axis:e,origin:J,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:B}=M.current,[J,Z]=i?.[e]||[void 0,void 0];let G=H2e(W,B,H.ray.origin,H.ray.direction);J!==void 0&&(G=Math.max(G,J-S.current)),Z!==void 0&&(G=Math.min(G,Z-S.current)),n.current[e]=S.current+G,r&&(_.current.innerText=`${n.current[e].toFixed(2)}`),p6.makeTranslation(B.x*G,B.y*G,B.z*G),b(p6)}},[r,b,A,n,i,e]),L=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:F}=I.useMemo(()=>{const H=c?l/o*1.6:o/20,W=c?.2:o/5,B=c?1-W:o-W,J=new qn().setFromUnitVectors(V2e,t.clone().normalize()),Z=new Dt().makeRotationFromQuaternion(J);return{cylinderLength:B,coneWidth:H,coneLength:W,matrixL:Z}},[t,o,l,c]),V=A?f:u[e];return I.createElement("group",{ref:w},I.createElement("group",{matrix:F,matrixAutoUpdate:!1,onPointerDown:D,onPointerMove:R,onPointerUp:L,onPointerOut:U},r&&I.createElement(Qv,{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:m},I.createElement("cylinderGeometry",{args:[z*1.4,z*1.4,j+q,8,1]})),I.createElement($m,{transparent:!0,raycast:()=>null,depthTest:s,points:[0,0,0,0,j,0],lineWidth:l,side:Jr,color:V,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:V,opacity:h,polygonOffset:!0,polygonOffsetFactor:-10,fog:!1}))))},yD=new te,xD=new te,_D=t=>t*180/Math.PI,G2e=t=>t*Math.PI/180,W2e=(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},q2e=(t,e)=>{let n=Math.floor(t/e);return n=n<0?n+1:n,t-n*e},m6=t=>{let e=q2e(t,2*Math.PI);return Math.abs(e)<1e-6?0:(e<0&&(e+=2*Math.PI),e)},hE=new Dt,g6=new te,dE=new yf,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:m}=I.useContext($_),x=ki(V=>V.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(V=>{r&&(_.current.innerText=`${_D(S.current).toFixed(0)}º`,_.current.style.display="block"),V.stopPropagation();const H=V.point.clone(),W=new te().setFromMatrixPosition(w.current.matrixWorld),B=new te().setFromMatrixColumn(w.current.matrixWorld,0).normalize(),J=new te().setFromMatrixColumn(w.current.matrixWorld,1).normalize(),Z=new te().setFromMatrixColumn(w.current.matrixWorld,2).normalize(),G=new nu().setFromNormalAndCoplanarPoint(Z,W);A.current={clickPoint:H,origin:W,e1:B,e2:J,normal:Z,plane:G},g({component:"Rotator",axis:n,origin:W,directions:[B,J,Z]}),x&&(x.enabled=!1),V.target.setPointerCapture(V.pointerId)},[r,x,g,n]),L=I.useCallback(V=>{if(V.stopPropagation(),C||D(!0),A.current){const{clickPoint:H,origin:W,e1:B,e2:J,normal:Z,plane:G}=A.current,[de,oe]=i?.[n]||[void 0,void 0];dE.copy(V.ray),dE.intersectPlane(G,SD),dE.direction.negate(),dE.intersectPlane(G,SD);let le=W2e(H,SD,W,B,J),ue=_D(le);V.shiftKey&&(ue=Math.round(ue/10)*10,le=G2e(ue)),de!==void 0&&oe!==void 0&&oe-de<2*Math.PI?(le=m6(le),le=le>Math.PI?le-2*Math.PI:le,le=yc.clamp(le,de-M.current,oe-M.current),S.current=M.current+le):(S.current=m6(M.current+le),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,le),g6.copy(W).applyMatrix4(hE).sub(W).negate(),hE.setPosition(g6),b(hE)}},[r,b,C,i,n]),U=I.useCallback(V=>{r&&(_.current.style.display="none"),V.stopPropagation(),M.current=S.current,A.current=null,y(),x&&(x.enabled=!0),V.target.releasePointerCapture(V.pointerId)},[r,x,y]),j=I.useCallback(V=>{V.stopPropagation(),D(!1)},[]),z=I.useMemo(()=>{const V=t.clone().normalize(),H=e.clone().normalize();return new Dt().makeBasis(V,H,V.clone().cross(H))},[t,e]),q=c?.65:o*.65,F=I.useMemo(()=>{const H=[];for(let W=0;W<=32;W++){const B=W*(Math.PI/2)/32;H.push(new te(Math.cos(B)*q,Math.sin(B)*q,0))}return H},[q]);return I.createElement("group",{ref:w,onPointerDown:R,onPointerMove:L,onPointerUp:U,onPointerOut:j,matrix:z,matrixAutoUpdate:!1},r&&I.createElement(Qv,{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($m,{points:F,lineWidth:l*4,visible:!1,userData:m}),I.createElement($m,{transparent:!0,raycast:()=>null,depthTest:s,points:F,lineWidth:l,side:Jr,color:C?f:u[n],opacity:d,polygonOffset:!0,polygonOffsetFactor:-10,renderOrder:h,fog:!1}))},X2e=(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 yf,mE=new te,b6=new Dt,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:m}=I.useContext($_),x=ki(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 B=W.point.clone(),J=new te().setFromMatrixPosition(w.current.matrixWorld),Z=new te().setFromMatrixColumn(w.current.matrixWorld,0).normalize(),G=new te().setFromMatrixColumn(w.current.matrixWorld,1).normalize(),de=new te().setFromMatrixColumn(w.current.matrixWorld,2).normalize(),oe=new nu().setFromNormalAndCoplanarPoint(de,J);M.current={clickPoint:B,e1:Z,e2:G,plane:oe},S.current=i.current[(n+1)%3],A.current=i.current[(n+2)%3],g({component:"Slider",axis:n,origin:J,directions:[Z,G,de]}),x&&(x.enabled=!1),W.target.setPointerCapture(W.pointerId)},[a,x,g,n]),L=I.useCallback(W=>{if(W.stopPropagation(),C||D(!0),M.current){const{clickPoint:B,e1:J,e2:Z,plane:G}=M.current,[de,oe]=r?.[(n+1)%3]||[void 0,void 0],[le,ue]=r?.[(n+2)%3]||[void 0,void 0];pE.copy(W.ray),pE.intersectPlane(G,mE),pE.direction.negate(),pE.intersectPlane(G,mE),mE.sub(B);let[Se,Oe]=X2e(J,Z,mE);de!==void 0&&(Se=Math.max(Se,de-S.current)),oe!==void 0&&(Se=Math.min(Se,oe-S.current)),le!==void 0&&(Oe=Math.max(Oe,le-A.current)),ue!==void 0&&(Oe=Math.min(Oe,ue-A.current)),i.current[(n+1)%3]=S.current+Se,i.current[(n+2)%3]=A.current+Oe,a&&(_.current.innerText=`${i.current[(n+1)%3].toFixed(2)}, ${i.current[(n+2)%3].toFixed(2)}`),b6.makeTranslation(Se*J.x+Oe*Z.x,Se*J.y+Oe*Z.y,Se*J.z+Oe*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(),B=e.clone().normalize();return new Dt().makeBasis(W,B,W.clone().cross(B))},[t,e]),q=u?1/7:l/7,F=u?.225:l*.225,V=C?h:f[n],H=I.useMemo(()=>[new te(0,0,0),new te(0,F,0),new te(F,F,0),new te(F,0,0),new te(0,0,0)],[F]);return I.createElement("group",{ref:w,matrix:z,matrixAutoUpdate:!1},a&&I.createElement(Qv,{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:L,onPointerUp:U,onPointerOut:j,scale:F,userData:m},I.createElement("planeGeometry",null),I.createElement("meshBasicMaterial",{transparent:!0,depthTest:o,color:V,polygonOffset:!0,polygonOffsetFactor:-10,side:Jr,fog:!1})),I.createElement($m,{position:[-F/2,-F/2,0],transparent:!0,depthTest:o,points:H,lineWidth:c,color:V,opacity:d,polygonOffset:!0,polygonOffsetFactor:-10,userData:m,fog:!1})))},Rx=new te,v6=new te,K2e=(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:(Rx.copy(i).multiplyScalar(r/s).sub(e),v6.copy(i).multiplyScalar(a/s).add(n).sub(t),-Rx.dot(v6)/Rx.dot(Rx))},Y2e=new te(0,1,0),rx=new te,y6=new Dt,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($_),m=ki(W=>W.size),x=ki(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),L=l?1.2:1.2*s,U=I.useCallback(W=>{i&&(_.current.innerText=`${A.current.toFixed(2)}`,_.current.style.display="block"),W.stopPropagation();const B=new Dt().extractRotation(w.current.matrixWorld),J=W.point.clone(),Z=new te().setFromMatrixPosition(w.current.matrixWorld),G=t.clone().applyMatrix4(B).normalize(),de=w.current.matrixWorld.clone(),oe=de.clone().invert(),le=l?1/CZ(w.current.getWorldPosition(Rx),s,W.camera,m):1;C.current={clickPoint:J,dir:G,mPLG:de,mPLGInv:oe,offsetMultiplier:le},d({component:"Sphere",axis:e,origin:Z,directions:[G]}),x&&(x.enabled=!1),W.target.setPointerCapture(W.pointerId)},[i,x,t,d,e,l,s,m]),j=I.useCallback(W=>{if(W.stopPropagation(),D||R(!0),C.current){const{clickPoint:B,dir:J,mPLG:Z,mPLGInv:G,offsetMultiplier:de}=C.current,[oe,le]=n?.[e]||[1e-5,void 0],Se=K2e(B,J,W.ray.origin,W.ray.direction)*de,Oe=l?Se:Se/s;let Be=Math.pow(2,Oe*.2);W.shiftKey&&(Be=Math.round(Be*10)/10),Be=Math.max(Be,oe/S.current),le!==void 0&&(Be=Math.min(Be,le/S.current)),A.current=S.current*Be,M.current.position.set(0,L+Se,0),i&&(_.current.innerText=`${A.current.toFixed(2)}`),rx.set(1,1,1),rx.setComponent(e,Be),y6.makeScale(rx.x,rx.y,rx.z).premultiply(Z).multiply(G),g(y6)}},[i,L,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,L,0),b(),x&&(x.enabled=!0),W.target.releasePointerCapture(W.pointerId)},[i,x,b,L]),q=I.useCallback(W=>{W.stopPropagation(),R(!1)},[]),{radius:F,matrixL:V}=I.useMemo(()=>{const W=l?o/s*1.8:s/22.5,B=new qn().setFromUnitVectors(Y2e,t.clone().normalize()),J=new Dt().makeRotationFromQuaternion(B);return{radius:W,matrixL:J}},[t,s,o,l]),H=D?u:c[e];return I.createElement("group",{ref:w},I.createElement("group",{matrix:V,matrixAutoUpdate:!1,onPointerDown:U,onPointerMove:j,onPointerUp:z,onPointerOut:q},i&&I.createElement(Qv,{position:[0,L/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,L,0],renderOrder:h,userData:y},I.createElement("sphereGeometry",{args:[F,12,12]}),I.createElement("meshBasicMaterial",{transparent:!0,depthTest:a,color:H,opacity:f,polygonOffset:!0,polygonOffsetFactor:-10}))))},x6=new Dt,_6=new Dt,S6=new Dt,gE=new Dt,TD=new Dt,Mb=new Dt,w6=new Dt,E6=new Dt,M6=new Dt,Tb=new rr,AD=new rr,T6=new te,A6=new te,C6=new te,R6=new te,ax=new te,Ab=new te(1,0,0),Cb=new te(0,1,0),Rb=new te(0,0,1),ZZ=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:m,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:L=!0,userData:U,children:j,...z},q)=>{const F=ki(le=>le.invalidate),V=I.useRef(null),H=I.useRef(null),W=I.useRef(null),B=I.useRef(null),J=I.useRef([0,0,0]),Z=I.useRef(new te(1,1,1)),G=I.useRef(new te(1,1,1));I.useLayoutEffect(()=>{s&&(B.current.updateWorldMatrix(!0,!0),gE.copy(B.current.matrixWorld).invert(),Tb.makeEmpty(),B.current.traverse(le=>{le.geometry&&(le.geometry.boundingBox||le.geometry.computeBoundingBox(),Mb.copy(le.matrixWorld).premultiply(gE),AD.copy(le.geometry.boundingBox),AD.applyMatrix4(Mb),Tb.union(AD))}),T6.copy(Tb.max).add(Tb.min).multiplyScalar(.5),A6.copy(Tb.max).sub(Tb.min).multiplyScalar(.5),C6.copy(A6).multiply(new te(...s)).add(T6),R6.set(...h).add(C6),W.current.position.copy(R6),F())});const de=I.useMemo(()=>({onDragStart:le=>{x6.copy(H.current.matrix),_6.copy(H.current.matrixWorld),n&&n(le),F()},onDrag:le=>{S6.copy(V.current.matrixWorld),gE.copy(S6).invert(),TD.copy(_6).premultiply(le),Mb.copy(TD).premultiply(gE),w6.copy(x6).invert(),E6.copy(Mb).multiply(w6),a&&H.current.matrix.copy(Mb),i&&i(Mb,E6,TD,le),F()},onDragEnd:()=>{r&&r(),F()},translation:J,translationLimits:m,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,J,m,x,_,w,g,b,y,...S,A,R,U,a,C,D]),oe=new te;return oa(le=>{if(y){const ue=CZ(W.current.getWorldPosition(oe),g,le.camera,le.size);Z.current.setScalar(ue)}e&&e instanceof Dt&&(H.current.matrix=e),H.current.updateWorldMatrix(!0,!0),M6.makeRotationFromEuler(W.current.rotation).setPosition(W.current.position).premultiply(H.current.matrixWorld),G.current.setFromMatrixScale(M6),ax.copy(Z.current).divide(G.current),(Math.abs(W.current.scale.x-ax.x)>1e-4||Math.abs(W.current.scale.y-ax.y)>1e-4||Math.abs(W.current.scale.z-ax.z)>1e-4)&&(W.current.scale.copy(ax),le.invalidate())}),I.useImperativeHandle(q,()=>H.current,[]),I.createElement($_.Provider,{value:de},I.createElement("group",{ref:V},I.createElement("group",Is({ref:H,matrix:e,matrixAutoUpdate:!1},z),I.createElement("group",{visible:L,ref:W,position:h,rotation:d},t&&I.createElement(I.Fragment,null,!o&&f[0]&&I.createElement(vD,{axis:0,direction:Ab}),!o&&f[1]&&I.createElement(vD,{axis:1,direction:Cb}),!o&&f[2]&&I.createElement(vD,{axis:2,direction:Rb}),!l&&f[0]&&f[1]&&I.createElement(ED,{axis:2,dir1:Ab,dir2:Cb}),!l&&f[0]&&f[2]&&I.createElement(ED,{axis:1,dir1:Rb,dir2:Ab}),!l&&f[2]&&f[1]&&I.createElement(ED,{axis:0,dir1:Cb,dir2:Rb}),!c&&f[0]&&f[1]&&I.createElement(wD,{axis:2,dir1:Ab,dir2:Cb}),!c&&f[0]&&f[2]&&I.createElement(wD,{axis:1,dir1:Rb,dir2:Ab}),!c&&f[2]&&f[1]&&I.createElement(wD,{axis:0,dir1:Cb,dir2:Rb}),!u&&f[0]&&I.createElement(MD,{axis:0,direction:Ab}),!u&&f[1]&&I.createElement(MD,{axis:1,direction:Cb}),!u&&f[2]&&I.createElement(MD,{axis:2,direction:Rb}))),I.createElement("group",{ref:B},j))))}),xi=Ce.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 J2e{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 $2e extends J2e{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 zu extends $2e{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=>{Z2e(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 Z2e(t){const e=t.target;return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.isContentEditable}function Zf(t){const e=t.useSceneTree.getState()[""],n=e?.wxyz??[1,0,0,0],i=e?.position??[0,0,0];return new Dt().makeRotationFromQuaternion(new qn(n[1],n[2],n[3],n[0])).setPosition(i[0],i[1],i[2])}function QZ(t,e){const n=Zf(t).invert(),i=e.origin.clone().applyMatrix4(n),r=n.setPosition(0,0,0),a=e.direction.clone().applyMatrix4(r);return new yf(i,a)}function EC(t){const e=Ce.useContext(xi);return eQ(e,t)}function eQ(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 Q2e({visible:t,children:e}){const{camera:n}=ki(),i=I.useRef(null),r=new te;return oa(()=>{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(cc,{position:[.5,0,0],color:"#777777"}),k.jsx(cc,{position:[-.5,0,0],color:"#777777"}),k.jsx(cc,{position:[0,0,.5],rotation:new vi(0,Math.PI/2,0),color:"#777777"}),k.jsx(cc,{position:[0,0,-.5],rotation:new vi(0,Math.PI/2,0),color:"#777777"}),k.jsx(cc,{position:[0,.5,0],rotation:new vi(0,0,Math.PI/2),color:"#999999"}),k.jsx(cc,{position:[0,-.5,0],rotation:new vi(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 eTe({forceShow:t,pivotRef:e,onPivotChange:n,update:i,crosshairVisible:r}){const a=I.useContext(xi),s=a.useGui(c=>c.showOrbitOriginTool),o=a.useDevSettings(c=>c.enableOrbitCrosshair);Ce.useEffect(i,[s]);const l=s||t;return k.jsxs(ZZ,{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(HZ,{args:[10,10,10,10],infiniteGrid:!0,fadeStrength:0,fadeFrom:0,fadeDistance:1e3,sectionColor:"#ffaaff",cellColor:"#ffccff",side:Jr,visible:l}),k.jsx(Q2e,{visible:o&&r})]})}function tTe(){const t=I.useContext(xi),e=ki(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;oa(H=>{if(f&&a.cameraControl){const W=a.cameraControl,B=W.camera,J=H.clock.getElapsedTime()-f.startTime,Z=Math.min(J/f.duration,1),G=Z*Z*(3-2*Z),de=new te().copy(f.startUp).lerp(f.targetUp,G).normalize(),oe=new te().copy(f.startLookAt).lerp(f.targetLookAt,G);B.up.copy(de);const le=new te;W.getPosition(le),W.updateCameraUp(),W.setPosition(le.x,le.y,le.z,!1),W.setLookAt(le.x,le.y,le.z,oe.x,oe.y,oe.z,!1),Z>=1&&h(null)}});const{clock:g}=ki(),b=H=>{if(!a.cameraControl)return;const W=new te;W.setFromMatrixPosition(H);const B=a.cameraControl,J=a.cameraControl.camera,Z=new te().setFromMatrixColumn(H,1),G=B.getTarget(new te);h({startUp:J.up.clone(),targetUp:Z,startLookAt:G,targetLookAt:W,startTime:g.getElapsedTime(),duration:d})},y=()=>{if(f!==null||!a.cameraControl||!r.current)return;const W=a.cameraControl.getTarget(new te),B=new Dt().extractRotation(r.current.matrix),J=e.up.clone().normalize(),Z=new te(0,1,0).applyMatrix4(B).normalize(),G=new te().crossVectors(Z,J).normalize(),de=Math.acos(Math.min(1,Math.max(-1,J.dot(Z)))),oe=new Dt;G.lengthSq()>1e-4&&oe.makeRotationAxis(G,de);const le=new Dt;le.multiply(oe),le.multiply(B),le.setPosition(W),r.current.matrix.copy(le),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 m=new qn().setFromEuler(new vi(Math.PI,0,0)),x=new qn,_=new Dt,w=new te,M=new qn,S=new te,A=new te,C=Ce.useCallback(()=>{y();const H=e,W=a.cameraControl,B=a.canvas;if(W===null){setTimeout(C,10);return}const J=Zf(t).invert(),Z=J.clone().multiply(_.makeRotationFromQuaternion(H.quaternion).setPosition(H.position)).multiply(_.makeRotationFromQuaternion(m));x.setFromRotationMatrix(J),W.getTarget(w).applyQuaternion(x);const G=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:B.height,image_width:B.width,fov:H.fov*Math.PI/180,near:H.near,far:H.far,look_at:[w.x,w.y,w.z],up_direction:[G.x,G.y,G.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=${G.x.toFixed(3)},${G.y.toFixed(3)},${G.z.toFixed(3)}`)},[e,n]),D=new URLSearchParams(window.location.search),R=D.get("initialCameraPosition"),L=D.get("initialCameraLookAt"),U=D.get("initialCameraUp"),j=D.get("forceOrbitOriginTool")==="1",z=t.useDevSettings(H=>H.logCamera),q=t.useGui(H=>H.websocketConnected),F=Ce.useRef(!1);Ce.useEffect(()=>{if(!F.current){const H=new te(...R?R.split(",").map(Number):[3,3,3]);H.applyMatrix4(Zf(t));const W=new te(...L?L.split(",").map(Number):[0,0,0]);W.applyMatrix4(Zf(t));const B=new te(...U?U.split(",").map(Number):[0,0,1]);B.applyMatrix4(Zf(t)),B.normalize(),e.up.set(B.x,B.y,B.z),a.cameraControl.updateCameraUp(),a.cameraControl.setLookAt(H.x,H.y,H.z,W.x,W.y,W.z,!1),F.current=!0}a.sendCamera=C,q&&setTimeout(()=>C(),50)},[q,C]);const V=a.canvas;return Ce.useEffect(()=>{const H=new ResizeObserver(()=>{C()});return H.observe(V),()=>H.disconnect()},[V]),Ce.useEffect(()=>{const H=a.cameraControl,W={w:new zu("KeyW",1e3/60),a:new zu("KeyA",1e3/60),s:new zu("KeyS",1e3/60),d:new zu("KeyD",1e3/60),q:new zu("KeyQ",1e3/60),e:new zu("KeyE",1e3/60),up:new zu("ArrowUp",1e3/60),down:new zu("ArrowDown",1e3/60),left:new zu("ArrowLeft",1e3/60),right:new zu("ArrowRight",1e3/60)};W.a.addEventListener(_s.HOLDING,B=>{H.truck(-.002*B?.deltaTime,0,!1)}),W.d.addEventListener(_s.HOLDING,B=>{H.truck(.002*B?.deltaTime,0,!1)}),W.w.addEventListener(_s.HOLDING,B=>{H.forward(.002*B?.deltaTime,!1)}),W.s.addEventListener(_s.HOLDING,B=>{H.forward(-.002*B?.deltaTime,!1)}),W.q.addEventListener(_s.HOLDING,B=>{H.elevate(-.002*B?.deltaTime,!1)}),W.e.addEventListener(_s.HOLDING,B=>{H.elevate(.002*B?.deltaTime,!1)}),W.left.addEventListener(_s.HOLDING,B=>{H.rotate(-.05*yc.DEG2RAD*B?.deltaTime,0,!0)}),W.right.addEventListener(_s.HOLDING,B=>{H.rotate(.05*yc.DEG2RAD*B?.deltaTime,0,!0)}),W.up.addEventListener(_s.HOLDING,B=>{H.rotate(0,-.05*yc.DEG2RAD*B?.deltaTime,!0)}),W.down.addEventListener(_s.HOLDING,B=>{H.rotate(0,.05*yc.DEG2RAD*B?.deltaTime,!0)});for(const B of Object.values(W))B.addEventListener(_s.HOLD_START,()=>{o(J=>J+1)}),B.addEventListener(_s.HOLD_END,()=>{o(J=>Math.max(0,J-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(eTe,{forceShow:j,pivotRef:r,onPivotChange:H=>{b(H)},update:y,crosshairVisible:u})]})}const ty=Ce.createContext(null);function Z_(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 <${zZ>=154?"colorspace_fragment":"encodings_fragment"}>
   }`),nTe=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:Da})),y=ki(_=>_.gl).getDrawingBufferSize(new wt),m=I.useRef(0),x=I.useRef();return I.useLayoutEffect(()=>{const _=d.current;if(!_)return;const w=_.parent;if(w&&w.geometry&&(m.current!==u||x.current!==w.geometry)){m.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 Si,M.material=g,_.add(M)),M.geometry=u?Xwe(w.geometry,u):w.geometry}}),I.useLayoutEffect(()=>{const _=d.current;if(!_)return;const w=_.children[0];w&&(w.renderOrder=l,ou(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 Qf(t={unmountOnHide:!1,enableCreaseAngle:!1}){const e=Ce.useContext(ty);return e===null||!e.clickable?null:k.jsx(iTe,{...t})}function iTe(t){const e=Ce.useRef(null),n=Ce.useContext(ty),[i,r]=Ce.useState(!0),a=t.enableCreaseAngle?Math.PI:0;return oa(()=>{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(nTe,{ref:e,thickness:10,screenspace:!0,color:16514816,opacity:.8,transparent:!0,angle:a}):null}const Kl={instanceMatrix:new Dt,transformMatrix:new Dt,finalMatrix:new Dt,position:new te,quaternion:new qn,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=Ce.useContext(ty),o=Ce.useRef(null),l=ki(h=>h.gl),c=Ce.useMemo(()=>l.getDrawingBufferSize(new wt),[l]),u=Ce.useMemo(()=>t?t.clone():null,[t]),f=Ce.useMemo(()=>{const h=new PU({side:Da});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 Ce.useEffect(()=>()=>{u&&u.dispose()},[u]),Ce.useEffect(()=>()=>{f&&f.dispose()},[f]),oa(()=>{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 m=d*3*4%e.byteLength,x=d*4*4%n.byteLength;if(o.current.position.set(g.getFloat32(m,!0),g.getFloat32(m+4,!0),g.getFloat32(m+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&&(Kl.instanceMatrix.compose(o.current.position,o.current.quaternion,o.current.scale),Kl.transformMatrix.compose(r.position,r.rotation,r.scale),Kl.finalMatrix.copy(Kl.instanceMatrix).multiply(Kl.transformMatrix),Kl.finalMatrix.decompose(Kl.position,Kl.quaternion,Kl.scale),o.current.position.copy(Kl.position),o.current.quaternion.copy(Kl.quaternion),o.current.scale.copy(Kl.scale)),o.current.visible=!0}}}),!s||!s.clickable||!u?null:k.jsx("mesh",{ref:o,geometry:u,material:f,visible:!1})},tQ=Ce.createContext(null),k6=16777215,D6=.85,O6=.2,I6=.2;function rTe(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 aTe(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 sTe(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 oTe=new Kv(1),lTe=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);
  }
   `),cTe=Ce.forwardRef(function({children:e,...n},i){const r=ki(c=>c.get),a=n.props,s=Ce.useMemo(()=>{const c=new On;return n.props.precision==="float16"?c.setAttribute("position",new zJ(new Uint16Array(a.points.buffer.slice(a.points.byteOffset,a.points.byteOffset+a.points.byteLength)),3)):c.setAttribute("position",new mn(new Float32Array(a.points.buffer.slice(a.points.byteOffset,a.points.byteOffset+a.points.byteLength)),3)),a.colors.length>3?c.setAttribute("color",new In(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=Ce.useMemo(()=>{const c=new lTe;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]);Ce.useEffect(()=>()=>{s.dispose(),o.dispose()},[s,o]),Ce.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 oa(()=>{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})}),uTe=Ce.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:oTe,scale:new te(r,r,r),children:[k.jsx("meshBasicMaterial",{color:a}),k.jsx(Qf,{})]}),k.jsxs(lT,{limit:6,children:[k.jsx("meshBasicMaterial",{}),k.jsx("cylinderGeometry",{args:[i,i,n,16]}),k.jsx(cc,{rotation:new vi(0,0,3*Math.PI/2),position:[.5*n,0,0],color:13369344,children:k.jsx(Qf,{unmountOnHide:!0,enableCreaseAngle:!0})}),k.jsx(cc,{position:[0,.5*n,0],color:52224,children:k.jsx(Qf,{unmountOnHide:!0,enableCreaseAngle:!0})}),k.jsx(cc,{rotation:new vi(Math.PI/2,0,0),position:[0,0,.5*n],color:204,children:k.jsx(Qf,{unmountOnHide:!0,enableCreaseAngle:!0})})]})]}),s]})}),fTe=Ce.forwardRef(function({batched_wxyzs:e,batched_positions:n,batched_scales:i,axes_length:r=.5,axes_radius:a=.0125,children:s},o){const l=Ce.useRef(null),c=Ce.useMemo(()=>new Wm(a,a,r,16),[a,r]),u=Ce.useMemo(()=>new Cs,[]);Ce.useEffect(()=>()=>{c.dispose(),u.dispose()},[c,u]);const f=Ce.useMemo(()=>({T_frame_framex:new Dt().makeRotationFromEuler(new vi(0,0,3*Math.PI/2)).setPosition(.5*r,0,0),T_frame_framey:new Dt().makeRotationFromEuler(new vi(0,0,0)).setPosition(0,.5*r,0),T_frame_framez:new Dt().makeRotationFromEuler(new vi(Math.PI/2,0,0)).setPosition(0,0,.5*r),red:new Ut(13369344),green:new Ut(52224),blue:new Ut(204)}),[r]);Ce.useEffect(()=>{if(!l.current)return;const m=new Dt,x=new Dt,_=new Dt,w=new Dt,M=new qn,S=new te,{T_frame_framex:A,T_frame_framey:C,T_frame_framez:D,red:R,green:L,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,F=e.byteLength/(4*4);for(let V=0;V<F;V++){const H=V*3*4%n.byteLength,W=V*4*4%e.byteLength,B=i&&i.byteLength===e.byteLength/4*3?V*3*4%i.byteLength:V*4%(i?.byteLength??4);if(q&&i)if(i.byteLength===e.byteLength/4*3)S.set(q.getFloat32(B,!0),q.getFloat32(B+4,!0),q.getFloat32(B+8,!0));else{const J=q.getFloat32(B,!0);S.set(J,J,J)}else S.set(1,1,1);m.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(m).multiply(A),_.copy(m).multiply(C),w.copy(m).multiply(D),l.current.setMatrixAt(V*3+0,x),l.current.setMatrixAt(V*3+1,_),l.current.setMatrixAt(V*3+2,w),l.current.setColorAt(V*3+0,R),l.current.setColorAt(V*3+1,L),l.current.setColorAt(V*3+2,U)}l.current.instanceMatrix.needsUpdate=!0,l.current.instanceColor.needsUpdate=!0},[e,n,i,f]);const h=Ce.useMemo(()=>new Wm(a,a,r,16),[a,r]),d=Ce.useMemo(()=>({position:new te(.5*r,0,0),rotation:new qn().setFromEuler(new vi(0,0,3*Math.PI/2)),scale:new te(1,1,1)}),[r]),g=Ce.useMemo(()=>({position:new te(0,.5*r,0),rotation:new qn().setFromEuler(new vi(0,0,0)),scale:new te(1,1,1)}),[r]),b=Ce.useMemo(()=>({position:new te(0,0,.5*r),rotation:new qn().setFromEuler(new vi(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:m=>Math.floor(m/3)}),k.jsx(yM,{geometry:h,batched_positions:n,batched_wxyzs:e,batched_scales:i,meshTransform:g,computeBatchIndexFromInstanceIndex:m=>Math.floor(m/3)}),k.jsx(yM,{geometry:h,batched_positions:n,batched_wxyzs:e,batched_scales:i,meshTransform:b,computeBatchIndexFromInstanceIndex:m=>Math.floor(m/3)}),s]})}),hTe=Ce.forwardRef(function({children:e,...n},i){const[r,a]=Ce.useState();return Ce.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 fv().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 vi(Math.PI,0,0),castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[k.jsx(Qf,{}),k.jsx("planeGeometry",{attach:"geometry",args:[n.props.render_width,n.props.render_height]}),k.jsx("meshBasicMaterial",{attach:"material",transparent:!0,side:Jr,map:r,toneMapped:!1})]}),e]})});function dTe(t){const[e,n]=t.split("-");return{anchorX:n==="left"?"left":n==="right"?"right":"center",anchorY:e==="top"?"top":e==="bottom"?"bottom":"middle"}}const pTe=Ce.forwardRef(function({children:e,...n},i){const r=Ce.useContext(xi),a=Ce.useRef(null),s=Ce.useRef(null),o=Ce.useContext(tQ);if(!o)throw new Error("ViserLabel must be used within BatchedLabelManager context");const{anchorX:l,anchorY:c}=dTe(n.props.anchor),u=_I(n.props.font_size_mode,n.props.font_screen_scale,n.props.font_scene_height);return Ce.useEffect(()=>{const h=new f1;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()}},[]),Ce.useEffect(()=>{s.current&&(s.current.text=n.props.text,o.syncText(s.current))},[n.props.text,o]),Ce.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]),Ce.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 nQ(t){return t[0]<<16|t[1]<<8|t[2]}function N6(t){const e=new os(Uint8Array.from(t===3?[0,128,255]:[0,64,128,192,255]),t,1,Th);return e.needsUpdate=!0,e}function mTe(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 Q_(t){const e={color:t.color===void 0?16777215:nQ(t.color),wireframe:t.wireframe,transparent:t.opacity!==null,opacity:t.opacity??1,side:{front:_u,back:Da,double:Jr}[t.side]};return t.material=="standard"||t.wireframe?new Yv({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}):mTe(t.material)}const gTe=Ce.forwardRef(function({children:e,...n},i){const[r,a]=Ce.useState();Ce.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 fv().load(y,m=>{a(m),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=Ce.useContext(ty),[f,h]=Ce.useState(!1);oa(()=>{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=Ce.useMemo(()=>{if(n.props.variant!=="filled")return null;const y=new On,m=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 In(m,3)),y.setIndex(new In(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($m,{points:d,color:f?16514816:nQ(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:Jr,depthWrite:!1})}),r&&k.jsxs("mesh",{position:[0,0,l*.999999],rotation:new vi(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:Jr,map:r,toneMapped:!1})]}),e]})});var bTe=(()=>{var t=import.meta.url;return async function(e={}){var n,i=e,r,a,s=new Promise((ne,ie)=>{r=ne,a=ie}),o=typeof window=="object",l=typeof importScripts=="function",c=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(c){const{createRequire:ne}=await c2e(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]);var u=ne(import.meta.url)}var f=Object.assign({},i),h="";function d(ne){return i.locateFile?i.locateFile(ne,h):h+ne}var g,b,y;if(c){var m=u("fs"),x=u("path");h=u("url").fileURLToPath(new URL("./",import.meta.url)),g=(ne,ie)=>(ne=He(ne)?new URL(ne):x.normalize(ne),m.readFileSync(ne,ie?void 0:"utf8")),y=ne=>{var ie=g(ne,!0);return ie.buffer||(ie=new Uint8Array(ie)),ie},b=(ne,ie,ke,Ke=!0)=>{ne=He(ne)?new URL(ne):x.normalize(ne),m.readFile(ne,Ke?void 0:"utf8",(xt,Ot)=>{xt?ke(xt):ie(Ke?Ot.buffer:Ot)})},!i.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2)}else(o||l)&&(l?h=self.location.href:typeof document<"u"&&document.currentScript&&(h=document.currentScript.src),t&&(h=t),h.startsWith("blob:")?h="":h=h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1),g=ne=>{var ie=new XMLHttpRequest;return ie.open("GET",ne,!1),ie.send(null),ie.responseText},l&&(y=ne=>{var ie=new XMLHttpRequest;return ie.open("GET",ne,!1),ie.responseType="arraybuffer",ie.send(null),new Uint8Array(ie.response)}),b=(ne,ie,ke)=>{if(He(ne)){var Ke=new XMLHttpRequest;Ke.open("GET",ne,!0),Ke.responseType="arraybuffer",Ke.onload=()=>{if(Ke.status==200||Ke.status==0&&Ke.response){ie(Ke.response);return}ke()},Ke.onerror=ke,Ke.send(null);return}fetch(ne,{credentials:"same-origin"}).then(xt=>xt.ok?xt.arrayBuffer():Promise.reject(new Error(xt.status+" : "+xt.url))).then(ie,ke)});i.print||console.log.bind(console);var _=i.printErr||console.error.bind(console);Object.assign(i,f),f=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit;var w;i.wasmBinary&&(w=i.wasmBinary);var M,S=!1,A,C,D,R,L,U,j,z;function q(){var ne=M.buffer;i.HEAP8=A=new Int8Array(ne),i.HEAP16=D=new Int16Array(ne),i.HEAPU8=C=new Uint8Array(ne),i.HEAPU16=R=new Uint16Array(ne),i.HEAP32=L=new Int32Array(ne),i.HEAPU32=U=new Uint32Array(ne),i.HEAPF32=j=new Float32Array(ne),i.HEAPF64=z=new Float64Array(ne)}var F=[],V=[],H=[];function W(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)Z(i.preRun.shift());Ue(F)}function B(){Ue(V)}function J(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)de(i.postRun.shift());Ue(H)}function Z(ne){F.unshift(ne)}function G(ne){V.unshift(ne)}function de(ne){H.unshift(ne)}var oe=0,le=null;function ue(ne){oe++,i.monitorRunDependencies?.(oe)}function Se(ne){if(oe--,i.monitorRunDependencies?.(oe),oe==0&&le){var ie=le;le=null,ie()}}function Oe(ne){i.onAbort?.(ne),ne="Aborted("+ne+")",_(ne),S=!0,ne+=". Build with -sASSERTIONS for more info.";var ie=new WebAssembly.RuntimeError(ne);throw a(ie),ie}var Be="data:application/octet-stream;base64,",je=ne=>ne.startsWith(Be),He=ne=>ne.startsWith("file://");function pe(){if(i.locateFile){var ne="Sorter.wasm";return je(ne)?ne:d(ne)}return new URL("/assets/Sorter-Df0J3ZWJ.wasm",import.meta.url).href}var ze;function Ie(ne){if(ne==ze&&w)return new Uint8Array(w);if(y)return y(ne);throw"both async and sync fetching of the wasm failed"}function qe(ne){return w?Promise.resolve().then(()=>Ie(ne)):new Promise((ie,ke)=>{b(ne,Ke=>ie(new Uint8Array(Ke)),Ke=>{try{ie(Ie(ne))}catch(xt){ke(xt)}})})}function we(ne,ie,ke){return qe(ne).then(Ke=>WebAssembly.instantiate(Ke,ie)).then(ke,Ke=>{_(`failed to asynchronously prepare wasm: ${Ke}`),Oe(Ke)})}function Me(ne,ie,ke,Ke){return!ne&&typeof WebAssembly.instantiateStreaming=="function"&&!je(ie)&&!He(ie)&&!c&&typeof fetch=="function"?fetch(ie,{credentials:"same-origin"}).then(xt=>{var Ot=WebAssembly.instantiateStreaming(xt,ke);return Ot.then(Ke,function(Vt){return _(`wasm streaming compile failed: ${Vt}`),_("falling back to ArrayBuffer instantiation"),we(ie,ke,Ke)})}):we(ie,ke,Ke)}function Ae(){return{a:_f}}function Ne(){var ne=Ae();function ie(Ke,xt){return oo=Ke.exports,M=oo.z,q(),Dn=oo.C,G(oo.A),Se(),oo}ue();function ke(Ke){ie(Ke.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(ne,ie)}catch(Ke){_(`Module.instantiateWasm callback failed with error: ${Ke}`),a(Ke)}return ze||(ze=pe()),Me(w,ze,ne,ke).catch(a),{}}var Ue=ne=>{for(;ne.length>0;)ne.shift()(i)};i.noExitRuntime;class Qe{constructor(ie){this.excPtr=ie,this.ptr=ie-24}set_type(ie){U[this.ptr+4>>2]=ie}get_type(){return U[this.ptr+4>>2]}set_destructor(ie){U[this.ptr+8>>2]=ie}get_destructor(){return U[this.ptr+8>>2]}set_caught(ie){ie=ie?1:0,A[this.ptr+12]=ie}get_caught(){return A[this.ptr+12]!=0}set_rethrown(ie){ie=ie?1:0,A[this.ptr+13]=ie}get_rethrown(){return A[this.ptr+13]!=0}init(ie,ke){this.set_adjusted_ptr(0),this.set_type(ie),this.set_destructor(ke)}set_adjusted_ptr(ie){U[this.ptr+16>>2]=ie}get_adjusted_ptr(){return U[this.ptr+16>>2]}get_exception_ptr(){var ie=lo(this.get_type());if(ie)return U[this.excPtr>>2];var ke=this.get_adjusted_ptr();return ke!==0?ke:this.excPtr}}var ae=0,K=(ne,ie,ke)=>{var Ke=new Qe(ne);throw Ke.init(ie,ke),ae=ne,ae},ce=()=>{Oe("")},he=(ne,ie,ke,Ke,xt)=>{},me=()=>{for(var ne=new Array(256),ie=0;ie<256;++ie)ne[ie]=String.fromCharCode(ie);$=ne},$,Ve=ne=>{for(var ie="",ke=ne;C[ke];)ie+=$[C[ke++]];return ie},Xe={},mt={},Ge={},Je,Ye=ne=>{throw new Je(ne)},vt,Mt=ne=>{throw new vt(ne)},gt=(ne,ie,ke)=>{ne.forEach(function(Tt){Ge[Tt]=ie});function Ke(Tt){var Bt=ke(Tt);Bt.length!==ne.length&&Mt("Mismatched type converter count");for(var rn=0;rn<ne.length;++rn)Re(ne[rn],Bt[rn])}var xt=new Array(ie.length),Ot=[],Vt=0;ie.forEach((Tt,Bt)=>{mt.hasOwnProperty(Tt)?xt[Bt]=mt[Tt]:(Ot.push(Tt),Xe.hasOwnProperty(Tt)||(Xe[Tt]=[]),Xe[Tt].push(()=>{xt[Bt]=mt[Tt],++Vt,Vt===Ot.length&&Ke(xt)}))}),Ot.length===0&&Ke(xt)};function kt(ne,ie,ke={}){var Ke=ie.name;if(ne||Ye(`type "${Ke}" must have a positive integer typeid pointer`),mt.hasOwnProperty(ne)){if(ke.ignoreDuplicateRegistrations)return;Ye(`Cannot register type '${Ke}' twice`)}if(mt[ne]=ie,delete Ge[ne],Xe.hasOwnProperty(ne)){var xt=Xe[ne];delete Xe[ne],xt.forEach(Ot=>Ot())}}function Re(ne,ie,ke={}){if(!("argPackAdvance"in ie))throw new TypeError("registerType registeredInstance requires argPackAdvance");return kt(ne,ie,ke)}var Le=8,ht=(ne,ie,ke,Ke)=>{ie=Ve(ie),Re(ne,{name:ie,fromWireType:function(xt){return!!xt},toWireType:function(xt,Ot){return Ot?ke:Ke},argPackAdvance:Le,readValueFromPointer:function(xt){return this.fromWireType(C[xt])},destructorFunction:null})},jt=ne=>({count:ne.count,deleteScheduled:ne.deleteScheduled,preservePointerOnDelete:ne.preservePointerOnDelete,ptr:ne.ptr,ptrType:ne.ptrType,smartPtr:ne.smartPtr,smartPtrType:ne.smartPtrType}),st=ne=>{function ie(ke){return ke.$$.ptrType.registeredClass.name}Ye(ie(ne)+" instance already deleted")},it=!1,bt=ne=>{},Jt=ne=>{ne.smartPtr?ne.smartPtrType.rawDestructor(ne.smartPtr):ne.ptrType.registeredClass.rawDestructor(ne.ptr)},Kt=ne=>{ne.count.value-=1;var ie=ne.count.value===0;ie&&Jt(ne)},un=(ne,ie,ke)=>{if(ie===ke)return ne;if(ke.baseClass===void 0)return null;var Ke=un(ne,ie,ke.baseClass);return Ke===null?null:ke.downcast(Ke)},Vn={},vn=()=>Object.keys(on).length,Qn=()=>{var ne=[];for(var ie in on)on.hasOwnProperty(ie)&&ne.push(on[ie]);return ne},Yn=[],_i=()=>{for(;Yn.length;){var ne=Yn.pop();ne.$$.deleteScheduled=!1,ne.delete()}},Xn,Ji=ne=>{Xn=ne,Yn.length&&Xn&&Xn(_i)},hi=()=>{i.getInheritedInstanceCount=vn,i.getLiveInheritedInstances=Qn,i.flushPendingDeletes=_i,i.setDelayFunction=Ji},on={},Ii=(ne,ie)=>{for(ie===void 0&&Ye("ptr should not be undefined");ne.baseClass;)ie=ne.upcast(ie),ne=ne.baseClass;return ie},ri=(ne,ie)=>(ie=Ii(ne,ie),on[ie]),se=(ne,ie)=>{(!ie.ptrType||!ie.ptr)&&Mt("makeClassHandle requires ptr and ptrType");var ke=!!ie.smartPtrType,Ke=!!ie.smartPtr;return ke!==Ke&&Mt("Both smartPtrType and smartPtr must be specified"),ie.count={value:1},Pe(Object.create(ne,{$$:{value:ie,writable:!0}}))};function ge(ne){var ie=this.getPointee(ne);if(!ie)return this.destructor(ne),null;var ke=ri(this.registeredClass,ie);if(ke!==void 0){if(ke.$$.count.value===0)return ke.$$.ptr=ie,ke.$$.smartPtr=ne,ke.clone();var Ke=ke.clone();return this.destructor(ne),Ke}function xt(){return this.isSmartPointer?se(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:ie,smartPtrType:this,smartPtr:ne}):se(this.registeredClass.instancePrototype,{ptrType:this,ptr:ne})}var Ot=this.registeredClass.getActualType(ie),Vt=Vn[Ot];if(!Vt)return xt.call(this);var Tt;this.isConst?Tt=Vt.constPointerType:Tt=Vt.pointerType;var Bt=un(ie,this.registeredClass,Tt.registeredClass);return Bt===null?xt.call(this):this.isSmartPointer?se(Tt.registeredClass.instancePrototype,{ptrType:Tt,ptr:Bt,smartPtrType:this,smartPtr:ne}):se(Tt.registeredClass.instancePrototype,{ptrType:Tt,ptr:Bt})}var Pe=ne=>typeof FinalizationRegistry>"u"?(Pe=ie=>ie,ne):(it=new FinalizationRegistry(ie=>{Kt(ie.$$)}),Pe=ie=>{var ke=ie.$$,Ke=!!ke.smartPtr;if(Ke){var xt={$$:ke};it.register(ie,xt,ie)}return ie},bt=ie=>it.unregister(ie),Pe(ne)),rt=()=>{Object.assign(dt.prototype,{isAliasOf(ne){if(!(this instanceof dt)||!(ne instanceof dt))return!1;var ie=this.$$.ptrType.registeredClass,ke=this.$$.ptr;ne.$$=ne.$$;for(var Ke=ne.$$.ptrType.registeredClass,xt=ne.$$.ptr;ie.baseClass;)ke=ie.upcast(ke),ie=ie.baseClass;for(;Ke.baseClass;)xt=Ke.upcast(xt),Ke=Ke.baseClass;return ie===Ke&&ke===xt},clone(){if(this.$$.ptr||st(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var ne=Pe(Object.create(Object.getPrototypeOf(this),{$$:{value:jt(this.$$)}}));return ne.$$.count.value+=1,ne.$$.deleteScheduled=!1,ne},delete(){this.$$.ptr||st(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ye("Object already scheduled for deletion"),bt(this),Kt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||st(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ye("Object already scheduled for deletion"),Yn.push(this),Yn.length===1&&Xn&&Xn(_i),this.$$.deleteScheduled=!0,this}})};function dt(){}var ot=(ne,ie)=>Object.defineProperty(ie,"name",{value:ne}),At=(ne,ie,ke)=>{if(ne[ie].overloadTable===void 0){var Ke=ne[ie];ne[ie]=function(...xt){return ne[ie].overloadTable.hasOwnProperty(xt.length)||Ye(`Function '${ke}' called with an invalid number of arguments (${xt.length}) - expects one of (${ne[ie].overloadTable})!`),ne[ie].overloadTable[xt.length].apply(this,xt)},ne[ie].overloadTable=[],ne[ie].overloadTable[Ke.argCount]=Ke}},ee=(ne,ie,ke)=>{i.hasOwnProperty(ne)?(Ye(`Cannot register public name '${ne}' twice`),At(i,ne,ne),i.hasOwnProperty(ke)&&Ye(`Cannot register multiple overloads of a function with the same number of arguments (${ke})!`),i[ne].overloadTable[ke]=ie):i[ne]=ie},xe=48,Te=57,De=ne=>{if(ne===void 0)return"_unknown";ne=ne.replace(/[^a-zA-Z0-9_]/g,"$");var ie=ne.charCodeAt(0);return ie>=xe&&ie<=Te?`_${ne}`:ne};function ve(ne,ie,ke,Ke,xt,Ot,Vt,Tt){this.name=ne,this.constructor=ie,this.instancePrototype=ke,this.rawDestructor=Ke,this.baseClass=xt,this.getActualType=Ot,this.upcast=Vt,this.downcast=Tt,this.pureVirtualFunctions=[]}var _t=(ne,ie,ke)=>{for(;ie!==ke;)ie.upcast||Ye(`Expected null or instance of ${ke.name}, got an instance of ${ie.name}`),ne=ie.upcast(ne),ie=ie.baseClass;return ne};function ft(ne,ie){if(ie===null)return this.isReference&&Ye(`null is not a valid ${this.name}`),0;ie.$$||Ye(`Cannot pass "${js(ie)}" as a ${this.name}`),ie.$$.ptr||Ye(`Cannot pass deleted object as a pointer of type ${this.name}`);var ke=ie.$$.ptrType.registeredClass,Ke=_t(ie.$$.ptr,ke,this.registeredClass);return Ke}function yt(ne,ie){var ke;if(ie===null)return this.isReference&&Ye(`null is not a valid ${this.name}`),this.isSmartPointer?(ke=this.rawConstructor(),ne!==null&&ne.push(this.rawDestructor,ke),ke):0;(!ie||!ie.$$)&&Ye(`Cannot pass "${js(ie)}" as a ${this.name}`),ie.$$.ptr||Ye(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&ie.$$.ptrType.isConst&&Ye(`Cannot convert argument of type ${ie.$$.smartPtrType?ie.$$.smartPtrType.name:ie.$$.ptrType.name} to parameter type ${this.name}`);var Ke=ie.$$.ptrType.registeredClass;if(ke=_t(ie.$$.ptr,Ke,this.registeredClass),this.isSmartPointer)switch(ie.$$.smartPtr===void 0&&Ye("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:ie.$$.smartPtrType===this?ke=ie.$$.smartPtr:Ye(`Cannot convert argument of type ${ie.$$.smartPtrType?ie.$$.smartPtrType.name:ie.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:ke=ie.$$.smartPtr;break;case 2:if(ie.$$.smartPtrType===this)ke=ie.$$.smartPtr;else{var xt=ie.clone();ke=this.rawShare(ke,$i.toHandle(()=>xt.delete())),ne!==null&&ne.push(this.rawDestructor,ke)}break;default:Ye("Unsupporting sharing policy")}return ke}function St(ne,ie){if(ie===null)return this.isReference&&Ye(`null is not a valid ${this.name}`),0;ie.$$||Ye(`Cannot pass "${js(ie)}" as a ${this.name}`),ie.$$.ptr||Ye(`Cannot pass deleted object as a pointer of type ${this.name}`),ie.$$.ptrType.isConst&&Ye(`Cannot convert argument of type ${ie.$$.ptrType.name} to parameter type ${this.name}`);var ke=ie.$$.ptrType.registeredClass,Ke=_t(ie.$$.ptr,ke,this.registeredClass);return Ke}function Nt(ne){return this.fromWireType(U[ne>>2])}var qt=()=>{Object.assign(at.prototype,{getPointee(ne){return this.rawGetPointee&&(ne=this.rawGetPointee(ne)),ne},destructor(ne){this.rawDestructor?.(ne)},argPackAdvance:Le,readValueFromPointer:Nt,fromWireType:ge})};function at(ne,ie,ke,Ke,xt,Ot,Vt,Tt,Bt,rn,ln){this.name=ne,this.registeredClass=ie,this.isReference=ke,this.isConst=Ke,this.isSmartPointer=xt,this.pointeeType=Ot,this.sharingPolicy=Vt,this.rawGetPointee=Tt,this.rawConstructor=Bt,this.rawShare=rn,this.rawDestructor=ln,!xt&&ie.baseClass===void 0?Ke?(this.toWireType=ft,this.destructorFunction=null):(this.toWireType=St,this.destructorFunction=null):this.toWireType=yt}var nn=(ne,ie,ke)=>{i.hasOwnProperty(ne)||Mt("Replacing nonexistent public symbol"),i[ne].overloadTable!==void 0&&ke!==void 0||(i[ne]=ie,i[ne].argCount=ke)},pn=(ne,ie,ke)=>{ne=ne.replace(/p/g,"i");var Ke=i["dynCall_"+ne];return Ke(ie,...ke)},dn=[],Dn,$t=ne=>{var ie=dn[ne];return ie||(ne>=dn.length&&(dn.length=ne+1),dn[ne]=ie=Dn.get(ne)),ie},Yt=(ne,ie,ke=[])=>{if(ne.includes("j"))return pn(ne,ie,ke);var Ke=$t(ie)(...ke);return Ke},Un=(ne,ie)=>(...ke)=>Yt(ne,ie,ke),xn=(ne,ie)=>{ne=Ve(ne);function ke(){return ne.includes("j")?Un(ne,ie):$t(ie)}var Ke=ke();return typeof Ke!="function"&&Ye(`unknown function pointer with signature ${ne}: ${ie}`),Ke},Zn=(ne,ie)=>{var ke=ot(ie,function(Ke){this.name=ie,this.message=Ke;var xt=new Error(Ke).stack;xt!==void 0&&(this.stack=this.toString()+`
`+xt.replace(/^Error(:[^\n]*)?\n/,""))});return ke.prototype=Object.create(ne.prototype),ke.prototype.constructor=ke,ke.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},ke},Nn,An=ne=>{var ie=Jo(ne),ke=Ve(ie);return Xa(ie),ke},Sn=(ne,ie)=>{var ke=[],Ke={};function xt(Ot){if(!Ke[Ot]&&!mt[Ot]){if(Ge[Ot]){Ge[Ot].forEach(xt);return}ke.push(Ot),Ke[Ot]=!0}}throw ie.forEach(xt),new Nn(`${ne}: `+ke.map(An).join([", "]))},an=(ne,ie,ke,Ke,xt,Ot,Vt,Tt,Bt,rn,ln,Jn,Ln)=>{ln=Ve(ln),Ot=xn(xt,Ot),Tt&&=xn(Vt,Tt),rn&&=xn(Bt,rn),Ln=xn(Jn,Ln);var ea=De(ln);ee(ea,function(){Sn(`Cannot construct ${ln} due to unbound types`,[Ke])}),gt([ne,ie,ke],Ke?[Ke]:[],si=>{si=si[0];var zc,Fr;Ke?(zc=si.registeredClass,Fr=zc.instancePrototype):Fr=dt.prototype;var $o=ot(ln,function(..._e){if(Object.getPrototypeOf(this)!==Sf)throw new Je("Use 'new' to construct "+ln);if(co.constructor_body===void 0)throw new Je(ln+" has no accessible constructor");var Ee=co.constructor_body[_e.length];if(Ee===void 0)throw new Je(`Tried to invoke ctor of ${ln} with invalid number of parameters (${_e.length}) - expected (${Object.keys(co.constructor_body).toString()}) parameters instead!`);return Ee.apply(this,_e)}),Sf=Object.create(Fr,{constructor:{value:$o}});$o.prototype=Sf;var co=new ve(ln,$o,Sf,Ln,zc,Ot,Tt,rn);co.baseClass&&(co.baseClass.__derivedClasses??=[],co.baseClass.__derivedClasses.push(co));var Dh=new at(ln,co,!0,!1,!1),Q=new at(ln+"*",co,!1,!1,!1),fe=new at(ln+" const*",co,!1,!0,!1);return Vn[ne]={pointerType:Q,constPointerType:fe},nn(ea,$o),[Dh,Q,fe]})},di=(ne,ie)=>{for(var ke=[],Ke=0;Ke<ne;Ke++)ke.push(U[ie+Ke*4>>2]);return ke},Li=ne=>{for(;ne.length;){var ie=ne.pop(),ke=ne.pop();ke(ie)}};function Gn(ne){for(var ie=1;ie<ne.length;++ie)if(ne[ie]!==null&&ne[ie].destructorFunction===void 0)return!0;return!1}function wi(ne,ie){if(!(ne instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof ne} which is not a function`);var ke=ot(ne.name||"unknownFunctionName",function(){});ke.prototype=ne.prototype;var Ke=new ke,xt=ne.apply(Ke,ie);return xt instanceof Object?xt:Ke}function Sa(ne,ie,ke,Ke){for(var xt=Gn(ne),Ot=ne.length,Vt="",Tt="",Bt=0;Bt<Ot-2;++Bt)Vt+=(Bt!==0?", ":"")+"arg"+Bt,Tt+=(Bt!==0?", ":"")+"arg"+Bt+"Wired";var rn=`
        return function (${Vt}) {
        if (arguments.length !== ${Ot-2}) {
          throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${Ot-2}');
        }`;xt&&(rn+=`var destructors = [];
`);var ln=xt?"destructors":"null",Jn=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];ie&&(rn+="var thisWired = classParam['toWireType']("+ln+`, this);
`);for(var Bt=0;Bt<Ot-2;++Bt)rn+="var arg"+Bt+"Wired = argType"+Bt+"['toWireType']("+ln+", arg"+Bt+`);
`,Jn.push("argType"+Bt);if(ie&&(Tt="thisWired"+(Tt.length>0?", ":"")+Tt),rn+=(ke||Ke?"var rv = ":"")+"invoker(fn"+(Tt.length>0?", ":"")+Tt+`);
`,xt)rn+=`runDestructors(destructors);
`;else for(var Bt=ie?1:2;Bt<ne.length;++Bt){var Ln=Bt===1?"thisWired":"arg"+(Bt-2)+"Wired";ne[Bt].destructorFunction!==null&&(rn+=`${Ln}_dtor(${Ln});
`,Jn.push(`${Ln}_dtor`))}return ke&&(rn+=`var ret = retType['fromWireType'](rv);
return ret;
`),rn+=`}
`,[Jn,rn]}function Gi(ne,ie,ke,Ke,xt,Ot){var Vt=ie.length;Vt<2&&Ye("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var Tt=ie[1]!==null&&ke!==null,Bt=Gn(ie),rn=ie[0].name!=="void",ln=[ne,Ye,Ke,xt,Li,ie[0],ie[1]],Jn=0;Jn<Vt-2;++Jn)ln.push(ie[Jn+2]);if(!Bt)for(var Jn=Tt?1:2;Jn<ie.length;++Jn)ie[Jn].destructorFunction!==null&&ln.push(ie[Jn].destructorFunction);let[Ln,ea]=Sa(ie,Tt,rn,Ot);Ln.push(ea);var si=wi(Function,Ln)(...ln);return ot(ne,si)}var Ko=(ne,ie,ke,Ke,xt,Ot)=>{var Vt=di(ie,ke);xt=xn(Ke,xt),gt([],[ne],Tt=>{Tt=Tt[0];var Bt=`constructor ${Tt.name}`;if(Tt.registeredClass.constructor_body===void 0&&(Tt.registeredClass.constructor_body=[]),Tt.registeredClass.constructor_body[ie-1]!==void 0)throw new Je(`Cannot register multiple constructors with identical number of parameters (${ie-1}) for class '${Tt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Tt.registeredClass.constructor_body[ie-1]=()=>{Sn(`Cannot construct ${Tt.name} due to unbound types`,Vt)},gt([],Vt,rn=>(rn.splice(1,0,null),Tt.registeredClass.constructor_body[ie-1]=Gi(Bt,rn,null,xt,Ot),[])),[]})},Bs=ne=>{ne=ne.trim();const ie=ne.indexOf("(");return ie!==-1?ne.substr(0,ie):ne},ko=(ne,ie,ke,Ke,xt,Ot,Vt,Tt,Bt)=>{var rn=di(ke,Ke);ie=Ve(ie),ie=Bs(ie),Ot=xn(xt,Ot),gt([],[ne],ln=>{ln=ln[0];var Jn=`${ln.name}.${ie}`;ie.startsWith("@@")&&(ie=Symbol[ie.substring(2)]),Tt&&ln.registeredClass.pureVirtualFunctions.push(ie);function Ln(){Sn(`Cannot call ${Jn} due to unbound types`,rn)}var ea=ln.registeredClass.instancePrototype,si=ea[ie];return si===void 0||si.overloadTable===void 0&&si.className!==ln.name&&si.argCount===ke-2?(Ln.argCount=ke-2,Ln.className=ln.name,ea[ie]=Ln):(At(ea,ie,Jn),ea[ie].overloadTable[ke-2]=Ln),gt([],rn,zc=>{var Fr=Gi(Jn,zc,ln,Ot,Vt,Bt);return ea[ie].overloadTable===void 0?(Fr.argCount=ke-2,ea[ie]=Fr):ea[ie].overloadTable[ke-2]=Fr,[]}),[]})},us=[],_n=[],Ga=ne=>{ne>9&&--_n[ne+1]===0&&(_n[ne]=void 0,us.push(ne))},fs=()=>_n.length/2-5-us.length,Wa=()=>{_n.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=fs},$i={toValue:ne=>(ne||Ye("Cannot use deleted val. handle = "+ne),_n[ne]),toHandle:ne=>{switch(ne){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const ie=us.pop()||_n.length;return _n[ie]=ne,_n[ie+1]=1,ie}}}},so={name:"emscripten::val",fromWireType:ne=>{var ie=$i.toValue(ne);return Ga(ne),ie},toWireType:(ne,ie)=>$i.toHandle(ie),argPackAdvance:Le,readValueFromPointer:Nt,destructorFunction:null},zs=ne=>Re(ne,so),js=ne=>{if(ne===null)return"null";var ie=typeof ne;return ie==="object"||ie==="array"||ie==="function"?ne.toString():""+ne},E=(ne,ie)=>{switch(ie){case 4:return function(ke){return this.fromWireType(j[ke>>2])};case 8:return function(ke){return this.fromWireType(z[ke>>3])};default:throw new TypeError(`invalid float width (${ie}): ${ne}`)}},N=(ne,ie,ke)=>{ie=Ve(ie),Re(ne,{name:ie,fromWireType:Ke=>Ke,toWireType:(Ke,xt)=>xt,argPackAdvance:Le,readValueFromPointer:E(ie,ke),destructorFunction:null})},Y=(ne,ie,ke)=>{switch(ie){case 1:return ke?Ke=>A[Ke]:Ke=>C[Ke];case 2:return ke?Ke=>D[Ke>>1]:Ke=>R[Ke>>1];case 4:return ke?Ke=>L[Ke>>2]:Ke=>U[Ke>>2];default:throw new TypeError(`invalid integer width (${ie}): ${ne}`)}},re=(ne,ie,ke,Ke,xt)=>{ie=Ve(ie);var Ot=ln=>ln;if(Ke===0){var Vt=32-8*ke;Ot=ln=>ln<<Vt>>>Vt}var Tt=ie.includes("unsigned"),Bt=(ln,Jn)=>{},rn;Tt?rn=function(ln,Jn){return Bt(Jn,this.name),Jn>>>0}:rn=function(ln,Jn){return Bt(Jn,this.name),Jn},Re(ne,{name:ie,fromWireType:Ot,toWireType:rn,argPackAdvance:Le,readValueFromPointer:Y(ie,ke,Ke!==0),destructorFunction:null})},ye=(ne,ie,ke)=>{var Ke=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],xt=Ke[ie];function Ot(Vt){var Tt=U[Vt>>2],Bt=U[Vt+4>>2];return new xt(A.buffer,Bt,Tt)}ke=Ve(ke),Re(ne,{name:ke,fromWireType:Ot,argPackAdvance:Le,readValueFromPointer:Ot},{ignoreDuplicateRegistrations:!0})},$e=(ne,ie,ke,Ke)=>{if(!(Ke>0))return 0;for(var xt=ke,Ot=ke+Ke-1,Vt=0;Vt<ne.length;++Vt){var Tt=ne.charCodeAt(Vt);if(Tt>=55296&&Tt<=57343){var Bt=ne.charCodeAt(++Vt);Tt=65536+((Tt&1023)<<10)|Bt&1023}if(Tt<=127){if(ke>=Ot)break;ie[ke++]=Tt}else if(Tt<=2047){if(ke+1>=Ot)break;ie[ke++]=192|Tt>>6,ie[ke++]=128|Tt&63}else if(Tt<=65535){if(ke+2>=Ot)break;ie[ke++]=224|Tt>>12,ie[ke++]=128|Tt>>6&63,ie[ke++]=128|Tt&63}else{if(ke+3>=Ot)break;ie[ke++]=240|Tt>>18,ie[ke++]=128|Tt>>12&63,ie[ke++]=128|Tt>>6&63,ie[ke++]=128|Tt&63}}return ie[ke]=0,ke-xt},tt=(ne,ie,ke)=>$e(ne,C,ie,ke),Lt=ne=>{for(var ie=0,ke=0;ke<ne.length;++ke){var Ke=ne.charCodeAt(ke);Ke<=127?ie++:Ke<=2047?ie+=2:Ke>=55296&&Ke<=57343?(ie+=4,++ke):ie+=3}return ie},zt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,gn=(ne,ie,ke)=>{for(var Ke=ie+ke,xt=ie;ne[xt]&&!(xt>=Ke);)++xt;if(xt-ie>16&&ne.buffer&&zt)return zt.decode(ne.subarray(ie,xt));for(var Ot="";ie<xt;){var Vt=ne[ie++];if(!(Vt&128)){Ot+=String.fromCharCode(Vt);continue}var Tt=ne[ie++]&63;if((Vt&224)==192){Ot+=String.fromCharCode((Vt&31)<<6|Tt);continue}var Bt=ne[ie++]&63;if((Vt&240)==224?Vt=(Vt&15)<<12|Tt<<6|Bt:Vt=(Vt&7)<<18|Tt<<12|Bt<<6|ne[ie++]&63,Vt<65536)Ot+=String.fromCharCode(Vt);else{var rn=Vt-65536;Ot+=String.fromCharCode(55296|rn>>10,56320|rn&1023)}}return Ot},En=(ne,ie)=>ne?gn(C,ne,ie):"",Ei=(ne,ie)=>{ie=Ve(ie);var ke=ie==="std::string";Re(ne,{name:ie,fromWireType(Ke){var xt=U[Ke>>2],Ot=Ke+4,Vt;if(ke)for(var Tt=Ot,Bt=0;Bt<=xt;++Bt){var rn=Ot+Bt;if(Bt==xt||C[rn]==0){var ln=rn-Tt,Jn=En(Tt,ln);Vt===void 0?Vt=Jn:(Vt+="\0",Vt+=Jn),Tt=rn+1}}else{for(var Ln=new Array(xt),Bt=0;Bt<xt;++Bt)Ln[Bt]=String.fromCharCode(C[Ot+Bt]);Vt=Ln.join("")}return Xa(Ke),Vt},toWireType(Ke,xt){xt instanceof ArrayBuffer&&(xt=new Uint8Array(xt));var Ot,Vt=typeof xt=="string";Vt||xt instanceof Uint8Array||xt instanceof Uint8ClampedArray||xt instanceof Int8Array||Ye("Cannot pass non-string to std::string"),ke&&Vt?Ot=Lt(xt):Ot=xt.length;var Tt=Gs(4+Ot+1),Bt=Tt+4;if(U[Tt>>2]=Ot,ke&&Vt)tt(xt,Bt,Ot+1);else if(Vt)for(var rn=0;rn<Ot;++rn){var ln=xt.charCodeAt(rn);ln>255&&(Xa(Bt),Ye("String has UTF-16 code units that do not fit in 8 bits")),C[Bt+rn]=ln}else for(var rn=0;rn<Ot;++rn)C[Bt+rn]=xt[rn];return Ke!==null&&Ke.push(Xa,Tt),Tt},argPackAdvance:Le,readValueFromPointer:Nt,destructorFunction(Ke){Xa(Ke)}})},Cn=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ai=(ne,ie)=>{for(var ke=ne,Ke=ke>>1,xt=Ke+ie/2;!(Ke>=xt)&&R[Ke];)++Ke;if(ke=Ke<<1,ke-ne>32&&Cn)return Cn.decode(C.subarray(ne,ke));for(var Ot="",Vt=0;!(Vt>=ie/2);++Vt){var Tt=D[ne+Vt*2>>1];if(Tt==0)break;Ot+=String.fromCharCode(Tt)}return Ot},Ar=(ne,ie,ke)=>{if(ke??=2147483647,ke<2)return 0;ke-=2;for(var Ke=ie,xt=ke<ne.length*2?ke/2:ne.length,Ot=0;Ot<xt;++Ot){var Vt=ne.charCodeAt(Ot);D[ie>>1]=Vt,ie+=2}return D[ie>>1]=0,ie-Ke},Mi=ne=>ne.length*2,Hi=(ne,ie)=>{for(var ke=0,Ke="";!(ke>=ie/4);){var xt=L[ne+ke*4>>2];if(xt==0)break;if(++ke,xt>=65536){var Ot=xt-65536;Ke+=String.fromCharCode(55296|Ot>>10,56320|Ot&1023)}else Ke+=String.fromCharCode(xt)}return Ke},Ui=(ne,ie,ke)=>{if(ke??=2147483647,ke<4)return 0;for(var Ke=ie,xt=Ke+ke-4,Ot=0;Ot<ne.length;++Ot){var Vt=ne.charCodeAt(Ot);if(Vt>=55296&&Vt<=57343){var Tt=ne.charCodeAt(++Ot);Vt=65536+((Vt&1023)<<10)|Tt&1023}if(L[ie>>2]=Vt,ie+=4,ie+4>xt)break}return L[ie>>2]=0,ie-Ke},pi=ne=>{for(var ie=0,ke=0;ke<ne.length;++ke){var Ke=ne.charCodeAt(ke);Ke>=55296&&Ke<=57343&&++ke,ie+=4}return ie},Ia=(ne,ie,ke)=>{ke=Ve(ke);var Ke,xt,Ot,Vt;ie===2?(Ke=ai,xt=Ar,Vt=Mi,Ot=Tt=>R[Tt>>1]):ie===4&&(Ke=Hi,xt=Ui,Vt=pi,Ot=Tt=>U[Tt>>2]),Re(ne,{name:ke,fromWireType:Tt=>{for(var Bt=U[Tt>>2],rn,ln=Tt+4,Jn=0;Jn<=Bt;++Jn){var Ln=Tt+4+Jn*ie;if(Jn==Bt||Ot(Ln)==0){var ea=Ln-ln,si=Ke(ln,ea);rn===void 0?rn=si:(rn+="\0",rn+=si),ln=Ln+ie}}return Xa(Tt),rn},toWireType:(Tt,Bt)=>{typeof Bt!="string"&&Ye(`Cannot pass non-string to C++ string type ${ke}`);var rn=Vt(Bt),ln=Gs(4+rn+ie);return U[ln>>2]=rn/ie,xt(Bt,ln+4,rn+ie),Tt!==null&&Tt.push(Xa,ln),ln},argPackAdvance:Le,readValueFromPointer:Nt,destructorFunction(Tt){Xa(Tt)}})},Pl=(ne,ie)=>{ie=Ve(ie),Re(ne,{isVoid:!0,name:ie,argPackAdvance:0,fromWireType:()=>{},toWireType:(ke,Ke)=>{}})},Yo=(ne,ie,ke)=>C.copyWithin(ne,ie,ie+ke),Na=(ne,ie)=>{var ke=mt[ne];return ke===void 0&&Ye(`${ie} has unknown type ${An(ne)}`),ke},sr=(ne,ie,ke)=>{var Ke=[],xt=ne.toWireType(Ke,ke);return Ke.length&&(U[ie>>2]=$i.toHandle(Ke)),xt},rp=(ne,ie,ke)=>(ne=$i.toValue(ne),ie=Na(ie,"emval::as"),sr(ie,ke,ne)),Cr={},Ul=ne=>{var ie=Cr[ne];return ie===void 0?Ve(ne):ie},Fc=[],Hs=(ne,ie,ke,Ke,xt)=>(ne=Fc[ne],ie=$i.toValue(ie),ke=Ul(ke),ne(ie,ie[ke],Ke,xt)),br=ne=>{var ie=Fc.length;return Fc.push(ne),ie},Wr=(ne,ie)=>{for(var ke=new Array(ne),Ke=0;Ke<ne;++Ke)ke[Ke]=Na(U[ie+Ke*4>>2],"parameter "+Ke);return ke},ur=(ne,ie,ke)=>{var Ke=Wr(ne,ie),xt=Ke.shift();ne--;var Ot=`return function (obj, func, destructorsRef, args) {
`,Vt=0,Tt=[];ke===0&&Tt.push("obj");for(var Bt=["retType"],rn=[xt],ln=0;ln<ne;++ln)Tt.push("arg"+ln),Bt.push("argType"+ln),rn.push(Ke[ln]),Ot+=`  var arg${ln} = argType${ln}.readValueFromPointer(args${Vt?"+"+Vt:""});
`,Vt+=Ke[ln].argPackAdvance;var Jn=ke===1?"new func":"func.call";Ot+=`  var rv = ${Jn}(${Tt.join(", ")});
`,xt.isVoid||(Bt.push("emval_returnValue"),rn.push(sr),Ot+=`  return emval_returnValue(retType, destructorsRef, rv);
`),Ot+=`};
`,Bt.push(Ot);var Ln=wi(Function,Bt)(...rn),ea=`methodCaller<(${Ke.map(si=>si.name).join(", ")}) => ${xt.name}>`;return br(ot(ea,Ln))},Vs=(ne,ie)=>(ne=$i.toValue(ne),ie=$i.toValue(ie),$i.toHandle(ne[ie])),qa=ne=>{ne>9&&(_n[ne+1]+=1)},vg=ne=>$i.toHandle(Ul(ne)),ap=ne=>{var ie=$i.toValue(ne);Li(ie),Ga(ne)},Rh=(ne,ie)=>{ne=Na(ne,"_emval_take_value");var ke=ne.readValueFromPointer(ie);return $i.toHandle(ke)},Bc=()=>1073741824,Cu=ne=>{var ie=M.buffer,ke=(ne-ie.byteLength+65535)/65536;try{return M.grow(ke),q(),1}catch{}},sp=ne=>{var ie=C.length;ne>>>=0;var ke=Bc();if(ne>ke)return!1;for(var Ke=(Bt,rn)=>Bt+(rn-Bt%rn)%rn,xt=1;xt<=4;xt*=2){var Ot=ie*(1+.2/xt);Ot=Math.min(Ot,ne+100663296);var Vt=Math.min(ke,Ke(Math.max(ne,Ot),65536)),Tt=Cu(Vt);if(Tt)return!0}return!1};me(),Je=i.BindingError=class extends Error{constructor(ie){super(ie),this.name="BindingError"}},vt=i.InternalError=class extends Error{constructor(ie){super(ie),this.name="InternalError"}},rt(),hi(),qt(),Nn=i.UnboundTypeError=Zn(Error,"UnboundTypeError"),Wa();var _f={n:K,t:ce,s:he,x:ht,r:an,q:Ko,k:ko,w:zs,m:N,c:re,a:ye,l:Ei,f:Ia,y:Pl,v:Yo,h:rp,o:Hs,b:Ga,p:ur,i:Vs,g:qa,j:vg,d:ap,e:Rh,u:sp},oo=Ne(),Jo=ne=>(Jo=oo.B)(ne),Gs=ne=>(Gs=oo.D)(ne),Xa=ne=>(Xa=oo.E)(ne),lo=ne=>(lo=oo.F)(ne);i.addOnPostRun=de;var Fl;le=function ne(){Fl||kh(),Fl||(le=ne)};function kh(){if(oe>0||(W(),oe>0))return;function ne(){Fl||(Fl=!0,i.calledRun=!0,!S&&(B(),r(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),J()))}i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),ne()},1)):ne()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return kh(),n=s,n}})();function vTe(t){return new Worker("/assets/SplatSortWorker-D00osGmu.js",{type:"module",name:t?.name})}const vs=[];for(let t=0;t<256;++t)vs.push((t+256).toString(16).slice(1));function yTe(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 xTe=new Uint8Array(16);function _Te(){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(xTe)}const STe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),P6={randomUUID:STe};function iQ(t,e,n){if(P6.randomUUID&&!t)return P6.randomUUID();t=t||{};const i=t.random??t.rng?.()??_Te();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,yTe(i)}const wTe=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 Dt},`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 ETe(t,e){const n=t.length/8,i=ki(d=>d.gl).capabilities.maxTextureSize,r=new V_;r.instanceCount=n,r.setIndex(new In(new Uint32Array([0,2,1,0,3,2]),1)),r.setAttribute("position",new In(new Float32Array([-2,-2,2,-2,2,2,-2,2]),2));const a=new hf(new Uint32Array(n),1);a.setUsage(G1),r.setAttribute("sortedIndex",a);const s=Math.min(n*2,i),o=Math.ceil(n*2/s),l=new Uint32Array(s*o*4);l.set(t);const c=new os(l,s,o,Gv,Ac);c.internalFormat="RGBA32UI",c.needsUpdate=!0;const u=new Float32Array(e*12),f=new os(u,e*12/4,1,Qr,wr);f.internalFormat="RGBA32F",f.needsUpdate=!0;const h=new wTe;return h.textureBuffer=c,h.textureT_camera_groups=f,h.numGaussians=n,{geometry:r,material:h,textureBuffer:c,sortedIndexAttribute:a,textureT_camera_groups:f,rowMajorT_camera_groups:u}}function MTe(){const t=Ce.useRef({});return Ce.useState(()=>J_(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 eS=Ce.createContext(null);function TTe({children:t}){const e=MTe();return k.jsxs(eS.Provider,{value:{useGaussianSplatStore:e,updateCamera:Ce.useRef(null),meshPropsRef:Ce.useRef(null)},children:[k.jsx(CTe,{}),t]})}const ATe=Ce.forwardRef(function({buffer:e,children:n},i){const r=Ce.useContext(eS),a=r.useGaussianSplatStore(c=>c.setBuffer),s=r.useGaussianSplatStore(c=>c.removeBuffer),o=r.useGaussianSplatStore(c=>c.nodeRefFromId),l=Ce.useMemo(()=>iQ(),[e]);return Ce.useEffect(()=>(a(l,e),()=>{s(l),delete o.current[l]}),[e]),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=Ce.useContext(eS).useGaussianSplatStore(n=>n.groupBufferFromId);return Object.keys(e).length>0?k.jsx(RTe,{}):null}function RTe(){const t=Ce.useContext(eS),e=t.useGaussianSplatStore(m=>m.groupBufferFromId),n=t.useGaussianSplatStore(m=>m.nodeRefFromId),i=kTe(e),r=ETe(i.gaussianBuffer,i.numGroups);t.meshPropsRef.current=r;const a=new vTe;let s=!1;a.onmessage=m=>{const x=m.data.sortedIndices;r.sortedIndexAttribute.set(x),r.sortedIndexAttribute.needsUpdate=!0,s||(r.material.uniforms.numGaussians.value=i.numGaussians,r.textureBuffer.needsUpdate=!0,s=!0)};function o(m){a.postMessage(m)}o({setBuffer:i.gaussianBuffer,setGroupIndices:i.groupIndices}),Ce.useEffect(()=>()=>{r.textureBuffer.dispose(),r.geometry.dispose(),r.material.dispose(),o({close:!0})});const l=Ce.useRef(null),c=new Dt,u=new Float32Array(i.numGroups*4),f=r.rowMajorT_camera_groups.slice().fill(0),h=[],d=Ce.useRef({fovY:0,aspect:0,near:0,far:0}),g=Ce.useRef(new Dt().makePerspective(-1,1,1,-1,.1,1e3)),b=Ce.useRef(null);Ce.useEffect(()=>{(async()=>b.current=new(await bTe()).Sorter(i.gaussianBuffer,i.groupIndices))()},[i.gaussianBuffer,i.groupIndices]);const y=Ce.useCallback(function(x,_,w,M){x.updateMatrixWorld(!0),x.updateProjectionMatrix();const S=x.fov*Math.PI/180,A=_/w;if(r.material===void 0)return;const C=r.material.uniforms;C.near.value=x.near,C.far.value=x.far,C.viewport.value=[_,w];const D=x.matrixWorldInverse,R=[];let L=!1;for(const[F,V]of Object.keys(e).entries()){const H=n.current[V];if(H===void 0)continue;c.copy(D).multiply(H.matrixWorld);const W=c.elements;u.set([W[2],W[6],W[10],W[14]],F*4);const B=c.transpose().elements;r.rowMajorT_camera_groups.set(B.slice(0,12),F*12);const J=H.visible&&H.parent!==null;R.push(J&&h[F]===!0),h[F]!==J&&(h[F]=J,L=!0)}const U=!r.rowMajorT_camera_groups.every((F,V)=>F===f[V]);if(U)if(M&&b.current!==null){const F=b.current.sort(u);r.sortedIndexAttribute.set(F),r.sortedIndexAttribute.needsUpdate=!0}else o({setTz_camera_groups:u});if(U||L){for(const[F,V]of R.entries())V||(r.rowMajorT_camera_groups[F*12+3]=1e10,r.rowMajorT_camera_groups[F*12+7]=1e10,r.rowMajorT_camera_groups[F*12+11]=1e10);f.set(r.rowMajorT_camera_groups),r.textureT_camera_groups.needsUpdate=!0}r.material.uniforms.projectionMatrixCustom.value.copy(g.current);const j=x.near,z=x.far,q=d.current;if(S!==q.fovY||A!==q.aspect||j!==q.near||z!==q.far){const F=Math.tan(S/2),V=j*F,H=-V,W=V*A,B=-W;g.current.makePerspective(B,W,V,H,j,z),q.fovY=S,q.aspect=A,q.near=j,q.far=z}},[r]);return t.updateCamera.current=y,oa((m,x)=>{if(l.current===null||a===null||r.rowMajorT_camera_groups.length===0)return;const w=r.material.uniforms;w.transitionInState.value=Math.min(w.transitionInState.value+x*2,1),y(m.camera,m.viewport.dpr*m.size.width,m.viewport.dpr*m.size.height,!1)},-100),k.jsx("mesh",{ref:l,geometry:r.geometry,material:r.material,renderOrder:1e4})}function kTe(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 rQ(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",aQ="_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 U6(t){return`rgb(${Math.round(t[0])}, ${Math.round(t[1])}, ${Math.round(t[2])})`}function F6(t){return`rgba(${Math.round(t[0])}, ${Math.round(t[1])}, ${Math.round(t[2])}, ${(t[3]/255).toFixed(4)})`}function kx(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=kx(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 DTe({uuid:t,props:{visible:e,disabled:n,label:i,color:r,_icon_html:a}}){const{messageSender:s}=Ce.useContext(Ls);return e??!0?k.jsx(ct,{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 Au({uuid:t,label:e,hint:n,children:i}){const{folderDepth:r}=I.useContext(Ls);return n!=null&&(i=k.jsx(Pr,{zIndex:100,label:n,multiline:!0,style:{width:"15rem"},withArrow:!0,openDelay:500,withinPortal:!0,children:k.jsx(ct,{children:i})})),e!==void 0&&(i=k.jsx(OTe,{uuid:t,label:e,input:i,folderDepth:r})),k.jsx(ct,{pb:"0.5em",px:"xs",children:i})}function OTe(t){return k.jsxs(bh,{align:"center",children:[k.jsx(ct,{pr:"xs",style:{width:`${7.25-t.folderDepth*.6375}em`,flexShrink:0,position:"relative"},children:k.jsx(bu,{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(ct,{style:{flexGrow:1},children:t.input})]})}function sQ(t){return k.jsx(bh,{justify:"space-between",columnGap:"0.5em",children:[...Array(t.n).keys()].map(e=>k.jsx(cg,{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 ITe({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}=Ce.useContext(Ls);if(!r)return null;const h=g=>f(t,g),d=k.jsxs(bh,{justify:"space-between",children:[k.jsx(OA,{id:t,className:u===null?aQ: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(cg,{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(Au,{uuid:t,hint:i,label:n,children:d})}function NTe({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(Au,{uuid:t,hint:r,label:i,children:k.jsx(cg,{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 LTe({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(Au,{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(fg,{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 PTe({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(vh,{id:t,checked:e,size:"xs",onChange:l=>{s(t,l.target.checked)},disabled:n});return r!=null&&(o=k.jsx(Pr,{zIndex:100,label:r,multiline:!0,style:{width:"15rem"},withArrow:!0,openDelay:500,withinPortal:!0,children:k.jsx(ct,{style:{display:"inline-block"},children:o})})),k.jsx(Au,{uuid:t,label:a,children:o})}function UTe({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(Au,{uuid:t,hint:n,label:i,children:k.jsx(sQ,{uuid:t,n:2,value:e,onChange:f=>u(t,f),min:s,max:o,step:l,precision:c,disabled:a})}):null}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(Au,{uuid:t,hint:n,label:i,children:k.jsx(sQ,{uuid:t,n:3,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,disabled:r,visible:a,options:s}}){const{setValue:o}=I.useContext(Ls);return a?k.jsx(Au,{uuid:t,hint:n,label:i,children:k.jsx(Bv,{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 zTe={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 ar=(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,...zTe[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 jTe=[["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"}]],HTe=ar("outline","adjustments","Adjustments",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 VTe=[["path",{d:"M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1",key:"svg-0"}]],GTe=ar("outline","arrow-back","ArrowBack",VTe);/**
 * @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 WTe=[["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"}]],qTe=ar("outline","brand-github","BrandGithub",WTe);/**
 * @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 XTe=[["path",{d:"M6 10l6 6l6 -6h-12",key:"svg-0"}]],KTe=ar("outline","caret-down","CaretDown",XTe);/**
 * @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 YTe=[["path",{d:"M10 18l6 -6l-6 -6v12",key:"svg-0"}]],JTe=ar("outline","caret-right","CaretRight",YTe);/**
 * @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 $Te=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],FU=ar("outline","check","Check",$Te);/**
 * @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:"M6 9l6 6l6 -6",key:"svg-0"}]],QTe=ar("outline","chevron-down","ChevronDown",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 eAe=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],tAe=ar("outline","chevron-left","ChevronLeft",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 nAe=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],iAe=ar("outline","chevron-right","ChevronRight",nAe);/**
 * @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:"M6 15l6 -6l6 6",key:"svg-0"}]],aAe=ar("outline","chevron-up","ChevronUp",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 sAe=[["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"}]],oAe=ar("outline","cloud-check","CloudCheck",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 lAe=[["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"}]],oQ=ar("outline","color-picker","ColorPicker",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 cAe=[["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"}]],uAe=ar("outline","copy","Copy",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 fAe=[["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"}]],hAe=ar("outline","device-floppy","DeviceFloppy",fAe);/**
 * @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:"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"}]],pAe=ar("outline","download","Download",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 mAe=[["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"}]],gAe=ar("outline","eye-off","EyeOff",mAe);/**
 * @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:"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"}]],vAe=ar("outline","eye-x","EyeX",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 yAe=[["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"}]],xAe=ar("outline","eye","Eye",yAe);/**
 * @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 _Ae=[["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"}]],SAe=ar("outline","file-description","FileDescription",_Ae);/**
 * @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 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"}]],EAe=ar("outline","home-move","HomeMove",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 MAe=[["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"}]],TAe=ar("outline","keyboard","Keyboard",MAe);/**
 * @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:"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"}]],lQ=ar("outline","maximize","Maximize",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 CAe=[["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"}]],RAe=ar("outline","pencil","Pencil",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 kAe=[["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"}]],DAe=ar("outline","photo","Photo",kAe);/**
 * @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:"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"}]],IAe=ar("outline","plug-connected-x","PlugConnectedX",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 NAe=[["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"}]],LAe=ar("outline","qrcode-off","QrcodeOff",NAe);/**
 * @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 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"}]],UAe=ar("outline","qrcode","Qrcode",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 FAe=[["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"}]],BAe=ar("outline","share","Share",FAe);/**
 * @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 zAe=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],jAe=ar("outline","x","X",zAe);/**
 * @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:"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"}]],VAe=ar("filled","player-pause-filled","PlayerPauseFilled",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 GAe=[["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"}]],WAe=ar("filled","player-play-filled","PlayerPlayFilled",GAe);function qAe({uuid:t,value:e,props:{label:n,hint:i,disabled:r,visible:a}}){const{setValue:s}=I.useContext(Ls),[o,l]=I.useState(U6(e));return I.useEffect(()=>{const c=kx(o);(!c||!kD(c,e))&&l(U6(e))},[e]),a?k.jsx(Au,{uuid:t,hint:i,label:n,children:k.jsx(Uv,{disabled:r,size:"xs",value:o,format:"rgb",eyeDropperIcon:k.jsx(oQ,{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=kx(c);u&&!kD(u,e)&&s(t,u)}},onKeyDown:c=>{if(c.key==="Enter"){const u=kx(o);u&&s(t,u)}},onBlur:()=>{const c=kx(o);c&&!kD(c,e)&&s(t,c)}})}):null}function XAe({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=bE(o);(!c||!DD(c,e))&&l(F6(e))},[e,o]),a?k.jsx(Au,{uuid:t,hint:i,label:n,children:k.jsx(Uv,{disabled:r,size:"xs",value:o,format:"rgba",eyeDropperIcon:k.jsx(oQ,{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 KAe({uuid:t,props:{hint:e,label:n,visible:i,disabled:r,options:a}}){const{messageSender:s}=I.useContext(Ls);return i?k.jsx(Au,{uuid:t,hint:e,label:n,children:k.jsx(bh,{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={},cQ=Ce.createContext(SI);function uQ(t){const e=Ce.useContext(cQ);return Ce.useMemo(function(){return typeof t=="function"?t(e):{...e,...t}},[e,t])}function YAe(t){let e;return t.disableParentContext?e=typeof t.components=="function"?t.components(SI):t.components||SI:e=uQ(t.components),Ce.createElement(cQ.Provider,{value:e},t.children)}const JAe=Object.freeze(Object.defineProperty({__proto__:null,MDXProvider:YAe,useMDXComponents:uQ},Symbol.toStringTag,{value:"Module"}));function xc(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?B6(t.position):"start"in t||"end"in t?B6(t):"line"in t||"column"in t?wI(t):""}function wI(t){return z6(t&&t.line)+":"+z6(t&&t.column)}function B6(t){return wI(t&&t.start)+"-"+wI(t&&t.end)}function z6(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=xc(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 Hu={basename:$Ae,dirname:ZAe,extname:QAe,join:eCe,sep:"/"};function $Ae(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');tS(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 ZAe(t){if(tS(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 QAe(t){tS(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 eCe(...t){let e=-1,n;for(;++e<t.length;)tS(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":tCe(n)}function tCe(t){tS(t);const e=t.codePointAt(0)===47;let n=nCe(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function nCe(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 tS(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const iCe={cwd:rCe};function rCe(){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 aCe(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 sCe(t)}function sCe(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 fQ{constructor(e){let n;e?EI(e)?n={path:e}:typeof e=="string"||oCe(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":iCe.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"?Hu.basename(this.path):void 0}set basename(e){ND(e,"basename"),ID(e,"basename"),this.path=Hu.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Hu.dirname(this.path):void 0}set dirname(e){j6(this.basename,"dirname"),this.path=Hu.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Hu.extname(this.path):void 0}set extname(e){if(ID(e,"extname"),j6(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=Hu.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){EI(e)&&(e=aCe(e)),ND(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Hu.basename(this.path,this.extname):void 0}set stem(e){ND(e,"stem"),ID(e,"stem"),this.path=Hu.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(Hu.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Hu.sep+"`")}function ND(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function j6(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function oCe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const lCe=["md","markdown","mdown","mkdn","mkd","mdwn","mkdown","ron"],cCe=lCe.map(function(t){return"."+t});function uCe(t,e){const n=fCe(t)?t:new fQ(t),{format:i,...r}=e||{};return{file:n,options:{format:i==="md"||i==="mdx"?i:n.extname&&(r.mdExtensions||cCe).includes(n.extname)?"md":"mdx",...r}}}function fCe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}const hCe=/[$_\p{ID_Start}]/u,dCe=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,pCe=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,mCe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gCe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hQ={};function Yc(t){return t?hCe.test(String.fromCodePoint(t)):!1}function sx(t,e){const i=(e||hQ).jsx?pCe:dCe;return t?i.test(String.fromCodePoint(t)):!1}function sf(t,e){return((e||hQ).jsx?gCe:mCe).test(t)}class bCe{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 vCe extends bCe{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];H6(c)&&(this.visit(c,e,a,l)||l--)}}else H6(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 H6(t){return t!==null&&typeof t=="object"&&"type"in t&&typeof t.type=="string"}function M0(t,{enter:e,leave:n}){return new vCe(e,n).visit(t,null)}const LD=/@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g;function yCe(t,e){const n=e||{};let i=n.runtime==="automatic";const r={},a={};M0(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 m=s.body[y];if("directive"in m&&m.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 m={type:"Literal",value:y};h1(b,m),o.push(m)}}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};h1(c,x),c=x}let b;const y=s.openingElement.attributes;let m=-1;for(;++m<y.length;){const x=y[m];if(x.type==="JSXSpreadAttribute")x.argument.type==="ObjectExpression"?u.push(...x.argument.properties):u.push({type:"SpreadElement",argument:x.argument}),b=!0;else{const _=xCe(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=V6(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=V6(r.jsx||n.pragma||"React.createElement");f.unshift(c);const g={type:"CallExpression",callee:d,arguments:f,optional:!1};h1(s,g),this.replace(g)}})}function xCe(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 h1(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=sf(t.name)?{type:"Identifier",name:t.name}:{type:"Literal",value:t.name};return h1(t,e),e}function V6(t){const e=t.split(".");let n=-1,i;for(;++n<e.length;){const r=sf(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 h1(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 _Ce(t){return function(e,n){yCe(e,{filePath:n.history[0],...t})}}var dQ={exports:{}},SCe={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:{}},G6;function MI(){return G6||(G6=1,function(t,e){(function(n,i){i(e)})(Fm,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,N){for(var Y=65536,re=0;re<N.length;re+=2){if(Y+=N[re],Y>E)return!1;if(Y+=N[re+1],Y>=E)return!0}return!1}function g(E,N){return E<65?E===36:E<91?!0:E<97?E===95:E<123?!0:E<=65535?E>=170&&f.test(String.fromCharCode(E)):N===!1?!1:d(E,r)}function b(E,N){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)):N===!1?!1:d(E,r)||d(E,i)}var y=function(N,Y){Y===void 0&&(Y={}),this.label=N,this.keyword=Y.keyword,this.beforeExpr=!!Y.beforeExpr,this.startsExpr=!!Y.startsExpr,this.isLoop=!!Y.isLoop,this.isAssign=!!Y.isAssign,this.prefix=!!Y.prefix,this.postfix=!!Y.postfix,this.binop=Y.binop||null,this.updateContext=null};function m(E,N){return new y(E,{beforeExpr:!0,binop:N})}var x={beforeExpr:!0},_={startsExpr:!0},w={};function M(E,N){return N===void 0&&(N={}),N.keyword=E,w[E]=new y(E,N)}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:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("</>/<=/>=",7),bitShift:m("<</>>/>>>",8),plusMin:new y("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new y("**",{beforeExpr:!0}),coalesce:m("??",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,N,Y){Y===void 0&&(Y=E.length);for(var re=N;re<Y;re++){var ye=E.charCodeAt(re);if(D(ye))return re<Y-1&&ye===13&&E.charCodeAt(re+1)===10?re+2:re+1}return-1}var L=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,U=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,j=Object.prototype,z=j.hasOwnProperty,q=j.toString,F=Object.hasOwn||function(E,N){return z.call(E,N)},V=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 B(E){return E<=65535?String.fromCharCode(E):(E-=65536,String.fromCharCode((E>>10)+55296,(E&1023)+56320))}var J=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Z=function(N,Y){this.line=N,this.column=Y};Z.prototype.offset=function(N){return new Z(this.line,this.column+N)};var G=function(N,Y,re){this.start=Y,this.end=re,N.sourceFile!==null&&(this.source=N.sourceFile)};function de(E,N){for(var Y=1,re=0;;){var ye=R(E,re,N);if(ye<0)return new Z(Y,N-re);++Y,re=ye}}var oe={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},le=!1;function ue(E){var N={};for(var Y in oe)N[Y]=E&&F(E,Y)?E[Y]:oe[Y];if(N.ecmaVersion==="latest"?N.ecmaVersion=1e8:N.ecmaVersion==null?(!le&&typeof console=="object"&&console.warn&&(le=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
Defaulting to 2020, but this will stop working in the future.`)),N.ecmaVersion=11):N.ecmaVersion>=2015&&(N.ecmaVersion-=2009),N.allowReserved==null&&(N.allowReserved=N.ecmaVersion<5),(!E||E.allowHashBang==null)&&(N.allowHashBang=N.ecmaVersion>=14),V(N.onToken)){var re=N.onToken;N.onToken=function(ye){return re.push(ye)}}return V(N.onComment)&&(N.onComment=Se(N,N.onComment)),N}function Se(E,N){return function(Y,re,ye,$e,tt,Lt){var zt={type:Y?"Block":"Line",value:re,start:ye,end:$e};E.locations&&(zt.loc=new G(this,tt,Lt)),E.ranges&&(zt.range=[ye,$e]),N.push(zt)}}var Oe=1,Be=2,je=4,He=8,pe=16,ze=32,Ie=64,qe=128,we=256,Me=512,Ae=Oe|Be|we;function Ne(E,N){return Be|(E?je:0)|(N?He:0)}var Ue=0,Qe=1,ae=2,K=3,ce=4,he=5,me=function(N,Y,re){this.options=N=ue(N),this.sourceFile=N.sourceFile,this.keywords=W(c[N.ecmaVersion>=6?6:N.sourceType==="module"?"5module":5]);var ye="";N.allowReserved!==!0&&(ye=o[N.ecmaVersion>=6?6:N.ecmaVersion===5?5:3],N.sourceType==="module"&&(ye+=" await")),this.reservedWords=W(ye);var $e=(ye?ye+" ":"")+o.strict;this.reservedWordsStrict=W($e),this.reservedWordsStrictBind=W($e+" "+o.strictBind),this.input=String(Y),this.containsEsc=!1,re?(this.pos=re,this.lineStart=this.input.lastIndexOf(`
`,re-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=N.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&&N.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Oe),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 N=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(N)},$.inFunction.get=function(){return(this.currentVarScope().flags&Be)>0},$.inGenerator.get=function(){return(this.currentVarScope().flags&He)>0},$.inAsync.get=function(){return(this.currentVarScope().flags&je)>0},$.canAwait.get=function(){for(var E=this.scopeStack.length-1;E>=0;E--){var N=this.scopeStack[E],Y=N.flags;if(Y&(we|Me))return!1;if(Y&Be)return(Y&je)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},$.allowSuper.get=function(){var E=this.currentThisScope(),N=E.flags;return(N&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 N=this.scopeStack[E],Y=N.flags;if(Y&(we|Me)||Y&Be&&!(Y&pe))return!0}return!1},$.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&we)>0},me.extend=function(){for(var N=[],Y=arguments.length;Y--;)N[Y]=arguments[Y];for(var re=this,ye=0;ye<N.length;ye++)re=N[ye](re);return re},me.parse=function(N,Y){return new this(Y,N).parse()},me.parseExpressionAt=function(N,Y,re){var ye=new this(re,N,Y);return ye.nextToken(),ye.parseExpression()},me.tokenizer=function(N,Y){return new this(Y,N)},Object.defineProperties(me.prototype,$);var Ve=me.prototype,Xe=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Ve.strictDirective=function(E){if(this.options.ecmaVersion<5)return!1;for(;;){U.lastIndex=E,E+=U.exec(this.input)[0].length;var N=Xe.exec(this.input.slice(E));if(!N)return!1;if((N[1]||N[2])==="use strict"){U.lastIndex=E+N[0].length;var Y=U.exec(this.input),re=Y.index+Y[0].length,ye=this.input.charAt(re);return ye===";"||ye==="}"||A.test(Y[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(ye)||ye==="!"&&this.input.charAt(re+1)==="=")}E+=N[0].length,U.lastIndex=E,E+=U.exec(this.input)[0].length,this.input[E]===";"&&E++}},Ve.eat=function(E){return this.type===E?(this.next(),!0):!1},Ve.isContextual=function(E){return this.type===S.name&&this.value===E&&!this.containsEsc},Ve.eatContextual=function(E){return this.isContextual(E)?(this.next(),!0):!1},Ve.expectContextual=function(E){this.eatContextual(E)||this.unexpected()},Ve.canInsertSemicolon=function(){return this.type===S.eof||this.type===S.braceR||A.test(this.input.slice(this.lastTokEnd,this.start))},Ve.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Ve.semicolon=function(){!this.eat(S.semi)&&!this.insertSemicolon()&&this.unexpected()},Ve.afterTrailingComma=function(E,N){if(this.type===E)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),N||this.next(),!0},Ve.expect=function(E){this.eat(E)||this.unexpected()},Ve.unexpected=function(E){this.raise(E??this.start,"Unexpected token")};var mt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Ve.checkPatternErrors=function(E,N){if(E){E.trailingComma>-1&&this.raiseRecoverable(E.trailingComma,"Comma is not permitted after the rest element");var Y=N?E.parenthesizedAssign:E.parenthesizedBind;Y>-1&&this.raiseRecoverable(Y,N?"Assigning to rvalue":"Parenthesized pattern")}},Ve.checkExpressionErrors=function(E,N){if(!E)return!1;var Y=E.shorthandAssign,re=E.doubleProto;if(!N)return Y>=0||re>=0;Y>=0&&this.raise(Y,"Shorthand property assignments are valid only in destructuring patterns"),re>=0&&this.raiseRecoverable(re,"Redefinition of __proto__ property")},Ve.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")},Ve.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 N=Object.create(null);for(E.body||(E.body=[]);this.type!==S.eof;){var Y=this.parseStatement(null,!0,N);E.body.push(Y)}if(this.inModule)for(var re=0,ye=Object.keys(this.undefinedExports);re<ye.length;re+=1){var $e=ye[re];this.raiseRecoverable(this.undefinedExports[$e].start,"Export '"+$e+"' is not defined")}return this.adaptDirectivePrologue(E.body),this.next(),E.sourceType=this.options.sourceType,this.finishNode(E,"Program")};var Je={kind:"loop"},Ye={kind:"switch"};Ge.isLet=function(E){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;U.lastIndex=this.pos;var N=U.exec(this.input),Y=this.pos+N[0].length,re=this.input.charCodeAt(Y);if(re===91||re===92)return!0;if(E)return!1;if(re===123||re>55295&&re<56320)return!0;if(g(re,!0)){for(var ye=Y+1;b(re=this.input.charCodeAt(ye),!0);)++ye;if(re===92||re>55295&&re<56320)return!0;var $e=this.input.slice(Y,ye);if(!u.test($e))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),N=this.pos+E[0].length,Y;return!A.test(this.input.slice(this.pos,N))&&this.input.slice(N,N+8)==="function"&&(N+8===this.input.length||!(b(Y=this.input.charCodeAt(N+8))||Y>55295&&Y<56320))},Ge.isUsingKeyword=function(E,N){if(this.options.ecmaVersion<17||!this.isContextual(E?"await":"using"))return!1;U.lastIndex=this.pos;var Y=U.exec(this.input),re=this.pos+Y[0].length;if(A.test(this.input.slice(this.pos,re)))return!1;if(E){var ye=re+5,$e;if(this.input.slice(re,ye)!=="using"||ye===this.input.length||b($e=this.input.charCodeAt(ye))||$e>55295&&$e<56320)return!1;U.lastIndex=ye;var tt=U.exec(this.input);if(tt&&A.test(this.input.slice(ye,ye+tt[0].length)))return!1}if(N){var Lt=re+2,zt;if(this.input.slice(re,Lt)==="of"&&(Lt===this.input.length||!b(zt=this.input.charCodeAt(Lt))&&!(zt>55295&&zt<56320)))return!1}var gn=this.input.charCodeAt(re);return g(gn,!0)||gn===92},Ge.isAwaitUsing=function(E){return this.isUsingKeyword(!0,E)},Ge.isUsing=function(E){return this.isUsingKeyword(!1,E)},Ge.parseStatement=function(E,N,Y){var re=this.type,ye=this.startNode(),$e;switch(this.isLet(E)&&(re=S._var,$e="let"),re){case S._break:case S._continue:return this.parseBreakContinueStatement(ye,re.keyword);case S._debugger:return this.parseDebuggerStatement(ye);case S._do:return this.parseDoStatement(ye);case S._for:return this.parseForStatement(ye);case S._function:return E&&(this.strict||E!=="if"&&E!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(ye,!1,!E);case S._class:return E&&this.unexpected(),this.parseClass(ye,!0);case S._if:return this.parseIfStatement(ye);case S._return:return this.parseReturnStatement(ye);case S._switch:return this.parseSwitchStatement(ye);case S._throw:return this.parseThrowStatement(ye);case S._try:return this.parseTryStatement(ye);case S._const:case S._var:return $e=$e||this.value,E&&$e!=="var"&&this.unexpected(),this.parseVarStatement(ye,$e);case S._while:return this.parseWhileStatement(ye);case S._with:return this.parseWithStatement(ye);case S.braceL:return this.parseBlock(!0,ye);case S.semi:return this.parseEmptyStatement(ye);case S._export:case S._import:if(this.options.ecmaVersion>10&&re===S._import){U.lastIndex=this.pos;var tt=U.exec(this.input),Lt=this.pos+tt[0].length,zt=this.input.charCodeAt(Lt);if(zt===40||zt===46)return this.parseExpressionStatement(ye,this.parseExpression())}return this.options.allowImportExportEverywhere||(N||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'")),re===S._import?this.parseImport(ye):this.parseExport(ye,Y);default:if(this.isAsyncFunction())return E&&this.unexpected(),this.next(),this.parseFunctionStatement(ye,!0,!E);var gn=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(gn)return N&&this.options.sourceType==="script"&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),gn==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(ye,!1,gn),this.semicolon(),this.finishNode(ye,"VariableDeclaration");var En=this.value,Ei=this.parseExpression();return re===S.name&&Ei.type==="Identifier"&&this.eat(S.colon)?this.parseLabeledStatement(ye,En,Ei,E):this.parseExpressionStatement(ye,Ei)}},Ge.parseBreakContinueStatement=function(E,N){var Y=N==="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 re=0;re<this.labels.length;++re){var ye=this.labels[re];if((E.label==null||ye.name===E.label.name)&&(ye.kind!=null&&(Y||ye.kind==="loop")||E.label&&Y))break}return re===this.labels.length&&this.raise(E.start,"Unsyntactic "+N),this.finishNode(E,Y?"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 N=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 N>-1&&this.unexpected(N),this.parseFor(E,null);var Y=this.isLet();if(this.type===S._var||this.type===S._const||Y){var re=this.startNode(),ye=Y?"let":this.value;return this.next(),this.parseVar(re,!0,ye),this.finishNode(re,"VariableDeclaration"),this.parseForAfterInit(E,re,N)}var $e=this.isContextual("let"),tt=!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,N)}var gn=this.containsEsc,En=new mt,Ei=this.start,Cn=N>-1?this.parseExprSubscripts(En,"await"):this.parseExpression(!0,En);return this.type===S._in||(tt=this.options.ecmaVersion>=6&&this.isContextual("of"))?(N>-1?(this.type===S._in&&this.unexpected(N),E.await=!0):tt&&this.options.ecmaVersion>=8&&(Cn.start===Ei&&!gn&&Cn.type==="Identifier"&&Cn.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(E.await=!1)),$e&&tt&&this.raise(Cn.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Cn,!1,En),this.checkLValPattern(Cn),this.parseForIn(E,Cn)):(this.checkExpressionErrors(En,!0),N>-1&&this.unexpected(N),this.parseFor(E,Cn))},Ge.parseForAfterInit=function(E,N,Y){return(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&N.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===S._in?Y>-1&&this.unexpected(Y):E.await=Y>-1),this.parseForIn(E,N)):(Y>-1&&this.unexpected(Y),this.parseFor(E,N))},Ge.parseFunctionStatement=function(E,N,Y){return this.next(),this.parseFunction(E,Mt|(Y?0:gt),!1,N)},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(Ye),this.enterScope(0);for(var N,Y=!1;this.type!==S.braceR;)if(this.type===S._case||this.type===S._default){var re=this.type===S._case;N&&this.finishNode(N,"SwitchCase"),E.cases.push(N=this.startNode()),N.consequent=[],this.next(),re?N.test=this.parseExpression():(Y&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),Y=!0,N.test=null),this.expect(S.colon)}else N||this.unexpected(),N.consequent.push(this.parseStatement(null));return this.exitScope(),N&&this.finishNode(N,"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 vt=[];Ge.parseCatchClauseParam=function(){var E=this.parseBindingAtom(),N=E.type==="Identifier";return this.enterScope(N?ze:0),this.checkLValPattern(E,N?ce:ae),this.expect(S.parenR),E},Ge.parseTryStatement=function(E){if(this.next(),E.block=this.parseBlock(),E.handler=null,this.type===S._catch){var N=this.startNode();this.next(),this.eat(S.parenL)?N.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),N.param=null,this.enterScope(0)),N.body=this.parseBlock(!1),this.exitScope(),E.handler=this.finishNode(N,"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,N,Y){return this.next(),this.parseVar(E,!1,N,Y),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,N,Y,re){for(var ye=0,$e=this.labels;ye<$e.length;ye+=1){var tt=$e[ye];tt.name===N&&this.raise(Y.start,"Label '"+N+"' 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 gn=this.labels[zt];if(gn.statementStart===E.start)gn.statementStart=this.start,gn.kind=Lt;else break}return this.labels.push({name:N,kind:Lt,statementStart:this.start}),E.body=this.parseStatement(re?re.indexOf("label")===-1?re+"label":re:"label"),this.labels.pop(),E.label=Y,this.finishNode(E,"LabeledStatement")},Ge.parseExpressionStatement=function(E,N){return E.expression=N,this.semicolon(),this.finishNode(E,"ExpressionStatement")},Ge.parseBlock=function(E,N,Y){for(E===void 0&&(E=!0),N===void 0&&(N=this.startNode()),N.body=[],this.expect(S.braceL),E&&this.enterScope(0);this.type!==S.braceR;){var re=this.parseStatement(null);N.body.push(re)}return Y&&(this.strict=!1),this.next(),E&&this.exitScope(),this.finishNode(N,"BlockStatement")},Ge.parseFor=function(E,N){return E.init=N,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,N){var Y=this.type===S._in;return this.next(),N.type==="VariableDeclaration"&&N.declarations[0].init!=null&&(!Y||this.options.ecmaVersion<8||this.strict||N.kind!=="var"||N.declarations[0].id.type!=="Identifier")&&this.raise(N.start,(Y?"for-in":"for-of")+" loop variable declaration may not have an initializer"),E.left=N,E.right=Y?this.parseExpression():this.parseMaybeAssign(),this.expect(S.parenR),E.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(E,Y?"ForInStatement":"ForOfStatement")},Ge.parseVar=function(E,N,Y,re){for(E.declarations=[],E.kind=Y;;){var ye=this.startNode();if(this.parseVarId(ye,Y),this.eat(S.eq)?ye.init=this.parseMaybeAssign(N):!re&&Y==="const"&&!(this.type===S._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!re&&(Y==="using"||Y==="await using")&&this.options.ecmaVersion>=17&&this.type!==S._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+Y+" declaration"):!re&&ye.id.type!=="Identifier"&&!(N&&(this.type===S._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):ye.init=null,E.declarations.push(this.finishNode(ye,"VariableDeclarator")),!this.eat(S.comma))break}return E},Ge.parseVarId=function(E,N){E.id=N==="using"||N==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(E.id,N==="var"?Qe:ae,!1)};var Mt=1,gt=2,kt=4;Ge.parseFunction=function(E,N,Y,re,ye){this.initFunction(E),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!re)&&(this.type===S.star&&N&gt&&this.unexpected(),E.generator=this.eat(S.star)),this.options.ecmaVersion>=8&&(E.async=!!re),N&Mt&&(E.id=N&kt&&this.type!==S.name?null:this.parseIdent(),E.id&&!(N&gt)&&this.checkLValSimple(E.id,this.strict||E.generator||E.async?this.treatFunctionsAsVar?Qe:ae:K));var $e=this.yieldPos,tt=this.awaitPos,Lt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ne(E.async,E.generator)),N&Mt||(E.id=this.type===S.name?this.parseIdent():null),this.parseFunctionParams(E),this.parseFunctionBody(E,Y,!1,ye),this.yieldPos=$e,this.awaitPos=tt,this.awaitIdentPos=Lt,this.finishNode(E,N&Mt?"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,N){this.next();var Y=this.strict;this.strict=!0,this.parseClassId(E,N),this.parseClassSuper(E);var re=this.enterClassBody(),ye=this.startNode(),$e=!1;for(ye.body=[],this.expect(S.braceL);this.type!==S.braceR;){var tt=this.parseClassElement(E.superClass!==null);tt&&(ye.body.push(tt),tt.type==="MethodDefinition"&&tt.kind==="constructor"?($e&&this.raiseRecoverable(tt.start,"Duplicate constructor in the same class"),$e=!0):tt.key&&tt.key.type==="PrivateIdentifier"&&Re(re,tt)&&this.raiseRecoverable(tt.key.start,"Identifier '#"+tt.key.name+"' has already been declared"))}return this.strict=Y,this.next(),E.body=this.finishNode(ye,"ClassBody"),this.exitClassBody(),this.finishNode(E,N?"ClassDeclaration":"ClassExpression")},Ge.parseClassElement=function(E){if(this.eat(S.semi))return null;var N=this.options.ecmaVersion,Y=this.startNode(),re="",ye=!1,$e=!1,tt="method",Lt=!1;if(this.eatContextual("static")){if(N>=13&&this.eat(S.braceL))return this.parseClassStaticBlock(Y),Y;this.isClassElementNameStart()||this.type===S.star?Lt=!0:re="static"}if(Y.static=Lt,!re&&N>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===S.star)&&!this.canInsertSemicolon()?$e=!0:re="async"),!re&&(N>=9||!$e)&&this.eat(S.star)&&(ye=!0),!re&&!$e&&!ye){var zt=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?tt=zt:re=zt)}if(re?(Y.computed=!1,Y.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Y.key.name=re,this.finishNode(Y.key,"Identifier")):this.parseClassElementName(Y),N<13||this.type===S.parenL||tt!=="method"||ye||$e){var gn=!Y.static&&Le(Y,"constructor"),En=gn&&E;gn&&tt!=="method"&&this.raise(Y.key.start,"Constructor can't have get/set modifier"),Y.kind=gn?"constructor":tt,this.parseClassMethod(Y,ye,$e,En)}else this.parseClassField(Y);return Y},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,N,Y,re){var ye=E.key;E.kind==="constructor"?(N&&this.raise(ye.start,"Constructor can't be a generator"),Y&&this.raise(ye.start,"Constructor can't be an async method")):E.static&&Le(E,"prototype")&&this.raise(ye.start,"Classes may not have a static property named prototype");var $e=E.value=this.parseMethod(N,Y,re);return E.kind==="get"&&$e.params.length!==0&&this.raiseRecoverable($e.start,"getter should have no params"),E.kind==="set"&&$e.params.length!==1&&this.raiseRecoverable($e.start,"setter should have exactly one param"),E.kind==="set"&&$e.params[0].type==="RestElement"&&this.raiseRecoverable($e.params[0].start,"Setter cannot use rest params"),this.finishNode(E,"MethodDefinition")},Ge.parseClassField=function(E){return Le(E,"constructor")?this.raise(E.key.start,"Classes can't have a field named 'constructor'"):E.static&&Le(E,"prototype")&&this.raise(E.key.start,"Classes can't have a static field named 'prototype'"),this.eat(S.eq)?(this.enterScope(Me|Ie),E.value=this.parseMaybeAssign(),this.exitScope()):E.value=null,this.semicolon(),this.finishNode(E,"PropertyDefinition")},Ge.parseClassStaticBlock=function(E){E.body=[];var N=this.labels;for(this.labels=[],this.enterScope(we|Ie);this.type!==S.braceR;){var Y=this.parseStatement(null);E.body.push(Y)}return this.next(),this.exitScope(),this.labels=N,this.finishNode(E,"StaticBlock")},Ge.parseClassId=function(E,N){this.type===S.name?(E.id=this.parseIdent(),N&&this.checkLValSimple(E.id,ae,!1)):(N===!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(),N=E.declared,Y=E.used;if(this.options.checkPrivateFields)for(var re=this.privateNameStack.length,ye=re===0?null:this.privateNameStack[re-1],$e=0;$e<Y.length;++$e){var tt=Y[$e];F(N,tt.name)||(ye?ye.used.push(tt):this.raiseRecoverable(tt.start,"Private field '#"+tt.name+"' must be declared in an enclosing class"))}};function Re(E,N){var Y=N.key.name,re=E[Y],ye="true";return N.type==="MethodDefinition"&&(N.kind==="get"||N.kind==="set")&&(ye=(N.static?"s":"i")+N.kind),re==="iget"&&ye==="iset"||re==="iset"&&ye==="iget"||re==="sget"&&ye==="sset"||re==="sset"&&ye==="sget"?(E[Y]="true",!1):re?!0:(E[Y]=ye,!1)}function Le(E,N){var Y=E.computed,re=E.key;return!Y&&(re.type==="Identifier"&&re.name===N||re.type==="Literal"&&re.value===N)}Ge.parseExportAllDeclaration=function(E,N){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(E.exported=this.parseModuleExportName(),this.checkExport(N,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,N){if(this.next(),this.eat(S.star))return this.parseExportAllDeclaration(E,N);if(this.eat(S._default))return this.checkExport(N,"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(N,E.declaration.declarations):this.checkExport(N,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(N),this.eatContextual("from"))this.type!==S.string&&this.unexpected(),E.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(E.attributes=this.parseWithClause());else{for(var Y=0,re=E.specifiers;Y<re.length;Y+=1){var ye=re[Y];this.checkUnreserved(ye.local),this.checkLocalExport(ye.local),ye.local.type==="Literal"&&this.raise(ye.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 N=this.startNode();return this.next(),E&&this.next(),this.parseFunction(N,Mt|kt,!1,E)}else if(this.type===S._class){var Y=this.startNode();return this.parseClass(Y,"nullableID")}else{var re=this.parseMaybeAssign();return this.semicolon(),re}},Ge.checkExport=function(E,N,Y){E&&(typeof N!="string"&&(N=N.type==="Identifier"?N.name:N.value),F(E,N)&&this.raiseRecoverable(Y,"Duplicate export '"+N+"'"),E[N]=!0)},Ge.checkPatternExport=function(E,N){var Y=N.type;if(Y==="Identifier")this.checkExport(E,N,N.start);else if(Y==="ObjectPattern")for(var re=0,ye=N.properties;re<ye.length;re+=1){var $e=ye[re];this.checkPatternExport(E,$e)}else if(Y==="ArrayPattern")for(var tt=0,Lt=N.elements;tt<Lt.length;tt+=1){var zt=Lt[tt];zt&&this.checkPatternExport(E,zt)}else Y==="Property"?this.checkPatternExport(E,N.value):Y==="AssignmentPattern"?this.checkPatternExport(E,N.left):Y==="RestElement"&&this.checkPatternExport(E,N.argument)},Ge.checkVariableExport=function(E,N){if(E)for(var Y=0,re=N;Y<re.length;Y+=1){var ye=re[Y];this.checkPatternExport(E,ye.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 N=this.startNode();return N.local=this.parseModuleExportName(),N.exported=this.eatContextual("as")?this.parseModuleExportName():N.local,this.checkExport(E,N.exported,N.exported.start),this.finishNode(N,"ExportSpecifier")},Ge.parseExportSpecifiers=function(E){var N=[],Y=!0;for(this.expect(S.braceL);!this.eat(S.braceR);){if(Y)Y=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;N.push(this.parseExportSpecifier(E))}return N},Ge.parseImport=function(E){return this.next(),this.type===S.string?(E.specifiers=vt,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,ae),this.finishNode(E,"ImportSpecifier")},Ge.parseImportDefaultSpecifier=function(){var E=this.startNode();return E.local=this.parseIdent(),this.checkLValSimple(E.local,ae),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,ae),this.finishNode(E,"ImportNamespaceSpecifier")},Ge.parseImportSpecifiers=function(){var E=[],N=!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(N)N=!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 N={},Y=!0;!this.eat(S.braceR);){if(Y)Y=!1;else if(this.expect(S.comma),this.afterTrailingComma(S.braceR))break;var re=this.parseImportAttribute(),ye=re.key.type==="Identifier"?re.key.name:re.key.value;F(N,ye)&&this.raiseRecoverable(re.key.start,"Duplicate attribute key '"+ye+"'"),N[ye]=!0,E.push(re)}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 J.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 N=0;N<E.length&&this.isDirectiveCandidate(E[N]);++N)E[N].directive=E[N].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,N,Y){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",Y&&this.checkPatternErrors(Y,!0);for(var re=0,ye=E.properties;re<ye.length;re+=1){var $e=ye[re];this.toAssignable($e,N),$e.type==="RestElement"&&($e.argument.type==="ArrayPattern"||$e.argument.type==="ObjectPattern")&&this.raise($e.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,N);break;case"ArrayExpression":E.type="ArrayPattern",Y&&this.checkPatternErrors(Y,!0),this.toAssignableList(E.elements,N);break;case"SpreadElement":E.type="RestElement",this.toAssignable(E.argument,N),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,N);break;case"ParenthesizedExpression":this.toAssignable(E.expression,N,Y);break;case"ChainExpression":this.raiseRecoverable(E.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!N)break;default:this.raise(E.start,"Assigning to rvalue")}else Y&&this.checkPatternErrors(Y,!0);return E},ht.toAssignableList=function(E,N){for(var Y=E.length,re=0;re<Y;re++){var ye=E[re];ye&&this.toAssignable(ye,N)}if(Y){var $e=E[Y-1];this.options.ecmaVersion===6&&N&&$e&&$e.type==="RestElement"&&$e.argument.type!=="Identifier"&&this.unexpected($e.argument.start)}return E},ht.parseSpread=function(E){var N=this.startNode();return this.next(),N.argument=this.parseMaybeAssign(!1,E),this.finishNode(N,"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,N,Y,re){for(var ye=[],$e=!0;!this.eat(E);)if($e?$e=!1:this.expect(S.comma),N&&this.type===S.comma)ye.push(null);else{if(Y&&this.afterTrailingComma(E))break;if(this.type===S.ellipsis){var tt=this.parseRestBinding();this.parseBindingListItem(tt),ye.push(tt),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(E);break}else ye.push(this.parseAssignableListItem(re))}return ye},ht.parseAssignableListItem=function(E){var N=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(N),N},ht.parseBindingListItem=function(E){return E},ht.parseMaybeDefault=function(E,N,Y){if(Y=Y||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(S.eq))return Y;var re=this.startNodeAt(E,N);return re.left=Y,re.right=this.parseMaybeAssign(),this.finishNode(re,"AssignmentPattern")},ht.checkLValSimple=function(E,N,Y){N===void 0&&(N=Ue);var re=N!==Ue;switch(E.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(E.name)&&this.raiseRecoverable(E.start,(re?"Binding ":"Assigning to ")+E.name+" in strict mode"),re&&(N===ae&&E.name==="let"&&this.raiseRecoverable(E.start,"let is disallowed as a lexically bound name"),Y&&(F(Y,E.name)&&this.raiseRecoverable(E.start,"Argument name clash"),Y[E.name]=!0),N!==he&&this.declareName(E.name,N,E.start));break;case"ChainExpression":this.raiseRecoverable(E.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":re&&this.raiseRecoverable(E.start,"Binding member expression");break;case"ParenthesizedExpression":return re&&this.raiseRecoverable(E.start,"Binding parenthesized expression"),this.checkLValSimple(E.expression,N,Y);default:this.raise(E.start,(re?"Binding":"Assigning to")+" rvalue")}},ht.checkLValPattern=function(E,N,Y){switch(N===void 0&&(N=Ue),E.type){case"ObjectPattern":for(var re=0,ye=E.properties;re<ye.length;re+=1){var $e=ye[re];this.checkLValInnerPattern($e,N,Y)}break;case"ArrayPattern":for(var tt=0,Lt=E.elements;tt<Lt.length;tt+=1){var zt=Lt[tt];zt&&this.checkLValInnerPattern(zt,N,Y)}break;default:this.checkLValSimple(E,N,Y)}},ht.checkLValInnerPattern=function(E,N,Y){switch(N===void 0&&(N=Ue),E.type){case"Property":this.checkLValInnerPattern(E.value,N,Y);break;case"AssignmentPattern":this.checkLValPattern(E.left,N,Y);break;case"RestElement":this.checkLValPattern(E.argument,N,Y);break;default:this.checkLValPattern(E,N,Y)}};var jt=function(N,Y,re,ye,$e){this.token=N,this.isExpr=!!Y,this.preserveSpace=!!re,this.override=ye,this.generator=!!$e},st={b_stat:new jt("{",!1),b_expr:new jt("{",!0),b_tmpl:new jt("${",!1),p_stat:new jt("(",!1),p_expr:new jt("(",!0),q_tmpl:new jt("`",!0,!0,function(E){return E.tryReadTemplateToken()}),f_stat:new jt("function",!1),f_expr:new jt("function",!0),f_expr_gen:new jt("function",!0,!1,null,!0),f_gen:new jt("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 N=this.curContext();return N===st.f_expr||N===st.f_stat?!0:E===S.colon&&(N===st.b_stat||N===st.b_expr)?!N.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?N===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 N=this.context[E];if(N.token==="function")return N.generator}return!1},it.updateContext=function(E){var N,Y=this.type;Y.keyword&&E===S.dot?this.exprAllowed=!1:(N=Y.updateContext)?N.call(this,E):this.exprAllowed=Y.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 N=E===S._if||E===S._for||E===S._with||E===S._while;this.context.push(N?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 N=this.context.length-1;this.context[N]===st.f_expr?this.context[N]=st.f_expr_gen:this.context[N]=st.f_gen}this.exprAllowed=!0},S.name.updateContext=function(E){var N=!1;this.options.ecmaVersion>=6&&E!==S.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(N=!0),this.exprAllowed=N};var bt=me.prototype;bt.checkPropClash=function(E,N,Y){if(!(this.options.ecmaVersion>=9&&E.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(E.computed||E.method||E.shorthand))){var re=E.key,ye;switch(re.type){case"Identifier":ye=re.name;break;case"Literal":ye=String(re.value);break;default:return}var $e=E.kind;if(this.options.ecmaVersion>=6){ye==="__proto__"&&$e==="init"&&(N.proto&&(Y?Y.doubleProto<0&&(Y.doubleProto=re.start):this.raiseRecoverable(re.start,"Redefinition of __proto__ property")),N.proto=!0);return}ye="$"+ye;var tt=N[ye];if(tt){var Lt;$e==="init"?Lt=this.strict&&tt.init||tt.get||tt.set:Lt=tt.init||tt[$e],Lt&&this.raiseRecoverable(re.start,"Redefinition of property")}else tt=N[ye]={init:!1,get:!1,set:!1};tt[$e]=!0}},bt.parseExpression=function(E,N){var Y=this.start,re=this.startLoc,ye=this.parseMaybeAssign(E,N);if(this.type===S.comma){var $e=this.startNodeAt(Y,re);for($e.expressions=[ye];this.eat(S.comma);)$e.expressions.push(this.parseMaybeAssign(E,N));return this.finishNode($e,"SequenceExpression")}return ye},bt.parseMaybeAssign=function(E,N,Y){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(E);this.exprAllowed=!1}var re=!1,ye=-1,$e=-1,tt=-1;N?(ye=N.parenthesizedAssign,$e=N.trailingComma,tt=N.doubleProto,N.parenthesizedAssign=N.trailingComma=-1):(N=new mt,re=!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 gn=this.parseMaybeConditional(E,N);if(Y&&(gn=Y.call(this,gn,Lt,zt)),this.type.isAssign){var En=this.startNodeAt(Lt,zt);return En.operator=this.value,this.type===S.eq&&(gn=this.toAssignable(gn,!1,N)),re||(N.parenthesizedAssign=N.trailingComma=N.doubleProto=-1),N.shorthandAssign>=gn.start&&(N.shorthandAssign=-1),this.type===S.eq?this.checkLValPattern(gn):this.checkLValSimple(gn),En.left=gn,this.next(),En.right=this.parseMaybeAssign(E),tt>-1&&(N.doubleProto=tt),this.finishNode(En,"AssignmentExpression")}else re&&this.checkExpressionErrors(N,!0);return ye>-1&&(N.parenthesizedAssign=ye),$e>-1&&(N.trailingComma=$e),gn},bt.parseMaybeConditional=function(E,N){var Y=this.start,re=this.startLoc,ye=this.parseExprOps(E,N);if(this.checkExpressionErrors(N))return ye;if(this.eat(S.question)){var $e=this.startNodeAt(Y,re);return $e.test=ye,$e.consequent=this.parseMaybeAssign(),this.expect(S.colon),$e.alternate=this.parseMaybeAssign(E),this.finishNode($e,"ConditionalExpression")}return ye},bt.parseExprOps=function(E,N){var Y=this.start,re=this.startLoc,ye=this.parseMaybeUnary(N,!1,!1,E);return this.checkExpressionErrors(N)||ye.start===Y&&ye.type==="ArrowFunctionExpression"?ye:this.parseExprOp(ye,Y,re,-1,E)},bt.parseExprOp=function(E,N,Y,re,ye){var $e=this.type.binop;if($e!=null&&(!ye||this.type!==S._in)&&$e>re){var tt=this.type===S.logicalOR||this.type===S.logicalAND,Lt=this.type===S.coalesce;Lt&&($e=S.logicalAND.binop);var zt=this.value;this.next();var gn=this.start,En=this.startLoc,Ei=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,ye),gn,En,$e,ye),Cn=this.buildBinary(N,Y,E,Ei,zt,tt||Lt);return(tt&&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(Cn,N,Y,re,ye)}return E},bt.buildBinary=function(E,N,Y,re,ye,$e){re.type==="PrivateIdentifier"&&this.raise(re.start,"Private identifier can only be left side of binary expression");var tt=this.startNodeAt(E,N);return tt.left=Y,tt.operator=ye,tt.right=re,this.finishNode(tt,$e?"LogicalExpression":"BinaryExpression")},bt.parseMaybeUnary=function(E,N,Y,re){var ye=this.start,$e=this.startLoc,tt;if(this.isContextual("await")&&this.canAwait)tt=this.parseAwait(re),N=!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,re),this.checkExpressionErrors(E,!0),zt?this.checkLValSimple(Lt.argument):this.strict&&Lt.operator==="delete"&&Jt(Lt.argument)?this.raiseRecoverable(Lt.start,"Deleting local variable in strict mode"):Lt.operator==="delete"&&Kt(Lt.argument)?this.raiseRecoverable(Lt.start,"Private fields can not be deleted"):N=!0,tt=this.finishNode(Lt,zt?"UpdateExpression":"UnaryExpression")}else if(!N&&this.type===S.privateId)(re||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),tt=this.parsePrivateIdent(),this.type!==S._in&&this.unexpected();else{if(tt=this.parseExprSubscripts(E,re),this.checkExpressionErrors(E))return tt;for(;this.type.postfix&&!this.canInsertSemicolon();){var gn=this.startNodeAt(ye,$e);gn.operator=this.value,gn.prefix=!1,gn.argument=tt,this.checkLValSimple(tt),this.next(),tt=this.finishNode(gn,"UpdateExpression")}}if(!Y&&this.eat(S.starstar))if(N)this.unexpected(this.lastTokStart);else return this.buildBinary(ye,$e,tt,this.parseMaybeUnary(null,!1,!1,re),"**",!1);else return tt};function Jt(E){return E.type==="Identifier"||E.type==="ParenthesizedExpression"&&Jt(E.expression)}function Kt(E){return E.type==="MemberExpression"&&E.property.type==="PrivateIdentifier"||E.type==="ChainExpression"&&Kt(E.expression)||E.type==="ParenthesizedExpression"&&Kt(E.expression)}bt.parseExprSubscripts=function(E,N){var Y=this.start,re=this.startLoc,ye=this.parseExprAtom(E,N);if(ye.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return ye;var $e=this.parseSubscripts(ye,Y,re,!1,N);return E&&$e.type==="MemberExpression"&&(E.parenthesizedAssign>=$e.start&&(E.parenthesizedAssign=-1),E.parenthesizedBind>=$e.start&&(E.parenthesizedBind=-1),E.trailingComma>=$e.start&&(E.trailingComma=-1)),$e},bt.parseSubscripts=function(E,N,Y,re,ye){for(var $e=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,tt=!1;;){var Lt=this.parseSubscript(E,N,Y,re,$e,tt,ye);if(Lt.optional&&(tt=!0),Lt===E||Lt.type==="ArrowFunctionExpression"){if(tt){var zt=this.startNodeAt(N,Y);zt.expression=Lt,Lt=this.finishNode(zt,"ChainExpression")}return Lt}E=Lt}},bt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(S.arrow)},bt.parseSubscriptAsyncArrow=function(E,N,Y,re){return this.parseArrowExpression(this.startNodeAt(E,N),Y,!0,re)},bt.parseSubscript=function(E,N,Y,re,ye,$e,tt){var Lt=this.options.ecmaVersion>=11,zt=Lt&&this.eat(S.questionDot);re&&zt&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var gn=this.eat(S.bracketL);if(gn||zt&&this.type!==S.parenL&&this.type!==S.backQuote||this.eat(S.dot)){var En=this.startNodeAt(N,Y);En.object=E,gn?(En.property=this.parseExpression(),this.expect(S.bracketR)):this.type===S.privateId&&E.type!=="Super"?En.property=this.parsePrivateIdent():En.property=this.parseIdent(this.options.allowReserved!=="never"),En.computed=!!gn,Lt&&(En.optional=zt),E=this.finishNode(En,"MemberExpression")}else if(!re&&this.eat(S.parenL)){var Ei=new mt,Cn=this.yieldPos,ai=this.awaitPos,Ar=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Mi=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1,Ei);if(ye&&!zt&&this.shouldParseAsyncArrow())return this.checkPatternErrors(Ei,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=Cn,this.awaitPos=ai,this.awaitIdentPos=Ar,this.parseSubscriptAsyncArrow(N,Y,Mi,tt);this.checkExpressionErrors(Ei,!0),this.yieldPos=Cn||this.yieldPos,this.awaitPos=ai||this.awaitPos,this.awaitIdentPos=Ar||this.awaitIdentPos;var Hi=this.startNodeAt(N,Y);Hi.callee=E,Hi.arguments=Mi,Lt&&(Hi.optional=zt),E=this.finishNode(Hi,"CallExpression")}else if(this.type===S.backQuote){(zt||$e)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Ui=this.startNodeAt(N,Y);Ui.tag=E,Ui.quasi=this.parseTemplate({isTagged:!0}),E=this.finishNode(Ui,"TaggedTemplateExpression")}return E},bt.parseExprAtom=function(E,N,Y){this.type===S.slash&&this.readRegexp();var re,ye=this.potentialArrowAt===this.start;switch(this.type){case S._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),re=this.startNode(),this.next(),this.type===S.parenL&&!this.allowDirectSuper&&this.raise(re.start,"super() call outside constructor of a subclass"),this.type!==S.dot&&this.type!==S.bracketL&&this.type!==S.parenL&&this.unexpected(),this.finishNode(re,"Super");case S._this:return re=this.startNode(),this.next(),this.finishNode(re,"ThisExpression");case S.name:var $e=this.start,tt=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($e,tt),0,!1,!0,N);if(ye&&!this.canInsertSemicolon()){if(this.eat(S.arrow))return this.parseArrowExpression(this.startNodeAt($e,tt),[zt],!1,N);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($e,tt),[zt],!0,N)}return zt;case S.regexp:var gn=this.value;return re=this.parseLiteral(gn.value),re.regex={pattern:gn.pattern,flags:gn.flags},re;case S.num:case S.string:return this.parseLiteral(this.value);case S._null:case S._true:case S._false:return re=this.startNode(),re.value=this.type===S._null?null:this.type===S._true,re.raw=this.type.keyword,this.next(),this.finishNode(re,"Literal");case S.parenL:var En=this.start,Ei=this.parseParenAndDistinguishExpression(ye,N);return E&&(E.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ei)&&(E.parenthesizedAssign=En),E.parenthesizedBind<0&&(E.parenthesizedBind=En)),Ei;case S.bracketL:return re=this.startNode(),this.next(),re.elements=this.parseExprList(S.bracketR,!0,!0,E),this.finishNode(re,"ArrayExpression");case S.braceL:return this.overrideContext(st.b_expr),this.parseObj(!1,E);case S._function:return re=this.startNode(),this.next(),this.parseFunction(re,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(Y):this.unexpected();default:return this.parseExprAtomDefault()}},bt.parseExprAtomDefault=function(){this.unexpected()},bt.parseExprImport=function(E){var N=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===S.parenL&&!E)return this.parseDynamicImport(N);if(this.type===S.dot){var Y=this.startNodeAt(N.start,N.loc&&N.loc.start);return Y.name="import",N.meta=this.finishNode(Y,"Identifier"),this.parseImportMeta(N)}else this.unexpected()},bt.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 N=this.start;this.eat(S.comma)&&this.eat(S.parenR)?this.raiseRecoverable(N,"Trailing comma is not allowed in import()"):this.unexpected(N)}return this.finishNode(E,"ImportExpression")},bt.parseImportMeta=function(E){this.next();var N=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'"),N&&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")},bt.parseLiteral=function(E){var N=this.startNode();return N.value=E,N.raw=this.input.slice(this.start,this.end),N.raw.charCodeAt(N.raw.length-1)===110&&(N.bigint=N.value!=null?N.value.toString():N.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(N,"Literal")},bt.parseParenExpression=function(){this.expect(S.parenL);var E=this.parseExpression();return this.expect(S.parenR),E},bt.shouldParseArrow=function(E){return!this.canInsertSemicolon()},bt.parseParenAndDistinguishExpression=function(E,N){var Y=this.start,re=this.startLoc,ye,$e=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var tt=this.start,Lt=this.startLoc,zt=[],gn=!0,En=!1,Ei=new mt,Cn=this.yieldPos,ai=this.awaitPos,Ar;for(this.yieldPos=0,this.awaitPos=0;this.type!==S.parenR;)if(gn?gn=!1:this.expect(S.comma),$e&&this.afterTrailingComma(S.parenR,!0)){En=!0;break}else if(this.type===S.ellipsis){Ar=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,Ei,this.parseParenItem));var Mi=this.lastTokEnd,Hi=this.lastTokEndLoc;if(this.expect(S.parenR),E&&this.shouldParseArrow(zt)&&this.eat(S.arrow))return this.checkPatternErrors(Ei,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Cn,this.awaitPos=ai,this.parseParenArrowList(Y,re,zt,N);(!zt.length||En)&&this.unexpected(this.lastTokStart),Ar&&this.unexpected(Ar),this.checkExpressionErrors(Ei,!0),this.yieldPos=Cn||this.yieldPos,this.awaitPos=ai||this.awaitPos,zt.length>1?(ye=this.startNodeAt(tt,Lt),ye.expressions=zt,this.finishNodeAt(ye,"SequenceExpression",Mi,Hi)):ye=zt[0]}else ye=this.parseParenExpression();if(this.options.preserveParens){var Ui=this.startNodeAt(Y,re);return Ui.expression=ye,this.finishNode(Ui,"ParenthesizedExpression")}else return ye},bt.parseParenItem=function(E){return E},bt.parseParenArrowList=function(E,N,Y,re){return this.parseArrowExpression(this.startNodeAt(E,N),Y,!1,re)};var un=[];bt.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 N=this.startNodeAt(E.start,E.loc&&E.loc.start);N.name="new",E.meta=this.finishNode(N,"Identifier"),this.next();var Y=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'"),Y&&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 re=this.start,ye=this.startLoc;return E.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),re,ye,!0,!1),this.eat(S.parenL)?E.arguments=this.parseExprList(S.parenR,this.options.ecmaVersion>=8,!1):E.arguments=un,this.finishNode(E,"NewExpression")},bt.parseTemplateElement=function(E){var N=E.isTagged,Y=this.startNode();return this.type===S.invalidTemplate?(N||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),Y.value={raw:this.value.replace(/\r\n?/g,`
`),cooked:null}):Y.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
`),cooked:this.value},this.next(),Y.tail=this.type===S.backQuote,this.finishNode(Y,"TemplateElement")},bt.parseTemplate=function(E){E===void 0&&(E={});var N=E.isTagged;N===void 0&&(N=!1);var Y=this.startNode();this.next(),Y.expressions=[];var re=this.parseTemplateElement({isTagged:N});for(Y.quasis=[re];!re.tail;)this.type===S.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(S.dollarBraceL),Y.expressions.push(this.parseExpression()),this.expect(S.braceR),Y.quasis.push(re=this.parseTemplateElement({isTagged:N}));return this.next(),this.finishNode(Y,"TemplateLiteral")},bt.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))},bt.parseObj=function(E,N){var Y=this.startNode(),re=!0,ye={};for(Y.properties=[],this.next();!this.eat(S.braceR);){if(re)re=!1;else if(this.expect(S.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(S.braceR))break;var $e=this.parseProperty(E,N);E||this.checkPropClash($e,ye,N),Y.properties.push($e)}return this.finishNode(Y,E?"ObjectPattern":"ObjectExpression")},bt.parseProperty=function(E,N){var Y=this.startNode(),re,ye,$e,tt;if(this.options.ecmaVersion>=9&&this.eat(S.ellipsis))return E?(Y.argument=this.parseIdent(!1),this.type===S.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(Y,"RestElement")):(Y.argument=this.parseMaybeAssign(!1,N),this.type===S.comma&&N&&N.trailingComma<0&&(N.trailingComma=this.start),this.finishNode(Y,"SpreadElement"));this.options.ecmaVersion>=6&&(Y.method=!1,Y.shorthand=!1,(E||N)&&($e=this.start,tt=this.startLoc),E||(re=this.eat(S.star)));var Lt=this.containsEsc;return this.parsePropertyName(Y),!E&&!Lt&&this.options.ecmaVersion>=8&&!re&&this.isAsyncProp(Y)?(ye=!0,re=this.options.ecmaVersion>=9&&this.eat(S.star),this.parsePropertyName(Y)):ye=!1,this.parsePropertyValue(Y,E,re,ye,$e,tt,N,Lt),this.finishNode(Y,"Property")},bt.parseGetterSetter=function(E){var N=E.key.name;this.parsePropertyName(E),E.value=this.parseMethod(!1),E.kind=N;var Y=E.kind==="get"?0:1;if(E.value.params.length!==Y){var re=E.value.start;E.kind==="get"?this.raiseRecoverable(re,"getter should have no params"):this.raiseRecoverable(re,"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")},bt.parsePropertyValue=function(E,N,Y,re,ye,$e,tt,Lt){(Y||re)&&this.type===S.colon&&this.unexpected(),this.eat(S.colon)?(E.value=N?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,tt),E.kind="init"):this.options.ecmaVersion>=6&&this.type===S.parenL?(N&&this.unexpected(),E.method=!0,E.value=this.parseMethod(Y,re),E.kind="init"):!N&&!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?((Y||re)&&this.unexpected(),this.parseGetterSetter(E)):this.options.ecmaVersion>=6&&!E.computed&&E.key.type==="Identifier"?((Y||re)&&this.unexpected(),this.checkUnreserved(E.key),E.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=ye),N?E.value=this.parseMaybeDefault(ye,$e,this.copyNode(E.key)):this.type===S.eq&&tt?(tt.shorthandAssign<0&&(tt.shorthandAssign=this.start),E.value=this.parseMaybeDefault(ye,$e,this.copyNode(E.key))):E.value=this.copyNode(E.key),E.kind="init",E.shorthand=!0):this.unexpected()},bt.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")},bt.initFunction=function(E){E.id=null,this.options.ecmaVersion>=6&&(E.generator=E.expression=!1),this.options.ecmaVersion>=8&&(E.async=!1)},bt.parseMethod=function(E,N,Y){var re=this.startNode(),ye=this.yieldPos,$e=this.awaitPos,tt=this.awaitIdentPos;return this.initFunction(re),this.options.ecmaVersion>=6&&(re.generator=E),this.options.ecmaVersion>=8&&(re.async=!!N),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ne(N,re.generator)|Ie|(Y?qe:0)),this.expect(S.parenL),re.params=this.parseBindingList(S.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(re,!1,!0,!1),this.yieldPos=ye,this.awaitPos=$e,this.awaitIdentPos=tt,this.finishNode(re,"FunctionExpression")},bt.parseArrowExpression=function(E,N,Y,re){var ye=this.yieldPos,$e=this.awaitPos,tt=this.awaitIdentPos;return this.enterScope(Ne(Y,!1)|pe),this.initFunction(E),this.options.ecmaVersion>=8&&(E.async=!!Y),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,E.params=this.toAssignableList(N,!0),this.parseFunctionBody(E,!0,!1,re),this.yieldPos=ye,this.awaitPos=$e,this.awaitIdentPos=tt,this.finishNode(E,"ArrowFunctionExpression")},bt.parseFunctionBody=function(E,N,Y,re){var ye=N&&this.type!==S.braceL,$e=this.strict,tt=!1;if(ye)E.body=this.parseMaybeAssign(re),E.expression=!0,this.checkParams(E,!1);else{var Lt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(E.params);(!$e||Lt)&&(tt=this.strictDirective(this.end),tt&&Lt&&this.raiseRecoverable(E.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var zt=this.labels;this.labels=[],tt&&(this.strict=!0),this.checkParams(E,!$e&&!tt&&!N&&!Y&&this.isSimpleParamList(E.params)),this.strict&&E.id&&this.checkLValSimple(E.id,he),E.body=this.parseBlock(!1,void 0,tt&&!$e),E.expression=!1,this.adaptDirectivePrologue(E.body.body),this.labels=zt}this.exitScope()},bt.isSimpleParamList=function(E){for(var N=0,Y=E;N<Y.length;N+=1){var re=Y[N];if(re.type!=="Identifier")return!1}return!0},bt.checkParams=function(E,N){for(var Y=Object.create(null),re=0,ye=E.params;re<ye.length;re+=1){var $e=ye[re];this.checkLValInnerPattern($e,Qe,N?null:Y)}},bt.parseExprList=function(E,N,Y,re){for(var ye=[],$e=!0;!this.eat(E);){if($e)$e=!1;else if(this.expect(S.comma),N&&this.afterTrailingComma(E))break;var tt=void 0;Y&&this.type===S.comma?tt=null:this.type===S.ellipsis?(tt=this.parseSpread(re),re&&this.type===S.comma&&re.trailingComma<0&&(re.trailingComma=this.start)):tt=this.parseMaybeAssign(!1,re),ye.push(tt)}return ye},bt.checkUnreserved=function(E){var N=E.start,Y=E.end,re=E.name;if(this.inGenerator&&re==="yield"&&this.raiseRecoverable(N,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&re==="await"&&this.raiseRecoverable(N,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&Ae)&&re==="arguments"&&this.raiseRecoverable(N,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(re==="arguments"||re==="await")&&this.raise(N,"Cannot use "+re+" in class static initialization block"),this.keywords.test(re)&&this.raise(N,"Unexpected keyword '"+re+"'"),!(this.options.ecmaVersion<6&&this.input.slice(N,Y).indexOf("\\")!==-1)){var ye=this.strict?this.reservedWordsStrict:this.reservedWords;ye.test(re)&&(!this.inAsync&&re==="await"&&this.raiseRecoverable(N,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(N,"The keyword '"+re+"' is reserved"))}},bt.parseIdent=function(E){var N=this.parseIdentNode();return this.next(!!E),this.finishNode(N,"Identifier"),E||(this.checkUnreserved(N),N.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=N.start)),N},bt.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},bt.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},bt.parseYield=function(E){this.yieldPos||(this.yieldPos=this.start);var N=this.startNode();return this.next(),this.type===S.semi||this.canInsertSemicolon()||this.type!==S.star&&!this.type.startsExpr?(N.delegate=!1,N.argument=null):(N.delegate=this.eat(S.star),N.argument=this.parseMaybeAssign(E)),this.finishNode(N,"YieldExpression")},bt.parseAwait=function(E){this.awaitPos||(this.awaitPos=this.start);var N=this.startNode();return this.next(),N.argument=this.parseMaybeUnary(null,!0,!1,E),this.finishNode(N,"AwaitExpression")};var Vn=me.prototype;Vn.raise=function(E,N){var Y=de(this.input,E);N+=" ("+Y.line+":"+Y.column+")",this.sourceFile&&(N+=" in "+this.sourceFile);var re=new SyntaxError(N);throw re.pos=E,re.loc=Y,re.raisedAt=this.pos,re},Vn.raiseRecoverable=Vn.raise,Vn.curPosition=function(){if(this.options.locations)return new Z(this.curLine,this.pos-this.lineStart)};var vn=me.prototype,Qn=function(N){this.flags=N,this.var=[],this.lexical=[],this.functions=[]};vn.enterScope=function(E){this.scopeStack.push(new Qn(E))},vn.exitScope=function(){this.scopeStack.pop()},vn.treatFunctionsAsVarInScope=function(E){return E.flags&Be||!this.inModule&&E.flags&Oe},vn.declareName=function(E,N,Y){var re=!1;if(N===ae){var ye=this.currentScope();re=ye.lexical.indexOf(E)>-1||ye.functions.indexOf(E)>-1||ye.var.indexOf(E)>-1,ye.lexical.push(E),this.inModule&&ye.flags&Oe&&delete this.undefinedExports[E]}else if(N===ce){var $e=this.currentScope();$e.lexical.push(E)}else if(N===K){var tt=this.currentScope();this.treatFunctionsAsVar?re=tt.lexical.indexOf(E)>-1:re=tt.lexical.indexOf(E)>-1||tt.var.indexOf(E)>-1,tt.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&ze&&zt.lexical[0]===E)||!this.treatFunctionsAsVarInScope(zt)&&zt.functions.indexOf(E)>-1){re=!0;break}if(zt.var.push(E),this.inModule&&zt.flags&Oe&&delete this.undefinedExports[E],zt.flags&Ae)break}re&&this.raiseRecoverable(Y,"Identifier '"+E+"' has already been declared")},vn.checkLocalExport=function(E){this.scopeStack[0].lexical.indexOf(E.name)===-1&&this.scopeStack[0].var.indexOf(E.name)===-1&&(this.undefinedExports[E.name]=E)},vn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},vn.currentVarScope=function(){for(var E=this.scopeStack.length-1;;E--){var N=this.scopeStack[E];if(N.flags&(Ae|Me|we))return N}},vn.currentThisScope=function(){for(var E=this.scopeStack.length-1;;E--){var N=this.scopeStack[E];if(N.flags&(Ae|Me|we)&&!(N.flags&pe))return N}};var Yn=function(N,Y,re){this.type="",this.start=Y,this.end=0,N.options.locations&&(this.loc=new G(N,re)),N.options.directSourceFile&&(this.sourceFile=N.options.directSourceFile),N.options.ranges&&(this.range=[Y,0])},_i=me.prototype;_i.startNode=function(){return new Yn(this,this.start,this.startLoc)},_i.startNodeAt=function(E,N){return new Yn(this,E,N)};function Xn(E,N,Y,re){return E.type=N,E.end=Y,this.options.locations&&(E.loc.end=re),this.options.ranges&&(E.range[1]=Y),E}_i.finishNode=function(E,N){return Xn.call(this,E,N,this.lastTokEnd,this.lastTokEndLoc)},_i.finishNodeAt=function(E,N,Y,re){return Xn.call(this,E,N,Y,re)},_i.copyNode=function(E){var N=new Yn(this,E.start,this.startLoc);for(var Y in E)N[Y]=E[Y];return N};var Ji="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",hi="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",on=hi+" Extended_Pictographic",Ii=on,ri=Ii+" EBase EComp EMod EPres ExtPict",se=ri,ge=se,Pe={9:hi,10:on,11:Ii,12:ri,13:se,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",At="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=At+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",xe=ee+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Te=xe+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",De=Te+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ve=De+" "+Ji,_t={9:At,10:ee,11:xe,12:Te,13:De,14:ve},ft={};function yt(E){var N=ft[E]={binary:W(Pe[E]+" "+ot),binaryOfStrings:W(dt[E]),nonBinary:{General_Category:W(ot),Script:W(_t[E])}};N.nonBinary.Script_Extensions=N.nonBinary.Script,N.nonBinary.gc=N.nonBinary.General_Category,N.nonBinary.sc=N.nonBinary.Script,N.nonBinary.scx=N.nonBinary.Script_Extensions}for(var St=0,Nt=[9,10,11,12,13,14];St<Nt.length;St+=1){var qt=Nt[St];yt(qt)}var at=me.prototype,nn=function(N,Y){this.parent=N,this.base=Y||this};nn.prototype.separatedFrom=function(N){for(var Y=this;Y;Y=Y.parent)for(var re=N;re;re=re.parent)if(Y.base===re.base&&Y!==re)return!0;return!1},nn.prototype.sibling=function(){return new nn(this.parent,this.base)};var pn=function(N){this.parser=N,this.validFlags="gim"+(N.options.ecmaVersion>=6?"uy":"")+(N.options.ecmaVersion>=9?"s":"")+(N.options.ecmaVersion>=13?"d":"")+(N.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ft[N.options.ecmaVersion>=14?14:N.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};pn.prototype.reset=function(N,Y,re){var ye=re.indexOf("v")!==-1,$e=re.indexOf("u")!==-1;this.start=N|0,this.source=Y+"",this.flags=re,ye&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=$e&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=$e&&this.parser.options.ecmaVersion>=9)},pn.prototype.raise=function(N){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+N)},pn.prototype.at=function(N,Y){Y===void 0&&(Y=!1);var re=this.source,ye=re.length;if(N>=ye)return-1;var $e=re.charCodeAt(N);if(!(Y||this.switchU)||$e<=55295||$e>=57344||N+1>=ye)return $e;var tt=re.charCodeAt(N+1);return tt>=56320&&tt<=57343?($e<<10)+tt-56613888:$e},pn.prototype.nextIndex=function(N,Y){Y===void 0&&(Y=!1);var re=this.source,ye=re.length;if(N>=ye)return ye;var $e=re.charCodeAt(N),tt;return!(Y||this.switchU)||$e<=55295||$e>=57344||N+1>=ye||(tt=re.charCodeAt(N+1))<56320||tt>57343?N+1:N+2},pn.prototype.current=function(N){return N===void 0&&(N=!1),this.at(this.pos,N)},pn.prototype.lookahead=function(N){return N===void 0&&(N=!1),this.at(this.nextIndex(this.pos,N),N)},pn.prototype.advance=function(N){N===void 0&&(N=!1),this.pos=this.nextIndex(this.pos,N)},pn.prototype.eat=function(N,Y){return Y===void 0&&(Y=!1),this.current(Y)===N?(this.advance(Y),!0):!1},pn.prototype.eatChars=function(N,Y){Y===void 0&&(Y=!1);for(var re=this.pos,ye=0,$e=N;ye<$e.length;ye+=1){var tt=$e[ye],Lt=this.at(re,Y);if(Lt===-1||Lt!==tt)return!1;re=this.nextIndex(re,Y)}return this.pos=re,!0},at.validateRegExpFlags=function(E){for(var N=E.validFlags,Y=E.flags,re=!1,ye=!1,$e=0;$e<Y.length;$e++){var tt=Y.charAt($e);N.indexOf(tt)===-1&&this.raise(E.start,"Invalid regular expression flag"),Y.indexOf(tt,$e+1)>-1&&this.raise(E.start,"Duplicate regular expression flag"),tt==="u"&&(re=!0),tt==="v"&&(ye=!0)}this.options.ecmaVersion>=15&&re&&ye&&this.raise(E.start,"Invalid regular expression flag")};function dn(E){for(var N 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 N=0,Y=E.backReferenceNames;N<Y.length;N+=1){var re=Y[N];E.groupNames[re]||E.raise("Invalid named capture referenced")}},at.regexp_disjunction=function(E){var N=this.options.ecmaVersion>=16;for(N&&(E.branchID=new nn(E.branchID,null)),this.regexp_alternative(E);E.eat(124);)N&&(E.branchID=E.branchID.sibling()),this.regexp_alternative(E);N&&(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 N=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=N}if(E.eat(40)&&E.eat(63)){var Y=!1;if(this.options.ecmaVersion>=9&&(Y=E.eat(60)),E.eat(61)||E.eat(33))return this.regexp_disjunction(E),E.eat(41)||E.raise("Unterminated group"),E.lastAssertionIsQuantifiable=!Y,!0}return E.pos=N,!1},at.regexp_eatQuantifier=function(E,N){return N===void 0&&(N=!1),this.regexp_eatQuantifierPrefix(E,N)?(E.eat(63),!0):!1},at.regexp_eatQuantifierPrefix=function(E,N){return E.eat(42)||E.eat(43)||E.eat(63)||this.regexp_eatBracedQuantifier(E,N)},at.regexp_eatBracedQuantifier=function(E,N){var Y=E.pos;if(E.eat(123)){var re=0,ye=-1;if(this.regexp_eatDecimalDigits(E)&&(re=E.lastIntValue,E.eat(44)&&this.regexp_eatDecimalDigits(E)&&(ye=E.lastIntValue),E.eat(125)))return ye!==-1&&ye<re&&!N&&E.raise("numbers out of order in {} quantifier"),!0;E.switchU&&!N&&E.raise("Incomplete quantifier"),E.pos=Y}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 N=E.pos;if(E.eat(92)){if(this.regexp_eatAtomEscape(E))return!0;E.pos=N}return!1},at.regexp_eatUncapturingGroup=function(E){var N=E.pos;if(E.eat(40)){if(E.eat(63)){if(this.options.ecmaVersion>=16){var Y=this.regexp_eatModifiers(E),re=E.eat(45);if(Y||re){for(var ye=0;ye<Y.length;ye++){var $e=Y.charAt(ye);Y.indexOf($e,ye+1)>-1&&E.raise("Duplicate regular expression modifiers")}if(re){var tt=this.regexp_eatModifiers(E);!Y&&!tt&&E.current()===58&&E.raise("Invalid regular expression modifiers");for(var Lt=0;Lt<tt.length;Lt++){var zt=tt.charAt(Lt);(tt.indexOf(zt,Lt+1)>-1||Y.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=N}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 N="",Y=0;(Y=E.current())!==-1&&Dn(Y);)N+=B(Y),E.advance();return N};function Dn(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 N=E.current();return $t(N)?(E.lastIntValue=N,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 N=E.pos,Y=0;(Y=E.current())!==-1&&!$t(Y);)E.advance();return E.pos!==N},at.regexp_eatExtendedPatternCharacter=function(E){var N=E.current();return N!==-1&&N!==36&&!(N>=40&&N<=43)&&N!==46&&N!==63&&N!==91&&N!==94&&N!==124?(E.advance(),!0):!1},at.regexp_groupSpecifier=function(E){if(E.eat(63)){this.regexp_eatGroupName(E)||E.raise("Invalid group");var N=this.options.ecmaVersion>=16,Y=E.groupNames[E.lastStringValue];if(Y)if(N)for(var re=0,ye=Y;re<ye.length;re+=1){var $e=ye[re];$e.separatedFrom(E.branchID)||E.raise("Duplicate capture group name")}else E.raise("Duplicate capture group name");N?(Y||(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+=B(E.lastIntValue);this.regexp_eatRegExpIdentifierPart(E);)E.lastStringValue+=B(E.lastIntValue);return!0}return!1},at.regexp_eatRegExpIdentifierStart=function(E){var N=E.pos,Y=this.options.ecmaVersion>=11,re=E.current(Y);return E.advance(Y),re===92&&this.regexp_eatRegExpUnicodeEscapeSequence(E,Y)&&(re=E.lastIntValue),Yt(re)?(E.lastIntValue=re,!0):(E.pos=N,!1)};function Yt(E){return g(E,!0)||E===36||E===95}at.regexp_eatRegExpIdentifierPart=function(E){var N=E.pos,Y=this.options.ecmaVersion>=11,re=E.current(Y);return E.advance(Y),re===92&&this.regexp_eatRegExpUnicodeEscapeSequence(E,Y)&&(re=E.lastIntValue),Un(re)?(E.lastIntValue=re,!0):(E.pos=N,!1)};function Un(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 N=E.pos;if(this.regexp_eatDecimalEscape(E)){var Y=E.lastIntValue;if(E.switchU)return Y>E.maxBackReference&&(E.maxBackReference=Y),!0;if(Y<=E.numCapturingParens)return!0;E.pos=N}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 N=E.pos;if(E.eat(99)){if(this.regexp_eatControlLetter(E))return!0;E.pos=N}return!1},at.regexp_eatZero=function(E){return E.current()===48&&!Gi(E.lookahead())?(E.lastIntValue=0,E.advance(),!0):!1},at.regexp_eatControlEscape=function(E){var N=E.current();return N===116?(E.lastIntValue=9,E.advance(),!0):N===110?(E.lastIntValue=10,E.advance(),!0):N===118?(E.lastIntValue=11,E.advance(),!0):N===102?(E.lastIntValue=12,E.advance(),!0):N===114?(E.lastIntValue=13,E.advance(),!0):!1},at.regexp_eatControlLetter=function(E){var N=E.current();return xn(N)?(E.lastIntValue=N%32,E.advance(),!0):!1};function xn(E){return E>=65&&E<=90||E>=97&&E<=122}at.regexp_eatRegExpUnicodeEscapeSequence=function(E,N){N===void 0&&(N=!1);var Y=E.pos,re=N||E.switchU;if(E.eat(117)){if(this.regexp_eatFixedHexDigits(E,4)){var ye=E.lastIntValue;if(re&&ye>=55296&&ye<=56319){var $e=E.pos;if(E.eat(92)&&E.eat(117)&&this.regexp_eatFixedHexDigits(E,4)){var tt=E.lastIntValue;if(tt>=56320&&tt<=57343)return E.lastIntValue=(ye-55296)*1024+(tt-56320)+65536,!0}E.pos=$e,E.lastIntValue=ye}return!0}if(re&&E.eat(123)&&this.regexp_eatHexDigits(E)&&E.eat(125)&&Zn(E.lastIntValue))return!0;re&&E.raise("Invalid unicode escape"),E.pos=Y}return!1};function Zn(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 N=E.current();return N!==99&&(!E.switchN||N!==107)?(E.lastIntValue=N,E.advance(),!0):!1},at.regexp_eatDecimalEscape=function(E){E.lastIntValue=0;var N=E.current();if(N>=49&&N<=57){do E.lastIntValue=10*E.lastIntValue+(N-48),E.advance();while((N=E.current())>=48&&N<=57);return!0}return!1};var Nn=0,An=1,Sn=2;at.regexp_eatCharacterClassEscape=function(E){var N=E.current();if(an(N))return E.lastIntValue=-1,E.advance(),An;var Y=!1;if(E.switchU&&this.options.ecmaVersion>=9&&((Y=N===80)||N===112)){E.lastIntValue=-1,E.advance();var re;if(E.eat(123)&&(re=this.regexp_eatUnicodePropertyValueExpression(E))&&E.eat(125))return Y&&re===Sn&&E.raise("Invalid property name"),re;E.raise("Invalid property name")}return Nn};function an(E){return E===100||E===68||E===115||E===83||E===119||E===87}at.regexp_eatUnicodePropertyValueExpression=function(E){var N=E.pos;if(this.regexp_eatUnicodePropertyName(E)&&E.eat(61)){var Y=E.lastStringValue;if(this.regexp_eatUnicodePropertyValue(E)){var re=E.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(E,Y,re),An}}if(E.pos=N,this.regexp_eatLoneUnicodePropertyNameOrValue(E)){var ye=E.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(E,ye)}return Nn},at.regexp_validateUnicodePropertyNameAndValue=function(E,N,Y){F(E.unicodeProperties.nonBinary,N)||E.raise("Invalid property name"),E.unicodeProperties.nonBinary[N].test(Y)||E.raise("Invalid property value")},at.regexp_validateUnicodePropertyNameOrValue=function(E,N){if(E.unicodeProperties.binary.test(N))return An;if(E.switchV&&E.unicodeProperties.binaryOfStrings.test(N))return Sn;E.raise("Invalid property name")},at.regexp_eatUnicodePropertyName=function(E){var N=0;for(E.lastStringValue="";di(N=E.current());)E.lastStringValue+=B(N),E.advance();return E.lastStringValue!==""};function di(E){return xn(E)||E===95}at.regexp_eatUnicodePropertyValue=function(E){var N=0;for(E.lastStringValue="";Li(N=E.current());)E.lastStringValue+=B(N),E.advance();return E.lastStringValue!==""};function Li(E){return di(E)||Gi(E)}at.regexp_eatLoneUnicodePropertyNameOrValue=function(E){return this.regexp_eatUnicodePropertyValue(E)},at.regexp_eatCharacterClass=function(E){if(E.eat(91)){var N=E.eat(94),Y=this.regexp_classContents(E);return E.eat(93)||E.raise("Unterminated character class"),N&&Y===Sn&&E.raise("Negated character class may contain strings"),!0}return!1},at.regexp_classContents=function(E){return E.current()===93?An:E.switchV?this.regexp_classSetExpression(E):(this.regexp_nonEmptyClassRanges(E),An)},at.regexp_nonEmptyClassRanges=function(E){for(;this.regexp_eatClassAtom(E);){var N=E.lastIntValue;if(E.eat(45)&&this.regexp_eatClassAtom(E)){var Y=E.lastIntValue;E.switchU&&(N===-1||Y===-1)&&E.raise("Invalid character class"),N!==-1&&Y!==-1&&N>Y&&E.raise("Range out of order in character class")}}},at.regexp_eatClassAtom=function(E){var N=E.pos;if(E.eat(92)){if(this.regexp_eatClassEscape(E))return!0;if(E.switchU){var Y=E.current();(Y===99||ko(Y))&&E.raise("Invalid class escape"),E.raise("Invalid escape")}E.pos=N}var re=E.current();return re!==93?(E.lastIntValue=re,E.advance(),!0):!1},at.regexp_eatClassEscape=function(E){var N=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=N}return this.regexp_eatCharacterClassEscape(E)||this.regexp_eatCharacterEscape(E)},at.regexp_classSetExpression=function(E){var N=An,Y;if(!this.regexp_eatClassSetRange(E))if(Y=this.regexp_eatClassSetOperand(E)){Y===Sn&&(N=Sn);for(var re=E.pos;E.eatChars([38,38]);){if(E.current()!==38&&(Y=this.regexp_eatClassSetOperand(E))){Y!==Sn&&(N=An);continue}E.raise("Invalid character in character class")}if(re!==E.pos)return N;for(;E.eatChars([45,45]);)this.regexp_eatClassSetOperand(E)||E.raise("Invalid character in character class");if(re!==E.pos)return N}else E.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(E)){if(Y=this.regexp_eatClassSetOperand(E),!Y)return N;Y===Sn&&(N=Sn)}},at.regexp_eatClassSetRange=function(E){var N=E.pos;if(this.regexp_eatClassSetCharacter(E)){var Y=E.lastIntValue;if(E.eat(45)&&this.regexp_eatClassSetCharacter(E)){var re=E.lastIntValue;return Y!==-1&&re!==-1&&Y>re&&E.raise("Range out of order in character class"),!0}E.pos=N}return!1},at.regexp_eatClassSetOperand=function(E){return this.regexp_eatClassSetCharacter(E)?An:this.regexp_eatClassStringDisjunction(E)||this.regexp_eatNestedClass(E)},at.regexp_eatNestedClass=function(E){var N=E.pos;if(E.eat(91)){var Y=E.eat(94),re=this.regexp_classContents(E);if(E.eat(93))return Y&&re===Sn&&E.raise("Negated character class may contain strings"),re;E.pos=N}if(E.eat(92)){var ye=this.regexp_eatCharacterClassEscape(E);if(ye)return ye;E.pos=N}return null},at.regexp_eatClassStringDisjunction=function(E){var N=E.pos;if(E.eatChars([92,113])){if(E.eat(123)){var Y=this.regexp_classStringDisjunctionContents(E);if(E.eat(125))return Y}else E.raise("Invalid escape");E.pos=N}return null},at.regexp_classStringDisjunctionContents=function(E){for(var N=this.regexp_classString(E);E.eat(124);)this.regexp_classString(E)===Sn&&(N=Sn);return N},at.regexp_classString=function(E){for(var N=0;this.regexp_eatClassSetCharacter(E);)N++;return N===1?An:Sn},at.regexp_eatClassSetCharacter=function(E){var N=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=N,!1);var Y=E.current();return Y<0||Y===E.lookahead()&&Gn(Y)||wi(Y)?!1:(E.advance(),E.lastIntValue=Y,!0)};function Gn(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 wi(E){return E===40||E===41||E===45||E===47||E>=91&&E<=93||E>=123&&E<=125}at.regexp_eatClassSetReservedPunctuator=function(E){var N=E.current();return Sa(N)?(E.lastIntValue=N,E.advance(),!0):!1};function Sa(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 N=E.current();return Gi(N)||N===95?(E.lastIntValue=N%32,E.advance(),!0):!1},at.regexp_eatHexEscapeSequence=function(E){var N=E.pos;if(E.eat(120)){if(this.regexp_eatFixedHexDigits(E,2))return!0;E.switchU&&E.raise("Invalid escape"),E.pos=N}return!1},at.regexp_eatDecimalDigits=function(E){var N=E.pos,Y=0;for(E.lastIntValue=0;Gi(Y=E.current());)E.lastIntValue=10*E.lastIntValue+(Y-48),E.advance();return E.pos!==N};function Gi(E){return E>=48&&E<=57}at.regexp_eatHexDigits=function(E){var N=E.pos,Y=0;for(E.lastIntValue=0;Ko(Y=E.current());)E.lastIntValue=16*E.lastIntValue+Bs(Y),E.advance();return E.pos!==N};function Ko(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 N=E.lastIntValue;if(this.regexp_eatOctalDigit(E)){var Y=E.lastIntValue;N<=3&&this.regexp_eatOctalDigit(E)?E.lastIntValue=N*64+Y*8+E.lastIntValue:E.lastIntValue=N*8+Y}else E.lastIntValue=N;return!0}return!1},at.regexp_eatOctalDigit=function(E){var N=E.current();return ko(N)?(E.lastIntValue=N-48,E.advance(),!0):(E.lastIntValue=0,!1)};function ko(E){return E>=48&&E<=55}at.regexp_eatFixedHexDigits=function(E,N){var Y=E.pos;E.lastIntValue=0;for(var re=0;re<N;++re){var ye=E.current();if(!Ko(ye))return E.pos=Y,!1;E.lastIntValue=16*E.lastIntValue+Bs(ye),E.advance()}return!0};var us=function(N){this.type=N.type,this.value=N.value,this.start=N.start,this.end=N.end,N.options.locations&&(this.loc=new G(N,N.startLoc,N.endLoc)),N.options.ranges&&(this.range=[N.start,N.end])},_n=me.prototype;_n.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 us(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},_n.getToken=function(){return this.next(),new us(this)},typeof Symbol<"u"&&(_n[Symbol.iterator]=function(){var E=this;return{next:function(){var N=E.getToken();return{done:N.type===S.eof,value:N}}}}),_n.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())},_n.readToken=function(E){return g(E,this.options.ecmaVersion>=6)||E===92?this.readWord():this.getTokenFromCode(E)},_n.fullCharCodeAtPos=function(){var E=this.input.charCodeAt(this.pos);if(E<=55295||E>=56320)return E;var N=this.input.charCodeAt(this.pos+1);return N<=56319||N>=57344?E:(E<<10)+N-56613888},_n.skipBlockComment=function(){var E=this.options.onComment&&this.curPosition(),N=this.pos,Y=this.input.indexOf("*/",this.pos+=2);if(Y===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=Y+2,this.options.locations)for(var re=void 0,ye=N;(re=R(this.input,ye,this.pos))>-1;)++this.curLine,ye=this.lineStart=re;this.options.onComment&&this.options.onComment(!0,this.input.slice(N+2,Y),N,this.pos,E,this.curPosition())},_n.skipLineComment=function(E){for(var N=this.pos,Y=this.options.onComment&&this.curPosition(),re=this.input.charCodeAt(this.pos+=E);this.pos<this.input.length&&!D(re);)re=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(N+E,this.pos),N,this.pos,Y,this.curPosition())},_n.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&&L.test(String.fromCharCode(E)))++this.pos;else break e}}},_n.finishToken=function(E,N){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var Y=this.type;this.type=E,this.value=N,this.updateContext(Y)},_n.readToken_dot=function(){var E=this.input.charCodeAt(this.pos+1);if(E>=48&&E<=57)return this.readNumber(!0);var N=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&E===46&&N===46?(this.pos+=3,this.finishToken(S.ellipsis)):(++this.pos,this.finishToken(S.dot))},_n.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)},_n.readToken_mult_modulo_exp=function(E){var N=this.input.charCodeAt(this.pos+1),Y=1,re=E===42?S.star:S.modulo;return this.options.ecmaVersion>=7&&E===42&&N===42&&(++Y,re=S.starstar,N=this.input.charCodeAt(this.pos+2)),N===61?this.finishOp(S.assign,Y+1):this.finishOp(re,Y)},_n.readToken_pipe_amp=function(E){var N=this.input.charCodeAt(this.pos+1);if(N===E){if(this.options.ecmaVersion>=12){var Y=this.input.charCodeAt(this.pos+2);if(Y===61)return this.finishOp(S.assign,3)}return this.finishOp(E===124?S.logicalOR:S.logicalAND,2)}return N===61?this.finishOp(S.assign,2):this.finishOp(E===124?S.bitwiseOR:S.bitwiseAND,1)},_n.readToken_caret=function(){var E=this.input.charCodeAt(this.pos+1);return E===61?this.finishOp(S.assign,2):this.finishOp(S.bitwiseXOR,1)},_n.readToken_plus_min=function(E){var N=this.input.charCodeAt(this.pos+1);return N===E?N===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):N===61?this.finishOp(S.assign,2):this.finishOp(S.plusMin,1)},_n.readToken_lt_gt=function(E){var N=this.input.charCodeAt(this.pos+1),Y=1;return N===E?(Y=E===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Y)===61?this.finishOp(S.assign,Y+1):this.finishOp(S.bitShift,Y)):N===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()):(N===61&&(Y=2),this.finishOp(S.relational,Y))},_n.readToken_eq_excl=function(E){var N=this.input.charCodeAt(this.pos+1);return N===61?this.finishOp(S.equality,this.input.charCodeAt(this.pos+2)===61?3:2):E===61&&N===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(S.arrow)):this.finishOp(E===61?S.eq:S.prefix,1)},_n.readToken_question=function(){var E=this.options.ecmaVersion;if(E>=11){var N=this.input.charCodeAt(this.pos+1);if(N===46){var Y=this.input.charCodeAt(this.pos+2);if(Y<48||Y>57)return this.finishOp(S.questionDot,2)}if(N===63){if(E>=12){var re=this.input.charCodeAt(this.pos+2);if(re===61)return this.finishOp(S.assign,3)}return this.finishOp(S.coalesce,2)}}return this.finishOp(S.question,1)},_n.readToken_numberSign=function(){var E=this.options.ecmaVersion,N=35;if(E>=13&&(++this.pos,N=this.fullCharCodeAtPos(),g(N,!0)||N===92))return this.finishToken(S.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+B(N)+"'")},_n.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 N=this.input.charCodeAt(this.pos+1);if(N===120||N===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(N===111||N===79)return this.readRadixNumber(8);if(N===98||N===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 '"+B(E)+"'")},_n.finishOp=function(E,N){var Y=this.input.slice(this.pos,this.pos+N);return this.pos+=N,this.finishToken(E,Y)},_n.readRegexp=function(){for(var E,N,Y=this.pos;;){this.pos>=this.input.length&&this.raise(Y,"Unterminated regular expression");var re=this.input.charAt(this.pos);if(A.test(re)&&this.raise(Y,"Unterminated regular expression"),E)E=!1;else{if(re==="[")N=!0;else if(re==="]"&&N)N=!1;else if(re==="/"&&!N)break;E=re==="\\"}++this.pos}var ye=this.input.slice(Y,this.pos);++this.pos;var $e=this.pos,tt=this.readWord1();this.containsEsc&&this.unexpected($e);var Lt=this.regexpState||(this.regexpState=new pn(this));Lt.reset(Y,ye,tt),this.validateRegExpFlags(Lt),this.validateRegExpPattern(Lt);var zt=null;try{zt=new RegExp(ye,tt)}catch{}return this.finishToken(S.regexp,{pattern:ye,flags:tt,value:zt})},_n.readInt=function(E,N,Y){for(var re=this.options.ecmaVersion>=12&&N===void 0,ye=Y&&this.input.charCodeAt(this.pos)===48,$e=this.pos,tt=0,Lt=0,zt=0,gn=N??1/0;zt<gn;++zt,++this.pos){var En=this.input.charCodeAt(this.pos),Ei=void 0;if(re&&En===95){ye&&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=En;continue}if(En>=97?Ei=En-97+10:En>=65?Ei=En-65+10:En>=48&&En<=57?Ei=En-48:Ei=1/0,Ei>=E)break;Lt=En,tt=tt*E+Ei}return re&&Lt===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===$e||N!=null&&this.pos-$e!==N?null:tt};function Ga(E,N){return N?parseInt(E,8):parseFloat(E.replace(/_/g,""))}function fs(E){return typeof BigInt!="function"?null:BigInt(E.replace(/_/g,""))}_n.readRadixNumber=function(E){var N=this.pos;this.pos+=2;var Y=this.readInt(E);return Y==null&&this.raise(this.start+2,"Expected number in radix "+E),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(Y=fs(this.input.slice(N,this.pos)),++this.pos):g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,Y)},_n.readNumber=function(E){var N=this.pos;!E&&this.readInt(10,void 0,!0)===null&&this.raise(N,"Invalid number");var Y=this.pos-N>=2&&this.input.charCodeAt(N)===48;Y&&this.strict&&this.raise(N,"Invalid number");var re=this.input.charCodeAt(this.pos);if(!Y&&!E&&this.options.ecmaVersion>=11&&re===110){var ye=fs(this.input.slice(N,this.pos));return++this.pos,g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(S.num,ye)}Y&&/[89]/.test(this.input.slice(N,this.pos))&&(Y=!1),re===46&&!Y&&(++this.pos,this.readInt(10),re=this.input.charCodeAt(this.pos)),(re===69||re===101)&&!Y&&(re=this.input.charCodeAt(++this.pos),(re===43||re===45)&&++this.pos,this.readInt(10)===null&&this.raise(N,"Invalid number")),g(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var $e=Ga(this.input.slice(N,this.pos),Y);return this.finishToken(S.num,$e)},_n.readCodePoint=function(){var E=this.input.charCodeAt(this.pos),N;if(E===123){this.options.ecmaVersion<6&&this.unexpected();var Y=++this.pos;N=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,N>1114111&&this.invalidStringToken(Y,"Code point out of bounds")}else N=this.readHexChar(4);return N},_n.readString=function(E){for(var N="",Y=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var re=this.input.charCodeAt(this.pos);if(re===E)break;re===92?(N+=this.input.slice(Y,this.pos),N+=this.readEscapedChar(!1),Y=this.pos):re===8232||re===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(D(re)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return N+=this.input.slice(Y,this.pos++),this.finishToken(S.string,N)};var Wa={};_n.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(E){if(E===Wa)this.readInvalidTemplateToken();else throw E}this.inTemplateElement=!1},_n.invalidStringToken=function(E,N){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Wa;this.raise(E,N)},_n.readTmplToken=function(){for(var E="",N=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var Y=this.input.charCodeAt(this.pos);if(Y===96||Y===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===S.template||this.type===S.invalidTemplate)?Y===36?(this.pos+=2,this.finishToken(S.dollarBraceL)):(++this.pos,this.finishToken(S.backQuote)):(E+=this.input.slice(N,this.pos),this.finishToken(S.template,E));if(Y===92)E+=this.input.slice(N,this.pos),E+=this.readEscapedChar(!0),N=this.pos;else if(D(Y)){switch(E+=this.input.slice(N,this.pos),++this.pos,Y){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:E+=`
`;break;default:E+=String.fromCharCode(Y);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),N=this.pos}else++this.pos}},_n.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")},_n.readEscapedChar=function(E){var N=this.input.charCodeAt(++this.pos);switch(++this.pos,N){case 110:return`
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return B(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 Y=this.pos-1;this.invalidStringToken(Y,"Invalid escape sequence in template string")}default:if(N>=48&&N<=55){var re=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],ye=parseInt(re,8);return ye>255&&(re=re.slice(0,-1),ye=parseInt(re,8)),this.pos+=re.length-1,N=this.input.charCodeAt(this.pos),(re!=="0"||N===56||N===57)&&(this.strict||E)&&this.invalidStringToken(this.pos-1-re.length,E?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(ye)}return D(N)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(N)}},_n.readHexChar=function(E){var N=this.pos,Y=this.readInt(16,E);return Y===null&&this.invalidStringToken(N,"Bad character escape sequence"),Y},_n.readWord1=function(){this.containsEsc=!1;for(var E="",N=!0,Y=this.pos,re=this.options.ecmaVersion>=6;this.pos<this.input.length;){var ye=this.fullCharCodeAtPos();if(b(ye,re))this.pos+=ye<=65535?1:2;else if(ye===92){this.containsEsc=!0,E+=this.input.slice(Y,this.pos);var $e=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var tt=this.readCodePoint();(N?g:b)(tt,re)||this.invalidStringToken($e,"Invalid Unicode escape"),E+=B(tt),Y=this.pos}else break;N=!1}return E+this.input.slice(Y,this.pos)},_n.readWord=function(){var E=this.readWord1(),N=S.name;return this.keywords.test(E)&&(N=w[E]),this.finishToken(N,E)};var $i="8.15.0";me.acorn={Parser:me,version:$i,defaultOptions:oe,Position:Z,SourceLocation:G,getLineInfo:de,Node:Yn,TokenType:y,tokTypes:S,keywordTypes:w,TokContext:jt,tokContexts:st,isIdentifierChar:b,isIdentifierStart:g,Token:us,isNewLine:D,lineBreak:A,lineBreakG:C,nonASCIIwhitespace:L};function so(E,N){return me.parse(E,N)}function zs(E,N,Y){return me.parseExpressionAt(E,N,Y)}function js(E,N){return me.tokenizer(E,N)}n.Node=Yn,n.Parser=me,n.Position=Z,n.SourceLocation=G,n.TokContext=jt,n.Token=us,n.TokenType=y,n.defaultOptions=oe,n.getLineInfo=de,n.isIdentifierChar=b,n.isIdentifierStart=g,n.isNewLine=D,n.keywordTypes=w,n.lineBreak=A,n.lineBreakG=C,n.nonASCIIwhitespace=L,n.parse=so,n.parseExpressionAt=zs,n.tokContexts=st,n.tokTypes=S,n.tokenizer=js,n.version=$i})}(vE,vE.exports)),vE.exports}(function(t){const e=SCe,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},m={jsxName:new h("jsxName"),jsxText:new h("jsxText",{beforeExpr:!0}),jsxTagStart:new h("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new h("jsxTagEnd")};m.jsxTagStart.updateContext=function(){this.context.push(b),this.context.push(d),this.exprAllowed=!1},m.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:m},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,m=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 L=D.name?"Element":"Fragment";return A["opening"+L]=D,A["closing"+L]=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"+L)}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===m)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==m?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)}}}})(dQ);var wCe=dQ.exports;const pQ=Rc(wCe),{stringify:ECe}=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},ru=17,MCe={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:ru,ClassExpression:ru,FunctionExpression:ru,ObjectExpression:ru,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function kb(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 mQ(t,e,n,i){const r=t.expressionsPrecedence[e.type];if(r===ru)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;mQ(t,e,n,i)?(t.write("("),r[e.type](e,t),t.write(")")):r[e.type](e,t)}function TCe(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 bo(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("/*"),TCe(t,s.value,n,i),t.write("*/"+i))}}function ACe(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 W6,q6,X6,K6,Y6,J6;const gQ={Program(t,e){const n=e.indent.repeat(e.indentLevel),{lineEnd:i,writeComments:r}=e;r&&t.comments!=null&&bo(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&&bo(e,l.comments,n,i),e.write(n),this[l.type](l,e),e.write(i)}r&&t.trailingComments!=null&&bo(e,t.trailingComments,n,i)},BlockStatement:J6=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&&bo(e,t.comments,a,i);const{length:o}=s;for(let l=0;l<o;l++){const c=s[l];r&&c.comments!=null&&bo(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),bo(e,t.comments,a,i),e.write(n));r&&t.trailingComments!=null&&bo(e,t.trailingComments,a,i),e.write("}"),e.indentLevel--},ClassBody:J6,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===ru||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&&bo(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&&bo(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:W6=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:W6,DebuggerStatement(t,e){e.write("debugger;",t)},FunctionDeclaration:q6=function(t,e){e.write((t.async?"async ":"")+(t.generator?"function* ":"function ")+(t.id?t.id.name:""),t),kb(e,t.params),e.write(" "),this[t.body.type](t.body,e)},FunctionExpression:q6,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===ru||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),kb(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]):kb(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:X6=function(t,e){e.write("..."),this[t.argument.type](t.argument,e)},SpreadElement:X6,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:Y6=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:Y6,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&&bo(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&&bo(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&&bo(e,t.trailingComments,a,i),e.write(n+"}")}else r?t.comments!=null?(e.write(i),bo(e,t.comments,a,i),t.trailingComments!=null&&bo(e,t.trailingComments,a,i),e.write(n+"}")):t.trailingComments!=null?(e.write(i),bo(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){kb(e,t.expressions)},UnaryExpression(t,e){if(t.prefix){const{operator:n,argument:i,argument:{type:r}}=t;e.write(n);const a=mQ(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:K6=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:K6,ConditionalExpression(t,e){const{test:n}=t,i=e.expressionsPrecedence[n.type];i===ru||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===ru||n<e.expressionsPrecedence.CallExpression||ACe(t.callee)?(e.write("("),this[t.callee.type](t.callee,e),e.write(")")):this[t.callee.type](t.callee,e),kb(e,t.arguments)},CallExpression(t,e){const n=e.expressionsPrecedence[t.callee.type];n===ru||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("?."),kb(e,t.arguments)},ChainExpression(t,e){this[t.expression.type](t.expression,e)},MemberExpression(t,e){const n=e.expressionsPrecedence[t.object.type];n===ru||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(ECe(t.value),t)},RegExpLiteral(t,e){const{regex:n}=t;e.write(`/${n.pattern}/${n.flags}`,t)}},CCe={};class RCe{constructor(e){const n=e??CCe;this.output="",n.output!=null?(this.output=n.output,this.write=this.writeToStream):this.output="",this.generator=n.generator!=null?n.generator:gQ,this.expressionsPrecedence=n.expressionsPrecedence!=null?n.expressionsPrecedence:MCe,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 kCe(t,e){const n=new RCe(e);return n.generator[t.type](t,n),n.output}const DCe={};function OCe(t,e){const{SourceMapGenerator:n,filePath:i,handlers:r}=e||DCe,a=n?new n({file:i||"<unknown>.js"}):void 0,s=kCe(t,{comments:!0,generator:{...gQ,...r},sourceMap:a||void 0}),o=a?a.toJSON():void 0;return{value:s,map:o}}const ICe={JSXAttribute:NCe,JSXClosingElement:LCe,JSXClosingFragment:PCe,JSXElement:UCe,JSXEmptyExpression:FCe,JSXExpressionContainer:BCe,JSXFragment:zCe,JSXIdentifier:jCe,JSXMemberExpression:HCe,JSXNamespacedName:VCe,JSXOpeningElement:GCe,JSXOpeningFragment:WCe,JSXSpreadAttribute:qCe,JSXText:XCe};function NCe(t,e){this[t.name.type](t.name,e),t.value!==null&&t.value!==void 0&&(e.write("="),t.value.type==="Literal"?e.write('"'+bQ(String(t.value.value)).replace(/"/g,"&quot;")+'"',t):this[t.value.type](t.value,e))}function LCe(t,e){e.write("</"),this[t.name.type](t.name,e),e.write(">")}function PCe(t,e){e.write("</>",t)}function UCe(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 FCe(){}function BCe(t,e){e.write("{"),this[t.expression.type](t.expression,e),e.write("}")}function zCe(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 jCe(t,e){e.write(t.name,t)}function HCe(t,e){this[t.object.type](t.object,e),e.write("."),this[t.property.type](t.property,e)}function VCe(t,e){this[t.namespace.type](t.namespace,e),e.write(":"),this[t.name.type](t.name,e)}function GCe(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 WCe(t,e){e.write("<>",t)}function qCe(t,e){e.write("{"),this.SpreadElement(t,e),e.write("}")}function XCe(t,e){e.write(bQ(t.value).replace(/[<>{}]/g,KCe),t)}function bQ(t){return t.replace(/&(?=[#a-z])/gi,"&amp;")}function KCe(t){return t==="<"?"&lt;":t===">"?"&gt;":t==="{"?"&#123;":"&#125;"}function YCe(){const t=this.data(),e=t.settings||(t.settings={}),n=e.handlers||(e.handlers={});(e.plugins||(e.plugins=[])).push(pQ()),Object.assign(n,ICe)}function JCe(t){const e=this;this.compiler=n;function n(i,r){const a={...e.data("settings"),...t},s=OCe(i,{SourceMapGenerator:a.SourceMapGenerator,filePath:r.path||"unknown.js",handlers:a.handlers});return r.map=s.map,s.value}}function $Ce(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 ZCe(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}class nS{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}nS.prototype.normal={};nS.prototype.property={};nS.prototype.space=void 0;function vQ(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new nS(n,i,e)}function TI(t){return t.toLowerCase()}class Xo{constructor(e,n){this.attribute=n,this.property=e}}Xo.prototype.attribute="";Xo.prototype.booleanish=!1;Xo.prototype.boolean=!1;Xo.prototype.commaOrSpaceSeparated=!1;Xo.prototype.commaSeparated=!1;Xo.prototype.defined=!1;Xo.prototype.mustUseProperty=!1;Xo.prototype.number=!1;Xo.prototype.overloadedBoolean=!1;Xo.prototype.property="";Xo.prototype.spaceSeparated=!1;Xo.prototype.space=void 0;let QCe=0;const li=mg(),Ta=mg(),AI=mg(),Wt=mg(),Nr=mg(),T0=mg(),hl=mg();function mg(){return 2**++QCe}const CI=Object.freeze(Object.defineProperty({__proto__:null,boolean:li,booleanish:Ta,commaOrSpaceSeparated:hl,commaSeparated:T0,number:Wt,overloadedBoolean:AI,spaceSeparated:Nr},Symbol.toStringTag,{value:"Module"})),UD=Object.keys(CI);class BU extends Xo{constructor(e,n,i,r){let a=-1;if(super(e,n),$6(this,"space",r),typeof i=="number")for(;++a<UD.length;){const s=UD[a];$6(this,UD[a],(i&CI[s])===CI[s])}}}BU.prototype.defined=!0;function $6(t,e,n){n&&(t[e]=n)}function ny(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 nS(e,n,t.space)}const yQ=ny({properties:{ariaActiveDescendant:null,ariaAtomic:Ta,ariaAutoComplete:null,ariaBusy:Ta,ariaChecked:Ta,ariaColCount:Wt,ariaColIndex:Wt,ariaColSpan:Wt,ariaControls:Nr,ariaCurrent:null,ariaDescribedBy:Nr,ariaDetails:null,ariaDisabled:Ta,ariaDropEffect:Nr,ariaErrorMessage:null,ariaExpanded:Ta,ariaFlowTo:Nr,ariaGrabbed:Ta,ariaHasPopup:null,ariaHidden:Ta,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nr,ariaLevel:Wt,ariaLive:null,ariaModal:Ta,ariaMultiLine:Ta,ariaMultiSelectable:Ta,ariaOrientation:null,ariaOwns:Nr,ariaPlaceholder:null,ariaPosInSet:Wt,ariaPressed:Ta,ariaReadOnly:Ta,ariaRelevant:null,ariaRequired:Ta,ariaRoleDescription:Nr,ariaRowCount:Wt,ariaRowIndex:Wt,ariaRowSpan:Wt,ariaSelected:Ta,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 xQ(t,e){return e in t?t[e]:e}function _Q(t,e){return xQ(t,e.toLowerCase())}const eRe=ny({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:T0,acceptCharset:Nr,accessKey:Nr,action:null,allow:null,allowFullScreen:li,allowPaymentRequest:li,allowUserMedia:li,alt:null,as:null,async:li,autoCapitalize:null,autoComplete:Nr,autoFocus:li,autoPlay:li,blocking:Nr,capture:null,charSet:null,checked:li,cite:null,className:Nr,cols:Wt,colSpan:null,content:null,contentEditable:Ta,controls:li,controlsList:Nr,coords:Wt|T0,crossOrigin:null,data:null,dateTime:null,decoding:null,default:li,defer:li,dir:null,dirName:null,disabled:li,download:AI,draggable:Ta,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:li,formTarget:null,headers:Nr,height:Wt,hidden:AI,high:Wt,href:null,hrefLang:null,htmlFor:Nr,httpEquiv:Nr,id:null,imageSizes:null,imageSrcSet:null,inert:li,inputMode:null,integrity:null,is:null,isMap:li,itemId:null,itemProp:Nr,itemRef:Nr,itemScope:li,itemType:Nr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:li,low:Wt,manifest:null,max:null,maxLength:Wt,media:null,method:null,min:null,minLength:Wt,multiple:li,muted:li,name:null,nonce:null,noModule:li,noValidate:li,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:li,optimum:Wt,pattern:null,ping:Nr,placeholder:null,playsInline:li,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:li,referrerPolicy:null,rel:Nr,required:li,reversed:li,rows:Wt,rowSpan:Wt,sandbox:Nr,scope:null,scoped:li,seamless:li,selected:li,shadowRootClonable:li,shadowRootDelegatesFocus:li,shadowRootMode:null,shape:null,size:Wt,sizes:null,slot:null,span:Wt,spellCheck:Ta,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:li,useMap:null,value:Ta,width:Wt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nr,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:li,declare:li,event:null,face:null,frame:null,frameBorder:null,hSpace:Wt,leftMargin:Wt,link:null,longDesc:null,lowSrc:null,marginHeight:Wt,marginWidth:Wt,noResize:li,noHref:li,noShade:li,noWrap:li,object:null,profile:null,prompt:null,rev:null,rightMargin:Wt,rules:null,scheme:null,scrolling:Ta,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:li,disableRemotePlayback:li,prefix:null,property:null,results:Wt,security:null,unselectable:null},space:"html",transform:_Q}),tRe=ny({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:hl,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:Nr,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:li,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:T0,g2:T0,glyphName:T0,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:hl,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:Nr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Wt,pointsAtY:Wt,pointsAtZ:Wt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:hl,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:hl,rev:hl,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:hl,requiredFeatures:hl,requiredFonts:hl,requiredFormats:hl,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:hl,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:hl,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:hl,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:xQ}),SQ=ny({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()}}),wQ=ny({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_Q}),EQ=ny({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),nRe={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"},iRe=/[A-Z]/g,Z6=/-[a-z]/g,rRe=/^data[-\w.:]+$/i;function aRe(t,e){const n=TI(e);let i=e,r=Xo;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&rRe.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(Z6,oRe);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!Z6.test(a)){let s=a.replace(iRe,sRe);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}r=BU}return new r(i,e)}function sRe(t){return"-"+t.toLowerCase()}function oRe(t){return t.charAt(1).toUpperCase()}const lRe=vQ([yQ,eRe,SQ,wQ,EQ],"html"),zU=vQ([yQ,tRe,SQ,wQ,EQ],"svg");function cRe(t){return t.join(" ").trim()}var jU={},Q6=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,uRe=/\n/g,fRe=/^\s*/,hRe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,dRe=/^:\s*/,pRe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,mRe=/^[;\s]*/,gRe=/^\s+|\s+$/g,bRe=`
`,eH="/",tH="*",im="",vRe="comment",yRe="declaration",xRe=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(uRe);b&&(n+=b.length);var y=g.lastIndexOf(bRe);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(fRe)}function u(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=a();if(!(eH!=t.charAt(0)||tH!=t.charAt(1))){for(var b=2;im!=t.charAt(b)&&(tH!=t.charAt(b)||eH!=t.charAt(b+1));)++b;if(b+=2,im===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:vRe,comment:y})}}function h(){var g=a(),b=l(hRe);if(b){if(f(),!l(dRe))return o("property missing ':'");var y=l(pRe),m=g({type:yRe,property:nH(b[0].replace(Q6,im)),value:y?nH(y[0].replace(Q6,im)):im});return l(mRe),m}}function d(){var g=[];u(g);for(var b;b=h();)b!==!1&&(g.push(b),u(g));return g}return c(),d()};function nH(t){return t?t.replace(gRe,im):im}var _Re=Fm&&Fm.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jU,"__esModule",{value:!0});jU.default=wRe;var SRe=_Re(xRe);function wRe(t,e){var n=null;if(!t||typeof t!="string")return n;var i=(0,SRe.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 ERe=/^--[a-zA-Z0-9_-]+$/,MRe=/-([a-z])/g,TRe=/^[^-]+$/,ARe=/^-(webkit|moz|ms|o|khtml)-/,CRe=/^-(ms)-/,RRe=function(t){return!t||TRe.test(t)||ERe.test(t)},kRe=function(t,e){return e.toUpperCase()},iH=function(t,e){return"".concat(e,"-")},DRe=function(t,e){return e===void 0&&(e={}),RRe(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(CRe,iH):t=t.replace(ARe,iH),t.replace(MRe,kRe))};TC.camelCase=DRe;var ORe=Fm&&Fm.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},IRe=ORe(jU),NRe=TC;function RI(t,e){var n={};return!t||typeof t!="string"||(0,IRe.default)(t,function(i,r){i&&r&&(n[(0,NRe.camelCase)(i,e)]=r)}),n}RI.default=RI;var LRe=RI;const PRe=Rc(LRe),kI={}.hasOwnProperty,URe=/[A-Z]/g,FRe=new Set(["td","th"]);function BRe(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=aRe(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?nRe[h.property]||h.property:h.attribute,Array.isArray(f)&&(f=h.commaSeparated?ZCe(f):cRe(f)),o==="style"){let g=typeof f=="object"?f:zRe(String(f),t.tagName);e.stylePropertyNameCase==="css"&&(g=jRe(g));const b=[];let y;for(y in g)kI.call(g,y)&&b.push({type:"Property",method:!1,shorthand:!1,computed:!1,key:sf(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&&FRe.has(t.tagName)&&o==="align"){l=String(f);continue}else d={type:"Literal",value:String(f)};sf(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"?MQ("textAlign"):"textAlign";c.push({type:"Property",method:!1,shorthand:!1,computed:!1,key:sf(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 zRe(t,e){try{return PRe(t,{reactCompat:!0})}catch(n){const i=n;throw new Error("Could not parse `style` attribute on `"+e+"`",{cause:i})}}function jRe(t){const e={};let n;for(n in t)kI.call(t,n)&&(e[MQ(n)]=t[n]);return e}function MQ(t){let e=t.replace(URe,HRe);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function HRe(t){return"-"+t.toLowerCase()}const VRe={}.hasOwnProperty,GRe=[];function uT(t,e){const n=e?[...e].sort(HU):GRe;n.length>0&&TQ(t,{comments:n,index:0})}function TQ(t,e){if(e.index===e.comments.length)return;const n=[],i=[];let r;for(r in t)if(VRe.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(...rH(e,t,!1,{leading:!0,trailing:!1}));let a=-1;for(;++a<n.length;)TQ(n[a],e);i.push(...rH(e,t,!0,{leading:!1,trailing:n.length>0})),i.length>0&&(t.comments=i)}function rH(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 aH(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 sH(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 WRe(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 qRe=/[ \t\n\f\r]/g;function XRe(t){return typeof t=="object"?t.type==="text"?oH(t.value):!1:oH(t)}function oH(t){return t.replace(qRe,"")===""}function KRe(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"&&XRe(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 YRe(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 JRe={comment:$Ce,doctype:$Re,element:BRe,mdxFlowExpression:aH,mdxJsxFlowElement:sH,mdxJsxTextElement:sH,mdxTextExpression:aH,mdxjsEsm:WRe,root:KRe,text:YRe};function $Re(){}const AQ=RQ("end"),CQ=RQ("start");function RQ(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 kQ(t){const e=CQ(t),n=AQ(t);if(e&&n)return{start:e,end:n}}const lH={}.hasOwnProperty;function ZRe(t,e){const n=e||{};function i(r,...a){let s=i.invalid;const o=i.handlers;if(r&&lH.call(r,t)){const l=String(r[t]);s=lH.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 QRe={}.hasOwnProperty,e3e=new Set(["table","tbody","thead","tfoot","tr"]);function t3e(t){const e=ZRe("type",{invalid:n3e,unknown:i3e,handlers:{...JRe,...t.handlers}});return{elementAttributeNameCase:t.elementAttributeNameCase||"react",schema:t.space==="svg"?zU:lRe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1,comments:[],esm:[],all:r3e,createJsxAttributeName:s3e,createJsxElementName:o3e,handle:n,inherit:a3e,patch:DQ};function n(i){return e(i,this)}}function n3e(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function i3e(t){throw new Error("Cannot handle unknown node `"+t.type+"`")}function r3e(t){const e=t.children||[];let n=-1;const i=[],r=this.schema.space==="html"&&t.type==="element"&&e3e.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 a3e(t,e){const n=t.data;let i,r;if(DQ(t,e),n){for(r in n)QRe.call(n,r)&&r!=="estree"&&(i||(i={}),i[r]=n[r]);i&&(e.data=i)}}function DQ(t,e){const n=kQ(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 s3e(t){const e=OQ(t);if(e.type==="JSXMemberExpression")throw new Error("Member expressions in attribute names are not supported");return e}function o3e(t){return OQ(t)}function OQ(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 l3e(t,e){const n=t3e(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 c3e(t){return function(e){return l3e(e,t)}}function u3e(){return{enter:{mdxFlowExpression:h3e,mdxTextExpression:d3e},exit:{mdxFlowExpression:cH,mdxFlowExpressionChunk:uH,mdxTextExpression:cH,mdxTextExpressionChunk:uH}}}function f3e(){return{handlers:{mdxFlowExpression:fH,mdxTextExpression:fH},unsafe:[{character:"{",inConstruct:["phrasing"]},{atBreak:!0,character:"{"}]}}function h3e(t){this.enter({type:"mdxFlowExpression",value:""},t),this.buffer()}function d3e(t){this.enter({type:"mdxTextExpression",value:""},t),this.buffer()}function cH(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 uH(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}function fH(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 p3e=["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"],hH={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 IQ(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=48&&e<=57}function m3e(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}function g3e(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=122||e>=65&&e<=90}function dH(t){return g3e(t)||IQ(t)}const pH=document.createElement("i");function Q1(t){const e="&"+t+";";pH.innerHTML=e;const n=pH.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}const b3e=["","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 v3e(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 m=t.charCodeAt(a+1);if(m===9||m===10||m===12||m===32||m===38||m===60||Number.isNaN(m)||i&&m===i){o+=String.fromCharCode(d),f++;continue}const x=a+1;let _=x,w=x,M;if(m===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"?dH:M==="decimal"?IQ:m3e;for(w--;++w<=t.length;){const j=t.charCodeAt(w);if(!D(j))break;C+=String.fromCharCode(j),M==="named"&&p3e.includes(C)&&(S=C,A=Q1(C))}let R=t.charCodeAt(w)===59;if(R){w++;const j=M==="named"?Q1(C):!1;j&&(S=C,A=j)}let L=1+w-x,U="";if(!(!R&&n.nonTerminated===!1))if(!C)M!=="named"&&b(4,L);else if(M==="named"){if(R&&!A)b(5,1);else if(S!==C&&(w=_+S.length,L=1+w-_,R=!1),!R){const j=S?1:3;if(n.attribute){const z=t.charCodeAt(w);z===61?(b(j,L),A=""):dH(z)?A="":b(j,L)}else b(j,L)}U=A}else{R||b(2,L);let j=Number.parseInt(C,M==="hexadecimal"?16:10);if(y3e(j))b(7,L),U="�";else if(j in hH)b(6,L),U=hH[j];else{let z="";x3e(j)&&b(6,L),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(m,x){let _;n.warning&&(_=g(),_.column+=x,_.offset+=x,n.warning.call(n.warningContext||void 0,b3e[m],_,m))}function y(){o&&(r.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:h,end:g()}),o="")}}function y3e(t){return t>=55296&&t<=57343||t>1114111}function x3e(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 _3e=/["&'<>`]/g,S3e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,w3e=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,E3e=/[|\\{}()[\]^$+*?.]/g,mH=new WeakMap;function M3e(t,e){if(t=t.replace(e.subset?T3e(e.subset):_3e,i),e.subset||e.escapeOnly)return t;return t.replace(S3e,n).replace(w3e,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 T3e(t){let e=mH.get(t);return e||(e=A3e(t),mH.set(t,e)),e}function A3e(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(E3e,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function C3e(t){return"&#x"+t.toString(16).toUpperCase()+";"}function R3e(t,e){return M3e(t,Object.assign({format:C3e},e))}const NQ="  ";function k3e(){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:m,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:m,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=v3e(this.resume(),{nonTerminated:!1}),D.position,D.position.end=e(A.end)}function m(A){const C=this.data.mdxJsxTag,D=C.attributes[C.attributes.length-1];D.type;const R={type:"mdxJsxAttributeValueExpression",value:this.resume()},L=A.estree;L&&(R.data={estree:L}),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)+"` ("+xc(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],L=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)+"` ("+xc({start:C.start,end:C.end})+")"+L,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+"` ("+xc(C.end)+") or another opening tag after the start of `"+C.type+"` ("+xc(C.start)+")",{start:A.start,end:A.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function S(A){return"<"+(A.close?"/":"")+(A.name||"")+">"}}function D3e(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=I3e,{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=LQ(u),b=PQ(g),y=u.createTracker(f),m=u.createTracker(f),x=[],_=(h?b:"")+"<"+(l.name||""),w=u.enter(l.type);if(y.move(_),m.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 L;if(R.type==="mdxJsxExpressionAttribute")L="{"+(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+R3e(U,{subset:[q]})+q}L=j+(z?"=":"")+z}x.push(L)}}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=m;let D=-1;for(;++D<x.length;)x[D]=b+NQ+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(O3e(l,u,A.current())),C+=A.move(`
`))),d||(C+=A.move((h?b:"")+"</"+(l.name||"")+">")),w(),C}}function O3e(t,e,n){const i=e.indexStack,r=t.children,a=e.createTracker(n),s=PQ(LQ(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 LQ(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 PQ(t){return NQ.repeat(t)}function I3e(){return"<"}function N3e(){return{enter:{mdxjsEsm:P3e},exit:{mdxjsEsm:U3e,mdxjsEsmData:F3e}}}function L3e(){return{handlers:{mdxjsEsm:B3e}}}function P3e(t){this.enter({type:"mdxjsEsm",value:""},t),this.buffer()}function U3e(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 F3e(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}function B3e(t){return t.value||""}function z3e(){return[u3e(),k3e(),N3e()]}function j3e(t){return{extensions:[f3e(),D3e(t),L3e()]}}var H3e=MI();const to=np(/[A-Za-z]/),ro=np(/[\dA-Za-z]/),V3e=np(/[#-'*+\--9=?A-Z^-~]/);function hT(t){return t!==null&&(t<32||t===127)}const DI=np(/\d/),G3e=np(/[\dA-Fa-f]/),W3e=np(/[!-/:-@[-`{-~]/);function bn(t){return t!==null&&t<-2}function zi(t){return t!==null&&(t<0||t===32)}function ii(t){return t===-2||t===-1||t===32}const AC=np(new RegExp("\\p{P}|\\p{S}","u")),xo=np(/\s/);function np(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Oi(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(l){return ii(l)?(t.enter(n),o(l)):e(l)}function o(l){return ii(l)&&a++<r?(t.consume(l),o):(t.exit(n),e(l))}}const q3e={}.hasOwnProperty,X3e=Symbol("continue"),FD=Symbol("exit"),K3e=Symbol("skip");function Y3e(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?gH(n(a,s,o,l)):[];if(u[0]===FD)return u;if(u[0]!==K3e){let f;for(f in a)if(q3e.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 m=r(y,f,b,h)();if(m[0]===FD)return m;b=typeof m[1]=="number"?m[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?gH(i(a,s,o,l)):u}}}function gH(t){return Array.isArray(t)?t:typeof t=="number"?[X3e,t]:[t]}function BD(t){return!!(t&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&t.type.length>0)}function UQ(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=J3e(t,e.tokenTypes),g=d.value,b=n+g+i,y=e.expression&&bH(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(bH(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,Y3e(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),m(_)}),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||(m(_),Array.isArray(l)?l.push(_):l(_))}return{estree:u,error:f,swallow:c};function m(_){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=$3e(d.stops,w);return M||(M={line:e.start.line,column:e.start.column,offset:e.start.offset}),M}}function bH(t){return/^\s*$/.test(t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,""))}function J3e(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=Z3e(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 $3e(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 Z3e(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 eh(t){const e=t||{},n=e.loc||{},i=e.range||[void 0,void 0],r=vH(n.start,i[0]||e.start),a=vH(n.end,i[1]||e.end);if(r&&a)return{start:r,end:a}}function vH(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 Q3e=2,s0="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",eke="#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",tke="#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",yH="#unexpected-type-in-code-expected-an-object-spread-spread",nke="#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",ike="#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(),m}function m(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=s0+eke,M}if(bn(w))return t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),_;if(w===125&&d===0){const M=a?rke.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||bn(w)?(t.exit(r),m(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=s0+tke,S}return ii(w)?Oi(t,m,"linePrefix",Q3e+1)(w):m(w)}}function rke(t,e,n,i,r,a,s){const o=UQ(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=eh(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=s0+yH,f}if(c.expression.properties[1]){const u=eh(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=s0+nke,f}if(c.expression.properties[0]&&c.expression.properties[0].type!=="SpreadElement"){const u=eh(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=s0+yH,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=s0+ike,{type:"nok",message:c}}return{type:"ok",estree:l}}function ake(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(m){return g(m)}function g(m){return dT.call(h,c,b,"mdxFlowExpression","mdxFlowExpressionMarker","mdxFlowExpressionChunk",i,s,n,r,a)(m)}function b(m){return ii(m)?Oi(c,y,"whitespace")(m):y(m)}function y(m){const x=h.parser.constructs.flow[60],w=(Array.isArray(x)?x:x?[x]:[]).find(function(M){return M.name==="mdxJsxFlowTag"});return m===60&&w?c.attempt(w,y,f)(m):m===null||bn(m)?u(m):f(m)}}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 xH="https://github.com/micromark/micromark-extension-mdx-jsx";function FQ(t,e,n,i,r,a,s,o,l,c,u,f,h,d,g,b,y,m,x,_,w,M,S,A,C,D,R,L,U,j,z,q){const F=this;let V,H;return W;function W($){return t.enter(o),t.enter(l),t.consume($),t.exit(l),B}function B($){return zi($)?n($):(V=J,K($))}function J($){if($===47)return t.enter(c),t.consume($),t.exit(c),V=Z,K;if($===62)return ae($);if($!==null&&$>=0&&Yc($))return t.enter(f),t.enter(h),t.consume($),G;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 ae($);if($!==null&&$>=0&&Yc($))return t.enter(f),t.enter(h),t.consume($),G;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 G($){if($!==null&&$>=0&&sx($,{jsx:!0}))return t.consume($),G;if($===46||$===47||$===58||$===62||$===123||zi($)||xo($))return t.exit(h),V=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),V=oe,K;if($===58)return t.enter(b),t.consume($),t.exit(b),V=Se,K;if($===47||$===62||$===123||$!==null&&$>=0&&Yc($))return t.exit(f),je($);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 oe($){if($!==null&&$>=0&&Yc($))return t.enter(g),t.consume($),le;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 le($){if($!==null&&$>=0&&sx($,{jsx:!0}))return t.consume($),le;if($===46||$===47||$===62||$===123||zi($)||xo($))return t.exit(g),V=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),V=oe,K;if($===47||$===62||$===123||$!==null&&$>=0&&Yc($))return t.exit(f),je($);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 Se($){if($!==null&&$>=0&&Yc($))return t.enter(y),t.consume($),Oe;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 Oe($){if($!==null&&$>=0&&sx($,{jsx:!0}))return t.consume($),Oe;if($===47||$===62||$===123||zi($)||xo($))return t.exit(y),V=Be,K($);me($,"in local name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Be($){if($===47||$===62||$===123||$!==null&&$>=0&&Yc($))return t.exit(f),je($);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 je($){if($===47)return t.enter(u),t.consume($),t.exit(u),V=Qe,K;if($===62)return ae($);if($===123)return dT.call(F,t,He,m,x,_,i,r,a,!0,!1,s)($);if($!==null&&$>=0&&Yc($))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 He($){return V=je,K($)}function pe($){if($!==null&&$>=0&&sx($,{jsx:!0}))return t.consume($),pe;if($===47||$===58||$===61||$===62||$===123||zi($)||xo($))return t.exit(S),V=ze,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 ze($){if($===58)return t.enter(A),t.consume($),t.exit(A),V=Ie,K;if($===61)return t.exit(M),t.enter(D),t.consume($),t.exit(D),V=Me,K;if($===47||$===62||$===123||zi($)||xo($)||$!==null&&$>=0&&Yc($))return t.exit(M),t.exit(w),V=je,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&&Yc($))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&&sx($,{jsx:!0}))return t.consume($),qe;if($===47||$===61||$===62||$===123||zi($)||xo($))return t.exit(C),t.exit(M),V=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),V=Me,K;if($===47||$===62||$===123||$!==null&&$>=0&&Yc($))return t.exit(w),je($);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 Me($){if($===34||$===39)return t.enter(R),t.enter(L),t.consume($),t.exit(L),H=$,Ne;if($===123)return dT.call(F,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),V=je,K($)}function Ne($){return $===null&&me($,"in attribute value","a corresponding closing quote `"+String.fromCodePoint(H)+"`"),$===H?(t.enter(L),t.consume($),t.exit(L),t.exit(R),t.exit(w),H=void 0,V=je,K):bn($)?(V=Ne,K($)):(t.enter(U),Ue($))}function Ue($){return $===null||$===H||bn($)?(t.exit(U),Ne($)):(t.consume($),Ue)}function Qe($){if($===62)return ae($);me($,"after self-closing slash","`>` to end the tag"+($===42||$===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function ae($){return t.enter(l),t.consume($),t.exit(l),t.exit(o),e}function K($){return bn($)?(t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),he):ii($)||xo($)?(t.enter("esWhitespace"),ce($)):V($)}function ce($){return bn($)?(t.exit("esWhitespace"),K($)):ii($)||xo($)?(t.consume($),ce):(t.exit("esWhitespace"),V($))}function he($){if(!s&&F.parser.lazy[F.now().line]){const Ve=new tr("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",F.now(),"micromark-extension-mdx-jsx:unexpected-lazy");throw Ve.url=xH+"#unexpected-lazy-line-in-container-expected-line-to-be",Ve}return K($)}function me($,Ve,Xe){const mt=new tr("Unexpected "+($===null?"end of file":"character `"+($===96?"` ` `":String.fromCodePoint($))+"` ("+ske($)+")")+" "+Ve+", expected "+Xe,F.now(),"micromark-extension-mdx-jsx:unexpected-"+($===null?"eof":"character"));throw mt.url=xH+($===null?"#unexpected-end-of-file-at-expected-expect":"#unexpected-character-at-expected-expect"),mt}}function ske(t){return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function oke(t,e){return{name:"mdxJsxTextTag",tokenize:n};function n(i,r,a){return FQ.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 lke(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 FQ.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 ii(f)?Oi(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||bn(f)?r(f):a(f)}}}function cke(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:lke(n||void 0,{acornOptions:i,addResult:e.addResult||void 0})},text:{60:oke(n||void 0,{acornOptions:i,addResult:e.addResult||void 0})}}}function uke(){return{disable:{null:["autolink","codeIndented","htmlFlow","htmlText"]}}}function Ml(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 uc(t,e){return t.length>0?(Ml(t,t.length,0,e),t):e}function mv(t){if(t===null||zi(t)||xo(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:fke,tokenize:hke};function fke(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};_H(f,-l),_H(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=uc(c,[["enter",t[i][1],e],["exit",t[i][1],e]])),c=uc(c,[["enter",r,e],["enter",s,e],["exit",s,e],["enter",a,e]]),c=uc(c,CC(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),c=uc(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=uc(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Ml(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 hke(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=mv(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=mv(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 _H(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const dke={name:"autolink",tokenize:pke};function pke(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 to(d)?(t.consume(d),s):d===64?n(d):c(d)}function s(d){return d===43||d===45||d===46||ro(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||ro(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):V3e(d)?(t.consume(d),c):n(d)}function u(d){return ro(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||ro(d))&&i++<63){const g=d===45?h:f;return t.consume(d),g}return n(d)}}const iy={partial:!0,tokenize:mke};function mke(t,e,n){return i;function i(a){return ii(a)?Oi(t,r,"linePrefix")(a):r(a)}function r(a){return a===null||bn(a)?e(a):n(a)}}const BQ={continuation:{tokenize:bke},exit:vke,name:"blockQuote",tokenize:gke};function gke(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 ii(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function bke(t,e,n){const i=this;return r;function r(s){return ii(s)?Oi(t,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return t.attempt(BQ,e,n)(s)}}function vke(t){t.exit("blockQuote")}const zQ={name:"characterEscape",tokenize:yke};function yke(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 W3e(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(a)}}const jQ={name:"characterReference",tokenize:xke};function xke(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=ro,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=G3e,u):(t.enter("characterReferenceValue"),a=7,s=DI,u(f))}function u(f){if(f===59&&r){const h=t.exit("characterReferenceValue");return s===ro&&!Q1(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 SH={partial:!0,tokenize:Ske},wH={concrete:!0,name:"codeFenced",tokenize:_ke};function _ke(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"),ii(S)?Oi(t,f,"whitespace")(S):f(S))}function f(S){return S===null||bn(S)?(t.exit("codeFencedFence"),i.interrupt?e(S):t.check(SH,b,w)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||bn(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):ii(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Oi(t,d,"whitespace")(S)):S===96&&S===o?n(S):(t.consume(S),h)}function d(S){return S===null||bn(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||bn(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"),m}function m(S){return a>0&&ii(S)?Oi(t,x,"linePrefix",a+1)(S):x(S)}function x(S){return S===null||bn(S)?t.check(SH,b,w)(S):(t.enter("codeFlowValue"),_(S))}function _(S){return S===null||bn(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"),L}function L(q){return S.enter("codeFencedFence"),ii(q)?Oi(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"),ii(q)?Oi(S,z,"whitespace")(q):z(q)):C(q)}function z(q){return q===null||bn(q)?(S.exit("codeFencedFence"),A(q)):C(q)}}}function Ske(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:Eke},wke={partial:!0,tokenize:Mke};function Eke(t,e,n){const i=this;return r;function r(c){return t.enter("codeIndented"),Oi(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):bn(c)?t.attempt(wke,s,l)(c):(t.enter("codeFlowValue"),o(c))}function o(c){return c===null||bn(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),o)}function l(c){return t.exit("codeIndented"),e(c)}}function Mke(t,e,n){const i=this;return r;function r(s){return i.parser.lazy[i.now().line]?n(s):bn(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),r):Oi(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):bn(s)?r(s):n(s)}}const Tke={name:"codeText",previous:Cke,resolve:Ake,tokenize:Rke};function Ake(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 Cke(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Rke(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)):bn(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||bn(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 kke{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&&ox(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),ox(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ox(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);ox(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);ox(this.left,n.reverse())}}}function ox(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 HQ(t){const e={};let n=-1,i,r,a,s,o,l,c;const u=new kke(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,Dke(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 Ml(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Dke(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 m=o.slice(y[h],y[h+1]),x=a.pop();l.push([x,x+m.length-1]),t.splice(x,2,m)}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 Oke={resolve:Nke,tokenize:Lke},Ike={partial:!0,tokenize:Pke};function Nke(t){return HQ(t),t}function Lke(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):bn(o)?t.check(Ike,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 Pke(t,e,n){const i=this;return r;function r(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Oi(t,a,"linePrefix")}function a(s){if(s===null||bn(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 VQ(t,e,n,i,r,a,s,o,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(m){return m===60?(t.enter(i),t.enter(r),t.enter(a),t.consume(m),t.exit(a),h):m===null||m===32||m===41||hT(m)?n(m):(t.enter(i),t.enter(s),t.enter(o),t.enter("chunkString",{contentType:"string"}),b(m))}function h(m){return m===62?(t.enter(a),t.consume(m),t.exit(a),t.exit(r),t.exit(i),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===62?(t.exit("chunkString"),t.exit(o),h(m)):m===null||m===60||bn(m)?n(m):(t.consume(m),m===92?g:d)}function g(m){return m===60||m===62||m===92?(t.consume(m),d):d(m)}function b(m){return!u&&(m===null||m===41||zi(m))?(t.exit("chunkString"),t.exit(o),t.exit(s),t.exit(i),e(m)):u<c&&m===40?(t.consume(m),u++,b):m===41?(t.consume(m),u--,b):m===null||m===32||m===40||hT(m)?n(m):(t.consume(m),m===92?y:b)}function y(m){return m===40||m===41||m===92?(t.consume(m),b):b(m)}}function GQ(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):bn(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||bn(d)||o++>999?(t.exit("chunkString"),u(d)):(t.consume(d),l||(l=!ii(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(t.consume(d),o++,f):f(d)}}function WQ(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):bn(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),Oi(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===s||h===null||bn(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 d1(t,e){let n;return i;function i(r){return bn(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):ii(r)?Oi(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}function vu(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Uke={name:"definition",tokenize:Bke},Fke={partial:!0,tokenize:zke};function Bke(t,e,n){const i=this;let r;return a;function a(d){return t.enter("definition"),s(d)}function s(d){return GQ.call(i,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return r=vu(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 zi(d)?d1(t,c)(d):c(d)}function c(d){return VQ(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return t.attempt(Fke,f,f)(d)}function f(d){return ii(d)?Oi(t,h,"whitespace")(d):h(d)}function h(d){return d===null||bn(d)?(t.exit("definition"),i.parser.defined.push(r),e(d)):n(d)}}function zke(t,e,n){return i;function i(o){return zi(o)?d1(t,r)(o):n(o)}function r(o){return WQ(t,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return ii(o)?Oi(t,s,"whitespace")(o):s(o)}function s(o){return o===null||bn(o)?e(o):n(o)}}const jke={name:"hardBreakEscape",tokenize:Hke};function Hke(t,e,n){return i;function i(a){return t.enter("hardBreakEscape"),t.consume(a),r}function r(a){return bn(a)?(t.exit("hardBreakEscape"),e(a)):n(a)}}const Vke={name:"headingAtx",resolve:Gke,tokenize:Wke};function Gke(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"},Ml(t,i,n-i+1,[["enter",r,e],["enter",a,e],["exit",a,e],["exit",r,e]])),t}function Wke(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||zi(u)?(t.exit("atxHeadingSequence"),o(u)):n(u)}function o(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||bn(u)?(t.exit("atxHeading"),e(u)):ii(u)?Oi(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||zi(u)?(t.exit("atxHeadingText"),o(u)):(t.consume(u),c)}}const qke=["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"],EH=["pre","script","style","textarea"],Xke={concrete:!0,name:"htmlFlow",resolveTo:Jke,tokenize:$ke},Kke={partial:!0,tokenize:Qke},Yke={partial:!0,tokenize:Zke};function Jke(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 $ke(t,e,n){const i=this;let r,a,s,o,l;return c;function c(G){return u(G)}function u(G){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(G),f}function f(G){return G===33?(t.consume(G),h):G===47?(t.consume(G),a=!0,b):G===63?(t.consume(G),r=3,i.interrupt?e:B):to(G)?(t.consume(G),s=String.fromCharCode(G),y):n(G)}function h(G){return G===45?(t.consume(G),r=2,d):G===91?(t.consume(G),r=5,o=0,g):to(G)?(t.consume(G),r=4,i.interrupt?e:B):n(G)}function d(G){return G===45?(t.consume(G),i.interrupt?e:B):n(G)}function g(G){const de="CDATA[";return G===de.charCodeAt(o++)?(t.consume(G),o===de.length?i.interrupt?e:U:g):n(G)}function b(G){return to(G)?(t.consume(G),s=String.fromCharCode(G),y):n(G)}function y(G){if(G===null||G===47||G===62||zi(G)){const de=G===47,oe=s.toLowerCase();return!de&&!a&&EH.includes(oe)?(r=1,i.interrupt?e(G):U(G)):qke.includes(s.toLowerCase())?(r=6,de?(t.consume(G),m):i.interrupt?e(G):U(G)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(G):a?x(G):_(G))}return G===45||ro(G)?(t.consume(G),s+=String.fromCharCode(G),y):n(G)}function m(G){return G===62?(t.consume(G),i.interrupt?e:U):n(G)}function x(G){return ii(G)?(t.consume(G),x):R(G)}function _(G){return G===47?(t.consume(G),R):G===58||G===95||to(G)?(t.consume(G),w):ii(G)?(t.consume(G),_):R(G)}function w(G){return G===45||G===46||G===58||G===95||ro(G)?(t.consume(G),w):M(G)}function M(G){return G===61?(t.consume(G),S):ii(G)?(t.consume(G),M):_(G)}function S(G){return G===null||G===60||G===61||G===62||G===96?n(G):G===34||G===39?(t.consume(G),l=G,A):ii(G)?(t.consume(G),S):C(G)}function A(G){return G===l?(t.consume(G),l=null,D):G===null||bn(G)?n(G):(t.consume(G),A)}function C(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||zi(G)?M(G):(t.consume(G),C)}function D(G){return G===47||G===62||ii(G)?_(G):n(G)}function R(G){return G===62?(t.consume(G),L):n(G)}function L(G){return G===null||bn(G)?U(G):ii(G)?(t.consume(G),L):n(G)}function U(G){return G===45&&r===2?(t.consume(G),F):G===60&&r===1?(t.consume(G),V):G===62&&r===4?(t.consume(G),J):G===63&&r===3?(t.consume(G),B):G===93&&r===5?(t.consume(G),W):bn(G)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(Kke,Z,j)(G)):G===null||bn(G)?(t.exit("htmlFlowData"),j(G)):(t.consume(G),U)}function j(G){return t.check(Yke,z,Z)(G)}function z(G){return t.enter("lineEnding"),t.consume(G),t.exit("lineEnding"),q}function q(G){return G===null||bn(G)?j(G):(t.enter("htmlFlowData"),U(G))}function F(G){return G===45?(t.consume(G),B):U(G)}function V(G){return G===47?(t.consume(G),s="",H):U(G)}function H(G){if(G===62){const de=s.toLowerCase();return EH.includes(de)?(t.consume(G),J):U(G)}return to(G)&&s.length<8?(t.consume(G),s+=String.fromCharCode(G),H):U(G)}function W(G){return G===93?(t.consume(G),B):U(G)}function B(G){return G===62?(t.consume(G),J):G===45&&r===2?(t.consume(G),B):U(G)}function J(G){return G===null||bn(G)?(t.exit("htmlFlowData"),Z(G)):(t.consume(G),J)}function Z(G){return t.exit("htmlFlow"),e(G)}}function Zke(t,e,n){const i=this;return r;function r(s){return bn(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 Qke(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(iy,e,n)}}const eDe={name:"htmlText",tokenize:tDe};function tDe(t,e,n){const i=this;let r,a,s;return o;function o(B){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(B),l}function l(B){return B===33?(t.consume(B),c):B===47?(t.consume(B),M):B===63?(t.consume(B),_):to(B)?(t.consume(B),C):n(B)}function c(B){return B===45?(t.consume(B),u):B===91?(t.consume(B),a=0,g):to(B)?(t.consume(B),x):n(B)}function u(B){return B===45?(t.consume(B),d):n(B)}function f(B){return B===null?n(B):B===45?(t.consume(B),h):bn(B)?(s=f,V(B)):(t.consume(B),f)}function h(B){return B===45?(t.consume(B),d):f(B)}function d(B){return B===62?F(B):B===45?h(B):f(B)}function g(B){const J="CDATA[";return B===J.charCodeAt(a++)?(t.consume(B),a===J.length?b:g):n(B)}function b(B){return B===null?n(B):B===93?(t.consume(B),y):bn(B)?(s=b,V(B)):(t.consume(B),b)}function y(B){return B===93?(t.consume(B),m):b(B)}function m(B){return B===62?F(B):B===93?(t.consume(B),m):b(B)}function x(B){return B===null||B===62?F(B):bn(B)?(s=x,V(B)):(t.consume(B),x)}function _(B){return B===null?n(B):B===63?(t.consume(B),w):bn(B)?(s=_,V(B)):(t.consume(B),_)}function w(B){return B===62?F(B):_(B)}function M(B){return to(B)?(t.consume(B),S):n(B)}function S(B){return B===45||ro(B)?(t.consume(B),S):A(B)}function A(B){return bn(B)?(s=A,V(B)):ii(B)?(t.consume(B),A):F(B)}function C(B){return B===45||ro(B)?(t.consume(B),C):B===47||B===62||zi(B)?D(B):n(B)}function D(B){return B===47?(t.consume(B),F):B===58||B===95||to(B)?(t.consume(B),R):bn(B)?(s=D,V(B)):ii(B)?(t.consume(B),D):F(B)}function R(B){return B===45||B===46||B===58||B===95||ro(B)?(t.consume(B),R):L(B)}function L(B){return B===61?(t.consume(B),U):bn(B)?(s=L,V(B)):ii(B)?(t.consume(B),L):D(B)}function U(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(t.consume(B),r=B,j):bn(B)?(s=U,V(B)):ii(B)?(t.consume(B),U):(t.consume(B),z)}function j(B){return B===r?(t.consume(B),r=void 0,q):B===null?n(B):bn(B)?(s=j,V(B)):(t.consume(B),j)}function z(B){return B===null||B===34||B===39||B===60||B===61||B===96?n(B):B===47||B===62||zi(B)?D(B):(t.consume(B),z)}function q(B){return B===47||B===62||zi(B)?D(B):n(B)}function F(B){return B===62?(t.consume(B),t.exit("htmlTextData"),t.exit("htmlText"),e):n(B)}function V(B){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),H}function H(B){return ii(B)?Oi(t,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):W(B)}function W(B){return t.enter("htmlTextData"),s(B)}}const VU={name:"labelEnd",resolveAll:aDe,resolveTo:sDe,tokenize:oDe},nDe={tokenize:lDe},iDe={tokenize:cDe},rDe={tokenize:uDe};function aDe(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&&Ml(t,0,t.length,n),t}function sDe(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=uc(o,t.slice(a+1,a+i+3)),o=uc(o,[["enter",u,e]]),o=uc(o,CC(e.parser.constructs.insideSpan.null,t.slice(a+i+4,s-3),e)),o=uc(o,[["exit",u,e],t[s-2],t[s-1],["exit",c,e]]),o=uc(o,t.slice(s+1)),o=uc(o,[["exit",l,e]]),Ml(t,a,t.length,o),t}function oDe(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(vu(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(nDe,u,s?u:f)(h):h===91?t.attempt(iDe,u,s?c:f)(h):s?u(h):f(h)}function c(h){return t.attempt(rDe,u,f)(h)}function u(h){return e(h)}function f(h){return a._balanced=!0,n(h)}}function lDe(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 zi(f)?d1(t,a)(f):a(f)}function a(f){return f===41?u(f):VQ(t,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return zi(f)?d1(t,l)(f):u(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?WQ(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return zi(f)?d1(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 cDe(t,e,n){const i=this;return r;function r(o){return GQ.call(i,t,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return i.parser.defined.includes(vu(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function s(o){return n(o)}}function uDe(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 fDe={name:"labelStartImage",resolveAll:VU.resolveAll,tokenize:hDe};function hDe(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 dDe={name:"labelStartLink",resolveAll:VU.resolveAll,tokenize:pDe};function pDe(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:mDe};function mDe(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Oi(t,e,"linePrefix")}}const xM={name:"thematicBreak",tokenize:gDe};function gDe(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||bn(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===r?(t.consume(c),i++,l):(t.exit("thematicBreakSequence"),ii(c)?Oi(t,o,"whitespace")(c):o(c))}}const Lo={continuation:{tokenize:xDe},exit:SDe,name:"list",tokenize:yDe},bDe={partial:!0,tokenize:wDe},vDe={partial:!0,tokenize:_De};function yDe(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(iy,i.interrupt?n:u,t.attempt(bDe,h,f))}function u(d){return i.containerState.initialBlankLine=!0,a++,h(d)}function f(d){return ii(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 xDe(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(iy,r,a);function r(o){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Oi(t,e,"listItemIndent",i.containerState.size+1)(o)}function a(o){return i.containerState.furtherBlankLines||!ii(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(vDe,e,s)(o))}function s(o){return i.containerState._closeFlow=!0,i.interrupt=void 0,Oi(t,t.attempt(Lo,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function _De(t,e,n){const i=this;return Oi(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 SDe(t){t.exit(this.containerState.type)}function wDe(t,e,n){const i=this;return Oi(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!ii(a)&&s&&s[1].type==="listItemPrefixWhitespace"?e(a):n(a)}}const MH={name:"setextUnderline",resolveTo:EDe,tokenize:MDe};function EDe(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 MDe(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"),ii(c)?Oi(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||bn(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const TDe={tokenize:RDe,partial:!0},TH="https://github.com/micromark/micromark-extension-mdxjs-esm",ADe=new Set(["ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ImportDeclaration"]);function CDe(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 to(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||bn(x)?(a.exit("mdxjsEsmData"),b(x)):(a.consume(x),g)}function b(x){return x===null?m(x):bn(x)?a.check(TDe,m,y)(x):(a.enter("mdxjsEsmData"),g(x))}function y(x){return a.enter("lineEnding"),a.consume(x),a.exit("lineEnding"),b}function m(x){const _=UQ(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=TH+"#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(!ADe.has(M.type)){const S=new tr("Unexpected `"+M.type+"` in code: only import/exports are supported",{place:eh(M),ruleId:"non-esm",source:"micromark-extension-mdxjs-esm"});throw S.url=TH+"#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 RDe(t,e,n){return i;function i(r){return t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),t.attempt(iy,e,n)}}const AH={}.hasOwnProperty;function GU(t){const e={};let n=-1;for(;++n<t.length;)kDe(e,t[n]);return e}function kDe(t,e){let n;for(n in e){const r=(AH.call(t,n)?t[n]:void 0)||(t[n]={}),a=e[n];let s;if(a)for(s in a){AH.call(r,s)||(r[s]=[]);const o=a[s];DDe(r[s],Array.isArray(o)?o:o?[o]:[])}}}function DDe(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);Ml(t,0,0,i)}function ODe(t){const e=Object.assign({acorn:H3e.Parser.extend(pQ()),acornOptions:{ecmaVersion:2024,sourceType:"module"},addResult:!0},t);return GU([CDe(e),ake(e),cke(e),uke()])}const IDe={};function NDe(t){const e=this,n=t||IDe,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),s=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(ODe(n)),a.push(z3e()),s.push(j3e(n))}const LDe={};function WU(t,e){const n=LDe,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return qQ(t,i,r)}function qQ(t,e,n){if(PDe(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 CH(t.children,e,n)}return Array.isArray(t)?CH(t,e,n):""}function CH(t,e,n){const i=[];let r=-1;for(;++r<t.length;)i[r]=qQ(t[r],e,n);return i.join("")}function PDe(t){return!!(t&&typeof t=="object")}function XQ(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 ry(t){const e=[];let n=-1,i=0,r=0;for(;++n<t.length;){const a=t.charCodeAt(n);let s="";if(a===37&&ro(t.charCodeAt(n+1))&&ro(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 UDe={tokenize:FDe};function FDe(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"),Oi(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 bn(o)?(t.consume(o),t.exit("chunkText"),a):(t.consume(o),s)}}const BDe={tokenize:zDe},RH={tokenize:jDe};function zDe(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}m(i);let A=w;for(;A<e.events.length;)e.events[A][1].end={...S},A++;return Ml(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(RH,u,f)(_)}function u(_){return r&&x(),m(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(RH,d,g)(_)}function d(_){return i++,n.push([e.currentConstruct,e.containerState]),h(_)}function g(_){if(_===null){r&&x(),m(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),m(0),t.consume(_);return}return bn(_)?(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(m(i),S=A;S<e.events.length;)e.events[S][1].end={...R},S++;Ml(e.events,C+1,0,e.events.slice(A)),e.events.length=S}}function m(_){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 jDe(t,e,n){return Oi(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const HDe={tokenize:VDe};function VDe(t){const e=this,n=t.attempt(iy,i,t.attempt(this.parser.constructs.flowInitial,r,Oi(t,t.attempt(this.parser.constructs.flow,r,t.attempt(Oke,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 GDe={resolveAll:YQ()},WDe=KQ("string"),qDe=KQ("text");function KQ(t){return{resolveAll:YQ(t==="text"?XDe: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 YQ(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 XDe(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 KDe={42:Lo,43:Lo,45:Lo,48:Lo,49:Lo,50:Lo,51:Lo,52:Lo,53:Lo,54:Lo,55:Lo,56:Lo,57:Lo,62:BQ},YDe={91:Uke},JDe={[-2]:jD,[-1]:jD,32:jD},$De={35:Vke,42:xM,45:[MH,xM],60:Xke,61:MH,95:xM,96:wH,126:wH},ZDe={38:jQ,92:zQ},QDe={[-5]:HD,[-4]:HD,[-3]:HD,33:fDe,38:jQ,42:OI,60:[dke,eDe],91:dDe,92:[jke,zQ],93:VU,95:OI,96:Tke},e8e={null:[OI,GDe]},t8e={null:[42,95]},n8e={null:[]},i8e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:t8e,contentInitial:YDe,disable:n8e,document:KDe,flow:$De,flowInitial:JDe,insideSpan:e8e,string:ZDe,text:QDe},Symbol.toStringTag,{value:"Module"}));function r8e(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(L){return s=uc(s,L),y(),s[s.length-1]!==null?[]:(C(e,0),c.events=CC(a,c.events,c),c.events)}function h(L,U){return s8e(d(L),U)}function d(L){return a8e(s,L)}function g(){const{_bufferIndex:L,_index:U,line:j,column:z,offset:q}=i;return{_bufferIndex:L,_index:U,line:j,column:z,offset:q}}function b(L){r[L.line]=L.column,R()}function y(){let L;for(;i._index<s.length;){const U=s[i._index];if(typeof U=="string")for(L=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===L&&i._bufferIndex<U.length;)m(U.charCodeAt(i._bufferIndex));else m(U)}}function m(L){u=u(L)}function x(L){bn(L)?(i.line++,i.column=1,i.offset+=L===-3?2:1,R()):L!==-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=L}function _(L,U){const j=U||{};return j.type=L,j.start=g(),c.events.push(["enter",j,c]),o.push(j),j}function w(L){const U=o.pop();return U.end=g(),c.events.push(["exit",U,c]),U}function M(L,U){C(L,U.from)}function S(L,U){U.restore()}function A(L,U){return j;function j(z,q,F){let V,H,W,B;return Array.isArray(z)?Z(z):"tokenize"in z?Z([z]):J(z);function J(le){return ue;function ue(Se){const Oe=Se!==null&&le[Se],Be=Se!==null&&le.null,je=[...Array.isArray(Oe)?Oe:Oe?[Oe]:[],...Array.isArray(Be)?Be:Be?[Be]:[]];return Z(je)(Se)}}function Z(le){return V=le,H=0,le.length===0?F:G(le[H])}function G(le){return ue;function ue(Se){return B=D(),W=le,le.partial||(c.currentConstruct=le),le.name&&c.parser.constructs.disable.null.includes(le.name)?oe():le.tokenize.call(U?Object.assign(Object.create(c),U):c,l,de,oe)(Se)}}function de(le){return L(W,B),q}function oe(le){return B.restore(),++H<V.length?G(V[H]):F}}}function C(L,U){L.resolveAll&&!a.includes(L)&&a.push(L),L.resolve&&Ml(c.events,U,c.events.length-U,L.resolve(c.events.slice(U),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function D(){const L=g(),U=c.previous,j=c.currentConstruct,z=c.events.length,q=Array.from(o);return{from:z,restore:F};function F(){i=L,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 a8e(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 s8e(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 o8e(t){const i={constructs:GU([i8e,...(t||{}).extensions||[]]),content:r(UDe),defined:[],document:r(BDe),flow:r(HDe),lazy:{},string:r(WDe),text:r(qDe)};return i;function r(a){return s;function s(o){return r8e(i,a,o)}}}function l8e(t){for(;!HQ(t););return t}const kH=/[\0\t\n\r]/g;function c8e(){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(kH.lastIndex=f,c=kH.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 u8e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function f8e(t){return t.replace(u8e,h8e)}function h8e(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),a=r===120||r===88;return XQ(n.slice(a?2:1),a?16:10)}return Q1(n)||t}const JQ={}.hasOwnProperty;function d8e(t,e,n){return typeof e!="string"&&(n=e,e=void 0),p8e(n)(l8e(o8e(n).document().write(c8e()(t,e,!0))))}function p8e(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ae),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(Ie),blockQuote:a(Be),characterEscape:D,characterReference:D,codeFenced:a(je),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(je,s),codeText:a(He,s),codeTextData:D,data:D,codeFlowValue:D,definition:a(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(ze),hardBreakEscape:a(qe),hardBreakTrailing:a(qe),htmlFlow:a(we,s),htmlFlowData:D,htmlText:a(we,s),htmlTextData:D,image:a(Me),label:s,link:a(Ae),listItem:a(Ue),listItemValue:h,listOrdered:a(Ne,f),listUnordered:a(Ne),paragraph:a(Qe),reference:G,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Ie),strong:a(ae),thematicBreak:a(ce)},exit:{atxHeading:l(),atxHeadingSequence:M,autolink:l(),autolinkEmail:Oe,autolinkProtocol:Se,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:le,characterReference:ue,codeFenced:l(y),codeFencedFence:b,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:l(m),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(V),label:W,labelText:H,lineEnding:L,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:de,resourceDestinationString:B,resourceTitleString:J,resource:Z,setextHeading:l(C),setextHeadingLineSequence:A,setextHeadingText:S,strong:l(),thematicBreak:l()}};$Q(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(he){let me={type:"root",children:[]};const $={stack:[me],tokenStack:[],config:e,enter:o,exit:c,buffer:s,resume:u,data:n},Ve=[];let Xe=-1;for(;++Xe<he.length;)if(he[Xe][1].type==="listOrdered"||he[Xe][1].type==="listUnordered")if(he[Xe][0]==="enter")Ve.push(Xe);else{const mt=Ve.pop();Xe=r(he,mt,Xe)}for(Xe=-1;++Xe<he.length;){const mt=e[he[Xe][0]];JQ.call(mt,he[Xe][1].type)&&mt[he[Xe][1].type].call(Object.assign({sliceSerialize:he[Xe][2].sliceSerialize},$),he[Xe][1])}if($.tokenStack.length>0){const mt=$.tokenStack[$.tokenStack.length-1];(mt[1]||DH).call($,void 0,mt[0])}for(me.position={start:nd(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:nd(he.length>0?he[he.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(he,me,$){let Ve=me-1,Xe=-1,mt=!1,Ge,Je,Ye,vt;for(;++Ve<=$;){const Mt=he[Ve];switch(Mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Mt[0]==="enter"?Xe++:Xe--,vt=void 0;break}case"lineEndingBlank":{Mt[0]==="enter"&&(Ge&&!vt&&!Xe&&!Ye&&(Ye=Ve),vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vt=void 0}if(!Xe&&Mt[0]==="enter"&&Mt[1].type==="listItemPrefix"||Xe===-1&&Mt[0]==="exit"&&(Mt[1].type==="listUnordered"||Mt[1].type==="listOrdered")){if(Ge){let gt=Ve;for(Je=void 0;gt--;){const kt=he[gt];if(kt[1].type==="lineEnding"||kt[1].type==="lineEndingBlank"){if(kt[0]==="exit")continue;Je&&(he[Je][1].type="lineEndingBlank",mt=!0),kt[1].type="lineEnding",Je=gt}else if(!(kt[1].type==="linePrefix"||kt[1].type==="blockQuotePrefix"||kt[1].type==="blockQuotePrefixWhitespace"||kt[1].type==="blockQuoteMarker"||kt[1].type==="listItemIndent"))break}Ye&&(!Je||Ye<Je)&&(Ge._spread=!0),Ge.end=Object.assign({},Je?he[Je][1].start:Mt[1].end),he.splice(Je||Ve,0,["exit",Ge,Mt[2]]),Ve++,$++}if(Mt[1].type==="listItemPrefix"){const gt={type:"listItem",_spread:!1,start:Object.assign({},Mt[1].start),end:void 0};Ge=gt,he.splice(Ve,0,["enter",gt,Mt[2]]),Ve++,$++,Ye=void 0,vt=!0}}}return he[me][1]._spread=mt,$}function a(he,me){return $;function $(Ve){o.call(this,he(Ve),Ve),me&&me.call(this,Ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(he,me,$){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([me,$||void 0]),he.position={start:nd(me.start),end:void 0}}function l(he){return me;function me($){he&&he.call(this,$),c.call(this,$)}}function c(he,me){const $=this.stack.pop(),Ve=this.tokenStack.pop();if(Ve)Ve[0].type!==he.type&&(me?me.call(this,he,Ve[0]):(Ve[1]||DH).call(this,he,Ve[0]));else throw new Error("Cannot close `"+he.type+"` ("+xc({start:he.start,end:he.end})+"): it’s not open");$.position.end=nd(he.end)}function u(){return WU(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(he){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function d(){const he=this.resume(),me=this.stack[this.stack.length-1];me.lang=he}function g(){const he=this.resume(),me=this.stack[this.stack.length-1];me.meta=he}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he.replace(/(\r?\n|\r)$/g,"")}function x(he){const me=this.resume(),$=this.stack[this.stack.length-1];$.label=me,$.identifier=vu(this.sliceSerialize(he)).toLowerCase()}function _(){const he=this.resume(),me=this.stack[this.stack.length-1];me.title=he}function w(){const he=this.resume(),me=this.stack[this.stack.length-1];me.url=he}function M(he){const me=this.stack[this.stack.length-1];if(!me.depth){const $=this.sliceSerialize(he).length;me.depth=$}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(he){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function D(he){const $=this.stack[this.stack.length-1].children;let Ve=$[$.length-1];(!Ve||Ve.type!=="text")&&(Ve=K(),Ve.position={start:nd(he.start),end:void 0},$.push(Ve)),this.stack.push(Ve)}function R(he){const me=this.stack.pop();me.value+=this.sliceSerialize(he),me.position.end=nd(he.end)}function L(he){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $=me.children[me.children.length-1];$.position.end=nd(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(me.type)&&(D.call(this,he),R.call(this,he))}function U(){this.data.atHardBreak=!0}function j(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function z(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function q(){const he=this.resume(),me=this.stack[this.stack.length-1];me.value=he}function F(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=me,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function V(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=me,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function H(he){const me=this.sliceSerialize(he),$=this.stack[this.stack.length-2];$.label=f8e(me),$.identifier=vu(me).toLowerCase()}function W(){const he=this.stack[this.stack.length-1],me=this.resume(),$=this.stack[this.stack.length-1];if(this.data.inReference=!0,$.type==="link"){const Ve=he.children;$.children=Ve}else $.alt=me}function B(){const he=this.resume(),me=this.stack[this.stack.length-1];me.url=he}function J(){const he=this.resume(),me=this.stack[this.stack.length-1];me.title=he}function Z(){this.data.inReference=void 0}function G(){this.data.referenceType="collapsed"}function de(he){const me=this.resume(),$=this.stack[this.stack.length-1];$.label=me,$.identifier=vu(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function oe(he){this.data.characterReferenceType=he.type}function le(he){const me=this.sliceSerialize(he),$=this.data.characterReferenceType;let Ve;$?(Ve=XQ(me,$==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ve=Q1(me);const Xe=this.stack[this.stack.length-1];Xe.value+=Ve}function ue(he){const me=this.stack.pop();me.position.end=nd(he.end)}function Se(he){R.call(this,he);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(he)}function Oe(he){R.call(this,he);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(he)}function Be(){return{type:"blockquote",children:[]}}function je(){return{type:"code",lang:null,meta:null,value:""}}function He(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Ie(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function we(){return{type:"html",value:""}}function Me(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function Ne(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ue(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function ae(){return{type:"strong",children:[]}}function K(){return{type:"text",value:""}}function ce(){return{type:"thematicBreak"}}}function nd(t){return{line:t.line,column:t.column,offset:t.offset}}function $Q(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?$Q(t,i):m8e(t,i)}}function m8e(t,e){let n;for(n in e)if(JQ.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 DH(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+xc({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+xc({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+xc({start:e.start,end:e.end})+") is still open")}function g8e(t){const e=this;e.parser=n;function n(i){return d8e(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function b8e(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 v8e(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
`}]}function y8e(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 x8e(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function _8e(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function S8e(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=ry(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 w8e(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 E8e(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ZQ(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 M8e(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return ZQ(t,e);const r={src:ry(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 T8e(t,e){const n={src:ry(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 A8e(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 C8e(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return ZQ(t,e);const r={href:ry(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 R8e(t,e){const n={href:ry(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 k8e(t,e,n){const i=t.all(e),r=n?D8e(n):QQ(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 D8e(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=QQ(n[i])}return e}function QQ(t){const e=t.spread;return e??t.children.length>1}function O8e(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 I8e(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function N8e(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function L8e(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function P8e(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=CQ(e.children[1]),l=AQ(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 U8e(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 F8e(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const OH=9,IH=32;function B8e(t){const e=String(t),n=/\r?\n|\r/g;let i=n.exec(e),r=0;const a=[];for(;i;)a.push(NH(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(e);return a.push(NH(e.slice(r),r>0,!1)),a.join("")}function NH(t,e,n){let i=0,r=t.length;if(e){let a=t.codePointAt(i);for(;a===OH||a===IH;)i++,a=t.codePointAt(i)}if(n){let a=t.codePointAt(r-1);for(;a===OH||a===IH;)r--,a=t.codePointAt(r-1)}return r>i?t.slice(i,r):""}function z8e(t,e){const n={type:"text",value:B8e(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function j8e(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const H8e={blockquote:b8e,break:v8e,code:y8e,delete:x8e,emphasis:_8e,footnoteReference:S8e,heading:w8e,html:E8e,imageReference:M8e,image:T8e,inlineCode:A8e,linkReference:C8e,link:R8e,listItem:k8e,list:O8e,paragraph:I8e,root:N8e,strong:L8e,table:P8e,tableCell:F8e,tableRow:U8e,text:z8e,thematicBreak:j8e,toml:_E,yaml:_E,definition:_E,footnoteDefinition:_E};function _E(){}const eee=-1,RC=0,p1=1,pT=2,qU=3,XU=4,KU=5,YU=6,tee=7,nee=8,LH=typeof self=="object"?self:globalThis,V8e=(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 eee:return n(s,r);case p1:{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 tee:{const{name:o,message:l}=s;return n(new LH[o](l),r)}case nee: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 LH[a](s),r)};return i},PH=t=>V8e(new Map,t)(0),Db="",{toString:G8e}={},{keys:W8e}=Object,lx=t=>{const e=typeof t;if(e!=="object"||!t)return[RC,e];const n=G8e.call(t).slice(8,-1);switch(n){case"Array":return[p1,Db];case"Object":return[pT,Db];case"Date":return[qU,Db];case"RegExp":return[XU,Db];case"Map":return[KU,Db];case"Set":return[YU,Db];case"DataView":return[p1,n]}return n.includes("Array")?[p1,n]:n.includes("Error")?[tee,n]:[pT,n]},SE=([t,e])=>t===RC&&(e==="function"||e==="symbol"),q8e=(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]=lx(s);switch(o){case RC:{let u=s;switch(l){case"bigint":o=nee,u=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return r([eee],s)}return r([o,u],s)}case p1:{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 W8e(s))(t||!SE(lx(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(lx(h))||SE(lx(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(lx(h)))&&u.push(a(h));return f}}const{message:c}=s;return r([o,{name:l,message:c}],s)};return a},UH=(t,{json:e,lossy:n}={})=>{const i=[];return q8e(!(e||n),!!e,new Map,i)(t),i},mT=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?PH(UH(t,e)):structuredClone(t):(t,e)=>PH(UH(t,e));function X8e(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 K8e(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Y8e(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||X8e,i=t.options.footnoteBackLabel||K8e,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=ry(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 m={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:t.wrap(u,!0)};t.patch(c,m),o.push(m)}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 Q8e;if(typeof t=="function")return DC(t);if(typeof t=="object")return Array.isArray(t)?J8e(t):$8e(t);if(typeof t=="string")return Z8e(t);throw new Error("Expected function, string, or object as test")};function J8e(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 $8e(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 Z8e(t){return DC(e);function e(n){return n&&n.type===t}}function DC(t){return e;function e(n,i,r){return!!(eOe(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function Q8e(){return!0}function eOe(t){return t!==null&&typeof t=="object"&&"type"in t}const iee=[],tOe=!0,II=!1,nOe="skip";function ree(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=iee,g,b,y;if((!e||a(l,c,u[u.length-1]||void 0))&&(d=iOe(n(l,u)),d[0]===II))return d;if("children"in l&&l.children){const m=l;if(m.children&&d[0]!==nOe)for(b=(i?m.children.length:-1)+s,y=u.concat(m);b>-1&&b<m.children.length;){const x=m.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 iOe(t){return Array.isArray(t)?t:typeof t=="number"?[tOe,t]:t==null?iee:[t]}function iS(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),ree(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,rOe={};function aOe(t,e){const n=e||rOe,i=new Map,r=new Map,a=new Map,s={...H8e,...n.handlers},o={all:c,applyData:oOe,definitionById:i,footnoteById:r,footnoteCounts:a,footnoteOrder:[],handlers:s,one:l,options:n,patch:sOe,wrap:cOe};return iS(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,m=mT(y);return m.children=o.all(u),m}return mT(u)}return(o.options.unknownHandler||lOe)(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=FH(g.value)),!Array.isArray(g)&&g.type==="element")){const b=g.children[0];b&&b.type==="text"&&(b.value=FH(b.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function sOe(t,e){t.position&&(e.position=kQ(t))}function oOe(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 lOe(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 cOe(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 FH(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function BH(t,e){const n=aOe(t,e),i=n.one(t,void 0),r=Y8e(n),a=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&a.children.push({type:"text",value:`
`},r),a}function uOe(t,e){return t&&"run"in t?async function(n,i){const r=BH(n,{file:i,...e});await t.run(r,i)}:function(n,i){return BH(n,{file:i,...t||e})}}function zH(t){if(t)throw t}var _M=Object.prototype.hasOwnProperty,aee=Object.prototype.toString,jH=Object.defineProperty,HH=Object.getOwnPropertyDescriptor,VH=function(e){return typeof Array.isArray=="function"?Array.isArray(e):aee.call(e)==="[object Array]"},GH=function(e){if(!e||aee.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)},WH=function(e,n){jH&&n.name==="__proto__"?jH(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},qH=function(e,n){if(n==="__proto__")if(_M.call(e,n)){if(HH)return HH(e,n).value}else return;return e[n]},fOe=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=qH(o,n),r=qH(e,n),o!==r&&(u&&r&&(GH(r)||(a=VH(r)))?(a?(a=!1,s=i&&VH(i)?i:[]):s=i&&GH(i)?i:{},WH(o,{name:n,newValue:t(u,s,r)})):typeof r<"u"&&WH(o,{name:n,newValue:r}));return o};const VD=Rc(fOe);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 hOe(){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?dOe(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 dOe(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 pOe=function(t){const i=this.constructor.prototype,r=i[t],a=function(){return r.apply(a,arguments)};return Object.setPrototypeOf(a,i),a},mOe={}.hasOwnProperty;class JU extends pOe{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=hOe()}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):mOe.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);vOe(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),KH("processSync","process",n),i;function r(a,s){n=!0,zH(a),i=s}}run(e,n,i){XH(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),KH("runSync","run",i),r;function a(s,o){zH(s),r=o,i=!0}}stringify(e,n){this.freeze();const i=wE(n),r=this.compiler||this.Compiler;return WD("stringify",r),XH(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 gOe=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 XH(t){if(!LI(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function KH(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function wE(t){return bOe(t)?t:new fQ(t)}function bOe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function vOe(t){return typeof t=="string"||yOe(t)}function yOe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function ud(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};ud(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 ud(s,c),c})},init:a?{type:"Identifier",name:a.local.name}:e}),i}function Pd(t){let e=-1,n;for(;++e<t.length;){const i=t[e],r=typeof i=="string"&&sf(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 YH(t){let e=-1,n;for(;++e<t.length;){const i=t[e];typeof i=="string"&&sf(i,{jsx:!0});const r={type:"JSXIdentifier",name:i};n=n?{type:"JSXMemberExpression",object:n,property:r}:r}return n}function xOe(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,Pd(["arguments",0]))})}}}function see(){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 _Oe(t){return t.type==="FunctionDeclaration"?{...t,type:"FunctionExpression"}:(t.type,{...t,type:"ClassExpression"})}function SOe(t){return t.type==="FunctionDeclaration"||t.type==="ClassDeclaration"||t.type==="VariableDeclaration"}function wOe(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,m;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(m of u.body)if(m.type==="ExportDefaultDeclaration")b&&f.fail("Unexpected duplicate layout, expected a single layout (previous: "+xc(eh(b))+")",{ancestors:[u,m],place:eh(m),ruleId:"duplicate-layout",source:"recma-document"}),b=m,d.push({type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"MDXLayout"},init:SOe(m.declaration)?_Oe(m.declaration):m.declaration}]});else if(m.type==="ExportNamedDeclaration"&&m.source){const S=m.source;m.specifiers=m.specifiers.filter(function(A){if(A.exported.type==="Identifier"&&A.exported.name==="default"){b&&f.fail("Unexpected duplicate layout, expected a single layout (previous: "+xc(eh(b))+")",{ancestors:[u,m,A],place:eh(m),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 L={type:"ImportSpecifier",imported:A.local,local:{type:"Identifier",name:"MDXLayout"}};ud(A.local,L),C.push(L)}const D={type:"Literal",value:S.value};ud(S,D);const R={type:"ImportDeclaration",specifiers:C,source:D};return ud(A,R),M(R),!1}return!0}),m.specifiers.length>0&&w(m)}else m.type==="ExportNamedDeclaration"||m.type==="ExportAllDeclaration"?w(m):m.type==="ImportDeclaration"?M(m):m.type==="ExpressionStatement"&&(m.expression.type==="JSXElement"||m.expression.type==="JSXFragment")?(y=!0,d.push(...c(m.expression,i,!!b))):d.push(m);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")&&M0(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};ud(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"};ud(S,A),this.replace(A)}}}),_&&(n||(x=!0),u.body.push(EOe(n?{type:"Literal",value:n}:{type:"Identifier",name:"_importMetaUrl"}))),x&&u.body.unshift(...MOe());function w(S){if(S.type==="ExportNamedDeclaration"){if(S.declaration){const A=see();M0(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(m of S.specifiers)m.exported.type==="Identifier"?h.push(m.exported.name):(m.exported.value,h.push(m.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};ud(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;M0(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 m={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:m}:m]}}function EE(t,e,n){t.comments?.unshift({type:"Block",value:e+" "+n,data:{_mdxIsPragmaComment:!0}})}function EOe(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:Pd(["d","startsWith"]),arguments:[{type:"Literal",value:"/"}],optional:!1},operator:"||",right:{type:"CallExpression",callee:Pd(["d","startsWith"]),arguments:[{type:"Literal",value:"./"}],optional:!1}},operator:"||",right:{type:"CallExpression",callee:Pd(["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 MOe(){return[{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:"_importMetaUrl"},init:Pd(["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 JH(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 TOe(t){const{development:e,outputFormat:n,providerImportSource:i}=t;return function(r,a){const s=see(),o=[];let l=!1,c=!1;if(M0(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:[]}),Ob(u,"MDXContent")&&!XD(s.scopes,"MDXLayout")&&o[0].components.push("MDXLayout"));const f=o[0];if(!(!f||!Ob(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"&&Ob(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(sf(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(sf(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=YH(g),u.closingElement&&(u.closingElement.name=YH(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:sf(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 m=[];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})),(Ob(b.node,"MDXContent")||Ob(b.node,"_createMdxContent"))&&d.push(Pd(["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"}),Ob(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&&m.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=xc(eh(S.node)),C=[{type:"Literal",value:M},{type:"Literal",value:S.component}];c=!0,e&&A&&C.push({type:"Literal",value:A}),m.push({type:"IfStatement",test:{type:"UnaryExpression",operator:"!",prefix:!0,argument:Pd(M.split("."))},consequent:{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"Identifier",name:"_missingMdxReference"},arguments:C,optional:!1}},alternate:void 0})}m.length>0&&(u.body.type!=="BlockStatement"&&(u.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:u.body}]}),u.body.body.unshift(...m)),o.pop()}}}),l&&i&&r.body.unshift(AOe(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:JH([{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:[JH(u)]}}]}})}n==="function-body"&&r.body.unshift({type:"ExpressionStatement",expression:{type:"Literal",value:"use strict"},directive:"use strict"})}}function AOe(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,Pd(["arguments",0]))}:{type:"ImportDeclaration",specifiers:n,source:{type:"Literal",value:t}}}function Ob(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 COe(){return function(t){iS(t,"raw",function(e,n,i){if(i&&typeof n=="number")return i.children.splice(n,1),n})}}const ROe=/\s+/g,kOe=/[\t\n\v\f\r ]+/g;function DOe(t,e){e?typeof e=="string"&&(e={style:e}):e={};const n=e.preserveLineEndings?OOe:IOe;return String(t).replace(e.style==="html"?kOe:ROe,e.trim?NOe(n):n)}function OOe(t){const e=/\r?\n|\r/.exec(t);return e?e[0]:" "}function IOe(){return" "}function NOe(t){return e;function e(n,i,r){return i===0||i+n.length===r.length?"":t(n)}}function LOe(){return function(t){iS(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"&&DOe(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&&M0(e.data.estree,{enter(o){if(o.type==="JSXElement"){const l=o.data||(o.data={});l._mdxExplicitJsx=!0}}})})}}const POe=["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"];let $H=!1;function UOe(t){const e=t||{};e.format,(e.jsxRuntime==="classic"||e.pragma||e.pragmaFrag||e.pragmaImportSource)&&!$H&&($H=!0,console.warn("Unexpected deprecated option `jsxRuntime: 'classic'`, `pragma`, `pragmaFrag`, or `pragmaImportSource`; see <https://mdxjs.com/migrating/v3/> on how to migrate"));const n=gOe().use(g8e);e.format!=="md"&&n.use(NDe);const i=e.remarkRehypeOptions||{};return n.use(LOe).use(e.remarkPlugins||[]).use(uOe,{...i,allowDangerousHtml:!0,passThrough:[...i.passThrough||[],...POe]}).use(e.rehypePlugins||[]),e.format==="md"&&n.use(COe),n.use(c3e,e).use(wOe,e).use(TOe,e),e.jsx||n.use(_Ce,e).use(xOe,e),n.use(YCe).use(JCe,e).use(e.recmaPlugins||[]),n}function FOe(t,e){const{file:n,options:i}=uCe(t,e);return UOe(i).process(n)}function BOe(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 zOe=Object.getPrototypeOf(oee).constructor;async function oee(t,e){return new zOe(String(t))(e)}async function jOe(t,e){const{compiletime:n,runtime:i}=BOe(e);return oee(await FOe(t,n),i)}function HOe(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function VOe(t,e,n){const r=kC((n||{}).ignore||[]),a=GOe(e);let s=-1;for(;++s<a.length;)ree(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 m=!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,m=!0),!h.global)break;_=h.exec(c.value)}return m?(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 GOe(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([WOe(r[0]),qOe(r[1])])}return e}function WOe(t){return typeof t=="string"?new RegExp(HOe(t),"g"):t}function qOe(t){return typeof t=="function"?t:function(){return t}}const KD="phrasing",YD=["autolink","link","image","label"];function XOe(){return{transforms:[eIe],enter:{literalAutolink:YOe,literalAutolinkEmail:JD,literalAutolinkHttp:JD,literalAutolinkWww:JD},exit:{literalAutolink:QOe,literalAutolinkEmail:ZOe,literalAutolinkHttp:JOe,literalAutolinkWww:$Oe}}}function KOe(){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 YOe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function JD(t){this.config.enter.autolinkProtocol.call(this,t)}function JOe(t){this.config.exit.autolinkProtocol.call(this,t)}function $Oe(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 ZOe(t){this.config.exit.autolinkEmail.call(this,t)}function QOe(t){this.exit(t)}function eIe(t){VOe(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tIe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nIe]],{ignore:["link","linkReference"]})}function tIe(t,e,n,i,r){let a="";if(!lee(r)||(/^w/i.test(e)&&(n=e+n,e="",a="http://"),!iIe(n)))return!1;const s=rIe(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 nIe(t,e,n,i){return!lee(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function iIe(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 rIe(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 lee(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||xo(n)||AC(n))&&(!e||n!==47)}cee.peek=dIe;function aIe(){this.buffer()}function sIe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function oIe(){this.buffer()}function lIe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function cIe(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vu(this.sliceSerialize(t)).toLowerCase(),n.label=e}function uIe(t){this.exit(t)}function fIe(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vu(this.sliceSerialize(t)).toLowerCase(),n.label=e}function hIe(t){this.exit(t)}function dIe(){return"["}function cee(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 pIe(){return{enter:{gfmFootnoteCallString:aIe,gfmFootnoteCall:sIe,gfmFootnoteDefinitionLabelString:oIe,gfmFootnoteDefinition:lIe},exit:{gfmFootnoteCallString:cIe,gfmFootnoteCall:uIe,gfmFootnoteDefinitionLabelString:fIe,gfmFootnoteDefinition:hIe}}}function mIe(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:cee},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?uee:gIe))),c(),l}}function gIe(t,e,n){return e===0?t:uee(t,e,n)}function uee(t,e,n){return(n?"":"    ")+t}const bIe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fee.peek=SIe;function vIe(){return{canContainEols:["delete"],enter:{strikethrough:xIe},exit:{strikethrough:_Ie}}}function yIe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:bIe}],handlers:{delete:fee}}}function xIe(t){this.enter({type:"delete",children:[]},t)}function _Ie(t){this.exit(t)}function fee(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 SIe(){return"~"}function wIe(t){return t.length}function EIe(t,e){const n=e||{},i=(n.align||[]).concat(),r=n.stringLength||wIe,a=[],s=[],o=[],l=[];let c=0,u=-1;for(;++u<t.length;){const b=[],y=[];let m=-1;for(t[u].length>c&&(c=t[u].length);++m<t[u].length;){const x=MIe(t[u][m]);if(n.alignDelimiters!==!1){const _=r(x);y[m]=_,(l[m]===void 0||_>l[m])&&(l[m]=_)}b.push(x)}s[u]=b,o[u]=y}let f=-1;if(typeof i=="object"&&"length"in i)for(;++f<c;)a[f]=ZH(i[f]);else{const b=ZH(i);for(;++f<c;)a[f]=b}f=-1;const h=[],d=[];for(;++f<c;){const b=a[f];let y="",m="";b===99?(y=":",m=":"):b===108?y=":":b===114&&(m=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-m.length);const _=y+"-".repeat(x)+m;n.alignDelimiters!==!1&&(x=y.length+x+m.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 m=[];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&&m.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||f)&&m.push(" "),n.alignDelimiters!==!1&&m.push(_),m.push(x),n.alignDelimiters!==!1&&m.push(w),n.padding!==!1&&m.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&m.push("|")}g.push(n.delimiterEnd===!1?m.join("").replace(/ +$/,""):m.join(""))}return g.join(`
`)}function MIe(t){return t==null?"":String(t)}function ZH(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 TIe(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()),AIe);return r(),s}function AIe(t,e,n){return">"+(n?"":" ")+t}function CIe(t,e){return QH(t,e.inConstruct,!0)&&!QH(t,e.notInConstruct,!1)}function QH(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 eV(t,e,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
`&&CIe(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
`}function RIe(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 kIe(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 DIe(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 OIe(t,e,n,i){const r=DIe(n),a=t.value||"",s=r==="`"?"GraveAccent":"Tilde";if(kIe(t,n)){const f=n.enter("codeIndented"),h=n.indentLines(a,IIe);return f(),h}const o=n.createTracker(i),l=r.repeat(Math.max(RIe(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 IIe(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 NIe(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 LIe(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 e_(t){return"&#x"+t.toString(16).toUpperCase()+";"}function gT(t,e,n){const i=mv(t),r=mv(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}}hee.peek=PIe;function hee(t,e,n,i){const r=LIe(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=e_(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)+e_(f));const d=s.move(r);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+d}function PIe(t,e,n){return n.options.emphasis||"*"}function UIe(t,e){let n=!1;return iS(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 FIe(t,e,n,i){const r=Math.max(Math.min(6,t.depth||1),1),a=n.createTracker(i);if(UIe(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=e_(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),l(),o(),c}dee.peek=BIe;function dee(t){return t.value||""}function BIe(){return"<"}pee.peek=zIe;function pee(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 zIe(){return"!"}mee.peek=jIe;function mee(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 jIe(){return"!"}gee.peek=HIe;function gee(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 HIe(){return"`"}function bee(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))}vee.peek=VIe;function vee(t,e,n,i){const r=ZU(n),a=r==='"'?"Quote":"Apostrophe",s=n.createTracker(i);let o,l;if(bee(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 VIe(t,e,n){return bee(t,n)?"<":"["}yee.peek=GIe;function yee(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 GIe(){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 WIe(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 qIe(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 xee(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 XIe(t,e,n,i){const r=n.enter("list"),a=n.bulletCurrent;let s=t.ordered?qIe(n):QU(n);const o=t.ordered?s==="."?")":".":WIe(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),xee(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 KIe(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 YIe(t,e,n,i){const r=KIe(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 JIe(t,e,n,i){const r=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,i);return a(),r(),s}const $Ie=kC(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ZIe(t,e,n,i){return(t.children.some(function(s){return $Ie(s)})?n.containerPhrasing:n.containerFlow).call(n,t,i)}function QIe(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}_ee.peek=eNe;function _ee(t,e,n,i){const r=QIe(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=e_(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)+e_(f));const d=s.move(r+r);return a(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},o+l+d}function eNe(t,e,n){return n.options.strong||"*"}function tNe(t,e,n,i){return n.safe(t.value,i)}function nNe(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 iNe(t,e,n){const i=(xee(n)+(n.options.ruleSpaces?" ":"")).repeat(nNe(n));return n.options.ruleSpaces?i.slice(0,-1):i}const See={blockquote:TIe,break:eV,code:OIe,definition:NIe,emphasis:hee,hardBreak:eV,heading:FIe,html:dee,image:pee,imageReference:mee,inlineCode:gee,link:vee,linkReference:yee,list:XIe,listItem:YIe,paragraph:JIe,root:ZIe,strong:_ee,text:tNe,thematicBreak:iNe};function rNe(){return{enter:{table:aNe,tableData:tV,tableHeader:tV,tableRow:oNe},exit:{codeText:lNe,table:sNe,tableData:$D,tableHeader:$D,tableRow:$D}}}function aNe(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 sNe(t){this.exit(t),this.data.inTable=void 0}function oNe(t){this.enter({type:"tableRow",children:[]},t)}function $D(t){this.exit(t)}function tV(t){this.enter({type:"tableCell",children:[]},t)}function lNe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,cNe));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function cNe(t,e){return e==="|"?e:t}function uNe(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 m=f(d,b,y),x=c([m]);return x.slice(0,x.indexOf(`
`))}function l(d,g,b,y){const m=b.enter("tableCell"),x=b.enter("phrasing"),_=b.containerPhrasing(d,{...y,before:a,after:a});return x(),m(),_}function c(d,g){return EIe(d,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function u(d,g,b){const y=d.children;let m=-1;const x=[],_=g.enter("table");for(;++m<y.length;)x[m]=f(y[m],g,b);return _(),x}function f(d,g,b){const y=d.children;let m=-1;const x=[],_=g.enter("tableRow");for(;++m<y.length;)x[m]=l(y[m],d,g,b);return _(),x}function h(d,g,b){let y=See.inlineCode(d,g,b);return b.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function fNe(){return{exit:{taskListCheckValueChecked:nV,taskListCheckValueUnchecked:nV,paragraph:dNe}}}function hNe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:pNe}}}function nV(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function dNe(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 pNe(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=See.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 mNe(){return[XOe(),pIe(),vIe(),rNe(),fNe()]}function gNe(t){return{extensions:[KOe(),mIe(t),yIe(),uNe(t),hNe()]}}const bNe={tokenize:wNe,partial:!0},wee={tokenize:ENe,partial:!0},Eee={tokenize:MNe,partial:!0},Mee={tokenize:TNe,partial:!0},vNe={tokenize:ANe,partial:!0},Tee={name:"wwwAutolink",tokenize:_Ne,previous:Cee},Aee={name:"protocolAutolink",tokenize:SNe,previous:Ree},Ch={name:"emailAutolink",tokenize:xNe,previous:kee},xf={};function yNe(){return{text:xf}}let jp=48;for(;jp<123;)xf[jp]=Ch,jp++,jp===58?jp=65:jp===91&&(jp=97);xf[43]=Ch;xf[45]=Ch;xf[46]=Ch;xf[95]=Ch;xf[72]=[Ch,Aee];xf[104]=[Ch,Aee];xf[87]=[Ch,Tee];xf[119]=[Ch,Tee];function xNe(t,e,n){const i=this;let r,a;return s;function s(f){return!PI(f)||!kee.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(vNe,u,c)(f):f===45||f===95||ro(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&&to(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function _Ne(t,e,n){const i=this;return r;function r(s){return s!==87&&s!==119||!Cee.call(i,i.previous)||e4(i.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(bNe,t.attempt(wee,t.attempt(Eee,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function SNe(t,e,n){const i=this;let r="",a=!1;return s;function s(f){return(f===72||f===104)&&Ree.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(to(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)||zi(f)||xo(f)||AC(f)?n(f):t.attempt(wee,t.attempt(Eee,u),n)(f)}function u(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function wNe(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 ENe(t,e,n){let i,r,a;return s;function s(c){return c===46||c===95?t.check(Mee,l,o)(c):c===null||zi(c)||xo(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 MNe(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(Mee,e,a)(s):s===null||zi(s)||xo(s)?e(s):(t.consume(s),r)}function a(s){return s===41&&i++,t.consume(s),r}}function TNe(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||zi(o)||xo(o)?e(o):n(o)}function r(o){return o===null||o===40||o===91||zi(o)||xo(o)?e(o):i(o)}function a(o){return to(o)?s(o):n(o)}function s(o){return o===59?(t.consume(o),i):to(o)?(t.consume(o),s):n(o)}}function ANe(t,e,n){return i;function i(a){return t.consume(a),r}function r(a){return ro(a)?n(a):e(a)}}function Cee(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||zi(t)}function Ree(t){return!to(t)}function kee(t){return!(t===47||PI(t))}function PI(t){return t===43||t===45||t===46||t===95||ro(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 CNe={tokenize:PNe,partial:!0};function RNe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:INe,continuation:{tokenize:NNe},exit:LNe}},text:{91:{name:"gfmFootnoteCall",tokenize:ONe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kNe,resolveTo:DNe}}}}function kNe(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=vu(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 DNe(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 ONe(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||zi(f))return n(f);if(f===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return r.includes(vu(i.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return zi(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 INe(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||zi(g))return n(g);if(g===93){t.exit("chunkString");const b=t.exit("gfmFootnoteDefinitionLabelString");return a=vu(i.sliceSerialize(b)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return zi(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),Oi(t,d,"gfmFootnoteDefinitionWhitespace")):n(g)}function d(g){return e(g)}}function NNe(t,e,n){return t.check(iy,e,t.attempt(CNe,e,n))}function LNe(t){t.exit("gfmFootnoteDefinition")}function PNe(t,e,n){const i=this;return Oi(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 UNe(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&&Ml(h,h.length,0,CC(d,s.slice(c+1,l),o)),Ml(h,h.length,0,[["exit",f,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",u,o]]),Ml(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=mv(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"),m=mv(g);return y._open=!m||m===2&&!!b,y._close=!b||b===2&&!!m,o(g)}}}class FNe{constructor(){this.map=[]}add(e,n,i){BNe(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 BNe(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 zNe(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 jNe(){return{flow:{null:{name:"table",tokenize:HNe,resolveAll:VNe}}}}function HNe(t,e,n){const i=this;let r=0,a=0,s;return o;function o(R){let L=i.events.length-1;for(;L>-1;){const z=i.events[L][1].type;if(z==="lineEnding"||z==="linePrefix")L--;else break}const U=L>-1?i.events[L][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):bn(R)?a>1?(a=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),d):n(R):ii(R)?Oi(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||zi(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,ii(R)?Oi(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 ii(R)?Oi(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"),m):R===45?(a+=1,m(R)):R===null||bn(R)?w(R):M(R)}function m(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 ii(R)?Oi(t,w,"whitespace")(R):w(R)}function w(R){return R===124?g(R):R===null||bn(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||bn(R)?(t.exit("tableRow"),e(R)):ii(R)?Oi(t,A,"whitespace")(R):(t.enter("data"),C(R))}function C(R){return R===null||R===124||zi(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 VNe(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 FNe;for(;++n<t.length;){const d=t[n],g=d[1];d[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(iV(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&&iV(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=zNe(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({},Hb(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const l=Hb(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=Hb(e.events,n[2]),u=Hb(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({},Hb(e.events,r)),t.add(r,0,[["exit",a,e]]),a=void 0),a}function iV(t,e,n,i,r){const a=[],s=Hb(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 Hb(t,e){const n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}const GNe={name:"tasklistCheck",tokenize:qNe};function WNe(){return{text:{91:GNe}}}function qNe(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 zi(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 bn(l)?e(l):ii(l)?t.check({tokenize:XNe},e,n)(l):n(l)}}function XNe(t,e,n){return Oi(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function KNe(t){return GU([yNe(),RNe(),UNe(t),jNe(),WNe()])}const YNe={};function JNe(t){const e=this,n=t||YNe,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),a=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),s=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(KNe(n)),a.push(mNe()),s.push(gNe(n))}const $Ne=function(t){return ZNe(t)};function ZNe(t){return QNe(e);function e(n){return n&&n.type===t}}function QNe(t){return e;function e(n,...i){return!!(n&&typeof n=="object"&&"type"in n&&t.call(this,n,...i))}}const eLe=!0,rV=!1,tLe="skip",nLe=function(t,e,n,i){const r=$Ne(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=iLe(n(o,c)),h[0]===rV))return h;if(o.children&&h[0]!==tLe)for(g=-1+a,b=c.concat(o);g>-1&&g<o.children.length;){if(d=s(o.children[g],g,b)(),d[0]===rV)return d;g=typeof d[1]=="number"?d[1]:g+a}return h}}};function iLe(t){return Array.isArray(t)?t:typeof t=="number"?[eLe,t]:[t]}const rLe=function(t,e,n,i){nLe(t,e,r);function r(a,s){const o=s[s.length-1];return n(a,o?o.children.indexOf(a):null,o)}};function aLe(t){return"children"in t?Dee(t):"value"in t?t.value:""}function sLe(t){return t.type==="text"?t.value:"children"in t?Dee(t):""}function Dee(t){let e=-1;const n=[];for(;++e<t.children.length;)n[e]=sLe(t.children[e]);return n.join("")}function t4(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Oee(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function rS(){}var t_=.7,bT=1/t_,A0="\\s*([+-]?\\d+)\\s*",n_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",of="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oLe=/^#([0-9a-f]{3,8})$/,lLe=new RegExp(`^rgb\\(${A0},${A0},${A0}\\)$`),cLe=new RegExp(`^rgb\\(${of},${of},${of}\\)$`),uLe=new RegExp(`^rgba\\(${A0},${A0},${A0},${n_}\\)$`),fLe=new RegExp(`^rgba\\(${of},${of},${of},${n_}\\)$`),hLe=new RegExp(`^hsl\\(${n_},${of},${of}\\)$`),dLe=new RegExp(`^hsla\\(${n_},${of},${of},${n_}\\)$`),aV={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(rS,OC,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:sV,formatHex:sV,formatHex8:pLe,formatHsl:mLe,formatRgb:oV,toString:oV});function sV(){return this.rgb().formatHex()}function pLe(){return this.rgb().formatHex8()}function mLe(){return Iee(this).formatHsl()}function oV(){return this.rgb().formatRgb()}function OC(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=oLe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?lV(e):n===3?new jo(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=lLe.exec(t))?new jo(e[1],e[2],e[3],1):(e=cLe.exec(t))?new jo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=uLe.exec(t))?TE(e[1],e[2],e[3],e[4]):(e=fLe.exec(t))?TE(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=hLe.exec(t))?fV(e[1],e[2]/100,e[3]/100,1):(e=dLe.exec(t))?fV(e[1],e[2]/100,e[3]/100,e[4]):aV.hasOwnProperty(t)?lV(aV[t]):t==="transparent"?new jo(NaN,NaN,NaN,0):null}function lV(t){return new jo(t>>16&255,t>>8&255,t&255,1)}function TE(t,e,n,i){return i<=0&&(t=e=n=NaN),new jo(t,e,n,i)}function gLe(t){return t instanceof rS||(t=OC(t)),t?(t=t.rgb(),new jo(t.r,t.g,t.b,t.opacity)):new jo}function bLe(t,e,n,i){return arguments.length===1?gLe(t):new jo(t,e,n,i??1)}function jo(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}t4(jo,bLe,Oee(rS,{brighter(t){return t=t==null?bT:Math.pow(bT,t),new jo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?t_:Math.pow(t_,t),new jo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new jo(Lm(this.r),Lm(this.g),Lm(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:cV,formatHex:cV,formatHex8:vLe,formatRgb:uV,toString:uV}));function cV(){return`#${mm(this.r)}${mm(this.g)}${mm(this.b)}`}function vLe(){return`#${mm(this.r)}${mm(this.g)}${mm(this.b)}${mm((isNaN(this.opacity)?1:this.opacity)*255)}`}function uV(){const t=vT(this.opacity);return`${t===1?"rgb(":"rgba("}${Lm(this.r)}, ${Lm(this.g)}, ${Lm(this.b)}${t===1?")":`, ${t})`}`}function vT(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Lm(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mm(t){return t=Lm(t),(t<16?"0":"")+t.toString(16)}function fV(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new lu(t,e,n,i)}function Iee(t){if(t instanceof lu)return new lu(t.h,t.s,t.l,t.opacity);if(t instanceof rS||(t=OC(t)),!t)return new lu;if(t instanceof lu)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 lu(s,o,l,t.opacity)}function yLe(t,e,n,i){return arguments.length===1?Iee(t):new lu(t,e,n,i??1)}function lu(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}t4(lu,yLe,Oee(rS,{brighter(t){return t=t==null?bT:Math.pow(bT,t),new lu(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?t_:Math.pow(t_,t),new lu(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 jo(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 lu(hV(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("}${hV(this.h)}, ${AE(this.s)*100}%, ${AE(this.l)*100}%${t===1?")":`, ${t})`}`}}));function hV(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 xLe(t){return t===void 0&&(t={customClassName:"gfm-color-chip"}),function(e){rLe(e,"element",function(n){if(n.tagName==="code"&&n.properties){var i=aLe(n),r=OC(i);r&&n.children.push({type:"element",tagName:"span",properties:{className:[t.customClassName],style:"background-color: "+r.formatHex()+";"},children:[]})}})}}function _Le(){return t=>{iS(t,"element",(e,n,i)=>{e.tagName==="code"&&i&&i.type==="element"&&i.tagName==="pre"&&(e.properties={block:!0,...e.properties})})}}function SLe(t){return k.jsx(bu,{...t})}function wLe(t){return k.jsx(Cm,{...t})}function Ib(t,e){return k.jsx(IA,{order:e,...t})}function dV(t,e,n){return t.className=="contains-task-list"?k.jsx(Y0,{type:n,...t,listStyleType:"none",children:e}):k.jsx(Y0,{type:n,...t,children:e})}function ELe(t,e){return k.jsx(Y0.Item,{...t,children:e})}function MLe(t,e){return k.jsx(oP,{...t,children:e})}function TLe(t){return k.jsx(iP,{...t})}function ALe(t){return k.jsx("cite",{style:{display:"block",fontSize:"0.875rem",marginTop:"0.625rem",color:"#909296",overflow:"hidden",textOverflow:"ellipsis"},...t})}function CLe(t){return k.jsx(Nc,{...t,highlightOnHover:!0,withColumnBorders:!0})}function RLe(t){return k.jsx(O_,{maw:240,mx:"auto",radius:"md",...t})}const kLe={p:t=>SLe(t),a:t=>wLe(t),h1:t=>Ib(t,1),h2:t=>Ib(t,2),h3:t=>Ib(t,3),h4:t=>Ib(t,4),h5:t=>Ib(t,5),h6:t=>Ib(t,6),ul:t=>dV(t,t.children??"","unordered"),ol:t=>dV(t,t.children??"","ordered"),li:t=>ELe(t,t.children??""),code:t=>MLe(t,t.children??""),pre:t=>k.jsx(k.Fragment,{children:t.children}),blockquote:t=>TLe(t),Cite:t=>ALe(t),table:t=>CLe(t),img:t=>RLe(t),"*":()=>k.jsx(k.Fragment,{})};async function DLe(t){const{default:e}=await jOe(t,{..._re,...JAe,development:!1,remarkPlugins:[JNe],rehypePlugins:[_Le,xLe]});return e}function OLe(t){const[e,n]=I.useState(null);return I.useEffect(()=>{try{DLe(t.children??"").then(i=>{n(k.jsx(i,{components:kLe}))})}catch{n(k.jsx(IA,{order:2,children:"Error Parsing Markdown..."}))}},[t.children]),e}const ILe=I.createContext(null),QD={didCatch:!1,error:null};class NLe 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&&LLe(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(ILe.Provider,{value:{didCatch:a,error:s,resetErrorBoundary:this.resetErrorBoundary}},o)}}function LLe(){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 PLe({props:{visible:t,_markdown:e}}){return t?k.jsx(ct,{pb:"xs",px:"sm",style:{maxWidth:"95%"},children:k.jsx(NLe,{fallback:k.jsx(bu,{style:{textAlign:"center"},children:"Markdown Failed to Render"}),children:k.jsx(OLe,{children:e})})}):null}var n4="_3o7djo0",ULe="_3o7djo1",FLe="_3o7djo2";const pV=Ce.memo(function({jsonStr:e,aspectRatio:n,onExpand:i}){const[r,a]=Ce.useState(!1);if(e==="")return k.jsx("div",{});const s=JSON.parse(e);s.layout.uirevision="true";const{ref:o,width:l}=aX();s.layout.width=l,s.layout.height=l*n;const c=Ce.useRef(null);return Ce.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(Pr,{label:"Expand plot",children:k.jsx(Ol,{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(lQ,{size:14})})})]})});function BLe({props:{visible:t,_plotly_json_str:e,aspect:n}}){if(!t)return null;const[i,{open:r,close:a}]=Ec(!1);return k.jsxs(ct,{children:[k.jsx(pV,{jsonStr:e,aspectRatio:n,onExpand:r}),k.jsx(Ro,{opened:i,onClose:a,size:"xl",children:k.jsx(pV,{jsonStr:e,aspectRatio:n})})]})}var Nee={exports:{}};const zLe=!0,Va="u-",jLe="uplot",HLe=Va+"hz",VLe=Va+"vt",GLe=Va+"title",WLe=Va+"wrap",qLe=Va+"under",XLe=Va+"over",KLe=Va+"axis",rm=Va+"off",YLe=Va+"select",JLe=Va+"cursor-x",$Le=Va+"cursor-y",ZLe=Va+"cursor-pt",QLe=Va+"legend",ePe=Va+"live",tPe=Va+"inline",nPe=Va+"series",iPe=Va+"marker",mV=Va+"label",rPe=Va+"value",Dx="width",Ox="height",cx="top",gV="bottom",Nb="left",e8="right",i4="#000",bV=i4+"0",t8="mousemove",vV="mousedown",n8="mouseup",yV="mouseenter",xV="mouseleave",_V="dblclick",aPe="resize",sPe="scroll",SV="change",yT="dppxchange",r4="--",ay=typeof window<"u",UI=ay?document:null,C0=ay?window:null,oPe=ay?navigator:null;let Qi,CE;function FI(){let t=devicePixelRatio;Qi!=t&&(Qi=t,CE&&zI(SV,CE,FI),CE=matchMedia(`(min-resolution: ${Qi-.001}dppx) and (max-resolution: ${Qi+.001}dppx)`),Pm(SV,CE,FI),C0.dispatchEvent(new CustomEvent(yT)))}function dl(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 zr(t,e,n){t.style[e]=n+"px"}function $c(t,e,n,i){let r=UI.createElement(t);return e!=null&&dl(r,e),n?.insertBefore(r,i),r}function Ql(t,e){return $c("div",t,e)}const wV=new WeakMap;function ju(t,e,n,i,r){let a="translate("+e+"px,"+n+"px)",s=wV.get(t);a!=s&&(t.style.transform=a,wV.set(t,a),e<0||n<0||e>i||n>r?dl(t,rm):BI(t,rm))}const EV=new WeakMap;function MV(t,e,n){let i=e+n,r=EV.get(t);i!=r&&(EV.set(t,i),t.style.background=e,t.style.borderColor=n)}const TV=new WeakMap;function AV(t,e,n,i){let r=e+""+n,a=TV.get(t);r!=a&&(TV.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},lPe={...a4,capture:!0};function Pm(t,e,n,i){e.addEventListener(t,n,i?lPe:a4)}function zI(t,e,n,i){e.removeEventListener(t,n,a4)}ay&&FI();function tu(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:Tl((n+i)/2),e[r]<t?n=r:i=r;return t-e[n]<=e[i]-t?n:i}function Lee(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 Pee=t=>t!=null,Uee=t=>t!=null&&t>0,IC=Lee(Pee),cPe=Lee(Uee);function uPe(t,e,n,i=0,r=!1){let a=r?cPe:IC,s=r?Uee:Pee;[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??Er,l??-Er]}function NC(t,e,n,i){let r=kV(t),a=kV(e);t==e&&(r==-1?(t*=n,e/=n):(t/=n,e*=n));let s=n==10?lh:Fee,o=r==1?Tl:ac,l=a==1?ac:Tl,c=o(s(Ua(t))),u=l(s(Ua(e))),f=gv(n,c),h=gv(n,u);return n==10&&(c<0&&(f=Mr(f,-c)),u<0&&(h=Mr(h,-u))),i||n==2?(t=f*r,e=h*a):(t=Hee(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,CV={mode:3,pad:o4},m1={pad:0,soft:null,mode:0},fPe={min:m1,max:m1};function xT(t,e,n,i){return PC(n)?RV(t,e,n):(m1.pad=n,m1.soft=i?0:null,m1.mode=i?3:0,RV(t,e,fPe))}function Yi(t,e){return t??e}function hPe(t,e,n){for(e=Yi(e,0),n=Yi(n,t.length-1);e<=n;){if(t[e]!=null)return!0;e++}return!1}function RV(t,e,n){let i=n.min,r=n.max,a=Yi(i.pad,0),s=Yi(r.pad,0),o=Yi(i.hard,-Er),l=Yi(r.hard,Er),c=Yi(i.soft,Er),u=Yi(r.soft,-Er),f=Yi(i.mode,0),h=Yi(r.mode,0),d=e-t,g=lh(d),b=To(Ua(t),Ua(e)),y=lh(b),m=Ua(y-g);(d<1e-24||m>10)&&(d=0,(t==0||e==0)&&(d=1e-24,f==2&&c!=Er&&(a=0),h==2&&u!=-Er&&(s=0)));let x=d||b||1e3,_=lh(x),w=gv(10,Tl(_)),M=x*(d==0?t==0?.1:1:a),S=Mr(Hee(t-M,w/10),24),A=t>=c&&(f==1||f==3&&S<=c||f==2&&S>=c)?c:Er,C=To(o,S<A&&t>=A?A:cu(A,S)),D=x*(d==0?e==0?.1:1:s),R=Mr(LC(e+D,w/10),24),L=e<=u&&(h==1||h==3&&R>=u||h==2&&R<=u)?u:-Er,U=cu(l,R>L&&e<=L?L:To(L,R));return C==U&&C==0&&(U=100),[C,U]}const dPe=new Intl.NumberFormat(ay?oPe.language:"en-US"),l4=t=>dPe.format(t),Nl=Math,SM=Nl.PI,Ua=Nl.abs,Tl=Nl.floor,Pa=Nl.round,ac=Nl.ceil,cu=Nl.min,To=Nl.max,gv=Nl.pow,kV=Nl.sign,lh=Nl.log10,Fee=Nl.log2,pPe=(t,e=1)=>Nl.sinh(t)*e,i8=(t,e=1)=>Nl.asinh(t/e),Er=1/0;function DV(t){return(lh((t^t>>31)-(t>>31))|0)+1}function jI(t,e,n){return cu(To(t,e),n)}function Bee(t){return typeof t=="function"}function Ni(t){return Bee(t)?t:()=>t}const mPe=()=>{},zee=t=>t,jee=(t,e)=>e,gPe=t=>null,OV=t=>!0,IV=(t,e)=>t==e,bPe=/\.\d*?(?=9{6,}|0{6,})/gm,Zm=t=>{if(Gee(t)||Wd.has(t))return t;const e=`${t}`,n=e.match(bPe);if(n==null)return t;let i=n[0].length-1;if(e.indexOf("e-")!=-1){let[r,a]=e.split("e");return+`${Zm(r)}e${a}`}return Mr(t,i)};function Zp(t,e){return Zm(Mr(Zm(t/e))*e)}function LC(t,e){return Zm(ac(Zm(t/e))*e)}function Hee(t,e){return Zm(Tl(Zm(t/e))*e)}function Mr(t,e=0){if(Gee(t))return t;let n=10**e,i=t*n*(1+Number.EPSILON);return Pa(i)/n}const Wd=new Map;function Vee(t){return((""+t).split(".")[1]||"").length}function i_(t,e,n,i){let r=[],a=i.map(Vee);for(let s=e;s<n;s++){let o=Ua(s),l=Mr(gv(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:Mr(u,f);r.push(h),Wd.set(h,f)}}return r}const g1={},c4=[],bv=[null,null],fd=Array.isArray,Gee=Number.isInteger,vPe=t=>t===void 0;function NV(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 yPe(t){return t!=null&&typeof t=="object"}const xPe=Object.getPrototypeOf(Uint8Array),Wee="__proto__";function vv(t,e=PC){let n;if(fd(t)){let i=t.find(r=>r!=null);if(fd(i)||e(i)){n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=vv(t[r],e)}else n=t.slice()}else if(t instanceof xPe)n=t.slice();else if(e(t)){n={};for(let i in t)i!=Wee&&(n[i]=vv(t[i],e))}else n=t;return n}function Aa(t){let e=arguments;for(let n=1;n<e.length;n++){let i=e[n];for(let r in i)r!=Wee&&(PC(t[r])?Aa(t[r],vv(i[r])):t[r]=vv(i[r]))}return t}const _Pe=0,SPe=1,wPe=2;function EPe(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 MPe(t,e){if(CPe(t)){let s=t[0].slice();for(let o=1;o<t.length;o++)s.push(...t[o].slice(1));return RPe(s[0])||(s=APe(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]:SPe,d=[];for(let g=0;g<u.length;g++){let b=u[g],y=a.get(l[g]);b===null?h!=_Pe&&(f[y]=b,h==wPe&&d.push(y)):f[y]=b}EPe(f,d,r),i.push(f)}}return i}const TPe=typeof queueMicrotask>"u"?t=>Promise.resolve().then(t):queueMicrotask;function APe(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 CPe(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 RPe(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=To(1,Tl((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 qee=["January","February","March","April","May","June","July","August","September","October","November","December"],Xee=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Kee(t){return t.slice(0,3)}const kPe=Xee.map(Kee),DPe=qee.map(Kee),OPe={MMMM:qee,MMM:DPe,WWWW:Xee,WWW:kPe};function ux(t){return(t<10?"0":"")+t}function IPe(t){return(t<10?"00":t<100?"0":"")+t}const NPe={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=>ux(t.getMonth()+1),M:t=>t.getMonth()+1,DD:t=>ux(t.getDate()),D:t=>t.getDate(),WWWW:(t,e)=>e.WWWW[t.getDay()],WWW:(t,e)=>e.WWW[t.getDay()],HH:t=>ux(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=>ux(t.getMinutes()),m:t=>t.getMinutes(),ss:t=>ux(t.getSeconds()),s:t=>t.getSeconds(),fff:t=>IPe(t.getMilliseconds())};function u4(t,e){e=e||OPe;let n=[],i=/\{([a-z]+)\}|[^{]+/gi,r;for(;r=i.exec(t);)n.push(r[0][0]=="{"?NPe[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 LPe=new Intl.DateTimeFormat().resolvedOptions().timeZone;function PPe(t,e){let n;return e=="UTC"||e=="Etc/UTC"?n=new Date(+t+t.getTimezoneOffset()*6e4):e==LPe?n=t:(n=new Date(t.toLocaleString("en-US",{timeZone:e})),n.setMilliseconds(t.getMilliseconds())),n}const Yee=t=>t%1==0,_T=[1,2,2.5,5],UPe=i_(10,-32,0,_T),Jee=i_(10,0,32,_T),FPe=Jee.filter(Yee),Qp=UPe.concat(Jee),f4=`
`,$ee="{YYYY}",LV=f4+$ee,Zee="{M}/{D}",Ix=f4+Zee,RE=Ix+"/{YY}",Qee="{aa}",BPe="{h}:{mm}",Vb=BPe+Qee,PV=f4+Vb,UV=":{ss}",lr=null;function ete(t){let e=t*1e3,n=e*60,i=n*60,r=i*24,a=r*30,s=r*365,l=(t==1?i_(10,0,3,_T).filter(Yee):i_(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,$ee,lr,lr,lr,lr,lr,lr,1],[r*28,"{MMM}",LV,lr,lr,lr,lr,lr,1],[r,Zee,LV,lr,lr,lr,lr,lr,1],[i,"{h}"+Qee,RE,lr,Ix,lr,lr,lr,1],[n,Vb,RE,lr,Ix,lr,lr,lr,1],[e,UV,RE+" "+Vb,lr,Ix+" "+Vb,lr,PV,lr,1],[t,UV+".{fff}",RE+" "+Vb,lr,Ix+" "+Vb,lr,PV,lr,1]];function u(f){return(h,d,g,b,y,m)=>{let x=[],_=y>=s,w=y>=a&&y<s,M=f(g),S=Mr(M*t,3),A=r8(M.getFullYear(),_?0:M.getMonth(),w||_?1:M.getDate()),C=Mr(A*t,3);if(w||_){let D=w?y/a:0,R=_?y/s:0,L=S==C?S:Mr(r8(A.getFullYear()+R,A.getMonth()+D,1)*t,3),U=new Date(Pa(L/t)),j=U.getFullYear(),z=U.getMonth();for(let q=0;L<=b;q++){let F=r8(j+R*q,z+D*q,1),V=F-f(Mr(F*t,3));L=Mr((+F+V)*t,3),L<=b&&x.push(L)}}else{let D=y>=r?r:y,R=Tl(g)-Tl(S),L=C+R+LC(S-C,D);x.push(L);let U=f(L),j=U.getHours()+U.getMinutes()/n+U.getSeconds()/i,z=y/i,q=h.axes[d]._space,F=m/q;for(;L=Mr(L+y,t==1?0:3),!(L>b);)if(z>1){let V=Tl(Mr(j+z,6))%24,B=f(L).getHours()-V;B>1&&(B=-1),L-=B*i,j=(j+z)%24;let J=x[x.length-1];Mr((L-J)/y,3)*F>=.7&&x.push(L)}else x.push(L)}return x}}return[l,c,u]}const[zPe,jPe,HPe]=ete(1),[VPe,GPe,WPe]=ete(.001);i_(2,-53,53,[1]);function FV(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 BV(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(),m=b.getMonth(),x=b.getDate(),_=b.getHours(),w=b.getMinutes(),M=b.getSeconds(),S=y!=l&&o[2]||m!=c&&o[3]||x!=u&&o[4]||_!=f&&o[5]||w!=h&&o[6]||M!=d&&o[7]||o[1];return l=y,c=m,u=x,f=_,h=w,d=M,S(b)})}}function qPe(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 zV(t,e){return e(t)}const XPe="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function jV(t,e){return(n,i,r,a)=>a==null?r4:e(t(i))}function KPe(t,e){let n=t.series[e];return n.width?n.stroke(t,e):n.points.width?n.points.stroke(t,e):null}function YPe(t,e){return t.series[e].fill(t,e)}const JPe={show:!0,live:!0,isolate:!1,mount:mPe,markers:{show:!0,width:2,stroke:KPe,fill:YPe,dash:"solid"},idx:null,idxs:null,values:[]};function $Pe(t,e){let n=t.cursor.points,i=Ql(),r=n.size(t,e);zr(i,Dx,r),zr(i,Ox,r);let a=r/-2;zr(i,"marginLeft",a),zr(i,"marginTop",a);let s=n.width(t,e,r);return s&&zr(i,"borderWidth",s),i}function ZPe(t,e){let n=t.series[e].points;return n._fill||n._stroke}function QPe(t,e){let n=t.series[e].points;return n._stroke||n._fill}function eUe(t,e){return t.series[e].points.size}const a8=[0,0];function tUe(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 nUe={show:!0,x:!0,y:!0,lock:!1,move:tUe,points:{one:!1,show:$Pe,size:eUe,width:0,stroke:QPe,fill:ZPe},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},tte={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},h4=Aa({},tte,{filter:jee}),nte=Aa({},h4,{size:10}),ite=Aa({},tte,{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"',rte="bold "+d4,ate=1.5,HV={show:!0,scale:"x",stroke:i4,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:rte,side:2,grid:h4,ticks:nte,border:ite,font:d4,lineGap:ate,rotate:0},iUe="Value",rUe="Time",VV={show:!0,scale:"x",auto:!1,sorted:1,min:Er,max:-Er,idxs:[]};function aUe(t,e,n,i,r){return e.map(a=>a==null?"":l4(a))}function sUe(t,e,n,i,r,a,s){let o=[],l=Wd.get(r)||0;n=s?n:Mr(LC(n,r),l);for(let c=n;c<=i;c=Mr(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?lh:Fee,u=Tl(c(n));r=gv(l,u),l==10&&(r=Qp[tu(r,Qp)]);let f=n,h=r*l;l==10&&(h=Qp[tu(h,Qp)]);do o.push(f),f=f+r,l==10&&!Wd.has(f)&&(f=Mr(f,Wd.get(r))),f>=h&&(r=f,h=r*l,l==10&&(h=Qp[tu(h,Qp)]));while(f<=i);return o}function oUe(t,e,n,i,r,a,s){let l=t.scales[t.axes[e].scale].asinh,c=i>l?HI(t,e,To(l,n),i,r):[l],u=i>=0&&n<=0?[0]:[];return(n<-l?HI(t,e,To(l,-i),-n,r):[l]).reverse().map(h=>-h).concat(u,c)}const ste=/./,lUe=/[12357]/,cUe=/[125]/,GV=/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 uUe(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?ste:l(7,s)-u>=c?lUe:l(5,s)-u>=c?cUe:GV;if(f==GV){let h=Ua(l(1,s)-u);if(h<c)return VI(e.slice().reverse(),o.distr,f,ac(c/h)).reverse()}return VI(e,o.distr,f,1)}function fUe(t,e,n,i,r){let a=t.axes[n],s=a.scale,o=a._space,l=t.valToPos,c=Ua(l(1,s)-l(2,s));return c<o?VI(e.slice().reverse(),3,ste,ac(o/c)).reverse():e}function hUe(t,e,n,i){return i==null?r4:e==null?"":l4(e)}const WV={show:!0,scale:"y",stroke:i4,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:rte,side:3,grid:h4,ticks:nte,border:ite,font:d4,lineGap:ate,rotate:0};function dUe(t,e){let n=3+(t||1)*2;return Mr(n*e,3)}function pUe(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=Ua(s-a),l=t.series[e],c=o/(l.points.space*Qi);return i[1]-i[0]<=c}const qV={scale:null,auto:!0,sorted:0,min:Er,max:-Er},ote=(t,e,n,i,r)=>r,XV={show:!0,auto:!0,sorted:0,gaps:ote,alpha:1,facets:[Aa({},qV,{scale:"x"}),Aa({},qV,{scale:"y"})]},KV={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:ote,alpha:1,points:{show:pUe,filter:null},values:null,min:Er,max:-Er,idxs:[],path:null,clip:null};function mUe(t,e,n,i,r){return n/10}const lte={time:zLe,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},gUe=Aa({},lte,{time:!1,ori:1}),YV={};function cte(t,e){let n=YV[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&&(YV[t]=n)),n}const yv=1,GI=2;function gg(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,m=t.valToPosV;return u.ori==0?n(r,l,c,u,f,y,m,h,d,g,b,FC,sy,zC,fte,dte):n(r,l,c,u,f,m,y,d,h,b,g,BC,oy,g4,hte,pte)}function p4(t,e){let n=0,i=0,r=Yi(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 bUe(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 ch(t,e,n,i,r,a){return gg(t,e,(s,o,l,c,u,f,h,d,g,b,y)=>{let m=s.pxRound;const x=c.dir*(c.ori==0?1:-1),_=c.ori==0?sy:oy;let w,M;x==1?(w=n,M=i):(w=i,M=n);let S=m(f(o[w],c,b,d)),A=m(h(l[w],u,y,g)),C=m(f(o[M],c,b,d)),D=m(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 vUe(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 m=h+r;g=s>=0&&m>=0&&m<l?a(t[m]):g,g>=d&&o.push([d,g])}return o}function JV(t){return t==0?zee:t==1?Pa:e=>Zp(e,t)}function ute(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=cu(c,o/2,l/2),u=cu(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)},sy=(t,e,n)=>{t.lineTo(e,n)},oy=(t,e,n)=>{t.lineTo(n,e)},zC=ute(0),g4=ute(1),fte=(t,e,n,i,r,a)=>{t.arc(e,n,i,r,a)},hte=(t,e,n,i,r,a)=>{t.arc(n,e,i,r,a)},dte=(t,e,n,i,r,a,s)=>{t.bezierCurveTo(e,n,i,r,a,s)},pte=(t,e,n,i,r,a,s)=>{t.bezierCurveTo(n,e,r,i,s,a)};function mte(t){return(e,n,i,r,a)=>gg(e,n,(s,o,l,c,u,f,h,d,g,b,y)=>{let{pxRound:m,points:x}=s,_,w;c.ori==0?(_=FC,w=fte):(_=BC,w=hte);const M=Mr(x.width*Qi,3);let S=(x.size-x.width)/2*Qi,A=Mr(S*2,3),C=new Path2D,D=new Path2D,{left:R,top:L,width:U,height:j}=e.bbox;zC(D,R-A,L-A,U+A*2,j+A*2);const z=q=>{if(l[q]!=null){let F=m(f(o[q],c,b,d)),V=m(h(l[q],u,y,g));_(C,F+S,V),w(C,F,V,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:yv|GI}})}function gte(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 yUe=gte(sy),xUe=gte(oy);function bte(t){const e=Yi(t?.alignGaps,0);return(n,i,r,a)=>gg(n,i,(s,o,l,c,u,f,h,d,g,b,y)=>{[r,a]=IC(l,r,a);let m=s.pxRound,x=j=>m(f(j,c,b,d)),_=j=>m(h(j,u,y,g)),w,M;c.ori==0?(w=sy,M=yUe):(w=oy,M=xUe);const S=c.dir*(c.ori==0?1:-1),A={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:yv},C=A.stroke;let D=!1;if(a-r>=b*4){let j=G=>n.posToVal(G,c.key,!0),z=null,q=null,F,V,H,W=x(o[S==1?r:a]),B=x(o[r]),J=x(o[a]),Z=j(S==1?B+1:J-1);for(let G=S==1?r:a;G>=r&&G<=a;G+=S){let de=o[G],le=(S==1?de<Z:de>Z)?W:x(de),ue=l[G];le==W?ue!=null?(V=ue,z==null?(w(C,le,_(V)),F=z=q=V):V<z?z=V:V>q&&(q=V)):ue===null&&(D=!0):(z!=null&&M(C,W,_(z),_(q),_(F),_(V)),ue!=null?(V=ue,w(C,le,_(V)),z=q=F=V):(z=q=null,ue===null&&(D=!0)),W=le,Z=j(W+S))}z!=null&&z!=q&&H!=W&&M(C,W,_(z),_(q),_(F),_(V))}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[L,U]=p4(n,i);if(s.fill!=null||L!=0){let j=A.fill=new Path2D(C),z=s.fillTo(n,i,s.min,s.max,L),q=_(z),F=x(o[r]),V=x(o[a]);S==-1&&([V,F]=[F,V]),w(j,V,q),w(j,F,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?[ch(n,i,r,a,C,-1),ch(n,i,r,a,C,1)]:ch(n,i,r,a,C,U)),A})}function _Ue(t){const e=Yi(t.align,1),n=Yi(t.ascDesc,!1),i=Yi(t.alignGaps,0),r=Yi(t.extend,!1);return(a,s,o,l)=>gg(a,s,(c,u,f,h,d,g,b,y,m,x,_)=>{[o,l]=IC(f,o,l);let w=c.pxRound,{left:M,width:S}=a.bbox,A=B=>w(g(B,h,x,y)),C=B=>w(b(B,d,_,m)),D=h.ori==0?sy:oy;const R={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:yv},L=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,F=z;r&&e==-1&&(F=M,D(L,F,j)),D(L,z,j);for(let B=U==1?o:l;B>=o&&B<=l;B+=U){let J=f[B];if(J==null)continue;let Z=A(u[B]),G=C(J);e==1?D(L,Z,j):D(L,q,G),D(L,Z,G),j=G,q=Z}let V=q;r&&e==1&&(V=M+S,D(L,V,j));let[H,W]=p4(a,s);if(c.fill!=null||H!=0){let B=R.fill=new Path2D(L),J=c.fillTo(a,s,c.min,c.max,H),Z=C(J);D(B,V,Z),D(B,F,Z)}if(!c.spanGaps){let B=[];B.push(...m4(u,f,o,l,U,A,i));let J=c.width*Qi/2,Z=n||e==1?J:-J,G=n||e==-1?-J:J;B.forEach(de=>{de[0]+=Z,de[1]+=G}),R.gaps=B=c.gaps(a,s,o,l,B),R.clip=UC(B,h.ori,y,m,x,_)}return W!=0&&(R.band=W==2?[ch(a,s,o,l,L,-1),ch(a,s,o,l,L,1)]:ch(a,s,o,l,L,W)),R})}function $V(t,e,n,i,r,a,s=Er){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=Ua(t[l]-t[o]);u<c&&(c=u,s=Ua(n(t[l],i,r,a)-n(t[o],i,r,a)))}o=l}}return s}function SUe(t){t=t||g1;const e=Yi(t.size,[.6,Er,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=Ni(r),s=1-e[0],o=Yi(e[1],Er),l=Yi(e[2],1),c=Yi(t.disp,g1),u=Yi(t.each,d=>{}),{fill:f,stroke:h}=c;return(d,g,b,y)=>gg(d,g,(m,x,_,w,M,S,A,C,D,R,L)=>{let U=m.pxRound,j=n,z=i*Qi,q=o*Qi,F=l*Qi,V,H;w.ori==0?[V,H]=a(d,g):[H,V]=a(d,g);const W=w.dir*(w.ori==0?1:-1);let B=w.ori==0?zC:g4,J=w.ori==0?u:(ce,he,me,$,Ve,Xe,mt)=>{u(ce,he,me,Ve,$,mt,Xe)},Z=Yi(d.bands,c4).find(ce=>ce.series[0]==g),G=Z!=null?Z.dir:0,de=m.fillTo(d,g,m.min,m.max,G),oe=U(A(de,M,L,D)),le,ue,Se,Oe=R,Be=U(m.width*Qi),je=!1,He=null,pe=null,ze=null,Ie=null;f!=null&&(Be==0||h!=null)&&(je=!0,He=f.values(d,g,b,y),pe=new Map,new Set(He).forEach(ce=>{ce!=null&&pe.set(ce,new Path2D)}),Be>0&&(ze=h.values(d,g,b,y),Ie=new Map,new Set(ze).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),Oe=$V(x,_,S,w,R,C,Oe),Se=Oe-ue+z}else Oe=$V(x,_,S,w,R,C,Oe),Se=Oe*s+z,ue=Oe-Se;Se<1&&(Se=0),Be>=ue/2&&(Be=0),Se<5&&(U=zee);let Me=Se>0,Ae=Oe-Se-(Me?Be:0);ue=U(jI(Ae,F,q)),le=(j==0?ue/2:j==W?0:ue)-j*W*((j==0?z/2:0)+(Me?Be/2:0));const Ne={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Ue=je?null:new Path2D;let Qe=null;if(Z!=null)Qe=d.data[Z.series[1]];else{let{y0:ce,y1:he}=c;ce!=null&&he!=null&&(_=he.values(d,g,b,y),Qe=ce.values(d,g,b,y))}let ae=V*ue,K=H*ue;for(let ce=W==1?b:y;ce>=b&&ce<=y;ce+=W){let he=_[ce];if(he==null)continue;if(Qe!=null){let Ye=Qe[ce]??0;if(he-Ye==0)continue;oe=A(Ye,M,L,D)}let me=w.distr!=2||c!=null?x[ce]:ce,$=S(me,w,R,C),Ve=A(Yi(he,de),M,L,D),Xe=U($-le),mt=U(To(Ve,oe)),Ge=U(cu(Ve,oe)),Je=mt-Ge;if(he!=null){let Ye=he<0?K:ae,vt=he<0?ae:K;je?(Be>0&&ze[ce]!=null&&B(Ie.get(ze[ce]),Xe,Ge+Tl(Be/2),ue,To(0,Je-Be),Ye,vt),He[ce]!=null&&B(pe.get(He[ce]),Xe,Ge+Tl(Be/2),ue,To(0,Je-Be),Ye,vt)):B(Ue,Xe,Ge+Tl(Be/2),ue,To(0,Je-Be),Ye,vt),J(d,g,ce,Xe-Be/2,Ge,ue+Be,Je)}}return Be>0?Ne.stroke=je?Ie:Ue:je||(Ne._fill=m.width==0?m._fill:m._stroke??m._fill,Ne.width=0),Ne.fill=je?pe:Ue,Ne})}function wUe(t,e){const n=Yi(e?.alignGaps,0);return(i,r,a,s)=>gg(i,r,(o,l,c,u,f,h,d,g,b,y,m)=>{[a,s]=IC(c,a,s);let x=o.pxRound,_=V=>x(h(V,u,y,g)),w=V=>x(d(V,f,m,b)),M,S,A;u.ori==0?(M=FC,A=sy,S=dte):(M=BC,A=oy,S=pte);const C=u.dir*(u.ori==0?1:-1);let D=_(l[C==1?a:s]),R=D,L=[],U=[];for(let V=C==1?a:s;V>=a&&V<=s;V+=C)if(c[V]!=null){let W=l[V],B=_(W);L.push(R=B),U.push(w(c[V]))}const j={stroke:t(L,U,M,A,S,x),fill:null,clip:null,band:null,gaps:null,flags:yv},z=j.stroke;let[q,F]=p4(i,r);if(o.fill!=null||q!=0){let V=j.fill=new Path2D(z),H=o.fillTo(i,r,o.min,o.max,q),W=w(H);A(V,R,W),A(V,D,W)}if(!o.spanGaps){let V=[];V.push(...m4(l,c,a,s,C,_,n)),j.gaps=V=o.gaps(i,r,a,s,V),j.clip=UC(V,u.ori,g,b,y,m)}return F!=0&&(j.band=F==2?[ch(i,r,a,s,z,-1),ch(i,r,a,s,z,1)]:ch(i,r,a,s,z,F)),j})}function EUe(t){return wUe(MUe,t)}function MUe(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 ZV(){for(let t of WI)t.syncRect(!0)}ay&&(Pm(aPe,C0,ZV),Pm(sPe,C0,ZV,!0),Pm(yT,C0,()=>{ao.pxRatio=Qi}));const TUe=bte(),AUe=mte();function QV(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 CUe(t,e){return t.map((n,i)=>i==0?{}:Aa({},e,n))}function qI(t,e,n,i){return Aa({},e==0?n:i,t)}function vte(t,e,n){return e==null?bv:[e,n]}const RUe=vte;function kUe(t,e,n){return e==null?bv:xT(e,n,o4,!0)}function yte(t,e,n,i){return e==null?bv:NC(e,n,t.scales[i].log,!1)}const DUe=yte;function xte(t,e,n,i){return e==null?bv:s4(e,n,t.scales[i].log,!1)}const OUe=xte;function IUe(t,e,n,i,r){let a=To(DV(t),DV(e)),s=e-t,o=tu(r/i*s,n);do{let l=n[o],c=i*l/s;if(c>=r&&a+(l<5?Wd.get(l):0)<=17)return[l,c]}while(++o<n.length);return[0,0]}function eG(t){let e,n;return t=t.replace(/(\d+)px/,(i,r)=>(e=Pa((n=+r)*Qi))+"px"),[t,e,n]}function NUe(t){t.show&&[t.font,t.labelFont].forEach(e=>{let n=Mr(e[2]*Qi,1);e[0]=e[0].replace(/[0-9.]+px/,n+"px"),e[1]=n})}function ao(t,e,n){const i={mode:Yi(t.mode,1)},r=i.mode;function a(Q,fe,_e,Ee){let We=fe.valToPct(Q);return Ee+_e*(fe.dir==-1?1-We:We)}function s(Q,fe,_e,Ee){let We=fe.valToPct(Q);return Ee+_e*(fe.dir==-1?We:1-We)}function o(Q,fe,_e,Ee){return fe.ori==0?a(Q,fe,_e,Ee):s(Q,fe,_e,Ee)}i.valToPosH=a,i.valToPosV=s;let l=!1;i.status=0;const c=i.root=Ql(jLe);if(t.id!=null&&(c.id=t.id),dl(c,t.class),t.title){let Q=Ql(GLe,c);Q.textContent=t.title}const u=$c("canvas"),f=i.ctx=u.getContext("2d"),h=Ql(WLe,c);Pm("click",h,Q=>{Q.target===g&&(Cn!=zt||ai!=gn)&&Mi.click(i,Q)},!0);const d=i.under=Ql(qLe,h);h.appendChild(u);const g=i.over=Ql(XLe,h);t=vv(t);const b=+Yi(t.pxAlign,1),y=JV(b);(t.plugins||[]).forEach(Q=>{Q.opts&&(t=Q.opts(i,t)||t)});const m=t.ms||.001,x=i.series=r==1?QV(t.series||[],VV,KV,!1):CUe(t.series||[null],XV),_=i.axes=QV(t.axes||[],HV,WV,!0),w=i.scales={},M=i.bands=t.bands||[];M.forEach(Q=>{Q.fill=Ni(Q.fill||null),Q.dir=Yi(Q.dir,-1)});const S=r==2?x[1].facets[0].scale:x[0].scale,A={axes:_n,series:Sn},C=(t.drawOrder||["axes","series"]).map(Q=>A[Q]);function D(Q){const fe=Q.distr==3?_e=>lh(_e>0?_e:Q.clamp(i,_e,Q.min,Q.max,Q.key)):Q.distr==4?_e=>i8(_e,Q.asinh):Q.distr==100?_e=>Q.fwd(_e):_e=>_e;return _e=>{let Ee=fe(_e),{_min:We,_max:Ze}=Q,Ct=Ze-We;return(Ee-We)/Ct}}function R(Q){let fe=w[Q];if(fe==null){let _e=(t.scales||g1)[Q]||g1;if(_e.from!=null){R(_e.from);let Ee=Aa({},w[_e.from],_e,{key:Q});Ee.valToPct=D(Ee),w[Q]=Ee}else{fe=w[Q]=Aa({},Q==S?lte:gUe,_e),fe.key=Q;let Ee=fe.time,We=fe.range,Ze=fd(We);if((Q!=S||r==2&&!Ee)&&(Ze&&(We[0]==null||We[1]==null)&&(We={min:We[0]==null?CV:{mode:1,hard:We[0],soft:We[0]},max:We[1]==null?CV:{mode:1,hard:We[1],soft:We[1]}},Ze=!1),!Ze&&PC(We))){let Ct=We;We=(Ft,Gt,Qt)=>Gt==null?bv:xT(Gt,Qt,Ct)}fe.range=Ni(We||(Ee?RUe:Q==S?fe.distr==3?DUe:fe.distr==4?OUe:vte:fe.distr==3?yte:fe.distr==4?xte:kUe)),fe.auto=Ni(Ze?!1:fe.auto),fe.clamp=Ni(fe.clamp||mUe),fe._min=fe._max=null,fe.valToPct=D(fe)}}}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 L=w[S],U=L.distr;let j,z;L.ori==0?(dl(c,HLe),j=a,z=s):(dl(c,VLe),j=s,z=a);const q={};for(let Q in w){let fe=w[Q];(fe.min!=null||fe.max!=null)&&(q[Q]={min:fe.min,max:fe.max},fe.min=fe.max=null)}const F=t.tzDate||(Q=>new Date(Pa(Q/m))),V=t.fmtDate||u4,H=m==1?HPe(F):WPe(F),W=BV(F,FV(m==1?jPe:GPe,V)),B=jV(F,zV(XPe,V)),J=[],Z=i.legend=Aa({},JPe,t.legend),G=i.cursor=Aa({},nUe,{drag:{y:r==2}},t.cursor),de=Z.show,oe=G.show,le=Z.markers;Z.idxs=J,le.width=Ni(le.width),le.dash=Ni(le.dash),le.stroke=Ni(le.stroke),le.fill=Ni(le.fill);let ue,Se,Oe,Be=[],je=[],He,pe=!1,ze={};if(Z.live){const Q=x[1]?x[1].values:null;pe=Q!=null,He=pe?Q(i,1,0):{_:0};for(let fe in He)ze[fe]=r4}if(de)if(ue=$c("table",QLe,c),Oe=$c("tbody",null,ue),Z.mount(i,ue),pe){Se=$c("thead",null,ue,Oe);let Q=$c("tr",null,Se);$c("th",null,Q);for(var Ie in He)$c("th",mV,Q).textContent=Ie}else dl(ue,tPe),Z.live&&dl(ue,ePe);const qe={show:!0},we={show:!1};function Me(Q,fe){if(fe==0&&(pe||!Z.live||r==2))return bv;let _e=[],Ee=$c("tr",nPe,Oe,Oe.childNodes[fe]);dl(Ee,Q.class),Q.show||dl(Ee,rm);let We=$c("th",null,Ee);if(le.show){let Ft=Ql(iPe,We);if(fe>0){let Gt=le.width(i,fe);Gt&&(Ft.style.border=Gt+"px "+le.dash(i,fe)+" "+le.stroke(i,fe)),Ft.style.background=le.fill(i,fe)}}let Ze=Ql(mV,We);Q.label instanceof HTMLElement?Ze.appendChild(Q.label):Ze.textContent=Q.label,fe>0&&(le.show||(Ze.style.color=Q.width>0?le.stroke(i,fe):le.fill(i,fe)),Ne("click",We,Ft=>{if(G._lock)return;Vn(Ft);let Gt=x.indexOf(Q);if((Ft.ctrlKey||Ft.metaKey)!=Z.isolate){let Qt=x.some((Zt,fn)=>fn>0&&fn!=Gt&&Zt.show);x.forEach((Zt,fn)=>{fn>0&&sr(fn,Qt?fn==Gt?qe:we:qe,!0,si.setSeries)})}else sr(Gt,{show:!Q.show},!0,si.setSeries)},!1),Yn&&Ne(yV,We,Ft=>{G._lock||(Vn(Ft),sr(x.indexOf(Q),ur,!0,si.setSeries))},!1));for(var Ct in He){let Ft=$c("td",rPe,Ee);Ft.textContent="--",_e.push(Ft)}return[Ee,_e]}const Ae=new Map;function Ne(Q,fe,_e,Ee=!0){const We=Ae.get(fe)||{},Ze=G.bind[Q](i,fe,_e,Ee);Ze&&(Pm(Q,fe,We[Q]=Ze),Ae.set(fe,We))}function Ue(Q,fe,_e){const Ee=Ae.get(fe)||{};for(let We in Ee)(Q==null||We==Q)&&(zI(We,fe,Ee[We]),delete Ee[We]);Q==null&&Ae.delete(fe)}let Qe=0,ae=0,K=0,ce=0,he=0,me=0,$=he,Ve=me,Xe=K,mt=ce,Ge=0,Je=0,Ye=0,vt=0;i.bbox={};let Mt=!1,gt=!1,kt=!1,Re=!1,Le=!1,ht=!1;function jt(Q,fe,_e){(_e||Q!=i.width||fe!=i.height)&&st(Q,fe),Ga(!1),kt=!0,gt=!0,zs()}function st(Q,fe){i.width=Qe=K=Q,i.height=ae=ce=fe,he=me=0,Kt(),un();let _e=i.bbox;Ge=_e.left=Zp(he*Qi,.5),Je=_e.top=Zp(me*Qi,.5),Ye=_e.width=Zp(K*Qi,.5),vt=_e.height=Zp(ce*Qi,.5)}const it=3;function bt(){let Q=!1,fe=0;for(;!Q;){fe++;let _e=ko(fe),Ee=us(fe);Q=fe==it||_e&&Ee,Q||(st(i.width,i.height),gt=!0)}}function Jt({width:Q,height:fe}){jt(Q,fe)}i.setSize=Jt;function Kt(){let Q=!1,fe=!1,_e=!1,Ee=!1;_.forEach((We,Ze)=>{if(We.show&&We._show){let{side:Ct,_size:Ft}=We,Gt=Ct%2,Qt=We.label!=null?We.labelSize:0,Zt=Ft+Qt;Zt>0&&(Gt?(K-=Zt,Ct==3?(he+=Zt,Ee=!0):_e=!0):(ce-=Zt,Ct==0?(me+=Zt,Q=!0):fe=!0))}}),ge[0]=Q,ge[1]=_e,ge[2]=fe,ge[3]=Ee,K-=ot[1]+ot[3],he+=ot[3],ce-=ot[2]+ot[0],me+=ot[0]}function un(){let Q=he+K,fe=me+ce,_e=he,Ee=me;function We(Ze,Ct){switch(Ze){case 1:return Q+=Ct,Q-Ct;case 2:return fe+=Ct,fe-Ct;case 3:return _e-=Ct,_e+Ct;case 0:return Ee-=Ct,Ee+Ct}}_.forEach((Ze,Ct)=>{if(Ze.show&&Ze._show){let Ft=Ze.side;Ze._pos=We(Ft,Ze._size),Ze.label!=null&&(Ze._lpos=We(Ft,Ze.labelSize))}})}if(G.dataIdx==null){let Q=G.hover,fe=Q.skip=new Set(Q.skip??[]);fe.add(void 0);let _e=Q.prox=Ni(Q.prox),Ee=Q.bias??=0;G.dataIdx=(We,Ze,Ct,Ft)=>{if(Ze==0)return Ct;let Gt=Ct,Qt=_e(We,Ze,Ct,Ft)??Er,Zt=Qt>=0&&Qt<Er,fn=L.ori==0?K:ce,Fn=G.left,mi=e[0],Wn=e[Ze];if(fe.has(Wn[Ct])){Gt=null;let ci=null,Rn=null,yn;if(Ee==0||Ee==-1)for(yn=Ct;ci==null&&yn-- >0;)fe.has(Wn[yn])||(ci=yn);if(Ee==0||Ee==1)for(yn=Ct;Rn==null&&yn++<Wn.length;)fe.has(Wn[yn])||(Rn=yn);if(ci!=null||Rn!=null)if(Zt){let fr=ci==null?-1/0:j(mi[ci],L,fn,0),Rr=Rn==null?1/0:j(mi[Rn],L,fn,0),ta=Fn-fr,Zi=Rr-Fn;ta<=Zi?ta<=Qt&&(Gt=ci):Zi<=Qt&&(Gt=Rn)}else Gt=Rn==null?ci:ci==null?Rn:Ct-ci<=Rn-Ct?ci:Rn}else Zt&&Ua(Fn-j(mi[Ct],L,fn,0))>Qt&&(Gt=null);return Gt}}const Vn=Q=>{G.event=Q};G.idxs=J,G._lock=!1;let vn=G.points;vn.show=Ni(vn.show),vn.size=Ni(vn.size),vn.stroke=Ni(vn.stroke),vn.width=Ni(vn.width),vn.fill=Ni(vn.fill);const Qn=i.focus=Aa({},t.focus||{alpha:.3},G.focus),Yn=Qn.prox>=0,_i=Yn&&vn.one;let Xn=[],Ji=[],hi=[];function on(Q,fe){let _e=vn.show(i,fe);if(_e instanceof HTMLElement)return dl(_e,ZLe),dl(_e,Q.class),ju(_e,-10,-10,K,ce),g.insertBefore(_e,Xn[fe]),_e}function Ii(Q,fe){if(r==1||fe>0){let _e=r==1&&w[Q.scale].time,Ee=Q.value;Q.value=_e?NV(Ee)?jV(F,zV(Ee,V)):Ee||B:Ee||hUe,Q.label=Q.label||(_e?rUe:iUe)}if(_i||fe>0){Q.width=Q.width==null?1:Q.width,Q.paths=Q.paths||TUe||gPe,Q.fillTo=Ni(Q.fillTo||bUe),Q.pxAlign=+Yi(Q.pxAlign,b),Q.pxRound=JV(Q.pxAlign),Q.stroke=Ni(Q.stroke||null),Q.fill=Ni(Q.fill||null),Q._stroke=Q._fill=Q._paths=Q._focus=null;let _e=dUe(To(1,Q.width),1),Ee=Q.points=Aa({},{size:_e,width:To(1,_e*.2),stroke:Q.stroke,space:_e*2,paths:AUe,_stroke:null,_fill:null},Q.points);Ee.show=Ni(Ee.show),Ee.filter=Ni(Ee.filter),Ee.fill=Ni(Ee.fill),Ee.stroke=Ni(Ee.stroke),Ee.paths=Ni(Ee.paths),Ee.pxAlign=Q.pxAlign}if(de){let _e=Me(Q,fe);Be.splice(fe,0,_e[0]),je.splice(fe,0,_e[1]),Z.values.push(null)}if(oe){J.splice(fe,0,null);let _e=null;_i?fe==0&&(_e=on(Q,fe)):fe>0&&(_e=on(Q,fe)),Xn.splice(fe,0,_e),Ji.splice(fe,0,0),hi.splice(fe,0,0)}Ln("addSeries",fe)}function ri(Q,fe){fe=fe??x.length,Q=r==1?qI(Q,fe,VV,KV):qI(Q,fe,{},XV),x.splice(fe,0,Q),Ii(x[fe],fe)}i.addSeries=ri;function se(Q){if(x.splice(Q,1),de){Z.values.splice(Q,1),je.splice(Q,1);let fe=Be.splice(Q,1)[0];Ue(null,fe.firstChild),fe.remove()}oe&&(J.splice(Q,1),Xn.splice(Q,1)[0].remove(),Ji.splice(Q,1),hi.splice(Q,1)),Ln("delSeries",Q)}i.delSeries=se;const ge=[!1,!1,!1,!1];function Pe(Q,fe){if(Q._show=Q.show,Q.show){let _e=Q.side%2,Ee=w[Q.scale];Ee==null&&(Q.scale=_e?x[1].scale:S,Ee=w[Q.scale]);let We=Ee.time;Q.size=Ni(Q.size),Q.space=Ni(Q.space),Q.rotate=Ni(Q.rotate),fd(Q.incrs)&&Q.incrs.forEach(Ct=>{!Wd.has(Ct)&&Wd.set(Ct,Vee(Ct))}),Q.incrs=Ni(Q.incrs||(Ee.distr==2?FPe:We?m==1?zPe:VPe:Qp)),Q.splits=Ni(Q.splits||(We&&Ee.distr==1?H:Ee.distr==3?HI:Ee.distr==4?oUe:sUe)),Q.stroke=Ni(Q.stroke),Q.grid.stroke=Ni(Q.grid.stroke),Q.ticks.stroke=Ni(Q.ticks.stroke),Q.border.stroke=Ni(Q.border.stroke);let Ze=Q.values;Q.values=fd(Ze)&&!fd(Ze[0])?Ni(Ze):We?fd(Ze)?BV(F,FV(Ze,V)):NV(Ze)?qPe(F,Ze):Ze||W:Ze||aUe,Q.filter=Ni(Q.filter||(Ee.distr>=3&&Ee.log==10?uUe:Ee.distr==3&&Ee.log==2?fUe:jee)),Q.font=eG(Q.font),Q.labelFont=eG(Q.labelFont),Q._size=Q.size(i,null,fe,0),Q._space=Q._rotate=Q._incrs=Q._found=Q._splits=Q._values=null,Q._size>0&&(ge[fe]=!0,Q._el=Ql(KLe,h))}}function rt(Q,fe,_e,Ee){let[We,Ze,Ct,Ft]=_e,Gt=fe%2,Qt=0;return Gt==0&&(Ft||Ze)&&(Qt=fe==0&&!We||fe==2&&!Ct?Pa(HV.size/3):0),Gt==1&&(We||Ct)&&(Qt=fe==1&&!Ze||fe==3&&!Ft?Pa(WV.size/2):0),Qt}const dt=i.padding=(t.padding||[rt,rt,rt,rt]).map(Q=>Ni(Yi(Q,rt))),ot=i._padding=dt.map((Q,fe)=>Q(i,fe,ge,0));let At,ee=null,xe=null;const Te=r==1?x[0].idxs:null;let De=null,ve=!1;function _t(Q,fe){if(e=Q??[],i.data=i._data=e,r==2){At=0;for(let _e=1;_e<x.length;_e++)At+=e[_e][0].length}else{e.length==0&&(i.data=i._data=e=[[]]),De=e[0],At=De.length;let _e=e;if(U==2){_e=e.slice();let Ee=_e[0]=Array(At);for(let We=0;We<At;We++)Ee[We]=We}i._data=e=_e}if(Ga(!0),Ln("setData"),U==2&&(kt=!0),fe!==!1){let _e=L;_e.auto(i,ve)?ft():Na(S,_e.min,_e.max),Re=Re||G.left>=0,ht=!0,zs()}}i.setData=_t;function ft(){ve=!0;let Q,fe;r==1&&(At>0?(ee=Te[0]=0,xe=Te[1]=At-1,Q=e[0][ee],fe=e[0][xe],U==2?(Q=ee,fe=xe):Q==fe&&(U==3?[Q,fe]=NC(Q,Q,L.log,!1):U==4?[Q,fe]=s4(Q,Q,L.log,!1):L.time?fe=Q+Pa(86400/m):[Q,fe]=xT(Q,fe,o4,!0))):(ee=Te[0]=Q=null,xe=Te[1]=fe=null)),Na(S,Q,fe)}let yt,St,Nt,qt,at,nn,pn,dn,Dn,$t;function Yt(Q,fe,_e,Ee,We,Ze){Q??=bV,_e??=c4,Ee??="butt",We??=bV,Ze??="round",Q!=yt&&(f.strokeStyle=yt=Q),We!=St&&(f.fillStyle=St=We),fe!=Nt&&(f.lineWidth=Nt=fe),Ze!=at&&(f.lineJoin=at=Ze),Ee!=nn&&(f.lineCap=nn=Ee),_e!=qt&&f.setLineDash(qt=_e)}function Un(Q,fe,_e,Ee){fe!=St&&(f.fillStyle=St=fe),Q!=pn&&(f.font=pn=Q),_e!=dn&&(f.textAlign=dn=_e),Ee!=Dn&&(f.textBaseline=Dn=Ee)}function xn(Q,fe,_e,Ee,We=0){if(Ee.length>0&&Q.auto(i,ve)&&(fe==null||fe.min==null)){let Ze=Yi(ee,0),Ct=Yi(xe,Ee.length-1),Ft=_e.min==null?uPe(Ee,Ze,Ct,We,Q.distr==3):[_e.min,_e.max];Q.min=cu(Q.min,_e.min=Ft[0]),Q.max=To(Q.max,_e.max=Ft[1])}}const Zn={min:null,max:null};function Nn(){for(let Ee in w){let We=w[Ee];q[Ee]==null&&(We.min==null||q[S]!=null&&We.auto(i,ve))&&(q[Ee]=Zn)}for(let Ee in w){let We=w[Ee];q[Ee]==null&&We.from!=null&&q[We.from]!=null&&(q[Ee]=Zn)}q[S]!=null&&Ga(!0);let Q={};for(let Ee in q){let We=q[Ee];if(We!=null){let Ze=Q[Ee]=vv(w[Ee],yPe);if(We.min!=null)Aa(Ze,We);else if(Ee!=S||r==2)if(At==0&&Ze.from==null){let Ct=Ze.range(i,null,null,Ee);Ze.min=Ct[0],Ze.max=Ct[1]}else Ze.min=Er,Ze.max=-Er}}if(At>0){x.forEach((Ee,We)=>{if(r==1){let Ze=Ee.scale,Ct=q[Ze];if(Ct==null)return;let Ft=Q[Ze];if(We==0){let Gt=Ft.range(i,Ft.min,Ft.max,Ze);Ft.min=Gt[0],Ft.max=Gt[1],ee=tu(Ft.min,e[0]),xe=tu(Ft.max,e[0]),xe-ee>1&&(e[0][ee]<Ft.min&&ee++,e[0][xe]>Ft.max&&xe--),Ee.min=De[ee],Ee.max=De[xe]}else Ee.show&&Ee.auto&&xn(Ft,Ct,Ee,e[We],Ee.sorted);Ee.idxs[0]=ee,Ee.idxs[1]=xe}else if(We>0&&Ee.show&&Ee.auto){let[Ze,Ct]=Ee.facets,Ft=Ze.scale,Gt=Ct.scale,[Qt,Zt]=e[We],fn=Q[Ft],Fn=Q[Gt];fn!=null&&xn(fn,q[Ft],Ze,Qt,Ze.sorted),Fn!=null&&xn(Fn,q[Gt],Ct,Zt,Ct.sorted),Ee.min=Ct.min,Ee.max=Ct.max}});for(let Ee in Q){let We=Q[Ee],Ze=q[Ee];if(We.from==null&&(Ze==null||Ze.min==null)){let Ct=We.range(i,We.min==Er?null:We.min,We.max==-Er?null:We.max,Ee);We.min=Ct[0],We.max=Ct[1]}}}for(let Ee in Q){let We=Q[Ee];if(We.from!=null){let Ze=Q[We.from];if(Ze.min==null)We.min=We.max=null;else{let Ct=We.range(i,Ze.min,Ze.max,Ee);We.min=Ct[0],We.max=Ct[1]}}}let fe={},_e=!1;for(let Ee in Q){let We=Q[Ee],Ze=w[Ee];if(Ze.min!=We.min||Ze.max!=We.max){Ze.min=We.min,Ze.max=We.max;let Ct=Ze.distr;Ze._min=Ct==3?lh(Ze.min):Ct==4?i8(Ze.min,Ze.asinh):Ct==100?Ze.fwd(Ze.min):Ze.min,Ze._max=Ct==3?lh(Ze.max):Ct==4?i8(Ze.max,Ze.asinh):Ct==100?Ze.fwd(Ze.max):Ze.max,fe[Ee]=_e=!0}}if(_e){x.forEach((Ee,We)=>{r==2?We>0&&fe.y&&(Ee._paths=null):fe[Ee.scale]&&(Ee._paths=null)});for(let Ee in fe)kt=!0,Ln("setScale",Ee);oe&&G.left>=0&&(Re=ht=!0)}for(let Ee in q)q[Ee]=null}function An(Q){let fe=jI(ee-1,0,At-1),_e=jI(xe+1,0,At-1);for(;Q[fe]==null&&fe>0;)fe--;for(;Q[_e]==null&&_e<At-1;)_e++;return[fe,_e]}function Sn(){if(At>0){let Q=x.some(fe=>fe._focus)&&$t!=Qn.alpha;Q&&(f.globalAlpha=$t=Qn.alpha),x.forEach((fe,_e)=>{if(_e>0&&fe.show&&(an(_e,!1),an(_e,!0),fe._paths==null)){let Ee=$t;$t!=fe.alpha&&(f.globalAlpha=$t=fe.alpha);let We=r==2?[0,e[_e][0].length-1]:An(e[_e]);fe._paths=fe.paths(i,_e,We[0],We[1]),$t!=Ee&&(f.globalAlpha=$t=Ee)}}),x.forEach((fe,_e)=>{if(_e>0&&fe.show){let Ee=$t;$t!=fe.alpha&&(f.globalAlpha=$t=fe.alpha),fe._paths!=null&&di(_e,!1);{let We=fe._paths!=null?fe._paths.gaps:null,Ze=fe.points.show(i,_e,ee,xe,We),Ct=fe.points.filter(i,_e,Ze,We);(Ze||Ct)&&(fe.points._paths=fe.points.paths(i,_e,ee,xe,Ct),di(_e,!0))}$t!=Ee&&(f.globalAlpha=$t=Ee),Ln("drawSeries",_e)}}),Q&&(f.globalAlpha=$t=1)}}function an(Q,fe){let _e=fe?x[Q].points:x[Q];_e._stroke=_e.stroke(i,Q),_e._fill=_e.fill(i,Q)}function di(Q,fe){let _e=fe?x[Q].points:x[Q],{stroke:Ee,fill:We,clip:Ze,flags:Ct,_stroke:Ft=_e._stroke,_fill:Gt=_e._fill,_width:Qt=_e.width}=_e._paths;Qt=Mr(Qt*Qi,3);let Zt=null,fn=Qt%2/2;fe&&Gt==null&&(Gt=Qt>0?"#fff":Ft);let Fn=_e.pxAlign==1&&fn>0;if(Fn&&f.translate(fn,fn),!fe){let mi=Ge-Qt/2,Wn=Je-Qt/2,ci=Ye+Qt,Rn=vt+Qt;Zt=new Path2D,Zt.rect(mi,Wn,ci,Rn)}fe?wi(Ft,Qt,_e.dash,_e.cap,Gt,Ee,We,Ct,Ze):Li(Q,Ft,Qt,_e.dash,_e.cap,Gt,Ee,We,Ct,Zt,Ze),Fn&&f.translate(-fn,-fn)}function Li(Q,fe,_e,Ee,We,Ze,Ct,Ft,Gt,Qt,Zt){let fn=!1;Gt!=0&&M.forEach((Fn,mi)=>{if(Fn.series[0]==Q){let Wn=x[Fn.series[1]],ci=e[Fn.series[1]],Rn=(Wn._paths||g1).band;fd(Rn)&&(Rn=Fn.dir==1?Rn[0]:Rn[1]);let yn,fr=null;Wn.show&&Rn&&hPe(ci,ee,xe)?(fr=Fn.fill(i,mi)||Ze,yn=Wn._paths.clip):Rn=null,wi(fe,_e,Ee,We,fr,Ct,Ft,Gt,Qt,Zt,yn,Rn),fn=!0}}),fn||wi(fe,_e,Ee,We,Ze,Ct,Ft,Gt,Qt,Zt)}const Gn=yv|GI;function wi(Q,fe,_e,Ee,We,Ze,Ct,Ft,Gt,Qt,Zt,fn){Yt(Q,fe,_e,Ee,We),(Gt||Qt||fn)&&(f.save(),Gt&&f.clip(Gt),Qt&&f.clip(Qt)),fn?(Ft&Gn)==Gn?(f.clip(fn),Zt&&f.clip(Zt),Gi(We,Ct),Sa(Q,Ze,fe)):Ft&GI?(Gi(We,Ct),f.clip(fn),Sa(Q,Ze,fe)):Ft&yv&&(f.save(),f.clip(fn),Zt&&f.clip(Zt),Gi(We,Ct),f.restore(),Sa(Q,Ze,fe)):(Gi(We,Ct),Sa(Q,Ze,fe)),(Gt||Qt||fn)&&f.restore()}function Sa(Q,fe,_e){_e>0&&(fe instanceof Map?fe.forEach((Ee,We)=>{f.strokeStyle=yt=We,f.stroke(Ee)}):fe!=null&&Q&&f.stroke(fe))}function Gi(Q,fe){fe instanceof Map?fe.forEach((_e,Ee)=>{f.fillStyle=St=Ee,f.fill(_e)}):fe!=null&&Q&&f.fill(fe)}function Ko(Q,fe,_e,Ee){let We=_[Q],Ze;if(Ee<=0)Ze=[0,0];else{let Ct=We._space=We.space(i,Q,fe,_e,Ee),Ft=We._incrs=We.incrs(i,Q,fe,_e,Ee,Ct);Ze=IUe(fe,_e,Ft,Ee,Ct)}return We._found=Ze}function Bs(Q,fe,_e,Ee,We,Ze,Ct,Ft,Gt,Qt){let Zt=Ct%2/2;b==1&&f.translate(Zt,Zt),Yt(Ft,Ct,Gt,Qt,Ft),f.beginPath();let fn,Fn,mi,Wn,ci=We+(Ee==0||Ee==3?-Ze:Ze);_e==0?(Fn=We,Wn=ci):(fn=We,mi=ci);for(let Rn=0;Rn<Q.length;Rn++)fe[Rn]!=null&&(_e==0?fn=mi=Q[Rn]:Fn=Wn=Q[Rn],f.moveTo(fn,Fn),f.lineTo(mi,Wn));f.stroke(),b==1&&f.translate(-Zt,-Zt)}function ko(Q){let fe=!0;return _.forEach((_e,Ee)=>{if(!_e.show)return;let We=w[_e.scale];if(We.min==null){_e._show&&(fe=!1,_e._show=!1,Ga(!1));return}else _e._show||(fe=!1,_e._show=!0,Ga(!1));let Ze=_e.side,Ct=Ze%2,{min:Ft,max:Gt}=We,[Qt,Zt]=Ko(Ee,Ft,Gt,Ct==0?K:ce);if(Zt==0)return;let fn=We.distr==2,Fn=_e._splits=_e.splits(i,Ee,Ft,Gt,Qt,Zt,fn),mi=We.distr==2?Fn.map(yn=>De[yn]):Fn,Wn=We.distr==2?De[Fn[1]]-De[Fn[0]]:Qt,ci=_e._values=_e.values(i,_e.filter(i,mi,Ee,Zt,Wn),Ee,Zt,Wn);_e._rotate=Ze==2?_e.rotate(i,ci,Ee,Zt):0;let Rn=_e._size;_e._size=ac(_e.size(i,ci,Ee,Q)),Rn!=null&&_e._size!=Rn&&(fe=!1)}),fe}function us(Q){let fe=!0;return dt.forEach((_e,Ee)=>{let We=_e(i,Ee,ge,Q);We!=ot[Ee]&&(fe=!1),ot[Ee]=We}),fe}function _n(){for(let Q=0;Q<_.length;Q++){let fe=_[Q];if(!fe.show||!fe._show)continue;let _e=fe.side,Ee=_e%2,We,Ze,Ct=fe.stroke(i,Q),Ft=_e==0||_e==3?-1:1,[Gt,Qt]=fe._found;if(fe.label!=null){let hr=fe.labelGap*Ft,Xs=Pa((fe._lpos+hr)*Qi);Un(fe.labelFont[0],Ct,"center",_e==2?cx:gV),f.save(),Ee==1?(We=Ze=0,f.translate(Xs,Pa(Je+vt/2)),f.rotate((_e==3?-SM:SM)/2)):(We=Pa(Ge+Ye/2),Ze=Xs);let hs=Bee(fe.label)?fe.label(i,Q,Gt,Qt):fe.label;f.fillText(hs,We,Ze),f.restore()}if(Qt==0)continue;let Zt=w[fe.scale],fn=Ee==0?Ye:vt,Fn=Ee==0?Ge:Je,mi=fe._splits,Wn=Zt.distr==2?mi.map(hr=>De[hr]):mi,ci=Zt.distr==2?De[mi[1]]-De[mi[0]]:Gt,Rn=fe.ticks,yn=fe.border,fr=Rn.show?Rn.size:0,Rr=Pa(fr*Qi),ta=Pa((fe.alignTo==2?fe._size-fr-fe.gap:fe.gap)*Qi),Zi=fe._rotate*-SM/180,qr=y(fe._pos*Qi),Ws=(Rr+ta)*Ft,Ka=qr+Ws;Ze=Ee==0?Ka:0,We=Ee==1?Ka:0;let Xr=fe.font[0],uo=fe.align==1?Nb:fe.align==2?e8:Zi>0?Nb:Zi<0?e8:Ee==0?"center":_e==3?e8:Nb,Zo=Zi||Ee==1?"middle":_e==2?cx:gV;Un(Xr,Ct,uo,Zo);let fo=fe.font[1]*fe.lineGap,qs=mi.map(hr=>y(o(hr,Zt,fn,Fn))),kr=fe._values;for(let hr=0;hr<kr.length;hr++){let Xs=kr[hr];if(Xs!=null){Ee==0?We=qs[hr]:Ze=qs[hr],Xs=""+Xs;let hs=Xs.indexOf(`
`)==-1?[Xs]:Xs.split(/\n/gm);for(let ca=0;ca<hs.length;ca++){let jc=hs[ca];Zi?(f.save(),f.translate(We,Ze+ca*fo),f.rotate(Zi),f.fillText(jc,0,0),f.restore()):f.fillText(jc,We,Ze+ca*fo)}}}Rn.show&&Bs(qs,Rn.filter(i,Wn,Q,Qt,ci),Ee,_e,qr,Rr,Mr(Rn.width*Qi,3),Rn.stroke(i,Q),Rn.dash,Rn.cap);let Qo=fe.grid;Qo.show&&Bs(qs,Qo.filter(i,Wn,Q,Qt,ci),Ee,Ee==0?2:1,Ee==0?Je:Ge,Ee==0?vt:Ye,Mr(Qo.width*Qi,3),Qo.stroke(i,Q),Qo.dash,Qo.cap),yn.show&&Bs([qr],[1],Ee==0?1:0,Ee==0?1:2,Ee==1?Je:Ge,Ee==1?vt:Ye,Mr(yn.width*Qi,3),yn.stroke(i,Q),yn.dash,yn.cap)}Ln("drawAxes")}function Ga(Q){x.forEach((fe,_e)=>{_e>0&&(fe._paths=null,Q&&(r==1?(fe.min=null,fe.max=null):fe.facets.forEach(Ee=>{Ee.min=null,Ee.max=null})))})}let fs=!1,Wa=!1,$i=[];function so(){Wa=!1;for(let Q=0;Q<$i.length;Q++)Ln(...$i[Q]);$i.length=0}function zs(){fs||(TPe(E),fs=!0)}function js(Q,fe=!1){fs=!0,Wa=fe,Q(i),E(),fe&&$i.length>0&&queueMicrotask(so)}i.batch=js;function E(){if(Mt&&(Nn(),Mt=!1),kt&&(bt(),kt=!1),gt){if(zr(d,Nb,he),zr(d,cx,me),zr(d,Dx,K),zr(d,Ox,ce),zr(g,Nb,he),zr(g,cx,me),zr(g,Dx,K),zr(g,Ox,ce),zr(h,Dx,Qe),zr(h,Ox,ae),u.width=Pa(Qe*Qi),u.height=Pa(ae*Qi),_.forEach(({_el:Q,_show:fe,_size:_e,_pos:Ee,side:We})=>{if(Q!=null)if(fe){let Ze=We===3||We===0?_e:0,Ct=We%2==1;zr(Q,Ct?"left":"top",Ee-Ze),zr(Q,Ct?"width":"height",_e),zr(Q,Ct?"top":"left",Ct?me:he),zr(Q,Ct?"height":"width",Ct?ce:K),BI(Q,rm)}else dl(Q,rm)}),yt=St=Nt=at=nn=pn=dn=Dn=qt=null,$t=1,Xa(!0),he!=$||me!=Ve||K!=Xe||ce!=mt){Ga(!1);let Q=K/Xe,fe=ce/mt;if(oe&&!Re&&G.left>=0){G.left*=Q,G.top*=fe,ye&&ju(ye,Pa(G.left),0,K,ce),$e&&ju($e,0,Pa(G.top),K,ce);for(let _e=0;_e<Xn.length;_e++){let Ee=Xn[_e];Ee!=null&&(Ji[_e]*=Q,hi[_e]*=fe,ju(Ee,ac(Ji[_e]),ac(hi[_e]),K,ce))}}if(pi.show&&!Le&&pi.left>=0&&pi.width>0){pi.left*=Q,pi.width*=Q,pi.top*=fe,pi.height*=fe;for(let _e in kh)zr(Ia,_e,pi[_e])}$=he,Ve=me,Xe=K,mt=ce}Ln("setSize"),gt=!1}Qe>0&&ae>0&&(f.clearRect(0,0,u.width,u.height),Ln("drawClear"),C.forEach(Q=>Q()),Ln("draw")),pi.show&&Le&&(Pl(pi),Le=!1),oe&&Re&&(Jo(null,!0,!1),Re=!1),Z.show&&Z.live&&ht&&(_f(),ht=!1),l||(l=!0,i.status=1,Ln("ready")),ve=!1,fs=!1}i.redraw=(Q,fe)=>{kt=fe||!1,Q!==!1?Na(S,L.min,L.max):zs()};function N(Q,fe){let _e=w[Q];if(_e.from==null){if(At==0){let Ee=_e.range(i,fe.min,fe.max,Q);fe.min=Ee[0],fe.max=Ee[1]}if(fe.min>fe.max){let Ee=fe.min;fe.min=fe.max,fe.max=Ee}if(At>1&&fe.min!=null&&fe.max!=null&&fe.max-fe.min<1e-16)return;Q==S&&_e.distr==2&&At>0&&(fe.min=tu(fe.min,e[0]),fe.max=tu(fe.max,e[0]),fe.min==fe.max&&fe.max++),q[Q]=fe,Mt=!0,zs()}}i.setScale=N;let Y,re,ye,$e,tt,Lt,zt,gn,En,Ei,Cn,ai,Ar=!1;const Mi=G.drag;let Hi=Mi.x,Ui=Mi.y;oe&&(G.x&&(Y=Ql(JLe,g)),G.y&&(re=Ql($Le,g)),L.ori==0?(ye=Y,$e=re):(ye=re,$e=Y),Cn=G.left,ai=G.top);const pi=i.select=Aa({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),Ia=pi.show?Ql(YLe,pi.over?g:d):null;function Pl(Q,fe){if(pi.show){for(let _e in Q)pi[_e]=Q[_e],_e in kh&&zr(Ia,_e,Q[_e]);fe!==!1&&Ln("setSelect")}}i.setSelect=Pl;function Yo(Q){if(x[Q].show)de&&BI(Be[Q],rm);else if(de&&dl(Be[Q],rm),oe){let _e=_i?Xn[0]:Xn[Q];_e!=null&&ju(_e,-10,-10,K,ce)}}function Na(Q,fe,_e){N(Q,{min:fe,max:_e})}function sr(Q,fe,_e,Ee){fe.focus!=null&&Vs(Q),fe.show!=null&&x.forEach((We,Ze)=>{Ze>0&&(Q==Ze||Q==null)&&(We.show=fe.show,Yo(Ze),r==2?(Na(We.facets[0].scale,null,null),Na(We.facets[1].scale,null,null)):Na(We.scale,null,null),zs())}),_e!==!1&&Ln("setSeries",Q,fe),Ee&&$o("setSeries",i,Q,fe)}i.setSeries=sr;function rp(Q,fe){Aa(M[Q],fe)}function Cr(Q,fe){Q.fill=Ni(Q.fill||null),Q.dir=Yi(Q.dir,-1),fe=fe??M.length,M.splice(fe,0,Q)}function Ul(Q){Q==null?M.length=0:M.splice(Q,1)}i.addBand=Cr,i.setBand=rp,i.delBand=Ul;function Fc(Q,fe){x[Q].alpha=fe,oe&&Xn[Q]!=null&&(Xn[Q].style.opacity=fe),de&&Be[Q]&&(Be[Q].style.opacity=fe)}let Hs,br,Wr;const ur={focus:!0};function Vs(Q){if(Q!=Wr){let fe=Q==null,_e=Qn.alpha!=1;x.forEach((Ee,We)=>{if(r==1||We>0){let Ze=fe||We==0||We==Q;Ee._focus=fe?null:Ze,_e&&Fc(We,Ze?1:Qn.alpha)}}),Wr=Q,_e&&zs()}}de&&Yn&&Ne(xV,ue,Q=>{G._lock||(Vn(Q),Wr!=null&&sr(null,ur,!0,si.setSeries))});function qa(Q,fe,_e){let Ee=w[fe];_e&&(Q=Q/Qi-(Ee.ori==1?me:he));let We=K;Ee.ori==1&&(We=ce,Q=We-Q),Ee.dir==-1&&(Q=We-Q);let Ze=Ee._min,Ct=Ee._max,Ft=Q/We,Gt=Ze+(Ct-Ze)*Ft,Qt=Ee.distr;return Qt==3?gv(10,Gt):Qt==4?pPe(Gt,Ee.asinh):Qt==100?Ee.bwd(Gt):Gt}function vg(Q,fe){let _e=qa(Q,S,fe);return tu(_e,e[0],ee,xe)}i.valToIdx=Q=>tu(Q,e[0]),i.posToIdx=vg,i.posToVal=qa,i.valToPos=(Q,fe,_e)=>w[fe].ori==0?a(Q,w[fe],_e?Ye:K,_e?Ge:0):s(Q,w[fe],_e?vt:ce,_e?Je:0),i.setCursor=(Q,fe,_e)=>{Cn=Q.left,ai=Q.top,Jo(null,fe,_e)};function ap(Q,fe){zr(Ia,Nb,pi.left=Q),zr(Ia,Dx,pi.width=fe)}function Rh(Q,fe){zr(Ia,cx,pi.top=Q),zr(Ia,Ox,pi.height=fe)}let Bc=L.ori==0?ap:Rh,Cu=L.ori==1?ap:Rh;function sp(){if(de&&Z.live)for(let Q=r==2?1:0;Q<x.length;Q++){if(Q==0&&pe)continue;let fe=Z.values[Q],_e=0;for(let Ee in fe)je[Q][_e++].firstChild.nodeValue=fe[Ee]}}function _f(Q,fe){if(Q!=null&&(Q.idxs?Q.idxs.forEach((_e,Ee)=>{J[Ee]=_e}):vPe(Q.idx)||J.fill(Q.idx),Z.idx=J[0]),de&&Z.live){for(let _e=0;_e<x.length;_e++)(_e>0||r==1&&!pe)&&oo(_e,J[_e]);sp()}ht=!1,fe!==!1&&Ln("setLegend")}i.setLegend=_f;function oo(Q,fe){let _e=x[Q],Ee=Q==0&&U==2?De:e[Q],We;pe?We=_e.values(i,Q,fe)??ze:(We=_e.value(i,fe==null?null:Ee[fe],Q,fe),We=We==null?ze:{_:We}),Z.values[Q]=We}function Jo(Q,fe,_e){En=Cn,Ei=ai,[Cn,ai]=G.move(i,Cn,ai),G.left=Cn,G.top=ai,oe&&(ye&&ju(ye,Pa(Cn),0,K,ce),$e&&ju($e,0,Pa(ai),K,ce));let Ee,We=ee>xe;Hs=Er,br=null;let Ze=L.ori==0?K:ce,Ct=L.ori==1?K:ce;if(Cn<0||At==0||We){Ee=G.idx=null;for(let Ft=0;Ft<x.length;Ft++){let Gt=Xn[Ft];Gt!=null&&ju(Gt,-10,-10,K,ce)}Yn&&sr(null,ur,!0,Q==null&&si.setSeries),Z.live&&(J.fill(Ee),ht=!0)}else{let Ft,Gt,Qt;r==1&&(Ft=L.ori==0?Cn:ai,Gt=qa(Ft,S),Ee=G.idx=tu(Gt,e[0],ee,xe),Qt=j(e[0][Ee],L,Ze,0));let Zt=-10,fn=-10,Fn=0,mi=0,Wn=!0,ci="",Rn="";for(let yn=r==2?1:0;yn<x.length;yn++){let fr=x[yn],Rr=J[yn],ta=Rr==null?null:r==1?e[yn][Rr]:e[yn][1][Rr],Zi=G.dataIdx(i,yn,Ee,Gt),qr=Zi==null?null:r==1?e[yn][Zi]:e[yn][1][Zi];if(ht=ht||qr!=ta||Zi!=Rr,J[yn]=Zi,yn>0&&fr.show){let Ws=Zi==null?-10:Zi==Ee?Qt:j(r==1?e[0][Zi]:e[yn][0][Zi],L,Ze,0),Ka=qr==null?-10:z(qr,r==1?w[fr.scale]:w[fr.facets[1].scale],Ct,0);if(Yn&&qr!=null){let Xr=L.ori==1?Cn:ai,uo=Ua(Qn.dist(i,yn,Zi,Ka,Xr));if(uo<Hs){let Zo=Qn.bias;if(Zo!=0){let fo=qa(Xr,fr.scale),qs=qr>=0?1:-1,kr=fo>=0?1:-1;kr==qs&&(kr==1?Zo==1?qr>=fo:qr<=fo:Zo==1?qr<=fo:qr>=fo)&&(Hs=uo,br=yn)}else Hs=uo,br=yn}}if(ht||_i){let Xr,uo;L.ori==0?(Xr=Ws,uo=Ka):(Xr=Ka,uo=Ws);let Zo,fo,qs,kr,Qo,hr,Xs=!0,hs=vn.bbox;if(hs!=null){Xs=!1;let ca=hs(i,yn);qs=ca.left,kr=ca.top,Zo=ca.width,fo=ca.height}else qs=Xr,kr=uo,Zo=fo=vn.size(i,yn);if(hr=vn.fill(i,yn),Qo=vn.stroke(i,yn),_i)yn==br&&Hs<=Qn.prox&&(Zt=qs,fn=kr,Fn=Zo,mi=fo,Wn=Xs,ci=hr,Rn=Qo);else{let ca=Xn[yn];ca!=null&&(Ji[yn]=qs,hi[yn]=kr,AV(ca,Zo,fo,Xs),MV(ca,hr,Qo),ju(ca,ac(qs),ac(kr),K,ce))}}}}if(_i){let yn=Qn.prox,fr=Wr==null?Hs<=yn:Hs>yn||br!=Wr;if(ht||fr){let Rr=Xn[0];Rr!=null&&(Ji[0]=Zt,hi[0]=fn,AV(Rr,Fn,mi,Wn),MV(Rr,ci,Rn),ju(Rr,ac(Zt),ac(fn),K,ce))}}}if(pi.show&&Ar)if(Q!=null){let[Ft,Gt]=si.scales,[Qt,Zt]=si.match,[fn,Fn]=Q.cursor.sync.scales,mi=Q.cursor.drag;if(Hi=mi._x,Ui=mi._y,Hi||Ui){let{left:Wn,top:ci,width:Rn,height:yn}=Q.select,fr=Q.scales[fn].ori,Rr=Q.posToVal,ta,Zi,qr,Ws,Ka,Xr=Ft!=null&&Qt(Ft,fn),uo=Gt!=null&&Zt(Gt,Fn);Xr&&Hi?(fr==0?(ta=Wn,Zi=Rn):(ta=ci,Zi=yn),qr=w[Ft],Ws=j(Rr(ta,fn),qr,Ze,0),Ka=j(Rr(ta+Zi,fn),qr,Ze,0),Bc(cu(Ws,Ka),Ua(Ka-Ws))):Bc(0,Ze),uo&&Ui?(fr==1?(ta=Wn,Zi=Rn):(ta=ci,Zi=yn),qr=w[Gt],Ws=z(Rr(ta,Fn),qr,Ct,0),Ka=z(Rr(ta+Zi,Fn),qr,Ct,0),Cu(cu(Ws,Ka),Ua(Ka-Ws))):Cu(0,Ct)}else ne()}else{let Ft=Ua(En-tt),Gt=Ua(Ei-Lt);if(L.ori==1){let Fn=Ft;Ft=Gt,Gt=Fn}Hi=Mi.x&&Ft>=Mi.dist,Ui=Mi.y&&Gt>=Mi.dist;let Qt=Mi.uni;Qt!=null?Hi&&Ui&&(Hi=Ft>=Qt,Ui=Gt>=Qt,!Hi&&!Ui&&(Gt>Ft?Ui=!0:Hi=!0)):Mi.x&&Mi.y&&(Hi||Ui)&&(Hi=Ui=!0);let Zt,fn;Hi&&(L.ori==0?(Zt=zt,fn=Cn):(Zt=gn,fn=ai),Bc(cu(Zt,fn),Ua(fn-Zt)),Ui||Cu(0,Ct)),Ui&&(L.ori==1?(Zt=zt,fn=Cn):(Zt=gn,fn=ai),Cu(cu(Zt,fn),Ua(fn-Zt)),Hi||Bc(0,Ze)),!Hi&&!Ui&&(Bc(0,0),Cu(0,0))}if(Mi._x=Hi,Mi._y=Ui,Q==null){if(_e){if(zc!=null){let[Ft,Gt]=si.scales;si.values[0]=Ft!=null?qa(L.ori==0?Cn:ai,Ft):null,si.values[1]=Gt!=null?qa(L.ori==1?Cn:ai,Gt):null}$o(t8,i,Cn,ai,K,ce,Ee)}if(Yn){let Ft=_e&&si.setSeries,Gt=Qn.prox;Wr==null?Hs<=Gt&&sr(br,ur,!0,Ft):Hs>Gt?sr(null,ur,!0,Ft):br!=Wr&&sr(br,ur,!0,Ft)}}ht&&(Z.idx=Ee,_f()),fe!==!1&&Ln("setCursor")}let Gs=null;Object.defineProperty(i,"rect",{get(){return Gs==null&&Xa(!1),Gs}});function Xa(Q=!1){Q?Gs=null:(Gs=g.getBoundingClientRect(),Ln("syncRect",Gs))}function lo(Q,fe,_e,Ee,We,Ze,Ct){G._lock||Ar&&Q!=null&&Q.movementX==0&&Q.movementY==0||(Fl(Q,fe,_e,Ee,We,Ze,Ct,!1,Q!=null),Q!=null?Jo(null,!0,!0):Jo(fe,!0,!1))}function Fl(Q,fe,_e,Ee,We,Ze,Ct,Ft,Gt){if(Gs==null&&Xa(!1),Vn(Q),Q!=null)_e=Q.clientX-Gs.left,Ee=Q.clientY-Gs.top;else{if(_e<0||Ee<0){Cn=-10,ai=-10;return}let[Qt,Zt]=si.scales,fn=fe.cursor.sync,[Fn,mi]=fn.values,[Wn,ci]=fn.scales,[Rn,yn]=si.match,fr=fe.axes[0].side%2==1,Rr=L.ori==0?K:ce,ta=L.ori==1?K:ce,Zi=fr?Ze:We,qr=fr?We:Ze,Ws=fr?Ee:_e,Ka=fr?_e:Ee;if(Wn!=null?_e=Rn(Qt,Wn)?o(Fn,w[Qt],Rr,0):-10:_e=Rr*(Ws/Zi),ci!=null?Ee=yn(Zt,ci)?o(mi,w[Zt],ta,0):-10:Ee=ta*(Ka/qr),L.ori==1){let Xr=_e;_e=Ee,Ee=Xr}}Gt&&(fe==null||fe.cursor.event.type==t8)&&((_e<=1||_e>=K-1)&&(_e=Zp(_e,K)),(Ee<=1||Ee>=ce-1)&&(Ee=Zp(Ee,ce))),Ft?(tt=_e,Lt=Ee,[zt,gn]=G.move(i,_e,Ee)):(Cn=_e,ai=Ee)}const kh={width:0,height:0,left:0,top:0};function ne(){Pl(kh,!1)}let ie,ke,Ke,xt;function Ot(Q,fe,_e,Ee,We,Ze,Ct){Ar=!0,Hi=Ui=Mi._x=Mi._y=!1,Fl(Q,fe,_e,Ee,We,Ze,Ct,!0,!1),Q!=null&&(Ne(n8,UI,Vt,!1),$o(vV,i,zt,gn,K,ce,null));let{left:Ft,top:Gt,width:Qt,height:Zt}=pi;ie=Ft,ke=Gt,Ke=Qt,xt=Zt}function Vt(Q,fe,_e,Ee,We,Ze,Ct){Ar=Mi._x=Mi._y=!1,Fl(Q,fe,_e,Ee,We,Ze,Ct,!1,!0);let{left:Ft,top:Gt,width:Qt,height:Zt}=pi,fn=Qt>0||Zt>0,Fn=ie!=Ft||ke!=Gt||Ke!=Qt||xt!=Zt;if(fn&&Fn&&Pl(pi),Mi.setScale&&fn&&Fn){let mi=Ft,Wn=Qt,ci=Gt,Rn=Zt;if(L.ori==1&&(mi=Gt,Wn=Zt,ci=Ft,Rn=Qt),Hi&&Na(S,qa(mi,S),qa(mi+Wn,S)),Ui)for(let yn in w){let fr=w[yn];yn!=S&&fr.from==null&&fr.min!=Er&&Na(yn,qa(ci+Rn,yn),qa(ci,yn))}ne()}else G.lock&&(G._lock=!G._lock,Jo(fe,!0,Q!=null));Q!=null&&(Ue(n8,UI),$o(n8,i,Cn,ai,K,ce,null))}function Tt(Q,fe,_e,Ee,We,Ze,Ct){if(G._lock)return;Vn(Q);let Ft=Ar;if(Ar){let Gt=!0,Qt=!0,Zt=10,fn,Fn;L.ori==0?(fn=Hi,Fn=Ui):(fn=Ui,Fn=Hi),fn&&Fn&&(Gt=Cn<=Zt||Cn>=K-Zt,Qt=ai<=Zt||ai>=ce-Zt),fn&&Gt&&(Cn=Cn<zt?0:K),Fn&&Qt&&(ai=ai<gn?0:ce),Jo(null,!0,!0),Ar=!1}Cn=-10,ai=-10,J.fill(null),Jo(null,!0,!0),Ft&&(Ar=Ft)}function Bt(Q,fe,_e,Ee,We,Ze,Ct){G._lock||(Vn(Q),ft(),ne(),Q!=null&&$o(_V,i,Cn,ai,K,ce,null))}function rn(){_.forEach(NUe),jt(i.width,i.height,!0)}Pm(yT,C0,rn);const ln={};ln.mousedown=Ot,ln.mousemove=lo,ln.mouseup=Vt,ln.dblclick=Bt,ln.setSeries=(Q,fe,_e,Ee)=>{let We=si.match[2];_e=We(i,fe,_e),_e!=-1&&sr(_e,Ee,!0,!1)},oe&&(Ne(vV,g,Ot),Ne(t8,g,lo),Ne(yV,g,Q=>{Vn(Q),Xa(!1)}),Ne(xV,g,Tt),Ne(_V,g,Bt),WI.add(i),i.syncRect=Xa);const Jn=i.hooks=t.hooks||{};function Ln(Q,fe,_e){Wa?$i.push([Q,fe,_e]):Q in Jn&&Jn[Q].forEach(Ee=>{Ee.call(null,i,fe,_e)})}(t.plugins||[]).forEach(Q=>{for(let fe in Q.hooks)Jn[fe]=(Jn[fe]||[]).concat(Q.hooks[fe])});const ea=(Q,fe,_e)=>_e,si=Aa({key:null,setSeries:!1,filters:{pub:OV,sub:OV},scales:[S,x[1]?x[1].scale:null],match:[IV,IV,ea],values:[null,null]},G.sync);si.match.length==2&&si.match.push(ea),G.sync=si;const zc=si.key,Fr=cte(zc);function $o(Q,fe,_e,Ee,We,Ze,Ct){si.filters.pub(Q,fe,_e,Ee,We,Ze,Ct)&&Fr.pub(Q,fe,_e,Ee,We,Ze,Ct)}Fr.sub(i);function Sf(Q,fe,_e,Ee,We,Ze,Ct){si.filters.sub(Q,fe,_e,Ee,We,Ze,Ct)&&ln[Q](null,fe,_e,Ee,We,Ze,Ct)}i.pub=Sf;function co(){Fr.unsub(i),WI.delete(i),Ae.clear(),zI(yT,C0,rn),c.remove(),ue?.remove(),Ln("destroy")}i.destroy=co;function Dh(){Ln("init",t,e),_t(e||t.data,!1),q[S]?N(S,q[S]):ft(),Le=pi.show&&(pi.width>0||pi.height>0),Re=ht=!0,jt(t.width,t.height)}return x.forEach(Ii),_.forEach(Pe),n?n instanceof HTMLElement?(n.appendChild(c),Dh()):n(i,Dh):Dh(),i}ao.assign=Aa;ao.fmtNum=l4;ao.rangeNum=xT;ao.rangeLog=NC;ao.rangeAsinh=s4;ao.orient=gg;ao.pxRatio=Qi;ao.join=MPe;ao.fmtDate=u4,ao.tzDate=PPe;ao.sync=cte;{ao.addGap=vUe,ao.clipGaps=UC;let t=ao.paths={points:mte};t.linear=bte,t.stepped=_Ue,t.bars=SUe,t.spline=EUe}const LUe=Object.freeze(Object.defineProperty({__proto__:null,default:ao},Symbol.toStringTag,{value:"Module"})),PUe=bre(LUe);(function(t,e){(function(i,r){t.exports=r(I,PUe)})(Fm,(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 m in g)Object.prototype.hasOwnProperty.call(g,m)&&b.indexOf(m)<0&&(y[m]=g[m]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var x=0,m=Object.getOwnPropertySymbols(g);x<m.length;x++)b.indexOf(m[x])<0&&Object.prototype.propertyIsEnumerable.call(g,m[x])&&(y[m[x]]=g[m[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 m=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||m!==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(m,x){var _=y[x];return m.length!==_.length?!1:m.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,m=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)(m),L=(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(F){var V;F&&((V=j.current)===null||V===void 0||V.call(j,F),F.destroy(),A.current=null)},[]),q=(0,l.useCallback)(function(){var F,V=new(f())(D.current,L.current,R.current||C.current);A.current=V,(F=U.current)===null||F===void 0||F.call(U,V)},[]);return(0,l.useEffect)(function(){return q(),function(){z(A.current)}},[q,z]),(0,l.useEffect)(function(){if(D.current!==b){var F=(0,h.optionsUpdateState)(D.current,b);D.current=b,!A.current||F==="create"?(z(A.current),q()):F==="update"&&A.current.setSize({width:b.width,height:b.height})}},[b,q,z]),(0,l.useEffect)(function(){L.current!==y&&(A.current?(0,h.dataMatch)(L.current,y)||(M?A.current.setData(y,!0):(A.current.setData(y,!1),A.current.redraw())):(L.current=y,q()),L.current=y)},[y,M,q]),(0,l.useEffect)(function(){return R.current!==m&&(R.current=m,q()),function(){return z(A.current)}},[m,q,z]),m?null:c().createElement("div",{ref:C,className:S})}})(),o=o.default,o})())})(Nee);var UUe=Nee.exports;const FUe=Rc(UUe);function tG({props:t,onExpand:e}){const[n,i]=I.useState(!1),{ref:r,width:a}=aX(),s=_a(),{colorScheme:o}=og(),[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,m=-1/0;for(const x of b[0])x<y&&(y=x),x>m&&(m=x);return[b,y,m]},[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 m=t.axes;return m==null?m=[{stroke:b,grid:{stroke:y,show:!0}},{stroke:b,grid:{stroke:y,show:!0}}]:m=m.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:m,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 m=u-c;if(m!==0)return h.setScale(b,{min:c+g.current.relMin*m,max:c+g.current.relMax*m}),()=>{g.current={relMin:((y.min??0)-c)/m,relMax:((y.max??1)-c)/m}}},[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(FUe,{resetScales:!1,onCreate:b=>{d(b)},onDelete:()=>{d(void 0)},options:f,data:l},o),e&&n&&k.jsx(Pr,{label:"Expand plot",children:k.jsx(Ol,{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(lQ,{size:14})})})]})}function BUe(t){const[e,{open:n,close:i}]=Ec(!1);return t.props.visible===!1?null:k.jsxs(ct,{children:[k.jsx(tG,{...t,onExpand:n}),k.jsx(Ro,{opened:e,onClose:i,size:"xl",children:k.jsx(tG,{...t})})]})}function zUe({props:{_tab_labels:t,_tab_icons_html:e,_tab_container_ids:n,visible:i}}){const{GuiContainer:r}=I.useContext(Ls);return i?k.jsxs($f,{radius:"xs",defaultValue:"0",style:{marginTop:"-0.55em"},children:[k.jsx($f.List,{children:t.map((a,s)=>k.jsx($f.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($f.Panel,{value:s.toString(),children:k.jsx(r,{containerUuid:a})},a))]}):null}function jUe({uuid:t,props:{label:e,visible:n,expand_by_default:i},nextGuiUuid:r}){const a=I.useContext(xi),[s,{toggle:o}]=Ec(i),l=a.useGui(d=>d.guiUuidSetFromContainerUuid[t],rQ),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?aAe:QTe;return n?k.jsxs(Ns,{withBorder:!0,className:n4,mb:f==="GuiFolderMessage"?"md":void 0,children:[k.jsxs(Ns,{className:ULe,style:{cursor:u?void 0:"pointer"},onClick:o,children:[e,k.jsx(h,{className:FLe,style:{display:u?"none":void 0}})]}),k.jsx(mh,{in:s&&!u,children:k.jsx(ct,{pt:"0.2em",children:k.jsx(Ls.Provider,{value:{...c,folderDepth:c.folderDepth+1},children:k.jsx(c.GuiContainer,{containerUuid:t})})})}),k.jsx(mh,{in:!(s&&!u),children:k.jsx(ct,{p:"xs"})})]}):null}function HUe(t,e,n){return Math.max(e,Math.min(n,t))}function VUe({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),m=_a(),{colorScheme:x}=og(),_=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,L=0;return i.forEach((U,j)=>{const z=Math.abs(U-D);z<R&&(R=z,L=j)}),L},S=I.useCallback((D,R)=>{const L=[...i];L[R]=HUe(D,t,e);const U=o||n;R<L.length-1&&L[R]>L[R+1]-U&&(L[R]=L[R+1]-U),R>0&&L[R]<L[R-1]+U&&(L[R]=L[R-1]+U),!(s&&(R===0||R===L.length-1))&&r(L)},[i,r,t,e,n,o,s]),A=D=>{if(f||i.length===0)return;const R=w(D.clientX),L=M(R);if(L===-1)return;b(L);const U=z=>{const q=w(z.clientX);S(q,L)},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 L=j=>{const z=w(j.clientX);S(z,R)},U=()=>{b(null),document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",U)};document.addEventListener("mousemove",L),document.addEventListener("mouseup",U)};return k.jsx(ct,{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(Pr,{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:m.colors[m.primaryColor][x==="dark"?5:6]},onMouseDown:L=>C(L,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 GUe({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}=Ce.useContext(Ls);if(!r)return null;const g=y=>d(t,y),b=k.jsx(ct,{px:"0.1em",children:k.jsx(VUe,{id:t,className:u===null?aQ: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(Au,{uuid:t,hint:i,label:n,children:b})}function WUe({uuid:t,props:{disabled:e,mime_type:n,color:i,_icon_html:r,label:a}}){const s=I.useContext(xi),o=Ce.useRef(null),{isUploading:l,upload:c}=qUe({viewer:s,componentUuid:t});return k.jsxs(ct,{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 qUe({viewer:t,componentUuid:e}){const n=t.useGui(l=>l.updateUploadState),i=t.useGui(l=>l.uploadsInProgress[e]),r=i?.totalBytes,a=Ce.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]);Ce.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(uf,{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(uf,{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=iQ(),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 XUe({value:t,props:{visible:e,color:n,animated:i}}){return e?k.jsx(ct,{pb:"xs",px:"xs",children:k.jsx(uf,{radius:"xs",color:MC(n),value:t,animated:i,transitionDuration:0})}):null}function KUe({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(ct,{px:"xs",children:[t.label===null?null:k.jsx(bu,{fz:"sm",style:{display:"block"},children:t.label}),k.jsx("img",{src:e,style:{maxWidth:"100%",height:"auto"}})]})}function YUe({props:t}){return t.visible?k.jsx("div",{dangerouslySetInnerHTML:{__html:t.content}}):null}function b4({containerUuid:t}){const n=Ce.useContext(xi).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:nG,messageSender:i,setValue:r},children:k.jsx(nG,{containerUuid:t})})}function nG({containerUuid:t}){const e=Ce.useContext(xi);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],rQ),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(ct,{pt:"xs",children:a.map((o,l)=>k.jsx(JUe,{guiUuid:o.uuid,nextGuiUuid:a[l+1]?.uuid??null},o.uuid))})}function JUe(t){const n=Ce.useContext(xi).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(jUe,{...n,nextGuiUuid:t.nextGuiUuid});case"GuiTabGroupMessage":return k.jsx(zUe,{...n});case"GuiMarkdownMessage":return k.jsx(PLe,{...n});case"GuiHtmlMessage":return k.jsx(YUe,{...n});case"GuiPlotlyMessage":return k.jsx(BLe,{...n});case"GuiUplotMessage":return k.jsx(BUe,{...n});case"GuiImageMessage":return k.jsx(KUe,{...n});case"GuiButtonMessage":return k.jsx(DTe,{...n});case"GuiUploadButtonMessage":return k.jsx(WUe,{...n});case"GuiSliderMessage":return k.jsx(ITe,{...n});case"GuiMultiSliderMessage":return k.jsx(GUe,{...n});case"GuiNumberMessage":return k.jsx(NTe,{...n});case"GuiTextMessage":return k.jsx(LTe,{...n});case"GuiCheckboxMessage":return k.jsx(PTe,{...n});case"GuiVector2Message":return k.jsx(UTe,{...n});case"GuiVector3Message":return k.jsx(FTe,{...n});case"GuiDropdownMessage":return k.jsx(BTe,{...n});case"GuiRgbMessage":return k.jsx(qAe,{...n});case"GuiRgbaMessage":return k.jsx(XAe,{...n});case"GuiButtonGroupMessage":return k.jsx(KAe,{...n});case"GuiProgressBarMessage":return k.jsx(XUe,{...n});default:$Ue(n)}}function $Ue(t){throw new Error("Unexpected object: "+t.type)}const ZUe=I.forwardRef(function({points:e,color:n=16777215,vertexColors:i,linewidth:r,lineWidth:a,segments:s,dashed:o,...l},c){const u=ki(b=>b.size),f=I.useMemo(()=>s?new TU:new AZ,[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(m=>m/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})]})}),QUe=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(ZUe,{points:r,lineWidth:e.line_width,color:s,vertexColors:o,segments:!0}),n]})}),iG={"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 Dt;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 rG={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
	`+hn.lights_pars_begin},aG=new Dt,l8=new jC({webGL:!0}),zf=new te,fx=new rr,c8=[],u8=[],f8=new Dt,sG=new Dt,e4e=new te(0,1,0);class t4e{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(yc.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,e4e),sG.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;aG.multiplyMatrices(sG,e.matrixWorld),n[i].toSpace(aG,l8);const l=l8.vertices.near,c=l8.vertices.far;fx.makeEmpty();for(let u=0;u<4;u++)fx.expandByPoint(l[u]),fx.expandByPoint(c[u]);fx.getCenter(zf),zf.z=fx.max.z+this.lightMargin,zf.x=Math.floor(zf.x/s)*s,zf.y=Math.floor(zf.y/o)*o,zf.applyMatrix4(f8),r.position.copy(zf),r.target.position.copy(zf),r.target.position.x+=this.lightDirection.x,r.target.position.y+=this.lightDirection.y,r.target.position.z+=this.lightDirection.z}}_injectInclude(){hn.lights_fragment_begin=rG.lights_fragment_begin,hn.lights_pars_begin=rG.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 n4e extends yl{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 On;r.setIndex(new In(n,1)),r.setAttribute("position",new In(i,3,!1));const a=new Lc(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:Jr}),y=new Si(new Il,b),m=new yl,x=new tI(new rr,16711680);m.add(x),this.add(g),this.add(y),this.add(m),c.push(g),u.push(y),f.push(m)}for(let g=0;g<i;g++){const b=a[g],m=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(m.position),M.quaternion.copy(m.quaternion),M.scale.copy(m.scale),M.updateMatrixWorld(!0),this.attach(M),S.box.min.set(m.bottom,m.left,-m.far),S.box.max.set(m.top,m.right,-m.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 oG="",lG="",DE=0;class i4e{instance;args;constructor(e){this.args=e,DE===0&&(oG=hn.lights_fragment_begin,lG=hn.lights_pars_begin)}attach(){this.instance||(this.instance=new t4e(this.args),DE++)}dispose(){this.instance&&(this.instance.remove(),this.instance.dispose(),this.instance=void 0,DE--,DE===0&&(hn.lights_fragment_begin=oG,hn.lights_pars_begin=lG))}}function cG(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(r4e,{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 r4e({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=ki(C=>C.camera),{scene:g}=ki(),b=I.useMemo(()=>{let C=g;for(;C;){if(C instanceof Wv)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]),m=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 i4e({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]),oa(()=>{!S.instance||!m.current||(m.current.getWorldPosition(_),M.subVectors(w,_).normalize(),S.instance.lightDirection.copy(M),S.instance.update(),x.current&&x.current.update())}),I.useEffect(()=>(cG(b),()=>{requestAnimationFrame(()=>{cG(b)})}),[b]),I.useEffect(()=>{if(S.attach(),S.instance&&S.instance.lights.forEach(C=>{C.color=A}),h&&S.instance){const C=new n4e(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:m})})}const a4e=Ce.forwardRef(function({children:e,...n},i){const r=Ce.useMemo(()=>Q_(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),a=Ce.useMemo(()=>{const l=new On;return l.setAttribute("position",new In(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),l.setIndex(new In(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]);Ce.useEffect(()=>()=>{a&&a.dispose()},[a]),Ce.useEffect(()=>()=>{r&&r.dispose()},[r]);const s=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,o=Ce.useMemo(()=>s===0?null:new hg({opacity:s,color:0,depthWrite:!1}),[s]);return k.jsxs("mesh",{ref:i,geometry:a,material:r,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,children:[k.jsx(Qf,{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 s4e=Ce.forwardRef(function({children:e,...n},i){const r=Ce.useMemo(()=>Q_(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 $d(1,1,1)),Ce.useEffect(()=>()=>{r&&r.dispose()},[r]);const a=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,s=Ce.useMemo(()=>a===0?null:new hg({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(Qf,{enableCreaseAngle:!0}),s&&a>0?k.jsx("mesh",{geometry:OE,material:s,receiveShadow:!0}):null]}),e]})}),h8=new Map,o4e=Ce.forwardRef(function({children:e,...n},i){const r=Ce.useMemo(()=>Q_(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),a=Ce.useMemo(()=>(h8.has(n.props.subdivisions)||h8.set(n.props.subdivisions,new Xv(1,n.props.subdivisions)),h8.get(n.props.subdivisions)),[n.props.subdivisions]);Ce.useEffect(()=>()=>{a&&a.dispose()},[a]),Ce.useEffect(()=>()=>{r&&r.dispose()},[r]);const s=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,o=Ce.useMemo(()=>s===0?null:new hg({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(Qf,{}),o&&s>0?k.jsx("mesh",{geometry:a,material:o,receiveShadow:!0}):null]}),e]})}),l4e=Ce.forwardRef(function({children:e,...n},i){const r=Ce.useContext(xi),a=Ce.useMemo(()=>Q_(n.props),[n.props.material,n.props.color,n.props.wireframe,n.props.opacity,n.props.flat_shading,n.props.side]),s=Ce.useRef(),{geometry:o,skeleton:l}=Ce.useMemo(()=>{const h=new On;h.setAttribute("position",new In(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),h.setIndex(new In(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 z_);const y=[],m=new qn;b.forEach((_,w)=>{m.set(d[w*4+1],d[w*4+2],d[w*4+3],d[w*4+0]);const M=new Dt;M.makeRotationFromQuaternion(m),M.setPosition(g[w*3+0],g[w*3+1],g[w*3+2]),M.invert(),y.push(M),_.setRotationFromQuaternion(m),_.position.set(g[w*3+0],g[w*3+1],g[w*3+2])});const x=new qv(b,y);return h.setAttribute("skinIndex",new In(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 In(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;Ce.useEffect(()=>{const h=c.skinnedMeshState[n.name];return h.initialized=!1,()=>{l&&l.dispose(),o&&o.dispose()}},[l,o,n.name,c.skinnedMeshState]),Ce.useEffect(()=>()=>{a&&a.dispose()},[a]);const u=typeof n.props.receive_shadow=="number"?n.props.receive_shadow:0,f=Ce.useMemo(()=>u===0?null:new hg({opacity:u,color:0,depthWrite:!1}),[u]);return oa(()=>{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,m=h.poses[b].position;g.quaternion.set(y[1],y[2],y[3],y[0]),g.position.set(m[0],m[1],m[2])}),h.dirty=!1)}}),k.jsxs("skinnedMesh",{ref:i,geometry:o,material:a,skeleton:l,castShadow:n.props.cast_shadow,receiveShadow:n.props.receive_shadow===!0,frustumCulled:!1,children:[k.jsx(Qf,{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 c4e(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 u4e(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 f4e(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 Lb(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 Hp(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 h4e(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 Nx(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 d4e(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 p4e=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()}},m4e=class{constructor(e=!1){this.root=null,this._sortedList=new p4e,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 m=f(g,b);h();let x=d(g,b);(x===g||x===g+b)&&(x=g+(b>>1));const _={box:m,parent:y};return _.left=u(g,x-g,_),_.right=u(x,b-x+g,_),_}function f(g,b){const y=new s(6),m=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<m;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,L=(A+S)*.5,U=(D+C)*.5;o[0]>R&&(o[0]=R),o[1]<R&&(o[1]=R),o[2]>L&&(o[2]=L),o[3]<L&&(o[3]=L),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=h4e(o)*2,c=(o[l]+o[l+1])*.5}function d(g,b){let y=g,m=g+b-1;for(;y<=m;){const x=n[y];if((x[l+1]+x[l])*.5>=c)for(;;){const _=n[m];if((_[l+1]+_[l])*.5<c){const w=e[y];e[y]=e[m],e[m]=w;const M=n[y];n[y]=n[m],n[m]=M,m--;break}if(m--,m<=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||u4e(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=Hp(e,n.box);const a=Lb(e);if(n.object!==void 0)return n;const s=this._sortedList;s.clear();let o={node:n,inheritedCost:r-Lb(n.box)};do{const{node:l,inheritedCost:c}=o;if(a+c>=r)break;const u=l.left,f=l.right,h=Hp(e,u.box)+c,d=h-Lb(u.box),g=Hp(e,f.box)+c,b=g-Lb(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(!c4e(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(!f4e(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=Lb(o.box),y=b-Hp(l,d.box),m=b-Hp(l,g.box);y>m?y>0&&(u=s,f=g,h=y):m>0&&(u=s,f=d,h=m)}if(s.object===void 0){const d=s.left,g=s.right,b=Lb(s.box),y=b-Hp(c,d.box),m=b-Hp(c,g.box);y>m?y>h&&(u=o,f=g):m>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,g4e=1;let b4e=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===g4e)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 uG(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 fG(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 v4e(t,e,n){return Nx(n,t)<=e*e}class y4e{constructor(e,n=v4){this._sign=new Uint8Array(3),this.builder=e;const i=e.highPrecision;this.frustum=new b4e(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 uG(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 fG(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 v4e(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 fG(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(uG(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}=d4e(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)??Nx(a.box,e);l<i&&(i=l)}else i=Nx(a.box,e);return}const s=Nx(a.left.box,e),o=Nx(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 hG(t,e){return e[0]=t.x,e[1]=t.y,e[2]=t.z,e}function dG(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 _te{constructor(e,n,i){if(this.isInstanceEntity=!0,this.position=new te,this.scale=new te(1,1,1),this.quaternion=new qn,this.id=n,this.owner=e,i){const r=this.quaternion,a=this.rotation=new vi;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,m=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]=(m-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]=(m+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(mG,e)}rotateY(e){return this.rotateOnAxis(gG,e)}rotateZ(e){return this.rotateOnAxis(bG,e)}translateOnAxis(e,n){return pG.copy(e).applyQuaternion(this.quaternion),this.position.add(pG.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(mG,e)}translateY(e){return this.translateOnAxis(gG,e)}translateZ(e){return this.translateOnAxis(bG,e)}remove(){return this.owner.removeInstances(this.id),this}}const NE=new qn,pG=new te,mG=new te(1,0,0),gG=new te(0,1,0),bG=new te(0,0,1);class x4e{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 y4e(new m4e,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;hG(i.origin,r),hG(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 dG(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 vG.copy(this.geoBoundingBox).applyMatrix4(this.target.getMatrixAt(e)),dG(vG,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 vG=new rr;class _4e extends A${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 S4e(t){var e;return((e=ST.get(t))==null?void 0:e())??HC(t)}function w4e(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 E4e(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=S4e,w4e(n)}function M4e(t){t.properties.get=HC}function Ste(t,e){return Math.max(e,Math.ceil(Math.sqrt(t/e))*e)}function T4e(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=Ste(i,n),a=new t(r*r*e),s=t.name.includes("Float"),o=t.name.includes("Uint"),l=s?wr:o?Ac:Hv;let c;switch(e){case 1:c=s?Th:Vv;break;case 2:c=s?zA:U_;break;case 4:c=s?Qr:Gv;break}return{array:a,size:r,type:l,format:c}}let wT=class extends os{constructor(e,n,i,r,a,s){n===3&&(n=4);const{array:o,format:l,size:c,type:u}=T4e(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=Ste(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=bi.getPrimaries(bi.workingColorSpace),d=this.colorSpace===su?null:bi.getPrimaries(this.colorSpace),g=this.colorSpace===su||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+=A4e[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 A4e=["r","g","b","a"];let kn=class extends Si{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=B1,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 hf(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:C4e;this._renderer=s,this._capacity=l,this._parentLOD=r,this._geometry=e,this.material=n,this._allowsEuler=a??!1,this._tempInstance=new _te(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 _4e(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=bi.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,E4e(this,e,n)}unpatchMaterial(e,n){this._currentMaterial=null,M4e(e),n.onBeforeCompile=this._onBeforeCompileBase,n.customProgramCacheKey=this._customProgramCacheKeyBase,this._onBeforeCompileBase=null,this._customProgramCacheKeyBase=null}computeBVH(e={}){this.bvh||(this.bvh=new x4e(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=R4e){return n.fromArray(this.matricesTexture._data,e*16)}getPositionAt(e,n=k4e){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],m=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,L=1/(u*C+g*D+x*R+S);A.x=(o*C+f*D+b*R+_)*L,A.y=(l*C+h*D+y*R+w)*L,A.z=(c*C+d*D+m*R+M)*L;const U=o*o+l*l+c*c,j=f*f+h*h+d*d,z=b*b+y*y+m*m;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):_G.set(n).toArray(this.colorsTexture._data,e*4),this.colorsTexture.enqueueUpdate(e)}getColorAt(e,n=_G){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)&&(yG.copy(i).applyMatrix4(this.getMatrixAt(a)),r.union(yG))}computeBoundingSphere(){const e=this._geometry,n=this._instancesArrayCount;this.boundingSphere??(this.boundingSphere=new Ur),e.boundingSphere===null&&e.computeBoundingSphere();const i=e.boundingSphere,r=this.boundingSphere;r.makeEmpty();for(let a=0;a<n;a++)this.getActiveAt(a)&&(xG.copy(i).applyMatrix4(this.getMatrixAt(a)),r.union(xG))}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===B1?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===kP?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("Unrecognized bindMode: "+this.bindMode))}};const C4e=1e3,yG=new rr,xG=new Ur,R4e=new Dt,_G=new Ut,k4e=new te;kn.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 os(new Float32Array(a*t),a,t,Th,wr),this.morphTexture.image.data.set(r)}return(e=this.uniformsTexture)==null||e.resize(t),this};kn.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 wte(t,e){return t.depth-e.depth}function Ete(t,e){return e.depth-t.depth}class D4e{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 Zd,pu=new D4e,Qm=new Dt,R0=new Dt,VC=new te,aS=new te,k0=new te,O4e=new te,au=new Ur;kn.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))};kn.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)};kn.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&&(R0.copy(this.matrixWorld).invert(),aS.setFromMatrixPosition(t.matrixWorld).applyMatrix4(R0),VC.set(0,0,-1).transformDirection(t.matrixWorld).transformDirection(R0)),i?(Qm.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?pu.array.sort((e=this.material)!=null&&e.transparent?Ete:wte):a(pu.array);const s=pu.array,o=s.length;for(let l=0;l<o;l++)r[l]=s[l].index;this.count=o,pu.reset()}};kn.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};kn.prototype.updateRenderList=function(){const t=this._instancesArrayCount;for(let e=0;e<t;e++)if(this.getActiveAndVisibilityAt(e)){const n=this.getPositionAt(e).sub(aS).dot(VC);pu.push(n,e)}};kn.prototype.BVHCulling=function(t){const e=this.instanceIndex.array,n=this._instancesArrayCount,i=this._sortObjects,r=this.onFrustumEnter;let a=0;this.bvh.frustumCulling(Qm,s=>{const o=s.object;if(o<n&&this.getVisibilityAt(o)&&(!r||r(o,t)))if(i){const l=this.getPositionAt(o).sub(aS).dot(VC);pu.push(l,o)}else e[a++]=o}),this.count=a};kn.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(Qm);for(let u=0;u<a;u++)if(this.getActiveAndVisibilityAt(u)){if(s){const f=this.getPositionAndMaxScaleOnAxisAt(u,au.center);au.radius=i*f}else this.applyMatrixAtToSphere(u,au,r,i);if(ET.intersectsSphere(au)&&(!l||l(u,t)))if(o){const f=O4e.subVectors(au.center,aS).dot(VC);pu.push(f,u)}else e[c++]=u}this.count=c};kn.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);Qm.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse).multiply(this.matrixWorld),R0.copy(this.matrixWorld).invert(),aS.setFromMatrixPosition(e.matrixWorld).applyMatrix4(R0),k0.setFromMatrixPosition(n.matrixWorld).applyMatrix4(R0);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=pu.array;let f=0,h=s[1].distance;c===null?u.sort((i=s[0].object.material)!=null&&i.transparent?Ete:wte):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}pu.reset()}for(let c=0;c<s.length;c++){const u=s[c].object;u.count=a[c]}};kn.prototype.BVHCullingLOD=function(t,e,n,i,r){const{count:a,levels:s}=t,o=this._instancesArrayCount,l=this.onFrustumEnter;n?this.bvh.frustumCulling(Qm,c=>{const u=c.object;if(u<o&&this.getVisibilityAt(u)&&(!l||l(u,i,r))){const f=this.getPositionAt(u).distanceToSquared(k0);pu.push(f,u)}}):this.bvh.frustumCullingLOD(Qm,k0,s,(c,u)=>{const f=c.object;if(f<o&&this.getVisibilityAt(f)){if(u===null){const h=this.getPositionAt(f).distanceToSquared(k0);u=this.getObjectLODIndexForDistance(s,h)}(!l||l(f,i,r,u))&&(e[u][a[u]++]=f)}})};kn.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(Qm);for(let d=0;d<u;d++)if(this.getActiveAndVisibilityAt(d)){if(f){const g=this.getPositionAndMaxScaleOnAxisAt(d,au.center);au.radius=l*g}else this.applyMatrixAtToSphere(d,au,c,l);if(ET.intersectsSphere(au))if(n){if(!h||h(d,i,r))continue;const g=au.center.distanceToSquared(k0);pu.push(g,d)}else{const g=au.center.distanceToSquared(k0),b=this.getObjectLODIndexForDistance(s,g);(!h||h(d,i,r,b))&&(e[b][a[b]++]=d)}}};kn.prototype.clearTempInstance=function(t){const e=this._tempInstance;return e.id=t,this.clearInstance(e)};kn.prototype.clearTempInstancePosition=function(t){const e=this._tempInstance;return e.id=t,e.position.set(0,0,0),e};kn.prototype.clearInstance=function(t){return t.position.set(0,0,0),t.scale.set(1,1,1),t.quaternion.identity(),t};kn.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};kn.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};kn.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 _te(this,i,this._allowsEuler));return this};kn.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};kn.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)};kn.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};kn.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};kn.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};kn.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};kn.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};kn.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};kn.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 kn(e,n??new cs,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};kn.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};kn.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)};kn.prototype.updateShadowLOD=function(t,e,n){var i;return this.updateLevel((i=this.LODinfo)==null?void 0:i.shadowRender,t,e,n)};kn.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};kn.prototype.updateAllLOD=function(t,e){var n;return this.updateAllLevels((n=this.LODinfo)==null?void 0:n.render,t,e)};kn.prototype.updateAllShadowLOD=function(t,e){var n;return this.updateAllLevels((n=this.LODinfo)==null?void 0:n.shadowRender,t,e)};kn.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()};kn.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};kn.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 I4e=new Si;kn.prototype.getMorphAt=function(t,e=I4e){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};kn.prototype.setMorphAt=function(t,e){const n=e.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&!this._parentLOD&&(this.morphTexture=new os(new Float32Array(i*this._capacity),i,this._capacity,Th,wr));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 Si,N4e=new yf,SG=new te,wG=new te,EG=new Dt,MG=new Ur;kn.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;EG.copy(this.matrixWorld).invert(),wG.setFromMatrixScale(this.matrixWorld),SG.copy(t.ray.direction).multiply(wG);const a=SG.length();t.ray=N4e.copy(t.ray).applyMatrix4(EG),t.near/=a,t.far/=a,this.raycastInstances(t,e),t.ray=n,t.near=i,t.far=r};kn.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(),MG.copy(this.boundingSphere),!t.ray.intersectsSphere(MG))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)}};kn.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}};kn.prototype.initSkeleton=function(t,e=!0){if(t&&this.skeleton!==t&&!this._parentLOD){const n=t.bones;if(this.skeleton=t,this.bindMatrix=new Dt,this.bindMatrixInverse=new Dt,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()}};kn.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)};kn.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],m=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],L=s[12],U=s[1],j=s[5],z=s[9],q=s[13],F=s[2],V=s[6],H=s[10],W=s[14],B=s[3],J=s[7],Z=s[11],G=s[15];o[r+0]=l*C+c*U+u*F+f*B,o[r+4]=l*D+c*j+u*V+f*J,o[r+8]=l*R+c*z+u*H+f*Z,o[r+12]=l*L+c*q+u*W+f*G,o[r+1]=h*C+d*U+g*F+b*B,o[r+5]=h*D+d*j+g*V+b*J,o[r+9]=h*R+d*z+g*H+b*Z,o[r+13]=h*L+d*q+g*W+b*G,o[r+2]=y*C+m*U+x*F+_*B,o[r+6]=y*D+m*j+x*V+_*J,o[r+10]=y*R+m*z+x*H+_*Z,o[r+14]=y*L+m*q+x*W+_*G,o[r+3]=w*C+M*U+S*F+A*B,o[r+7]=w*D+M*j+S*V+A*J,o[r+11]=w*R+M*z+S*H+A*Z,o[r+15]=w*L+M*q+S*W+A*G};kn.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)};kn.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)};kn.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()}};kn.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}};kn.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};kn.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 L4e=`#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`,P4e=`#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`,U4e=`#ifdef USE_INSTANCING_INDIRECT\r
  mat4 instanceMatrix = getInstancedMatrix();

  #ifdef USE_INSTANCING_COLOR_INDIRECT\r
    vColor *= getColorTexture();\r
  #endif\r
#endif`,F4e=`#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`,B4e=`#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`;hn.instanced_pars_vertex=L4e;hn.instanced_color_pars_vertex=P4e;hn.instanced_vertex=U4e;hn.instanced_color_vertex=F4e;function y4(t){return t.replace("#ifdef USE_INSTANCING","#if defined USE_INSTANCING || defined USE_INSTANCING_INDIRECT")}hn.project_vertex=y4(hn.project_vertex);hn.worldpos_vertex=y4(hn.worldpos_vertex);hn.defaultnormal_vertex=y4(hn.defaultnormal_vertex);hn.batching_pars_vertex=hn.batching_pars_vertex.concat(`
#include <instanced_pars_vertex>`);hn.color_pars_vertex=hn.color_pars_vertex.concat(`
#include <instanced_color_pars_vertex>`);hn.batching_vertex=hn.batching_vertex.concat(`
#include <instanced_vertex>`);hn.skinning_pars_vertex=B4e;hn.morphinstance_vertex&&(hn.morphinstance_vertex=hn.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 m=0,b=0;b<d.length;++b)g[m++]=g[b]<60?e[g[b]]:(g[b]-60)*64+g[++b];return g.buffer.slice(0,m)}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 m=n.exports.sbrk,x=m(g.length*4),_=m(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)),m(x-m(0));for(var C=0;C<g.length;++C)g[C]=A[g[C]];return[A,S]}function l(d,g,b,y){var m=n.exports.sbrk,x=m(b*4),_=m(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)),m(x-m(0)),M}function c(d,g,b,y,m,x,_){var w=n.exports.sbrk,M=w(g),S=w(y*m),A=new Uint8Array(n.exports.memory.buffer);A.set(s(b),S);var C=d(M,g,S,y,m,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,m,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,m,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,m){a(b>0&&b<=256),a(b%4==0),a(y>=0&&y<=3),a(m===void 0||m==0||m==1);var x=n.exports.meshopt_encodeVertexBufferBound(g,b);return c(n.exports.meshopt_encodeVertexBufferLevel,x,d,g,b,y,m||0)},encodeIndexBuffer:function(d,g,b){a(b==2||b==4),a(g%3==0);var y=f(d,b),m=n.exports.meshopt_encodeIndexBufferBound(g,u(y)+1);return c(n.exports.meshopt_encodeIndexBuffer,m,y,g,4)},encodeIndexSequence:function(d,g,b){a(b==2||b==4);var y=f(d,b),m=n.exports.meshopt_encodeIndexSequenceBound(g,u(y)+1);return c(n.exports.meshopt_encodeIndexSequence,m,y,g,4)},encodeGltfBuffer:function(d,g,b,y){var m={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return a(m[y]),m[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,m){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,m?x[m]: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(m){a=m.instance,a.exports.__wasm_call_ctors()});function o(m){for(var x=new Uint8Array(m.length),_=0;_<m.length;++_){var w=m.charCodeAt(_);x[_]=w>96?w-97:w>64?w-39:w+4}for(var M=0,_=0;_<m.length;++_)x[M++]=x[_]<60?i[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,M)}function l(m,x,_,w,M,S,A){var C=m.exports.sbrk,D=w+3&-4,R=C(D*M),L=C(S.length),U=new Uint8Array(m.exports.memory.buffer);U.set(S,L);var j=x(R,w,M,L,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(m){var x={object:new Worker(m),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(m){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<m;++M)f[M]=d(w);for(var M=m;M<f.length;++M)f[M].object.postMessage({});f.length=m,URL.revokeObjectURL(w)}function b(m,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(_),L=++h;S.pending+=m,S.requests[L]={resolve:C,reject:D},S.object.postMessage({id:L,count:m,size:x,source:R,mode:w,filter:M},[R.buffer])})}function y(m){var x=m.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(m){g(m)},decodeVertexBuffer:function(m,x,_,w,M){l(a,a.exports.meshopt_decodeVertexBuffer,m,x,_,w,a.exports[c[M]])},decodeIndexBuffer:function(m,x,_,w){l(a,a.exports.meshopt_decodeIndexBuffer,m,x,_,w)},decodeIndexSequence:function(m,x,_,w){l(a,a.exports.meshopt_decodeIndexSequence,m,x,_,w)},decodeGltfBuffer:function(m,x,_,w,M,S){l(a,a.exports[u[M]],m,x,_,w,a.exports[c[S]])},decodeGltfBufferAsync:function(m,x,_,w,M){return f.length>0?b(m,x,_,u[w],c[M]):s.then(function(){var S=new Uint8Array(m*x);return l(a,a.exports[u[w]],S,m,x,_,a.exports[c[M]]),S})}}})();var z4e=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(m){n=m.instance,n.exports.__wasm_call_ctors()});function r(m){for(var x=new Uint8Array(m.length),_=0;_<m.length;++_){var w=m.charCodeAt(_);x[_]=w>96?w-97:w>64?w-39:w+4}for(var M=0,_=0;_<m.length;++_)x[M++]=x[_]<60?e[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,M)}function a(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function o(m,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=m(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 L=0;L<x.length;++L)x[L]=R[x[L]];return[R,D]}function l(m){for(var x=0,_=0;_<m.length;++_){var w=m[_];x=x<w?w:x}return x}function c(m,x,_,w,M,S,A,C,D){var R=n.exports.sbrk,L=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 F=m(U,z,_,j,M,S,A,C,D,L);q=new Uint8Array(n.exports.memory.buffer);var V=new Uint32Array(F);s(V).set(q.subarray(U,U+F*4));var H=new Float32Array(1);return s(H).set(q.subarray(L,L+4)),R(L-R(0)),[V,H[0]]}function u(m,x,_,w,M,S,A,C,D,R,L,U,j){var z=n.exports.sbrk,q=z(4),F=z(_*4),V=z(M*S),H=z(M*C),W=z(D.length*4),B=z(_*4),J=R?z(M):0,Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(w),V),Z.set(s(A),H),Z.set(s(D),W),Z.set(s(x),B),R&&Z.set(s(R),J);var G=m(F,B,_,V,M,S,H,C,W,D.length,J,L,U,j,q);Z=new Uint8Array(n.exports.memory.buffer);var de=new Uint32Array(G);s(de).set(Z.subarray(F,F+G*4));var oe=new Float32Array(1);return s(oe).set(Z.subarray(q,q+4)),z(q-z(0)),[de,oe[0]]}function f(m,x,_,w,M,S,A,C,D,R,L,U,j){var z=n.exports.sbrk,q=z(4),F=z(M*S),V=z(M*C),H=z(D.length*4),W=z(_*4),B=R?z(M):0,J=new Uint8Array(n.exports.memory.buffer);J.set(s(w),F),J.set(s(A),V),J.set(s(D),H),J.set(s(x),W),R&&J.set(s(R),B);var Z=m(W,_,F,M,S,V,C,H,D.length,B,L,U,j,q);J=new Uint8Array(n.exports.memory.buffer),s(x).set(J.subarray(W,W+Z*4)),s(w).set(J.subarray(F,F+M*S)),s(A).set(J.subarray(V,V+M*C));var G=new Float32Array(1);return s(G).set(J.subarray(q,q+4)),z(q-z(0)),[Z,G[0]]}function h(m,x,_,w){var M=n.exports.sbrk,S=M(_*w),A=new Uint8Array(n.exports.memory.buffer);A.set(s(x),S);var C=m(S,_,w);return M(S-M(0)),C}function d(m,x,_,w,M,S,A,C){var D=n.exports.sbrk,R=D(C*4),L=D(_*w),U=D(_*S),j=new Uint8Array(n.exports.memory.buffer);j.set(s(x),L),M&&j.set(s(M),U);var z=m(R,L,_,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(m,x,_,w,M,S,A,C,D){var R=n.exports.sbrk,L=R(4),U=R(_*4),j=R(M*S),z=R(_*4),q=A?R(M):0,F=new Uint8Array(n.exports.memory.buffer);F.set(s(w),j),F.set(s(x),z),A&&F.set(s(A),q);var V=m(U,z,_,j,M,S,q,C,D,L);F=new Uint8Array(n.exports.memory.buffer);var H=new Uint32Array(V);s(H).set(F.subarray(U,U+V*4));var W=new Float32Array(1);return s(W).set(F.subarray(L,L+4)),R(L-R(0)),[H,W[0]]}function b(m,x,_,w,M,S,A){var C=n.exports.sbrk,D=C(_*4),R=C(M*S),L=C(_*4),U=new Uint8Array(n.exports.memory.buffer);U.set(s(w),R),U.set(s(x),L);var j=m(D,L,_,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(m){a(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),a(m.length%3==0);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return o(n.exports.meshopt_optimizeVertexFetchRemap,x,l(m)+1)},simplify:function(m,x,_,w,M,S){a(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),a(m.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w>=0&&w<=m.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=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),R=c(n.exports.meshopt_simplify,D,m.length,x,x.length/_,_*4,w,M,A);return R[0]=m instanceof Uint32Array?R[0]:new m.constructor(R[0]),R},simplifyWithAttributes:function(m,x,_,w,M,S,A,C,D,R){a(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),a(m.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<=m.length),a(C%3==0),a(D>=0),a(Array.isArray(S)),a(M>=S.length),a(S.length<=32);for(var L=0;L<S.length;++L)a(S[L]>=0);for(var U=0,L=0;L<(R?R.length:0);++L)a(R[L]in y),U|=y[R[L]];var j=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),z=u(n.exports.meshopt_simplifyWithAttributes,j,m.length,x,x.length/_,_*4,w,M*4,new Float32Array(S),A,C,D,U);return z[0]=m instanceof Uint32Array?z[0]:new m.constructor(z[0]),z},simplifyWithUpdate:function(m,x,_,w,M,S,A,C,D,R){a(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),a(m.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<=m.length),a(C%3==0),a(D>=0),a(Array.isArray(S)),a(M>=S.length),a(S.length<=32);for(var L=0;L<S.length;++L)a(S[L]>=0);for(var U=0,L=0;L<(R?R.length:0);++L)a(R[L]in y),U|=y[R[L]];var j=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),z=f(n.exports.meshopt_simplifyWithUpdate,j,m.length,x,x.length/_,_*4,w,M*4,new Float32Array(S),A,C,D,U);if(m!==j)for(var L=0;L<z[0];++L)m[L]=j[L];return z},getScale:function(m,x){return a(m instanceof Float32Array),a(m.length%x==0),a(x>=3),h(n.exports.meshopt_simplifyScale,m,m.length/x,x*4)},simplifyPoints:function(m,x,_,w,M,S){return a(m instanceof Float32Array),a(m.length%x==0),a(x>=3),a(_>=0&&_<=m.length/x),w?(a(w instanceof Float32Array),a(w.length%M==0),a(M>=3),a(m.length/x==w.length/M),d(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,w,M*4,S,_)):d(n.exports.meshopt_simplifyPoints,m,m.length/x,x*4,void 0,0,0,_)},simplifySloppy:function(m,x,_,w,M,S){a(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),a(m.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<=m.length),a(M%3==0),a(S>=0);var A=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),C=g(n.exports.meshopt_simplifySloppy,A,m.length,x,x.length/_,_*4,w,M,S);return C[0]=m instanceof Uint32Array?C[0]:new m.constructor(C[0]),C},simplifyPrune:function(m,x,_,w){a(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),a(m.length%3==0),a(x instanceof Float32Array),a(x.length%_==0),a(_>=3),a(w>=0);var M=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),S=b(n.exports.meshopt_simplifyPrune,M,m.length,x,x.length/_,_*4,w);return S=m instanceof Uint32Array?S:new m.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),m=0;m<b.length;++m){var x=b.charCodeAt(m);y[m]=x>96?x-97:x>64?x-39:x+4}for(var _=0,m=0;m<b.length;++m)y[_++]=y[m]<60?e[y[m]]:(y[m]-60)*64+y[++m];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 m=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(m,m+_),triangles:b.triangles.subarray(x,x+w*3)}}function u(b,y,m,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),L=S(b.byteLength),U=S(y.byteLength),j=new Uint8Array(n.exports.memory.buffer);j.set(s(b),L),j.set(s(y),U);var z=n.exports.meshopt_buildMeshlets(C,D,R,L,b.length,U,m,x,_,w,M);j=new Uint8Array(n.exports.memory.buffer);for(var q=j.subarray(C,C+z*l),F=new Uint32Array(q.buffer,q.byteOffset,q.byteLength/4).slice(),V=0;V<z;++V){var H=F[V*4+0],W=F[V*4+1],m=F[V*4+2],B=F[V*4+3];n.exports.meshopt_optimizeMeshlet(D+H*4,R+W,B,m)}var J=F[(z-1)*4+0],Z=F[(z-1)*4+1],G=F[(z-1)*4+2],de=F[(z-1)*4+3],oe=J+G,le=Z+(de*3+3&-4),ue={meshlets:F,vertices:new Uint32Array(j.buffer,D,oe).slice(),triangles:new Uint8Array(j.buffer,R,le*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,m,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 L=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+L*4,A+U,j,M,m,x),w.push(f(C))}return _(M-_(0)),w}function d(b,y,m,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,m,x);var C=f(w);return _(w-_(0)),C}function g(b,y,m,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,m,A,x?_:0);var D=f(M);return w(M-w(0)),D}return{ready:i,supported:!0,buildMeshlets:function(b,y,m,x,_,w){a(b.length%3==0),a(y instanceof Float32Array),a(y.length%m==0),a(m>=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/m,m*4,x,_,w)},extractMeshlet:function(b,y){return a(y>=0&&y<b.meshletCount),c(b,y)},computeClusterBounds:function(b,y,m){a(b.length%3==0),a(b.length/3<=512),a(y instanceof Float32Array),a(y.length%m==0),a(m>=3);var x=b.BYTES_PER_ELEMENT==4?b:new Uint32Array(b);return d(x,y,y.length/m,m*4)},computeMeshletBounds:function(b,y,m){return a(b.meshletCount!=0),a(y instanceof Float32Array),a(y.length%m==0),a(m>=3),h(b,y,y.length/m,m*4)},computeSphereBounds:function(b,y,m,x){return a(b instanceof Float32Array),a(b.length%y==0),a(y>=3),a(!m||m instanceof Float32Array),a(!m||m.length%x==0),a(!m||x>=1),a(!m||b.length/y==m.length/x),x=x||0,g(b,b.length/y,y*4,m,x*4)}}})();function j4e(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=z4e.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 Mte=Ce.forwardRef(function(e,n){const[i,r]=Ce.useState(null);Ce.useImperativeHandle(n,()=>i,[i]);const a=I.useMemo(()=>new te,[]),s=I.useMemo(()=>new qn,[]),o=I.useMemo(()=>new te(1,1,1),[]),l=ki(c=>c.gl);return I.useEffect(()=>{const c=e.batched_positions.byteLength/(3*Float32Array.BYTES_PER_ELEMENT),u=new kn(e.geometry.clone(),e.material,{capacity:c,renderer:l});u.frustumCulled=!1;let f=[],h=[];if(e.lod!=="off"){const d=j4e(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 m=g*3*4%e.batched_scales.byteLength;o.set(h.getFloat32(m,!0),h.getFloat32(m+4,!0),h.getFloat32(m+8,!0))}else{const m=g*4%e.batched_scales.byteLength,x=h.getFloat32(m,!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]),Ce.useEffect(()=>{i!==null&&(e.clickable||i.instancesCount>5e4?i.computeBVH({margin:i.geometry.boundingSphere.radius*.2}):i.disposeBVH())},[e.clickable,i]),Ce.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]),Ce.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})]})}),H4e=Ce.forwardRef(function({children:e,...n},i){const a=Ce.useContext(xi).useSceneTree(l=>l[n.name]?.clickable)??!1,s=I.useMemo(()=>{const l=Q_({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 On;return l.setAttribute("position",new In(new Float32Array(n.props.vertices.buffer.slice(n.props.vertices.byteOffset,n.props.vertices.byteOffset+n.props.vertices.byteLength)),3)),l.setIndex(new In(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(Mte,{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]})}),Tte=new XEe;Tte.setDecoderPath("https://www.gstatic.com/draco/v1/decoders/");function V4e(t){t instanceof Si&&(t.geometry&&t.geometry.dispose(),t.material&&(Array.isArray(t.material)?t.material.forEach(e=>{L6(e)}):L6(t.material)))}function Ate(t){const[e,n]=Ce.useState(),[i,r]=Ce.useState([]),a=Ce.useRef(null);return Ce.useEffect(()=>{const s=new uEe;return s.setDRACOLoader(Tte),s.parse(new Uint8Array(t).buffer,"",o=>{o.animations&&o.animations.length&&(a.current=new T$(o.scene),o.animations.forEach(c=>{a.current.clipAction(c).play()}));const l=[];o?.scene.traverse(c=>{c instanceof Si&&(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(V4e)}},[t]),{gltf:e,meshes:i,mixerRef:a}}const G4e=Ce.forwardRef(function({children:e,...n},i){const{gltf:r,meshes:a,mixerRef:s}=Ate(n.props.glb_data);Ce.useEffect(()=>{r&&r.scene.traverse(b=>{b instanceof Si&&(b.castShadow=n.props.cast_shadow,b.receiveShadow=n.props.receive_shadow===!0)})},[r,n.props.cast_shadow,n.props.receive_shadow]),oa((b,y)=>{s.current?.update(y)});const o=ki(b=>b.gl),l=Ce.useMemo(()=>o.getDrawingBufferSize(new wt),[o]),c=Ce.useMemo(()=>{const b=new PU({side:Da});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=Ce.useRef(null),f=Ce.useContext(ty);oa(()=>{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=Ce.useMemo(()=>d===0?null:new hg({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}),W4e=Ce.forwardRef(function({children:e,...n},i){const a=Ce.useContext(xi).useSceneTree(c=>c[n.name]?.clickable)??!1,{gltf:s}=Ate(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 Si&&d.parent&&(d.geometry.applyMatrix4(d.matrixWorld),c.push(d.geometry),u.push(d.material))});const f=c.length===1?c[0].clone():qwe(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(Mte,{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 q4e(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 Yl(t){return t[0]<<16|t[1]<<8|t[2]}function X4e(t){return Ce.useContext(xi).useSceneTree(i=>i[t.name]?.labelVisible)?k.jsx(Qv,{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 K4e(t,e,n){if(t===void 0)return{makeObject:()=>null};switch(t.type){case"FrameMessage":return{makeObject:(i,r)=>k.jsx(uTe,{ref:i,showAxes:t.props.show_axes,axesLength:t.props.axes_length,axesRadius:t.props.axes_radius,originRadius:t.props.origin_radius,originColor:Yl(t.props.origin_color),children:r})};case"BatchedAxesMessage":return{makeObject:(i,r)=>k.jsx(fTe,{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 qn().setFromEuler(t.props.plane=="xz"?new vi(0,0,0):t.props.plane=="xy"?new vi(Math.PI/2,0,0):t.props.plane=="yx"?new vi(0,Math.PI/2,Math.PI/2):t.props.plane=="yz"?new vi(0,0,Math.PI/2):t.props.plane=="zx"?new vi(0,Math.PI/2,0):new vi(-Math.PI/2,0,-Math.PI/2)),r=new qn().setFromEuler(new vi(-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(HZ,{args:[t.props.width,t.props.height],side:Jr,cellColor:Yl(t.props.cell_color),cellThickness:t.props.cell_thickness,cellSize:t.props.cell_size,sectionColor:Yl(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(cTe,{ref:i,...t,children:r})};case"SkinnedMeshMessage":return{makeObject:(i,r)=>k.jsx(l4e,{ref:i,...t,children:r})};case"MeshMessage":return{makeObject:(i,r)=>k.jsx(a4e,{ref:i,...t,children:r})};case"BoxMessage":return{makeObject:(i,r)=>k.jsx(s4e,{ref:i,...t,children:r})};case"IcosphereMessage":return{makeObject:(i,r)=>k.jsx(o4e,{ref:i,...t,children:r})};case"BatchedMeshesMessage":return{makeObject:(i,r)=>k.jsx(H4e,{ref:i,...t,children:r}),computeClickInstanceIndexFromInstanceId:t.type==="BatchedMeshesMessage"?i=>i:void 0};case"CameraFrustumMessage":return{makeObject:(i,r)=>k.jsx(gTe,{ref:i,...t,children:r})};case"TransformControlsMessage":{const{send:i,flush:r}=eQ(e,50);let a=!1;return{makeObject:(s,o)=>k.jsx("group",{onClick:l=>l.stopPropagation(),children:k.jsx(ZZ,{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 qn;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(pTe,{ref:i,...t,children:r}),unmountWhenInvisible:!1};case"Gui3DMessage":return{makeObject:(i,r)=>k.jsxs("group",{ref:i,children:[k.jsx(Qv,{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(hTe,{ref:i,...t,children:r})};case"GlbMessage":return{makeObject:(i,r)=>k.jsx(G4e,{ref:i,...t,children:r})};case"BatchedGlbMessage":return{makeObject:(i,r)=>k.jsx(W4e,{ref:i,...t,children:r}),computeClickInstanceIndexFromInstanceId:i=>i};case"LineSegmentsMessage":return{makeObject:(i,r)=>k.jsx(QUe,{ref:i,...t,children:r})};case"CatmullRomSplineMessage":return{makeObject:(i,r)=>k.jsxs("group",{ref:i,children:[k.jsx(iMe,{points:g8(t.props.points),closed:t.props.closed,curveType:t.props.curve_type,tension:t.props.tension,lineWidth:t.props.line_width,color:Yl(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(nMe,{start:a[o],end:a[o+1],midA:s[2*o],midB:s[2*o+1],lineWidth:t.props.line_width,color:Yl(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:Yl(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:Yl(t.props.color),children:r})};case"HemisphereLightMessage":return{makeObject:(i,r)=>k.jsx("hemisphereLight",{ref:i,intensity:t.props.intensity,color:Yl(t.props.sky_color),groundColor:Yl(t.props.ground_color),children:r})};case"PointLightMessage":return{makeObject:(i,r)=>k.jsx("pointLight",{ref:i,intensity:t.props.intensity,color:Yl(t.props.color),distance:t.props.distance,decay:t.props.decay,castShadow:t.props.cast_shadow,...iG,children:r})};case"RectAreaLightMessage":return{makeObject:(i,r)=>k.jsx("rectAreaLight",{ref:i,intensity:t.props.intensity,color:Yl(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:Yl(t.props.color),distance:t.props.distance,angle:t.props.angle,penumbra:t.props.penumbra,decay:t.props.decay,castShadow:t.props.cast_shadow,...iG,children:r})};default:return console.log("Received message did not match any known types:",t),{makeObject:()=>null}}}function Cte(t){const e=Ce.useContext(xi),n=e.useSceneTree(w=>w[t.name]?.message),i=Q$(),r=e.sceneTreeActions.updateNodeAttributes,{makeObject:a,unmountWhenInvisible:s,computeClickInstanceIndexFromInstanceId:o}=Ce.useMemo(()=>K4e(n,e,i),[n,e,i]),[l,c]=Ce.useState(!1),u=e.useSceneTree(w=>w[t.name]?.clickable)??!1,f=Ce.useRef(null),h=Ce.useRef(),d=Ce.useMemo(()=>k.jsx(Y4e,{name:t.name}),[]),g=e.mutable.current,b=Ce.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}Ce.useEffect(()=>{r(t.name,{poseUpdateState:"needsUpdate"})},[b]),oa(()=>{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 m=EC(50).send,x=Ce.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 _=Ce.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=QZ(e,w.ray),A=g.canvas.getBoundingClientRect(),C=q4e(e,[w.clientX-A.left,w.clientY-A.top]);m({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(ty.Provider,{value:{state:x,clickable:u},children:b})})})}function Y4e(t){const n=Ce.useContext(xi).useSceneTree(i=>i[t.name]?.children,Z_);return k.jsxs(k.Fragment,{children:[n&&n.map(i=>k.jsx(Cte,{name:i},i)),k.jsx(X4e,{name:t.name})]})}var GC={},Rte={L:1,M:0,Q:3,H:2},kte={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},J4e=kte;function Dte(t){this.mode=J4e.MODE_8BIT_BYTE,this.data=t}Dte.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 $4e=Dte,LE=Rte;function Xu(t,e){this.totalCount=t,this.dataCount=e}Xu.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]];Xu.getRSBlocks=function(t,e){var n=Xu.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 Xu(o,l));return r};Xu.getRsBlockTable=function(t,e){switch(e){case LE.L:return Xu.RS_BLOCK_TABLE[(t-1)*4+0];case LE.M:return Xu.RS_BLOCK_TABLE[(t-1)*4+1];case LE.Q:return Xu.RS_BLOCK_TABLE[(t-1)*4+2];case LE.H:return Xu.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};var Z4e=Xu;function Ote(){this.buffer=new Array,this.length=0}Ote.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 Q4e=Ote,uu={glog:function(t){if(t<1)throw new Error("glog("+t+")");return uu.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return uu.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ms=0;Ms<8;Ms++)uu.EXP_TABLE[Ms]=1<<Ms;for(var Ms=8;Ms<256;Ms++)uu.EXP_TABLE[Ms]=uu.EXP_TABLE[Ms-4]^uu.EXP_TABLE[Ms-5]^uu.EXP_TABLE[Ms-6]^uu.EXP_TABLE[Ms-8];for(var Ms=0;Ms<255;Ms++)uu.LOG_TABLE[uu.EXP_TABLE[Ms]]=Ms;var Ite=uu,Vp=Ite;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]^=Vp.gexp(Vp.glog(this.get(n))+Vp.glog(t.get(i)));return new wM(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Vp.glog(this.get(0))-Vp.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]^=Vp.gexp(Vp.glog(t.get(i))+e);return new wM(n,0).mod(t)}};var Nte=wM,Jl=kte,TG=Nte,e9e=Ite,id={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 id.PATTERN000:return(e+n)%2==0;case id.PATTERN001:return e%2==0;case id.PATTERN010:return n%3==0;case id.PATTERN011:return(e+n)%3==0;case id.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case id.PATTERN101:return e*n%2+e*n%3==0;case id.PATTERN110:return(e*n%2+e*n%3)%2==0;case id.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new TG([1],0),n=0;n<t;n++)e=e.multiply(new TG([1,e9e.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Jl.MODE_NUMBER:return 10;case Jl.MODE_ALPHA_NUM:return 9;case Jl.MODE_8BIT_BYTE:return 8;case Jl.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Jl.MODE_NUMBER:return 12;case Jl.MODE_ALPHA_NUM:return 11;case Jl.MODE_8BIT_BYTE:return 16;case Jl.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Jl.MODE_NUMBER:return 14;case Jl.MODE_ALPHA_NUM:return 13;case Jl.MODE_8BIT_BYTE:return 16;case Jl.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}},t9e=ys,n9e=$4e,Lte=Z4e,Pte=Q4e,ip=t9e,i9e=Nte;function Ju(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var Ll=Ju.prototype;Ll.addData=function(t){var e=new n9e(t);this.dataList.push(e),this.dataCache=null};Ll.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]};Ll.getModuleCount=function(){return this.moduleCount};Ll.make=function(){if(this.typeNumber<1){var t=1;for(t=1;t<40;t++){for(var e=Lte.getRSBlocks(t,this.errorCorrectLevel),n=new Pte,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(),ip.getLengthInBits(a.mode,t)),a.write(n)}if(n.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())};Ll.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=Ju.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)};Ll.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)};Ll.getBestMaskPattern=function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=ip.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e};Ll.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};Ll.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)};Ll.setupPositionAdjustPattern=function(){for(var t=ip.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}};Ll.setupTypeNumber=function(t){for(var e=ip.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}};Ll.setupTypeInfo=function(t,e){for(var n=this.errorCorrectLevel<<3|e,i=ip.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};Ll.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=ip.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}}};Ju.PAD0=236;Ju.PAD1=17;Ju.createData=function(t,e,n){for(var i=Lte.getRSBlocks(t,e),r=new Pte,a=0;a<n.length;a++){var s=n[a];r.put(s.mode,4),r.put(s.getLength(),ip.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(Ju.PAD0,8),r.getLengthInBits()>=o*8));)r.put(Ju.PAD1,8);return Ju.createBytes(r,i)};Ju.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=ip.getErrorCorrectPolynomial(c),h=new i9e(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),m=0,u=0;u<i;u++)for(var o=0;o<e.length;o++)u<a[o].length&&(y[m++]=a[o][u]);for(var u=0;u<r;u++)for(var o=0;o<e.length;o++)u<s[o].length&&(y[m++]=s[o][u]);return y};var r9e=Ju,x4={};Object.defineProperty(x4,"__esModule",{value:!0});var a9e=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},s9e=fX,$l=Fte(s9e),Ute=I,PE=Fte(Ute);function Fte(t){return t&&t.__esModule?t:{default:t}}function o9e(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 l9e={bgColor:$l.default.oneOfType([$l.default.object,$l.default.string]).isRequired,bgD:$l.default.string.isRequired,fgColor:$l.default.oneOfType([$l.default.object,$l.default.string]).isRequired,fgD:$l.default.string.isRequired,size:$l.default.number.isRequired,title:$l.default.string,viewBoxSize:$l.default.number.isRequired,xmlns:$l.default.string},_4=(0,Ute.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=o9e(t,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return PE.default.createElement("svg",a9e({},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=l9e;x4.default=_4;Object.defineProperty(GC,"__esModule",{value:!0});GC.QRCode=void 0;var c9e=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},u9e=fX,jf=sS(u9e),f9e=Rte,h9e=sS(f9e),d9e=r9e,p9e=sS(d9e),Bte=I,m9e=sS(Bte),g9e=x4,b9e=sS(g9e);function sS(t){return t&&t.__esModule?t:{default:t}}function v9e(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 y9e={bgColor:jf.default.oneOfType([jf.default.object,jf.default.string]),fgColor:jf.default.oneOfType([jf.default.object,jf.default.string]),level:jf.default.string,size:jf.default.number,value:jf.default.string.isRequired},WC=(0,Bte.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=v9e(t,["bgColor","fgColor","level","size","value"]),h=new p9e.default(-1,h9e.default[o]);h.addData(u),h.make();var d=h.modules;return m9e.default.createElement(b9e.default,c9e({},f,{bgColor:i,bgD:d.map(function(g,b){return g.map(function(y,m){return y?"":"M "+m+" "+b+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:a,fgD:d.map(function(g,b){return g.map(function(y,m){return y?"M "+m+" "+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=y9e;var x9e=GC.default=WC,_9e="z8daqr0",S9e="z8daqr1",AG="z8daqr2",w9e="z8daqr3",E9e="z8daqr4";function M9e(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 T9e=typeof window<"u"?I.useLayoutEffect:I.useEffect;function gs(t,e){T9e(()=>{if(t)return window.addEventListener(t,e),()=>window.removeEventListener(t,e)},[t])}function A9e(t,e){t&&M9e(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 C9e(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 R9e(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 CG(t,e){const n=t.substring(e.length+1).split(".")[0];return parseInt(n,10)}function RG(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=CG(l,r);return Number.isNaN(c)?!1:c>=e}).forEach(([l,c])=>{const u=CG(l,r),f=l.replace(`${r}.${u}`,`${r}.${u+i}`);s[f]=c,o.add(f),o.has(l)||delete s[l]}),s}function k9e(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 kG(t,e,n){typeof n.value=="object"&&(n.value=o0(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function o0(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(o0(s))})):a==="[object Map]"?(r=new Map,t.forEach(function(s,o){r.set(o0(o),o0(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(o0(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++)kG(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]||kG(r,n,Object.getOwnPropertyDescriptor(t,n))}return r||t}function zte(t){return typeof t!="string"?[]:t.split(".")}function Ra(t,e){const n=zte(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 oS(t,e,n){const i=zte(t);if(i.length===0)return n;const r=o0(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 D9e(t,{from:e,to:n},i){const r=Ra(t,i);if(!Array.isArray(r))return i;const a=[...r],s=r[e];return a.splice(e,1),a.splice(n,0,s),oS(t,a,i)}function O9e(t,e,n,i){const r=Ra(t,i);if(!Array.isArray(r))return i;const a=[...r];return a.splice(typeof n=="number"?n:a.length,0,e),oS(t,a,i)}function I9e(t,e,n){const i=Ra(t,n);return Array.isArray(i)?oS(t,i.filter((r,a)=>a!==e),n):n}function N9e(t,e,n,i){const r=Ra(t,i);if(!Array.isArray(r)||r.length<=n)return i;const a=[...r];return a[n]=e,oS(t,a,i)}function L9e({$values:t,$errors:e,$status:n}){const i=I.useCallback((o,l)=>{n.clearFieldDirty(o),e.setErrors(c=>k9e(o,l,c)),t.setValues({values:D9e(o,l,t.refValues.current),updateState:!0})},[]),r=I.useCallback((o,l)=>{n.clearFieldDirty(o),e.setErrors(c=>RG(o,l,c,-1)),t.setValues({values:I9e(o,l,t.refValues.current),updateState:!0})},[]),a=I.useCallback((o,l,c)=>{n.clearFieldDirty(o),e.setErrors(u=>RG(o,c,u,1)),t.setValues({values:O9e(o,l,c,t.refValues.current),updateState:!0})},[]),s=I.useCallback((o,l,c)=>{n.clearFieldDirty(o),t.setValues({values:N9e(o,c,l,t.refValues.current),updateState:!0})},[]);return{reorderListItem:i,removeListItem:r,insertListItem:a,replaceListItem:s}}var P9e=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=Rc(P9e);function hx(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 U9e({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=>hx(C,S)===A?C:{...C,[S]:A})},[]),b=I.useCallback((S,A,C)=>{f(D=>hx(D,S)===A?D:{...D,[S]:A},C)},[]),y=I.useCallback((S,A)=>{const C=hx(c.current,S),D=!UE(Ra(S,i.getValuesSnapshot()),A),R=YI(S,c.current);R[S]=D,f(R,C!==D)},[]),m=I.useCallback(S=>hx(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=Ra(S,c.current);if(typeof C=="boolean")return C;const D=Ra(S,i.refValues.current),R=Ra(S,i.valuesSnapshot.current);return!UE(D,R)}return Object.keys(c.current).length>0?hx(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:m,setFieldTouched:g,setFieldDirty:b,setTouchedState:a,setDirtyState:o,clearFieldDirty:x,isDirty:_,getDirty:w,getTouched:M,setCalculatedFieldDirty:y}}function F9e({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:m,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),m?.filter(Boolean).forEach(A=>A({updatedValues:S,previousValues:w}))},[e]),c=I.useCallback(y=>{const m=Ra(y.path,s.current),x=y.value instanceof Function?y.value(m):y.value;if(m!==x){const _=s.current,w=oS(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,m)=>{i.current||(i.current=!0,l({values:y,updateState:n==="controlled"}),u(y),m())},[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,m)=>{const x=Ra(y,o.current);typeof x>"u"||c({path:y,value:x,updateState:n==="controlled",subscribers:m})},[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 B9e({$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:Ra(a,l.previousValues),value:Ra(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:Ra(o,c.previousValues),value:Ra(o,c.updatedValues),touched:t.isTouched(o),dirty:t.isDirty(o)})));return s},[]);return{subscribers:n,watch:i,getFieldSubscribers:r}}function DG(t,e){return t?`${t}-${e.toString()}`:e.toString()}const FE=Symbol("root-rule");function OG(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=Ra(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 OG(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 z9e="__MANTINE_FORM_INDEX__";function IG(t,e){return e?typeof e=="boolean"?e:Array.isArray(e)?e.includes(t.replace(/[.][0-9]+/g,`.${z9e}`)):!1:!1}function j9e({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=R9e(i),m=F9e({initialValues:n,onValuesChange:c,mode:e}),x=U9e({initialDirty:r,initialTouched:a,$values:m,mode:e}),_=L9e({$values:m,$errors:y,$status:x}),w=B9e({$status:x,cascadeUpdates:b}),[M,S]=I.useState(0),[A,C]=I.useState({}),[D,R]=I.useState(!1),L=I.useCallback(()=>{m.resetValues(),y.clearErrors(),x.resetDirty(),x.resetTouched(),e==="uncontrolled"&&S(ue=>ue+1)},[]),U=I.useCallback(ue=>{s&&y.clearErrors(),e==="uncontrolled"&&S(Se=>Se+1),Object.keys(w.subscribers.current).forEach(Se=>{const Oe=Ra(Se,m.refValues.current),Be=Ra(Se,ue);Oe!==Be&&w.getFieldSubscribers(Se).forEach(je=>je({previousValues:ue,updatedValues:m.refValues.current}))})},[s]),j=I.useCallback(ue=>{const Se=m.refValues.current;m.initialize(ue,()=>e==="uncontrolled"&&S(Oe=>Oe+1)),U(Se)},[U]),z=I.useCallback((ue,Se,Oe)=>{const Be=IG(ue,o),je=Se instanceof Function?Se(Ra(ue,m.refValues.current)):Se;x.setCalculatedFieldDirty(ue,je),g==="change"&&x.setFieldTouched(ue,!0),!Be&&s&&y.clearFieldError(ue),m.setFieldValue({path:ue,value:Se,updateState:e==="controlled",subscribers:[...w.getFieldSubscribers(ue),Be?He=>{const pe=BE(ue,h,He.updatedValues);pe.hasError?y.setFieldError(ue,pe.error):y.clearFieldError(ue)}:null,Oe?.forceUpdate!==!1&&e!=="controlled"?()=>C(He=>({...He,[ue]:(He[ue]||0)+1})):null]})},[c,h]),q=I.useCallback(ue=>{const Se=m.refValues.current;m.setValues({values:ue,updateState:e==="controlled"}),U(Se)},[c,U]),F=I.useCallback(()=>{const ue=$I(h,m.refValues.current);return y.setErrors(ue.errors),ue},[h]),V=I.useCallback(ue=>{const Se=BE(ue,h,m.refValues.current);return Se.hasError?y.setFieldError(ue,Se.error):y.clearFieldError(ue),Se},[h]),H=(ue,{type:Se="input",withError:Oe=!0,withFocus:Be=!0,...je}={})=>{const pe={onChange:C9e(ze=>z(ue,ze,{forceUpdate:!1})),"data-path":DG(t,ue)};return Oe&&(pe.error=y.errorsState[ue]),Se==="checkbox"?pe[e==="controlled"?"checked":"defaultChecked"]=Ra(ue,m.refValues.current):pe[e==="controlled"?"value":"defaultValue"]=Ra(ue,m.refValues.current),Be&&(pe.onFocus=()=>x.setFieldTouched(ue,!0),pe.onBlur=()=>{if(IG(ue,l)){const ze=BE(ue,h,m.refValues.current);ze.hasError?y.setFieldError(ue,ze.error):y.clearFieldError(ue)}}),Object.assign(pe,f?.({inputProps:pe,field:ue,options:{type:Se,withError:Oe,withFocus:Be,...je},form:le}))},W=(ue,Se)=>Oe=>{d==="always"&&Oe?.preventDefault();const Be=F();if(Be.hasErrors)d==="validation-failed"&&Oe?.preventDefault(),Se?.(Be.errors,m.refValues.current,Oe);else{const je=ue?.(u(m.refValues.current),Oe);je instanceof Promise&&(R(!0),je.finally(()=>R(!1)))}},B=ue=>u(ue||m.refValues.current),J=I.useCallback(ue=>{ue.preventDefault(),L()},[]),Z=I.useCallback(ue=>ue?!BE(ue,h,m.refValues.current).hasError:!$I(h,m.refValues.current).hasErrors,[h]),G=ue=>`${M}-${String(ue)}-${A[String(ue)]||0}`,de=I.useCallback(ue=>document.querySelector(`[data-path="${DG(t,ue)}"]`),[]),oe=I.useCallback(ue=>{m.resetField(ue,[e!=="controlled"?()=>C(Se=>({...Se,[ue]:(Se[ue]||0)+1})):null])},[m.resetField,e,C]),le={watch:w.watch,initialized:m.initialized.current,values:e==="uncontrolled"?m.refValues.current:m.stateValues,getValues:m.getValues,getInitialValues:m.getValuesSnapshot,setInitialValues:m.setValuesSnapshot,resetField:oe,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:L,validate:F,validateField:V,getInputProps:H,onSubmit:W,onReset:J,isValid:Z,getTransformedValues:B,key:G,getInputNode:de};return A9e(t,le),le}function H9e({nodeName:t,closePopoverFn:e}){const n=Ce.useContext(xi),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=j9e({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(ct,{className:S9e,component:"form",onSubmit:c.onSubmit(u),w:"15em",children:[k.jsxs(ct,{children:[k.jsxs(ct,{style:{display:"flex",alignItems:"center"},children:[k.jsxs(ct,{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(Pr,{label:"Close props",children:k.jsx(jAe,{style:{cursor:"pointer",width:"1em",height:"1em",display:"block",opacity:"0.7"},onClick:f=>{f.stopPropagation(),e()}})})]}),k.jsx(ct,{style:{opacity:"0.5"},fz:"xs",children:t})]}),k.jsx(Dc.Autosize,{mah:"30vh",scrollbarSize:6,offsetScrollbars:"present",type:"auto",children:k.jsx(ct,{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(bh,{align:"center",children:[k.jsx(ct,{style:{flexGrow:"1"},fz:"xs",children:f.charAt(0).toUpperCase()+f.slice(1).split("_").join(" ")}),k.jsx(bh,{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)},m=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(Uv,{size:"xs",styles:{input:{height:"1.625rem",minHeight:"1.625rem"}},style:{width:"100%"},value:y(g[0],g[1],g[2]),onChange:x=>{const _=m(x);c.setFieldValue(f,a(_)),c.onSubmit(u)()},onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),c.onSubmit(u)())}})}}catch{}return k.jsx(fg,{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(hAe,{style:{width:"1rem",height:"1rem",opacity:d?1:.3,cursor:d?"pointer":"default"},onClick:()=>{d&&c.onSubmit(u)()}})})})()})]},f)})})}),k.jsx(ct,{style:{opacity:"0.4",marginTop:"0.25rem"},fz:"xs",children:"Updates from the server will overwrite local changes."})]})}function V9e(){const e=Ce.useContext(xi).useSceneTree(n=>n[""].children,Z_);return k.jsx(Dc,{className:_9e,children:k.jsx(W9e,{children:k.jsx(G9e,{children:e.map(n=>k.jsx(q9e,{nodeName:n,indentCount:0},n))})})})}const jte=Ce.createContext(null),Hte=Ce.createContext(null);function G9e({children:t}){const e=Ce.useRef(!1),n=Ce.useRef(!1),i=a=>{e.current=!0,n.current=a},r=()=>{e.current=!1};return Ce.useEffect(()=>(window.addEventListener("mouseup",r),()=>{window.removeEventListener("mouseup",r)}),[r]),k.jsx(jte.Provider,{value:{paintingRef:e,paintValueRef:n,startPainting:i,stopPainting:r},children:t})}function W9e({children:t}){const[e,n]=Ce.useState(null);return k.jsx(Hte.Provider,{value:{openPopoverNodeName:e,setOpenPopoverNodeName:n},children:t})}const q9e=Ce.memo(function t(e){const n=Ce.useContext(xi),i=_a(),{colorScheme:r}=og(),{paintingRef:a,paintValueRef:s,startPainting:o}=Ce.useContext(jte),{openPopoverNodeName:l,setOpenPopoverNodeName:c}=Ce.useContext(Hte),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,Z_),d=(h?.length??0)>0,[g,{toggle:b}]=Ec(!1),y=C=>{n.sceneTreeActions.updateNodeAttributes(e.nodeName,{labelVisible:C})},m=n.useSceneTree(C=>C[e.nodeName]?.visibility)??!0,x=n.useSceneTree(C=>C[e.nodeName]?.overrideVisibility),_=x!==void 0?x:m,w=n.useSceneTree(C=>C[e.nodeName]?.effectiveVisibility)??!1;Ce.useEffect(()=>()=>{y(!1)},[]);const M=_?xAe:gAe,S=()=>{c(null)},A=()=>{l===e.nodeName?c(null):c(e.nodeName)};return k.jsxs(k.Fragment,{children:[k.jsxs(ct,{className:w9e,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(ct,{className:E9e},D)),k.jsx(ct,{style:{opacity:d?.7:.1},children:g?k.jsx(KTe,{style:{height:"1em",width:"1em",transform:"translateY(0.1em)"}}):k.jsx(JTe,{style:{height:"1em",width:"1em",transform:"translateY(0.1em)"}})}),k.jsx(ct,{style:{width:"1.5em",height:"1.5em"},children:k.jsx(Pr,{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(ct,{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(ct,{className:AG,style:{width:"1.25em",height:"1.25em",display:"block",transition:"opacity 0.2s",marginRight:"0.25em"},children:k.jsx(Pr,{label:"Clear visibility override",children:k.jsx(vAe,{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(Vo,{position:"bottom",withArrow:!0,shadow:"sm",arrowSize:10,opened:l===e.nodeName,onDismiss:S,middlewares:{flip:!0,shift:!0},withinPortal:!0,children:[k.jsx(Vo.Target,{children:k.jsx(ct,{className:AG,style:{width:"1.25em",height:"1.25em",display:"block",transition:"opacity 0.2s"},children:k.jsx(Pr,{label:"Local props",children:k.jsx(RAe,{style:{cursor:"pointer",width:"1.25em",height:"1.25em",display:"block"},onClick:C=>{C.stopPropagation(),A()}})})})}),k.jsx(Vo.Dropdown,{onMouseDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation(),children:k.jsx(H9e,{nodeName:e.nodeName,closePopoverFn:S})})]})]}),g?h?.map(C=>k.jsx(t,{nodeName:C,indentCount:e.indentCount+1},C)):null]})});function X9e({devSettingsStore:t}){const e=Ce.useContext(xi),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(Rm,{gap:"xs",children:[k.jsx(vd,{radius:"xs",label:"Dark Mode",checked:o,onChange:u=>l(u.currentTarget.checked),size:"xs"}),k.jsx(vd,{radius:"xs",label:"WebGL Stats",checked:n,onChange:u=>t.setState({showStats:u.currentTarget.checked}),size:"xs"}),k.jsx(vd,{radius:"xs",label:"Show Viser Logo",checked:i,onChange:u=>c(u.currentTarget.checked),size:"xs"}),k.jsx(Pr,{label:k.jsxs(k.Fragment,{children:["Log camera position and orientation to the",k.jsx("br",{}),"Javascript console."]}),refProp:"rootRef",children:k.jsx(vd,{radius:"xs",label:"Log Camera to Console",checked:a,onChange:u=>t.setState({logCamera:u.currentTarget.checked}),size:"xs"})}),k.jsx(Pr,{label:k.jsxs(k.Fragment,{children:["Show crosshair at look-at point",k.jsx("br",{}),"when moving camera."]}),refProp:"rootRef",children:k.jsx(vd,{radius:"xs",label:"Show Orbit Crosshair",checked:s,onChange:u=>t.setState({enableOrbitCrosshair:u.currentTarget.checked}),size:"xs"})}),k.jsx(Pr,{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(Bv,{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 K9e=Ce.memo(V9e);function Y9e(){const t=Ce.useContext(xi),e=t.mutable.current,n=t.useGui(a=>a.theme.control_width),[i,r]=Ce.useState(!1);return k.jsx(k.Fragment,{children:k.jsxs(Rm,{gap:"xs",mt:"0.3em",children:[k.jsx(Pr,{label:"Server URL",position:"top-start",children:k.jsx(fg,{leftSection:k.jsx(O_,{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(X0,{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(DAe,{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(EAe,{size:"1rem"}),px:"0",style:{height:"1.875rem"},children:"Reset View"})]}),k.jsxs(X0,{gap:"md",children:[k.jsx(Pr,{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(vh,{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(vh,{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(ct,{mt:"-0.4em",children:k.jsx(mh,{in:i,children:k.jsx(ct,{mt:"0.4em",children:k.jsx(X9e,{devSettingsStore:t.useDevSettings})})})}),k.jsx(lg,{}),k.jsxs(ct,{children:[k.jsx(Pr,{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(bu,{style:{fontWeight:500},fz:"sm",children:"Scene tree"})}),k.jsx(K9e,{})]})]})})}const qC=Ce.createContext(null);function gm({children:t}){const e=Ce.useRef(null),[n,{toggle:i}]=Ec(!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:Dc.Autosize,ref:e,children:k.jsx(ct,{style:{width:"20em"},children:t})})})})}gm.Handle=function({children:e}){const n=Ce.useContext(qC);return k.jsx(ct,{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})};gm.Contents=function({children:e}){const n=Ce.useContext(qC);return k.jsxs(mh,{in:n.expanded,children:[k.jsx(lg,{mx:"xs"}),e]})};gm.HideWhenCollapsed=function({children:e}){return Ce.useContext(qC)?.expanded??!0?e:null};const J9e={move:"touchmove",end:"touchend"},$9e={move:"mousemove",end:"mouseup"};function Z9e(t){return t.type==="touchmove"}function Q9e(t){return t.type==="mousemove"}const XC=Ce.createContext(null);function bm({children:t,width:e}){const n=Ce.useRef(null),[i,{toggle:r}]=Ec(!0),[a,s]=Ce.useState(800),o=Ce.useRef({dragging:!1,startPosX:0,startPosY:0,startClientX:0,startClientY:0}),l=Ce.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 m=d,x=g;return m=Math.min(m,y.clientWidth-b.clientWidth-u),m=Math.max(m,u),x=Math.min(x,y.clientHeight-b.clientHeight-u),x=Math.max(x,u),b.style.top=`${x.toString()}px`,b.style.left=`${m.toString()}px`,[c(m,b.clientWidth,y.clientWidth),c(x,b.clientHeight,y.clientHeight)]}Ce.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 m=l.current.x,x=l.current.y;for(;m<0;)m+=g.clientWidth;for(;x<0;)x+=g.clientHeight;f(m,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"?J9e:$9e;function m(x){let _=0,w=0;if(Z9e(x)?(x=x,_=x.touches[0].clientX-g.startClientX,w=x.touches[0].clientY-g.startClientY):Q9e(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,m),window.addEventListener(y.end,()=>{d.type=="touchstart"&&(g.dragging=!1),window.removeEventListener(y.move,m)},{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})})}bm.Handle=function({children:e}){const n=Ce.useContext(XC);return k.jsx(k.Fragment,{children:k.jsx(ct,{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})})};bm.Contents=function({children:e}){const n=Ce.useContext(XC);return k.jsxs(mh,{in:n.expanded,children:[k.jsx(lg,{mx:"xs"}),k.jsx(Dc.Autosize,{mah:n.maxHeight,children:k.jsx(ct,{style:{width:n.width},children:e})})]})};bm.HideWhenCollapsed=function({children:e}){return Ce.useContext(XC)?.expanded??!0?e:null};const Vte=Ce.createContext(null);function b1({children:t,collapsible:e,width:n}){const[i,{toggle:r}]=Ec(!1),a=k.jsx(ct,{style:s=>({position:"absolute",top:0,right:i?"0em":"-3em",transitionProperty:"right",transitionDuration:"0.5s",transitionDelay:"0.25s",borderBottomLeftRadius:"0.5em",backgroundColor:og().colorScheme=="dark"?s.colors.dark[5]:s.colors.gray[2],padding:"0.5em"}),children:k.jsx(Ol,{onClick:s=>{s.stopPropagation(),r()},children:k.jsx(Pr,{zIndex:100,label:"Show sidebar",children:k.jsx(tAe,{})})})});return k.jsxs(Vte.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(ct,{style:{width:n,height:"100%",display:"flex",flexDirection:"column"},children:t})})]})}b1.Handle=function({children:e}){const{toggleCollapsed:n,collapsible:i}=Ce.useContext(Vte),r=k.jsx(Ol,{onClick:a=>{a.stopPropagation(),n()},children:k.jsx(Pr,{zIndex:100,label:"Collapse sidebar",children:k.jsx(iAe,{stroke:1.625})})});return k.jsxs(k.Fragment,{children:[k.jsxs(ct,{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(lg,{mx:"xs"})]})};b1.Contents=function({children:e}){return k.jsx(Dc,{style:{flexGrow:1},children:e})};const eFe="root",tFe=Ce.memo(b4);function nFe(t){const e=_a(),n=uL(`(max-width: ${e.breakpoints.xs})`),i=Ce.useContext(xi),r=i.useGui(f=>Object.keys(f.guiUuidSetFromContainerUuid.root??{}).length>0),[a,{toggle:s}]=Ec(!1),o=i.useGui(f=>f.theme.control_width),l=o=="small"?"16em":o=="medium"?"20em":o=="large"?"24em":null,c=k.jsx(Ol,{onClick:f=>{f.stopPropagation(),s()},style:{display:r?void 0:"none",transform:"translateY(0.05em)"},children:k.jsx(Pr,{zIndex:100,label:a?"Return to GUI":"Configuration & diagnostics",withinPortal:!0,children:a?k.jsx(GTe,{stroke:1.625}):k.jsx(HTe,{stroke:1.625})})}),u=k.jsxs(k.Fragment,{children:[k.jsx(mh,{in:!r||a,children:k.jsx(ct,{p:"xs",pt:"0.375em",children:k.jsx(Y9e,{})})}),k.jsx(mh,{in:r&&!a,keepMounted:!0,children:k.jsx(tFe,{containerUuid:eFe})})]});return n?k.jsxs(gm,{children:[k.jsxs(gm.Handle,{children:[k.jsx(b8,{}),k.jsxs(gm.HideWhenCollapsed,{children:[k.jsx(v8,{}),c]})]}),k.jsx(gm.Contents,{children:u})]}):t.control_layout==="floating"?k.jsxs(bm,{width:l,children:[k.jsxs(bm.Handle,{children:[k.jsx(b8,{}),k.jsxs(bm.HideWhenCollapsed,{children:[k.jsx(v8,{}),c]})]}),k.jsx(bm.Contents,{children:u})]}):k.jsxs(b1,{width:l,collapsible:t.control_layout==="collapsible",children:[k.jsxs(b1.Handle,{children:[k.jsx(b8,{}),k.jsx(v8,{}),c]}),k.jsx(b1.Contents,{children:u})]})}function b8(){const{useGui:t}=Ce.useContext(xi),e=t(i=>i.websocketConnected),n=t(i=>i.label);return k.jsxs(k.Fragment,{children:[k.jsx("div",{style:{width:"1.1em"}})," ",k.jsx(Tc,{transition:"skew-down",mounted:e,children:i=>k.jsx(oAe,{color:"#0b0",style:{position:"absolute",width:"1.25em",height:"1.25em",...i}})}),k.jsx(Tc,{transition:"skew-down",mounted:!e,children:i=>k.jsx(Yd,{size:"xs",type:"dots",color:"red",style:{position:"absolute",...i}})}),k.jsx(ct,{px:"xs",style:{flexGrow:1,letterSpacing:"-0.5px"},pt:"0.1em",children:n!==""?n:e?"Connected":"Connecting..."})]})}function v8(){const t=Ce.useContext(xi),e=t.mutable.current,n=t.useGui(d=>d.websocketConnected),i=t.useGui(d=>d.shareUrl),r=t.useGui(d=>d.setShareUrl),[a,s]=Ce.useState(!1),[o,{open:l,close:c}]=Ec(!1),[u,{toggle:f}]=Ec();Ce.useEffect(()=>{i!==null&&s(!1)},[i]),Ce.useEffect(()=>{!n&&o&&c()},[n,o]);const h=og().colorScheme;return t.useGui(d=>d.theme).show_share_button===!1?null:k.jsxs(k.Fragment,{children:[k.jsx(Pr,{zIndex:100,label:n?"Share":"Share (needs connection)",withinPortal:!0,children:k.jsx(Ol,{onClick:d=>{d.stopPropagation(),l()},style:{transform:"translateY(0.05em)"},disabled:!n,children:k.jsx(BAe,{stroke:2,height:"1.125em",width:"1.125em"})})}),k.jsxs(Ro,{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(Rm,{mb:"xl",children:k.jsx(Yd,{size:"xl",mx:"auto",type:"dots"})}):k.jsxs(Rm,{mb:"md",children:[k.jsx(bu,{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(bu,{children:"Share URL is connected."}),k.jsxs(Rm,{gap:"xs",my:"md",children:[k.jsx(fg,{value:i}),k.jsxs(bh,{justify:"space-between",columnGap:"0.5em",align:"center",children:[k.jsx(gY,{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(uAe,{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(LAe,{}):k.jsx(UAe,{}),onClick:f,children:"QR Code"}),k.jsx(Pr,{zIndex:100,label:"Disconnect",withinPortal:!0,children:k.jsx(As,{color:"red",onClick:()=>{e.sendMessage({type:"ShareUrlDisconnect"}),r(null)},children:k.jsx(IAe,{})})})]}),k.jsx(mh,{in:u,children:k.jsx(x9e,{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(bu,{size:"xs",children:["Share links are experimental and bandwidth-limited. Problems? Consider"," ",k.jsx(Cm,{href:"https://github.com/nerfstudio-project/viser/issues",children:"reporting on GitHub"}),"."]})]})]})}var Hn,NG,l0,TT;(function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CIELab="CIELab",t.CMYK="CMYK"})(Hn||(Hn={})),function(t){t.ANALOGOUS="ANALOGOUS",t.COMPLEMENTARY="COMPLEMENTARY",t.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",t.TRIADIC="TRIADIC",t.TETRADIC="TETRADIC",t.SQUARE="SQUARE"}(NG||(NG={})),function(t){t.ADDITIVE="ADDITIVE",t.SUBTRACTIVE="SUBTRACTIVE"}(l0||(l0={})),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 Gte=Object.keys(TT),iFe={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:Hn.RGB,ABGR:Hn.RGB,HLS:Hn.HSL,AHLS:Hn.HSL,LAB:Hn.CIELab,ALAB:Hn.CIELab,CKMY:Hn.CMYK,ACKMY:Hn.CMYK};var LG;(function(t){t.NUMBER="number",t.BOOLEAN="boolean"})(LG||(LG={}));const Gb={[Hn.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,[Hn.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*\)$/,[Hn.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*\)$/,[Hn.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[Hn.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*\)$/},rFe=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,bg=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,QI=/^0x([a-f\d]{1,2})$/i,aFe=/\{(\d+)\}/g,sFe="The provided string color doesn't have a correct format",oFe="The provided color object doesn't have the proper keys or format";var bl,mu,eN;(function(t){t.NONE="none",t.DEGREES="deg",t.GRADIANS="grad",t.RADIANS="rad",t.TURNS="turn"})(bl||(bl={})),function(t){t.NONE="none",t.PERCENT="percent"}(mu||(mu={})),function(t){t.DEVICE_CMYK="device-cmyk",t.CMYK="cmyk"}(eN||(eN={}));bl.NONE,mu.NONE,mu.NONE,mu.PERCENT,mu.NONE,eN.DEVICE_CMYK;const _o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),lS=t=>+`${t}`.replace(bg,"$1"),Um=t=>bg.test(`${t}`)?lS(t):Math.min(+t,100),zE=t=>(t.length===1&&(t+=t),parseInt(t,16)),jE=t=>{const e=wn(t,0).toString(16).toUpperCase();return e.length===1?`0x0${e}`:`0x${e}`},vm=(t,e=!1)=>!e&&bg.test(t)?Math.min(255*lS(t)/100,255):QI.test(t)?(t.length===3&&(t+=t.slice(-1)),e?wn(t)/255:wn(t)):Math.min(+t,e?1:255),AT=t=>bg.test(t)?D0(125*lS(t)/100,-125,125):D0(+t,-125,125),Td=t=>Math.min(bg.test(t)?lS(t)/100:+t,1),Wte=t=>[...t].sort().join("").toUpperCase(),wn=(t,e=6)=>{const n=Math.pow(10,e);return Math.round(+t*n)/n},D0=(t,e,n)=>Math.max(e,Math.min(t,n)),qte=t=>{if(typeof t=="string"){const e=t.match(rFe),n=+e[1];switch(e[2]){case bl.RADIANS:t=wn(180*n/Math.PI);break;case bl.TURNS:t=wn(360*n);break;case bl.GRADIANS:t=wn(.9*n);break;case bl.DEGREES:default:t=n}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},lFe=(t,e)=>{let n;switch(e){case bl.RADIANS:n=wn((i=>i*Math.PI/180)(t));break;case bl.TURNS:n=wn(t/360);break;case bl.GRADIANS:n=wn(10/9*t);break;case bl.DEGREES:case bl.NONE:default:n=t}return n},Xte=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],cFe=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],O0=Xte.map(t=>t.reduce((e,n)=>e+n,0)),y8=(t,e,n)=>(n<0&&(n+=6),n>=6&&(n-=6),wn(n<1?255*((e-t)*n+t):n<3?255*e:n<4?255*((e-t)*(4-n)+t):255*t)),uFe=t=>t<=.04045?t/12.92:((t+.055)/1.055)**2.4,fFe=t=>t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055,Kte=(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},hd=(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=wn(60*o),o<0&&(o+=360),l=s/(1-Math.abs(2*c-1))}return{H:o,S:wn(100*l),L:wn(100*c),A:i}},CT=(t,e,n)=>{const i=[t/255,e/255,n/255].map(uFe),r=Kte(i[0],i[1],i[2],Xte),a=((s,o,l)=>{const c=h=>h>.008856451679035631?Math.cbrt(h):h/.12841854934601665+.13793103448275862,u=c(s/O0[0]),f=c(o/O0[1]);return[116*f-16,500*(u-f),200*(f-c(l/O0[2]))]})(r[0],r[1],r[2]);return{L:a[0],a:a[1],b:a[2]}},Yte=(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[O0[0]*l(c+u),O0[1]*l(c),O0[2]*l(c-f)]})(t,e,n),r=Kte(i[0],i[1],i[2],cFe).map(fFe);return{R:D0(255*r[0],0,255),G:D0(255*r[1],0,255),B:D0(255*r[2],0,255)}},Jte=(t,e,n,i)=>({R:wn(255*(1-t)*(i=1-i)),G:wn(255*(1-e)*i),B:wn(255*(1-n)*i)}),hFe=(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:wn(100*(r&&(r-t)/r)),M:wn(100*a),Y:wn(100*s),K:wn(100*i)}},x8=t=>t?", ":",",dx=(t,e)=>{const n=Wte(Object.keys(t));return iFe[ZI[n]].reduce((i,r,a)=>{const s=t[r];return s!==void 0&&i.push(e(s,a)),i},[])},px=(t,e)=>t.replace(aFe,(n,i)=>`${e[+i-1]}`),HE=(t,e,n=!1)=>{const{alphaUnit:i,legacyCSS:r,decimals:a}=e;return i!==mu.PERCENT||r&&!n?wn(t,a):`${wn(100*t,a)}%`},rc={[Hn.HEX]:t=>{const e=dx(t,i=>(r=>{let a=wn(r,0).toString(16).toUpperCase();return a.length===1&&(a=`0${a}`),a})(wn(i))),n=e.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return px(n,e)},[Hn.RGB]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,rgbUnit:a}=e,s=x8(r),o=dx(t,(c,u)=>a===mu.PERCENT&&u<3?`${((f,h)=>wn(f/255*100,h))(c,n)}%`:u===3?HE(c,e):wn(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 px(l,o)},[Hn.HSL]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,anglesUnit:a}=e,s=x8(r),o=dx(t,(c,u)=>u===0&&a!==bl.NONE?`${wn(lFe(c,a),n)}${a}`:u===3?HE(c,e):wn(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 px(l,o)},[Hn.CIELab]:(t,e)=>{const{decimals:n,labUnit:i}=e,r=dx(t,(s,o)=>{if(o===0){const l=wn(Um(s),n);return i===mu.PERCENT?`${l}%`:`${l}`}return o<3?i===mu.PERCENT?`${((l,c)=>wn(l/125*100,c))(s,n)}%`:wn(s,n):HE(s,e,!0)}),a=r.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return px(a,r)},[Hn.CMYK]:(t,e)=>{const{decimals:n,legacyCSS:i,spacesAfterCommas:r,cmykUnit:a,cmykFunction:s}=e,o=x8(r),l=dx(t,(u,f)=>a===mu.PERCENT&&f<4?`${wn(u,n)}%`:f===4?HE(u,e):wn(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 px(c,l)}},th=t=>(typeof t=="string"&&(t=bg.test(t)?lS(t)/100:+t),isNaN(+t)||t>1?1:wn(t)),$te=t=>typeof t=="string"?(e=>{let n;if(Object.keys(Hn).some(i=>{if(Gb[i].test(e))return n=i,!0}),!n&&~Gte.indexOf(e)&&(n=Hn.HEX),!n)throw new Error(sFe);return n})(t):(e=>{let n,i=!1;const r=Wte(Object.keys(e));if(ZI[r]&&(n=ZI[r]),n&&n===Hn.RGB){const a=Object.entries(e).some(o=>!QI.test(`${o[1]}`)),s=Object.entries(e).some(o=>!(bg.test(`${o[1]}`)||!QI.test(`${o[1]}`)&&!isNaN(+o[1])&&+o[1]<=255));a&&s&&(i=!0),a||(n=Hn.HEX)}if(!n||i)throw new Error(oFe);return n})(t),dFe={[Hn.HEX](t){const e=(~Gte.indexOf(t)?TT[t]:t).match(Gb.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},[Hn.RGB](t){const e=t.match(Gb.RGB),n=vm(e[1]||e[5]),i=vm(e[2]||e[6]),r=vm(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=th(a)),s},[Hn.HSL](t){const e=t.match(Gb.HSL),n=qte(e[1]||e[5]),i=Um(e[2]||e[6]),r=Um(e[3]||e[7]),a=e[4]||e[8],s=hd(n,i,r);return a!==void 0&&(s.A=th(a)),s},[Hn.CIELab](t){const e=t.match(Gb.CIELab),n=Um(e[1]),i=AT(e[2]),r=AT(e[3]),a=e[4],s=Yte(n,i,r);return a!==void 0&&(s.A=th(a)),s},[Hn.CMYK](t){const e=t.match(Gb.CMYK),n=Td(e[1]||e[6]),i=Td(e[2]||e[7]),r=Td(e[3]||e[8]),a=Td(e[4]||e[9]),s=e[5]||e[10],o=Jte(n,i,r,a);return s!==void 0&&(o.A=th(s)),o}},pFe={[Hn.HEX](t){const e={R:vm(`${t.R}`),G:vm(`${t.G}`),B:vm(`${t.B}`)};return _o(t,"A")&&(e.A=Math.min(vm(`${t.A}`,!0),1)),e},[Hn.RGB](t){return this.HEX(t)},[Hn.HSL](t){const e=Um(`${t.S}`),n=Um(`${t.L}`),i=hd(qte(t.H),e,n);return _o(t,"A")&&(i.A=th(t.A)),i},[Hn.CIELab](t){const e=Um(`${t.L}`),n=AT(`${t.a}`),i=AT(`${t.b}`),r=Yte(e,n,i);return _o(t,"A")&&(r.A=th(t.A)),r},[Hn.CMYK](t){const e=Td(`${t.C}`),n=Td(`${t.M}`),i=Td(`${t.Y}`),r=Td(`${t.K}`),a=Jte(e,n,i,r);return _o(t,"A")&&(a.A=th(t.A)),a}},mFe=(t,e=$te(t))=>typeof t=="string"?dFe[e](t):pFe[e](t),ws={[Hn.HEX]:t=>({R:jE(t.R),G:jE(t.G),B:jE(t.B)}),HEXA(t){const e=ws.HEX(t);return e.A=_o(t,"A")?jE(255*t.A):"0xFF",e},[Hn.RGB](t,e){const n=gFe(t,e);return _o(n,"A")&&delete n.A,n},RGBA(t,e){const n=ws.RGB(t,e);return n.A=_o(t,"A")?wn(t.A):1,n},[Hn.HSL](t,e){const n=tN(t.R,t.G,t.B);return delete n.A,bFe(n,e)},HSLA(t,e){const n=ws.HSL(t,e);return n.A=_o(t,"A")?wn(t.A,e):1,n},[Hn.CIELab](t,e){const n=CT(t.R,t.G,t.B);return vFe(n,e)},CIELabA(t,e){const n=ws.CIELab(t,e);return n.A=_o(t,"A")?wn(t.A,e):1,n},[Hn.CMYK]:(t,e)=>yFe(hFe(t.R,t.G,t.B),e),CMYKA(t,e){const n=ws.CMYK(t,e);return n.A=_o(t,"A")?wn(t.A,e):1,n}};Hn.HEX+"",Hn.RGB+"",Hn.HSL+"",Hn.CIELab+"";Hn.HEX+"",Hn.RGB+"",Hn.HSL+"",Hn.CIELab+"";const gFe=(t,e)=>({R:wn(t.R,e),G:wn(t.G,e),B:wn(t.B,e),..._o(t,"A")?{A:wn(t.A,e)}:{}}),bFe=(t,e)=>({H:wn(t.H,e),S:wn(t.S,e),L:wn(t.L,e),..._o(t,"A")?{A:wn(t.A,e)}:{}}),vFe=(t,e)=>({L:wn(t.L,e),a:wn(t.a,e),b:wn(t.b,e)}),yFe=(t,e)=>({C:wn(t.C,e),M:wn(t.M,e),Y:wn(t.Y,e),K:wn(t.K,e)});var Zte=Symbol.for("immer-nothing"),PG=Symbol.for("immer-draftable"),cr=Symbol.for("immer-state");function pc(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var xv=Object.getPrototypeOf;function _v(t){return!!t&&!!t[cr]}function xh(t){return t?Qte(t)||Array.isArray(t)||!!t[PG]||!!t.constructor?.[PG]||YC(t)||JC(t):!1}var xFe=Object.prototype.constructor.toString();function Qte(t){if(!t||typeof t!="object")return!1;const e=xv(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)===xFe}function r_(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[cr];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 ene(t,e,n){const i=KC(t);i===2?t.set(e,n):i===3?t.add(n):t[e]=n}function _Fe(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 Qa(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=Qte(t);if(e===!0||e==="class_only"&&!n){const i=Object.getOwnPropertyDescriptors(t);delete i[cr];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(xv(t),i)}else{const i=xv(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)||_v(t)||!xh(t)||(KC(t)>1&&(t.set=t.add=t.clear=t.delete=SFe),Object.freeze(t),e&&Object.entries(t).forEach(([n,i])=>S4(i,!0))),t}function SFe(){pc(2)}function $C(t){return Object.isFrozen(t)}var rN={};function eg(t){const e=rN[t];return e||pc(0,t),e}function wFe(t,e){rN[t]||(rN[t]=e)}var a_;function RT(){return a_}function EFe(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function UG(t,e){e&&(eg("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function aN(t){sN(t),t.drafts_.forEach(MFe),t.drafts_=null}function sN(t){t===a_&&(a_=t.parent_)}function FG(t){return a_=EFe(a_,t)}function MFe(t){const e=t[cr];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function BG(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];return t!==void 0&&t!==n?(n[cr].modified_&&(aN(e),pc(4)),xh(t)&&(t=kT(e,t),e.parent_||DT(e,t)),e.patches_&&eg("Patches").generateReplacementPatches_(n[cr].base_,t,e.patches_,e.inversePatches_)):t=kT(e,n,[]),aN(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==Zte?t:void 0}function kT(t,e,n){if($C(e))return e;const i=e[cr];if(!i)return r_(e,(r,a)=>zG(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),r_(a,(o,l)=>zG(t,i,r,o,l,n,s)),DT(t,r,!1),n&&t.patches_&&eg("Patches").generatePatches_(i,n,t.patches_,t.inversePatches_)}return i.copy_}function zG(t,e,n,i,r,a,s){if(_v(r)){const o=a&&e&&e.type_!==3&&!nN(e.assigned_,i)?a.concat(i):void 0,l=kT(t,r,o);if(ene(n,i,l),_v(l))t.canAutoFreeze_=!1;else return}else s&&n.add(r);if(xh(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 TFe(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=s_);const{revoke:s,proxy:o}=Proxy.revocable(r,a);return i.draft_=o,i.revoke_=s,o}var w4={get(t,e){if(e===cr)return t;const n=Qa(t);if(!nN(n,e))return AFe(t,n,e);const i=n[e];return t.finalized_||!xh(i)?i:i===_8(t.base_,e)?(S8(t),t.copy_[e]=o_(i,t)):i},has(t,e){return e in Qa(t)},ownKeys(t){return Reflect.ownKeys(Qa(t))},set(t,e,n){const i=tne(Qa(t),e);if(i?.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const r=_8(Qa(t),e),a=r?.[cr];if(a&&a.base_===n)return t.copy_[e]=n,t.assigned_[e]=!1,!0;if(_Fe(n,r)&&(n!==void 0||nN(t.base_,e)))return!0;S8(t),Vf(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),Vf(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=Qa(t),i=Reflect.getOwnPropertyDescriptor(n,e);return i&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:i.enumerable,value:n[e]}},defineProperty(){pc(11)},getPrototypeOf(t){return xv(t.base_)},setPrototypeOf(){pc(12)}},s_={};r_(w4,(t,e)=>{s_[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});s_.deleteProperty=function(t,e){return s_.set.call(this,t,e,void 0)};s_.set=function(t,e,n){return w4.set.call(this,t[0],e,n,t[0])};function _8(t,e){const n=t[cr];return(n?Qa(n):t)[e]}function AFe(t,e,n){const i=tne(e,n);return i?"value"in i?i.value:i.get?.call(t.draft_):void 0}function tne(t,e){if(!(e in t))return;let n=xv(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=xv(n)}}function Vf(t){t.modified_||(t.modified_=!0,t.parent_&&Vf(t.parent_))}function S8(t){t.copy_||(t.copy_=iN(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var CFe=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"&&pc(6),i!==void 0&&typeof i!="function"&&pc(7);let r;if(xh(e)){const a=FG(this),s=o_(e,void 0);let o=!0;try{r=n(s),o=!1}finally{o?aN(a):sN(a)}return UG(a,i),BG(r,a)}else if(!e||typeof e!="object"){if(r=n(e),r===void 0&&(r=e),r===Zte&&(r=void 0),this.autoFreeze_&&S4(r,!0),i){const a=[],s=[];eg("Patches").generateReplacementPatches_(e,r,a,s),i(a,s)}return r}else pc(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){xh(t)||pc(8),_v(t)&&(t=RFe(t));const e=FG(this),n=o_(t,void 0);return n[cr].isManual_=!0,sN(e),n}finishDraft(t,e){const n=t&&t[cr];(!n||!n.isManual_)&&pc(9);const{scope_:i}=n;return UG(i,e),BG(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=eg("Patches").applyPatches_;return _v(t)?i(t,e):this.produce(t,r=>i(r,e))}};function o_(t,e){const n=YC(t)?eg("MapSet").proxyMap_(t,e):JC(t)?eg("MapSet").proxySet_(t,e):TFe(t,e);return(e?e.scope_:RT()).drafts_.push(n),n}function RFe(t){return _v(t)||pc(10,t),nne(t)}function nne(t){if(!xh(t)||$C(t))return t;const e=t[cr];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 r_(n,(i,r)=>{ene(n,i,nne(r))}),e&&(e.finalized_=!1),n}function kFe(){class t extends Map{constructor(l,c){super(),this[cr]={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 Qa(this[cr]).size}has(l){return Qa(this[cr]).has(l)}set(l,c){const u=this[cr];return s(u),(!Qa(u).has(l)||Qa(u).get(l)!==c)&&(n(u),Vf(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[cr];return s(c),n(c),Vf(c),c.base_.has(l)?c.assigned_.set(l,!1):c.assigned_.delete(l),c.copy_.delete(l),!0}clear(){const l=this[cr];s(l),Qa(l).size&&(n(l),Vf(l),l.assigned_=new Map,r_(l.base_,c=>{l.assigned_.set(c,!1)}),l.copy_.clear())}forEach(l,c){const u=this[cr];Qa(u).forEach((f,h,d)=>{l.call(c,this.get(h),h,this)})}get(l){const c=this[cr];s(c);const u=Qa(c).get(l);if(c.finalized_||!xh(u)||u!==c.base_.get(l))return u;const f=o_(u,c);return n(c),c.copy_.set(l,f),f}keys(){return Qa(this[cr]).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[cr]={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 Qa(this[cr]).size}has(l){const c=this[cr];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[cr];return s(c),this.has(l)||(a(c),Vf(c),c.copy_.add(l)),this}delete(l){if(!this.has(l))return!1;const c=this[cr];return s(c),a(c),Vf(c),c.copy_.delete(l)||(c.drafts_.has(l)?c.copy_.delete(c.drafts_.get(l)):!1)}clear(){const l=this[cr];s(l),Qa(l).size&&(a(l),Vf(l),l.copy_.clear())}values(){const l=this[cr];return s(l),a(l),l.copy_.values()}entries(){const l=this[cr];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(xh(l)){const c=o_(l,o);o.drafts_.set(l,c),o.copy_.add(c)}else o.copy_.add(l)}))}function s(o){o.revoked_&&pc(3,JSON.stringify(Qa(o)))}wFe("MapSet",{proxyMap_:e,proxySet_:r})}var kl=new CFe,DFe=kl.produce;kl.produceWithPatches.bind(kl);kl.setAutoFreeze.bind(kl);kl.setUseStrictShallowCopy.bind(kl);kl.applyPatches.bind(kl);kl.createDraft.bind(kl);kl.finishDraft.bind(kl);const OFe=t=>(e,n,i)=>(i.setState=(r,a,...s)=>{const o=typeof r=="function"?DFe(r):r;return e(o,a,...s)},t(i.setState,n,i)),IFe=OFe,NFe=new URLSearchParams(window.location.search),LFe=NFe.get("hideViserLogo")!==null,Gp={theme:{type:"ThemeConfigurationMessage",titlebar_content:null,control_layout:"floating",control_width:"medium",dark_mode:!1,show_logo:!LFe,show_share_button:!0,colors:null},label:"",server:"ws://localhost:8080",shareUrl:null,websocketConnected:!1,backgroundAvailable:!1,showOrbitOriginTool:!1,guiUuidSetFromContainerUuid:{root:{}},modals:[],guiOrderFromUuid:{},guiConfigFromUuid:{},uploadsInProgress:{}};function PFe(t){return Ce.useState(()=>J_(IFe(e=>({...Gp,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=Gp.shareUrl,n.guiUuidSetFromContainerUuid=Gp.guiUuidSetFromContainerUuid,n.modals=Gp.modals,n.guiOrderFromUuid=Gp.guiOrderFromUuid,n.guiConfigFromUuid=Gp.guiConfigFromUuid,n.uploadsInProgress=Gp.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 UFe(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 FFe(t){return new Worker("/assets/WebsocketServerWorker-C9fS7jGc.js",{type:"module",name:t?.name})}var jG=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))},BFe=function(){function t(e,n,i){this.name=e,this.version=n,this.os=i,this.type="browser"}return t}(),zFe=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),jFe=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}(),HFe=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),VFe=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),GFe=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,WFe=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,HG=3,qFe=[["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",GFe]],VG=[["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 ine(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new VFe:typeof navigator<"u"?KFe(navigator.userAgent):JFe()}function XFe(t){return t!==""&&qFe.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 KFe(t){var e=XFe(t);if(!e)return null;var n=e[0],i=e[1];if(n==="searchbot")return new HFe;var r=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);r?r.length<HG&&(r=jG(jG([],r,!0),$Fe(HG-r.length),!0)):r=[];var a=r.join("."),s=YFe(t),o=WFe.exec(t);return o&&o[1]?new jFe(n,a,s,o[1]):new BFe(n,a,s)}function YFe(t){for(var e=0,n=VG.length;e<n;e++){var i=VG[e],r=i[0],a=i[1],s=a.exec(t);if(s)return r}return null}function JFe(){var t=typeof process<"u"&&process.version;return t?new zFe(process.version.slice(1)):null}function $Fe(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}function ZFe(){const t=I.useContext(xi),e=t.mutable.current,n=t.useGui(o=>o.server),i=t.useGui(o=>o.websocketConnected),r=Ce.useRef(!1),a=Ce.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=ine(),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 QFe(){const t=I.useContext(xi),e=t.mutable.current,n=t.useGui(a=>a.server),i=t.useGui(a=>a.resetGui),r=t.sceneTreeActions.resetScene;return ZFe(),UFe(n),Ce.useEffect(()=>{const a=new FFe;a.onmessage=o=>{const l=o.data;l.type==="connected"?(i(),r(),t.useGui.setState({websocketConnected:!0}),e.sendMessage=c=>{s({type:"send",message:c})}):l.type==="closed"?(i(),t.useGui.setState({websocketConnected:!1}),e.sendMessage=c=>{console.log(`Tried to send ${c.type} but websocket is not connected!`)},l.versionMismatch&&ks.show({id:"version-mismatch",title:"Connection rejected",message:`${l.closeReason}.`,color:"red",autoClose:5e3,withCloseButton:!0})):l.type==="message_batch"&&e.messageQueue.push(...l.messages)};function s(o){a.postMessage(o)}return s({type:"set_server",server:n}),()=>{s({type:"close"}),e.sendMessage=o=>console.log(`Tried to send ${o.type} but websocket is not connected!`),t.useGui.setState({websocketConnected:!1})}},[n,i,r]),null}function eBe(t){throw new Error("Didn't expect to get here",t)}function rne(t){let e=null;switch(t){case null:break;case"GitHub":e=qTe;break;case"Description":e=SAe;break;case"Keyboard":e=TAe;break;default:eBe(t)}return e}function tBe(t){const e=rne(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 nBe(t){const e=rne(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 iBe(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 rBe(){const e=I.useContext(xi).useGui(o=>o.theme.titlebar_content),n=og().colorScheme,[i,r]=Ec(!1);if(e==null)return null;const a=e.buttons,s=e.image;return k.jsx(ct,{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(X0,{style:()=>({marginRight:"auto"}),children:s!==null?iBe(s,n):null}),k.jsx(X0,{display:{base:"none",xs:"flex"},style:()=>({flexWrap:"nowrap",overflowX:"scroll",msOverflowStyle:"none",scrollbarWidth:"none"}),children:a?.map((o,l)=>I.createElement(tBe,{...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(nBe,{...o,key:l}))})})]})})}function aBe(){return I.useContext(xi).useGui(i=>i.modals,Z_).map((i,r)=>k.jsx(sBe,{conf:i,index:r},i.uuid))}function sBe({conf:t,index:e}){return k.jsx(Ro,{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 qn().setFromEuler(new vi(Math.PI/2,Math.PI,-Math.PI/2));return[t.w,t.x,t.y,t.z]})()},ane={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 oBe(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":ane},!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 m=r[y];if(!m)return;const x=m.overrideVisibility??m.visibility??!0,_=g&&x;f[y]={...m,effectiveVisibility:_},h(y,_)})}h(i,u),t.setState(f)}};return n}function lBe(t){return Ce.useState(()=>{const e=J_(()=>({"":E4,"/WorldAxes":ane})),n=oBe(e,t);return{store:e,actions:n}})[0]}function cBe(){return Ce.useState(()=>J_(()=>({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 uBe(){return Ce.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 J_(()=>({showStats:e,fixedDpr:i,logCamera:r,enableOrbitCrosshair:!0}))})[0]}function mx(t,e,n){return Object.keys(t[e]).reduce((i,r)=>(i[r]=`var(--mantine-${n}-${r})`,i),{})}function GG(t,e){return t in e.breakpoints?e.breakpoints[t]:EO(t)}function fBe(t){const e=EX(aA,t),n=mx(e,"fontSizes","font-size"),i=mx(e,"lineHeights","line-height"),r=mx(e,"shadows","shadow"),a=mx(e,"radius","radius"),s=mx(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: ${GG(c,e)})`,largerThan:c=>`(min-width: ${GG(c,e)})`}}const sne={fontFamily:"Inter",autoContrast:!0,components:{Checkbox:vh.extend({defaultProps:{radius:"xs"}}),ColorInput:Uv.extend({defaultProps:{radius:"xs"}}),Select:Bv.extend({defaultProps:{radius:"sm"}}),Textarea:yA.extend({defaultProps:{radius:"xs"}}),TextInput:fg.extend({defaultProps:{radius:"xs"}}),NumberInput:cg.extend({defaultProps:{radius:"xs"}}),Paper:Ns.extend({defaultProps:{radius:"xs",shadow:"0"}}),ActionIcon:Ol.extend({defaultProps:{variant:"subtle",color:"gray",radius:"xs"}}),Button:As.extend({defaultProps:{radius:"xs",styles:{label:{fontWeight:450}}}})}};fBe(sne);const hBe=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 dBe(t){return hBe.has(t.type)}const pBe=new Set(["GuiFolderMessage","GuiMarkdownMessage","GuiHtmlMessage","GuiProgressBarMessage","GuiPlotlyMessage","GuiUplotMessage","GuiImageMessage","GuiTabGroupMessage","GuiButtonMessage","GuiUploadButtonMessage","GuiSliderMessage","GuiMultiSliderMessage","GuiNumberMessage","GuiRgbMessage","GuiRgbaMessage","GuiCheckboxMessage","GuiVector2Message","GuiVector3Message","GuiTextMessage","GuiDropdownMessage","GuiButtonGroupMessage"]);function mBe(t){return pBe.has(t.type)}function gBe(){const t=I.useContext(xi),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],m=t.useSceneTree.getState(),x=b.name.split("/").slice(0,-1).join("/");m[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=bBe();return b=>{if(mBe(b)){o(b);return}if(dBe(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)),m=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:[m[3*x],m[3*x+1],m[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.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,m=Zf(t),x=new te(b.look_at[0],b.look_at[1],b.look_at[2]);x.applyMatrix4(m),y.setTarget(x.x,x.y,x.z,!1);return}case"SetCameraUpDirectionMessage":{const y=e.camera,m=e.cameraControl,x=Zf(t),_=new te(b.position[0],b.position[1],b.position[2]).normalize().applyQuaternion(new qn().setFromRotationMatrix(x));y.up.set(_.x,_.y,_.z);const w=new te;m.getPosition(w),m.updateCameraUp(),m.setPosition(w.x,w.y,w.z,!1);return}case"SetCameraPositionMessage":{const y=e.cameraControl,m=new te(b.position[0],b.position[1],b.position[2]),x=Zf(t);m.applyMatrix4(x),y.setPosition(m.x,m.y,m.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],m=y?.poseUpdateState!=="waitForMakeObject"?"needsUpdate":y?.poseUpdateState||"needsUpdate";return{targetNode:b.name,updates:{wxyz:b.wxyz,poseUpdateState:m}}}case"SetPositionMessage":{const y=t.useSceneTree.getState()[b.name],m=y?.poseUpdateState!=="waitForMakeObject"?"needsUpdate":y?.poseUpdateState||"needsUpdate";return{targetNode:b.name,updates:{position:b.position,poseUpdateState:m}}}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 fv().load(y,m=>{URL.revokeObjectURL(y);const x=e.backgroundMaterial.uniforms.colorMap.value;e.backgroundMaterial.uniforms.colorMap.value=m,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 fv().load(y,m=>{URL.revokeObjectURL(y);const x=e.backgroundMaterial?.uniforms.depthMap.value;e.backgroundMaterial.uniforms.depthMap.value=m,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 bBe(){const t=Ce.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(uf,{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(pAe,{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 vBe(){const t=gBe(),e=I.useContext(xi),n=e.mutable.current,i=n.messageQueue,r=Ce.useContext(eS),a=ki(s=>s.gl);return oa(()=>{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=Zf(e),h=new ra(yc.radToDeg(l),c/u,.01,1e3);h.position.set(...s).applyMatrix4(f),h.setRotationFromQuaternion(new qn(o[1],o[2],o[3],o[0]).premultiply(new qn().setFromRotationMatrix(f)).multiply(new qn().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),m=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(m),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 yBe=4096;function one(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>=yBe&&(s+=String.fromCharCode(...a),a.length=0)}return a.length>0&&(s+=String.fromCharCode(...a)),s}const xBe=new TextDecoder,_Be=200;function SBe(t,e,n){const i=t.subarray(e,e+n);return xBe.decode(i)}function wBe(t,e,n){return n>_Be?SBe(t,e,n):one(t,e,n)}class VE{constructor(e,n){this.type=e,this.data=n}}class ml extends Error{constructor(e){super(e);const n=Object.create(ml.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:ml.name})}}const gx=4294967295;function EBe(t,e,n){const i=Math.floor(n/4294967296),r=n;t.setUint32(e,i),t.setUint32(e+4,r)}function lne(t,e){const n=t.getInt32(e),i=t.getUint32(e+4);return n*4294967296+i}function MBe(t,e){const n=t.getUint32(e),i=t.getUint32(e+4);return n*4294967296+i}const TBe=-1,ABe=4294967296-1,CBe=17179869184-1;function RBe({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=CBe)if(e===0&&t<=ABe){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),EBe(i,4,t),n}}function kBe(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 DBe(t){if(t instanceof Date){const e=kBe(t);return RBe(e)}else return null}function OBe(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=lne(e,4),i=e.getUint32(0);return{sec:n,nsec:i}}default:throw new ml(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function IBe(t){const e=OBe(t);return new Date(e.sec*1e3+e.nsec/1e6)}const NBe={type:TBe,encode:DBe,decode:IBe};class oN{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(NBe)}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 LBe(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function WG(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):LBe(t)?new Uint8Array(t):Uint8Array.from(t)}function w8(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const PBe=16,UBe=16;class FBe{constructor(e=PBe,n=UBe){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=one(e,n,i),s=Uint8Array.prototype.slice.call(e,n,n+i);return this.store(s,a),a}}const lN="array",v1="map_key",cne="map_value",BBe=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new ml("The type of key must be string or number but "+typeof t)};class zBe{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=v1,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===v1||e.type===cne){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 bx=-1,M4=new DataView(new ArrayBuffer(0)),jBe=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 qG=new RangeError("Insufficient data"),HBe=new FBe;class ZC{constructor(e){this.totalPos=0,this.pos=0,this.view=M4,this.bytes=jBe,this.headByte=bx,this.stack=new zBe,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??gx,this.maxBinLength=e?.maxBinLength??gx,this.maxArrayLength=e?.maxArrayLength??gx,this.maxMapLength=e?.maxMapLength??gx,this.maxExtLength=e?.maxExtLength??gx,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:HBe,this.mapKeyConverter=e?.mapKeyConverter??BBe}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=bx,this.stack.reset()}setBuffer(e){const n=WG(e);this.bytes=n,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===bx&&!this.hasRemaining(1))this.setBuffer(e);else{const n=this.bytes.subarray(this.pos),i=WG(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 ml(`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===v1){if(n==="__proto__")throw new ml("The key __proto__ is not allowed");r.key=this.mapKeyConverter(n),r.type=cne;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=v1;continue e}}return n}}readHeadByte(){return this.headByte===bx&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=bx}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 ml(`Unrecognized array type byte: ${w8(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new ml(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new ml(`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 ml(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+n+e)throw qG;const i=this.pos+n;let r;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?r=this.keyDecoder.decode(this.bytes,i,e):r=wBe(this.bytes,i,e),this.pos+=n+e,r}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===v1:!1}decodeBinary(e,n){if(e>this.maxBinLength)throw new ml(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+n))throw qG;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 ml(`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=MBe(this.view,this.pos);return this.pos+=8,e}readI64(){const e=lne(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 VBe(t,e){return new ZC(e).decode(t)}function GBe(t){return t[Symbol.asyncIterator]!=null}async function*WBe(t){const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)return;yield i}}finally{e.releaseLock()}}function qBe(t){return GBe(t)?t:WBe(t)}async function XBe(t,e){const n=qBe(t);return new ZC(e).decodeAsync(n)}var XG={},KBe=function(t,e,n,i,r){var a=new Worker(XG[e]||(XG[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},Eo=Uint8Array,ym=Uint16Array,une=Int32Array,T4=new Eo([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 Eo([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]),fne=new Eo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hne=function(t,e){for(var n=new ym(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];for(var r=new une(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}},dne=hne(T4,2),C4=dne.b,YBe=dne.r;C4[28]=258,YBe[258]=28;var JBe=hne(A4,0),pne=JBe.b,OT=new ym(32768);for(var Vr=0;Vr<32768;++Vr){var rd=(Vr&43690)>>1|(Vr&21845)<<1;rd=(rd&52428)>>2|(rd&13107)<<2,rd=(rd&61680)>>4|(rd&3855)<<4,OT[Vr]=((rd&65280)>>8|(rd&255)<<8)>>1}var I0=function(t,e,n){for(var i=t.length,r=0,a=new ym(e);r<i;++r)t[r]&&++a[t[r]-1];var s=new ym(e);for(r=1;r<e;++r)s[r]=s[r-1]+a[r-1]<<1;var o;if(n){o=new ym(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 ym(i),r=0;r<i;++r)t[r]&&(o[r]=OT[s[t[r]-1]++]>>15-t[r]);return o},cS=new Eo(288);for(var Vr=0;Vr<144;++Vr)cS[Vr]=8;for(var Vr=144;Vr<256;++Vr)cS[Vr]=9;for(var Vr=256;Vr<280;++Vr)cS[Vr]=7;for(var Vr=280;Vr<288;++Vr)cS[Vr]=8;var mne=new Eo(32);for(var Vr=0;Vr<32;++Vr)mne[Vr]=5;var gne=I0(cS,9,1),bne=I0(mne,5,1),MM=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},ec=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)},vne=function(t){return(t+7)/8|0},yne=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new Eo(t.subarray(e,n))},xne=["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"],ts=function(t,e,n){var i=new Error(e||xne[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,ts),!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 Eo(0);var s=!n,o=s||e.i!=2,l=e.i;s&&(n=new Eo(r*3));var c=function(je){var He=n.length;if(je>He){var pe=new Eo(Math.max(He*2,je));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,m=r*8;do{if(!d){u=ec(t,f,1);var x=ec(t,f+1,3);if(f+=3,x)if(x==1)d=gne,g=bne,b=9,y=5;else if(x==2){var S=ec(t,f,31)+257,A=ec(t,f+10,15)+4,C=S+ec(t,f+5,31)+1;f+=14;for(var D=new Eo(C),R=new Eo(19),L=0;L<A;++L)R[fne[L]]=ec(t,f+L*3,7);f+=A*3;for(var U=MM(R),j=(1<<U)-1,z=I0(R,U,1),L=0;L<C;){var q=z[ec(t,f,j)];f+=q&15;var _=q>>4;if(_<16)D[L++]=_;else{var F=0,V=0;for(_==16?(V=3+ec(t,f,3),f+=2,F=D[L-1]):_==17?(V=3+ec(t,f,7),f+=3):_==18&&(V=11+ec(t,f,127),f+=7);V--;)D[L++]=F}}var H=D.subarray(0,S),W=D.subarray(S);b=MM(H),y=MM(W),d=I0(H,b,1),g=I0(W,y,1)}else ts(1);else{var _=vne(f)+4,w=t[_-4]|t[_-3]<<8,M=_+w;if(M>r){l&&ts(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>m){l&&ts(0);break}}o&&c(h+131072);for(var B=(1<<b)-1,J=(1<<y)-1,Z=f;;Z=f){var F=d[TM(t,f)&B],G=F>>4;if(f+=F&15,f>m){l&&ts(0);break}if(F||ts(2),G<256)n[h++]=G;else if(G==256){Z=f,d=null;break}else{var de=G-254;if(G>264){var L=G-257,oe=T4[L];de=ec(t,f,(1<<oe)-1)+C4[L],f+=oe}var le=g[TM(t,f)&J],ue=le>>4;le||ts(3),f+=le&15;var W=pne[ue];if(ue>3){var oe=A4[ue];W+=TM(t,f)&(1<<oe)-1,f+=oe}if(f>m){l&&ts(0);break}o&&c(h+131072);var Se=h+de;if(h<W){var Oe=a-W,Be=Math.min(W,Se);for(Oe+h<0&&ts(3);h<Be;++h)n[h]=i[Oe+h]}for(;h<Se;++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?yne(n,0,h):n.subarray(0,h)},$Be=new Eo(0),ZBe=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},KG=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=[],QBe=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},eze=function(t,e,n,i){if(!GE[n]){for(var r="",a={},s=t.length-1,o=0;o<s;++o)r=KG(t[o],r,a);GE[n]={c:KG(t[s],r,a),e:a}}var l=ZBe({},GE[n].e);return KBe(GE[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,l,QBe(l),i)},R4=function(){return[Eo,ym,une,T4,A4,fne,C4,pne,gne,bne,OT,xne,I0,MM,ec,TM,vne,yne,ts,QC,Ene,eR,k4]},tze=function(){return[_ne,Sne]},nze=function(){return[wne]},eR=function(t){return postMessage(t,[t.buffer])},k4=function(t){return t&&{out:t.size&&new Eo(t.size),dictionary:t.dictionary}},D4=function(t,e,n,i,r,a){var s=eze(n,i,r,function(o,l){s.terminate(),a(o,l)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},_ne=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&ts(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)},Sne=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},wne=function(t,e){return((t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31)&&ts(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&ts(6,"invalid zlib data: "+(t[1]&32?"need":"unexpected")+" dictionary"),(t[1]>>3&4)+2};function ize(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ts(7),D4(t,e,[R4],function(i){return eR(Ene(i.data[0],k4(i.data[1])))},1,n)}function Ene(t,e){return QC(t,{i:2},e&&e.out,e&&e.dictionary)}function rze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ts(7),D4(t,e,[R4,tze,function(){return[YG]}],function(i){return eR(YG(i.data[0],i.data[1]))},3,n)}function YG(t,e){var n=_ne(t);return n+8>t.length&&ts(6,"invalid gzip data"),QC(t.subarray(n,-8),{i:2},e&&e.out||new Eo(Sne(t)),e&&e.dictionary)}function aze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ts(7),D4(t,e,[R4,nze,function(){return[JG]}],function(i){return eR(JG(i.data[0],k4(i.data[1])))},5,n)}function JG(t,e){return QC(t.subarray(wne(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}function sze(t,e,n){return n||(n=e,e={}),typeof n!="function"&&ts(7),t[0]==31&&t[1]==139&&t[2]==8?rze(t,e,n):(t[0]&15)!=8||t[0]>>4>7||(t[0]<<8|t[1])%31?ize(t,e,n):aze(t,e,n)}var oze=typeof TextDecoder<"u"&&new TextDecoder,lze=0;try{oze.decode($Be,{stream:!0}),lze=1}catch{}async function cze(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}),sze(new Uint8Array(a),(s,o)=>{e({downloaded:1*r,total:r}),i(VBe(o))})});else{let a=0;const s=new TransformStream({transform(o,l){a+=o.length,e({downloaded:a,total:r}),l.enqueue(o)}});XBe(n.body.pipeThrough(s).pipeThrough(new DecompressionStream("gzip"))).then(o=>i(o))}})}function uze({fileUrl:t}){const e=I.useContext(xi),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=_a();I.useEffect(()=>{cze(t,a).then(_=>{console.log("File loaded! Saved with Viser version:",_.viserVersion),f(_)})},[]);const y=I.useRef({currentTime:0,currentIndex:0}),m=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,m(),y.current.currentIndex===u.messages.length&&u.durationSeconds===0&&clearInterval(M)},1e3/120);return()=>clearInterval(M)}},[m,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),m()},[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(uf,{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(Ol,{size:"md",variant:"subtle",onClick:()=>c(!l),children:l?k.jsx(WAe,{height:"1.125em",width:"1.125em"}):k.jsx(VAe,{height:"1.125em",width:"1.125em"})}),k.jsx(cg,{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(Pr,{zIndex:10,label:"Playback speed",withinPortal:!0,children:k.jsx(Bv,{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 fze(){return I.useEffect(()=>{const t=ine();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 $G({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 hze="1.0.19",ZG=[{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"}],dze=({children:t})=>{const e=Ce.useContext(xi),[n,i]=Ce.useState(null),r=Ce.useRef(new Map),a=Ce.useRef(new Map),s=Ce.useRef(new Set),[o,l]=Ce.useState(new Set),c=Ce.useRef(new Map),u=Ce.useRef(new Set),f=Ce.useRef(0),h=Ce.useMemo(()=>new qn,[]),d=Ce.useMemo(()=>new qn,[]),g=Ce.useMemo(()=>new Zd,[]),b=Ce.useMemo(()=>new Dt,[]),y=Ce.useMemo(()=>new te,[]),m=Ce.useMemo(()=>new te,[]),x=Ce.useMemo(()=>new te,[]),_=Ce.useMemo(()=>new Il(1,1),[]);Ce.useEffect(()=>{const L=new yl;return i(L),()=>{r.current.forEach(U=>{L.remove(U),U.dispose()})}},[]);const w=Ce.useCallback((L,U,j,z,q,F,V,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(L),u.current.add(W);const B=U.split("/").slice(0,-1).join("/"),J=`bg-${j}-${f.current++}`;c.current.set(J,Ce.createRef()),l(G=>new Set([...G,J]));const Z=_I(z,q,F);a.current.set(L,{nodeName:U,parentName:B,depthTest:j,batchedText:W,backgroundInstanceId:J,backgroundDepthTest:j,fontSizeMode:z,fontScreenScale:q,fontSceneHeight:F,baseFontSize:Z,anchorX:V,anchorY:H})},[n]),M=Ce.useCallback(L=>{const U=a.current.get(L);U&&(U.batchedText.remove(L),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(L))},[]),S=Ce.useCallback(()=>{r.current.forEach(L=>{u.current.add(L)})},[]),A=Ce.useCallback(L=>{const U=a.current.get(L);U&&u.current.add(U.batchedText)},[]),C=Ce.useCallback((L,U,j,z,q,F,V)=>{const H=a.current.get(L);if(!H)return;if(H.depthTest!==U){const B=H.nodeName;M(L),w(L,B,U,j,z,q,F,V);return}const W=_I(j,z,q);H.fontSizeMode=j,H.fontScreenScale=z,H.fontSceneHeight=q,H.baseFontSize=W,H.anchorX=F,H.anchorY=V,L.anchorX=F,L.anchorY=V,u.current.add(H.batchedText)},[w,M]),D=Ce.useMemo(()=>({registerText:w,unregisterText:M,updateText:C,syncBatchedText:S,syncText:A}),[w,M,C,S,A]);oa(({camera:L})=>{n&&(u.current.forEach(U=>{U.sync()}),u.current.clear(),b.multiplyMatrices(L.projectionMatrix,L.matrixWorldInverse),g.setFromProjectionMatrix(b),aTe(n,L,h,d),r.current.forEach((U,j)=>{s.current.has(U)||rTe(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 F=j.position;F.set(...q.position??[0,0,0]),F.applyMatrix4(z.matrixWorld);const V=q.effectiveVisibility??!1;V?j.fillOpacity=1:j.fillOpacity=0;let H=O6,W=I6;if(U.fontSizeMode==="screen"){m.copy(j.position),m.applyMatrix4(n.matrixWorld);const J=sTe(L,m,x);j.fontSize=U.baseFontSize*J,H=O6*J*U.fontScreenScale,W=I6*J*U.fontScreenScale}else j.fontSize=U.baseFontSize;const B=c.current.get(U.backgroundInstanceId);if(B?.current){const J=B.current;if(V&&j.textRenderInfo){const Z=j.textRenderInfo.blockBounds,G=j.textRenderInfo.visibleBounds;if(Z&&G){const[de,oe,le,ue]=Z,[Se,Oe,Be,je]=G,He=Be-Se,pe=je-Oe,ze=He+H,Ie=pe+W,qe=Se-H/2,we=Be+H/2,Me=Oe-W/2,Ae=je+W/2;let Ne=0;U.anchorX==="left"?Ne=de:U.anchorX==="right"?Ne=le:Ne=(de+le)/2;let Ue=0;U.anchorY==="top"?Ue=ue:U.anchorY==="bottom"?Ue=oe:Ue=(oe+ue)/2;const Qe=(qe+we)/2,ae=(Me+Ae)/2,K=Qe-Ne,ce=ae-Ue;y.set(K,ce,0),y.applyQuaternion(d),J.position.copy(j.position),J.position.add(y),J.scale.set(ze,Ie,1),J.quaternion.copy(d)}}else J.scale.set(0,0,0)}}else{j.fillOpacity=0;const F=c.current.get(U.backgroundInstanceId);F?.current&&F.current.scale.set(0,0,0)}j.quaternion.copy(d)}catch(z){console.error("[BatchedLabelManager] Error updating text:",z)}}))});const R=Ce.useMemo(()=>{const L=new Map;return L.set(!0,[]),L.set(!1,[]),o.forEach(U=>{const j=U.startsWith("bg-true"),z=L.get(j);z&&z.push(U)}),L},[o]);return k.jsxs(tQ.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(L=>{const U=c.current.get(L);return k.jsx(cc,{ref:U,renderOrder:1e4},L)})]}),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(L=>{const U=c.current.get(L);return k.jsx(cc,{ref:U},L)})]}),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 pze=()=>{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},mze=()=>oa(()=>null,1e3);function gze(){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(bze,{})});if(!e)return i;if(e==="fill")return k.jsx($G,{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($G,{title:n,width:r,height:a,children:i})}function bze(){const t=new URLSearchParams(window.location.search).getAll(EM),e=t.length>=1?t[0]:pze(),n=new URLSearchParams(window.location.search),i=n.get("playbackPath"),r=n.get("darkMode")!==null,a=i===null?"websocket":"file_playback",s={},o=Ce.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,dragStart:[0,0],dragEnd:[0,0],isDragging:!1},skinnedMeshState:{},hoveredElementsCount:0}),l=lBe(o.current.nodeRefFromName),c=cBe(),u=uBe(),f={messageSource:a,useSceneTree:l.store,sceneTreeActions:l.actions,useEnvironment:c,useGui:PFe(e),useDevSettings:u,mutable:o};return r&&(f.useGui.getState().theme.dark_mode=r),k.jsx(xi.Provider,{value:f,children:k.jsxs(vze,{children:[a==="websocket"&&k.jsx(QFe,{}),a==="file_playback"&&k.jsx(uze,{fileUrl:i})]})})}function vze({children:t}){const e=Ce.useContext(xi),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(()=>({...sne,...i===null?{}:{colors:{custom:i},primaryColor:"custom"}}),[i]),c=I.useMemo(()=>k.jsxs(k.Fragment,{children:[k.jsx(Tze,{}),k.jsx(_ze,{children:k.jsx(vBe,{})})]}),[]);return k.jsx(k.Fragment,{children:k.jsxs(CX,{theme:l,defaultColorScheme:n?"dark":"light",colorSchemeManager:{get:u=>u,set:()=>null,subscribe:()=>null,unsubscribe:()=>null,clear:()=>null},children:[t,k.jsx(yze,{darkMode:n}),k.jsx(xze,{}),k.jsx(fze,{}),k.jsx(aBe,{}),k.jsxs(ct,{style:{width:"100%",height:"100%",display:"flex",position:"relative",flexDirection:"column"},children:[k.jsx(rBe,{}),k.jsxs(ct,{style:{width:"100%",position:"relative",flexGrow:1,overflow:"hidden",display:"flex"},children:[k.jsxs(ct,{style:u=>({backgroundColor:n?u.colors.dark[9]:"#fff",flexGrow:1,overflow:"hidden",height:"100%"}),children:[c,a&&o==="websocket"&&k.jsx(Rze,{})]}),o==="websocket"&&k.jsx(nFe,{control_layout:r})]})]}),s&&k.jsx(d2e,{className:"stats-panel"})]})})}function yze(t){const e=og();return I.useEffect(()=>{e.setColorScheme(t.darkMode?"dark":"light")},[t.darkMode]),null}function xze(){return k.jsx(Mh,{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 _ze({children:t}){const e=Ce.useContext(xi),n=EC(20).send,i=_a(),{ref:r,inView:a}=xoe(),s=I.useMemo(()=>k.jsx(tTe,{}),[]),o=h=>{const{mutable:d}=e,g=d.current.scenePointerInfo;if(g.enabled===!1)return;const b=d.current.canvas.getBoundingClientRect();if(g.dragStart=[h.clientX-b.left,h.clientY-b.top],g.dragEnd=g.dragStart,cN(e,g.dragEnd)===null||g.isDragging)return;g.isDragging=!0,d.current.cameraControl.enabled=!1;const y=d.current.canvas2d.getContext("2d");y.clearRect(0,0,y.canvas.width,y.canvas.height)},l=h=>{const{mutable:d}=e,g=d.current.scenePointerInfo;if(g.enabled===!1||!g.isDragging)return;const b=d.current.canvas.getBoundingClientRect(),y=[h.clientX-b.left,h.clientY-b.top];if(cN(e,y)!==null&&(g.dragEnd=y,!(Math.abs(g.dragEnd[0]-g.dragStart[0])<=3&&Math.abs(g.dragEnd[1]-g.dragStart[1])<=3)&&g.enabled==="rect-select")){const m=d.current.canvas2d.getContext("2d");m.clearRect(0,0,m.canvas.width,m.canvas.height),m.beginPath(),m.fillStyle=i.primaryColor,m.strokeStyle="blue",m.globalAlpha=.2,m.fillRect(g.dragStart[0],g.dragStart[1],g.dragEnd[0]-g.dragStart[0],g.dragEnd[1]-g.dragStart[1]),m.globalAlpha=1,m.stroke()}},c=()=>{const{mutable:h}=e,d=h.current.scenePointerInfo;if(h.current.cameraControl.enabled=!0,d.enabled===!1||!d.isDragging)return;const g=h.current.canvas2d.getContext("2d");g.clearRect(0,0,g.canvas.width,g.canvas.height),d.enabled==="click"?Sze(e,d.dragEnd,n):d.enabled==="rect-select"&&wze(e,d,n),d.isDragging=!1},u=e.useDevSettings(h=>h.fixedDpr),f=Ce.useMemo(()=>k.jsxs(k.Fragment,{children:[k.jsx(Aze,{}),k.jsx(Cze,{}),s,k.jsxs(TTe,{children:[k.jsx(Mze,{}),t,k.jsx(dze,{children:k.jsx(Cte,{name:""})})]}),k.jsx(Eze,{})]}),[t,s]);return k.jsx("div",{ref:r,style:{position:"relative",zIndex:0,width:"100%",height:"100%"},children:k.jsxs(Pwe,{camera:{position:[-3,3,-3],near:.01,far:1e3},gl:{preserveDrawingBuffer:!0},style:{width:"100%",height:"100%"},ref:h=>e.mutable.current.canvas=h,onPointerDown:o,onPointerMove:l,onPointerUp:c,shadows:!0,dpr:u??void 0,children:[!a&&k.jsx(mze,{}),f]})})}function Sze(t,e,n){const i=new G_,r=cN(t,e);if(r===null)return;i.setFromCamera(r,t.mutable.current.camera);const a=QZ(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 wze(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 Eze(){const t=Ce.useContext(xi),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],Z_),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 qn(r[1],r[2],r[3],r[0]),l=o.clone().invert(),c=new vi().setFromQuaternion(new qn(i.background_wxyz[1],i.background_wxyz[2],i.background_wxyz[3],i.background_wxyz[0]).premultiply(o).multiply(l)),u=new vi().setFromQuaternion(new qn(i.environment_wxyz[1],i.environment_wxyz[2],i.environment_wxyz[3],i.environment_wxyz[0]).premultiply(o).multiply(l));return k.jsx(I2e,{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 Mze(){const t=Ce.useContext(xi),e=ki(i=>i.setDpr);return t.useDevSettings(i=>i.fixedDpr)!==null?null:k.jsx(L2e,{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 Tze(){const t=Ce.useContext(xi);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 Aze(){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 cs({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}=Ce.useContext(xi);n.current.backgroundMaterial=e;const i=Ce.useRef(null);return oa(({camera:r})=>{if(!(r instanceof ra)){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 Cze(){const{mutable:t}=Ce.useContext(xi);return t.current.scene=ki(e=>e.scene),t.current.camera=ki(e=>e.camera),null}function Rze(){const[t,{open:e,close:n}]=Ec(!1);return k.jsxs(k.Fragment,{children:[k.jsx(Pr,{label:`Viser ${hze}`,children:k.jsx(ct,{style:{position:"absolute",bottom:"1em",left:"1em",cursor:"pointer"},component:"a",onClick:e,title:"About Viser",children:k.jsx(O_,{src:"./logo.svg",style:{width:"2.5em",height:"auto"}})})}),k.jsxs(Ro,{opened:t,onClose:n,withCloseButton:!1,size:"xl",style:{textAlign:"center"},trapFocus:!1,children:[k.jsx(ct,{pt:"lg",pb:"xs",children:"Viser is a 3D visualization toolkit developed at UC Berkeley."}),k.jsxs(ct,{pb:"lg",children:[k.jsx(Cm,{href:"https://viser.studio/main",target:"_blank",style:{fontWeight:"600"},children:"Documentation"}),"  •  ",k.jsx(Cm,{href:"https://github.com/nerfstudio-project/viser",target:"_blank",style:{fontWeight:"600"},children:"GitHub"})]}),k.jsx(lg,{}),k.jsxs(ct,{style:{textAlign:"left",maxHeight:"120px",overflowY:"auto",lineHeight:"1",fontSize:"0.8rem",opacity:"0.75"},px:"md",pt:"sm",children:["Thanks to our contributors!"," ",ZG.map((i,r)=>k.jsxs("span",{children:[k.jsx(Cm,{href:i.html_url,target:"_blank",style:{textDecoration:"none",fontSize:"0.75rem"},children:i.login}),r<ZG.length-1&&", "]},i.login))]})]})]})}kFe();poe.createRoot(document.getElementById("root")).render(k.jsx(gze,{}));
