var GF=Object.defineProperty;var fw=n=>{throw TypeError(n)};var VF=(n,e,t)=>e in n?GF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ks=(n,e,t)=>VF(n,typeof e!="symbol"?e+"":e,t),Vy=(n,e,t)=>e.has(n)||fw("Cannot "+t);var pe=(n,e,t)=>(Vy(n,e,"read from private field"),t?t.call(n):e.get(n)),zt=(n,e,t)=>e.has(n)?fw("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),St=(n,e,t,r)=>(Vy(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),sr=(n,e,t)=>(Vy(n,e,"access private method"),t);var lp=(n,e,t,r)=>({set _(i){St(n,e,i,t)},get _(){return pe(n,e,r)}});function jF(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in n)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();var qZ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function $Z(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var mA={exports:{}},D0={},gA={exports:{}},It={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Vd=Symbol.for("react.element"),XF=Symbol.for("react.portal"),YF=Symbol.for("react.fragment"),qF=Symbol.for("react.strict_mode"),$F=Symbol.for("react.profiler"),KF=Symbol.for("react.provider"),ZF=Symbol.for("react.context"),QF=Symbol.for("react.forward_ref"),JF=Symbol.for("react.suspense"),eN=Symbol.for("react.memo"),tN=Symbol.for("react.lazy"),pw=Symbol.iterator;function nN(n){return n===null||typeof n!="object"?null:(n=pw&&n[pw]||n["@@iterator"],typeof n=="function"?n:null)}var yA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vA=Object.assign,_A={};function Tu(n,e,t){this.props=n,this.context=e,this.refs=_A,this.updater=t||yA}Tu.prototype.isReactComponent={};Tu.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};Tu.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function xA(){}xA.prototype=Tu.prototype;function Ax(n,e,t){this.props=n,this.context=e,this.refs=_A,this.updater=t||yA}var Cx=Ax.prototype=new xA;Cx.constructor=Ax;vA(Cx,Tu.prototype);Cx.isPureReactComponent=!0;var mw=Array.isArray,SA=Object.prototype.hasOwnProperty,Px={current:null},bA={key:!0,ref:!0,__self:!0,__source:!0};function wA(n,e,t){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)SA.call(e,r)&&!bA.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=t;else if(1<a){for(var l=Array(a),h=0;h<a;h++)l[h]=arguments[h+2];i.children=l}if(n&&n.defaultProps)for(r in a=n.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Vd,type:n,key:s,ref:o,props:i,_owner:Px.current}}function rN(n,e){return{$$typeof:Vd,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function Rx(n){return typeof n=="object"&&n!==null&&n.$$typeof===Vd}function iN(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var gw=/\/+/g;function jy(n,e){return typeof n=="object"&&n!==null&&n.key!=null?iN(""+n.key):e.toString(36)}function Em(n,e,t,r,i){var s=typeof n;(s==="undefined"||s==="boolean")&&(n=null);var o=!1;if(n===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(n.$$typeof){case Vd:case XF:o=!0}}if(o)return o=n,i=i(o),n=r===""?"."+jy(o,0):r,mw(i)?(t="",n!=null&&(t=n.replace(gw,"$&/")+"/"),Em(i,e,t,"",function(h){return h})):i!=null&&(Rx(i)&&(i=rN(i,t+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(gw,"$&/")+"/")+n)),e.push(i)),1;if(o=0,r=r===""?".":r+":",mw(n))for(var a=0;a<n.length;a++){s=n[a];var l=r+jy(s,a);o+=Em(s,e,t,l,i)}else if(l=nN(n),typeof l=="function")for(n=l.call(n),a=0;!(s=n.next()).done;)s=s.value,l=r+jy(s,a++),o+=Em(s,e,t,l,i);else if(s==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function cp(n,e,t){if(n==null)return n;var r=[],i=0;return Em(n,r,"","",function(s){return e.call(t,s,i++)}),r}function sN(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var Pr={current:null},Am={transition:null},oN={ReactCurrentDispatcher:Pr,ReactCurrentBatchConfig:Am,ReactCurrentOwner:Px};function TA(){throw Error("act(...) is not supported in production builds of React.")}It.Children={map:cp,forEach:function(n,e,t){cp(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return cp(n,function(){e++}),e},toArray:function(n){return cp(n,function(e){return e})||[]},only:function(n){if(!Rx(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};It.Component=Tu;It.Fragment=YF;It.Profiler=$F;It.PureComponent=Ax;It.StrictMode=qF;It.Suspense=JF;It.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oN;It.act=TA;It.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var r=vA({},n.props),i=n.key,s=n.ref,o=n._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=Px.current),e.key!==void 0&&(i=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(l in e)SA.call(e,l)&&!bA.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=t;else if(1<l){a=Array(l);for(var h=0;h<l;h++)a[h]=arguments[h+2];r.children=a}return{$$typeof:Vd,type:n.type,key:i,ref:s,props:r,_owner:o}};It.createContext=function(n){return n={$$typeof:ZF,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:KF,_context:n},n.Consumer=n};It.createElement=wA;It.createFactory=function(n){var e=wA.bind(null,n);return e.type=n,e};It.createRef=function(){return{current:null}};It.forwardRef=function(n){return{$$typeof:QF,render:n}};It.isValidElement=Rx;It.lazy=function(n){return{$$typeof:tN,_payload:{_status:-1,_result:n},_init:sN}};It.memo=function(n,e){return{$$typeof:eN,type:n,compare:e===void 0?null:e}};It.startTransition=function(n){var e=Am.transition;Am.transition={};try{n()}finally{Am.transition=e}};It.unstable_act=TA;It.useCallback=function(n,e){return Pr.current.useCallback(n,e)};It.useContext=function(n){return Pr.current.useContext(n)};It.useDebugValue=function(){};It.useDeferredValue=function(n){return Pr.current.useDeferredValue(n)};It.useEffect=function(n,e){return Pr.current.useEffect(n,e)};It.useId=function(){return Pr.current.useId()};It.useImperativeHandle=function(n,e,t){return Pr.current.useImperativeHandle(n,e,t)};It.useInsertionEffect=function(n,e){return Pr.current.useInsertionEffect(n,e)};It.useLayoutEffect=function(n,e){return Pr.current.useLayoutEffect(n,e)};It.useMemo=function(n,e){return Pr.current.useMemo(n,e)};It.useReducer=function(n,e,t){return Pr.current.useReducer(n,e,t)};It.useRef=function(n){return Pr.current.useRef(n)};It.useState=function(n){return Pr.current.useState(n)};It.useSyncExternalStore=function(n,e,t){return Pr.current.useSyncExternalStore(n,e,t)};It.useTransition=function(){return Pr.current.useTransition()};It.version="18.3.1";gA.exports=It;var D=gA.exports;const Ae=wu(D),MA=jF({__proto__:null,default:Ae},[D]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var aN=D,lN=Symbol.for("react.element"),cN=Symbol.for("react.fragment"),uN=Object.prototype.hasOwnProperty,hN=aN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,dN={key:!0,ref:!0,__self:!0,__source:!0};function EA(n,e,t){var r,i={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)uN.call(e,r)&&!dN.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:lN,type:n,key:s,ref:o,props:i,_owner:hN.current}}D0.Fragment=cN;D0.jsx=EA;D0.jsxs=EA;mA.exports=D0;var L=mA.exports,AA={exports:{}},li={},CA={exports:{}},PA={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(n){function e(F,U){var G=F.length;F.push(U);e:for(;0<G;){var Y=G-1>>>1,ee=F[Y];if(0<i(ee,U))F[Y]=U,F[G]=ee,G=Y;else break e}}function t(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var U=F[0],G=F.pop();if(G!==U){F[0]=G;e:for(var Y=0,ee=F.length,K=ee>>>1;Y<K;){var ie=2*(Y+1)-1,me=F[ie],Ee=ie+1,ge=F[Ee];if(0>i(me,G))Ee<ee&&0>i(ge,me)?(F[Y]=ge,F[Ee]=G,Y=Ee):(F[Y]=me,F[ie]=G,Y=ie);else if(Ee<ee&&0>i(ge,G))F[Y]=ge,F[Ee]=G,Y=Ee;else break e}}return U}function i(F,U){var G=F.sortIndex-U.sortIndex;return G!==0?G:F.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],h=[],d=1,f=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(F){for(var U=t(h);U!==null;){if(U.callback===null)r(h);else if(U.startTime<=F)r(h),U.sortIndex=U.expirationTime,e(l,U);else break;U=t(h)}}function M(F){if(x=!1,b(F),!v)if(t(l)!==null)v=!0,Z(C);else{var U=t(h);U!==null&&re(M,U.startTime-F)}}function C(F,U){v=!1,x&&(x=!1,g(O),O=-1),m=!0;var G=p;try{for(b(U),f=t(l);f!==null&&(!(f.expirationTime>U)||F&&!H());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var ee=Y(f.expirationTime<=U);U=n.unstable_now(),typeof ee=="function"?f.callback=ee:f===t(l)&&r(l),b(U)}else r(l);f=t(l)}if(f!==null)var K=!0;else{var ie=t(h);ie!==null&&re(M,ie.startTime-U),K=!1}return K}finally{f=null,p=G,m=!1}}var A=!1,R=null,O=-1,P=5,I=-1;function H(){return!(n.unstable_now()-I<P)}function X(){if(R!==null){var F=n.unstable_now();I=F;var U=!0;try{U=R(!0,F)}finally{U?se():(A=!1,R=null)}}else A=!1}var se;if(typeof S=="function")se=function(){S(X)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,$=W.port2;W.port1.onmessage=X,se=function(){$.postMessage(null)}}else se=function(){_(X,0)};function Z(F){R=F,A||(A=!0,se())}function re(F,U){O=_(function(){F(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(F){F.callback=null},n.unstable_continueExecution=function(){v||m||(v=!0,Z(C))},n.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"):P=0<F?Math.floor(1e3/F):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(F){switch(p){case 1:case 2:case 3:var U=3;break;default:U=p}var G=p;p=U;try{return F()}finally{p=G}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(F,U){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var G=p;p=F;try{return U()}finally{p=G}},n.unstable_scheduleCallback=function(F,U,G){var Y=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Y+G:Y):G=Y,F){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=G+ee,F={id:d++,callback:U,priorityLevel:F,startTime:G,expirationTime:ee,sortIndex:-1},G>Y?(F.sortIndex=G,e(h,F),t(l)===null&&F===t(h)&&(x?(g(O),O=-1):x=!0,re(M,G-Y))):(F.sortIndex=ee,e(l,F),v||m||(v=!0,Z(C))),F},n.unstable_shouldYield=H,n.unstable_wrapCallback=function(F){var U=p;return function(){var G=p;p=U;try{return F.apply(this,arguments)}finally{p=G}}}})(PA);CA.exports=PA;var fN=CA.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var pN=D,ai=fN;function Me(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var RA=new Set,Kh={};function Ml(n,e){au(n,e),au(n+"Capture",e)}function au(n,e){for(Kh[n]=e,n=0;n<e.length;n++)RA.add(e[n])}var io=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),b_=Object.prototype.hasOwnProperty,mN=/^[: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]*$/,yw={},vw={};function gN(n){return b_.call(vw,n)?!0:b_.call(yw,n)?!1:mN.test(n)?vw[n]=!0:(yw[n]=!0,!1)}function yN(n,e,t,r){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function vN(n,e,t,r){if(e===null||typeof e>"u"||yN(n,e,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Rr(n,e,t,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var er={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){er[n]=new Rr(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];er[e]=new Rr(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){er[n]=new Rr(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){er[n]=new Rr(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){er[n]=new Rr(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){er[n]=new Rr(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){er[n]=new Rr(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){er[n]=new Rr(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){er[n]=new Rr(n,5,!1,n.toLowerCase(),null,!1,!1)});var Ix=/[\-:]([a-z])/g;function Lx(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(Ix,Lx);er[e]=new Rr(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(Ix,Lx);er[e]=new Rr(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(Ix,Lx);er[e]=new Rr(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){er[n]=new Rr(n,1,!1,n.toLowerCase(),null,!1,!1)});er.xlinkHref=new Rr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){er[n]=new Rr(n,1,!1,n.toLowerCase(),null,!0,!0)});function Fx(n,e,t,r){var i=er.hasOwnProperty(e)?er[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(vN(e,t,i,r)&&(t=null),r||i===null?gN(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):i.mustUseProperty?n[i.propertyName]=t===null?i.type===3?!1:"":t:(e=i.attributeName,r=i.attributeNamespace,t===null?n.removeAttribute(e):(i=i.type,t=i===3||i===4&&t===!0?"":""+t,r?n.setAttributeNS(r,e,t):n.setAttribute(e,t))))}var po=pN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,up=Symbol.for("react.element"),Tc=Symbol.for("react.portal"),Mc=Symbol.for("react.fragment"),Nx=Symbol.for("react.strict_mode"),w_=Symbol.for("react.profiler"),IA=Symbol.for("react.provider"),LA=Symbol.for("react.context"),Dx=Symbol.for("react.forward_ref"),T_=Symbol.for("react.suspense"),M_=Symbol.for("react.suspense_list"),Ox=Symbol.for("react.memo"),Oo=Symbol.for("react.lazy"),FA=Symbol.for("react.offscreen"),_w=Symbol.iterator;function ih(n){return n===null||typeof n!="object"?null:(n=_w&&n[_w]||n["@@iterator"],typeof n=="function"?n:null)}var dn=Object.assign,Xy;function Ph(n){if(Xy===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);Xy=e&&e[1]||""}return`
`+Xy+n}var Yy=!1;function qy(n,e){if(!n||Yy)return"";Yy=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(h){var r=h}Reflect.construct(n,[],e)}else{try{e.call()}catch(h){r=h}n.call(e.prototype)}else{try{throw Error()}catch(h){r=h}n()}}catch(h){if(h&&r&&typeof h.stack=="string"){for(var i=h.stack.split(`
`),s=r.stack.split(`
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
`+i[o].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Yy=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Ph(n):""}function _N(n){switch(n.tag){case 5:return Ph(n.type);case 16:return Ph("Lazy");case 13:return Ph("Suspense");case 19:return Ph("SuspenseList");case 0:case 2:case 15:return n=qy(n.type,!1),n;case 11:return n=qy(n.type.render,!1),n;case 1:return n=qy(n.type,!0),n;default:return""}}function E_(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Mc:return"Fragment";case Tc:return"Portal";case w_:return"Profiler";case Nx:return"StrictMode";case T_:return"Suspense";case M_:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case LA:return(n.displayName||"Context")+".Consumer";case IA:return(n._context.displayName||"Context")+".Provider";case Dx:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Ox:return e=n.displayName||null,e!==null?e:E_(n.type)||"Memo";case Oo:e=n._payload,n=n._init;try{return E_(n(e))}catch{}}return null}function xN(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return E_(e);case 8:return e===Nx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ca(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function NA(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function SN(n){var e=NA(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),r=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function hp(n){n._valueTracker||(n._valueTracker=SN(n))}function DA(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),r="";return n&&(r=NA(n)?n.checked?"true":"false":n.value),n=r,n!==t?(e.setValue(n),!0):!1}function Zm(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function A_(n,e){var t=e.checked;return dn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function xw(n,e){var t=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;t=ca(e.value!=null?e.value:t),n._wrapperState={initialChecked:r,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function OA(n,e){e=e.checked,e!=null&&Fx(n,"checked",e,!1)}function C_(n,e){OA(n,e);var t=ca(e.value),r=e.type;if(t!=null)r==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(r==="submit"||r==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?P_(n,e.type,t):e.hasOwnProperty("defaultValue")&&P_(n,e.type,ca(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function Sw(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function P_(n,e,t){(e!=="number"||Zm(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var Rh=Array.isArray;function Hc(n,e,t,r){if(n=n.options,e){e={};for(var i=0;i<t.length;i++)e["$"+t[i]]=!0;for(t=0;t<n.length;t++)i=e.hasOwnProperty("$"+n[t].value),n[t].selected!==i&&(n[t].selected=i),i&&r&&(n[t].defaultSelected=!0)}else{for(t=""+ca(t),e=null,i=0;i<n.length;i++){if(n[i].value===t){n[i].selected=!0,r&&(n[i].defaultSelected=!0);return}e!==null||n[i].disabled||(e=n[i])}e!==null&&(e.selected=!0)}}function R_(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Me(91));return dn({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function bw(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(Me(92));if(Rh(t)){if(1<t.length)throw Error(Me(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:ca(t)}}function UA(n,e){var t=ca(e.value),r=ca(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),r!=null&&(n.defaultValue=""+r)}function ww(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function kA(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function I_(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?kA(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var dp,BA=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,r,i){MSApp.execUnsafeLocalFunction(function(){return n(e,t,r,i)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(dp=dp||document.createElement("div"),dp.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=dp.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Zh(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var Nh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bN=["Webkit","ms","Moz","O"];Object.keys(Nh).forEach(function(n){bN.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),Nh[e]=Nh[n]})});function zA(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||Nh.hasOwnProperty(n)&&Nh[n]?(""+e).trim():e+"px"}function WA(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var r=t.indexOf("--")===0,i=zA(t,e[t],r);t==="float"&&(t="cssFloat"),r?n.setProperty(t,i):n[t]=i}}var wN=dn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function L_(n,e){if(e){if(wN[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Me(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Me(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Me(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Me(62))}}function F_(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 N_=null;function Ux(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var D_=null,Gc=null,Vc=null;function Tw(n){if(n=Yd(n)){if(typeof D_!="function")throw Error(Me(280));var e=n.stateNode;e&&(e=z0(e),D_(n.stateNode,n.type,e))}}function HA(n){Gc?Vc?Vc.push(n):Vc=[n]:Gc=n}function GA(){if(Gc){var n=Gc,e=Vc;if(Vc=Gc=null,Tw(n),e)for(n=0;n<e.length;n++)Tw(e[n])}}function VA(n,e){return n(e)}function jA(){}var $y=!1;function XA(n,e,t){if($y)return n(e,t);$y=!0;try{return VA(n,e,t)}finally{$y=!1,(Gc!==null||Vc!==null)&&(jA(),GA())}}function Qh(n,e){var t=n.stateNode;if(t===null)return null;var r=z0(t);if(r===null)return null;t=r[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":(r=!r.disabled)||(n=n.type,r=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!r;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(Me(231,e,typeof t));return t}var O_=!1;if(io)try{var sh={};Object.defineProperty(sh,"passive",{get:function(){O_=!0}}),window.addEventListener("test",sh,sh),window.removeEventListener("test",sh,sh)}catch{O_=!1}function TN(n,e,t,r,i,s,o,a,l){var h=Array.prototype.slice.call(arguments,3);try{e.apply(t,h)}catch(d){this.onError(d)}}var Dh=!1,Qm=null,Jm=!1,U_=null,MN={onError:function(n){Dh=!0,Qm=n}};function EN(n,e,t,r,i,s,o,a,l){Dh=!1,Qm=null,TN.apply(MN,arguments)}function AN(n,e,t,r,i,s,o,a,l){if(EN.apply(this,arguments),Dh){if(Dh){var h=Qm;Dh=!1,Qm=null}else throw Error(Me(198));Jm||(Jm=!0,U_=h)}}function El(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function YA(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function Mw(n){if(El(n)!==n)throw Error(Me(188))}function CN(n){var e=n.alternate;if(!e){if(e=El(n),e===null)throw Error(Me(188));return e!==n?null:n}for(var t=n,r=e;;){var i=t.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){t=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===t)return Mw(i),n;if(s===r)return Mw(i),e;s=s.sibling}throw Error(Me(188))}if(t.return!==r.return)t=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===t){o=!0,t=i,r=s;break}if(a===r){o=!0,r=i,t=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===t){o=!0,t=s,r=i;break}if(a===r){o=!0,r=s,t=i;break}a=a.sibling}if(!o)throw Error(Me(189))}}if(t.alternate!==r)throw Error(Me(190))}if(t.tag!==3)throw Error(Me(188));return t.stateNode.current===t?n:e}function qA(n){return n=CN(n),n!==null?$A(n):null}function $A(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=$A(n);if(e!==null)return e;n=n.sibling}return null}var KA=ai.unstable_scheduleCallback,Ew=ai.unstable_cancelCallback,PN=ai.unstable_shouldYield,RN=ai.unstable_requestPaint,wn=ai.unstable_now,IN=ai.unstable_getCurrentPriorityLevel,kx=ai.unstable_ImmediatePriority,ZA=ai.unstable_UserBlockingPriority,e0=ai.unstable_NormalPriority,LN=ai.unstable_LowPriority,QA=ai.unstable_IdlePriority,O0=null,bs=null;function FN(n){if(bs&&typeof bs.onCommitFiberRoot=="function")try{bs.onCommitFiberRoot(O0,n,void 0,(n.current.flags&128)===128)}catch{}}var qi=Math.clz32?Math.clz32:ON,NN=Math.log,DN=Math.LN2;function ON(n){return n>>>=0,n===0?32:31-(NN(n)/DN|0)|0}var fp=64,pp=4194304;function Ih(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function t0(n,e){var t=n.pendingLanes;if(t===0)return 0;var r=0,i=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~i;a!==0?r=Ih(a):(s&=o,s!==0&&(r=Ih(s)))}else o=t&~i,o!==0?r=Ih(o):s!==0&&(r=Ih(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=r;0<e;)t=31-qi(e),i=1<<t,r|=n[t],e&=~i;return r}function UN(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kN(n,e){for(var t=n.suspendedLanes,r=n.pingedLanes,i=n.expirationTimes,s=n.pendingLanes;0<s;){var o=31-qi(s),a=1<<o,l=i[o];l===-1?(!(a&t)||a&r)&&(i[o]=UN(a,e)):l<=e&&(n.expiredLanes|=a),s&=~a}}function k_(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function JA(){var n=fp;return fp<<=1,!(fp&4194240)&&(fp=64),n}function Ky(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function jd(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-qi(e),n[e]=t}function BN(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var r=n.eventTimes;for(n=n.expirationTimes;0<t;){var i=31-qi(t),s=1<<i;e[i]=0,r[i]=-1,n[i]=-1,t&=~s}}function Bx(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var r=31-qi(t),i=1<<r;i&e|n[r]&e&&(n[r]|=e),t&=~i}}var jt=0;function eC(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var tC,zx,nC,rC,iC,B_=!1,mp=[],Ko=null,Zo=null,Qo=null,Jh=new Map,ed=new Map,Bo=[],zN="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 submit".split(" ");function Aw(n,e){switch(n){case"focusin":case"focusout":Ko=null;break;case"dragenter":case"dragleave":Zo=null;break;case"mouseover":case"mouseout":Qo=null;break;case"pointerover":case"pointerout":Jh.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ed.delete(e.pointerId)}}function oh(n,e,t,r,i,s){return n===null||n.nativeEvent!==s?(n={blockedOn:e,domEventName:t,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Yd(e),e!==null&&zx(e)),n):(n.eventSystemFlags|=r,e=n.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),n)}function WN(n,e,t,r,i){switch(e){case"focusin":return Ko=oh(Ko,n,e,t,r,i),!0;case"dragenter":return Zo=oh(Zo,n,e,t,r,i),!0;case"mouseover":return Qo=oh(Qo,n,e,t,r,i),!0;case"pointerover":var s=i.pointerId;return Jh.set(s,oh(Jh.get(s)||null,n,e,t,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ed.set(s,oh(ed.get(s)||null,n,e,t,r,i)),!0}return!1}function sC(n){var e=$a(n.target);if(e!==null){var t=El(e);if(t!==null){if(e=t.tag,e===13){if(e=YA(t),e!==null){n.blockedOn=e,iC(n.priority,function(){nC(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Cm(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=z_(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var r=new t.constructor(t.type,t);N_=r,t.target.dispatchEvent(r),N_=null}else return e=Yd(t),e!==null&&zx(e),n.blockedOn=t,!1;e.shift()}return!0}function Cw(n,e,t){Cm(n)&&t.delete(e)}function HN(){B_=!1,Ko!==null&&Cm(Ko)&&(Ko=null),Zo!==null&&Cm(Zo)&&(Zo=null),Qo!==null&&Cm(Qo)&&(Qo=null),Jh.forEach(Cw),ed.forEach(Cw)}function ah(n,e){n.blockedOn===e&&(n.blockedOn=null,B_||(B_=!0,ai.unstable_scheduleCallback(ai.unstable_NormalPriority,HN)))}function td(n){function e(i){return ah(i,n)}if(0<mp.length){ah(mp[0],n);for(var t=1;t<mp.length;t++){var r=mp[t];r.blockedOn===n&&(r.blockedOn=null)}}for(Ko!==null&&ah(Ko,n),Zo!==null&&ah(Zo,n),Qo!==null&&ah(Qo,n),Jh.forEach(e),ed.forEach(e),t=0;t<Bo.length;t++)r=Bo[t],r.blockedOn===n&&(r.blockedOn=null);for(;0<Bo.length&&(t=Bo[0],t.blockedOn===null);)sC(t),t.blockedOn===null&&Bo.shift()}var jc=po.ReactCurrentBatchConfig,n0=!0;function GN(n,e,t,r){var i=jt,s=jc.transition;jc.transition=null;try{jt=1,Wx(n,e,t,r)}finally{jt=i,jc.transition=s}}function VN(n,e,t,r){var i=jt,s=jc.transition;jc.transition=null;try{jt=4,Wx(n,e,t,r)}finally{jt=i,jc.transition=s}}function Wx(n,e,t,r){if(n0){var i=z_(n,e,t,r);if(i===null)ov(n,e,r,r0,t),Aw(n,r);else if(WN(i,n,e,t,r))r.stopPropagation();else if(Aw(n,r),e&4&&-1<zN.indexOf(n)){for(;i!==null;){var s=Yd(i);if(s!==null&&tC(s),s=z_(n,e,t,r),s===null&&ov(n,e,r,r0,t),s===i)break;i=s}i!==null&&r.stopPropagation()}else ov(n,e,r,null,t)}}var r0=null;function z_(n,e,t,r){if(r0=null,n=Ux(r),n=$a(n),n!==null)if(e=El(n),e===null)n=null;else if(t=e.tag,t===13){if(n=YA(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return r0=n,null}function oC(n){switch(n){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(IN()){case kx:return 1;case ZA:return 4;case e0:case LN:return 16;case QA:return 536870912;default:return 16}default:return 16}}var Yo=null,Hx=null,Pm=null;function aC(){if(Pm)return Pm;var n,e=Hx,t=e.length,r,i="value"in Yo?Yo.value:Yo.textContent,s=i.length;for(n=0;n<t&&e[n]===i[n];n++);var o=t-n;for(r=1;r<=o&&e[t-r]===i[s-r];r++);return Pm=i.slice(n,1<r?1-r:void 0)}function Rm(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function gp(){return!0}function Pw(){return!1}function ci(n){function e(t,r,i,s,o){this._reactName=t,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?gp:Pw,this.isPropagationStopped=Pw,this}return dn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=gp)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=gp)},persist:function(){},isPersistent:gp}),e}var Mu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gx=ci(Mu),Xd=dn({},Mu,{view:0,detail:0}),jN=ci(Xd),Zy,Qy,lh,U0=dn({},Xd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vx,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==lh&&(lh&&n.type==="mousemove"?(Zy=n.screenX-lh.screenX,Qy=n.screenY-lh.screenY):Qy=Zy=0,lh=n),Zy)},movementY:function(n){return"movementY"in n?n.movementY:Qy}}),Rw=ci(U0),XN=dn({},U0,{dataTransfer:0}),YN=ci(XN),qN=dn({},Xd,{relatedTarget:0}),Jy=ci(qN),$N=dn({},Mu,{animationName:0,elapsedTime:0,pseudoElement:0}),KN=ci($N),ZN=dn({},Mu,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),QN=ci(ZN),JN=dn({},Mu,{data:0}),Iw=ci(JN),eD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tD={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"},nD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rD(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=nD[n])?!!e[n]:!1}function Vx(){return rD}var iD=dn({},Xd,{key:function(n){if(n.key){var e=eD[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=Rm(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?tD[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vx,charCode:function(n){return n.type==="keypress"?Rm(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Rm(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),sD=ci(iD),oD=dn({},U0,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lw=ci(oD),aD=dn({},Xd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vx}),lD=ci(aD),cD=dn({},Mu,{propertyName:0,elapsedTime:0,pseudoElement:0}),uD=ci(cD),hD=dn({},U0,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),dD=ci(hD),fD=[9,13,27,32],jx=io&&"CompositionEvent"in window,Oh=null;io&&"documentMode"in document&&(Oh=document.documentMode);var pD=io&&"TextEvent"in window&&!Oh,lC=io&&(!jx||Oh&&8<Oh&&11>=Oh),Fw=" ",Nw=!1;function cC(n,e){switch(n){case"keyup":return fD.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uC(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ec=!1;function mD(n,e){switch(n){case"compositionend":return uC(e);case"keypress":return e.which!==32?null:(Nw=!0,Fw);case"textInput":return n=e.data,n===Fw&&Nw?null:n;default:return null}}function gD(n,e){if(Ec)return n==="compositionend"||!jx&&cC(n,e)?(n=aC(),Pm=Hx=Yo=null,Ec=!1,n):null;switch(n){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 lC&&e.locale!=="ko"?null:e.data;default:return null}}var yD={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 Dw(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!yD[n.type]:e==="textarea"}function hC(n,e,t,r){HA(r),e=i0(e,"onChange"),0<e.length&&(t=new Gx("onChange","change",null,t,r),n.push({event:t,listeners:e}))}var Uh=null,nd=null;function vD(n){bC(n,0)}function k0(n){var e=Pc(n);if(DA(e))return n}function _D(n,e){if(n==="change")return e}var dC=!1;if(io){var ev;if(io){var tv="oninput"in document;if(!tv){var Ow=document.createElement("div");Ow.setAttribute("oninput","return;"),tv=typeof Ow.oninput=="function"}ev=tv}else ev=!1;dC=ev&&(!document.documentMode||9<document.documentMode)}function Uw(){Uh&&(Uh.detachEvent("onpropertychange",fC),nd=Uh=null)}function fC(n){if(n.propertyName==="value"&&k0(nd)){var e=[];hC(e,nd,n,Ux(n)),XA(vD,e)}}function xD(n,e,t){n==="focusin"?(Uw(),Uh=e,nd=t,Uh.attachEvent("onpropertychange",fC)):n==="focusout"&&Uw()}function SD(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return k0(nd)}function bD(n,e){if(n==="click")return k0(e)}function wD(n,e){if(n==="input"||n==="change")return k0(e)}function TD(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Zi=typeof Object.is=="function"?Object.is:TD;function rd(n,e){if(Zi(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var i=t[r];if(!b_.call(e,i)||!Zi(n[i],e[i]))return!1}return!0}function kw(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Bw(n,e){var t=kw(n);n=0;for(var r;t;){if(t.nodeType===3){if(r=n+t.textContent.length,n<=e&&r>=e)return{node:t,offset:e-n};n=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=kw(t)}}function pC(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?pC(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function mC(){for(var n=window,e=Zm();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=Zm(n.document)}return e}function Xx(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function MD(n){var e=mC(),t=n.focusedElem,r=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&pC(t.ownerDocument.documentElement,t)){if(r!==null&&Xx(t)){if(e=r.start,n=r.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var i=t.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!n.extend&&s>r&&(i=r,r=s,s=i),i=Bw(t,s);var o=Bw(t,r);i&&o&&(n.rangeCount!==1||n.anchorNode!==i.node||n.anchorOffset!==i.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),n.removeAllRanges(),s>r?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var ED=io&&"documentMode"in document&&11>=document.documentMode,Ac=null,W_=null,kh=null,H_=!1;function zw(n,e,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;H_||Ac==null||Ac!==Zm(r)||(r=Ac,"selectionStart"in r&&Xx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),kh&&rd(kh,r)||(kh=r,r=i0(W_,"onSelect"),0<r.length&&(e=new Gx("onSelect","select",null,e,t),n.push({event:e,listeners:r}),e.target=Ac)))}function yp(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var Cc={animationend:yp("Animation","AnimationEnd"),animationiteration:yp("Animation","AnimationIteration"),animationstart:yp("Animation","AnimationStart"),transitionend:yp("Transition","TransitionEnd")},nv={},gC={};io&&(gC=document.createElement("div").style,"AnimationEvent"in window||(delete Cc.animationend.animation,delete Cc.animationiteration.animation,delete Cc.animationstart.animation),"TransitionEvent"in window||delete Cc.transitionend.transition);function B0(n){if(nv[n])return nv[n];if(!Cc[n])return n;var e=Cc[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in gC)return nv[n]=e[t];return n}var yC=B0("animationend"),vC=B0("animationiteration"),_C=B0("animationstart"),xC=B0("transitionend"),SC=new Map,Ww="abort auxClick 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(" ");function ya(n,e){SC.set(n,e),Ml(e,[n])}for(var rv=0;rv<Ww.length;rv++){var iv=Ww[rv],AD=iv.toLowerCase(),CD=iv[0].toUpperCase()+iv.slice(1);ya(AD,"on"+CD)}ya(yC,"onAnimationEnd");ya(vC,"onAnimationIteration");ya(_C,"onAnimationStart");ya("dblclick","onDoubleClick");ya("focusin","onFocus");ya("focusout","onBlur");ya(xC,"onTransitionEnd");au("onMouseEnter",["mouseout","mouseover"]);au("onMouseLeave",["mouseout","mouseover"]);au("onPointerEnter",["pointerout","pointerover"]);au("onPointerLeave",["pointerout","pointerover"]);Ml("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ml("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ml("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ml("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ml("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ml("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lh="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(" "),PD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lh));function Hw(n,e,t){var r=n.type||"unknown-event";n.currentTarget=t,AN(r,e,void 0,n),n.currentTarget=null}function bC(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var r=n[t],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,h=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Hw(i,a,h),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,h=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Hw(i,a,h),s=l}}}if(Jm)throw n=U_,Jm=!1,U_=null,n}function en(n,e){var t=e[Y_];t===void 0&&(t=e[Y_]=new Set);var r=n+"__bubble";t.has(r)||(wC(e,n,2,!1),t.add(r))}function sv(n,e,t){var r=0;e&&(r|=4),wC(t,n,r,e)}var vp="_reactListening"+Math.random().toString(36).slice(2);function id(n){if(!n[vp]){n[vp]=!0,RA.forEach(function(t){t!=="selectionchange"&&(PD.has(t)||sv(t,!1,n),sv(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[vp]||(e[vp]=!0,sv("selectionchange",!1,e))}}function wC(n,e,t,r){switch(oC(e)){case 1:var i=GN;break;case 4:i=VN;break;default:i=Wx}t=i.bind(null,e,t,n),i=void 0,!O_||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?n.addEventListener(e,t,{capture:!0,passive:i}):n.addEventListener(e,t,!0):i!==void 0?n.addEventListener(e,t,{passive:i}):n.addEventListener(e,t,!1)}function ov(n,e,t,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=$a(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}XA(function(){var h=s,d=Ux(t),f=[];e:{var p=SC.get(n);if(p!==void 0){var m=Gx,v=n;switch(n){case"keypress":if(Rm(t)===0)break e;case"keydown":case"keyup":m=sD;break;case"focusin":v="focus",m=Jy;break;case"focusout":v="blur",m=Jy;break;case"beforeblur":case"afterblur":m=Jy;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Rw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=YN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=lD;break;case yC:case vC:case _C:m=KN;break;case xC:m=uD;break;case"scroll":m=jN;break;case"wheel":m=dD;break;case"copy":case"cut":case"paste":m=QN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Lw}var x=(e&4)!==0,_=!x&&n==="scroll",g=x?p!==null?p+"Capture":null:p;x=[];for(var S=h,b;S!==null;){b=S;var M=b.stateNode;if(b.tag===5&&M!==null&&(b=M,g!==null&&(M=Qh(S,g),M!=null&&x.push(sd(S,M,b)))),_)break;S=S.return}0<x.length&&(p=new m(p,v,null,t,d),f.push({event:p,listeners:x}))}}if(!(e&7)){e:{if(p=n==="mouseover"||n==="pointerover",m=n==="mouseout"||n==="pointerout",p&&t!==N_&&(v=t.relatedTarget||t.fromElement)&&($a(v)||v[so]))break e;if((m||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,m?(v=t.relatedTarget||t.toElement,m=h,v=v?$a(v):null,v!==null&&(_=El(v),v!==_||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=h),m!==v)){if(x=Rw,M="onMouseLeave",g="onMouseEnter",S="mouse",(n==="pointerout"||n==="pointerover")&&(x=Lw,M="onPointerLeave",g="onPointerEnter",S="pointer"),_=m==null?p:Pc(m),b=v==null?p:Pc(v),p=new x(M,S+"leave",m,t,d),p.target=_,p.relatedTarget=b,M=null,$a(d)===h&&(x=new x(g,S+"enter",v,t,d),x.target=b,x.relatedTarget=_,M=x),_=M,m&&v)t:{for(x=m,g=v,S=0,b=x;b;b=Kl(b))S++;for(b=0,M=g;M;M=Kl(M))b++;for(;0<S-b;)x=Kl(x),S--;for(;0<b-S;)g=Kl(g),b--;for(;S--;){if(x===g||g!==null&&x===g.alternate)break t;x=Kl(x),g=Kl(g)}x=null}else x=null;m!==null&&Gw(f,p,m,x,!1),v!==null&&_!==null&&Gw(f,_,v,x,!0)}}e:{if(p=h?Pc(h):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var C=_D;else if(Dw(p))if(dC)C=wD;else{C=SD;var A=xD}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=bD);if(C&&(C=C(n,h))){hC(f,C,t,d);break e}A&&A(n,p,h),n==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&P_(p,"number",p.value)}switch(A=h?Pc(h):window,n){case"focusin":(Dw(A)||A.contentEditable==="true")&&(Ac=A,W_=h,kh=null);break;case"focusout":kh=W_=Ac=null;break;case"mousedown":H_=!0;break;case"contextmenu":case"mouseup":case"dragend":H_=!1,zw(f,t,d);break;case"selectionchange":if(ED)break;case"keydown":case"keyup":zw(f,t,d)}var R;if(jx)e:{switch(n){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Ec?cC(n,t)&&(O="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(O="onCompositionStart");O&&(lC&&t.locale!=="ko"&&(Ec||O!=="onCompositionStart"?O==="onCompositionEnd"&&Ec&&(R=aC()):(Yo=d,Hx="value"in Yo?Yo.value:Yo.textContent,Ec=!0)),A=i0(h,O),0<A.length&&(O=new Iw(O,n,null,t,d),f.push({event:O,listeners:A}),R?O.data=R:(R=uC(t),R!==null&&(O.data=R)))),(R=pD?mD(n,t):gD(n,t))&&(h=i0(h,"onBeforeInput"),0<h.length&&(d=new Iw("onBeforeInput","beforeinput",null,t,d),f.push({event:d,listeners:h}),d.data=R))}bC(f,e)})}function sd(n,e,t){return{instance:n,listener:e,currentTarget:t}}function i0(n,e){for(var t=e+"Capture",r=[];n!==null;){var i=n,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Qh(n,t),s!=null&&r.unshift(sd(n,s,i)),s=Qh(n,e),s!=null&&r.push(sd(n,s,i))),n=n.return}return r}function Kl(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function Gw(n,e,t,r,i){for(var s=e._reactName,o=[];t!==null&&t!==r;){var a=t,l=a.alternate,h=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&h!==null&&(a=h,i?(l=Qh(t,s),l!=null&&o.unshift(sd(t,l,a))):i||(l=Qh(t,s),l!=null&&o.push(sd(t,l,a)))),t=t.return}o.length!==0&&n.push({event:e,listeners:o})}var RD=/\r\n?/g,ID=/\u0000|\uFFFD/g;function Vw(n){return(typeof n=="string"?n:""+n).replace(RD,`
`).replace(ID,"")}function _p(n,e,t){if(e=Vw(e),Vw(n)!==e&&t)throw Error(Me(425))}function s0(){}var G_=null,V_=null;function j_(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var X_=typeof setTimeout=="function"?setTimeout:void 0,LD=typeof clearTimeout=="function"?clearTimeout:void 0,jw=typeof Promise=="function"?Promise:void 0,FD=typeof queueMicrotask=="function"?queueMicrotask:typeof jw<"u"?function(n){return jw.resolve(null).then(n).catch(ND)}:X_;function ND(n){setTimeout(function(){throw n})}function av(n,e){var t=e,r=0;do{var i=t.nextSibling;if(n.removeChild(t),i&&i.nodeType===8)if(t=i.data,t==="/$"){if(r===0){n.removeChild(i),td(e);return}r--}else t!=="$"&&t!=="$?"&&t!=="$!"||r++;t=i}while(t);td(e)}function Jo(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function Xw(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var Eu=Math.random().toString(36).slice(2),_s="__reactFiber$"+Eu,od="__reactProps$"+Eu,so="__reactContainer$"+Eu,Y_="__reactEvents$"+Eu,DD="__reactListeners$"+Eu,OD="__reactHandles$"+Eu;function $a(n){var e=n[_s];if(e)return e;for(var t=n.parentNode;t;){if(e=t[so]||t[_s]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=Xw(n);n!==null;){if(t=n[_s])return t;n=Xw(n)}return e}n=t,t=n.parentNode}return null}function Yd(n){return n=n[_s]||n[so],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Pc(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(Me(33))}function z0(n){return n[od]||null}var q_=[],Rc=-1;function va(n){return{current:n}}function nn(n){0>Rc||(n.current=q_[Rc],q_[Rc]=null,Rc--)}function Kt(n,e){Rc++,q_[Rc]=n.current,n.current=e}var ua={},gr=va(ua),Wr=va(!1),gl=ua;function lu(n,e){var t=n.type.contextTypes;if(!t)return ua;var r=n.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=i),i}function Hr(n){return n=n.childContextTypes,n!=null}function o0(){nn(Wr),nn(gr)}function Yw(n,e,t){if(gr.current!==ua)throw Error(Me(168));Kt(gr,e),Kt(Wr,t)}function TC(n,e,t){var r=n.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Me(108,xN(n)||"Unknown",i));return dn({},t,r)}function a0(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ua,gl=gr.current,Kt(gr,n),Kt(Wr,Wr.current),!0}function qw(n,e,t){var r=n.stateNode;if(!r)throw Error(Me(169));t?(n=TC(n,e,gl),r.__reactInternalMemoizedMergedChildContext=n,nn(Wr),nn(gr),Kt(gr,n)):nn(Wr),Kt(Wr,t)}var qs=null,W0=!1,lv=!1;function MC(n){qs===null?qs=[n]:qs.push(n)}function UD(n){W0=!0,MC(n)}function _a(){if(!lv&&qs!==null){lv=!0;var n=0,e=jt;try{var t=qs;for(jt=1;n<t.length;n++){var r=t[n];do r=r(!0);while(r!==null)}qs=null,W0=!1}catch(i){throw qs!==null&&(qs=qs.slice(n+1)),KA(kx,_a),i}finally{jt=e,lv=!1}}return null}var Ic=[],Lc=0,l0=null,c0=0,wi=[],Ti=0,yl=null,Zs=1,Qs="";function Va(n,e){Ic[Lc++]=c0,Ic[Lc++]=l0,l0=n,c0=e}function EC(n,e,t){wi[Ti++]=Zs,wi[Ti++]=Qs,wi[Ti++]=yl,yl=n;var r=Zs;n=Qs;var i=32-qi(r)-1;r&=~(1<<i),t+=1;var s=32-qi(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zs=1<<32-qi(e)+i|t<<i|r,Qs=s+n}else Zs=1<<s|t<<i|r,Qs=n}function Yx(n){n.return!==null&&(Va(n,1),EC(n,1,0))}function qx(n){for(;n===l0;)l0=Ic[--Lc],Ic[Lc]=null,c0=Ic[--Lc],Ic[Lc]=null;for(;n===yl;)yl=wi[--Ti],wi[Ti]=null,Qs=wi[--Ti],wi[Ti]=null,Zs=wi[--Ti],wi[Ti]=null}var ii=null,ri=null,on=!1,Gi=null;function AC(n,e){var t=Mi(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function $w(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,ii=n,ri=Jo(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,ii=n,ri=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=yl!==null?{id:Zs,overflow:Qs}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=Mi(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,ii=n,ri=null,!0):!1;default:return!1}}function $_(n){return(n.mode&1)!==0&&(n.flags&128)===0}function K_(n){if(on){var e=ri;if(e){var t=e;if(!$w(n,e)){if($_(n))throw Error(Me(418));e=Jo(t.nextSibling);var r=ii;e&&$w(n,e)?AC(r,t):(n.flags=n.flags&-4097|2,on=!1,ii=n)}}else{if($_(n))throw Error(Me(418));n.flags=n.flags&-4097|2,on=!1,ii=n}}}function Kw(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;ii=n}function xp(n){if(n!==ii)return!1;if(!on)return Kw(n),on=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!j_(n.type,n.memoizedProps)),e&&(e=ri)){if($_(n))throw CC(),Error(Me(418));for(;e;)AC(n,e),e=Jo(e.nextSibling)}if(Kw(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(Me(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){ri=Jo(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}ri=null}}else ri=ii?Jo(n.stateNode.nextSibling):null;return!0}function CC(){for(var n=ri;n;)n=Jo(n.nextSibling)}function cu(){ri=ii=null,on=!1}function $x(n){Gi===null?Gi=[n]:Gi.push(n)}var kD=po.ReactCurrentBatchConfig;function ch(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(Me(309));var r=t.stateNode}if(!r)throw Error(Me(147,n));var i=r,s=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof n!="string")throw Error(Me(284));if(!t._owner)throw Error(Me(290,n))}return n}function Sp(n,e){throw n=Object.prototype.toString.call(e),Error(Me(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function Zw(n){var e=n._init;return e(n._payload)}function PC(n){function e(g,S){if(n){var b=g.deletions;b===null?(g.deletions=[S],g.flags|=16):b.push(S)}}function t(g,S){if(!n)return null;for(;S!==null;)e(g,S),S=S.sibling;return null}function r(g,S){for(g=new Map;S!==null;)S.key!==null?g.set(S.key,S):g.set(S.index,S),S=S.sibling;return g}function i(g,S){return g=ra(g,S),g.index=0,g.sibling=null,g}function s(g,S,b){return g.index=b,n?(b=g.alternate,b!==null?(b=b.index,b<S?(g.flags|=2,S):b):(g.flags|=2,S)):(g.flags|=1048576,S)}function o(g){return n&&g.alternate===null&&(g.flags|=2),g}function a(g,S,b,M){return S===null||S.tag!==6?(S=mv(b,g.mode,M),S.return=g,S):(S=i(S,b),S.return=g,S)}function l(g,S,b,M){var C=b.type;return C===Mc?d(g,S,b.props.children,M,b.key):S!==null&&(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Oo&&Zw(C)===S.type)?(M=i(S,b.props),M.ref=ch(g,S,b),M.return=g,M):(M=Um(b.type,b.key,b.props,null,g.mode,M),M.ref=ch(g,S,b),M.return=g,M)}function h(g,S,b,M){return S===null||S.tag!==4||S.stateNode.containerInfo!==b.containerInfo||S.stateNode.implementation!==b.implementation?(S=gv(b,g.mode,M),S.return=g,S):(S=i(S,b.children||[]),S.return=g,S)}function d(g,S,b,M,C){return S===null||S.tag!==7?(S=ul(b,g.mode,M,C),S.return=g,S):(S=i(S,b),S.return=g,S)}function f(g,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return S=mv(""+S,g.mode,b),S.return=g,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case up:return b=Um(S.type,S.key,S.props,null,g.mode,b),b.ref=ch(g,null,S),b.return=g,b;case Tc:return S=gv(S,g.mode,b),S.return=g,S;case Oo:var M=S._init;return f(g,M(S._payload),b)}if(Rh(S)||ih(S))return S=ul(S,g.mode,b,null),S.return=g,S;Sp(g,S)}return null}function p(g,S,b,M){var C=S!==null?S.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return C!==null?null:a(g,S,""+b,M);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case up:return b.key===C?l(g,S,b,M):null;case Tc:return b.key===C?h(g,S,b,M):null;case Oo:return C=b._init,p(g,S,C(b._payload),M)}if(Rh(b)||ih(b))return C!==null?null:d(g,S,b,M,null);Sp(g,b)}return null}function m(g,S,b,M,C){if(typeof M=="string"&&M!==""||typeof M=="number")return g=g.get(b)||null,a(S,g,""+M,C);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case up:return g=g.get(M.key===null?b:M.key)||null,l(S,g,M,C);case Tc:return g=g.get(M.key===null?b:M.key)||null,h(S,g,M,C);case Oo:var A=M._init;return m(g,S,b,A(M._payload),C)}if(Rh(M)||ih(M))return g=g.get(b)||null,d(S,g,M,C,null);Sp(S,M)}return null}function v(g,S,b,M){for(var C=null,A=null,R=S,O=S=0,P=null;R!==null&&O<b.length;O++){R.index>O?(P=R,R=null):P=R.sibling;var I=p(g,R,b[O],M);if(I===null){R===null&&(R=P);break}n&&R&&I.alternate===null&&e(g,R),S=s(I,S,O),A===null?C=I:A.sibling=I,A=I,R=P}if(O===b.length)return t(g,R),on&&Va(g,O),C;if(R===null){for(;O<b.length;O++)R=f(g,b[O],M),R!==null&&(S=s(R,S,O),A===null?C=R:A.sibling=R,A=R);return on&&Va(g,O),C}for(R=r(g,R);O<b.length;O++)P=m(R,g,O,b[O],M),P!==null&&(n&&P.alternate!==null&&R.delete(P.key===null?O:P.key),S=s(P,S,O),A===null?C=P:A.sibling=P,A=P);return n&&R.forEach(function(H){return e(g,H)}),on&&Va(g,O),C}function x(g,S,b,M){var C=ih(b);if(typeof C!="function")throw Error(Me(150));if(b=C.call(b),b==null)throw Error(Me(151));for(var A=C=null,R=S,O=S=0,P=null,I=b.next();R!==null&&!I.done;O++,I=b.next()){R.index>O?(P=R,R=null):P=R.sibling;var H=p(g,R,I.value,M);if(H===null){R===null&&(R=P);break}n&&R&&H.alternate===null&&e(g,R),S=s(H,S,O),A===null?C=H:A.sibling=H,A=H,R=P}if(I.done)return t(g,R),on&&Va(g,O),C;if(R===null){for(;!I.done;O++,I=b.next())I=f(g,I.value,M),I!==null&&(S=s(I,S,O),A===null?C=I:A.sibling=I,A=I);return on&&Va(g,O),C}for(R=r(g,R);!I.done;O++,I=b.next())I=m(R,g,O,I.value,M),I!==null&&(n&&I.alternate!==null&&R.delete(I.key===null?O:I.key),S=s(I,S,O),A===null?C=I:A.sibling=I,A=I);return n&&R.forEach(function(X){return e(g,X)}),on&&Va(g,O),C}function _(g,S,b,M){if(typeof b=="object"&&b!==null&&b.type===Mc&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case up:e:{for(var C=b.key,A=S;A!==null;){if(A.key===C){if(C=b.type,C===Mc){if(A.tag===7){t(g,A.sibling),S=i(A,b.props.children),S.return=g,g=S;break e}}else if(A.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Oo&&Zw(C)===A.type){t(g,A.sibling),S=i(A,b.props),S.ref=ch(g,A,b),S.return=g,g=S;break e}t(g,A);break}else e(g,A);A=A.sibling}b.type===Mc?(S=ul(b.props.children,g.mode,M,b.key),S.return=g,g=S):(M=Um(b.type,b.key,b.props,null,g.mode,M),M.ref=ch(g,S,b),M.return=g,g=M)}return o(g);case Tc:e:{for(A=b.key;S!==null;){if(S.key===A)if(S.tag===4&&S.stateNode.containerInfo===b.containerInfo&&S.stateNode.implementation===b.implementation){t(g,S.sibling),S=i(S,b.children||[]),S.return=g,g=S;break e}else{t(g,S);break}else e(g,S);S=S.sibling}S=gv(b,g.mode,M),S.return=g,g=S}return o(g);case Oo:return A=b._init,_(g,S,A(b._payload),M)}if(Rh(b))return v(g,S,b,M);if(ih(b))return x(g,S,b,M);Sp(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,S!==null&&S.tag===6?(t(g,S.sibling),S=i(S,b),S.return=g,g=S):(t(g,S),S=mv(b,g.mode,M),S.return=g,g=S),o(g)):t(g,S)}return _}var uu=PC(!0),RC=PC(!1),u0=va(null),h0=null,Fc=null,Kx=null;function Zx(){Kx=Fc=h0=null}function Qx(n){var e=u0.current;nn(u0),n._currentValue=e}function Z_(n,e,t){for(;n!==null;){var r=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),n===t)break;n=n.return}}function Xc(n,e){h0=n,Kx=Fc=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(zr=!0),n.firstContext=null)}function Ai(n){var e=n._currentValue;if(Kx!==n)if(n={context:n,memoizedValue:e,next:null},Fc===null){if(h0===null)throw Error(Me(308));Fc=n,h0.dependencies={lanes:0,firstContext:n}}else Fc=Fc.next=n;return e}var Ka=null;function Jx(n){Ka===null?Ka=[n]:Ka.push(n)}function IC(n,e,t,r){var i=e.interleaved;return i===null?(t.next=t,Jx(e)):(t.next=i.next,i.next=t),e.interleaved=t,oo(n,r)}function oo(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Uo=!1;function eS(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function LC(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function to(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function ea(n,e,t){var r=n.updateQueue;if(r===null)return null;if(r=r.shared,Ot&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,oo(n,t)}return i=r.interleaved,i===null?(e.next=e,Jx(r)):(e.next=i.next,i.next=e),r.interleaved=e,oo(n,t)}function Im(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,Bx(n,t)}}function Qw(n,e){var t=n.updateQueue,r=n.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var i=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?i=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?i=s=e:s=s.next=e}else i=s=e;t={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function d0(n,e,t,r){var i=n.updateQueue;Uo=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,h=l.next;l.next=null,o===null?s=h:o.next=h,o=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=h:a.next=h,d.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,d=h=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=n,x=a;switch(p=e,m=t,x.tag){case 1:if(v=x.payload,typeof v=="function"){f=v.call(m,f,p);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,p=typeof v=="function"?v.call(m,f,p):v,p==null)break e;f=dn({},f,p);break e;case 2:Uo=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(h=d=m,l=f):d=d.next=m,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=h,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);_l|=o,n.lanes=o,n.memoizedState=f}}function Jw(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var r=n[e],i=r.callback;if(i!==null){if(r.callback=null,r=t,typeof i!="function")throw Error(Me(191,i));i.call(r)}}}var qd={},ws=va(qd),ad=va(qd),ld=va(qd);function Za(n){if(n===qd)throw Error(Me(174));return n}function tS(n,e){switch(Kt(ld,e),Kt(ad,n),Kt(ws,qd),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:I_(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=I_(e,n)}nn(ws),Kt(ws,e)}function hu(){nn(ws),nn(ad),nn(ld)}function FC(n){Za(ld.current);var e=Za(ws.current),t=I_(e,n.type);e!==t&&(Kt(ad,n),Kt(ws,t))}function nS(n){ad.current===n&&(nn(ws),nn(ad))}var cn=va(0);function f0(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))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===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var cv=[];function rS(){for(var n=0;n<cv.length;n++)cv[n]._workInProgressVersionPrimary=null;cv.length=0}var Lm=po.ReactCurrentDispatcher,uv=po.ReactCurrentBatchConfig,vl=0,hn=null,Fn=null,Xn=null,p0=!1,Bh=!1,cd=0,BD=0;function or(){throw Error(Me(321))}function iS(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!Zi(n[t],e[t]))return!1;return!0}function sS(n,e,t,r,i,s){if(vl=s,hn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Lm.current=n===null||n.memoizedState===null?GD:VD,n=t(r,i),Bh){s=0;do{if(Bh=!1,cd=0,25<=s)throw Error(Me(301));s+=1,Xn=Fn=null,e.updateQueue=null,Lm.current=jD,n=t(r,i)}while(Bh)}if(Lm.current=m0,e=Fn!==null&&Fn.next!==null,vl=0,Xn=Fn=hn=null,p0=!1,e)throw Error(Me(300));return n}function oS(){var n=cd!==0;return cd=0,n}function ms(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?hn.memoizedState=Xn=n:Xn=Xn.next=n,Xn}function Ci(){if(Fn===null){var n=hn.alternate;n=n!==null?n.memoizedState:null}else n=Fn.next;var e=Xn===null?hn.memoizedState:Xn.next;if(e!==null)Xn=e,Fn=n;else{if(n===null)throw Error(Me(310));Fn=n,n={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},Xn===null?hn.memoizedState=Xn=n:Xn=Xn.next=n}return Xn}function ud(n,e){return typeof e=="function"?e(n):e}function hv(n){var e=Ci(),t=e.queue;if(t===null)throw Error(Me(311));t.lastRenderedReducer=n;var r=Fn,i=r.baseQueue,s=t.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,t.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,h=s;do{var d=h.lane;if((vl&d)===d)l!==null&&(l=l.next={lane:0,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null}),r=h.hasEagerState?h.eagerState:n(r,h.action);else{var f={lane:d,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,hn.lanes|=d,_l|=d}h=h.next}while(h!==null&&h!==s);l===null?o=r:l.next=a,Zi(r,e.memoizedState)||(zr=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,t.lastRenderedState=r}if(n=t.interleaved,n!==null){i=n;do s=i.lane,hn.lanes|=s,_l|=s,i=i.next;while(i!==n)}else i===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function dv(n){var e=Ci(),t=e.queue;if(t===null)throw Error(Me(311));t.lastRenderedReducer=n;var r=t.dispatch,i=t.pending,s=e.memoizedState;if(i!==null){t.pending=null;var o=i=i.next;do s=n(s,o.action),o=o.next;while(o!==i);Zi(s,e.memoizedState)||(zr=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),t.lastRenderedState=s}return[s,r]}function NC(){}function DC(n,e){var t=hn,r=Ci(),i=e(),s=!Zi(r.memoizedState,i);if(s&&(r.memoizedState=i,zr=!0),r=r.queue,aS(kC.bind(null,t,r,n),[n]),r.getSnapshot!==e||s||Xn!==null&&Xn.memoizedState.tag&1){if(t.flags|=2048,hd(9,UC.bind(null,t,r,i,e),void 0,null),qn===null)throw Error(Me(349));vl&30||OC(t,e,i)}return i}function OC(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=hn.updateQueue,e===null?(e={lastEffect:null,stores:null},hn.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function UC(n,e,t,r){e.value=t,e.getSnapshot=r,BC(e)&&zC(n)}function kC(n,e,t){return t(function(){BC(e)&&zC(n)})}function BC(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Zi(n,t)}catch{return!0}}function zC(n){var e=oo(n,1);e!==null&&$i(e,n,1,-1)}function eT(n){var e=ms();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ud,lastRenderedState:n},e.queue=n,n=n.dispatch=HD.bind(null,hn,n),[e.memoizedState,n]}function hd(n,e,t,r){return n={tag:n,create:e,destroy:t,deps:r,next:null},e=hn.updateQueue,e===null?(e={lastEffect:null,stores:null},hn.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(r=t.next,t.next=n,n.next=r,e.lastEffect=n)),n}function WC(){return Ci().memoizedState}function Fm(n,e,t,r){var i=ms();hn.flags|=n,i.memoizedState=hd(1|e,t,void 0,r===void 0?null:r)}function H0(n,e,t,r){var i=Ci();r=r===void 0?null:r;var s=void 0;if(Fn!==null){var o=Fn.memoizedState;if(s=o.destroy,r!==null&&iS(r,o.deps)){i.memoizedState=hd(e,t,s,r);return}}hn.flags|=n,i.memoizedState=hd(1|e,t,s,r)}function tT(n,e){return Fm(8390656,8,n,e)}function aS(n,e){return H0(2048,8,n,e)}function HC(n,e){return H0(4,2,n,e)}function GC(n,e){return H0(4,4,n,e)}function VC(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function jC(n,e,t){return t=t!=null?t.concat([n]):null,H0(4,4,VC.bind(null,e,n),t)}function lS(){}function XC(n,e){var t=Ci();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&iS(e,r[1])?r[0]:(t.memoizedState=[n,e],n)}function YC(n,e){var t=Ci();e=e===void 0?null:e;var r=t.memoizedState;return r!==null&&e!==null&&iS(e,r[1])?r[0]:(n=n(),t.memoizedState=[n,e],n)}function qC(n,e,t){return vl&21?(Zi(t,e)||(t=JA(),hn.lanes|=t,_l|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,zr=!0),n.memoizedState=t)}function zD(n,e){var t=jt;jt=t!==0&&4>t?t:4,n(!0);var r=uv.transition;uv.transition={};try{n(!1),e()}finally{jt=t,uv.transition=r}}function $C(){return Ci().memoizedState}function WD(n,e,t){var r=na(n);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},KC(n))ZC(e,t);else if(t=IC(n,e,t,r),t!==null){var i=Er();$i(t,n,r,i),QC(t,e,r)}}function HD(n,e,t){var r=na(n),i={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(KC(n))ZC(e,i);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(i.hasEagerState=!0,i.eagerState=a,Zi(a,o)){var l=e.interleaved;l===null?(i.next=i,Jx(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}t=IC(n,e,i,r),t!==null&&(i=Er(),$i(t,n,r,i),QC(t,e,r))}}function KC(n){var e=n.alternate;return n===hn||e!==null&&e===hn}function ZC(n,e){Bh=p0=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function QC(n,e,t){if(t&4194240){var r=e.lanes;r&=n.pendingLanes,t|=r,e.lanes=t,Bx(n,t)}}var m0={readContext:Ai,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},GD={readContext:Ai,useCallback:function(n,e){return ms().memoizedState=[n,e===void 0?null:e],n},useContext:Ai,useEffect:tT,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Fm(4194308,4,VC.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Fm(4194308,4,n,e)},useInsertionEffect:function(n,e){return Fm(4,2,n,e)},useMemo:function(n,e){var t=ms();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var r=ms();return e=t!==void 0?t(e):e,r.memoizedState=r.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},r.queue=n,n=n.dispatch=WD.bind(null,hn,n),[r.memoizedState,n]},useRef:function(n){var e=ms();return n={current:n},e.memoizedState=n},useState:eT,useDebugValue:lS,useDeferredValue:function(n){return ms().memoizedState=n},useTransition:function(){var n=eT(!1),e=n[0];return n=zD.bind(null,n[1]),ms().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var r=hn,i=ms();if(on){if(t===void 0)throw Error(Me(407));t=t()}else{if(t=e(),qn===null)throw Error(Me(349));vl&30||OC(r,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,tT(kC.bind(null,r,s,n),[n]),r.flags|=2048,hd(9,UC.bind(null,r,s,t,e),void 0,null),t},useId:function(){var n=ms(),e=qn.identifierPrefix;if(on){var t=Qs,r=Zs;t=(r&~(1<<32-qi(r)-1)).toString(32)+t,e=":"+e+"R"+t,t=cd++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=BD++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},VD={readContext:Ai,useCallback:XC,useContext:Ai,useEffect:aS,useImperativeHandle:jC,useInsertionEffect:HC,useLayoutEffect:GC,useMemo:YC,useReducer:hv,useRef:WC,useState:function(){return hv(ud)},useDebugValue:lS,useDeferredValue:function(n){var e=Ci();return qC(e,Fn.memoizedState,n)},useTransition:function(){var n=hv(ud)[0],e=Ci().memoizedState;return[n,e]},useMutableSource:NC,useSyncExternalStore:DC,useId:$C,unstable_isNewReconciler:!1},jD={readContext:Ai,useCallback:XC,useContext:Ai,useEffect:aS,useImperativeHandle:jC,useInsertionEffect:HC,useLayoutEffect:GC,useMemo:YC,useReducer:dv,useRef:WC,useState:function(){return dv(ud)},useDebugValue:lS,useDeferredValue:function(n){var e=Ci();return Fn===null?e.memoizedState=n:qC(e,Fn.memoizedState,n)},useTransition:function(){var n=dv(ud)[0],e=Ci().memoizedState;return[n,e]},useMutableSource:NC,useSyncExternalStore:DC,useId:$C,unstable_isNewReconciler:!1};function Ui(n,e){if(n&&n.defaultProps){e=dn({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}function Q_(n,e,t,r){e=n.memoizedState,t=t(r,e),t=t==null?e:dn({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var G0={isMounted:function(n){return(n=n._reactInternals)?El(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var r=Er(),i=na(n),s=to(r,i);s.payload=e,t!=null&&(s.callback=t),e=ea(n,s,i),e!==null&&($i(e,n,i,r),Im(e,n,i))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var r=Er(),i=na(n),s=to(r,i);s.tag=1,s.payload=e,t!=null&&(s.callback=t),e=ea(n,s,i),e!==null&&($i(e,n,i,r),Im(e,n,i))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=Er(),r=na(n),i=to(t,r);i.tag=2,e!=null&&(i.callback=e),e=ea(n,i,r),e!==null&&($i(e,n,r,t),Im(e,n,r))}};function nT(n,e,t,r,i,s,o){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!rd(t,r)||!rd(i,s):!0}function JC(n,e,t){var r=!1,i=ua,s=e.contextType;return typeof s=="object"&&s!==null?s=Ai(s):(i=Hr(e)?gl:gr.current,r=e.contextTypes,s=(r=r!=null)?lu(n,i):ua),e=new e(t,s),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=G0,n.stateNode=e,e._reactInternals=n,r&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=s),e}function rT(n,e,t,r){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,r),e.state!==n&&G0.enqueueReplaceState(e,e.state,null)}function J_(n,e,t,r){var i=n.stateNode;i.props=t,i.state=n.memoizedState,i.refs={},eS(n);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Ai(s):(s=Hr(e)?gl:gr.current,i.context=lu(n,s)),i.state=n.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Q_(n,e,s,t),i.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&G0.enqueueReplaceState(i,i.state,null),d0(n,t,i,r),i.state=n.memoizedState),typeof i.componentDidMount=="function"&&(n.flags|=4194308)}function du(n,e){try{var t="",r=e;do t+=_N(r),r=r.return;while(r);var i=t}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:n,source:e,stack:i,digest:null}}function fv(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function e2(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var XD=typeof WeakMap=="function"?WeakMap:Map;function eP(n,e,t){t=to(-1,t),t.tag=3,t.payload={element:null};var r=e.value;return t.callback=function(){y0||(y0=!0,u2=r),e2(n,e)},t}function tP(n,e,t){t=to(-1,t),t.tag=3;var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;t.payload=function(){return r(i)},t.callback=function(){e2(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){e2(n,e),typeof r!="function"&&(ta===null?ta=new Set([this]):ta.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function iT(n,e,t){var r=n.pingCache;if(r===null){r=n.pingCache=new XD;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(t)||(i.add(t),n=oO.bind(null,n,e,t),e.then(n,n))}function sT(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function oT(n,e,t,r,i){return n.mode&1?(n.flags|=65536,n.lanes=i,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=to(-1,1),e.tag=2,ea(t,e,1))),t.lanes|=1),n)}var YD=po.ReactCurrentOwner,zr=!1;function wr(n,e,t,r){e.child=n===null?RC(e,null,t,r):uu(e,n.child,t,r)}function aT(n,e,t,r,i){t=t.render;var s=e.ref;return Xc(e,i),r=sS(n,e,t,r,s,i),t=oS(),n!==null&&!zr?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,ao(n,e,i)):(on&&t&&Yx(e),e.flags|=1,wr(n,e,r,i),e.child)}function lT(n,e,t,r,i){if(n===null){var s=t.type;return typeof s=="function"&&!gS(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,nP(n,e,s,r,i)):(n=Um(t.type,null,r,e,e.mode,i),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&i)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:rd,t(o,r)&&n.ref===e.ref)return ao(n,e,i)}return e.flags|=1,n=ra(s,r),n.ref=e.ref,n.return=e,e.child=n}function nP(n,e,t,r,i){if(n!==null){var s=n.memoizedProps;if(rd(s,r)&&n.ref===e.ref)if(zr=!1,e.pendingProps=r=s,(n.lanes&i)!==0)n.flags&131072&&(zr=!0);else return e.lanes=n.lanes,ao(n,e,i)}return t2(n,e,t,r,i)}function rP(n,e,t){var r=e.pendingProps,i=r.children,s=n!==null?n.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Kt(Dc,ei),ei|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,Kt(Dc,ei),ei|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:t,Kt(Dc,ei),ei|=r}else s!==null?(r=s.baseLanes|t,e.memoizedState=null):r=t,Kt(Dc,ei),ei|=r;return wr(n,e,i,t),e.child}function iP(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function t2(n,e,t,r,i){var s=Hr(t)?gl:gr.current;return s=lu(e,s),Xc(e,i),t=sS(n,e,t,r,s,i),r=oS(),n!==null&&!zr?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~i,ao(n,e,i)):(on&&r&&Yx(e),e.flags|=1,wr(n,e,t,i),e.child)}function cT(n,e,t,r,i){if(Hr(t)){var s=!0;a0(e)}else s=!1;if(Xc(e,i),e.stateNode===null)Nm(n,e),JC(e,t,r),J_(e,t,r,i),r=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,h=t.contextType;typeof h=="object"&&h!==null?h=Ai(h):(h=Hr(t)?gl:gr.current,h=lu(e,h));var d=t.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==h)&&rT(e,o,r,h),Uo=!1;var p=e.memoizedState;o.state=p,d0(e,r,o,i),l=e.memoizedState,a!==r||p!==l||Wr.current||Uo?(typeof d=="function"&&(Q_(e,t,d,r),l=e.memoizedState),(a=Uo||nT(e,t,a,r,p,l,h))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=h,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,LC(n,e),a=e.memoizedProps,h=e.type===e.elementType?a:Ui(e.type,a),o.props=h,f=e.pendingProps,p=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=Ai(l):(l=Hr(t)?gl:gr.current,l=lu(e,l));var m=t.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||p!==l)&&rT(e,o,r,l),Uo=!1,p=e.memoizedState,o.state=p,d0(e,r,o,i);var v=e.memoizedState;a!==f||p!==v||Wr.current||Uo?(typeof m=="function"&&(Q_(e,t,m,r),v=e.memoizedState),(h=Uo||nT(e,t,h,r,p,v,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),o.props=r,o.state=v,o.context=l,r=h):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),r=!1)}return n2(n,e,t,r,s,i)}function n2(n,e,t,r,i,s){iP(n,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&qw(e,t,!1),ao(n,e,s);r=e.stateNode,YD.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,n!==null&&o?(e.child=uu(e,n.child,null,s),e.child=uu(e,null,a,s)):wr(n,e,a,s),e.memoizedState=r.state,i&&qw(e,t,!0),e.child}function sP(n){var e=n.stateNode;e.pendingContext?Yw(n,e.pendingContext,e.pendingContext!==e.context):e.context&&Yw(n,e.context,!1),tS(n,e.containerInfo)}function uT(n,e,t,r,i){return cu(),$x(i),e.flags|=256,wr(n,e,t,r),e.child}var r2={dehydrated:null,treeContext:null,retryLane:0};function i2(n){return{baseLanes:n,cachePool:null,transitions:null}}function oP(n,e,t){var r=e.pendingProps,i=cn.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(i|=1),Kt(cn,i&1),n===null)return K_(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,n=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=X0(o,r,0,null),n=ul(n,r,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=i2(t),e.memoizedState=r2,n):cS(e,o));if(i=n.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return qD(n,e,o,r,a,i,t);if(s){s=r.fallback,o=e.mode,i=n.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=ra(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ra(a,s):(s=ul(s,o,t,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=n.child.memoizedState,o=o===null?i2(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=r2,r}return s=n.child,n=s.sibling,r=ra(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=t),r.return=e,r.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=r,e.memoizedState=null,r}function cS(n,e){return e=X0({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function bp(n,e,t,r){return r!==null&&$x(r),uu(e,n.child,null,t),n=cS(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function qD(n,e,t,r,i,s,o){if(t)return e.flags&256?(e.flags&=-257,r=fv(Error(Me(422))),bp(n,e,o,r)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=X0({mode:"visible",children:r.children},i,0,null),s=ul(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&uu(e,n.child,null,o),e.child.memoizedState=i2(o),e.memoizedState=r2,s);if(!(e.mode&1))return bp(n,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Me(419)),r=fv(s,r,void 0),bp(n,e,o,r)}if(a=(o&n.childLanes)!==0,zr||a){if(r=qn,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,oo(n,i),$i(r,n,i,-1))}return mS(),r=fv(Error(Me(421))),bp(n,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=n.child,e=aO.bind(null,n),i._reactRetry=e,null):(n=s.treeContext,ri=Jo(i.nextSibling),ii=e,on=!0,Gi=null,n!==null&&(wi[Ti++]=Zs,wi[Ti++]=Qs,wi[Ti++]=yl,Zs=n.id,Qs=n.overflow,yl=e),e=cS(e,r.children),e.flags|=4096,e)}function hT(n,e,t){n.lanes|=e;var r=n.alternate;r!==null&&(r.lanes|=e),Z_(n.return,e,t)}function pv(n,e,t,r,i){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=t,s.tailMode=i)}function aP(n,e,t){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(wr(n,e,r.children,t),r=cn.current,r&2)r=r&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&hT(n,t,e);else if(n.tag===19)hT(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}r&=1}if(Kt(cn,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(t=e.child,i=null;t!==null;)n=t.alternate,n!==null&&f0(n)===null&&(i=t),t=t.sibling;t=i,t===null?(i=e.child,e.child=null):(i=t.sibling,t.sibling=null),pv(e,!1,i,t,s);break;case"backwards":for(t=null,i=e.child,e.child=null;i!==null;){if(n=i.alternate,n!==null&&f0(n)===null){e.child=i;break}n=i.sibling,i.sibling=t,t=i,i=n}pv(e,!0,t,null,s);break;case"together":pv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Nm(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function ao(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),_l|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Me(153));if(e.child!==null){for(n=e.child,t=ra(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=ra(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function $D(n,e,t){switch(e.tag){case 3:sP(e),cu();break;case 5:FC(e);break;case 1:Hr(e.type)&&a0(e);break;case 4:tS(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Kt(u0,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Kt(cn,cn.current&1),e.flags|=128,null):t&e.child.childLanes?oP(n,e,t):(Kt(cn,cn.current&1),n=ao(n,e,t),n!==null?n.sibling:null);Kt(cn,cn.current&1);break;case 19:if(r=(t&e.childLanes)!==0,n.flags&128){if(r)return aP(n,e,t);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Kt(cn,cn.current),r)break;return null;case 22:case 23:return e.lanes=0,rP(n,e,t)}return ao(n,e,t)}var lP,s2,cP,uP;lP=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};s2=function(){};cP=function(n,e,t,r){var i=n.memoizedProps;if(i!==r){n=e.stateNode,Za(ws.current);var s=null;switch(t){case"input":i=A_(n,i),r=A_(n,r),s=[];break;case"select":i=dn({},i,{value:void 0}),r=dn({},r,{value:void 0}),s=[];break;case"textarea":i=R_(n,i),r=R_(n,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(n.onclick=s0)}L_(t,r);var o;t=null;for(h in i)if(!r.hasOwnProperty(h)&&i.hasOwnProperty(h)&&i[h]!=null)if(h==="style"){var a=i[h];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else h!=="dangerouslySetInnerHTML"&&h!=="children"&&h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(Kh.hasOwnProperty(h)?s||(s=[]):(s=s||[]).push(h,null));for(h in r){var l=r[h];if(a=i!=null?i[h]:void 0,r.hasOwnProperty(h)&&l!==a&&(l!=null||a!=null))if(h==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(h,t)),t=l;else h==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(h,l)):h==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(h,""+l):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&(Kh.hasOwnProperty(h)?(l!=null&&h==="onScroll"&&en("scroll",n),s||a===l||(s=[])):(s=s||[]).push(h,l))}t&&(s=s||[]).push("style",t);var h=s;(e.updateQueue=h)&&(e.flags|=4)}};uP=function(n,e,t,r){t!==r&&(e.flags|=4)};function uh(n,e){if(!on)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:r.sibling=null}}function ar(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,r=0;if(e)for(var i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=n,i=i.sibling;else for(i=n.child;i!==null;)t|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=n,i=i.sibling;return n.subtreeFlags|=r,n.childLanes=t,e}function KD(n,e,t){var r=e.pendingProps;switch(qx(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ar(e),null;case 1:return Hr(e.type)&&o0(),ar(e),null;case 3:return r=e.stateNode,hu(),nn(Wr),nn(gr),rS(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(n===null||n.child===null)&&(xp(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Gi!==null&&(f2(Gi),Gi=null))),s2(n,e),ar(e),null;case 5:nS(e);var i=Za(ld.current);if(t=e.type,n!==null&&e.stateNode!=null)cP(n,e,t,r,i),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Me(166));return ar(e),null}if(n=Za(ws.current),xp(e)){r=e.stateNode,t=e.type;var s=e.memoizedProps;switch(r[_s]=e,r[od]=s,n=(e.mode&1)!==0,t){case"dialog":en("cancel",r),en("close",r);break;case"iframe":case"object":case"embed":en("load",r);break;case"video":case"audio":for(i=0;i<Lh.length;i++)en(Lh[i],r);break;case"source":en("error",r);break;case"img":case"image":case"link":en("error",r),en("load",r);break;case"details":en("toggle",r);break;case"input":xw(r,s),en("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},en("invalid",r);break;case"textarea":bw(r,s),en("invalid",r)}L_(t,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&_p(r.textContent,a,n),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&_p(r.textContent,a,n),i=["children",""+a]):Kh.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&en("scroll",r)}switch(t){case"input":hp(r),Sw(r,s,!0);break;case"textarea":hp(r),ww(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=s0)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=kA(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof r.is=="string"?n=o.createElement(t,{is:r.is}):(n=o.createElement(t),t==="select"&&(o=n,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):n=o.createElementNS(n,t),n[_s]=e,n[od]=r,lP(n,e,!1,!1),e.stateNode=n;e:{switch(o=F_(t,r),t){case"dialog":en("cancel",n),en("close",n),i=r;break;case"iframe":case"object":case"embed":en("load",n),i=r;break;case"video":case"audio":for(i=0;i<Lh.length;i++)en(Lh[i],n);i=r;break;case"source":en("error",n),i=r;break;case"img":case"image":case"link":en("error",n),en("load",n),i=r;break;case"details":en("toggle",n),i=r;break;case"input":xw(n,r),i=A_(n,r),en("invalid",n);break;case"option":i=r;break;case"select":n._wrapperState={wasMultiple:!!r.multiple},i=dn({},r,{value:void 0}),en("invalid",n);break;case"textarea":bw(n,r),i=R_(n,r),en("invalid",n);break;default:i=r}L_(t,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?WA(n,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&BA(n,l)):s==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&Zh(n,l):typeof l=="number"&&Zh(n,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Kh.hasOwnProperty(s)?l!=null&&s==="onScroll"&&en("scroll",n):l!=null&&Fx(n,s,l,o))}switch(t){case"input":hp(n),Sw(n,r,!1);break;case"textarea":hp(n),ww(n);break;case"option":r.value!=null&&n.setAttribute("value",""+ca(r.value));break;case"select":n.multiple=!!r.multiple,s=r.value,s!=null?Hc(n,!!r.multiple,s,!1):r.defaultValue!=null&&Hc(n,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(n.onclick=s0)}switch(t){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ar(e),null;case 6:if(n&&e.stateNode!=null)uP(n,e,n.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(Me(166));if(t=Za(ld.current),Za(ws.current),xp(e)){if(r=e.stateNode,t=e.memoizedProps,r[_s]=e,(s=r.nodeValue!==t)&&(n=ii,n!==null))switch(n.tag){case 3:_p(r.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&_p(r.nodeValue,t,(n.mode&1)!==0)}s&&(e.flags|=4)}else r=(t.nodeType===9?t:t.ownerDocument).createTextNode(r),r[_s]=e,e.stateNode=r}return ar(e),null;case 13:if(nn(cn),r=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(on&&ri!==null&&e.mode&1&&!(e.flags&128))CC(),cu(),e.flags|=98560,s=!1;else if(s=xp(e),r!==null&&r.dehydrated!==null){if(n===null){if(!s)throw Error(Me(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Me(317));s[_s]=e}else cu(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ar(e),s=!1}else Gi!==null&&(f2(Gi),Gi=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(r=r!==null,r!==(n!==null&&n.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(n===null||cn.current&1?On===0&&(On=3):mS())),e.updateQueue!==null&&(e.flags|=4),ar(e),null);case 4:return hu(),s2(n,e),n===null&&id(e.stateNode.containerInfo),ar(e),null;case 10:return Qx(e.type._context),ar(e),null;case 17:return Hr(e.type)&&o0(),ar(e),null;case 19:if(nn(cn),s=e.memoizedState,s===null)return ar(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)uh(s,!1);else{if(On!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(o=f0(n),o!==null){for(e.flags|=128,uh(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=t,t=e.child;t!==null;)s=t,n=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=n,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,n=o.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return Kt(cn,cn.current&1|2),e.child}n=n.sibling}s.tail!==null&&wn()>fu&&(e.flags|=128,r=!0,uh(s,!1),e.lanes=4194304)}else{if(!r)if(n=f0(o),n!==null){if(e.flags|=128,r=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),uh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!on)return ar(e),null}else 2*wn()-s.renderingStartTime>fu&&t!==1073741824&&(e.flags|=128,r=!0,uh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=wn(),e.sibling=null,t=cn.current,Kt(cn,r?t&1|2:t&1),e):(ar(e),null);case 22:case 23:return pS(),r=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ei&1073741824&&(ar(e),e.subtreeFlags&6&&(e.flags|=8192)):ar(e),null;case 24:return null;case 25:return null}throw Error(Me(156,e.tag))}function ZD(n,e){switch(qx(e),e.tag){case 1:return Hr(e.type)&&o0(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return hu(),nn(Wr),nn(gr),rS(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return nS(e),null;case 13:if(nn(cn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Me(340));cu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return nn(cn),null;case 4:return hu(),null;case 10:return Qx(e.type._context),null;case 22:case 23:return pS(),null;case 24:return null;default:return null}}var wp=!1,dr=!1,QD=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function Nc(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){yn(n,e,r)}else t.current=null}function o2(n,e,t){try{t()}catch(r){yn(n,e,r)}}var dT=!1;function JD(n,e){if(G_=n0,n=mC(),Xx(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,h=0,d=0,f=n,p=null;t:for(;;){for(var m;f!==t||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===n)break t;if(p===t&&++h===i&&(a=o),p===s&&++d===r&&(l=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(V_={focusedElem:n,selectionRange:t},n0=!1,Ge=e;Ge!==null;)if(e=Ge,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,Ge=n;else for(;Ge!==null;){e=Ge;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,_=v.memoizedState,g=e.stateNode,S=g.getSnapshotBeforeUpdate(e.elementType===e.type?x:Ui(e.type,x),_);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Me(163))}}catch(M){yn(e,e.return,M)}if(n=e.sibling,n!==null){n.return=e.return,Ge=n;break}Ge=e.return}return v=dT,dT=!1,v}function zh(n,e,t){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&n)===n){var s=i.destroy;i.destroy=void 0,s!==void 0&&o2(e,t,s)}i=i.next}while(i!==r)}}function V0(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}}function a2(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function hP(n){var e=n.alternate;e!==null&&(n.alternate=null,hP(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[_s],delete e[od],delete e[Y_],delete e[DD],delete e[OD])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function dP(n){return n.tag===5||n.tag===3||n.tag===4}function fT(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||dP(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function l2(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=s0));else if(r!==4&&(n=n.child,n!==null))for(l2(n,e,t),n=n.sibling;n!==null;)l2(n,e,t),n=n.sibling}function c2(n,e,t){var r=n.tag;if(r===5||r===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(r!==4&&(n=n.child,n!==null))for(c2(n,e,t),n=n.sibling;n!==null;)c2(n,e,t),n=n.sibling}var Qn=null,Hi=!1;function Mo(n,e,t){for(t=t.child;t!==null;)fP(n,e,t),t=t.sibling}function fP(n,e,t){if(bs&&typeof bs.onCommitFiberUnmount=="function")try{bs.onCommitFiberUnmount(O0,t)}catch{}switch(t.tag){case 5:dr||Nc(t,e);case 6:var r=Qn,i=Hi;Qn=null,Mo(n,e,t),Qn=r,Hi=i,Qn!==null&&(Hi?(n=Qn,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Qn.removeChild(t.stateNode));break;case 18:Qn!==null&&(Hi?(n=Qn,t=t.stateNode,n.nodeType===8?av(n.parentNode,t):n.nodeType===1&&av(n,t),td(n)):av(Qn,t.stateNode));break;case 4:r=Qn,i=Hi,Qn=t.stateNode.containerInfo,Hi=!0,Mo(n,e,t),Qn=r,Hi=i;break;case 0:case 11:case 14:case 15:if(!dr&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&o2(t,e,o),i=i.next}while(i!==r)}Mo(n,e,t);break;case 1:if(!dr&&(Nc(t,e),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(a){yn(t,e,a)}Mo(n,e,t);break;case 21:Mo(n,e,t);break;case 22:t.mode&1?(dr=(r=dr)||t.memoizedState!==null,Mo(n,e,t),dr=r):Mo(n,e,t);break;default:Mo(n,e,t)}}function pT(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new QD),e.forEach(function(r){var i=lO.bind(null,n,r);t.has(r)||(t.add(r),r.then(i,i))})}}function Li(n,e){var t=e.deletions;if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];try{var s=n,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Qn=a.stateNode,Hi=!1;break e;case 3:Qn=a.stateNode.containerInfo,Hi=!0;break e;case 4:Qn=a.stateNode.containerInfo,Hi=!0;break e}a=a.return}if(Qn===null)throw Error(Me(160));fP(s,o,i),Qn=null,Hi=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(h){yn(i,e,h)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)pP(e,n),e=e.sibling}function pP(n,e){var t=n.alternate,r=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Li(e,n),ps(n),r&4){try{zh(3,n,n.return),V0(3,n)}catch(x){yn(n,n.return,x)}try{zh(5,n,n.return)}catch(x){yn(n,n.return,x)}}break;case 1:Li(e,n),ps(n),r&512&&t!==null&&Nc(t,t.return);break;case 5:if(Li(e,n),ps(n),r&512&&t!==null&&Nc(t,t.return),n.flags&32){var i=n.stateNode;try{Zh(i,"")}catch(x){yn(n,n.return,x)}}if(r&4&&(i=n.stateNode,i!=null)){var s=n.memoizedProps,o=t!==null?t.memoizedProps:s,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&OA(i,s),F_(a,o);var h=F_(a,s);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?WA(i,f):d==="dangerouslySetInnerHTML"?BA(i,f):d==="children"?Zh(i,f):Fx(i,d,f,h)}switch(a){case"input":C_(i,s);break;case"textarea":UA(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?Hc(i,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?Hc(i,!!s.multiple,s.defaultValue,!0):Hc(i,!!s.multiple,s.multiple?[]:"",!1))}i[od]=s}catch(x){yn(n,n.return,x)}}break;case 6:if(Li(e,n),ps(n),r&4){if(n.stateNode===null)throw Error(Me(162));i=n.stateNode,s=n.memoizedProps;try{i.nodeValue=s}catch(x){yn(n,n.return,x)}}break;case 3:if(Li(e,n),ps(n),r&4&&t!==null&&t.memoizedState.isDehydrated)try{td(e.containerInfo)}catch(x){yn(n,n.return,x)}break;case 4:Li(e,n),ps(n);break;case 13:Li(e,n),ps(n),i=n.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(dS=wn())),r&4&&pT(n);break;case 22:if(d=t!==null&&t.memoizedState!==null,n.mode&1?(dr=(h=dr)||d,Li(e,n),dr=h):Li(e,n),ps(n),r&8192){if(h=n.memoizedState!==null,(n.stateNode.isHidden=h)&&!d&&n.mode&1)for(Ge=n,d=n.child;d!==null;){for(f=Ge=d;Ge!==null;){switch(p=Ge,m=p.child,p.tag){case 0:case 11:case 14:case 15:zh(4,p,p.return);break;case 1:Nc(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,t=p.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(x){yn(r,t,x)}}break;case 5:Nc(p,p.return);break;case 22:if(p.memoizedState!==null){gT(f);continue}}m!==null?(m.return=p,Ge=m):gT(f)}d=d.sibling}e:for(d=null,f=n;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,h?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=zA("display",o))}catch(x){yn(n,n.return,x)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=h?"":f.memoizedProps}catch(x){yn(n,n.return,x)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===n)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===n)break e;for(;f.sibling===null;){if(f.return===null||f.return===n)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Li(e,n),ps(n),r&4&&pT(n);break;case 21:break;default:Li(e,n),ps(n)}}function ps(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(dP(t)){var r=t;break e}t=t.return}throw Error(Me(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Zh(i,""),r.flags&=-33);var s=fT(n);c2(n,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=fT(n);l2(n,a,o);break;default:throw Error(Me(161))}}catch(l){yn(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function eO(n,e,t){Ge=n,mP(n)}function mP(n,e,t){for(var r=(n.mode&1)!==0;Ge!==null;){var i=Ge,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||wp;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||dr;a=wp;var h=dr;if(wp=o,(dr=l)&&!h)for(Ge=i;Ge!==null;)o=Ge,l=o.child,o.tag===22&&o.memoizedState!==null?yT(i):l!==null?(l.return=o,Ge=l):yT(i);for(;s!==null;)Ge=s,mP(s),s=s.sibling;Ge=i,wp=a,dr=h}mT(n)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Ge=s):mT(n)}}function mT(n){for(;Ge!==null;){var e=Ge;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:dr||V0(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!dr)if(t===null)r.componentDidMount();else{var i=e.elementType===e.type?t.memoizedProps:Ui(e.type,t.memoizedProps);r.componentDidUpdate(i,t.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Jw(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}Jw(e,o,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var h=e.alternate;if(h!==null){var d=h.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&td(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Me(163))}dr||e.flags&512&&a2(e)}catch(p){yn(e,e.return,p)}}if(e===n){Ge=null;break}if(t=e.sibling,t!==null){t.return=e.return,Ge=t;break}Ge=e.return}}function gT(n){for(;Ge!==null;){var e=Ge;if(e===n){Ge=null;break}var t=e.sibling;if(t!==null){t.return=e.return,Ge=t;break}Ge=e.return}}function yT(n){for(;Ge!==null;){var e=Ge;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{V0(4,e)}catch(l){yn(e,t,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){yn(e,i,l)}}var s=e.return;try{a2(e)}catch(l){yn(e,s,l)}break;case 5:var o=e.return;try{a2(e)}catch(l){yn(e,o,l)}}}catch(l){yn(e,e.return,l)}if(e===n){Ge=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Ge=a;break}Ge=e.return}}var tO=Math.ceil,g0=po.ReactCurrentDispatcher,uS=po.ReactCurrentOwner,Ei=po.ReactCurrentBatchConfig,Ot=0,qn=null,Pn=null,Jn=0,ei=0,Dc=va(0),On=0,dd=null,_l=0,j0=0,hS=0,Wh=null,Ur=null,dS=0,fu=1/0,Ys=null,y0=!1,u2=null,ta=null,Tp=!1,qo=null,v0=0,Hh=0,h2=null,Dm=-1,Om=0;function Er(){return Ot&6?wn():Dm!==-1?Dm:Dm=wn()}function na(n){return n.mode&1?Ot&2&&Jn!==0?Jn&-Jn:kD.transition!==null?(Om===0&&(Om=JA()),Om):(n=jt,n!==0||(n=window.event,n=n===void 0?16:oC(n.type)),n):1}function $i(n,e,t,r){if(50<Hh)throw Hh=0,h2=null,Error(Me(185));jd(n,t,r),(!(Ot&2)||n!==qn)&&(n===qn&&(!(Ot&2)&&(j0|=t),On===4&&zo(n,Jn)),Gr(n,r),t===1&&Ot===0&&!(e.mode&1)&&(fu=wn()+500,W0&&_a()))}function Gr(n,e){var t=n.callbackNode;kN(n,e);var r=t0(n,n===qn?Jn:0);if(r===0)t!==null&&Ew(t),n.callbackNode=null,n.callbackPriority=0;else if(e=r&-r,n.callbackPriority!==e){if(t!=null&&Ew(t),e===1)n.tag===0?UD(vT.bind(null,n)):MC(vT.bind(null,n)),FD(function(){!(Ot&6)&&_a()}),t=null;else{switch(eC(r)){case 1:t=kx;break;case 4:t=ZA;break;case 16:t=e0;break;case 536870912:t=QA;break;default:t=e0}t=wP(t,gP.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function gP(n,e){if(Dm=-1,Om=0,Ot&6)throw Error(Me(327));var t=n.callbackNode;if(Yc()&&n.callbackNode!==t)return null;var r=t0(n,n===qn?Jn:0);if(r===0)return null;if(r&30||r&n.expiredLanes||e)e=_0(n,r);else{e=r;var i=Ot;Ot|=2;var s=vP();(qn!==n||Jn!==e)&&(Ys=null,fu=wn()+500,cl(n,e));do try{iO();break}catch(a){yP(n,a)}while(!0);Zx(),g0.current=s,Ot=i,Pn!==null?e=0:(qn=null,Jn=0,e=On)}if(e!==0){if(e===2&&(i=k_(n),i!==0&&(r=i,e=d2(n,i))),e===1)throw t=dd,cl(n,0),zo(n,r),Gr(n,wn()),t;if(e===6)zo(n,r);else{if(i=n.current.alternate,!(r&30)&&!nO(i)&&(e=_0(n,r),e===2&&(s=k_(n),s!==0&&(r=s,e=d2(n,s))),e===1))throw t=dd,cl(n,0),zo(n,r),Gr(n,wn()),t;switch(n.finishedWork=i,n.finishedLanes=r,e){case 0:case 1:throw Error(Me(345));case 2:ja(n,Ur,Ys);break;case 3:if(zo(n,r),(r&130023424)===r&&(e=dS+500-wn(),10<e)){if(t0(n,0)!==0)break;if(i=n.suspendedLanes,(i&r)!==r){Er(),n.pingedLanes|=n.suspendedLanes&i;break}n.timeoutHandle=X_(ja.bind(null,n,Ur,Ys),e);break}ja(n,Ur,Ys);break;case 4:if(zo(n,r),(r&4194240)===r)break;for(e=n.eventTimes,i=-1;0<r;){var o=31-qi(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=wn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*tO(r/1960))-r,10<r){n.timeoutHandle=X_(ja.bind(null,n,Ur,Ys),r);break}ja(n,Ur,Ys);break;case 5:ja(n,Ur,Ys);break;default:throw Error(Me(329))}}}return Gr(n,wn()),n.callbackNode===t?gP.bind(null,n):null}function d2(n,e){var t=Wh;return n.current.memoizedState.isDehydrated&&(cl(n,e).flags|=256),n=_0(n,e),n!==2&&(e=Ur,Ur=t,e!==null&&f2(e)),n}function f2(n){Ur===null?Ur=n:Ur.push.apply(Ur,n)}function nO(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var r=0;r<t.length;r++){var i=t[r],s=i.getSnapshot;i=i.value;try{if(!Zi(s(),i))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function zo(n,e){for(e&=~hS,e&=~j0,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-qi(e),r=1<<t;n[t]=-1,e&=~r}}function vT(n){if(Ot&6)throw Error(Me(327));Yc();var e=t0(n,0);if(!(e&1))return Gr(n,wn()),null;var t=_0(n,e);if(n.tag!==0&&t===2){var r=k_(n);r!==0&&(e=r,t=d2(n,r))}if(t===1)throw t=dd,cl(n,0),zo(n,e),Gr(n,wn()),t;if(t===6)throw Error(Me(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,ja(n,Ur,Ys),Gr(n,wn()),null}function fS(n,e){var t=Ot;Ot|=1;try{return n(e)}finally{Ot=t,Ot===0&&(fu=wn()+500,W0&&_a())}}function xl(n){qo!==null&&qo.tag===0&&!(Ot&6)&&Yc();var e=Ot;Ot|=1;var t=Ei.transition,r=jt;try{if(Ei.transition=null,jt=1,n)return n()}finally{jt=r,Ei.transition=t,Ot=e,!(Ot&6)&&_a()}}function pS(){ei=Dc.current,nn(Dc)}function cl(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,LD(t)),Pn!==null)for(t=Pn.return;t!==null;){var r=t;switch(qx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&o0();break;case 3:hu(),nn(Wr),nn(gr),rS();break;case 5:nS(r);break;case 4:hu();break;case 13:nn(cn);break;case 19:nn(cn);break;case 10:Qx(r.type._context);break;case 22:case 23:pS()}t=t.return}if(qn=n,Pn=n=ra(n.current,null),Jn=ei=e,On=0,dd=null,hS=j0=_l=0,Ur=Wh=null,Ka!==null){for(e=0;e<Ka.length;e++)if(t=Ka[e],r=t.interleaved,r!==null){t.interleaved=null;var i=r.next,s=t.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}t.pending=r}Ka=null}return n}function yP(n,e){do{var t=Pn;try{if(Zx(),Lm.current=m0,p0){for(var r=hn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}p0=!1}if(vl=0,Xn=Fn=hn=null,Bh=!1,cd=0,uS.current=null,t===null||t.return===null){On=1,dd=e,Pn=null;break}e:{var s=n,o=t.return,a=t,l=e;if(e=Jn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var h=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=sT(o);if(m!==null){m.flags&=-257,oT(m,o,a,s,e),m.mode&1&&iT(s,h,e),e=m,l=h;var v=e.updateQueue;if(v===null){var x=new Set;x.add(l),e.updateQueue=x}else v.add(l);break e}else{if(!(e&1)){iT(s,h,e),mS();break e}l=Error(Me(426))}}else if(on&&a.mode&1){var _=sT(o);if(_!==null){!(_.flags&65536)&&(_.flags|=256),oT(_,o,a,s,e),$x(du(l,a));break e}}s=l=du(l,a),On!==4&&(On=2),Wh===null?Wh=[s]:Wh.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var g=eP(s,l,e);Qw(s,g);break e;case 1:a=l;var S=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof S.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ta===null||!ta.has(b)))){s.flags|=65536,e&=-e,s.lanes|=e;var M=tP(s,a,e);Qw(s,M);break e}}s=s.return}while(s!==null)}xP(t)}catch(C){e=C,Pn===t&&t!==null&&(Pn=t=t.return);continue}break}while(!0)}function vP(){var n=g0.current;return g0.current=m0,n===null?m0:n}function mS(){(On===0||On===3||On===2)&&(On=4),qn===null||!(_l&268435455)&&!(j0&268435455)||zo(qn,Jn)}function _0(n,e){var t=Ot;Ot|=2;var r=vP();(qn!==n||Jn!==e)&&(Ys=null,cl(n,e));do try{rO();break}catch(i){yP(n,i)}while(!0);if(Zx(),Ot=t,g0.current=r,Pn!==null)throw Error(Me(261));return qn=null,Jn=0,On}function rO(){for(;Pn!==null;)_P(Pn)}function iO(){for(;Pn!==null&&!PN();)_P(Pn)}function _P(n){var e=bP(n.alternate,n,ei);n.memoizedProps=n.pendingProps,e===null?xP(n):Pn=e,uS.current=null}function xP(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=ZD(t,e),t!==null){t.flags&=32767,Pn=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{On=6,Pn=null;return}}else if(t=KD(t,e,ei),t!==null){Pn=t;return}if(e=e.sibling,e!==null){Pn=e;return}Pn=e=n}while(e!==null);On===0&&(On=5)}function ja(n,e,t){var r=jt,i=Ei.transition;try{Ei.transition=null,jt=1,sO(n,e,t,r)}finally{Ei.transition=i,jt=r}return null}function sO(n,e,t,r){do Yc();while(qo!==null);if(Ot&6)throw Error(Me(327));t=n.finishedWork;var i=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(Me(177));n.callbackNode=null,n.callbackPriority=0;var s=t.lanes|t.childLanes;if(BN(n,s),n===qn&&(Pn=qn=null,Jn=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||Tp||(Tp=!0,wP(e0,function(){return Yc(),null})),s=(t.flags&15990)!==0,t.subtreeFlags&15990||s){s=Ei.transition,Ei.transition=null;var o=jt;jt=1;var a=Ot;Ot|=4,uS.current=null,JD(n,t),pP(t,n),MD(V_),n0=!!G_,V_=G_=null,n.current=t,eO(t),RN(),Ot=a,jt=o,Ei.transition=s}else n.current=t;if(Tp&&(Tp=!1,qo=n,v0=i),s=n.pendingLanes,s===0&&(ta=null),FN(t.stateNode),Gr(n,wn()),e!==null)for(r=n.onRecoverableError,t=0;t<e.length;t++)i=e[t],r(i.value,{componentStack:i.stack,digest:i.digest});if(y0)throw y0=!1,n=u2,u2=null,n;return v0&1&&n.tag!==0&&Yc(),s=n.pendingLanes,s&1?n===h2?Hh++:(Hh=0,h2=n):Hh=0,_a(),null}function Yc(){if(qo!==null){var n=eC(v0),e=Ei.transition,t=jt;try{if(Ei.transition=null,jt=16>n?16:n,qo===null)var r=!1;else{if(n=qo,qo=null,v0=0,Ot&6)throw Error(Me(331));var i=Ot;for(Ot|=4,Ge=n.current;Ge!==null;){var s=Ge,o=s.child;if(Ge.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var h=a[l];for(Ge=h;Ge!==null;){var d=Ge;switch(d.tag){case 0:case 11:case 15:zh(8,d,s)}var f=d.child;if(f!==null)f.return=d,Ge=f;else for(;Ge!==null;){d=Ge;var p=d.sibling,m=d.return;if(hP(d),d===h){Ge=null;break}if(p!==null){p.return=m,Ge=p;break}Ge=m}}}var v=s.alternate;if(v!==null){var x=v.child;if(x!==null){v.child=null;do{var _=x.sibling;x.sibling=null,x=_}while(x!==null)}}Ge=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,Ge=o;else e:for(;Ge!==null;){if(s=Ge,s.flags&2048)switch(s.tag){case 0:case 11:case 15:zh(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,Ge=g;break e}Ge=s.return}}var S=n.current;for(Ge=S;Ge!==null;){o=Ge;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,Ge=b;else e:for(o=S;Ge!==null;){if(a=Ge,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:V0(9,a)}}catch(C){yn(a,a.return,C)}if(a===o){Ge=null;break e}var M=a.sibling;if(M!==null){M.return=a.return,Ge=M;break e}Ge=a.return}}if(Ot=i,_a(),bs&&typeof bs.onPostCommitFiberRoot=="function")try{bs.onPostCommitFiberRoot(O0,n)}catch{}r=!0}return r}finally{jt=t,Ei.transition=e}}return!1}function _T(n,e,t){e=du(t,e),e=eP(n,e,1),n=ea(n,e,1),e=Er(),n!==null&&(jd(n,1,e),Gr(n,e))}function yn(n,e,t){if(n.tag===3)_T(n,n,t);else for(;e!==null;){if(e.tag===3){_T(e,n,t);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ta===null||!ta.has(r))){n=du(t,n),n=tP(e,n,1),e=ea(e,n,1),n=Er(),e!==null&&(jd(e,1,n),Gr(e,n));break}}e=e.return}}function oO(n,e,t){var r=n.pingCache;r!==null&&r.delete(e),e=Er(),n.pingedLanes|=n.suspendedLanes&t,qn===n&&(Jn&t)===t&&(On===4||On===3&&(Jn&130023424)===Jn&&500>wn()-dS?cl(n,0):hS|=t),Gr(n,e)}function SP(n,e){e===0&&(n.mode&1?(e=pp,pp<<=1,!(pp&130023424)&&(pp=4194304)):e=1);var t=Er();n=oo(n,e),n!==null&&(jd(n,e,t),Gr(n,t))}function aO(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),SP(n,t)}function lO(n,e){var t=0;switch(n.tag){case 13:var r=n.stateNode,i=n.memoizedState;i!==null&&(t=i.retryLane);break;case 19:r=n.stateNode;break;default:throw Error(Me(314))}r!==null&&r.delete(e),SP(n,t)}var bP;bP=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Wr.current)zr=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return zr=!1,$D(n,e,t);zr=!!(n.flags&131072)}else zr=!1,on&&e.flags&1048576&&EC(e,c0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Nm(n,e),n=e.pendingProps;var i=lu(e,gr.current);Xc(e,t),i=sS(null,e,r,n,i,t);var s=oS();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Hr(r)?(s=!0,a0(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,eS(e),i.updater=G0,e.stateNode=i,i._reactInternals=e,J_(e,r,n,t),e=n2(null,e,r,!0,s,t)):(e.tag=0,on&&s&&Yx(e),wr(null,e,i,t),e=e.child),e;case 16:r=e.elementType;e:{switch(Nm(n,e),n=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=uO(r),n=Ui(r,n),i){case 0:e=t2(null,e,r,n,t);break e;case 1:e=cT(null,e,r,n,t);break e;case 11:e=aT(null,e,r,n,t);break e;case 14:e=lT(null,e,r,Ui(r.type,n),t);break e}throw Error(Me(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ui(r,i),t2(n,e,r,i,t);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ui(r,i),cT(n,e,r,i,t);case 3:e:{if(sP(e),n===null)throw Error(Me(387));r=e.pendingProps,s=e.memoizedState,i=s.element,LC(n,e),d0(e,r,null,t);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=du(Error(Me(423)),e),e=uT(n,e,r,t,i);break e}else if(r!==i){i=du(Error(Me(424)),e),e=uT(n,e,r,t,i);break e}else for(ri=Jo(e.stateNode.containerInfo.firstChild),ii=e,on=!0,Gi=null,t=RC(e,null,r,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(cu(),r===i){e=ao(n,e,t);break e}wr(n,e,r,t)}e=e.child}return e;case 5:return FC(e),n===null&&K_(e),r=e.type,i=e.pendingProps,s=n!==null?n.memoizedProps:null,o=i.children,j_(r,i)?o=null:s!==null&&j_(r,s)&&(e.flags|=32),iP(n,e),wr(n,e,o,t),e.child;case 6:return n===null&&K_(e),null;case 13:return oP(n,e,t);case 4:return tS(e,e.stateNode.containerInfo),r=e.pendingProps,n===null?e.child=uu(e,null,r,t):wr(n,e,r,t),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ui(r,i),aT(n,e,r,i,t);case 7:return wr(n,e,e.pendingProps,t),e.child;case 8:return wr(n,e,e.pendingProps.children,t),e.child;case 12:return wr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,Kt(u0,r._currentValue),r._currentValue=o,s!==null)if(Zi(s.value,o)){if(s.children===i.children&&!Wr.current){e=ao(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=to(-1,t&-t),l.tag=2;var h=s.updateQueue;if(h!==null){h=h.shared;var d=h.pending;d===null?l.next=l:(l.next=d.next,d.next=l),h.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),Z_(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Me(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),Z_(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}wr(n,e,i.children,t),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Xc(e,t),i=Ai(i),r=r(i),e.flags|=1,wr(n,e,r,t),e.child;case 14:return r=e.type,i=Ui(r,e.pendingProps),i=Ui(r.type,i),lT(n,e,r,i,t);case 15:return nP(n,e,e.type,e.pendingProps,t);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Ui(r,i),Nm(n,e),e.tag=1,Hr(r)?(n=!0,a0(e)):n=!1,Xc(e,t),JC(e,r,i),J_(e,r,i,t),n2(null,e,r,!0,n,t);case 19:return aP(n,e,t);case 22:return rP(n,e,t)}throw Error(Me(156,e.tag))};function wP(n,e){return KA(n,e)}function cO(n,e,t,r){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(n,e,t,r){return new cO(n,e,t,r)}function gS(n){return n=n.prototype,!(!n||!n.isReactComponent)}function uO(n){if(typeof n=="function")return gS(n)?1:0;if(n!=null){if(n=n.$$typeof,n===Dx)return 11;if(n===Ox)return 14}return 2}function ra(n,e){var t=n.alternate;return t===null?(t=Mi(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function Um(n,e,t,r,i,s){var o=2;if(r=n,typeof n=="function")gS(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case Mc:return ul(t.children,i,s,e);case Nx:o=8,i|=8;break;case w_:return n=Mi(12,t,e,i|2),n.elementType=w_,n.lanes=s,n;case T_:return n=Mi(13,t,e,i),n.elementType=T_,n.lanes=s,n;case M_:return n=Mi(19,t,e,i),n.elementType=M_,n.lanes=s,n;case FA:return X0(t,i,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case IA:o=10;break e;case LA:o=9;break e;case Dx:o=11;break e;case Ox:o=14;break e;case Oo:o=16,r=null;break e}throw Error(Me(130,n==null?n:typeof n,""))}return e=Mi(o,t,e,i),e.elementType=n,e.type=r,e.lanes=s,e}function ul(n,e,t,r){return n=Mi(7,n,r,e),n.lanes=t,n}function X0(n,e,t,r){return n=Mi(22,n,r,e),n.elementType=FA,n.lanes=t,n.stateNode={isHidden:!1},n}function mv(n,e,t){return n=Mi(6,n,null,e),n.lanes=t,n}function gv(n,e,t){return e=Mi(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function hO(n,e,t,r,i){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ky(0),this.expirationTimes=Ky(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ky(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function yS(n,e,t,r,i,s,o,a,l){return n=new hO(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Mi(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},eS(s),n}function dO(n,e,t){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Tc,key:r==null?null:""+r,children:n,containerInfo:e,implementation:t}}function TP(n){if(!n)return ua;n=n._reactInternals;e:{if(El(n)!==n||n.tag!==1)throw Error(Me(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Hr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Me(171))}if(n.tag===1){var t=n.type;if(Hr(t))return TC(n,t,e)}return e}function MP(n,e,t,r,i,s,o,a,l){return n=yS(t,r,!0,n,i,s,o,a,l),n.context=TP(null),t=n.current,r=Er(),i=na(t),s=to(r,i),s.callback=e??null,ea(t,s,i),n.current.lanes=i,jd(n,i,r),Gr(n,r),n}function Y0(n,e,t,r){var i=e.current,s=Er(),o=na(i);return t=TP(t),e.context===null?e.context=t:e.pendingContext=t,e=to(s,o),e.payload={element:n},r=r===void 0?null:r,r!==null&&(e.callback=r),n=ea(i,e,o),n!==null&&($i(n,i,o,s),Im(n,i,o)),o}function x0(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function xT(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function vS(n,e){xT(n,e),(n=n.alternate)&&xT(n,e)}function fO(){return null}var EP=typeof reportError=="function"?reportError:function(n){console.error(n)};function _S(n){this._internalRoot=n}q0.prototype.render=_S.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(Me(409));Y0(n,e,null,null)};q0.prototype.unmount=_S.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;xl(function(){Y0(null,n,null,null)}),e[so]=null}};function q0(n){this._internalRoot=n}q0.prototype.unstable_scheduleHydration=function(n){if(n){var e=rC();n={blockedOn:null,target:n,priority:e};for(var t=0;t<Bo.length&&e!==0&&e<Bo[t].priority;t++);Bo.splice(t,0,n),t===0&&sC(n)}};function xS(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function $0(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function ST(){}function pO(n,e,t,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var h=x0(o);s.call(h)}}var o=MP(e,r,n,0,null,!1,!1,"",ST);return n._reactRootContainer=o,n[so]=o.current,id(n.nodeType===8?n.parentNode:n),xl(),o}for(;i=n.lastChild;)n.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var h=x0(l);a.call(h)}}var l=yS(n,0,!1,null,null,!1,!1,"",ST);return n._reactRootContainer=l,n[so]=l.current,id(n.nodeType===8?n.parentNode:n),xl(function(){Y0(e,l,t,r)}),l}function K0(n,e,t,r,i){var s=t._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=x0(o);a.call(l)}}Y0(e,o,n,i)}else o=pO(t,e,n,i,r);return x0(o)}tC=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=Ih(e.pendingLanes);t!==0&&(Bx(e,t|1),Gr(e,wn()),!(Ot&6)&&(fu=wn()+500,_a()))}break;case 13:xl(function(){var r=oo(n,1);if(r!==null){var i=Er();$i(r,n,1,i)}}),vS(n,1)}};zx=function(n){if(n.tag===13){var e=oo(n,134217728);if(e!==null){var t=Er();$i(e,n,134217728,t)}vS(n,134217728)}};nC=function(n){if(n.tag===13){var e=na(n),t=oo(n,e);if(t!==null){var r=Er();$i(t,n,e,r)}vS(n,e)}};rC=function(){return jt};iC=function(n,e){var t=jt;try{return jt=n,e()}finally{jt=t}};D_=function(n,e,t){switch(e){case"input":if(C_(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var r=t[e];if(r!==n&&r.form===n.form){var i=z0(r);if(!i)throw Error(Me(90));DA(r),C_(r,i)}}}break;case"textarea":UA(n,t);break;case"select":e=t.value,e!=null&&Hc(n,!!t.multiple,e,!1)}};VA=fS;jA=xl;var mO={usingClientEntryPoint:!1,Events:[Yd,Pc,z0,HA,GA,fS]},hh={findFiberByHostInstance:$a,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gO={bundleType:hh.bundleType,version:hh.version,rendererPackageName:hh.rendererPackageName,rendererConfig:hh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:po.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=qA(n),n===null?null:n.stateNode},findFiberByHostInstance:hh.findFiberByHostInstance||fO,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mp.isDisabled&&Mp.supportsFiber)try{O0=Mp.inject(gO),bs=Mp}catch{}}li.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mO;li.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xS(e))throw Error(Me(200));return dO(n,e,null,t)};li.createRoot=function(n,e){if(!xS(n))throw Error(Me(299));var t=!1,r="",i=EP;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=yS(n,1,!1,null,null,t,!1,r,i),n[so]=e.current,id(n.nodeType===8?n.parentNode:n),new _S(e)};li.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(Me(188)):(n=Object.keys(n).join(","),Error(Me(268,n)));return n=qA(e),n=n===null?null:n.stateNode,n};li.flushSync=function(n){return xl(n)};li.hydrate=function(n,e,t){if(!$0(e))throw Error(Me(200));return K0(null,n,e,!0,t)};li.hydrateRoot=function(n,e,t){if(!xS(n))throw Error(Me(405));var r=t!=null&&t.hydratedSources||null,i=!1,s="",o=EP;if(t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),e=MP(e,null,n,1,t??null,i,!1,s,o),n[so]=e.current,id(n),r)for(n=0;n<r.length;n++)t=r[n],i=t._getVersion,i=i(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,i]:e.mutableSourceEagerHydrationData.push(t,i);return new q0(e)};li.render=function(n,e,t){if(!$0(e))throw Error(Me(200));return K0(null,n,e,!1,t)};li.unmountComponentAtNode=function(n){if(!$0(n))throw Error(Me(40));return n._reactRootContainer?(xl(function(){K0(null,null,n,!1,function(){n._reactRootContainer=null,n[so]=null})}),!0):!1};li.unstable_batchedUpdates=fS;li.unstable_renderSubtreeIntoContainer=function(n,e,t,r){if(!$0(t))throw Error(Me(200));if(n==null||n._reactInternals===void 0)throw Error(Me(38));return K0(n,e,t,!1,r)};li.version="18.3.1-next-f1338f8080-20240426";function AP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AP)}catch(n){console.error(n)}}AP(),AA.exports=li;var $d=AA.exports;const CP=wu($d);var PP,bT=$d;PP=bT.createRoot,bT.hydrateRoot;var yO=typeof Element<"u",vO=typeof Map=="function",_O=typeof Set=="function",xO=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function km(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,r,i;if(Array.isArray(n)){if(t=n.length,t!=e.length)return!1;for(r=t;r--!==0;)if(!km(n[r],e[r]))return!1;return!0}var s;if(vO&&n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(s=n.entries();!(r=s.next()).done;)if(!e.has(r.value[0]))return!1;for(s=n.entries();!(r=s.next()).done;)if(!km(r.value[1],e.get(r.value[0])))return!1;return!0}if(_O&&n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(s=n.entries();!(r=s.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(xO&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if(t=n.length,t!=e.length)return!1;for(r=t;r--!==0;)if(n[r]!==e[r])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof e.valueOf=="function")return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof e.toString=="function")return n.toString()===e.toString();if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(yO&&n instanceof Element)return!1;for(r=t;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&n.$$typeof)&&!km(n[i[r]],e[i[r]]))return!1;return!0}return n!==n&&e!==e}var SO=function(e,t){try{return km(e,t)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const bO=wu(SO);var wO=function(n,e,t,r,i,s,o,a){if(!n){var l;if(e===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[t,r,i,s,o,a],d=0;l=new Error(e.replace(/%s/g,function(){return h[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},TO=wO;const wT=wu(TO);var MO=function(e,t,r,i){var s=r?r.call(i,e,t):void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),h=0;h<o.length;h++){var d=o[h];if(!l(d))return!1;var f=e[d],p=t[d];if(s=r?r.call(i,f,p,d):void 0,s===!1||s===void 0&&f!==p)return!1}return!0};const EO=wu(MO);var RP=(n=>(n.BASE="base",n.BODY="body",n.HEAD="head",n.HTML="html",n.LINK="link",n.META="meta",n.NOSCRIPT="noscript",n.SCRIPT="script",n.STYLE="style",n.TITLE="title",n.FRAGMENT="Symbol(react.fragment)",n))(RP||{}),yv={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},TT=Object.values(RP),SS={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},AO=Object.entries(SS).reduce((n,[e,t])=>(n[t]=e,n),{}),ji="data-rh",qc={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},$c=(n,e)=>{for(let t=n.length-1;t>=0;t-=1){const r=n[t];if(Object.prototype.hasOwnProperty.call(r,e))return r[e]}return null},CO=n=>{let e=$c(n,"title");const t=$c(n,qc.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),t&&e)return t.replace(/%s/g,()=>e);const r=$c(n,qc.DEFAULT_TITLE);return e||r||void 0},PO=n=>$c(n,qc.ON_CHANGE_CLIENT_STATE)||(()=>{}),vv=(n,e)=>e.filter(t=>typeof t[n]<"u").map(t=>t[n]).reduce((t,r)=>({...t,...r}),{}),RO=(n,e)=>e.filter(t=>typeof t.base<"u").map(t=>t.base).reverse().reduce((t,r)=>{if(!t.length){const i=Object.keys(r);for(let s=0;s<i.length;s+=1){const a=i[s].toLowerCase();if(n.indexOf(a)!==-1&&r[a])return t.concat(r)}}return t},[]),IO=n=>console&&typeof console.warn=="function"&&console.warn(n),dh=(n,e,t)=>{const r={};return t.filter(i=>Array.isArray(i[n])?!0:(typeof i[n]<"u"&&IO(`Helmet: ${n} should be of type "Array". Instead found type "${typeof i[n]}"`),!1)).map(i=>i[n]).reverse().reduce((i,s)=>{const o={};s.filter(l=>{let h;const d=Object.keys(l);for(let p=0;p<d.length;p+=1){const m=d[p],v=m.toLowerCase();e.indexOf(v)!==-1&&!(h==="rel"&&l[h].toLowerCase()==="canonical")&&!(v==="rel"&&l[v].toLowerCase()==="stylesheet")&&(h=v),e.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(h=m)}if(!h||!l[h])return!1;const f=l[h].toLowerCase();return r[h]||(r[h]={}),o[h]||(o[h]={}),r[h][f]?!1:(o[h][f]=!0,!0)}).reverse().forEach(l=>i.push(l));const a=Object.keys(o);for(let l=0;l<a.length;l+=1){const h=a[l],d={...r[h],...o[h]};r[h]=d}return i},[]).reverse()},LO=(n,e)=>{if(Array.isArray(n)&&n.length){for(let t=0;t<n.length;t+=1)if(n[t][e])return!0}return!1},FO=n=>({baseTag:RO(["href"],n),bodyAttributes:vv("bodyAttributes",n),defer:$c(n,qc.DEFER),encode:$c(n,qc.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:vv("htmlAttributes",n),linkTags:dh("link",["rel","href"],n),metaTags:dh("meta",["name","charset","http-equiv","property","itemprop"],n),noscriptTags:dh("noscript",["innerHTML"],n),onChangeClientState:PO(n),scriptTags:dh("script",["src","innerHTML"],n),styleTags:dh("style",["cssText"],n),title:CO(n),titleAttributes:vv("titleAttributes",n),prioritizeSeoTags:LO(n,qc.PRIORITIZE_SEO_TAGS)}),IP=n=>Array.isArray(n)?n.join(""):n,NO=(n,e)=>{const t=Object.keys(n);for(let r=0;r<t.length;r+=1)if(e[t[r]]&&e[t[r]].includes(n[t[r]]))return!0;return!1},_v=(n,e)=>Array.isArray(n)?n.reduce((t,r)=>(NO(r,e)?t.priority.push(r):t.default.push(r),t),{priority:[],default:[]}):{default:n,priority:[]},MT=(n,e)=>({...n,[e]:void 0}),DO=["noscript","script","style"],p2=(n,e=!0)=>e===!1?String(n):String(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),LP=n=>Object.keys(n).reduce((e,t)=>{const r=typeof n[t]<"u"?`${t}="${n[t]}"`:`${t}`;return e?`${e} ${r}`:r},""),OO=(n,e,t,r)=>{const i=LP(t),s=IP(e);return i?`<${n} ${ji}="true" ${i}>${p2(s,r)}</${n}>`:`<${n} ${ji}="true">${p2(s,r)}</${n}>`},UO=(n,e,t=!0)=>e.reduce((r,i)=>{const s=i,o=Object.keys(s).filter(h=>!(h==="innerHTML"||h==="cssText")).reduce((h,d)=>{const f=typeof s[d]>"u"?d:`${d}="${p2(s[d],t)}"`;return h?`${h} ${f}`:f},""),a=s.innerHTML||s.cssText||"",l=DO.indexOf(n)===-1;return`${r}<${n} ${ji}="true" ${o}${l?"/>":`>${a}</${n}>`}`},""),FP=(n,e={})=>Object.keys(n).reduce((t,r)=>{const i=SS[r];return t[i||r]=n[r],t},e),kO=(n,e,t)=>{const r={key:e,[ji]:!0},i=FP(t,r);return[Ae.createElement("title",i,e)]},Bm=(n,e)=>e.map((t,r)=>{const i={key:r,[ji]:!0};return Object.keys(t).forEach(s=>{const a=SS[s]||s;if(a==="innerHTML"||a==="cssText"){const l=t.innerHTML||t.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=t[s]}),Ae.createElement(n,i)}),Si=(n,e,t=!0)=>{switch(n){case"title":return{toComponent:()=>kO(n,e.title,e.titleAttributes),toString:()=>OO(n,e.title,e.titleAttributes,t)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>FP(e),toString:()=>LP(e)};default:return{toComponent:()=>Bm(n,e),toString:()=>UO(n,e,t)}}},BO=({metaTags:n,linkTags:e,scriptTags:t,encode:r})=>{const i=_v(n,yv.meta),s=_v(e,yv.link),o=_v(t,yv.script);return{priorityMethods:{toComponent:()=>[...Bm("meta",i.priority),...Bm("link",s.priority),...Bm("script",o.priority)],toString:()=>`${Si("meta",i.priority,r)} ${Si("link",s.priority,r)} ${Si("script",o.priority,r)}`},metaTags:i.default,linkTags:s.default,scriptTags:o.default}},zO=n=>{const{baseTag:e,bodyAttributes:t,encode:r=!0,htmlAttributes:i,noscriptTags:s,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:h}=n;let{linkTags:d,metaTags:f,scriptTags:p}=n,m={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:m,linkTags:d,metaTags:f,scriptTags:p}=BO(n)),{priority:m,base:Si("base",e,r),bodyAttributes:Si("bodyAttributes",t,r),htmlAttributes:Si("htmlAttributes",i,r),link:Si("link",d,r),meta:Si("meta",f,r),noscript:Si("noscript",s,r),script:Si("script",p,r),style:Si("style",o,r),title:Si("title",{title:a,titleAttributes:l},r)}},m2=zO,Ep=[],NP=!!(typeof window<"u"&&window.document&&window.document.createElement),g2=class{constructor(n,e){ks(this,"instances",[]);ks(this,"canUseDOM",NP);ks(this,"context");ks(this,"value",{setHelmet:n=>{this.context.helmet=n},helmetInstances:{get:()=>this.canUseDOM?Ep:this.instances,add:n=>{(this.canUseDOM?Ep:this.instances).push(n)},remove:n=>{const e=(this.canUseDOM?Ep:this.instances).indexOf(n);(this.canUseDOM?Ep:this.instances).splice(e,1)}}});this.context=n,this.canUseDOM=e||!1,e||(n.helmet=m2({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},WO={},DP=Ae.createContext(WO),nl,OP=(nl=class extends D.Component{constructor(t){super(t);ks(this,"helmetData");this.helmetData=new g2(this.props.context||{},nl.canUseDOM)}render(){return Ae.createElement(DP.Provider,{value:this.helmetData.value},this.props.children)}},ks(nl,"canUseDOM",NP),nl),Zl=(n,e)=>{const t=document.head||document.querySelector("head"),r=t.querySelectorAll(`${n}[${ji}]`),i=[].slice.call(r),s=[];let o;return e&&e.length&&e.forEach(a=>{const l=document.createElement(n);for(const h in a)if(Object.prototype.hasOwnProperty.call(a,h))if(h==="innerHTML")l.innerHTML=a.innerHTML;else if(h==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const d=h,f=typeof a[d]>"u"?"":a[d];l.setAttribute(h,f)}l.setAttribute(ji,"true"),i.some((h,d)=>(o=d,l.isEqualNode(h)))?i.splice(o,1):s.push(l)}),i.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),s.forEach(a=>t.appendChild(a)),{oldTags:i,newTags:s}},y2=(n,e)=>{const t=document.getElementsByTagName(n)[0];if(!t)return;const r=t.getAttribute(ji),i=r?r.split(","):[],s=[...i],o=Object.keys(e);for(const a of o){const l=e[a]||"";t.getAttribute(a)!==l&&t.setAttribute(a,l),i.indexOf(a)===-1&&i.push(a);const h=s.indexOf(a);h!==-1&&s.splice(h,1)}for(let a=s.length-1;a>=0;a-=1)t.removeAttribute(s[a]);i.length===s.length?t.removeAttribute(ji):t.getAttribute(ji)!==o.join(",")&&t.setAttribute(ji,o.join(","))},HO=(n,e)=>{typeof n<"u"&&document.title!==n&&(document.title=IP(n)),y2("title",e)},ET=(n,e)=>{const{baseTag:t,bodyAttributes:r,htmlAttributes:i,linkTags:s,metaTags:o,noscriptTags:a,onChangeClientState:l,scriptTags:h,styleTags:d,title:f,titleAttributes:p}=n;y2("body",r),y2("html",i),HO(f,p);const m={baseTag:Zl("base",t),linkTags:Zl("link",s),metaTags:Zl("meta",o),noscriptTags:Zl("noscript",a),scriptTags:Zl("script",h),styleTags:Zl("style",d)},v={},x={};Object.keys(m).forEach(_=>{const{newTags:g,oldTags:S}=m[_];g.length&&(v[_]=g),S.length&&(x[_]=m[_].oldTags)}),e&&e(),l(n,v,x)},fh=null,GO=n=>{fh&&cancelAnimationFrame(fh),n.defer?fh=requestAnimationFrame(()=>{ET(n,()=>{fh=null})}):(ET(n),fh=null)},VO=GO,AT=class extends D.Component{constructor(){super(...arguments);ks(this,"rendered",!1)}shouldComponentUpdate(e){return!EO(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:t}=this.props.context;let r=null;const i=FO(e.get().map(s=>{const o={...s.props};return delete o.context,o}));OP.canUseDOM?VO(i):m2&&(r=m2(i)),t(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},S_,bS=(S_=class extends D.Component{shouldComponentUpdate(n){return!bO(MT(this.props,"helmetData"),MT(n,"helmetData"))}mapNestedChildrenToProps(n,e){if(!e)return null;switch(n.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${n.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(n,e,t,r){return{...e,[n.type]:[...e[n.type]||[],{...t,...this.mapNestedChildrenToProps(n,r)}]}}mapObjectTypeChildren(n,e,t,r){switch(n.type){case"title":return{...e,[n.type]:r,titleAttributes:{...t}};case"body":return{...e,bodyAttributes:{...t}};case"html":return{...e,htmlAttributes:{...t}};default:return{...e,[n.type]:{...t}}}}mapArrayTypeChildrenToProps(n,e){let t={...e};return Object.keys(n).forEach(r=>{t={...t,[r]:n[r]}}),t}warnOnInvalidChildren(n,e){return wT(TT.some(t=>n.type===t),typeof n.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${TT.join(", ")} are allowed. Helmet does not support rendering <${n.type}> elements. Refer to our API for more information.`),wT(!e||typeof e=="string"||Array.isArray(e)&&!e.some(t=>typeof t!="string"),`Helmet expects a string as a child of <${n.type}>. Did you forget to wrap your children in braces? ( <${n.type}>{\`\`}</${n.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(n,e){let t={};return Ae.Children.forEach(n,r=>{if(!r||!r.props)return;const{children:i,...s}=r.props,o=Object.keys(s).reduce((l,h)=>(l[AO[h]||h]=s[h],l),{});let{type:a}=r;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,i),a){case"Symbol(react.fragment)":e=this.mapChildrenToProps(i,e);break;case"link":case"meta":case"noscript":case"script":case"style":t=this.flattenArrayTypeChildren(r,t,o,i);break;default:e=this.mapObjectTypeChildren(r,e,o,i);break}}),this.mapArrayTypeChildrenToProps(t,e)}render(){const{children:n,...e}=this.props;let t={...e},{helmetData:r}=e;if(n&&(t=this.mapChildrenToProps(n,t)),r&&!(r instanceof g2)){const i=r;r=new g2(i.context,!0),delete t.helmetData}return r?Ae.createElement(AT,{...t,context:r.value}):Ae.createElement(DP.Consumer,null,i=>Ae.createElement(AT,{...t,context:i}))}},ks(S_,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),S_);const jO=1,XO=1e6;let xv=0;function YO(){return xv=(xv+1)%Number.MAX_SAFE_INTEGER,xv.toString()}const Sv=new Map,CT=n=>{if(Sv.has(n))return;const e=setTimeout(()=>{Sv.delete(n),Gh({type:"REMOVE_TOAST",toastId:n})},XO);Sv.set(n,e)},qO=(n,e)=>{switch(e.type){case"ADD_TOAST":return{...n,toasts:[e.toast,...n.toasts].slice(0,jO)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{const{toastId:t}=e;return t?CT(t):n.toasts.forEach(r=>{CT(r.id)}),{...n,toasts:n.toasts.map(r=>r.id===t||t===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(t=>t.id!==e.toastId)}}},zm=[];let Wm={toasts:[]};function Gh(n){Wm=qO(Wm,n),zm.forEach(e=>{e(Wm)})}function $O({...n}){const e=YO(),t=i=>Gh({type:"UPDATE_TOAST",toast:{...i,id:e}}),r=()=>Gh({type:"DISMISS_TOAST",toastId:e});return Gh({type:"ADD_TOAST",toast:{...n,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:t}}function KO(){const[n,e]=D.useState(Wm);return D.useEffect(()=>(zm.push(e),()=>{const t=zm.indexOf(e);t>-1&&zm.splice(t,1)}),[n]),{...n,toast:$O,dismiss:t=>Gh({type:"DISMISS_TOAST",toastId:t})}}function Dn(n,e,{checkForDefaultPrevented:t=!0}={}){return function(i){if(n==null||n(i),t===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function PT(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function UP(...n){return e=>{let t=!1;const r=n.map(i=>{const s=PT(i,e);return!t&&typeof s=="function"&&(t=!0),s});if(t)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():PT(n[i],null)}}}}function Qi(...n){return D.useCallback(UP(...n),n)}function Z0(n,e=[]){let t=[];function r(s,o){const a=D.createContext(o),l=t.length;t=[...t,o];const h=f=>{var g;const{scope:p,children:m,...v}=f,x=((g=p==null?void 0:p[n])==null?void 0:g[l])||a,_=D.useMemo(()=>v,Object.values(v));return L.jsx(x.Provider,{value:_,children:m})};h.displayName=s+"Provider";function d(f,p){var x;const m=((x=p==null?void 0:p[n])==null?void 0:x[l])||a,v=D.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[h,d]}const i=()=>{const s=t.map(o=>D.createContext(o));return function(a){const l=(a==null?void 0:a[n])||s;return D.useMemo(()=>({[`__scope${n}`]:{...a,[n]:l}}),[a,l])}};return i.scopeName=n,[r,ZO(i,...e)]}function ZO(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:h})=>{const f=l(s)[`__scope${h}`];return{...a,...f}},{});return D.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function v2(n){const e=QO(n),t=D.forwardRef((r,i)=>{const{children:s,...o}=r,a=D.Children.toArray(s),l=a.find(eU);if(l){const h=l.props.children,d=a.map(f=>f===l?D.Children.count(h)>1?D.Children.only(null):D.isValidElement(h)?h.props.children:null:f);return L.jsx(e,{...o,ref:i,children:D.isValidElement(h)?D.cloneElement(h,void 0,d):null})}return L.jsx(e,{...o,ref:i,children:s})});return t.displayName=`${n}.Slot`,t}function QO(n){const e=D.forwardRef((t,r)=>{const{children:i,...s}=t;if(D.isValidElement(i)){const o=nU(i),a=tU(s,i.props);return i.type!==D.Fragment&&(a.ref=r?UP(r,o):o),D.cloneElement(i,a)}return D.Children.count(i)>1?D.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var kP=Symbol("radix.slottable");function JO(n){const e=({children:t})=>L.jsx(L.Fragment,{children:t});return e.displayName=`${n}.Slottable`,e.__radixId=kP,e}function eU(n){return D.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===kP}function tU(n,e){const t={...e};for(const r in e){const i=n[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?t[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(t[r]=i):r==="style"?t[r]={...i,...s}:r==="className"&&(t[r]=[i,s].filter(Boolean).join(" "))}return{...n,...t}}function nU(n){var r,i;let e=(r=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=(i=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}function rU(n){const e=n+"CollectionProvider",[t,r]=Z0(e),[i,s]=t(e,{collectionRef:{current:null},itemMap:new Map}),o=x=>{const{scope:_,children:g}=x,S=Ae.useRef(null),b=Ae.useRef(new Map).current;return L.jsx(i,{scope:_,itemMap:b,collectionRef:S,children:g})};o.displayName=e;const a=n+"CollectionSlot",l=v2(a),h=Ae.forwardRef((x,_)=>{const{scope:g,children:S}=x,b=s(a,g),M=Qi(_,b.collectionRef);return L.jsx(l,{ref:M,children:S})});h.displayName=a;const d=n+"CollectionItemSlot",f="data-radix-collection-item",p=v2(d),m=Ae.forwardRef((x,_)=>{const{scope:g,children:S,...b}=x,M=Ae.useRef(null),C=Qi(_,M),A=s(d,g);return Ae.useEffect(()=>(A.itemMap.set(M,{ref:M,...b}),()=>void A.itemMap.delete(M))),L.jsx(p,{[f]:"",ref:C,children:S})});m.displayName=d;function v(x){const _=s(n+"CollectionConsumer",x);return Ae.useCallback(()=>{const S=_.collectionRef.current;if(!S)return[];const b=Array.from(S.querySelectorAll(`[${f}]`));return Array.from(_.itemMap.values()).sort((A,R)=>b.indexOf(A.ref.current)-b.indexOf(R.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:o,Slot:h,ItemSlot:m},v,r]}var iU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jr=iU.reduce((n,e)=>{const t=v2(`Primitive.${e}`),r=D.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),L.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function BP(n,e){n&&$d.flushSync(()=>n.dispatchEvent(e))}function ha(n){const e=D.useRef(n);return D.useEffect(()=>{e.current=n}),D.useMemo(()=>(...t)=>{var r;return(r=e.current)==null?void 0:r.call(e,...t)},[])}function sU(n,e=globalThis==null?void 0:globalThis.document){const t=ha(n);D.useEffect(()=>{const r=i=>{i.key==="Escape"&&t(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[t,e])}var oU="DismissableLayer",_2="dismissableLayer.update",aU="dismissableLayer.pointerDownOutside",lU="dismissableLayer.focusOutside",RT,zP=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wS=D.forwardRef((n,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=n,h=D.useContext(zP),[d,f]=D.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=D.useState({}),v=Qi(e,R=>f(R)),x=Array.from(h.layers),[_]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),g=x.indexOf(_),S=d?x.indexOf(d):-1,b=h.layersWithOutsidePointerEventsDisabled.size>0,M=S>=g,C=uU(R=>{const O=R.target,P=[...h.branches].some(I=>I.contains(O));!M||P||(i==null||i(R),o==null||o(R),R.defaultPrevented||a==null||a())},p),A=hU(R=>{const O=R.target;[...h.branches].some(I=>I.contains(O))||(s==null||s(R),o==null||o(R),R.defaultPrevented||a==null||a())},p);return sU(R=>{S===h.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},p),D.useEffect(()=>{if(d)return t&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(RT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(d)),h.layers.add(d),IT(),()=>{t&&h.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=RT)}},[d,p,t,h]),D.useEffect(()=>()=>{d&&(h.layers.delete(d),h.layersWithOutsidePointerEventsDisabled.delete(d),IT())},[d,h]),D.useEffect(()=>{const R=()=>m({});return document.addEventListener(_2,R),()=>document.removeEventListener(_2,R)},[]),L.jsx(jr.div,{...l,ref:v,style:{pointerEvents:b?M?"auto":"none":void 0,...n.style},onFocusCapture:Dn(n.onFocusCapture,A.onFocusCapture),onBlurCapture:Dn(n.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Dn(n.onPointerDownCapture,C.onPointerDownCapture)})});wS.displayName=oU;var cU="DismissableLayerBranch",WP=D.forwardRef((n,e)=>{const t=D.useContext(zP),r=D.useRef(null),i=Qi(e,r);return D.useEffect(()=>{const s=r.current;if(s)return t.branches.add(s),()=>{t.branches.delete(s)}},[t.branches]),L.jsx(jr.div,{...n,ref:i})});WP.displayName=cU;function uU(n,e=globalThis==null?void 0:globalThis.document){const t=ha(n),r=D.useRef(!1),i=D.useRef(()=>{});return D.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){HP(aU,t,h,{discrete:!0})};const h={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,t]),{onPointerDownCapture:()=>r.current=!0}}function hU(n,e=globalThis==null?void 0:globalThis.document){const t=ha(n),r=D.useRef(!1);return D.useEffect(()=>{const i=s=>{s.target&&!r.current&&HP(lU,t,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,t]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function IT(){const n=new CustomEvent(_2);document.dispatchEvent(n)}function HP(n,e,t,{discrete:r}){const i=t.originalEvent.target,s=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?BP(i,s):i.dispatchEvent(s)}var dU=wS,fU=WP,da=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{},pU="Portal",GP=D.forwardRef((n,e)=>{var a;const{container:t,...r}=n,[i,s]=D.useState(!1);da(()=>s(!0),[]);const o=t||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?CP.createPortal(L.jsx(jr.div,{...r,ref:e}),o):null});GP.displayName=pU;function mU(n,e){return D.useReducer((t,r)=>e[t][r]??t,n)}var TS=n=>{const{present:e,children:t}=n,r=gU(e),i=typeof t=="function"?t({present:r.isPresent}):D.Children.only(t),s=Qi(r.ref,yU(i));return typeof t=="function"||r.isPresent?D.cloneElement(i,{ref:s}):null};TS.displayName="Presence";function gU(n){const[e,t]=D.useState(),r=D.useRef(null),i=D.useRef(n),s=D.useRef("none"),o=n?"mounted":"unmounted",[a,l]=mU(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const h=Ap(r.current);s.current=a==="mounted"?h:"none"},[a]),da(()=>{const h=r.current,d=i.current;if(d!==n){const p=s.current,m=Ap(h);n?l("MOUNT"):m==="none"||(h==null?void 0:h.display)==="none"?l("UNMOUNT"):l(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=n}},[n,l]),da(()=>{if(e){let h;const d=e.ownerDocument.defaultView??window,f=m=>{const x=Ap(r.current).includes(m.animationName);if(m.target===e&&x&&(l("ANIMATION_END"),!i.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",h=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},p=m=>{m.target===e&&(s.current=Ap(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(h),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:D.useCallback(h=>{r.current=h?getComputedStyle(h):null,t(h)},[])}}function Ap(n){return(n==null?void 0:n.animationName)||"none"}function yU(n){var r,i;let e=(r=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:r.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=(i=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:i.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var vU=MA[" useInsertionEffect ".trim().toString()]||da;function _U({prop:n,defaultProp:e,onChange:t=()=>{},caller:r}){const[i,s,o]=xU({defaultProp:e,onChange:t}),a=n!==void 0,l=a?n:i;{const d=D.useRef(n!==void 0);D.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const h=D.useCallback(d=>{var f;if(a){const p=SU(d)?d(n):d;p!==n&&((f=o.current)==null||f.call(o,p))}else s(d)},[a,n,s,o]);return[l,h]}function xU({defaultProp:n,onChange:e}){const[t,r]=D.useState(n),i=D.useRef(t),s=D.useRef(e);return vU(()=>{s.current=e},[e]),D.useEffect(()=>{var o;i.current!==t&&((o=s.current)==null||o.call(s,t),i.current=t)},[t,i]),[t,r,s]}function SU(n){return typeof n=="function"}var bU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wU="VisuallyHidden",Q0=D.forwardRef((n,e)=>L.jsx(jr.span,{...n,ref:e,style:{...bU,...n.style}}));Q0.displayName=wU;var TU=Q0,MS="ToastProvider",[ES,MU,EU]=rU("Toast"),[VP,KZ]=Z0("Toast",[EU]),[AU,J0]=VP(MS),jP=n=>{const{__scopeToast:e,label:t="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=n,[a,l]=D.useState(null),[h,d]=D.useState(0),f=D.useRef(!1),p=D.useRef(!1);return t.trim()||console.error(`Invalid prop \`label\` supplied to \`${MS}\`. Expected non-empty \`string\`.`),L.jsx(ES.Provider,{scope:e,children:L.jsx(AU,{scope:e,label:t,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:h,viewport:a,onViewportChange:l,onToastAdd:D.useCallback(()=>d(m=>m+1),[]),onToastRemove:D.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:o})})};jP.displayName=MS;var XP="ToastViewport",CU=["F8"],x2="toast.viewportPause",S2="toast.viewportResume",YP=D.forwardRef((n,e)=>{const{__scopeToast:t,hotkey:r=CU,label:i="Notifications ({hotkey})",...s}=n,o=J0(XP,t),a=MU(t),l=D.useRef(null),h=D.useRef(null),d=D.useRef(null),f=D.useRef(null),p=Qi(e,f,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;D.useEffect(()=>{const _=g=>{var b;r.length!==0&&r.every(M=>g[M]||g.code===M)&&((b=f.current)==null||b.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[r]),D.useEffect(()=>{const _=l.current,g=f.current;if(v&&_&&g){const S=()=>{if(!o.isClosePausedRef.current){const A=new CustomEvent(x2);g.dispatchEvent(A),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const A=new CustomEvent(S2);g.dispatchEvent(A),o.isClosePausedRef.current=!1}},M=A=>{!_.contains(A.relatedTarget)&&b()},C=()=>{_.contains(document.activeElement)||b()};return _.addEventListener("focusin",S),_.addEventListener("focusout",M),_.addEventListener("pointermove",S),_.addEventListener("pointerleave",C),window.addEventListener("blur",S),window.addEventListener("focus",b),()=>{_.removeEventListener("focusin",S),_.removeEventListener("focusout",M),_.removeEventListener("pointermove",S),_.removeEventListener("pointerleave",C),window.removeEventListener("blur",S),window.removeEventListener("focus",b)}}},[v,o.isClosePausedRef]);const x=D.useCallback(({tabbingDirection:_})=>{const S=a().map(b=>{const M=b.ref.current,C=[M,...WU(M)];return _==="forwards"?C:C.reverse()});return(_==="forwards"?S.reverse():S).flat()},[a]);return D.useEffect(()=>{const _=f.current;if(_){const g=S=>{var C,A,R;const b=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!b){const O=document.activeElement,P=S.shiftKey;if(S.target===_&&P){(C=h.current)==null||C.focus();return}const X=x({tabbingDirection:P?"backwards":"forwards"}),se=X.findIndex(W=>W===O);bv(X.slice(se+1))?S.preventDefault():P?(A=h.current)==null||A.focus():(R=d.current)==null||R.focus()}};return _.addEventListener("keydown",g),()=>_.removeEventListener("keydown",g)}},[a,x]),L.jsxs(fU,{ref:l,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&L.jsx(b2,{ref:h,onFocusFromOutsideViewport:()=>{const _=x({tabbingDirection:"forwards"});bv(_)}}),L.jsx(ES.Slot,{scope:t,children:L.jsx(jr.ol,{tabIndex:-1,...s,ref:p})}),v&&L.jsx(b2,{ref:d,onFocusFromOutsideViewport:()=>{const _=x({tabbingDirection:"backwards"});bv(_)}})]})});YP.displayName=XP;var qP="ToastFocusProxy",b2=D.forwardRef((n,e)=>{const{__scopeToast:t,onFocusFromOutsideViewport:r,...i}=n,s=J0(qP,t);return L.jsx(Q0,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{var h;const a=o.relatedTarget;!((h=s.viewport)!=null&&h.contains(a))&&r()}})});b2.displayName=qP;var Kd="Toast",PU="toast.swipeStart",RU="toast.swipeMove",IU="toast.swipeCancel",LU="toast.swipeEnd",$P=D.forwardRef((n,e)=>{const{forceMount:t,open:r,defaultOpen:i,onOpenChange:s,...o}=n,[a,l]=_U({prop:r,defaultProp:i??!0,onChange:s,caller:Kd});return L.jsx(TS,{present:t||a,children:L.jsx(DU,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:ha(n.onPause),onResume:ha(n.onResume),onSwipeStart:Dn(n.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Dn(n.onSwipeMove,h=>{const{x:d,y:f}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Dn(n.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Dn(n.onSwipeEnd,h=>{const{x:d,y:f}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});$P.displayName=Kd;var[FU,NU]=VP(Kd,{onClose(){}}),DU=D.forwardRef((n,e)=>{const{__scopeToast:t,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:h,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...v}=n,x=J0(Kd,t),[_,g]=D.useState(null),S=Qi(e,W=>g(W)),b=D.useRef(null),M=D.useRef(null),C=i||x.duration,A=D.useRef(0),R=D.useRef(C),O=D.useRef(0),{onToastAdd:P,onToastRemove:I}=x,H=ha(()=>{var $;(_==null?void 0:_.contains(document.activeElement))&&(($=x.viewport)==null||$.focus()),o()}),X=D.useCallback(W=>{!W||W===1/0||(window.clearTimeout(O.current),A.current=new Date().getTime(),O.current=window.setTimeout(H,W))},[H]);D.useEffect(()=>{const W=x.viewport;if(W){const $=()=>{X(R.current),h==null||h()},Z=()=>{const re=new Date().getTime()-A.current;R.current=R.current-re,window.clearTimeout(O.current),l==null||l()};return W.addEventListener(x2,Z),W.addEventListener(S2,$),()=>{W.removeEventListener(x2,Z),W.removeEventListener(S2,$)}}},[x.viewport,C,l,h,X]),D.useEffect(()=>{s&&!x.isClosePausedRef.current&&X(C)},[s,C,x.isClosePausedRef,X]),D.useEffect(()=>(P(),()=>I()),[P,I]);const se=D.useMemo(()=>_?nR(_):null,[_]);return x.viewport?L.jsxs(L.Fragment,{children:[se&&L.jsx(OU,{__scopeToast:t,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:se}),L.jsx(FU,{scope:t,onClose:H,children:$d.createPortal(L.jsx(ES.ItemSlot,{scope:t,children:L.jsx(dU,{asChild:!0,onEscapeKeyDown:Dn(a,()=>{x.isFocusedToastEscapeKeyDownRef.current||H(),x.isFocusedToastEscapeKeyDownRef.current=!1}),children:L.jsx(jr.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":x.swipeDirection,...v,ref:S,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:Dn(n.onKeyDown,W=>{W.key==="Escape"&&(a==null||a(W.nativeEvent),W.nativeEvent.defaultPrevented||(x.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:Dn(n.onPointerDown,W=>{W.button===0&&(b.current={x:W.clientX,y:W.clientY})}),onPointerMove:Dn(n.onPointerMove,W=>{if(!b.current)return;const $=W.clientX-b.current.x,Z=W.clientY-b.current.y,re=!!M.current,F=["left","right"].includes(x.swipeDirection),U=["left","up"].includes(x.swipeDirection)?Math.min:Math.max,G=F?U(0,$):0,Y=F?0:U(0,Z),ee=W.pointerType==="touch"?10:2,K={x:G,y:Y},ie={originalEvent:W,delta:K};re?(M.current=K,Cp(RU,f,ie,{discrete:!1})):LT(K,x.swipeDirection,ee)?(M.current=K,Cp(PU,d,ie,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs($)>ee||Math.abs(Z)>ee)&&(b.current=null)}),onPointerUp:Dn(n.onPointerUp,W=>{const $=M.current,Z=W.target;if(Z.hasPointerCapture(W.pointerId)&&Z.releasePointerCapture(W.pointerId),M.current=null,b.current=null,$){const re=W.currentTarget,F={originalEvent:W,delta:$};LT($,x.swipeDirection,x.swipeThreshold)?Cp(LU,m,F,{discrete:!0}):Cp(IU,p,F,{discrete:!0}),re.addEventListener("click",U=>U.preventDefault(),{once:!0})}})})})}),x.viewport)})]}):null}),OU=n=>{const{__scopeToast:e,children:t,...r}=n,i=J0(Kd,e),[s,o]=D.useState(!1),[a,l]=D.useState(!1);return BU(()=>o(!0)),D.useEffect(()=>{const h=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(h)},[]),a?null:L.jsx(GP,{asChild:!0,children:L.jsx(Q0,{...r,children:s&&L.jsxs(L.Fragment,{children:[i.label," ",t]})})})},UU="ToastTitle",KP=D.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return L.jsx(jr.div,{...r,ref:e})});KP.displayName=UU;var kU="ToastDescription",ZP=D.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n;return L.jsx(jr.div,{...r,ref:e})});ZP.displayName=kU;var QP="ToastAction",JP=D.forwardRef((n,e)=>{const{altText:t,...r}=n;return t.trim()?L.jsx(tR,{altText:t,asChild:!0,children:L.jsx(AS,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${QP}\`. Expected non-empty \`string\`.`),null)});JP.displayName=QP;var eR="ToastClose",AS=D.forwardRef((n,e)=>{const{__scopeToast:t,...r}=n,i=NU(eR,t);return L.jsx(tR,{asChild:!0,children:L.jsx(jr.button,{type:"button",...r,ref:e,onClick:Dn(n.onClick,i.onClose)})})});AS.displayName=eR;var tR=D.forwardRef((n,e)=>{const{__scopeToast:t,altText:r,...i}=n;return L.jsx(jr.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function nR(n){const e=[];return Array.from(n.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),zU(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...nR(r))}}),e}function Cp(n,e,t,{discrete:r}){const i=t.originalEvent.currentTarget,s=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?BP(i,s):i.dispatchEvent(s)}var LT=(n,e,t=0)=>{const r=Math.abs(n.x),i=Math.abs(n.y),s=r>i;return e==="left"||e==="right"?s&&r>t:!s&&i>t};function BU(n=()=>{}){const e=ha(n);da(()=>{let t=0,r=0;return t=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(r)}},[e])}function zU(n){return n.nodeType===n.ELEMENT_NODE}function WU(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function bv(n){const e=document.activeElement;return n.some(t=>t===e?!0:(t.focus(),document.activeElement!==e))}var HU=jP,rR=YP,iR=$P,sR=KP,oR=ZP,aR=JP,lR=AS;function cR(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=cR(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function uR(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=cR(n))&&(r&&(r+=" "),r+=e);return r}const FT=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,NT=uR,GU=(n,e)=>t=>{var r;if((e==null?void 0:e.variants)==null)return NT(n,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:i,defaultVariants:s}=e,o=Object.keys(i).map(h=>{const d=t==null?void 0:t[h],f=s==null?void 0:s[h];if(d===null)return null;const p=FT(d)||FT(f);return i[h][p]}),a=t&&Object.entries(t).reduce((h,d)=>{let[f,p]=d;return p===void 0||(h[f]=p),h},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(v=>{let[x,_]=v;return Array.isArray(_)?_.includes({...s,...a}[x]):{...s,...a}[x]===_})?[...h,f,p]:h},[]);return NT(n,o,l,t==null?void 0:t.class,t==null?void 0:t.className)};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VU=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hR=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim();/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var jU={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"};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XU=D.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>D.createElement("svg",{ref:l,...jU,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:hR("lucide",i),...a},[...o.map(([h,d])=>D.createElement(h,d)),...Array.isArray(s)?s:[s]]));/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YU=(n,e)=>{const t=D.forwardRef(({className:r,...i},s)=>D.createElement(XU,{ref:s,iconNode:e,className:hR(`lucide-${VU(n)}`,r),...i}));return t.displayName=`${n}`,t};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qU=YU("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),CS="-",$U=n=>{const e=ZU(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{const a=o.split(CS);return a[0]===""&&a.length!==1&&a.shift(),dR(a,e)||KU(o)},getConflictingClassGroupIds:(o,a)=>{const l=t[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},dR=(n,e)=>{var o;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),i=r?dR(n.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const s=n.join(CS);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},DT=/^\[(.+)\]$/,KU=n=>{if(DT.test(n)){const e=DT.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},ZU=n=>{const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return JU(Object.entries(n.classGroups),t).forEach(([s,o])=>{w2(o,r,s,e)}),r},w2=(n,e,t,r)=>{n.forEach(i=>{if(typeof i=="string"){const s=i===""?e:OT(e,i);s.classGroupId=t;return}if(typeof i=="function"){if(QU(i)){w2(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([s,o])=>{w2(o,OT(e,s),t,r)})})},OT=(n,e)=>{let t=n;return e.split(CS).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},QU=n=>n.isThemeGetter,JU=(n,e)=>e?n.map(([t,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[t,i]}):n,ek=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const i=(s,o)=>{t.set(s,o),e++,e>n&&(e=0,r=t,t=new Map)};return{get(s){let o=t.get(s);if(o!==void 0)return o;if((o=r.get(s))!==void 0)return i(s,o),o},set(s,o){t.has(s)?t.set(s,o):i(s,o)}}},fR="!",tk=n=>{const{separator:e,experimentalParseClassName:t}=n,r=e.length===1,i=e[0],s=e.length,o=a=>{const l=[];let h=0,d=0,f;for(let _=0;_<a.length;_++){let g=a[_];if(h===0){if(g===i&&(r||a.slice(_,_+s)===e)){l.push(a.slice(d,_)),d=_+s;continue}if(g==="/"){f=_;continue}}g==="["?h++:g==="]"&&h--}const p=l.length===0?a:a.substring(d),m=p.startsWith(fR),v=m?p.substring(1):p,x=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:x}};return t?a=>t({className:a,parseClassName:o}):o},nk=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e},rk=n=>({cache:ek(n.cacheSize),parseClassName:tk(n),...$U(n)}),ik=/\s+/,sk=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],o=n.trim().split(ik);let a="";for(let l=o.length-1;l>=0;l-=1){const h=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=t(h);let v=!!m,x=r(v?p.substring(0,m):p);if(!x){if(!v){a=h+(a.length>0?" "+a:a);continue}if(x=r(p),!x){a=h+(a.length>0?" "+a:a);continue}v=!1}const _=nk(d).join(":"),g=f?_+fR:_,S=g+x;if(s.includes(S))continue;s.push(S);const b=i(x,v);for(let M=0;M<b.length;++M){const C=b[M];s.push(g+C)}a=h+(a.length>0?" "+a:a)}return a};function ok(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=pR(e))&&(r&&(r+=" "),r+=t);return r}const pR=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=pR(n[r]))&&(t&&(t+=" "),t+=e);return t};function ak(n,...e){let t,r,i,s=o;function o(l){const h=e.reduce((d,f)=>f(d),n());return t=rk(h),r=t.cache.get,i=t.cache.set,s=a,a(l)}function a(l){const h=r(l);if(h)return h;const d=sk(l,t);return i(l,d),d}return function(){return s(ok.apply(null,arguments))}}const Jt=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},mR=/^\[(?:([a-z-]+):)?(.+)\]$/i,lk=/^\d+\/\d+$/,ck=new Set(["px","full","screen"]),uk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bs=n=>Kc(n)||ck.has(n)||lk.test(n),Eo=n=>Au(n,"length",bk),Kc=n=>!!n&&!Number.isNaN(Number(n)),wv=n=>Au(n,"number",Kc),ph=n=>!!n&&Number.isInteger(Number(n)),mk=n=>n.endsWith("%")&&Kc(n.slice(0,-1)),wt=n=>mR.test(n),Ao=n=>uk.test(n),gk=new Set(["length","size","percentage"]),yk=n=>Au(n,gk,gR),vk=n=>Au(n,"position",gR),_k=new Set(["image","url"]),xk=n=>Au(n,_k,Tk),Sk=n=>Au(n,"",wk),mh=()=>!0,Au=(n,e,t)=>{const r=mR.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1},bk=n=>hk.test(n)&&!dk.test(n),gR=()=>!1,wk=n=>fk.test(n),Tk=n=>pk.test(n),Mk=()=>{const n=Jt("colors"),e=Jt("spacing"),t=Jt("blur"),r=Jt("brightness"),i=Jt("borderColor"),s=Jt("borderRadius"),o=Jt("borderSpacing"),a=Jt("borderWidth"),l=Jt("contrast"),h=Jt("grayscale"),d=Jt("hueRotate"),f=Jt("invert"),p=Jt("gap"),m=Jt("gradientColorStops"),v=Jt("gradientColorStopPositions"),x=Jt("inset"),_=Jt("margin"),g=Jt("opacity"),S=Jt("padding"),b=Jt("saturate"),M=Jt("scale"),C=Jt("sepia"),A=Jt("skew"),R=Jt("space"),O=Jt("translate"),P=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",wt,e],X=()=>[wt,e],se=()=>["",Bs,Eo],W=()=>["auto",Kc,wt],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",wt],G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Kc,wt];return{cacheSize:500,separator:":",theme:{colors:[mh],spacing:[Bs,Eo],blur:["none","",Ao,wt],brightness:Y(),borderColor:[n],borderRadius:["none","","full",Ao,wt],borderSpacing:X(),borderWidth:se(),contrast:Y(),grayscale:U(),hueRotate:Y(),invert:U(),gap:X(),gradientColorStops:[n],gradientColorStopPositions:[mk,Eo],inset:H(),margin:H(),opacity:Y(),padding:X(),saturate:Y(),scale:Y(),sepia:U(),skew:Y(),space:X(),translate:X()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[Ao]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),wt]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ph,wt]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",ph,wt]}],"grid-cols":[{"grid-cols":[mh]}],"col-start-end":[{col:["auto",{span:["full",ph,wt]},wt]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[mh]}],"row-start-end":[{row:["auto",{span:[ph,wt]},wt]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",wt,e]}],"min-w":[{"min-w":[wt,e,"min","max","fit"]}],"max-w":[{"max-w":[wt,e,"none","full","min","max","fit","prose",{screen:[Ao]},Ao]}],h:[{h:[wt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[wt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[wt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[wt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Ao,Eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wv]}],"font-family":[{font:[mh]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",wt]}],"line-clamp":[{"line-clamp":["none",Kc,wv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Bs,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Bs,Eo]}],"underline-offset":[{"underline-offset":["auto",Bs,wt]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:X()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),vk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xk]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Z()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[Bs,wt]}],"outline-w":[{outline:[Bs,Eo]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Bs,Eo]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Ao,Sk]}],"shadow-color":[{shadow:[mh]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ao,wt]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",wt]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[ph,wt]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",wt]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":X()}],"scroll-mx":[{"scroll-mx":X()}],"scroll-my":[{"scroll-my":X()}],"scroll-ms":[{"scroll-ms":X()}],"scroll-me":[{"scroll-me":X()}],"scroll-mt":[{"scroll-mt":X()}],"scroll-mr":[{"scroll-mr":X()}],"scroll-mb":[{"scroll-mb":X()}],"scroll-ml":[{"scroll-ml":X()}],"scroll-p":[{"scroll-p":X()}],"scroll-px":[{"scroll-px":X()}],"scroll-py":[{"scroll-py":X()}],"scroll-ps":[{"scroll-ps":X()}],"scroll-pe":[{"scroll-pe":X()}],"scroll-pt":[{"scroll-pt":X()}],"scroll-pr":[{"scroll-pr":X()}],"scroll-pb":[{"scroll-pb":X()}],"scroll-pl":[{"scroll-pl":X()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",wt]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Bs,Eo,wv]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Ek=ak(Mk);function Al(...n){return Ek(uR(n))}const Ak=HU,yR=D.forwardRef(({className:n,...e},t)=>L.jsx(rR,{ref:t,className:Al("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",n),...e}));yR.displayName=rR.displayName;const Ck=GU("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),vR=D.forwardRef(({className:n,variant:e,...t},r)=>L.jsx(iR,{ref:r,className:Al(Ck({variant:e}),n),...t}));vR.displayName=iR.displayName;const Pk=D.forwardRef(({className:n,...e},t)=>L.jsx(aR,{ref:t,className:Al("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",n),...e}));Pk.displayName=aR.displayName;const _R=D.forwardRef(({className:n,...e},t)=>L.jsx(lR,{ref:t,className:Al("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...e,children:L.jsx(qU,{className:"h-4 w-4"})}));_R.displayName=lR.displayName;const xR=D.forwardRef(({className:n,...e},t)=>L.jsx(sR,{ref:t,className:Al("text-sm font-semibold",n),...e}));xR.displayName=sR.displayName;const SR=D.forwardRef(({className:n,...e},t)=>L.jsx(oR,{ref:t,className:Al("text-sm opacity-90",n),...e}));SR.displayName=oR.displayName;function Rk(){const{toasts:n}=KO();return L.jsxs(Ak,{children:[n.map(function({id:e,title:t,description:r,action:i,...s}){return L.jsxs(vR,{...s,children:[L.jsxs("div",{className:"grid gap-1",children:[t&&L.jsx(xR,{children:t}),r&&L.jsx(SR,{children:r})]}),i,L.jsx(_R,{})]},e)}),L.jsx(yR,{})]})}var UT=["light","dark"],Ik="(prefers-color-scheme: dark)",Lk=D.createContext(void 0),Fk={setTheme:n=>{},themes:[]},Nk=()=>{var n;return(n=D.useContext(Lk))!=null?n:Fk};D.memo(({forcedTheme:n,storageKey:e,attribute:t,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:o,attrs:a,nonce:l})=>{let h=s==="system",d=t==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${t}',s='setAttribute';`,f=i?UT.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(v,x=!1,_=!0)=>{let g=o?o[v]:v,S=x?v+"|| ''":`'${g}'`,b="";return i&&_&&!x&&UT.includes(v)&&(b+=`d.style.colorScheme = '${v}';`),t==="class"?x||g?b+=`c.add(${S})`:b+="null":g&&(b+=`d[s](n,${S})`),b},m=n?`!function(){${d}${p(n)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${h})){var t='${Ik}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}${h?"":"else{"+p(s,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}else{${p(s,!1,!1)};}${f}}catch(t){}}();`;return D.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})});var Dk=n=>{switch(n){case"success":return kk;case"info":return zk;case"warning":return Bk;case"error":return Wk;default:return null}},Ok=Array(12).fill(0),Uk=({visible:n,className:e})=>Ae.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":n},Ae.createElement("div",{className:"sonner-spinner"},Ok.map((t,r)=>Ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),kk=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Bk=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ae.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),zk=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Wk=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Hk=Ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Gk=()=>{let[n,e]=Ae.useState(document.hidden);return Ae.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),n},T2=1,Vk=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let e=this.subscribers.indexOf(n);this.subscribers.splice(e,1)}),this.publish=n=>{this.subscribers.forEach(e=>e(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var e;let{message:t,...r}=n,i=typeof(n==null?void 0:n.id)=="number"||((e=n.id)==null?void 0:e.length)>0?n.id:T2++,s=this.toasts.find(a=>a.id===i),o=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...n,id:i,title:t}),{...a,...n,id:i,dismissible:o,title:t}):a):this.addToast({title:t,...r,dismissible:o,id:i}),i},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:n,dismiss:!0})),n),this.message=(n,e)=>this.create({...e,message:n}),this.error=(n,e)=>this.create({...e,message:n,type:"error"}),this.success=(n,e)=>this.create({...e,type:"success",message:n}),this.info=(n,e)=>this.create({...e,type:"info",message:n}),this.warning=(n,e)=>this.create({...e,type:"warning",message:n}),this.loading=(n,e)=>this.create({...e,type:"loading",message:n}),this.promise=(n,e)=>{if(!e)return;let t;e.loading!==void 0&&(t=this.create({...e,promise:n,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let r=n instanceof Promise?n:n(),i=t!==void 0,s,o=r.then(async l=>{if(s=["resolve",l],Ae.isValidElement(l))i=!1,this.create({id:t,type:"default",message:l});else if(Xk(l)&&!l.ok){i=!1;let h=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:t,type:"error",message:h,description:d})}else if(e.success!==void 0){i=!1;let h=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:t,type:"success",message:h,description:d})}}).catch(async l=>{if(s=["reject",l],e.error!==void 0){i=!1;let h=typeof e.error=="function"?await e.error(l):e.error,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:t,type:"error",message:h,description:d})}}).finally(()=>{var l;i&&(this.dismiss(t),t=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,h)=>o.then(()=>s[0]==="reject"?h(s[1]):l(s[1])).catch(h));return typeof t!="string"&&typeof t!="number"?{unwrap:a}:Object.assign(t,{unwrap:a})},this.custom=(n,e)=>{let t=(e==null?void 0:e.id)||T2++;return this.create({jsx:n(t),id:t,...e}),t},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Or=new Vk,jk=(n,e)=>{let t=(e==null?void 0:e.id)||T2++;return Or.addToast({title:n,...e,id:t}),t},Xk=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",Yk=jk,qk=()=>Or.toasts,$k=()=>Or.getActiveToasts();Object.assign(Yk,{success:Or.success,info:Or.info,warning:Or.warning,error:Or.error,custom:Or.custom,message:Or.message,promise:Or.promise,dismiss:Or.dismiss,loading:Or.loading},{getHistory:qk,getToasts:$k});function Kk(n,{insertAt:e}={}){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}Kk(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function Pp(n){return n.label!==void 0}var Zk=3,Qk="32px",Jk="16px",kT=4e3,e4=356,t4=14,n4=20,r4=200;function Fi(...n){return n.filter(Boolean).join(" ")}function i4(n){let[e,t]=n.split("-"),r=[];return e&&r.push(e),t&&r.push(t),r}var s4=n=>{var e,t,r,i,s,o,a,l,h,d,f;let{invert:p,toast:m,unstyled:v,interacting:x,setHeights:_,visibleToasts:g,heights:S,index:b,toasts:M,expanded:C,removeToast:A,defaultRichColors:R,closeButton:O,style:P,cancelButtonStyle:I,actionButtonStyle:H,className:X="",descriptionClassName:se="",duration:W,position:$,gap:Z,loadingIcon:re,expandByDefault:F,classNames:U,icons:G,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:ee}=n,[K,ie]=Ae.useState(null),[me,Ee]=Ae.useState(null),[ge,tt]=Ae.useState(!1),[nt,Be]=Ae.useState(!1),[Xe,j]=Ae.useState(!1),[Se,fe]=Ae.useState(!1),[Te,de]=Ae.useState(!1),[$e,Ne]=Ae.useState(0),[k,N]=Ae.useState(0),te=Ae.useRef(m.duration||W||kT),be=Ae.useRef(null),ve=Ae.useRef(null),_e=b===0,Ye=b+1<=g,Ce=m.type,Ue=m.dismissible!==!1,it=m.className||"",mt=m.descriptionClassName||"",xe=Ae.useMemo(()=>S.findIndex(we=>we.toastId===m.id)||0,[S,m.id]),Lt=Ae.useMemo(()=>{var we;return(we=m.closeButton)!=null?we:O},[m.closeButton,O]),bt=Ae.useMemo(()=>m.duration||W||kT,[m.duration,W]),lt=Ae.useRef(0),Ke=Ae.useRef(0),He=Ae.useRef(0),ct=Ae.useRef(null),[Ft,qt]=$.split("-"),vt=Ae.useMemo(()=>S.reduce((we,Qe,rt)=>rt>=xe?we:we+Qe.height,0),[S,xe]),Re=Gk(),q=m.invert||p,Fe=Ce==="loading";Ke.current=Ae.useMemo(()=>xe*Z+vt,[xe,vt]),Ae.useEffect(()=>{te.current=bt},[bt]),Ae.useEffect(()=>{tt(!0)},[]),Ae.useEffect(()=>{let we=ve.current;if(we){let Qe=we.getBoundingClientRect().height;return N(Qe),_(rt=>[{toastId:m.id,height:Qe,position:m.position},...rt]),()=>_(rt=>rt.filter(Nt=>Nt.toastId!==m.id))}},[_,m.id]),Ae.useLayoutEffect(()=>{if(!ge)return;let we=ve.current,Qe=we.style.height;we.style.height="auto";let rt=we.getBoundingClientRect().height;we.style.height=Qe,N(rt),_(Nt=>Nt.find(Ht=>Ht.toastId===m.id)?Nt.map(Ht=>Ht.toastId===m.id?{...Ht,height:rt}:Ht):[{toastId:m.id,height:rt,position:m.position},...Nt])},[ge,m.title,m.description,_,m.id]);let Ie=Ae.useCallback(()=>{Be(!0),Ne(Ke.current),_(we=>we.filter(Qe=>Qe.toastId!==m.id)),setTimeout(()=>{A(m)},r4)},[m,A,_,Ke]);Ae.useEffect(()=>{if(m.promise&&Ce==="loading"||m.duration===1/0||m.type==="loading")return;let we;return C||x||ee&&Re?(()=>{if(He.current<lt.current){let Qe=new Date().getTime()-lt.current;te.current=te.current-Qe}He.current=new Date().getTime()})():te.current!==1/0&&(lt.current=new Date().getTime(),we=setTimeout(()=>{var Qe;(Qe=m.onAutoClose)==null||Qe.call(m,m),Ie()},te.current)),()=>clearTimeout(we)},[C,x,m,Ce,ee,Re,Ie]),Ae.useEffect(()=>{m.delete&&Ie()},[Ie,m.delete]);function ot(){var we,Qe,rt;return G!=null&&G.loading?Ae.createElement("div",{className:Fi(U==null?void 0:U.loader,(we=m==null?void 0:m.classNames)==null?void 0:we.loader,"sonner-loader"),"data-visible":Ce==="loading"},G.loading):re?Ae.createElement("div",{className:Fi(U==null?void 0:U.loader,(Qe=m==null?void 0:m.classNames)==null?void 0:Qe.loader,"sonner-loader"),"data-visible":Ce==="loading"},re):Ae.createElement(Uk,{className:Fi(U==null?void 0:U.loader,(rt=m==null?void 0:m.classNames)==null?void 0:rt.loader),visible:Ce==="loading"})}return Ae.createElement("li",{tabIndex:0,ref:ve,className:Fi(X,it,U==null?void 0:U.toast,(e=m==null?void 0:m.classNames)==null?void 0:e.toast,U==null?void 0:U.default,U==null?void 0:U[Ce],(t=m==null?void 0:m.classNames)==null?void 0:t[Ce]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:R,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":ge,"data-promise":!!m.promise,"data-swiped":Te,"data-removed":nt,"data-visible":Ye,"data-y-position":Ft,"data-x-position":qt,"data-index":b,"data-front":_e,"data-swiping":Xe,"data-dismissible":Ue,"data-type":Ce,"data-invert":q,"data-swipe-out":Se,"data-swipe-direction":me,"data-expanded":!!(C||F&&ge),style:{"--index":b,"--toasts-before":b,"--z-index":M.length-b,"--offset":`${nt?$e:Ke.current}px`,"--initial-height":F?"auto":`${k}px`,...P,...m.style},onDragEnd:()=>{j(!1),ie(null),ct.current=null},onPointerDown:we=>{Fe||!Ue||(be.current=new Date,Ne(Ke.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&(j(!0),ct.current={x:we.clientX,y:we.clientY}))},onPointerUp:()=>{var we,Qe,rt,Nt;if(Se||!Ue)return;ct.current=null;let Ht=Number(((we=ve.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rt=Number(((Qe=ve.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Zt=new Date().getTime()-((rt=be.current)==null?void 0:rt.getTime()),rn=K==="x"?Ht:Rt,Ir=Math.abs(rn)/Zt;if(Math.abs(rn)>=n4||Ir>.11){Ne(Ke.current),(Nt=m.onDismiss)==null||Nt.call(m,m),Ee(K==="x"?Ht>0?"right":"left":Rt>0?"down":"up"),Ie(),fe(!0),de(!1);return}j(!1),ie(null)},onPointerMove:we=>{var Qe,rt,Nt,Ht;if(!ct.current||!Ue||((Qe=window.getSelection())==null?void 0:Qe.toString().length)>0)return;let Rt=we.clientY-ct.current.y,Zt=we.clientX-ct.current.x,rn=(rt=n.swipeDirections)!=null?rt:i4($);!K&&(Math.abs(Zt)>1||Math.abs(Rt)>1)&&ie(Math.abs(Zt)>Math.abs(Rt)?"x":"y");let Ir={x:0,y:0};K==="y"?(rn.includes("top")||rn.includes("bottom"))&&(rn.includes("top")&&Rt<0||rn.includes("bottom")&&Rt>0)&&(Ir.y=Rt):K==="x"&&(rn.includes("left")||rn.includes("right"))&&(rn.includes("left")&&Zt<0||rn.includes("right")&&Zt>0)&&(Ir.x=Zt),(Math.abs(Ir.x)>0||Math.abs(Ir.y)>0)&&de(!0),(Nt=ve.current)==null||Nt.style.setProperty("--swipe-amount-x",`${Ir.x}px`),(Ht=ve.current)==null||Ht.style.setProperty("--swipe-amount-y",`${Ir.y}px`)}},Lt&&!m.jsx?Ae.createElement("button",{"aria-label":Y,"data-disabled":Fe,"data-close-button":!0,onClick:Fe||!Ue?()=>{}:()=>{var we;Ie(),(we=m.onDismiss)==null||we.call(m,m)},className:Fi(U==null?void 0:U.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(s=G==null?void 0:G.close)!=null?s:Hk):null,m.jsx||D.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:Ae.createElement(Ae.Fragment,null,Ce||m.icon||m.promise?Ae.createElement("div",{"data-icon":"",className:Fi(U==null?void 0:U.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ot():null,m.type!=="loading"?m.icon||(G==null?void 0:G[Ce])||Dk(Ce):null):null,Ae.createElement("div",{"data-content":"",className:Fi(U==null?void 0:U.content,(a=m==null?void 0:m.classNames)==null?void 0:a.content)},Ae.createElement("div",{"data-title":"",className:Fi(U==null?void 0:U.title,(l=m==null?void 0:m.classNames)==null?void 0:l.title)},typeof m.title=="function"?m.title():m.title),m.description?Ae.createElement("div",{"data-description":"",className:Fi(se,mt,U==null?void 0:U.description,(h=m==null?void 0:m.classNames)==null?void 0:h.description)},typeof m.description=="function"?m.description():m.description):null),D.isValidElement(m.cancel)?m.cancel:m.cancel&&Pp(m.cancel)?Ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:we=>{var Qe,rt;Pp(m.cancel)&&Ue&&((rt=(Qe=m.cancel).onClick)==null||rt.call(Qe,we),Ie())},className:Fi(U==null?void 0:U.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,D.isValidElement(m.action)?m.action:m.action&&Pp(m.action)?Ae.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:we=>{var Qe,rt;Pp(m.action)&&((rt=(Qe=m.action).onClick)==null||rt.call(Qe,we),!we.defaultPrevented&&Ie())},className:Fi(U==null?void 0:U.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function BT(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function o4(n,e){let t={};return[n,e].forEach((r,i)=>{let s=i===1,o=s?"--mobile-offset":"--offset",a=s?Jk:Qk;function l(h){["top","right","bottom","left"].forEach(d=>{t[`${o}-${d}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?t[`${o}-${h}`]=a:t[`${o}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):l(a)}),t}var a4=D.forwardRef(function(n,e){let{invert:t,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:o,className:a,offset:l,mobileOffset:h,theme:d="light",richColors:f,duration:p,style:m,visibleToasts:v=Zk,toastOptions:x,dir:_=BT(),gap:g=t4,loadingIcon:S,icons:b,containerAriaLabel:M="Notifications",pauseWhenPageIsHidden:C}=n,[A,R]=Ae.useState([]),O=Ae.useMemo(()=>Array.from(new Set([r].concat(A.filter(ee=>ee.position).map(ee=>ee.position)))),[A,r]),[P,I]=Ae.useState([]),[H,X]=Ae.useState(!1),[se,W]=Ae.useState(!1),[$,Z]=Ae.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),re=Ae.useRef(null),F=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=Ae.useRef(null),G=Ae.useRef(!1),Y=Ae.useCallback(ee=>{R(K=>{var ie;return(ie=K.find(me=>me.id===ee.id))!=null&&ie.delete||Or.dismiss(ee.id),K.filter(({id:me})=>me!==ee.id)})},[]);return Ae.useEffect(()=>Or.subscribe(ee=>{if(ee.dismiss){R(K=>K.map(ie=>ie.id===ee.id?{...ie,delete:!0}:ie));return}setTimeout(()=>{CP.flushSync(()=>{R(K=>{let ie=K.findIndex(me=>me.id===ee.id);return ie!==-1?[...K.slice(0,ie),{...K[ie],...ee},...K.slice(ie+1)]:[ee,...K]})})})}),[]),Ae.useEffect(()=>{if(d!=="system"){Z(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;let ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:K})=>{Z(K?"dark":"light")})}catch{ee.addListener(({matches:ie})=>{try{Z(ie?"dark":"light")}catch(me){console.error(me)}})}},[d]),Ae.useEffect(()=>{A.length<=1&&X(!1)},[A]),Ae.useEffect(()=>{let ee=K=>{var ie,me;i.every(Ee=>K[Ee]||K.code===Ee)&&(X(!0),(ie=re.current)==null||ie.focus()),K.code==="Escape"&&(document.activeElement===re.current||(me=re.current)!=null&&me.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[i]),Ae.useEffect(()=>{if(re.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,G.current=!1)}},[re.current]),Ae.createElement("section",{ref:e,"aria-label":`${M} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((ee,K)=>{var ie;let[me,Ee]=ee.split("-");return A.length?Ae.createElement("ol",{key:ee,dir:_==="auto"?BT():_,tabIndex:-1,ref:re,className:a,"data-sonner-toaster":!0,"data-theme":$,"data-y-position":me,"data-lifted":H&&A.length>1&&!s,"data-x-position":Ee,style:{"--front-toast-height":`${((ie=P[0])==null?void 0:ie.height)||0}px`,"--width":`${e4}px`,"--gap":`${g}px`,...m,...o4(l,h)},onBlur:ge=>{G.current&&!ge.currentTarget.contains(ge.relatedTarget)&&(G.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||G.current||(G.current=!0,U.current=ge.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{se||X(!1)},onDragEnd:()=>X(!1),onPointerDown:ge=>{ge.target instanceof HTMLElement&&ge.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},A.filter(ge=>!ge.position&&K===0||ge.position===ee).map((ge,tt)=>{var nt,Be;return Ae.createElement(s4,{key:ge.id,icons:b,index:tt,toast:ge,defaultRichColors:f,duration:(nt=x==null?void 0:x.duration)!=null?nt:p,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:t,visibleToasts:v,closeButton:(Be=x==null?void 0:x.closeButton)!=null?Be:o,interacting:se,position:ee,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:Y,toasts:A.filter(Xe=>Xe.position==ge.position),heights:P.filter(Xe=>Xe.position==ge.position),setHeights:I,expandByDefault:s,gap:g,loadingIcon:S,expanded:H,pauseWhenPageIsHidden:C,swipeDirections:n.swipeDirections})})):null}))});const l4=({...n})=>{const{theme:e="system"}=Nk();return L.jsx(a4,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...n})},c4=["top","right","bottom","left"],fa=Math.min,ti=Math.max,S0=Math.round,Rp=Math.floor,Ts=n=>({x:n,y:n}),u4={left:"right",right:"left",bottom:"top",top:"bottom"},h4={start:"end",end:"start"};function M2(n,e,t){return ti(n,fa(e,t))}function lo(n,e){return typeof n=="function"?n(e):n}function co(n){return n.split("-")[0]}function Cu(n){return n.split("-")[1]}function PS(n){return n==="x"?"y":"x"}function RS(n){return n==="y"?"height":"width"}const d4=new Set(["top","bottom"]);function Ss(n){return d4.has(co(n))?"y":"x"}function IS(n){return PS(Ss(n))}function f4(n,e,t){t===void 0&&(t=!1);const r=Cu(n),i=IS(n),s=RS(i);let o=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=b0(o)),[o,b0(o)]}function p4(n){const e=b0(n);return[E2(n),e,E2(e)]}function E2(n){return n.replace(/start|end/g,e=>h4[e])}const zT=["left","right"],WT=["right","left"],m4=["top","bottom"],g4=["bottom","top"];function y4(n,e,t){switch(n){case"top":case"bottom":return t?e?WT:zT:e?zT:WT;case"left":case"right":return e?m4:g4;default:return[]}}function v4(n,e,t,r){const i=Cu(n);let s=y4(co(n),t==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(E2)))),s}function b0(n){return n.replace(/left|right|bottom|top/g,e=>u4[e])}function _4(n){return{top:0,right:0,bottom:0,left:0,...n}}function bR(n){return typeof n!="number"?_4(n):{top:n,right:n,bottom:n,left:n}}function w0(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function HT(n,e,t){let{reference:r,floating:i}=n;const s=Ss(e),o=IS(e),a=RS(o),l=co(e),h=s==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-i.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-i.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Cu(e)){case"start":m[o]-=p*(t&&h?-1:1);break;case"end":m[o]+=p*(t&&h?-1:1);break}return m}const x4=async(n,e,t)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=t,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let h=await o.getElementRects({reference:n,floating:e,strategy:i}),{x:d,y:f}=HT(h,r,l),p=r,m={},v=0;for(let x=0;x<a.length;x++){const{name:_,fn:g}=a[x],{x:S,y:b,data:M,reset:C}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:h,platform:o,elements:{reference:n,floating:e}});d=S??d,f=b??f,m={...m,[_]:{...m[_],...M}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(h=C.rects===!0?await o.getElementRects({reference:n,floating:e,strategy:i}):C.rects),{x:d,y:f}=HT(h,p,l)),x=-1)}return{x:d,y:f,placement:p,strategy:i,middlewareData:m}};async function fd(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=n,{boundary:h="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=lo(e,n),v=bR(m),_=a[p?f==="floating"?"reference":"floating":f],g=w0(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(_)))==null||t?_:_.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:h,rootBoundary:d,strategy:l})),S=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),M=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},C=w0(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:b,strategy:l}):S);return{top:(g.top-C.top+v.top)/M.y,bottom:(C.bottom-g.bottom+v.bottom)/M.y,left:(g.left-C.left+v.left)/M.x,right:(C.right-g.right+v.right)/M.x}}const S4=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:h,padding:d=0}=lo(n,e)||{};if(h==null)return{};const f=bR(d),p={x:t,y:r},m=IS(i),v=RS(m),x=await o.getDimensions(h),_=m==="y",g=_?"top":"left",S=_?"bottom":"right",b=_?"clientHeight":"clientWidth",M=s.reference[v]+s.reference[m]-p[m]-s.floating[v],C=p[m]-s.reference[m],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(h));let R=A?A[b]:0;(!R||!await(o.isElement==null?void 0:o.isElement(A)))&&(R=a.floating[b]||s.floating[v]);const O=M/2-C/2,P=R/2-x[v]/2-1,I=fa(f[g],P),H=fa(f[S],P),X=I,se=R-x[v]-H,W=R/2-x[v]/2+O,$=M2(X,W,se),Z=!l.arrow&&Cu(i)!=null&&W!==$&&s.reference[v]/2-(W<X?I:H)-x[v]/2<0,re=Z?W<X?W-X:W-se:0;return{[m]:p[m]+re,data:{[m]:$,centerOffset:W-$-re,...Z&&{alignmentOffset:re}},reset:Z}}}),b4=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:h}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:x=!0,..._}=lo(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const g=co(i),S=Ss(a),b=co(a)===a,M=await(l.isRTL==null?void 0:l.isRTL(h.floating)),C=p||(b||!x?[b0(a)]:p4(a)),A=v!=="none";!p&&A&&C.push(...v4(a,x,v,M));const R=[a,...C],O=await fd(e,_),P=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&P.push(O[g]),f){const W=f4(i,o,M);P.push(O[W[0]],O[W[1]])}if(I=[...I,{placement:i,overflows:P}],!P.every(W=>W<=0)){var H,X;const W=(((H=s.flip)==null?void 0:H.index)||0)+1,$=R[W];if($&&(!(f==="alignment"?S!==Ss($):!1)||I.every(F=>F.overflows[0]>0&&Ss(F.placement)===S)))return{data:{index:W,overflows:I},reset:{placement:$}};let Z=(X=I.filter(re=>re.overflows[0]<=0).sort((re,F)=>re.overflows[1]-F.overflows[1])[0])==null?void 0:X.placement;if(!Z)switch(m){case"bestFit":{var se;const re=(se=I.filter(F=>{if(A){const U=Ss(F.placement);return U===S||U==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(U=>U>0).reduce((U,G)=>U+G,0)]).sort((F,U)=>F[1]-U[1])[0])==null?void 0:se[0];re&&(Z=re);break}case"initialPlacement":Z=a;break}if(i!==Z)return{reset:{placement:Z}}}return{}}}};function GT(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function VT(n){return c4.some(e=>n[e]>=0)}const w4=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=lo(n,e);switch(r){case"referenceHidden":{const s=await fd(e,{...i,elementContext:"reference"}),o=GT(s,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:VT(o)}}}case"escaped":{const s=await fd(e,{...i,altBoundary:!0}),o=GT(s,t.floating);return{data:{escapedOffsets:o,escaped:VT(o)}}}default:return{}}}}},wR=new Set(["left","top"]);async function T4(n,e){const{placement:t,platform:r,elements:i}=n,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=co(t),a=Cu(t),l=Ss(t)==="y",h=wR.has(o)?-1:1,d=s&&l?-1:1,f=lo(e,n);let{mainAxis:p,crossAxis:m,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),l?{x:m*d,y:p*h}:{x:p*h,y:m*d}}const M4=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await T4(e,n);return o===((t=a.offset)==null?void 0:t.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},E4=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:_=>{let{x:g,y:S}=_;return{x:g,y:S}}},...l}=lo(n,e),h={x:t,y:r},d=await fd(e,l),f=Ss(co(i)),p=PS(f);let m=h[p],v=h[f];if(s){const _=p==="y"?"top":"left",g=p==="y"?"bottom":"right",S=m+d[_],b=m-d[g];m=M2(S,m,b)}if(o){const _=f==="y"?"top":"left",g=f==="y"?"bottom":"right",S=v+d[_],b=v-d[g];v=M2(S,v,b)}const x=a.fn({...e,[p]:m,[f]:v});return{...x,data:{x:x.x-t,y:x.y-r,enabled:{[p]:s,[f]:o}}}}}},A4=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:h=!0}=lo(n,e),d={x:t,y:r},f=Ss(i),p=PS(f);let m=d[p],v=d[f];const x=lo(a,e),_=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){const b=p==="y"?"height":"width",M=s.reference[p]-s.floating[b]+_.mainAxis,C=s.reference[p]+s.reference[b]-_.mainAxis;m<M?m=M:m>C&&(m=C)}if(h){var g,S;const b=p==="y"?"width":"height",M=wR.has(co(i)),C=s.reference[f]-s.floating[b]+(M&&((g=o.offset)==null?void 0:g[f])||0)+(M?0:_.crossAxis),A=s.reference[f]+s.reference[b]+(M?0:((S=o.offset)==null?void 0:S[f])||0)-(M?_.crossAxis:0);v<C?v=C:v>A&&(v=A)}return{[p]:m,[f]:v}}}},C4=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...h}=lo(n,e),d=await fd(e,h),f=co(i),p=Cu(i),m=Ss(i)==="y",{width:v,height:x}=s.floating;let _,g;f==="top"||f==="bottom"?(_=f,g=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,_=p==="end"?"top":"bottom");const S=x-d.top-d.bottom,b=v-d.left-d.right,M=fa(x-d[_],S),C=fa(v-d[g],b),A=!e.middlewareData.shift;let R=M,O=C;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(O=b),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(R=S),A&&!p){const I=ti(d.left,0),H=ti(d.right,0),X=ti(d.top,0),se=ti(d.bottom,0);m?O=v-2*(I!==0||H!==0?I+H:ti(d.left,d.right)):R=x-2*(X!==0||se!==0?X+se:ti(d.top,d.bottom))}await l({...e,availableWidth:O,availableHeight:R});const P=await o.getDimensions(a.floating);return v!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function eg(){return typeof window<"u"}function Pu(n){return TR(n)?(n.nodeName||"").toLowerCase():"#document"}function si(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Is(n){var e;return(e=(TR(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function TR(n){return eg()?n instanceof Node||n instanceof si(n).Node:!1}function Ji(n){return eg()?n instanceof Element||n instanceof si(n).Element:!1}function Cs(n){return eg()?n instanceof HTMLElement||n instanceof si(n).HTMLElement:!1}function jT(n){return!eg()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof si(n).ShadowRoot}const P4=new Set(["inline","contents"]);function Zd(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=es(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!P4.has(i)}const R4=new Set(["table","td","th"]);function I4(n){return R4.has(Pu(n))}const L4=[":popover-open",":modal"];function tg(n){return L4.some(e=>{try{return n.matches(e)}catch{return!1}})}const F4=["transform","translate","scale","rotate","perspective"],N4=["transform","translate","scale","rotate","perspective","filter"],D4=["paint","layout","strict","content"];function LS(n){const e=FS(),t=Ji(n)?es(n):n;return F4.some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||N4.some(r=>(t.willChange||"").includes(r))||D4.some(r=>(t.contain||"").includes(r))}function O4(n){let e=pa(n);for(;Cs(e)&&!pu(e);){if(LS(e))return e;if(tg(e))return null;e=pa(e)}return null}function FS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const U4=new Set(["html","body","#document"]);function pu(n){return U4.has(Pu(n))}function es(n){return si(n).getComputedStyle(n)}function ng(n){return Ji(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function pa(n){if(Pu(n)==="html")return n;const e=n.assignedSlot||n.parentNode||jT(n)&&n.host||Is(n);return jT(e)?e.host:e}function MR(n){const e=pa(n);return pu(e)?n.ownerDocument?n.ownerDocument.body:n.body:Cs(e)&&Zd(e)?e:MR(e)}function pd(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=MR(n),s=i===((r=n.ownerDocument)==null?void 0:r.body),o=si(i);if(s){const a=A2(o);return e.concat(o,o.visualViewport||[],Zd(i)?i:[],a&&t?pd(a):[])}return e.concat(i,pd(i,[],t))}function A2(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function ER(n){const e=es(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Cs(n),s=i?n.offsetWidth:t,o=i?n.offsetHeight:r,a=S0(t)!==s||S0(r)!==o;return a&&(t=s,r=o),{width:t,height:r,$:a}}function NS(n){return Ji(n)?n:n.contextElement}function Zc(n){const e=NS(n);if(!Cs(e))return Ts(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:s}=ER(e);let o=(s?S0(t.width):t.width)/r,a=(s?S0(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const k4=Ts(0);function AR(n){const e=si(n);return!FS()||!e.visualViewport?k4:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function B4(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==si(n)?!1:e}function Sl(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),s=NS(n);let o=Ts(1);e&&(r?Ji(r)&&(o=Zc(r)):o=Zc(n));const a=B4(s,t,r)?AR(s):Ts(0);let l=(i.left+a.x)/o.x,h=(i.top+a.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(s){const p=si(s),m=r&&Ji(r)?si(r):r;let v=p,x=A2(v);for(;x&&r&&m!==v;){const _=Zc(x),g=x.getBoundingClientRect(),S=es(x),b=g.left+(x.clientLeft+parseFloat(S.paddingLeft))*_.x,M=g.top+(x.clientTop+parseFloat(S.paddingTop))*_.y;l*=_.x,h*=_.y,d*=_.x,f*=_.y,l+=b,h+=M,v=si(x),x=A2(v)}}return w0({width:d,height:f,x:l,y:h})}function DS(n,e){const t=ng(n).scrollLeft;return e?e.left+t:Sl(Is(n)).left+t}function CR(n,e,t){t===void 0&&(t=!1);const r=n.getBoundingClientRect(),i=r.left+e.scrollLeft-(t?0:DS(n,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function z4(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const s=i==="fixed",o=Is(r),a=e?tg(e.floating):!1;if(r===o||a&&s)return t;let l={scrollLeft:0,scrollTop:0},h=Ts(1);const d=Ts(0),f=Cs(r);if((f||!f&&!s)&&((Pu(r)!=="body"||Zd(o))&&(l=ng(r)),Cs(r))){const m=Sl(r);h=Zc(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=o&&!f&&!s?CR(o,l,!0):Ts(0);return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-l.scrollLeft*h.x+d.x+p.x,y:t.y*h.y-l.scrollTop*h.y+d.y+p.y}}function W4(n){return Array.from(n.getClientRects())}function H4(n){const e=Is(n),t=ng(n),r=n.ownerDocument.body,i=ti(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=ti(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-t.scrollLeft+DS(n);const a=-t.scrollTop;return es(r).direction==="rtl"&&(o+=ti(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function G4(n,e){const t=si(n),r=Is(n),i=t.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const h=FS();(!h||h&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}const V4=new Set(["absolute","fixed"]);function j4(n,e){const t=Sl(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,s=Cs(n)?Zc(n):Ts(1),o=n.clientWidth*s.x,a=n.clientHeight*s.y,l=i*s.x,h=r*s.y;return{width:o,height:a,x:l,y:h}}function XT(n,e,t){let r;if(e==="viewport")r=G4(n,t);else if(e==="document")r=H4(Is(n));else if(Ji(e))r=j4(e,t);else{const i=AR(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return w0(r)}function PR(n,e){const t=pa(n);return t===e||!Ji(t)||pu(t)?!1:es(t).position==="fixed"||PR(t,e)}function X4(n,e){const t=e.get(n);if(t)return t;let r=pd(n,[],!1).filter(a=>Ji(a)&&Pu(a)!=="body"),i=null;const s=es(n).position==="fixed";let o=s?pa(n):n;for(;Ji(o)&&!pu(o);){const a=es(o),l=LS(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&V4.has(i.position)||Zd(o)&&!l&&PR(n,o))?r=r.filter(d=>d!==o):i=a,o=pa(o)}return e.set(n,r),r}function Y4(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=[...t==="clippingAncestors"?tg(e)?[]:X4(e,this._c):[].concat(t),r],a=o[0],l=o.reduce((h,d)=>{const f=XT(e,d,i);return h.top=ti(f.top,h.top),h.right=fa(f.right,h.right),h.bottom=fa(f.bottom,h.bottom),h.left=ti(f.left,h.left),h},XT(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function q4(n){const{width:e,height:t}=ER(n);return{width:e,height:t}}function $4(n,e,t){const r=Cs(e),i=Is(e),s=t==="fixed",o=Sl(n,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Ts(0);function h(){l.x=DS(i)}if(r||!r&&!s)if((Pu(e)!=="body"||Zd(i))&&(a=ng(e)),r){const m=Sl(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&h();s&&!r&&i&&h();const d=i&&!r&&!s?CR(i,a):Ts(0),f=o.left+a.scrollLeft-l.x-d.x,p=o.top+a.scrollTop-l.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function Tv(n){return es(n).position==="static"}function YT(n,e){if(!Cs(n)||es(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Is(n)===t&&(t=t.ownerDocument.body),t}function RR(n,e){const t=si(n);if(tg(n))return t;if(!Cs(n)){let i=pa(n);for(;i&&!pu(i);){if(Ji(i)&&!Tv(i))return i;i=pa(i)}return t}let r=YT(n,e);for(;r&&I4(r)&&Tv(r);)r=YT(r,e);return r&&pu(r)&&Tv(r)&&!LS(r)?t:r||O4(n)||t}const K4=async function(n){const e=this.getOffsetParent||RR,t=this.getDimensions,r=await t(n.floating);return{reference:$4(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Z4(n){return es(n).direction==="rtl"}const Q4={convertOffsetParentRelativeRectToViewportRelativeRect:z4,getDocumentElement:Is,getClippingRect:Y4,getOffsetParent:RR,getElementRects:K4,getClientRects:W4,getDimensions:q4,getScale:Zc,isElement:Ji,isRTL:Z4};function IR(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function J4(n,e){let t=null,r;const i=Is(n);function s(){var a;clearTimeout(r),(a=t)==null||a.disconnect(),t=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const h=n.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=h;if(a||e(),!p||!m)return;const v=Rp(f),x=Rp(i.clientWidth-(d+p)),_=Rp(i.clientHeight-(f+m)),g=Rp(d),b={rootMargin:-v+"px "+-x+"px "+-_+"px "+-g+"px",threshold:ti(0,fa(1,l))||1};let M=!0;function C(A){const R=A[0].intersectionRatio;if(R!==l){if(!M)return o();R?o(!1,R):r=setTimeout(()=>{o(!1,1e-7)},1e3)}R===1&&!IR(h,n.getBoundingClientRect())&&o(),M=!1}try{t=new IntersectionObserver(C,{...b,root:i.ownerDocument})}catch{t=new IntersectionObserver(C,b)}t.observe(n)}return o(!0),s}function eB(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,h=NS(n),d=i||s?[...h?pd(h):[],...pd(e)]:[];d.forEach(g=>{i&&g.addEventListener("scroll",t,{passive:!0}),s&&g.addEventListener("resize",t)});const f=h&&a?J4(h,t):null;let p=-1,m=null;o&&(m=new ResizeObserver(g=>{let[S]=g;S&&S.target===h&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(e)})),t()}),h&&!l&&m.observe(h),m.observe(e));let v,x=l?Sl(n):null;l&&_();function _(){const g=Sl(n);x&&!IR(x,g)&&t(),x=g,v=requestAnimationFrame(_)}return t(),()=>{var g;d.forEach(S=>{i&&S.removeEventListener("scroll",t),s&&S.removeEventListener("resize",t)}),f==null||f(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const tB=M4,nB=E4,rB=b4,iB=C4,sB=w4,qT=S4,oB=A4,aB=(n,e,t)=>{const r=new Map,i={platform:Q4,...t},s={...i.platform,_c:r};return x4(n,e,{...i,platform:s})};var lB=typeof document<"u",cB=function(){},Hm=lB?D.useLayoutEffect:cB;function T0(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!==0;)if(!T0(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!==0;){const s=i[r];if(!(s==="_owner"&&n.$$typeof)&&!T0(n[s],e[s]))return!1}return!0}return n!==n&&e!==e}function LR(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function $T(n,e){const t=LR(n);return Math.round(e*t)/t}function Mv(n){const e=D.useRef(n);return Hm(()=>{e.current=n}),e}function uB(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:h}=n,[d,f]=D.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=D.useState(r);T0(p,r)||m(r);const[v,x]=D.useState(null),[_,g]=D.useState(null),S=D.useCallback(F=>{F!==A.current&&(A.current=F,x(F))},[]),b=D.useCallback(F=>{F!==R.current&&(R.current=F,g(F))},[]),M=s||v,C=o||_,A=D.useRef(null),R=D.useRef(null),O=D.useRef(d),P=l!=null,I=Mv(l),H=Mv(i),X=Mv(h),se=D.useCallback(()=>{if(!A.current||!R.current)return;const F={placement:e,strategy:t,middleware:p};H.current&&(F.platform=H.current),aB(A.current,R.current,F).then(U=>{const G={...U,isPositioned:X.current!==!1};W.current&&!T0(O.current,G)&&(O.current=G,$d.flushSync(()=>{f(G)}))})},[p,e,t,H,X]);Hm(()=>{h===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[h]);const W=D.useRef(!1);Hm(()=>(W.current=!0,()=>{W.current=!1}),[]),Hm(()=>{if(M&&(A.current=M),C&&(R.current=C),M&&C){if(I.current)return I.current(M,C,se);se()}},[M,C,se,I,P]);const $=D.useMemo(()=>({reference:A,floating:R,setReference:S,setFloating:b}),[S,b]),Z=D.useMemo(()=>({reference:M,floating:C}),[M,C]),re=D.useMemo(()=>{const F={position:t,left:0,top:0};if(!Z.floating)return F;const U=$T(Z.floating,d.x),G=$T(Z.floating,d.y);return a?{...F,transform:"translate("+U+"px, "+G+"px)",...LR(Z.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:U,top:G}},[t,a,Z.floating,d.x,d.y]);return D.useMemo(()=>({...d,update:se,refs:$,elements:Z,floatingStyles:re}),[d,se,$,Z,re])}const hB=n=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:n,fn(t){const{element:r,padding:i}=typeof n=="function"?n(t):n;return r&&e(r)?r.current!=null?qT({element:r.current,padding:i}).fn(t):{}:r?qT({element:r,padding:i}).fn(t):{}}}},dB=(n,e)=>({...tB(n),options:[n,e]}),fB=(n,e)=>({...nB(n),options:[n,e]}),pB=(n,e)=>({...oB(n),options:[n,e]}),mB=(n,e)=>({...rB(n),options:[n,e]}),gB=(n,e)=>({...iB(n),options:[n,e]}),yB=(n,e)=>({...sB(n),options:[n,e]}),vB=(n,e)=>({...hB(n),options:[n,e]});var _B="Arrow",FR=D.forwardRef((n,e)=>{const{children:t,width:r=10,height:i=5,...s}=n;return L.jsx(jr.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:L.jsx("polygon",{points:"0,0 30,0 15,10"})})});FR.displayName=_B;var xB=FR;function SB(n){const[e,t]=D.useState(void 0);return da(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,h=Array.isArray(l)?l[0]:l;o=h.inlineSize,a=h.blockSize}else o=n.offsetWidth,a=n.offsetHeight;t({width:o,height:a})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}else t(void 0)},[n]),e}var NR="Popper",[DR,OR]=Z0(NR),[ZZ,UR]=DR(NR),kR="PopperAnchor",BR=D.forwardRef((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,s=UR(kR,t),o=D.useRef(null),a=Qi(e,o);return D.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:L.jsx(jr.div,{...i,ref:a})});BR.displayName=kR;var OS="PopperContent",[bB,wB]=DR(OS),zR=D.forwardRef((n,e)=>{var ge,tt,nt,Be,Xe,j;const{__scopePopper:t,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:h=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:v,...x}=n,_=UR(OS,t),[g,S]=D.useState(null),b=Qi(e,Se=>S(Se)),[M,C]=D.useState(null),A=SB(M),R=(A==null?void 0:A.width)??0,O=(A==null?void 0:A.height)??0,P=r+(s!=="center"?"-"+s:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},H=Array.isArray(h)?h:[h],X=H.length>0,se={padding:I,boundary:H.filter(MB),altBoundary:X},{refs:W,floatingStyles:$,placement:Z,isPositioned:re,middlewareData:F}=uB({strategy:"fixed",placement:P,whileElementsMounted:(...Se)=>eB(...Se,{animationFrame:m==="always"}),elements:{reference:_.anchor},middleware:[dB({mainAxis:i+O,alignmentAxis:o}),l&&fB({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?pB():void 0,...se}),l&&mB({...se}),gB({...se,apply:({elements:Se,rects:fe,availableWidth:Te,availableHeight:de})=>{const{width:$e,height:Ne}=fe.reference,k=Se.floating.style;k.setProperty("--radix-popper-available-width",`${Te}px`),k.setProperty("--radix-popper-available-height",`${de}px`),k.setProperty("--radix-popper-anchor-width",`${$e}px`),k.setProperty("--radix-popper-anchor-height",`${Ne}px`)}}),M&&vB({element:M,padding:a}),EB({arrowWidth:R,arrowHeight:O}),p&&yB({strategy:"referenceHidden",...se})]}),[U,G]=GR(Z),Y=ha(v);da(()=>{re&&(Y==null||Y())},[re,Y]);const ee=(ge=F.arrow)==null?void 0:ge.x,K=(tt=F.arrow)==null?void 0:tt.y,ie=((nt=F.arrow)==null?void 0:nt.centerOffset)!==0,[me,Ee]=D.useState();return da(()=>{g&&Ee(window.getComputedStyle(g).zIndex)},[g]),L.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:re?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(Be=F.transformOrigin)==null?void 0:Be.x,(Xe=F.transformOrigin)==null?void 0:Xe.y].join(" "),...((j=F.hide)==null?void 0:j.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:L.jsx(bB,{scope:t,placedSide:U,onArrowChange:C,arrowX:ee,arrowY:K,shouldHideArrow:ie,children:L.jsx(jr.div,{"data-side":U,"data-align":G,...x,ref:b,style:{...x.style,animation:re?void 0:"none"}})})})});zR.displayName=OS;var WR="PopperArrow",TB={top:"bottom",right:"left",bottom:"top",left:"right"},HR=D.forwardRef(function(e,t){const{__scopePopper:r,...i}=e,s=wB(WR,r),o=TB[s.placedSide];return L.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:L.jsx(xB,{...i,ref:t,style:{...i.style,display:"block"}})})});HR.displayName=WR;function MB(n){return n!==null}var EB=n=>({name:"transformOrigin",options:n,fn(e){var _,g,S;const{placement:t,rects:r,middlewareData:i}=e,o=((_=i.arrow)==null?void 0:_.centerOffset)!==0,a=o?0:n.arrowWidth,l=o?0:n.arrowHeight,[h,d]=GR(t),f={start:"0%",center:"50%",end:"100%"}[d],p=(((g=i.arrow)==null?void 0:g.x)??0)+a/2,m=(((S=i.arrow)==null?void 0:S.y)??0)+l/2;let v="",x="";return h==="bottom"?(v=o?f:`${p}px`,x=`${-l}px`):h==="top"?(v=o?f:`${p}px`,x=`${r.floating.height+l}px`):h==="right"?(v=`${-l}px`,x=o?f:`${m}px`):h==="left"&&(v=`${r.floating.width+l}px`,x=o?f:`${m}px`),{data:{x:v,y:x}}}});function GR(n){const[e,t="center"]=n.split("-");return[e,t]}var AB=BR,CB=zR,PB=HR,[rg,QZ]=Z0("Tooltip",[OR]),US=OR(),VR="TooltipProvider",RB=700,KT="tooltip.open",[IB,jR]=rg(VR),XR=n=>{const{__scopeTooltip:e,delayDuration:t=RB,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=n,o=D.useRef(!0),a=D.useRef(!1),l=D.useRef(0);return D.useEffect(()=>{const h=l.current;return()=>window.clearTimeout(h)},[]),L.jsx(IB,{scope:e,isOpenDelayedRef:o,delayDuration:t,onOpen:D.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:D.useCallback(h=>{a.current=h},[]),disableHoverableContent:i,children:s})};XR.displayName=VR;var YR="Tooltip",[JZ,ig]=rg(YR),C2="TooltipTrigger",LB=D.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=ig(C2,t),s=jR(C2,t),o=US(t),a=D.useRef(null),l=Qi(e,a,i.onTriggerChange),h=D.useRef(!1),d=D.useRef(!1),f=D.useCallback(()=>h.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),L.jsx(AB,{asChild:!0,...o,children:L.jsx(jr.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Dn(n.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Dn(n.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Dn(n.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Dn(n.onFocus,()=>{h.current||i.onOpen()}),onBlur:Dn(n.onBlur,i.onClose),onClick:Dn(n.onClick,i.onClose)})})});LB.displayName=C2;var FB="TooltipPortal",[eQ,NB]=rg(FB,{forceMount:void 0}),mu="TooltipContent",qR=D.forwardRef((n,e)=>{const t=NB(mu,n.__scopeTooltip),{forceMount:r=t.forceMount,side:i="top",...s}=n,o=ig(mu,n.__scopeTooltip);return L.jsx(TS,{present:r||o.open,children:o.disableHoverableContent?L.jsx($R,{side:i,...s,ref:e}):L.jsx(DB,{side:i,...s,ref:e})})}),DB=D.forwardRef((n,e)=>{const t=ig(mu,n.__scopeTooltip),r=jR(mu,n.__scopeTooltip),i=D.useRef(null),s=Qi(e,i),[o,a]=D.useState(null),{trigger:l,onClose:h}=t,d=i.current,{onPointerInTransitChange:f}=r,p=D.useCallback(()=>{a(null),f(!1)},[f]),m=D.useCallback((v,x)=>{const _=v.currentTarget,g={x:v.clientX,y:v.clientY},S=zB(g,_.getBoundingClientRect()),b=WB(g,S),M=HB(x.getBoundingClientRect()),C=VB([...b,...M]);a(C),f(!0)},[f]);return D.useEffect(()=>()=>p(),[p]),D.useEffect(()=>{if(l&&d){const v=_=>m(_,d),x=_=>m(_,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",x),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",x)}}},[l,d,m,p]),D.useEffect(()=>{if(o){const v=x=>{const _=x.target,g={x:x.clientX,y:x.clientY},S=(l==null?void 0:l.contains(_))||(d==null?void 0:d.contains(_)),b=!GB(g,o);S?p():b&&(p(),h())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,o,h,p]),L.jsx($R,{...n,ref:s})}),[OB,UB]=rg(YR,{isInside:!1}),kB=JO("TooltipContent"),$R=D.forwardRef((n,e)=>{const{__scopeTooltip:t,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=n,l=ig(mu,t),h=US(t),{onClose:d}=l;return D.useEffect(()=>(document.addEventListener(KT,d),()=>document.removeEventListener(KT,d)),[d]),D.useEffect(()=>{if(l.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),L.jsx(wS,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:L.jsxs(CB,{"data-state":l.stateAttribute,...h,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[L.jsx(kB,{children:r}),L.jsx(OB,{scope:t,isInside:!0,children:L.jsx(TU,{id:l.contentId,role:"tooltip",children:i||r})})]})})});qR.displayName=mu;var KR="TooltipArrow",BB=D.forwardRef((n,e)=>{const{__scopeTooltip:t,...r}=n,i=US(t);return UB(KR,t).isInside?null:L.jsx(PB,{...i,...r,ref:e})});BB.displayName=KR;function zB(n,e){const t=Math.abs(e.top-n.y),r=Math.abs(e.bottom-n.y),i=Math.abs(e.right-n.x),s=Math.abs(e.left-n.x);switch(Math.min(t,r,i,s)){case s:return"left";case i:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function WB(n,e,t=5){const r=[];switch(e){case"top":r.push({x:n.x-t,y:n.y+t},{x:n.x+t,y:n.y+t});break;case"bottom":r.push({x:n.x-t,y:n.y-t},{x:n.x+t,y:n.y-t});break;case"left":r.push({x:n.x+t,y:n.y-t},{x:n.x+t,y:n.y+t});break;case"right":r.push({x:n.x-t,y:n.y-t},{x:n.x-t,y:n.y+t});break}return r}function HB(n){const{top:e,right:t,bottom:r,left:i}=n;return[{x:i,y:e},{x:t,y:e},{x:t,y:r},{x:i,y:r}]}function GB(n,e){const{x:t,y:r}=n;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],l=e[o],h=a.x,d=a.y,f=l.x,p=l.y;d>r!=p>r&&t<(f-h)*(r-d)/(p-d)+h&&(i=!i)}return i}function VB(n){const e=n.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),jB(e)}function jB(n){if(n.length<=1)return n.slice();const e=[];for(let r=0;r<n.length;r++){const i=n[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const t=[];for(let r=n.length-1;r>=0;r--){const i=n[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var XB=XR,ZR=qR;const YB=XB,qB=D.forwardRef(({className:n,sideOffset:e=4,...t},r)=>L.jsx(ZR,{ref:r,sideOffset:e,className:Al("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...t}));qB.displayName=ZR.displayName;var sg=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},og=typeof window>"u"||"Deno"in globalThis;function ki(){}function $B(n,e){return typeof n=="function"?n(e):n}function KB(n){return typeof n=="number"&&n>=0&&n!==1/0}function ZB(n,e){return Math.max(n+(e||0)-Date.now(),0)}function P2(n,e){return typeof n=="function"?n(e):n}function QB(n,e){return typeof n=="function"?n(e):n}function ZT(n,e){const{type:t="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=n;if(o){if(r){if(e.queryHash!==kS(o,e.options))return!1}else if(!gd(e.queryKey,o))return!1}if(t!=="all"){const l=e.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function QT(n,e){const{exact:t,status:r,predicate:i,mutationKey:s}=n;if(s){if(!e.options.mutationKey)return!1;if(t){if(md(e.options.mutationKey)!==md(s))return!1}else if(!gd(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function kS(n,e){return((e==null?void 0:e.queryKeyHashFn)||md)(n)}function md(n){return JSON.stringify(n,(e,t)=>R2(t)?Object.keys(t).sort().reduce((r,i)=>(r[i]=t[i],r),{}):t)}function gd(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?Object.keys(e).every(t=>gd(n[t],e[t])):!1}function QR(n,e){if(n===e)return n;const t=JT(n)&&JT(e);if(t||R2(n)&&R2(e)){const r=t?n:Object.keys(n),i=r.length,s=t?e:Object.keys(e),o=s.length,a=t?[]:{},l=new Set(r);let h=0;for(let d=0;d<o;d++){const f=t?d:s[d];(!t&&l.has(f)||t)&&n[f]===void 0&&e[f]===void 0?(a[f]=void 0,h++):(a[f]=QR(n[f],e[f]),a[f]===n[f]&&n[f]!==void 0&&h++)}return i===o&&h===i?n:a}return e}function JT(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function R2(n){if(!eM(n))return!1;const e=n.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!eM(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function eM(n){return Object.prototype.toString.call(n)==="[object Object]"}function JB(n){return new Promise(e=>{setTimeout(e,n)})}function ez(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?QR(n,e):e}function tz(n,e,t=0){const r=[...n,e];return t&&r.length>t?r.slice(1):r}function nz(n,e,t=0){const r=[e,...n];return t&&r.length>t?r.slice(0,-1):r}var BS=Symbol();function JR(n,e){return!n.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!n.queryFn||n.queryFn===BS?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}var rl,Ho,Jc,aA,rz=(aA=class extends sg{constructor(){super();zt(this,rl);zt(this,Ho);zt(this,Jc);St(this,Jc,e=>{if(!og&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){pe(this,Ho)||this.setEventListener(pe(this,Jc))}onUnsubscribe(){var e;this.hasListeners()||((e=pe(this,Ho))==null||e.call(this),St(this,Ho,void 0))}setEventListener(e){var t;St(this,Jc,e),(t=pe(this,Ho))==null||t.call(this),St(this,Ho,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){pe(this,rl)!==e&&(St(this,rl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof pe(this,rl)=="boolean"?pe(this,rl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},rl=new WeakMap,Ho=new WeakMap,Jc=new WeakMap,aA),e3=new rz,eu,Go,tu,lA,iz=(lA=class extends sg{constructor(){super();zt(this,eu,!0);zt(this,Go);zt(this,tu);St(this,tu,e=>{if(!og&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){pe(this,Go)||this.setEventListener(pe(this,tu))}onUnsubscribe(){var e;this.hasListeners()||((e=pe(this,Go))==null||e.call(this),St(this,Go,void 0))}setEventListener(e){var t;St(this,tu,e),(t=pe(this,Go))==null||t.call(this),St(this,Go,e(this.setOnline.bind(this)))}setOnline(e){pe(this,eu)!==e&&(St(this,eu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return pe(this,eu)}},eu=new WeakMap,Go=new WeakMap,tu=new WeakMap,lA),M0=new iz;function sz(){let n,e;const t=new Promise((i,s)=>{n=i,e=s});t.status="pending",t.catch(()=>{});function r(i){Object.assign(t,i),delete t.resolve,delete t.reject}return t.resolve=i=>{r({status:"fulfilled",value:i}),n(i)},t.reject=i=>{r({status:"rejected",reason:i}),e(i)},t}function oz(n){return Math.min(1e3*2**n,3e4)}function t3(n){return(n??"online")==="online"?M0.isOnline():!0}var n3=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function Ev(n){return n instanceof n3}function r3(n){let e=!1,t=0,r=!1,i;const s=sz(),o=x=>{var _;r||(p(new n3(x)),(_=n.abort)==null||_.call(n))},a=()=>{e=!0},l=()=>{e=!1},h=()=>e3.isFocused()&&(n.networkMode==="always"||M0.isOnline())&&n.canRun(),d=()=>t3(n.networkMode)&&n.canRun(),f=x=>{var _;r||(r=!0,(_=n.onSuccess)==null||_.call(n,x),i==null||i(),s.resolve(x))},p=x=>{var _;r||(r=!0,(_=n.onError)==null||_.call(n,x),i==null||i(),s.reject(x))},m=()=>new Promise(x=>{var _;i=g=>{(r||h())&&x(g)},(_=n.onPause)==null||_.call(n)}).then(()=>{var x;i=void 0,r||(x=n.onContinue)==null||x.call(n)}),v=()=>{if(r)return;let x;const _=t===0?n.initialPromise:void 0;try{x=_??n.fn()}catch(g){x=Promise.reject(g)}Promise.resolve(x).then(f).catch(g=>{var A;if(r)return;const S=n.retry??(og?0:3),b=n.retryDelay??oz,M=typeof b=="function"?b(t,g):b,C=S===!0||typeof S=="number"&&t<S||typeof S=="function"&&S(t,g);if(e||!C){p(g);return}t++,(A=n.onFail)==null||A.call(n,t,g),JB(M).then(()=>h()?void 0:m()).then(()=>{e?p(g):v()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?v():m().then(v),s)}}var az=n=>setTimeout(n,0);function lz(){let n=[],e=0,t=a=>{a()},r=a=>{a()},i=az;const s=a=>{e?n.push(a):i(()=>{t(a)})},o=()=>{const a=n;n=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{t(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{t=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Tr=lz(),il,cA,i3=(cA=class{constructor(){zt(this,il)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),KB(this.gcTime)&&St(this,il,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(og?1/0:5*60*1e3))}clearGcTimeout(){pe(this,il)&&(clearTimeout(pe(this,il)),St(this,il,void 0))}},il=new WeakMap,cA),nu,sl,bi,ol,hr,Hd,al,zi,Xs,uA,cz=(uA=class extends i3{constructor(e){super();zt(this,zi);zt(this,nu);zt(this,sl);zt(this,bi);zt(this,ol);zt(this,hr);zt(this,Hd);zt(this,al);St(this,al,!1),St(this,Hd,e.defaultOptions),this.setOptions(e.options),this.observers=[],St(this,ol,e.client),St(this,bi,pe(this,ol).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,St(this,nu,hz(this.options)),this.state=e.state??pe(this,nu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=pe(this,hr))==null?void 0:e.promise}setOptions(e){this.options={...pe(this,Hd),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&pe(this,bi).remove(this)}setData(e,t){const r=ez(this.state.data,e,this.options);return sr(this,zi,Xs).call(this,{data:r,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),r}setState(e,t){sr(this,zi,Xs).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var r,i;const t=(r=pe(this,hr))==null?void 0:r.promise;return(i=pe(this,hr))==null||i.cancel(e),t?t.then(ki).catch(ki):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(pe(this,nu))}isActive(){return this.observers.some(e=>QB(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===BS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>P2(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!ZB(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=pe(this,hr))==null||t.continue()}onOnline(){var t;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=pe(this,hr))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),pe(this,bi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(pe(this,hr)&&(pe(this,al)?pe(this,hr).cancel({revert:!0}):pe(this,hr).cancelRetry()),this.scheduleGc()),pe(this,bi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||sr(this,zi,Xs).call(this,{type:"invalidate"})}fetch(e,t){var h,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(pe(this,hr))return pe(this,hr).continueRetry(),pe(this,hr).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(St(this,al,!0),r.signal)})},s=()=>{const p=JR(this.options,t),v=(()=>{const x={client:pe(this,ol),queryKey:this.queryKey,meta:this.meta};return i(x),x})();return St(this,al,!1),this.options.persister?this.options.persister(p,v,this):p(v)},a=(()=>{const p={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:pe(this,ol),state:this.state,fetchFn:s};return i(p),p})();(h=this.options.behavior)==null||h.onFetch(a,this),St(this,sl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&sr(this,zi,Xs).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const l=p=>{var m,v,x,_;Ev(p)&&p.silent||sr(this,zi,Xs).call(this,{type:"error",error:p}),Ev(p)||((v=(m=pe(this,bi).config).onError)==null||v.call(m,p,this),(_=(x=pe(this,bi).config).onSettled)==null||_.call(x,this.state.data,p,this)),this.scheduleGc()};return St(this,hr,r3({initialPromise:t==null?void 0:t.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,v,x,_;if(p===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(g){l(g);return}(v=(m=pe(this,bi).config).onSuccess)==null||v.call(m,p,this),(_=(x=pe(this,bi).config).onSettled)==null||_.call(x,p,this.state.error,this),this.scheduleGc()},onError:l,onFail:(p,m)=>{sr(this,zi,Xs).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{sr(this,zi,Xs).call(this,{type:"pause"})},onContinue:()=>{sr(this,zi,Xs).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),pe(this,hr).start()}},nu=new WeakMap,sl=new WeakMap,bi=new WeakMap,ol=new WeakMap,hr=new WeakMap,Hd=new WeakMap,al=new WeakMap,zi=new WeakSet,Xs=function(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...uz(r.data,this.options),fetchMeta:e.meta??null};case"success":return St(this,sl,void 0),{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return Ev(i)&&i.revert&&pe(this,sl)?{...pe(this,sl),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),Tr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),pe(this,bi).notify({query:this,type:"updated",action:e})})},uA);function uz(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:t3(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function hz(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=e!==void 0,r=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var gs,hA,dz=(hA=class extends sg{constructor(e={}){super();zt(this,gs);this.config=e,St(this,gs,new Map)}build(e,t,r){const i=t.queryKey,s=t.queryHash??kS(i,t);let o=this.get(s);return o||(o=new cz({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){pe(this,gs).has(e.queryHash)||(pe(this,gs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=pe(this,gs).get(e.queryHash);t&&(e.destroy(),t===e&&pe(this,gs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Tr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return pe(this,gs).get(e)}getAll(){return[...pe(this,gs).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>ZT(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>ZT(e,r)):t}notify(e){Tr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gs=new WeakMap,hA),ys,br,ll,vs,Do,dA,fz=(dA=class extends i3{constructor(e){super();zt(this,vs);zt(this,ys);zt(this,br);zt(this,ll);this.mutationId=e.mutationId,St(this,br,e.mutationCache),St(this,ys,[]),this.state=e.state||pz(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){pe(this,ys).includes(e)||(pe(this,ys).push(e),this.clearGcTimeout(),pe(this,br).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){St(this,ys,pe(this,ys).filter(t=>t!==e)),this.scheduleGc(),pe(this,br).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){pe(this,ys).length||(this.state.status==="pending"?this.scheduleGc():pe(this,br).remove(this))}continue(){var e;return((e=pe(this,ll))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,o,a,l,h,d,f,p,m,v,x,_,g,S,b,M,C,A,R,O;const t=()=>{sr(this,vs,Do).call(this,{type:"continue"})};St(this,ll,r3({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(P,I)=>{sr(this,vs,Do).call(this,{type:"failed",failureCount:P,error:I})},onPause:()=>{sr(this,vs,Do).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>pe(this,br).canRun(this)}));const r=this.state.status==="pending",i=!pe(this,ll).canStart();try{if(r)t();else{sr(this,vs,Do).call(this,{type:"pending",variables:e,isPaused:i}),await((o=(s=pe(this,br).config).onMutate)==null?void 0:o.call(s,e,this));const I=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));I!==this.state.context&&sr(this,vs,Do).call(this,{type:"pending",context:I,variables:e,isPaused:i})}const P=await pe(this,ll).start();return await((d=(h=pe(this,br).config).onSuccess)==null?void 0:d.call(h,P,e,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,P,e,this.state.context)),await((v=(m=pe(this,br).config).onSettled)==null?void 0:v.call(m,P,null,this.state.variables,this.state.context,this)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,P,null,e,this.state.context)),sr(this,vs,Do).call(this,{type:"success",data:P}),P}catch(P){try{throw await((S=(g=pe(this,br).config).onError)==null?void 0:S.call(g,P,e,this.state.context,this)),await((M=(b=this.options).onError)==null?void 0:M.call(b,P,e,this.state.context)),await((A=(C=pe(this,br).config).onSettled)==null?void 0:A.call(C,void 0,P,this.state.variables,this.state.context,this)),await((O=(R=this.options).onSettled)==null?void 0:O.call(R,void 0,P,e,this.state.context)),P}finally{sr(this,vs,Do).call(this,{type:"error",error:P})}}finally{pe(this,br).runNext(this)}}},ys=new WeakMap,br=new WeakMap,ll=new WeakMap,vs=new WeakSet,Do=function(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Tr.batch(()=>{pe(this,ys).forEach(r=>{r.onMutationUpdate(e)}),pe(this,br).notify({mutation:this,type:"updated",action:e})})},dA);function pz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $s,Wi,Gd,fA,mz=(fA=class extends sg{constructor(e={}){super();zt(this,$s);zt(this,Wi);zt(this,Gd);this.config=e,St(this,$s,new Set),St(this,Wi,new Map),St(this,Gd,0)}build(e,t,r){const i=new fz({mutationCache:this,mutationId:++lp(this,Gd)._,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){pe(this,$s).add(e);const t=Ip(e);if(typeof t=="string"){const r=pe(this,Wi).get(t);r?r.push(e):pe(this,Wi).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(pe(this,$s).delete(e)){const t=Ip(e);if(typeof t=="string"){const r=pe(this,Wi).get(t);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&pe(this,Wi).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ip(e);if(typeof t=="string"){const r=pe(this,Wi).get(t),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const t=Ip(e);if(typeof t=="string"){const i=(r=pe(this,Wi).get(t))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Tr.batch(()=>{pe(this,$s).forEach(e=>{this.notify({type:"removed",mutation:e})}),pe(this,$s).clear(),pe(this,Wi).clear()})}getAll(){return Array.from(pe(this,$s))}find(e){const t={exact:!0,...e};return this.getAll().find(r=>QT(t,r))}findAll(e={}){return this.getAll().filter(t=>QT(e,t))}notify(e){Tr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Tr.batch(()=>Promise.all(e.map(t=>t.continue().catch(ki))))}},$s=new WeakMap,Wi=new WeakMap,Gd=new WeakMap,fA);function Ip(n){var e;return(e=n.options.scope)==null?void 0:e.id}function tM(n){return{onFetch:(e,t)=>{var d,f,p,m,v;const r=e.options,i=(p=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,s=((m=e.state.data)==null?void 0:m.pages)||[],o=((v=e.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const h=async()=>{let x=!1;const _=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?x=!0:e.signal.addEventListener("abort",()=>{x=!0}),e.signal)})},g=JR(e.options,e.fetchOptions),S=async(b,M,C)=>{if(x)return Promise.reject();if(M==null&&b.pages.length)return Promise.resolve(b);const R=(()=>{const H={client:e.client,queryKey:e.queryKey,pageParam:M,direction:C?"backward":"forward",meta:e.options.meta};return _(H),H})(),O=await g(R),{maxPages:P}=e.options,I=C?nz:tz;return{pages:I(b.pages,O,P),pageParams:I(b.pageParams,M,P)}};if(i&&s.length){const b=i==="backward",M=b?gz:nM,C={pages:s,pageParams:o},A=M(r,C);a=await S(C,A,b)}else{const b=n??s.length;do{const M=l===0?o[0]??r.initialPageParam:nM(r,a);if(l>0&&M==null)break;a=await S(a,M),l++}while(l<b)}return a};e.options.persister?e.fetchFn=()=>{var x,_;return(_=(x=e.options).persister)==null?void 0:_.call(x,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=h}}}function nM(n,{pages:e,pageParams:t}){const r=e.length-1;return e.length>0?n.getNextPageParam(e[r],e,t[r],t):void 0}function gz(n,{pages:e,pageParams:t}){var r;return e.length>0?(r=n.getPreviousPageParam)==null?void 0:r.call(n,e[0],e,t[0],t):void 0}var gn,Vo,jo,ru,iu,Xo,su,ou,pA,yz=(pA=class{constructor(n={}){zt(this,gn);zt(this,Vo);zt(this,jo);zt(this,ru);zt(this,iu);zt(this,Xo);zt(this,su);zt(this,ou);St(this,gn,n.queryCache||new dz),St(this,Vo,n.mutationCache||new mz),St(this,jo,n.defaultOptions||{}),St(this,ru,new Map),St(this,iu,new Map),St(this,Xo,0)}mount(){lp(this,Xo)._++,pe(this,Xo)===1&&(St(this,su,e3.subscribe(async n=>{n&&(await this.resumePausedMutations(),pe(this,gn).onFocus())})),St(this,ou,M0.subscribe(async n=>{n&&(await this.resumePausedMutations(),pe(this,gn).onOnline())})))}unmount(){var n,e;lp(this,Xo)._--,pe(this,Xo)===0&&((n=pe(this,su))==null||n.call(this),St(this,su,void 0),(e=pe(this,ou))==null||e.call(this),St(this,ou,void 0))}isFetching(n){return pe(this,gn).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return pe(this,Vo).findAll({...n,status:"pending"}).length}getQueryData(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=pe(this,gn).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(n){const e=this.defaultQueryOptions(n),t=pe(this,gn).build(this,e),r=t.state.data;return r===void 0?this.fetchQuery(n):(n.revalidateIfStale&&t.isStaleByTime(P2(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(n){return pe(this,gn).findAll(n).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(n,e,t){const r=this.defaultQueryOptions({queryKey:n}),i=pe(this,gn).get(r.queryHash),s=i==null?void 0:i.state.data,o=$B(e,s);if(o!==void 0)return pe(this,gn).build(this,r).setData(o,{...t,manual:!0})}setQueriesData(n,e,t){return Tr.batch(()=>pe(this,gn).findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,e,t)]))}getQueryState(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=pe(this,gn).get(e.queryHash))==null?void 0:t.state}removeQueries(n){const e=pe(this,gn);Tr.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=pe(this,gn);return Tr.batch(()=>(t.findAll(n).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...n},e)))}cancelQueries(n,e={}){const t={revert:!0,...e},r=Tr.batch(()=>pe(this,gn).findAll(n).map(i=>i.cancel(t)));return Promise.all(r).then(ki).catch(ki)}invalidateQueries(n,e={}){return Tr.batch(()=>(pe(this,gn).findAll(n).forEach(t=>{t.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},e)))}refetchQueries(n,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},r=Tr.batch(()=>pe(this,gn).findAll(n).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,t);return t.throwOnError||(s=s.catch(ki)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(ki)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const t=pe(this,gn).build(this,e);return t.isStaleByTime(P2(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(ki).catch(ki)}fetchInfiniteQuery(n){return n.behavior=tM(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(ki).catch(ki)}ensureInfiniteQueryData(n){return n.behavior=tM(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return M0.isOnline()?pe(this,Vo).resumePausedMutations():Promise.resolve()}getQueryCache(){return pe(this,gn)}getMutationCache(){return pe(this,Vo)}getDefaultOptions(){return pe(this,jo)}setDefaultOptions(n){St(this,jo,n)}setQueryDefaults(n,e){pe(this,ru).set(md(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...pe(this,ru).values()],t={};return e.forEach(r=>{gd(n,r.queryKey)&&Object.assign(t,r.defaultOptions)}),t}setMutationDefaults(n,e){pe(this,iu).set(md(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...pe(this,iu).values()],t={};return e.forEach(r=>{gd(n,r.mutationKey)&&Object.assign(t,r.defaultOptions)}),t}defaultQueryOptions(n){if(n._defaulted)return n;const e={...pe(this,jo).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=kS(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===BS&&(e.enabled=!1),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...pe(this,jo).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){pe(this,gn).clear(),pe(this,Vo).clear()}},gn=new WeakMap,Vo=new WeakMap,jo=new WeakMap,ru=new WeakMap,iu=new WeakMap,Xo=new WeakMap,su=new WeakMap,ou=new WeakMap,pA),vz=D.createContext(void 0),_z=({client:n,children:e})=>(D.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),L.jsx(vz.Provider,{value:n,children:e}));/**
* @remix-run/router v1.23.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function yd(){return yd=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},yd.apply(this,arguments)}var $o;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})($o||($o={}));const rM="popstate";function xz(n){n===void 0&&(n={});function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return I2("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function t(r,i){return typeof i=="string"?i:E0(i)}return bz(e,t,null,n)}function Rn(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function s3(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Sz(){return Math.random().toString(36).substr(2,8)}function iM(n,e){return{usr:n.state,key:n.key,idx:e}}function I2(n,e,t,r){return t===void 0&&(t=null),yd({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Ru(e):e,{state:t,key:e&&e.key||r||Sz()})}function E0(n){let{pathname:e="/",search:t="",hash:r=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ru(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let r=n.indexOf("?");r>=0&&(e.search=n.substr(r),n=n.substr(0,r)),n&&(e.pathname=n)}return e}function bz(n,e,t,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=$o.Pop,l=null,h=d();h==null&&(h=0,o.replaceState(yd({},o.state,{idx:h}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=$o.Pop;let _=d(),g=_==null?null:_-h;h=_,l&&l({action:a,location:x.location,delta:g})}function p(_,g){a=$o.Push;let S=I2(x.location,_,g);h=d()+1;let b=iM(S,h),M=x.createHref(S);try{o.pushState(b,"",M)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(M)}s&&l&&l({action:a,location:x.location,delta:1})}function m(_,g){a=$o.Replace;let S=I2(x.location,_,g);h=d();let b=iM(S,h),M=x.createHref(S);o.replaceState(b,"",M),s&&l&&l({action:a,location:x.location,delta:0})}function v(_){let g=i.location.origin!=="null"?i.location.origin:i.location.href,S=typeof _=="string"?_:E0(_);return S=S.replace(/ $/,"%20"),Rn(g,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,g)}let x={get action(){return a},get location(){return n(i,o)},listen(_){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(rM,f),l=_,()=>{i.removeEventListener(rM,f),l=null}},createHref(_){return e(i,_)},createURL:v,encodeLocation(_){let g=v(_);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:p,replace:m,go(_){return o.go(_)}};return x}var sM;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(sM||(sM={}));function wz(n,e,t){return t===void 0&&(t="/"),Tz(n,e,t,!1)}function Tz(n,e,t,r){let i=typeof e=="string"?Ru(e):e,s=zS(i.pathname||"/",t);if(s==null)return null;let o=o3(n);Mz(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let h=Oz(s);a=Nz(o[l],h,r)}return a}function o3(n,e,t,r){e===void 0&&(e=[]),t===void 0&&(t=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(Rn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let h=ia([r,l.relativePath]),d=t.concat(l);s.children&&s.children.length>0&&(Rn(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+h+'".')),o3(s.children,e,d,h)),!(s.path==null&&!s.index)&&e.push({path:h,score:Lz(h,s.index),routesMeta:d})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of a3(s.path))i(s,o,l)}),e}function a3(n){let e=n.split("/");if(e.length===0)return[];let[t,...r]=e,i=t.endsWith("?"),s=t.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=a3(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function Mz(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:Fz(e.routesMeta.map(r=>r.childrenIndex),t.routesMeta.map(r=>r.childrenIndex)))}const Ez=/^:[\w-]+$/,Az=3,Cz=2,Pz=1,Rz=10,Iz=-2,oM=n=>n==="*";function Lz(n,e){let t=n.split("/"),r=t.length;return t.some(oM)&&(r+=Iz),e&&(r+=Cz),t.filter(i=>!oM(i)).reduce((i,s)=>i+(Ez.test(s)?Az:s===""?Pz:Rz),r)}function Fz(n,e){return n.length===e.length&&n.slice(0,-1).every((r,i)=>r===e[i])?n[n.length-1]-e[e.length-1]:0}function Nz(n,e,t){let{routesMeta:r}=n,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],h=a===r.length-1,d=s==="/"?e:e.slice(s.length)||"/",f=aM({path:l.relativePath,caseSensitive:l.caseSensitive,end:h},d),p=l.route;if(!f&&h&&t&&!r[r.length-1].route.index&&(f=aM({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:ia([s,f.pathname]),pathnameBase:zz(ia([s,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(s=ia([s,f.pathnameBase]))}return o}function aM(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,r]=Dz(n.path,n.caseSensitive,n.end),i=e.match(t);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((h,d,f)=>{let{paramName:p,isOptional:m}=d;if(p==="*"){let x=a[f]||"";o=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const v=a[f];return m&&!v?h[p]=void 0:h[p]=(v||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:o,pattern:n}}function Dz(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),s3(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let r=[],i="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(r.push({paramName:"*"}),i+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?i+="\\/*$":n!==""&&n!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function Oz(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return s3(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function zS(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,r=n.charAt(t);return r&&r!=="/"?null:n.slice(t)||"/"}function Uz(n,e){e===void 0&&(e="/");let{pathname:t,search:r="",hash:i=""}=typeof n=="string"?Ru(n):n;return{pathname:t?t.startsWith("/")?t:kz(t,e):e,search:Wz(r),hash:Hz(i)}}function kz(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function Av(n,e,t,r){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Bz(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function l3(n,e){let t=Bz(n);return e?t.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):t.map(r=>r.pathnameBase)}function c3(n,e,t,r){r===void 0&&(r=!1);let i;typeof n=="string"?i=Ru(n):(i=yd({},n),Rn(!i.pathname||!i.pathname.includes("?"),Av("?","pathname","search",i)),Rn(!i.pathname||!i.pathname.includes("#"),Av("#","pathname","hash",i)),Rn(!i.search||!i.search.includes("#"),Av("#","search","hash",i)));let s=n===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=t;else{let f=e.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}a=f>=0?e[f]:"/"}let l=Uz(i,a),h=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(h||d)&&(l.pathname+="/"),l}const ia=n=>n.join("/").replace(/\/\/+/g,"/"),zz=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Wz=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Hz=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function Gz(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const u3=["post","put","patch","delete"];new Set(u3);const Vz=["get",...u3];new Set(Vz);/**
* React Router v6.30.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function vd(){return vd=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},vd.apply(this,arguments)}const WS=D.createContext(null),jz=D.createContext(null),Cl=D.createContext(null),ag=D.createContext(null),xa=D.createContext({outlet:null,matches:[],isDataRoute:!1}),h3=D.createContext(null);function Xz(n,e){let{relative:t}=e===void 0?{}:e;Qd()||Rn(!1);let{basename:r,navigator:i}=D.useContext(Cl),{hash:s,pathname:o,search:a}=p3(n,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:ia([r,o])),i.createHref({pathname:l,search:a,hash:s})}function Qd(){return D.useContext(ag)!=null}function Iu(){return Qd()||Rn(!1),D.useContext(ag).location}function d3(n){D.useContext(Cl).static||D.useLayoutEffect(n)}function f3(){let{isDataRoute:n}=D.useContext(xa);return n?o6():Yz()}function Yz(){Qd()||Rn(!1);let n=D.useContext(WS),{basename:e,future:t,navigator:r}=D.useContext(Cl),{matches:i}=D.useContext(xa),{pathname:s}=Iu(),o=JSON.stringify(l3(i,t.v7_relativeSplatPath)),a=D.useRef(!1);return d3(()=>{a.current=!0}),D.useCallback(function(h,d){if(d===void 0&&(d={}),!a.current)return;if(typeof h=="number"){r.go(h);return}let f=c3(h,JSON.parse(o),s,d.relative==="path");n==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:ia([e,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[e,r,o,s,n])}function qz(){let{matches:n}=D.useContext(xa),e=n[n.length-1];return e?e.params:{}}function p3(n,e){let{relative:t}=e===void 0?{}:e,{future:r}=D.useContext(Cl),{matches:i}=D.useContext(xa),{pathname:s}=Iu(),o=JSON.stringify(l3(i,r.v7_relativeSplatPath));return D.useMemo(()=>c3(n,JSON.parse(o),s,t==="path"),[n,o,s,t])}function $z(n,e){return Kz(n,e)}function Kz(n,e,t,r){Qd()||Rn(!1);let{navigator:i}=D.useContext(Cl),{matches:s}=D.useContext(xa),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let h=Iu(),d;if(e){var f;let _=typeof e=="string"?Ru(e):e;l==="/"||(f=_.pathname)!=null&&f.startsWith(l)||Rn(!1),d=_}else d=h;let p=d.pathname||"/",m=p;if(l!=="/"){let _=l.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(_.length).join("/")}let v=wz(n,{pathname:m}),x=t6(v&&v.map(_=>Object.assign({},_,{params:Object.assign({},a,_.params),pathname:ia([l,i.encodeLocation?i.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:ia([l,i.encodeLocation?i.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),s,t,r);return e&&x?D.createElement(ag.Provider,{value:{location:vd({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:$o.Pop}},x):x}function Zz(){let n=s6(),e=Gz(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},e),t?D.createElement("pre",{style:i},t):null,null)}const Qz=D.createElement(Zz,null);class Jz extends D.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?D.createElement(xa.Provider,{value:this.props.routeContext},D.createElement(h3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function e6(n){let{routeContext:e,match:t,children:r}=n,i=D.useContext(WS);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),D.createElement(xa.Provider,{value:e},r)}function t6(n,e,t,r){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),r===void 0&&(r=null),n==null){var s;if(!t)return null;if(t.errors)n=t.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let o=n,a=(i=t)==null?void 0:i.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Rn(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,h=-1;if(t&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(h=d),f.route.id){let{loaderData:p,errors:m}=t,v=f.route.loader&&p[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||v){l=!0,h>=0?o=o.slice(0,h+1):o=[o[0]];break}}}return o.reduceRight((d,f,p)=>{let m,v=!1,x=null,_=null;t&&(m=a&&f.route.id?a[f.route.id]:void 0,x=f.route.errorElement||Qz,l&&(h<0&&p===0?(v=!0,_=null):h===p&&(v=!0,_=f.route.hydrateFallbackElement||null)));let g=e.concat(o.slice(0,p+1)),S=()=>{let b;return m?b=x:v?b=_:f.route.Component?b=D.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=d,D.createElement(e6,{match:f,routeContext:{outlet:d,matches:g,isDataRoute:t!=null},children:b})};return t&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?D.createElement(Jz,{location:t.location,revalidation:t.revalidation,component:x,error:m,children:S(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):S()},null)}var m3=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(m3||{}),A0=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(A0||{});function n6(n){let e=D.useContext(WS);return e||Rn(!1),e}function r6(n){let e=D.useContext(jz);return e||Rn(!1),e}function i6(n){let e=D.useContext(xa);return e||Rn(!1),e}function g3(n){let e=i6(),t=e.matches[e.matches.length-1];return t.route.id||Rn(!1),t.route.id}function s6(){var n;let e=D.useContext(h3),t=r6(A0.UseRouteError),r=g3(A0.UseRouteError);return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function o6(){let{router:n}=n6(m3.UseNavigateStable),e=g3(A0.UseNavigateStable),t=D.useRef(!1);return d3(()=>{t.current=!0}),D.useCallback(function(i,s){s===void 0&&(s={}),t.current&&(typeof i=="number"?n.navigate(i):n.navigate(i,vd({fromRouteId:e},s)))},[n,e])}function a6(n,e){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function Sc(n){Rn(!1)}function l6(n){let{basename:e="/",children:t=null,location:r,navigationType:i=$o.Pop,navigator:s,static:o=!1,future:a}=n;Qd()&&Rn(!1);let l=e.replace(/^\/*/,"/"),h=D.useMemo(()=>({basename:l,navigator:s,static:o,future:vd({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=Ru(r));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:v="default"}=r,x=D.useMemo(()=>{let _=zS(d,l);return _==null?null:{location:{pathname:_,search:f,hash:p,state:m,key:v},navigationType:i}},[l,d,f,p,m,v,i]);return x==null?null:D.createElement(Cl.Provider,{value:h},D.createElement(ag.Provider,{children:t,value:x}))}function c6(n){let{children:e,location:t}=n;return $z(L2(e),t)}new Promise(()=>{});function L2(n,e){e===void 0&&(e=[]);let t=[];return D.Children.forEach(n,(r,i)=>{if(!D.isValidElement(r))return;let s=[...e,i];if(r.type===D.Fragment){t.push.apply(t,L2(r.props.children,s));return}r.type!==Sc&&Rn(!1),!r.props.index||!r.props.children||Rn(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=L2(r.props.children,s)),t.push(o)}),t}/**
* React Router DOM v6.30.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function F2(){return F2=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},F2.apply(this,arguments)}function u6(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function h6(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function d6(n,e){return n.button===0&&(!e||e==="_self")&&!h6(n)}function N2(n){return n===void 0&&(n=""),new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let r=n[t];return e.concat(Array.isArray(r)?r.map(i=>[t,i]):[[t,r]])},[]))}function f6(n,e){let t=N2(n);return e&&e.forEach((r,i)=>{t.has(i)||e.getAll(i).forEach(s=>{t.append(i,s)})}),t}const p6=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],m6="6";try{window.__reactRouterVersion=m6}catch{}const g6="startTransition",lM=MA[g6];function y6(n){let{basename:e,children:t,future:r,window:i}=n,s=D.useRef();s.current==null&&(s.current=xz({window:i,v5Compat:!0}));let o=s.current,[a,l]=D.useState({action:o.action,location:o.location}),{v7_startTransition:h}=r||{},d=D.useCallback(f=>{h&&lM?lM(()=>l(f)):l(f)},[l,h]);return D.useLayoutEffect(()=>o.listen(d),[o,d]),D.useEffect(()=>a6(r),[r]),D.createElement(l6,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,future:r})}const v6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ki=D.forwardRef(function(e,t){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:h,preventScrollReset:d,viewTransition:f}=e,p=u6(e,p6),{basename:m}=D.useContext(Cl),v,x=!1;if(typeof h=="string"&&_6.test(h)&&(v=h,v6))try{let b=new URL(window.location.href),M=h.startsWith("//")?new URL(b.protocol+h):new URL(h),C=zS(M.pathname,m);M.origin===b.origin&&C!=null?h=C+M.search+M.hash:x=!0}catch{}let _=Xz(h,{relative:i}),g=x6(h,{replace:o,state:a,target:l,preventScrollReset:d,relative:i,viewTransition:f});function S(b){r&&r(b),b.defaultPrevented||g(b)}return D.createElement("a",F2({},p,{href:v||_,onClick:x||s?r:S,ref:t,target:l}))});var cM;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(cM||(cM={}));var uM;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(uM||(uM={}));function x6(n,e){let{target:t,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=e===void 0?{}:e,l=f3(),h=Iu(),d=p3(n,{relative:o});return D.useCallback(f=>{if(d6(f,t)){f.preventDefault();let p=r!==void 0?r:E0(h)===E0(d);l(n,{replace:p,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[h,l,d,r,i,t,n,s,o,a])}function S6(n){let e=D.useRef(N2(n)),t=D.useRef(!1),r=Iu(),i=D.useMemo(()=>f6(r.search,t.current?null:e.current),[r.search]),s=f3(),o=D.useCallback((a,l)=>{const h=N2(typeof a=="function"?a(i):a);t.current=!0,s("?"+h,l)},[s,i]);return[i,o]}const _d=()=>{const n=t=>{const r=document.getElementById(t);r&&r.scrollIntoView({behavior:"smooth"})},e=()=>{const t=document.getElementById("contact");t&&(t.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{const r=t.querySelector("button");r&&r.click()},600))};return L.jsx("nav",{className:"fixed top-0 left-0 right-0 z-50 bg-background/80 backdrop-blur-sm border-b border-border/40",children:L.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between px-6 py-4",children:[L.jsx(Ki,{to:"/",className:"text-xs tracking-[0.35em] uppercase font-sans font-medium text-foreground",children:"Prompted"}),L.jsxs("div",{className:"hidden md:flex items-center gap-8",children:[L.jsx("button",{onClick:()=>n("principles"),className:"text-xs tracking-[0.2em] uppercase text-muted-foreground hover:text-foreground transition-colors",children:"Primitives"}),L.jsx("button",{onClick:()=>n("enablement"),className:"text-xs tracking-[0.2em] uppercase text-muted-foreground hover:text-foreground transition-colors",children:"Abstraction Ladder"}),L.jsx(Ki,{to:"/research",className:"text-xs tracking-[0.2em] uppercase text-muted-foreground hover:text-foreground transition-colors",children:"Research"}),L.jsx("button",{onClick:e,className:"text-xs tracking-[0.2em] uppercase text-muted-foreground hover:text-foreground transition-colors",children:"Contact"})]}),L.jsx("button",{onClick:e,className:"text-xs tracking-[0.15em] uppercase px-4 py-2 border border-foreground/20 text-foreground hover:bg-foreground hover:text-primary-foreground transition-colors duration-300",children:"Start Conversation"})]})})},b6=()=>{const n=e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})};return L.jsx("section",{id:"hero",className:"relative z-10 min-h-screen flex flex-col items-center justify-center px-6 pt-32 pb-24 bg-transparent",children:L.jsxs("div",{className:"max-w-lg mx-auto text-center backdrop-blur-[1px]",style:{maskImage:"radial-gradient(ellipse 70% 70% at 50% 50%, black 40%, transparent 100%)"},children:[L.jsx("div",{className:"h-48"})," ",L.jsx("h1",{className:"text-4xl md:text-5xl font-serif font-light text-foreground tracking-tight mb-6",children:"Governance as Substrate."}),L.jsx("p",{className:"text-lg font-light text-muted-foreground mb-16 tracking-wide leading-relaxed",children:"Infrastructure where accountability is encoded before the first action occurs. Patterns tested across 3.8 billion years of biological regulation and 2,600 years of institutional governance."}),L.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[L.jsx("button",{onClick:()=>n("principles"),className:"px-8 py-3 border border-foreground/20 text-foreground text-sm tracking-widest uppercase hover:bg-foreground hover:text-primary-foreground transition-colors duration-300",children:"Explore the Quiver Model"}),L.jsx("button",{onClick:()=>n("enablement"),className:"px-8 py-3 text-muted-foreground text-sm tracking-widest uppercase hover:text-foreground transition-colors duration-300",children:"View the Abstraction Ladder"})]})]})})},w6=[{title:"Anchors",lines:["Non-negotiable invariants that survive changes of context.","Thin, enforceable, load-bearing. Civilization priors compiled into microsecond safety gates."]},{title:"Rays",lines:["Legitimate interpretations that coexist within anchor bounds.","Disagreement is the healthy state. Target alignment is 0.83, not 1.00."]},{title:"Absorbers",lines:["Mechanisms that convert dissonance into system learning without stalling.","Drift detection, validation gates, escalation ladders, inherited failure memory."]}],T6=()=>L.jsx("section",{id:"principles",className:"relative z-10 py-32 px-6 bg-background/80 min-h-[70vh]",children:L.jsxs("div",{className:"max-w-2xl mx-auto",children:[L.jsx("h2",{className:"text-sm uppercase tracking-[0.3em] text-muted-foreground/60 mb-12 text-center",children:"Governance Primitives"}),L.jsx("div",{className:"space-y-8",children:w6.map((n,e)=>L.jsxs("div",{className:"border border-foreground/10 p-8",children:[L.jsx("h3",{className:"text-xs uppercase tracking-[0.3em] text-muted-foreground mb-4 font-sans",children:n.title}),n.lines.map((t,r)=>L.jsx("p",{className:"text-lg font-serif font-light text-foreground/80 leading-relaxed",children:t},r))]},e))})]})}),M6=()=>L.jsx("section",{id:"enablement",className:"relative z-10 py-32 px-6 bg-surface-mid/70 min-h-[60vh]",children:L.jsxs("div",{className:"max-w-2xl mx-auto",children:[L.jsx("h2",{className:"text-sm uppercase tracking-[0.3em] text-muted-foreground/60 mb-12 text-center",children:"Abstraction Ladder"}),L.jsxs("div",{className:"space-y-6 text-foreground/70 font-light leading-loose text-center max-w-lg mx-auto",children:[L.jsx("p",{className:"text-base md:text-lg",children:"Biological regulation. Substrate shapes expression."}),L.jsx("p",{className:"text-base md:text-lg text-foreground/60",children:"Formal mathematics. Anchors, rays, absorbers, cost."}),L.jsx("p",{className:"text-base md:text-lg text-foreground/60",children:"Institutional design. 2,600 years of durable governance structures."}),L.jsx("p",{className:"text-base md:text-lg text-foreground/60",children:"Signal manifold. Signals, warrants, tics, conformations."}),L.jsx("p",{className:"text-base md:text-lg text-foreground/60",children:"Deployed code. 77 projects, 132,000 lines, measured behavior."})]})]})}),E6="/assets/Theory-Practice%20Synthesis_%202026-02-24%20-%20The%20Operationalization%20Crisis-D8HD0Mgi.docx",A6="/assets/Theory-Practice%20Synthesis_%202026-02-24%20-%20The%20Sovereignty%20Paradox%20in%20Agentic%20AI-BrU1yqkY.docx",C6="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20When%20AI%20Reasoning%20Became%20Organizational%20Infrastructure-CnLYBX09.docx",P6="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20When%20Constitutions%20Evolve-BQooh8gq.docx",R6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20Metacognitive%20Efficiency%20in%20AI%20Systems-DgbmLfwk.docx",I6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20Sovereignty-Preserving%20Coordination-DMxK0sb2.docx",L6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Constraint%20Paradox%20in%20Agentic%20AI-BB5A-u4K.docx",F6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Coordination%20Substrate-DB9_7oUa.docx",N6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Implicit%20Knowledge%20Economy-4qm2DGJ3.docx",D6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Inference-Time%20Intelligence%20Paradigm-CerO1lEm.docx",O6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Metacognitive%20Turn-Pc2_hLYt.docx",U6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Sovereignty%20Constraint%20in%20AI%20Coordination-Dc4g-efO.docx",k6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Stability-Efficiency%20Paradox-Ja4PGc2g.docx",B6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Thinking%20Tax-DRxaQrx9.docx",z6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20Self-Awareness-CGjxCcrE.docx",W6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20Self-Limitation-BVPVLzw_.docx",H6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20They%20Already%20Know%20How%20to%20Stop-ismJycTU.docx",G6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Fail%20Well-d3CwoHzm.docx",V6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Govern%20Themselves-BwaSBMY5.docx",j6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20They_re%20Lost-DyXtw7v0.docx",X6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20What%20They%20Don_t%20Know(1)-0m9-5o_y.docx",Y6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Stop%20Thinking(1)-DqcXMud7.docx",q6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Stop%20Thinking-BnbVmdNA.docx",$6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Intelligence%20Meets%20Economics-R40jGbQv.docx",K6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Machines%20Learn%20to%20Doubt-DiHuqo6B.docx",Z6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Production%20Constraints%20Become%20Theoretical%20Insights-BXos_CKE.docx",Q6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Theory%20Meets%20the%20Datacenter%20Floor-CiIjOlZf.docx",J6="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Theory%20Meets%20the%20Ledger-hdXzjOUu.docx",e5="/assets/Theory-Practice%20Synthesis_%20Feb%2024%202026%20-%20The%20Guardrail%20Deficit-BwXQz3GW.docx",t5="/assets/Theory-Practice%20Synthesis_%20Feb%2024%202026%20-%20The%20Orchestration%20Layer%20Is%20The%20Product-CmdvsiXC.docx",n5="/assets/Theory-Practice%20Synthesis_%20Feb%2024%202026%20-%20When%20Agents%20Stopped%20Being%20Demo-able%20and%20Started%20Being%20Deployable-YapIdf7h.docx",r5="/assets/Theory-Practice%20Synthesis_%20Feb%2024%202026%20-%20When%20Cognitive%20Architecture%20Meets%20Production%20Reality-8Ny4ZTGh.docx",i5="/assets/Theory-Practice%20Synthesis_%20Feb%2024%202026%20-%20When%20Coordination%20Becomes%20Infrastructure-BSNfVjmi.docx",s5="/assets/Theory-Practice%20Synthesis_%20Feb%2024%202026%20-%20When%20Slime%20Molds%20Meet%20Prefrontal%20Cortex-BmHCPKph.docx",o5="/assets/Theory-Practice%20Synthesis_%20Feb%2024%202026%20-%20When%20Systems%20Learn%20What%20Practice%20Already%20Knew-BUxT35ZK.docx",a5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20AI%20Self-Awareness%20_%20Human-Centric%20Coordination-BGjHN2kG.docx",l5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20AI%20Systems%20Learning%20Self-Awareness-Be3ngWmv.docx",c5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20Agentic%20AI%20Convergence-Cipv7uCy.docx",u5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20Control%20as%20Capability-DnEB6KWD.docx",h5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20Diffusion%20LLMs%20and%20Real-Time%20Reasoning-CavKOUOJ.docx",d5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20Economic%20Self-Governance-DeXj-J-b.docx",f5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20Machine%20Meta-Cognition-BMcBaXWW.docx",p5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20Memory%20Architecture%20Revolution-f6-MeeMY.docx",m5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20Multi-Agent%20Governance%20Architecture-Ia3JJvCA.docx",g5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%2090_%20Problem-CFw--CHR.docx",y5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Abstraction%20Layer%20Wars-XPWCclqz.docx",v5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Authenticity%20Paradox-NsaRFZaJ.docx",_5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Capability%20Maturity%20Gap-BtfkRuoE.docx",x5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Constraint%20Paradox-Bzfh786H.docx",S5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Coordination%20Crisis%20in%20Agentic%20Systems-G0l8DiDe.docx",b5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Coordination%20Inflection-7vyn6fzB.docx",w5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20False%20Summit%20of%20Autonomous%20Coding-C9Z9zGT7.docx",T5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Heterogeneous%20Coordination%20Era-yDP6OiYb.docx",M5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Hidden%20Capability%20Paradigm-DRlnsdO7.docx",E5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Infrastructure%20Inflection%20Point-zHIyLydP.docx",A5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Latent%20Governance%20Capabilities%20AI%20Systems%20Already%20Possess-B3dEWlep.docx",C5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Reliability%20Inflection-DscFXswm.docx",P5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20The%20Self-Aware%20Infrastructure-DtScJhYv.docx",R5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Learns%20Its%20Own%20Limits-CR9EU69c.docx",I5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Learns%20to%20Stop%20Thinking-BxXdZsPP.docx",L5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Systems%20Know%20More%20Than%20They%20Can%20Tell-DNGvP486.docx",F5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20Their%20Limits-By_K18Jz.docx",N5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20What%20They%20Don_t%20Know(1)-B5Gy9iph.docx",D5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20What%20They%20Don_t%20Know(2)-DaxqiNBt.docx",O5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20What%20They%20Don_t%20Know-wmrd73vq.docx",U5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Stop-DZdvCn3r.docx",k5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Watch%20Themselves%20Think-Cv0n9KyE.docx",B5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Agents%20Learn%20to%20Remember%20and%20Evolve-5Lda973y.docx",z5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Architecture%20Becomes%20Destiny-BMJygKXs.docx",W5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Autonomous%20Capability%20Meets%20Accountability%20Infrastructure-qEE6ddFM.docx",H5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Autonomy%20Meets%20Accountability-xB2OQ1DQ.docx",G5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Bounded%20Autonomy%20Meets%20Production%20Reality-CiTyd1w7.docx",V5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Coordination%20Becomes%20Capability-D4ooBDFO.docx",j5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Expert%20Teams%20Become%20Consensus%20Machines-CtcrfKwM.docx",X5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Governance%20Architecture%20Becomes%20Substrate-CkcxYS7W.docx",Y5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Implicit%20AI%20Capabilities%20Became%20Enterprise%20Infrastructure-BTWpMqs5.docx",q5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Infrastructure%20Becomes%20Intelligence-BJfHZ8rK.docx",$5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Institutional%20AI%20Theory%20Meets%20Enterprise%20Reality-Dbtou0RW.docx",K5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Institutions%20Become%20Code-Bx0osIGc.docx",Z5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Research%20Predicts%20Production%20Crises-RN7Bu2x5.docx",Q5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Systems%20Know%20More%20Than%20They%20Show-HW1nAKuy.docx",J5="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Theory%20Becomes%20Infrastructure-D1AjY03k.docx",eW="/assets/Theory-Practice%20Synthesis_%20Feb%2025_%202026%20-%20The%2085_%20Governance%20Debt-C1bogYzi.docx",tW="/assets/Theory-Practice%20Synthesis_%20Feb%2025_%202026%20-%20The%20Orchestration%20Trilemma-3mfFin-A.docx",nW="/assets/Theory-Practice%20Synthesis_%20Feb%2025_%202026%20-%20When%20Agent%20Governance%20Stops%20Being%20Theoretical-Nw1Gb1jm.docx",rW="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20Meta-Cognitive%20AI%20and%20Enterprise%20Resilience-BhYpwqvf.docx",iW="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20What%20They%20Don_t%20Know-BWj7XeD7.docx",sW="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Watch%20Themselves-DniD8HKD.docx",oW="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20Models%20Know%20More%20Than%20They%20Show-C4kvRxNZ.docx",aW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20Multi-Agent%20Coordination-yXegLle_.docx",lW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20The%20Coordination%20Substrate%20Beneath%20Agentic%20AI-pZU62n7z.docx",cW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20The%20Self-Regulating%20Agent%20Thesis-BREBxmJf.docx",uW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20When%20AI%20Learns%20to%20Stop%20Thinking-C-NVE7fR.docx",hW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20When%20AI%20Research%20Catches%20Up%20to%20Deployment%20Reality-D4oGo9N6.docx",dW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20What%20They%20Don_t%20Know-usS5zlZC.docx",fW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20When%20Agents%20Know%20What%20They%20Don_t%20Know-Bcl_UXHN.docx",pW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20When%20Coordination%20Became%20the%20Constraint-IU23wV46.docx",mW="/assets/Theory-Practice%20Synthesis_%20February%2024_%202026%20-%20When%20Measurement%20Fails_%20Governance%20Emerges-lp5mOuWB.docx",gW="/assets/Theory-Practice%20Synthesis_%20February%2025_%202026%20-%20The%20Coordination%20Turn-Dnaqlrt-.docx",yW="/assets/Theory-Practice%20Synthesis_%202_23_2026%20-%20When%20AI%20Governance%20Became%20an%20Accelerant-BCbjjpeq.docx",vW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20Agency%20Inflection%20Point-4y2zFmNb.docx",_W="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20Calibration%20as%20Coordination%20Primitive-CBC77pnu.docx",xW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20Efficiency_%20Trust_%20and%20the%20Operationalization%20Gap-6fUEcJPn.docx",SW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Agentic%20Transition-DAVt103Y.docx",bW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Coordination%20Wall-DmhE4z6-.docx",wW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Cost-Conscious%20Singularity-BJXjD3gF.docx",TW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Efficiency-First%20Era-DaVDfW9N.docx",MW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Explicitness%20Premium%20in%20AI-DUwCo1yJ.docx",EW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Governance%20Inversion-Cc4yOHnA.docx",AW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Governance-Speed%20Paradox%20in%20Production%20Agentic%20AI-CK2iuAC5.docx",CW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Inference%20Inflection-Ck6dysHF.docx",PW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Operationalization%20Moment%20for%20Agentic%20Systems-DZ7N3ZfN.docx",RW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Operationalization%20Paradox-DfENMZtz.docx",IW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Orchestration%20Imperative-CzvDHddz.docx",LW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Orchestration%20Layer-D_8P-pNe.docx",FW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Sovereignty-Coordination%20Paradox(1)-CaDfS1Wj.docx",NW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20AI%20Agents%20Learn%20to%20Calibrate%20Their%20Own%20Existence-cM5SXvJo.docx",DW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agentic%20AI%20Meets%20Operational%20Reality-3mnpENBa.docx",OW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agentic%20Theory%20Meets%20Enterprise%20Reality-BVJpDRsf.docx",UW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agents%20Learn%20to%20Budget-BhiMYE8x.docx",kW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agents%20Learn%20to%20Coordinate%20Without%20Conformity-D-g8STZ_.docx",BW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agents%20Learn%20to%20Govern%20Themselves-BTWMv4w_.docx",zW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agents%20Need%20Rehearsal%20Grounds-DBWOvv-Y.docx",WW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Constraints%20Became%20Capabilities-DIVDDCKf.docx",HW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Economic%20Constraints%20Become%20Governance%20Primitives-BzJzZ_lV.docx",GW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Efficiency%20Architectures%20Become%20Coordination%20Substrates--IBm3OQy.docx",VW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Efficiency%20Becomes%20Governance-MVPQe6yE.docx",jW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Efficiency%20Creates%20Coordination%20Debt-CYWB43zd.docx",XW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Intelligence%20Moves%20Into%20Infrastructure-ClN0HODi.docx",YW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Scarcity%20Became%20the%20Mother%20of%20AI%20Invention-DUp0GDjf.docx",qW="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Theory%20Meets%20the%20Invoice-DzIvfKxp.docx",$W="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20AI%20Agent%20Operationalization-Dyy0aw61.docx",KW="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20The%20Governance%20Threshold-pO9j0v3v.docx",ZW="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20The%20Validation%20Paradox%20in%20Agentic%20AI-JsjDaUWO.docx",QW="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20When%20Agentic%20AI%20Theory%20Meets%20Production%20Economics-CgtvrkfM.docx",JW="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20When%20Efficiency%20Primitives%20Met%20Production%20Reality-g1D7F_t7.docx",eH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20The%20Coordination%20Inflection-CnH4qPPw.docx",tH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20The%20Coordination%20Paradox%20in%20Agentic%20AI-J_0il8ug.docx",nH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Learn-DWYbf_Yc.docx",rH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Agent%20Theory%20Met%20Production%20Reality-BwkSOTn2.docx",iH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Agents%20Became%20Infrastructure-B-fh6KuV.docx",sH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Agents%20Learn%20to%20Trust%20Themselves-Buv2-1tK.docx",oH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Autonomous%20Agents%20Moved%20From%20While%20Loops%20to%20Workforce%20Planning-UN6gB4KU.docx",aH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Coordination%20Becomes%20the%20Cost-BDC9-LRa.docx",lH="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Governance%20Infrastructure%20Became%20Non-Negotiable-C9NrWHCH.docx",cH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20Agent%20Reliability%20_%20Coordination-B7-qGzOk.docx",uH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20Coordination%20as%20the%20New%20Computing%20Primitive-CZq16UJp.docx",hH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20Factorization%20as%20the%20Production%20Viability%20Threshold-J1lHbS8z.docx",dH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20From%20Black%20Box%20to%20Black%20Mirror-DlKX-BFI.docx",fH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20Governance%20as%20Substrate-BqCDEXBY.docx",pH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20Human-AI%20Coordination%20Infrastructure-LG0qrKr-.docx",mH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20Philosophy%20as%20Infrastructure-CQnnzYN4.docx",gH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Atomization%20Inflection-BwfInkNN.docx",yH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Cost-Governance%20Inflection%20in%20Agentic%20AI-i54dFq9J.docx",vH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Efficiency-Autonomy%20Paradox-DNkBxt-w.docx",_H="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Governance%20Inflection%20Point-mZafKRD7.docx",xH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Impossible%20Trinity%20of%20Agentic%20AI-CphwFdFR.docx",SH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Operationalization%20Inflection-UyVYIDdF.docx",bH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20The%20Profitability%20Inflection-DhvZz1Aw.docx",wH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20AI%20Systems%20Learn%20to%20Know%20What%20They%20Don_t%20Know-Ck4Yb2hs.docx",TH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Agent%20Governance%20Becomes%20Infrastructure-Sb5sxkE8.docx",MH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Agentic%20Economics%20Meets%20Enterprise%20Reality-CtOt-sl4.docx",EH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Agentic%20Systems%20Fail%20Like%20Organizations-BuO2rbEx.docx",AH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Agents%20Coordinate_%20Markets%20Collapse-CwpU0bTd.docx",CH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Agents%20Forget-jsHtDcvU.docx",PH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Agents%20Learn%20to%20Budget%20Their%20Intelligence-Cg5iccHb.docx",RH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Agents%20Learn%20to%20Think%20Out%20Loud-BQwyJxj3.docx",IH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Agents%20Learned%20to%20Improvise-D_-YeQ69.docx",LH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Architectural%20Theory%20Meets%20Production%20Workflows-CMj_x7we.docx",FH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Autonomous%20Agents%20Cross%20the%20Production%20Chasm--cmUSkZD.docx",NH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Benchmarks%20Saturate-VOYFhV84.docx",DH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Constraints%20Birth%20Capability-BSYtKVwh.docx",OH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Coordination%20Becomes%20Constitution-DkdrjUId.docx",UH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Coordination%20Becomes%20the%20Product-D20f5RVz.docx",kH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Coordination%20Costs%20Collapse-kalluYL1.docx",BH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Pattern%20Matching%20Meets%20Production%20Reality-5kIsY-Kx.docx",zH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Research%20Becomes%20Infrastructure-82_gJhO8.docx",WH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Research%20Meets%20Production%20Reality-D-u6pzKM.docx",HH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Security%20Becomes%20a%20Prediction%20Market-Bs47CJiN.docx",GH="/assets/Theory-Practice%20Synthesis_%20Feb%2023_%202026%20-%20When%20Theory%20Becomes%20Economics-kGNNu4Px.docx",VH="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20AI%20Agents%20Learned%20to%20Explain%20Their%20Costs-3hrFBP1W.docx",jH="/assets/Theory-Practice%20Synthesis_%20Feb%2024_%202026%20-%20When%20Invitation%20Becomes%20Infrastructure-DF9cQNfG.docx",XH="/assets/Theory-Practice%20Synthesis_%20February%202026%20-%20When%20Autonomous%20Agents%20Become%20Infrastructure-Lb8sG0ev.docx",YH="/assets/Theory-Practice%20Synthesis_%20February%202026%20-%20When%20Governance%20Operates%20at%20Machine%20Speed-Dw7wMrnd.docx",qH="/assets/Theory-Practice%20Synthesis_%20February%2022_%202026%20-%20Agent%20Coordination%20Without%20Socialization-Dy7S1UNE.docx",$H="/assets/Theory-Practice%20Synthesis_%20February%2022_%202026%20-%20When%20Agents%20Learn%20to%20Calculate%20Cost_%20Simulate%20Futures_%20and%20Earn%20Trust-CbkCZhRj.docx",KH="/assets/Theory-Practice%20Synthesis_%20February%2022_%202026%20-%20When%20Agents%20Learn%20to%20Doubt-Dwh8kf2A.docx",ZH="/assets/Theory-Practice%20Synthesis_%20February%2022_%202026%20-%20When%20Theory%20Earns%20Its%20Production%20Badge-DL1o8jFo.docx",QH="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20The%20Coordination%20Crisis-BJiKKbYw.docx",JH="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20The%20Coordination%20Governance%20Inflection%20Point-CTpu2gWx.docx",eG="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20The%20Sovereignty%20Paradox%20in%20Agentic%20AI-CB3jWyEL.docx",tG="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20Agentic%20Autonomy%20Demands%20Architectural%20Sovereignty-DqzuvaHo.docx",nG="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20Context%20Engineering%20Becomes%20Governance-BYGPuNfq.docx",rG="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20Explicit%20Governance%20Meets%20Autonomous%20Capability-BhLbITMp.docx",iG="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20Governance%20Becomes%20Architecture-DzoLhC1x.docx",sG="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20Legacy%20Infrastructure%20Became%20AI_s%20Secret%20Weapon-CEP6tDLw.docx",oG="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20Orchestration%20Becomes%20the%20Operating%20System-tRRpzOtx.docx",aG="/assets/Theory-Practice%20Synthesis_%20February%2023_%202026%20-%20When%20Research%20Meets%20Governance%20Reality-CQtraN7p.docx",lG="/assets/Theory-Practice%20Synthesis_%202026-02-20%20-%20The%2010-Step%20Ceiling-EzM3g2d_.docx",cG="/assets/Theory-Practice%20Synthesis_%20Feb%2019%202026%20-%20When%20Agent%20Theory%20Meets%20Deployment%20Reality-DuPcTNa4.docx",uG="/assets/Theory-Practice%20Synthesis_%20Feb%2019%202026%20-%20When%20Capability%20Outpaces%20Reliability-DuFOV8eQ.docx",hG="/assets/Theory-Practice%20Synthesis_%20Feb%2019%202026%20-%20When%20Constraint%20Forces%20Operationalization-X2k_3huE.docx",dG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20The%20Capability-Reliability%20Paradox-Dnl7CHZp.docx",fG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20The%20Reliability%20Valley%20in%20Enterprise%20AI%20Agents-dO4G3Pca.docx",pG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20The%20Trust%20Infrastructure%20Gap-cA2NaPJL.docx",mG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20AI%20Agent%20Research%20Meets%20Production%20Reality-Cw2NZkyV.docx",gG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20AI%20Capability%20Decouples%20From%20Reliability-BMSSVtw7.docx",yG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Agents%20Get%20Smarter%20But%20Not%20More%20Trustworthy-DCnQHgeZ.docx",vG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Agents%20Learn%20to%20Fail%20Measurably-C_DyBnAA.docx",_G="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Agents%20Leave%20the%20Benchmark-C7ssVhco.docx",xG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Capability%20Divorced%20Reliability-1CrXD8d_.docx",SG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Capability%20Meets%20the%20Reliability%20Wall-Cb6ps_uO.docx",bG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Deployment%20Velocity%20Outpaces%20Safety%20Science-jv3gtYSh.docx",wG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Foundations%20Mature%20Faster%20Than%20Frameworks-ChLWBErU.docx",TG="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Reliability%20Became%20the%20New%20Capability-obhn5w9V.docx",MG="/assets/Theory-Practice%20Synthesis_%20Feb%2020%202026%20-%20When%20Constraints%20Force%20Maturity-B9Qw-5i0.docx",EG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20Compositional%20Architectures%20Meet%20Operational%20Reality-BukJO3vr.docx",AG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%2089_%20Deployment%20Crisis-qqUsBXjY.docx",CG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Capability%20Overhang-9mSovPsK.docx",PG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Capability-Accountability%20Chasm-DgPV0ga9.docx",RG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Capability-Reliability%20Paradox-Cc_tn2N8.docx",IG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Convergence%20Moment-qnHGA0ew.docx",LG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Coordination%20Paradox-CD4f9npA.docx",FG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Coordination%20Tax-DY6rFXro.docx",NG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Deployment%20Wall-D5d9UXdA.docx",DG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Governance%20Convergence-D33Z29G7.docx",OG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Governance-Autonomy%20Paradox-DOyqHZV5.docx",UG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Governance-at-Runtime%20Paradigm-C2EIhn5c.docx",kG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Infrastructure-Capability%20Paradox-CeZuny5h.docx",BG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Orchestration%20Inflection%20Point-DErjXEes.docx",zG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Reliability-Capability%20Paradox-Bnnr2wy8.docx",WG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Sovereignty-Coordination%20Paradox-F5WivG-m.docx",HG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20AI%20Agents%20Meet%20Operational%20Reality-DLkl9dxJ.docx",GG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20AI%20Societies%20Meet%20Enterprise%20Reality-DJ10lKYG.docx",VG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agent%20Capability%20Gains%20Stop%20Predicting%20Reliability-BeXywzEC.docx",jG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agent%20Societies%20Meet%20Enterprise%20Reality-4h8SLNH9.docx",XG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agent%20Sprawl%20Meets%20Coordination%20Theory-BhwOFpYK.docx",YG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agentic%20AI%20Learned%20Economic%20Rationality-C46uqhHR.docx",qG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agentic%20AI%20Theory%20Meets%20Enterprise%20Reality-BUOKHNgG.docx",$G="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agents%20Graduate%20from%20Lab%20to%20Ledger-CHDAFUfT.docx",KG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agents%20Hit%20Production%20and%20Governance%20Hits%20the%20Wall-CEcpElZf.docx",ZG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agents%20Leave%20the%20Lab-DO7RmpSO.docx",QG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Agents%20Need%20Governors-DGvxUj4t.docx",JG="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Benchmarks%20Meet%20Budgets-BrjVBHtm.docx",eV="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Capability%20and%20Reliability%20Diverge-BpwAH9dI.docx",tV="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Efficiency%20Becomes%20Governance(1)-DUS1rk9N.docx",nV="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Governance%20Becomes%20the%20Product-CEzvFM-k.docx",rV="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Infrastructure%20Constraints%20Birth%20Governance%20Innovation-B1AtX7mt.docx",iV="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Reliability%20Engineering%20Supersedes%20Model%20Intelligence-BQlOukiL.docx",sV="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Robots%20Work%20and%20Agents%20Don_t-C0ExgDpQ.docx",oV="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Sparse%20Becomes%20Sufficient-CfMwxMsj.docx",aV="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Telecom%20Infrastructure%20Becomes%20More%20Relevant%20Than%20Model%20Advances-_GpG1N9s.docx",lV="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20The%20Infrastructure%20Layer%20That%20Will%20Determine%20Agent%20Sovereignty-DD2ajkhE.docx",cV="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20When%20Agent%20Autonomy%20Meets%20the%20Audit%20Trail-BgWmkKRV.docx",uV="/assets/Theory-Practice%20Synthesis_%20Feb%202026%20-%20When%20Agent%20Reliability%20Science%20Meets%20Production%20Reality-DsxQ6WSh.docx",hV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20Computational%20Sovereignty-DQpL-zhv.docx",dV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20The%2077_%20Paradox-DG-95KPS.docx",fV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20The%20Autonomy%20Paradox-bU3W4iIE.docx",pV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20The%20Coordination%20Infrastructure%20Inflection-DLOjYhI0.docx",mV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20The%20Governance%20Trilemma-DtGQgEBJ.docx",gV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20When%20AI%20Theory%20Meets%20Production%20Reality-DUC31mt3.docx",yV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20When%20Agentic%20AI%20Meets%20The%20Reality%20Tax-CUtU7-mY.docx",vV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20When%20Agentic%20AI%20Theory%20Meets%20the%20Governance%20Wall-CFz0LnKr.docx",_V="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20When%20Agents%20Stop%20Averaging%20and%20Start%20Deciding-CVHKZTJD.docx",xV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20When%20Compression%20Meets%20Trust-ByWh-JTa.docx",SV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20When%20Coordination%20Becomes%20Containment-C0r_1xna.docx",bV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20When%20Theory%20Becomes%20Infrastructure-CnCwKc5r.docx",wV="/assets/Theory-Practice%20Synthesis_%20Feb%2021_%202026%20-%20When%20Vibe%20Coding%20Met%20Production%20Reality-By4teIZm.docx",TV="/assets/Theory-Practice%20Synthesis_%20Feb%2022%202026%20-%20When%20Velocity%20Meets%20Governance-YaRNpE0J.docx",MV="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20Agentic%20Infrastructure%20at%20the%20Inflection%20Point-B0TZkQZQ.docx",EV="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20Agentic%20Infrastructure-CPYqNTdP.docx",AV="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20The%20Autonomy%20Paradox-BL2_QHvN.docx",CV="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20The%20Non-Delegation%20Paradox-Dn8fb7-2.docx",PV="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Agents%20Learn%20to%20Calibrate%20Themselves-BsehpF2k.docx",RV="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Constraints%20Become%20Architecture-Cmb9CQny.docx",IV="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Governance%20Becomes%20Infrastructure-Bik0l7JN.docx",LV="/assets/Theory-Practice%20Synthesis_%20Feb%2022_%202026%20-%20When%20Organization%20Becomes%20Infrastructure-DPGVnuRj.docx",FV="/assets/Theory-Practice%20Synthesis_%20February%2019_%202026%20-%20The%20Reliability%20Reckoning-B5CCCYcv.docx",NV="/assets/Theory-Practice%20Synthesis_%20February%2019_%202026%20-%20When%20AI%20Deployment%20Shifts%20From%20_Does%20It%20Work_%20to%20_Can%20We%20Rely%20On%20It_-QPzykQnj.docx",DV="/assets/Theory-Practice%20Synthesis_%20February%2020_%202026%20-%20When%20Capability%20Diverged%20From%20Reliability-BUH0W_FC.docx",OV="/assets/Theory-Practice%20Synthesis_%20February%2020_%202026%20-%20When%20Infrastructure%20Efficiency%20Becomes%20Governance%20Capability-CxDEjBIs.docx",UV="/assets/Theory-Practice%20Synthesis_%20February%2020_%202026%20-%20When%20Organizations%20Become%20Code-2CqeKVqD.docx",kV="/assets/Theory-Practice%20Synthesis_%20February%2020_%202026%20-%20When%20Selective%20Attention%20Becomes%20Infrastructure-BtCgs_bX.docx",BV="/assets/Theory-Practice%20Synthesis_%20February%202026%20-%20When%20AI%20Systems%20Learn%20to%20Optimize%20Themselves-JBqBJ6Dq.docx",zV="/assets/Theory-Practice%20Synthesis_%20February%202026%20-%20When%20Agent%20Capability%20Outpaced%20Agent%20Reliability-DKJ-3dC9.docx",WV="/assets/Theory-Practice%20Synthesis_%20February%202026%20-%20When%20Agent%20Infrastructure%20Meets%20Regulatory%20Reality-DJex9az6.docx",HV="/assets/Theory-Practice%20Synthesis_%20February%202026%20-%20When%20Optimization%20Migrates%20from%20Compute%20to%20Economics-C2IiamjN.docx",GV="/assets/Theory-Practice%20Synthesis_%20February%202026%20-%20When%20_Human%20Control_%20Became%20the%20Anchor_%20Not%20the%20Answer-DEmvYE33.docx",VV="/assets/Theory-Practice%20Synthesis_%20February%2021_%202026%20-%20When%20AI%20Systems%20Develop%20Economic%20Consciousness-BZ5-q4WM.docx",jV="/assets/Theory-Practice%20Synthesis_%20February%2021_%202026%20-%20When%20Agents%20Go%20to%20Work-CxzFLKUb.docx",XV="/assets/Theory-Practice%20Synthesis_%20February%2021_%202026%20-%20When%20Governance%20Becomes%20the%20Coordination%20Protocol-CdME-o_Q.docx",YV="/assets/Theory-Practice%20Synthesis_%20February%2021_%202026%20-%20When%20Runtime%20Governance%20Becomes%20Economic%20Reality-Cu6mu6go.docx",qV="/assets/Theory-Practice%20Synthesis_%20February%2022_%202026%20-%20When%20Agent%20Autonomy%20Met%20Enterprise%20Reality-BhAiTgmD.docx",$V="/assets/Theory-Practice%20Synthesis_%20February%2022_%202026%20-%20When%20Governance%20Becomes%20Infrastructure-ClfpuZH9.docx",KV="/assets/Theory-Practice%20Synthesis_%20February%2022_%202026%20-%20When%20Silent%20Coordination%20Outperforms%20Conversation-Bd22M7-D.docx",ZV="/assets/Theory-Practice%20Synthesis_%20Feb%2019%202026%20-%20The%20Science%20of%20Agent%20Reliability-_F_h4hBi.docx",QV="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20The%20Operationalization%20Paradox%20in%20Agentic%20AI-CksdK_l5.docx",JV="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20The%20Reliability%20Paradox-DtD4LOkT.docx",e8="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20AI%20Agent%20Theory%20Predicts%20the%2040_%20Enterprise%20Failure%20Rate-ChjVijQm.docx",t8="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Agent%20Reliability%20Science%20Meets%20Enterprise%20Reality-DKB0oL-T.docx",n8="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Capability%20Diverges%20from%20Reliability-CXG5_6WR.docx",r8="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Capability%20Saturates_%20Governance%20Emerges-CQok7UKY.docx",i8="/assets/Theory-Practice%20Synthesis_%20Feb%2019_%202026%20-%20When%20Efficiency%20Met%20Embodiment-Clr3Jt9b.docx",s8="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20Infrastructure%20as%20Philosophy-Uhktdgn_.docx",o8="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%2088_%20Financial%20AI%20Deployment%20Paradox-Dm6yKzx2.docx",a8="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Headline%20Is%20Wrong_%20Why%2060_%20Cheaper%20Agents%20Miss%20the%20Real%20Cost%20of%20Agentic%20AI-CUEMHRHj.docx",l8="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20The%20Inflection%20Point%20Where%20Agent%20Theory%20Meets%20Workforce%20Reality-piX57H19.docx",c8="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20AI%20Theory%20Becomes%20Infrastructure-mcydPGnO.docx",u8="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Capability%20Meets%20Accountability-BawFF8UK.docx",h8="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Capability%20Met%20Reliability-D7Rm29AY.docx",d8="/assets/Theory-Practice%20Synthesis_%20Feb%2020_%202026%20-%20When%20Theory%20Meets%20Reality-Bna-rpBI.docx",f8="/assets/Theory-Practice%20Synthesis_%20February%2019_%202026%20-%20The%20Capability-Reliability%20Decoupling-DvqZ6iFS.docx",p8=Object.assign({"/batch1/Theory-Practice Synthesis_ 2026-02-24 - The Operationalization Crisis.docx":E6,"/batch1/Theory-Practice Synthesis_ 2026-02-24 - The Sovereignty Paradox in Agentic AI.docx":A6,"/batch1/Theory-Practice Synthesis_ Feb 2026 - When AI Reasoning Became Organizational Infrastructure.docx":C6,"/batch1/Theory-Practice Synthesis_ Feb 2026 - When Constitutions Evolve.docx":P6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - Metacognitive Efficiency in AI Systems.docx":R6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - Sovereignty-Preserving Coordination.docx":I6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - The Constraint Paradox in Agentic AI.docx":L6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - The Coordination Substrate.docx":F6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - The Implicit Knowledge Economy.docx":N6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - The Inference-Time Intelligence Paradigm.docx":D6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - The Metacognitive Turn.docx":O6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - The Sovereignty Constraint in AI Coordination.docx":U6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - The Stability-Efficiency Paradox.docx":k6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - The Thinking Tax.docx":B6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn Self-Awareness.docx":z6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn Self-Limitation.docx":W6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn They Already Know How to Stop.docx":H6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn to Fail Well.docx":G6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn to Govern Themselves.docx":V6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn to Know They_re Lost.docx":j6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn to Know What They Don_t Know(1).docx":X6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn to Stop Thinking(1).docx":Y6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn to Stop Thinking.docx":q6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When Intelligence Meets Economics.docx":$6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When Machines Learn to Doubt.docx":K6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When Production Constraints Become Theoretical Insights.docx":Z6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When Theory Meets the Datacenter Floor.docx":Q6,"/batch1/Theory-Practice Synthesis_ Feb 23, 2026 - When Theory Meets the Ledger.docx":J6,"/batch1/Theory-Practice Synthesis_ Feb 24 2026 - The Guardrail Deficit.docx":e5,"/batch1/Theory-Practice Synthesis_ Feb 24 2026 - The Orchestration Layer Is The Product.docx":t5,"/batch1/Theory-Practice Synthesis_ Feb 24 2026 - When Agents Stopped Being Demo-able and Started Being Deployable.docx":n5,"/batch1/Theory-Practice Synthesis_ Feb 24 2026 - When Cognitive Architecture Meets Production Reality.docx":r5,"/batch1/Theory-Practice Synthesis_ Feb 24 2026 - When Coordination Becomes Infrastructure.docx":i5,"/batch1/Theory-Practice Synthesis_ Feb 24 2026 - When Slime Molds Meet Prefrontal Cortex.docx":s5,"/batch1/Theory-Practice Synthesis_ Feb 24 2026 - When Systems Learn What Practice Already Knew.docx":o5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - AI Self-Awareness & Human-Centric Coordination.docx":a5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - AI Systems Learning Self-Awareness.docx":l5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - Agentic AI Convergence.docx":c5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - Control as Capability.docx":u5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - Diffusion LLMs and Real-Time Reasoning.docx":h5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - Economic Self-Governance.docx":d5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - Machine Meta-Cognition.docx":f5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - Memory Architecture Revolution.docx":p5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - Multi-Agent Governance Architecture.docx":m5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The 90_ Problem.docx":g5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Abstraction Layer Wars.docx":y5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Authenticity Paradox.docx":v5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Capability Maturity Gap.docx":_5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Constraint Paradox.docx":x5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Coordination Crisis in Agentic Systems.docx":S5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Coordination Inflection.docx":b5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The False Summit of Autonomous Coding.docx":w5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Heterogeneous Coordination Era.docx":T5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Hidden Capability Paradigm.docx":M5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Infrastructure Inflection Point.docx":E5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Latent Governance Capabilities AI Systems Already Possess.docx":A5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Reliability Inflection.docx":C5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - The Self-Aware Infrastructure.docx":P5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Learns Its Own Limits.docx":R5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Learns to Stop Thinking.docx":I5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Systems Know More Than They Can Tell.docx":L5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Systems Learn to Know Their Limits.docx":F5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Systems Learn to Know What They Don_t Know(1).docx":N5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Systems Learn to Know What They Don_t Know(2).docx":D5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Systems Learn to Know What They Don_t Know.docx":O5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Systems Learn to Stop.docx":U5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Systems Learn to Watch Themselves Think.docx":k5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Agents Learn to Remember and Evolve.docx":B5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Architecture Becomes Destiny.docx":z5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Autonomous Capability Meets Accountability Infrastructure.docx":W5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Autonomy Meets Accountability.docx":H5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Bounded Autonomy Meets Production Reality.docx":G5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Coordination Becomes Capability.docx":V5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Expert Teams Become Consensus Machines.docx":j5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Governance Architecture Becomes Substrate.docx":X5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Implicit AI Capabilities Became Enterprise Infrastructure.docx":Y5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Infrastructure Becomes Intelligence.docx":q5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Institutional AI Theory Meets Enterprise Reality.docx":$5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Institutions Become Code.docx":K5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Research Predicts Production Crises.docx":Z5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Systems Know More Than They Show.docx":Q5,"/batch1/Theory-Practice Synthesis_ Feb 24, 2026 - When Theory Becomes Infrastructure.docx":J5,"/batch1/Theory-Practice Synthesis_ Feb 25, 2026 - The 85_ Governance Debt.docx":eW,"/batch1/Theory-Practice Synthesis_ Feb 25, 2026 - The Orchestration Trilemma.docx":tW,"/batch1/Theory-Practice Synthesis_ Feb 25, 2026 - When Agent Governance Stops Being Theoretical.docx":nW,"/batch1/Theory-Practice Synthesis_ February 23, 2026 - Meta-Cognitive AI and Enterprise Resilience.docx":rW,"/batch1/Theory-Practice Synthesis_ February 23, 2026 - When AI Systems Learn to Know What They Don_t Know.docx":iW,"/batch1/Theory-Practice Synthesis_ February 23, 2026 - When AI Systems Learn to Watch Themselves.docx":sW,"/batch1/Theory-Practice Synthesis_ February 23, 2026 - When Models Know More Than They Show.docx":oW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - Multi-Agent Coordination.docx":aW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - The Coordination Substrate Beneath Agentic AI.docx":lW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - The Self-Regulating Agent Thesis.docx":cW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - When AI Learns to Stop Thinking.docx":uW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - When AI Research Catches Up to Deployment Reality.docx":hW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - When AI Systems Learn to Know What They Don_t Know.docx":dW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - When Agents Know What They Don_t Know.docx":fW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - When Coordination Became the Constraint.docx":pW,"/batch1/Theory-Practice Synthesis_ February 24, 2026 - When Measurement Fails, Governance Emerges.docx":mW,"/batch1/Theory-Practice Synthesis_ February 25, 2026 - The Coordination Turn.docx":gW,"/batch2/Theory-Practice Synthesis_ 2_23_2026 - When AI Governance Became an Accelerant.docx":yW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - Agency Inflection Point.docx":vW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - Calibration as Coordination Primitive.docx":_W,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - Efficiency, Trust, and the Operationalization Gap.docx":xW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Agentic Transition.docx":SW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Coordination Wall.docx":bW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Cost-Conscious Singularity.docx":wW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Efficiency-First Era.docx":TW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Explicitness Premium in AI.docx":MW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Governance Inversion.docx":EW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Governance-Speed Paradox in Production Agentic AI.docx":AW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Inference Inflection.docx":CW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Operationalization Moment for Agentic Systems.docx":PW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Operationalization Paradox.docx":RW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Orchestration Imperative.docx":IW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Orchestration Layer.docx":LW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - The Sovereignty-Coordination Paradox(1).docx":FW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When AI Agents Learn to Calibrate Their Own Existence.docx":NW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Agentic AI Meets Operational Reality.docx":DW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Agentic Theory Meets Enterprise Reality.docx":OW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Agents Learn to Budget.docx":UW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Agents Learn to Coordinate Without Conformity.docx":kW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Agents Learn to Govern Themselves.docx":BW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Agents Need Rehearsal Grounds.docx":zW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Constraints Became Capabilities.docx":WW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Economic Constraints Become Governance Primitives.docx":HW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Efficiency Architectures Become Coordination Substrates.docx":GW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Efficiency Becomes Governance.docx":VW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Efficiency Creates Coordination Debt.docx":jW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Intelligence Moves Into Infrastructure.docx":XW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Scarcity Became the Mother of AI Invention.docx":YW,"/batch2/Theory-Practice Synthesis_ Feb 20, 2026 - When Theory Meets the Invoice.docx":qW,"/batch2/Theory-Practice Synthesis_ Feb 2026 - AI Agent Operationalization.docx":$W,"/batch2/Theory-Practice Synthesis_ Feb 2026 - The Governance Threshold.docx":KW,"/batch2/Theory-Practice Synthesis_ Feb 2026 - The Validation Paradox in Agentic AI.docx":ZW,"/batch2/Theory-Practice Synthesis_ Feb 2026 - When Agentic AI Theory Meets Production Economics.docx":QW,"/batch2/Theory-Practice Synthesis_ Feb 2026 - When Efficiency Primitives Met Production Reality.docx":JW,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - The Coordination Inflection.docx":eH,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - The Coordination Paradox in Agentic AI.docx":tH,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - When AI Systems Learn to Learn.docx":nH,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - When Agent Theory Met Production Reality.docx":rH,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - When Agents Became Infrastructure.docx":iH,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - When Agents Learn to Trust Themselves.docx":sH,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - When Autonomous Agents Moved From While Loops to Workforce Planning.docx":oH,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - When Coordination Becomes the Cost.docx":aH,"/batch2/Theory-Practice Synthesis_ Feb 22, 2026 - When Governance Infrastructure Became Non-Negotiable.docx":lH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - Agent Reliability & Coordination.docx":cH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - Coordination as the New Computing Primitive.docx":uH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - Factorization as the Production Viability Threshold.docx":hH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - From Black Box to Black Mirror.docx":dH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - Governance as Substrate.docx":fH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - Human-AI Coordination Infrastructure.docx":pH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - Philosophy as Infrastructure.docx":mH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - The Atomization Inflection.docx":gH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - The Cost-Governance Inflection in Agentic AI.docx":yH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - The Efficiency-Autonomy Paradox.docx":vH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - The Governance Inflection Point.docx":_H,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - The Impossible Trinity of Agentic AI.docx":xH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - The Operationalization Inflection.docx":SH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - The Profitability Inflection.docx":bH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When AI Systems Learn to Know What They Don_t Know.docx":wH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Agent Governance Becomes Infrastructure.docx":TH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Agentic Economics Meets Enterprise Reality.docx":MH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Agentic Systems Fail Like Organizations.docx":EH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Agents Coordinate, Markets Collapse.docx":AH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Agents Forget.docx":CH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Agents Learn to Budget Their Intelligence.docx":PH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Agents Learn to Think Out Loud.docx":RH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Agents Learned to Improvise.docx":IH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Architectural Theory Meets Production Workflows.docx":LH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Autonomous Agents Cross the Production Chasm.docx":FH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Benchmarks Saturate.docx":NH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Constraints Birth Capability.docx":DH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Coordination Becomes Constitution.docx":OH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Coordination Becomes the Product.docx":UH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Coordination Costs Collapse.docx":kH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Pattern Matching Meets Production Reality.docx":BH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Research Becomes Infrastructure.docx":zH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Research Meets Production Reality.docx":WH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Security Becomes a Prediction Market.docx":HH,"/batch2/Theory-Practice Synthesis_ Feb 23, 2026 - When Theory Becomes Economics.docx":GH,"/batch2/Theory-Practice Synthesis_ Feb 24, 2026 - When AI Agents Learned to Explain Their Costs.docx":VH,"/batch2/Theory-Practice Synthesis_ Feb 24, 2026 - When Invitation Becomes Infrastructure.docx":jH,"/batch2/Theory-Practice Synthesis_ February 2026 - When Autonomous Agents Become Infrastructure.docx":XH,"/batch2/Theory-Practice Synthesis_ February 2026 - When Governance Operates at Machine Speed.docx":YH,"/batch2/Theory-Practice Synthesis_ February 22, 2026 - Agent Coordination Without Socialization.docx":qH,"/batch2/Theory-Practice Synthesis_ February 22, 2026 - When Agents Learn to Calculate Cost, Simulate Futures, and Earn Trust.docx":$H,"/batch2/Theory-Practice Synthesis_ February 22, 2026 - When Agents Learn to Doubt.docx":KH,"/batch2/Theory-Practice Synthesis_ February 22, 2026 - When Theory Earns Its Production Badge.docx":ZH,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - The Coordination Crisis.docx":QH,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - The Coordination Governance Inflection Point.docx":JH,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - The Sovereignty Paradox in Agentic AI.docx":eG,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - When Agentic Autonomy Demands Architectural Sovereignty.docx":tG,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - When Context Engineering Becomes Governance.docx":nG,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - When Explicit Governance Meets Autonomous Capability.docx":rG,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - When Governance Becomes Architecture.docx":iG,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - When Legacy Infrastructure Became AI_s Secret Weapon.docx":sG,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - When Orchestration Becomes the Operating System.docx":oG,"/batch2/Theory-Practice Synthesis_ February 23, 2026 - When Research Meets Governance Reality.docx":aG,"/batch3/Theory-Practice Synthesis_ 2026-02-20 - The 10-Step Ceiling.docx":lG,"/batch3/Theory-Practice Synthesis_ Feb 19 2026 - When Agent Theory Meets Deployment Reality.docx":cG,"/batch3/Theory-Practice Synthesis_ Feb 19 2026 - When Capability Outpaces Reliability.docx":uG,"/batch3/Theory-Practice Synthesis_ Feb 19 2026 - When Constraint Forces Operationalization.docx":hG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - The Capability-Reliability Paradox.docx":dG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - The Reliability Valley in Enterprise AI Agents.docx":fG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - The Trust Infrastructure Gap.docx":pG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When AI Agent Research Meets Production Reality.docx":mG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When AI Capability Decouples From Reliability.docx":gG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When Agents Get Smarter But Not More Trustworthy.docx":yG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When Agents Learn to Fail Measurably.docx":vG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When Agents Leave the Benchmark.docx":_G,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When Capability Divorced Reliability.docx":xG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When Capability Meets the Reliability Wall.docx":SG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When Deployment Velocity Outpaces Safety Science.docx":bG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When Foundations Mature Faster Than Frameworks.docx":wG,"/batch3/Theory-Practice Synthesis_ Feb 19, 2026 - When Reliability Became the New Capability.docx":TG,"/batch3/Theory-Practice Synthesis_ Feb 20 2026 - When Constraints Force Maturity.docx":MG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - Compositional Architectures Meet Operational Reality.docx":EG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The 89_ Deployment Crisis.docx":AG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Capability Overhang.docx":CG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Capability-Accountability Chasm.docx":PG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Capability-Reliability Paradox.docx":RG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Convergence Moment.docx":IG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Coordination Paradox.docx":LG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Coordination Tax.docx":FG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Deployment Wall.docx":NG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Governance Convergence.docx":DG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Governance-Autonomy Paradox.docx":OG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Governance-at-Runtime Paradigm.docx":UG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Infrastructure-Capability Paradox.docx":kG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Orchestration Inflection Point.docx":BG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Reliability-Capability Paradox.docx":zG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - The Sovereignty-Coordination Paradox.docx":WG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When AI Agents Meet Operational Reality.docx":HG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When AI Societies Meet Enterprise Reality.docx":GG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agent Capability Gains Stop Predicting Reliability.docx":VG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agent Societies Meet Enterprise Reality.docx":jG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agent Sprawl Meets Coordination Theory.docx":XG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agentic AI Learned Economic Rationality.docx":YG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agentic AI Theory Meets Enterprise Reality.docx":qG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agents Graduate from Lab to Ledger.docx":$G,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agents Hit Production and Governance Hits the Wall.docx":KG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agents Leave the Lab.docx":ZG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Agents Need Governors.docx":QG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Benchmarks Meet Budgets.docx":JG,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Capability and Reliability Diverge.docx":eV,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Efficiency Becomes Governance(1).docx":tV,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Governance Becomes the Product.docx":nV,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Infrastructure Constraints Birth Governance Innovation.docx":rV,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Reliability Engineering Supersedes Model Intelligence.docx":iV,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Robots Work and Agents Don_t.docx":sV,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Sparse Becomes Sufficient.docx":oV,"/batch3/Theory-Practice Synthesis_ Feb 20, 2026 - When Telecom Infrastructure Becomes More Relevant Than Model Advances.docx":aV,"/batch3/Theory-Practice Synthesis_ Feb 2026 - The Infrastructure Layer That Will Determine Agent Sovereignty.docx":lV,"/batch3/Theory-Practice Synthesis_ Feb 2026 - When Agent Autonomy Meets the Audit Trail.docx":cV,"/batch3/Theory-Practice Synthesis_ Feb 2026 - When Agent Reliability Science Meets Production Reality.docx":uV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - Computational Sovereignty.docx":hV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - The 77_ Paradox.docx":dV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - The Autonomy Paradox.docx":fV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - The Coordination Infrastructure Inflection.docx":pV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - The Governance Trilemma.docx":mV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - When AI Theory Meets Production Reality.docx":gV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - When Agentic AI Meets The Reality Tax.docx":yV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - When Agentic AI Theory Meets the Governance Wall.docx":vV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - When Agents Stop Averaging and Start Deciding.docx":_V,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - When Compression Meets Trust.docx":xV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - When Coordination Becomes Containment.docx":SV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - When Theory Becomes Infrastructure.docx":bV,"/batch3/Theory-Practice Synthesis_ Feb 21, 2026 - When Vibe Coding Met Production Reality.docx":wV,"/batch3/Theory-Practice Synthesis_ Feb 22 2026 - When Velocity Meets Governance.docx":TV,"/batch3/Theory-Practice Synthesis_ Feb 22, 2026 - Agentic Infrastructure at the Inflection Point.docx":MV,"/batch3/Theory-Practice Synthesis_ Feb 22, 2026 - Agentic Infrastructure.docx":EV,"/batch3/Theory-Practice Synthesis_ Feb 22, 2026 - The Autonomy Paradox.docx":AV,"/batch3/Theory-Practice Synthesis_ Feb 22, 2026 - The Non-Delegation Paradox.docx":CV,"/batch3/Theory-Practice Synthesis_ Feb 22, 2026 - When Agents Learn to Calibrate Themselves.docx":PV,"/batch3/Theory-Practice Synthesis_ Feb 22, 2026 - When Constraints Become Architecture.docx":RV,"/batch3/Theory-Practice Synthesis_ Feb 22, 2026 - When Governance Becomes Infrastructure.docx":IV,"/batch3/Theory-Practice Synthesis_ Feb 22, 2026 - When Organization Becomes Infrastructure.docx":LV,"/batch3/Theory-Practice Synthesis_ February 19, 2026 - The Reliability Reckoning.docx":FV,"/batch3/Theory-Practice Synthesis_ February 19, 2026 - When AI Deployment Shifts From _Does It Work_ to _Can We Rely On It_.docx":NV,"/batch3/Theory-Practice Synthesis_ February 20, 2026 - When Capability Diverged From Reliability.docx":DV,"/batch3/Theory-Practice Synthesis_ February 20, 2026 - When Infrastructure Efficiency Becomes Governance Capability.docx":OV,"/batch3/Theory-Practice Synthesis_ February 20, 2026 - When Organizations Become Code.docx":UV,"/batch3/Theory-Practice Synthesis_ February 20, 2026 - When Selective Attention Becomes Infrastructure.docx":kV,"/batch3/Theory-Practice Synthesis_ February 2026 - When AI Systems Learn to Optimize Themselves.docx":BV,"/batch3/Theory-Practice Synthesis_ February 2026 - When Agent Capability Outpaced Agent Reliability.docx":zV,"/batch3/Theory-Practice Synthesis_ February 2026 - When Agent Infrastructure Meets Regulatory Reality.docx":WV,"/batch3/Theory-Practice Synthesis_ February 2026 - When Optimization Migrates from Compute to Economics.docx":HV,"/batch3/Theory-Practice Synthesis_ February 2026 - When _Human Control_ Became the Anchor, Not the Answer.docx":GV,"/batch3/Theory-Practice Synthesis_ February 21, 2026 - When AI Systems Develop Economic Consciousness.docx":VV,"/batch3/Theory-Practice Synthesis_ February 21, 2026 - When Agents Go to Work.docx":jV,"/batch3/Theory-Practice Synthesis_ February 21, 2026 - When Governance Becomes the Coordination Protocol.docx":XV,"/batch3/Theory-Practice Synthesis_ February 21, 2026 - When Runtime Governance Becomes Economic Reality.docx":YV,"/batch3/Theory-Practice Synthesis_ February 22, 2026 - When Agent Autonomy Met Enterprise Reality.docx":qV,"/batch3/Theory-Practice Synthesis_ February 22, 2026 - When Governance Becomes Infrastructure.docx":$V,"/batch3/Theory-Practice Synthesis_ February 22, 2026 - When Silent Coordination Outperforms Conversation.docx":KV,"/batch4/Theory-Practice Synthesis_ Feb 19 2026 - The Science of Agent Reliability.docx":ZV,"/batch4/Theory-Practice Synthesis_ Feb 19, 2026 - The Operationalization Paradox in Agentic AI.docx":QV,"/batch4/Theory-Practice Synthesis_ Feb 19, 2026 - The Reliability Paradox.docx":JV,"/batch4/Theory-Practice Synthesis_ Feb 19, 2026 - When AI Agent Theory Predicts the 40_ Enterprise Failure Rate.docx":e8,"/batch4/Theory-Practice Synthesis_ Feb 19, 2026 - When Agent Reliability Science Meets Enterprise Reality.docx":t8,"/batch4/Theory-Practice Synthesis_ Feb 19, 2026 - When Capability Diverges from Reliability.docx":n8,"/batch4/Theory-Practice Synthesis_ Feb 19, 2026 - When Capability Saturates, Governance Emerges.docx":r8,"/batch4/Theory-Practice Synthesis_ Feb 19, 2026 - When Efficiency Met Embodiment.docx":i8,"/batch4/Theory-Practice Synthesis_ Feb 20, 2026 - Infrastructure as Philosophy.docx":s8,"/batch4/Theory-Practice Synthesis_ Feb 20, 2026 - The 88_ Financial AI Deployment Paradox.docx":o8,"/batch4/Theory-Practice Synthesis_ Feb 20, 2026 - The Headline Is Wrong_ Why 60_ Cheaper Agents Miss the Real Cost of Agentic AI.docx":a8,"/batch4/Theory-Practice Synthesis_ Feb 20, 2026 - The Inflection Point Where Agent Theory Meets Workforce Reality.docx":l8,"/batch4/Theory-Practice Synthesis_ Feb 20, 2026 - When AI Theory Becomes Infrastructure.docx":c8,"/batch4/Theory-Practice Synthesis_ Feb 20, 2026 - When Capability Meets Accountability.docx":u8,"/batch4/Theory-Practice Synthesis_ Feb 20, 2026 - When Capability Met Reliability.docx":h8,"/batch4/Theory-Practice Synthesis_ Feb 20, 2026 - When Theory Meets Reality.docx":d8,"/batch4/Theory-Practice Synthesis_ February 19, 2026 - The Capability-Reliability Decoupling.docx":f8});function m8(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function g8(n){if(/^\d{4}-\d{2}-\d{2}$/.test(n))return n;const e={jan:"01",feb:"02",mar:"03",apr:"04",may:"05",jun:"06",jul:"07",aug:"08",sep:"09",oct:"10",nov:"11",dec:"12"},t=n.match(/^(\w+)\s+(\d{1,2}),?\s+(\d{4})$/);if(t){const s=e[t[1].toLowerCase().slice(0,3)],o=t[2].padStart(2,"0");return`${t[3]}-${s}-${o}`}const r=n.match(/^(\w+)\s+(\d{4})$/);if(r){const s=e[r[1].toLowerCase().slice(0,3)];return`${r[2]}-${s}-20`}const i=n.match(/^(\d{1,2})[\/_](\d{1,2})[\/_](\d{4})$/);return i?`${i[3]}-${i[1].padStart(2,"0")}-${i[2].padStart(2,"0")}`:"2026-02-20"}const y3={},HS=[],hM=new Set;for(const[n,e]of Object.entries(p8)){const t=n.match(/ - (.+)\.docx$/);if(!t)continue;const r=t[1].replace(/\s*\(\d+\)$/,"").trim(),i=m8(r);if(hM.has(i))continue;hM.add(i),y3[i]=e;const s=n.match(/Synthesis_\s*(.+?)\s*-\s*.+\.docx$/),o=s?s[1].trim():"Feb 2026",a=g8(o);HS.push({slug:i,title:r,date:a,url:e})}console.debug(`[docxLoader] ${HS.length} docx files mapped`);function y8(n){return y3[n]}function v8(){return HS}function De(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}const v3=[{id:0,docCount:15,topTerms:["ai","haif","governance","coordination","agent","agents","agentic","4c","theory","2026","human","oversight"]},{id:1,docCount:23,topTerms:["reliability","cooperation","agent","rynnbrain","sla2","ai","princeton","attention","sparse","production","embodied","agents"]},{id:2,docCount:45,topTerms:["agents","agent","cost","transparency","gui","trust","ai","coordination","theory","alphaevolve","calibrate","systems"]},{id:3,docCount:16,topTerms:["vespo","sage","sarah","ai","spatial","reasoning","training","systems","stability","generated reality","production","inference"]},{id:4,docCount:45,topTerms:["cost","agents","attention","agent","sparse","gui","ai","sparse attention","theory","latents","spargeattention2","production"]},{id:5,docCount:13,topTerms:["glm","agent","readmes","agent readmes","context files","mem0","memory","governance","files","agents","ai","security"]},{id:6,docCount:37,topTerms:["ai","governance","agent","theory","systems","human","agents","infrastructure","2026","practice","model","coordination"]},{id:7,docCount:11,topTerms:["coordination","agent","ai","governance","secp","byzantine","agents","systems","invariants","formal","self modification","multi"]},{id:8,docCount:26,topTerms:["reliability","agent","cooperation","agents","ai","personalization","embodied","pahf","rynnbrain","theory","feedback","models"]},{id:9,docCount:41,topTerms:["rein","recovery","vespo","ai","reasoning","sarah","spatial","error recovery","sage","systems","training","error"]},{id:10,docCount:34,topTerms:["agent","agents","ai","coordination","governance","systems","multi","multi agent","theory","agentic","production","2026"]},{id:11,docCount:7,topTerms:["skillorchestra","skill","agents chaos","dsdr","agents","agent","topreward","reasoning","diversity","vbvr","chaos","security"]}],_3=[{slug:De("Infrastructure as Philosophy"),title:"Infrastructure as Philosophy",date:"2026-02-20",cluster:1,score:.883,wordCount:3466,arxivCount:5,lanes:["Infrastructure","Reliability","Coordination"]},{slug:De("When Theory Becomes Infrastructure"),title:"When Theory Becomes Infrastructure",date:"2026-02-21",cluster:4,score:.857,wordCount:3400,arxivCount:5,lanes:["Economics","Infrastructure","Coordination"]},{slug:De("When Deployment Velocity Outpaces Safety Science"),title:"When Deployment Velocity Outpaces Safety Science",date:"2026-02-19",cluster:8,score:.817,wordCount:2810,arxivCount:5,lanes:["Infrastructure","Reliability","Coordination"]},{slug:De("Efficiency, Trust, and the Operationalization Gap"),title:"Efficiency, Trust, and the Operationalization Gap",date:"2026-02-20",cluster:2,score:.81,wordCount:3541,arxivCount:0,lanes:["Infrastructure","Economics","Reliability"]},{slug:De("When Cognitive Architecture Meets Production Reality"),title:"When Cognitive Architecture Meets Production Reality",date:"2026-02-24",cluster:11,score:.804,wordCount:3128,arxivCount:5,lanes:["Infrastructure","Coordination","Governance"]},{slug:De("The 85% Governance Debt"),title:"The 85% Governance Debt",date:"2026-02-25",cluster:5,score:.798,wordCount:2732,arxivCount:3,lanes:["Infrastructure","Governance","Institutions"]},{slug:De("When Intelligence Meets Economics"),title:"When Intelligence Meets Economics",date:"2026-02-23",cluster:3,score:.795,wordCount:3189,arxivCount:4,lanes:["Infrastructure","Governance","Economics"]},{slug:De("The Coordination Turn"),title:"The Coordination Turn",date:"2026-02-25",cluster:3,score:.795,wordCount:2823,arxivCount:4,lanes:["Infrastructure","Coordination","Governance"]},{slug:De("When Agents Get Smarter But Not More Trustworthy"),title:"When Agents Get Smarter But Not More Trustworthy",date:"2026-02-19",cluster:1,score:.787,wordCount:3140,arxivCount:3,lanes:["Infrastructure","Reliability","Governance"]},{slug:De("The Coordination Inflection"),title:"The Coordination Inflection",date:"2026-02-24",cluster:0,score:.785,wordCount:3207,arxivCount:4,lanes:["Coordination","Infrastructure","Reliability"]},{slug:De("The Operationalization Paradox in Agentic AI"),title:"The Operationalization Paradox in Agentic AI",date:"2026-02-19",cluster:8,score:.784,wordCount:3457,arxivCount:5,lanes:["Infrastructure","Reliability","Coordination"]},{slug:De("The Implicit Knowledge Economy"),title:"The Implicit Knowledge Economy",date:"2026-02-23",cluster:3,score:.78,wordCount:3427,arxivCount:3,lanes:["Infrastructure","Economics","Metacognition"]},{slug:De("When Agents Leave the Benchmark"),title:"When Agents Leave the Benchmark",date:"2026-02-19",cluster:8,score:.778,wordCount:3190,arxivCount:4,lanes:["Infrastructure","Reliability","Coordination"]},{slug:De("When Theory Meets the Datacenter Floor"),title:"When Theory Meets the Datacenter Floor",date:"2026-02-23",cluster:3,score:.776,wordCount:3759,arxivCount:3,lanes:["Infrastructure","Coordination","Economics"]},{slug:De("When Reliability Engineering Supersedes Model Intelligence"),title:"When Reliability Engineering Supersedes Model Intelligence",date:"2026-02-20",cluster:4,score:.774,wordCount:3037,arxivCount:5,lanes:["Infrastructure","Economics","Coordination"]},{slug:De("Computational Sovereignty"),title:"Computational Sovereignty",date:"2026-02-21",cluster:4,score:.762,wordCount:3457,arxivCount:3,lanes:["Infrastructure","Coordination","Governance"]},{slug:De("When Organization Becomes Infrastructure"),title:"When Organization Becomes Infrastructure",date:"2026-02-22",cluster:10,score:.758,wordCount:3162,arxivCount:3,lanes:["Infrastructure","Coordination","Governance"]},{slug:De("The Capability Maturity Gap"),title:"The Capability Maturity Gap",date:"2026-02-24",cluster:6,score:.753,wordCount:2995,arxivCount:3,lanes:["Infrastructure","Coordination","Governance"]},{slug:De("Agent Reliability & Coordination"),title:"Agent Reliability & Coordination",date:"2026-02-23",cluster:10,score:.746,wordCount:4167,arxivCount:5,lanes:["Infrastructure","Coordination","Reliability"]},{slug:De("When Agents Leave the Lab"),title:"When Agents Leave the Lab",date:"2026-02-20",cluster:4,score:.746,wordCount:3740,arxivCount:5,lanes:["Infrastructure","Economics","Reliability"]},{slug:De("When Institutions Become Code"),title:"When Institutions Become Code",date:"2026-02-24",cluster:10,score:.745,wordCount:3198,arxivCount:3,lanes:["Infrastructure","Governance","Reliability"]},{slug:De("When Systems Learn What Practice Already Knew"),title:"When Systems Learn What Practice Already Knew",date:"2026-02-24",cluster:9,score:.743,wordCount:3381,arxivCount:5,lanes:["Infrastructure","Governance","Economics"]},{slug:De("Memory Architecture Revolution"),title:"Memory Architecture Revolution",date:"2026-02-24",cluster:10,score:.741,wordCount:3075,arxivCount:4,lanes:["Infrastructure","Coordination","Economics"]},{slug:De("The Orchestration Inflection Point"),title:"The Orchestration Inflection Point",date:"2026-02-20",cluster:8,score:.74,wordCount:2942,arxivCount:5,lanes:["Infrastructure","Coordination","Reliability"]},{slug:De("The Cost-Conscious Singularity"),title:"The Cost-Conscious Singularity",date:"2026-02-20",cluster:4,score:.74,wordCount:3027,arxivCount:5,lanes:["Economics","Infrastructure","Reliability"]},{slug:De("The 10-Step Ceiling"),title:"The 10-Step Ceiling",date:"2026-02-20",cluster:6,score:.739,wordCount:3459,arxivCount:1,lanes:["Infrastructure","Reliability","Economics"]},{slug:De("The Reliability Inflection"),title:"The Reliability Inflection",date:"2026-02-24",cluster:8,score:.739,wordCount:3112,arxivCount:5,lanes:["Infrastructure","Reliability","Coordination"]},{slug:De("The Capability Overhang"),title:"The Capability Overhang",date:"2026-02-20",cluster:8,score:.737,wordCount:3357,arxivCount:4,lanes:["Infrastructure","Reliability","Coordination"]},{slug:De("Sovereignty-Preserving Coordination"),title:"Sovereignty-Preserving Coordination",date:"2026-02-23",cluster:3,score:.737,wordCount:2910,arxivCount:3,lanes:["Infrastructure","Governance","Coordination"]},{slug:De("When Agents Need Governors"),title:"When Agents Need Governors",date:"2026-02-20",cluster:6,score:.732,wordCount:3419,arxivCount:2,lanes:["Governance","Infrastructure","Economics"]},{slug:De("The Reliability Paradox"),title:"The Reliability Paradox",date:"2026-02-19",cluster:1,score:.73,wordCount:2934,arxivCount:4,lanes:["Reliability","Infrastructure","Coordination"]},{slug:De("The Validation Paradox in Agentic AI"),title:"The Validation Paradox in Agentic AI",date:"2026-02-20",cluster:0,score:.729,wordCount:3589,arxivCount:4,lanes:["Infrastructure","Governance","Reliability"]},{slug:De("When Theory Becomes Economics"),title:"When Theory Becomes Economics",date:"2026-02-23",cluster:4,score:.729,wordCount:3334,arxivCount:6,lanes:["Economics","Infrastructure","Governance"]},{slug:De("The Orchestration Imperative"),title:"The Orchestration Imperative",date:"2026-02-20",cluster:2,score:.728,wordCount:2884,arxivCount:4,lanes:["Coordination","Infrastructure","Governance"]},{slug:De("The Reliability-Capability Paradox"),title:"The Reliability-Capability Paradox",date:"2026-02-20",cluster:8,score:.727,wordCount:3877,arxivCount:5,lanes:["Infrastructure","Reliability","Governance"]},{slug:De("When Vibe Coding Met Production Reality"),title:"When Vibe Coding Met Production Reality",date:"2026-02-21",cluster:5,score:.726,wordCount:3062,arxivCount:3,lanes:["Infrastructure","Governance","Economics"]},{slug:De("When AI Agent Theory Predicts the 40% Enterprise Failure Rate"),title:"When AI Agent Theory Predicts the 40% Enterprise Failure Rate",date:"2026-02-19",cluster:8,score:.724,wordCount:2687,arxivCount:5,lanes:["Infrastructure","Reliability","Coordination"]},{slug:De("Philosophy as Infrastructure"),title:"Philosophy as Infrastructure",date:"2026-02-23",cluster:0,score:.722,wordCount:3293,arxivCount:3,lanes:["Infrastructure","Governance","Coordination"]},{slug:De("The Inference-Time Intelligence Paradigm"),title:"The Inference-Time Intelligence Paradigm",date:"2026-02-23",cluster:3,score:.722,wordCount:3357,arxivCount:4,lanes:["Infrastructure","Governance","Economics"]},{slug:De("The 89% Deployment Crisis"),title:"The 89% Deployment Crisis",date:"2026-02-20",cluster:2,score:.72,wordCount:3868,arxivCount:1,lanes:["Infrastructure","Reliability","Economics"]},{slug:De("When Research Becomes Infrastructure"),title:"When Research Becomes Infrastructure",date:"2026-02-23",cluster:6,score:.717,wordCount:3474,arxivCount:2,lanes:["Infrastructure","Governance","Institutions"]},{slug:De("When Agent Theory Met Production Reality"),title:"When Agent Theory Met Production Reality",date:"2026-02-22",cluster:2,score:.713,wordCount:3144,arxivCount:5,lanes:["Infrastructure","Governance","Coordination"]},{slug:De("The Profitability Inflection"),title:"The Profitability Inflection",date:"2026-02-23",cluster:2,score:.71,wordCount:3852,arxivCount:5,lanes:["Economics","Coordination","Infrastructure"]},{slug:De("When AI Learns Its Own Limits"),title:"When AI Learns Its Own Limits",date:"2026-02-24",cluster:9,score:.709,wordCount:3246,arxivCount:4,lanes:["Infrastructure","Governance","Reliability"]},{slug:De("The Operationalization Paradox"),title:"The Operationalization Paradox",date:"2026-02-20",cluster:2,score:.707,wordCount:3643,arxivCount:5,lanes:["Infrastructure","Coordination","Economics"]},{slug:De("Multi-Agent Governance Architecture"),title:"Multi-Agent Governance Architecture",date:"2026-02-24",cluster:7,score:.707,wordCount:3521,arxivCount:4,lanes:["Governance","Infrastructure","Coordination"]},{slug:De("The Governance-Autonomy Paradox"),title:"The Governance-Autonomy Paradox",date:"2026-02-20",cluster:2,score:.706,wordCount:3255,arxivCount:4,lanes:["Infrastructure","Reliability","Governance"]},{slug:De("The Reliability Valley in Enterprise AI Agents"),title:"The Reliability Valley in Enterprise AI Agents",date:"2026-02-19",cluster:8,score:.706,wordCount:3110,arxivCount:3,lanes:["Infrastructure","Reliability","Coordination"]},{slug:De("The Latent Governance Capabilities AI Systems Already Possess"),title:"The Latent Governance Capabilities AI Systems Already Possess",date:"2026-02-24",cluster:9,score:.705,wordCount:3581,arxivCount:4,lanes:["Infrastructure","Governance","Reliability"]},{slug:De("When Agents Forget"),title:"When Agents Forget",date:"2026-02-23",cluster:0,score:.705,wordCount:2786,arxivCount:3,lanes:["Infrastructure","Governance","Coordination"]},{slug:De("When Coordination Becomes Infrastructure"),title:"When Coordination Becomes Infrastructure",date:"2026-02-24",cluster:0,score:.677,wordCount:3041,arxivCount:0,lanes:["Coordination","Infrastructure","Governance"]},{slug:De("The Coordination Governance Inflection Point"),title:"The Coordination Governance Inflection Point",date:"2026-02-23",cluster:0,score:.669,wordCount:3045,arxivCount:0,lanes:["Coordination","Governance","Infrastructure"]},{slug:De("When Capability Meets Accountability"),title:"When Capability Meets Accountability",date:"2026-02-20",cluster:1,score:.692,wordCount:2739,arxivCount:0,lanes:["Infrastructure","Reliability","Governance"]},{slug:De("When Capability Saturates, Governance Emerges"),title:"When Capability Saturates, Governance Emerges",date:"2026-02-19",cluster:1,score:.679,wordCount:3206,arxivCount:0,lanes:["Governance","Infrastructure","Reliability"]},{slug:De("The Deployment Wall"),title:"The Deployment Wall",date:"2026-02-20",cluster:1,score:.673,wordCount:4430,arxivCount:0,lanes:["Infrastructure","Reliability","Economics"]},{slug:De("The Coordination Crisis in Agentic Systems"),title:"The Coordination Crisis in Agentic Systems",date:"2026-02-24",cluster:5,score:.7,wordCount:2741,arxivCount:0,lanes:["Coordination","Infrastructure","Governance"]},{slug:De("The Sovereignty Paradox in Agentic AI"),title:"The Sovereignty Paradox in Agentic AI",date:"2026-02-23",cluster:5,score:.643,wordCount:3032,arxivCount:0,lanes:["Governance","Infrastructure","Coordination"]},{slug:De("When Infrastructure Becomes Intelligence"),title:"When Infrastructure Becomes Intelligence",date:"2026-02-24",cluster:5,score:.639,wordCount:2341,arxivCount:0,lanes:["Infrastructure","Governance","Economics"]},{slug:De("The Guardrail Deficit"),title:"The Guardrail Deficit",date:"2026-02-24",cluster:5,score:.637,wordCount:2624,arxivCount:0,lanes:["Governance","Infrastructure","Reliability"]},{slug:De("The Convergence Moment"),title:"The Convergence Moment",date:"2026-02-20",cluster:6,score:.703,wordCount:3761,arxivCount:0,lanes:["Infrastructure","Coordination","Economics"]},{slug:De("When Governance Becomes Infrastructure"),title:"When Governance Becomes Infrastructure",date:"2026-02-22",cluster:6,score:.702,wordCount:2571,arxivCount:0,lanes:["Governance","Infrastructure","Coordination"]},{slug:De("Governance as Substrate"),title:"Governance as Substrate",date:"2026-02-23",cluster:7,score:.702,wordCount:3044,arxivCount:0,lanes:["Governance","Coordination","Infrastructure"]},{slug:De("When Coordination Becomes Containment"),title:"When Coordination Becomes Containment",date:"2026-02-21",cluster:7,score:.694,wordCount:2800,arxivCount:0,lanes:["Coordination","Governance","Infrastructure"]},{slug:De("When Coordination Becomes Constitution"),title:"When Coordination Becomes Constitution",date:"2026-02-23",cluster:7,score:.682,wordCount:3021,arxivCount:0,lanes:["Coordination","Governance","Infrastructure"]},{slug:De("The Coordination Paradox"),title:"The Coordination Paradox",date:"2026-02-20",cluster:7,score:.681,wordCount:2833,arxivCount:0,lanes:["Coordination","Infrastructure","Governance"]},{slug:De("When Silent Coordination Outperforms Conversation"),title:"When Silent Coordination Outperforms Conversation",date:"2026-02-22",cluster:7,score:.655,wordCount:3103,arxivCount:0,lanes:["Coordination","Infrastructure","Governance"]},{slug:De("AI Self-Awareness & Human-Centric Coordination"),title:"AI Self-Awareness & Human-Centric Coordination",date:"2026-02-24",cluster:9,score:.694,wordCount:3633,arxivCount:0,lanes:["Infrastructure","Governance","Coordination"]},{slug:De("The Hidden Capability Paradigm"),title:"The Hidden Capability Paradigm",date:"2026-02-24",cluster:9,score:.692,wordCount:3535,arxivCount:0,lanes:["Infrastructure","Governance","Economics"]},{slug:De("When Machines Learn to Doubt"),title:"When Machines Learn to Doubt",date:"2026-02-23",cluster:9,score:.683,wordCount:3460,arxivCount:0,lanes:["Infrastructure","Metacognition","Governance"]},{slug:De("When Coordination Became the Constraint"),title:"When Coordination Became the Constraint",date:"2026-02-24",cluster:10,score:.697,wordCount:3422,arxivCount:0,lanes:["Coordination","Infrastructure","Governance"]},{slug:De("When Agents Stop Averaging and Start Deciding"),title:"When Agents Stop Averaging and Start Deciding",date:"2026-02-21",cluster:10,score:.692,wordCount:3455,arxivCount:0,lanes:["Infrastructure","Coordination","Governance"]},{slug:De("Agentic AI Convergence"),title:"Agentic AI Convergence",date:"2026-02-24",cluster:11,score:.675,wordCount:2838,arxivCount:0,lanes:["Infrastructure","Coordination","Governance"]},{slug:De("When Agent Governance Stops Being Theoretical"),title:"When Agent Governance Stops Being Theoretical",date:"2026-02-25",cluster:11,score:.647,wordCount:3384,arxivCount:0,lanes:["Governance","Infrastructure","Coordination"]},{slug:De("When Autonomy Meets Accountability"),title:"When Autonomy Meets Accountability",date:"2026-02-24",cluster:11,score:.614,wordCount:3016,arxivCount:0,lanes:["Governance","Infrastructure","Coordination"]},{slug:De("When Agents Know What They Don't Know"),title:"When Agents Know What They Don't Know",date:"2026-02-24",cluster:11,score:.586,wordCount:3005,arxivCount:0,lanes:["Infrastructure","Metacognition","Governance"]},{slug:De("When Bounded Autonomy Meets Production Reality"),title:"When Bounded Autonomy Meets Production Reality",date:"2026-02-24",cluster:11,score:.574,wordCount:3699,arxivCount:0,lanes:["Infrastructure","Governance","Coordination"]}],_8=new Set(_3.map(n=>n.slug)),x8=v8(),S8=x8.filter(n=>!_8.has(n.slug)).map(n=>({slug:n.slug,title:n.title,date:n.date,cluster:6,score:.6,wordCount:3e3,arxivCount:0,lanes:["Infrastructure","Governance","Coordination"]})),gu=[..._3,...S8],b8=["Infrastructure","Reliability","Coordination","Governance","Economics","Institutions","Metacognition"],D2=v3.reduce((n,e)=>n+e.docCount,0);function w8(n,e){return n.filter(t=>t.lanes.includes(e))}function T8(n,e){return n.filter(t=>t.cluster===e)}function M8(n,e){const t=[...n];switch(e){case"score":return t.sort((r,i)=>i.score-r.score);case"date":return t.sort((r,i)=>i.date.localeCompare(r.date));case"wordCount":return t.sort((r,i)=>i.wordCount-r.wordCount);default:return t}}function E8(n){return gu.find(e=>e.slug===n)}function A8(n,e=5){return gu.filter(t=>t.cluster===n.cluster&&t.slug!==n.slug).sort((t,r)=>r.score-t.score).slice(0,e)}function C8(n=5){return[...gu].sort((e,t)=>t.score-e.score).slice(0,n)}function x3(n){const e=new Date(n).getMonth(),t=Math.floor(e/3)+1,r=new Date(n).getFullYear();return`Q${t} ${r}`}const P8=()=>{const n=C8(5);return L.jsx("section",{id:"corpus-section",className:"relative z-10 py-24 px-6 bg-background/85 min-h-[50vh]",children:L.jsxs("div",{className:"max-w-5xl mx-auto",children:[L.jsx("h2",{className:"text-3xl md:text-4xl font-serif mb-2",children:"Research Corpus"}),L.jsxs("p",{className:"text-sm text-muted-foreground mb-10",children:[D2," synthesized papers · 12 clusters · 7 lanes · Feb 19–25, 2026"]}),L.jsx("div",{className:"space-y-0 border-t border-foreground/10",children:n.map(e=>L.jsxs(Ki,{to:`/research/${e.slug}`,className:"flex items-baseline justify-between py-4 border-b border-foreground/10 group hover:bg-muted/30 transition-colors px-2 -mx-2",children:[L.jsx("span",{className:"font-serif text-base group-hover:text-foreground/70 transition-colors",children:e.title}),L.jsx("span",{className:"text-xs font-mono text-muted-foreground ml-4 shrink-0",children:e.score.toFixed(3)})]},e.slug))}),L.jsx("div",{className:"mt-8",children:L.jsx(Ki,{to:"/research",className:"text-xs tracking-[0.15em] uppercase border border-foreground/20 px-4 py-2 text-foreground hover:bg-foreground hover:text-primary-foreground transition-colors duration-300 inline-block",children:"Browse the full corpus →"})})]})})},R8=()=>{const[n,e]=D.useState(!1);return D.useEffect(()=>{if(n&&!document.querySelector('script[src="https://links.promptedllc.com/js/form_embed.js"]')){const r=document.createElement("script");r.src="https://links.promptedllc.com/js/form_embed.js",r.async=!0,document.body.appendChild(r)}},[n]),L.jsx("section",{id:"contact",className:"relative z-10 py-32 px-6 bg-surface-deep/95 text-surface-deep-foreground min-h-[50vh]",children:L.jsxs("div",{className:"max-w-lg mx-auto text-center",children:[L.jsx("h2",{className:"text-sm uppercase tracking-[0.3em] text-surface-deep-foreground/50 mb-12",children:"Contact"}),L.jsx("h3",{className:"text-2xl font-serif font-light text-surface-deep-foreground/80 mb-8",children:"Breyden Taylor"}),L.jsxs("div",{className:"space-y-4 text-sm tracking-wide",children:[L.jsx("p",{children:L.jsx("a",{href:"mailto:breyden@prompted.community",className:"hover:text-primary-foreground transition-colors duration-300 underline underline-offset-4 decoration-surface-deep-foreground/20",children:"breyden@prompted.community"})}),L.jsxs("p",{children:["GitHub:"," ",L.jsx("a",{href:"https://github.com/prompted365",target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary-foreground transition-colors duration-300 underline underline-offset-4 decoration-surface-deep-foreground/20",children:"prompted365"})]}),L.jsxs("p",{children:["LinkedIn:"," ",L.jsx("a",{href:"https://www.linkedin.com/in/breyden-taylor/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary-foreground transition-colors duration-300 underline underline-offset-4 decoration-surface-deep-foreground/20",children:"Breyden Taylor"})]})]}),L.jsx("div",{className:"mt-16",children:n?L.jsx("div",{className:"mt-4",children:L.jsx("iframe",{src:"https://links.promptedllc.com/widget/form/FfPK9U5duYlnKXEhCFbB",style:{width:"100%",height:"550px",border:"none",borderRadius:"0px"},id:"inline-FfPK9U5duYlnKXEhCFbB","data-layout":'{"id":"INLINE"}',"data-trigger-type":"alwaysShow","data-trigger-value":"","data-activation-type":"alwaysActivated","data-activation-value":"","data-deactivation-type":"neverDeactivate","data-deactivation-value":"","data-form-name":"Lead Generation","data-height":"550","data-layout-iframe-id":"inline-FfPK9U5duYlnKXEhCFbB","data-form-id":"FfPK9U5duYlnKXEhCFbB",title:"Lead Generation"})}):L.jsx("button",{onClick:()=>e(!0),className:"inline-block px-8 py-3 border border-surface-deep-foreground/20 text-surface-deep-foreground text-sm tracking-widest uppercase hover:bg-surface-deep-foreground/10 transition-colors duration-300",children:"Start a Conversation"})})]})})},I8=()=>L.jsxs("svg",{viewBox:"0 0 200 200",className:"w-32 h-32 mx-auto",xmlns:"http://www.w3.org/2000/svg",children:[L.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.5"}),L.jsx("circle",{cx:"100",cy:"100",r:"60",fill:"none",stroke:"currentColor",strokeWidth:"1",opacity:"0.4"}),L.jsx("line",{x1:"100",y1:"10",x2:"100",y2:"190",stroke:"currentColor",strokeWidth:"0.8",opacity:"0.35"}),L.jsx("line",{x1:"10",y1:"100",x2:"190",y2:"100",stroke:"currentColor",strokeWidth:"0.8",opacity:"0.35"}),L.jsx("line",{x1:"36",y1:"36",x2:"164",y2:"164",stroke:"currentColor",strokeWidth:"0.8",opacity:"0.25"}),L.jsx("line",{x1:"164",y1:"36",x2:"36",y2:"164",stroke:"currentColor",strokeWidth:"0.8",opacity:"0.25"})]}),lg=()=>L.jsxs("footer",{className:"relative py-24 px-6 bg-surface-deep",children:[L.jsxs("div",{className:"max-w-lg mx-auto text-center",children:[L.jsx(I8,{}),L.jsx("p",{className:"mt-8 text-xs tracking-[0.2em] text-surface-deep-foreground/25 italic font-serif",children:"Accès aux couches inférieures"}),L.jsx("p",{className:"mt-16 text-xs tracking-[0.15em] text-surface-deep-foreground/20",children:"© 2022–2026 Prompted LLC. All rights reserved."})]}),L.jsx("a",{href:"https://gas.promptedllc.com",target:"_blank",rel:"noopener noreferrer",className:"absolute bottom-6 right-6 text-surface-deep-foreground/20 hover:text-surface-deep-foreground/40 transition-colors","aria-label":"Gas — Prompted LLC",children:L.jsxs("svg",{viewBox:"0 0 32 32",className:"w-5 h-5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("rect",{x:"4",y:"8",width:"14",height:"18",rx:"1"}),L.jsx("rect",{x:"7",y:"11",width:"8",height:"6",rx:"0.5"}),L.jsx("line",{x1:"11",y1:"20",x2:"11",y2:"22"}),L.jsx("path",{d:"M18 12h3a2 2 0 0 1 2 2v8a2 2 0 0 0 2 2v0a2 2 0 0 0 2-2V11l-3-3"}),L.jsx("line",{x1:"4",y1:"26",x2:"18",y2:"26"}),L.jsx("rect",{x:"9",y:"5",width:"4",height:"3",rx:"0.5"})]})})]}),S3="https://promptedllc.com",L8=`${S3}/og-image.png`,GS=({title:n,description:e="Infrastructure where accountability is encoded before the first action occurs.",path:t="/",type:r="website",publishedTime:i,keywords:s,wordCount:o,image:a})=>{const l=n?`${n} — Prompted Research`:"Prompted LLC — Governance as Substrate",h=`${S3}${t}`,d=a||L8;return L.jsxs(bS,{children:[L.jsx("title",{children:l}),L.jsx("meta",{name:"description",content:e}),L.jsx("link",{rel:"canonical",href:h}),s&&L.jsx("meta",{name:"keywords",content:s.join(", ")}),L.jsx("meta",{property:"og:title",content:l}),L.jsx("meta",{property:"og:description",content:e}),L.jsx("meta",{property:"og:url",content:h}),L.jsx("meta",{property:"og:type",content:r}),L.jsx("meta",{property:"og:image",content:d}),L.jsx("meta",{property:"og:site_name",content:"Prompted LLC"}),r==="article"&&i&&L.jsx("meta",{property:"article:published_time",content:i}),r==="article"&&L.jsx("meta",{property:"article:author",content:"Prompted LLC"}),r==="article"&&(s==null?void 0:s.map(f=>L.jsx("meta",{property:"article:tag",content:f},f))),L.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),L.jsx("meta",{name:"twitter:site",content:"@prompted365"}),L.jsx("meta",{name:"twitter:title",content:l}),L.jsx("meta",{name:"twitter:description",content:e}),L.jsx("meta",{name:"twitter:image",content:d}),o&&L.jsx("meta",{name:"citation_word_count",content:String(o)}),i&&L.jsx("meta",{name:"citation_publication_date",content:i}),L.jsx("meta",{name:"citation_author",content:"Prompted LLC"})]})};/**
* @license
* Copyright 2010-2023 Three.js Authors
* SPDX-License-Identifier: MIT
*/const cg="160",F8={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},N8={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},b3=0,O2=1,w3=2,D8=3,T3=0,ug=1,Vh=2,Bi=3,uo=0,Ar=1,xs=2,O8=2,no=0,hl=1,U2=2,k2=3,B2=4,M3=5,Wo=100,E3=101,A3=102,z2=103,W2=104,C3=200,P3=201,R3=202,I3=203,C0=204,P0=205,L3=206,F3=207,N3=208,D3=209,O3=210,U3=211,k3=212,B3=213,z3=214,W3=0,H3=1,G3=2,xd=3,V3=4,j3=5,X3=6,Y3=7,Jd=0,q3=1,$3=2,Ms=0,K3=1,Z3=2,Q3=3,VS=4,J3=5,eI=6,H2="attached",tI="detached",hg=300,ho=301,ma=302,Sd=303,bd=304,Lu=306,wd=1e3,pr=1001,Td=1002,bn=1003,R0=1004,U8=1004,jh=1005,k8=1005,Tn=1006,jS=1007,B8=1007,ga=1008,z8=1008,Es=1009,nI=1010,rI=1011,dg=1012,XS=1013,Js=1014,Xi=1015,yu=1016,YS=1017,qS=1018,sa=1020,iI=1021,Mr=1023,sI=1024,oI=1025,oa=1026,bl=1027,aI=1028,$S=1029,lI=1030,KS=1031,ZS=1033,Gm=33776,Vm=33777,jm=33778,Xm=33779,G2=35840,V2=35841,j2=35842,X2=35843,QS=36196,Y2=37492,q2=37496,$2=37808,K2=37809,Z2=37810,Q2=37811,J2=37812,ex=37813,tx=37814,nx=37815,rx=37816,ix=37817,sx=37818,ox=37819,ax=37820,lx=37821,Ym=36492,cx=36494,ux=36495,cI=36283,hx=36284,dx=36285,fx=36286,uI=2200,hI=2201,dI=2202,Md=2300,Ed=2301,qm=2302,Qa=2400,Ja=2401,Ad=2402,fg=2500,JS=2501,W8=0,H8=1,G8=2,e1=3e3,aa=3001,fI=3200,pI=3201,Sa=0,mI=1,ni="",Nn="srgb",Ps="srgb-linear",pg="display-p3",ef="display-p3-linear",Cd="linear",$t="srgb",Pd="rec709",Rd="p3",V8=0,Xa=7680,j8=7681,X8=7682,Y8=7683,q8=34055,$8=34056,K8=5386,Z8=512,Q8=513,J8=514,e9=515,t9=516,n9=517,r9=518,px=519,gI=512,yI=513,vI=514,t1=515,_I=516,xI=517,SI=518,bI=519,Id=35044,i9=35048,s9=35040,o9=35045,a9=35049,l9=35041,c9=35046,u9=35050,h9=35042,d9="100",mx="300 es",I0=1035,Yi=2e3,vu=2001;class mo{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(t)===-1&&r[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}}const lr=["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 dM=1234567;const dl=Math.PI/180,_u=180/Math.PI;function oi(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(lr[n&255]+lr[n>>8&255]+lr[n>>16&255]+lr[n>>24&255]+"-"+lr[e&255]+lr[e>>8&255]+"-"+lr[e>>16&15|64]+lr[e>>24&255]+"-"+lr[t&63|128]+lr[t>>8&255]+"-"+lr[t>>16&255]+lr[t>>24&255]+lr[r&255]+lr[r>>8&255]+lr[r>>16&255]+lr[r>>24&255]).toLowerCase()}function vn(n,e,t){return Math.max(e,Math.min(t,n))}function n1(n,e){return(n%e+e)%e}function f9(n,e,t,r,i){return r+(n-e)*(i-r)/(t-e)}function p9(n,e,t){return n!==e?(t-n)/(e-n):0}function Xh(n,e,t){return(1-t)*n+t*e}function m9(n,e,t,r){return Xh(n,e,1-Math.exp(-t*r))}function g9(n,e=1){return e-Math.abs(n1(n,e*2)-e)}function y9(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function v9(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function _9(n,e){return n+Math.floor(Math.random()*(e-n+1))}function x9(n,e){return n+Math.random()*(e-n)}function S9(n){return n*(.5-Math.random())}function b9(n){n!==void 0&&(dM=n);let e=dM+=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 w9(n){return n*dl}function T9(n){return n*_u}function gx(n){return(n&n-1)===0&&n!==0}function M9(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function L0(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function E9(n,e,t,r,i){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),h=s((e+r)/2),d=o((e+r)/2),f=s((e-r)/2),p=o((e-r)/2),m=s((r-e)/2),v=o((r-e)/2);switch(i){case"XYX":n.set(a*d,l*f,l*p,a*h);break;case"YZY":n.set(l*p,a*d,l*f,a*h);break;case"ZXZ":n.set(l*f,l*p,a*d,a*h);break;case"XZX":n.set(a*d,l*v,l*m,a*h);break;case"YXY":n.set(l*m,a*d,l*v,a*h);break;case"ZYZ":n.set(l*v,l*m,a*d,a*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Br(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Mt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const A9={DEG2RAD:dl,RAD2DEG:_u,generateUUID:oi,clamp:vn,euclideanModulo:n1,mapLinear:f9,inverseLerp:p9,lerp:Xh,damp:m9,pingpong:g9,smoothstep:y9,smootherstep:v9,randInt:_9,randFloat:x9,randFloatSpread:S9,seededRandom:b9,degToRad:w9,radToDeg:T9,isPowerOfTwo:gx,ceilPowerOfTwo:M9,floorPowerOfTwo:L0,setQuaternionFromProperEuler:E9,normalize:Mt,denormalize:Br};class ye{constructor(e=0,t=0){ye.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.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 t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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 t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(vn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const r=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*r-o*i+e.x,this.y=s*i+o*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class At{constructor(e,t,r,i,s,o,a,l,h){At.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,r,i,s,o,a,l,h)}set(e,t,r,i,s,o,a,l,h){const d=this.elements;return d[0]=e,d[1]=i,d[2]=a,d[3]=t,d[4]=s,d[5]=l,d[6]=r,d[7]=o,d[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}extractBasis(e,t,r){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[3],l=r[6],h=r[1],d=r[4],f=r[7],p=r[2],m=r[5],v=r[8],x=i[0],_=i[3],g=i[6],S=i[1],b=i[4],M=i[7],C=i[2],A=i[5],R=i[8];return s[0]=o*x+a*S+l*C,s[3]=o*_+a*b+l*A,s[6]=o*g+a*M+l*R,s[1]=h*x+d*S+f*C,s[4]=h*_+d*b+f*A,s[7]=h*g+d*M+f*R,s[2]=p*x+m*S+v*C,s[5]=p*_+m*b+v*A,s[8]=p*g+m*M+v*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],h=e[7],d=e[8];return t*o*d-t*a*h-r*s*d+r*a*l+i*s*h-i*o*l}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],h=e[7],d=e[8],f=d*o-a*h,p=a*l-d*s,m=h*s-o*l,v=t*f+r*p+i*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;return e[0]=f*x,e[1]=(i*h-d*r)*x,e[2]=(a*r-i*o)*x,e[3]=p*x,e[4]=(d*t-i*l)*x,e[5]=(i*s-a*t)*x,e[6]=m*x,e[7]=(r*l-h*t)*x,e[8]=(o*t-r*s)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,r,i,s,o,a){const l=Math.cos(s),h=Math.sin(s);return this.set(r*l,r*h,-r*(l*o+h*a)+o+e,-i*h,i*l,-i*(-h*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Cv.makeScale(e,t)),this}rotate(e){return this.premultiply(Cv.makeRotation(-e)),this}translate(e,t){return this.premultiply(Cv.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<9;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Cv=new At;function wI(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const C9={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Oc(n,e){return new C9[n](e)}function Ld(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function TI(){const n=Ld("canvas");return n.style.display="block",n}const fM={};function Yh(n){n in fM||(fM[n]=!0,console.warn(n))}const pM=new At().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),mM=new At().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Lp={[Ps]:{transfer:Cd,primaries:Pd,toReference:n=>n,fromReference:n=>n},[Nn]:{transfer:$t,primaries:Pd,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[ef]:{transfer:Cd,primaries:Rd,toReference:n=>n.applyMatrix3(mM),fromReference:n=>n.applyMatrix3(pM)},[pg]:{transfer:$t,primaries:Rd,toReference:n=>n.convertSRGBToLinear().applyMatrix3(mM),fromReference:n=>n.applyMatrix3(pM).convertLinearToSRGB()}},P9=new Set([Ps,ef]),Gt={enabled:!0,_workingColorSpace:Ps,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!P9.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const r=Lp[e].toReference,i=Lp[t].fromReference;return i(r(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Lp[n].primaries},getTransfer:function(n){return n===ni?Cd:Lp[n].transfer}};function Qc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Pv(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ql;class r1{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Ql===void 0&&(Ql=Ld("canvas")),Ql.width=e.width,Ql.height=e.height;const r=Ql.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),t=Ql}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Ld("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=Qc(s[o]/255)*255;return r.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let r=0;r<t.length;r++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[r]=Math.floor(Qc(t[r]/255)*255):t[r]=Qc(t[r]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let R9=0;class el{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:R9++}),this.uuid=oi(),this.data=e,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(Rv(i[o].image)):s.push(Rv(i[o]))}else s=Rv(i);r.url=s}return t||(e.images[this.uuid]=r),r}}function Rv(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?r1.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let I9=0;class Mn extends mo{constructor(e=Mn.DEFAULT_IMAGE,t=Mn.DEFAULT_MAPPING,r=pr,i=pr,s=Tn,o=ga,a=Mr,l=Es,h=Mn.DEFAULT_ANISOTROPY,d=ni){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:I9++}),this.uuid=oi(),this.name="",this.source=new el(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=l,this.offset=new ye(0,0),this.repeat=new ye(1,1),this.center=new ye(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new At,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,typeof d=="string"?this.colorSpace=d:(Yh("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=d===aa?Nn:ni),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}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)}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.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.6,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&&(r.userData=this.userData),t||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==hg)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case wd:e.x=e.x-Math.floor(e.x);break;case pr:e.x=e.x<0?0:1;break;case Td: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 wd:e.y=e.y-Math.floor(e.y);break;case pr:e.y=e.y<0?0:1;break;case Td: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)}get encoding(){return Yh("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Nn?aa:e1}set encoding(e){Yh("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===aa?Nn:ni}}Mn.DEFAULT_IMAGE=null;Mn.DEFAULT_MAPPING=hg;Mn.DEFAULT_ANISOTROPY=1;class Vt{constructor(e=0,t=0,r=0,i=1){Vt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,r,i){return this.x=e,this.y=t,this.z=r,this.w=i,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.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 t=this.x,r=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*r+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*r+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*r+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,r,i,s;const l=e.elements,h=l[0],d=l[4],f=l[8],p=l[1],m=l[5],v=l[9],x=l[2],_=l[6],g=l[10];if(Math.abs(d-p)<.01&&Math.abs(f-x)<.01&&Math.abs(v-_)<.01){if(Math.abs(d+p)<.1&&Math.abs(f+x)<.1&&Math.abs(v+_)<.1&&Math.abs(h+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(h+1)/2,M=(m+1)/2,C=(g+1)/2,A=(d+p)/4,R=(f+x)/4,O=(v+_)/4;return b>M&&b>C?b<.01?(r=0,i=.707106781,s=.707106781):(r=Math.sqrt(b),i=A/r,s=R/r):M>C?M<.01?(r=.707106781,i=0,s=.707106781):(i=Math.sqrt(M),r=A/i,s=O/i):C<.01?(r=.707106781,i=.707106781,s=0):(s=Math.sqrt(C),r=R/s,i=O/s),this.set(r,i,s,t),this}let S=Math.sqrt((_-v)*(_-v)+(f-x)*(f-x)+(p-d)*(p-d));return Math.abs(S)<.001&&(S=1),this.x=(_-v)/S,this.y=(f-x)/S,this.z=(p-d)/S,this.w=Math.acos((h+m+g-1)/2),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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this.w=e.w+(t.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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 MI extends mo{constructor(e=1,t=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Vt(0,0,e,t),this.scissorTest=!1,this.viewport=new Vt(0,0,e,t);const i={width:e,height:t,depth:1};r.encoding!==void 0&&(Yh("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===aa?Nn:ni),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Tn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new Mn(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,t,r=1){(this.width!==e||this.height!==t||this.depth!==r)&&(this.width=e,this.height=t,this.depth=r,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}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.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new el(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ts extends MI{constructor(e=1,t=1,r={}){super(e,t,r),this.isWebGLRenderTarget=!0}}class mg extends Mn{constructor(e=null,t=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=bn,this.minFilter=bn,this.wrapR=pr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class L9 extends ts{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new mg(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class i1 extends Mn{constructor(e=null,t=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:r,depth:i},this.magFilter=bn,this.minFilter=bn,this.wrapR=pr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class F9 extends ts{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new i1(null,e,t,r),this.texture.isRenderTargetTexture=!0}}class N9 extends ts{constructor(e=1,t=1,r=1,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o<r;o++)this.texture[o]=s.clone(),this.texture[o].isRenderTargetTexture=!0}setSize(e,t,r=1){if(this.width!==e||this.height!==t||this.depth!==r){this.width=e,this.height=t,this.depth=r;for(let i=0,s=this.texture.length;i<s;i++)this.texture[i].image.width=e,this.texture[i].image.height=t,this.texture[i].image.depth=r;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}copy(e){this.dispose(),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.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,r=e.texture.length;t<r;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}}class Vr{constructor(e=0,t=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=r,this._w=i}static slerpFlat(e,t,r,i,s,o,a){let l=r[i+0],h=r[i+1],d=r[i+2],f=r[i+3];const p=s[o+0],m=s[o+1],v=s[o+2],x=s[o+3];if(a===0){e[t+0]=l,e[t+1]=h,e[t+2]=d,e[t+3]=f;return}if(a===1){e[t+0]=p,e[t+1]=m,e[t+2]=v,e[t+3]=x;return}if(f!==x||l!==p||h!==m||d!==v){let _=1-a;const g=l*p+h*m+d*v+f*x,S=g>=0?1:-1,b=1-g*g;if(b>Number.EPSILON){const C=Math.sqrt(b),A=Math.atan2(C,g*S);_=Math.sin(_*A)/C,a=Math.sin(a*A)/C}const M=a*S;if(l=l*_+p*M,h=h*_+m*M,d=d*_+v*M,f=f*_+x*M,_===1-a){const C=1/Math.sqrt(l*l+h*h+d*d+f*f);l*=C,h*=C,d*=C,f*=C}}e[t]=l,e[t+1]=h,e[t+2]=d,e[t+3]=f}static multiplyQuaternionsFlat(e,t,r,i,s,o){const a=r[i],l=r[i+1],h=r[i+2],d=r[i+3],f=s[o],p=s[o+1],m=s[o+2],v=s[o+3];return e[t]=a*v+d*f+l*m-h*p,e[t+1]=l*v+d*p+h*f-a*m,e[t+2]=h*v+d*m+a*p-l*f,e[t+3]=d*v-a*f-l*p-h*m,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,t,r,i){return this._x=e,this._y=t,this._z=r,this._w=i,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,t=!0){const r=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,h=a(r/2),d=a(i/2),f=a(s/2),p=l(r/2),m=l(i/2),v=l(s/2);switch(o){case"XYZ":this._x=p*d*f+h*m*v,this._y=h*m*f-p*d*v,this._z=h*d*v+p*m*f,this._w=h*d*f-p*m*v;break;case"YXZ":this._x=p*d*f+h*m*v,this._y=h*m*f-p*d*v,this._z=h*d*v-p*m*f,this._w=h*d*f+p*m*v;break;case"ZXY":this._x=p*d*f-h*m*v,this._y=h*m*f+p*d*v,this._z=h*d*v+p*m*f,this._w=h*d*f-p*m*v;break;case"ZYX":this._x=p*d*f-h*m*v,this._y=h*m*f+p*d*v,this._z=h*d*v-p*m*f,this._w=h*d*f+p*m*v;break;case"YZX":this._x=p*d*f+h*m*v,this._y=h*m*f+p*d*v,this._z=h*d*v-p*m*f,this._w=h*d*f-p*m*v;break;case"XZY":this._x=p*d*f-h*m*v,this._y=h*m*f-p*d*v,this._z=h*d*v+p*m*f,this._w=h*d*f+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const r=t/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,r=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],h=t[2],d=t[6],f=t[10],p=r+a+f;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(d-l)*m,this._y=(s-h)*m,this._z=(o-i)*m}else if(r>a&&r>f){const m=2*Math.sqrt(1+r-a-f);this._w=(d-l)/m,this._x=.25*m,this._y=(i+o)/m,this._z=(s+h)/m}else if(a>f){const m=2*Math.sqrt(1+a-r-f);this._w=(s-h)/m,this._x=(i+o)/m,this._y=.25*m,this._z=(l+d)/m}else{const m=2*Math.sqrt(1+f-r-a);this._w=(o-i)/m,this._x=(s+h)/m,this._y=(l+d)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let r=e.dot(t)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(vn(this.dot(e),-1,1)))}rotateTowards(e,t){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,t/r);return this.slerp(e,i),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,t){const r=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,h=t._z,d=t._w;return this._x=r*d+o*a+i*h-s*l,this._y=i*d+o*l+s*a-r*h,this._z=s*d+o*h+r*l-i*a,this._w=o*d-r*a-i*l-s*h,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const r=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+r*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=r,this._y=i,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*r+t*this._x,this._y=m*i+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const h=Math.sqrt(l),d=Math.atan2(h,a),f=Math.sin((1-t)*d)/h,p=Math.sin(t*d)/h;return this._w=o*f+this._w*p,this._x=r*f+this._x*p,this._y=i*f+this._y*p,this._z=s*f+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,r){return this.copy(e).slerp(t,r)}random(){const e=Math.random(),t=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),r*Math.sin(s),r*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),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 z{constructor(e=0,t=0,r=0){z.prototype.isVector3=!0,this.x=e,this.y=t,this.z=r}set(e,t,r){return r===void 0&&(r=this.z),this.x=e,this.y=t,this.z=r,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,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;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,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,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,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.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,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(gM.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(gM.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6]*i,this.y=s[1]*t+s[4]*r+s[7]*i,this.z=s[2]*t+s[5]*r+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,r=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*r+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*r+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*r+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*r+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,r=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,h=2*(o*i-a*r),d=2*(a*t-s*i),f=2*(s*r-o*t);return this.x=t+l*h+o*f-a*d,this.y=r+l*d+a*h-s*f,this.z=i+l*f+s*d-o*h,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,r=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*r+s[8]*i,this.y=s[1]*t+s[5]*r+s[9]*i,this.z=s[2]*t+s[6]*r+s[10]*i,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,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}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,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this.z=e.z+(t.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const r=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-r*l,this.z=r*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const r=e.dot(this)/t;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return Iv.copy(this).projectOnVector(e),this.sub(Iv)}reflect(e){return this.sub(Iv.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const r=this.dot(e)/t;return Math.acos(vn(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return t*t+r*r+i*i}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,t,r){const i=Math.sin(t)*e;return this.x=i*Math.sin(r),this.y=Math.cos(t)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(t),this.y=r*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Iv=new z,gM=new Vr;class Cr{constructor(e=new z(1/0,1/0,1/0),t=new z(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(Ni.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,r=e.count;t<r;t++)this.expandByPoint(Ni.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=Ni.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}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,t=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0){const s=r.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)e.isMesh===!0?e.getVertexPosition(o,Ni):Ni.fromBufferAttribute(s,o),Ni.applyMatrix4(e.matrixWorld),this.expandByPoint(Ni);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Fp.copy(e.boundingBox)):(r.boundingBox===null&&r.computeBoundingBox(),Fp.copy(r.boundingBox)),Fp.applyMatrix4(e.matrixWorld),this.union(Fp)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],t);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,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(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,Ni),Ni.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(gh),Np.subVectors(this.max,gh),Jl.subVectors(e.a,gh),ec.subVectors(e.b,gh),tc.subVectors(e.c,gh),Co.subVectors(ec,Jl),Po.subVectors(tc,ec),Na.subVectors(Jl,tc);let t=[0,-Co.z,Co.y,0,-Po.z,Po.y,0,-Na.z,Na.y,Co.z,0,-Co.x,Po.z,0,-Po.x,Na.z,0,-Na.x,-Co.y,Co.x,0,-Po.y,Po.x,0,-Na.y,Na.x,0];return!Lv(t,Jl,ec,tc,Np)||(t=[1,0,0,0,1,0,0,0,1],!Lv(t,Jl,ec,tc,Np))?!1:(Dp.crossVectors(Co,Po),t=[Dp.x,Dp.y,Dp.z],Lv(t,Jl,ec,tc,Np))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ni).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ni).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:(zs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),zs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),zs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),zs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),zs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),zs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),zs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),zs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(zs),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 zs=[new z,new z,new z,new z,new z,new z,new z,new z],Ni=new z,Fp=new Cr,Jl=new z,ec=new z,tc=new z,Co=new z,Po=new z,Na=new z,gh=new z,Np=new z,Dp=new z,Da=new z;function Lv(n,e,t,r,i){for(let s=0,o=n.length-3;s<=o;s+=3){Da.fromArray(n,s);const a=i.x*Math.abs(Da.x)+i.y*Math.abs(Da.y)+i.z*Math.abs(Da.z),l=e.dot(Da),h=t.dot(Da),d=r.dot(Da);if(Math.max(-Math.max(l,h,d),Math.min(l,h,d))>a)return!1}return!0}const D9=new Cr,yh=new z,Fv=new z;class mr{constructor(e=new z,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const r=this.center;t!==void 0?r.copy(t):D9.setFromPoints(e).getCenter(r);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,r.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),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 t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const r=this.center.distanceToSquared(e);return t.copy(e),r>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}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;yh.subVectors(e,this.center);const t=yh.lengthSq();if(t>this.radius*this.radius){const r=Math.sqrt(t),i=(r-this.radius)*.5;this.center.addScaledVector(yh,i/r),this.radius+=i}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):(Fv.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(yh.copy(e.center).add(Fv)),this.expandByPoint(yh.copy(e.center).sub(Fv))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ws=new z,Nv=new z,Op=new z,Ro=new z,Dv=new z,Up=new z,Ov=new z;class Fu{constructor(e=new z,t=new z(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.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,Ws)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ws.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ws.copy(this.origin).addScaledVector(this.direction,t),Ws.distanceToSquared(e))}distanceSqToSegment(e,t,r,i){Nv.copy(e).add(t).multiplyScalar(.5),Op.copy(t).sub(e).normalize(),Ro.copy(this.origin).sub(Nv);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Op),a=Ro.dot(this.direction),l=-Ro.dot(Op),h=Ro.lengthSq(),d=Math.abs(1-o*o);let f,p,m,v;if(d>0)if(f=o*l-a,p=o*a-l,v=s*d,f>=0)if(p>=-v)if(p<=v){const x=1/d;f*=x,p*=x,m=f*(f+o*p+2*a)+p*(o*f+p+2*l)+h}else p=s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+h;else p=-s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+h;else p<=-v?(f=Math.max(0,-(-o*s+a)),p=f>0?-s:Math.min(Math.max(-s,-l),s),m=-f*f+p*(p+2*l)+h):p<=v?(f=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+h):(f=Math.max(0,-(o*s+a)),p=f>0?s:Math.min(Math.max(-s,-l),s),m=-f*f+p*(p+2*l)+h);else p=o>0?-s:s,f=Math.max(0,-(o*p+a)),m=-f*f+p*(p+2*l)+h;return r&&r.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(Nv).addScaledVector(Op,p),m}intersectSphere(e,t){Ws.subVectors(e.center,this.origin);const r=Ws.dot(this.direction),i=Ws.dot(Ws)-r*r,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=r-o,l=r+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null}intersectPlane(e,t){const r=this.distanceToPlane(e);return r===null?null:this.at(r,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let r,i,s,o,a,l;const h=1/this.direction.x,d=1/this.direction.y,f=1/this.direction.z,p=this.origin;return h>=0?(r=(e.min.x-p.x)*h,i=(e.max.x-p.x)*h):(r=(e.max.x-p.x)*h,i=(e.min.x-p.x)*h),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),r>o||s>i||((s>r||isNaN(r))&&(r=s),(o<i||isNaN(i))&&(i=o),f>=0?(a=(e.min.z-p.z)*f,l=(e.max.z-p.z)*f):(a=(e.max.z-p.z)*f,l=(e.min.z-p.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l<i||i!==i)&&(i=l),i<0)?null:this.at(r>=0?r:i,t)}intersectsBox(e){return this.intersectBox(e,Ws)!==null}intersectTriangle(e,t,r,i,s){Dv.subVectors(t,e),Up.subVectors(r,e),Ov.crossVectors(Dv,Up);let o=this.direction.dot(Ov),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ro.subVectors(this.origin,e);const l=a*this.direction.dot(Up.crossVectors(Ro,Up));if(l<0)return null;const h=a*this.direction.dot(Dv.cross(Ro));if(h<0||l+h>o)return null;const d=-a*Ro.dot(Ov);return d<0?null:this.at(d/o,s)}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 ft{constructor(e,t,r,i,s,o,a,l,h,d,f,p,m,v,x,_){ft.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,t,r,i,s,o,a,l,h,d,f,p,m,v,x,_)}set(e,t,r,i,s,o,a,l,h,d,f,p,m,v,x,_){const g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=h,g[6]=d,g[10]=f,g[14]=p,g[3]=m,g[7]=v,g[11]=x,g[15]=_,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 ft().fromArray(this.elements)}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this}copyPosition(e){const t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,r=e.elements,i=1/nc.setFromMatrixColumn(e,0).length(),s=1/nc.setFromMatrixColumn(e,1).length(),o=1/nc.setFromMatrixColumn(e,2).length();return t[0]=r[0]*i,t[1]=r[1]*i,t[2]=r[2]*i,t[3]=0,t[4]=r[4]*s,t[5]=r[5]*s,t[6]=r[6]*s,t[7]=0,t[8]=r[8]*o,t[9]=r[9]*o,t[10]=r[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,r=e.x,i=e.y,s=e.z,o=Math.cos(r),a=Math.sin(r),l=Math.cos(i),h=Math.sin(i),d=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const p=o*d,m=o*f,v=a*d,x=a*f;t[0]=l*d,t[4]=-l*f,t[8]=h,t[1]=m+v*h,t[5]=p-x*h,t[9]=-a*l,t[2]=x-p*h,t[6]=v+m*h,t[10]=o*l}else if(e.order==="YXZ"){const p=l*d,m=l*f,v=h*d,x=h*f;t[0]=p+x*a,t[4]=v*a-m,t[8]=o*h,t[1]=o*f,t[5]=o*d,t[9]=-a,t[2]=m*a-v,t[6]=x+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*d,m=l*f,v=h*d,x=h*f;t[0]=p-x*a,t[4]=-o*f,t[8]=v+m*a,t[1]=m+v*a,t[5]=o*d,t[9]=x-p*a,t[2]=-o*h,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*d,m=o*f,v=a*d,x=a*f;t[0]=l*d,t[4]=v*h-m,t[8]=p*h+x,t[1]=l*f,t[5]=x*h+p,t[9]=m*h-v,t[2]=-h,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*h,v=a*l,x=a*h;t[0]=l*d,t[4]=x-p*f,t[8]=v*f+m,t[1]=f,t[5]=o*d,t[9]=-a*d,t[2]=-h*d,t[6]=m*f+v,t[10]=p-x*f}else if(e.order==="XZY"){const p=o*l,m=o*h,v=a*l,x=a*h;t[0]=l*d,t[4]=-f,t[8]=h*d,t[1]=p*f+x,t[5]=o*d,t[9]=m*f-v,t[2]=v*f-m,t[6]=a*d,t[10]=x*f+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(O9,e,U9)}lookAt(e,t,r){const i=this.elements;return Qr.subVectors(e,t),Qr.lengthSq()===0&&(Qr.z=1),Qr.normalize(),Io.crossVectors(r,Qr),Io.lengthSq()===0&&(Math.abs(r.z)===1?Qr.x+=1e-4:Qr.z+=1e-4,Qr.normalize(),Io.crossVectors(r,Qr)),Io.normalize(),kp.crossVectors(Qr,Io),i[0]=Io.x,i[4]=kp.x,i[8]=Qr.x,i[1]=Io.y,i[5]=kp.y,i[9]=Qr.y,i[2]=Io.z,i[6]=kp.z,i[10]=Qr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,s=this.elements,o=r[0],a=r[4],l=r[8],h=r[12],d=r[1],f=r[5],p=r[9],m=r[13],v=r[2],x=r[6],_=r[10],g=r[14],S=r[3],b=r[7],M=r[11],C=r[15],A=i[0],R=i[4],O=i[8],P=i[12],I=i[1],H=i[5],X=i[9],se=i[13],W=i[2],$=i[6],Z=i[10],re=i[14],F=i[3],U=i[7],G=i[11],Y=i[15];return s[0]=o*A+a*I+l*W+h*F,s[4]=o*R+a*H+l*$+h*U,s[8]=o*O+a*X+l*Z+h*G,s[12]=o*P+a*se+l*re+h*Y,s[1]=d*A+f*I+p*W+m*F,s[5]=d*R+f*H+p*$+m*U,s[9]=d*O+f*X+p*Z+m*G,s[13]=d*P+f*se+p*re+m*Y,s[2]=v*A+x*I+_*W+g*F,s[6]=v*R+x*H+_*$+g*U,s[10]=v*O+x*X+_*Z+g*G,s[14]=v*P+x*se+_*re+g*Y,s[3]=S*A+b*I+M*W+C*F,s[7]=S*R+b*H+M*$+C*U,s[11]=S*O+b*X+M*Z+C*G,s[15]=S*P+b*se+M*re+C*Y,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],r=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],h=e[13],d=e[2],f=e[6],p=e[10],m=e[14],v=e[3],x=e[7],_=e[11],g=e[15];return v*(+s*l*f-i*h*f-s*a*p+r*h*p+i*a*m-r*l*m)+x*(+t*l*m-t*h*p+s*o*p-i*o*m+i*h*d-s*l*d)+_*(+t*h*f-t*a*m-s*o*f+r*o*m+s*a*d-r*h*d)+g*(-i*a*d-t*l*f+t*a*p+i*o*f-r*o*p+r*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=r),this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],h=e[7],d=e[8],f=e[9],p=e[10],m=e[11],v=e[12],x=e[13],_=e[14],g=e[15],S=f*_*h-x*p*h+x*l*m-a*_*m-f*l*g+a*p*g,b=v*p*h-d*_*h-v*l*m+o*_*m+d*l*g-o*p*g,M=d*x*h-v*f*h+v*a*m-o*x*m-d*a*g+o*f*g,C=v*f*l-d*x*l-v*a*p+o*x*p+d*a*_-o*f*_,A=t*S+r*b+i*M+s*C;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/A;return e[0]=S*R,e[1]=(x*p*s-f*_*s-x*i*m+r*_*m+f*i*g-r*p*g)*R,e[2]=(a*_*s-x*l*s+x*i*h-r*_*h-a*i*g+r*l*g)*R,e[3]=(f*l*s-a*p*s-f*i*h+r*p*h+a*i*m-r*l*m)*R,e[4]=b*R,e[5]=(d*_*s-v*p*s+v*i*m-t*_*m-d*i*g+t*p*g)*R,e[6]=(v*l*s-o*_*s-v*i*h+t*_*h+o*i*g-t*l*g)*R,e[7]=(o*p*s-d*l*s+d*i*h-t*p*h-o*i*m+t*l*m)*R,e[8]=M*R,e[9]=(v*f*s-d*x*s-v*r*m+t*x*m+d*r*g-t*f*g)*R,e[10]=(o*x*s-v*a*s+v*r*h-t*x*h-o*r*g+t*a*g)*R,e[11]=(d*a*s-o*f*s-d*r*h+t*f*h+o*r*m-t*a*m)*R,e[12]=C*R,e[13]=(d*x*i-v*f*i+v*r*p-t*x*p-d*r*_+t*f*_)*R,e[14]=(v*a*i-o*x*i-v*r*l+t*x*l+o*r*_-t*a*_)*R,e[15]=(o*f*i-d*a*i+d*r*l-t*f*l-o*r*p+t*a*p)*R,this}scale(e){const t=this.elements,r=e.x,i=e.y,s=e.z;return t[0]*=r,t[4]*=i,t[8]*=s,t[1]*=r,t[5]*=i,t[9]*=s,t[2]*=r,t[6]*=i,t[10]*=s,t[3]*=r,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,i))}makeTranslation(e,t,r){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,t,0,0,1,r,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const r=Math.cos(t),i=Math.sin(t),s=1-r,o=e.x,a=e.y,l=e.z,h=s*o,d=s*a;return this.set(h*o+r,h*a-i*l,h*l+i*a,0,h*a+i*l,d*a+r,d*l-i*o,0,h*l-i*a,d*l+i*o,s*l*l+r,0,0,0,0,1),this}makeScale(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,t,r,i,s,o){return this.set(1,r,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,r){const i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,h=s+s,d=o+o,f=a+a,p=s*h,m=s*d,v=s*f,x=o*d,_=o*f,g=a*f,S=l*h,b=l*d,M=l*f,C=r.x,A=r.y,R=r.z;return i[0]=(1-(x+g))*C,i[1]=(m+M)*C,i[2]=(v-b)*C,i[3]=0,i[4]=(m-M)*A,i[5]=(1-(p+g))*A,i[6]=(_+S)*A,i[7]=0,i[8]=(v+b)*R,i[9]=(_-S)*R,i[10]=(1-(p+x))*R,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,r){const i=this.elements;let s=nc.set(i[0],i[1],i[2]).length();const o=nc.set(i[4],i[5],i[6]).length(),a=nc.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Di.copy(this);const h=1/s,d=1/o,f=1/a;return Di.elements[0]*=h,Di.elements[1]*=h,Di.elements[2]*=h,Di.elements[4]*=d,Di.elements[5]*=d,Di.elements[6]*=d,Di.elements[8]*=f,Di.elements[9]*=f,Di.elements[10]*=f,t.setFromRotationMatrix(Di),r.x=s,r.y=o,r.z=a,this}makePerspective(e,t,r,i,s,o,a=Yi){const l=this.elements,h=2*s/(t-e),d=2*s/(r-i),f=(t+e)/(t-e),p=(r+i)/(r-i);let m,v;if(a===Yi)m=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===vu)m=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=h,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,r,i,s,o,a=Yi){const l=this.elements,h=1/(t-e),d=1/(r-i),f=1/(o-s),p=(t+e)*h,m=(r+i)*d;let v,x;if(a===Yi)v=(o+s)*f,x=-2*f;else if(a===vu)v=s*f,x=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*h,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=x,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,r=e.elements;for(let i=0;i<16;i++)if(t[i]!==r[i])return!1;return!0}fromArray(e,t=0){for(let r=0;r<16;r++)this.elements[r]=e[r+t];return this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e}}const nc=new z,Di=new ft,O9=new z(0,0,0),U9=new z(1,1,1),Io=new z,kp=new z,Qr=new z,yM=new ft,vM=new Vr;class tf{constructor(e=0,t=0,r=0,i=tf.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=r,this._order=i}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,t,r,i=this._order){return this._x=e,this._y=t,this._z=r,this._order=i,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,t=this._order,r=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],h=i[5],d=i[9],f=i[2],p=i[6],m=i[10];switch(t){case"XYZ":this._y=Math.asin(vn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,h),this._z=0);break;case"YXZ":this._x=Math.asin(-vn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,h)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(vn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-f,m),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-vn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,h));break;case"YZX":this._z=Math.asin(vn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,h),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-vn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,h),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,r){return yM.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yM,t,r)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return vM.setFromEuler(this),this.setFromQuaternion(vM,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+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}}tf.DEFAULT_ORDER="XYZ";class fl{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 k9=0;const _M=new z,rc=new Vr,Hs=new ft,Bp=new z,vh=new z,B9=new z,z9=new Vr,xM=new z(1,0,0),SM=new z(0,1,0),bM=new z(0,0,1),W9={type:"added"},H9={type:"removed"};class Wt extends mo{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:k9++}),this.uuid=oi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Wt.DEFAULT_UP.clone();const e=new z,t=new tf,r=new Vr,i=new z(1,1,1);function s(){r.setFromEuler(t,!1)}function o(){t.setFromQuaternion(r,void 0,!1)}t._onChange(s),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new ft},normalMatrix:{value:new At}}),this.matrix=new ft,this.matrixWorld=new ft,this.matrixAutoUpdate=Wt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Wt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new fl,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],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,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return rc.setFromAxisAngle(e,t),this.quaternion.multiply(rc),this}rotateOnWorldAxis(e,t){return rc.setFromAxisAngle(e,t),this.quaternion.premultiply(rc),this}rotateX(e){return this.rotateOnAxis(xM,e)}rotateY(e){return this.rotateOnAxis(SM,e)}rotateZ(e){return this.rotateOnAxis(bM,e)}translateOnAxis(e,t){return _M.copy(e).applyQuaternion(this.quaternion),this.position.add(_M.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(xM,e)}translateY(e){return this.translateOnAxis(SM,e)}translateZ(e){return this.translateOnAxis(bM,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Hs.copy(this.matrixWorld).invert())}lookAt(e,t,r){e.isVector3?Bp.copy(e):Bp.set(e,t,r);const i=this.parent;this.updateWorldMatrix(!0,!1),vh.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Hs.lookAt(vh,Bp,this.up):Hs.lookAt(Bp,vh,this.up),this.quaternion.setFromRotationMatrix(Hs),i&&(Hs.extractRotation(i.matrixWorld),rc.setFromRotationMatrix(Hs),this.quaternion.premultiply(rc.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);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.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(W9)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(H9)),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),Hs.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Hs.multiply(e.parent.matrixWorld)),e.applyMatrix4(Hs),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let r=0,i=this.children.length;r<i;r++){const o=this.children[r].getObjectByProperty(e,t);if(o!==void 0)return o}}getObjectsByProperty(e,t,r=[]){this[e]===t&&r.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,t,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vh,e,B9),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(vh,z9,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let r=0,i=t.length;r<i;r++)t[r].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.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.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let r=0,i=t.length;r<i;r++){const s=t[r];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const r=this.parent;if(e===!0&&r!==null&&r.matrixWorldAutoUpdate===!0&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++){const a=i[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",r={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let h=0,d=l.length;h<d;h++){const f=l[h];s(e.shapes,f)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const a=[];for(let l=0,h=this.material.length;l<h;l++)a.push(s(e.materials,this.material[l]));i.material=a}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){const l=this.animations[a];i.animations.push(s(e.animations,l))}}if(t){const a=o(e.geometries),l=o(e.materials),h=o(e.textures),d=o(e.images),f=o(e.shapes),p=o(e.skeletons),m=o(e.animations),v=o(e.nodes);a.length>0&&(r.geometries=a),l.length>0&&(r.materials=l),h.length>0&&(r.textures=h),d.length>0&&(r.images=d),f.length>0&&(r.shapes=f),p.length>0&&(r.skeletons=p),m.length>0&&(r.animations=m),v.length>0&&(r.nodes=v)}return r.object=i,r;function o(a){const l=[];for(const h in a){const d=a[h];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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)),t===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}Wt.DEFAULT_UP=new z(0,1,0);Wt.DEFAULT_MATRIX_AUTO_UPDATE=!0;Wt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Oi=new z,Gs=new z,Uv=new z,Vs=new z,ic=new z,sc=new z,wM=new z,kv=new z,Bv=new z,zv=new z;let zp=!1;class kr{constructor(e=new z,t=new z,r=new z){this.a=e,this.b=t,this.c=r}static getNormal(e,t,r,i){i.subVectors(r,t),Oi.subVectors(e,t),i.cross(Oi);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,r,i,s){Oi.subVectors(i,t),Gs.subVectors(r,t),Uv.subVectors(e,t);const o=Oi.dot(Oi),a=Oi.dot(Gs),l=Oi.dot(Uv),h=Gs.dot(Gs),d=Gs.dot(Uv),f=o*h-a*a;if(f===0)return s.set(0,0,0),null;const p=1/f,m=(h*l-a*d)*p,v=(o*d-a*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,r,i){return this.getBarycoord(e,t,r,i,Vs)===null?!1:Vs.x>=0&&Vs.y>=0&&Vs.x+Vs.y<=1}static getUV(e,t,r,i,s,o,a,l){return zp===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),zp=!0),this.getInterpolation(e,t,r,i,s,o,a,l)}static getInterpolation(e,t,r,i,s,o,a,l){return this.getBarycoord(e,t,r,i,Vs)===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(s,Vs.x),l.addScaledVector(o,Vs.y),l.addScaledVector(a,Vs.z),l)}static isFrontFacing(e,t,r,i){return Oi.subVectors(r,t),Gs.subVectors(e,t),Oi.cross(Gs).dot(i)<0}set(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this}setFromPointsAndIndices(e,t,r,i){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,r,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),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 Oi.subVectors(this.c,this.b),Gs.subVectors(this.a,this.b),Oi.cross(Gs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return kr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return kr.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,r,i,s){return zp===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),zp=!0),kr.getInterpolation(e,this.a,this.b,this.c,t,r,i,s)}getInterpolation(e,t,r,i,s){return kr.getInterpolation(e,this.a,this.b,this.c,t,r,i,s)}containsPoint(e){return kr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return kr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const r=this.a,i=this.b,s=this.c;let o,a;ic.subVectors(i,r),sc.subVectors(s,r),kv.subVectors(e,r);const l=ic.dot(kv),h=sc.dot(kv);if(l<=0&&h<=0)return t.copy(r);Bv.subVectors(e,i);const d=ic.dot(Bv),f=sc.dot(Bv);if(d>=0&&f<=d)return t.copy(i);const p=l*f-d*h;if(p<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(r).addScaledVector(ic,o);zv.subVectors(e,s);const m=ic.dot(zv),v=sc.dot(zv);if(v>=0&&m<=v)return t.copy(s);const x=m*h-l*v;if(x<=0&&h>=0&&v<=0)return a=h/(h-v),t.copy(r).addScaledVector(sc,a);const _=d*v-m*f;if(_<=0&&f-d>=0&&m-v>=0)return wM.subVectors(s,i),a=(f-d)/(f-d+(m-v)),t.copy(i).addScaledVector(wM,a);const g=1/(_+x+p);return o=x*g,a=p*g,t.copy(r).addScaledVector(ic,o).addScaledVector(sc,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const EI={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},Lo={h:0,s:0,l:0},Wp={h:0,s:0,l:0};function Wv(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class We{constructor(e,t,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,r)}set(e,t,r){if(t===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Nn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Gt.toWorkingColorSpace(this,t),this}setRGB(e,t,r,i=Gt.workingColorSpace){return this.r=e,this.g=t,this.b=r,Gt.toWorkingColorSpace(this,i),this}setHSL(e,t,r,i=Gt.workingColorSpace){if(e=n1(e,1),t=vn(t,0,1),r=vn(r,0,1),t===0)this.r=this.g=this.b=r;else{const s=r<=.5?r*(1+t):r+t-r*t,o=2*r-s;this.r=Wv(o,s,e+1/3),this.g=Wv(o,s,e),this.b=Wv(o,s,e-1/3)}return Gt.toWorkingColorSpace(this,i),this}setStyle(e,t=Nn){function r(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Nn){const r=EI[e.toLowerCase()];return r!==void 0?this.setHex(r,t):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=Qc(e.r),this.g=Qc(e.g),this.b=Qc(e.b),this}copyLinearToSRGB(e){return this.r=Pv(e.r),this.g=Pv(e.g),this.b=Pv(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Nn){return Gt.fromWorkingColorSpace(cr.copy(this),e),Math.round(vn(cr.r*255,0,255))*65536+Math.round(vn(cr.g*255,0,255))*256+Math.round(vn(cr.b*255,0,255))}getHexString(e=Nn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Gt.workingColorSpace){Gt.fromWorkingColorSpace(cr.copy(this),t);const r=cr.r,i=cr.g,s=cr.b,o=Math.max(r,i,s),a=Math.min(r,i,s);let l,h;const d=(a+o)/2;if(a===o)l=0,h=0;else{const f=o-a;switch(h=d<=.5?f/(o+a):f/(2-o-a),o){case r:l=(i-s)/f+(i<s?6:0);break;case i:l=(s-r)/f+2;break;case s:l=(r-i)/f+4;break}l/=6}return e.h=l,e.s=h,e.l=d,e}getRGB(e,t=Gt.workingColorSpace){return Gt.fromWorkingColorSpace(cr.copy(this),t),e.r=cr.r,e.g=cr.g,e.b=cr.b,e}getStyle(e=Nn){Gt.fromWorkingColorSpace(cr.copy(this),e);const t=cr.r,r=cr.g,i=cr.b;return e!==Nn?`color(${e} ${t.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(r*255)},${Math.round(i*255)})`}offsetHSL(e,t,r){return this.getHSL(Lo),this.setHSL(Lo.h+e,Lo.s+t,Lo.l+r)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.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,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Lo),e.getHSL(Wp);const r=Xh(Lo.h,Wp.h,t),i=Xh(Lo.s,Wp.s,t),s=Xh(Lo.l,Wp.l,t);return this.setHSL(r,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,r=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*r+s[6]*i,this.g=s[1]*t+s[4]*r+s[7]*i,this.b=s[2]*t+s[5]*r+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const cr=new We;We.NAMES=EI;let G9=0;class yr extends mo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:G9++}),this.uuid=oi(),this.name="",this.type="Material",this.blending=hl,this.side=uo,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=C0,this.blendDst=P0,this.blendEquation=Wo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new We(0,0,0),this.blendAlpha=0,this.depthFunc=xd,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=px,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Xa,this.stencilZFail=Xa,this.stencilZPass=Xa,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.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}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const r=e[t];if(r===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[t]=r}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==hl&&(r.blending=this.blending),this.side!==uo&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==C0&&(r.blendSrc=this.blendSrc),this.blendDst!==P0&&(r.blendDst=this.blendDst),this.blendEquation!==Wo&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==xd&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==px&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Xa&&(r.stencilFail=this.stencilFail),this.stencilZFail!==Xa&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==Xa&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(r.textures=s),o.length>0&&(r.images=o)}return r}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 t=e.clippingPlanes;let r=null;if(t!==null){const i=t.length;r=new Array(i);for(let s=0;s!==i;++s)r[s]=t[s].clone()}return this.clippingPlanes=r,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 ba extends yr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new We(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Jd,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.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 Ks=V9();function V9(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const h=l-127;h<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):h<-14?(r[l]=1024>>-h-14,r[l|256]=1024>>-h-14|32768,i[l]=-h-1,i[l|256]=-h-1):h<=15?(r[l]=h+15<<10,r[l|256]=h+15<<10|32768,i[l]=13,i[l|256]=13):h<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let h=l<<13,d=0;for(;!(h&8388608);)h<<=1,d-=8388608;h&=-8388609,d+=947912704,s[l]=h|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function Dr(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=vn(n,-65504,65504),Ks.floatView[0]=n;const e=Ks.uint32View[0],t=e>>23&511;return Ks.baseTable[t]+((e&8388607)>>Ks.shiftTable[t])}function Fh(n){const e=n>>10;return Ks.uint32View[0]=Ks.mantissaTable[Ks.offsetTable[e]+(n&1023)]+Ks.exponentTable[e],Ks.floatView[0]}const j9={toHalfFloat:Dr,fromHalfFloat:Fh},Cn=new z,Hp=new ye;class Xt{constructor(e,t,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=r,this.usage=Id,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Xi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}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,t,r){e*=this.itemSize,r*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,r=this.count;t<r;t++)Hp.fromBufferAttribute(this,t),Hp.applyMatrix3(e),this.setXY(t,Hp.x,Hp.y);else if(this.itemSize===3)for(let t=0,r=this.count;t<r;t++)Cn.fromBufferAttribute(this,t),Cn.applyMatrix3(e),this.setXYZ(t,Cn.x,Cn.y,Cn.z);return this}applyMatrix4(e){for(let t=0,r=this.count;t<r;t++)Cn.fromBufferAttribute(this,t),Cn.applyMatrix4(e),this.setXYZ(t,Cn.x,Cn.y,Cn.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)Cn.fromBufferAttribute(this,t),Cn.applyNormalMatrix(e),this.setXYZ(t,Cn.x,Cn.y,Cn.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)Cn.fromBufferAttribute(this,t),Cn.transformDirection(e),this.setXYZ(t,Cn.x,Cn.y,Cn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let r=this.array[e*this.itemSize+t];return this.normalized&&(r=Br(r,this.array)),r}setComponent(e,t,r){return this.normalized&&(r=Mt(r,this.array)),this.array[e*this.itemSize+t]=r,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Br(t,this.array)),t}setX(e,t){return this.normalized&&(t=Mt(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Br(t,this.array)),t}setY(e,t){return this.normalized&&(t=Mt(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Br(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Mt(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Br(t,this.array)),t}setW(e,t){return this.normalized&&(t=Mt(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array)),this.array[e+0]=t,this.array[e+1]=r,this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array),i=Mt(i,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e*=this.itemSize,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array),i=Mt(i,this.array),s=Mt(s,this.array)),this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=s,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!==Id&&(e.usage=this.usage),e}}class X9 extends Xt{constructor(e,t,r){super(new Int8Array(e),t,r)}}class Y9 extends Xt{constructor(e,t,r){super(new Uint8Array(e),t,r)}}class q9 extends Xt{constructor(e,t,r){super(new Uint8ClampedArray(e),t,r)}}class $9 extends Xt{constructor(e,t,r){super(new Int16Array(e),t,r)}}class s1 extends Xt{constructor(e,t,r){super(new Uint16Array(e),t,r)}}class K9 extends Xt{constructor(e,t,r){super(new Int32Array(e),t,r)}}class o1 extends Xt{constructor(e,t,r){super(new Uint32Array(e),t,r)}}class Z9 extends Xt{constructor(e,t,r){super(new Uint16Array(e),t,r),this.isFloat16BufferAttribute=!0}getX(e){let t=Fh(this.array[e*this.itemSize]);return this.normalized&&(t=Br(t,this.array)),t}setX(e,t){return this.normalized&&(t=Mt(t,this.array)),this.array[e*this.itemSize]=Dr(t),this}getY(e){let t=Fh(this.array[e*this.itemSize+1]);return this.normalized&&(t=Br(t,this.array)),t}setY(e,t){return this.normalized&&(t=Mt(t,this.array)),this.array[e*this.itemSize+1]=Dr(t),this}getZ(e){let t=Fh(this.array[e*this.itemSize+2]);return this.normalized&&(t=Br(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Mt(t,this.array)),this.array[e*this.itemSize+2]=Dr(t),this}getW(e){let t=Fh(this.array[e*this.itemSize+3]);return this.normalized&&(t=Br(t,this.array)),t}setW(e,t){return this.normalized&&(t=Mt(t,this.array)),this.array[e*this.itemSize+3]=Dr(t),this}setXY(e,t,r){return e*=this.itemSize,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array)),this.array[e+0]=Dr(t),this.array[e+1]=Dr(r),this}setXYZ(e,t,r,i){return e*=this.itemSize,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array),i=Mt(i,this.array)),this.array[e+0]=Dr(t),this.array[e+1]=Dr(r),this.array[e+2]=Dr(i),this}setXYZW(e,t,r,i,s){return e*=this.itemSize,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array),i=Mt(i,this.array),s=Mt(s,this.array)),this.array[e+0]=Dr(t),this.array[e+1]=Dr(r),this.array[e+2]=Dr(i),this.array[e+3]=Dr(s),this}}class qe extends Xt{constructor(e,t,r){super(new Float32Array(e),t,r)}}class Q9 extends Xt{constructor(e,t,r){super(new Float64Array(e),t,r)}}let J9=0;const xi=new ft,Hv=new Wt,oc=new z,Jr=new Cr,_h=new Cr,jn=new z;class dt extends mo{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:J9++}),this.uuid=oi(),this.name="",this.type="BufferGeometry",this.index=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(wI(e)?o1:s1)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,r=0){this.groups.push({start:e,count:t,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const s=new At().getNormalMatrix(e);r.applyNormalMatrix(s),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return xi.makeRotationFromQuaternion(e),this.applyMatrix4(xi),this}rotateX(e){return xi.makeRotationX(e),this.applyMatrix4(xi),this}rotateY(e){return xi.makeRotationY(e),this.applyMatrix4(xi),this}rotateZ(e){return xi.makeRotationZ(e),this.applyMatrix4(xi),this}translate(e,t,r){return xi.makeTranslation(e,t,r),this.applyMatrix4(xi),this}scale(e,t,r){return xi.makeScale(e,t,r),this.applyMatrix4(xi),this}lookAt(e){return Hv.lookAt(e),Hv.updateMatrix(),this.applyMatrix4(Hv.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(oc).negate(),this.translate(oc.x,oc.y,oc.z),this}setFromPoints(e){const t=[];for(let r=0,i=e.length;r<i;r++){const s=e[r];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new qe(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Cr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new z(-1/0,-1/0,-1/0),new z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let r=0,i=t.length;r<i;r++){const s=t[r];Jr.setFromBufferAttribute(s),this.morphTargetsRelative?(jn.addVectors(this.boundingBox.min,Jr.min),this.boundingBox.expandByPoint(jn),jn.addVectors(this.boundingBox.max,Jr.max),this.boundingBox.expandByPoint(jn)):(this.boundingBox.expandByPoint(Jr.min),this.boundingBox.expandByPoint(Jr.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 mr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new z,1/0);return}if(e){const r=this.boundingSphere.center;if(Jr.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const a=t[s];_h.setFromBufferAttribute(a),this.morphTargetsRelative?(jn.addVectors(Jr.min,_h.min),Jr.expandByPoint(jn),jn.addVectors(Jr.max,_h.max),Jr.expandByPoint(jn)):(Jr.expandByPoint(_h.min),Jr.expandByPoint(_h.max))}Jr.getCenter(r);let i=0;for(let s=0,o=e.count;s<o;s++)jn.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(jn));if(t)for(let s=0,o=t.length;s<o;s++){const a=t[s],l=this.morphTargetsRelative;for(let h=0,d=a.count;h<d;h++)jn.fromBufferAttribute(a,h),l&&(oc.fromBufferAttribute(e,h),jn.add(oc)),i=Math.max(i,r.distanceToSquared(jn))}this.boundingSphere.radius=Math.sqrt(i),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,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=e.array,i=t.position.array,s=t.normal.array,o=t.uv.array,a=i.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Xt(new Float32Array(4*a),4));const l=this.getAttribute("tangent").array,h=[],d=[];for(let I=0;I<a;I++)h[I]=new z,d[I]=new z;const f=new z,p=new z,m=new z,v=new ye,x=new ye,_=new ye,g=new z,S=new z;function b(I,H,X){f.fromArray(i,I*3),p.fromArray(i,H*3),m.fromArray(i,X*3),v.fromArray(o,I*2),x.fromArray(o,H*2),_.fromArray(o,X*2),p.sub(f),m.sub(f),x.sub(v),_.sub(v);const se=1/(x.x*_.y-_.x*x.y);isFinite(se)&&(g.copy(p).multiplyScalar(_.y).addScaledVector(m,-x.y).multiplyScalar(se),S.copy(m).multiplyScalar(x.x).addScaledVector(p,-_.x).multiplyScalar(se),h[I].add(g),h[H].add(g),h[X].add(g),d[I].add(S),d[H].add(S),d[X].add(S))}let M=this.groups;M.length===0&&(M=[{start:0,count:r.length}]);for(let I=0,H=M.length;I<H;++I){const X=M[I],se=X.start,W=X.count;for(let $=se,Z=se+W;$<Z;$+=3)b(r[$+0],r[$+1],r[$+2])}const C=new z,A=new z,R=new z,O=new z;function P(I){R.fromArray(s,I*3),O.copy(R);const H=h[I];C.copy(H),C.sub(R.multiplyScalar(R.dot(H))).normalize(),A.crossVectors(O,H);const se=A.dot(d[I])<0?-1:1;l[I*4]=C.x,l[I*4+1]=C.y,l[I*4+2]=C.z,l[I*4+3]=se}for(let I=0,H=M.length;I<H;++I){const X=M[I],se=X.start,W=X.count;for(let $=se,Z=se+W;$<Z;$+=3)P(r[$+0]),P(r[$+1]),P(r[$+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new Xt(new Float32Array(t.count*3),3),this.setAttribute("normal",r);else for(let p=0,m=r.count;p<m;p++)r.setXYZ(p,0,0,0);const i=new z,s=new z,o=new z,a=new z,l=new z,h=new z,d=new z,f=new z;if(e)for(let p=0,m=e.count;p<m;p+=3){const v=e.getX(p+0),x=e.getX(p+1),_=e.getX(p+2);i.fromBufferAttribute(t,v),s.fromBufferAttribute(t,x),o.fromBufferAttribute(t,_),d.subVectors(o,s),f.subVectors(i,s),d.cross(f),a.fromBufferAttribute(r,v),l.fromBufferAttribute(r,x),h.fromBufferAttribute(r,_),a.add(d),l.add(d),h.add(d),r.setXYZ(v,a.x,a.y,a.z),r.setXYZ(x,l.x,l.y,l.z),r.setXYZ(_,h.x,h.y,h.z)}else for(let p=0,m=t.count;p<m;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,s),f.subVectors(i,s),d.cross(f),r.setXYZ(p+0,d.x,d.y,d.z),r.setXYZ(p+1,d.x,d.y,d.z),r.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,r=e.count;t<r;t++)jn.fromBufferAttribute(e,t),jn.normalize(),e.setXYZ(t,jn.x,jn.y,jn.z)}toNonIndexed(){function e(a,l){const h=a.array,d=a.itemSize,f=a.normalized,p=new h.constructor(l.length*d);let m=0,v=0;for(let x=0,_=l.length;x<_;x++){a.isInterleavedBufferAttribute?m=l[x]*a.data.stride+a.offset:m=l[x]*d;for(let g=0;g<d;g++)p[v++]=h[m++]}return new Xt(p,d,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new dt,r=this.index.array,i=this.attributes;for(const a in i){const l=i[a],h=e(l,r);t.setAttribute(a,h)}const s=this.morphAttributes;for(const a in s){const l=[],h=s[a];for(let d=0,f=h.length;d<f;d++){const p=h[d],m=e(p,r);l.push(m)}t.morphAttributes[a]=l}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let a=0,l=o.length;a<l;a++){const h=o[a];t.addGroup(h.start,h.count,h.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,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 h in l)l[h]!==void 0&&(e[h]=l[h]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const r=this.attributes;for(const l in r){const h=r[l];e.data.attributes[l]=h.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const h=this.morphAttributes[l],d=[];for(let f=0,p=h.length;f<p;f++){const m=h[f];d.push(m.toJSON(e.data))}d.length>0&&(i[l]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),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 t={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(t));const i=e.attributes;for(const h in i){const d=i[h];this.setAttribute(h,d.clone(t))}const s=e.morphAttributes;for(const h in s){const d=[],f=s[h];for(let p=0,m=f.length;p<m;p++)d.push(f[p].clone(t));this.morphAttributes[h]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let h=0,d=o.length;h<d;h++){const f=o[h];this.addGroup(f.start,f.count,f.materialIndex)}const a=e.boundingBox;a!==null&&(this.boundingBox=a.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 TM=new ft,Oa=new Fu,Gp=new mr,MM=new z,ac=new z,lc=new z,cc=new z,Gv=new z,Vp=new z,jp=new ye,Xp=new ye,Yp=new ye,EM=new z,AM=new z,CM=new z,qp=new z,$p=new z;class Un extends Wt{constructor(e=new dt,t=new ba){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),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 t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(e,t){const r=this.geometry,i=r.attributes.position,s=r.morphAttributes.position,o=r.morphTargetsRelative;t.fromBufferAttribute(i,e);const a=this.morphTargetInfluences;if(s&&a){Vp.set(0,0,0);for(let l=0,h=s.length;l<h;l++){const d=a[l],f=s[l];d!==0&&(Gv.fromBufferAttribute(f,e),o?Vp.addScaledVector(Gv,d):Vp.addScaledVector(Gv.sub(t),d))}t.add(Vp)}return t}raycast(e,t){const r=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(r.boundingSphere===null&&r.computeBoundingSphere(),Gp.copy(r.boundingSphere),Gp.applyMatrix4(s),Oa.copy(e.ray).recast(e.near),!(Gp.containsPoint(Oa.origin)===!1&&(Oa.intersectSphere(Gp,MM)===null||Oa.origin.distanceToSquared(MM)>(e.far-e.near)**2))&&(TM.copy(s).invert(),Oa.copy(e.ray).applyMatrix4(TM),!(r.boundingBox!==null&&Oa.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,t,Oa)))}_computeIntersections(e,t,r){let i;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,h=s.attributes.uv,d=s.attributes.uv1,f=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,x=p.length;v<x;v++){const _=p[v],g=o[_.materialIndex],S=Math.max(_.start,m.start),b=Math.min(a.count,Math.min(_.start+_.count,m.start+m.count));for(let M=S,C=b;M<C;M+=3){const A=a.getX(M),R=a.getX(M+1),O=a.getX(M+2);i=Kp(this,g,e,r,h,d,f,A,R,O),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=_.materialIndex,t.push(i))}}else{const v=Math.max(0,m.start),x=Math.min(a.count,m.start+m.count);for(let _=v,g=x;_<g;_+=3){const S=a.getX(_),b=a.getX(_+1),M=a.getX(_+2);i=Kp(this,o,e,r,h,d,f,S,b,M),i&&(i.faceIndex=Math.floor(_/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let v=0,x=p.length;v<x;v++){const _=p[v],g=o[_.materialIndex],S=Math.max(_.start,m.start),b=Math.min(l.count,Math.min(_.start+_.count,m.start+m.count));for(let M=S,C=b;M<C;M+=3){const A=M,R=M+1,O=M+2;i=Kp(this,g,e,r,h,d,f,A,R,O),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=_.materialIndex,t.push(i))}}else{const v=Math.max(0,m.start),x=Math.min(l.count,m.start+m.count);for(let _=v,g=x;_<g;_+=3){const S=_,b=_+1,M=_+2;i=Kp(this,o,e,r,h,d,f,S,b,M),i&&(i.faceIndex=Math.floor(_/3),t.push(i))}}}}function e7(n,e,t,r,i,s,o,a){let l;if(e.side===Ar?l=r.intersectTriangle(o,s,i,!0,a):l=r.intersectTriangle(i,s,o,e.side===uo,a),l===null)return null;$p.copy(a),$p.applyMatrix4(n.matrixWorld);const h=t.ray.origin.distanceTo($p);return h<t.near||h>t.far?null:{distance:h,point:$p.clone(),object:n}}function Kp(n,e,t,r,i,s,o,a,l,h){n.getVertexPosition(a,ac),n.getVertexPosition(l,lc),n.getVertexPosition(h,cc);const d=e7(n,e,t,r,ac,lc,cc,qp);if(d){i&&(jp.fromBufferAttribute(i,a),Xp.fromBufferAttribute(i,l),Yp.fromBufferAttribute(i,h),d.uv=kr.getInterpolation(qp,ac,lc,cc,jp,Xp,Yp,new ye)),s&&(jp.fromBufferAttribute(s,a),Xp.fromBufferAttribute(s,l),Yp.fromBufferAttribute(s,h),d.uv1=kr.getInterpolation(qp,ac,lc,cc,jp,Xp,Yp,new ye),d.uv2=d.uv1),o&&(EM.fromBufferAttribute(o,a),AM.fromBufferAttribute(o,l),CM.fromBufferAttribute(o,h),d.normal=kr.getInterpolation(qp,ac,lc,cc,EM,AM,CM,new z),d.normal.dot(r.direction)>0&&d.normal.multiplyScalar(-1));const f={a,b:l,c:h,normal:new z,materialIndex:0};kr.getNormal(ac,lc,cc,f.normal),d.face=f}return d}class Pl extends dt{constructor(e=1,t=1,r=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const l=[],h=[],d=[],f=[];let p=0,m=0;v("z","y","x",-1,-1,r,t,e,o,s,0),v("z","y","x",1,-1,r,t,-e,o,s,1),v("x","z","y",1,1,e,r,t,i,o,2),v("x","z","y",1,-1,e,r,-t,i,o,3),v("x","y","z",1,-1,e,t,r,i,s,4),v("x","y","z",-1,-1,e,t,-r,i,s,5),this.setIndex(l),this.setAttribute("position",new qe(h,3)),this.setAttribute("normal",new qe(d,3)),this.setAttribute("uv",new qe(f,2));function v(x,_,g,S,b,M,C,A,R,O,P){const I=M/R,H=C/O,X=M/2,se=C/2,W=A/2,$=R+1,Z=O+1;let re=0,F=0;const U=new z;for(let G=0;G<Z;G++){const Y=G*H-se;for(let ee=0;ee<$;ee++){const K=ee*I-X;U[x]=K*S,U[_]=Y*b,U[g]=W,h.push(U.x,U.y,U.z),U[x]=0,U[_]=0,U[g]=A>0?1:-1,d.push(U.x,U.y,U.z),f.push(ee/R),f.push(1-G/O),re+=1}}for(let G=0;G<O;G++)for(let Y=0;Y<R;Y++){const ee=p+Y+$*G,K=p+Y+$*(G+1),ie=p+(Y+1)+$*(G+1),me=p+(Y+1)+$*G;l.push(ee,K,me),l.push(K,ie,me),F+=6}a.addGroup(m,F,P),m+=F,p+=re}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Pl(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function xu(n){const e={};for(const t in n){e[t]={};for(const r in n[t]){const i=n[t][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][r]=null):e[t][r]=i.clone():Array.isArray(i)?e[t][r]=i.slice():e[t][r]=i}}return e}function Sr(n){const e={};for(let t=0;t<n.length;t++){const r=xu(n[t]);for(const i in r)e[i]=r[i]}return e}function t7(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function AI(n){return n.getRenderTarget()===null?n.outputColorSpace:Gt.workingColorSpace}const CI={clone:xu,merge:Sr};var n7=`void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,r7=`void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class Rs extends yr{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=n7,this.fragmentShader=r7,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!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=xu(e.uniforms),this.uniformsGroups=t7(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 t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const o=this.uniforms[i].value;o&&o.isTexture?t.uniforms[i]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[i]={type:"m4",value:o.toArray()}:t.uniforms[i]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(t.extensions=r),t}}class nf extends Wt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ft,this.projectionMatrix=new ft,this.projectionMatrixInverse=new ft,this.coordinateSystem=Yi}copy(e,t){return super.copy(e,t),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,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Yn extends nf{constructor(e=50,t=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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 t=.5*this.getFilmHeight()/e;this.fov=_u*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(dl*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return _u*2*Math.atan(Math.tan(dl*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,r,i,s,o){this.aspect=e/t,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=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(dl*.5*this.fov)/this.zoom,r=2*t,i=this.aspect*r,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,h=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*r/h,i*=o.width/l,r*=o.height/h}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const uc=-90,hc=1;class PI extends Wt{constructor(e,t,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Yn(uc,hc,e,t);i.layers=this.layers,this.add(i);const s=new Yn(uc,hc,e,t);s.layers=this.layers,this.add(s);const o=new Yn(uc,hc,e,t);o.layers=this.layers,this.add(o);const a=new Yn(uc,hc,e,t);a.layers=this.layers,this.add(a);const l=new Yn(uc,hc,e,t);l.layers=this.layers,this.add(l);const h=new Yn(uc,hc,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[r,i,s,o,a,l]=t;for(const h of t)this.remove(h);if(e===Yi)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===vu)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.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 h of t)this.add(h),h.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,h,d]=this.children,f=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const x=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(t,s),e.setRenderTarget(r,1,i),e.render(t,o),e.setRenderTarget(r,2,i),e.render(t,a),e.setRenderTarget(r,3,i),e.render(t,l),e.setRenderTarget(r,4,i),e.render(t,h),r.texture.generateMipmaps=x,e.setRenderTarget(r,5,i),e.render(t,d),e.setRenderTarget(f,p,m),e.xr.enabled=v,r.texture.needsPMREMUpdate=!0}}class rf extends Mn{constructor(e,t,r,i,s,o,a,l,h,d){e=e!==void 0?e:[],t=t!==void 0?t:ho,super(e,t,r,i,s,o,a,l,h,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class RI extends ts{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];t.encoding!==void 0&&(Yh("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===aa?Nn:ni),this.texture=new rf(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Tn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const r={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 );
}
`},i=new Pl(5,5,5),s=new Rs({name:"CubemapFromEquirect",uniforms:xu(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Ar,blending:no});s.uniforms.tEquirect.value=t;const o=new Un(i,s),a=t.minFilter;return t.minFilter===ga&&(t.minFilter=Tn),new PI(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,r,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,r,i);e.setRenderTarget(s)}}const Vv=new z,i7=new z,s7=new At;class ko{constructor(e=new z(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,r,i){return this.normal.set(e,t,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,r){const i=Vv.subVectors(r,t).cross(i7.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,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,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const r=e.delta(Vv),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(r,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>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,t){const r=t||s7.getNormalMatrix(e),i=this.coplanarPoint(Vv).applyMatrix4(e),s=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(s),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 Ua=new mr,Zp=new z;class sf{constructor(e=new ko,t=new ko,r=new ko,i=new ko,s=new ko,o=new ko){this.planes=[e,t,r,i,s,o]}set(e,t,r,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let r=0;r<6;r++)t[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,t=Yi){const r=this.planes,i=e.elements,s=i[0],o=i[1],a=i[2],l=i[3],h=i[4],d=i[5],f=i[6],p=i[7],m=i[8],v=i[9],x=i[10],_=i[11],g=i[12],S=i[13],b=i[14],M=i[15];if(r[0].setComponents(l-s,p-h,_-m,M-g).normalize(),r[1].setComponents(l+s,p+h,_+m,M+g).normalize(),r[2].setComponents(l+o,p+d,_+v,M+S).normalize(),r[3].setComponents(l-o,p-d,_-v,M-S).normalize(),r[4].setComponents(l-a,p-f,_-x,M-b).normalize(),t===Yi)r[5].setComponents(l+a,p+f,_+x,M+b).normalize();else if(t===vu)r[5].setComponents(a,f,x,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ua.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Ua.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ua)}intersectsSprite(e){return Ua.center.set(0,0,0),Ua.radius=.7071067811865476,Ua.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ua)}intersectsSphere(e){const t=this.planes,r=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let r=0;r<6;r++){const i=t[r];if(Zp.x=i.normal.x>0?e.max.x:e.min.x,Zp.y=i.normal.y>0?e.max.y:e.min.y,Zp.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Zp)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function II(){let n=null,e=!1,t=null,r=null;function i(s,o){t(s,o),r=n.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(r=n.requestAnimationFrame(i),e=!0)},stop:function(){n.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function o7(n,e){const t=e.isWebGL2,r=new WeakMap;function i(h,d){const f=h.array,p=h.usage,m=f.byteLength,v=n.createBuffer();n.bindBuffer(d,v),n.bufferData(d,f,p),h.onUploadCallback();let x;if(f instanceof Float32Array)x=n.FLOAT;else if(f instanceof Uint16Array)if(h.isFloat16BufferAttribute)if(t)x=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else x=n.UNSIGNED_SHORT;else if(f instanceof Int16Array)x=n.SHORT;else if(f instanceof Uint32Array)x=n.UNSIGNED_INT;else if(f instanceof Int32Array)x=n.INT;else if(f instanceof Int8Array)x=n.BYTE;else if(f instanceof Uint8Array)x=n.UNSIGNED_BYTE;else if(f instanceof Uint8ClampedArray)x=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:v,type:x,bytesPerElement:f.BYTES_PER_ELEMENT,version:h.version,size:m}}function s(h,d,f){const p=d.array,m=d._updateRange,v=d.updateRanges;if(n.bindBuffer(f,h),m.count===-1&&v.length===0&&n.bufferSubData(f,0,p),v.length!==0){for(let x=0,_=v.length;x<_;x++){const g=v[x];t?n.bufferSubData(f,g.start*p.BYTES_PER_ELEMENT,p,g.start,g.count):n.bufferSubData(f,g.start*p.BYTES_PER_ELEMENT,p.subarray(g.start,g.start+g.count))}d.clearUpdateRanges()}m.count!==-1&&(t?n.bufferSubData(f,m.offset*p.BYTES_PER_ELEMENT,p,m.offset,m.count):n.bufferSubData(f,m.offset*p.BYTES_PER_ELEMENT,p.subarray(m.offset,m.offset+m.count)),m.count=-1),d.onUploadCallback()}function o(h){return h.isInterleavedBufferAttribute&&(h=h.data),r.get(h)}function a(h){h.isInterleavedBufferAttribute&&(h=h.data);const d=r.get(h);d&&(n.deleteBuffer(d.buffer),r.delete(h))}function l(h,d){if(h.isGLBufferAttribute){const p=r.get(h);(!p||p.version<h.version)&&r.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}h.isInterleavedBufferAttribute&&(h=h.data);const f=r.get(h);if(f===void 0)r.set(h,i(h,d));else if(f.version<h.version){if(f.size!==h.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.");s(f.buffer,h,d),f.version=h.version}}return{get:o,remove:a,update:l}}class Nu extends dt{constructor(e=1,t=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:i};const s=e/2,o=t/2,a=Math.floor(r),l=Math.floor(i),h=a+1,d=l+1,f=e/a,p=t/l,m=[],v=[],x=[],_=[];for(let g=0;g<d;g++){const S=g*p-o;for(let b=0;b<h;b++){const M=b*f-s;v.push(M,-S,0),x.push(0,0,1),_.push(b/a),_.push(1-g/l)}}for(let g=0;g<l;g++)for(let S=0;S<a;S++){const b=S+h*g,M=S+h*(g+1),C=S+1+h*(g+1),A=S+1+h*g;m.push(b,M,A),m.push(M,C,A)}this.setIndex(m),this.setAttribute("position",new qe(v,3)),this.setAttribute("normal",new qe(x,3)),this.setAttribute("uv",new qe(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nu(e.width,e.height,e.widthSegments,e.heightSegments)}}var a7=`#ifdef USE_ALPHAHASH
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,l7=`#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`,c7=`#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,u7=`#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,h7=`#ifdef USE_ALPHATEST
if ( diffuseColor.a < alphaTest ) discard;
#endif`,d7=`#ifdef USE_ALPHATEST
uniform float alphaTest;
#endif`,f7=`#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`,p7=`#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`,m7=`#ifdef USE_BATCHING
attribute float batchId;
uniform highp sampler2D batchingTexture;
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 );
}
#endif`,g7=`#ifdef USE_BATCHING
mat4 batchingMatrix = getBatchingMatrix( batchId );
#endif`,y7=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
vPosition = vec3( position );
#endif`,v7=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`,_7=`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`,x7=`#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`,S7=`#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`,b7=`#if NUM_CLIPPING_PLANES > 0
vec4 plane;
#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`,w7=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,T7=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`,M7=`#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`,E7=`#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`,A7=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`,C7=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
varying vec3 vColor;
#endif`,P7=`#if defined( USE_COLOR_ALPHA )
vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
vColor.xyz *= instanceColor.xyz;
#endif`,R7=`#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;
}
float luminance( const in vec3 rgb ) {
const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
return dot( weights, rgb );
}
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`,I7=`#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`,L7=`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`,F7=`#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`,N7=`#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,D7=`#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,O7=`#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`,U7="gl_FragColor = linearToOutputTexel( gl_FragColor );",k7=`
const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(
vec3( 0.8224621, 0.177538, 0.0 ),
vec3( 0.0331941, 0.9668058, 0.0 ),
vec3( 0.0170827, 0.0723974, 0.9105199 )
);
const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(
vec3( 1.2249401, - 0.2249404, 0.0 ),
vec3( - 0.0420569, 1.0420571, 0.0 ),
vec3( - 0.0196376, - 0.0786361, 1.0982735 )
);
vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {
return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );
}
vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {
return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );
}
vec4 LinearTransferOETF( in vec4 value ) {
return value;
}
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 );
}
vec4 LinearToLinear( in vec4 value ) {
return value;
}
vec4 LinearTosRGB( in vec4 value ) {
return sRGBTransferOETF( value );
}`,B7=`#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, 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`,z7=`#ifdef USE_ENVMAP
uniform float envMapIntensity;
uniform float flipEnvMap;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
#endif`,W7=`#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`,H7=`#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`,G7=`#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`,V7=`#ifdef USE_FOG
vFogDepth = - mvPosition.z;
#endif`,j7=`#ifdef USE_FOG
varying float vFogDepth;
#endif`,X7=`#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`,Y7=`#ifdef USE_FOG
uniform vec3 fogColor;
varying float vFogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`,q7=`#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
}`,$7=`#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
reflectedLight.indirectDiffuse += lightMapIrradiance;
#endif`,K7=`#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`,Z7=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,Q7=`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`,J7=`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 ) {
#if defined ( LEGACY_LIGHTS )
if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
}
return 1.0;
#else
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
if ( cutoffDistance > 0.0 ) {
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
}
return distanceFalloff;
#endif
}
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`,ej=`#ifdef USE_ENVMAP
vec3 getIBLIrradiance( const in vec3 normal ) {
#ifdef ENVMAP_TYPE_CUBE_UV
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, 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, 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`,tj=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,nj=`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`,rj=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,ij=`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`,sj=`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_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`,oj=`struct PhysicalMaterial {
vec3 diffuseColor;
float roughness;
vec3 specularColor;
float specularF90;
#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 );
}`,aj=`
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.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.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.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`,lj=`#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`,cj=`#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`,uj=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,hj=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`,dj=`#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
varying float vFragDepth;
varying float vIsPerspective;
#else
uniform float logDepthBufFC;
#endif
#endif`,fj=`#ifdef USE_LOGDEPTHBUF
#ifdef USE_LOGDEPTHBUF_EXT
vFragDepth = 1.0 + gl_Position.w;
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#else
if ( isPerspectiveMatrix( projectionMatrix ) ) {
gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
gl_Position.z *= gl_Position.w;
}
#endif
#endif`,pj=`#ifdef USE_MAP
vec4 sampledDiffuseColor = texture2D( map, vMapUv );
#ifdef DECODE_VIDEO_TEXTURE
sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
#endif
diffuseColor *= sampledDiffuseColor;
#endif`,mj=`#ifdef USE_MAP
uniform sampler2D map;
#endif`,gj=`#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`,yj=`#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`,vj=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
metalnessFactor *= texelMetalness.b;
#endif`,_j=`#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`,xj=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
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`,Sj=`#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
}
#else
objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
#endif
#endif`,bj=`#ifdef USE_MORPHTARGETS
uniform float morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
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 );
}
#else
#ifndef USE_MORPHNORMALS
uniform float morphTargetInfluences[ 8 ];
#else
uniform float morphTargetInfluences[ 4 ];
#endif
#endif
#endif`,wj=`#ifdef USE_MORPHTARGETS
transformed *= morphTargetBaseInfluence;
#ifdef MORPHTARGETS_TEXTURE
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
}
#else
transformed += morphTarget0 * morphTargetInfluences[ 0 ];
transformed += morphTarget1 * morphTargetInfluences[ 1 ];
transformed += morphTarget2 * morphTargetInfluences[ 2 ];
transformed += morphTarget3 * morphTargetInfluences[ 3 ];
#ifndef USE_MORPHNORMALS
transformed += morphTarget4 * morphTargetInfluences[ 4 ];
transformed += morphTarget5 * morphTargetInfluences[ 5 ];
transformed += morphTarget6 * morphTargetInfluences[ 6 ];
transformed += morphTarget7 * morphTargetInfluences[ 7 ];
#endif
#endif
#endif`,Tj=`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;`,Mj=`#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`,Ej=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,Aj=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,Cj=`#ifndef FLAT_SHADED
vNormal = normalize( transformedNormal );
#ifdef USE_TANGENT
vTangent = normalize( transformedTangent );
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
#endif
#endif`,Pj=`#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`,Rj=`#ifdef USE_CLEARCOAT
vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,Ij=`#ifdef USE_CLEARCOAT_NORMALMAP
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
clearcoatMapN.xy *= clearcoatNormalScale;
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,Lj=`#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`,Fj=`#ifdef USE_IRIDESCENCEMAP
uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
uniform sampler2D iridescenceThicknessMap;
#endif`,Nj=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Dj=`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 vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
vec4 r = vec4( fract( v * PackFactors ), v );
r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
return dot( v, UnpackFactors );
}
vec2 packDepthToRG( in highp float v ) {
return packDepthToRGBA( v ).yx;
}
float unpackRGToDepth( const in highp vec2 v ) {
return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );
}
vec4 pack2HalfToRGBA( 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( 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 );
}`,Oj=`#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`,Uj=`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;`,kj=`#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,Bj=`#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`,zj=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
roughnessFactor *= texelRoughness.g;
#endif`,Wj=`#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`,Hj=`#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 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 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 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 ) {
return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
}
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 );
float hard_shadow = step( compare , distribution.x );
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 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 shadow;
}
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 shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
vec3 lightToPosition = shadowCoord.xyz;
float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
vec3 bd3D = normalize( lightToPosition );
#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
return (
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
return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
#endif
}
#endif`,Gj=`#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 shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
struct SpotLightShadow {
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 shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
#endif`,Vj=`#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`,jj=`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.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.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.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
}
#pragma unroll_loop_end
#endif
#endif
return shadow;
}`,Xj=`#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,Yj=`#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`,qj=`#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`,$j=`#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`,Kj=`float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`,Zj=`#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`,Qj=`#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,Jj=`#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 OptimizedCineonToneMapping( 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 = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
color *= toneMappingExposure;
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;
return color;
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,eX=`#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.ior, material.thickness,
material.attenuationColor, material.attenuationDistance );
material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,tX=`#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 ior, const in float thickness,
const in vec3 attenuationColor, const in float attenuationDistance ) {
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;
vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
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`,nX=`#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`,rX=`#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`,iX=`#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`,sX=`#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 oX=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,aX=`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>
}`,lX=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,cX=`#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;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
#ifdef ENVMAP_TYPE_CUBE
vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
#elif defined( ENVMAP_TYPE_CUBE_UV )
vec4 texColor = textureCubeUV( envMap, 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>
}`,uX=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,hX=`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>
}`,dX=`#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>
#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;
}`,fX=`#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() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( 1.0 );
#if DEPTH_PACKING == 3200
diffuseColor.a = opacity;
#endif
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <logdepthbuf_fragment>
float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
#if DEPTH_PACKING == 3200
gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
#elif DEPTH_PACKING == 3201
gl_FragColor = packDepthToRGBA( fragCoordZ );
#endif
}`,pX=`#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>
#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;
}`,mX=`#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 () {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( 1.0 );
#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 );
}`,gX=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}`,yX=`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>
}`,vX=`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 <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,_X=`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() {
#include <clipping_planes_fragment>
if ( mod( vLineDistance, totalSize ) > dashSize ) {
discard;
}
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#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>
}`,xX=`#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 <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>
}`,SX=`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() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
#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>
}`,bX=`#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 <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>
}`,wX=`#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() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
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>
}`,TX=`#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 <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;
}`,MX=`#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() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
#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>
}`,EX=`#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 <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
}`,AX=`#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() {
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
#ifdef OPAQUE
gl_FragColor.a = 1.0;
#endif
}`,CX=`#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 <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>
}`,PX=`#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() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
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>
}`,RX=`#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 <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
}`,IX=`#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_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() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
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>
}`,LX=`#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 <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>
}`,FX=`#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() {
#include <clipping_planes_fragment>
vec4 diffuseColor = vec4( diffuse, opacity );
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>
}`,NX=`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 <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>
}`,DX=`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() {
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#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>
}`,OX=`#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 <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>
}`,UX=`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>
}`,kX=`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 * 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 ) );
#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>
}`,BX=`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() {
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
vec4 diffuseColor = vec4( diffuse, opacity );
#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>
}`,Tt={alphahash_fragment:a7,alphahash_pars_fragment:l7,alphamap_fragment:c7,alphamap_pars_fragment:u7,alphatest_fragment:h7,alphatest_pars_fragment:d7,aomap_fragment:f7,aomap_pars_fragment:p7,batching_pars_vertex:m7,batching_vertex:g7,begin_vertex:y7,beginnormal_vertex:v7,bsdfs:_7,iridescence_fragment:x7,bumpmap_pars_fragment:S7,clipping_planes_fragment:b7,clipping_planes_pars_fragment:w7,clipping_planes_pars_vertex:T7,clipping_planes_vertex:M7,color_fragment:E7,color_pars_fragment:A7,color_pars_vertex:C7,color_vertex:P7,common:R7,cube_uv_reflection_fragment:I7,defaultnormal_vertex:L7,displacementmap_pars_vertex:F7,displacementmap_vertex:N7,emissivemap_fragment:D7,emissivemap_pars_fragment:O7,colorspace_fragment:U7,colorspace_pars_fragment:k7,envmap_fragment:B7,envmap_common_pars_fragment:z7,envmap_pars_fragment:W7,envmap_pars_vertex:H7,envmap_physical_pars_fragment:ej,envmap_vertex:G7,fog_vertex:V7,fog_pars_vertex:j7,fog_fragment:X7,fog_pars_fragment:Y7,gradientmap_pars_fragment:q7,lightmap_fragment:$7,lightmap_pars_fragment:K7,lights_lambert_fragment:Z7,lights_lambert_pars_fragment:Q7,lights_pars_begin:J7,lights_toon_fragment:tj,lights_toon_pars_fragment:nj,lights_phong_fragment:rj,lights_phong_pars_fragment:ij,lights_physical_fragment:sj,lights_physical_pars_fragment:oj,lights_fragment_begin:aj,lights_fragment_maps:lj,lights_fragment_end:cj,logdepthbuf_fragment:uj,logdepthbuf_pars_fragment:hj,logdepthbuf_pars_vertex:dj,logdepthbuf_vertex:fj,map_fragment:pj,map_pars_fragment:mj,map_particle_fragment:gj,map_particle_pars_fragment:yj,metalnessmap_fragment:vj,metalnessmap_pars_fragment:_j,morphcolor_vertex:xj,morphnormal_vertex:Sj,morphtarget_pars_vertex:bj,morphtarget_vertex:wj,normal_fragment_begin:Tj,normal_fragment_maps:Mj,normal_pars_fragment:Ej,normal_pars_vertex:Aj,normal_vertex:Cj,normalmap_pars_fragment:Pj,clearcoat_normal_fragment_begin:Rj,clearcoat_normal_fragment_maps:Ij,clearcoat_pars_fragment:Lj,iridescence_pars_fragment:Fj,opaque_fragment:Nj,packing:Dj,premultiplied_alpha_fragment:Oj,project_vertex:Uj,dithering_fragment:kj,dithering_pars_fragment:Bj,roughnessmap_fragment:zj,roughnessmap_pars_fragment:Wj,shadowmap_pars_fragment:Hj,shadowmap_pars_vertex:Gj,shadowmap_vertex:Vj,shadowmask_pars_fragment:jj,skinbase_vertex:Xj,skinning_pars_vertex:Yj,skinning_vertex:qj,skinnormal_vertex:$j,specularmap_fragment:Kj,specularmap_pars_fragment:Zj,tonemapping_fragment:Qj,tonemapping_pars_fragment:Jj,transmission_fragment:eX,transmission_pars_fragment:tX,uv_pars_fragment:nX,uv_pars_vertex:rX,uv_vertex:iX,worldpos_vertex:sX,background_vert:oX,background_frag:aX,backgroundCube_vert:lX,backgroundCube_frag:cX,cube_vert:uX,cube_frag:hX,depth_vert:dX,depth_frag:fX,distanceRGBA_vert:pX,distanceRGBA_frag:mX,equirect_vert:gX,equirect_frag:yX,linedashed_vert:vX,linedashed_frag:_X,meshbasic_vert:xX,meshbasic_frag:SX,meshlambert_vert:bX,meshlambert_frag:wX,meshmatcap_vert:TX,meshmatcap_frag:MX,meshnormal_vert:EX,meshnormal_frag:AX,meshphong_vert:CX,meshphong_frag:PX,meshphysical_vert:RX,meshphysical_frag:IX,meshtoon_vert:LX,meshtoon_frag:FX,points_vert:NX,points_frag:DX,shadow_vert:OX,shadow_frag:UX,sprite_vert:kX,sprite_frag:BX},Le={common:{diffuse:{value:new We(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new At},alphaMap:{value:null},alphaMapTransform:{value:new At},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new At}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new At}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new At}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new At},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new At},normalScale:{value:new ye(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new At},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new At}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new At}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new At}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new We(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new We(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new At},alphaTest:{value:0},uvTransform:{value:new At}},sprite:{diffuse:{value:new We(16777215)},opacity:{value:1},center:{value:new ye(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new At},alphaMap:{value:null},alphaMapTransform:{value:new At},alphaTest:{value:0}}},Vi={basic:{uniforms:Sr([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:Tt.meshbasic_vert,fragmentShader:Tt.meshbasic_frag},lambert:{uniforms:Sr([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new We(0)}}]),vertexShader:Tt.meshlambert_vert,fragmentShader:Tt.meshlambert_frag},phong:{uniforms:Sr([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new We(0)},specular:{value:new We(1118481)},shininess:{value:30}}]),vertexShader:Tt.meshphong_vert,fragmentShader:Tt.meshphong_frag},standard:{uniforms:Sr([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new We(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag},toon:{uniforms:Sr([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new We(0)}}]),vertexShader:Tt.meshtoon_vert,fragmentShader:Tt.meshtoon_frag},matcap:{uniforms:Sr([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:Tt.meshmatcap_vert,fragmentShader:Tt.meshmatcap_frag},points:{uniforms:Sr([Le.points,Le.fog]),vertexShader:Tt.points_vert,fragmentShader:Tt.points_frag},dashed:{uniforms:Sr([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Tt.linedashed_vert,fragmentShader:Tt.linedashed_frag},depth:{uniforms:Sr([Le.common,Le.displacementmap]),vertexShader:Tt.depth_vert,fragmentShader:Tt.depth_frag},normal:{uniforms:Sr([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:Tt.meshnormal_vert,fragmentShader:Tt.meshnormal_frag},sprite:{uniforms:Sr([Le.sprite,Le.fog]),vertexShader:Tt.sprite_vert,fragmentShader:Tt.sprite_frag},background:{uniforms:{uvTransform:{value:new At},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Tt.background_vert,fragmentShader:Tt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Tt.backgroundCube_vert,fragmentShader:Tt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Tt.cube_vert,fragmentShader:Tt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Tt.equirect_vert,fragmentShader:Tt.equirect_frag},distanceRGBA:{uniforms:Sr([Le.common,Le.displacementmap,{referencePosition:{value:new z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Tt.distanceRGBA_vert,fragmentShader:Tt.distanceRGBA_frag},shadow:{uniforms:Sr([Le.lights,Le.fog,{color:{value:new We(0)},opacity:{value:1}}]),vertexShader:Tt.shadow_vert,fragmentShader:Tt.shadow_frag}};Vi.physical={uniforms:Sr([Vi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new At},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new At},clearcoatNormalScale:{value:new ye(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new At},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new At},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new At},sheen:{value:0},sheenColor:{value:new We(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new At},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new At},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new At},transmissionSamplerSize:{value:new ye},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new At},attenuationDistance:{value:0},attenuationColor:{value:new We(0)},specularColor:{value:new We(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new At},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new At},anisotropyVector:{value:new ye},anisotropyMap:{value:null},anisotropyMapTransform:{value:new At}}]),vertexShader:Tt.meshphysical_vert,fragmentShader:Tt.meshphysical_frag};const Qp={r:0,b:0,g:0};function zX(n,e,t,r,i,s,o){const a=new We(0);let l=s===!0?0:1,h,d,f=null,p=0,m=null;function v(_,g){let S=!1,b=g.isScene===!0?g.background:null;b&&b.isTexture&&(b=(g.backgroundBlurriness>0?t:e).get(b)),b===null?x(a,l):b&&b.isColor&&(x(b,1),S=!0);const M=n.xr.getEnvironmentBlendMode();M==="additive"?r.buffers.color.setClear(0,0,0,1,o):M==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),b&&(b.isCubeTexture||b.mapping===Lu)?(d===void 0&&(d=new Un(new Pl(1,1,1),new Rs({name:"BackgroundCubeMaterial",uniforms:xu(Vi.backgroundCube.uniforms),vertexShader:Vi.backgroundCube.vertexShader,fragmentShader:Vi.backgroundCube.fragmentShader,side:Ar,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(C,A,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),d.material.uniforms.envMap.value=b,d.material.uniforms.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,d.material.toneMapped=Gt.getTransfer(b.colorSpace)!==$t,(f!==b||p!==b.version||m!==n.toneMapping)&&(d.material.needsUpdate=!0,f=b,p=b.version,m=n.toneMapping),d.layers.enableAll(),_.unshift(d,d.geometry,d.material,0,0,null)):b&&b.isTexture&&(h===void 0&&(h=new Un(new Nu(2,2),new Rs({name:"BackgroundMaterial",uniforms:xu(Vi.background.uniforms),vertexShader:Vi.background.vertexShader,fragmentShader:Vi.background.fragmentShader,side:uo,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(h)),h.material.uniforms.t2D.value=b,h.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,h.material.toneMapped=Gt.getTransfer(b.colorSpace)!==$t,b.matrixAutoUpdate===!0&&b.updateMatrix(),h.material.uniforms.uvTransform.value.copy(b.matrix),(f!==b||p!==b.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,f=b,p=b.version,m=n.toneMapping),h.layers.enableAll(),_.unshift(h,h.geometry,h.material,0,0,null))}function x(_,g){_.getRGB(Qp,AI(n)),r.buffers.color.setClear(Qp.r,Qp.g,Qp.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(_,g=1){a.set(_),l=g,x(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(_){l=_,x(a,l)},render:v}}function WX(n,e,t,r){const i=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||s!==null,a={},l=_(null);let h=l,d=!1;function f(W,$,Z,re,F){let U=!1;if(o){const G=x(re,Z,$);h!==G&&(h=G,m(h.object)),U=g(W,re,Z,F),U&&S(W,re,Z,F)}else{const G=$.wireframe===!0;(h.geometry!==re.id||h.program!==Z.id||h.wireframe!==G)&&(h.geometry=re.id,h.program=Z.id,h.wireframe=G,U=!0)}F!==null&&t.update(F,n.ELEMENT_ARRAY_BUFFER),(U||d)&&(d=!1,O(W,$,Z,re),F!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(F).buffer))}function p(){return r.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(W){return r.isWebGL2?n.bindVertexArray(W):s.bindVertexArrayOES(W)}function v(W){return r.isWebGL2?n.deleteVertexArray(W):s.deleteVertexArrayOES(W)}function x(W,$,Z){const re=Z.wireframe===!0;let F=a[W.id];F===void 0&&(F={},a[W.id]=F);let U=F[$.id];U===void 0&&(U={},F[$.id]=U);let G=U[re];return G===void 0&&(G=_(p()),U[re]=G),G}function _(W){const $=[],Z=[],re=[];for(let F=0;F<i;F++)$[F]=0,Z[F]=0,re[F]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:$,enabledAttributes:Z,attributeDivisors:re,object:W,attributes:{},index:null}}function g(W,$,Z,re){const F=h.attributes,U=$.attributes;let G=0;const Y=Z.getAttributes();for(const ee in Y)if(Y[ee].location>=0){const ie=F[ee];let me=U[ee];if(me===void 0&&(ee==="instanceMatrix"&&W.instanceMatrix&&(me=W.instanceMatrix),ee==="instanceColor"&&W.instanceColor&&(me=W.instanceColor)),ie===void 0||ie.attribute!==me||me&&ie.data!==me.data)return!0;G++}return h.attributesNum!==G||h.index!==re}function S(W,$,Z,re){const F={},U=$.attributes;let G=0;const Y=Z.getAttributes();for(const ee in Y)if(Y[ee].location>=0){let ie=U[ee];ie===void 0&&(ee==="instanceMatrix"&&W.instanceMatrix&&(ie=W.instanceMatrix),ee==="instanceColor"&&W.instanceColor&&(ie=W.instanceColor));const me={};me.attribute=ie,ie&&ie.data&&(me.data=ie.data),F[ee]=me,G++}h.attributes=F,h.attributesNum=G,h.index=re}function b(){const W=h.newAttributes;for(let $=0,Z=W.length;$<Z;$++)W[$]=0}function M(W){C(W,0)}function C(W,$){const Z=h.newAttributes,re=h.enabledAttributes,F=h.attributeDivisors;Z[W]=1,re[W]===0&&(n.enableVertexAttribArray(W),re[W]=1),F[W]!==$&&((r.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](W,$),F[W]=$)}function A(){const W=h.newAttributes,$=h.enabledAttributes;for(let Z=0,re=$.length;Z<re;Z++)$[Z]!==W[Z]&&(n.disableVertexAttribArray(Z),$[Z]=0)}function R(W,$,Z,re,F,U,G){G===!0?n.vertexAttribIPointer(W,$,Z,F,U):n.vertexAttribPointer(W,$,Z,re,F,U)}function O(W,$,Z,re){if(r.isWebGL2===!1&&(W.isInstancedMesh||re.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;b();const F=re.attributes,U=Z.getAttributes(),G=$.defaultAttributeValues;for(const Y in U){const ee=U[Y];if(ee.location>=0){let K=F[Y];if(K===void 0&&(Y==="instanceMatrix"&&W.instanceMatrix&&(K=W.instanceMatrix),Y==="instanceColor"&&W.instanceColor&&(K=W.instanceColor)),K!==void 0){const ie=K.normalized,me=K.itemSize,Ee=t.get(K);if(Ee===void 0)continue;const ge=Ee.buffer,tt=Ee.type,nt=Ee.bytesPerElement,Be=r.isWebGL2===!0&&(tt===n.INT||tt===n.UNSIGNED_INT||K.gpuType===XS);if(K.isInterleavedBufferAttribute){const Xe=K.data,j=Xe.stride,Se=K.offset;if(Xe.isInstancedInterleavedBuffer){for(let fe=0;fe<ee.locationSize;fe++)C(ee.location+fe,Xe.meshPerAttribute);W.isInstancedMesh!==!0&&re._maxInstanceCount===void 0&&(re._maxInstanceCount=Xe.meshPerAttribute*Xe.count)}else for(let fe=0;fe<ee.locationSize;fe++)M(ee.location+fe);n.bindBuffer(n.ARRAY_BUFFER,ge);for(let fe=0;fe<ee.locationSize;fe++)R(ee.location+fe,me/ee.locationSize,tt,ie,j*nt,(Se+me/ee.locationSize*fe)*nt,Be)}else{if(K.isInstancedBufferAttribute){for(let Xe=0;Xe<ee.locationSize;Xe++)C(ee.location+Xe,K.meshPerAttribute);W.isInstancedMesh!==!0&&re._maxInstanceCount===void 0&&(re._maxInstanceCount=K.meshPerAttribute*K.count)}else for(let Xe=0;Xe<ee.locationSize;Xe++)M(ee.location+Xe);n.bindBuffer(n.ARRAY_BUFFER,ge);for(let Xe=0;Xe<ee.locationSize;Xe++)R(ee.location+Xe,me/ee.locationSize,tt,ie,me*nt,me/ee.locationSize*Xe*nt,Be)}}else if(G!==void 0){const ie=G[Y];if(ie!==void 0)switch(ie.length){case 2:n.vertexAttrib2fv(ee.location,ie);break;case 3:n.vertexAttrib3fv(ee.location,ie);break;case 4:n.vertexAttrib4fv(ee.location,ie);break;default:n.vertexAttrib1fv(ee.location,ie)}}}}A()}function P(){X();for(const W in a){const $=a[W];for(const Z in $){const re=$[Z];for(const F in re)v(re[F].object),delete re[F];delete $[Z]}delete a[W]}}function I(W){if(a[W.id]===void 0)return;const $=a[W.id];for(const Z in $){const re=$[Z];for(const F in re)v(re[F].object),delete re[F];delete $[Z]}delete a[W.id]}function H(W){for(const $ in a){const Z=a[$];if(Z[W.id]===void 0)continue;const re=Z[W.id];for(const F in re)v(re[F].object),delete re[F];delete Z[W.id]}}function X(){se(),d=!0,h!==l&&(h=l,m(h.object))}function se(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:f,reset:X,resetDefaultState:se,dispose:P,releaseStatesOfGeometry:I,releaseStatesOfProgram:H,initAttributes:b,enableAttribute:M,disableUnusedAttributes:A}}function HX(n,e,t,r){const i=r.isWebGL2;let s;function o(d){s=d}function a(d,f){n.drawArrays(s,d,f),t.update(f,s,1)}function l(d,f,p){if(p===0)return;let m,v;if(i)m=n,v="drawArraysInstanced";else if(m=e.get("ANGLE_instanced_arrays"),v="drawArraysInstancedANGLE",m===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}m[v](s,d,f,p),t.update(f,s,p)}function h(d,f,p){if(p===0)return;const m=e.get("WEBGL_multi_draw");if(m===null)for(let v=0;v<p;v++)this.render(d[v],f[v]);else{m.multiDrawArraysWEBGL(s,d,0,f,0,p);let v=0;for(let x=0;x<p;x++)v+=f[x];t.update(v,s,1)}}this.setMode=o,this.render=a,this.renderInstances=l,this.renderMultiDraw=h}function GX(n,e,t){let r;function i(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const R=e.get("EXT_texture_filter_anisotropic");r=n.getParameter(R.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function s(R){if(R==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const h=o||e.has("WEBGL_draw_buffers"),d=t.logarithmicDepthBuffer===!0,f=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),x=n.getParameter(n.MAX_VERTEX_ATTRIBS),_=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),b=p>0,M=o||e.has("OES_texture_float"),C=b&&M,A=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:h,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:d,maxTextures:f,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:v,maxAttributes:x,maxVertexUniforms:_,maxVaryings:g,maxFragmentUniforms:S,vertexTextures:b,floatFragmentTextures:M,floatVertexTextures:C,maxSamples:A}}function VX(n){const e=this;let t=null,r=0,i=!1,s=!1;const o=new ko,a=new At,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,p){const m=f.length!==0||p||r!==0||i;return i=p,r=f.length,m},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,p){t=d(f,p,0)},this.setState=function(f,p,m){const v=f.clippingPlanes,x=f.clipIntersection,_=f.clipShadows,g=n.get(f);if(!i||v===null||v.length===0||s&&!_)s?d(null):h();else{const S=s?0:r,b=S*4;let M=g.clippingState||null;l.value=M,M=d(v,p,b,m);for(let C=0;C!==b;++C)M[C]=t[C];g.clippingState=M,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=S}};function h(){l.value!==t&&(l.value=t,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function d(f,p,m,v){const x=f!==null?f.length:0;let _=null;if(x!==0){if(_=l.value,v!==!0||_===null){const g=m+x*4,S=p.matrixWorldInverse;a.getNormalMatrix(S),(_===null||_.length<g)&&(_=new Float32Array(g));for(let b=0,M=m;b!==x;++b,M+=4)o.copy(f[b]).applyMatrix4(S,a),o.normal.toArray(_,M),_[M+3]=o.constant}l.value=_,l.needsUpdate=!0}return e.numPlanes=x,e.numIntersection=0,_}}function jX(n){let e=new WeakMap;function t(o,a){return a===Sd?o.mapping=ho:a===bd&&(o.mapping=ma),o}function r(o){if(o&&o.isTexture){const a=o.mapping;if(a===Sd||a===bd)if(e.has(o)){const l=e.get(o).texture;return t(l,o.mapping)}else{const l=o.image;if(l&&l.height>0){const h=new RI(l.height/2);return h.fromEquirectangularTexture(n,o),e.set(o,h),o.addEventListener("dispose",i),t(h.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:r,dispose:s}}class of extends nf{constructor(e=-1,t=1,r=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=r,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),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,t,r,i,s,o){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=t,this.view.offsetX=r,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=r-e,o=r+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,o=s+h*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Uc=4,PM=[.125,.215,.35,.446,.526,.582],qa=20,jv=new of,RM=new We;let Xv=null,Yv=0,qv=0;const Ya=(1+Math.sqrt(5))/2,dc=1/Ya,IM=[new z(1,1,1),new z(-1,1,1),new z(1,1,-1),new z(-1,1,-1),new z(0,Ya,dc),new z(0,Ya,-dc),new z(dc,0,Ya),new z(-dc,0,Ya),new z(Ya,dc,0),new z(-Ya,dc,0)];class yx{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,t=0,r=.1,i=100){Xv=this._renderer.getRenderTarget(),Yv=this._renderer.getActiveCubeFace(),qv=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,r,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=NM(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=FM(),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(Xv,Yv,qv),e.scissorTest=!1,Jp(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ho||e.mapping===ma?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Xv=this._renderer.getRenderTarget(),Yv=this._renderer.getActiveCubeFace(),qv=this._renderer.getActiveMipmapLevel();const r=t||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,r={magFilter:Tn,minFilter:Tn,generateMipmaps:!1,type:yu,format:Mr,colorSpace:Ps,depthBuffer:!1},i=LM(e,t,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=LM(e,t,r);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=XX(s)),this._blurMaterial=YX(s,e,t)}return i}_compileMaterial(e){const t=new Un(this._lodPlanes[0],e);this._renderer.compile(t,jv)}_sceneToCubeUV(e,t,r,i){const a=new Yn(90,1,t,r),l=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],d=this._renderer,f=d.autoClear,p=d.toneMapping;d.getClearColor(RM),d.toneMapping=Ms,d.autoClear=!1;const m=new ba({name:"PMREM.Background",side:Ar,depthWrite:!1,depthTest:!1}),v=new Un(new Pl,m);let x=!1;const _=e.background;_?_.isColor&&(m.color.copy(_),e.background=null,x=!0):(m.color.copy(RM),x=!0);for(let g=0;g<6;g++){const S=g%3;S===0?(a.up.set(0,l[g],0),a.lookAt(h[g],0,0)):S===1?(a.up.set(0,0,l[g]),a.lookAt(0,h[g],0)):(a.up.set(0,l[g],0),a.lookAt(0,0,h[g]));const b=this._cubeSize;Jp(i,S*b,g>2?b:0,b,b),d.setRenderTarget(i),x&&d.render(v,a),d.render(e,a)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=f,e.background=_}_textureToCubeUV(e,t){const r=this._renderer,i=e.mapping===ho||e.mapping===ma;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=NM()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=FM());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Un(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Jp(t,0,0,3*l,2*l),r.setRenderTarget(t),r.render(o,jv)}_applyPMREM(e){const t=this._renderer,r=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=IM[(i-1)%IM.length];this._blur(e,i-1,i,s,o)}t.autoClear=r}_blur(e,t,r,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,r,i,"latitudinal",s),this._halfBlur(o,e,r,r,i,"longitudinal",s)}_halfBlur(e,t,r,i,s,o,a){const l=this._renderer,h=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,f=new Un(this._lodPlanes[i],h),p=h.uniforms,m=this._sizeLods[r]-1,v=isFinite(s)?Math.PI/(2*m):2*Math.PI/(2*qa-1),x=s/v,_=isFinite(s)?1+Math.floor(d*x):qa;_>qa&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${qa}`);const g=[];let S=0;for(let R=0;R<qa;++R){const O=R/x,P=Math.exp(-O*O/2);g.push(P),R===0?S+=P:R<_&&(S+=2*P)}for(let R=0;R<g.length;R++)g[R]=g[R]/S;p.envMap.value=e.texture,p.samples.value=_,p.weights.value=g,p.latitudinal.value=o==="latitudinal",a&&(p.poleAxis.value=a);const{_lodMax:b}=this;p.dTheta.value=v,p.mipInt.value=b-r;const M=this._sizeLods[i],C=3*M*(i>b-Uc?i-b+Uc:0),A=4*(this._cubeSize-M);Jp(t,C,A,3*M,2*M),l.setRenderTarget(t),l.render(f,jv)}}function XX(n){const e=[],t=[],r=[];let i=n;const s=n-Uc+1+PM.length;for(let o=0;o<s;o++){const a=Math.pow(2,i);t.push(a);let l=1/a;o>n-Uc?l=PM[o-n+Uc-1]:o===0&&(l=0),r.push(l);const h=1/(a-2),d=-h,f=1+h,p=[d,d,f,d,f,f,d,d,f,f,d,f],m=6,v=6,x=3,_=2,g=1,S=new Float32Array(x*v*m),b=new Float32Array(_*v*m),M=new Float32Array(g*v*m);for(let A=0;A<m;A++){const R=A%3*2/3-1,O=A>2?0:-1,P=[R,O,0,R+2/3,O,0,R+2/3,O+1,0,R,O,0,R+2/3,O+1,0,R,O+1,0];S.set(P,x*v*A),b.set(p,_*v*A);const I=[A,A,A,A,A,A];M.set(I,g*v*A)}const C=new dt;C.setAttribute("position",new Xt(S,x)),C.setAttribute("uv",new Xt(b,_)),C.setAttribute("faceIndex",new Xt(M,g)),e.push(C),i>Uc&&i--}return{lodPlanes:e,sizeLods:t,sigmas:r}}function LM(n,e,t){const r=new ts(n,e,t);return r.texture.mapping=Lu,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Jp(n,e,t,r,i){n.viewport.set(e,t,r,i),n.scissor.set(e,t,r,i)}function YX(n,e,t){const r=new Float32Array(qa),i=new z(0,1,0);return new Rs({name:"SphericalGaussianBlur",defines:{n:qa,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:a1(),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:no,depthTest:!1,depthWrite:!1})}function FM(){return new Rs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:a1(),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:no,depthTest:!1,depthWrite:!1})}function NM(){return new Rs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:a1(),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:no,depthTest:!1,depthWrite:!1})}function a1(){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 qX(n){let e=new WeakMap,t=null;function r(a){if(a&&a.isTexture){const l=a.mapping,h=l===Sd||l===bd,d=l===ho||l===ma;if(h||d)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let f=e.get(a);return t===null&&(t=new yx(n)),f=h?t.fromEquirectangular(a,f):t.fromCubemap(a,f),e.set(a,f),f.texture}else{if(e.has(a))return e.get(a).texture;{const f=a.image;if(h&&f&&f.height>0||d&&f&&i(f)){t===null&&(t=new yx(n));const p=h?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function i(a){let l=0;const h=6;for(let d=0;d<h;d++)a[d]!==void 0&&l++;return l===h}function s(a){const l=a.target;l.removeEventListener("dispose",s);const h=e.get(l);h!==void 0&&(e.delete(l),h.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:r,dispose:o}}function $X(n){const e={};function t(r){if(e[r]!==void 0)return e[r];let i;switch(r){case"WEBGL_depth_texture":i=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=n.getExtension(r)}return e[r]=i,i}return{has:function(r){return t(r)!==null},init:function(r){r.isWebGL2?(t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance")):(t("WEBGL_depth_texture"),t("OES_texture_float"),t("OES_texture_half_float"),t("OES_texture_half_float_linear"),t("OES_standard_derivatives"),t("OES_element_index_uint"),t("OES_vertex_array_object"),t("ANGLE_instanced_arrays")),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture")},get:function(r){const i=t(r);return i===null&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),i}}}function KX(n,e,t,r){const i={},s=new WeakMap;function o(f){const p=f.target;p.index!==null&&e.remove(p.index);for(const v in p.attributes)e.remove(p.attributes[v]);for(const v in p.morphAttributes){const x=p.morphAttributes[v];for(let _=0,g=x.length;_<g;_++)e.remove(x[_])}p.removeEventListener("dispose",o),delete i[p.id];const m=s.get(p);m&&(e.remove(m),s.delete(p)),r.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function a(f,p){return i[p.id]===!0||(p.addEventListener("dispose",o),i[p.id]=!0,t.memory.geometries++),p}function l(f){const p=f.attributes;for(const v in p)e.update(p[v],n.ARRAY_BUFFER);const m=f.morphAttributes;for(const v in m){const x=m[v];for(let _=0,g=x.length;_<g;_++)e.update(x[_],n.ARRAY_BUFFER)}}function h(f){const p=[],m=f.index,v=f.attributes.position;let x=0;if(m!==null){const S=m.array;x=m.version;for(let b=0,M=S.length;b<M;b+=3){const C=S[b+0],A=S[b+1],R=S[b+2];p.push(C,A,A,R,R,C)}}else if(v!==void 0){const S=v.array;x=v.version;for(let b=0,M=S.length/3-1;b<M;b+=3){const C=b+0,A=b+1,R=b+2;p.push(C,A,A,R,R,C)}}else return;const _=new(wI(p)?o1:s1)(p,1);_.version=x;const g=s.get(f);g&&e.remove(g),s.set(f,_)}function d(f){const p=s.get(f);if(p){const m=f.index;m!==null&&p.version<m.version&&h(f)}else h(f);return s.get(f)}return{get:a,update:l,getWireframeAttribute:d}}function ZX(n,e,t,r){const i=r.isWebGL2;let s;function o(m){s=m}let a,l;function h(m){a=m.type,l=m.bytesPerElement}function d(m,v){n.drawElements(s,v,a,m*l),t.update(v,s,1)}function f(m,v,x){if(x===0)return;let _,g;if(i)_=n,g="drawElementsInstanced";else if(_=e.get("ANGLE_instanced_arrays"),g="drawElementsInstancedANGLE",_===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}_[g](s,v,a,m*l,x),t.update(v,s,x)}function p(m,v,x){if(x===0)return;const _=e.get("WEBGL_multi_draw");if(_===null)for(let g=0;g<x;g++)this.render(m[g]/l,v[g]);else{_.multiDrawElementsWEBGL(s,v,0,a,m,0,x);let g=0;for(let S=0;S<x;S++)g+=v[S];t.update(g,s,1)}}this.setMode=o,this.setIndex=h,this.render=d,this.renderInstances=f,this.renderMultiDraw=p}function QX(n){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function r(s,o,a){switch(t.calls++,o){case n.TRIANGLES:t.triangles+=a*(s/3);break;case n.LINES:t.lines+=a*(s/2);break;case n.LINE_STRIP:t.lines+=a*(s-1);break;case n.LINE_LOOP:t.lines+=a*s;break;case n.POINTS:t.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:r}}function JX(n,e){return n[0]-e[0]}function eY(n,e){return Math.abs(e[1])-Math.abs(n[1])}function tY(n,e,t){const r={},i=new Float32Array(8),s=new WeakMap,o=new Vt,a=[];for(let h=0;h<8;h++)a[h]=[h,0];function l(h,d,f){const p=h.morphTargetInfluences;if(e.isWebGL2===!0){const m=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,v=m!==void 0?m.length:0;let x=s.get(d);if(x===void 0||x.count!==v){let W=function(){X.dispose(),s.delete(d),d.removeEventListener("dispose",W)};x!==void 0&&x.texture.dispose();const S=d.morphAttributes.position!==void 0,b=d.morphAttributes.normal!==void 0,M=d.morphAttributes.color!==void 0,C=d.morphAttributes.position||[],A=d.morphAttributes.normal||[],R=d.morphAttributes.color||[];let O=0;S===!0&&(O=1),b===!0&&(O=2),M===!0&&(O=3);let P=d.attributes.position.count*O,I=1;P>e.maxTextureSize&&(I=Math.ceil(P/e.maxTextureSize),P=e.maxTextureSize);const H=new Float32Array(P*I*4*v),X=new mg(H,P,I,v);X.type=Xi,X.needsUpdate=!0;const se=O*4;for(let $=0;$<v;$++){const Z=C[$],re=A[$],F=R[$],U=P*I*4*$;for(let G=0;G<Z.count;G++){const Y=G*se;S===!0&&(o.fromBufferAttribute(Z,G),H[U+Y+0]=o.x,H[U+Y+1]=o.y,H[U+Y+2]=o.z,H[U+Y+3]=0),b===!0&&(o.fromBufferAttribute(re,G),H[U+Y+4]=o.x,H[U+Y+5]=o.y,H[U+Y+6]=o.z,H[U+Y+7]=0),M===!0&&(o.fromBufferAttribute(F,G),H[U+Y+8]=o.x,H[U+Y+9]=o.y,H[U+Y+10]=o.z,H[U+Y+11]=F.itemSize===4?o.w:1)}}x={count:v,texture:X,size:new ye(P,I)},s.set(d,x),d.addEventListener("dispose",W)}let _=0;for(let S=0;S<p.length;S++)_+=p[S];const g=d.morphTargetsRelative?1:1-_;f.getUniforms().setValue(n,"morphTargetBaseInfluence",g),f.getUniforms().setValue(n,"morphTargetInfluences",p),f.getUniforms().setValue(n,"morphTargetsTexture",x.texture,t),f.getUniforms().setValue(n,"morphTargetsTextureSize",x.size)}else{const m=p===void 0?0:p.length;let v=r[d.id];if(v===void 0||v.length!==m){v=[];for(let b=0;b<m;b++)v[b]=[b,0];r[d.id]=v}for(let b=0;b<m;b++){const M=v[b];M[0]=b,M[1]=p[b]}v.sort(eY);for(let b=0;b<8;b++)b<m&&v[b][1]?(a[b][0]=v[b][0],a[b][1]=v[b][1]):(a[b][0]=Number.MAX_SAFE_INTEGER,a[b][1]=0);a.sort(JX);const x=d.morphAttributes.position,_=d.morphAttributes.normal;let g=0;for(let b=0;b<8;b++){const M=a[b],C=M[0],A=M[1];C!==Number.MAX_SAFE_INTEGER&&A?(x&&d.getAttribute("morphTarget"+b)!==x[C]&&d.setAttribute("morphTarget"+b,x[C]),_&&d.getAttribute("morphNormal"+b)!==_[C]&&d.setAttribute("morphNormal"+b,_[C]),i[b]=A,g+=A):(x&&d.hasAttribute("morphTarget"+b)===!0&&d.deleteAttribute("morphTarget"+b),_&&d.hasAttribute("morphNormal"+b)===!0&&d.deleteAttribute("morphNormal"+b),i[b]=0)}const S=d.morphTargetsRelative?1:1-g;f.getUniforms().setValue(n,"morphTargetBaseInfluence",S),f.getUniforms().setValue(n,"morphTargetInfluences",i)}}return{update:l}}function nY(n,e,t,r){let i=new WeakMap;function s(l){const h=r.render.frame,d=l.geometry,f=e.get(l,d);if(i.get(f)!==h&&(e.update(f),i.set(f,h)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),i.get(l)!==h&&(t.update(l.instanceMatrix,n.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,n.ARRAY_BUFFER),i.set(l,h))),l.isSkinnedMesh){const p=l.skeleton;i.get(p)!==h&&(p.update(),i.set(p,h))}return f}function o(){i=new WeakMap}function a(l){const h=l.target;h.removeEventListener("dispose",a),t.remove(h.instanceMatrix),h.instanceColor!==null&&t.remove(h.instanceColor)}return{update:s,dispose:o}}class l1 extends Mn{constructor(e,t,r,i,s,o,a,l,h,d){if(d=d!==void 0?d:oa,d!==oa&&d!==bl)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&d===oa&&(r=Js),r===void 0&&d===bl&&(r=sa),super(null,i,s,o,a,l,d,r,h),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:bn,this.minFilter=l!==void 0?l:bn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const LI=new Mn,FI=new l1(1,1);FI.compareFunction=t1;const NI=new mg,DI=new i1,OI=new rf,DM=[],OM=[],UM=new Float32Array(16),kM=new Float32Array(9),BM=new Float32Array(4);function Du(n,e,t){const r=n[0];if(r<=0||r>0)return n;const i=e*t;let s=DM[i];if(s===void 0&&(s=new Float32Array(i),DM[i]=s),e!==0){r.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function kn(n,e){if(n.length!==e.length)return!1;for(let t=0,r=n.length;t<r;t++)if(n[t]!==e[t])return!1;return!0}function Bn(n,e){for(let t=0,r=e.length;t<r;t++)n[t]=e[t]}function gg(n,e){let t=OM[e];t===void 0&&(t=new Int32Array(e),OM[e]=t);for(let r=0;r!==e;++r)t[r]=n.allocateTextureUnit();return t}function rY(n,e){const t=this.cache;t[0]!==e&&(n.uniform1f(this.addr,e),t[0]=e)}function iY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(kn(t,e))return;n.uniform2fv(this.addr,e),Bn(t,e)}}function sY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(n.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(kn(t,e))return;n.uniform3fv(this.addr,e),Bn(t,e)}}function oY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(kn(t,e))return;n.uniform4fv(this.addr,e),Bn(t,e)}}function aY(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(kn(t,e))return;n.uniformMatrix2fv(this.addr,!1,e),Bn(t,e)}else{if(kn(t,r))return;BM.set(r),n.uniformMatrix2fv(this.addr,!1,BM),Bn(t,r)}}function lY(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(kn(t,e))return;n.uniformMatrix3fv(this.addr,!1,e),Bn(t,e)}else{if(kn(t,r))return;kM.set(r),n.uniformMatrix3fv(this.addr,!1,kM),Bn(t,r)}}function cY(n,e){const t=this.cache,r=e.elements;if(r===void 0){if(kn(t,e))return;n.uniformMatrix4fv(this.addr,!1,e),Bn(t,e)}else{if(kn(t,r))return;UM.set(r),n.uniformMatrix4fv(this.addr,!1,UM),Bn(t,r)}}function uY(n,e){const t=this.cache;t[0]!==e&&(n.uniform1i(this.addr,e),t[0]=e)}function hY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(kn(t,e))return;n.uniform2iv(this.addr,e),Bn(t,e)}}function dY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(kn(t,e))return;n.uniform3iv(this.addr,e),Bn(t,e)}}function fY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(kn(t,e))return;n.uniform4iv(this.addr,e),Bn(t,e)}}function pY(n,e){const t=this.cache;t[0]!==e&&(n.uniform1ui(this.addr,e),t[0]=e)}function mY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(n.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(kn(t,e))return;n.uniform2uiv(this.addr,e),Bn(t,e)}}function gY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(n.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(kn(t,e))return;n.uniform3uiv(this.addr,e),Bn(t,e)}}function yY(n,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(n.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(kn(t,e))return;n.uniform4uiv(this.addr,e),Bn(t,e)}}function vY(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i);const s=this.type===n.SAMPLER_2D_SHADOW?FI:LI;t.setTexture2D(e||s,i)}function _Y(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture3D(e||DI,i)}function xY(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTextureCube(e||OI,i)}function SY(n,e,t){const r=this.cache,i=t.allocateTextureUnit();r[0]!==i&&(n.uniform1i(this.addr,i),r[0]=i),t.setTexture2DArray(e||NI,i)}function bY(n){switch(n){case 5126:return rY;case 35664:return iY;case 35665:return sY;case 35666:return oY;case 35674:return aY;case 35675:return lY;case 35676:return cY;case 5124:case 35670:return uY;case 35667:case 35671:return hY;case 35668:case 35672:return dY;case 35669:case 35673:return fY;case 5125:return pY;case 36294:return mY;case 36295:return gY;case 36296:return yY;case 35678:case 36198:case 36298:case 36306:case 35682:return vY;case 35679:case 36299:case 36307:return _Y;case 35680:case 36300:case 36308:case 36293:return xY;case 36289:case 36303:case 36311:case 36292:return SY}}function wY(n,e){n.uniform1fv(this.addr,e)}function TY(n,e){const t=Du(e,this.size,2);n.uniform2fv(this.addr,t)}function MY(n,e){const t=Du(e,this.size,3);n.uniform3fv(this.addr,t)}function EY(n,e){const t=Du(e,this.size,4);n.uniform4fv(this.addr,t)}function AY(n,e){const t=Du(e,this.size,4);n.uniformMatrix2fv(this.addr,!1,t)}function CY(n,e){const t=Du(e,this.size,9);n.uniformMatrix3fv(this.addr,!1,t)}function PY(n,e){const t=Du(e,this.size,16);n.uniformMatrix4fv(this.addr,!1,t)}function RY(n,e){n.uniform1iv(this.addr,e)}function IY(n,e){n.uniform2iv(this.addr,e)}function LY(n,e){n.uniform3iv(this.addr,e)}function FY(n,e){n.uniform4iv(this.addr,e)}function NY(n,e){n.uniform1uiv(this.addr,e)}function DY(n,e){n.uniform2uiv(this.addr,e)}function OY(n,e){n.uniform3uiv(this.addr,e)}function UY(n,e){n.uniform4uiv(this.addr,e)}function kY(n,e,t){const r=this.cache,i=e.length,s=gg(t,i);kn(r,s)||(n.uniform1iv(this.addr,s),Bn(r,s));for(let o=0;o!==i;++o)t.setTexture2D(e[o]||LI,s[o])}function BY(n,e,t){const r=this.cache,i=e.length,s=gg(t,i);kn(r,s)||(n.uniform1iv(this.addr,s),Bn(r,s));for(let o=0;o!==i;++o)t.setTexture3D(e[o]||DI,s[o])}function zY(n,e,t){const r=this.cache,i=e.length,s=gg(t,i);kn(r,s)||(n.uniform1iv(this.addr,s),Bn(r,s));for(let o=0;o!==i;++o)t.setTextureCube(e[o]||OI,s[o])}function WY(n,e,t){const r=this.cache,i=e.length,s=gg(t,i);kn(r,s)||(n.uniform1iv(this.addr,s),Bn(r,s));for(let o=0;o!==i;++o)t.setTexture2DArray(e[o]||NI,s[o])}function HY(n){switch(n){case 5126:return wY;case 35664:return TY;case 35665:return MY;case 35666:return EY;case 35674:return AY;case 35675:return CY;case 35676:return PY;case 5124:case 35670:return RY;case 35667:case 35671:return IY;case 35668:case 35672:return LY;case 35669:case 35673:return FY;case 5125:return NY;case 36294:return DY;case 36295:return OY;case 36296:return UY;case 35678:case 36198:case 36298:case 36306:case 35682:return kY;case 35679:case 36299:case 36307:return BY;case 35680:case 36300:case 36308:case 36293:return zY;case 36289:case 36303:case 36311:case 36292:return WY}}class GY{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.setValue=bY(t.type)}}class VY{constructor(e,t,r){this.id=e,this.addr=r,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=HY(t.type)}}class jY{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,r){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const a=i[s];a.setValue(e,t[a.id],r)}}}const $v=/(\w+)(\])?(\[|\.)?/g;function zM(n,e){n.seq.push(e),n.map[e.id]=e}function XY(n,e,t){const r=n.name,i=r.length;for($v.lastIndex=0;;){const s=$v.exec(r),o=$v.lastIndex;let a=s[1];const l=s[2]==="]",h=s[3];if(l&&(a=a|0),h===void 0||h==="["&&o+2===i){zM(t,h===void 0?new GY(a,n,e):new VY(a,n,e));break}else{let f=t.map[a];f===void 0&&(f=new jY(a),zM(t,f)),t=f}}}class $m{constructor(e,t){this.seq=[],this.map={};const r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<r;++i){const s=e.getActiveUniform(t,i),o=e.getUniformLocation(t,s.name);XY(s,o,this)}}setValue(e,t,r,i){const s=this.map[t];s!==void 0&&s.setValue(e,r,i)}setOptional(e,t,r){const i=t[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,t,r,i){for(let s=0,o=t.length;s!==o;++s){const a=t[s],l=r[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,i)}}static seqWithValue(e,t){const r=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in t&&r.push(o)}return r}}function WM(n,e,t){const r=n.createShader(e);return n.shaderSource(r,t),n.compileShader(r),r}const YY=37297;let qY=0;function $Y(n,e){const t=n.split(`
`),r=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=i;o<s;o++){const a=o+1;r.push(`${a===e?">":" "} ${a}: ${t[o]}`)}return r.join(`
`)}function KY(n){const e=Gt.getPrimaries(Gt.workingColorSpace),t=Gt.getPrimaries(n);let r;switch(e===t?r="":e===Rd&&t===Pd?r="LinearDisplayP3ToLinearSRGB":e===Pd&&t===Rd&&(r="LinearSRGBToLinearDisplayP3"),n){case Ps:case ef:return[r,"LinearTransferOETF"];case Nn:case pg:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[r,"LinearTransferOETF"]}}function HM(n,e,t){const r=n.getShaderParameter(e,n.COMPILE_STATUS),i=n.getShaderInfoLog(e).trim();if(r&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+`
`+i+`
`+$Y(n.getShaderSource(e),o)}else return i}function ZY(n,e){const t=KY(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function QY(n,e){let t;switch(e){case K3:t="Linear";break;case Z3:t="Reinhard";break;case Q3:t="OptimizedCineon";break;case VS:t="ACESFilmic";break;case eI:t="AgX";break;case J3:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function JY(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(kc).join(`
`)}function eq(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":""].filter(kc).join(`
`)}function tq(n){const e=[];for(const t in n){const r=n[t];r!==!1&&e.push("#define "+t+" "+r)}return e.join(`
`)}function nq(n,e){const t={},r=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const s=n.getActiveAttrib(e,i),o=s.name;let a=1;s.type===n.FLOAT_MAT2&&(a=2),s.type===n.FLOAT_MAT3&&(a=3),s.type===n.FLOAT_MAT4&&(a=4),t[o]={type:s.type,location:n.getAttribLocation(e,o),locationSize:a}}return t}function kc(n){return n!==""}function GM(n,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return n.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,t).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 VM(n,e){return n.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const rq=/^[ \t]*#include +<([\w\d./]+)>/gm;function vx(n){return n.replace(rq,sq)}const iq=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function sq(n,e){let t=Tt[e];if(t===void 0){const r=iq.get(e);if(r!==void 0)t=Tt[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,r);else throw new Error("Can not resolve #include <"+e+">")}return vx(t)}const oq=/#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 jM(n){return n.replace(oq,aq)}function aq(n,e,t,r){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function XM(n){let e="precision "+n.precision+` float;
precision `+n.precision+" int;";return n.precision==="highp"?e+=`
#define HIGH_PRECISION`:n.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:n.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function lq(n){let e="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===ug?e="SHADOWMAP_TYPE_PCF":n.shadowMapType===Vh?e="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===Bi&&(e="SHADOWMAP_TYPE_VSM"),e}function cq(n){let e="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case ho:case ma:e="ENVMAP_TYPE_CUBE";break;case Lu:e="ENVMAP_TYPE_CUBE_UV";break}return e}function uq(n){let e="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case ma:e="ENVMAP_MODE_REFRACTION";break}return e}function hq(n){let e="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case Jd:e="ENVMAP_BLENDING_MULTIPLY";break;case q3:e="ENVMAP_BLENDING_MIX";break;case $3:e="ENVMAP_BLENDING_ADD";break}return e}function dq(n){const e=n.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:r,maxMip:t}}function fq(n,e,t,r){const i=n.getContext(),s=t.defines;let o=t.vertexShader,a=t.fragmentShader;const l=lq(t),h=cq(t),d=uq(t),f=hq(t),p=dq(t),m=t.isWebGL2?"":JY(t),v=eq(t),x=tq(s),_=i.createProgram();let g,S,b=t.glslVersion?"#version "+t.glslVersion+`
`:"";t.isRawShaderMaterial?(g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(kc).join(`
`),g.length>0&&(g+=`
`),S=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(kc).join(`
`),S.length>0&&(S+=`
`)):(g=[XM(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
`].filter(kc).join(`
`),S=[m,XM(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",t.envMap?"#define "+f:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Ms?"#define TONE_MAPPING":"",t.toneMapping!==Ms?Tt.tonemapping_pars_fragment:"",t.toneMapping!==Ms?QY("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Tt.colorspace_pars_fragment,ZY("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
`].filter(kc).join(`
`)),o=vx(o),o=GM(o,t),o=VM(o,t),a=vx(a),a=GM(a,t),a=VM(a,t),o=jM(o),a=jM(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(b=`#version 300 es
`,g=[v,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+g,S=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===mx?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===mx?"":"#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(`
`)+`
`+S);const M=b+g+o,C=b+S+a,A=WM(i,i.VERTEX_SHADER,M),R=WM(i,i.FRAGMENT_SHADER,C);i.attachShader(_,A),i.attachShader(_,R),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function O(X){if(n.debug.checkShaderErrors){const se=i.getProgramInfoLog(_).trim(),W=i.getShaderInfoLog(A).trim(),$=i.getShaderInfoLog(R).trim();let Z=!0,re=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(Z=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(i,_,A,R);else{const F=HM(i,A,"vertex"),U=HM(i,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+`
Program Info Log: `+se+`
`+F+`
`+U)}else se!==""?console.warn("THREE.WebGLProgram: Program Info Log:",se):(W===""||$==="")&&(re=!1);re&&(X.diagnostics={runnable:Z,programLog:se,vertexShader:{log:W,prefix:g},fragmentShader:{log:$,prefix:S}})}i.deleteShader(A),i.deleteShader(R),P=new $m(i,_),I=nq(i,_)}let P;this.getUniforms=function(){return P===void 0&&O(this),P};let I;this.getAttributes=function(){return I===void 0&&O(this),I};let H=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return H===!1&&(H=i.getProgramParameter(_,YY)),H},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=qY++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=A,this.fragmentShader=R,this}let pq=0;class mq{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(r),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const r of t)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.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 t=this.materialCache;let r=t.get(e);return r===void 0&&(r=new Set,t.set(e,r)),r}_getShaderStage(e){const t=this.shaderCache;let r=t.get(e);return r===void 0&&(r=new gq(e),t.set(e,r)),r}}class gq{constructor(e){this.id=pq++,this.code=e,this.usedTimes=0}}function yq(n,e,t,r,i,s,o){const a=new fl,l=new mq,h=[],d=i.isWebGL2,f=i.logarithmicDepthBuffer,p=i.vertexTextures;let m=i.precision;const v={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 x(P){return P===0?"uv":`uv${P}`}function _(P,I,H,X,se){const W=X.fog,$=se.geometry,Z=P.isMeshStandardMaterial?X.environment:null,re=(P.isMeshStandardMaterial?t:e).get(P.envMap||Z),F=re&&re.mapping===Lu?re.image.height:null,U=v[P.type];P.precision!==null&&(m=i.getMaxPrecision(P.precision),m!==P.precision&&console.warn("THREE.WebGLProgram.getParameters:",P.precision,"not supported, using",m,"instead."));const G=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,Y=G!==void 0?G.length:0;let ee=0;$.morphAttributes.position!==void 0&&(ee=1),$.morphAttributes.normal!==void 0&&(ee=2),$.morphAttributes.color!==void 0&&(ee=3);let K,ie,me,Ee;if(U){const Ht=Vi[U];K=Ht.vertexShader,ie=Ht.fragmentShader}else K=P.vertexShader,ie=P.fragmentShader,l.update(P),me=l.getVertexShaderID(P),Ee=l.getFragmentShaderID(P);const ge=n.getRenderTarget(),tt=se.isInstancedMesh===!0,nt=se.isBatchedMesh===!0,Be=!!P.map,Xe=!!P.matcap,j=!!re,Se=!!P.aoMap,fe=!!P.lightMap,Te=!!P.bumpMap,de=!!P.normalMap,$e=!!P.displacementMap,Ne=!!P.emissiveMap,k=!!P.metalnessMap,N=!!P.roughnessMap,te=P.anisotropy>0,be=P.clearcoat>0,ve=P.iridescence>0,_e=P.sheen>0,Ye=P.transmission>0,Ce=te&&!!P.anisotropyMap,Ue=be&&!!P.clearcoatMap,it=be&&!!P.clearcoatNormalMap,mt=be&&!!P.clearcoatRoughnessMap,xe=ve&&!!P.iridescenceMap,Lt=ve&&!!P.iridescenceThicknessMap,bt=_e&&!!P.sheenColorMap,lt=_e&&!!P.sheenRoughnessMap,Ke=!!P.specularMap,He=!!P.specularColorMap,ct=!!P.specularIntensityMap,Ft=Ye&&!!P.transmissionMap,qt=Ye&&!!P.thicknessMap,vt=!!P.gradientMap,Re=!!P.alphaMap,q=P.alphaTest>0,Fe=!!P.alphaHash,Ie=!!P.extensions,ot=!!$.attributes.uv1,we=!!$.attributes.uv2,Qe=!!$.attributes.uv3;let rt=Ms;return P.toneMapped&&(ge===null||ge.isXRRenderTarget===!0)&&(rt=n.toneMapping),{isWebGL2:d,shaderID:U,shaderType:P.type,shaderName:P.name,vertexShader:K,fragmentShader:ie,defines:P.defines,customVertexShaderID:me,customFragmentShaderID:Ee,isRawShaderMaterial:P.isRawShaderMaterial===!0,glslVersion:P.glslVersion,precision:m,batching:nt,instancing:tt,instancingColor:tt&&se.instanceColor!==null,supportsVertexTextures:p,outputColorSpace:ge===null?n.outputColorSpace:ge.isXRRenderTarget===!0?ge.texture.colorSpace:Ps,map:Be,matcap:Xe,envMap:j,envMapMode:j&&re.mapping,envMapCubeUVHeight:F,aoMap:Se,lightMap:fe,bumpMap:Te,normalMap:de,displacementMap:p&&$e,emissiveMap:Ne,normalMapObjectSpace:de&&P.normalMapType===mI,normalMapTangentSpace:de&&P.normalMapType===Sa,metalnessMap:k,roughnessMap:N,anisotropy:te,anisotropyMap:Ce,clearcoat:be,clearcoatMap:Ue,clearcoatNormalMap:it,clearcoatRoughnessMap:mt,iridescence:ve,iridescenceMap:xe,iridescenceThicknessMap:Lt,sheen:_e,sheenColorMap:bt,sheenRoughnessMap:lt,specularMap:Ke,specularColorMap:He,specularIntensityMap:ct,transmission:Ye,transmissionMap:Ft,thicknessMap:qt,gradientMap:vt,opaque:P.transparent===!1&&P.blending===hl,alphaMap:Re,alphaTest:q,alphaHash:Fe,combine:P.combine,mapUv:Be&&x(P.map.channel),aoMapUv:Se&&x(P.aoMap.channel),lightMapUv:fe&&x(P.lightMap.channel),bumpMapUv:Te&&x(P.bumpMap.channel),normalMapUv:de&&x(P.normalMap.channel),displacementMapUv:$e&&x(P.displacementMap.channel),emissiveMapUv:Ne&&x(P.emissiveMap.channel),metalnessMapUv:k&&x(P.metalnessMap.channel),roughnessMapUv:N&&x(P.roughnessMap.channel),anisotropyMapUv:Ce&&x(P.anisotropyMap.channel),clearcoatMapUv:Ue&&x(P.clearcoatMap.channel),clearcoatNormalMapUv:it&&x(P.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:mt&&x(P.clearcoatRoughnessMap.channel),iridescenceMapUv:xe&&x(P.iridescenceMap.channel),iridescenceThicknessMapUv:Lt&&x(P.iridescenceThicknessMap.channel),sheenColorMapUv:bt&&x(P.sheenColorMap.channel),sheenRoughnessMapUv:lt&&x(P.sheenRoughnessMap.channel),specularMapUv:Ke&&x(P.specularMap.channel),specularColorMapUv:He&&x(P.specularColorMap.channel),specularIntensityMapUv:ct&&x(P.specularIntensityMap.channel),transmissionMapUv:Ft&&x(P.transmissionMap.channel),thicknessMapUv:qt&&x(P.thicknessMap.channel),alphaMapUv:Re&&x(P.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(de||te),vertexColors:P.vertexColors,vertexAlphas:P.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,vertexUv1s:ot,vertexUv2s:we,vertexUv3s:Qe,pointsUvs:se.isPoints===!0&&!!$.attributes.uv&&(Be||Re),fog:!!W,useFog:P.fog===!0,fogExp2:W&&W.isFogExp2,flatShading:P.flatShading===!0,sizeAttenuation:P.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:se.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:Y,morphTextureStride:ee,numDirLights:I.directional.length,numPointLights:I.point.length,numSpotLights:I.spot.length,numSpotLightMaps:I.spotLightMap.length,numRectAreaLights:I.rectArea.length,numHemiLights:I.hemi.length,numDirLightShadows:I.directionalShadowMap.length,numPointLightShadows:I.pointShadowMap.length,numSpotLightShadows:I.spotShadowMap.length,numSpotLightShadowsWithMaps:I.numSpotLightShadowsWithMaps,numLightProbes:I.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:P.dithering,shadowMapEnabled:n.shadowMap.enabled&&H.length>0,shadowMapType:n.shadowMap.type,toneMapping:rt,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Be&&P.map.isVideoTexture===!0&&Gt.getTransfer(P.map.colorSpace)===$t,premultipliedAlpha:P.premultipliedAlpha,doubleSided:P.side===xs,flipSided:P.side===Ar,useDepthPacking:P.depthPacking>=0,depthPacking:P.depthPacking||0,index0AttributeName:P.index0AttributeName,extensionDerivatives:Ie&&P.extensions.derivatives===!0,extensionFragDepth:Ie&&P.extensions.fragDepth===!0,extensionDrawBuffers:Ie&&P.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ie&&P.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Ie&&P.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),rendererExtensionFragDepth:d||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:P.customProgramCacheKey()}}function g(P){const I=[];if(P.shaderID?I.push(P.shaderID):(I.push(P.customVertexShaderID),I.push(P.customFragmentShaderID)),P.defines!==void 0)for(const H in P.defines)I.push(H),I.push(P.defines[H]);return P.isRawShaderMaterial===!1&&(S(I,P),b(I,P),I.push(n.outputColorSpace)),I.push(P.customProgramCacheKey),I.join()}function S(P,I){P.push(I.precision),P.push(I.outputColorSpace),P.push(I.envMapMode),P.push(I.envMapCubeUVHeight),P.push(I.mapUv),P.push(I.alphaMapUv),P.push(I.lightMapUv),P.push(I.aoMapUv),P.push(I.bumpMapUv),P.push(I.normalMapUv),P.push(I.displacementMapUv),P.push(I.emissiveMapUv),P.push(I.metalnessMapUv),P.push(I.roughnessMapUv),P.push(I.anisotropyMapUv),P.push(I.clearcoatMapUv),P.push(I.clearcoatNormalMapUv),P.push(I.clearcoatRoughnessMapUv),P.push(I.iridescenceMapUv),P.push(I.iridescenceThicknessMapUv),P.push(I.sheenColorMapUv),P.push(I.sheenRoughnessMapUv),P.push(I.specularMapUv),P.push(I.specularColorMapUv),P.push(I.specularIntensityMapUv),P.push(I.transmissionMapUv),P.push(I.thicknessMapUv),P.push(I.combine),P.push(I.fogExp2),P.push(I.sizeAttenuation),P.push(I.morphTargetsCount),P.push(I.morphAttributeCount),P.push(I.numDirLights),P.push(I.numPointLights),P.push(I.numSpotLights),P.push(I.numSpotLightMaps),P.push(I.numHemiLights),P.push(I.numRectAreaLights),P.push(I.numDirLightShadows),P.push(I.numPointLightShadows),P.push(I.numSpotLightShadows),P.push(I.numSpotLightShadowsWithMaps),P.push(I.numLightProbes),P.push(I.shadowMapType),P.push(I.toneMapping),P.push(I.numClippingPlanes),P.push(I.numClipIntersection),P.push(I.depthPacking)}function b(P,I){a.disableAll(),I.isWebGL2&&a.enable(0),I.supportsVertexTextures&&a.enable(1),I.instancing&&a.enable(2),I.instancingColor&&a.enable(3),I.matcap&&a.enable(4),I.envMap&&a.enable(5),I.normalMapObjectSpace&&a.enable(6),I.normalMapTangentSpace&&a.enable(7),I.clearcoat&&a.enable(8),I.iridescence&&a.enable(9),I.alphaTest&&a.enable(10),I.vertexColors&&a.enable(11),I.vertexAlphas&&a.enable(12),I.vertexUv1s&&a.enable(13),I.vertexUv2s&&a.enable(14),I.vertexUv3s&&a.enable(15),I.vertexTangents&&a.enable(16),I.anisotropy&&a.enable(17),I.alphaHash&&a.enable(18),I.batching&&a.enable(19),P.push(a.mask),a.disableAll(),I.fog&&a.enable(0),I.useFog&&a.enable(1),I.flatShading&&a.enable(2),I.logarithmicDepthBuffer&&a.enable(3),I.skinning&&a.enable(4),I.morphTargets&&a.enable(5),I.morphNormals&&a.enable(6),I.morphColors&&a.enable(7),I.premultipliedAlpha&&a.enable(8),I.shadowMapEnabled&&a.enable(9),I.useLegacyLights&&a.enable(10),I.doubleSided&&a.enable(11),I.flipSided&&a.enable(12),I.useDepthPacking&&a.enable(13),I.dithering&&a.enable(14),I.transmission&&a.enable(15),I.sheen&&a.enable(16),I.opaque&&a.enable(17),I.pointsUvs&&a.enable(18),I.decodeVideoTexture&&a.enable(19),P.push(a.mask)}function M(P){const I=v[P.type];let H;if(I){const X=Vi[I];H=CI.clone(X.uniforms)}else H=P.uniforms;return H}function C(P,I){let H;for(let X=0,se=h.length;X<se;X++){const W=h[X];if(W.cacheKey===I){H=W,++H.usedTimes;break}}return H===void 0&&(H=new fq(n,I,P,s),h.push(H)),H}function A(P){if(--P.usedTimes===0){const I=h.indexOf(P);h[I]=h[h.length-1],h.pop(),P.destroy()}}function R(P){l.remove(P)}function O(){l.dispose()}return{getParameters:_,getProgramCacheKey:g,getUniforms:M,acquireProgram:C,releaseProgram:A,releaseShaderCache:R,programs:h,dispose:O}}function vq(){let n=new WeakMap;function e(s){let o=n.get(s);return o===void 0&&(o={},n.set(s,o)),o}function t(s){n.delete(s)}function r(s,o,a){n.get(s)[o]=a}function i(){n=new WeakMap}return{get:e,remove:t,update:r,dispose:i}}function _q(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.z!==e.z?n.z-e.z:n.id-e.id}function YM(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function qM(){const n=[];let e=0;const t=[],r=[],i=[];function s(){e=0,t.length=0,r.length=0,i.length=0}function o(f,p,m,v,x,_){let g=n[e];return g===void 0?(g={id:f.id,object:f,geometry:p,material:m,groupOrder:v,renderOrder:f.renderOrder,z:x,group:_},n[e]=g):(g.id=f.id,g.object=f,g.geometry=p,g.material=m,g.groupOrder=v,g.renderOrder=f.renderOrder,g.z=x,g.group=_),e++,g}function a(f,p,m,v,x,_){const g=o(f,p,m,v,x,_);m.transmission>0?r.push(g):m.transparent===!0?i.push(g):t.push(g)}function l(f,p,m,v,x,_){const g=o(f,p,m,v,x,_);m.transmission>0?r.unshift(g):m.transparent===!0?i.unshift(g):t.unshift(g)}function h(f,p){t.length>1&&t.sort(f||_q),r.length>1&&r.sort(p||YM),i.length>1&&i.sort(p||YM)}function d(){for(let f=e,p=n.length;f<p;f++){const m=n[f];if(m.id===null)break;m.id=null,m.object=null,m.geometry=null,m.material=null,m.group=null}}return{opaque:t,transmissive:r,transparent:i,init:s,push:a,unshift:l,finish:d,sort:h}}function xq(){let n=new WeakMap;function e(r,i){const s=n.get(r);let o;return s===void 0?(o=new qM,n.set(r,[o])):i>=s.length?(o=new qM,s.push(o)):o=s[i],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function Sq(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new z,color:new We};break;case"SpotLight":t={position:new z,direction:new z,color:new We,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new z,color:new We,distance:0,decay:0};break;case"HemisphereLight":t={direction:new z,skyColor:new We,groundColor:new We};break;case"RectAreaLight":t={color:new We,position:new z,halfWidth:new z,halfHeight:new z};break}return n[e.id]=t,t}}}function bq(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let wq=0;function Tq(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function Mq(n,e){const t=new Sq,r=bq(),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 d=0;d<9;d++)i.probe.push(new z);const s=new z,o=new ft,a=new ft;function l(d,f){let p=0,m=0,v=0;for(let X=0;X<9;X++)i.probe[X].set(0,0,0);let x=0,_=0,g=0,S=0,b=0,M=0,C=0,A=0,R=0,O=0,P=0;d.sort(Tq);const I=f===!0?Math.PI:1;for(let X=0,se=d.length;X<se;X++){const W=d[X],$=W.color,Z=W.intensity,re=W.distance,F=W.shadow&&W.shadow.map?W.shadow.map.texture:null;if(W.isAmbientLight)p+=$.r*Z*I,m+=$.g*Z*I,v+=$.b*Z*I;else if(W.isLightProbe){for(let U=0;U<9;U++)i.probe[U].addScaledVector(W.sh.coefficients[U],Z);P++}else if(W.isDirectionalLight){const U=t.get(W);if(U.color.copy(W.color).multiplyScalar(W.intensity*I),W.castShadow){const G=W.shadow,Y=r.get(W);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,i.directionalShadow[x]=Y,i.directionalShadowMap[x]=F,i.directionalShadowMatrix[x]=W.shadow.matrix,M++}i.directional[x]=U,x++}else if(W.isSpotLight){const U=t.get(W);U.position.setFromMatrixPosition(W.matrixWorld),U.color.copy($).multiplyScalar(Z*I),U.distance=re,U.coneCos=Math.cos(W.angle),U.penumbraCos=Math.cos(W.angle*(1-W.penumbra)),U.decay=W.decay,i.spot[g]=U;const G=W.shadow;if(W.map&&(i.spotLightMap[R]=W.map,R++,G.updateMatrices(W),W.castShadow&&O++),i.spotLightMatrix[g]=G.matrix,W.castShadow){const Y=r.get(W);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,i.spotShadow[g]=Y,i.spotShadowMap[g]=F,A++}g++}else if(W.isRectAreaLight){const U=t.get(W);U.color.copy($).multiplyScalar(Z),U.halfWidth.set(W.width*.5,0,0),U.halfHeight.set(0,W.height*.5,0),i.rectArea[S]=U,S++}else if(W.isPointLight){const U=t.get(W);if(U.color.copy(W.color).multiplyScalar(W.intensity*I),U.distance=W.distance,U.decay=W.decay,W.castShadow){const G=W.shadow,Y=r.get(W);Y.shadowBias=G.bias,Y.shadowNormalBias=G.normalBias,Y.shadowRadius=G.radius,Y.shadowMapSize=G.mapSize,Y.shadowCameraNear=G.camera.near,Y.shadowCameraFar=G.camera.far,i.pointShadow[_]=Y,i.pointShadowMap[_]=F,i.pointShadowMatrix[_]=W.shadow.matrix,C++}i.point[_]=U,_++}else if(W.isHemisphereLight){const U=t.get(W);U.skyColor.copy(W.color).multiplyScalar(Z*I),U.groundColor.copy(W.groundColor).multiplyScalar(Z*I),i.hemi[b]=U,b++}}S>0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Le.LTC_FLOAT_1,i.rectAreaLTC2=Le.LTC_FLOAT_2):(i.rectAreaLTC1=Le.LTC_HALF_1,i.rectAreaLTC2=Le.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Le.LTC_FLOAT_1,i.rectAreaLTC2=Le.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Le.LTC_HALF_1,i.rectAreaLTC2=Le.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=p,i.ambient[1]=m,i.ambient[2]=v;const H=i.hash;(H.directionalLength!==x||H.pointLength!==_||H.spotLength!==g||H.rectAreaLength!==S||H.hemiLength!==b||H.numDirectionalShadows!==M||H.numPointShadows!==C||H.numSpotShadows!==A||H.numSpotMaps!==R||H.numLightProbes!==P)&&(i.directional.length=x,i.spot.length=g,i.rectArea.length=S,i.point.length=_,i.hemi.length=b,i.directionalShadow.length=M,i.directionalShadowMap.length=M,i.pointShadow.length=C,i.pointShadowMap.length=C,i.spotShadow.length=A,i.spotShadowMap.length=A,i.directionalShadowMatrix.length=M,i.pointShadowMatrix.length=C,i.spotLightMatrix.length=A+R-O,i.spotLightMap.length=R,i.numSpotLightShadowsWithMaps=O,i.numLightProbes=P,H.directionalLength=x,H.pointLength=_,H.spotLength=g,H.rectAreaLength=S,H.hemiLength=b,H.numDirectionalShadows=M,H.numPointShadows=C,H.numSpotShadows=A,H.numSpotMaps=R,H.numLightProbes=P,i.version=wq++)}function h(d,f){let p=0,m=0,v=0,x=0,_=0;const g=f.matrixWorldInverse;for(let S=0,b=d.length;S<b;S++){const M=d[S];if(M.isDirectionalLight){const C=i.directional[p];C.direction.setFromMatrixPosition(M.matrixWorld),s.setFromMatrixPosition(M.target.matrixWorld),C.direction.sub(s),C.direction.transformDirection(g),p++}else if(M.isSpotLight){const C=i.spot[v];C.position.setFromMatrixPosition(M.matrixWorld),C.position.applyMatrix4(g),C.direction.setFromMatrixPosition(M.matrixWorld),s.setFromMatrixPosition(M.target.matrixWorld),C.direction.sub(s),C.direction.transformDirection(g),v++}else if(M.isRectAreaLight){const C=i.rectArea[x];C.position.setFromMatrixPosition(M.matrixWorld),C.position.applyMatrix4(g),a.identity(),o.copy(M.matrixWorld),o.premultiply(g),a.extractRotation(o),C.halfWidth.set(M.width*.5,0,0),C.halfHeight.set(0,M.height*.5,0),C.halfWidth.applyMatrix4(a),C.halfHeight.applyMatrix4(a),x++}else if(M.isPointLight){const C=i.point[m];C.position.setFromMatrixPosition(M.matrixWorld),C.position.applyMatrix4(g),m++}else if(M.isHemisphereLight){const C=i.hemi[_];C.direction.setFromMatrixPosition(M.matrixWorld),C.direction.transformDirection(g),_++}}}return{setup:l,setupView:h,state:i}}function $M(n,e){const t=new Mq(n,e),r=[],i=[];function s(){r.length=0,i.length=0}function o(f){r.push(f)}function a(f){i.push(f)}function l(f){t.setup(r,f)}function h(f){t.setupView(r,f)}return{init:s,state:{lightsArray:r,shadowsArray:i,lights:t},setupLights:l,setupLightsView:h,pushLight:o,pushShadow:a}}function Eq(n,e){let t=new WeakMap;function r(s,o=0){const a=t.get(s);let l;return a===void 0?(l=new $M(n,e),t.set(s,[l])):o>=a.length?(l=new $M(n,e),a.push(l)):l=a[o],l}function i(){t=new WeakMap}return{get:r,dispose:i}}class c1 extends yr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=fI,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 u1 extends yr{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}}const Aq=`void main() {
gl_Position = vec4( position, 1.0 );
}`,Cq=`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 Pq(n,e,t){let r=new sf;const i=new ye,s=new ye,o=new Vt,a=new c1({depthPacking:pI}),l=new u1,h={},d=t.maxTextureSize,f={[uo]:Ar,[Ar]:uo,[xs]:xs},p=new Rs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ye},radius:{value:4}},vertexShader:Aq,fragmentShader:Cq}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const v=new dt;v.setAttribute("position",new Xt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new Un(v,p),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ug;let g=this.type;this.render=function(A,R,O){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||A.length===0)return;const P=n.getRenderTarget(),I=n.getActiveCubeFace(),H=n.getActiveMipmapLevel(),X=n.state;X.setBlending(no),X.buffers.color.setClear(1,1,1,1),X.buffers.depth.setTest(!0),X.setScissorTest(!1);const se=g!==Bi&&this.type===Bi,W=g===Bi&&this.type!==Bi;for(let $=0,Z=A.length;$<Z;$++){const re=A[$],F=re.shadow;if(F===void 0){console.warn("THREE.WebGLShadowMap:",re,"has no shadow.");continue}if(F.autoUpdate===!1&&F.needsUpdate===!1)continue;i.copy(F.mapSize);const U=F.getFrameExtents();if(i.multiply(U),s.copy(F.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/U.x),i.x=s.x*U.x,F.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/U.y),i.y=s.y*U.y,F.mapSize.y=s.y)),F.map===null||se===!0||W===!0){const Y=this.type!==Bi?{minFilter:bn,magFilter:bn}:{};F.map!==null&&F.map.dispose(),F.map=new ts(i.x,i.y,Y),F.map.texture.name=re.name+".shadowMap",F.camera.updateProjectionMatrix()}n.setRenderTarget(F.map),n.clear();const G=F.getViewportCount();for(let Y=0;Y<G;Y++){const ee=F.getViewport(Y);o.set(s.x*ee.x,s.y*ee.y,s.x*ee.z,s.y*ee.w),X.viewport(o),F.updateMatrices(re,Y),r=F.getFrustum(),M(R,O,F.camera,re,this.type)}F.isPointLightShadow!==!0&&this.type===Bi&&S(F,O),F.needsUpdate=!1}g=this.type,_.needsUpdate=!1,n.setRenderTarget(P,I,H)};function S(A,R){const O=e.update(x);p.defines.VSM_SAMPLES!==A.blurSamples&&(p.defines.VSM_SAMPLES=A.blurSamples,m.defines.VSM_SAMPLES=A.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),A.mapPass===null&&(A.mapPass=new ts(i.x,i.y)),p.uniforms.shadow_pass.value=A.map.texture,p.uniforms.resolution.value=A.mapSize,p.uniforms.radius.value=A.radius,n.setRenderTarget(A.mapPass),n.clear(),n.renderBufferDirect(R,null,O,p,x,null),m.uniforms.shadow_pass.value=A.mapPass.texture,m.uniforms.resolution.value=A.mapSize,m.uniforms.radius.value=A.radius,n.setRenderTarget(A.map),n.clear(),n.renderBufferDirect(R,null,O,m,x,null)}function b(A,R,O,P){let I=null;const H=O.isPointLight===!0?A.customDistanceMaterial:A.customDepthMaterial;if(H!==void 0)I=H;else if(I=O.isPointLight===!0?l:a,n.localClippingEnabled&&R.clipShadows===!0&&Array.isArray(R.clippingPlanes)&&R.clippingPlanes.length!==0||R.displacementMap&&R.displacementScale!==0||R.alphaMap&&R.alphaTest>0||R.map&&R.alphaTest>0){const X=I.uuid,se=R.uuid;let W=h[X];W===void 0&&(W={},h[X]=W);let $=W[se];$===void 0&&($=I.clone(),W[se]=$,R.addEventListener("dispose",C)),I=$}if(I.visible=R.visible,I.wireframe=R.wireframe,P===Bi?I.side=R.shadowSide!==null?R.shadowSide:R.side:I.side=R.shadowSide!==null?R.shadowSide:f[R.side],I.alphaMap=R.alphaMap,I.alphaTest=R.alphaTest,I.map=R.map,I.clipShadows=R.clipShadows,I.clippingPlanes=R.clippingPlanes,I.clipIntersection=R.clipIntersection,I.displacementMap=R.displacementMap,I.displacementScale=R.displacementScale,I.displacementBias=R.displacementBias,I.wireframeLinewidth=R.wireframeLinewidth,I.linewidth=R.linewidth,O.isPointLight===!0&&I.isMeshDistanceMaterial===!0){const X=n.properties.get(I);X.light=O}return I}function M(A,R,O,P,I){if(A.visible===!1)return;if(A.layers.test(R.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&I===Bi)&&(!A.frustumCulled||r.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,A.matrixWorld);const se=e.update(A),W=A.material;if(Array.isArray(W)){const $=se.groups;for(let Z=0,re=$.length;Z<re;Z++){const F=$[Z],U=W[F.materialIndex];if(U&&U.visible){const G=b(A,U,P,I);A.onBeforeShadow(n,A,R,O,se,G,F),n.renderBufferDirect(O,null,se,G,A,F),A.onAfterShadow(n,A,R,O,se,G,F)}}}else if(W.visible){const $=b(A,W,P,I);A.onBeforeShadow(n,A,R,O,se,$,null),n.renderBufferDirect(O,null,se,$,A,null),A.onAfterShadow(n,A,R,O,se,$,null)}}const X=A.children;for(let se=0,W=X.length;se<W;se++)M(X[se],R,O,P,I)}function C(A){A.target.removeEventListener("dispose",C);for(const O in h){const P=h[O],I=A.target.uuid;I in P&&(P[I].dispose(),delete P[I])}}}function Rq(n,e,t){const r=t.isWebGL2;function i(){let q=!1;const Fe=new Vt;let Ie=null;const ot=new Vt(0,0,0,0);return{setMask:function(we){Ie!==we&&!q&&(n.colorMask(we,we,we,we),Ie=we)},setLocked:function(we){q=we},setClear:function(we,Qe,rt,Nt,Ht){Ht===!0&&(we*=Nt,Qe*=Nt,rt*=Nt),Fe.set(we,Qe,rt,Nt),ot.equals(Fe)===!1&&(n.clearColor(we,Qe,rt,Nt),ot.copy(Fe))},reset:function(){q=!1,Ie=null,ot.set(-1,0,0,0)}}}function s(){let q=!1,Fe=null,Ie=null,ot=null;return{setTest:function(we){we?nt(n.DEPTH_TEST):Be(n.DEPTH_TEST)},setMask:function(we){Fe!==we&&!q&&(n.depthMask(we),Fe=we)},setFunc:function(we){if(Ie!==we){switch(we){case W3:n.depthFunc(n.NEVER);break;case H3:n.depthFunc(n.ALWAYS);break;case G3:n.depthFunc(n.LESS);break;case xd:n.depthFunc(n.LEQUAL);break;case V3:n.depthFunc(n.EQUAL);break;case j3:n.depthFunc(n.GEQUAL);break;case X3:n.depthFunc(n.GREATER);break;case Y3:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ie=we}},setLocked:function(we){q=we},setClear:function(we){ot!==we&&(n.clearDepth(we),ot=we)},reset:function(){q=!1,Fe=null,Ie=null,ot=null}}}function o(){let q=!1,Fe=null,Ie=null,ot=null,we=null,Qe=null,rt=null,Nt=null,Ht=null;return{setTest:function(Rt){q||(Rt?nt(n.STENCIL_TEST):Be(n.STENCIL_TEST))},setMask:function(Rt){Fe!==Rt&&!q&&(n.stencilMask(Rt),Fe=Rt)},setFunc:function(Rt,Zt,rn){(Ie!==Rt||ot!==Zt||we!==rn)&&(n.stencilFunc(Rt,Zt,rn),Ie=Rt,ot=Zt,we=rn)},setOp:function(Rt,Zt,rn){(Qe!==Rt||rt!==Zt||Nt!==rn)&&(n.stencilOp(Rt,Zt,rn),Qe=Rt,rt=Zt,Nt=rn)},setLocked:function(Rt){q=Rt},setClear:function(Rt){Ht!==Rt&&(n.clearStencil(Rt),Ht=Rt)},reset:function(){q=!1,Fe=null,Ie=null,ot=null,we=null,Qe=null,rt=null,Nt=null,Ht=null}}}const a=new i,l=new s,h=new o,d=new WeakMap,f=new WeakMap;let p={},m={},v=new WeakMap,x=[],_=null,g=!1,S=null,b=null,M=null,C=null,A=null,R=null,O=null,P=new We(0,0,0),I=0,H=!1,X=null,se=null,W=null,$=null,Z=null;const re=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let F=!1,U=0;const G=n.getParameter(n.VERSION);G.indexOf("WebGL")!==-1?(U=parseFloat(/^WebGL (\d)/.exec(G)[1]),F=U>=1):G.indexOf("OpenGL ES")!==-1&&(U=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),F=U>=2);let Y=null,ee={};const K=n.getParameter(n.SCISSOR_BOX),ie=n.getParameter(n.VIEWPORT),me=new Vt().fromArray(K),Ee=new Vt().fromArray(ie);function ge(q,Fe,Ie,ot){const we=new Uint8Array(4),Qe=n.createTexture();n.bindTexture(q,Qe),n.texParameteri(q,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(q,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let rt=0;rt<Ie;rt++)r&&(q===n.TEXTURE_3D||q===n.TEXTURE_2D_ARRAY)?n.texImage3D(Fe,0,n.RGBA,1,1,ot,0,n.RGBA,n.UNSIGNED_BYTE,we):n.texImage2D(Fe+rt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,we);return Qe}const tt={};tt[n.TEXTURE_2D]=ge(n.TEXTURE_2D,n.TEXTURE_2D,1),tt[n.TEXTURE_CUBE_MAP]=ge(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(tt[n.TEXTURE_2D_ARRAY]=ge(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),tt[n.TEXTURE_3D]=ge(n.TEXTURE_3D,n.TEXTURE_3D,1,1)),a.setClear(0,0,0,1),l.setClear(1),h.setClear(0),nt(n.DEPTH_TEST),l.setFunc(xd),Ne(!1),k(O2),nt(n.CULL_FACE),de(no);function nt(q){p[q]!==!0&&(n.enable(q),p[q]=!0)}function Be(q){p[q]!==!1&&(n.disable(q),p[q]=!1)}function Xe(q,Fe){return m[q]!==Fe?(n.bindFramebuffer(q,Fe),m[q]=Fe,r&&(q===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=Fe),q===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=Fe)),!0):!1}function j(q,Fe){let Ie=x,ot=!1;if(q)if(Ie=v.get(Fe),Ie===void 0&&(Ie=[],v.set(Fe,Ie)),q.isWebGLMultipleRenderTargets){const we=q.texture;if(Ie.length!==we.length||Ie[0]!==n.COLOR_ATTACHMENT0){for(let Qe=0,rt=we.length;Qe<rt;Qe++)Ie[Qe]=n.COLOR_ATTACHMENT0+Qe;Ie.length=we.length,ot=!0}}else Ie[0]!==n.COLOR_ATTACHMENT0&&(Ie[0]=n.COLOR_ATTACHMENT0,ot=!0);else Ie[0]!==n.BACK&&(Ie[0]=n.BACK,ot=!0);ot&&(t.isWebGL2?n.drawBuffers(Ie):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(Ie))}function Se(q){return _!==q?(n.useProgram(q),_=q,!0):!1}const fe={[Wo]:n.FUNC_ADD,[E3]:n.FUNC_SUBTRACT,[A3]:n.FUNC_REVERSE_SUBTRACT};if(r)fe[z2]=n.MIN,fe[W2]=n.MAX;else{const q=e.get("EXT_blend_minmax");q!==null&&(fe[z2]=q.MIN_EXT,fe[W2]=q.MAX_EXT)}const Te={[C3]:n.ZERO,[P3]:n.ONE,[R3]:n.SRC_COLOR,[C0]:n.SRC_ALPHA,[O3]:n.SRC_ALPHA_SATURATE,[N3]:n.DST_COLOR,[L3]:n.DST_ALPHA,[I3]:n.ONE_MINUS_SRC_COLOR,[P0]:n.ONE_MINUS_SRC_ALPHA,[D3]:n.ONE_MINUS_DST_COLOR,[F3]:n.ONE_MINUS_DST_ALPHA,[U3]:n.CONSTANT_COLOR,[k3]:n.ONE_MINUS_CONSTANT_COLOR,[B3]:n.CONSTANT_ALPHA,[z3]:n.ONE_MINUS_CONSTANT_ALPHA};function de(q,Fe,Ie,ot,we,Qe,rt,Nt,Ht,Rt){if(q===no){g===!0&&(Be(n.BLEND),g=!1);return}if(g===!1&&(nt(n.BLEND),g=!0),q!==M3){if(q!==S||Rt!==H){if((b!==Wo||A!==Wo)&&(n.blendEquation(n.FUNC_ADD),b=Wo,A=Wo),Rt)switch(q){case hl:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case U2:n.blendFunc(n.ONE,n.ONE);break;case k2:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case B2:n.blendFuncSeparate(n.ZERO,n.SRC_COLOR,n.ZERO,n.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",q);break}else switch(q){case hl:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case U2:n.blendFunc(n.SRC_ALPHA,n.ONE);break;case k2:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case B2:n.blendFunc(n.ZERO,n.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",q);break}M=null,C=null,R=null,O=null,P.set(0,0,0),I=0,S=q,H=Rt}return}we=we||Fe,Qe=Qe||Ie,rt=rt||ot,(Fe!==b||we!==A)&&(n.blendEquationSeparate(fe[Fe],fe[we]),b=Fe,A=we),(Ie!==M||ot!==C||Qe!==R||rt!==O)&&(n.blendFuncSeparate(Te[Ie],Te[ot],Te[Qe],Te[rt]),M=Ie,C=ot,R=Qe,O=rt),(Nt.equals(P)===!1||Ht!==I)&&(n.blendColor(Nt.r,Nt.g,Nt.b,Ht),P.copy(Nt),I=Ht),S=q,H=!1}function $e(q,Fe){q.side===xs?Be(n.CULL_FACE):nt(n.CULL_FACE);let Ie=q.side===Ar;Fe&&(Ie=!Ie),Ne(Ie),q.blending===hl&&q.transparent===!1?de(no):de(q.blending,q.blendEquation,q.blendSrc,q.blendDst,q.blendEquationAlpha,q.blendSrcAlpha,q.blendDstAlpha,q.blendColor,q.blendAlpha,q.premultipliedAlpha),l.setFunc(q.depthFunc),l.setTest(q.depthTest),l.setMask(q.depthWrite),a.setMask(q.colorWrite);const ot=q.stencilWrite;h.setTest(ot),ot&&(h.setMask(q.stencilWriteMask),h.setFunc(q.stencilFunc,q.stencilRef,q.stencilFuncMask),h.setOp(q.stencilFail,q.stencilZFail,q.stencilZPass)),te(q.polygonOffset,q.polygonOffsetFactor,q.polygonOffsetUnits),q.alphaToCoverage===!0?nt(n.SAMPLE_ALPHA_TO_COVERAGE):Be(n.SAMPLE_ALPHA_TO_COVERAGE)}function Ne(q){X!==q&&(q?n.frontFace(n.CW):n.frontFace(n.CCW),X=q)}function k(q){q!==b3?(nt(n.CULL_FACE),q!==se&&(q===O2?n.cullFace(n.BACK):q===w3?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Be(n.CULL_FACE),se=q}function N(q){q!==W&&(F&&n.lineWidth(q),W=q)}function te(q,Fe,Ie){q?(nt(n.POLYGON_OFFSET_FILL),($!==Fe||Z!==Ie)&&(n.polygonOffset(Fe,Ie),$=Fe,Z=Ie)):Be(n.POLYGON_OFFSET_FILL)}function be(q){q?nt(n.SCISSOR_TEST):Be(n.SCISSOR_TEST)}function ve(q){q===void 0&&(q=n.TEXTURE0+re-1),Y!==q&&(n.activeTexture(q),Y=q)}function _e(q,Fe,Ie){Ie===void 0&&(Y===null?Ie=n.TEXTURE0+re-1:Ie=Y);let ot=ee[Ie];ot===void 0&&(ot={type:void 0,texture:void 0},ee[Ie]=ot),(ot.type!==q||ot.texture!==Fe)&&(Y!==Ie&&(n.activeTexture(Ie),Y=Ie),n.bindTexture(q,Fe||tt[q]),ot.type=q,ot.texture=Fe)}function Ye(){const q=ee[Y];q!==void 0&&q.type!==void 0&&(n.bindTexture(q.type,null),q.type=void 0,q.texture=void 0)}function Ce(){try{n.compressedTexImage2D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function Ue(){try{n.compressedTexImage3D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function it(){try{n.texSubImage2D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function mt(){try{n.texSubImage3D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function xe(){try{n.compressedTexSubImage2D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function Lt(){try{n.compressedTexSubImage3D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function bt(){try{n.texStorage2D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function lt(){try{n.texStorage3D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function Ke(){try{n.texImage2D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function He(){try{n.texImage3D.apply(n,arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function ct(q){me.equals(q)===!1&&(n.scissor(q.x,q.y,q.z,q.w),me.copy(q))}function Ft(q){Ee.equals(q)===!1&&(n.viewport(q.x,q.y,q.z,q.w),Ee.copy(q))}function qt(q,Fe){let Ie=f.get(Fe);Ie===void 0&&(Ie=new WeakMap,f.set(Fe,Ie));let ot=Ie.get(q);ot===void 0&&(ot=n.getUniformBlockIndex(Fe,q.name),Ie.set(q,ot))}function vt(q,Fe){const ot=f.get(Fe).get(q);d.get(Fe)!==ot&&(n.uniformBlockBinding(Fe,ot,q.__bindingPointIndex),d.set(Fe,ot))}function Re(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),r===!0&&(n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),p={},Y=null,ee={},m={},v=new WeakMap,x=[],_=null,g=!1,S=null,b=null,M=null,C=null,A=null,R=null,O=null,P=new We(0,0,0),I=0,H=!1,X=null,se=null,W=null,$=null,Z=null,me.set(0,0,n.canvas.width,n.canvas.height),Ee.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),h.reset()}return{buffers:{color:a,depth:l,stencil:h},enable:nt,disable:Be,bindFramebuffer:Xe,drawBuffers:j,useProgram:Se,setBlending:de,setMaterial:$e,setFlipSided:Ne,setCullFace:k,setLineWidth:N,setPolygonOffset:te,setScissorTest:be,activeTexture:ve,bindTexture:_e,unbindTexture:Ye,compressedTexImage2D:Ce,compressedTexImage3D:Ue,texImage2D:Ke,texImage3D:He,updateUBOMapping:qt,uniformBlockBinding:vt,texStorage2D:bt,texStorage3D:lt,texSubImage2D:it,texSubImage3D:mt,compressedTexSubImage2D:xe,compressedTexSubImage3D:Lt,scissor:ct,viewport:Ft,reset:Re}}function Iq(n,e,t,r,i,s,o){const a=i.isWebGL2,l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),d=new WeakMap;let f;const p=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(k,N){return m?new OffscreenCanvas(k,N):Ld("canvas")}function x(k,N,te,be){let ve=1;if((k.width>be||k.height>be)&&(ve=be/Math.max(k.width,k.height)),ve<1||N===!0)if(typeof HTMLImageElement<"u"&&k instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&k instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&k instanceof ImageBitmap){const _e=N?L0:Math.floor,Ye=_e(ve*k.width),Ce=_e(ve*k.height);f===void 0&&(f=v(Ye,Ce));const Ue=te?v(Ye,Ce):f;return Ue.width=Ye,Ue.height=Ce,Ue.getContext("2d").drawImage(k,0,0,Ye,Ce),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+Ye+"x"+Ce+")."),Ue}else return"data"in k&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),k;return k}function _(k){return gx(k.width)&&gx(k.height)}function g(k){return a?!1:k.wrapS!==pr||k.wrapT!==pr||k.minFilter!==bn&&k.minFilter!==Tn}function S(k,N){return k.generateMipmaps&&N&&k.minFilter!==bn&&k.minFilter!==Tn}function b(k){n.generateMipmap(k)}function M(k,N,te,be,ve=!1){if(a===!1)return N;if(k!==null){if(n[k]!==void 0)return n[k];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+k+"'")}let _e=N;if(N===n.RED&&(te===n.FLOAT&&(_e=n.R32F),te===n.HALF_FLOAT&&(_e=n.R16F),te===n.UNSIGNED_BYTE&&(_e=n.R8)),N===n.RED_INTEGER&&(te===n.UNSIGNED_BYTE&&(_e=n.R8UI),te===n.UNSIGNED_SHORT&&(_e=n.R16UI),te===n.UNSIGNED_INT&&(_e=n.R32UI),te===n.BYTE&&(_e=n.R8I),te===n.SHORT&&(_e=n.R16I),te===n.INT&&(_e=n.R32I)),N===n.RG&&(te===n.FLOAT&&(_e=n.RG32F),te===n.HALF_FLOAT&&(_e=n.RG16F),te===n.UNSIGNED_BYTE&&(_e=n.RG8)),N===n.RGBA){const Ye=ve?Cd:Gt.getTransfer(be);te===n.FLOAT&&(_e=n.RGBA32F),te===n.HALF_FLOAT&&(_e=n.RGBA16F),te===n.UNSIGNED_BYTE&&(_e=Ye===$t?n.SRGB8_ALPHA8:n.RGBA8),te===n.UNSIGNED_SHORT_4_4_4_4&&(_e=n.RGBA4),te===n.UNSIGNED_SHORT_5_5_5_1&&(_e=n.RGB5_A1)}return(_e===n.R16F||_e===n.R32F||_e===n.RG16F||_e===n.RG32F||_e===n.RGBA16F||_e===n.RGBA32F)&&e.get("EXT_color_buffer_float"),_e}function C(k,N,te){return S(k,te)===!0||k.isFramebufferTexture&&k.minFilter!==bn&&k.minFilter!==Tn?Math.log2(Math.max(N.width,N.height))+1:k.mipmaps!==void 0&&k.mipmaps.length>0?k.mipmaps.length:k.isCompressedTexture&&Array.isArray(k.image)?N.mipmaps.length:1}function A(k){return k===bn||k===R0||k===jh?n.NEAREST:n.LINEAR}function R(k){const N=k.target;N.removeEventListener("dispose",R),P(N),N.isVideoTexture&&d.delete(N)}function O(k){const N=k.target;N.removeEventListener("dispose",O),H(N)}function P(k){const N=r.get(k);if(N.__webglInit===void 0)return;const te=k.source,be=p.get(te);if(be){const ve=be[N.__cacheKey];ve.usedTimes--,ve.usedTimes===0&&I(k),Object.keys(be).length===0&&p.delete(te)}r.remove(k)}function I(k){const N=r.get(k);n.deleteTexture(N.__webglTexture);const te=k.source,be=p.get(te);delete be[N.__cacheKey],o.memory.textures--}function H(k){const N=k.texture,te=r.get(k),be=r.get(N);if(be.__webglTexture!==void 0&&(n.deleteTexture(be.__webglTexture),o.memory.textures--),k.depthTexture&&k.depthTexture.dispose(),k.isWebGLCubeRenderTarget)for(let ve=0;ve<6;ve++){if(Array.isArray(te.__webglFramebuffer[ve]))for(let _e=0;_e<te.__webglFramebuffer[ve].length;_e++)n.deleteFramebuffer(te.__webglFramebuffer[ve][_e]);else n.deleteFramebuffer(te.__webglFramebuffer[ve]);te.__webglDepthbuffer&&n.deleteRenderbuffer(te.__webglDepthbuffer[ve])}else{if(Array.isArray(te.__webglFramebuffer))for(let ve=0;ve<te.__webglFramebuffer.length;ve++)n.deleteFramebuffer(te.__webglFramebuffer[ve]);else n.deleteFramebuffer(te.__webglFramebuffer);if(te.__webglDepthbuffer&&n.deleteRenderbuffer(te.__webglDepthbuffer),te.__webglMultisampledFramebuffer&&n.deleteFramebuffer(te.__webglMultisampledFramebuffer),te.__webglColorRenderbuffer)for(let ve=0;ve<te.__webglColorRenderbuffer.length;ve++)te.__webglColorRenderbuffer[ve]&&n.deleteRenderbuffer(te.__webglColorRenderbuffer[ve]);te.__webglDepthRenderbuffer&&n.deleteRenderbuffer(te.__webglDepthRenderbuffer)}if(k.isWebGLMultipleRenderTargets)for(let ve=0,_e=N.length;ve<_e;ve++){const Ye=r.get(N[ve]);Ye.__webglTexture&&(n.deleteTexture(Ye.__webglTexture),o.memory.textures--),r.remove(N[ve])}r.remove(N),r.remove(k)}let X=0;function se(){X=0}function W(){const k=X;return k>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+k+" texture units while this GPU supports only "+i.maxTextures),X+=1,k}function $(k){const N=[];return N.push(k.wrapS),N.push(k.wrapT),N.push(k.wrapR||0),N.push(k.magFilter),N.push(k.minFilter),N.push(k.anisotropy),N.push(k.internalFormat),N.push(k.format),N.push(k.type),N.push(k.generateMipmaps),N.push(k.premultiplyAlpha),N.push(k.flipY),N.push(k.unpackAlignment),N.push(k.colorSpace),N.join()}function Z(k,N){const te=r.get(k);if(k.isVideoTexture&&$e(k),k.isRenderTargetTexture===!1&&k.version>0&&te.__version!==k.version){const be=k.image;if(be===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(be.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{me(te,k,N);return}}t.bindTexture(n.TEXTURE_2D,te.__webglTexture,n.TEXTURE0+N)}function re(k,N){const te=r.get(k);if(k.version>0&&te.__version!==k.version){me(te,k,N);return}t.bindTexture(n.TEXTURE_2D_ARRAY,te.__webglTexture,n.TEXTURE0+N)}function F(k,N){const te=r.get(k);if(k.version>0&&te.__version!==k.version){me(te,k,N);return}t.bindTexture(n.TEXTURE_3D,te.__webglTexture,n.TEXTURE0+N)}function U(k,N){const te=r.get(k);if(k.version>0&&te.__version!==k.version){Ee(te,k,N);return}t.bindTexture(n.TEXTURE_CUBE_MAP,te.__webglTexture,n.TEXTURE0+N)}const G={[wd]:n.REPEAT,[pr]:n.CLAMP_TO_EDGE,[Td]:n.MIRRORED_REPEAT},Y={[bn]:n.NEAREST,[R0]:n.NEAREST_MIPMAP_NEAREST,[jh]:n.NEAREST_MIPMAP_LINEAR,[Tn]:n.LINEAR,[jS]:n.LINEAR_MIPMAP_NEAREST,[ga]:n.LINEAR_MIPMAP_LINEAR},ee={[gI]:n.NEVER,[bI]:n.ALWAYS,[yI]:n.LESS,[t1]:n.LEQUAL,[vI]:n.EQUAL,[SI]:n.GEQUAL,[_I]:n.GREATER,[xI]:n.NOTEQUAL};function K(k,N,te){if(te?(n.texParameteri(k,n.TEXTURE_WRAP_S,G[N.wrapS]),n.texParameteri(k,n.TEXTURE_WRAP_T,G[N.wrapT]),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,G[N.wrapR]),n.texParameteri(k,n.TEXTURE_MAG_FILTER,Y[N.magFilter]),n.texParameteri(k,n.TEXTURE_MIN_FILTER,Y[N.minFilter])):(n.texParameteri(k,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(k,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(k===n.TEXTURE_3D||k===n.TEXTURE_2D_ARRAY)&&n.texParameteri(k,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(N.wrapS!==pr||N.wrapT!==pr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(k,n.TEXTURE_MAG_FILTER,A(N.magFilter)),n.texParameteri(k,n.TEXTURE_MIN_FILTER,A(N.minFilter)),N.minFilter!==bn&&N.minFilter!==Tn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),N.compareFunction&&(n.texParameteri(k,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(k,n.TEXTURE_COMPARE_FUNC,ee[N.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const be=e.get("EXT_texture_filter_anisotropic");if(N.magFilter===bn||N.minFilter!==jh&&N.minFilter!==ga||N.type===Xi&&e.has("OES_texture_float_linear")===!1||a===!1&&N.type===yu&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||r.get(N).__currentAnisotropy)&&(n.texParameterf(k,be.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,i.getMaxAnisotropy())),r.get(N).__currentAnisotropy=N.anisotropy)}}function ie(k,N){let te=!1;k.__webglInit===void 0&&(k.__webglInit=!0,N.addEventListener("dispose",R));const be=N.source;let ve=p.get(be);ve===void 0&&(ve={},p.set(be,ve));const _e=$(N);if(_e!==k.__cacheKey){ve[_e]===void 0&&(ve[_e]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,te=!0),ve[_e].usedTimes++;const Ye=ve[k.__cacheKey];Ye!==void 0&&(ve[k.__cacheKey].usedTimes--,Ye.usedTimes===0&&I(N)),k.__cacheKey=_e,k.__webglTexture=ve[_e].texture}return te}function me(k,N,te){let be=n.TEXTURE_2D;(N.isDataArrayTexture||N.isCompressedArrayTexture)&&(be=n.TEXTURE_2D_ARRAY),N.isData3DTexture&&(be=n.TEXTURE_3D);const ve=ie(k,N),_e=N.source;t.bindTexture(be,k.__webglTexture,n.TEXTURE0+te);const Ye=r.get(_e);if(_e.version!==Ye.__version||ve===!0){t.activeTexture(n.TEXTURE0+te);const Ce=Gt.getPrimaries(Gt.workingColorSpace),Ue=N.colorSpace===ni?null:Gt.getPrimaries(N.colorSpace),it=N.colorSpace===ni||Ce===Ue?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,N.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,N.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,it);const mt=g(N)&&_(N.image)===!1;let xe=x(N.image,mt,!1,i.maxTextureSize);xe=Ne(N,xe);const Lt=_(xe)||a,bt=s.convert(N.format,N.colorSpace);let lt=s.convert(N.type),Ke=M(N.internalFormat,bt,lt,N.colorSpace,N.isVideoTexture);K(be,N,Lt);let He;const ct=N.mipmaps,Ft=a&&N.isVideoTexture!==!0&&Ke!==QS,qt=Ye.__version===void 0||ve===!0,vt=C(N,xe,Lt);if(N.isDepthTexture)Ke=n.DEPTH_COMPONENT,a?N.type===Xi?Ke=n.DEPTH_COMPONENT32F:N.type===Js?Ke=n.DEPTH_COMPONENT24:N.type===sa?Ke=n.DEPTH24_STENCIL8:Ke=n.DEPTH_COMPONENT16:N.type===Xi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===oa&&Ke===n.DEPTH_COMPONENT&&N.type!==dg&&N.type!==Js&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=Js,lt=s.convert(N.type)),N.format===bl&&Ke===n.DEPTH_COMPONENT&&(Ke=n.DEPTH_STENCIL,N.type!==sa&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=sa,lt=s.convert(N.type))),qt&&(Ft?t.texStorage2D(n.TEXTURE_2D,1,Ke,xe.width,xe.height):t.texImage2D(n.TEXTURE_2D,0,Ke,xe.width,xe.height,0,bt,lt,null));else if(N.isDataTexture)if(ct.length>0&&Lt){Ft&&qt&&t.texStorage2D(n.TEXTURE_2D,vt,Ke,ct[0].width,ct[0].height);for(let Re=0,q=ct.length;Re<q;Re++)He=ct[Re],Ft?t.texSubImage2D(n.TEXTURE_2D,Re,0,0,He.width,He.height,bt,lt,He.data):t.texImage2D(n.TEXTURE_2D,Re,Ke,He.width,He.height,0,bt,lt,He.data);N.generateMipmaps=!1}else Ft?(qt&&t.texStorage2D(n.TEXTURE_2D,vt,Ke,xe.width,xe.height),t.texSubImage2D(n.TEXTURE_2D,0,0,0,xe.width,xe.height,bt,lt,xe.data)):t.texImage2D(n.TEXTURE_2D,0,Ke,xe.width,xe.height,0,bt,lt,xe.data);else if(N.isCompressedTexture)if(N.isCompressedArrayTexture){Ft&&qt&&t.texStorage3D(n.TEXTURE_2D_ARRAY,vt,Ke,ct[0].width,ct[0].height,xe.depth);for(let Re=0,q=ct.length;Re<q;Re++)He=ct[Re],N.format!==Mr?bt!==null?Ft?t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Re,0,0,0,He.width,He.height,xe.depth,bt,He.data,0,0):t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,Re,Ke,He.width,He.height,xe.depth,0,He.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ft?t.texSubImage3D(n.TEXTURE_2D_ARRAY,Re,0,0,0,He.width,He.height,xe.depth,bt,lt,He.data):t.texImage3D(n.TEXTURE_2D_ARRAY,Re,Ke,He.width,He.height,xe.depth,0,bt,lt,He.data)}else{Ft&&qt&&t.texStorage2D(n.TEXTURE_2D,vt,Ke,ct[0].width,ct[0].height);for(let Re=0,q=ct.length;Re<q;Re++)He=ct[Re],N.format!==Mr?bt!==null?Ft?t.compressedTexSubImage2D(n.TEXTURE_2D,Re,0,0,He.width,He.height,bt,He.data):t.compressedTexImage2D(n.TEXTURE_2D,Re,Ke,He.width,He.height,0,He.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Ft?t.texSubImage2D(n.TEXTURE_2D,Re,0,0,He.width,He.height,bt,lt,He.data):t.texImage2D(n.TEXTURE_2D,Re,Ke,He.width,He.height,0,bt,lt,He.data)}else if(N.isDataArrayTexture)Ft?(qt&&t.texStorage3D(n.TEXTURE_2D_ARRAY,vt,Ke,xe.width,xe.height,xe.depth),t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,xe.width,xe.height,xe.depth,bt,lt,xe.data)):t.texImage3D(n.TEXTURE_2D_ARRAY,0,Ke,xe.width,xe.height,xe.depth,0,bt,lt,xe.data);else if(N.isData3DTexture)Ft?(qt&&t.texStorage3D(n.TEXTURE_3D,vt,Ke,xe.width,xe.height,xe.depth),t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,xe.width,xe.height,xe.depth,bt,lt,xe.data)):t.texImage3D(n.TEXTURE_3D,0,Ke,xe.width,xe.height,xe.depth,0,bt,lt,xe.data);else if(N.isFramebufferTexture){if(qt)if(Ft)t.texStorage2D(n.TEXTURE_2D,vt,Ke,xe.width,xe.height);else{let Re=xe.width,q=xe.height;for(let Fe=0;Fe<vt;Fe++)t.texImage2D(n.TEXTURE_2D,Fe,Ke,Re,q,0,bt,lt,null),Re>>=1,q>>=1}}else if(ct.length>0&&Lt){Ft&&qt&&t.texStorage2D(n.TEXTURE_2D,vt,Ke,ct[0].width,ct[0].height);for(let Re=0,q=ct.length;Re<q;Re++)He=ct[Re],Ft?t.texSubImage2D(n.TEXTURE_2D,Re,0,0,bt,lt,He):t.texImage2D(n.TEXTURE_2D,Re,Ke,bt,lt,He);N.generateMipmaps=!1}else Ft?(qt&&t.texStorage2D(n.TEXTURE_2D,vt,Ke,xe.width,xe.height),t.texSubImage2D(n.TEXTURE_2D,0,0,0,bt,lt,xe)):t.texImage2D(n.TEXTURE_2D,0,Ke,bt,lt,xe);S(N,Lt)&&b(be),Ye.__version=_e.version,N.onUpdate&&N.onUpdate(N)}k.__version=N.version}function Ee(k,N,te){if(N.image.length!==6)return;const be=ie(k,N),ve=N.source;t.bindTexture(n.TEXTURE_CUBE_MAP,k.__webglTexture,n.TEXTURE0+te);const _e=r.get(ve);if(ve.version!==_e.__version||be===!0){t.activeTexture(n.TEXTURE0+te);const Ye=Gt.getPrimaries(Gt.workingColorSpace),Ce=N.colorSpace===ni?null:Gt.getPrimaries(N.colorSpace),Ue=N.colorSpace===ni||Ye===Ce?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,N.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,N.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,N.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ue);const it=N.isCompressedTexture||N.image[0].isCompressedTexture,mt=N.image[0]&&N.image[0].isDataTexture,xe=[];for(let Re=0;Re<6;Re++)!it&&!mt?xe[Re]=x(N.image[Re],!1,!0,i.maxCubemapSize):xe[Re]=mt?N.image[Re].image:N.image[Re],xe[Re]=Ne(N,xe[Re]);const Lt=xe[0],bt=_(Lt)||a,lt=s.convert(N.format,N.colorSpace),Ke=s.convert(N.type),He=M(N.internalFormat,lt,Ke,N.colorSpace),ct=a&&N.isVideoTexture!==!0,Ft=_e.__version===void 0||be===!0;let qt=C(N,Lt,bt);K(n.TEXTURE_CUBE_MAP,N,bt);let vt;if(it){ct&&Ft&&t.texStorage2D(n.TEXTURE_CUBE_MAP,qt,He,Lt.width,Lt.height);for(let Re=0;Re<6;Re++){vt=xe[Re].mipmaps;for(let q=0;q<vt.length;q++){const Fe=vt[q];N.format!==Mr?lt!==null?ct?t.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,q,0,0,Fe.width,Fe.height,lt,Fe.data):t.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,q,He,Fe.width,Fe.height,0,Fe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ct?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,q,0,0,Fe.width,Fe.height,lt,Ke,Fe.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,q,He,Fe.width,Fe.height,0,lt,Ke,Fe.data)}}}else{vt=N.mipmaps,ct&&Ft&&(vt.length>0&&qt++,t.texStorage2D(n.TEXTURE_CUBE_MAP,qt,He,xe[0].width,xe[0].height));for(let Re=0;Re<6;Re++)if(mt){ct?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0,0,0,xe[Re].width,xe[Re].height,lt,Ke,xe[Re].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0,He,xe[Re].width,xe[Re].height,0,lt,Ke,xe[Re].data);for(let q=0;q<vt.length;q++){const Ie=vt[q].image[Re].image;ct?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,q+1,0,0,Ie.width,Ie.height,lt,Ke,Ie.data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,q+1,He,Ie.width,Ie.height,0,lt,Ke,Ie.data)}}else{ct?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0,0,0,lt,Ke,xe[Re]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0,He,lt,Ke,xe[Re]);for(let q=0;q<vt.length;q++){const Fe=vt[q];ct?t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,q+1,0,0,lt,Ke,Fe.image[Re]):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Re,q+1,He,lt,Ke,Fe.image[Re])}}}S(N,bt)&&b(n.TEXTURE_CUBE_MAP),_e.__version=ve.version,N.onUpdate&&N.onUpdate(N)}k.__version=N.version}function ge(k,N,te,be,ve,_e){const Ye=s.convert(te.format,te.colorSpace),Ce=s.convert(te.type),Ue=M(te.internalFormat,Ye,Ce,te.colorSpace);if(!r.get(N).__hasExternalTextures){const mt=Math.max(1,N.width>>_e),xe=Math.max(1,N.height>>_e);ve===n.TEXTURE_3D||ve===n.TEXTURE_2D_ARRAY?t.texImage3D(ve,_e,Ue,mt,xe,N.depth,0,Ye,Ce,null):t.texImage2D(ve,_e,Ue,mt,xe,0,Ye,Ce,null)}t.bindFramebuffer(n.FRAMEBUFFER,k),de(N)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,be,ve,r.get(te).__webglTexture,0,Te(N)):(ve===n.TEXTURE_2D||ve>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&ve<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,be,ve,r.get(te).__webglTexture,_e),t.bindFramebuffer(n.FRAMEBUFFER,null)}function tt(k,N,te){if(n.bindRenderbuffer(n.RENDERBUFFER,k),N.depthBuffer&&!N.stencilBuffer){let be=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(te||de(N)){const ve=N.depthTexture;ve&&ve.isDepthTexture&&(ve.type===Xi?be=n.DEPTH_COMPONENT32F:ve.type===Js&&(be=n.DEPTH_COMPONENT24));const _e=Te(N);de(N)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,_e,be,N.width,N.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,_e,be,N.width,N.height)}else n.renderbufferStorage(n.RENDERBUFFER,be,N.width,N.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,k)}else if(N.depthBuffer&&N.stencilBuffer){const be=Te(N);te&&de(N)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,be,n.DEPTH24_STENCIL8,N.width,N.height):de(N)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,be,n.DEPTH24_STENCIL8,N.width,N.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,N.width,N.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,k)}else{const be=N.isWebGLMultipleRenderTargets===!0?N.texture:[N.texture];for(let ve=0;ve<be.length;ve++){const _e=be[ve],Ye=s.convert(_e.format,_e.colorSpace),Ce=s.convert(_e.type),Ue=M(_e.internalFormat,Ye,Ce,_e.colorSpace),it=Te(N);te&&de(N)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,it,Ue,N.width,N.height):de(N)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,it,Ue,N.width,N.height):n.renderbufferStorage(n.RENDERBUFFER,Ue,N.width,N.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function nt(k,N){if(N&&N.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(n.FRAMEBUFFER,k),!(N.depthTexture&&N.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(N.depthTexture).__webglTexture||N.depthTexture.image.width!==N.width||N.depthTexture.image.height!==N.height)&&(N.depthTexture.image.width=N.width,N.depthTexture.image.height=N.height,N.depthTexture.needsUpdate=!0),Z(N.depthTexture,0);const be=r.get(N.depthTexture).__webglTexture,ve=Te(N);if(N.depthTexture.format===oa)de(N)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,be,0,ve):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,be,0);else if(N.depthTexture.format===bl)de(N)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,be,0,ve):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,be,0);else throw new Error("Unknown depthTexture format")}function Be(k){const N=r.get(k),te=k.isWebGLCubeRenderTarget===!0;if(k.depthTexture&&!N.__autoAllocateDepthBuffer){if(te)throw new Error("target.depthTexture not supported in Cube render targets");nt(N.__webglFramebuffer,k)}else if(te){N.__webglDepthbuffer=[];for(let be=0;be<6;be++)t.bindFramebuffer(n.FRAMEBUFFER,N.__webglFramebuffer[be]),N.__webglDepthbuffer[be]=n.createRenderbuffer(),tt(N.__webglDepthbuffer[be],k,!1)}else t.bindFramebuffer(n.FRAMEBUFFER,N.__webglFramebuffer),N.__webglDepthbuffer=n.createRenderbuffer(),tt(N.__webglDepthbuffer,k,!1);t.bindFramebuffer(n.FRAMEBUFFER,null)}function Xe(k,N,te){const be=r.get(k);N!==void 0&&ge(be.__webglFramebuffer,k,k.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),te!==void 0&&Be(k)}function j(k){const N=k.texture,te=r.get(k),be=r.get(N);k.addEventListener("dispose",O),k.isWebGLMultipleRenderTargets!==!0&&(be.__webglTexture===void 0&&(be.__webglTexture=n.createTexture()),be.__version=N.version,o.memory.textures++);const ve=k.isWebGLCubeRenderTarget===!0,_e=k.isWebGLMultipleRenderTargets===!0,Ye=_(k)||a;if(ve){te.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(a&&N.mipmaps&&N.mipmaps.length>0){te.__webglFramebuffer[Ce]=[];for(let Ue=0;Ue<N.mipmaps.length;Ue++)te.__webglFramebuffer[Ce][Ue]=n.createFramebuffer()}else te.__webglFramebuffer[Ce]=n.createFramebuffer()}else{if(a&&N.mipmaps&&N.mipmaps.length>0){te.__webglFramebuffer=[];for(let Ce=0;Ce<N.mipmaps.length;Ce++)te.__webglFramebuffer[Ce]=n.createFramebuffer()}else te.__webglFramebuffer=n.createFramebuffer();if(_e)if(i.drawBuffers){const Ce=k.texture;for(let Ue=0,it=Ce.length;Ue<it;Ue++){const mt=r.get(Ce[Ue]);mt.__webglTexture===void 0&&(mt.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(a&&k.samples>0&&de(k)===!1){const Ce=_e?N:[N];te.__webglMultisampledFramebuffer=n.createFramebuffer(),te.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,te.__webglMultisampledFramebuffer);for(let Ue=0;Ue<Ce.length;Ue++){const it=Ce[Ue];te.__webglColorRenderbuffer[Ue]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,te.__webglColorRenderbuffer[Ue]);const mt=s.convert(it.format,it.colorSpace),xe=s.convert(it.type),Lt=M(it.internalFormat,mt,xe,it.colorSpace,k.isXRRenderTarget===!0),bt=Te(k);n.renderbufferStorageMultisample(n.RENDERBUFFER,bt,Lt,k.width,k.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Ue,n.RENDERBUFFER,te.__webglColorRenderbuffer[Ue])}n.bindRenderbuffer(n.RENDERBUFFER,null),k.depthBuffer&&(te.__webglDepthRenderbuffer=n.createRenderbuffer(),tt(te.__webglDepthRenderbuffer,k,!0)),t.bindFramebuffer(n.FRAMEBUFFER,null)}}if(ve){t.bindTexture(n.TEXTURE_CUBE_MAP,be.__webglTexture),K(n.TEXTURE_CUBE_MAP,N,Ye);for(let Ce=0;Ce<6;Ce++)if(a&&N.mipmaps&&N.mipmaps.length>0)for(let Ue=0;Ue<N.mipmaps.length;Ue++)ge(te.__webglFramebuffer[Ce][Ue],k,N,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,Ue);else ge(te.__webglFramebuffer[Ce],k,N,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,0);S(N,Ye)&&b(n.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(_e){const Ce=k.texture;for(let Ue=0,it=Ce.length;Ue<it;Ue++){const mt=Ce[Ue],xe=r.get(mt);t.bindTexture(n.TEXTURE_2D,xe.__webglTexture),K(n.TEXTURE_2D,mt,Ye),ge(te.__webglFramebuffer,k,mt,n.COLOR_ATTACHMENT0+Ue,n.TEXTURE_2D,0),S(mt,Ye)&&b(n.TEXTURE_2D)}t.unbindTexture()}else{let Ce=n.TEXTURE_2D;if((k.isWebGL3DRenderTarget||k.isWebGLArrayRenderTarget)&&(a?Ce=k.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),t.bindTexture(Ce,be.__webglTexture),K(Ce,N,Ye),a&&N.mipmaps&&N.mipmaps.length>0)for(let Ue=0;Ue<N.mipmaps.length;Ue++)ge(te.__webglFramebuffer[Ue],k,N,n.COLOR_ATTACHMENT0,Ce,Ue);else ge(te.__webglFramebuffer,k,N,n.COLOR_ATTACHMENT0,Ce,0);S(N,Ye)&&b(Ce),t.unbindTexture()}k.depthBuffer&&Be(k)}function Se(k){const N=_(k)||a,te=k.isWebGLMultipleRenderTargets===!0?k.texture:[k.texture];for(let be=0,ve=te.length;be<ve;be++){const _e=te[be];if(S(_e,N)){const Ye=k.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D,Ce=r.get(_e).__webglTexture;t.bindTexture(Ye,Ce),b(Ye),t.unbindTexture()}}}function fe(k){if(a&&k.samples>0&&de(k)===!1){const N=k.isWebGLMultipleRenderTargets?k.texture:[k.texture],te=k.width,be=k.height;let ve=n.COLOR_BUFFER_BIT;const _e=[],Ye=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ce=r.get(k),Ue=k.isWebGLMultipleRenderTargets===!0;if(Ue)for(let it=0;it<N.length;it++)t.bindFramebuffer(n.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+it,n.RENDERBUFFER,null),t.bindFramebuffer(n.FRAMEBUFFER,Ce.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+it,n.TEXTURE_2D,null,0);t.bindFramebuffer(n.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let it=0;it<N.length;it++){_e.push(n.COLOR_ATTACHMENT0+it),k.depthBuffer&&_e.push(Ye);const mt=Ce.__ignoreDepthValues!==void 0?Ce.__ignoreDepthValues:!1;if(mt===!1&&(k.depthBuffer&&(ve|=n.DEPTH_BUFFER_BIT),k.stencilBuffer&&(ve|=n.STENCIL_BUFFER_BIT)),Ue&&n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,Ce.__webglColorRenderbuffer[it]),mt===!0&&(n.invalidateFramebuffer(n.READ_FRAMEBUFFER,[Ye]),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[Ye])),Ue){const xe=r.get(N[it]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,xe,0)}n.blitFramebuffer(0,0,te,be,0,0,te,be,ve,n.NEAREST),h&&n.invalidateFramebuffer(n.READ_FRAMEBUFFER,_e)}if(t.bindFramebuffer(n.READ_FRAMEBUFFER,null),t.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),Ue)for(let it=0;it<N.length;it++){t.bindFramebuffer(n.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+it,n.RENDERBUFFER,Ce.__webglColorRenderbuffer[it]);const mt=r.get(N[it]).__webglTexture;t.bindFramebuffer(n.FRAMEBUFFER,Ce.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+it,n.TEXTURE_2D,mt,0)}t.bindFramebuffer(n.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}}function Te(k){return Math.min(i.maxSamples,k.samples)}function de(k){const N=r.get(k);return a&&k.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&N.__useRenderToTexture!==!1}function $e(k){const N=o.render.frame;d.get(k)!==N&&(d.set(k,N),k.update())}function Ne(k,N){const te=k.colorSpace,be=k.format,ve=k.type;return k.isCompressedTexture===!0||k.isVideoTexture===!0||k.format===I0||te!==Ps&&te!==ni&&(Gt.getTransfer(te)===$t?a===!1?e.has("EXT_sRGB")===!0&&be===Mr?(k.format=I0,k.minFilter=Tn,k.generateMipmaps=!1):N=r1.sRGBToLinear(N):(be!==Mr||ve!==Es)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",te)),N}this.allocateTextureUnit=W,this.resetTextureUnits=se,this.setTexture2D=Z,this.setTexture2DArray=re,this.setTexture3D=F,this.setTextureCube=U,this.rebindTextures=Xe,this.setupRenderTarget=j,this.updateRenderTargetMipmap=Se,this.updateMultisampleRenderTarget=fe,this.setupDepthRenderbuffer=Be,this.setupFrameBufferTexture=ge,this.useMultisampledRTT=de}function UI(n,e,t){const r=t.isWebGL2;function i(s,o=ni){let a;const l=Gt.getTransfer(o);if(s===Es)return n.UNSIGNED_BYTE;if(s===YS)return n.UNSIGNED_SHORT_4_4_4_4;if(s===qS)return n.UNSIGNED_SHORT_5_5_5_1;if(s===nI)return n.BYTE;if(s===rI)return n.SHORT;if(s===dg)return n.UNSIGNED_SHORT;if(s===XS)return n.INT;if(s===Js)return n.UNSIGNED_INT;if(s===Xi)return n.FLOAT;if(s===yu)return r?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===iI)return n.ALPHA;if(s===Mr)return n.RGBA;if(s===sI)return n.LUMINANCE;if(s===oI)return n.LUMINANCE_ALPHA;if(s===oa)return n.DEPTH_COMPONENT;if(s===bl)return n.DEPTH_STENCIL;if(s===I0)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===aI)return n.RED;if(s===$S)return n.RED_INTEGER;if(s===lI)return n.RG;if(s===KS)return n.RG_INTEGER;if(s===ZS)return n.RGBA_INTEGER;if(s===Gm||s===Vm||s===jm||s===Xm)if(l===$t)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Gm)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Vm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===jm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Xm)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Gm)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Vm)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===jm)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Xm)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===G2||s===V2||s===j2||s===X2)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===G2)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===V2)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===j2)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===X2)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===QS)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===Y2||s===q2)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Y2)return l===$t?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===q2)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===$2||s===K2||s===Z2||s===Q2||s===J2||s===ex||s===tx||s===nx||s===rx||s===ix||s===sx||s===ox||s===ax||s===lx)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===$2)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===K2)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Z2)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Q2)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===J2)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===ex)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===tx)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===nx)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===rx)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===ix)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===sx)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===ox)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===ax)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===lx)return l===$t?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Ym||s===cx||s===ux)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===Ym)return l===$t?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===cx)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===ux)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===cI||s===hx||s===dx||s===fx)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===Ym)return a.COMPRESSED_RED_RGTC1_EXT;if(s===hx)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===dx)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===fx)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===sa?r?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:i}}class kI extends Yn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Bc extends Wt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Lq={type:"move"};class Kv{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Bc,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 Bc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Bc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new z),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 t=this._hand;if(t)for(const r of e.hand.values())this._getHandJoint(t,r)}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,t,r){let i=null,s=null,o=null;const a=this._targetRay,l=this._grip,h=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(h&&e.hand){o=!0;for(const x of e.hand.values()){const _=t.getJointPose(x,r),g=this._getHandJoint(h,x);_!==null&&(g.matrix.fromArray(_.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=_.radius),g.visible=_!==null}const d=h.joints["index-finger-tip"],f=h.joints["thumb-tip"],p=d.position.distanceTo(f.position),m=.02,v=.005;h.inputState.pinching&&p>m+v?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!h.inputState.pinching&&p<=m-v&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,r),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,r),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Lq)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),h!==null&&(h.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const r=new Bc;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[t.jointName]=r,e.add(r)}return e.joints[t.jointName]}}class Fq extends mo{constructor(e,t){super();const r=this;let i=null,s=1,o=null,a="local-floor",l=1,h=null,d=null,f=null,p=null,m=null,v=null;const x=t.getContextAttributes();let _=null,g=null;const S=[],b=[],M=new ye;let C=null;const A=new Yn;A.layers.enable(1),A.viewport=new Vt;const R=new Yn;R.layers.enable(2),R.viewport=new Vt;const O=[A,R],P=new kI;P.layers.enable(1),P.layers.enable(2);let I=null,H=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let ie=S[K];return ie===void 0&&(ie=new Kv,S[K]=ie),ie.getTargetRaySpace()},this.getControllerGrip=function(K){let ie=S[K];return ie===void 0&&(ie=new Kv,S[K]=ie),ie.getGripSpace()},this.getHand=function(K){let ie=S[K];return ie===void 0&&(ie=new Kv,S[K]=ie),ie.getHandSpace()};function X(K){const ie=b.indexOf(K.inputSource);if(ie===-1)return;const me=S[ie];me!==void 0&&(me.update(K.inputSource,K.frame,h||o),me.dispatchEvent({type:K.type,data:K.inputSource}))}function se(){i.removeEventListener("select",X),i.removeEventListener("selectstart",X),i.removeEventListener("selectend",X),i.removeEventListener("squeeze",X),i.removeEventListener("squeezestart",X),i.removeEventListener("squeezeend",X),i.removeEventListener("end",se),i.removeEventListener("inputsourceschange",W);for(let K=0;K<S.length;K++){const ie=b[K];ie!==null&&(b[K]=null,S[K].disconnect(ie))}I=null,H=null,e.setRenderTarget(_),m=null,p=null,f=null,i=null,g=null,ee.stop(),r.isPresenting=!1,e.setPixelRatio(C),e.setSize(M.width,M.height,!1),r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(K){s=K,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(K){a=K,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||o},this.setReferenceSpace=function(K){h=K},this.getBaseLayer=function(){return p!==null?p:m},this.getBinding=function(){return f},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(K){if(i=K,i!==null){if(_=e.getRenderTarget(),i.addEventListener("select",X),i.addEventListener("selectstart",X),i.addEventListener("selectend",X),i.addEventListener("squeeze",X),i.addEventListener("squeezestart",X),i.addEventListener("squeezeend",X),i.addEventListener("end",se),i.addEventListener("inputsourceschange",W),x.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(M),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const ie={antialias:i.renderState.layers===void 0?x.antialias:!0,alpha:!0,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:s};m=new XRWebGLLayer(i,t,ie),i.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),g=new ts(m.framebufferWidth,m.framebufferHeight,{format:Mr,type:Es,colorSpace:e.outputColorSpace,stencilBuffer:x.stencil})}else{let ie=null,me=null,Ee=null;x.depth&&(Ee=x.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ie=x.stencil?bl:oa,me=x.stencil?sa:Js);const ge={colorFormat:t.RGBA8,depthFormat:Ee,scaleFactor:s};f=new XRWebGLBinding(i,t),p=f.createProjectionLayer(ge),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),g=new ts(p.textureWidth,p.textureHeight,{format:Mr,type:Es,depthTexture:new l1(p.textureWidth,p.textureHeight,me,void 0,void 0,void 0,void 0,void 0,void 0,ie),stencilBuffer:x.stencil,colorSpace:e.outputColorSpace,samples:x.antialias?4:0});const tt=e.properties.get(g);tt.__ignoreDepthValues=p.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(l),h=null,o=await i.requestReferenceSpace(a),ee.setContext(i),ee.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function W(K){for(let ie=0;ie<K.removed.length;ie++){const me=K.removed[ie],Ee=b.indexOf(me);Ee>=0&&(b[Ee]=null,S[Ee].disconnect(me))}for(let ie=0;ie<K.added.length;ie++){const me=K.added[ie];let Ee=b.indexOf(me);if(Ee===-1){for(let tt=0;tt<S.length;tt++)if(tt>=b.length){b.push(me),Ee=tt;break}else if(b[tt]===null){b[tt]=me,Ee=tt;break}if(Ee===-1)break}const ge=S[Ee];ge&&ge.connect(me)}}const $=new z,Z=new z;function re(K,ie,me){$.setFromMatrixPosition(ie.matrixWorld),Z.setFromMatrixPosition(me.matrixWorld);const Ee=$.distanceTo(Z),ge=ie.projectionMatrix.elements,tt=me.projectionMatrix.elements,nt=ge[14]/(ge[10]-1),Be=ge[14]/(ge[10]+1),Xe=(ge[9]+1)/ge[5],j=(ge[9]-1)/ge[5],Se=(ge[8]-1)/ge[0],fe=(tt[8]+1)/tt[0],Te=nt*Se,de=nt*fe,$e=Ee/(-Se+fe),Ne=$e*-Se;ie.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(Ne),K.translateZ($e),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert();const k=nt+$e,N=Be+$e,te=Te-Ne,be=de+(Ee-Ne),ve=Xe*Be/N*k,_e=j*Be/N*k;K.projectionMatrix.makePerspective(te,be,ve,_e,k,N),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}function F(K,ie){ie===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(ie.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(i===null)return;P.near=R.near=A.near=K.near,P.far=R.far=A.far=K.far,(I!==P.near||H!==P.far)&&(i.updateRenderState({depthNear:P.near,depthFar:P.far}),I=P.near,H=P.far);const ie=K.parent,me=P.cameras;F(P,ie);for(let Ee=0;Ee<me.length;Ee++)F(me[Ee],ie);me.length===2?re(P,A,R):P.projectionMatrix.copy(A.projectionMatrix),U(K,P,ie)};function U(K,ie,me){me===null?K.matrix.copy(ie.matrixWorld):(K.matrix.copy(me.matrixWorld),K.matrix.invert(),K.matrix.multiply(ie.matrixWorld)),K.matrix.decompose(K.position,K.quaternion,K.scale),K.updateMatrixWorld(!0),K.projectionMatrix.copy(ie.projectionMatrix),K.projectionMatrixInverse.copy(ie.projectionMatrixInverse),K.isPerspectiveCamera&&(K.fov=_u*2*Math.atan(1/K.projectionMatrix.elements[5]),K.zoom=1)}this.getCamera=function(){return P},this.getFoveation=function(){if(!(p===null&&m===null))return l},this.setFoveation=function(K){l=K,p!==null&&(p.fixedFoveation=K),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=K)};let G=null;function Y(K,ie){if(d=ie.getViewerPose(h||o),v=ie,d!==null){const me=d.views;m!==null&&(e.setRenderTargetFramebuffer(g,m.framebuffer),e.setRenderTarget(g));let Ee=!1;me.length!==P.cameras.length&&(P.cameras.length=0,Ee=!0);for(let ge=0;ge<me.length;ge++){const tt=me[ge];let nt=null;if(m!==null)nt=m.getViewport(tt);else{const Xe=f.getViewSubImage(p,tt);nt=Xe.viewport,ge===0&&(e.setRenderTargetTextures(g,Xe.colorTexture,p.ignoreDepthValues?void 0:Xe.depthStencilTexture),e.setRenderTarget(g))}let Be=O[ge];Be===void 0&&(Be=new Yn,Be.layers.enable(ge),Be.viewport=new Vt,O[ge]=Be),Be.matrix.fromArray(tt.transform.matrix),Be.matrix.decompose(Be.position,Be.quaternion,Be.scale),Be.projectionMatrix.fromArray(tt.projectionMatrix),Be.projectionMatrixInverse.copy(Be.projectionMatrix).invert(),Be.viewport.set(nt.x,nt.y,nt.width,nt.height),ge===0&&(P.matrix.copy(Be.matrix),P.matrix.decompose(P.position,P.quaternion,P.scale)),Ee===!0&&P.cameras.push(Be)}}for(let me=0;me<S.length;me++){const Ee=b[me],ge=S[me];Ee!==null&&ge!==void 0&&ge.update(Ee,ie,h||o)}G&&G(K,ie),ie.detectedPlanes&&r.dispatchEvent({type:"planesdetected",data:ie}),v=null}const ee=new II;ee.setAnimationLoop(Y),this.setAnimationLoop=function(K){G=K},this.dispose=function(){}}}function Nq(n,e){function t(_,g){_.matrixAutoUpdate===!0&&_.updateMatrix(),g.value.copy(_.matrix)}function r(_,g){g.color.getRGB(_.fogColor.value,AI(n)),g.isFog?(_.fogNear.value=g.near,_.fogFar.value=g.far):g.isFogExp2&&(_.fogDensity.value=g.density)}function i(_,g,S,b,M){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(_,g):g.isMeshToonMaterial?(s(_,g),f(_,g)):g.isMeshPhongMaterial?(s(_,g),d(_,g)):g.isMeshStandardMaterial?(s(_,g),p(_,g),g.isMeshPhysicalMaterial&&m(_,g,M)):g.isMeshMatcapMaterial?(s(_,g),v(_,g)):g.isMeshDepthMaterial?s(_,g):g.isMeshDistanceMaterial?(s(_,g),x(_,g)):g.isMeshNormalMaterial?s(_,g):g.isLineBasicMaterial?(o(_,g),g.isLineDashedMaterial&&a(_,g)):g.isPointsMaterial?l(_,g,S,b):g.isSpriteMaterial?h(_,g):g.isShadowMaterial?(_.color.value.copy(g.color),_.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(_,g){_.opacity.value=g.opacity,g.color&&_.diffuse.value.copy(g.color),g.emissive&&_.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(_.map.value=g.map,t(g.map,_.mapTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,t(g.alphaMap,_.alphaMapTransform)),g.bumpMap&&(_.bumpMap.value=g.bumpMap,t(g.bumpMap,_.bumpMapTransform),_.bumpScale.value=g.bumpScale,g.side===Ar&&(_.bumpScale.value*=-1)),g.normalMap&&(_.normalMap.value=g.normalMap,t(g.normalMap,_.normalMapTransform),_.normalScale.value.copy(g.normalScale),g.side===Ar&&_.normalScale.value.negate()),g.displacementMap&&(_.displacementMap.value=g.displacementMap,t(g.displacementMap,_.displacementMapTransform),_.displacementScale.value=g.displacementScale,_.displacementBias.value=g.displacementBias),g.emissiveMap&&(_.emissiveMap.value=g.emissiveMap,t(g.emissiveMap,_.emissiveMapTransform)),g.specularMap&&(_.specularMap.value=g.specularMap,t(g.specularMap,_.specularMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest);const S=e.get(g).envMap;if(S&&(_.envMap.value=S,_.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=g.reflectivity,_.ior.value=g.ior,_.refractionRatio.value=g.refractionRatio),g.lightMap){_.lightMap.value=g.lightMap;const b=n._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=g.lightMapIntensity*b,t(g.lightMap,_.lightMapTransform)}g.aoMap&&(_.aoMap.value=g.aoMap,_.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,_.aoMapTransform))}function o(_,g){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,g.map&&(_.map.value=g.map,t(g.map,_.mapTransform))}function a(_,g){_.dashSize.value=g.dashSize,_.totalSize.value=g.dashSize+g.gapSize,_.scale.value=g.scale}function l(_,g,S,b){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,_.size.value=g.size*S,_.scale.value=b*.5,g.map&&(_.map.value=g.map,t(g.map,_.uvTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,t(g.alphaMap,_.alphaMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest)}function h(_,g){_.diffuse.value.copy(g.color),_.opacity.value=g.opacity,_.rotation.value=g.rotation,g.map&&(_.map.value=g.map,t(g.map,_.mapTransform)),g.alphaMap&&(_.alphaMap.value=g.alphaMap,t(g.alphaMap,_.alphaMapTransform)),g.alphaTest>0&&(_.alphaTest.value=g.alphaTest)}function d(_,g){_.specular.value.copy(g.specular),_.shininess.value=Math.max(g.shininess,1e-4)}function f(_,g){g.gradientMap&&(_.gradientMap.value=g.gradientMap)}function p(_,g){_.metalness.value=g.metalness,g.metalnessMap&&(_.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,_.metalnessMapTransform)),_.roughness.value=g.roughness,g.roughnessMap&&(_.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,_.roughnessMapTransform)),e.get(g).envMap&&(_.envMapIntensity.value=g.envMapIntensity)}function m(_,g,S){_.ior.value=g.ior,g.sheen>0&&(_.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),_.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(_.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,_.sheenColorMapTransform)),g.sheenRoughnessMap&&(_.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,_.sheenRoughnessMapTransform))),g.clearcoat>0&&(_.clearcoat.value=g.clearcoat,_.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(_.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,_.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(_.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Ar&&_.clearcoatNormalScale.value.negate())),g.iridescence>0&&(_.iridescence.value=g.iridescence,_.iridescenceIOR.value=g.iridescenceIOR,_.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(_.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,_.iridescenceMapTransform)),g.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),g.transmission>0&&(_.transmission.value=g.transmission,_.transmissionSamplerMap.value=S.texture,_.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(_.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,_.transmissionMapTransform)),_.thickness.value=g.thickness,g.thicknessMap&&(_.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=g.attenuationDistance,_.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(_.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(_.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=g.specularIntensity,_.specularColor.value.copy(g.specularColor),g.specularColorMap&&(_.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,_.specularColorMapTransform)),g.specularIntensityMap&&(_.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,_.specularIntensityMapTransform))}function v(_,g){g.matcap&&(_.matcap.value=g.matcap)}function x(_,g){const S=e.get(g).light;_.referencePosition.value.setFromMatrixPosition(S.matrixWorld),_.nearDistance.value=S.shadow.camera.near,_.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function Dq(n,e,t,r){let i={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,b){const M=b.program;r.uniformBlockBinding(S,M)}function h(S,b){let M=i[S.id];M===void 0&&(v(S),M=d(S),i[S.id]=M,S.addEventListener("dispose",_));const C=b.program;r.updateUBOMapping(S,C);const A=e.render.frame;s[S.id]!==A&&(p(S),s[S.id]=A)}function d(S){const b=f();S.__bindingPointIndex=b;const M=n.createBuffer(),C=S.__size,A=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,M),n.bufferData(n.UNIFORM_BUFFER,C,A),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,b,M),M}function f(){for(let S=0;S<a;S++)if(o.indexOf(S)===-1)return o.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(S){const b=i[S.id],M=S.uniforms,C=S.__cache;n.bindBuffer(n.UNIFORM_BUFFER,b);for(let A=0,R=M.length;A<R;A++){const O=Array.isArray(M[A])?M[A]:[M[A]];for(let P=0,I=O.length;P<I;P++){const H=O[P];if(m(H,A,P,C)===!0){const X=H.__offset,se=Array.isArray(H.value)?H.value:[H.value];let W=0;for(let $=0;$<se.length;$++){const Z=se[$],re=x(Z);typeof Z=="number"||typeof Z=="boolean"?(H.__data[0]=Z,n.bufferSubData(n.UNIFORM_BUFFER,X+W,H.__data)):Z.isMatrix3?(H.__data[0]=Z.elements[0],H.__data[1]=Z.elements[1],H.__data[2]=Z.elements[2],H.__data[3]=0,H.__data[4]=Z.elements[3],H.__data[5]=Z.elements[4],H.__data[6]=Z.elements[5],H.__data[7]=0,H.__data[8]=Z.elements[6],H.__data[9]=Z.elements[7],H.__data[10]=Z.elements[8],H.__data[11]=0):(Z.toArray(H.__data,W),W+=re.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,X,H.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function m(S,b,M,C){const A=S.value,R=b+"_"+M;if(C[R]===void 0)return typeof A=="number"||typeof A=="boolean"?C[R]=A:C[R]=A.clone(),!0;{const O=C[R];if(typeof A=="number"||typeof A=="boolean"){if(O!==A)return C[R]=A,!0}else if(O.equals(A)===!1)return O.copy(A),!0}return!1}function v(S){const b=S.uniforms;let M=0;const C=16;for(let R=0,O=b.length;R<O;R++){const P=Array.isArray(b[R])?b[R]:[b[R]];for(let I=0,H=P.length;I<H;I++){const X=P[I],se=Array.isArray(X.value)?X.value:[X.value];for(let W=0,$=se.length;W<$;W++){const Z=se[W],re=x(Z),F=M%C;F!==0&&C-F<re.boundary&&(M+=C-F),X.__data=new Float32Array(re.storage/Float32Array.BYTES_PER_ELEMENT),X.__offset=M,M+=re.storage}}}const A=M%C;return A>0&&(M+=C-A),S.__size=M,S.__cache={},this}function x(S){const b={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(b.boundary=4,b.storage=4):S.isVector2?(b.boundary=8,b.storage=8):S.isVector3||S.isColor?(b.boundary=16,b.storage=12):S.isVector4?(b.boundary=16,b.storage=16):S.isMatrix3?(b.boundary=48,b.storage=48):S.isMatrix4?(b.boundary=64,b.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),b}function _(S){const b=S.target;b.removeEventListener("dispose",_);const M=o.indexOf(b.__bindingPointIndex);o.splice(M,1),n.deleteBuffer(i[b.id]),delete i[b.id],delete s[b.id]}function g(){for(const S in i)n.deleteBuffer(i[S]);o=[],i={},s={}}return{bind:l,update:h,dispose:g}}class h1{constructor(e={}){const{canvas:t=TI(),context:r=null,depth:i=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:h=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:f=!1}=e;this.isWebGLRenderer=!0;let p;r!==null?p=r.getContextAttributes().alpha:p=o;const m=new Uint32Array(4),v=new Int32Array(4);let x=null,_=null;const g=[],S=[];this.domElement=t,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._outputColorSpace=Nn,this._useLegacyLights=!1,this.toneMapping=Ms,this.toneMappingExposure=1;const b=this;let M=!1,C=0,A=0,R=null,O=-1,P=null;const I=new Vt,H=new Vt;let X=null;const se=new We(0);let W=0,$=t.width,Z=t.height,re=1,F=null,U=null;const G=new Vt(0,0,$,Z),Y=new Vt(0,0,$,Z);let ee=!1;const K=new sf;let ie=!1,me=!1,Ee=null;const ge=new ft,tt=new ye,nt=new z,Be={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Xe(){return R===null?re:1}let j=r;function Se(B,ne){for(let le=0;le<B.length;le++){const ce=B[le],ae=t.getContext(ce,ne);if(ae!==null)return ae}return null}try{const B={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:h,powerPreference:d,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${cg}`),t.addEventListener("webglcontextlost",Re,!1),t.addEventListener("webglcontextrestored",q,!1),t.addEventListener("webglcontextcreationerror",Fe,!1),j===null){const ne=["webgl2","webgl","experimental-webgl"];if(b.isWebGL1Renderer===!0&&ne.shift(),j=Se(ne,B),j===null)throw Se(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&j instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),j.getShaderPrecisionFormat===void 0&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(B){throw console.error("THREE.WebGLRenderer: "+B.message),B}let fe,Te,de,$e,Ne,k,N,te,be,ve,_e,Ye,Ce,Ue,it,mt,xe,Lt,bt,lt,Ke,He,ct,Ft;function qt(){fe=new $X(j),Te=new GX(j,fe,e),fe.init(Te),He=new UI(j,fe,Te),de=new Rq(j,fe,Te),$e=new QX(j),Ne=new vq,k=new Iq(j,fe,de,Ne,Te,He,$e),N=new jX(b),te=new qX(b),be=new o7(j,Te),ct=new WX(j,fe,be,Te),ve=new KX(j,be,$e,ct),_e=new nY(j,ve,be,$e),bt=new tY(j,Te,k),mt=new VX(Ne),Ye=new yq(b,N,te,fe,Te,ct,mt),Ce=new Nq(b,Ne),Ue=new xq,it=new Eq(fe,Te),Lt=new zX(b,N,te,de,_e,p,l),xe=new Pq(b,_e,Te),Ft=new Dq(j,$e,Te,de),lt=new HX(j,fe,$e,Te),Ke=new ZX(j,fe,$e,Te),$e.programs=Ye.programs,b.capabilities=Te,b.extensions=fe,b.properties=Ne,b.renderLists=Ue,b.shadowMap=xe,b.state=de,b.info=$e}qt();const vt=new Fq(b,j);this.xr=vt,this.getContext=function(){return j},this.getContextAttributes=function(){return j.getContextAttributes()},this.forceContextLoss=function(){const B=fe.get("WEBGL_lose_context");B&&B.loseContext()},this.forceContextRestore=function(){const B=fe.get("WEBGL_lose_context");B&&B.restoreContext()},this.getPixelRatio=function(){return re},this.setPixelRatio=function(B){B!==void 0&&(re=B,this.setSize($,Z,!1))},this.getSize=function(B){return B.set($,Z)},this.setSize=function(B,ne,le=!0){if(vt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=B,Z=ne,t.width=Math.floor(B*re),t.height=Math.floor(ne*re),le===!0&&(t.style.width=B+"px",t.style.height=ne+"px"),this.setViewport(0,0,B,ne)},this.getDrawingBufferSize=function(B){return B.set($*re,Z*re).floor()},this.setDrawingBufferSize=function(B,ne,le){$=B,Z=ne,re=le,t.width=Math.floor(B*le),t.height=Math.floor(ne*le),this.setViewport(0,0,B,ne)},this.getCurrentViewport=function(B){return B.copy(I)},this.getViewport=function(B){return B.copy(G)},this.setViewport=function(B,ne,le,ce){B.isVector4?G.set(B.x,B.y,B.z,B.w):G.set(B,ne,le,ce),de.viewport(I.copy(G).multiplyScalar(re).floor())},this.getScissor=function(B){return B.copy(Y)},this.setScissor=function(B,ne,le,ce){B.isVector4?Y.set(B.x,B.y,B.z,B.w):Y.set(B,ne,le,ce),de.scissor(H.copy(Y).multiplyScalar(re).floor())},this.getScissorTest=function(){return ee},this.setScissorTest=function(B){de.setScissorTest(ee=B)},this.setOpaqueSort=function(B){F=B},this.setTransparentSort=function(B){U=B},this.getClearColor=function(B){return B.copy(Lt.getClearColor())},this.setClearColor=function(){Lt.setClearColor.apply(Lt,arguments)},this.getClearAlpha=function(){return Lt.getClearAlpha()},this.setClearAlpha=function(){Lt.setClearAlpha.apply(Lt,arguments)},this.clear=function(B=!0,ne=!0,le=!0){let ce=0;if(B){let ae=!1;if(R!==null){const ze=R.texture.format;ae=ze===ZS||ze===KS||ze===$S}if(ae){const ze=R.texture.type,Je=ze===Es||ze===Js||ze===dg||ze===sa||ze===YS||ze===qS,at=Lt.getClearColor(),ut=Lt.getClearAlpha(),gt=at.r,pt=at.g,yt=at.b;Je?(m[0]=gt,m[1]=pt,m[2]=yt,m[3]=ut,j.clearBufferuiv(j.COLOR,0,m)):(v[0]=gt,v[1]=pt,v[2]=yt,v[3]=ut,j.clearBufferiv(j.COLOR,0,v))}else ce|=j.COLOR_BUFFER_BIT}ne&&(ce|=j.DEPTH_BUFFER_BIT),le&&(ce|=j.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),j.clear(ce)},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(){t.removeEventListener("webglcontextlost",Re,!1),t.removeEventListener("webglcontextrestored",q,!1),t.removeEventListener("webglcontextcreationerror",Fe,!1),Ue.dispose(),it.dispose(),Ne.dispose(),N.dispose(),te.dispose(),_e.dispose(),ct.dispose(),Ft.dispose(),Ye.dispose(),vt.dispose(),vt.removeEventListener("sessionstart",Ht),vt.removeEventListener("sessionend",Rt),Ee&&(Ee.dispose(),Ee=null),Zt.stop()};function Re(B){B.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function q(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const B=$e.autoReset,ne=xe.enabled,le=xe.autoUpdate,ce=xe.needsUpdate,ae=xe.type;qt(),$e.autoReset=B,xe.enabled=ne,xe.autoUpdate=le,xe.needsUpdate=ce,xe.type=ae}function Fe(B){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",B.statusMessage)}function Ie(B){const ne=B.target;ne.removeEventListener("dispose",Ie),ot(ne)}function ot(B){we(B),Ne.remove(B)}function we(B){const ne=Ne.get(B).programs;ne!==void 0&&(ne.forEach(function(le){Ye.releaseProgram(le)}),B.isShaderMaterial&&Ye.releaseShaderCache(B))}this.renderBufferDirect=function(B,ne,le,ce,ae,ze){ne===null&&(ne=Be);const Je=ae.isMesh&&ae.matrixWorld.determinant()<0,at=Ug(B,ne,le,ce,ae);de.setMaterial(ce,Je);let ut=le.index,gt=1;if(ce.wireframe===!0){if(ut=ve.getWireframeAttribute(le),ut===void 0)return;gt=2}const pt=le.drawRange,yt=le.attributes.position;let an=pt.start*gt,$n=(pt.start+pt.count)*gt;ze!==null&&(an=Math.max(an,ze.start*gt),$n=Math.min($n,(ze.start+ze.count)*gt)),ut!==null?(an=Math.max(an,0),$n=Math.min($n,ut.count)):yt!=null&&(an=Math.max(an,0),$n=Math.min($n,yt.count));const Qt=$n-an;if(Qt<0||Qt===1/0)return;ct.setup(ae,ce,at,le,ut);let zn,ht=lt;if(ut!==null&&(zn=be.get(ut),ht=Ke,ht.setIndex(zn)),ae.isMesh)ce.wireframe===!0?(de.setLineWidth(ce.wireframeLinewidth*Xe()),ht.setMode(j.LINES)):ht.setMode(j.TRIANGLES);else if(ae.isLine){let Ve=ce.linewidth;Ve===void 0&&(Ve=1),de.setLineWidth(Ve*Xe()),ae.isLineSegments?ht.setMode(j.LINES):ae.isLineLoop?ht.setMode(j.LINE_LOOP):ht.setMode(j.LINE_STRIP)}else ae.isPoints?ht.setMode(j.POINTS):ae.isSprite&&ht.setMode(j.TRIANGLES);if(ae.isBatchedMesh)ht.renderMultiDraw(ae._multiDrawStarts,ae._multiDrawCounts,ae._multiDrawCount);else if(ae.isInstancedMesh)ht.renderInstances(an,Qt,ae.count);else if(le.isInstancedBufferGeometry){const Ve=le._maxInstanceCount!==void 0?le._maxInstanceCount:1/0,ui=Math.min(le.instanceCount,Ve);ht.renderInstances(an,Qt,ui)}else ht.render(an,Qt)};function Qe(B,ne,le){B.transparent===!0&&B.side===xs&&B.forceSinglePass===!1?(B.side=Ar,B.needsUpdate=!0,Dl(B,ne,le),B.side=uo,B.needsUpdate=!0,Dl(B,ne,le),B.side=xs):Dl(B,ne,le)}this.compile=function(B,ne,le=null){le===null&&(le=B),_=it.get(le),_.init(),S.push(_),le.traverseVisible(function(ae){ae.isLight&&ae.layers.test(ne.layers)&&(_.pushLight(ae),ae.castShadow&&_.pushShadow(ae))}),B!==le&&B.traverseVisible(function(ae){ae.isLight&&ae.layers.test(ne.layers)&&(_.pushLight(ae),ae.castShadow&&_.pushShadow(ae))}),_.setupLights(b._useLegacyLights);const ce=new Set;return B.traverse(function(ae){const ze=ae.material;if(ze)if(Array.isArray(ze))for(let Je=0;Je<ze.length;Je++){const at=ze[Je];Qe(at,le,ae),ce.add(at)}else Qe(ze,le,ae),ce.add(ze)}),S.pop(),_=null,ce},this.compileAsync=function(B,ne,le=null){const ce=this.compile(B,ne,le);return new Promise(ae=>{function ze(){if(ce.forEach(function(Je){Ne.get(Je).currentProgram.isReady()&&ce.delete(Je)}),ce.size===0){ae(B);return}setTimeout(ze,10)}fe.get("KHR_parallel_shader_compile")!==null?ze():setTimeout(ze,10)})};let rt=null;function Nt(B){rt&&rt(B)}function Ht(){Zt.stop()}function Rt(){Zt.start()}const Zt=new II;Zt.setAnimationLoop(Nt),typeof self<"u"&&Zt.setContext(self),this.setAnimationLoop=function(B){rt=B,vt.setAnimationLoop(B),B===null?Zt.stop():Zt.start()},vt.addEventListener("sessionstart",Ht),vt.addEventListener("sessionend",Rt),this.render=function(B,ne){if(ne!==void 0&&ne.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),vt.enabled===!0&&vt.isPresenting===!0&&(vt.cameraAutoUpdate===!0&&vt.updateCamera(ne),ne=vt.getCamera()),B.isScene===!0&&B.onBeforeRender(b,B,ne,R),_=it.get(B,S.length),_.init(),S.push(_),ge.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),K.setFromProjectionMatrix(ge),me=this.localClippingEnabled,ie=mt.init(this.clippingPlanes,me),x=Ue.get(B,g.length),x.init(),g.push(x),rn(B,ne,0,b.sortObjects),x.finish(),b.sortObjects===!0&&x.sort(F,U),this.info.render.frame++,ie===!0&&mt.beginShadows();const le=_.state.shadowsArray;if(xe.render(le,B,ne),ie===!0&&mt.endShadows(),this.info.autoReset===!0&&this.info.reset(),Lt.render(x,B),_.setupLights(b._useLegacyLights),ne.isArrayCamera){const ce=ne.cameras;for(let ae=0,ze=ce.length;ae<ze;ae++){const Je=ce[ae];Ir(x,B,Je,Je.viewport)}}else Ir(x,B,ne);R!==null&&(k.updateMultisampleRenderTarget(R),k.updateRenderTargetMipmap(R)),B.isScene===!0&&B.onAfterRender(b,B,ne),ct.resetDefaultState(),O=-1,P=null,S.pop(),S.length>0?_=S[S.length-1]:_=null,g.pop(),g.length>0?x=g[g.length-1]:x=null};function rn(B,ne,le,ce){if(B.visible===!1)return;if(B.layers.test(ne.layers)){if(B.isGroup)le=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(ne);else if(B.isLight)_.pushLight(B),B.castShadow&&_.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||K.intersectsSprite(B)){ce&&nt.setFromMatrixPosition(B.matrixWorld).applyMatrix4(ge);const Je=_e.update(B),at=B.material;at.visible&&x.push(B,Je,at,le,nt.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(!B.frustumCulled||K.intersectsObject(B))){const Je=_e.update(B),at=B.material;if(ce&&(B.boundingSphere!==void 0?(B.boundingSphere===null&&B.computeBoundingSphere(),nt.copy(B.boundingSphere.center)):(Je.boundingSphere===null&&Je.computeBoundingSphere(),nt.copy(Je.boundingSphere.center)),nt.applyMatrix4(B.matrixWorld).applyMatrix4(ge)),Array.isArray(at)){const ut=Je.groups;for(let gt=0,pt=ut.length;gt<pt;gt++){const yt=ut[gt],an=at[yt.materialIndex];an&&an.visible&&x.push(B,Je,an,le,nt.z,yt)}}else at.visible&&x.push(B,Je,at,le,nt.z,null)}}const ze=B.children;for(let Je=0,at=ze.length;Je<at;Je++)rn(ze[Je],ne,le,ce)}function Ir(B,ne,le,ce){const ae=B.opaque,ze=B.transmissive,Je=B.transparent;_.setupLightsView(le),ie===!0&&mt.setGlobalState(b.clippingPlanes,le),ze.length>0&&ku(ae,ze,ne,le),ce&&de.viewport(I.copy(ce)),ae.length>0&&Nl(ae,ne,le),ze.length>0&&Nl(ze,ne,le),Je.length>0&&Nl(Je,ne,le),de.buffers.depth.setTest(!0),de.buffers.depth.setMask(!0),de.buffers.color.setMask(!0),de.setPolygonOffset(!1)}function ku(B,ne,le,ce){if((le.isScene===!0?le.overrideMaterial:null)!==null)return;const ze=Te.isWebGL2;Ee===null&&(Ee=new ts(1,1,{generateMipmaps:!0,type:fe.has("EXT_color_buffer_half_float")?yu:Es,minFilter:ga,samples:ze?4:0})),b.getDrawingBufferSize(tt),ze?Ee.setSize(tt.x,tt.y):Ee.setSize(L0(tt.x),L0(tt.y));const Je=b.getRenderTarget();b.setRenderTarget(Ee),b.getClearColor(se),W=b.getClearAlpha(),W<1&&b.setClearColor(16777215,.5),b.clear();const at=b.toneMapping;b.toneMapping=Ms,Nl(B,le,ce),k.updateMultisampleRenderTarget(Ee),k.updateRenderTargetMipmap(Ee);let ut=!1;for(let gt=0,pt=ne.length;gt<pt;gt++){const yt=ne[gt],an=yt.object,$n=yt.geometry,Qt=yt.material,zn=yt.group;if(Qt.side===xs&&an.layers.test(ce.layers)){const ht=Qt.side;Qt.side=Ar,Qt.needsUpdate=!0,go(an,le,ce,$n,Qt,zn),Qt.side=ht,Qt.needsUpdate=!0,ut=!0}}ut===!0&&(k.updateMultisampleRenderTarget(Ee),k.updateRenderTargetMipmap(Ee)),b.setRenderTarget(Je),b.setClearColor(se,W),b.toneMapping=at}function Nl(B,ne,le){const ce=ne.isScene===!0?ne.overrideMaterial:null;for(let ae=0,ze=B.length;ae<ze;ae++){const Je=B[ae],at=Je.object,ut=Je.geometry,gt=ce===null?Je.material:ce,pt=Je.group;at.layers.test(le.layers)&&go(at,ne,le,ut,gt,pt)}}function go(B,ne,le,ce,ae,ze){B.onBeforeRender(b,ne,le,ce,ae,ze),B.modelViewMatrix.multiplyMatrices(le.matrixWorldInverse,B.matrixWorld),B.normalMatrix.getNormalMatrix(B.modelViewMatrix),ae.onBeforeRender(b,ne,le,ce,B,ze),ae.transparent===!0&&ae.side===xs&&ae.forceSinglePass===!1?(ae.side=Ar,ae.needsUpdate=!0,b.renderBufferDirect(le,ne,ce,ae,B,ze),ae.side=uo,ae.needsUpdate=!0,b.renderBufferDirect(le,ne,ce,ae,B,ze),ae.side=xs):b.renderBufferDirect(le,ne,ce,ae,B,ze),B.onAfterRender(b,ne,le,ce,ae,ze)}function Dl(B,ne,le){ne.isScene!==!0&&(ne=Be);const ce=Ne.get(B),ae=_.state.lights,ze=_.state.shadowsArray,Je=ae.state.version,at=Ye.getParameters(B,ae.state,ze,ne,le),ut=Ye.getProgramCacheKey(at);let gt=ce.programs;ce.environment=B.isMeshStandardMaterial?ne.environment:null,ce.fog=ne.fog,ce.envMap=(B.isMeshStandardMaterial?te:N).get(B.envMap||ce.environment),gt===void 0&&(B.addEventListener("dispose",Ie),gt=new Map,ce.programs=gt);let pt=gt.get(ut);if(pt!==void 0){if(ce.currentProgram===pt&&ce.lightsStateVersion===Je)return pf(B,at),pt}else at.uniforms=Ye.getUniforms(B),B.onBuild(le,at,b),B.onBeforeCompile(at,b),pt=Ye.acquireProgram(at,ut),gt.set(ut,pt),ce.uniforms=at.uniforms;const yt=ce.uniforms;return(!B.isShaderMaterial&&!B.isRawShaderMaterial||B.clipping===!0)&&(yt.clippingPlanes=mt.uniform),pf(B,at),ce.needsLights=Bg(B),ce.lightsStateVersion=Je,ce.needsLights&&(yt.ambientLightColor.value=ae.state.ambient,yt.lightProbe.value=ae.state.probe,yt.directionalLights.value=ae.state.directional,yt.directionalLightShadows.value=ae.state.directionalShadow,yt.spotLights.value=ae.state.spot,yt.spotLightShadows.value=ae.state.spotShadow,yt.rectAreaLights.value=ae.state.rectArea,yt.ltc_1.value=ae.state.rectAreaLTC1,yt.ltc_2.value=ae.state.rectAreaLTC2,yt.pointLights.value=ae.state.point,yt.pointLightShadows.value=ae.state.pointShadow,yt.hemisphereLights.value=ae.state.hemi,yt.directionalShadowMap.value=ae.state.directionalShadowMap,yt.directionalShadowMatrix.value=ae.state.directionalShadowMatrix,yt.spotShadowMap.value=ae.state.spotShadowMap,yt.spotLightMatrix.value=ae.state.spotLightMatrix,yt.spotLightMap.value=ae.state.spotLightMap,yt.pointShadowMap.value=ae.state.pointShadowMap,yt.pointShadowMatrix.value=ae.state.pointShadowMatrix),ce.currentProgram=pt,ce.uniformsList=null,pt}function ff(B){if(B.uniformsList===null){const ne=B.currentProgram.getUniforms();B.uniformsList=$m.seqWithValue(ne.seq,B.uniforms)}return B.uniformsList}function pf(B,ne){const le=Ne.get(B);le.outputColorSpace=ne.outputColorSpace,le.batching=ne.batching,le.instancing=ne.instancing,le.instancingColor=ne.instancingColor,le.skinning=ne.skinning,le.morphTargets=ne.morphTargets,le.morphNormals=ne.morphNormals,le.morphColors=ne.morphColors,le.morphTargetsCount=ne.morphTargetsCount,le.numClippingPlanes=ne.numClippingPlanes,le.numIntersection=ne.numClipIntersection,le.vertexAlphas=ne.vertexAlphas,le.vertexTangents=ne.vertexTangents,le.toneMapping=ne.toneMapping}function Ug(B,ne,le,ce,ae){ne.isScene!==!0&&(ne=Be),k.resetTextureUnits();const ze=ne.fog,Je=ce.isMeshStandardMaterial?ne.environment:null,at=R===null?b.outputColorSpace:R.isXRRenderTarget===!0?R.texture.colorSpace:Ps,ut=(ce.isMeshStandardMaterial?te:N).get(ce.envMap||Je),gt=ce.vertexColors===!0&&!!le.attributes.color&&le.attributes.color.itemSize===4,pt=!!le.attributes.tangent&&(!!ce.normalMap||ce.anisotropy>0),yt=!!le.morphAttributes.position,an=!!le.morphAttributes.normal,$n=!!le.morphAttributes.color;let Qt=Ms;ce.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(Qt=b.toneMapping);const zn=le.morphAttributes.position||le.morphAttributes.normal||le.morphAttributes.color,ht=zn!==void 0?zn.length:0,Ve=Ne.get(ce),ui=_.state.lights;if(ie===!0&&(me===!0||B!==P)){const Kn=B===P&&ce.id===O;mt.setState(ce,B,Kn)}let Ct=!1;ce.version===Ve.__version?(Ve.needsLights&&Ve.lightsStateVersion!==ui.state.version||Ve.outputColorSpace!==at||ae.isBatchedMesh&&Ve.batching===!1||!ae.isBatchedMesh&&Ve.batching===!0||ae.isInstancedMesh&&Ve.instancing===!1||!ae.isInstancedMesh&&Ve.instancing===!0||ae.isSkinnedMesh&&Ve.skinning===!1||!ae.isSkinnedMesh&&Ve.skinning===!0||ae.isInstancedMesh&&Ve.instancingColor===!0&&ae.instanceColor===null||ae.isInstancedMesh&&Ve.instancingColor===!1&&ae.instanceColor!==null||Ve.envMap!==ut||ce.fog===!0&&Ve.fog!==ze||Ve.numClippingPlanes!==void 0&&(Ve.numClippingPlanes!==mt.numPlanes||Ve.numIntersection!==mt.numIntersection)||Ve.vertexAlphas!==gt||Ve.vertexTangents!==pt||Ve.morphTargets!==yt||Ve.morphNormals!==an||Ve.morphColors!==$n||Ve.toneMapping!==Qt||Te.isWebGL2===!0&&Ve.morphTargetsCount!==ht)&&(Ct=!0):(Ct=!0,Ve.__version=ce.version);let fn=Ve.currentProgram;Ct===!0&&(fn=Dl(ce,ne,ae));let ss=!1,hi=!1,Wn=!1;const _n=fn.getUniforms(),os=Ve.uniforms;if(de.useProgram(fn.program)&&(ss=!0,hi=!0,Wn=!0),ce.id!==O&&(O=ce.id,hi=!0),ss||P!==B){_n.setValue(j,"projectionMatrix",B.projectionMatrix),_n.setValue(j,"viewMatrix",B.matrixWorldInverse);const Kn=_n.map.cameraPosition;Kn!==void 0&&Kn.setValue(j,nt.setFromMatrixPosition(B.matrixWorld)),Te.logarithmicDepthBuffer&&_n.setValue(j,"logDepthBufFC",2/(Math.log(B.far+1)/Math.LN2)),(ce.isMeshPhongMaterial||ce.isMeshToonMaterial||ce.isMeshLambertMaterial||ce.isMeshBasicMaterial||ce.isMeshStandardMaterial||ce.isShaderMaterial)&&_n.setValue(j,"isOrthographic",B.isOrthographicCamera===!0),P!==B&&(P=B,hi=!0,Wn=!0)}if(ae.isSkinnedMesh){_n.setOptional(j,ae,"bindMatrix"),_n.setOptional(j,ae,"bindMatrixInverse");const Kn=ae.skeleton;Kn&&(Te.floatVertexTextures?(Kn.boneTexture===null&&Kn.computeBoneTexture(),_n.setValue(j,"boneTexture",Kn.boneTexture,k)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}ae.isBatchedMesh&&(_n.setOptional(j,ae,"batchingTexture"),_n.setValue(j,"batchingTexture",ae._matricesTexture,k));const Ol=le.morphAttributes;if((Ol.position!==void 0||Ol.normal!==void 0||Ol.color!==void 0&&Te.isWebGL2===!0)&&bt.update(ae,le,fn),(hi||Ve.receiveShadow!==ae.receiveShadow)&&(Ve.receiveShadow=ae.receiveShadow,_n.setValue(j,"receiveShadow",ae.receiveShadow)),ce.isMeshGouraudMaterial&&ce.envMap!==null&&(os.envMap.value=ut,os.flipEnvMap.value=ut.isCubeTexture&&ut.isRenderTargetTexture===!1?-1:1),hi&&(_n.setValue(j,"toneMappingExposure",b.toneMappingExposure),Ve.needsLights&&kg(os,Wn),ze&&ce.fog===!0&&Ce.refreshFogUniforms(os,ze),Ce.refreshMaterialUniforms(os,ce,re,Z,Ee),$m.upload(j,ff(Ve),os,k)),ce.isShaderMaterial&&ce.uniformsNeedUpdate===!0&&($m.upload(j,ff(Ve),os,k),ce.uniformsNeedUpdate=!1),ce.isSpriteMaterial&&_n.setValue(j,"center",ae.center),_n.setValue(j,"modelViewMatrix",ae.modelViewMatrix),_n.setValue(j,"normalMatrix",ae.normalMatrix),_n.setValue(j,"modelMatrix",ae.matrixWorld),ce.isShaderMaterial||ce.isRawShaderMaterial){const Kn=ce.uniformsGroups;for(let Ul=0,Yr=Kn.length;Ul<Yr;Ul++)if(Te.isWebGL2){const mf=Kn[Ul];Ft.update(mf,fn),Ft.bind(mf,fn)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return fn}function kg(B,ne){B.ambientLightColor.needsUpdate=ne,B.lightProbe.needsUpdate=ne,B.directionalLights.needsUpdate=ne,B.directionalLightShadows.needsUpdate=ne,B.pointLights.needsUpdate=ne,B.pointLightShadows.needsUpdate=ne,B.spotLights.needsUpdate=ne,B.spotLightShadows.needsUpdate=ne,B.rectAreaLights.needsUpdate=ne,B.hemisphereLights.needsUpdate=ne}function Bg(B){return B.isMeshLambertMaterial||B.isMeshToonMaterial||B.isMeshPhongMaterial||B.isMeshStandardMaterial||B.isShadowMaterial||B.isShaderMaterial&&B.lights===!0}this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return R},this.setRenderTargetTextures=function(B,ne,le){Ne.get(B.texture).__webglTexture=ne,Ne.get(B.depthTexture).__webglTexture=le;const ce=Ne.get(B);ce.__hasExternalTextures=!0,ce.__hasExternalTextures&&(ce.__autoAllocateDepthBuffer=le===void 0,ce.__autoAllocateDepthBuffer||fe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),ce.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(B,ne){const le=Ne.get(B);le.__webglFramebuffer=ne,le.__useDefaultFramebuffer=ne===void 0},this.setRenderTarget=function(B,ne=0,le=0){R=B,C=ne,A=le;let ce=!0,ae=null,ze=!1,Je=!1;if(B){const ut=Ne.get(B);ut.__useDefaultFramebuffer!==void 0?(de.bindFramebuffer(j.FRAMEBUFFER,null),ce=!1):ut.__webglFramebuffer===void 0?k.setupRenderTarget(B):ut.__hasExternalTextures&&k.rebindTextures(B,Ne.get(B.texture).__webglTexture,Ne.get(B.depthTexture).__webglTexture);const gt=B.texture;(gt.isData3DTexture||gt.isDataArrayTexture||gt.isCompressedArrayTexture)&&(Je=!0);const pt=Ne.get(B).__webglFramebuffer;B.isWebGLCubeRenderTarget?(Array.isArray(pt[ne])?ae=pt[ne][le]:ae=pt[ne],ze=!0):Te.isWebGL2&&B.samples>0&&k.useMultisampledRTT(B)===!1?ae=Ne.get(B).__webglMultisampledFramebuffer:Array.isArray(pt)?ae=pt[le]:ae=pt,I.copy(B.viewport),H.copy(B.scissor),X=B.scissorTest}else I.copy(G).multiplyScalar(re).floor(),H.copy(Y).multiplyScalar(re).floor(),X=ee;if(de.bindFramebuffer(j.FRAMEBUFFER,ae)&&Te.drawBuffers&&ce&&de.drawBuffers(B,ae),de.viewport(I),de.scissor(H),de.setScissorTest(X),ze){const ut=Ne.get(B.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+ne,ut.__webglTexture,le)}else if(Je){const ut=Ne.get(B.texture),gt=ne||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,ut.__webglTexture,le||0,gt)}O=-1},this.readRenderTargetPixels=function(B,ne,le,ce,ae,ze,Je){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let at=Ne.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&Je!==void 0&&(at=at[Je]),at){de.bindFramebuffer(j.FRAMEBUFFER,at);try{const ut=B.texture,gt=ut.format,pt=ut.type;if(gt!==Mr&&He.convert(gt)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const yt=pt===yu&&(fe.has("EXT_color_buffer_half_float")||Te.isWebGL2&&fe.has("EXT_color_buffer_float"));if(pt!==Es&&He.convert(pt)!==j.getParameter(j.IMPLEMENTATION_COLOR_READ_TYPE)&&!(pt===Xi&&(Te.isWebGL2||fe.has("OES_texture_float")||fe.has("WEBGL_color_buffer_float")))&&!yt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=B.width-ce&&le>=0&&le<=B.height-ae&&j.readPixels(ne,le,ce,ae,He.convert(gt),He.convert(pt),ze)}finally{const ut=R!==null?Ne.get(R).__webglFramebuffer:null;de.bindFramebuffer(j.FRAMEBUFFER,ut)}}},this.copyFramebufferToTexture=function(B,ne,le=0){const ce=Math.pow(2,-le),ae=Math.floor(ne.image.width*ce),ze=Math.floor(ne.image.height*ce);k.setTexture2D(ne,0),j.copyTexSubImage2D(j.TEXTURE_2D,le,0,0,B.x,B.y,ae,ze),de.unbindTexture()},this.copyTextureToTexture=function(B,ne,le,ce=0){const ae=ne.image.width,ze=ne.image.height,Je=He.convert(le.format),at=He.convert(le.type);k.setTexture2D(le,0),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,le.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,le.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,le.unpackAlignment),ne.isDataTexture?j.texSubImage2D(j.TEXTURE_2D,ce,B.x,B.y,ae,ze,Je,at,ne.image.data):ne.isCompressedTexture?j.compressedTexSubImage2D(j.TEXTURE_2D,ce,B.x,B.y,ne.mipmaps[0].width,ne.mipmaps[0].height,Je,ne.mipmaps[0].data):j.texSubImage2D(j.TEXTURE_2D,ce,B.x,B.y,Je,at,ne.image),ce===0&&le.generateMipmaps&&j.generateMipmap(j.TEXTURE_2D),de.unbindTexture()},this.copyTextureToTexture3D=function(B,ne,le,ce,ae=0){if(b.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ze=B.max.x-B.min.x+1,Je=B.max.y-B.min.y+1,at=B.max.z-B.min.z+1,ut=He.convert(ce.format),gt=He.convert(ce.type);let pt;if(ce.isData3DTexture)k.setTexture3D(ce,0),pt=j.TEXTURE_3D;else if(ce.isDataArrayTexture||ce.isCompressedArrayTexture)k.setTexture2DArray(ce,0),pt=j.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,ce.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ce.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,ce.unpackAlignment);const yt=j.getParameter(j.UNPACK_ROW_LENGTH),an=j.getParameter(j.UNPACK_IMAGE_HEIGHT),$n=j.getParameter(j.UNPACK_SKIP_PIXELS),Qt=j.getParameter(j.UNPACK_SKIP_ROWS),zn=j.getParameter(j.UNPACK_SKIP_IMAGES),ht=le.isCompressedTexture?le.mipmaps[ae]:le.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,ht.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,ht.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,B.min.x),j.pixelStorei(j.UNPACK_SKIP_ROWS,B.min.y),j.pixelStorei(j.UNPACK_SKIP_IMAGES,B.min.z),le.isDataTexture||le.isData3DTexture?j.texSubImage3D(pt,ae,ne.x,ne.y,ne.z,ze,Je,at,ut,gt,ht.data):le.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),j.compressedTexSubImage3D(pt,ae,ne.x,ne.y,ne.z,ze,Je,at,ut,ht.data)):j.texSubImage3D(pt,ae,ne.x,ne.y,ne.z,ze,Je,at,ut,gt,ht),j.pixelStorei(j.UNPACK_ROW_LENGTH,yt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,an),j.pixelStorei(j.UNPACK_SKIP_PIXELS,$n),j.pixelStorei(j.UNPACK_SKIP_ROWS,Qt),j.pixelStorei(j.UNPACK_SKIP_IMAGES,zn),ae===0&&ce.generateMipmaps&&j.generateMipmap(pt),de.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?k.setTextureCube(B,0):B.isData3DTexture?k.setTexture3D(B,0):B.isDataArrayTexture||B.isCompressedArrayTexture?k.setTexture2DArray(B,0):k.setTexture2D(B,0),de.unbindTexture()},this.resetState=function(){C=0,A=0,R=null,de.reset(),ct.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Yi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===pg?"display-p3":"srgb",t.unpackColorSpace=Gt.workingColorSpace===ef?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Nn?aa:e1}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===aa?Nn:Ps}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class BI extends h1{}BI.prototype.isWebGL1Renderer=!0;class yg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new We(e),this.density=t}clone(){return new yg(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class vg{constructor(e,t=1,r=1e3){this.isFog=!0,this.name="",this.color=new We(e),this.near=t,this.far=r}clone(){return new vg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class d1 extends Wt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class _g{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Id,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=oi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return console.warn("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}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,t,r){e*=this.stride,r*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[r+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=oi()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(t,this.stride);return r.setUsage(this.usage),r}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=oi()),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 xr=new z;class wl{constructor(e,t,r,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=r,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,r=this.data.count;t<r;t++)xr.fromBufferAttribute(this,t),xr.applyMatrix4(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}applyNormalMatrix(e){for(let t=0,r=this.count;t<r;t++)xr.fromBufferAttribute(this,t),xr.applyNormalMatrix(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}transformDirection(e){for(let t=0,r=this.count;t<r;t++)xr.fromBufferAttribute(this,t),xr.transformDirection(e),this.setXYZ(t,xr.x,xr.y,xr.z);return this}setX(e,t){return this.normalized&&(t=Mt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Mt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Mt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Mt(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Br(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Br(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Br(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Br(t,this.array)),t}setXY(e,t,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this}setXYZ(e,t,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array),i=Mt(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this}setXYZW(e,t,r,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Mt(t,this.array),r=Mt(r,this.array),i=Mt(i,this.array),s=Mt(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new Xt(new this.array.constructor(t),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 wl(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 t=[];for(let r=0;r<this.count;r++){const i=r*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,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 f1 extends yr{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new We(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 fc;const xh=new z,pc=new z,mc=new z,gc=new ye,Sh=new ye,zI=new ft,em=new z,bh=new z,tm=new z,KM=new ye,Zv=new ye,ZM=new ye;class WI extends Wt{constructor(e=new f1){if(super(),this.isSprite=!0,this.type="Sprite",fc===void 0){fc=new dt;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),r=new _g(t,5);fc.setIndex([0,1,2,0,2,3]),fc.setAttribute("position",new wl(r,3,0,!1)),fc.setAttribute("uv",new wl(r,2,3,!1))}this.geometry=fc,this.material=e,this.center=new ye(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),pc.setFromMatrixScale(this.matrixWorld),zI.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),mc.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&pc.multiplyScalar(-mc.z);const r=this.material.rotation;let i,s;r!==0&&(s=Math.cos(r),i=Math.sin(r));const o=this.center;nm(em.set(-.5,-.5,0),mc,o,pc,i,s),nm(bh.set(.5,-.5,0),mc,o,pc,i,s),nm(tm.set(.5,.5,0),mc,o,pc,i,s),KM.set(0,0),Zv.set(1,0),ZM.set(1,1);let a=e.ray.intersectTriangle(em,bh,tm,!1,xh);if(a===null&&(nm(bh.set(-.5,.5,0),mc,o,pc,i,s),Zv.set(0,1),a=e.ray.intersectTriangle(em,tm,bh,!1,xh),a===null))return;const l=e.ray.origin.distanceTo(xh);l<e.near||l>e.far||t.push({distance:l,point:xh.clone(),uv:kr.getInterpolation(xh,em,bh,tm,KM,Zv,ZM,new ye),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function nm(n,e,t,r,i,s){gc.subVectors(n,t).addScalar(.5).multiply(r),i!==void 0?(Sh.x=s*gc.x-i*gc.y,Sh.y=i*gc.x+s*gc.y):Sh.copy(gc),n.copy(e),n.x+=Sh.x,n.y+=Sh.y,n.applyMatrix4(zI)}const rm=new z,QM=new z;class HI extends Wt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let r=0,i=t.length;r<i;r++){const s=t[r];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,r=0){t=Math.abs(t);const i=this.levels;let s;for(s=0;s<i.length&&!(t<i[s].distance);s++);return i.splice(s,0,{distance:t,hysteresis:r,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let r,i;for(r=1,i=t.length;r<i;r++){let s=t[r].distance;if(t[r].object.visible&&(s-=s*t[r].hysteresis),e<s)break}return t[r-1].object}return null}raycast(e,t){if(this.levels.length>0){rm.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(rm);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){rm.setFromMatrixPosition(e.matrixWorld),QM.setFromMatrixPosition(this.matrixWorld);const r=rm.distanceTo(QM)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i<s;i++){let o=t[i].distance;if(t[i].object.visible&&(o-=o*t[i].hysteresis),r>=o)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<s;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const r=this.levels;for(let i=0,s=r.length;i<s;i++){const o=r[i];t.object.levels.push({object:o.object.uuid,distance:o.distance,hysteresis:o.hysteresis})}return t}}const JM=new z,eE=new Vt,tE=new Vt,Oq=new z,nE=new ft,im=new z,Qv=new mr,rE=new ft,Jv=new Fu;class GI extends Un{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=H2,this.bindMatrix=new ft,this.bindMatrixInverse=new ft,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Cr),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)this.getVertexPosition(r,im),this.boundingBox.expandByPoint(im)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new mr),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let r=0;r<t.count;r++)this.getVertexPosition(r,im),this.boundingSphere.expandByPoint(im)}copy(e,t){return super.copy(e,t),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,t){const r=this.material,i=this.matrixWorld;r!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Qv.copy(this.boundingSphere),Qv.applyMatrix4(i),e.ray.intersectsSphere(Qv)!==!1&&(rE.copy(i).invert(),Jv.copy(e.ray).applyMatrix4(rE),!(this.boundingBox!==null&&Jv.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Jv)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Vt,t=this.geometry.attributes.skinWeight;for(let r=0,i=t.count;r<i;r++){e.fromBufferAttribute(t,r);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(r,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===H2?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===tI?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const r=this.skeleton,i=this.geometry;eE.fromBufferAttribute(i.attributes.skinIndex,e),tE.fromBufferAttribute(i.attributes.skinWeight,e),JM.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=tE.getComponent(s);if(o!==0){const a=eE.getComponent(s);nE.multiplyMatrices(r.bones[a].matrixWorld,r.boneInverses[a]),t.addScaledVector(Oq.copy(JM).applyMatrix4(nE),o)}}return t.applyMatrix4(this.bindMatrixInverse)}boneTransform(e,t){return console.warn("THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151."),this.applyBoneTransform(e,t)}}class p1 extends Wt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class pl extends Mn{constructor(e=null,t=1,r=1,i,s,o,a,l,h=bn,d=bn,f,p){super(null,o,a,l,h,d,i,s,f,p),this.isDataTexture=!0,this.image={data:e,width:t,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const iE=new ft,Uq=new ft;class xg{constructor(e=[],t=[]){this.uuid=oi(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,i=this.bones.length;r<i;r++)this.boneInverses.push(new ft)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const r=new ft;this.bones[e]&&r.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&r.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const r=this.bones[e];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){const e=this.bones,t=this.boneInverses,r=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const a=e[s]?e[s].matrixWorld:Uq;iE.multiplyMatrices(a,t[s]),iE.toArray(r,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new xg(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 t=new Float32Array(e*e*4);t.set(this.boneMatrices);const r=new pl(t,e,e,Mr,Xi);return r.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=r,this}getBoneByName(e){for(let t=0,r=this.bones.length;t<r;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let r=0,i=e.bones.length;r<i;r++){const s=e.bones[r];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new p1),this.bones.push(o),this.boneInverses.push(new ft().fromArray(e.boneInverses[r]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,r=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const a=r[i];e.boneInverses.push(a.toArray())}return e}}class Su extends Xt{constructor(e,t,r,i=1){super(e,t,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}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 yc=new ft,sE=new ft,sm=[],oE=new Cr,kq=new ft,wh=new Un,Th=new mr;class VI extends Un{constructor(e,t,r){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Su(new Float32Array(r*16),16),this.instanceColor=null,this.count=r,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<r;i++)this.setMatrixAt(i,kq)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Cr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,yc),oE.copy(e.boundingBox).applyMatrix4(yc),this.boundingBox.union(oE)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new mr),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let r=0;r<t;r++)this.getMatrixAt(r,yc),Th.copy(e.boundingSphere).applyMatrix4(yc),this.boundingSphere.union(Th)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),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,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const r=this.matrixWorld,i=this.count;if(wh.geometry=this.geometry,wh.material=this.material,wh.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Th.copy(this.boundingSphere),Th.applyMatrix4(r),e.ray.intersectsSphere(Th)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,yc),sE.multiplyMatrices(r,yc),wh.matrixWorld=sE,wh.raycast(e,sm);for(let o=0,a=sm.length;o<a;o++){const l=sm[o];l.instanceId=s,l.object=this,t.push(l)}sm.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Su(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}function Bq(n,e){return n.z-e.z}function zq(n,e){return e.z-n.z}class Wq{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t){const r=this.pool,i=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1});const s=r[this.index];i.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const vc="batchId",Fo=new ft,aE=new ft,Hq=new ft,lE=new ft,e_=new sf,om=new Cr,ka=new mr,Mh=new z,t_=new Wq,ur=new Un,am=[];function Gq(n,e,t=0){const r=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const i=n.count;for(let s=0;s<i;s++)for(let o=0;o<r;o++)e.setComponent(s+t,o,n.getComponent(s,o))}else e.array.set(n.array,t*r);e.needsUpdate=!0}class jI extends Un{get maxGeometryCount(){return this._maxGeometryCount}constructor(e,t,r=t*2,i){super(new dt,i),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._drawRanges=[],this._reservedRanges=[],this._visibility=[],this._active=[],this._bounds=[],this._maxGeometryCount=e,this._maxVertexCount=t,this._maxIndexCount=r,this._geometryInitialized=!1,this._geometryCount=0,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._visibilityChanged=!0,this._matricesTexture=null,this._initMatricesTexture()}_initMatricesTexture(){let e=Math.sqrt(this._maxGeometryCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),r=new pl(t,e,e,Mr,Xi);this._matricesTexture=r}_initializeGeometry(e){const t=this.geometry,r=this._maxVertexCount,i=this._maxGeometryCount,s=this._maxIndexCount;if(this._geometryInitialized===!1){for(const a in e.attributes){const l=e.getAttribute(a),{array:h,itemSize:d,normalized:f}=l,p=new h.constructor(r*d),m=new l.constructor(p,d,f);m.setUsage(l.usage),t.setAttribute(a,m)}if(e.getIndex()!==null){const a=r>65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new Xt(a,1))}const o=i>65536?new Uint32Array(r):new Uint16Array(r);t.setAttribute(vc,new Xt(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(vc))throw new Error(`BatchedMesh: Geometry cannot use attribute "${vc}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in t.attributes){if(r===vc)continue;if(!e.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=e.getAttribute(r),s=t.getAttribute(r);if(i.itemSize!==s.itemSize||i.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Cr);const e=this._geometryCount,t=this.boundingBox,r=this._active;t.makeEmpty();for(let i=0;i<e;i++)r[i]!==!1&&(this.getMatrixAt(i,Fo),this.getBoundingBoxAt(i,om).applyMatrix4(Fo),t.union(om))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new mr);const e=this._geometryCount,t=this.boundingSphere,r=this._active;t.makeEmpty();for(let i=0;i<e;i++)r[i]!==!1&&(this.getMatrixAt(i,Fo),this.getBoundingSphereAt(i,ka).applyMatrix4(Fo),t.union(ka))}addGeometry(e,t=-1,r=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._geometryCount>=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?i.vertexCount=e.getAttribute("position").count:i.vertexCount=t,s===null?i.vertexStart=0:i.vertexStart=s.vertexStart+s.vertexCount;const h=e.getIndex(),d=h!==null;if(d&&(r===-1?i.indexCount=h.count:i.indexCount=r,s===null?i.indexStart=0:i.indexStart=s.indexStart+s.indexCount),i.indexStart!==-1&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const f=this._visibility,p=this._active,m=this._matricesTexture,v=this._matricesTexture.image.data;f.push(!0),p.push(!0);const x=this._geometryCount;this._geometryCount++,Hq.toArray(v,x*16),m.needsUpdate=!0,o.push(i),a.push({start:d?i.indexStart:i.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Cr,sphereInitialized:!1,sphere:new mr});const _=this.geometry.getAttribute(vc);for(let g=0;g<i.vertexCount;g++)_.setX(i.vertexStart+g,x);return _.needsUpdate=!0,this.setGeometryAt(x,e),x}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const r=this.geometry,i=r.getIndex()!==null,s=r.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(i&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,h=a.vertexCount;for(const m in r.attributes){if(m===vc)continue;const v=t.getAttribute(m),x=r.getAttribute(m);Gq(v,x,l);const _=v.itemSize;for(let g=v.count,S=h;g<S;g++){const b=l+g;for(let M=0;M<_;M++)x.setComponent(b,M,0)}x.needsUpdate=!0}if(i){const m=a.indexStart;for(let v=0;v<o.count;v++)s.setX(m+v,l+o.getX(v));for(let v=o.count,x=a.indexCount;v<x;v++)s.setX(m+v,l);s.needsUpdate=!0}const d=this._bounds[e];t.boundingBox!==null?(d.box.copy(t.boundingBox),d.boxInitialized=!0):d.boxInitialized=!1,t.boundingSphere!==null?(d.sphere.copy(t.boundingSphere),d.sphereInitialized=!0):d.sphereInitialized=!1;const f=this._drawRanges[e],p=t.getAttribute("position");return f.count=i?o.count:p.count,this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._active;return e>=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return this;const i=this._bounds[e],s=i.box,o=this.geometry;if(i.boxInitialized===!1){s.makeEmpty();const a=o.index,l=o.attributes.position,h=this._drawRanges[e];for(let d=h.start,f=h.start+h.count;d<f;d++){let p=d;a&&(p=a.getX(p)),s.expandByPoint(Mh.fromBufferAttribute(l,p))}i.boxInitialized=!0}return t.copy(s),t}getBoundingSphereAt(e,t){if(this._active[e]===!1)return this;const i=this._bounds[e],s=i.sphere,o=this.geometry;if(i.sphereInitialized===!1){s.makeEmpty(),this.getBoundingBoxAt(e,om),om.getCenter(s.center);const a=o.index,l=o.attributes.position,h=this._drawRanges[e];let d=0;for(let f=h.start,p=h.start+h.count;f<p;f++){let m=f;a&&(m=a.getX(m)),Mh.fromBufferAttribute(l,m),d=Math.max(d,s.center.distanceToSquared(Mh))}s.radius=Math.sqrt(d),i.sphereInitialized=!0}return t.copy(s),t}setMatrixAt(e,t){const r=this._active,i=this._matricesTexture,s=this._matricesTexture.image.data,o=this._geometryCount;return e>=o||r[e]===!1?this:(t.toArray(s,e*16),i.needsUpdate=!0,this)}getMatrixAt(e,t){const r=this._active,i=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||r[e]===!1?null:t.fromArray(i,e*16)}setVisibleAt(e,t){const r=this._visibility,i=this._active,s=this._geometryCount;return e>=s||i[e]===!1||r[e]===t?this:(r[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,r=this._active,i=this._geometryCount;return e>=i||r[e]===!1?!1:t[e]}raycast(e,t){const r=this._visibility,i=this._active,s=this._drawRanges,o=this._geometryCount,a=this.matrixWorld,l=this.geometry;ur.material=this.material,ur.geometry.index=l.index,ur.geometry.attributes=l.attributes,ur.geometry.boundingBox===null&&(ur.geometry.boundingBox=new Cr),ur.geometry.boundingSphere===null&&(ur.geometry.boundingSphere=new mr);for(let h=0;h<o;h++){if(!r[h]||!i[h])continue;const d=s[h];ur.geometry.setDrawRange(d.start,d.count),this.getMatrixAt(h,ur.matrixWorld).premultiply(a),this.getBoundingBoxAt(h,ur.geometry.boundingBox),this.getBoundingSphereAt(h,ur.geometry.boundingSphere),ur.raycast(e,am);for(let f=0,p=am.length;f<p;f++){const m=am[f];m.object=this,m.batchId=h,t.push(m)}am.length=0}ur.material=null,ur.geometry.index=null,ur.geometry.attributes={},ur.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._drawRanges=e._drawRanges.map(t=>({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,r,i,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=i.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._visibility,h=this._multiDrawStarts,d=this._multiDrawCounts,f=this._drawRanges,p=this.perObjectFrustumCulled;p&&(lE.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),e_.setFromProjectionMatrix(lE,e.isWebGPURenderer?vu:Yi));let m=0;if(this.sortObjects){aE.copy(this.matrixWorld).invert(),Mh.setFromMatrixPosition(r.matrixWorld).applyMatrix4(aE);for(let _=0,g=l.length;_<g;_++)if(l[_]){this.getMatrixAt(_,Fo),this.getBoundingSphereAt(_,ka).applyMatrix4(Fo);let S=!1;if(p&&(S=!e_.intersectsSphere(ka)),!S){const b=Mh.distanceTo(ka.center);t_.push(f[_],b)}}const v=t_.list,x=this.customSort;x===null?v.sort(s.transparent?zq:Bq):x.call(this,v,r);for(let _=0,g=v.length;_<g;_++){const S=v[_];h[m]=S.start*a,d[m]=S.count,m++}t_.reset()}else for(let v=0,x=l.length;v<x;v++)if(l[v]){let _=!1;if(p&&(this.getMatrixAt(v,Fo),this.getBoundingSphereAt(v,ka).applyMatrix4(Fo),_=!e_.intersectsSphere(ka)),!_){const g=f[v];h[m]=g.start*a,d[m]=g.count,m++}}this._multiDrawCount=m,this._visibilityChanged=!1}onBeforeShadow(e,t,r,i,s,o){this.onBeforeRender(e,null,i,s,o)}}class In extends yr{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new We(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 cE=new z,uE=new z,hE=new ft,n_=new Fu,lm=new mr;class ns extends Wt{constructor(e=new dt,t=new In){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),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 t=e.attributes.position,r=[0];for(let i=1,s=t.count;i<s;i++)cE.fromBufferAttribute(t,i-1),uE.fromBufferAttribute(t,i),r[i]=r[i-1],r[i]+=cE.distanceTo(uE);e.setAttribute("lineDistance",new qe(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),lm.copy(r.boundingSphere),lm.applyMatrix4(i),lm.radius+=s,e.ray.intersectsSphere(lm)===!1)return;hE.copy(i).invert(),n_.copy(e.ray).applyMatrix4(hE);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,h=new z,d=new z,f=new z,p=new z,m=this.isLineSegments?2:1,v=r.index,_=r.attributes.position;if(v!==null){const g=Math.max(0,o.start),S=Math.min(v.count,o.start+o.count);for(let b=g,M=S-1;b<M;b+=m){const C=v.getX(b),A=v.getX(b+1);if(h.fromBufferAttribute(_,C),d.fromBufferAttribute(_,A),n_.distanceSqToSegment(h,d,p,f)>l)continue;p.applyMatrix4(this.matrixWorld);const O=e.ray.origin.distanceTo(p);O<e.near||O>e.far||t.push({distance:O,point:f.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),S=Math.min(_.count,o.start+o.count);for(let b=g,M=S-1;b<M;b+=m){if(h.fromBufferAttribute(_,b),d.fromBufferAttribute(_,b+1),n_.distanceSqToSegment(h,d,p,f)>l)continue;p.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(p);A<e.near||A>e.far||t.push({distance:A,point:f.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}const dE=new z,fE=new z;class Pi extends ns{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,r=[];for(let i=0,s=t.count;i<s;i+=2)dE.fromBufferAttribute(t,i),fE.fromBufferAttribute(t,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+dE.distanceTo(fE);e.setAttribute("lineDistance",new qe(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class XI extends ns{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class m1 extends yr{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new We(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 pE=new ft,_x=new Fu,cm=new mr,um=new z;class YI extends Wt{constructor(e=new dt,t=new m1){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const r=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),cm.copy(r.boundingSphere),cm.applyMatrix4(i),cm.radius+=s,e.ray.intersectsSphere(cm)===!1)return;pE.copy(i).invert(),_x.copy(e.ray).applyMatrix4(pE);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,h=r.index,f=r.attributes.position;if(h!==null){const p=Math.max(0,o.start),m=Math.min(h.count,o.start+o.count);for(let v=p,x=m;v<x;v++){const _=h.getX(v);um.fromBufferAttribute(f,_),mE(um,_,l,i,e,t,this)}}else{const p=Math.max(0,o.start),m=Math.min(f.count,o.start+o.count);for(let v=p,x=m;v<x;v++)um.fromBufferAttribute(f,v),mE(um,v,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,r=Object.keys(t);if(r.length>0){const i=t[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){const a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}}function mE(n,e,t,r,i,s,o){const a=_x.distanceSqToPoint(n);if(a<t){const l=new z;_x.closestPointToPoint(n,l),l.applyMatrix4(r);const h=i.ray.origin.distanceTo(l);if(h<i.near||h>i.far)return;s.push({distance:h,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class Vq extends Mn{constructor(e,t,r,i,s,o,a,l,h){super(e,t,r,i,s,o,a,l,h),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:Tn,this.magFilter=s!==void 0?s:Tn,this.generateMipmaps=!1;const d=this;function f(){d.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&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)}}class jq extends Mn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=bn,this.minFilter=bn,this.generateMipmaps=!1,this.needsUpdate=!0}}class Sg extends Mn{constructor(e,t,r,i,s,o,a,l,h,d,f,p){super(null,o,a,l,h,d,i,s,f,p),this.isCompressedTexture=!0,this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Xq extends Sg{constructor(e,t,r,i,s,o){super(e,t,r,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=pr}}class Yq extends Sg{constructor(e,t,r){super(void 0,e[0].width,e[0].height,t,r,ho),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class qq extends Mn{constructor(e,t,r,i,s,o,a,l,h){super(e,t,r,i,s,o,a,l,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}class rs{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const r=this.getUtoTmapping(e);return this.getPoint(r,t)}getPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return t}getSpacedPoints(e=5){const t=[];for(let r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let r,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)r=this.getPoint(o/e),s+=r.distanceTo(i),t.push(s),i=r;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const r=this.getLengths();let i=0;const s=r.length;let o;t?o=t:o=e*r[s-1];let a=0,l=s-1,h;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),h=r[i]-o,h<0)a=i+1;else if(h>0)l=i-1;else{l=i;break}if(i=l,r[i]===o)return i/(s-1);const d=r[i],p=r[i+1]-d,m=(o-d)/p;return(i+m)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new ye:new z);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const r=this.getUtoTmapping(e);return this.getTangent(r,t)}computeFrenetFrames(e,t){const r=new z,i=[],s=[],o=[],a=new z,l=new ft;for(let m=0;m<=e;m++){const v=m/e;i[m]=this.getTangentAt(v,new z)}s[0]=new z,o[0]=new z;let h=Number.MAX_VALUE;const d=Math.abs(i[0].x),f=Math.abs(i[0].y),p=Math.abs(i[0].z);d<=h&&(h=d,r.set(1,0,0)),f<=h&&(h=f,r.set(0,1,0)),p<=h&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(vn(i[m-1].dot(i[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,v))}o[m].crossVectors(i[m],s[m])}if(t===!0){let m=Math.acos(vn(s[0].dot(s[e]),-1,1));m/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(i[v],m*v)),o[v].crossVectors(i[v],s[v])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class bg extends rs{constructor(e=0,t=0,r=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const r=t||new ye,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(o?s=0:s=i),this.aClockwise===!0&&!o&&(s===i?s=-i:s=s-i);const a=this.aStartAngle+e*s;let l=this.aX+this.xRadius*Math.cos(a),h=this.aY+this.yRadius*Math.sin(a);if(this.aRotation!==0){const d=Math.cos(this.aRotation),f=Math.sin(this.aRotation),p=l-this.aX,m=h-this.aY;l=p*d-m*f+this.aX,h=p*f+m*d+this.aY}return r.set(l,h)}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 qI extends bg{constructor(e,t,r,i,s,o){super(e,t,r,r,i,s,o),this.isArcCurve=!0,this.type="ArcCurve"}}function g1(){let n=0,e=0,t=0,r=0;function i(s,o,a,l){n=s,e=a,t=-3*s+3*o-2*a-l,r=2*s-2*o+a+l}return{initCatmullRom:function(s,o,a,l,h){i(o,a,h*(a-s),h*(l-o))},initNonuniformCatmullRom:function(s,o,a,l,h,d,f){let p=(o-s)/h-(a-s)/(h+d)+(a-o)/d,m=(a-o)/d-(l-o)/(d+f)+(l-a)/f;p*=d,m*=d,i(o,a,p,m)},calc:function(s){const o=s*s,a=o*s;return n+e*s+t*o+r*a}}}const hm=new z,r_=new g1,i_=new g1,s_=new g1;class $I extends rs{constructor(e=[],t=!1,r="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=r,this.tension=i}getPoint(e,t=new z){const r=t,i=this.points,s=i.length,o=(s-(this.closed?0:1))*e;let a=Math.floor(o),l=o-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let h,d;this.closed||a>0?h=i[(a-1)%s]:(hm.subVectors(i[0],i[1]).add(i[0]),h=hm);const f=i[a%s],p=i[(a+1)%s];if(this.closed||a+2<s?d=i[(a+2)%s]:(hm.subVectors(i[s-1],i[s-2]).add(i[s-1]),d=hm),this.curveType==="centripetal"||this.curveType==="chordal"){const m=this.curveType==="chordal"?.5:.25;let v=Math.pow(h.distanceToSquared(f),m),x=Math.pow(f.distanceToSquared(p),m),_=Math.pow(p.distanceToSquared(d),m);x<1e-4&&(x=1),v<1e-4&&(v=x),_<1e-4&&(_=x),r_.initNonuniformCatmullRom(h.x,f.x,p.x,d.x,v,x,_),i_.initNonuniformCatmullRom(h.y,f.y,p.y,d.y,v,x,_),s_.initNonuniformCatmullRom(h.z,f.z,p.z,d.z,v,x,_)}else this.curveType==="catmullrom"&&(r_.initCatmullRom(h.x,f.x,p.x,d.x,this.tension),i_.initCatmullRom(h.y,f.y,p.y,d.y,this.tension),s_.initCatmullRom(h.z,f.z,p.z,d.z,this.tension));return r.set(r_.calc(l),i_.calc(l),s_.calc(l)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new z().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function gE(n,e,t,r,i){const s=(r-e)*.5,o=(i-t)*.5,a=n*n,l=n*a;return(2*t-2*r+s+o)*l+(-3*t+3*r-2*s-o)*a+s*n+t}function $q(n,e){const t=1-n;return t*t*e}function Kq(n,e){return 2*(1-n)*n*e}function Zq(n,e){return n*n*e}function qh(n,e,t,r){return $q(n,e)+Kq(n,t)+Zq(n,r)}function Qq(n,e){const t=1-n;return t*t*t*e}function Jq(n,e){const t=1-n;return 3*t*t*n*e}function e$(n,e){return 3*(1-n)*n*n*e}function t$(n,e){return n*n*n*e}function $h(n,e,t,r,i){return Qq(n,e)+Jq(n,t)+e$(n,r)+t$(n,i)}class y1 extends rs{constructor(e=new ye,t=new ye,r=new ye,i=new ye){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new ye){const r=t,i=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set($h(e,i.x,s.x,o.x,a.x),$h(e,i.y,s.y,o.y,a.y)),r}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 KI extends rs{constructor(e=new z,t=new z,r=new z,i=new z){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=r,this.v3=i}getPoint(e,t=new z){const r=t,i=this.v0,s=this.v1,o=this.v2,a=this.v3;return r.set($h(e,i.x,s.x,o.x,a.x),$h(e,i.y,s.y,o.y,a.y),$h(e,i.z,s.z,o.z,a.z)),r}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 v1 extends rs{constructor(e=new ye,t=new ye){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new ye){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new ye){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}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 ZI extends rs{constructor(e=new z,t=new z){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new z){const r=t;return e===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new z){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}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 _1 extends rs{constructor(e=new ye,t=new ye,r=new ye){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new ye){const r=t,i=this.v0,s=this.v1,o=this.v2;return r.set(qh(e,i.x,s.x,o.x),qh(e,i.y,s.y,o.y)),r}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 x1 extends rs{constructor(e=new z,t=new z,r=new z){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=r}getPoint(e,t=new z){const r=t,i=this.v0,s=this.v1,o=this.v2;return r.set(qh(e,i.x,s.x,o.x),qh(e,i.y,s.y,o.y),qh(e,i.z,s.z,o.z)),r}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 S1 extends rs{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new ye){const r=t,i=this.points,s=(i.length-1)*e,o=Math.floor(s),a=s-o,l=i[o===0?o:o-1],h=i[o],d=i[o>i.length-2?i.length-1:o+1],f=i[o>i.length-3?i.length-1:o+2];return r.set(gE(a,l.x,h.x,d.x,f.x),gE(a,l.y,h.y,d.y,f.y)),r}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,r=this.points.length;t<r;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++){const i=e.points[t];this.points.push(new ye().fromArray(i))}return this}}var F0=Object.freeze({__proto__:null,ArcCurve:qI,CatmullRomCurve3:$I,CubicBezierCurve:y1,CubicBezierCurve3:KI,EllipseCurve:bg,LineCurve:v1,LineCurve3:ZI,QuadraticBezierCurve:_1,QuadraticBezierCurve3:x1,SplineCurve:S1});class QI extends rs{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const r=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new F0[r](t,e))}return this}getPoint(e,t){const r=e*this.getLength(),i=this.getCurveLengths();let s=0;for(;s<i.length;){if(i[s]>=r){const o=i[s]-r,a=this.curves[s],l=a.getLength(),h=l===0?0:1-o/l;return a.getPointAt(h,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let r=0,i=this.curves.length;r<i;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let r=0;r<=e;r++)t.push(this.getPoint(r/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let r;for(let i=0,s=this.curves;i<s.length;i++){const o=s[i],a=o.isEllipseCurve?e*2:o.isLineCurve||o.isLineCurve3?1:o.isSplineCurve?e*o.points.length:e,l=o.getPoints(a);for(let h=0;h<l.length;h++){const d=l[h];r&&r.equals(d)||(t.push(d),r=d)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,r=this.curves.length;t<r;t++){const i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,r=e.curves.length;t<r;t++){const i=e.curves[t];this.curves.push(new F0[i.type]().fromJSON(i))}return this}}class Fd extends QI{constructor(e){super(),this.type="Path",this.currentPoint=new ye,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const r=new v1(this.currentPoint.clone(),new ye(e,t));return this.curves.push(r),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,r,i){const s=new _1(this.currentPoint.clone(),new ye(e,t),new ye(r,i));return this.curves.push(s),this.currentPoint.set(r,i),this}bezierCurveTo(e,t,r,i,s,o){const a=new y1(this.currentPoint.clone(),new ye(e,t),new ye(r,i),new ye(s,o));return this.curves.push(a),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),r=new S1(t);return this.curves.push(r),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,r,i,s,o){const a=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+a,t+l,r,i,s,o),this}absarc(e,t,r,i,s,o){return this.absellipse(e,t,r,r,i,s,o),this}ellipse(e,t,r,i,s,o,a,l){const h=this.currentPoint.x,d=this.currentPoint.y;return this.absellipse(e+h,t+d,r,i,s,o,a,l),this}absellipse(e,t,r,i,s,o,a,l){const h=new bg(e,t,r,i,s,o,a,l);if(this.curves.length>0){const f=h.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(h);const d=h.getPoint(1);return this.currentPoint.copy(d),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 af extends dt{constructor(e=[new ye(0,-.5),new ye(.5,0),new ye(0,.5)],t=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:i},t=Math.floor(t),i=vn(i,0,Math.PI*2);const s=[],o=[],a=[],l=[],h=[],d=1/t,f=new z,p=new ye,m=new z,v=new z,x=new z;let _=0,g=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:_=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-_,m.z=g*0,x.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(x.x,x.y,x.z);break;default:_=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-_,m.z=g*0,v.copy(m),m.x+=x.x,m.y+=x.y,m.z+=x.z,m.normalize(),l.push(m.x,m.y,m.z),x.copy(v)}for(let S=0;S<=t;S++){const b=r+S*d*i,M=Math.sin(b),C=Math.cos(b);for(let A=0;A<=e.length-1;A++){f.x=e[A].x*M,f.y=e[A].y,f.z=e[A].x*C,o.push(f.x,f.y,f.z),p.x=S/t,p.y=A/(e.length-1),a.push(p.x,p.y);const R=l[3*A+0]*M,O=l[3*A+1],P=l[3*A+0]*C;h.push(R,O,P)}}for(let S=0;S<t;S++)for(let b=0;b<e.length-1;b++){const M=b+S*e.length,C=M,A=M+e.length,R=M+e.length+1,O=M+1;s.push(C,A,O),s.push(R,O,A)}this.setIndex(s),this.setAttribute("position",new qe(o,3)),this.setAttribute("uv",new qe(a,2)),this.setAttribute("normal",new qe(h,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new af(e.points,e.segments,e.phiStart,e.phiLength)}}class wg extends af{constructor(e=1,t=1,r=4,i=8){const s=new Fd;s.absarc(0,-t/2,e,Math.PI*1.5,0),s.absarc(0,t/2,e,0,Math.PI*.5),super(s.getPoints(r),i),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:r,radialSegments:i}}static fromJSON(e){return new wg(e.radius,e.length,e.capSegments,e.radialSegments)}}class Tg extends dt{constructor(e=1,t=32,r=0,i=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:i},t=Math.max(3,t);const s=[],o=[],a=[],l=[],h=new z,d=new ye;o.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let f=0,p=3;f<=t;f++,p+=3){const m=r+f/t*i;h.x=e*Math.cos(m),h.y=e*Math.sin(m),o.push(h.x,h.y,h.z),a.push(0,0,1),d.x=(o[p]/e+1)/2,d.y=(o[p+1]/e+1)/2,l.push(d.x,d.y)}for(let f=1;f<=t;f++)s.push(f,f+1,0);this.setIndex(s),this.setAttribute("position",new qe(o,3)),this.setAttribute("normal",new qe(a,3)),this.setAttribute("uv",new qe(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Tg(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Ou extends dt{constructor(e=1,t=1,r=1,i=32,s=1,o=!1,a=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:i,heightSegments:s,openEnded:o,thetaStart:a,thetaLength:l};const h=this;i=Math.floor(i),s=Math.floor(s);const d=[],f=[],p=[],m=[];let v=0;const x=[],_=r/2;let g=0;S(),o===!1&&(e>0&&b(!0),t>0&&b(!1)),this.setIndex(d),this.setAttribute("position",new qe(f,3)),this.setAttribute("normal",new qe(p,3)),this.setAttribute("uv",new qe(m,2));function S(){const M=new z,C=new z;let A=0;const R=(t-e)/r;for(let O=0;O<=s;O++){const P=[],I=O/s,H=I*(t-e)+e;for(let X=0;X<=i;X++){const se=X/i,W=se*l+a,$=Math.sin(W),Z=Math.cos(W);C.x=H*$,C.y=-I*r+_,C.z=H*Z,f.push(C.x,C.y,C.z),M.set($,R,Z).normalize(),p.push(M.x,M.y,M.z),m.push(se,1-I),P.push(v++)}x.push(P)}for(let O=0;O<i;O++)for(let P=0;P<s;P++){const I=x[P][O],H=x[P+1][O],X=x[P+1][O+1],se=x[P][O+1];d.push(I,H,se),d.push(H,X,se),A+=6}h.addGroup(g,A,0),g+=A}function b(M){const C=v,A=new ye,R=new z;let O=0;const P=M===!0?e:t,I=M===!0?1:-1;for(let X=1;X<=i;X++)f.push(0,_*I,0),p.push(0,I,0),m.push(.5,.5),v++;const H=v;for(let X=0;X<=i;X++){const W=X/i*l+a,$=Math.cos(W),Z=Math.sin(W);R.x=P*Z,R.y=_*I,R.z=P*$,f.push(R.x,R.y,R.z),p.push(0,I,0),A.x=$*.5+.5,A.y=Z*.5*I+.5,m.push(A.x,A.y),v++}for(let X=0;X<i;X++){const se=C+X,W=H+X;M===!0?d.push(W,W+1,se):d.push(W+1,W,se),O+=3}h.addGroup(g,O,M===!0?1:2),g+=O}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ou(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Mg extends Ou{constructor(e=1,t=1,r=32,i=1,s=!1,o=0,a=Math.PI*2){super(0,e,t,r,i,s,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:o,thetaLength:a}}static fromJSON(e){return new Mg(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class wa extends dt{constructor(e=[],t=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:i};const s=[],o=[];a(i),h(r),d(),this.setAttribute("position",new qe(s,3)),this.setAttribute("normal",new qe(s.slice(),3)),this.setAttribute("uv",new qe(o,2)),i===0?this.computeVertexNormals():this.normalizeNormals();function a(S){const b=new z,M=new z,C=new z;for(let A=0;A<t.length;A+=3)m(t[A+0],b),m(t[A+1],M),m(t[A+2],C),l(b,M,C,S)}function l(S,b,M,C){const A=C+1,R=[];for(let O=0;O<=A;O++){R[O]=[];const P=S.clone().lerp(M,O/A),I=b.clone().lerp(M,O/A),H=A-O;for(let X=0;X<=H;X++)X===0&&O===A?R[O][X]=P:R[O][X]=P.clone().lerp(I,X/H)}for(let O=0;O<A;O++)for(let P=0;P<2*(A-O)-1;P++){const I=Math.floor(P/2);P%2===0?(p(R[O][I+1]),p(R[O+1][I]),p(R[O][I])):(p(R[O][I+1]),p(R[O+1][I+1]),p(R[O+1][I]))}}function h(S){const b=new z;for(let M=0;M<s.length;M+=3)b.x=s[M+0],b.y=s[M+1],b.z=s[M+2],b.normalize().multiplyScalar(S),s[M+0]=b.x,s[M+1]=b.y,s[M+2]=b.z}function d(){const S=new z;for(let b=0;b<s.length;b+=3){S.x=s[b+0],S.y=s[b+1],S.z=s[b+2];const M=_(S)/2/Math.PI+.5,C=g(S)/Math.PI+.5;o.push(M,1-C)}v(),f()}function f(){for(let S=0;S<o.length;S+=6){const b=o[S+0],M=o[S+2],C=o[S+4],A=Math.max(b,M,C),R=Math.min(b,M,C);A>.9&&R<.1&&(b<.2&&(o[S+0]+=1),M<.2&&(o[S+2]+=1),C<.2&&(o[S+4]+=1))}}function p(S){s.push(S.x,S.y,S.z)}function m(S,b){const M=S*3;b.x=e[M+0],b.y=e[M+1],b.z=e[M+2]}function v(){const S=new z,b=new z,M=new z,C=new z,A=new ye,R=new ye,O=new ye;for(let P=0,I=0;P<s.length;P+=9,I+=6){S.set(s[P+0],s[P+1],s[P+2]),b.set(s[P+3],s[P+4],s[P+5]),M.set(s[P+6],s[P+7],s[P+8]),A.set(o[I+0],o[I+1]),R.set(o[I+2],o[I+3]),O.set(o[I+4],o[I+5]),C.copy(S).add(b).add(M).divideScalar(3);const H=_(C);x(A,I+0,S,H),x(R,I+2,b,H),x(O,I+4,M,H)}}function x(S,b,M,C){C<0&&S.x===1&&(o[b]=S.x-1),M.x===0&&M.z===0&&(o[b]=C/2/Math.PI+.5)}function _(S){return Math.atan2(S.z,-S.x)}function g(S){return Math.atan2(-S.y,Math.sqrt(S.x*S.x+S.z*S.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new wa(e.vertices,e.indices,e.radius,e.details)}}class Eg extends wa{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,i=1/r,s=[-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,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],o=[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(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Eg(e.radius,e.detail)}}const dm=new z,fm=new z,o_=new z,pm=new kr;class JI extends dt{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const i=Math.pow(10,4),s=Math.cos(dl*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,h=[0,0,0],d=["a","b","c"],f=new Array(3),p={},m=[];for(let v=0;v<l;v+=3){o?(h[0]=o.getX(v),h[1]=o.getX(v+1),h[2]=o.getX(v+2)):(h[0]=v,h[1]=v+1,h[2]=v+2);const{a:x,b:_,c:g}=pm;if(x.fromBufferAttribute(a,h[0]),_.fromBufferAttribute(a,h[1]),g.fromBufferAttribute(a,h[2]),pm.getNormal(o_),f[0]=`${Math.round(x.x*i)},${Math.round(x.y*i)},${Math.round(x.z*i)}`,f[1]=`${Math.round(_.x*i)},${Math.round(_.y*i)},${Math.round(_.z*i)}`,f[2]=`${Math.round(g.x*i)},${Math.round(g.y*i)},${Math.round(g.z*i)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let S=0;S<3;S++){const b=(S+1)%3,M=f[S],C=f[b],A=pm[d[S]],R=pm[d[b]],O=`${M}_${C}`,P=`${C}_${M}`;P in p&&p[P]?(o_.dot(p[P].normal)<=s&&(m.push(A.x,A.y,A.z),m.push(R.x,R.y,R.z)),p[P]=null):O in p||(p[O]={index0:h[S],index1:h[b],normal:o_.clone()})}}for(const v in p)if(p[v]){const{index0:x,index1:_}=p[v];dm.fromBufferAttribute(a,x),fm.fromBufferAttribute(a,_),m.push(dm.x,dm.y,dm.z),m.push(fm.x,fm.y,fm.z)}this.setAttribute("position",new qe(m,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class ml extends Fd{constructor(e){super(e),this.uuid=oi(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let r=0,i=this.holes.length;r<i;r++)t[r]=this.holes[r].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,r=this.holes.length;t<r;t++){const i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,r=e.holes.length;t<r;t++){const i=e.holes[t];this.holes.push(new Fd().fromJSON(i))}return this}}const n$={triangulate:function(n,e,t=2){const r=e&&e.length,i=r?e[0]*t:n.length;let s=eL(n,0,i,t,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,h,d,f,p,m;if(r&&(s=a$(n,e,s,t)),n.length>80*t){a=h=n[0],l=d=n[1];for(let v=t;v<i;v+=t)f=n[v],p=n[v+1],f<a&&(a=f),p<l&&(l=p),f>h&&(h=f),p>d&&(d=p);m=Math.max(h-a,d-l),m=m!==0?32767/m:0}return Nd(s,o,t,a,l,m,0),o}};function eL(n,e,t,r,i){let s,o;if(i===v$(n,e,t,r)>0)for(s=e;s<t;s+=r)o=yE(s,n[s],n[s+1],o);else for(s=t-r;s>=e;s-=r)o=yE(s,n[s],n[s+1],o);return o&&Ag(o,o.next)&&(Od(o),o=o.next),o}function Tl(n,e){if(!n)return n;e||(e=n);let t=n,r;do if(r=!1,!t.steiner&&(Ag(t,t.next)||un(t.prev,t,t.next)===0)){if(Od(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Nd(n,e,t,r,i,s,o){if(!n)return;!o&&s&&d$(n,r,i,s);let a=n,l,h;for(;n.prev!==n.next;){if(l=n.prev,h=n.next,s?i$(n,r,i,s):r$(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(h.i/t|0),Od(n),n=h.next,a=h.next;continue}if(n=h,n===a){o?o===1?(n=s$(Tl(n),e,t),Nd(n,e,t,r,i,s,2)):o===2&&o$(n,e,t,r,i,s):Nd(Tl(n),e,t,r,i,s,1);break}}}function r$(n){const e=n.prev,t=n,r=n.next;if(un(e,t,r)>=0)return!1;const i=e.x,s=t.x,o=r.x,a=e.y,l=t.y,h=r.y,d=i<s?i<o?i:o:s<o?s:o,f=a<l?a<h?a:h:l<h?l:h,p=i>s?i>o?i:o:s>o?s:o,m=a>l?a>h?a:h:l>h?l:h;let v=r.next;for(;v!==e;){if(v.x>=d&&v.x<=p&&v.y>=f&&v.y<=m&&zc(i,a,s,l,o,h,v.x,v.y)&&un(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function i$(n,e,t,r){const i=n.prev,s=n,o=n.next;if(un(i,s,o)>=0)return!1;const a=i.x,l=s.x,h=o.x,d=i.y,f=s.y,p=o.y,m=a<l?a<h?a:h:l<h?l:h,v=d<f?d<p?d:p:f<p?f:p,x=a>l?a>h?a:h:l>h?l:h,_=d>f?d>p?d:p:f>p?f:p,g=xx(m,v,e,t,r),S=xx(x,_,e,t,r);let b=n.prevZ,M=n.nextZ;for(;b&&b.z>=g&&M&&M.z<=S;){if(b.x>=m&&b.x<=x&&b.y>=v&&b.y<=_&&b!==i&&b!==o&&zc(a,d,l,f,h,p,b.x,b.y)&&un(b.prev,b,b.next)>=0||(b=b.prevZ,M.x>=m&&M.x<=x&&M.y>=v&&M.y<=_&&M!==i&&M!==o&&zc(a,d,l,f,h,p,M.x,M.y)&&un(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;b&&b.z>=g;){if(b.x>=m&&b.x<=x&&b.y>=v&&b.y<=_&&b!==i&&b!==o&&zc(a,d,l,f,h,p,b.x,b.y)&&un(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=S;){if(M.x>=m&&M.x<=x&&M.y>=v&&M.y<=_&&M!==i&&M!==o&&zc(a,d,l,f,h,p,M.x,M.y)&&un(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function s$(n,e,t){let r=n;do{const i=r.prev,s=r.next.next;!Ag(i,s)&&tL(i,r,r.next,s)&&Dd(i,s)&&Dd(s,i)&&(e.push(i.i/t|0),e.push(r.i/t|0),e.push(s.i/t|0),Od(r),Od(r.next),r=n=s),r=r.next}while(r!==n);return Tl(r)}function o$(n,e,t,r,i,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&m$(o,a)){let l=nL(o,a);o=Tl(o,o.next),l=Tl(l,l.next),Nd(o,e,t,r,i,s,0),Nd(l,e,t,r,i,s,0);return}a=a.next}o=o.next}while(o!==n)}function a$(n,e,t,r){const i=[];let s,o,a,l,h;for(s=0,o=e.length;s<o;s++)a=e[s]*r,l=s<o-1?e[s+1]*r:n.length,h=eL(n,a,l,r,!1),h===h.next&&(h.steiner=!0),i.push(p$(h));for(i.sort(l$),s=0;s<i.length;s++)t=c$(i[s],t);return t}function l$(n,e){return n.x-e.x}function c$(n,e){const t=u$(n,e);if(!t)return e;const r=nL(t,n);return Tl(r,r.next),Tl(t,t.next)}function u$(n,e){let t=e,r=-1/0,i;const s=n.x,o=n.y;do{if(o<=t.y&&o>=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>r&&(r=p,i=t.x<t.next.x?t:t.next,p===s))return i}t=t.next}while(t!==e);if(!i)return null;const a=i,l=i.x,h=i.y;let d=1/0,f;t=i;do s>=t.x&&t.x>=l&&s!==t.x&&zc(o<h?s:r,o,l,h,o<h?r:s,o,t.x,t.y)&&(f=Math.abs(o-t.y)/(s-t.x),Dd(t,n)&&(f<d||f===d&&(t.x>i.x||t.x===i.x&&h$(i,t)))&&(i=t,d=f)),t=t.next;while(t!==a);return i}function h$(n,e){return un(n.prev,n,e.prev)<0&&un(e.next,n,n.next)<0}function d$(n,e,t,r){let i=n;do i.z===0&&(i.z=xx(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==n);i.prevZ.nextZ=null,i.prevZ=null,f$(i)}function f$(n){let e,t,r,i,s,o,a,l,h=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,r=t,a=0,e=0;e<h&&(a++,r=r.nextZ,!!r);e++);for(l=h;a>0||l>0&&r;)a!==0&&(l===0||!r||t.z<=r.z)?(i=t,t=t.nextZ,a--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:n=i,i.prevZ=s,s=i;t=r}s.nextZ=null,h*=2}while(o>1);return n}function xx(n,e,t,r,i){return n=(n-t)*i|0,e=(e-r)*i|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function p$(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function zc(n,e,t,r,i,s,o,a){return(i-o)*(e-a)>=(n-o)*(s-a)&&(n-o)*(r-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(i-o)*(r-a)}function m$(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!g$(n,e)&&(Dd(n,e)&&Dd(e,n)&&y$(n,e)&&(un(n.prev,n,e.prev)||un(n,e.prev,e))||Ag(n,e)&&un(n.prev,n,n.next)>0&&un(e.prev,e,e.next)>0)}function un(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ag(n,e){return n.x===e.x&&n.y===e.y}function tL(n,e,t,r){const i=gm(un(n,e,t)),s=gm(un(n,e,r)),o=gm(un(t,r,n)),a=gm(un(t,r,e));return!!(i!==s&&o!==a||i===0&&mm(n,t,e)||s===0&&mm(n,r,e)||o===0&&mm(t,n,r)||a===0&&mm(t,e,r))}function mm(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function gm(n){return n>0?1:n<0?-1:0}function g$(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&tL(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function Dd(n,e){return un(n.prev,n,n.next)<0?un(n,e,n.next)>=0&&un(n,n.prev,e)>=0:un(n,e,n.prev)<0||un(n,n.next,e)<0}function y$(n,e){let t=n,r=!1;const i=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==n);return r}function nL(n,e){const t=new Sx(n.i,n.x,n.y),r=new Sx(e.i,e.x,e.y),i=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=i,i.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}function yE(n,e,t,r){const i=new Sx(n,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Od(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Sx(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function v$(n,e,t,r){let i=0;for(let s=e,o=t-r;s<t;s+=r)i+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return i}class As{static area(e){const t=e.length;let r=0;for(let i=t-1,s=0;s<t;i=s++)r+=e[i].x*e[s].y-e[s].x*e[i].y;return r*.5}static isClockWise(e){return As.area(e)<0}static triangulateShape(e,t){const r=[],i=[],s=[];vE(e),_E(r,e);let o=e.length;t.forEach(vE);for(let l=0;l<t.length;l++)i.push(o),o+=t[l].length,_E(r,t[l]);const a=n$.triangulate(r,i);for(let l=0;l<a.length;l+=3)s.push(a.slice(l,l+3));return s}}function vE(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function _E(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Cg extends dt{constructor(e=new ml([new ye(.5,.5),new ye(-.5,.5),new ye(-.5,-.5),new ye(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const r=this,i=[],s=[];for(let a=0,l=e.length;a<l;a++){const h=e[a];o(h)}this.setAttribute("position",new qe(i,3)),this.setAttribute("uv",new qe(s,2)),this.computeVertexNormals();function o(a){const l=[],h=t.curveSegments!==void 0?t.curveSegments:12,d=t.steps!==void 0?t.steps:1,f=t.depth!==void 0?t.depth:1;let p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,m=t.bevelThickness!==void 0?t.bevelThickness:.2,v=t.bevelSize!==void 0?t.bevelSize:m-.1,x=t.bevelOffset!==void 0?t.bevelOffset:0,_=t.bevelSegments!==void 0?t.bevelSegments:3;const g=t.extrudePath,S=t.UVGenerator!==void 0?t.UVGenerator:_$;let b,M=!1,C,A,R,O;g&&(b=g.getSpacedPoints(d),M=!0,p=!1,C=g.computeFrenetFrames(d,!1),A=new z,R=new z,O=new z),p||(_=0,m=0,v=0,x=0);const P=a.extractPoints(h);let I=P.shape;const H=P.holes;if(!As.isClockWise(I)){I=I.reverse();for(let j=0,Se=H.length;j<Se;j++){const fe=H[j];As.isClockWise(fe)&&(H[j]=fe.reverse())}}const se=As.triangulateShape(I,H),W=I;for(let j=0,Se=H.length;j<Se;j++){const fe=H[j];I=I.concat(fe)}function $(j,Se,fe){return Se||console.error("THREE.ExtrudeGeometry: vec does not exist"),j.clone().addScaledVector(Se,fe)}const Z=I.length,re=se.length;function F(j,Se,fe){let Te,de,$e;const Ne=j.x-Se.x,k=j.y-Se.y,N=fe.x-j.x,te=fe.y-j.y,be=Ne*Ne+k*k,ve=Ne*te-k*N;if(Math.abs(ve)>Number.EPSILON){const _e=Math.sqrt(be),Ye=Math.sqrt(N*N+te*te),Ce=Se.x-k/_e,Ue=Se.y+Ne/_e,it=fe.x-te/Ye,mt=fe.y+N/Ye,xe=((it-Ce)*te-(mt-Ue)*N)/(Ne*te-k*N);Te=Ce+Ne*xe-j.x,de=Ue+k*xe-j.y;const Lt=Te*Te+de*de;if(Lt<=2)return new ye(Te,de);$e=Math.sqrt(Lt/2)}else{let _e=!1;Ne>Number.EPSILON?N>Number.EPSILON&&(_e=!0):Ne<-Number.EPSILON?N<-Number.EPSILON&&(_e=!0):Math.sign(k)===Math.sign(te)&&(_e=!0),_e?(Te=-k,de=Ne,$e=Math.sqrt(be)):(Te=Ne,de=k,$e=Math.sqrt(be/2))}return new ye(Te/$e,de/$e)}const U=[];for(let j=0,Se=W.length,fe=Se-1,Te=j+1;j<Se;j++,fe++,Te++)fe===Se&&(fe=0),Te===Se&&(Te=0),U[j]=F(W[j],W[fe],W[Te]);const G=[];let Y,ee=U.concat();for(let j=0,Se=H.length;j<Se;j++){const fe=H[j];Y=[];for(let Te=0,de=fe.length,$e=de-1,Ne=Te+1;Te<de;Te++,$e++,Ne++)$e===de&&($e=0),Ne===de&&(Ne=0),Y[Te]=F(fe[Te],fe[$e],fe[Ne]);G.push(Y),ee=ee.concat(Y)}for(let j=0;j<_;j++){const Se=j/_,fe=m*Math.cos(Se*Math.PI/2),Te=v*Math.sin(Se*Math.PI/2)+x;for(let de=0,$e=W.length;de<$e;de++){const Ne=$(W[de],U[de],Te);ge(Ne.x,Ne.y,-fe)}for(let de=0,$e=H.length;de<$e;de++){const Ne=H[de];Y=G[de];for(let k=0,N=Ne.length;k<N;k++){const te=$(Ne[k],Y[k],Te);ge(te.x,te.y,-fe)}}}const K=v+x;for(let j=0;j<Z;j++){const Se=p?$(I[j],ee[j],K):I[j];M?(R.copy(C.normals[0]).multiplyScalar(Se.x),A.copy(C.binormals[0]).multiplyScalar(Se.y),O.copy(b[0]).add(R).add(A),ge(O.x,O.y,O.z)):ge(Se.x,Se.y,0)}for(let j=1;j<=d;j++)for(let Se=0;Se<Z;Se++){const fe=p?$(I[Se],ee[Se],K):I[Se];M?(R.copy(C.normals[j]).multiplyScalar(fe.x),A.copy(C.binormals[j]).multiplyScalar(fe.y),O.copy(b[j]).add(R).add(A),ge(O.x,O.y,O.z)):ge(fe.x,fe.y,f/d*j)}for(let j=_-1;j>=0;j--){const Se=j/_,fe=m*Math.cos(Se*Math.PI/2),Te=v*Math.sin(Se*Math.PI/2)+x;for(let de=0,$e=W.length;de<$e;de++){const Ne=$(W[de],U[de],Te);ge(Ne.x,Ne.y,f+fe)}for(let de=0,$e=H.length;de<$e;de++){const Ne=H[de];Y=G[de];for(let k=0,N=Ne.length;k<N;k++){const te=$(Ne[k],Y[k],Te);M?ge(te.x,te.y+b[d-1].y,b[d-1].x+fe):ge(te.x,te.y,f+fe)}}}ie(),me();function ie(){const j=i.length/3;if(p){let Se=0,fe=Z*Se;for(let Te=0;Te<re;Te++){const de=se[Te];tt(de[2]+fe,de[1]+fe,de[0]+fe)}Se=d+_*2,fe=Z*Se;for(let Te=0;Te<re;Te++){const de=se[Te];tt(de[0]+fe,de[1]+fe,de[2]+fe)}}else{for(let Se=0;Se<re;Se++){const fe=se[Se];tt(fe[2],fe[1],fe[0])}for(let Se=0;Se<re;Se++){const fe=se[Se];tt(fe[0]+Z*d,fe[1]+Z*d,fe[2]+Z*d)}}r.addGroup(j,i.length/3-j,0)}function me(){const j=i.length/3;let Se=0;Ee(W,Se),Se+=W.length;for(let fe=0,Te=H.length;fe<Te;fe++){const de=H[fe];Ee(de,Se),Se+=de.length}r.addGroup(j,i.length/3-j,1)}function Ee(j,Se){let fe=j.length;for(;--fe>=0;){const Te=fe;let de=fe-1;de<0&&(de=j.length-1);for(let $e=0,Ne=d+_*2;$e<Ne;$e++){const k=Z*$e,N=Z*($e+1),te=Se+Te+k,be=Se+de+k,ve=Se+de+N,_e=Se+Te+N;nt(te,be,ve,_e)}}}function ge(j,Se,fe){l.push(j),l.push(Se),l.push(fe)}function tt(j,Se,fe){Be(j),Be(Se),Be(fe);const Te=i.length/3,de=S.generateTopUV(r,i,Te-3,Te-2,Te-1);Xe(de[0]),Xe(de[1]),Xe(de[2])}function nt(j,Se,fe,Te){Be(j),Be(Se),Be(Te),Be(Se),Be(fe),Be(Te);const de=i.length/3,$e=S.generateSideWallUV(r,i,de-6,de-3,de-2,de-1);Xe($e[0]),Xe($e[1]),Xe($e[3]),Xe($e[1]),Xe($e[2]),Xe($e[3])}function Be(j){i.push(l[j*3+0]),i.push(l[j*3+1]),i.push(l[j*3+2])}function Xe(j){s.push(j.x),s.push(j.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,r=this.parameters.options;return x$(t,r,e)}static fromJSON(e,t){const r=[];for(let s=0,o=e.shapes.length;s<o;s++){const a=t[e.shapes[s]];r.push(a)}const i=e.options.extrudePath;return i!==void 0&&(e.options.extrudePath=new F0[i.type]().fromJSON(i)),new Cg(r,e.options)}}const _$={generateTopUV:function(n,e,t,r,i){const s=e[t*3],o=e[t*3+1],a=e[r*3],l=e[r*3+1],h=e[i*3],d=e[i*3+1];return[new ye(s,o),new ye(a,l),new ye(h,d)]},generateSideWallUV:function(n,e,t,r,i,s){const o=e[t*3],a=e[t*3+1],l=e[t*3+2],h=e[r*3],d=e[r*3+1],f=e[r*3+2],p=e[i*3],m=e[i*3+1],v=e[i*3+2],x=e[s*3],_=e[s*3+1],g=e[s*3+2];return Math.abs(a-d)<Math.abs(o-h)?[new ye(o,1-l),new ye(h,1-f),new ye(p,1-v),new ye(x,1-g)]:[new ye(a,1-l),new ye(d,1-f),new ye(m,1-v),new ye(_,1-g)]}};function x$(n,e,t){if(t.shapes=[],Array.isArray(n))for(let r=0,i=n.length;r<i;r++){const s=n[r];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class Pg extends wa{constructor(e=1,t=0){const r=(1+Math.sqrt(5))/2,i=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],s=[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(i,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Pg(e.radius,e.detail)}}class lf extends wa{constructor(e=1,t=0){const r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[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(r,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new lf(e.radius,e.detail)}}class Rg extends dt{constructor(e=.5,t=1,r=32,i=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:i,thetaStart:s,thetaLength:o},r=Math.max(3,r),i=Math.max(1,i);const a=[],l=[],h=[],d=[];let f=e;const p=(t-e)/i,m=new z,v=new ye;for(let x=0;x<=i;x++){for(let _=0;_<=r;_++){const g=s+_/r*o;m.x=f*Math.cos(g),m.y=f*Math.sin(g),l.push(m.x,m.y,m.z),h.push(0,0,1),v.x=(m.x/t+1)/2,v.y=(m.y/t+1)/2,d.push(v.x,v.y)}f+=p}for(let x=0;x<i;x++){const _=x*(r+1);for(let g=0;g<r;g++){const S=g+_,b=S,M=S+r+1,C=S+r+2,A=S+1;a.push(b,M,A),a.push(M,C,A)}}this.setIndex(a),this.setAttribute("position",new qe(l,3)),this.setAttribute("normal",new qe(h,3)),this.setAttribute("uv",new qe(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Rg(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Ig extends dt{constructor(e=new ml([new ye(0,.5),new ye(-.5,-.5),new ye(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const r=[],i=[],s=[],o=[];let a=0,l=0;if(Array.isArray(e)===!1)h(e);else for(let d=0;d<e.length;d++)h(e[d]),this.addGroup(a,l,d),a+=l,l=0;this.setIndex(r),this.setAttribute("position",new qe(i,3)),this.setAttribute("normal",new qe(s,3)),this.setAttribute("uv",new qe(o,2));function h(d){const f=i.length/3,p=d.extractPoints(t);let m=p.shape;const v=p.holes;As.isClockWise(m)===!1&&(m=m.reverse());for(let _=0,g=v.length;_<g;_++){const S=v[_];As.isClockWise(S)===!0&&(v[_]=S.reverse())}const x=As.triangulateShape(m,v);for(let _=0,g=v.length;_<g;_++){const S=v[_];m=m.concat(S)}for(let _=0,g=m.length;_<g;_++){const S=m[_];i.push(S.x,S.y,0),s.push(0,0,1),o.push(S.x,S.y)}for(let _=0,g=x.length;_<g;_++){const S=x[_],b=S[0]+f,M=S[1]+f,C=S[2]+f;r.push(b,M,C),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return S$(t,e)}static fromJSON(e,t){const r=[];for(let i=0,s=e.shapes.length;i<s;i++){const o=t[e.shapes[i]];r.push(o)}return new Ig(r,e.curveSegments)}}function S$(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const i=n[t];e.shapes.push(i.uuid)}else e.shapes.push(n.uuid);return e}class cf extends dt{constructor(e=1,t=32,r=16,i=0,s=Math.PI*2,o=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:i,phiLength:s,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),r=Math.max(2,Math.floor(r));const l=Math.min(o+a,Math.PI);let h=0;const d=[],f=new z,p=new z,m=[],v=[],x=[],_=[];for(let g=0;g<=r;g++){const S=[],b=g/r;let M=0;g===0&&o===0?M=.5/t:g===r&&l===Math.PI&&(M=-.5/t);for(let C=0;C<=t;C++){const A=C/t;f.x=-e*Math.cos(i+A*s)*Math.sin(o+b*a),f.y=e*Math.cos(o+b*a),f.z=e*Math.sin(i+A*s)*Math.sin(o+b*a),v.push(f.x,f.y,f.z),p.copy(f).normalize(),x.push(p.x,p.y,p.z),_.push(A+M,1-b),S.push(h++)}d.push(S)}for(let g=0;g<r;g++)for(let S=0;S<t;S++){const b=d[g][S+1],M=d[g][S],C=d[g+1][S],A=d[g+1][S+1];(g!==0||o>0)&&m.push(b,M,A),(g!==r-1||l<Math.PI)&&m.push(M,C,A)}this.setIndex(m),this.setAttribute("position",new qe(v,3)),this.setAttribute("normal",new qe(x,3)),this.setAttribute("uv",new qe(_,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new cf(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Lg extends wa{constructor(e=1,t=0){const r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];super(r,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Lg(e.radius,e.detail)}}class Fg extends dt{constructor(e=1,t=.4,r=12,i=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:i,arc:s},r=Math.floor(r),i=Math.floor(i);const o=[],a=[],l=[],h=[],d=new z,f=new z,p=new z;for(let m=0;m<=r;m++)for(let v=0;v<=i;v++){const x=v/i*s,_=m/r*Math.PI*2;f.x=(e+t*Math.cos(_))*Math.cos(x),f.y=(e+t*Math.cos(_))*Math.sin(x),f.z=t*Math.sin(_),a.push(f.x,f.y,f.z),d.x=e*Math.cos(x),d.y=e*Math.sin(x),p.subVectors(f,d).normalize(),l.push(p.x,p.y,p.z),h.push(v/i),h.push(m/r)}for(let m=1;m<=r;m++)for(let v=1;v<=i;v++){const x=(i+1)*m+v-1,_=(i+1)*(m-1)+v-1,g=(i+1)*(m-1)+v,S=(i+1)*m+v;o.push(x,_,S),o.push(_,g,S)}this.setIndex(o),this.setAttribute("position",new qe(a,3)),this.setAttribute("normal",new qe(l,3)),this.setAttribute("uv",new qe(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Fg(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Ng extends dt{constructor(e=1,t=.4,r=64,i=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:i,p:s,q:o},r=Math.floor(r),i=Math.floor(i);const a=[],l=[],h=[],d=[],f=new z,p=new z,m=new z,v=new z,x=new z,_=new z,g=new z;for(let b=0;b<=r;++b){const M=b/r*s*Math.PI*2;S(M,s,o,e,m),S(M+.01,s,o,e,v),_.subVectors(v,m),g.addVectors(v,m),x.crossVectors(_,g),g.crossVectors(x,_),x.normalize(),g.normalize();for(let C=0;C<=i;++C){const A=C/i*Math.PI*2,R=-t*Math.cos(A),O=t*Math.sin(A);f.x=m.x+(R*g.x+O*x.x),f.y=m.y+(R*g.y+O*x.y),f.z=m.z+(R*g.z+O*x.z),l.push(f.x,f.y,f.z),p.subVectors(f,m).normalize(),h.push(p.x,p.y,p.z),d.push(b/r),d.push(C/i)}}for(let b=1;b<=r;b++)for(let M=1;M<=i;M++){const C=(i+1)*(b-1)+(M-1),A=(i+1)*b+(M-1),R=(i+1)*b+M,O=(i+1)*(b-1)+M;a.push(C,A,O),a.push(A,R,O)}this.setIndex(a),this.setAttribute("position",new qe(l,3)),this.setAttribute("normal",new qe(h,3)),this.setAttribute("uv",new qe(d,2));function S(b,M,C,A,R){const O=Math.cos(b),P=Math.sin(b),I=C/M*b,H=Math.cos(I);R.x=A*(2+H)*.5*O,R.y=A*(2+H)*P*.5,R.z=A*Math.sin(I)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ng(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Dg extends dt{constructor(e=new x1(new z(-1,-1,0),new z(-1,1,0),new z(1,1,0)),t=64,r=1,i=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:i,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new z,l=new z,h=new ye;let d=new z;const f=[],p=[],m=[],v=[];x(),this.setIndex(v),this.setAttribute("position",new qe(f,3)),this.setAttribute("normal",new qe(p,3)),this.setAttribute("uv",new qe(m,2));function x(){for(let b=0;b<t;b++)_(b);_(s===!1?t:0),S(),g()}function _(b){d=e.getPointAt(b/t,d);const M=o.normals[b],C=o.binormals[b];for(let A=0;A<=i;A++){const R=A/i*Math.PI*2,O=Math.sin(R),P=-Math.cos(R);l.x=P*M.x+O*C.x,l.y=P*M.y+O*C.y,l.z=P*M.z+O*C.z,l.normalize(),p.push(l.x,l.y,l.z),a.x=d.x+r*l.x,a.y=d.y+r*l.y,a.z=d.z+r*l.z,f.push(a.x,a.y,a.z)}}function g(){for(let b=1;b<=t;b++)for(let M=1;M<=i;M++){const C=(i+1)*(b-1)+(M-1),A=(i+1)*b+(M-1),R=(i+1)*b+M,O=(i+1)*(b-1)+M;v.push(C,A,O),v.push(A,R,O)}}function S(){for(let b=0;b<=t;b++)for(let M=0;M<=i;M++)h.x=b/t,h.y=M/i,m.push(h.x,h.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 Dg(new F0[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class b1 extends dt{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],r=new Set,i=new z,s=new z;if(e.index!==null){const o=e.attributes.position,a=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:a.count,materialIndex:0}]);for(let h=0,d=l.length;h<d;++h){const f=l[h],p=f.start,m=f.count;for(let v=p,x=p+m;v<x;v+=3)for(let _=0;_<3;_++){const g=a.getX(v+_),S=a.getX(v+(_+1)%3);i.fromBufferAttribute(o,g),s.fromBufferAttribute(o,S),xE(i,s,r)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}}else{const o=e.attributes.position;for(let a=0,l=o.count/3;a<l;a++)for(let h=0;h<3;h++){const d=3*a+h,f=3*a+(h+1)%3;i.fromBufferAttribute(o,d),s.fromBufferAttribute(o,f),xE(i,s,r)===!0&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new qe(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function xE(n,e,t){const r=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(r)===!0||t.has(i)===!0?!1:(t.add(r),t.add(i),!0)}var SE=Object.freeze({__proto__:null,BoxGeometry:Pl,CapsuleGeometry:wg,CircleGeometry:Tg,ConeGeometry:Mg,CylinderGeometry:Ou,DodecahedronGeometry:Eg,EdgesGeometry:JI,ExtrudeGeometry:Cg,IcosahedronGeometry:Pg,LatheGeometry:af,OctahedronGeometry:lf,PlaneGeometry:Nu,PolyhedronGeometry:wa,RingGeometry:Rg,ShapeGeometry:Ig,SphereGeometry:cf,TetrahedronGeometry:Lg,TorusGeometry:Fg,TorusKnotGeometry:Ng,TubeGeometry:Dg,WireframeGeometry:b1});class rL extends yr{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new We(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 iL extends Rs{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class w1 extends yr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new We(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 We(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,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.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 sL extends w1{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 ye(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return vn(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new We(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 We(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new We(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=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 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.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 oL extends yr{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new We(16777215),this.specular=new We(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new We(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Jd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class aL extends yr{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new We(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new We(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new ye(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 lL extends yr{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new ye(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 cL extends yr{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new We(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new We(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Jd,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.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 uL extends yr{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new We(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new ye(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 hL extends In{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 tl(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function dL(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function fL(n){function e(i,s){return n[i]-n[s]}const t=n.length,r=new Array(t);for(let i=0;i!==t;++i)r[i]=i;return r.sort(e),r}function bx(n,e,t){const r=n.length,i=new n.constructor(r);for(let s=0,o=0;o!==r;++s){const a=t[s]*e;for(let l=0;l!==e;++l)i[o++]=n[a+l]}return i}function T1(n,e,t,r){let i=1,s=n[0];for(;s!==void 0&&s[r]===void 0;)s=n[i++];if(s===void 0)return;let o=s[r];if(o!==void 0)if(Array.isArray(o))do o=s[r],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[r],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[i++];while(s!==void 0);else do o=s[r],o!==void 0&&(e.push(s.time),t.push(o)),s=n[i++];while(s!==void 0)}function b$(n,e,t,r,i=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l<s.tracks.length;++l){const h=s.tracks[l],d=h.getValueSize(),f=[],p=[];for(let m=0;m<h.times.length;++m){const v=h.times[m]*i;if(!(v<t||v>=r)){f.push(h.times[m]);for(let x=0;x<d;++x)p.push(h.values[m*d+x])}}f.length!==0&&(h.times=tl(f,h.times.constructor),h.values=tl(p,h.values.constructor),o.push(h))}s.tracks=o;let a=1/0;for(let l=0;l<s.tracks.length;++l)a>s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*a);return s.resetDuration(),s}function w$(n,e=0,t=n,r=30){r<=0&&(r=30);const i=t.tracks.length,s=e/r;for(let o=0;o<i;++o){const a=t.tracks[o],l=a.ValueTypeName;if(l==="bool"||l==="string")continue;const h=n.tracks.find(function(g){return g.name===a.name&&g.ValueTypeName===l});if(h===void 0)continue;let d=0;const f=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=f/3);let p=0;const m=h.getValueSize();h.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=m/3);const v=a.times.length-1;let x;if(s<=a.times[0]){const g=d,S=f-d;x=a.values.slice(g,S)}else if(s>=a.times[v]){const g=v*f+d,S=g+f-d;x=a.values.slice(g,S)}else{const g=a.createInterpolant(),S=d,b=f-d;g.evaluate(s),x=g.resultBuffer.slice(S,b)}l==="quaternion"&&new Vr().fromArray(x).normalize().conjugate().toArray(x);const _=h.times.length;for(let g=0;g<_;++g){const S=g*m+p;if(l==="quaternion")Vr.multiplyQuaternionsFlat(h.values,S,x,0,h.values,S);else{const b=m-p*2;for(let M=0;M<b;++M)h.values[S+M]-=x[M]}}}return n.blendMode=JS,n}const T$={convertArray:tl,isTypedArray:dL,getKeyframeOrder:fL,sortedArray:bx,flattenJSON:T1,subclip:b$,makeClipAdditive:w$};class uf{constructor(e,t,r,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(r),this.sampleValues=t,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let r=this._cachedIndex,i=t[r],s=t[r-1];e:{t:{let o;n:{r:if(!(e<i)){for(let a=r+2;;){if(i===void 0){if(e<s)break r;return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===a)break;if(s=i,i=t[++r],e<i)break t}o=t.length;break n}if(!(e>=s)){const a=t[1];e<a&&(r=2,s=a);for(let l=r-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===l)break;if(i=s,s=t[--r-1],e>=s)break t}o=r,r=0;break n}break e}for(;r<o;){const a=r+o>>>1;e<t[a]?o=a:r=a+1}if(i=t[r],s=t[r-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return r=t.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,s,i)}return this.interpolate_(r,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,r=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=r[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class pL extends uf{constructor(e,t,r,i){super(e,t,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Qa,endingEnd:Qa}}intervalChanged_(e,t,r){const i=this.parameterPositions;let s=e-2,o=e+1,a=i[s],l=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case Ja:s=e,a=2*t-r;break;case Ad:s=i.length-2,a=t+i[s]-i[s+1];break;default:s=e,a=r}if(l===void 0)switch(this.getSettings_().endingEnd){case Ja:o=e,l=2*r-t;break;case Ad:o=1,l=r+i[1]-i[0];break;default:o=e-1,l=t}const h=(r-t)*.5,d=this.valueSize;this._weightPrev=h/(t-a),this._weightNext=h/(l-r),this._offsetPrev=s*d,this._offsetNext=o*d}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,h=l-a,d=this._offsetPrev,f=this._offsetNext,p=this._weightPrev,m=this._weightNext,v=(r-t)/(i-t),x=v*v,_=x*v,g=-p*_+2*p*x-p*v,S=(1+p)*_+(-1.5-2*p)*x+(-.5+p)*v+1,b=(-1-m)*_+(1.5+m)*x+.5*v,M=m*_-m*x;for(let C=0;C!==a;++C)s[C]=g*o[d+C]+S*o[h+C]+b*o[l+C]+M*o[f+C];return s}}class M1 extends uf{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=e*a,h=l-a,d=(r-t)/(i-t),f=1-d;for(let p=0;p!==a;++p)s[p]=o[h+p]*f+o[l+p]*d;return s}}class mL extends uf{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class is{constructor(e,t,r,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=tl(t,this.TimeBufferType),this.values=tl(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let r;if(t.toJSON!==this.toJSON)r=t.toJSON(e);else{r={name:e.name,times:tl(e.times,Array),values:tl(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(r.interpolation=i)}return r.type=e.ValueTypeName,r}InterpolantFactoryMethodDiscrete(e){return new mL(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new M1(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new pL(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Md:t=this.InterpolantFactoryMethodDiscrete;break;case Ed:t=this.InterpolantFactoryMethodLinear;break;case qm:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const r="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(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Md;case this.InterpolantFactoryMethodLinear:return Ed;case this.InterpolantFactoryMethodSmooth:return qm}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let r=0,i=t.length;r!==i;++r)t[r]*=e}return this}trim(e,t){const r=this.times,i=r.length;let s=0,o=i-1;for(;s!==i&&r[s]<e;)++s;for(;o!==-1&&r[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=r.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,s=r.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&dL(i))for(let a=0,l=i.length;a!==l;++a){const h=i[a];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,h),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===qm,s=e.length-1;let o=1;for(let a=1;a<s;++a){let l=!1;const h=e[a],d=e[a+1];if(h!==d&&(a!==1||h!==e[0]))if(i)l=!0;else{const f=a*r,p=f-r,m=f+r;for(let v=0;v!==r;++v){const x=t[f+v];if(x!==t[p+v]||x!==t[m+v]){l=!0;break}}}if(l){if(a!==o){e[o]=e[a];const f=a*r,p=o*r;for(let m=0;m!==r;++m)t[p+m]=t[f+m]}++o}}if(s>0){e[o]=e[s];for(let a=s*r,l=o*r,h=0;h!==r;++h)t[l+h]=t[a+h];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*r)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),r=this.constructor,i=new r(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}is.prototype.TimeBufferType=Float32Array;is.prototype.ValueBufferType=Float32Array;is.prototype.DefaultInterpolation=Ed;class Rl extends is{}Rl.prototype.ValueTypeName="bool";Rl.prototype.ValueBufferType=Array;Rl.prototype.DefaultInterpolation=Md;Rl.prototype.InterpolantFactoryMethodLinear=void 0;Rl.prototype.InterpolantFactoryMethodSmooth=void 0;class E1 extends is{}E1.prototype.ValueTypeName="color";class Ud extends is{}Ud.prototype.ValueTypeName="number";class gL extends uf{constructor(e,t,r,i){super(e,t,r,i)}interpolate_(e,t,r,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(r-t)/(i-t);let h=e*a;for(let d=h+a;h!==d;h+=4)Vr.slerpFlat(s,0,o,h-a,o,h,l);return s}}class Uu extends is{InterpolantFactoryMethodLinear(e){return new gL(this.times,this.values,this.getValueSize(),e)}}Uu.prototype.ValueTypeName="quaternion";Uu.prototype.DefaultInterpolation=Ed;Uu.prototype.InterpolantFactoryMethodSmooth=void 0;class Il extends is{}Il.prototype.ValueTypeName="string";Il.prototype.ValueBufferType=Array;Il.prototype.DefaultInterpolation=Md;Il.prototype.InterpolantFactoryMethodLinear=void 0;Il.prototype.InterpolantFactoryMethodSmooth=void 0;class kd extends is{}kd.prototype.ValueTypeName="vector";class Bd{constructor(e,t=-1,r,i=fg){this.name=e,this.tracks=r,this.duration=t,this.blendMode=i,this.uuid=oi(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],r=e.tracks,i=1/(e.fps||1);for(let o=0,a=r.length;o!==a;++o)t.push(E$(r[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=r.length;s!==o;++s)t.push(is.toJSON(r[s]));return i}static CreateFromMorphTargetSequence(e,t,r,i){const s=t.length,o=[];for(let a=0;a<s;a++){let l=[],h=[];l.push((a+s-1)%s,a,(a+1)%s),h.push(0,1,0);const d=fL(l);l=bx(l,1,d),h=bx(h,1,d),!i&&l[0]===0&&(l.push(s),h.push(h[0])),o.push(new Ud(".morphTargetInfluences["+t[a].name+"]",l,h).scale(1/r))}return new this(e,-1,o)}static findByName(e,t){let r=e;if(!Array.isArray(e)){const i=e;r=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<r.length;i++)if(r[i].name===t)return r[i];return null}static CreateClipsFromMorphTargetSequences(e,t,r){const i={},s=/^([\w-]*?)([\d]+)$/;for(let a=0,l=e.length;a<l;a++){const h=e[a],d=h.name.match(s);if(d&&d.length>1){const f=d[1];let p=i[f];p||(i[f]=p=[]),p.push(h)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,r));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(f,p,m,v,x){if(m.length!==0){const _=[],g=[];T1(m,_,g,v),_.length!==0&&x.push(new f(p,_,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const h=e.hierarchy||[];for(let f=0;f<h.length;f++){const p=h[f].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const m={};let v;for(v=0;v<p.length;v++)if(p[v].morphTargets)for(let x=0;x<p[v].morphTargets.length;x++)m[p[v].morphTargets[x]]=-1;for(const x in m){const _=[],g=[];for(let S=0;S!==p[v].morphTargets.length;++S){const b=p[v];_.push(b.time),g.push(b.morphTarget===x?1:0)}i.push(new Ud(".morphTargetInfluence["+x+"]",_,g))}l=m.length*o}else{const m=".bones["+t[f].name+"]";r(kd,m+".position",p,"pos",i),r(Uu,m+".quaternion",p,"rot",i),r(kd,m+".scale",p,"scl",i)}}return i.length===0?null:new this(s,l,i,a)}resetDuration(){const e=this.tracks;let t=0;for(let r=0,i=e.length;r!==i;++r){const s=this.tracks[r];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,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 t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function M$(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ud;case"vector":case"vector2":case"vector3":case"vector4":return kd;case"color":return E1;case"quaternion":return Uu;case"bool":case"boolean":return Rl;case"string":return Il}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function E$(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=M$(n.type);if(n.times===void 0){const t=[],r=[];T1(n.keys,t,r,"value"),n.times=t,n.values=r}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const eo={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class A1{constructor(e,t,r){const i=this;let s=!1,o=0,a=0,l;const h=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(d){a++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,a),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return l?l(d):d},this.setURLModifier=function(d){return l=d,this},this.addHandler=function(d,f){return h.push(d,f),this},this.removeHandler=function(d){const f=h.indexOf(d);return f!==-1&&h.splice(f,2),this},this.getHandler=function(d){for(let f=0,p=h.length;f<p;f+=2){const m=h[f],v=h[f+1];if(m.global&&(m.lastIndex=0),m.test(d))return v}return null}}}const yL=new A1;class Xr{constructor(e){this.manager=e!==void 0?e:yL,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const r=this;return new Promise(function(i,s){r.load(e,i,t,s)})}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}}Xr.DEFAULT_MATERIAL_NAME="__DEFAULT";const js={};class A$ extends Error{constructor(e,t){super(e),this.response=t}}class fo extends Xr{constructor(e){super(e)}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=eo.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(js[e]!==void 0){js[e].push({onLoad:t,onProgress:r,onError:i});return}js[e]=[],js[e].push({onLoad:t,onProgress:r,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const d=js[e],f=h.body.getReader(),p=h.headers.get("Content-Length")||h.headers.get("X-File-Size"),m=p?parseInt(p):0,v=m!==0;let x=0;const _=new ReadableStream({start(g){S();function S(){f.read().then(({done:b,value:M})=>{if(b)g.close();else{x+=M.byteLength;const C=new ProgressEvent("progress",{lengthComputable:v,loaded:x,total:m});for(let A=0,R=d.length;A<R;A++){const O=d[A];O.onProgress&&O.onProgress(C)}g.enqueue(M),S()}})}}});return new Response(_)}else throw new A$(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(l){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return h.json();default:if(a===void 0)return h.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),p=f&&f[1]?f[1].toLowerCase():void 0,m=new TextDecoder(p);return h.arrayBuffer().then(v=>m.decode(v))}}}).then(h=>{eo.add(e,h);const d=js[e];delete js[e];for(let f=0,p=d.length;f<p;f++){const m=d[f];m.onLoad&&m.onLoad(h)}}).catch(h=>{const d=js[e];if(d===void 0)throw this.manager.itemError(e),h;delete js[e];for(let f=0,p=d.length;f<p;f++){const m=d[f];m.onError&&m.onError(h)}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}}class C$ extends Xr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new fo(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const t=[];for(let r=0;r<e.length;r++){const i=Bd.parse(e[r]);t.push(i)}return t}}class P$ extends Xr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=[],a=new Sg,l=new fo(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(s.withCredentials);let h=0;function d(f){l.load(e[f],function(p){const m=s.parse(p,!0);o[f]={width:m.width,height:m.height,format:m.format,mipmaps:m.mipmaps},h+=1,h===6&&(m.mipmapCount===1&&(a.minFilter=Tn),a.image=o,a.format=m.format,a.needsUpdate=!0,t&&t(a))},r,i)}if(Array.isArray(e))for(let f=0,p=e.length;f<p;++f)d(f);else l.load(e,function(f){const p=s.parse(f,!0);if(p.isCubemap){const m=p.mipmaps.length/p.mipmapCount;for(let v=0;v<m;v++){o[v]={mipmaps:[]};for(let x=0;x<p.mipmapCount;x++)o[v].mipmaps.push(p.mipmaps[v*p.mipmapCount+x]),o[v].format=p.format,o[v].width=p.width,o[v].height=p.height}a.image=o}else a.image.width=p.width,a.image.height=p.height,a.mipmaps=p.mipmaps;p.mipmapCount===1&&(a.minFilter=Tn),a.format=p.format,a.needsUpdate=!0,t&&t(a)},r,i);return a}}class zd extends Xr{constructor(e){super(e)}load(e,t,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=eo.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a=Ld("img");function l(){d(),eo.add(e,this),t&&t(this),s.manager.itemEnd(e)}function h(f){d(),i&&i(f),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){a.removeEventListener("load",l,!1),a.removeEventListener("error",h,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",h,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class R$ extends Xr{constructor(e){super(e)}load(e,t,r,i){const s=new rf;s.colorSpace=Nn;const o=new zd(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(h){o.load(e[h],function(d){s.images[h]=d,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,i)}for(let h=0;h<e.length;++h)l(h);return s}}class I$ extends Xr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new pl,a=new fo(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,function(l){let h;try{h=s.parse(l)}catch(d){if(i!==void 0)i(d);else{console.error(d);return}}h.image!==void 0?o.image=h.image:h.data!==void 0&&(o.image.width=h.width,o.image.height=h.height,o.image.data=h.data),o.wrapS=h.wrapS!==void 0?h.wrapS:pr,o.wrapT=h.wrapT!==void 0?h.wrapT:pr,o.magFilter=h.magFilter!==void 0?h.magFilter:Tn,o.minFilter=h.minFilter!==void 0?h.minFilter:Tn,o.anisotropy=h.anisotropy!==void 0?h.anisotropy:1,h.colorSpace!==void 0?o.colorSpace=h.colorSpace:h.encoding!==void 0&&(o.encoding=h.encoding),h.flipY!==void 0&&(o.flipY=h.flipY),h.format!==void 0&&(o.format=h.format),h.type!==void 0&&(o.type=h.type),h.mipmaps!==void 0&&(o.mipmaps=h.mipmaps,o.minFilter=ga),h.mipmapCount===1&&(o.minFilter=Tn),h.generateMipmaps!==void 0&&(o.generateMipmaps=h.generateMipmaps),o.needsUpdate=!0,t&&t(o,h)},r,i),o}}class L$ extends Xr{constructor(e){super(e)}load(e,t,r,i){const s=new Mn,o=new zd(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){s.image=a,s.needsUpdate=!0,t!==void 0&&t(s)},r,i),s}}class Ta extends Wt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new We(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class vL extends Ta{constructor(e,t,r){super(e,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Wt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new We(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const a_=new ft,bE=new z,wE=new z;class C1{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ye(512,512),this.map=null,this.mapPass=null,this.matrix=new ft,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new sf,this._frameExtents=new ye(1,1),this._viewportCount=1,this._viewports=[new Vt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,r=this.matrix;bE.setFromMatrixPosition(e.matrixWorld),t.position.copy(bE),wE.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(wE),t.updateMatrixWorld(),a_.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(a_),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(a_)}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.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return 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 F$ extends C1{constructor(){super(new Yn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,r=_u*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(r!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=r,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class _L extends Ta{constructor(e,t,r=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Wt.DEFAULT_UP),this.updateMatrix(),this.target=new Wt,this.distance=r,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new F$}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),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 TE=new ft,Eh=new z,l_=new z;class N$ extends C1{constructor(){super(new Yn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new ye(4,2),this._viewportCount=6,this._viewports=[new Vt(2,1,1,1),new Vt(0,1,1,1),new Vt(3,1,1,1),new Vt(1,1,1,1),new Vt(3,0,1,1),new Vt(1,0,1,1)],this._cubeDirections=[new z(1,0,0),new z(-1,0,0),new z(0,0,1),new z(0,0,-1),new z(0,1,0),new z(0,-1,0)],this._cubeUps=[new z(0,1,0),new z(0,1,0),new z(0,1,0),new z(0,1,0),new z(0,0,1),new z(0,0,-1)]}updateMatrices(e,t=0){const r=this.camera,i=this.matrix,s=e.distance||r.far;s!==r.far&&(r.far=s,r.updateProjectionMatrix()),Eh.setFromMatrixPosition(e.matrixWorld),r.position.copy(Eh),l_.copy(r.position),l_.add(this._cubeDirections[t]),r.up.copy(this._cubeUps[t]),r.lookAt(l_),r.updateMatrixWorld(),i.makeTranslation(-Eh.x,-Eh.y,-Eh.z),TE.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(TE)}}class xL extends Ta{constructor(e,t,r=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=i,this.shadow=new N$}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class D$ extends C1{constructor(){super(new of(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class SL extends Ta{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Wt.DEFAULT_UP),this.updateMatrix(),this.target=new Wt,this.shadow=new D$}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class bL extends Ta{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class wL extends Ta{constructor(e,t,r=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=r,this.height=i}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 t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class TL{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new z)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const r=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*i),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*r),t.addScaledVector(o[4],1.092548*(r*i)),t.addScaledVector(o[5],1.092548*(i*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(r*s)),t.addScaledVector(o[8],.546274*(r*r-i*i)),t}getIrradianceAt(e,t){const r=e.x,i=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*i),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*r),t.addScaledVector(o[4],2*.429043*r*i),t.addScaledVector(o[5],2*.429043*i*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*r*s),t.addScaledVector(o[8],.429043*(r*r-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let r=0;r<9;r++)this.coefficients[r].addScaledVector(e.coefficients[r],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let r=0;r<9;r++)this.coefficients[r].lerp(e.coefficients[r],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].fromArray(e,t+i*3);return this}toArray(e=[],t=0){const r=this.coefficients;for(let i=0;i<9;i++)r[i].toArray(e,t+i*3);return e}static getBasisAt(e,t){const r=e.x,i=e.y,s=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*s,t[3]=.488603*r,t[4]=1.092548*r*i,t[5]=1.092548*i*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*r*s,t[8]=.546274*(r*r-i*i)}}class ML extends Ta{constructor(e=new TL,t=1){super(void 0,t),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 t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class Og extends Xr{constructor(e){super(e),this.textures={}}load(e,t,r,i){const s=this,o=new fo(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const t=this.textures;function r(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const i=Og.createMaterialFromType(e.type);if(e.uuid!==void 0&&(i.uuid=e.uuid),e.name!==void 0&&(i.name=e.name),e.color!==void 0&&i.color!==void 0&&i.color.setHex(e.color),e.roughness!==void 0&&(i.roughness=e.roughness),e.metalness!==void 0&&(i.metalness=e.metalness),e.sheen!==void 0&&(i.sheen=e.sheen),e.sheenColor!==void 0&&(i.sheenColor=new We().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(i.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&i.emissive!==void 0&&i.emissive.setHex(e.emissive),e.specular!==void 0&&i.specular!==void 0&&i.specular.setHex(e.specular),e.specularIntensity!==void 0&&(i.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&i.specularColor!==void 0&&i.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(i.shininess=e.shininess),e.clearcoat!==void 0&&(i.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=e.clearcoatRoughness),e.iridescence!==void 0&&(i.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(i.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(i.transmission=e.transmission),e.thickness!==void 0&&(i.thickness=e.thickness),e.attenuationDistance!==void 0&&(i.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&i.attenuationColor!==void 0&&i.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(i.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(i.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(i.fog=e.fog),e.flatShading!==void 0&&(i.flatShading=e.flatShading),e.blending!==void 0&&(i.blending=e.blending),e.combine!==void 0&&(i.combine=e.combine),e.side!==void 0&&(i.side=e.side),e.shadowSide!==void 0&&(i.shadowSide=e.shadowSide),e.opacity!==void 0&&(i.opacity=e.opacity),e.transparent!==void 0&&(i.transparent=e.transparent),e.alphaTest!==void 0&&(i.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(i.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(i.depthFunc=e.depthFunc),e.depthTest!==void 0&&(i.depthTest=e.depthTest),e.depthWrite!==void 0&&(i.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(i.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(i.blendSrc=e.blendSrc),e.blendDst!==void 0&&(i.blendDst=e.blendDst),e.blendEquation!==void 0&&(i.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(i.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(i.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(i.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&i.blendColor!==void 0&&i.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(i.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(i.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(i.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(i.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(i.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(i.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(i.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(i.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(i.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(i.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(i.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(i.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(i.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(i.rotation=e.rotation),e.linewidth!==void 0&&(i.linewidth=e.linewidth),e.dashSize!==void 0&&(i.dashSize=e.dashSize),e.gapSize!==void 0&&(i.gapSize=e.gapSize),e.scale!==void 0&&(i.scale=e.scale),e.polygonOffset!==void 0&&(i.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(i.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(i.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(i.dithering=e.dithering),e.alphaToCoverage!==void 0&&(i.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(i.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(i.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(i.visible=e.visible),e.toneMapped!==void 0&&(i.toneMapped=e.toneMapped),e.userData!==void 0&&(i.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=r(o.value);break;case"c":i.uniforms[s].value=new We().setHex(o.value);break;case"v2":i.uniforms[s].value=new ye().fromArray(o.value);break;case"v3":i.uniforms[s].value=new z().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Vt().fromArray(o.value);break;case"m3":i.uniforms[s].value=new At().fromArray(o.value);break;case"m4":i.uniforms[s].value=new ft().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new ye().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new ye().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:rL,SpriteMaterial:f1,RawShaderMaterial:iL,ShaderMaterial:Rs,PointsMaterial:m1,MeshPhysicalMaterial:sL,MeshStandardMaterial:w1,MeshPhongMaterial:oL,MeshToonMaterial:aL,MeshNormalMaterial:lL,MeshLambertMaterial:cL,MeshDepthMaterial:c1,MeshDistanceMaterial:u1,MeshBasicMaterial:ba,MeshMatcapMaterial:uL,LineDashedMaterial:hL,LineBasicMaterial:In,Material:yr};return new t[e]}}class wx{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let r=0,i=e.length;r<i;r++)t+=String.fromCharCode(e[r]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class EL extends dt{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 AL extends Xr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new fo(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},r,i)}parse(e){const t={},r={};function i(m,v){if(t[v]!==void 0)return t[v];const _=m.interleavedBuffers[v],g=s(m,_.buffer),S=Oc(_.type,g),b=new _g(S,_.stride);return b.uuid=_.uuid,t[v]=b,b}function s(m,v){if(r[v]!==void 0)return r[v];const _=m.arrayBuffers[v],g=new Uint32Array(_).buffer;return r[v]=g,g}const o=e.isInstancedBufferGeometry?new EL:new dt,a=e.data.index;if(a!==void 0){const m=Oc(a.type,a.array);o.setIndex(new Xt(m,1))}const l=e.data.attributes;for(const m in l){const v=l[m];let x;if(v.isInterleavedBufferAttribute){const _=i(e.data,v.data);x=new wl(_,v.itemSize,v.offset,v.normalized)}else{const _=Oc(v.type,v.array),g=v.isInstancedBufferAttribute?Su:Xt;x=new g(_,v.itemSize,v.normalized)}v.name!==void 0&&(x.name=v.name),v.usage!==void 0&&x.setUsage(v.usage),o.setAttribute(m,x)}const h=e.data.morphAttributes;if(h)for(const m in h){const v=h[m],x=[];for(let _=0,g=v.length;_<g;_++){const S=v[_];let b;if(S.isInterleavedBufferAttribute){const M=i(e.data,S.data);b=new wl(M,S.itemSize,S.offset,S.normalized)}else{const M=Oc(S.type,S.array);b=new Xt(M,S.itemSize,S.normalized)}S.name!==void 0&&(b.name=S.name),x.push(b)}o.morphAttributes[m]=x}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const f=e.data.groups||e.data.drawcalls||e.data.offsets;if(f!==void 0)for(let m=0,v=f.length;m!==v;++m){const x=f[m];o.addGroup(x.start,x.count,x.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const m=new z;p.center!==void 0&&m.fromArray(p.center),o.boundingSphere=new mr(m,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class O$ extends Xr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=this.path===""?wx.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const a=new fo(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){let h=null;try{h=JSON.parse(l)}catch(f){i!==void 0&&i(f),console.error("THREE:ObjectLoader: Can't parse "+e+".",f.message);return}const d=h.metadata;if(d===void 0||d.type===void 0||d.type.toLowerCase()==="geometry"){i!==void 0&&i(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(h,t)},r,i)}async loadAsync(e,t){const r=this,i=this.path===""?wx.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;const s=new fo(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),a=JSON.parse(o),l=a.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await r.parseAsync(a)}parse(e,t){const r=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,i),o=this.parseImages(e.images,function(){t!==void 0&&t(h)}),a=this.parseTextures(e.textures,o),l=this.parseMaterials(e.materials,a),h=this.parseObject(e.object,s,l,a,r),d=this.parseSkeletons(e.skeletons,h);if(this.bindSkeletons(h,d),t!==void 0){let f=!1;for(const p in o)if(o[p].data instanceof HTMLImageElement){f=!0;break}f===!1&&t(h)}return h}async parseAsync(e){const t=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,i,a,o,t),h=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,h),l}parseShapes(e){const t={};if(e!==void 0)for(let r=0,i=e.length;r<i;r++){const s=new ml().fromJSON(e[r]);t[s.uuid]=s}return t}parseSkeletons(e,t){const r={},i={};if(t.traverse(function(s){s.isBone&&(i[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=new xg().fromJSON(e[s],i);r[a.uuid]=a}return r}parseGeometries(e,t){const r={};if(e!==void 0){const i=new AL;for(let s=0,o=e.length;s<o;s++){let a;const l=e[s];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(l);break;default:l.type in SE?a=SE[l.type].fromJSON(l,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${l.type}"`)}a.uuid=l.uuid,l.name!==void 0&&(a.name=l.name),l.userData!==void 0&&(a.userData=l.userData),r[l.uuid]=a}}return r}parseMaterials(e,t){const r={},i={};if(e!==void 0){const s=new Og;s.setTextures(t);for(let o=0,a=e.length;o<a;o++){const l=e[o];r[l.uuid]===void 0&&(r[l.uuid]=s.parse(l)),i[l.uuid]=r[l.uuid]}}return i}parseAnimations(e){const t={};if(e!==void 0)for(let r=0;r<e.length;r++){const i=e[r],s=Bd.parse(i);t[s.uuid]=s}return t}parseImages(e,t){const r=this,i={};let s;function o(l){return r.manager.itemStart(l),s.load(l,function(){r.manager.itemEnd(l)},void 0,function(){r.manager.itemError(l),r.manager.itemEnd(l)})}function a(l){if(typeof l=="string"){const h=l,d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h)?h:r.resourcePath+h;return o(d)}else return l.data?{data:Oc(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new A1(t);s=new zd(l),s.setCrossOrigin(this.crossOrigin);for(let h=0,d=e.length;h<d;h++){const f=e[h],p=f.url;if(Array.isArray(p)){const m=[];for(let v=0,x=p.length;v<x;v++){const _=p[v],g=a(_);g!==null&&(g instanceof HTMLImageElement?m.push(g):m.push(new pl(g.data,g.width,g.height)))}i[f.uuid]=new el(m)}else{const m=a(f.url);i[f.uuid]=new el(m)}}}return i}async parseImagesAsync(e){const t=this,r={};let i;async function s(o){if(typeof o=="string"){const a=o,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(a)?a:t.resourcePath+a;return await i.loadAsync(l)}else return o.data?{data:Oc(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){i=new zd(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o<a;o++){const l=e[o],h=l.url;if(Array.isArray(h)){const d=[];for(let f=0,p=h.length;f<p;f++){const m=h[f],v=await s(m);v!==null&&(v instanceof HTMLImageElement?d.push(v):d.push(new pl(v.data,v.width,v.height)))}r[l.uuid]=new el(d)}else{const d=await s(l.url);r[l.uuid]=new el(d)}}}return r}parseTextures(e,t){function r(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const i={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const a=e[s];a.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),t[a.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",a.image);const l=t[a.image],h=l.data;let d;Array.isArray(h)?(d=new rf,h.length===6&&(d.needsUpdate=!0)):(h&&h.data?d=new pl:d=new Mn,h&&(d.needsUpdate=!0)),d.source=l,d.uuid=a.uuid,a.name!==void 0&&(d.name=a.name),a.mapping!==void 0&&(d.mapping=r(a.mapping,U$)),a.channel!==void 0&&(d.channel=a.channel),a.offset!==void 0&&d.offset.fromArray(a.offset),a.repeat!==void 0&&d.repeat.fromArray(a.repeat),a.center!==void 0&&d.center.fromArray(a.center),a.rotation!==void 0&&(d.rotation=a.rotation),a.wrap!==void 0&&(d.wrapS=r(a.wrap[0],ME),d.wrapT=r(a.wrap[1],ME)),a.format!==void 0&&(d.format=a.format),a.internalFormat!==void 0&&(d.internalFormat=a.internalFormat),a.type!==void 0&&(d.type=a.type),a.colorSpace!==void 0&&(d.colorSpace=a.colorSpace),a.encoding!==void 0&&(d.encoding=a.encoding),a.minFilter!==void 0&&(d.minFilter=r(a.minFilter,EE)),a.magFilter!==void 0&&(d.magFilter=r(a.magFilter,EE)),a.anisotropy!==void 0&&(d.anisotropy=a.anisotropy),a.flipY!==void 0&&(d.flipY=a.flipY),a.generateMipmaps!==void 0&&(d.generateMipmaps=a.generateMipmaps),a.premultiplyAlpha!==void 0&&(d.premultiplyAlpha=a.premultiplyAlpha),a.unpackAlignment!==void 0&&(d.unpackAlignment=a.unpackAlignment),a.compareFunction!==void 0&&(d.compareFunction=a.compareFunction),a.userData!==void 0&&(d.userData=a.userData),i[a.uuid]=d}return i}parseObject(e,t,r,i,s){let o;function a(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function l(p){if(p!==void 0){if(Array.isArray(p)){const m=[];for(let v=0,x=p.length;v<x;v++){const _=p[v];r[_]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",_),m.push(r[_])}return m}return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),r[p]}}function h(p){return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),i[p]}let d,f;switch(e.type){case"Scene":o=new d1,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new We(e.background):o.background=h(e.background)),e.environment!==void 0&&(o.environment=h(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new vg(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new yg(e.fog.color,e.fog.density)),e.fog.name!==""&&(o.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(o.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(o.backgroundIntensity=e.backgroundIntensity);break;case"PerspectiveCamera":o=new Yn(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new of(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new bL(e.color,e.intensity);break;case"DirectionalLight":o=new SL(e.color,e.intensity);break;case"PointLight":o=new xL(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new wL(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new _L(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new vL(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new ML().fromJSON(e);break;case"SkinnedMesh":d=a(e.geometry),f=l(e.material),o=new GI(d,f),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":d=a(e.geometry),f=l(e.material),o=new Un(d,f);break;case"InstancedMesh":d=a(e.geometry),f=l(e.material);const p=e.count,m=e.instanceMatrix,v=e.instanceColor;o=new VI(d,f,p),o.instanceMatrix=new Su(new Float32Array(m.array),16),v!==void 0&&(o.instanceColor=new Su(new Float32Array(v.array),v.itemSize));break;case"BatchedMesh":d=a(e.geometry),f=l(e.material),o=new jI(e.maxGeometryCount,e.maxVertexCount,e.maxIndexCount,f),o.geometry=d,o.perObjectFrustumCulled=e.perObjectFrustumCulled,o.sortObjects=e.sortObjects,o._drawRanges=e.drawRanges,o._reservedRanges=e.reservedRanges,o._visibility=e.visibility,o._active=e.active,o._bounds=e.bounds.map(x=>{const _=new Cr;_.min.fromArray(x.boxMin),_.max.fromArray(x.boxMax);const g=new mr;return g.radius=x.sphereRadius,g.center.fromArray(x.sphereCenter),{boxInitialized:x.boxInitialized,box:_,sphereInitialized:x.sphereInitialized,sphere:g}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=h(e.matricesTexture.uuid);break;case"LOD":o=new HI;break;case"Line":o=new ns(a(e.geometry),l(e.material));break;case"LineLoop":o=new XI(a(e.geometry),l(e.material));break;case"LineSegments":o=new Pi(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new YI(a(e.geometry),l(e.material));break;case"Sprite":o=new WI(l(e.material));break;case"Group":o=new Bc;break;case"Bone":o=new p1;break;default:o=new Wt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m<p.length;m++)o.add(this.parseObject(p[m],t,r,i,s))}if(e.animations!==void 0){const p=e.animations;for(let m=0;m<p.length;m++){const v=p[m];o.animations.push(s[v])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let m=0;m<p.length;m++){const v=p[m],x=o.getObjectByProperty("uuid",v.object);x!==void 0&&o.addLevel(x,v.distance,v.hysteresis)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(r){if(r.isSkinnedMesh===!0&&r.skeleton!==void 0){const i=t[r.skeleton];i===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",r.skeleton):r.bind(i,r.bindMatrix)}})}}const U$={UVMapping:hg,CubeReflectionMapping:ho,CubeRefractionMapping:ma,EquirectangularReflectionMapping:Sd,EquirectangularRefractionMapping:bd,CubeUVReflectionMapping:Lu},ME={RepeatWrapping:wd,ClampToEdgeWrapping:pr,MirroredRepeatWrapping:Td},EE={NearestFilter:bn,NearestMipmapNearestFilter:R0,NearestMipmapLinearFilter:jh,LinearFilter:Tn,LinearMipmapNearestFilter:jS,LinearMipmapLinearFilter:ga};class k$ extends Xr{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"}}setOptions(e){return this.options=e,this}load(e,t,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=eo.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(h=>{t&&t(h),s.manager.itemEnd(e)}).catch(h=>{i&&i(h)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(h){return h.blob()}).then(function(h){return createImageBitmap(h,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(h){return eo.add(e,h),t&&t(h),s.manager.itemEnd(e),h}).catch(function(h){i&&i(h),eo.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});eo.add(e,l),s.manager.itemStart(e)}}let ym;class P1{static getContext(){return ym===void 0&&(ym=new(window.AudioContext||window.webkitAudioContext)),ym}static setContext(e){ym=e}}class B$ extends Xr{constructor(e){super(e)}load(e,t,r,i){const s=this,o=new fo(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const h=l.slice(0);P1.getContext().decodeAudioData(h,function(f){t(f)}).catch(a)}catch(h){a(h)}},r,i);function a(l){i?i(l):console.error(l),s.manager.itemError(e)}}}const AE=new ft,CE=new ft,Ba=new ft;class z${constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Yn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Yn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Ba.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(dl*t.fov*.5)/t.zoom;let a,l;CE.elements[12]=-i,AE.elements[12]=i,a=-o*t.aspect+s,l=o*t.aspect+s,Ba.elements[0]=2*t.near/(l-a),Ba.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Ba),a=-o*t.aspect-s,l=o*t.aspect-s,Ba.elements[0]=2*t.near/(l-a),Ba.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Ba)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(CE),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(AE)}}class R1{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=PE(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=PE();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function PE(){return(typeof performance>"u"?Date:performance).now()}const za=new z,RE=new Vr,W$=new z,Wa=new z;class H$ extends Wt{constructor(){super(),this.type="AudioListener",this.context=P1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new R1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(za,RE,W$),Wa.set(0,0,-1).applyQuaternion(RE),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(za.x,i),t.positionY.linearRampToValueAtTime(za.y,i),t.positionZ.linearRampToValueAtTime(za.z,i),t.forwardX.linearRampToValueAtTime(Wa.x,i),t.forwardY.linearRampToValueAtTime(Wa.y,i),t.forwardZ.linearRampToValueAtTime(Wa.z,i),t.upX.linearRampToValueAtTime(r.x,i),t.upY.linearRampToValueAtTime(r.y,i),t.upZ.linearRampToValueAtTime(r.z,i)}else t.setPosition(za.x,za.y,za.z),t.setOrientation(Wa.x,Wa.y,Wa.z,r.x,r.y,r.z)}}class CL extends Wt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;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,t=this.filters.length;e<t;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){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!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}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}}const Ha=new z,IE=new Vr,G$=new z,Ga=new z;class V$ extends CL{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){super.connect(),this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}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,t,r){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=r,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Ha,IE,G$),Ga.set(0,0,1).applyQuaternion(IE);const t=this.panner;if(t.positionX){const r=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Ha.x,r),t.positionY.linearRampToValueAtTime(Ha.y,r),t.positionZ.linearRampToValueAtTime(Ha.z,r),t.orientationX.linearRampToValueAtTime(Ga.x,r),t.orientationY.linearRampToValueAtTime(Ga.y,r),t.orientationZ.linearRampToValueAtTime(Ga.z,r)}else t.setPosition(Ha.x,Ha.y,Ha.z),t.setOrientation(Ga.x,Ga.y,Ga.z)}}class j${constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,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 t=this.getFrequencyData();for(let r=0;r<t.length;r++)e+=t[r];return e/t.length}}class PL{constructor(e,t,r){this.binding=e,this.valueSize=r;let i,s,o;switch(t){case"quaternion":i=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(r*6),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(r*5);break;default:i=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(r*5)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const r=this.buffer,i=this.valueSize,s=e*i+i;let o=this.cumulativeWeight;if(o===0){for(let a=0;a!==i;++a)r[s+a]=r[a];o=t}else{o+=t;const a=t/o;this._mixBufferRegion(r,s,0,a,i)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,r=this.valueSize,i=r*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,r),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,r=this.buffer,i=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=t*this._origIndex;this._mixBufferRegion(r,i,l,1-s,t)}o>0&&this._mixBufferRegionAdditive(r,i,this._addIndex*t,1,t);for(let l=t,h=t+t;l!==h;++l)if(r[l]!==r[l+t]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(t,i);for(let s=r,o=i;s!==o;++s)t[s]=t[i+s%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let r=e;r<t;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[t+r]=this.buffer[e+r]}_select(e,t,r,i,s){if(i>=.5)for(let o=0;o!==s;++o)e[t+o]=e[r+o]}_slerp(e,t,r,i){Vr.slerpFlat(e,t,e,t,e,r,i)}_slerpAdditive(e,t,r,i,s){const o=this._workIndex*s;Vr.multiplyQuaternionsFlat(e,o,e,t,e,r),Vr.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,r,i,s){const o=1-i;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[r+a]*i}}_lerpAdditive(e,t,r,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[r+o]*i}}}const I1="\\[\\]\\.:\\/",X$=new RegExp("["+I1+"]","g"),L1="[^"+I1+"]",Y$="[^"+I1.replace("\\.","")+"]",q$=/((?:WC+[\/:])*)/.source.replace("WC",L1),$$=/(WCOD+)?/.source.replace("WCOD",Y$),K$=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",L1),Z$=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",L1),Q$=new RegExp("^"+q$+$$+K$+Z$+"$"),J$=["material","materials","bones","map"];class eK{constructor(e,t,r){const i=r||Dt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,t)}setValue(e,t){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=r.length;i!==s;++i)r[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,r=e.length;t!==r;++t)e[t].unbind()}}class Dt{constructor(e,t,r){this.path=t,this.parsedPath=r||Dt.parseTrackName(t),this.node=Dt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,r){return e&&e.isAnimationObjectGroup?new Dt.Composite(e,t,r):new Dt(e,t,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(X$,"")}static parseTrackName(e){const t=Q$.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=r.nodeName.substring(i+1);J$.indexOf(s)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=s)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(t);if(r!==void 0)return r}if(e.children){const r=function(s){for(let o=0;o<s.length;o++){const a=s[o];if(a.name===t||a.uuid===t)return a;const l=r(a.children);if(l)return l}return null},i=r(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)e[t++]=r[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const r=this.resolvedProperty;for(let i=0,s=r.length;i!==s;++i)r[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,r=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Dt.findNode(this.rootNode,t.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(r){let h=t.objectIndex;switch(r){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 d=0;d<e.length;d++)if(e[d].name===h){h=d;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[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[r]}if(h!==void 0){if(e[h]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[h]}}const o=e[i];if(o===void 0){const h=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+h+"."+i+" but it wasn't found.",e);return}let a=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(i==="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[s]!==void 0&&(s=e.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Dt.Composite=eK;Dt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};Dt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};Dt.prototype.GetterByBindingType=[Dt.prototype._getValue_direct,Dt.prototype._getValue_array,Dt.prototype._getValue_arrayElement,Dt.prototype._getValue_toArray];Dt.prototype.SetterByBindingTypeAndVersioning=[[Dt.prototype._setValue_direct,Dt.prototype._setValue_direct_setNeedsUpdate,Dt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_array,Dt.prototype._setValue_array_setNeedsUpdate,Dt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_arrayElement,Dt.prototype._setValue_arrayElement_setNeedsUpdate,Dt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Dt.prototype._setValue_fromArray,Dt.prototype._setValue_fromArray_setNeedsUpdate,Dt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class tK{constructor(){this.isAnimationObjectGroup=!0,this.uuid=oi(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let r=0,i=arguments.length;r!==i;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,r=this._paths,i=this._parsedPaths,s=this._bindings,o=s.length;let a,l=e.length,h=this.nCachedObjects_;for(let d=0,f=arguments.length;d!==f;++d){const p=arguments[d],m=p.uuid;let v=t[m];if(v===void 0){v=l++,t[m]=v,e.push(p);for(let x=0,_=o;x!==_;++x)s[x].push(new Dt(p,r[x],i[x]))}else if(v<h){a=e[v];const x=--h,_=e[x];t[_.uuid]=v,e[v]=_,t[m]=x,e[x]=p;for(let g=0,S=o;g!==S;++g){const b=s[g],M=b[x];let C=b[v];b[v]=M,C===void 0&&(C=new Dt(p,r[g],i[g])),b[x]=C}}else e[v]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h}remove(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const l=arguments[o],h=l.uuid,d=t[h];if(d!==void 0&&d>=s){const f=s++,p=e[f];t[p.uuid]=d,e[d]=p,t[h]=f,e[f]=l;for(let m=0,v=i;m!==v;++m){const x=r[m],_=x[f],g=x[d];x[d]=_,x[f]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,r=this._bindings,i=r.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const h=arguments[a],d=h.uuid,f=t[d];if(f!==void 0)if(delete t[d],f<s){const p=--s,m=e[p],v=--o,x=e[v];t[m.uuid]=f,e[f]=m,t[x.uuid]=p,e[p]=x,e.pop();for(let _=0,g=i;_!==g;++_){const S=r[_],b=S[p],M=S[v];S[f]=b,S[p]=M,S.pop()}}else{const p=--o,m=e[p];p>0&&(t[m.uuid]=f),e[f]=m,e.pop();for(let v=0,x=i;v!==x;++v){const _=r[v];_[f]=_[p],_.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const r=this._bindingsIndicesByPath;let i=r[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,a=this._parsedPaths,l=this._objects,h=l.length,d=this.nCachedObjects_,f=new Array(h);i=s.length,r[e]=i,o.push(e),a.push(t),s.push(f);for(let p=d,m=l.length;p!==m;++p){const v=l[p];f[p]=new Dt(v,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,r=t[e];if(r!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],h=e[a];t[h]=r,o[r]=l,o.pop(),s[r]=s[a],s.pop(),i[r]=i[a],i.pop()}}}class RL{constructor(e,t,r=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=r,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Qa,endingEnd:Qa};for(let h=0;h!==o;++h){const d=s[h].createInterpolant(null);a[h]=d,d.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=hI,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,r){if(e.fadeOut(t),this.fadeIn(t),r){const i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,r){return e.crossFadeFrom(this,t,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,r){const i=this._mixer,s=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,h=a.sampleValues;return l[0]=s,l[1]=s+r,h[0]=e/o,h[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,r,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*r;l<0||r===0?t=0:(this._startTime=null,t=r*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,h=this._propertyBindings;switch(this.blendMode){case JS:for(let d=0,f=l.length;d!==f;++d)l[d].evaluate(o),h[d].accumulateAdditive(a);break;case fg:default:for(let d=0,f=l.length;d!==f;++d)l[d].evaluate(o),h[d].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];t*=i,e>r.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,r=this.loop;let i=this.time+e,s=this._loopCount;const o=r===dI;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(r===uI){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const h=e<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,r){const i=this._interpolantSettings;r?(i.endingStart=Ja,i.endingEnd=Ja):(e?i.endingStart=this.zeroSlopeAtStart?Ja:Qa:i.endingStart=Ad,t?i.endingEnd=this.zeroSlopeAtEnd?Ja:Qa:i.endingEnd=Ad)}_scheduleFading(e,t,r){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=r,this}}const nK=new Float32Array(1);class rK extends mo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const r=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=r.uuid,h=this._bindingsByRootAndName;let d=h[l];d===void 0&&(d={},h[l]=d);for(let f=0;f!==s;++f){const p=i[f],m=p.name;let v=d[m];if(v!==void 0)++v.referenceCount,o[f]=v;else{if(v=o[f],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const x=t&&t._propertyBindings[f].binding.parsedPath;v=new PL(Dt.create(r,m,x),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),o[f]=v}a[f].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,r)}const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,r){const i=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=i.length,i.push(e),o.actionByRoot[r]=e}_removeInactiveAction(e){const t=this._actions,r=t[t.length-1],i=e._cacheIndex;r._cacheIndex=i,t[i]=r,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,a=o[s],l=a.knownActions,h=l[l.length-1],d=e._byClipCacheIndex;h._byClipCacheIndex=d,l[d]=h,l.pop(),e._byClipCacheIndex=null;const f=a.actionByRoot,p=(e._localRoot||this._root).uuid;delete f[p],l.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let r=0,i=t.length;r!==i;++r){const s=t[r];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,r=e._cacheIndex,i=this._nActiveActions++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_takeBackAction(e){const t=this._actions,r=e._cacheIndex,i=--this._nActiveActions,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_addInactiveBinding(e,t,r){const i=this._bindingsByRootAndName,s=this._bindings;let o=i[t];o===void 0&&(o={},i[t]=o),o[r]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,r=e.binding,i=r.rootNode.uuid,s=r.path,o=this._bindingsByRootAndName,a=o[i],l=t[t.length-1],h=e._cacheIndex;l._cacheIndex=h,t[h]=l,t.pop(),delete a[s],Object.keys(a).length===0&&delete o[i]}_lendBinding(e){const t=this._bindings,r=e._cacheIndex,i=this._nActiveBindings++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_takeBackBinding(e){const t=this._bindings,r=e._cacheIndex,i=--this._nActiveBindings,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=r,t[r]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let r=e[t];return r===void 0&&(r=new M1(new Float32Array(2),new Float32Array(2),1,nK),r.__cacheIndex=t,e[t]=r),r}_takeBackControlInterpolant(e){const t=this._controlInterpolants,r=e.__cacheIndex,i=--this._nActiveControlInterpolants,s=t[i];e.__cacheIndex=i,t[i]=e,s.__cacheIndex=r,t[r]=s}clipAction(e,t,r){const i=t||this._root,s=i.uuid;let o=typeof e=="string"?Bd.findByName(i,e):e;const a=o!==null?o.uuid:e,l=this._actionsByClip[a];let h=null;if(r===void 0&&(o!==null?r=o.blendMode:r=fg),l!==void 0){const f=l.actionByRoot[s];if(f!==void 0&&f.blendMode===r)return f;h=l.knownActions[0],o===null&&(o=h._clip)}if(o===null)return null;const d=new RL(this,o,t,r);return this._bindAction(d,h),this._addInactiveAction(d,a,s),d}existingAction(e,t){const r=t||this._root,i=r.uuid,s=typeof e=="string"?Bd.findByName(r,e):e,o=s?s.uuid:e,a=this._actionsByClip[o];return a!==void 0&&a.actionByRoot[i]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let r=t-1;r>=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const t=this._actions,r=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let h=0;h!==r;++h)t[h]._update(i,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let h=0;h!==l;++h)a[h].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,r=e.uuid,i=this._actionsByClip,s=i[r];if(s!==void 0){const o=s.knownActions;for(let a=0,l=o.length;a!==l;++a){const h=o[a];this._deactivateAction(h);const d=h._cacheIndex,f=t[t.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,f._cacheIndex=d,t[d]=f,t.pop(),this._removeInactiveBindingsForAction(h)}delete i[r]}}uncacheRoot(e){const t=e.uuid,r=this._actionsByClip;for(const o in r){const a=r[o].actionByRoot,l=a[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const i=this._bindingsByRootAndName,s=i[t];if(s!==void 0)for(const o in s){const a=s[o];a.restoreOriginalState(),this._removeInactiveBinding(a)}}uncacheAction(e,t){const r=this.existingAction(e,t);r!==null&&(this._deactivateAction(r),this._removeInactiveAction(r))}}class F1{constructor(e){this.value=e}clone(){return new F1(this.value.clone===void 0?this.value:this.value.clone())}}let iK=0;class sK extends mo{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:iK++}),this.name="",this.usage=Id,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){return this.dispatchEvent({type:"dispose"}),this}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let r=0,i=t.length;r<i;r++){const s=Array.isArray(t[r])?t[r]:[t[r]];for(let o=0;o<s.length;o++)this.uniforms.push(s[o].clone())}return this}clone(){return new this.constructor().copy(this)}}class oK extends _g{constructor(e,t,r=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class aK{constructor(e,t,r,i,s){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=r,this.elementSize=i,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}class IL{constructor(e,t,r=0,i=1/0){this.ray=new Fu(e,t),this.near=r,this.far=i,this.camera=null,this.layers=new fl,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,r=[]){return Tx(e,this,r,t),r.sort(LE),r}intersectObjects(e,t=!0,r=[]){for(let i=0,s=e.length;i<s;i++)Tx(e[i],this,r,t);return r.sort(LE),r}}function LE(n,e){return n.distance-e.distance}function Tx(n,e,t,r){if(n.layers.test(e.layers)&&n.raycast(e,t),r===!0){const i=n.children;for(let s=0,o=i.length;s<o;s++)Tx(i[s],e,t,!0)}}class lK{constructor(e=1,t=0,r=0){return this.radius=e,this.phi=t,this.theta=r,this}set(e,t,r){return this.radius=e,this.phi=t,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,r){return this.radius=Math.sqrt(e*e+t*t+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(vn(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class cK{constructor(e=1,t=0,r=0){return this.radius=e,this.theta=t,this.y=r,this}set(e,t,r){return this.radius=e,this.theta=t,this.y=r,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,t,r){return this.radius=Math.sqrt(e*e+r*r),this.theta=Math.atan2(e,r),this.y=t,this}clone(){return new this.constructor().copy(this)}}const FE=new ye;class uK{constructor(e=new ye(1/0,1/0),t=new ye(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=FE.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),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,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,FE).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 NE=new z,vm=new z;class hK{constructor(e=new z,t=new z){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){NE.subVectors(e,this.start),vm.subVectors(this.end,this.start);const r=vm.dot(vm);let s=vm.dot(NE)/r;return t&&(s=vn(s,0,1)),s}closestPointToPoint(e,t,r){const i=this.closestPointToPointParameter(e,t);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const DE=new z;class dK extends Wt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const r=new dt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o<l;o++,a++){const h=o/l*Math.PI*2,d=a/l*Math.PI*2;i.push(Math.cos(h),Math.sin(h),1,Math.cos(d),Math.sin(d),1)}r.setAttribute("position",new qe(i,3));const s=new In({fog:!1,toneMapped:!1});this.cone=new Pi(r,s),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);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),DE.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(DE),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const No=new z,_m=new ft,c_=new ft;class fK extends Pi{constructor(e){const t=LL(e),r=new dt,i=[],s=[],o=new We(0,0,1),a=new We(0,1,0);for(let h=0;h<t.length;h++){const d=t[h];d.parent&&d.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(o.r,o.g,o.b),s.push(a.r,a.g,a.b))}r.setAttribute("position",new qe(i,3)),r.setAttribute("color",new qe(s,3));const l=new In({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(r,l),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,r=this.geometry,i=r.getAttribute("position");c_.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const a=t[s];a.parent&&a.parent.isBone&&(_m.multiplyMatrices(c_,a.matrixWorld),No.setFromMatrixPosition(_m),i.setXYZ(o,No.x,No.y,No.z),_m.multiplyMatrices(c_,a.parent.matrixWorld),No.setFromMatrixPosition(_m),i.setXYZ(o+1,No.x,No.y,No.z),o+=2)}r.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function LL(n){const e=[];n.isBone===!0&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,LL(n.children[t]));return e}class pK extends Un{constructor(e,t,r){const i=new cf(t,4,2),s=new ba({wireframe:!0,fog:!1,toneMapped:!1});super(i,s),this.light=e,this.color=r,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 mK=new z,OE=new We,UE=new We;class gK extends Wt{constructor(e,t,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="HemisphereLightHelper";const i=new lf(t);i.rotateY(Math.PI*.5),this.material=new ba({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),o=new Float32Array(s.count*3);i.setAttribute("color",new Xt(o,3)),this.add(new Un(i,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 t=e.geometry.getAttribute("color");OE.copy(this.light.color),UE.copy(this.light.groundColor);for(let r=0,i=t.count;r<i;r++){const s=r<i/2?OE:UE;t.setXYZ(r,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(mK.setFromMatrixPosition(this.light.matrixWorld).negate())}}class yK extends Pi{constructor(e=10,t=10,r=4473924,i=8947848){r=new We(r),i=new We(i);const s=t/2,o=e/t,a=e/2,l=[],h=[];for(let p=0,m=0,v=-a;p<=t;p++,v+=o){l.push(-a,0,v,a,0,v),l.push(v,0,-a,v,0,a);const x=p===s?r:i;x.toArray(h,m),m+=3,x.toArray(h,m),m+=3,x.toArray(h,m),m+=3,x.toArray(h,m),m+=3}const d=new dt;d.setAttribute("position",new qe(l,3)),d.setAttribute("color",new qe(h,3));const f=new In({vertexColors:!0,toneMapped:!1});super(d,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class vK extends Pi{constructor(e=10,t=16,r=8,i=64,s=4473924,o=8947848){s=new We(s),o=new We(o);const a=[],l=[];if(t>1)for(let f=0;f<t;f++){const p=f/t*(Math.PI*2),m=Math.sin(p)*e,v=Math.cos(p)*e;a.push(0,0,0),a.push(m,0,v);const x=f&1?s:o;l.push(x.r,x.g,x.b),l.push(x.r,x.g,x.b)}for(let f=0;f<r;f++){const p=f&1?s:o,m=e-e/r*f;for(let v=0;v<i;v++){let x=v/i*(Math.PI*2),_=Math.sin(x)*m,g=Math.cos(x)*m;a.push(_,0,g),l.push(p.r,p.g,p.b),x=(v+1)/i*(Math.PI*2),_=Math.sin(x)*m,g=Math.cos(x)*m,a.push(_,0,g),l.push(p.r,p.g,p.b)}}const h=new dt;h.setAttribute("position",new qe(a,3)),h.setAttribute("color",new qe(l,3));const d=new In({vertexColors:!0,toneMapped:!1});super(h,d),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const kE=new z,xm=new z,BE=new z;class _K extends Wt{constructor(e,t,r){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",t===void 0&&(t=1);let i=new dt;i.setAttribute("position",new qe([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new In({fog:!1,toneMapped:!1});this.lightPlane=new ns(i,s),this.add(this.lightPlane),i=new dt,i.setAttribute("position",new qe([0,0,0,0,0,1],3)),this.targetLine=new ns(i,s),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),kE.setFromMatrixPosition(this.light.matrixWorld),xm.setFromMatrixPosition(this.light.target.matrixWorld),BE.subVectors(xm,kE),this.lightPlane.lookAt(xm),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(xm),this.targetLine.scale.z=BE.length()}}const Sm=new z,mn=new nf;class xK extends Pi{constructor(e){const t=new dt,r=new In({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],o={};a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4");function a(v,x){l(v),l(x)}function l(v){i.push(0,0,0),s.push(0,0,0),o[v]===void 0&&(o[v]=[]),o[v].push(i.length/3-1)}t.setAttribute("position",new qe(i,3)),t.setAttribute("color",new qe(s,3)),super(t,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update();const h=new We(16755200),d=new We(16711680),f=new We(43775),p=new We(16777215),m=new We(3355443);this.setColors(h,d,f,p,m)}setColors(e,t,r,i,s){const a=this.geometry.getAttribute("color");a.setXYZ(0,e.r,e.g,e.b),a.setXYZ(1,e.r,e.g,e.b),a.setXYZ(2,e.r,e.g,e.b),a.setXYZ(3,e.r,e.g,e.b),a.setXYZ(4,e.r,e.g,e.b),a.setXYZ(5,e.r,e.g,e.b),a.setXYZ(6,e.r,e.g,e.b),a.setXYZ(7,e.r,e.g,e.b),a.setXYZ(8,e.r,e.g,e.b),a.setXYZ(9,e.r,e.g,e.b),a.setXYZ(10,e.r,e.g,e.b),a.setXYZ(11,e.r,e.g,e.b),a.setXYZ(12,e.r,e.g,e.b),a.setXYZ(13,e.r,e.g,e.b),a.setXYZ(14,e.r,e.g,e.b),a.setXYZ(15,e.r,e.g,e.b),a.setXYZ(16,e.r,e.g,e.b),a.setXYZ(17,e.r,e.g,e.b),a.setXYZ(18,e.r,e.g,e.b),a.setXYZ(19,e.r,e.g,e.b),a.setXYZ(20,e.r,e.g,e.b),a.setXYZ(21,e.r,e.g,e.b),a.setXYZ(22,e.r,e.g,e.b),a.setXYZ(23,e.r,e.g,e.b),a.setXYZ(24,t.r,t.g,t.b),a.setXYZ(25,t.r,t.g,t.b),a.setXYZ(26,t.r,t.g,t.b),a.setXYZ(27,t.r,t.g,t.b),a.setXYZ(28,t.r,t.g,t.b),a.setXYZ(29,t.r,t.g,t.b),a.setXYZ(30,t.r,t.g,t.b),a.setXYZ(31,t.r,t.g,t.b),a.setXYZ(32,r.r,r.g,r.b),a.setXYZ(33,r.r,r.g,r.b),a.setXYZ(34,r.r,r.g,r.b),a.setXYZ(35,r.r,r.g,r.b),a.setXYZ(36,r.r,r.g,r.b),a.setXYZ(37,r.r,r.g,r.b),a.setXYZ(38,i.r,i.g,i.b),a.setXYZ(39,i.r,i.g,i.b),a.setXYZ(40,s.r,s.g,s.b),a.setXYZ(41,s.r,s.g,s.b),a.setXYZ(42,s.r,s.g,s.b),a.setXYZ(43,s.r,s.g,s.b),a.setXYZ(44,s.r,s.g,s.b),a.setXYZ(45,s.r,s.g,s.b),a.setXYZ(46,s.r,s.g,s.b),a.setXYZ(47,s.r,s.g,s.b),a.setXYZ(48,s.r,s.g,s.b),a.setXYZ(49,s.r,s.g,s.b),a.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,r=1,i=1;mn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Sn("c",t,e,mn,0,0,-1),Sn("t",t,e,mn,0,0,1),Sn("n1",t,e,mn,-r,-i,-1),Sn("n2",t,e,mn,r,-i,-1),Sn("n3",t,e,mn,-r,i,-1),Sn("n4",t,e,mn,r,i,-1),Sn("f1",t,e,mn,-r,-i,1),Sn("f2",t,e,mn,r,-i,1),Sn("f3",t,e,mn,-r,i,1),Sn("f4",t,e,mn,r,i,1),Sn("u1",t,e,mn,r*.7,i*1.1,-1),Sn("u2",t,e,mn,-r*.7,i*1.1,-1),Sn("u3",t,e,mn,0,i*2,-1),Sn("cf1",t,e,mn,-r,0,1),Sn("cf2",t,e,mn,r,0,1),Sn("cf3",t,e,mn,0,-i,1),Sn("cf4",t,e,mn,0,i,1),Sn("cn1",t,e,mn,-r,0,-1),Sn("cn2",t,e,mn,r,0,-1),Sn("cn3",t,e,mn,0,-i,-1),Sn("cn4",t,e,mn,0,i,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Sn(n,e,t,r,i,s,o){Sm.set(i,s,o).unproject(r);const a=e[n];if(a!==void 0){const l=t.getAttribute("position");for(let h=0,d=a.length;h<d;h++)l.setXYZ(a[h],Sm.x,Sm.y,Sm.z)}}const bm=new Cr;class SK extends Pi{constructor(e,t=16776960){const r=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(8*3),s=new dt;s.setIndex(new Xt(r,1)),s.setAttribute("position",new Xt(i,3)),super(s,new In({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&bm.setFromObject(this.object),bm.isEmpty())return;const t=bm.min,r=bm.max,i=this.geometry.attributes.position,s=i.array;s[0]=r.x,s[1]=r.y,s[2]=r.z,s[3]=t.x,s[4]=r.y,s[5]=r.z,s[6]=t.x,s[7]=t.y,s[8]=r.z,s[9]=r.x,s[10]=t.y,s[11]=r.z,s[12]=r.x,s[13]=r.y,s[14]=t.z,s[15]=t.x,s[16]=r.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=r.x,s[22]=t.y,s[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class bK extends Pi{constructor(e,t=16776960){const r=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=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new dt;s.setIndex(new Xt(r,1)),s.setAttribute("position",new qe(i,3)),super(s,new In({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class wK extends ns{constructor(e,t=1,r=16776960){const i=r,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o=new dt;o.setAttribute("position",new qe(s,3)),o.computeBoundingSphere(),super(o,new In({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const a=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new dt;l.setAttribute("position",new qe(a,3)),l.computeBoundingSphere(),this.add(new Un(l,new ba({color:i,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 zE=new z;let wm,u_;class TK extends Wt{constructor(e=new z(0,0,1),t=new z(0,0,0),r=1,i=16776960,s=r*.2,o=s*.2){super(),this.type="ArrowHelper",wm===void 0&&(wm=new dt,wm.setAttribute("position",new qe([0,0,0,0,1,0],3)),u_=new Ou(0,.5,1,5,1),u_.translate(0,-.5,0)),this.position.copy(t),this.line=new ns(wm,new In({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Un(u_,new ba({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(r,s,o)}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{zE.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(zE,t)}}setLength(e,t=e*.2,r=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),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 MK extends Pi{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new dt;i.setAttribute("position",new qe(t,3)),i.setAttribute("color",new qe(r,3));const s=new In({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,r){const i=new We,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(r),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class EK{constructor(){this.type="ShapePath",this.color=new We,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Fd,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,r,i){return this.currentPath.quadraticCurveTo(e,t,r,i),this}bezierCurveTo(e,t,r,i,s,o){return this.currentPath.bezierCurveTo(e,t,r,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const S=[];for(let b=0,M=g.length;b<M;b++){const C=g[b],A=new ml;A.curves=C.curves,S.push(A)}return S}function r(g,S){const b=S.length;let M=!1;for(let C=b-1,A=0;A<b;C=A++){let R=S[C],O=S[A],P=O.x-R.x,I=O.y-R.y;if(Math.abs(I)>Number.EPSILON){if(I<0&&(R=S[A],P=-P,O=S[C],I=-I),g.y<R.y||g.y>O.y)continue;if(g.y===R.y){if(g.x===R.x)return!0}else{const H=I*(g.x-R.x)-P*(g.y-R.y);if(H===0)return!0;if(H<0)continue;M=!M}}else{if(g.y!==R.y)continue;if(O.x<=g.x&&g.x<=R.x||R.x<=g.x&&g.x<=O.x)return!0}}return M}const i=As.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const h=[];if(s.length===1)return a=s[0],l=new ml,l.curves=a.curves,h.push(l),h;let d=!i(s[0].getPoints());d=e?!d:d;const f=[],p=[];let m=[],v=0,x;p[v]=void 0,m[v]=[];for(let g=0,S=s.length;g<S;g++)a=s[g],x=a.getPoints(),o=i(x),o=e?!o:o,o?(!d&&p[v]&&v++,p[v]={s:new ml,p:x},p[v].s.curves=a.curves,d&&v++,m[v]=[]):m[v].push({h:a,p:x[0]});if(!p[0])return t(s);if(p.length>1){let g=!1,S=0;for(let b=0,M=p.length;b<M;b++)f[b]=[];for(let b=0,M=p.length;b<M;b++){const C=m[b];for(let A=0;A<C.length;A++){const R=C[A];let O=!0;for(let P=0;P<p.length;P++)r(R.p,p[P].p)&&(b!==P&&S++,O?(O=!1,f[P].push(R)):g=!0);O&&f[b].push(R)}}S>0&&g===!1&&(m=f)}let _;for(let g=0,S=p.length;g<S;g++){l=p[g].s,h.push(l),_=m[g];for(let b=0,M=_.length;b<M;b++)l.holes.push(_[b].h)}return h}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:cg}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=cg);const AK=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:VS,AddEquation:Wo,AddOperation:$3,AdditiveAnimationBlendMode:JS,AdditiveBlending:U2,AgXToneMapping:eI,AlphaFormat:iI,AlwaysCompare:bI,AlwaysDepth:H3,AlwaysStencilFunc:px,AmbientLight:bL,AnimationAction:RL,AnimationClip:Bd,AnimationLoader:C$,AnimationMixer:rK,AnimationObjectGroup:tK,AnimationUtils:T$,ArcCurve:qI,ArrayCamera:kI,ArrowHelper:TK,AttachedBindMode:H2,Audio:CL,AudioAnalyser:j$,AudioContext:P1,AudioListener:H$,AudioLoader:B$,AxesHelper:MK,BackSide:Ar,BasicDepthPacking:fI,BasicShadowMap:T3,BatchedMesh:jI,Bone:p1,BooleanKeyframeTrack:Rl,Box2:uK,Box3:Cr,Box3Helper:bK,BoxGeometry:Pl,BoxHelper:SK,BufferAttribute:Xt,BufferGeometry:dt,BufferGeometryLoader:AL,ByteType:nI,Cache:eo,Camera:nf,CameraHelper:xK,CanvasTexture:qq,CapsuleGeometry:wg,CatmullRomCurve3:$I,CineonToneMapping:Q3,CircleGeometry:Tg,ClampToEdgeWrapping:pr,Clock:R1,Color:We,ColorKeyframeTrack:E1,ColorManagement:Gt,CompressedArrayTexture:Xq,CompressedCubeTexture:Yq,CompressedTexture:Sg,CompressedTextureLoader:P$,ConeGeometry:Mg,ConstantAlphaFactor:B3,ConstantColorFactor:U3,CubeCamera:PI,CubeReflectionMapping:ho,CubeRefractionMapping:ma,CubeTexture:rf,CubeTextureLoader:R$,CubeUVReflectionMapping:Lu,CubicBezierCurve:y1,CubicBezierCurve3:KI,CubicInterpolant:pL,CullFaceBack:O2,CullFaceFront:w3,CullFaceFrontBack:D8,CullFaceNone:b3,Curve:rs,CurvePath:QI,CustomBlending:M3,CustomToneMapping:J3,CylinderGeometry:Ou,Cylindrical:cK,Data3DTexture:i1,DataArrayTexture:mg,DataTexture:pl,DataTextureLoader:I$,DataUtils:j9,DecrementStencilOp:Y8,DecrementWrapStencilOp:$8,DefaultLoadingManager:yL,DepthFormat:oa,DepthStencilFormat:bl,DepthTexture:l1,DetachedBindMode:tI,DirectionalLight:SL,DirectionalLightHelper:_K,DiscreteInterpolant:mL,DisplayP3ColorSpace:pg,DodecahedronGeometry:Eg,DoubleSide:xs,DstAlphaFactor:L3,DstColorFactor:N3,DynamicCopyUsage:u9,DynamicDrawUsage:i9,DynamicReadUsage:a9,EdgesGeometry:JI,EllipseCurve:bg,EqualCompare:vI,EqualDepth:V3,EqualStencilFunc:J8,EquirectangularReflectionMapping:Sd,EquirectangularRefractionMapping:bd,Euler:tf,EventDispatcher:mo,ExtrudeGeometry:Cg,FileLoader:fo,Float16BufferAttribute:Z9,Float32BufferAttribute:qe,Float64BufferAttribute:Q9,FloatType:Xi,Fog:vg,FogExp2:yg,FramebufferTexture:jq,FrontSide:uo,Frustum:sf,GLBufferAttribute:aK,GLSL1:d9,GLSL3:mx,GreaterCompare:_I,GreaterDepth:X3,GreaterEqualCompare:SI,GreaterEqualDepth:j3,GreaterEqualStencilFunc:r9,GreaterStencilFunc:t9,GridHelper:yK,Group:Bc,HalfFloatType:yu,HemisphereLight:vL,HemisphereLightHelper:gK,IcosahedronGeometry:Pg,ImageBitmapLoader:k$,ImageLoader:zd,ImageUtils:r1,IncrementStencilOp:X8,IncrementWrapStencilOp:q8,InstancedBufferAttribute:Su,InstancedBufferGeometry:EL,InstancedInterleavedBuffer:oK,InstancedMesh:VI,Int16BufferAttribute:$9,Int32BufferAttribute:K9,Int8BufferAttribute:X9,IntType:XS,InterleavedBuffer:_g,InterleavedBufferAttribute:wl,Interpolant:uf,InterpolateDiscrete:Md,InterpolateLinear:Ed,InterpolateSmooth:qm,InvertStencilOp:K8,KeepStencilOp:Xa,KeyframeTrack:is,LOD:HI,LatheGeometry:af,Layers:fl,LessCompare:yI,LessDepth:G3,LessEqualCompare:t1,LessEqualDepth:xd,LessEqualStencilFunc:e9,LessStencilFunc:Q8,Light:Ta,LightProbe:ML,Line:ns,Line3:hK,LineBasicMaterial:In,LineCurve:v1,LineCurve3:ZI,LineDashedMaterial:hL,LineLoop:XI,LineSegments:Pi,LinearDisplayP3ColorSpace:ef,LinearEncoding:e1,LinearFilter:Tn,LinearInterpolant:M1,LinearMipMapLinearFilter:z8,LinearMipMapNearestFilter:B8,LinearMipmapLinearFilter:ga,LinearMipmapNearestFilter:jS,LinearSRGBColorSpace:Ps,LinearToneMapping:K3,LinearTransfer:Cd,Loader:Xr,LoaderUtils:wx,LoadingManager:A1,LoopOnce:uI,LoopPingPong:dI,LoopRepeat:hI,LuminanceAlphaFormat:oI,LuminanceFormat:sI,MOUSE:F8,Material:yr,MaterialLoader:Og,MathUtils:A9,Matrix3:At,Matrix4:ft,MaxEquation:W2,Mesh:Un,MeshBasicMaterial:ba,MeshDepthMaterial:c1,MeshDistanceMaterial:u1,MeshLambertMaterial:cL,MeshMatcapMaterial:uL,MeshNormalMaterial:lL,MeshPhongMaterial:oL,MeshPhysicalMaterial:sL,MeshStandardMaterial:w1,MeshToonMaterial:aL,MinEquation:z2,MirroredRepeatWrapping:Td,MixOperation:q3,MultiplyBlending:B2,MultiplyOperation:Jd,NearestFilter:bn,NearestMipMapLinearFilter:k8,NearestMipMapNearestFilter:U8,NearestMipmapLinearFilter:jh,NearestMipmapNearestFilter:R0,NeverCompare:gI,NeverDepth:W3,NeverStencilFunc:Z8,NoBlending:no,NoColorSpace:ni,NoToneMapping:Ms,NormalAnimationBlendMode:fg,NormalBlending:hl,NotEqualCompare:xI,NotEqualDepth:Y3,NotEqualStencilFunc:n9,NumberKeyframeTrack:Ud,Object3D:Wt,ObjectLoader:O$,ObjectSpaceNormalMap:mI,OctahedronGeometry:lf,OneFactor:P3,OneMinusConstantAlphaFactor:z3,OneMinusConstantColorFactor:k3,OneMinusDstAlphaFactor:F3,OneMinusDstColorFactor:D3,OneMinusSrcAlphaFactor:P0,OneMinusSrcColorFactor:I3,OrthographicCamera:of,P3Primaries:Rd,PCFShadowMap:ug,PCFSoftShadowMap:Vh,PMREMGenerator:yx,Path:Fd,PerspectiveCamera:Yn,Plane:ko,PlaneGeometry:Nu,PlaneHelper:wK,PointLight:xL,PointLightHelper:pK,Points:YI,PointsMaterial:m1,PolarGridHelper:vK,PolyhedronGeometry:wa,PositionalAudio:V$,PropertyBinding:Dt,PropertyMixer:PL,QuadraticBezierCurve:_1,QuadraticBezierCurve3:x1,Quaternion:Vr,QuaternionKeyframeTrack:Uu,QuaternionLinearInterpolant:gL,RED_GREEN_RGTC2_Format:dx,RED_RGTC1_Format:cI,REVISION:cg,RGBADepthPacking:pI,RGBAFormat:Mr,RGBAIntegerFormat:ZS,RGBA_ASTC_10x10_Format:ox,RGBA_ASTC_10x5_Format:rx,RGBA_ASTC_10x6_Format:ix,RGBA_ASTC_10x8_Format:sx,RGBA_ASTC_12x10_Format:ax,RGBA_ASTC_12x12_Format:lx,RGBA_ASTC_4x4_Format:$2,RGBA_ASTC_5x4_Format:K2,RGBA_ASTC_5x5_Format:Z2,RGBA_ASTC_6x5_Format:Q2,RGBA_ASTC_6x6_Format:J2,RGBA_ASTC_8x5_Format:ex,RGBA_ASTC_8x6_Format:tx,RGBA_ASTC_8x8_Format:nx,RGBA_BPTC_Format:Ym,RGBA_ETC2_EAC_Format:q2,RGBA_PVRTC_2BPPV1_Format:X2,RGBA_PVRTC_4BPPV1_Format:j2,RGBA_S3TC_DXT1_Format:Vm,RGBA_S3TC_DXT3_Format:jm,RGBA_S3TC_DXT5_Format:Xm,RGB_BPTC_SIGNED_Format:cx,RGB_BPTC_UNSIGNED_Format:ux,RGB_ETC1_Format:QS,RGB_ETC2_Format:Y2,RGB_PVRTC_2BPPV1_Format:V2,RGB_PVRTC_4BPPV1_Format:G2,RGB_S3TC_DXT1_Format:Gm,RGFormat:lI,RGIntegerFormat:KS,RawShaderMaterial:iL,Ray:Fu,Raycaster:IL,Rec709Primaries:Pd,RectAreaLight:wL,RedFormat:aI,RedIntegerFormat:$S,ReinhardToneMapping:Z3,RenderTarget:MI,RepeatWrapping:wd,ReplaceStencilOp:j8,ReverseSubtractEquation:A3,RingGeometry:Rg,SIGNED_RED_GREEN_RGTC2_Format:fx,SIGNED_RED_RGTC1_Format:hx,SRGBColorSpace:Nn,SRGBTransfer:$t,Scene:d1,ShaderChunk:Tt,ShaderLib:Vi,ShaderMaterial:Rs,ShadowMaterial:rL,Shape:ml,ShapeGeometry:Ig,ShapePath:EK,ShapeUtils:As,ShortType:rI,Skeleton:xg,SkeletonHelper:fK,SkinnedMesh:GI,Source:el,Sphere:mr,SphereGeometry:cf,Spherical:lK,SphericalHarmonics3:TL,SplineCurve:S1,SpotLight:_L,SpotLightHelper:dK,Sprite:WI,SpriteMaterial:f1,SrcAlphaFactor:C0,SrcAlphaSaturateFactor:O3,SrcColorFactor:R3,StaticCopyUsage:c9,StaticDrawUsage:Id,StaticReadUsage:o9,StereoCamera:z$,StreamCopyUsage:h9,StreamDrawUsage:s9,StreamReadUsage:l9,StringKeyframeTrack:Il,SubtractEquation:E3,SubtractiveBlending:k2,TOUCH:N8,TangentSpaceNormalMap:Sa,TetrahedronGeometry:Lg,Texture:Mn,TextureLoader:L$,TorusGeometry:Fg,TorusKnotGeometry:Ng,Triangle:kr,TriangleFanDrawMode:G8,TriangleStripDrawMode:H8,TrianglesDrawMode:W8,TubeGeometry:Dg,TwoPassDoubleSide:O8,UVMapping:hg,Uint16BufferAttribute:s1,Uint32BufferAttribute:o1,Uint8BufferAttribute:Y9,Uint8ClampedBufferAttribute:q9,Uniform:F1,UniformsGroup:sK,UniformsLib:Le,UniformsUtils:CI,UnsignedByteType:Es,UnsignedInt248Type:sa,UnsignedIntType:Js,UnsignedShort4444Type:YS,UnsignedShort5551Type:qS,UnsignedShortType:dg,VSMShadowMap:Bi,Vector2:ye,Vector3:z,Vector4:Vt,VectorKeyframeTrack:kd,VideoTexture:Vq,WebGL1Renderer:BI,WebGL3DRenderTarget:F9,WebGLArrayRenderTarget:L9,WebGLCoordinateSystem:Yi,WebGLCubeRenderTarget:RI,WebGLMultipleRenderTargets:N9,WebGLRenderTarget:ts,WebGLRenderer:h1,WebGLUtils:UI,WebGPUCoordinateSystem:vu,WireframeGeometry:b1,WrapAroundEnding:Ad,ZeroCurvatureEnding:Qa,ZeroFactor:C3,ZeroSlopeEnding:Ja,ZeroStencilOp:V8,_SRGBAFormat:I0,createCanvasElement:TI,sRGBEncoding:aa},Symbol.toStringTag,{value:"Module"}));var FL={exports:{}},Ll={};/**
* @license React
* react-reconciler-constants.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/Ll.ConcurrentRoot=1;Ll.ContinuousEventPriority=4;Ll.DefaultEventPriority=16;Ll.DiscreteEventPriority=1;Ll.IdleEventPriority=536870912;Ll.LegacyRoot=0;FL.exports=Ll;var Wc=FL.exports;function CK(n){let e;const t=new Set,r=(h,d)=>{const f=typeof h=="function"?h(e):h;if(f!==e){const p=e;e=d?f:Object.assign({},e,f),t.forEach(m=>m(e,p))}},i=()=>e,s=(h,d=i,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function m(){const v=d(e);if(!f(p,v)){const x=p;h(p=v,x)}}return t.add(m),()=>t.delete(m)},l={setState:r,getState:i,subscribe:(h,d,f)=>d||f?s(h,d,f):(t.add(h),()=>t.delete(h)),destroy:()=>t.clear()};return e=n(r,i,l),l}const PK=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),WE=PK?D.useEffect:D.useLayoutEffect;function RK(n){const e=typeof n=="function"?CK(n):n,t=(r=e.getState,i=Object.is)=>{const[,s]=D.useReducer(_=>_+1,0),o=e.getState(),a=D.useRef(o),l=D.useRef(r),h=D.useRef(i),d=D.useRef(!1),f=D.useRef();f.current===void 0&&(f.current=r(o));let p,m=!1;(a.current!==o||l.current!==r||h.current!==i||d.current)&&(p=r(o),m=!i(f.current,p)),WE(()=>{m&&(f.current=p),a.current=o,l.current=r,h.current=i,d.current=!1});const v=D.useRef(o);WE(()=>{const _=()=>{try{const S=e.getState(),b=l.current(S);h.current(f.current,b)||(a.current=S,f.current=b,s())}catch{d.current=!0,s()}},g=e.subscribe(_);return e.getState()!==v.current&&_(),g},[]);const x=m?p:f.current;return D.useDebugValue(x),x};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[t,e];return{next(){const i=r.length<=0;return{value:r.shift(),done:i}}}},t}var NL={exports:{}},h_={exports:{}},d_={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var HE;function IK(){return HE||(HE=1,function(n){function e(F,U){var G=F.length;F.push(U);e:for(;0<G;){var Y=G-1>>>1,ee=F[Y];if(0<i(ee,U))F[Y]=U,F[G]=ee,G=Y;else break e}}function t(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var U=F[0],G=F.pop();if(G!==U){F[0]=G;e:for(var Y=0,ee=F.length,K=ee>>>1;Y<K;){var ie=2*(Y+1)-1,me=F[ie],Ee=ie+1,ge=F[Ee];if(0>i(me,G))Ee<ee&&0>i(ge,me)?(F[Y]=ge,F[Ee]=G,Y=Ee):(F[Y]=me,F[ie]=G,Y=ie);else if(Ee<ee&&0>i(ge,G))F[Y]=ge,F[Ee]=G,Y=Ee;else break e}}return U}function i(F,U){var G=F.sortIndex-U.sortIndex;return G!==0?G:F.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],h=[],d=1,f=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(F){for(var U=t(h);U!==null;){if(U.callback===null)r(h);else if(U.startTime<=F)r(h),U.sortIndex=U.expirationTime,e(l,U);else break;U=t(h)}}function M(F){if(x=!1,b(F),!v)if(t(l)!==null)v=!0,Z(C);else{var U=t(h);U!==null&&re(M,U.startTime-F)}}function C(F,U){v=!1,x&&(x=!1,g(O),O=-1),m=!0;var G=p;try{for(b(U),f=t(l);f!==null&&(!(f.expirationTime>U)||F&&!H());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var ee=Y(f.expirationTime<=U);U=n.unstable_now(),typeof ee=="function"?f.callback=ee:f===t(l)&&r(l),b(U)}else r(l);f=t(l)}if(f!==null)var K=!0;else{var ie=t(h);ie!==null&&re(M,ie.startTime-U),K=!1}return K}finally{f=null,p=G,m=!1}}var A=!1,R=null,O=-1,P=5,I=-1;function H(){return!(n.unstable_now()-I<P)}function X(){if(R!==null){var F=n.unstable_now();I=F;var U=!0;try{U=R(!0,F)}finally{U?se():(A=!1,R=null)}}else A=!1}var se;if(typeof S=="function")se=function(){S(X)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,$=W.port2;W.port1.onmessage=X,se=function(){$.postMessage(null)}}else se=function(){_(X,0)};function Z(F){R=F,A||(A=!0,se())}function re(F,U){O=_(function(){F(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(F){F.callback=null},n.unstable_continueExecution=function(){v||m||(v=!0,Z(C))},n.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"):P=0<F?Math.floor(1e3/F):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(F){switch(p){case 1:case 2:case 3:var U=3;break;default:U=p}var G=p;p=U;try{return F()}finally{p=G}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(F,U){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var G=p;p=F;try{return U()}finally{p=G}},n.unstable_scheduleCallback=function(F,U,G){var Y=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Y+G:Y):G=Y,F){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=G+ee,F={id:d++,callback:U,priorityLevel:F,startTime:G,expirationTime:ee,sortIndex:-1},G>Y?(F.sortIndex=G,e(h,F),t(l)===null&&F===t(h)&&(x?(g(O),O=-1):x=!0,re(M,G-Y))):(F.sortIndex=ee,e(l,F),v||m||(v=!0,Z(C))),F},n.unstable_shouldYield=H,n.unstable_wrapCallback=function(F){var U=p;return function(){var G=p;p=U;try{return F.apply(this,arguments)}finally{p=G}}}}(d_)),d_}var GE;function LK(){return GE||(GE=1,h_.exports=IK()),h_.exports}/**
* @license React
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var FK=function(e){var t={},r=D,i=LK(),s=Object.assign;function o(c){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+c,y=1;y<arguments.length;y++)u+="&args[]="+encodeURIComponent(arguments[y]);return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),h=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),v=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),C=Symbol.iterator;function A(c){return c===null||typeof c!="object"?null:(c=C&&c[C]||c["@@iterator"],typeof c=="function"?c:null)}function R(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case d:return"Fragment";case h:return"Portal";case p:return"Profiler";case f:return"StrictMode";case _:return"Suspense";case g:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case v:return(c.displayName||"Context")+".Consumer";case m:return(c._context.displayName||"Context")+".Provider";case x:var u=c.render;return c=c.displayName,c||(c=u.displayName||u.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case S:return u=c.displayName||null,u!==null?u:R(c.type)||"Memo";case b:u=c._payload,c=c._init;try{return R(c(u))}catch{}}return null}function O(c){var u=c.type;switch(c.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=u.render,c=c.displayName||c.name||"",u.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(u);case 8:return u===f?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function P(c){var u=c,y=c;if(c.alternate)for(;u.return;)u=u.return;else{c=u;do u=c,u.flags&4098&&(y=u.return),c=u.return;while(c)}return u.tag===3?y:null}function I(c){if(P(c)!==c)throw Error(o(188))}function H(c){var u=c.alternate;if(!u){if(u=P(c),u===null)throw Error(o(188));return u!==c?null:c}for(var y=c,w=u;;){var T=y.return;if(T===null)break;var E=T.alternate;if(E===null){if(w=T.return,w!==null){y=w;continue}break}if(T.child===E.child){for(E=T.child;E;){if(E===y)return I(T),c;if(E===w)return I(T),u;E=E.sibling}throw Error(o(188))}if(y.return!==w.return)y=T,w=E;else{for(var V=!1,Q=T.child;Q;){if(Q===y){V=!0,y=T,w=E;break}if(Q===w){V=!0,w=T,y=E;break}Q=Q.sibling}if(!V){for(Q=E.child;Q;){if(Q===y){V=!0,y=E,w=T;break}if(Q===w){V=!0,w=E,y=T;break}Q=Q.sibling}if(!V)throw Error(o(189))}}if(y.alternate!==w)throw Error(o(190))}if(y.tag!==3)throw Error(o(188));return y.stateNode.current===y?c:u}function X(c){return c=H(c),c!==null?se(c):null}function se(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var u=se(c);if(u!==null)return u;c=c.sibling}return null}function W(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var u=W(c);if(u!==null)return u}c=c.sibling}return null}var $=Array.isArray,Z=e.getPublicInstance,re=e.getRootHostContext,F=e.getChildHostContext,U=e.prepareForCommit,G=e.resetAfterCommit,Y=e.createInstance,ee=e.appendInitialChild,K=e.finalizeInitialChildren,ie=e.prepareUpdate,me=e.shouldSetTextContent,Ee=e.createTextInstance,ge=e.scheduleTimeout,tt=e.cancelTimeout,nt=e.noTimeout,Be=e.isPrimaryRenderer,Xe=e.supportsMutation,j=e.supportsPersistence,Se=e.supportsHydration,fe=e.getInstanceFromNode,Te=e.preparePortalMount,de=e.getCurrentEventPriority,$e=e.detachDeletedInstance,Ne=e.supportsMicrotasks,k=e.scheduleMicrotask,N=e.supportsTestSelectors,te=e.findFiberRoot,be=e.getBoundingRect,ve=e.getTextContent,_e=e.isHiddenSubtree,Ye=e.matchAccessibilityRole,Ce=e.setFocusIfFocusable,Ue=e.setupIntersectionObserver,it=e.appendChild,mt=e.appendChildToContainer,xe=e.commitTextUpdate,Lt=e.commitMount,bt=e.commitUpdate,lt=e.insertBefore,Ke=e.insertInContainerBefore,He=e.removeChild,ct=e.removeChildFromContainer,Ft=e.resetTextContent,qt=e.hideInstance,vt=e.hideTextInstance,Re=e.unhideInstance,q=e.unhideTextInstance,Fe=e.clearContainer,Ie=e.cloneInstance,ot=e.createContainerChildSet,we=e.appendChildToContainerChildSet,Qe=e.finalizeContainerChildren,rt=e.replaceContainerChildren,Nt=e.cloneHiddenInstance,Ht=e.cloneHiddenTextInstance,Rt=e.canHydrateInstance,Zt=e.canHydrateTextInstance,rn=e.canHydrateSuspenseInstance,Ir=e.isSuspenseInstancePending,ku=e.isSuspenseInstanceFallback,Nl=e.registerSuspenseInstanceRetry,go=e.getNextHydratableSibling,Dl=e.getFirstHydratableChild,ff=e.getFirstHydratableChildWithinContainer,pf=e.getFirstHydratableChildWithinSuspenseInstance,Ug=e.hydrateInstance,kg=e.hydrateTextInstance,Bg=e.hydrateSuspenseInstance,B=e.getNextHydratableInstanceAfterSuspenseInstance,ne=e.commitHydratedContainer,le=e.commitHydratedSuspenseInstance,ce=e.clearSuspenseBoundary,ae=e.clearSuspenseBoundaryFromContainer,ze=e.shouldDeleteUnhydratedTailInstances,Je=e.didNotMatchHydratedContainerTextInstance,at=e.didNotMatchHydratedTextInstance,ut;function gt(c){if(ut===void 0)try{throw Error()}catch(y){var u=y.stack.trim().match(/\n( *(at )?)/);ut=u&&u[1]||""}return`
`+ut+c}var pt=!1;function yt(c,u){if(!c||pt)return"";pt=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(Pe){var w=Pe}Reflect.construct(c,[],u)}else{try{u.call()}catch(Pe){w=Pe}c.call(u.prototype)}else{try{throw Error()}catch(Pe){w=Pe}c()}}catch(Pe){if(Pe&&w&&typeof Pe.stack=="string"){for(var T=Pe.stack.split(`
`),E=w.stack.split(`
`),V=T.length-1,Q=E.length-1;1<=V&&0<=Q&&T[V]!==E[Q];)Q--;for(;1<=V&&0<=Q;V--,Q--)if(T[V]!==E[Q]){if(V!==1||Q!==1)do if(V--,Q--,0>Q||T[V]!==E[Q]){var he=`
`+T[V].replace(" at new "," at ");return c.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",c.displayName)),he}while(1<=V&&0<=Q);break}}}finally{pt=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?gt(c):""}var an=Object.prototype.hasOwnProperty,$n=[],Qt=-1;function zn(c){return{current:c}}function ht(c){0>Qt||(c.current=$n[Qt],$n[Qt]=null,Qt--)}function Ve(c,u){Qt++,$n[Qt]=c.current,c.current=u}var ui={},Ct=zn(ui),fn=zn(!1),ss=ui;function hi(c,u){var y=c.type.contextTypes;if(!y)return ui;var w=c.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var T={},E;for(E in y)T[E]=u[E];return w&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=u,c.__reactInternalMemoizedMaskedChildContext=T),T}function Wn(c){return c=c.childContextTypes,c!=null}function _n(){ht(fn),ht(Ct)}function os(c,u,y){if(Ct.current!==ui)throw Error(o(168));Ve(Ct,u),Ve(fn,y)}function Ol(c,u,y){var w=c.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return y;w=w.getChildContext();for(var T in w)if(!(T in u))throw Error(o(108,O(c)||"Unknown",T));return s({},y,w)}function Kn(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||ui,ss=Ct.current,Ve(Ct,c),Ve(fn,fn.current),!0}function Ul(c,u,y){var w=c.stateNode;if(!w)throw Error(o(169));y?(c=Ol(c,u,ss),w.__reactInternalMemoizedMergedChildContext=c,ht(fn),ht(Ct),Ve(Ct,c)):ht(fn),Ve(fn,y)}var Yr=Math.clz32?Math.clz32:eF,mf=Math.log,JL=Math.LN2;function eF(c){return c>>>=0,c===0?32:31-(mf(c)/JL|0)|0}var gf=64,yf=4194304;function Bu(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function vf(c,u){var y=c.pendingLanes;if(y===0)return 0;var w=0,T=c.suspendedLanes,E=c.pingedLanes,V=y&268435455;if(V!==0){var Q=V&~T;Q!==0?w=Bu(Q):(E&=V,E!==0&&(w=Bu(E)))}else V=y&~T,V!==0?w=Bu(V):E!==0&&(w=Bu(E));if(w===0)return 0;if(u!==0&&u!==w&&!(u&T)&&(T=w&-w,E=u&-u,T>=E||T===16&&(E&4194240)!==0))return u;if(w&4&&(w|=y&16),u=c.entangledLanes,u!==0)for(c=c.entanglements,u&=w;0<u;)y=31-Yr(u),T=1<<y,w|=c[y],u&=~T;return w}function tF(c,u){switch(c){case 1:case 2:case 4:return u+250;case 8: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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nF(c,u){for(var y=c.suspendedLanes,w=c.pingedLanes,T=c.expirationTimes,E=c.pendingLanes;0<E;){var V=31-Yr(E),Q=1<<V,he=T[V];he===-1?(!(Q&y)||Q&w)&&(T[V]=tF(Q,u)):he<=u&&(c.expiredLanes|=Q),E&=~Q}}function zg(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function Wg(c){for(var u=[],y=0;31>y;y++)u.push(c);return u}function zu(c,u,y){c.pendingLanes|=u,u!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,u=31-Yr(u),c[u]=y}function rF(c,u){var y=c.pendingLanes&~u;c.pendingLanes=u,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=u,c.mutableReadLanes&=u,c.entangledLanes&=u,u=c.entanglements;var w=c.eventTimes;for(c=c.expirationTimes;0<y;){var T=31-Yr(y),E=1<<T;u[T]=0,w[T]=-1,c[T]=-1,y&=~E}}function Hg(c,u){var y=c.entangledLanes|=u;for(c=c.entanglements;y;){var w=31-Yr(y),T=1<<w;T&u|c[w]&u&&(c[w]|=u),y&=~T}}var Ut=0;function O1(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var Gg=i.unstable_scheduleCallback,U1=i.unstable_cancelCallback,iF=i.unstable_shouldYield,sF=i.unstable_requestPaint,Hn=i.unstable_now,Vg=i.unstable_ImmediatePriority,oF=i.unstable_UserBlockingPriority,jg=i.unstable_NormalPriority,aF=i.unstable_IdlePriority,_f=null,as=null;function lF(c){if(as&&typeof as.onCommitFiberRoot=="function")try{as.onCommitFiberRoot(_f,c,void 0,(c.current.flags&128)===128)}catch{}}function cF(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var ls=typeof Object.is=="function"?Object.is:cF,Ls=null,xf=!1,Xg=!1;function k1(c){Ls===null?Ls=[c]:Ls.push(c)}function uF(c){xf=!0,k1(c)}function cs(){if(!Xg&&Ls!==null){Xg=!0;var c=0,u=Ut;try{var y=Ls;for(Ut=1;c<y.length;c++){var w=y[c];do w=w(!0);while(w!==null)}Ls=null,xf=!1}catch(T){throw Ls!==null&&(Ls=Ls.slice(c+1)),Gg(Vg,cs),T}finally{Ut=u,Xg=!1}}return null}var hF=a.ReactCurrentBatchConfig;function Sf(c,u){if(ls(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var y=Object.keys(c),w=Object.keys(u);if(y.length!==w.length)return!1;for(w=0;w<y.length;w++){var T=y[w];if(!an.call(u,T)||!ls(c[T],u[T]))return!1}return!0}function dF(c){switch(c.tag){case 5:return gt(c.type);case 16:return gt("Lazy");case 13:return gt("Suspense");case 19:return gt("SuspenseList");case 0:case 2:case 15:return c=yt(c.type,!1),c;case 11:return c=yt(c.type.render,!1),c;case 1:return c=yt(c.type,!0),c;default:return""}}function Ri(c,u){if(c&&c.defaultProps){u=s({},u),c=c.defaultProps;for(var y in c)u[y]===void 0&&(u[y]=c[y]);return u}return u}var bf=zn(null),wf=null,kl=null,Yg=null;function qg(){Yg=kl=wf=null}function B1(c,u,y){Be?(Ve(bf,u._currentValue),u._currentValue=y):(Ve(bf,u._currentValue2),u._currentValue2=y)}function $g(c){var u=bf.current;ht(bf),Be?c._currentValue=u:c._currentValue2=u}function Kg(c,u,y){for(;c!==null;){var w=c.alternate;if((c.childLanes&u)!==u?(c.childLanes|=u,w!==null&&(w.childLanes|=u)):w!==null&&(w.childLanes&u)!==u&&(w.childLanes|=u),c===y)break;c=c.return}}function Bl(c,u){wf=c,Yg=kl=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&u&&(Kr=!0),c.firstContext=null)}function di(c){var u=Be?c._currentValue:c._currentValue2;if(Yg!==c)if(c={context:c,memoizedValue:u,next:null},kl===null){if(wf===null)throw Error(o(308));kl=c,wf.dependencies={lanes:0,firstContext:c}}else kl=kl.next=c;return u}var us=null,yo=!1;function Zg(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function z1(c,u){c=c.updateQueue,u.updateQueue===c&&(u.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function Fs(c,u){return{eventTime:c,lane:u,tag:0,payload:null,callback:null,next:null}}function vo(c,u){var y=c.updateQueue;y!==null&&(y=y.shared,En!==null&&c.mode&1&&!(Pt&2)?(c=y.interleaved,c===null?(u.next=u,us===null?us=[y]:us.push(y)):(u.next=c.next,c.next=u),y.interleaved=u):(c=y.pending,c===null?u.next=u:(u.next=c.next,c.next=u),y.pending=u))}function Tf(c,u,y){if(u=u.updateQueue,u!==null&&(u=u.shared,(y&4194240)!==0)){var w=u.lanes;w&=c.pendingLanes,y|=w,u.lanes=y,Hg(c,y)}}function W1(c,u){var y=c.updateQueue,w=c.alternate;if(w!==null&&(w=w.updateQueue,y===w)){var T=null,E=null;if(y=y.firstBaseUpdate,y!==null){do{var V={eventTime:y.eventTime,lane:y.lane,tag:y.tag,payload:y.payload,callback:y.callback,next:null};E===null?T=E=V:E=E.next=V,y=y.next}while(y!==null);E===null?T=E=u:E=E.next=u}else T=E=u;y={baseState:w.baseState,firstBaseUpdate:T,lastBaseUpdate:E,shared:w.shared,effects:w.effects},c.updateQueue=y;return}c=y.lastBaseUpdate,c===null?y.firstBaseUpdate=u:c.next=u,y.lastBaseUpdate=u}function Mf(c,u,y,w){var T=c.updateQueue;yo=!1;var E=T.firstBaseUpdate,V=T.lastBaseUpdate,Q=T.shared.pending;if(Q!==null){T.shared.pending=null;var he=Q,Pe=he.next;he.next=null,V===null?E=Pe:V.next=Pe,V=he;var je=c.alternate;je!==null&&(je=je.updateQueue,Q=je.lastBaseUpdate,Q!==V&&(Q===null?je.firstBaseUpdate=Pe:Q.next=Pe,je.lastBaseUpdate=he))}if(E!==null){var _t=T.baseState;V=0,je=Pe=he=null,Q=E;do{var st=Q.lane,Yt=Q.eventTime;if((w&st)===st){je!==null&&(je=je.next={eventTime:Yt,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var et=c,ir=Q;switch(st=u,Yt=y,ir.tag){case 1:if(et=ir.payload,typeof et=="function"){_t=et.call(Yt,_t,st);break e}_t=et;break e;case 3:et.flags=et.flags&-65537|128;case 0:if(et=ir.payload,st=typeof et=="function"?et.call(Yt,_t,st):et,st==null)break e;_t=s({},_t,st);break e;case 2:yo=!0}}Q.callback!==null&&Q.lane!==0&&(c.flags|=64,st=T.effects,st===null?T.effects=[Q]:st.push(Q))}else Yt={eventTime:Yt,lane:st,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},je===null?(Pe=je=Yt,he=_t):je=je.next=Yt,V|=st;if(Q=Q.next,Q===null){if(Q=T.shared.pending,Q===null)break;st=Q,Q=st.next,st.next=null,T.lastBaseUpdate=st,T.shared.pending=null}}while(!0);if(je===null&&(he=_t),T.baseState=he,T.firstBaseUpdate=Pe,T.lastBaseUpdate=je,u=T.shared.interleaved,u!==null){T=u;do V|=T.lane,T=T.next;while(T!==u)}else E===null&&(T.shared.lanes=0);ql|=V,c.lanes=V,c.memoizedState=_t}}function H1(c,u,y){if(c=u.effects,u.effects=null,c!==null)for(u=0;u<c.length;u++){var w=c[u],T=w.callback;if(T!==null){if(w.callback=null,w=y,typeof T!="function")throw Error(o(191,T));T.call(w)}}}var G1=new r.Component().refs;function Qg(c,u,y,w){u=c.memoizedState,y=y(w,u),y=y==null?u:s({},u,y),c.memoizedState=y,c.lanes===0&&(c.updateQueue.baseState=y)}var Ef={isMounted:function(c){return(c=c._reactInternals)?P(c)===c:!1},enqueueSetState:function(c,u,y){c=c._reactInternals;var w=_r(),T=So(c),E=Fs(w,T);E.payload=u,y!=null&&(E.callback=y),vo(c,E),u=yi(c,T,w),u!==null&&Tf(u,c,T)},enqueueReplaceState:function(c,u,y){c=c._reactInternals;var w=_r(),T=So(c),E=Fs(w,T);E.tag=1,E.payload=u,y!=null&&(E.callback=y),vo(c,E),u=yi(c,T,w),u!==null&&Tf(u,c,T)},enqueueForceUpdate:function(c,u){c=c._reactInternals;var y=_r(),w=So(c),T=Fs(y,w);T.tag=2,u!=null&&(T.callback=u),vo(c,T),u=yi(c,w,y),u!==null&&Tf(u,c,w)}};function V1(c,u,y,w,T,E,V){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(w,E,V):u.prototype&&u.prototype.isPureReactComponent?!Sf(y,w)||!Sf(T,E):!0}function j1(c,u,y){var w=!1,T=ui,E=u.contextType;return typeof E=="object"&&E!==null?E=di(E):(T=Wn(u)?ss:Ct.current,w=u.contextTypes,E=(w=w!=null)?hi(c,T):ui),u=new u(y,E),c.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Ef,c.stateNode=u,u._reactInternals=c,w&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=T,c.__reactInternalMemoizedMaskedChildContext=E),u}function X1(c,u,y,w){c=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(y,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(y,w),u.state!==c&&Ef.enqueueReplaceState(u,u.state,null)}function Jg(c,u,y,w){var T=c.stateNode;T.props=y,T.state=c.memoizedState,T.refs=G1,Zg(c);var E=u.contextType;typeof E=="object"&&E!==null?T.context=di(E):(E=Wn(u)?ss:Ct.current,T.context=hi(c,E)),T.state=c.memoizedState,E=u.getDerivedStateFromProps,typeof E=="function"&&(Qg(c,u,E,y),T.state=c.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(u=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),u!==T.state&&Ef.enqueueReplaceState(T,T.state,null),Mf(c,y,T,w),T.state=c.memoizedState),typeof T.componentDidMount=="function"&&(c.flags|=4194308)}var zl=[],Wl=0,Af=null,Cf=0,fi=[],pi=0,Ma=null,Ns=1,Ds="";function Ea(c,u){zl[Wl++]=Cf,zl[Wl++]=Af,Af=c,Cf=u}function Y1(c,u,y){fi[pi++]=Ns,fi[pi++]=Ds,fi[pi++]=Ma,Ma=c;var w=Ns;c=Ds;var T=32-Yr(w)-1;w&=~(1<<T),y+=1;var E=32-Yr(u)+T;if(30<E){var V=T-T%5;E=(w&(1<<V)-1).toString(32),w>>=V,T-=V,Ns=1<<32-Yr(u)+T|y<<T|w,Ds=E+c}else Ns=1<<E|y<<T|w,Ds=c}function ey(c){c.return!==null&&(Ea(c,1),Y1(c,1,0))}function ty(c){for(;c===Af;)Af=zl[--Wl],zl[Wl]=null,Cf=zl[--Wl],zl[Wl]=null;for(;c===Ma;)Ma=fi[--pi],fi[pi]=null,Ds=fi[--pi],fi[pi]=null,Ns=fi[--pi],fi[pi]=null}var qr=null,$r=null,sn=!1,Wu=!1,Ii=null;function q1(c,u){var y=vi(5,null,null,0);y.elementType="DELETED",y.stateNode=u,y.return=c,u=c.deletions,u===null?(c.deletions=[y],c.flags|=16):u.push(y)}function $1(c,u){switch(c.tag){case 5:return u=Rt(u,c.type,c.pendingProps),u!==null?(c.stateNode=u,qr=c,$r=Dl(u),!0):!1;case 6:return u=Zt(u,c.pendingProps),u!==null?(c.stateNode=u,qr=c,$r=null,!0):!1;case 13:if(u=rn(u),u!==null){var y=Ma!==null?{id:Ns,overflow:Ds}:null;return c.memoizedState={dehydrated:u,treeContext:y,retryLane:1073741824},y=vi(18,null,null,0),y.stateNode=u,y.return=c,c.child=y,qr=c,$r=null,!0}return!1;default:return!1}}function ny(c){return(c.mode&1)!==0&&(c.flags&128)===0}function ry(c){if(sn){var u=$r;if(u){var y=u;if(!$1(c,u)){if(ny(c))throw Error(o(418));u=go(y);var w=qr;u&&$1(c,u)?q1(w,y):(c.flags=c.flags&-4097|2,sn=!1,qr=c)}}else{if(ny(c))throw Error(o(418));c.flags=c.flags&-4097|2,sn=!1,qr=c}}}function K1(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;qr=c}function Hu(c){if(!Se||c!==qr)return!1;if(!sn)return K1(c),sn=!0,!1;if(c.tag!==3&&(c.tag!==5||ze(c.type)&&!me(c.type,c.memoizedProps))){var u=$r;if(u){if(ny(c)){for(c=$r;c;)c=go(c);throw Error(o(418))}for(;u;)q1(c,u),u=go(u)}}if(K1(c),c.tag===13){if(!Se)throw Error(o(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));$r=B(c)}else $r=qr?go(c.stateNode):null;return!0}function Hl(){Se&&($r=qr=null,Wu=sn=!1)}function iy(c){Ii===null?Ii=[c]:Ii.push(c)}function Gu(c,u,y){if(c=y.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(y._owner){if(y=y._owner,y){if(y.tag!==1)throw Error(o(309));var w=y.stateNode}if(!w)throw Error(o(147,c));var T=w,E=""+c;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===E?u.ref:(u=function(V){var Q=T.refs;Q===G1&&(Q=T.refs={}),V===null?delete Q[E]:Q[E]=V},u._stringRef=E,u)}if(typeof c!="string")throw Error(o(284));if(!y._owner)throw Error(o(290,c))}return c}function Pf(c,u){throw c=Object.prototype.toString.call(u),Error(o(31,c==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":c))}function Z1(c){var u=c._init;return u(c._payload)}function Q1(c){function u(oe,J){if(c){var ue=oe.deletions;ue===null?(oe.deletions=[J],oe.flags|=16):ue.push(J)}}function y(oe,J){if(!c)return null;for(;J!==null;)u(oe,J),J=J.sibling;return null}function w(oe,J){for(oe=new Map;J!==null;)J.key!==null?oe.set(J.key,J):oe.set(J.index,J),J=J.sibling;return oe}function T(oe,J){return oe=wo(oe,J),oe.index=0,oe.sibling=null,oe}function E(oe,J,ue){return oe.index=ue,c?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<J?(oe.flags|=2,J):ue):(oe.flags|=2,J)):(oe.flags|=1048576,J)}function V(oe){return c&&oe.alternate===null&&(oe.flags|=2),oe}function Q(oe,J,ue,ke){return J===null||J.tag!==6?(J=Wy(ue,oe.mode,ke),J.return=oe,J):(J=T(J,ue),J.return=oe,J)}function he(oe,J,ue,ke){var Ze=ue.type;return Ze===d?je(oe,J,ue.props.children,ke,ue.key):J!==null&&(J.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===b&&Z1(Ze)===J.type)?(ke=T(J,ue.props),ke.ref=Gu(oe,J,ue),ke.return=oe,ke):(ke=op(ue.type,ue.key,ue.props,null,oe.mode,ke),ke.ref=Gu(oe,J,ue),ke.return=oe,ke)}function Pe(oe,J,ue,ke){return J===null||J.tag!==4||J.stateNode.containerInfo!==ue.containerInfo||J.stateNode.implementation!==ue.implementation?(J=Hy(ue,oe.mode,ke),J.return=oe,J):(J=T(J,ue.children||[]),J.return=oe,J)}function je(oe,J,ue,ke,Ze){return J===null||J.tag!==7?(J=Fa(ue,oe.mode,ke,Ze),J.return=oe,J):(J=T(J,ue),J.return=oe,J)}function _t(oe,J,ue){if(typeof J=="string"&&J!==""||typeof J=="number")return J=Wy(""+J,oe.mode,ue),J.return=oe,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case l:return ue=op(J.type,J.key,J.props,null,oe.mode,ue),ue.ref=Gu(oe,null,J),ue.return=oe,ue;case h:return J=Hy(J,oe.mode,ue),J.return=oe,J;case b:var ke=J._init;return _t(oe,ke(J._payload),ue)}if($(J)||A(J))return J=Fa(J,oe.mode,ue,null),J.return=oe,J;Pf(oe,J)}return null}function st(oe,J,ue,ke){var Ze=J!==null?J.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number")return Ze!==null?null:Q(oe,J,""+ue,ke);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:return ue.key===Ze?he(oe,J,ue,ke):null;case h:return ue.key===Ze?Pe(oe,J,ue,ke):null;case b:return Ze=ue._init,st(oe,J,Ze(ue._payload),ke)}if($(ue)||A(ue))return Ze!==null?null:je(oe,J,ue,ke,null);Pf(oe,ue)}return null}function Yt(oe,J,ue,ke,Ze){if(typeof ke=="string"&&ke!==""||typeof ke=="number")return oe=oe.get(ue)||null,Q(J,oe,""+ke,Ze);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case l:return oe=oe.get(ke.key===null?ue:ke.key)||null,he(J,oe,ke,Ze);case h:return oe=oe.get(ke.key===null?ue:ke.key)||null,Pe(J,oe,ke,Ze);case b:var Et=ke._init;return Yt(oe,J,ue,Et(ke._payload),Ze)}if($(ke)||A(ke))return oe=oe.get(ue)||null,je(J,oe,ke,Ze,null);Pf(J,ke)}return null}function et(oe,J,ue,ke){for(var Ze=null,Et=null,xt=J,kt=J=0,Vn=null;xt!==null&&kt<ue.length;kt++){xt.index>kt?(Vn=xt,xt=null):Vn=xt.sibling;var Bt=st(oe,xt,ue[kt],ke);if(Bt===null){xt===null&&(xt=Vn);break}c&&xt&&Bt.alternate===null&&u(oe,xt),J=E(Bt,J,kt),Et===null?Ze=Bt:Et.sibling=Bt,Et=Bt,xt=Vn}if(kt===ue.length)return y(oe,xt),sn&&Ea(oe,kt),Ze;if(xt===null){for(;kt<ue.length;kt++)xt=_t(oe,ue[kt],ke),xt!==null&&(J=E(xt,J,kt),Et===null?Ze=xt:Et.sibling=xt,Et=xt);return sn&&Ea(oe,kt),Ze}for(xt=w(oe,xt);kt<ue.length;kt++)Vn=Yt(xt,oe,kt,ue[kt],ke),Vn!==null&&(c&&Vn.alternate!==null&&xt.delete(Vn.key===null?kt:Vn.key),J=E(Vn,J,kt),Et===null?Ze=Vn:Et.sibling=Vn,Et=Vn);return c&&xt.forEach(function(To){return u(oe,To)}),sn&&Ea(oe,kt),Ze}function ir(oe,J,ue,ke){var Ze=A(ue);if(typeof Ze!="function")throw Error(o(150));if(ue=Ze.call(ue),ue==null)throw Error(o(151));for(var Et=Ze=null,xt=J,kt=J=0,Vn=null,Bt=ue.next();xt!==null&&!Bt.done;kt++,Bt=ue.next()){xt.index>kt?(Vn=xt,xt=null):Vn=xt.sibling;var To=st(oe,xt,Bt.value,ke);if(To===null){xt===null&&(xt=Vn);break}c&&xt&&To.alternate===null&&u(oe,xt),J=E(To,J,kt),Et===null?Ze=To:Et.sibling=To,Et=To,xt=Vn}if(Bt.done)return y(oe,xt),sn&&Ea(oe,kt),Ze;if(xt===null){for(;!Bt.done;kt++,Bt=ue.next())Bt=_t(oe,Bt.value,ke),Bt!==null&&(J=E(Bt,J,kt),Et===null?Ze=Bt:Et.sibling=Bt,Et=Bt);return sn&&Ea(oe,kt),Ze}for(xt=w(oe,xt);!Bt.done;kt++,Bt=ue.next())Bt=Yt(xt,oe,kt,Bt.value,ke),Bt!==null&&(c&&Bt.alternate!==null&&xt.delete(Bt.key===null?kt:Bt.key),J=E(Bt,J,kt),Et===null?Ze=Bt:Et.sibling=Bt,Et=Bt);return c&&xt.forEach(function(HF){return u(oe,HF)}),sn&&Ea(oe,kt),Ze}function _i(oe,J,ue,ke){if(typeof ue=="object"&&ue!==null&&ue.type===d&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var Ze=ue.key,Et=J;Et!==null;){if(Et.key===Ze){if(Ze=ue.type,Ze===d){if(Et.tag===7){y(oe,Et.sibling),J=T(Et,ue.props.children),J.return=oe,oe=J;break e}}else if(Et.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===b&&Z1(Ze)===Et.type){y(oe,Et.sibling),J=T(Et,ue.props),J.ref=Gu(oe,Et,ue),J.return=oe,oe=J;break e}y(oe,Et);break}else u(oe,Et);Et=Et.sibling}ue.type===d?(J=Fa(ue.props.children,oe.mode,ke,ue.key),J.return=oe,oe=J):(ke=op(ue.type,ue.key,ue.props,null,oe.mode,ke),ke.ref=Gu(oe,J,ue),ke.return=oe,oe=ke)}return V(oe);case h:e:{for(Et=ue.key;J!==null;){if(J.key===Et)if(J.tag===4&&J.stateNode.containerInfo===ue.containerInfo&&J.stateNode.implementation===ue.implementation){y(oe,J.sibling),J=T(J,ue.children||[]),J.return=oe,oe=J;break e}else{y(oe,J);break}else u(oe,J);J=J.sibling}J=Hy(ue,oe.mode,ke),J.return=oe,oe=J}return V(oe);case b:return Et=ue._init,_i(oe,J,Et(ue._payload),ke)}if($(ue))return et(oe,J,ue,ke);if(A(ue))return ir(oe,J,ue,ke);Pf(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"?(ue=""+ue,J!==null&&J.tag===6?(y(oe,J.sibling),J=T(J,ue),J.return=oe,oe=J):(y(oe,J),J=Wy(ue,oe.mode,ke),J.return=oe,oe=J),V(oe)):y(oe,J)}return _i}var Gl=Q1(!0),J1=Q1(!1),Vu={},mi=zn(Vu),ju=zn(Vu),Vl=zn(Vu);function hs(c){if(c===Vu)throw Error(o(174));return c}function sy(c,u){Ve(Vl,u),Ve(ju,c),Ve(mi,Vu),c=re(u),ht(mi),Ve(mi,c)}function jl(){ht(mi),ht(ju),ht(Vl)}function eb(c){var u=hs(Vl.current),y=hs(mi.current);u=F(y,c.type,u),y!==u&&(Ve(ju,c),Ve(mi,u))}function oy(c){ju.current===c&&(ht(mi),ht(ju))}var ln=zn(0);function Rf(c){for(var u=c;u!==null;){if(u.tag===13){var y=u.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||Ir(y)||ku(y)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var ay=[];function ly(){for(var c=0;c<ay.length;c++){var u=ay[c];Be?u._workInProgressVersionPrimary=null:u._workInProgressVersionSecondary=null}ay.length=0}var If=a.ReactCurrentDispatcher,gi=a.ReactCurrentBatchConfig,Xl=0,pn=null,tr=null,Gn=null,Lf=!1,Xu=!1,Yu=0,fF=0;function nr(){throw Error(o(321))}function cy(c,u){if(u===null)return!1;for(var y=0;y<u.length&&y<c.length;y++)if(!ls(c[y],u[y]))return!1;return!0}function uy(c,u,y,w,T,E){if(Xl=E,pn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,If.current=c===null||c.memoizedState===null?yF:vF,c=y(w,T),Xu){E=0;do{if(Xu=!1,Yu=0,25<=E)throw Error(o(301));E+=1,Gn=tr=null,u.updateQueue=null,If.current=_F,c=y(w,T)}while(Xu)}if(If.current=Uf,u=tr!==null&&tr.next!==null,Xl=0,Gn=tr=pn=null,Lf=!1,u)throw Error(o(300));return c}function hy(){var c=Yu!==0;return Yu=0,c}function Os(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gn===null?pn.memoizedState=Gn=c:Gn=Gn.next=c,Gn}function ds(){if(tr===null){var c=pn.alternate;c=c!==null?c.memoizedState:null}else c=tr.next;var u=Gn===null?pn.memoizedState:Gn.next;if(u!==null)Gn=u,tr=c;else{if(c===null)throw Error(o(310));tr=c,c={memoizedState:tr.memoizedState,baseState:tr.baseState,baseQueue:tr.baseQueue,queue:tr.queue,next:null},Gn===null?pn.memoizedState=Gn=c:Gn=Gn.next=c}return Gn}function Aa(c,u){return typeof u=="function"?u(c):u}function Ff(c){var u=ds(),y=u.queue;if(y===null)throw Error(o(311));y.lastRenderedReducer=c;var w=tr,T=w.baseQueue,E=y.pending;if(E!==null){if(T!==null){var V=T.next;T.next=E.next,E.next=V}w.baseQueue=T=E,y.pending=null}if(T!==null){E=T.next,w=w.baseState;var Q=V=null,he=null,Pe=E;do{var je=Pe.lane;if((Xl&je)===je)he!==null&&(he=he.next={lane:0,action:Pe.action,hasEagerState:Pe.hasEagerState,eagerState:Pe.eagerState,next:null}),w=Pe.hasEagerState?Pe.eagerState:c(w,Pe.action);else{var _t={lane:je,action:Pe.action,hasEagerState:Pe.hasEagerState,eagerState:Pe.eagerState,next:null};he===null?(Q=he=_t,V=w):he=he.next=_t,pn.lanes|=je,ql|=je}Pe=Pe.next}while(Pe!==null&&Pe!==E);he===null?V=w:he.next=Q,ls(w,u.memoizedState)||(Kr=!0),u.memoizedState=w,u.baseState=V,u.baseQueue=he,y.lastRenderedState=w}if(c=y.interleaved,c!==null){T=c;do E=T.lane,pn.lanes|=E,ql|=E,T=T.next;while(T!==c)}else T===null&&(y.lanes=0);return[u.memoizedState,y.dispatch]}function Nf(c){var u=ds(),y=u.queue;if(y===null)throw Error(o(311));y.lastRenderedReducer=c;var w=y.dispatch,T=y.pending,E=u.memoizedState;if(T!==null){y.pending=null;var V=T=T.next;do E=c(E,V.action),V=V.next;while(V!==T);ls(E,u.memoizedState)||(Kr=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),y.lastRenderedState=E}return[E,w]}function tb(){}function nb(c,u){var y=pn,w=ds(),T=u(),E=!ls(w.memoizedState,T);if(E&&(w.memoizedState=T,Kr=!0),w=w.queue,$u(sb.bind(null,y,w,c),[c]),w.getSnapshot!==u||E||Gn!==null&&Gn.memoizedState.tag&1){if(y.flags|=2048,qu(9,ib.bind(null,y,w,T,u),void 0,null),En===null)throw Error(o(349));Xl&30||rb(y,u,T)}return T}function rb(c,u,y){c.flags|=16384,c={getSnapshot:u,value:y},u=pn.updateQueue,u===null?(u={lastEffect:null,stores:null},pn.updateQueue=u,u.stores=[c]):(y=u.stores,y===null?u.stores=[c]:y.push(c))}function ib(c,u,y,w){u.value=y,u.getSnapshot=w,ob(u)&&yi(c,1,-1)}function sb(c,u,y){return y(function(){ob(u)&&yi(c,1,-1)})}function ob(c){var u=c.getSnapshot;c=c.value;try{var y=u();return!ls(c,y)}catch{return!0}}function dy(c){var u=Os();return typeof c=="function"&&(c=c()),u.memoizedState=u.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:c},u.queue=c,c=c.dispatch=gF.bind(null,pn,c),[u.memoizedState,c]}function qu(c,u,y,w){return c={tag:c,create:u,destroy:y,deps:w,next:null},u=pn.updateQueue,u===null?(u={lastEffect:null,stores:null},pn.updateQueue=u,u.lastEffect=c.next=c):(y=u.lastEffect,y===null?u.lastEffect=c.next=c:(w=y.next,y.next=c,c.next=w,u.lastEffect=c)),c}function ab(){return ds().memoizedState}function Df(c,u,y,w){var T=Os();pn.flags|=c,T.memoizedState=qu(1|u,y,void 0,w===void 0?null:w)}function Of(c,u,y,w){var T=ds();w=w===void 0?null:w;var E=void 0;if(tr!==null){var V=tr.memoizedState;if(E=V.destroy,w!==null&&cy(w,V.deps)){T.memoizedState=qu(u,y,E,w);return}}pn.flags|=c,T.memoizedState=qu(1|u,y,E,w)}function fy(c,u){return Df(8390656,8,c,u)}function $u(c,u){return Of(2048,8,c,u)}function lb(c,u){return Of(4,2,c,u)}function cb(c,u){return Of(4,4,c,u)}function ub(c,u){if(typeof u=="function")return c=c(),u(c),function(){u(null)};if(u!=null)return c=c(),u.current=c,function(){u.current=null}}function hb(c,u,y){return y=y!=null?y.concat([c]):null,Of(4,4,ub.bind(null,u,c),y)}function py(){}function db(c,u){var y=ds();u=u===void 0?null:u;var w=y.memoizedState;return w!==null&&u!==null&&cy(u,w[1])?w[0]:(y.memoizedState=[c,u],c)}function fb(c,u){var y=ds();u=u===void 0?null:u;var w=y.memoizedState;return w!==null&&u!==null&&cy(u,w[1])?w[0]:(c=c(),y.memoizedState=[c,u],c)}function pF(c,u){var y=Ut;Ut=y!==0&&4>y?y:4,c(!0);var w=gi.transition;gi.transition={};try{c(!1),u()}finally{Ut=y,gi.transition=w}}function pb(){return ds().memoizedState}function mF(c,u,y){var w=So(c);y={lane:w,action:y,hasEagerState:!1,eagerState:null,next:null},mb(c)?gb(u,y):(yb(c,u,y),y=_r(),c=yi(c,w,y),c!==null&&vb(c,u,w))}function gF(c,u,y){var w=So(c),T={lane:w,action:y,hasEagerState:!1,eagerState:null,next:null};if(mb(c))gb(u,T);else{yb(c,u,T);var E=c.alternate;if(c.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var V=u.lastRenderedState,Q=E(V,y);if(T.hasEagerState=!0,T.eagerState=Q,ls(Q,V))return}catch{}finally{}y=_r(),c=yi(c,w,y),c!==null&&vb(c,u,w)}}function mb(c){var u=c.alternate;return c===pn||u!==null&&u===pn}function gb(c,u){Xu=Lf=!0;var y=c.pending;y===null?u.next=u:(u.next=y.next,y.next=u),c.pending=u}function yb(c,u,y){En!==null&&c.mode&1&&!(Pt&2)?(c=u.interleaved,c===null?(y.next=y,us===null?us=[u]:us.push(u)):(y.next=c.next,c.next=y),u.interleaved=y):(c=u.pending,c===null?y.next=y:(y.next=c.next,c.next=y),u.pending=y)}function vb(c,u,y){if(y&4194240){var w=u.lanes;w&=c.pendingLanes,y|=w,u.lanes=y,Hg(c,y)}}var Uf={readContext:di,useCallback:nr,useContext:nr,useEffect:nr,useImperativeHandle:nr,useInsertionEffect:nr,useLayoutEffect:nr,useMemo:nr,useReducer:nr,useRef:nr,useState:nr,useDebugValue:nr,useDeferredValue:nr,useTransition:nr,useMutableSource:nr,useSyncExternalStore:nr,useId:nr,unstable_isNewReconciler:!1},yF={readContext:di,useCallback:function(c,u){return Os().memoizedState=[c,u===void 0?null:u],c},useContext:di,useEffect:fy,useImperativeHandle:function(c,u,y){return y=y!=null?y.concat([c]):null,Df(4194308,4,ub.bind(null,u,c),y)},useLayoutEffect:function(c,u){return Df(4194308,4,c,u)},useInsertionEffect:function(c,u){return Df(4,2,c,u)},useMemo:function(c,u){var y=Os();return u=u===void 0?null:u,c=c(),y.memoizedState=[c,u],c},useReducer:function(c,u,y){var w=Os();return u=y!==void 0?y(u):u,w.memoizedState=w.baseState=u,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:u},w.queue=c,c=c.dispatch=mF.bind(null,pn,c),[w.memoizedState,c]},useRef:function(c){var u=Os();return c={current:c},u.memoizedState=c},useState:dy,useDebugValue:py,useDeferredValue:function(c){var u=dy(c),y=u[0],w=u[1];return fy(function(){var T=gi.transition;gi.transition={};try{w(c)}finally{gi.transition=T}},[c]),y},useTransition:function(){var c=dy(!1),u=c[0];return c=pF.bind(null,c[1]),Os().memoizedState=c,[u,c]},useMutableSource:function(){},useSyncExternalStore:function(c,u,y){var w=pn,T=Os();if(sn){if(y===void 0)throw Error(o(407));y=y()}else{if(y=u(),En===null)throw Error(o(349));Xl&30||rb(w,u,y)}T.memoizedState=y;var E={value:y,getSnapshot:u};return T.queue=E,fy(sb.bind(null,w,E,c),[c]),w.flags|=2048,qu(9,ib.bind(null,w,E,y,u),void 0,null),y},useId:function(){var c=Os(),u=En.identifierPrefix;if(sn){var y=Ds,w=Ns;y=(w&~(1<<32-Yr(w)-1)).toString(32)+y,u=":"+u+"R"+y,y=Yu++,0<y&&(u+="H"+y.toString(32)),u+=":"}else y=fF++,u=":"+u+"r"+y.toString(32)+":";return c.memoizedState=u},unstable_isNewReconciler:!1},vF={readContext:di,useCallback:db,useContext:di,useEffect:$u,useImperativeHandle:hb,useInsertionEffect:lb,useLayoutEffect:cb,useMemo:fb,useReducer:Ff,useRef:ab,useState:function(){return Ff(Aa)},useDebugValue:py,useDeferredValue:function(c){var u=Ff(Aa),y=u[0],w=u[1];return $u(function(){var T=gi.transition;gi.transition={};try{w(c)}finally{gi.transition=T}},[c]),y},useTransition:function(){var c=Ff(Aa)[0],u=ds().memoizedState;return[c,u]},useMutableSource:tb,useSyncExternalStore:nb,useId:pb,unstable_isNewReconciler:!1},_F={readContext:di,useCallback:db,useContext:di,useEffect:$u,useImperativeHandle:hb,useInsertionEffect:lb,useLayoutEffect:cb,useMemo:fb,useReducer:Nf,useRef:ab,useState:function(){return Nf(Aa)},useDebugValue:py,useDeferredValue:function(c){var u=Nf(Aa),y=u[0],w=u[1];return $u(function(){var T=gi.transition;gi.transition={};try{w(c)}finally{gi.transition=T}},[c]),y},useTransition:function(){var c=Nf(Aa)[0],u=ds().memoizedState;return[c,u]},useMutableSource:tb,useSyncExternalStore:nb,useId:pb,unstable_isNewReconciler:!1};function my(c,u){try{var y="",w=u;do y+=dF(w),w=w.return;while(w);var T=y}catch(E){T=`
Error generating stack: `+E.message+`
`+E.stack}return{value:c,source:u,stack:T}}function gy(c,u){try{console.error(u.value)}catch(y){setTimeout(function(){throw y})}}var xF=typeof WeakMap=="function"?WeakMap:Map;function _b(c,u,y){y=Fs(-1,y),y.tag=3,y.payload={element:null};var w=u.value;return y.callback=function(){Jf||(Jf=!0,Ny=w),gy(c,u)},y}function xb(c,u,y){y=Fs(-1,y),y.tag=3;var w=c.type.getDerivedStateFromError;if(typeof w=="function"){var T=u.value;y.payload=function(){return w(T)},y.callback=function(){gy(c,u)}}var E=c.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(y.callback=function(){gy(c,u),typeof w!="function"&&(_o===null?_o=new Set([this]):_o.add(this));var V=u.stack;this.componentDidCatch(u.value,{componentStack:V!==null?V:""})}),y}function Sb(c,u,y){var w=c.pingCache;if(w===null){w=c.pingCache=new xF;var T=new Set;w.set(u,T)}else T=w.get(u),T===void 0&&(T=new Set,w.set(u,T));T.has(y)||(T.add(y),c=NF.bind(null,c,u,y),u.then(c,c))}function bb(c){do{var u;if((u=c.tag===13)&&(u=c.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return c;c=c.return}while(c!==null);return null}function wb(c,u,y,w,T){return c.mode&1?(c.flags|=65536,c.lanes=T,c):(c===u?c.flags|=65536:(c.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(u=Fs(-1,1),u.tag=2,vo(y,u))),y.lanes|=1),c)}function fs(c){c.flags|=4}function Tb(c,u){if(c!==null&&c.child===u.child)return!0;if(u.flags&16)return!1;for(c=u.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var Ku,Zu,kf,Bf;if(Xe)Ku=function(c,u){for(var y=u.child;y!==null;){if(y.tag===5||y.tag===6)ee(c,y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===u)break;for(;y.sibling===null;){if(y.return===null||y.return===u)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},Zu=function(){},kf=function(c,u,y,w,T){if(c=c.memoizedProps,c!==w){var E=u.stateNode,V=hs(mi.current);y=ie(E,y,c,w,T,V),(u.updateQueue=y)&&fs(u)}},Bf=function(c,u,y,w){y!==w&&fs(u)};else if(j){Ku=function(c,u,y,w){for(var T=u.child;T!==null;){if(T.tag===5){var E=T.stateNode;y&&w&&(E=Nt(E,T.type,T.memoizedProps,T)),ee(c,E)}else if(T.tag===6)E=T.stateNode,y&&w&&(E=Ht(E,T.memoizedProps,T)),ee(c,E);else if(T.tag!==4){if(T.tag===22&&T.memoizedState!==null)E=T.child,E!==null&&(E.return=T),Ku(c,T,!0,!0);else if(T.child!==null){T.child.return=T,T=T.child;continue}}if(T===u)break;for(;T.sibling===null;){if(T.return===null||T.return===u)return;T=T.return}T.sibling.return=T.return,T=T.sibling}};var Mb=function(c,u,y,w){for(var T=u.child;T!==null;){if(T.tag===5){var E=T.stateNode;y&&w&&(E=Nt(E,T.type,T.memoizedProps,T)),we(c,E)}else if(T.tag===6)E=T.stateNode,y&&w&&(E=Ht(E,T.memoizedProps,T)),we(c,E);else if(T.tag!==4){if(T.tag===22&&T.memoizedState!==null)E=T.child,E!==null&&(E.return=T),Mb(c,T,!0,!0);else if(T.child!==null){T.child.return=T,T=T.child;continue}}if(T===u)break;for(;T.sibling===null;){if(T.return===null||T.return===u)return;T=T.return}T.sibling.return=T.return,T=T.sibling}};Zu=function(c,u){var y=u.stateNode;if(!Tb(c,u)){c=y.containerInfo;var w=ot(c);Mb(w,u,!1,!1),y.pendingChildren=w,fs(u),Qe(c,w)}},kf=function(c,u,y,w,T){var E=c.stateNode,V=c.memoizedProps;if((c=Tb(c,u))&&V===w)u.stateNode=E;else{var Q=u.stateNode,he=hs(mi.current),Pe=null;V!==w&&(Pe=ie(Q,y,V,w,T,he)),c&&Pe===null?u.stateNode=E:(E=Ie(E,Pe,y,V,w,u,c,Q),K(E,y,w,T,he)&&fs(u),u.stateNode=E,c?fs(u):Ku(E,u,!1,!1))}},Bf=function(c,u,y,w){y!==w?(c=hs(Vl.current),y=hs(mi.current),u.stateNode=Ee(w,c,y,u),fs(u)):u.stateNode=c.stateNode}}else Zu=function(){},kf=function(){},Bf=function(){};function Qu(c,u){if(!sn)switch(c.tailMode){case"hidden":u=c.tail;for(var y=null;u!==null;)u.alternate!==null&&(y=u),u=u.sibling;y===null?c.tail=null:y.sibling=null;break;case"collapsed":y=c.tail;for(var w=null;y!==null;)y.alternate!==null&&(w=y),y=y.sibling;w===null?u||c.tail===null?c.tail=null:c.tail.sibling=null:w.sibling=null}}function rr(c){var u=c.alternate!==null&&c.alternate.child===c.child,y=0,w=0;if(u)for(var T=c.child;T!==null;)y|=T.lanes|T.childLanes,w|=T.subtreeFlags&14680064,w|=T.flags&14680064,T.return=c,T=T.sibling;else for(T=c.child;T!==null;)y|=T.lanes|T.childLanes,w|=T.subtreeFlags,w|=T.flags,T.return=c,T=T.sibling;return c.subtreeFlags|=w,c.childLanes=y,u}function SF(c,u,y){var w=u.pendingProps;switch(ty(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rr(u),null;case 1:return Wn(u.type)&&_n(),rr(u),null;case 3:return w=u.stateNode,jl(),ht(fn),ht(Ct),ly(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(c===null||c.child===null)&&(Hu(u)?fs(u):c===null||c.memoizedState.isDehydrated&&!(u.flags&256)||(u.flags|=1024,Ii!==null&&(Uy(Ii),Ii=null))),Zu(c,u),rr(u),null;case 5:oy(u),y=hs(Vl.current);var T=u.type;if(c!==null&&u.stateNode!=null)kf(c,u,T,w,y),c.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(o(166));return rr(u),null}if(c=hs(mi.current),Hu(u)){if(!Se)throw Error(o(175));c=Ug(u.stateNode,u.type,u.memoizedProps,y,c,u,!Wu),u.updateQueue=c,c!==null&&fs(u)}else{var E=Y(T,w,y,c,u);Ku(E,u,!1,!1),u.stateNode=E,K(E,T,w,y,c)&&fs(u)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return rr(u),null;case 6:if(c&&u.stateNode!=null)Bf(c,u,c.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(o(166));if(c=hs(Vl.current),y=hs(mi.current),Hu(u)){if(!Se)throw Error(o(176));if(c=u.stateNode,w=u.memoizedProps,(y=kg(c,w,u,!Wu))&&(T=qr,T!==null))switch(E=(T.mode&1)!==0,T.tag){case 3:Je(T.stateNode.containerInfo,c,w,E);break;case 5:at(T.type,T.memoizedProps,T.stateNode,c,w,E)}y&&fs(u)}else u.stateNode=Ee(w,c,y,u)}return rr(u),null;case 13:if(ht(ln),w=u.memoizedState,sn&&$r!==null&&u.mode&1&&!(u.flags&128)){for(c=$r;c;)c=go(c);return Hl(),u.flags|=98560,u}if(w!==null&&w.dehydrated!==null){if(w=Hu(u),c===null){if(!w)throw Error(o(318));if(!Se)throw Error(o(344));if(c=u.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));Bg(c,u)}else Hl(),!(u.flags&128)&&(u.memoizedState=null),u.flags|=4;return rr(u),null}return Ii!==null&&(Uy(Ii),Ii=null),u.flags&128?(u.lanes=y,u):(w=w!==null,y=!1,c===null?Hu(u):y=c.memoizedState!==null,w&&!y&&(u.child.flags|=8192,u.mode&1&&(c===null||ln.current&1?Ln===0&&(Ln=3):By())),u.updateQueue!==null&&(u.flags|=4),rr(u),null);case 4:return jl(),Zu(c,u),c===null&&Te(u.stateNode.containerInfo),rr(u),null;case 10:return $g(u.type._context),rr(u),null;case 17:return Wn(u.type)&&_n(),rr(u),null;case 19:if(ht(ln),T=u.memoizedState,T===null)return rr(u),null;if(w=(u.flags&128)!==0,E=T.rendering,E===null)if(w)Qu(T,!1);else{if(Ln!==0||c!==null&&c.flags&128)for(c=u.child;c!==null;){if(E=Rf(c),E!==null){for(u.flags|=128,Qu(T,!1),c=E.updateQueue,c!==null&&(u.updateQueue=c,u.flags|=4),u.subtreeFlags=0,c=y,w=u.child;w!==null;)y=w,T=c,y.flags&=14680066,E=y.alternate,E===null?(y.childLanes=0,y.lanes=T,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=E.childLanes,y.lanes=E.lanes,y.child=E.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=E.memoizedProps,y.memoizedState=E.memoizedState,y.updateQueue=E.updateQueue,y.type=E.type,T=E.dependencies,y.dependencies=T===null?null:{lanes:T.lanes,firstContext:T.firstContext}),w=w.sibling;return Ve(ln,ln.current&1|2),u.child}c=c.sibling}T.tail!==null&&Hn()>Fy&&(u.flags|=128,w=!0,Qu(T,!1),u.lanes=4194304)}else{if(!w)if(c=Rf(E),c!==null){if(u.flags|=128,w=!0,c=c.updateQueue,c!==null&&(u.updateQueue=c,u.flags|=4),Qu(T,!0),T.tail===null&&T.tailMode==="hidden"&&!E.alternate&&!sn)return rr(u),null}else 2*Hn()-T.renderingStartTime>Fy&&y!==1073741824&&(u.flags|=128,w=!0,Qu(T,!1),u.lanes=4194304);T.isBackwards?(E.sibling=u.child,u.child=E):(c=T.last,c!==null?c.sibling=E:u.child=E,T.last=E)}return T.tail!==null?(u=T.tail,T.rendering=u,T.tail=u.sibling,T.renderingStartTime=Hn(),u.sibling=null,c=ln.current,Ve(ln,w?c&1|2:c&1),u):(rr(u),null);case 22:case 23:return ky(),w=u.memoizedState!==null,c!==null&&c.memoizedState!==null!==w&&(u.flags|=8192),w&&u.mode&1?Zr&1073741824&&(rr(u),Xe&&u.subtreeFlags&6&&(u.flags|=8192)):rr(u),null;case 24:return null;case 25:return null}throw Error(o(156,u.tag))}var bF=a.ReactCurrentOwner,Kr=!1;function vr(c,u,y,w){u.child=c===null?J1(u,null,y,w):Gl(u,c.child,y,w)}function Eb(c,u,y,w,T){y=y.render;var E=u.ref;return Bl(u,T),w=uy(c,u,y,w,E,T),y=hy(),c!==null&&!Kr?(u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~T,Us(c,u,T)):(sn&&y&&ey(u),u.flags|=1,vr(c,u,w,T),u.child)}function Ab(c,u,y,w,T){if(c===null){var E=y.type;return typeof E=="function"&&!zy(E)&&E.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(u.tag=15,u.type=E,Cb(c,u,E,w,T)):(c=op(y.type,null,w,u,u.mode,T),c.ref=u.ref,c.return=u,u.child=c)}if(E=c.child,!(c.lanes&T)){var V=E.memoizedProps;if(y=y.compare,y=y!==null?y:Sf,y(V,w)&&c.ref===u.ref)return Us(c,u,T)}return u.flags|=1,c=wo(E,w),c.ref=u.ref,c.return=u,u.child=c}function Cb(c,u,y,w,T){if(c!==null&&Sf(c.memoizedProps,w)&&c.ref===u.ref)if(Kr=!1,(c.lanes&T)!==0)c.flags&131072&&(Kr=!0);else return u.lanes=c.lanes,Us(c,u,T);return yy(c,u,y,w,T)}function Pb(c,u,y){var w=u.pendingProps,T=w.children,E=c!==null?c.memoizedState:null;if(w.mode==="hidden")if(!(u.mode&1))u.memoizedState={baseLanes:0,cachePool:null},Ve(Yl,Zr),Zr|=y;else if(y&1073741824)u.memoizedState={baseLanes:0,cachePool:null},w=E!==null?E.baseLanes:y,Ve(Yl,Zr),Zr|=w;else return c=E!==null?E.baseLanes|y:y,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:c,cachePool:null},u.updateQueue=null,Ve(Yl,Zr),Zr|=c,null;else E!==null?(w=E.baseLanes|y,u.memoizedState=null):w=y,Ve(Yl,Zr),Zr|=w;return vr(c,u,T,y),u.child}function Rb(c,u){var y=u.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(u.flags|=512,u.flags|=2097152)}function yy(c,u,y,w,T){var E=Wn(y)?ss:Ct.current;return E=hi(u,E),Bl(u,T),y=uy(c,u,y,w,E,T),w=hy(),c!==null&&!Kr?(u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~T,Us(c,u,T)):(sn&&w&&ey(u),u.flags|=1,vr(c,u,y,T),u.child)}function Ib(c,u,y,w,T){if(Wn(y)){var E=!0;Kn(u)}else E=!1;if(Bl(u,T),u.stateNode===null)c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),j1(u,y,w),Jg(u,y,w,T),w=!0;else if(c===null){var V=u.stateNode,Q=u.memoizedProps;V.props=Q;var he=V.context,Pe=y.contextType;typeof Pe=="object"&&Pe!==null?Pe=di(Pe):(Pe=Wn(y)?ss:Ct.current,Pe=hi(u,Pe));var je=y.getDerivedStateFromProps,_t=typeof je=="function"||typeof V.getSnapshotBeforeUpdate=="function";_t||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==w||he!==Pe)&&X1(u,V,w,Pe),yo=!1;var st=u.memoizedState;V.state=st,Mf(u,w,V,T),he=u.memoizedState,Q!==w||st!==he||fn.current||yo?(typeof je=="function"&&(Qg(u,y,je,w),he=u.memoizedState),(Q=yo||V1(u,y,Q,w,st,he,Pe))?(_t||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(u.flags|=4194308)):(typeof V.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=he),V.props=w,V.state=he,V.context=Pe,w=Q):(typeof V.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{V=u.stateNode,z1(c,u),Q=u.memoizedProps,Pe=u.type===u.elementType?Q:Ri(u.type,Q),V.props=Pe,_t=u.pendingProps,st=V.context,he=y.contextType,typeof he=="object"&&he!==null?he=di(he):(he=Wn(y)?ss:Ct.current,he=hi(u,he));var Yt=y.getDerivedStateFromProps;(je=typeof Yt=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==_t||st!==he)&&X1(u,V,w,he),yo=!1,st=u.memoizedState,V.state=st,Mf(u,w,V,T);var et=u.memoizedState;Q!==_t||st!==et||fn.current||yo?(typeof Yt=="function"&&(Qg(u,y,Yt,w),et=u.memoizedState),(Pe=yo||V1(u,y,Pe,w,st,et,he)||!1)?(je||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(w,et,he),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(w,et,he)),typeof V.componentDidUpdate=="function"&&(u.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof V.componentDidUpdate!="function"||Q===c.memoizedProps&&st===c.memoizedState||(u.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===c.memoizedProps&&st===c.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=et),V.props=w,V.state=et,V.context=he,w=Pe):(typeof V.componentDidUpdate!="function"||Q===c.memoizedProps&&st===c.memoizedState||(u.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===c.memoizedProps&&st===c.memoizedState||(u.flags|=1024),w=!1)}return vy(c,u,y,w,E,T)}function vy(c,u,y,w,T,E){Rb(c,u);var V=(u.flags&128)!==0;if(!w&&!V)return T&&Ul(u,y,!1),Us(c,u,E);w=u.stateNode,bF.current=u;var Q=V&&typeof y.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,c!==null&&V?(u.child=Gl(u,c.child,null,E),u.child=Gl(u,null,Q,E)):vr(c,u,Q,E),u.memoizedState=w.state,T&&Ul(u,y,!0),u.child}function Lb(c){var u=c.stateNode;u.pendingContext?os(c,u.pendingContext,u.pendingContext!==u.context):u.context&&os(c,u.context,!1),sy(c,u.containerInfo)}function Fb(c,u,y,w,T){return Hl(),iy(T),u.flags|=256,vr(c,u,y,w),u.child}var zf={dehydrated:null,treeContext:null,retryLane:0};function Wf(c){return{baseLanes:c,cachePool:null}}function Nb(c,u,y){var w=u.pendingProps,T=ln.current,E=!1,V=(u.flags&128)!==0,Q;if((Q=V)||(Q=c!==null&&c.memoizedState===null?!1:(T&2)!==0),Q?(E=!0,u.flags&=-129):(c===null||c.memoizedState!==null)&&(T|=1),Ve(ln,T&1),c===null)return ry(u),c=u.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(u.mode&1?ku(c)?u.lanes=8:u.lanes=1073741824:u.lanes=1,null):(T=w.children,c=w.fallback,E?(w=u.mode,E=u.child,T={mode:"hidden",children:T},!(w&1)&&E!==null?(E.childLanes=0,E.pendingProps=T):E=ap(T,w,0,null),c=Fa(c,w,y,null),E.return=u,c.return=u,E.sibling=c,u.child=E,u.child.memoizedState=Wf(y),u.memoizedState=zf,c):_y(u,T));if(T=c.memoizedState,T!==null){if(Q=T.dehydrated,Q!==null){if(V)return u.flags&256?(u.flags&=-257,Hf(c,u,y,Error(o(422)))):u.memoizedState!==null?(u.child=c.child,u.flags|=128,null):(E=w.fallback,T=u.mode,w=ap({mode:"visible",children:w.children},T,0,null),E=Fa(E,T,y,null),E.flags|=2,w.return=u,E.return=u,w.sibling=E,u.child=w,u.mode&1&&Gl(u,c.child,null,y),u.child.memoizedState=Wf(y),u.memoizedState=zf,E);if(!(u.mode&1))u=Hf(c,u,y,null);else if(ku(Q))u=Hf(c,u,y,Error(o(419)));else if(w=(y&c.childLanes)!==0,Kr||w){if(w=En,w!==null){switch(y&-y){case 4:E=2;break;case 16:E=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:E=32;break;case 536870912:E=268435456;break;default:E=0}w=E&(w.suspendedLanes|y)?0:E,w!==0&&w!==T.retryLane&&(T.retryLane=w,yi(c,w,-1))}By(),u=Hf(c,u,y,Error(o(421)))}else Ir(Q)?(u.flags|=128,u.child=c.child,u=DF.bind(null,c),Nl(Q,u),u=null):(y=T.treeContext,Se&&($r=pf(Q),qr=u,sn=!0,Ii=null,Wu=!1,y!==null&&(fi[pi++]=Ns,fi[pi++]=Ds,fi[pi++]=Ma,Ns=y.id,Ds=y.overflow,Ma=u)),u=_y(u,u.pendingProps.children),u.flags|=4096);return u}return E?(w=Ob(c,u,w.children,w.fallback,y),E=u.child,T=c.child.memoizedState,E.memoizedState=T===null?Wf(y):{baseLanes:T.baseLanes|y,cachePool:null},E.childLanes=c.childLanes&~y,u.memoizedState=zf,w):(y=Db(c,u,w.children,y),u.memoizedState=null,y)}return E?(w=Ob(c,u,w.children,w.fallback,y),E=u.child,T=c.child.memoizedState,E.memoizedState=T===null?Wf(y):{baseLanes:T.baseLanes|y,cachePool:null},E.childLanes=c.childLanes&~y,u.memoizedState=zf,w):(y=Db(c,u,w.children,y),u.memoizedState=null,y)}function _y(c,u){return u=ap({mode:"visible",children:u},c.mode,0,null),u.return=c,c.child=u}function Db(c,u,y,w){var T=c.child;return c=T.sibling,y=wo(T,{mode:"visible",children:y}),!(u.mode&1)&&(y.lanes=w),y.return=u,y.sibling=null,c!==null&&(w=u.deletions,w===null?(u.deletions=[c],u.flags|=16):w.push(c)),u.child=y}function Ob(c,u,y,w,T){var E=u.mode;c=c.child;var V=c.sibling,Q={mode:"hidden",children:y};return!(E&1)&&u.child!==c?(y=u.child,y.childLanes=0,y.pendingProps=Q,u.deletions=null):(y=wo(c,Q),y.subtreeFlags=c.subtreeFlags&14680064),V!==null?w=wo(V,w):(w=Fa(w,E,T,null),w.flags|=2),w.return=u,y.return=u,y.sibling=w,u.child=y,w}function Hf(c,u,y,w){return w!==null&&iy(w),Gl(u,c.child,null,y),c=_y(u,u.pendingProps.children),c.flags|=2,u.memoizedState=null,c}function Ub(c,u,y){c.lanes|=u;var w=c.alternate;w!==null&&(w.lanes|=u),Kg(c.return,u,y)}function xy(c,u,y,w,T){var E=c.memoizedState;E===null?c.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:y,tailMode:T}:(E.isBackwards=u,E.rendering=null,E.renderingStartTime=0,E.last=w,E.tail=y,E.tailMode=T)}function kb(c,u,y){var w=u.pendingProps,T=w.revealOrder,E=w.tail;if(vr(c,u,w.children,y),w=ln.current,w&2)w=w&1|2,u.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=u.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&Ub(c,y,u);else if(c.tag===19)Ub(c,y,u);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}w&=1}if(Ve(ln,w),!(u.mode&1))u.memoizedState=null;else switch(T){case"forwards":for(y=u.child,T=null;y!==null;)c=y.alternate,c!==null&&Rf(c)===null&&(T=y),y=y.sibling;y=T,y===null?(T=u.child,u.child=null):(T=y.sibling,y.sibling=null),xy(u,!1,T,y,E);break;case"backwards":for(y=null,T=u.child,u.child=null;T!==null;){if(c=T.alternate,c!==null&&Rf(c)===null){u.child=T;break}c=T.sibling,T.sibling=y,y=T,T=c}xy(u,!0,y,null,E);break;case"together":xy(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Us(c,u,y){if(c!==null&&(u.dependencies=c.dependencies),ql|=u.lanes,!(y&u.childLanes))return null;if(c!==null&&u.child!==c.child)throw Error(o(153));if(u.child!==null){for(c=u.child,y=wo(c,c.pendingProps),u.child=y,y.return=u;c.sibling!==null;)c=c.sibling,y=y.sibling=wo(c,c.pendingProps),y.return=u;y.sibling=null}return u.child}function wF(c,u,y){switch(u.tag){case 3:Lb(u),Hl();break;case 5:eb(u);break;case 1:Wn(u.type)&&Kn(u);break;case 4:sy(u,u.stateNode.containerInfo);break;case 10:B1(u,u.type._context,u.memoizedProps.value);break;case 13:var w=u.memoizedState;if(w!==null)return w.dehydrated!==null?(Ve(ln,ln.current&1),u.flags|=128,null):y&u.child.childLanes?Nb(c,u,y):(Ve(ln,ln.current&1),c=Us(c,u,y),c!==null?c.sibling:null);Ve(ln,ln.current&1);break;case 19:if(w=(y&u.childLanes)!==0,c.flags&128){if(w)return kb(c,u,y);u.flags|=128}var T=u.memoizedState;if(T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),Ve(ln,ln.current),w)break;return null;case 22:case 23:return u.lanes=0,Pb(c,u,y)}return Us(c,u,y)}function TF(c,u){switch(ty(u),u.tag){case 1:return Wn(u.type)&&_n(),c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 3:return jl(),ht(fn),ht(Ct),ly(),c=u.flags,c&65536&&!(c&128)?(u.flags=c&-65537|128,u):null;case 5:return oy(u),null;case 13:if(ht(ln),c=u.memoizedState,c!==null&&c.dehydrated!==null){if(u.alternate===null)throw Error(o(340));Hl()}return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 19:return ht(ln),null;case 4:return jl(),null;case 10:return $g(u.type._context),null;case 22:case 23:return ky(),null;case 24:return null;default:return null}}var Gf=!1,Ca=!1,MF=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function Vf(c,u){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(w){Nr(c,u,w)}else y.current=null}function Sy(c,u,y){try{y()}catch(w){Nr(c,u,w)}}var Bb=!1;function EF(c,u){for(U(c.containerInfo),Oe=u;Oe!==null;)if(c=Oe,u=c.child,(c.subtreeFlags&1028)!==0&&u!==null)u.return=c,Oe=u;else for(;Oe!==null;){c=Oe;try{var y=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,T=y.memoizedState,E=c.stateNode,V=E.getSnapshotBeforeUpdate(c.elementType===c.type?w:Ri(c.type,w),T);E.__reactInternalSnapshotBeforeUpdate=V}break;case 3:Xe&&Fe(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Q){Nr(c,c.return,Q)}if(u=c.sibling,u!==null){u.return=c.return,Oe=u;break}Oe=c.return}return y=Bb,Bb=!1,y}function Pa(c,u,y){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var T=w=w.next;do{if((T.tag&c)===c){var E=T.destroy;T.destroy=void 0,E!==void 0&&Sy(u,y,E)}T=T.next}while(T!==w)}}function Ju(c,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var y=u=u.next;do{if((y.tag&c)===c){var w=y.create;y.destroy=w()}y=y.next}while(y!==u)}}function by(c){var u=c.ref;if(u!==null){var y=c.stateNode;switch(c.tag){case 5:c=Z(y);break;default:c=y}typeof u=="function"?u(c):u.current=c}}function zb(c,u,y){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(_f,u)}catch{}switch(u.tag){case 0:case 11:case 14:case 15:if(c=u.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var w=c=c.next;do{var T=w,E=T.destroy;T=T.tag,E!==void 0&&(T&2||T&4)&&Sy(u,y,E),w=w.next}while(w!==c)}break;case 1:if(Vf(u,y),c=u.stateNode,typeof c.componentWillUnmount=="function")try{c.props=u.memoizedProps,c.state=u.memoizedState,c.componentWillUnmount()}catch(V){Nr(u,y,V)}break;case 5:Vf(u,y);break;case 4:Xe?Xb(c,u,y):j&&j&&(u=u.stateNode.containerInfo,y=ot(u),rt(u,y))}}function Wb(c,u,y){for(var w=u;;)if(zb(c,w,y),w.child===null||Xe&&w.tag===4){if(w===u)break;for(;w.sibling===null;){if(w.return===null||w.return===u)return;w=w.return}w.sibling.return=w.return,w=w.sibling}else w.child.return=w,w=w.child}function Hb(c){var u=c.alternate;u!==null&&(c.alternate=null,Hb(u)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(u=c.stateNode,u!==null&&$e(u)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Gb(c){return c.tag===5||c.tag===3||c.tag===4}function Vb(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Gb(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function jb(c){if(Xe){e:{for(var u=c.return;u!==null;){if(Gb(u))break e;u=u.return}throw Error(o(160))}var y=u;switch(y.tag){case 5:u=y.stateNode,y.flags&32&&(Ft(u),y.flags&=-33),y=Vb(c),Ty(c,y,u);break;case 3:case 4:u=y.stateNode.containerInfo,y=Vb(c),wy(c,y,u);break;default:throw Error(o(161))}}}function wy(c,u,y){var w=c.tag;if(w===5||w===6)c=c.stateNode,u?Ke(y,c,u):mt(y,c);else if(w!==4&&(c=c.child,c!==null))for(wy(c,u,y),c=c.sibling;c!==null;)wy(c,u,y),c=c.sibling}function Ty(c,u,y){var w=c.tag;if(w===5||w===6)c=c.stateNode,u?lt(y,c,u):it(y,c);else if(w!==4&&(c=c.child,c!==null))for(Ty(c,u,y),c=c.sibling;c!==null;)Ty(c,u,y),c=c.sibling}function Xb(c,u,y){for(var w=u,T=!1,E,V;;){if(!T){T=w.return;e:for(;;){if(T===null)throw Error(o(160));switch(E=T.stateNode,T.tag){case 5:V=!1;break e;case 3:E=E.containerInfo,V=!0;break e;case 4:E=E.containerInfo,V=!0;break e}T=T.return}T=!0}if(w.tag===5||w.tag===6)Wb(c,w,y),V?ct(E,w.stateNode):He(E,w.stateNode);else if(w.tag===18)V?ae(E,w.stateNode):ce(E,w.stateNode);else if(w.tag===4){if(w.child!==null){E=w.stateNode.containerInfo,V=!0,w.child.return=w,w=w.child;continue}}else if(zb(c,w,y),w.child!==null){w.child.return=w,w=w.child;continue}if(w===u)break;for(;w.sibling===null;){if(w.return===null||w.return===u)return;w=w.return,w.tag===4&&(T=!1)}w.sibling.return=w.return,w=w.sibling}}function My(c,u){if(Xe){switch(u.tag){case 0:case 11:case 14:case 15:Pa(3,u,u.return),Ju(3,u),Pa(5,u,u.return);return;case 1:return;case 5:var y=u.stateNode;if(y!=null){var w=u.memoizedProps;c=c!==null?c.memoizedProps:w;var T=u.type,E=u.updateQueue;u.updateQueue=null,E!==null&&bt(y,E,T,c,w,u)}return;case 6:if(u.stateNode===null)throw Error(o(162));y=u.memoizedProps,xe(u.stateNode,c!==null?c.memoizedProps:y,y);return;case 3:Se&&c!==null&&c.memoizedState.isDehydrated&&ne(u.stateNode.containerInfo);return;case 12:return;case 13:jf(u);return;case 19:jf(u);return;case 17:return}throw Error(o(163))}switch(u.tag){case 0:case 11:case 14:case 15:Pa(3,u,u.return),Ju(3,u),Pa(5,u,u.return);return;case 12:return;case 13:jf(u);return;case 19:jf(u);return;case 3:Se&&c!==null&&c.memoizedState.isDehydrated&&ne(u.stateNode.containerInfo);break;case 22:case 23:return}e:if(j){switch(u.tag){case 1:case 5:case 6:break e;case 3:case 4:u=u.stateNode,rt(u.containerInfo,u.pendingChildren);break e}throw Error(o(163))}}function jf(c){var u=c.updateQueue;if(u!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new MF),u.forEach(function(w){var T=OF.bind(null,c,w);y.has(w)||(y.add(w),w.then(T,T))})}}function AF(c,u){for(Oe=u;Oe!==null;){u=Oe;var y=u.deletions;if(y!==null)for(var w=0;w<y.length;w++){var T=y[w];try{var E=c;Xe?Xb(E,T,u):Wb(E,T,u);var V=T.alternate;V!==null&&(V.return=null),T.return=null}catch(Ze){Nr(T,u,Ze)}}if(y=u.child,u.subtreeFlags&12854&&y!==null)y.return=u,Oe=y;else for(;Oe!==null;){u=Oe;try{var Q=u.flags;if(Q&32&&Xe&&Ft(u.stateNode),Q&512){var he=u.alternate;if(he!==null){var Pe=he.ref;Pe!==null&&(typeof Pe=="function"?Pe(null):Pe.current=null)}}if(Q&8192)switch(u.tag){case 13:if(u.memoizedState!==null){var je=u.alternate;(je===null||je.memoizedState===null)&&(Ly=Hn())}break;case 22:var _t=u.memoizedState!==null,st=u.alternate,Yt=st!==null&&st.memoizedState!==null;if(y=u,Xe){e:if(w=y,T=_t,E=null,Xe)for(var et=w;;){if(et.tag===5){if(E===null){E=et;var ir=et.stateNode;T?qt(ir):Re(et.stateNode,et.memoizedProps)}}else if(et.tag===6){if(E===null){var _i=et.stateNode;T?vt(_i):q(_i,et.memoizedProps)}}else if((et.tag!==22&&et.tag!==23||et.memoizedState===null||et===w)&&et.child!==null){et.child.return=et,et=et.child;continue}if(et===w)break;for(;et.sibling===null;){if(et.return===null||et.return===w)break e;E===et&&(E=null),et=et.return}E===et&&(E=null),et.sibling.return=et.return,et=et.sibling}}if(_t&&!Yt&&y.mode&1){Oe=y;for(var oe=y.child;oe!==null;){for(y=Oe=oe;Oe!==null;){w=Oe;var J=w.child;switch(w.tag){case 0:case 11:case 14:case 15:Pa(4,w,w.return);break;case 1:Vf(w,w.return);var ue=w.stateNode;if(typeof ue.componentWillUnmount=="function"){var ke=w.return;try{ue.props=w.memoizedProps,ue.state=w.memoizedState,ue.componentWillUnmount()}catch(Ze){Nr(w,ke,Ze)}}break;case 5:Vf(w,w.return);break;case 22:if(w.memoizedState!==null){$b(y);continue}}J!==null?(J.return=w,Oe=J):$b(y)}oe=oe.sibling}}}switch(Q&4102){case 2:jb(u),u.flags&=-3;break;case 6:jb(u),u.flags&=-3,My(u.alternate,u);break;case 4096:u.flags&=-4097;break;case 4100:u.flags&=-4097,My(u.alternate,u);break;case 4:My(u.alternate,u)}}catch(Ze){Nr(u,u.return,Ze)}if(y=u.sibling,y!==null){y.return=u.return,Oe=y;break}Oe=u.return}}}function CF(c,u,y){Oe=c,Yb(c)}function Yb(c,u,y){for(var w=(c.mode&1)!==0;Oe!==null;){var T=Oe,E=T.child;if(T.tag===22&&w){var V=T.memoizedState!==null||Gf;if(!V){var Q=T.alternate,he=Q!==null&&Q.memoizedState!==null||Ca;Q=Gf;var Pe=Ca;if(Gf=V,(Ca=he)&&!Pe)for(Oe=T;Oe!==null;)V=Oe,he=V.child,V.tag===22&&V.memoizedState!==null?Kb(T):he!==null?(he.return=V,Oe=he):Kb(T);for(;E!==null;)Oe=E,Yb(E),E=E.sibling;Oe=T,Gf=Q,Ca=Pe}qb(c)}else T.subtreeFlags&8772&&E!==null?(E.return=T,Oe=E):qb(c)}}function qb(c){for(;Oe!==null;){var u=Oe;if(u.flags&8772){var y=u.alternate;try{if(u.flags&8772)switch(u.tag){case 0:case 11:case 15:Ca||Ju(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!Ca)if(y===null)w.componentDidMount();else{var T=u.elementType===u.type?y.memoizedProps:Ri(u.type,y.memoizedProps);w.componentDidUpdate(T,y.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var E=u.updateQueue;E!==null&&H1(u,E,w);break;case 3:var V=u.updateQueue;if(V!==null){if(y=null,u.child!==null)switch(u.child.tag){case 5:y=Z(u.child.stateNode);break;case 1:y=u.child.stateNode}H1(u,V,y)}break;case 5:var Q=u.stateNode;y===null&&u.flags&4&&Lt(Q,u.type,u.memoizedProps,u);break;case 6:break;case 4:break;case 12:break;case 13:if(Se&&u.memoizedState===null){var he=u.alternate;if(he!==null){var Pe=he.memoizedState;if(Pe!==null){var je=Pe.dehydrated;je!==null&&le(je)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}Ca||u.flags&512&&by(u)}catch(_t){Nr(u,u.return,_t)}}if(u===c){Oe=null;break}if(y=u.sibling,y!==null){y.return=u.return,Oe=y;break}Oe=u.return}}function $b(c){for(;Oe!==null;){var u=Oe;if(u===c){Oe=null;break}var y=u.sibling;if(y!==null){y.return=u.return,Oe=y;break}Oe=u.return}}function Kb(c){for(;Oe!==null;){var u=Oe;try{switch(u.tag){case 0:case 11:case 15:var y=u.return;try{Ju(4,u)}catch(he){Nr(u,y,he)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var T=u.return;try{w.componentDidMount()}catch(he){Nr(u,T,he)}}var E=u.return;try{by(u)}catch(he){Nr(u,E,he)}break;case 5:var V=u.return;try{by(u)}catch(he){Nr(u,V,he)}}}catch(he){Nr(u,u.return,he)}if(u===c){Oe=null;break}var Q=u.sibling;if(Q!==null){Q.return=u.return,Oe=Q;break}Oe=u.return}}var Xf=0,Yf=1,qf=2,$f=3,Kf=4;if(typeof Symbol=="function"&&Symbol.for){var eh=Symbol.for;Xf=eh("selector.component"),Yf=eh("selector.has_pseudo_class"),qf=eh("selector.role"),$f=eh("selector.test_id"),Kf=eh("selector.text")}function Ey(c){var u=fe(c);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(o(364));return u}if(c=te(c),c===null)throw Error(o(362));return c.stateNode.current}function Ay(c,u){switch(u.$$typeof){case Xf:if(c.type===u.value)return!0;break;case Yf:e:{u=u.value,c=[c,0];for(var y=0;y<c.length;){var w=c[y++],T=c[y++],E=u[T];if(w.tag!==5||!_e(w)){for(;E!=null&&Ay(w,E);)T++,E=u[T];if(T===u.length){u=!0;break e}else for(w=w.child;w!==null;)c.push(w,T),w=w.sibling}}u=!1}return u;case qf:if(c.tag===5&&Ye(c.stateNode,u.value))return!0;break;case Kf:if((c.tag===5||c.tag===6)&&(c=ve(c),c!==null&&0<=c.indexOf(u.value)))return!0;break;case $f:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function Cy(c){switch(c.$$typeof){case Xf:return"<"+(R(c.value)||"Unknown")+">";case Yf:return":has("+(Cy(c)||"")+")";case qf:return'[role="'+c.value+'"]';case Kf:return'"'+c.value+'"';case $f:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function Zb(c,u){var y=[];c=[c,0];for(var w=0;w<c.length;){var T=c[w++],E=c[w++],V=u[E];if(T.tag!==5||!_e(T)){for(;V!=null&&Ay(T,V);)E++,V=u[E];if(E===u.length)y.push(T);else for(T=T.child;T!==null;)c.push(T,E),T=T.sibling}}return y}function Py(c,u){if(!N)throw Error(o(363));c=Ey(c),c=Zb(c,u),u=[],c=Array.from(c);for(var y=0;y<c.length;){var w=c[y++];if(w.tag===5)_e(w)||u.push(w.stateNode);else for(w=w.child;w!==null;)c.push(w),w=w.sibling}return u}var PF=Math.ceil,Zf=a.ReactCurrentDispatcher,Ry=a.ReactCurrentOwner,xn=a.ReactCurrentBatchConfig,Pt=0,En=null,An=null,Zn=0,Zr=0,Yl=zn(0),Ln=0,th=null,ql=0,Qf=0,Iy=0,nh=null,Lr=null,Ly=0,Fy=1/0;function $l(){Fy=Hn()+500}var Jf=!1,Ny=null,_o=null,ep=!1,xo=null,tp=0,rh=0,Dy=null,np=-1,rp=0;function _r(){return Pt&6?Hn():np!==-1?np:np=Hn()}function So(c){return c.mode&1?Pt&2&&Zn!==0?Zn&-Zn:hF.transition!==null?(rp===0&&(c=gf,gf<<=1,!(gf&4194240)&&(gf=64),rp=c),rp):(c=Ut,c!==0?c:de()):1}function yi(c,u,y){if(50<rh)throw rh=0,Dy=null,Error(o(185));var w=ip(c,u);return w===null?null:(zu(w,u,y),(!(Pt&2)||w!==En)&&(w===En&&(!(Pt&2)&&(Qf|=u),Ln===4&&bo(w,Zn)),Fr(w,y),u===1&&Pt===0&&!(c.mode&1)&&($l(),xf&&cs())),w)}function ip(c,u){c.lanes|=u;var y=c.alternate;for(y!==null&&(y.lanes|=u),y=c,c=c.return;c!==null;)c.childLanes|=u,y=c.alternate,y!==null&&(y.childLanes|=u),y=c,c=c.return;return y.tag===3?y.stateNode:null}function Fr(c,u){var y=c.callbackNode;nF(c,u);var w=vf(c,c===En?Zn:0);if(w===0)y!==null&&U1(y),c.callbackNode=null,c.callbackPriority=0;else if(u=w&-w,c.callbackPriority!==u){if(y!=null&&U1(y),u===1)c.tag===0?uF(Jb.bind(null,c)):k1(Jb.bind(null,c)),Ne?k(function(){Pt===0&&cs()}):Gg(Vg,cs),y=null;else{switch(O1(w)){case 1:y=Vg;break;case 4:y=oF;break;case 16:y=jg;break;case 536870912:y=aF;break;default:y=jg}y=lw(y,Qb.bind(null,c))}c.callbackPriority=u,c.callbackNode=y}}function Qb(c,u){if(np=-1,rp=0,Pt&6)throw Error(o(327));var y=c.callbackNode;if(La()&&c.callbackNode!==y)return null;var w=vf(c,c===En?Zn:0);if(w===0)return null;if(w&30||w&c.expiredLanes||u)u=sp(c,w);else{u=w;var T=Pt;Pt|=2;var E=nw();(En!==c||Zn!==u)&&($l(),Ra(c,u));do try{LF();break}catch(Q){tw(c,Q)}while(!0);qg(),Zf.current=E,Pt=T,An!==null?u=0:(En=null,Zn=0,u=Ln)}if(u!==0){if(u===2&&(T=zg(c),T!==0&&(w=T,u=Oy(c,T))),u===1)throw y=th,Ra(c,0),bo(c,w),Fr(c,Hn()),y;if(u===6)bo(c,w);else{if(T=c.current.alternate,!(w&30)&&!RF(T)&&(u=sp(c,w),u===2&&(E=zg(c),E!==0&&(w=E,u=Oy(c,E))),u===1))throw y=th,Ra(c,0),bo(c,w),Fr(c,Hn()),y;switch(c.finishedWork=T,c.finishedLanes=w,u){case 0:case 1:throw Error(o(345));case 2:Ia(c,Lr);break;case 3:if(bo(c,w),(w&130023424)===w&&(u=Ly+500-Hn(),10<u)){if(vf(c,0)!==0)break;if(T=c.suspendedLanes,(T&w)!==w){_r(),c.pingedLanes|=c.suspendedLanes&T;break}c.timeoutHandle=ge(Ia.bind(null,c,Lr),u);break}Ia(c,Lr);break;case 4:if(bo(c,w),(w&4194240)===w)break;for(u=c.eventTimes,T=-1;0<w;){var V=31-Yr(w);E=1<<V,V=u[V],V>T&&(T=V),w&=~E}if(w=T,w=Hn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*PF(w/1960))-w,10<w){c.timeoutHandle=ge(Ia.bind(null,c,Lr),w);break}Ia(c,Lr);break;case 5:Ia(c,Lr);break;default:throw Error(o(329))}}}return Fr(c,Hn()),c.callbackNode===y?Qb.bind(null,c):null}function Oy(c,u){var y=nh;return c.current.memoizedState.isDehydrated&&(Ra(c,u).flags|=256),c=sp(c,u),c!==2&&(u=Lr,Lr=y,u!==null&&Uy(u)),c}function Uy(c){Lr===null?Lr=c:Lr.push.apply(Lr,c)}function RF(c){for(var u=c;;){if(u.flags&16384){var y=u.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var w=0;w<y.length;w++){var T=y[w],E=T.getSnapshot;T=T.value;try{if(!ls(E(),T))return!1}catch{return!1}}}if(y=u.child,u.subtreeFlags&16384&&y!==null)y.return=u,u=y;else{if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function bo(c,u){for(u&=~Iy,u&=~Qf,c.suspendedLanes|=u,c.pingedLanes&=~u,c=c.expirationTimes;0<u;){var y=31-Yr(u),w=1<<y;c[y]=-1,u&=~w}}function Jb(c){if(Pt&6)throw Error(o(327));La();var u=vf(c,0);if(!(u&1))return Fr(c,Hn()),null;var y=sp(c,u);if(c.tag!==0&&y===2){var w=zg(c);w!==0&&(u=w,y=Oy(c,w))}if(y===1)throw y=th,Ra(c,0),bo(c,u),Fr(c,Hn()),y;if(y===6)throw Error(o(345));return c.finishedWork=c.current.alternate,c.finishedLanes=u,Ia(c,Lr),Fr(c,Hn()),null}function ew(c){xo!==null&&xo.tag===0&&!(Pt&6)&&La();var u=Pt;Pt|=1;var y=xn.transition,w=Ut;try{if(xn.transition=null,Ut=1,c)return c()}finally{Ut=w,xn.transition=y,Pt=u,!(Pt&6)&&cs()}}function ky(){Zr=Yl.current,ht(Yl)}function Ra(c,u){c.finishedWork=null,c.finishedLanes=0;var y=c.timeoutHandle;if(y!==nt&&(c.timeoutHandle=nt,tt(y)),An!==null)for(y=An.return;y!==null;){var w=y;switch(ty(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&_n();break;case 3:jl(),ht(fn),ht(Ct),ly();break;case 5:oy(w);break;case 4:jl();break;case 13:ht(ln);break;case 19:ht(ln);break;case 10:$g(w.type._context);break;case 22:case 23:ky()}y=y.return}if(En=c,An=c=wo(c.current,null),Zn=Zr=u,Ln=0,th=null,Iy=Qf=ql=0,Lr=nh=null,us!==null){for(u=0;u<us.length;u++)if(y=us[u],w=y.interleaved,w!==null){y.interleaved=null;var T=w.next,E=y.pending;if(E!==null){var V=E.next;E.next=T,w.next=V}y.pending=w}us=null}return c}function tw(c,u){do{var y=An;try{if(qg(),If.current=Uf,Lf){for(var w=pn.memoizedState;w!==null;){var T=w.queue;T!==null&&(T.pending=null),w=w.next}Lf=!1}if(Xl=0,Gn=tr=pn=null,Xu=!1,Yu=0,Ry.current=null,y===null||y.return===null){Ln=1,th=u,An=null;break}e:{var E=c,V=y.return,Q=y,he=u;if(u=Zn,Q.flags|=32768,he!==null&&typeof he=="object"&&typeof he.then=="function"){var Pe=he,je=Q,_t=je.tag;if(!(je.mode&1)&&(_t===0||_t===11||_t===15)){var st=je.alternate;st?(je.updateQueue=st.updateQueue,je.memoizedState=st.memoizedState,je.lanes=st.lanes):(je.updateQueue=null,je.memoizedState=null)}var Yt=bb(V);if(Yt!==null){Yt.flags&=-257,wb(Yt,V,Q,E,u),Yt.mode&1&&Sb(E,Pe,u),u=Yt,he=Pe;var et=u.updateQueue;if(et===null){var ir=new Set;ir.add(he),u.updateQueue=ir}else et.add(he);break e}else{if(!(u&1)){Sb(E,Pe,u),By();break e}he=Error(o(426))}}else if(sn&&Q.mode&1){var _i=bb(V);if(_i!==null){!(_i.flags&65536)&&(_i.flags|=256),wb(_i,V,Q,E,u),iy(he);break e}}E=he,Ln!==4&&(Ln=2),nh===null?nh=[E]:nh.push(E),he=my(he,Q),Q=V;do{switch(Q.tag){case 3:Q.flags|=65536,u&=-u,Q.lanes|=u;var oe=_b(Q,he,u);W1(Q,oe);break e;case 1:E=he;var J=Q.type,ue=Q.stateNode;if(!(Q.flags&128)&&(typeof J.getDerivedStateFromError=="function"||ue!==null&&typeof ue.componentDidCatch=="function"&&(_o===null||!_o.has(ue)))){Q.flags|=65536,u&=-u,Q.lanes|=u;var ke=xb(Q,E,u);W1(Q,ke);break e}}Q=Q.return}while(Q!==null)}iw(y)}catch(Ze){u=Ze,An===y&&y!==null&&(An=y=y.return);continue}break}while(!0)}function nw(){var c=Zf.current;return Zf.current=Uf,c===null?Uf:c}function By(){(Ln===0||Ln===3||Ln===2)&&(Ln=4),En===null||!(ql&268435455)&&!(Qf&268435455)||bo(En,Zn)}function sp(c,u){var y=Pt;Pt|=2;var w=nw();En===c&&Zn===u||Ra(c,u);do try{IF();break}catch(T){tw(c,T)}while(!0);if(qg(),Pt=y,Zf.current=w,An!==null)throw Error(o(261));return En=null,Zn=0,Ln}function IF(){for(;An!==null;)rw(An)}function LF(){for(;An!==null&&!iF();)rw(An)}function rw(c){var u=aw(c.alternate,c,Zr);c.memoizedProps=c.pendingProps,u===null?iw(c):An=u,Ry.current=null}function iw(c){var u=c;do{var y=u.alternate;if(c=u.return,u.flags&32768){if(y=TF(y,u),y!==null){y.flags&=32767,An=y;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Ln=6,An=null;return}}else if(y=SF(y,u,Zr),y!==null){An=y;return}if(u=u.sibling,u!==null){An=u;return}An=u=c}while(u!==null);Ln===0&&(Ln=5)}function Ia(c,u){var y=Ut,w=xn.transition;try{xn.transition=null,Ut=1,FF(c,u,y)}finally{xn.transition=w,Ut=y}return null}function FF(c,u,y){do La();while(xo!==null);if(Pt&6)throw Error(o(327));var w=c.finishedWork,T=c.finishedLanes;if(w===null)return null;if(c.finishedWork=null,c.finishedLanes=0,w===c.current)throw Error(o(177));c.callbackNode=null,c.callbackPriority=0;var E=w.lanes|w.childLanes;if(rF(c,E),c===En&&(An=En=null,Zn=0),!(w.subtreeFlags&2064)&&!(w.flags&2064)||ep||(ep=!0,lw(jg,function(){return La(),null})),E=(w.flags&15990)!==0,w.subtreeFlags&15990||E){E=xn.transition,xn.transition=null;var V=Ut;Ut=1;var Q=Pt;Pt|=4,Ry.current=null,EF(c,w),AF(c,w),G(c.containerInfo),c.current=w,CF(w),sF(),Pt=Q,Ut=V,xn.transition=E}else c.current=w;if(ep&&(ep=!1,xo=c,tp=T),E=c.pendingLanes,E===0&&(_o=null),lF(w.stateNode),Fr(c,Hn()),u!==null)for(y=c.onRecoverableError,w=0;w<u.length;w++)y(u[w]);if(Jf)throw Jf=!1,c=Ny,Ny=null,c;return tp&1&&c.tag!==0&&La(),E=c.pendingLanes,E&1?c===Dy?rh++:(rh=0,Dy=c):rh=0,cs(),null}function La(){if(xo!==null){var c=O1(tp),u=xn.transition,y=Ut;try{if(xn.transition=null,Ut=16>c?16:c,xo===null)var w=!1;else{if(c=xo,xo=null,tp=0,Pt&6)throw Error(o(331));var T=Pt;for(Pt|=4,Oe=c.current;Oe!==null;){var E=Oe,V=E.child;if(Oe.flags&16){var Q=E.deletions;if(Q!==null){for(var he=0;he<Q.length;he++){var Pe=Q[he];for(Oe=Pe;Oe!==null;){var je=Oe;switch(je.tag){case 0:case 11:case 15:Pa(8,je,E)}var _t=je.child;if(_t!==null)_t.return=je,Oe=_t;else for(;Oe!==null;){je=Oe;var st=je.sibling,Yt=je.return;if(Hb(je),je===Pe){Oe=null;break}if(st!==null){st.return=Yt,Oe=st;break}Oe=Yt}}}var et=E.alternate;if(et!==null){var ir=et.child;if(ir!==null){et.child=null;do{var _i=ir.sibling;ir.sibling=null,ir=_i}while(ir!==null)}}Oe=E}}if(E.subtreeFlags&2064&&V!==null)V.return=E,Oe=V;else e:for(;Oe!==null;){if(E=Oe,E.flags&2048)switch(E.tag){case 0:case 11:case 15:Pa(9,E,E.return)}var oe=E.sibling;if(oe!==null){oe.return=E.return,Oe=oe;break e}Oe=E.return}}var J=c.current;for(Oe=J;Oe!==null;){V=Oe;var ue=V.child;if(V.subtreeFlags&2064&&ue!==null)ue.return=V,Oe=ue;else e:for(V=J;Oe!==null;){if(Q=Oe,Q.flags&2048)try{switch(Q.tag){case 0:case 11:case 15:Ju(9,Q)}}catch(Ze){Nr(Q,Q.return,Ze)}if(Q===V){Oe=null;break e}var ke=Q.sibling;if(ke!==null){ke.return=Q.return,Oe=ke;break e}Oe=Q.return}}if(Pt=T,cs(),as&&typeof as.onPostCommitFiberRoot=="function")try{as.onPostCommitFiberRoot(_f,c)}catch{}w=!0}return w}finally{Ut=y,xn.transition=u}}return!1}function sw(c,u,y){u=my(y,u),u=_b(c,u,1),vo(c,u),u=_r(),c=ip(c,1),c!==null&&(zu(c,1,u),Fr(c,u))}function Nr(c,u,y){if(c.tag===3)sw(c,c,y);else for(;u!==null;){if(u.tag===3){sw(u,c,y);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(_o===null||!_o.has(w))){c=my(y,c),c=xb(u,c,1),vo(u,c),c=_r(),u=ip(u,1),u!==null&&(zu(u,1,c),Fr(u,c));break}}u=u.return}}function NF(c,u,y){var w=c.pingCache;w!==null&&w.delete(u),u=_r(),c.pingedLanes|=c.suspendedLanes&y,En===c&&(Zn&y)===y&&(Ln===4||Ln===3&&(Zn&130023424)===Zn&&500>Hn()-Ly?Ra(c,0):Iy|=y),Fr(c,u)}function ow(c,u){u===0&&(c.mode&1?(u=yf,yf<<=1,!(yf&130023424)&&(yf=4194304)):u=1);var y=_r();c=ip(c,u),c!==null&&(zu(c,u,y),Fr(c,y))}function DF(c){var u=c.memoizedState,y=0;u!==null&&(y=u.retryLane),ow(c,y)}function OF(c,u){var y=0;switch(c.tag){case 13:var w=c.stateNode,T=c.memoizedState;T!==null&&(y=T.retryLane);break;case 19:w=c.stateNode;break;default:throw Error(o(314))}w!==null&&w.delete(u),ow(c,y)}var aw;aw=function(c,u,y){if(c!==null)if(c.memoizedProps!==u.pendingProps||fn.current)Kr=!0;else{if(!(c.lanes&y)&&!(u.flags&128))return Kr=!1,wF(c,u,y);Kr=!!(c.flags&131072)}else Kr=!1,sn&&u.flags&1048576&&Y1(u,Cf,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),c=u.pendingProps;var T=hi(u,Ct.current);Bl(u,y),T=uy(null,u,w,c,T,y);var E=hy();return u.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Wn(w)?(E=!0,Kn(u)):E=!1,u.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,Zg(u),T.updater=Ef,u.stateNode=T,T._reactInternals=u,Jg(u,w,c,y),u=vy(null,u,w,!0,E,y)):(u.tag=0,sn&&E&&ey(u),vr(null,u,T,y),u=u.child),u;case 16:w=u.elementType;e:{switch(c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),c=u.pendingProps,T=w._init,w=T(w._payload),u.type=w,T=u.tag=kF(w),c=Ri(w,c),T){case 0:u=yy(null,u,w,c,y);break e;case 1:u=Ib(null,u,w,c,y);break e;case 11:u=Eb(null,u,w,c,y);break e;case 14:u=Ab(null,u,w,Ri(w.type,c),y);break e}throw Error(o(306,w,""))}return u;case 0:return w=u.type,T=u.pendingProps,T=u.elementType===w?T:Ri(w,T),yy(c,u,w,T,y);case 1:return w=u.type,T=u.pendingProps,T=u.elementType===w?T:Ri(w,T),Ib(c,u,w,T,y);case 3:e:{if(Lb(u),c===null)throw Error(o(387));w=u.pendingProps,E=u.memoizedState,T=E.element,z1(c,u),Mf(u,w,null,y);var V=u.memoizedState;if(w=V.element,Se&&E.isDehydrated)if(E={element:w,isDehydrated:!1,cache:V.cache,transitions:V.transitions},u.updateQueue.baseState=E,u.memoizedState=E,u.flags&256){T=Error(o(423)),u=Fb(c,u,w,y,T);break e}else if(w!==T){T=Error(o(424)),u=Fb(c,u,w,y,T);break e}else for(Se&&($r=ff(u.stateNode.containerInfo),qr=u,sn=!0,Ii=null,Wu=!1),y=J1(u,null,w,y),u.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(Hl(),w===T){u=Us(c,u,y);break e}vr(c,u,w,y)}u=u.child}return u;case 5:return eb(u),c===null&&ry(u),w=u.type,T=u.pendingProps,E=c!==null?c.memoizedProps:null,V=T.children,me(w,T)?V=null:E!==null&&me(w,E)&&(u.flags|=32),Rb(c,u),vr(c,u,V,y),u.child;case 6:return c===null&&ry(u),null;case 13:return Nb(c,u,y);case 4:return sy(u,u.stateNode.containerInfo),w=u.pendingProps,c===null?u.child=Gl(u,null,w,y):vr(c,u,w,y),u.child;case 11:return w=u.type,T=u.pendingProps,T=u.elementType===w?T:Ri(w,T),Eb(c,u,w,T,y);case 7:return vr(c,u,u.pendingProps,y),u.child;case 8:return vr(c,u,u.pendingProps.children,y),u.child;case 12:return vr(c,u,u.pendingProps.children,y),u.child;case 10:e:{if(w=u.type._context,T=u.pendingProps,E=u.memoizedProps,V=T.value,B1(u,w,V),E!==null)if(ls(E.value,V)){if(E.children===T.children&&!fn.current){u=Us(c,u,y);break e}}else for(E=u.child,E!==null&&(E.return=u);E!==null;){var Q=E.dependencies;if(Q!==null){V=E.child;for(var he=Q.firstContext;he!==null;){if(he.context===w){if(E.tag===1){he=Fs(-1,y&-y),he.tag=2;var Pe=E.updateQueue;if(Pe!==null){Pe=Pe.shared;var je=Pe.pending;je===null?he.next=he:(he.next=je.next,je.next=he),Pe.pending=he}}E.lanes|=y,he=E.alternate,he!==null&&(he.lanes|=y),Kg(E.return,y,u),Q.lanes|=y;break}he=he.next}}else if(E.tag===10)V=E.type===u.type?null:E.child;else if(E.tag===18){if(V=E.return,V===null)throw Error(o(341));V.lanes|=y,Q=V.alternate,Q!==null&&(Q.lanes|=y),Kg(V,y,u),V=E.sibling}else V=E.child;if(V!==null)V.return=E;else for(V=E;V!==null;){if(V===u){V=null;break}if(E=V.sibling,E!==null){E.return=V.return,V=E;break}V=V.return}E=V}vr(c,u,T.children,y),u=u.child}return u;case 9:return T=u.type,w=u.pendingProps.children,Bl(u,y),T=di(T),w=w(T),u.flags|=1,vr(c,u,w,y),u.child;case 14:return w=u.type,T=Ri(w,u.pendingProps),T=Ri(w.type,T),Ab(c,u,w,T,y);case 15:return Cb(c,u,u.type,u.pendingProps,y);case 17:return w=u.type,T=u.pendingProps,T=u.elementType===w?T:Ri(w,T),c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2),u.tag=1,Wn(w)?(c=!0,Kn(u)):c=!1,Bl(u,y),j1(u,w,T),Jg(u,w,T,y),vy(null,u,w,!0,c,y);case 19:return kb(c,u,y);case 22:return Pb(c,u,y)}throw Error(o(156,u.tag))};function lw(c,u){return Gg(c,u)}function UF(c,u,y,w){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vi(c,u,y,w){return new UF(c,u,y,w)}function zy(c){return c=c.prototype,!(!c||!c.isReactComponent)}function kF(c){if(typeof c=="function")return zy(c)?1:0;if(c!=null){if(c=c.$$typeof,c===x)return 11;if(c===S)return 14}return 2}function wo(c,u){var y=c.alternate;return y===null?(y=vi(c.tag,u,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=u,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,u=c.dependencies,y.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function op(c,u,y,w,T,E){var V=2;if(w=c,typeof c=="function")zy(c)&&(V=1);else if(typeof c=="string")V=5;else e:switch(c){case d:return Fa(y.children,T,E,u);case f:V=8,T|=8;break;case p:return c=vi(12,y,u,T|2),c.elementType=p,c.lanes=E,c;case _:return c=vi(13,y,u,T),c.elementType=_,c.lanes=E,c;case g:return c=vi(19,y,u,T),c.elementType=g,c.lanes=E,c;case M:return ap(y,T,E,u);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case m:V=10;break e;case v:V=9;break e;case x:V=11;break e;case S:V=14;break e;case b:V=16,w=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return u=vi(V,y,u,T),u.elementType=c,u.type=w,u.lanes=E,u}function Fa(c,u,y,w){return c=vi(7,c,w,u),c.lanes=y,c}function ap(c,u,y,w){return c=vi(22,c,w,u),c.elementType=M,c.lanes=y,c.stateNode={},c}function Wy(c,u,y){return c=vi(6,c,null,u),c.lanes=y,c}function Hy(c,u,y){return u=vi(4,c.children!==null?c.children:[],c.key,u),u.lanes=y,u.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},u}function BF(c,u,y,w,T){this.tag=u,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=nt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wg(0),this.expirationTimes=Wg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wg(0),this.identifierPrefix=w,this.onRecoverableError=T,Se&&(this.mutableSourceEagerHydrationData=null)}function cw(c,u,y,w,T,E,V,Q,he){return c=new BF(c,u,y,Q,he),u===1?(u=1,E===!0&&(u|=8)):u=0,E=vi(3,null,null,u),c.current=E,E.stateNode=c,E.memoizedState={element:w,isDehydrated:y,cache:null,transitions:null},Zg(E),c}function uw(c){if(!c)return ui;c=c._reactInternals;e:{if(P(c)!==c||c.tag!==1)throw Error(o(170));var u=c;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Wn(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(o(171))}if(c.tag===1){var y=c.type;if(Wn(y))return Ol(c,y,u)}return u}function hw(c){var u=c._reactInternals;if(u===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=X(u),c===null?null:c.stateNode}function dw(c,u){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y<u?y:u}}function Gy(c,u){dw(c,u),(c=c.alternate)&&dw(c,u)}function zF(c){return c=X(c),c===null?null:c.stateNode}function WF(){return null}return t.attemptContinuousHydration=function(c){if(c.tag===13){var u=_r();yi(c,134217728,u),Gy(c,134217728)}},t.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var u=_r(),y=So(c);yi(c,y,u),Gy(c,y)}},t.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var u=c.stateNode;if(u.current.memoizedState.isDehydrated){var y=Bu(u.pendingLanes);y!==0&&(Hg(u,y|1),Fr(u,Hn()),!(Pt&6)&&($l(),cs()))}break;case 13:var w=_r();ew(function(){return yi(c,1,w)}),Gy(c,1)}},t.batchedUpdates=function(c,u){var y=Pt;Pt|=1;try{return c(u)}finally{Pt=y,Pt===0&&($l(),xf&&cs())}},t.createComponentSelector=function(c){return{$$typeof:Xf,value:c}},t.createContainer=function(c,u,y,w,T,E,V){return cw(c,u,!1,null,y,w,T,E,V)},t.createHasPseudoClassSelector=function(c){return{$$typeof:Yf,value:c}},t.createHydrationContainer=function(c,u,y,w,T,E,V,Q,he){return c=cw(y,w,!0,c,T,E,V,Q,he),c.context=uw(null),y=c.current,w=_r(),T=So(y),E=Fs(w,T),E.callback=u??null,vo(y,E),c.current.lanes=T,zu(c,T,w),Fr(c,w),c},t.createPortal=function(c,u,y){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:w==null?null:""+w,children:c,containerInfo:u,implementation:y}},t.createRoleSelector=function(c){return{$$typeof:qf,value:c}},t.createTestNameSelector=function(c){return{$$typeof:$f,value:c}},t.createTextSelector=function(c){return{$$typeof:Kf,value:c}},t.deferredUpdates=function(c){var u=Ut,y=xn.transition;try{return xn.transition=null,Ut=16,c()}finally{Ut=u,xn.transition=y}},t.discreteUpdates=function(c,u,y,w,T){var E=Ut,V=xn.transition;try{return xn.transition=null,Ut=1,c(u,y,w,T)}finally{Ut=E,xn.transition=V,Pt===0&&$l()}},t.findAllNodes=Py,t.findBoundingRects=function(c,u){if(!N)throw Error(o(363));u=Py(c,u),c=[];for(var y=0;y<u.length;y++)c.push(be(u[y]));for(u=c.length-1;0<u;u--){y=c[u];for(var w=y.x,T=w+y.width,E=y.y,V=E+y.height,Q=u-1;0<=Q;Q--)if(u!==Q){var he=c[Q],Pe=he.x,je=Pe+he.width,_t=he.y,st=_t+he.height;if(w>=Pe&&E>=_t&&T<=je&&V<=st){c.splice(u,1);break}else if(w!==Pe||y.width!==he.width||st<E||_t>V){if(!(E!==_t||y.height!==he.height||je<w||Pe>T)){Pe>w&&(he.width+=Pe-w,he.x=w),je<T&&(he.width=T-Pe),c.splice(u,1);break}}else{_t>E&&(he.height+=_t-E,he.y=E),st<V&&(he.height=V-_t),c.splice(u,1);break}}}return c},t.findHostInstance=hw,t.findHostInstanceWithNoPortals=function(c){return c=H(c),c=c!==null?W(c):null,c===null?null:c.stateNode},t.findHostInstanceWithWarning=function(c){return hw(c)},t.flushControlled=function(c){var u=Pt;Pt|=1;var y=xn.transition,w=Ut;try{xn.transition=null,Ut=1,c()}finally{Ut=w,xn.transition=y,Pt=u,Pt===0&&($l(),cs())}},t.flushPassiveEffects=La,t.flushSync=ew,t.focusWithin=function(c,u){if(!N)throw Error(o(363));for(c=Ey(c),u=Zb(c,u),u=Array.from(u),c=0;c<u.length;){var y=u[c++];if(!_e(y)){if(y.tag===5&&Ce(y.stateNode))return!0;for(y=y.child;y!==null;)u.push(y),y=y.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Ut},t.getFindAllNodesFailureDescription=function(c,u){if(!N)throw Error(o(363));var y=0,w=[];c=[Ey(c),0];for(var T=0;T<c.length;){var E=c[T++],V=c[T++],Q=u[V];if((E.tag!==5||!_e(E))&&(Ay(E,Q)&&(w.push(Cy(Q)),V++,V>y&&(y=V)),V<u.length))for(E=E.child;E!==null;)c.push(E,V),E=E.sibling}if(y<u.length){for(c=[];y<u.length;y++)c.push(Cy(u[y]));return`findAllNodes was able to match part of the selector:
`+(w.join(" > ")+`
No matching component was found for:
`)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return Z(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:zF,findFiberByHostInstance:c.findFiberByHostInstance||WF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)c=!0;else{try{_f=u.inject(c),as=u}catch{}c=!!u.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,u,y,w){if(!N)throw Error(o(363));c=Py(c,u);var T=Ue(c,y,w).disconnect;return{disconnect:function(){T()}}},t.registerMutableSourceForHydration=function(c,u){var y=u._getVersion;y=y(u._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[u,y]:c.mutableSourceEagerHydrationData.push(u,y)},t.runWithPriority=function(c,u){var y=Ut;try{return Ut=c,u()}finally{Ut=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,u,y,w){var T=u.current,E=_r(),V=So(T);return y=uw(y),u.context===null?u.context=y:u.pendingContext=y,u=Fs(E,V),u.payload={element:c},w=w===void 0?null:w,w!==null&&(u.callback=w),vo(T,u),c=yi(T,V,E),c!==null&&Tf(c,T,V),V},t};NL.exports=FK;var NK=NL.exports;const DK=wu(NK);var DL={exports:{}},OL={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(n){function e(F,U){var G=F.length;F.push(U);e:for(;0<G;){var Y=G-1>>>1,ee=F[Y];if(0<i(ee,U))F[Y]=U,F[G]=ee,G=Y;else break e}}function t(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var U=F[0],G=F.pop();if(G!==U){F[0]=G;e:for(var Y=0,ee=F.length,K=ee>>>1;Y<K;){var ie=2*(Y+1)-1,me=F[ie],Ee=ie+1,ge=F[Ee];if(0>i(me,G))Ee<ee&&0>i(ge,me)?(F[Y]=ge,F[Ee]=G,Y=Ee):(F[Y]=me,F[ie]=G,Y=ie);else if(Ee<ee&&0>i(ge,G))F[Y]=ge,F[Ee]=G,Y=Ee;else break e}}return U}function i(F,U){var G=F.sortIndex-U.sortIndex;return G!==0?G:F.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],h=[],d=1,f=null,p=3,m=!1,v=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(F){for(var U=t(h);U!==null;){if(U.callback===null)r(h);else if(U.startTime<=F)r(h),U.sortIndex=U.expirationTime,e(l,U);else break;U=t(h)}}function M(F){if(x=!1,b(F),!v)if(t(l)!==null)v=!0,Z(C);else{var U=t(h);U!==null&&re(M,U.startTime-F)}}function C(F,U){v=!1,x&&(x=!1,g(O),O=-1),m=!0;var G=p;try{for(b(U),f=t(l);f!==null&&(!(f.expirationTime>U)||F&&!H());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var ee=Y(f.expirationTime<=U);U=n.unstable_now(),typeof ee=="function"?f.callback=ee:f===t(l)&&r(l),b(U)}else r(l);f=t(l)}if(f!==null)var K=!0;else{var ie=t(h);ie!==null&&re(M,ie.startTime-U),K=!1}return K}finally{f=null,p=G,m=!1}}var A=!1,R=null,O=-1,P=5,I=-1;function H(){return!(n.unstable_now()-I<P)}function X(){if(R!==null){var F=n.unstable_now();I=F;var U=!0;try{U=R(!0,F)}finally{U?se():(A=!1,R=null)}}else A=!1}var se;if(typeof S=="function")se=function(){S(X)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,$=W.port2;W.port1.onmessage=X,se=function(){$.postMessage(null)}}else se=function(){_(X,0)};function Z(F){R=F,A||(A=!0,se())}function re(F,U){O=_(function(){F(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(F){F.callback=null},n.unstable_continueExecution=function(){v||m||(v=!0,Z(C))},n.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"):P=0<F?Math.floor(1e3/F):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function(F){switch(p){case 1:case 2:case 3:var U=3;break;default:U=p}var G=p;p=U;try{return F()}finally{p=G}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(F,U){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var G=p;p=F;try{return U()}finally{p=G}},n.unstable_scheduleCallback=function(F,U,G){var Y=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Y+G:Y):G=Y,F){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=G+ee,F={id:d++,callback:U,priorityLevel:F,startTime:G,expirationTime:ee,sortIndex:-1},G>Y?(F.sortIndex=G,e(h,F),t(l)===null&&F===t(h)&&(x?(g(O),O=-1):x=!0,re(M,G-Y))):(F.sortIndex=ee,e(l,F),v||m||(v=!0,Z(C))),F},n.unstable_shouldYield=H,n.unstable_wrapCallback=function(F){var U=p;return function(){var G=p;p=U;try{return F.apply(this,arguments)}finally{p=G}}}})(OL);DL.exports=OL;var VE=DL.exports;const N1={},OK=n=>void Object.assign(N1,n);function UK(n,e){function t(d,{args:f=[],attach:p,...m},v){let x=`${d[0].toUpperCase()}${d.slice(1)}`,_;if(d==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;_=bc(g,{type:d,root:v,attach:p,primitive:!0})}else{const g=N1[x];if(!g)throw new Error(`R3F: ${x} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(f))throw new Error("R3F: The args prop must be an array!");_=bc(new g(...f),{type:d,root:v,attach:p,memoizedProps:{args:f}})}return _.__r3f.attach===void 0&&(_.isBufferGeometry?_.__r3f.attach="geometry":_.isMaterial&&(_.__r3f.attach="material")),x!=="inject"&&m_(_,m),_}function r(d,f){let p=!1;if(f){var m,v;(m=f.__r3f)!=null&&m.attach?p_(d,f,f.__r3f.attach):f.isObject3D&&d.isObject3D&&(d.add(f),p=!0),p||(v=d.__r3f)==null||v.objects.push(f),f.__r3f||bc(f,{}),f.__r3f.parent=d,Ex(f),wc(f)}}function i(d,f,p){let m=!1;if(f){var v,x;if((v=f.__r3f)!=null&&v.attach)p_(d,f,f.__r3f.attach);else if(f.isObject3D&&d.isObject3D){f.parent=d,f.dispatchEvent({type:"added"}),d.dispatchEvent({type:"childadded",child:f});const _=d.children.filter(S=>S!==f),g=_.indexOf(p);d.children=[..._.slice(0,g),f,..._.slice(g)],m=!0}m||(x=d.__r3f)==null||x.objects.push(f),f.__r3f||bc(f,{}),f.__r3f.parent=d,Ex(f),wc(f)}}function s(d,f,p=!1){d&&[...d].forEach(m=>o(f,m,p))}function o(d,f,p){if(f){var m,v,x;if(f.__r3f&&(f.__r3f.parent=null),(m=d.__r3f)!=null&&m.objects&&(d.__r3f.objects=d.__r3f.objects.filter(M=>M!==f)),(v=f.__r3f)!=null&&v.attach)$E(d,f,f.__r3f.attach);else if(f.isObject3D&&d.isObject3D){var _;d.remove(f),(_=f.__r3f)!=null&&_.root&&jK(Km(f),f)}const S=(x=f.__r3f)==null?void 0:x.primitive,b=!S&&(p===void 0?f.dispose!==null:p);if(!S){var g;s((g=f.__r3f)==null?void 0:g.objects,f,b),s(f.children,f,b)}if(delete f.__r3f,b&&f.dispose&&f.type!=="Scene"){const M=()=>{try{f.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?VE.unstable_scheduleCallback(VE.unstable_IdlePriority,M):M()}wc(d)}}function a(d,f,p,m){var v;const x=(v=d.__r3f)==null?void 0:v.parent;if(!x)return;const _=t(f,p,d.__r3f.root);if(d.children){for(const g of d.children)g.__r3f&&r(_,g);d.children=d.children.filter(g=>!g.__r3f)}d.__r3f.objects.forEach(g=>r(_,g)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(x,d),_.parent&&(_.__r3f.autoRemovedBeforeAppend=!0),r(x,_),_.raycast&&_.__r3f.eventCount&&Km(_).getState().internal.interaction.push(_),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=_,g.ref&&(typeof g.ref=="function"?g.ref(_):g.ref.current=_))})}const l=()=>{};return{reconciler:DK({createInstance:t,removeChild:o,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,f)=>{if(!f)return;const p=d.getState().scene;p.__r3f&&(p.__r3f.root=d,r(p,f))},removeChildFromContainer:(d,f)=>{f&&o(d.getState().scene,f)},insertInContainerBefore:(d,f,p)=>{if(!f||!p)return;const m=d.getState().scene;m.__r3f&&i(m,f,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var f;return!!((f=d==null?void 0:d.__r3f)!=null?f:{}).handlers},prepareUpdate(d,f,p,m){var v;if(((v=d==null?void 0:d.__r3f)!=null?v:{}).primitive&&m.object&&m.object!==d)return[!0];{const{args:_=[],children:g,...S}=m,{args:b=[],children:M,...C}=p;if(!Array.isArray(_))throw new Error("R3F: the args prop must be an array!");if(_.some((R,O)=>R!==b[O]))return[!0];const A=GL(d,S,C,!0);return A.changes.length?[!1,A]:null}},commitUpdate(d,[f,p],m,v,x,_){f?a(d,m,x,_):m_(d,p)},commitMount(d,f,p,m){var v;const x=(v=d.__r3f)!=null?v:{};d.raycast&&x.handlers&&x.eventCount&&Km(d).getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>bc(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var f;const{attach:p,parent:m}=(f=d.__r3f)!=null?f:{};p&&m&&$E(m,d,p),d.isObject3D&&(d.visible=!1),wc(d)},unhideInstance(d,f){var p;const{attach:m,parent:v}=(p=d.__r3f)!=null?p:{};m&&v&&p_(v,d,m),(d.isObject3D&&f.visible==null||f.visible)&&(d.visible=!0),wc(d)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Wc.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&tn.fun(performance.now)?performance.now:tn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:tn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:tn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:m_}}var jE,XE;const f_=n=>"colorSpace"in n||"outputColorSpace"in n,UL=()=>{var n;return(n=N1.ColorManagement)!=null?n:null},kL=n=>n&&n.isOrthographicCamera,kK=n=>n&&n.hasOwnProperty("current"),hf=typeof window<"u"&&((jE=window.document)!=null&&jE.createElement||((XE=window.navigator)==null?void 0:XE.product)==="ReactNative")?D.useLayoutEffect:D.useEffect;function BL(n){const e=D.useRef(n);return hf(()=>void(e.current=n),[n]),e}function BK({set:n}){return hf(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class zL extends D.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}zL.getDerivedStateFromError=()=>({error:!0});const WL="__default",YE=new Map,zK=n=>n&&!!n.memoized&&!!n.changes;function HL(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Ah=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Km(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const tn={obj:n=>n===Object(n)&&!tn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:r="reference",strict:i=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(tn.str(n)||tn.num(n)||tn.boo(n))return n===e;const s=tn.obj(n);if(s&&r==="reference")return n===e;const o=tn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&r==="shallow"){for(a in i?e:n)if(!tn.equ(n[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:n)if(n[a]!==e[a])return!1;if(tn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function WK(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function bc(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function Mx(n,e){let t=n;if(e.includes("-")){const r=e.split("-"),i=r.pop();return t=r.reduce((s,o)=>s[o],n),{target:t,key:i}}else return{target:t,key:e}}const qE=/-\d+$/;function p_(n,e,t){if(tn.str(t)){if(qE.test(t)){const s=t.replace(qE,""),{target:o,key:a}=Mx(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:r,key:i}=Mx(n,t);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=t(n,e)}function $E(n,e,t){var r,i;if(tn.str(t)){const{target:s,key:o}=Mx(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(n,e);(i=e.__r3f)==null||delete i.previousAttach}function GL(n,{children:e,key:t,ref:r,...i},{children:s,key:o,ref:a,...l}={},h=!1){const d=n.__r3f,f=Object.entries(i),p=[];if(h){const v=Object.keys(l);for(let x=0;x<v.length;x++)i.hasOwnProperty(v[x])||f.unshift([v[x],WL+"remove"])}f.forEach(([v,x])=>{var _;if((_=n.__r3f)!=null&&_.primitive&&v==="object"||tn.equ(x,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return p.push([v,x,!0,[]]);let g=[];v.includes("-")&&(g=v.split("-")),p.push([v,x,!1,g]);for(const S in i){const b=i[S];S.startsWith(`${v}-`)&&p.push([S,b,!1,S.split("-")])}});const m={...i};return d!=null&&d.memoizedProps&&d!=null&&d.memoizedProps.args&&(m.args=d.memoizedProps.args),d!=null&&d.memoizedProps&&d!=null&&d.memoizedProps.attach&&(m.attach=d.memoizedProps.attach),{memoized:m,changes:p}}const HK=typeof process<"u"&&!1;function m_(n,e){var t;const r=n.__r3f,i=r==null?void 0:r.root,s=i==null||i.getState==null?void 0:i.getState(),{memoized:o,changes:a}=zK(e)?e:GL(n,e),l=r==null?void 0:r.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let p=0;p<a.length;p++){let[m,v,x,_]=a[p];if(f_(n)){const M="srgb",C="srgb-linear";m==="encoding"?(m="colorSpace",v=v===3001?M:C):m==="outputEncoding"&&(m="outputColorSpace",v=v===3001?M:C)}let g=n,S=g[m];if(_.length&&(S=_.reduce((b,M)=>b[M],n),!(S&&S.set))){const[b,...M]=_.reverse();g=M.reverse().reduce((C,A)=>C[A],n),m=b}if(v===WL+"remove")if(g.constructor){let b=YE.get(g.constructor);b||(b=new g.constructor,YE.set(g.constructor,b)),v=b[m]}else v=0;if(x&&r)v?r.handlers[m]=v:delete r.handlers[m],r.eventCount=Object.keys(r.handlers).length;else if(S&&S.set&&(S.copy||S instanceof fl)){if(Array.isArray(v))S.fromArray?S.fromArray(v):S.set(...v);else if(S.copy&&v&&v.constructor&&(HK?S.constructor.name===v.constructor.name:S.constructor===v.constructor))S.copy(v);else if(v!==void 0){var h;const b=(h=S)==null?void 0:h.isColor;!b&&S.setScalar?S.setScalar(v):S instanceof fl&&v instanceof fl?S.mask=v.mask:S.set(v),!UL()&&s&&!s.linear&&b&&S.convertSRGBToLinear()}}else{var d;if(g[m]=v,(d=g[m])!=null&&d.isTexture&&g[m].format===Mr&&g[m].type===Es&&s){const b=g[m];f_(b)&&f_(s.gl)?b.colorSpace=s.gl.outputColorSpace:b.encoding=s.gl.outputEncoding}}wc(n)}if(r&&r.parent&&n.raycast&&l!==r.eventCount){const p=Km(n).getState().internal,m=p.interaction.indexOf(n);m>-1&&p.interaction.splice(m,1),r.eventCount&&p.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&Ex(n),n}function wc(n){var e,t;const r=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();r&&r.internal.frames===0&&r.invalidate()}function Ex(n){n.onUpdate==null||n.onUpdate(n)}function GK(n,e){n.manual||(kL(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Tm(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function VK(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Wc.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Wc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Wc.ContinuousEventPriority;default:return Wc.DefaultEventPriority}}function VL(n,e,t,r){const i=t.get(e);i&&(t.delete(e),t.size===0&&(n.delete(r),i.target.releasePointerCapture(r)))}function jK(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(r=>r!==e),t.initialHits=t.initialHits.filter(r=>r!==e),t.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((r,i)=>{VL(t.capturedMap,e,r,i)})}function XK(n){function e(l){const{internal:h}=n.getState(),d=l.offsetX-h.initialClick[0],f=l.offsetY-h.initialClick[1];return Math.round(Math.sqrt(d*d+f*f))}function t(l){return l.filter(h=>["Move","Over","Enter","Out","Leave"].some(d=>{var f;return(f=h.__r3f)==null?void 0:f.handlers["onPointer"+d]}))}function r(l,h){const d=n.getState(),f=new Set,p=[],m=h?h(d.internal.interaction):d.internal.interaction;for(let g=0;g<m.length;g++){const S=Ah(m[g]);S&&(S.raycaster.camera=void 0)}d.previousRoot||d.events.compute==null||d.events.compute(l,d);function v(g){const S=Ah(g);if(!S||!S.events.enabled||S.raycaster.camera===null)return[];if(S.raycaster.camera===void 0){var b;S.events.compute==null||S.events.compute(l,S,(b=S.previousRoot)==null?void 0:b.getState()),S.raycaster.camera===void 0&&(S.raycaster.camera=null)}return S.raycaster.camera?S.raycaster.intersectObject(g,!0):[]}let x=m.flatMap(v).sort((g,S)=>{const b=Ah(g.object),M=Ah(S.object);return!b||!M?g.distance-S.distance:M.events.priority-b.events.priority||g.distance-S.distance}).filter(g=>{const S=Tm(g);return f.has(S)?!1:(f.add(S),!0)});d.events.filter&&(x=d.events.filter(x,d));for(const g of x){let S=g.object;for(;S;){var _;(_=S.__r3f)!=null&&_.eventCount&&p.push({...g,eventObject:S}),S=S.parent}}if("pointerId"in l&&d.internal.capturedMap.has(l.pointerId))for(let g of d.internal.capturedMap.get(l.pointerId).values())f.has(Tm(g.intersection))||p.push(g.intersection);return p}function i(l,h,d,f){const p=n.getState();if(l.length){const m={stopped:!1};for(const v of l){const x=Ah(v.object)||p,{raycaster:_,pointer:g,camera:S,internal:b}=x,M=new z(g.x,g.y,0).unproject(S),C=I=>{var H,X;return(H=(X=b.capturedMap.get(I))==null?void 0:X.has(v.eventObject))!=null?H:!1},A=I=>{const H={intersection:v,target:h.target};b.capturedMap.has(I)?b.capturedMap.get(I).set(v.eventObject,H):b.capturedMap.set(I,new Map([[v.eventObject,H]])),h.target.setPointerCapture(I)},R=I=>{const H=b.capturedMap.get(I);H&&VL(b.capturedMap,v.eventObject,H,I)};let O={};for(let I in h){let H=h[I];typeof H!="function"&&(O[I]=H)}let P={...v,...O,pointer:g,intersections:l,stopped:m.stopped,delta:d,unprojectedPoint:M,ray:_.ray,camera:S,stopPropagation(){const I="pointerId"in h&&b.capturedMap.get(h.pointerId);if((!I||I.has(v.eventObject))&&(P.stopped=m.stopped=!0,b.hovered.size&&Array.from(b.hovered.values()).find(H=>H.eventObject===v.eventObject))){const H=l.slice(0,l.indexOf(v));s([...H,v])}},target:{hasPointerCapture:C,setPointerCapture:A,releasePointerCapture:R},currentTarget:{hasPointerCapture:C,setPointerCapture:A,releasePointerCapture:R},nativeEvent:h};if(f(P),m.stopped===!0)break}}return l}function s(l){const{internal:h}=n.getState();for(const d of h.hovered.values())if(!l.length||!l.find(f=>f.object===d.object&&f.index===d.index&&f.instanceId===d.instanceId)){const p=d.eventObject.__r3f,m=p==null?void 0:p.handlers;if(h.hovered.delete(Tm(d)),p!=null&&p.eventCount){const v={...d,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function o(l,h){for(let d=0;d<h.length;d++){const f=h[d].__r3f;f==null||f.handlers.onPointerMissed==null||f.handlers.onPointerMissed(l)}}function a(l){switch(l){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return h=>{const{internal:d}=n.getState();"pointerId"in h&&d.capturedMap.has(h.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(h.pointerId)&&(d.capturedMap.delete(h.pointerId),s([]))})}}return function(d){const{onPointerMissed:f,internal:p}=n.getState();p.lastEvent.current=d;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=r(d,m?t:void 0),g=v?e(d):0;l==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=_.map(b=>b.eventObject)),v&&!_.length&&g<=2&&(o(d,p.interaction),f&&f(d)),m&&s(_);function S(b){const M=b.eventObject,C=M.__r3f,A=C==null?void 0:C.handlers;if(C!=null&&C.eventCount)if(m){if(A.onPointerOver||A.onPointerEnter||A.onPointerOut||A.onPointerLeave){const R=Tm(b),O=p.hovered.get(R);O?O.stopped&&b.stopPropagation():(p.hovered.set(R,b),A.onPointerOver==null||A.onPointerOver(b),A.onPointerEnter==null||A.onPointerEnter(b))}A.onPointerMove==null||A.onPointerMove(b)}else{const R=A[l];R?(!v||p.initialHits.includes(M))&&(o(d,p.interaction.filter(O=>!p.initialHits.includes(O))),R(b)):v&&p.initialHits.includes(M)&&o(d,p.interaction.filter(O=>!p.initialHits.includes(O)))}}i(_,d,g,S)}}return{handlePointer:a}}const jL=n=>!!(n!=null&&n.render),XL=D.createContext(null),YK=(n,e)=>{const t=RK((a,l)=>{const h=new z,d=new z,f=new z;function p(g=l().camera,S=d,b=l().size){const{width:M,height:C,top:A,left:R}=b,O=M/C;S.isVector3?f.copy(S):f.set(...S);const P=g.getWorldPosition(h).distanceTo(f);if(kL(g))return{width:M/g.zoom,height:C/g.zoom,top:A,left:R,factor:1,distance:P,aspect:O};{const I=g.fov*Math.PI/180,H=2*Math.tan(I/2)*P,X=H*(M/C);return{width:X,height:H,top:A,left:R,factor:M/X,distance:P,aspect:O}}}let m;const v=g=>a(S=>({performance:{...S.performance,current:g}})),x=new ye;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(l(),g),advance:(g,S)=>e(g,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new R1,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(S=>({...S,events:{...S.events,...g}})),setSize:(g,S,b,M,C)=>{const A=l().camera,R={width:g,height:S,top:M||0,left:C||0,updateStyle:b};a(O=>({size:R,viewport:{...O.viewport,...p(A,d,R)}}))},setDpr:g=>a(S=>{const b=HL(g);return{viewport:{...S.viewport,dpr:b,initialDpr:S.viewport.initialDpr||b}}}),setFrameloop:(g="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,g!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:D.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,S,b)=>{const M=l().internal;return M.priority=M.priority+(S>0?1:0),M.subscribers.push({ref:g,priority:S,store:b}),M.subscribers=M.subscribers.sort((C,A)=>C.priority-A.priority),()=>{const C=l().internal;C!=null&&C.subscribers&&(C.priority=C.priority-(S>0?1:0),C.subscribers=C.subscribers.filter(A=>A.ref!==g))}}}}}),r=t.getState();let i=r.size,s=r.viewport.dpr,o=r.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:h,gl:d,set:f}=t.getState();if(l.width!==i.width||l.height!==i.height||h.dpr!==s){var p;i=l,s=h.dpr,GK(a,l),d.setPixelRatio(h.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&d.domElement instanceof HTMLCanvasElement;d.setSize(l.width,l.height,m)}a!==o&&(o=a,f(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Mm,qK=new Set,$K=new Set,KK=new Set;function g_(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Ch(n,e){switch(n){case"before":return g_(qK,e);case"after":return g_($K,e);case"tail":return g_(KK,e)}}let y_,v_;function __(n,e,t){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(r=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),y_=e.internal.subscribers,Mm=0;Mm<y_.length;Mm++)v_=y_[Mm],v_.ref.current(v_.store.getState(),r,t);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}function ZK(n){let e=!1,t=!1,r,i,s;function o(h){i=requestAnimationFrame(o),e=!0,r=0,Ch("before",h),t=!0;for(const f of n.values()){var d;s=f.store.getState(),s.internal.active&&(s.frameloop==="always"||s.internal.frames>0)&&!((d=s.gl.xr)!=null&&d.isPresenting)&&(r+=__(h,s))}if(t=!1,Ch("after",h),r===0)return Ch("tail",h),e=!1,cancelAnimationFrame(i)}function a(h,d=1){var f;if(!h)return n.forEach(p=>a(p.store.getState(),d));(f=h.gl.xr)!=null&&f.isPresenting||!h.internal.active||h.frameloop==="never"||(d>1?h.internal.frames=Math.min(60,h.internal.frames+d):t?h.internal.frames=2:h.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(h,d=!0,f,p){if(d&&Ch("before",h),f)__(h,f,p);else for(const m of n.values())__(h,m.store.getState());d&&Ch("after",h)}return{loop:o,invalidate:a,advance:l}}function YL(){const n=D.useContext(XL);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function QK(n=t=>t,e){return YL()(n,e)}function Fl(n,e=0){const t=YL(),r=t.getState().internal.subscribe,i=BL(n);return hf(()=>r(i,e,t),[e,r,t]),null}const bu=new Map,{invalidate:KE,advance:ZE}=ZK(bu),{reconciler:N0,applyProps:_c}=UK(bu,VK),xc={objects:"shallow",strict:!1},JK=(n,e)=>{const t=typeof n=="function"?n(e):n;return jL(t)?t:new h1({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function eZ(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:s,left:o,updateStyle:a=t}=e;return{width:r,height:i,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:r,height:i,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:r,height:i,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function tZ(n){const e=bu.get(n),t=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=r||YK(KE,ZE),o=t||N0.createContainer(s,Wc.ConcurrentRoot,null,!1,null,"",i,null);e||bu.set(n,{fiber:o,store:s});let a,l=!1,h;return{configure(d={}){let{gl:f,size:p,scene:m,events:v,onCreated:x,shadows:_=!1,linear:g=!1,flat:S=!1,legacy:b=!1,orthographic:M=!1,frameloop:C="always",dpr:A=[1,2],performance:R,raycaster:O,camera:P,onPointerMissed:I}=d,H=s.getState(),X=H.gl;H.gl||H.set({gl:X=JK(f,n)});let se=H.raycaster;se||H.set({raycaster:se=new IL});const{params:W,...$}=O||{};if(tn.equ($,se,xc)||_c(se,{...$}),tn.equ(W,se.params,xc)||_c(se,{params:{...se.params,...W}}),!H.camera||H.camera===h&&!tn.equ(h,P,xc)){h=P;const G=P instanceof nf,Y=G?P:M?new of(0,0,0,0,.1,1e3):new Yn(75,0,.1,1e3);G||(Y.position.z=5,P&&(_c(Y,P),("aspect"in P||"left"in P||"right"in P||"bottom"in P||"top"in P)&&(Y.manual=!0,Y.updateProjectionMatrix())),!H.camera&&!(P!=null&&P.rotation)&&Y.lookAt(0,0,0)),H.set({camera:Y}),se.camera=Y}if(!H.scene){let G;m!=null&&m.isScene?G=m:(G=new d1,m&&_c(G,m)),H.set({scene:bc(G)})}if(!H.xr){var Z;const G=(K,ie)=>{const me=s.getState();me.frameloop!=="never"&&ZE(K,!0,me,ie)},Y=()=>{const K=s.getState();K.gl.xr.enabled=K.gl.xr.isPresenting,K.gl.xr.setAnimationLoop(K.gl.xr.isPresenting?G:null),K.gl.xr.isPresenting||KE(K)},ee={connect(){const K=s.getState().gl;K.xr.addEventListener("sessionstart",Y),K.xr.addEventListener("sessionend",Y)},disconnect(){const K=s.getState().gl;K.xr.removeEventListener("sessionstart",Y),K.xr.removeEventListener("sessionend",Y)}};typeof((Z=X.xr)==null?void 0:Z.addEventListener)=="function"&&ee.connect(),H.set({xr:ee})}if(X.shadowMap){const G=X.shadowMap.enabled,Y=X.shadowMap.type;if(X.shadowMap.enabled=!!_,tn.boo(_))X.shadowMap.type=Vh;else if(tn.str(_)){var re;const ee={basic:T3,percentage:ug,soft:Vh,variance:Bi};X.shadowMap.type=(re=ee[_])!=null?re:Vh}else tn.obj(_)&&Object.assign(X.shadowMap,_);(G!==X.shadowMap.enabled||Y!==X.shadowMap.type)&&(X.shadowMap.needsUpdate=!0)}const F=UL();F&&("enabled"in F?F.enabled=!b:"legacyMode"in F&&(F.legacyMode=b)),l||_c(X,{outputEncoding:g?3e3:3001,toneMapping:S?Ms:VS}),H.legacy!==b&&H.set(()=>({legacy:b})),H.linear!==g&&H.set(()=>({linear:g})),H.flat!==S&&H.set(()=>({flat:S})),f&&!tn.fun(f)&&!jL(f)&&!tn.equ(f,X,xc)&&_c(X,f),v&&!H.events.handlers&&H.set({events:v(s)});const U=eZ(n,p);return tn.equ(U,H.size,xc)||H.setSize(U.width,U.height,U.updateStyle,U.top,U.left),A&&H.viewport.dpr!==HL(A)&&H.setDpr(A),H.frameloop!==C&&H.setFrameloop(C),H.onPointerMissed||H.set({onPointerMissed:I}),R&&!tn.equ(R,H.performance,xc)&&H.set(G=>({performance:{...G.performance,...R}})),a=x,l=!0,this},render(d){return l||this.configure(),N0.updateContainer(L.jsx(nZ,{store:s,children:d,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){qL(n)}}}function nZ({store:n,children:e,onCreated:t,rootElement:r}){return hf(()=>{const i=n.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),n.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),L.jsx(XL.Provider,{value:n,children:e})}function qL(n,e){const t=bu.get(n),r=t==null?void 0:t.fiber;if(r){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),N0.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var s,o,a,l;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),WK(i),bu.delete(n)}catch{}},500)})}}N0.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:D.version});const x_={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 rZ(n){const{handlePointer:e}=XK(n);return{priority:1,enabled:!0,compute(t,r,i){r.pointer.set(t.offsetX/r.size.width*2-1,-(t.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(x_).reduce((t,r)=>({...t,[r]:e(r)}),{}),update:()=>{var t;const{events:r,internal:i}=n.getState();(t=i.lastEvent)!=null&&t.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var r;const{set:i,events:s}=n.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((r=s.handlers)!=null?r:[]).forEach(([o,a])=>{const[l,h]=x_[o];t.addEventListener(l,a,{passive:h})})},disconnect:()=>{const{set:t,events:r}=n.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([s,o])=>{if(r&&r.connected instanceof HTMLElement){const[a]=x_[s];r.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}function QE(n,e){let t;return(...r)=>{window.clearTimeout(t),t=window.setTimeout(()=>n(...r),e)}}function iZ({debounce:n,scroll:e,polyfill:t,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=D.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=D.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=n?typeof n=="number"?n:n.scroll:null,h=n?typeof n=="number"?n:n.resize:null,d=D.useRef(!1);D.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[f,p,m]=D.useMemo(()=>{const g=()=>{if(!a.current.element)return;const{left:S,top:b,width:M,height:C,bottom:A,right:R,x:O,y:P}=a.current.element.getBoundingClientRect(),I={left:S,top:b,width:M,height:C,bottom:A,right:R,x:O,y:P};a.current.element instanceof HTMLElement&&r&&(I.height=a.current.element.offsetHeight,I.width=a.current.element.offsetWidth),Object.freeze(I),d.current&&!lZ(a.current.lastBounds,I)&&o(a.current.lastBounds=I)};return[g,h?QE(g,h):g,l?QE(g,l):g]},[o,r,l,h]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function x(){a.current.element&&(a.current.resizeObserver=new i(m),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(g=>g.addEventListener("scroll",m,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const _=g=>{!g||g===a.current.element||(v(),a.current.element=g,a.current.scrollContainers=$L(g),x())};return oZ(m,!!e),sZ(p),D.useEffect(()=>{v(),x()},[e,m,p]),D.useEffect(()=>v,[]),[_,s,f]}function sZ(n){D.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function oZ(n,e){D.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function $L(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:r,overflowY:i}=window.getComputedStyle(n);return[t,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...$L(n.parentElement)]}const aZ=["x","y","top","bottom","left","right","width","height"],lZ=(n,e)=>aZ.every(t=>n[t]===e[t]);var cZ=Object.defineProperty,uZ=Object.defineProperties,hZ=Object.getOwnPropertyDescriptors,JE=Object.getOwnPropertySymbols,dZ=Object.prototype.hasOwnProperty,fZ=Object.prototype.propertyIsEnumerable,eA=(n,e,t)=>e in n?cZ(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,tA=(n,e)=>{for(var t in e||(e={}))dZ.call(e,t)&&eA(n,t,e[t]);if(JE)for(var t of JE(e))fZ.call(e,t)&&eA(n,t,e[t]);return n},pZ=(n,e)=>uZ(n,hZ(e)),nA,rA;typeof window<"u"&&((nA=window.document)!=null&&nA.createElement||((rA=window.navigator)==null?void 0:rA.product)==="ReactNative")?D.useLayoutEffect:D.useEffect;function KL(n,e,t){if(!n)return;if(t(n)===!0)return n;let r=n.child;for(;r;){const i=KL(r,e,t);if(i)return i;r=r.sibling}}function ZL(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const iA=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=iA;return}return iA.apply(this,arguments)};const D1=ZL(D.createContext(null));class QL extends D.Component{render(){return D.createElement(D1.Provider,{value:this._reactInternals},this.props.children)}}function mZ(){const n=D.useContext(D1);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=D.useId();return D.useMemo(()=>{for(const r of[n,n==null?void 0:n.alternate]){if(!r)continue;const i=KL(r,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[n,e])}function gZ(){const n=mZ(),[e]=D.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const i=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;i&&i!==D1&&!e.has(i)&&e.set(i,D.useContext(ZL(i)))}t=t.return}return e}function yZ(){const n=gZ();return D.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>r=>D.createElement(e,null,D.createElement(t.Provider,pZ(tA({},r),{value:n.get(t)}))),e=>D.createElement(QL,tA({},e))),[n])}const vZ=D.forwardRef(function({children:e,fallback:t,resize:r,style:i,gl:s,events:o=rZ,eventSource:a,eventPrefix:l,shadows:h,linear:d,flat:f,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:S,scene:b,onPointerMissed:M,onCreated:C,...A},R){D.useMemo(()=>OK(AK),[]);const O=yZ(),[P,I]=iZ({scroll:!0,debounce:{scroll:50,resize:0},...r}),H=D.useRef(null),X=D.useRef(null);D.useImperativeHandle(R,()=>H.current);const se=BL(M),[W,$]=D.useState(!1),[Z,re]=D.useState(!1);if(W)throw W;if(Z)throw Z;const F=D.useRef(null);hf(()=>{const G=H.current;I.width>0&&I.height>0&&G&&(F.current||(F.current=tZ(G)),F.current.configure({gl:s,events:o,shadows:h,linear:d,flat:f,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:_,raycaster:g,camera:S,scene:b,size:I,onPointerMissed:(...Y)=>se.current==null?void 0:se.current(...Y),onCreated:Y=>{Y.events.connect==null||Y.events.connect(a?kK(a)?a.current:a:X.current),l&&Y.setEvents({compute:(ee,K)=>{const ie=ee[l+"X"],me=ee[l+"Y"];K.pointer.set(ie/K.size.width*2-1,-(me/K.size.height)*2+1),K.raycaster.setFromCamera(K.pointer,K.camera)}}),C==null||C(Y)}}),F.current.render(L.jsx(O,{children:L.jsx(zL,{set:re,children:L.jsx(D.Suspense,{fallback:L.jsx(BK,{set:$}),children:e??null})})})))}),D.useEffect(()=>{const G=H.current;if(G)return()=>qL(G)},[]);const U=a?"none":"auto";return L.jsx("div",{ref:X,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...i},...A,children:L.jsx("div",{ref:P,style:{width:"100%",height:"100%"},children:L.jsx("canvas",{ref:H,style:{display:"block"},children:t})})})}),_Z=D.forwardRef(function(e,t){return L.jsx(QL,{children:L.jsx(vZ,{...e,ref:t})})}),fr={progress:0,hero:1,primitives:0,ladder:0,corpus:0,contact:0,mouseX:0,mouseY:0,isDark:!1},sA=["hero","principles","enablement","corpus-section","contact"],xZ={hero:"hero",principles:"primitives",enablement:"ladder","corpus-section":"corpus",contact:"contact"};function SZ(){D.useEffect(()=>{const n={},e=new IntersectionObserver(i=>{i.forEach(s=>{n[s.target.id]=s.intersectionRatio});for(const s of sA){const o=xZ[s];o&&(fr[o]=n[s]||0)}fr.isDark=fr.contact>.3},{threshold:[0,.05,.1,.2,.3,.5,.7,.9,1]});requestAnimationFrame(()=>{sA.forEach(i=>{const s=document.getElementById(i);s&&e.observe(s)})});const t=()=>{const i=window.scrollY,s=document.documentElement.scrollHeight-window.innerHeight;fr.progress=s>0?i/s:0},r=i=>{fr.mouseX=i.clientX/window.innerWidth*2-1,fr.mouseY=-(i.clientY/window.innerHeight)*2+1};return window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("mousemove",r,{passive:!0}),t(),()=>{e.disconnect(),window.removeEventListener("scroll",t),window.removeEventListener("mousemove",r)}},[])}const la="#2e3340",bZ="#9ca3af";function Wd(...n){return new dt().setFromPoints(n.map(([e,t,r])=>new z(e,t,r)))}function ro(n,e,t=la){const r=new In({color:t,transparent:!0,opacity:e});return r.userData.baseOpacity=e,new ns(n,r)}function df(n,e){n&&(n.visible=e>.01,n.visible&&n.traverse(t=>{const r=t.material;r&&r.userData.baseOpacity!==void 0&&(r.opacity=e*r.userData.baseOpacity)}))}function wZ(){const n=D.useRef(null),e=D.useRef(null),t=50,r=D.useMemo(()=>{const s=new Float32Array(t*3);for(let o=0;o<t;o++)s[o*3]=(Math.random()-.5)*12,s[o*3+1]=(Math.random()-.5)*9,s[o*3+2]=(Math.random()-.5)*3-2;return s},[]),i=D.useMemo(()=>[3.2,4.2,5.2].map((s,o)=>{const a=[],l=Math.PI*(1+o*.15),h=o*.6;for(let p=0;p<=48;p++){const m=h+p/48*l;a.push(new z(Math.cos(m)*s,Math.sin(m)*s*.25,-2))}const d=new dt().setFromPoints(a),f=new In({color:la,transparent:!0,opacity:.05});return new ns(d,f)}),[]);return Fl(({clock:s})=>{const o=s.getElapsedTime();if(n.current){const a=n.current.geometry.getAttribute("position"),l=a.array;for(let h=0;h<t;h++)l[h*3]+=Math.sin(o*.04+h*.3)*4e-4,l[h*3+1]+=Math.cos(o*.035+h*.5)*4e-4;a.needsUpdate=!0}e.current&&(e.current.rotation.z=o*.008)}),L.jsxs("group",{children:[L.jsxs("points",{ref:n,children:[L.jsx("bufferGeometry",{children:L.jsx("bufferAttribute",{attach:"attributes-position",args:[r,3],count:t})}),L.jsx("pointsMaterial",{color:la,size:.012,transparent:!0,opacity:.07,sizeAttenuation:!0})]}),L.jsx("group",{ref:e,children:i.map((s,o)=>L.jsx("primitive",{object:s,rotation:[.15*o,.25*o,.08*o]},o))})]})}function TZ(){const n=D.useRef(null),e=D.useMemo(()=>{const t=[],r=[];for(let s=0;s<=8;s++){const o=s/8*Math.PI*2;r.push(new z(Math.cos(o)*.25,Math.sin(o)*.25,0))}t.push(ro(new dt().setFromPoints(r),.75));const i=[];for(let s=0;s<=8;s++){const o=s/8*Math.PI*2+Math.PI/8;i.push(new z(Math.cos(o)*.12,Math.sin(o)*.12,0))}t.push(ro(new dt().setFromPoints(i),.4));for(let s=0;s<6;s++){const o=s/6*Math.PI*2;t.push(ro(Wd([Math.cos(o)*.28,Math.sin(o)*.28,0],[Math.cos(o)*2.4,Math.sin(o)*2.4,0]),.4))}return t},[]);return Fl(({clock:t})=>{if(!n.current)return;const r=t.getElapsedTime(),i=fr.hero;df(n.current,i),n.current.rotation.z=Math.sin(r*.12)*.025,n.current.rotation.x=fr.mouseY*.04,n.current.rotation.y=fr.mouseX*.04}),L.jsx("group",{ref:n,children:e.map((t,r)=>L.jsx("primitive",{object:t},r))})}function MZ(){const n=D.useRef(null),e=D.useRef([]),t=D.useMemo(()=>{const r=[],i=[],s=[[0,1.3],[-1.15,-.65],[1.15,-.65]];s.forEach(([o,a])=>{r.push(ro(Wd([o,a+.16,0],[o+.16,a,0],[o,a-.16,0],[o-.16,a,0],[o,a+.16,0]),.85))});for(let o=0;o<s.length;o++)for(let a=o+1;a<s.length;a++){const[l,h]=s[o],[d,f]=s[a],p=d-l,m=f-h,v=Math.sqrt(p*p+m*m),x=-m/v,_=p/v;for(let g=-1;g<=1;g++){const S=g*.07;r.push(ro(Wd([l+x*S,h+_*S,0],[d+x*S,f+_*S,0]),g===0?.45:.2))}}return s.forEach(([o,a])=>{[.35,.55].forEach(l=>{const h=[];for(let p=0;p<=40;p++){const m=p/40*Math.PI*2;h.push(new z(o+Math.cos(m)*l,a+Math.sin(m)*l,0))}const d=new dt().setFromPoints(h),f=new In({color:la,transparent:!0,opacity:.12});f.userData.baseOpacity=.12,i.push(f),r.push(new ns(d,f))})}),e.current=i,r},[]);return Fl(({clock:r})=>{if(!n.current)return;const i=r.getElapsedTime(),s=fr.primitives;df(n.current,s),e.current.forEach((o,a)=>{const l=.08+Math.sin(i*1.8+a*1.5)*.06;o.userData.baseOpacity=l}),n.current.rotation.z=Math.sin(i*.08)*.015}),L.jsx("group",{ref:n,children:t.map((r,i)=>L.jsx("primitive",{object:r},i))})}function EZ(){const n=D.useRef(null),e=D.useRef(null),t=18,{rungObjects:r,connectorObj:i,particlePositions:s,particleTs:o}=D.useMemo(()=>{const a=[],h=[6,3,5,8,4],d=[.5,.6,.8,1,1.2];for(let S=0;S<5;S++){const b=-1+S*.55,M=d[S],C=h[S],A=new Nu(M*2,M*2,C,C);A.rotateX(-Math.PI*.5);const R=new b1(A),O=new In({color:la,transparent:!0,opacity:.25+S*.1});O.userData.baseOpacity=.25+S*.1;const P=new Pi(R,O);P.position.y=b,a.push(P)}const f=[],p=[[-.3,.3],[.3,.3],[.3,-.3],[-.3,-.3]];for(const[S,b]of p)for(let M=0;M<4;M++){const C=-1+M*.55,A=-1+(M+1)*.55,R=d[M],O=d[M+1];f.push(S*R,C,b*R,S*O,A,b*O)}const m=new dt;m.setAttribute("position",new qe(f,3));const v=new In({color:la,transparent:!0,opacity:.15});v.userData.baseOpacity=.15;const x=new Pi(m,v),_=new Float32Array(t*3),g=new Float32Array(t);for(let S=0;S<t;S++)g[S]=Math.random();return{rungObjects:a,connectorObj:x,particlePositions:_,particleTs:g}},[]);return Fl(({clock:a})=>{if(!n.current)return;const l=a.getElapsedTime(),h=fr.ladder;df(n.current,h),r.forEach((p,m)=>{const v=-1+m*.55;p.position.y=v+Math.sin(l*.5+m*.4)*.025});const d=[[-.3,.3],[.3,.3],[.3,-.3],[-.3,-.3]],f=[.5,.6,.8,1,1.2];for(let p=0;p<t;p++){o[p]+=.002,o[p]>1&&(o[p]=0);const m=d[p%4],v=o[p],x=-1+v*4*.55,_=Math.min(4,Math.floor(v*5)),g=f[_];s[p*3]=m[0]*g,s[p*3+1]=x,s[p*3+2]=m[1]*g}e.current&&(e.current.geometry.getAttribute("position").needsUpdate=!0)}),L.jsxs("group",{ref:n,rotation:[.35,.25,0],children:[r.map((a,l)=>L.jsx("primitive",{object:a},l)),L.jsx("primitive",{object:i}),L.jsxs("points",{ref:e,children:[L.jsx("bufferGeometry",{children:L.jsx("bufferAttribute",{attach:"attributes-position",args:[s,3],count:t})}),L.jsx("pointsMaterial",{color:la,size:.028,transparent:!0,opacity:.4,sizeAttenuation:!0})]})]})}function AZ(){const n=D.useRef(null),e=D.useRef(null),t=7,r=[.883,.857,.817,.81,.804,.798,.795],{laneLines:i,dotPositions:s,DOT_COUNT:o}=D.useMemo(()=>{const a=[],l=[];for(let d=0;d<t;d++){const f=(d-3)*.4,p=3.5,m=Wd([-p/2,f,0],[p/2,f,0]),v=.12+r[d]*.3;a.push(ro(m,v));const x=2+Math.floor(Math.random()*3);for(let _=0;_<x;_++){const g=(Math.random()-.5)*p*.85;l.push(g,f,0)}}const h=new Float32Array(l);return{laneLines:a,dotPositions:h,DOT_COUNT:l.length/3}},[]);return Fl(({clock:a})=>{if(!n.current)return;const l=a.getElapsedTime(),h=fr.corpus;if(df(n.current,h),e.current&&h>.01){const d=e.current.geometry.getAttribute("position"),f=d.array;for(let p=0;p<o;p++)f[p*3]+=Math.sin(l*.3+p*1.1)*3e-4;d.needsUpdate=!0}}),L.jsxs("group",{ref:n,children:[i.map((a,l)=>L.jsx("primitive",{object:a},l)),L.jsxs("points",{ref:e,children:[L.jsx("bufferGeometry",{children:L.jsx("bufferAttribute",{attach:"attributes-position",args:[s,3],count:o})}),L.jsx("pointsMaterial",{color:la,size:.05,transparent:!0,opacity:.5,sizeAttenuation:!0})]})]})}function CZ(){const n=D.useRef(null),e=D.useMemo(()=>{const t=[],r=bZ,i=[];for(let o=0;o<=8;o++){const a=o/8*Math.PI*2;i.push(new z(Math.cos(a)*.18,Math.sin(a)*.18,0))}return t.push(ro(new dt().setFromPoints(i),.4,r)),[[-1.2,-.7],[1.2,-.7],[0,1]].forEach(([o,a])=>{t.push(ro(Wd([o,a,0],[0,0,0]),.2,r));const l=.06,h=[];for(let d=0;d<=4;d++){const f=d/4*Math.PI*2;h.push(new z(o+Math.cos(f)*l,a+Math.sin(f)*l,0))}t.push(ro(new dt().setFromPoints(h),.15,r))}),t},[]);return Fl(({clock:t})=>{if(!n.current)return;const r=t.getElapsedTime(),i=fr.contact;df(n.current,i),n.current.rotation.z=Math.sin(r*.1)*.01}),L.jsx("group",{ref:n,children:e.map((t,r)=>L.jsx("primitive",{object:t},r))})}const PZ=[["hero",new z(0,.4,5)],["primitives",new z(0,.15,4.5)],["ladder",new z(0,1.2,4)],["corpus",new z(0,0,5.5)],["contact",new z(0,0,4)]];function RZ(){const{camera:n}=QK();return Fl(()=>{const e=new z;let t=0;for(const[r,i]of PZ){const s=fr[r];e.addScaledVector(i,s),t+=s}t>.01?e.divideScalar(t):e.set(0,.4,5),e.x+=fr.mouseX*.15,e.y+=fr.mouseY*.1,n.position.lerp(e,.035),n.lookAt(0,0,0)}),null}function IZ(){return L.jsx("div",{className:"fixed inset-0 z-0 pointer-events-none",children:L.jsxs(_Z,{gl:{alpha:!0,antialias:!0},camera:{position:[0,.4,5],fov:35},style:{width:"100%",height:"100%"},children:[L.jsx(RZ,{}),L.jsx(wZ,{}),L.jsx(TZ,{}),L.jsx(MZ,{}),L.jsx(EZ,{}),L.jsx(AZ,{}),L.jsx(CZ,{})]})})}const LZ=()=>(SZ(),L.jsxs("main",{children:[L.jsx(GS,{description:"Infrastructure where accountability is encoded before the first action occurs. AI governance research, coordination protocols, and production-grade agent reliability.",keywords:["AI governance","agentic AI","coordination protocols","agent reliability","production AI infrastructure"]}),L.jsxs(bS,{children:[L.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"Organization",name:"Prompted LLC",url:"https://promptedllc.com",description:"Infrastructure where accountability is encoded before the first action occurs.",sameAs:["https://github.com/prompted365","https://www.linkedin.com/in/breyden-taylor/","https://twitter.com/prompted365"],founder:{"@type":"Person",name:"Breyden Taylor"}})}),L.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"WebSite",name:"Prompted LLC",url:"https://promptedllc.com",potentialAction:{"@type":"SearchAction",target:"https://promptedllc.com/research?q={search_term_string}","query-input":"required name=search_term_string"}})})]}),L.jsx(IZ,{}),L.jsx(_d,{}),L.jsx(b6,{}),L.jsx(T6,{}),L.jsx(M6,{}),L.jsx(P8,{}),L.jsx(R8,{}),L.jsx(lg,{})]})),FZ=({post:n})=>L.jsxs(Ki,{to:`/research/${n.slug}`,className:"block border border-foreground/10 p-5 hover:border-foreground/25 transition-colors duration-200 group",children:[L.jsx("h3",{className:"font-serif text-lg leading-snug group-hover:text-foreground/80 transition-colors",children:n.title}),L.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-muted-foreground font-mono",children:[L.jsx("span",{children:x3(n.date)}),L.jsx("span",{children:"·"}),L.jsxs("span",{children:[n.wordCount.toLocaleString(),"w"]}),L.jsx("span",{children:"·"}),L.jsx("span",{children:n.score.toFixed(3)}),L.jsx("span",{children:"·"}),L.jsxs("span",{children:["C",n.cluster]})]}),L.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:n.lanes.map(e=>L.jsx("span",{className:"text-[10px] tracking-[0.15em] uppercase border border-foreground/15 px-2 py-0.5 text-muted-foreground",children:e},e))})]}),NZ=({activeLane:n,onLaneChange:e,activeCluster:t,onClusterChange:r,sortKey:i,onSortChange:s})=>L.jsxs("div",{className:"space-y-4",children:[L.jsxs("div",{className:"flex flex-wrap gap-2",children:[L.jsx("button",{onClick:()=>e(null),className:`text-[10px] tracking-[0.15em] uppercase px-3 py-1 border transition-colors ${n===null?"border-foreground bg-foreground text-primary-foreground":"border-foreground/20 text-muted-foreground hover:border-foreground/40"}`,children:"All lanes"}),b8.map(o=>L.jsx("button",{onClick:()=>e(n===o?null:o),className:`text-[10px] tracking-[0.15em] uppercase px-3 py-1 border transition-colors ${n===o?"border-foreground bg-foreground text-primary-foreground":"border-foreground/20 text-muted-foreground hover:border-foreground/40"}`,children:o},o))]}),L.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[L.jsxs("div",{className:"flex items-center gap-2",children:[L.jsx("span",{className:"text-[10px] tracking-[0.15em] uppercase text-muted-foreground",children:"Cluster"}),L.jsxs("select",{value:t??"",onChange:o=>r(o.target.value===""?null:Number(o.target.value)),className:"text-xs bg-transparent border border-foreground/20 px-2 py-1 text-foreground focus:outline-none focus:border-foreground/40",children:[L.jsx("option",{value:"",children:"All"}),Array.from({length:12},(o,a)=>L.jsx("option",{value:a,children:a},a))]})]}),L.jsxs("div",{className:"flex items-center gap-2",children:[L.jsx("span",{className:"text-[10px] tracking-[0.15em] uppercase text-muted-foreground",children:"Sort"}),L.jsxs("select",{value:i,onChange:o=>s(o.target.value),className:"text-xs bg-transparent border border-foreground/20 px-2 py-1 text-foreground focus:outline-none focus:border-foreground/40",children:[L.jsx("option",{value:"score",children:"Score"}),L.jsx("option",{value:"date",children:"Date"}),L.jsx("option",{value:"wordCount",children:"Word count"})]})]})]})]}),DZ=()=>{const[n]=S6(),e=n.get("cluster"),[t,r]=D.useState(null),[i,s]=D.useState(e!==null?Number(e):null),[o,a]=D.useState("score"),[l,h]=D.useState("human"),d=D.useMemo(()=>{let f=[...gu];return t&&(f=w8(f,t)),i!==null&&(f=T8(f,i)),M8(f,o)},[t,i,o]);return L.jsxs("main",{className:"min-h-screen",children:[L.jsx(GS,{title:"Research Corpus",description:`${D2} synthesized AI governance research papers across 12 clusters and 7 lanes. Filterable corpus covering coordination, reliability, economics, and institutional design.`,path:"/research",keywords:["AI governance research","agentic AI coordination","agent reliability","AI policy","production AI"]}),L.jsx(_d,{}),L.jsxs("div",{className:"max-w-5xl mx-auto px-6 pt-28 pb-20",children:[L.jsxs("header",{className:"mb-10",children:[L.jsx("h1",{className:"text-4xl md:text-5xl font-serif mb-2",children:"Research Corpus"}),L.jsxs("p",{className:"text-sm text-muted-foreground",children:[D2," synthesized papers · 12 clusters · 7 lanes · Q1 2026"]}),L.jsx("div",{className:"mt-3",children:L.jsx(Ki,{to:"/research/clusters",className:"text-xs tracking-[0.15em] uppercase text-muted-foreground hover:text-foreground transition-colors underline underline-offset-4",children:"View cluster map"})})]}),L.jsx(NZ,{activeLane:t,onLaneChange:r,activeCluster:i,onClusterChange:s,sortKey:o,onSortChange:a}),L.jsxs("div",{className:"mt-6 mb-6 flex items-center gap-0 border border-foreground/20 w-fit",children:[L.jsx("button",{onClick:()=>h("human"),className:`text-[10px] tracking-[0.15em] uppercase px-4 py-1.5 transition-colors ${l==="human"?"bg-foreground text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Human"}),L.jsx("button",{onClick:()=>h("agentic"),className:`text-[10px] tracking-[0.15em] uppercase px-4 py-1.5 transition-colors ${l==="agentic"?"bg-foreground text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Agentic"})]}),L.jsxs("p",{className:"text-xs text-muted-foreground mb-6",children:[d.length," of ",gu.length," posts shown"]}),l==="human"?L.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:d.map(f=>L.jsx(FZ,{post:f},f.slug))}):L.jsx("pre",{className:"p-4 bg-muted/50 border border-foreground/10 text-xs font-mono text-foreground overflow-x-auto max-h-[80vh] overflow-y-auto whitespace-pre-wrap",children:JSON.stringify(d.map(({slug:f,title:p,date:m,cluster:v,score:x,wordCount:_,arxivCount:g,lanes:S})=>({slug:f,title:p,date:m,cluster:v,score:Number(x.toFixed(4)),wordCount:_,arxivCount:g,lanes:S})),null,2)})]}),L.jsx(lg,{})]})},OZ="modulepreload",UZ=function(n){return"/"+n},oA={},kZ=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(t.map(l=>{if(l=UZ(l),l in oA)return;oA[l]=!0;const h=l.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=h?"stylesheet":OZ,h||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),h)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function BZ(n){let e=n;return e=e.replace(/<p>(#{1,4})\s+(.+?)<\/p>/g,(t,r,i)=>{const s=Math.min(r.length+1,6);return`<h${s}>${i}</h${s}>`}),e=e.replace(/<p>-{3,}<\/p>/g,"<hr />"),e=e.replace(/<p>\s*<\/p>/g,""),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),e=e.replace(new RegExp('(?<!href="|">)(https?:\\/\\/[^\\s<)"]+)',"g"),'<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>'),e=e.replace(/<a [^>]*>(<a [^>]*>.*?<\/a>)<\/a>/g,"$1"),e}function zZ(n){const[e,t]=D.useState(null),[r,i]=D.useState(!1);return D.useEffect(()=>{if(!n)return;const s=y8(n);if(!s){t(null);return}let o=!1;return i(!0),(async()=>{try{const a=await kZ(()=>import("./index-CE8UJu83.js").then(f=>f.i),[]),l=await fetch(s);if(!l.ok)throw new Error("Failed to fetch docx");const h=await l.arrayBuffer(),d=await a.convertToHtml({arrayBuffer:h});o||t(BZ(d.value))}catch{o||t(null)}finally{o||i(!1)}})(),()=>{o=!0}},[n]),{body:e,loading:r}}const WZ=({post:n})=>{const[e,t]=D.useState(!1),r={"@context":"https://schema.org","@type":"ScholarlyArticle",headline:n.title,datePublished:n.date,author:{"@type":"Organization",name:"Prompted"},wordCount:n.wordCount,keywords:n.lanes,isPartOf:{"@type":"Collection",name:"TPS Research Corpus",url:"/research"}};return L.jsxs("div",{className:"border-t border-foreground/10 mt-12 pt-6",children:[L.jsxs("button",{onClick:()=>t(!e),className:"text-[10px] tracking-[0.2em] uppercase text-muted-foreground hover:text-foreground transition-colors flex items-center gap-2",children:[L.jsx("span",{children:e?"▾":"▸"}),"Structured Data — what machines read"]}),e&&L.jsx("pre",{className:"mt-4 p-4 bg-muted/50 border border-foreground/10 text-xs font-mono text-foreground overflow-x-auto whitespace-pre-wrap",children:JSON.stringify(r,null,2)})]})},HZ=()=>{const{slug:n}=qz(),e=n?E8(n):void 0,{body:t,loading:r}=zZ(n),i=e?`${e.title} — ${e.wordCount.toLocaleString()} word synthesis on ${e.lanes.slice(0,2).join(" & ").toLowerCase()}. Cluster ${e.cluster}, signal score ${e.score.toFixed(3)}.`:void 0;if(!e)return L.jsxs("main",{className:"min-h-screen",children:[L.jsx(_d,{}),L.jsxs("div",{className:"max-w-3xl mx-auto px-6 pt-28 pb-20",children:[L.jsx("h1",{className:"text-3xl font-serif mb-4",children:"Post not found"}),L.jsx(Ki,{to:"/research",className:"text-xs tracking-[0.15em] uppercase text-muted-foreground hover:text-foreground transition-colors",children:"← Back to corpus"})]})]});const s=A8(e);return L.jsxs("main",{className:"min-h-screen",children:[L.jsx(_d,{}),L.jsxs("article",{className:"max-w-3xl mx-auto px-6 pt-28 pb-20",children:[e&&L.jsxs(L.Fragment,{children:[L.jsx(GS,{title:e.title,description:i,path:`/research/${e.slug}`,type:"article",publishedTime:e.date,keywords:e.lanes,wordCount:e.wordCount}),L.jsx(bS,{children:L.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"ScholarlyArticle",headline:e.title,datePublished:e.date,author:{"@type":"Organization",name:"Prompted LLC",url:"https://promptedllc.com"},publisher:{"@type":"Organization",name:"Prompted LLC",url:"https://promptedllc.com"},wordCount:e.wordCount,keywords:e.lanes.join(", "),url:`https://promptedllc.com/research/${e.slug}`,isPartOf:{"@type":"Collection",name:"TPS Research Corpus",url:"https://promptedllc.com/research"},mainEntityOfPage:{"@type":"WebPage","@id":`https://promptedllc.com/research/${e.slug}`}})})})]}),L.jsx(Ki,{to:"/research",className:"text-[10px] tracking-[0.2em] uppercase text-muted-foreground hover:text-foreground transition-colors mb-8 inline-block",children:"← Corpus"}),L.jsxs("header",{className:"mb-12",children:[L.jsx("h1",{className:"text-3xl md:text-4xl font-serif mt-4 mb-4 leading-tight",children:e.title}),L.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs font-mono text-muted-foreground mb-6",children:[L.jsx("span",{children:x3(e.date)}),L.jsx("span",{className:"opacity-30",children:"·"}),L.jsxs("span",{children:[e.wordCount.toLocaleString()," words"]}),e.arxivCount>0&&L.jsxs(L.Fragment,{children:[L.jsx("span",{className:"opacity-30",children:"·"}),L.jsxs("span",{children:[e.arxivCount," arXiv refs"]})]})]}),L.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.lanes.map(o=>L.jsx("span",{className:"text-[10px] tracking-[0.15em] uppercase border border-foreground/15 px-2 py-0.5 text-muted-foreground",children:o},o))})]}),r?L.jsxs("div",{className:"space-y-4 animate-pulse",children:[L.jsx("div",{className:"h-4 bg-muted/50 rounded w-full"}),L.jsx("div",{className:"h-4 bg-muted/50 rounded w-5/6"}),L.jsx("div",{className:"h-4 bg-muted/50 rounded w-full"}),L.jsx("div",{className:"h-4 bg-muted/50 rounded w-4/6"}),L.jsx("div",{className:"h-4 bg-muted/50 rounded w-full"}),L.jsx("div",{className:"h-4 bg-muted/50 rounded w-3/4"})]}):t?L.jsx("section",{className:`prose prose-sm max-w-none text-foreground/90 leading-[1.85]
[&_h2]:font-serif [&_h2]:text-2xl [&_h2]:text-foreground [&_h2]:mt-14 [&_h2]:mb-5 [&_h2]:leading-snug
[&_h3]:font-serif [&_h3]:text-lg [&_h3]:text-foreground [&_h3]:mt-10 [&_h3]:mb-3 [&_h3]:leading-snug
[&_h4]:font-semibold [&_h4]:text-base [&_h4]:text-foreground [&_h4]:mt-8 [&_h4]:mb-2
[&_p]:mb-5
[&_li]:mb-1
[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-4 [&_a]:decoration-primary/30 hover:[&_a]:decoration-primary/70 [&_a]:transition-colors
[&_strong]:text-foreground [&_strong]:font-semibold
[&_blockquote]:border-l-2 [&_blockquote]:border-foreground/20 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-muted-foreground
[&_hr]:border-foreground/10 [&_hr]:my-12
[&_code]:text-xs [&_code]:bg-muted/50 [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:rounded`,dangerouslySetInnerHTML:{__html:t}}):L.jsxs("div",{className:"border border-dashed border-foreground/15 p-8 text-center",children:[L.jsx("p",{className:"text-sm text-muted-foreground",children:"Full text will be available once the corpus documents are processed."}),L.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Metadata and structural data are available now."})]}),L.jsxs("div",{className:"mt-16 pt-8 border-t border-foreground/10",children:[L.jsx("p",{className:"text-[10px] tracking-[0.2em] uppercase text-muted-foreground mb-6",children:"Agent interface"}),L.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-px bg-foreground/5 border border-foreground/10 mb-6",children:[{label:"Cluster",value:String(e.cluster)},{label:"Score",value:e.score.toFixed(3)},{label:"Words",value:e.wordCount.toLocaleString()},{label:"arXiv",value:String(e.arxivCount)}].map(({label:o,value:a})=>L.jsxs("div",{className:"bg-background px-3 py-2.5",children:[L.jsx("span",{className:"text-[10px] tracking-[0.15em] uppercase text-muted-foreground block mb-0.5",children:o}),L.jsx("span",{className:"text-sm font-mono text-foreground",children:a})]},o))}),L.jsx(WZ,{post:e})]}),s.length>0&&L.jsxs("div",{className:"mt-12",children:[L.jsxs("h2",{className:"text-[10px] tracking-[0.2em] uppercase text-muted-foreground mb-4",children:["Cluster ",e.cluster," neighbors"]}),L.jsx("div",{className:"space-y-0 border-t border-foreground/10",children:s.map(o=>L.jsxs(Ki,{to:`/research/${o.slug}`,className:"flex items-baseline justify-between py-3 border-b border-foreground/10 group hover:bg-muted/30 transition-colors px-2 -mx-2",children:[L.jsx("span",{className:"font-serif text-sm group-hover:text-foreground/70 transition-colors",children:o.title}),L.jsx("span",{className:"text-xs font-mono text-muted-foreground ml-4 shrink-0",children:o.score.toFixed(3)})]},o.slug))})]})]}),L.jsx(lg,{})]})},GZ=()=>(D.useEffect(()=>{document.title="Cluster Map — Prompted Research"},[]),L.jsxs("main",{className:"min-h-screen",children:[L.jsx(_d,{}),L.jsxs("div",{className:"max-w-5xl mx-auto px-6 pt-28 pb-20",children:[L.jsxs("header",{className:"mb-10",children:[L.jsx(Ki,{to:"/research",className:"text-[10px] tracking-[0.2em] uppercase text-muted-foreground hover:text-foreground transition-colors mb-6 inline-block",children:"← Corpus"}),L.jsx("h1",{className:"text-4xl md:text-5xl font-serif mb-2",children:"Cluster Map"}),L.jsx("p",{className:"text-sm text-muted-foreground",children:"12 clusters derived from TF-IDF similarity across the corpus."})]}),L.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:v3.map(n=>{const e=gu.filter(t=>t.cluster===n.id).sort((t,r)=>r.score-t.score).slice(0,3);return L.jsxs(Ki,{to:`/research?cluster=${n.id}`,className:"border border-foreground/10 p-5 hover:border-foreground/25 transition-colors group",children:[L.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[L.jsxs("h2",{className:"font-serif text-xl",children:["Cluster ",n.id]}),L.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:[n.docCount," docs"]})]}),L.jsx("div",{className:"flex flex-wrap gap-1 mb-4",children:n.topTerms.slice(0,6).map(t=>L.jsx("span",{className:"text-[9px] tracking-[0.1em] uppercase bg-muted px-1.5 py-0.5 text-muted-foreground",children:t},t))}),L.jsx("div",{className:"space-y-1.5",children:e.map(t=>L.jsxs("div",{className:"flex items-baseline justify-between",children:[L.jsx("span",{className:"text-xs text-foreground/80 truncate pr-2",children:t.title}),L.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:t.score.toFixed(3)})]},t.slug))})]},n.id)})})]}),L.jsx(lg,{})]})),VZ=()=>{const n=Iu();return D.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",n.pathname)},[n.pathname]),L.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:L.jsxs("div",{className:"text-center",children:[L.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),L.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),L.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},jZ=new yz,XZ=()=>L.jsx(_z,{client:jZ,children:L.jsxs(YB,{children:[L.jsx(Rk,{}),L.jsx(l4,{}),L.jsx(y6,{children:L.jsxs(c6,{children:[L.jsx(Sc,{path:"/",element:L.jsx(LZ,{})}),L.jsx(Sc,{path:"/research",element:L.jsx(DZ,{})}),L.jsx(Sc,{path:"/research/clusters",element:L.jsx(GZ,{})}),L.jsx(Sc,{path:"/research/:slug",element:L.jsx(HZ,{})}),L.jsx(Sc,{path:"*",element:L.jsx(VZ,{})})]})})]})});PP(document.getElementById("root")).render(L.jsx(OP,{children:L.jsx(XZ,{})}));export{qZ as c,$Z as g};