numbl 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist-cli/cli.js +435 -32
- package/dist-lib/graphics/figuresReducer.d.ts +9 -0
- package/dist-lib/graphics/types.d.ts +11 -0
- package/dist-lib/lib.js +339 -3
- package/dist-lib/numbl-core/executeCode.d.ts +10 -0
- package/dist-lib/numbl-core/runtime/plotBuiltinDispatch.d.ts +6 -0
- package/dist-lib/numbl-core/runtime/runtime.d.ts +22 -0
- package/dist-lib/numbl-core/runtime/uihtmlSession.d.ts +40 -0
- package/dist-lib/numbl-core/version.d.ts +1 -1
- package/dist-plot-viewer/assets/{index-Ct51ZiF1.js → index-CPiPZdGN.js} +246 -168
- package/dist-plot-viewer/index.html +1 -1
- package/dist-site-viewer/assets/index-Y_Z9U6zO.js +4826 -0
- package/dist-site-viewer/assets/{numbl-worker-s3tsbJJ2.js → numbl-worker-CdHI6Ort.js} +211 -126
- package/dist-site-viewer/index.html +1 -1
- package/dist-site-viewer/numbl-embed.js +55 -13
- package/package.json +1 -1
- package/dist-site-viewer/assets/index-USrK1-DZ.js +0 -4748
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Kh={exports:{}},rl={};var N_;function eM(){if(N_)return rl;N_=1;var a=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,l,c){var f=null;if(c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),"key"in l){c={};for(var d in l)d!=="key"&&(c[d]=l[d])}else c=l;return l=c.ref,{$$typeof:a,type:s,key:f,ref:l!==void 0?l:null,props:c}}return rl.Fragment=t,rl.jsx=i,rl.jsxs=i,rl}var O_;function nM(){return O_||(O_=1,Kh.exports=eM()),Kh.exports}var Kt=nM(),Qh={exports:{}},ge={};var P_;function iM(){if(P_)return ge;P_=1;var a=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),g=Symbol.iterator;function M(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,x={};function y(I,K,Mt){this.props=I,this.context=K,this.refs=x,this.updater=Mt||E}y.prototype.isReactComponent={},y.prototype.setState=function(I,K){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,K,"setState")},y.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function w(){}w.prototype=y.prototype;function D(I,K,Mt){this.props=I,this.context=K,this.refs=x,this.updater=Mt||E}var C=D.prototype=new w;C.constructor=D,R(C,y.prototype),C.isPureReactComponent=!0;var G=Array.isArray;function B(){}var F={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function U(I,K,Mt){var wt=Mt.ref;return{$$typeof:a,type:I,key:K,ref:wt!==void 0?wt:null,props:Mt}}function et(I,K){return U(I.type,K,I.props)}function H(I){return typeof I=="object"&&I!==null&&I.$$typeof===a}function q(I){var K={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Mt){return K[Mt]})}var nt=/\/+/g;function ot(I,K){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):K.toString(36)}function Y(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(B,B):(I.status="pending",I.then(function(K){I.status==="pending"&&(I.status="fulfilled",I.value=K)},function(K){I.status==="pending"&&(I.status="rejected",I.reason=K)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function z(I,K,Mt,wt,Bt){var st=typeof I;(st==="undefined"||st==="boolean")&&(I=null);var Et=!1;if(I===null)Et=!0;else switch(st){case"bigint":case"string":case"number":Et=!0;break;case"object":switch(I.$$typeof){case a:case t:Et=!0;break;case v:return Et=I._init,z(Et(I._payload),K,Mt,wt,Bt)}}if(Et)return Bt=Bt(I),Et=wt===""?"."+ot(I,0):wt,G(Bt)?(Mt="",Et!=null&&(Mt=Et.replace(nt,"$&/")+"/"),z(Bt,K,Mt,"",function(tt){return tt})):Bt!=null&&(H(Bt)&&(Bt=et(Bt,Mt+(Bt.key==null||I&&I.key===Bt.key?"":(""+Bt.key).replace(nt,"$&/")+"/")+Et)),K.push(Bt)),1;Et=0;var gt=wt===""?".":wt+":";if(G(I))for(var Ut=0;Ut<I.length;Ut++)wt=I[Ut],st=gt+ot(wt,Ut),Et+=z(wt,K,Mt,st,Bt);else if(Ut=M(I),typeof Ut=="function")for(I=Ut.call(I),Ut=0;!(wt=I.next()).done;)wt=wt.value,st=gt+ot(wt,Ut++),Et+=z(wt,K,Mt,st,Bt);else if(st==="object"){if(typeof I.then=="function")return z(Y(I),K,Mt,wt,Bt);throw K=String(I),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Et}function A(I,K,Mt){if(I==null)return I;var wt=[],Bt=0;return z(I,wt,"","",function(st){return K.call(Mt,st,Bt++)}),wt}function ht(I){if(I._status===-1){var K=I._result;K=K(),K.then(function(Mt){(I._status===0||I._status===-1)&&(I._status=1,I._result=Mt)},function(Mt){(I._status===0||I._status===-1)&&(I._status=2,I._result=Mt)}),I._status===-1&&(I._status=0,I._result=K)}if(I._status===1)return I._result.default;throw I._result}var lt=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},Ct={map:A,forEach:function(I,K,Mt){A(I,function(){K.apply(this,arguments)},Mt)},count:function(I){var K=0;return A(I,function(){K++}),K},toArray:function(I){return A(I,function(K){return K})||[]},only:function(I){if(!H(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return ge.Activity=_,ge.Children=Ct,ge.Component=y,ge.Fragment=i,ge.Profiler=l,ge.PureComponent=D,ge.StrictMode=s,ge.Suspense=m,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,ge.__COMPILER_RUNTIME={__proto__:null,c:function(I){return F.H.useMemoCache(I)}},ge.cache=function(I){return function(){return I.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(I,K,Mt){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var wt=R({},I.props),Bt=I.key;if(K!=null)for(st in K.key!==void 0&&(Bt=""+K.key),K)!T.call(K,st)||st==="key"||st==="__self"||st==="__source"||st==="ref"&&K.ref===void 0||(wt[st]=K[st]);var st=arguments.length-2;if(st===1)wt.children=Mt;else if(1<st){for(var Et=Array(st),gt=0;gt<st;gt++)Et[gt]=arguments[gt+2];wt.children=Et}return U(I.type,Bt,wt)},ge.createContext=function(I){return I={$$typeof:f,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:c,_context:I},I},ge.createElement=function(I,K,Mt){var wt,Bt={},st=null;if(K!=null)for(wt in K.key!==void 0&&(st=""+K.key),K)T.call(K,wt)&&wt!=="key"&&wt!=="__self"&&wt!=="__source"&&(Bt[wt]=K[wt]);var Et=arguments.length-2;if(Et===1)Bt.children=Mt;else if(1<Et){for(var gt=Array(Et),Ut=0;Ut<Et;Ut++)gt[Ut]=arguments[Ut+2];Bt.children=gt}if(I&&I.defaultProps)for(wt in Et=I.defaultProps,Et)Bt[wt]===void 0&&(Bt[wt]=Et[wt]);return U(I,st,Bt)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(I){return{$$typeof:d,render:I}},ge.isValidElement=H,ge.lazy=function(I){return{$$typeof:v,_payload:{_status:-1,_result:I},_init:ht}},ge.memo=function(I,K){return{$$typeof:p,type:I,compare:K===void 0?null:K}},ge.startTransition=function(I){var K=F.T,Mt={};F.T=Mt;try{var wt=I(),Bt=F.S;Bt!==null&&Bt(Mt,wt),typeof wt=="object"&&wt!==null&&typeof wt.then=="function"&&wt.then(B,lt)}catch(st){lt(st)}finally{K!==null&&Mt.types!==null&&(K.types=Mt.types),F.T=K}},ge.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},ge.use=function(I){return F.H.use(I)},ge.useActionState=function(I,K,Mt){return F.H.useActionState(I,K,Mt)},ge.useCallback=function(I,K){return F.H.useCallback(I,K)},ge.useContext=function(I){return F.H.useContext(I)},ge.useDebugValue=function(){},ge.useDeferredValue=function(I,K){return F.H.useDeferredValue(I,K)},ge.useEffect=function(I,K){return F.H.useEffect(I,K)},ge.useEffectEvent=function(I){return F.H.useEffectEvent(I)},ge.useId=function(){return F.H.useId()},ge.useImperativeHandle=function(I,K,Mt){return F.H.useImperativeHandle(I,K,Mt)},ge.useInsertionEffect=function(I,K){return F.H.useInsertionEffect(I,K)},ge.useLayoutEffect=function(I,K){return F.H.useLayoutEffect(I,K)},ge.useMemo=function(I,K){return F.H.useMemo(I,K)},ge.useOptimistic=function(I,K){return F.H.useOptimistic(I,K)},ge.useReducer=function(I,K,Mt){return F.H.useReducer(I,K,Mt)},ge.useRef=function(I){return F.H.useRef(I)},ge.useState=function(I){return F.H.useState(I)},ge.useSyncExternalStore=function(I,K,Mt){return F.H.useSyncExternalStore(I,K,Mt)},ge.useTransition=function(){return F.H.useTransition()},ge.version="19.2.4",ge}var z_;function zp(){return z_||(z_=1,Qh.exports=iM()),Qh.exports}var Hn=zp(),Jh={exports:{}},ol={},$h={exports:{}},td={};var F_;function aM(){return F_||(F_=1,(function(a){function t(z,A){var ht=z.length;z.push(A);t:for(;0<ht;){var lt=ht-1>>>1,Ct=z[lt];if(0<l(Ct,A))z[lt]=A,z[ht]=Ct,ht=lt;else break t}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var A=z[0],ht=z.pop();if(ht!==A){z[0]=ht;t:for(var lt=0,Ct=z.length,I=Ct>>>1;lt<I;){var K=2*(lt+1)-1,Mt=z[K],wt=K+1,Bt=z[wt];if(0>l(Mt,ht))wt<Ct&&0>l(Bt,Mt)?(z[lt]=Bt,z[wt]=ht,lt=wt):(z[lt]=Mt,z[K]=ht,lt=K);else if(wt<Ct&&0>l(Bt,ht))z[lt]=Bt,z[wt]=ht,lt=wt;else break t}}return A}function l(z,A){var ht=z.sortIndex-A.sortIndex;return ht!==0?ht:z.id-A.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;a.unstable_now=function(){return c.now()}}else{var f=Date,d=f.now();a.unstable_now=function(){return f.now()-d}}var m=[],p=[],v=1,_=null,g=3,M=!1,E=!1,R=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function C(z){for(var A=i(p);A!==null;){if(A.callback===null)s(p);else if(A.startTime<=z)s(p),A.sortIndex=A.expirationTime,t(m,A);else break;A=i(p)}}function G(z){if(R=!1,C(z),!E)if(i(m)!==null)E=!0,B||(B=!0,q());else{var A=i(p);A!==null&&Y(G,A.startTime-z)}}var B=!1,F=-1,T=5,U=-1;function et(){return x?!0:!(a.unstable_now()-U<T)}function H(){if(x=!1,B){var z=a.unstable_now();U=z;var A=!0;try{t:{E=!1,R&&(R=!1,w(F),F=-1),M=!0;var ht=g;try{e:{for(C(z),_=i(m);_!==null&&!(_.expirationTime>z&&et());){var lt=_.callback;if(typeof lt=="function"){_.callback=null,g=_.priorityLevel;var Ct=lt(_.expirationTime<=z);if(z=a.unstable_now(),typeof Ct=="function"){_.callback=Ct,C(z),A=!0;break e}_===i(m)&&s(m),C(z)}else s(m);_=i(m)}if(_!==null)A=!0;else{var I=i(p);I!==null&&Y(G,I.startTime-z),A=!1}}break t}finally{_=null,g=ht,M=!1}A=void 0}}finally{A?q():B=!1}}}var q;if(typeof D=="function")q=function(){D(H)};else if(typeof MessageChannel<"u"){var nt=new MessageChannel,ot=nt.port2;nt.port1.onmessage=H,q=function(){ot.postMessage(null)}}else q=function(){y(H,0)};function Y(z,A){F=y(function(){z(a.unstable_now())},A)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(z){z.callback=null},a.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<z?Math.floor(1e3/z):5},a.unstable_getCurrentPriorityLevel=function(){return g},a.unstable_next=function(z){switch(g){case 1:case 2:case 3:var A=3;break;default:A=g}var ht=g;g=A;try{return z()}finally{g=ht}},a.unstable_requestPaint=function(){x=!0},a.unstable_runWithPriority=function(z,A){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ht=g;g=z;try{return A()}finally{g=ht}},a.unstable_scheduleCallback=function(z,A,ht){var lt=a.unstable_now();switch(typeof ht=="object"&&ht!==null?(ht=ht.delay,ht=typeof ht=="number"&&0<ht?lt+ht:lt):ht=lt,z){case 1:var Ct=-1;break;case 2:Ct=250;break;case 5:Ct=1073741823;break;case 4:Ct=1e4;break;default:Ct=5e3}return Ct=ht+Ct,z={id:v++,callback:A,priorityLevel:z,startTime:ht,expirationTime:Ct,sortIndex:-1},ht>lt?(z.sortIndex=ht,t(p,z),i(m)===null&&z===i(p)&&(R?(w(F),F=-1):R=!0,Y(G,ht-lt))):(z.sortIndex=Ct,t(m,z),E||M||(E=!0,B||(B=!0,q()))),z},a.unstable_shouldYield=et,a.unstable_wrapCallback=function(z){var A=g;return function(){var ht=g;g=A;try{return z.apply(this,arguments)}finally{g=ht}}}})(td)),td}var I_;function sM(){return I_||(I_=1,$h.exports=aM()),$h.exports}var ed={exports:{}},Fn={};var B_;function rM(){if(B_)return Fn;B_=1;var a=zp();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(m,p,v){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:_==null?null:""+_,children:m,containerInfo:p,implementation:v}}var f=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Fn.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(m,p,null,v)},Fn.flushSync=function(m){var p=f.T,v=s.p;try{if(f.T=null,s.p=2,m)return m()}finally{f.T=p,s.p=v,s.d.f()}},Fn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(m,p))},Fn.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},Fn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,_=d(v,p.crossOrigin),g=typeof p.integrity=="string"?p.integrity:void 0,M=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?s.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:_,integrity:g,fetchPriority:M}):v==="script"&&s.d.X(m,{crossOrigin:_,integrity:g,fetchPriority:M,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Fn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);s.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(m)},Fn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,_=d(v,p.crossOrigin);s.d.L(m,v,{crossOrigin:_,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Fn.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=d(p.as,p.crossOrigin);s.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(m)},Fn.requestFormReset=function(m){s.d.r(m)},Fn.unstable_batchedUpdates=function(m,p){return m(p)},Fn.useFormState=function(m,p,v){return f.H.useFormState(m,p,v)},Fn.useFormStatus=function(){return f.H.useHostTransitionStatus()},Fn.version="19.2.4",Fn}var H_;function oM(){if(H_)return ed.exports;H_=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(t){console.error(t)}}return a(),ed.exports=rM(),ed.exports}var G_;function lM(){if(G_)return ol;G_=1;var a=sM(),t=zp(),i=oM();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(s(188))}function p(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(s(188));return n!==e?null:e}for(var r=e,o=n;;){var u=r.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){r=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===r)return m(u),e;if(h===o)return m(u),n;h=h.sibling}throw Error(s(188))}if(r.return!==o.return)r=u,o=h;else{for(var S=!1,L=u.child;L;){if(L===r){S=!0,r=u,o=h;break}if(L===o){S=!0,o=u,r=h;break}L=L.sibling}if(!S){for(L=h.child;L;){if(L===r){S=!0,r=h,o=u;break}if(L===o){S=!0,o=h,r=u;break}L=L.sibling}if(!S)throw Error(s(189))}}if(r.alternate!==o)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var _=Object.assign,g=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),D=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),et=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var nt=Symbol.for("react.client.reference");function ot(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===nt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case y:return"Profiler";case x:return"StrictMode";case G:return"Suspense";case B:return"SuspenseList";case U:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case D:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case C:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return n=e.displayName||null,n!==null?n:ot(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return ot(e(n))}catch{}}return null}var Y=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ht={pending:!1,data:null,method:null,action:null},lt=[],Ct=-1;function I(e){return{current:e}}function K(e){0>Ct||(e.current=lt[Ct],lt[Ct]=null,Ct--)}function Mt(e,n){Ct++,lt[Ct]=e.current,e.current=n}var wt=I(null),Bt=I(null),st=I(null),Et=I(null);function gt(e,n){switch(Mt(st,n),Mt(Bt,e),Mt(wt,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?n_(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=n_(n),e=i_(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K(wt),Mt(wt,e)}function Ut(){K(wt),K(Bt),K(st)}function tt(e){e.memoizedState!==null&&Mt(Et,e);var n=wt.current,r=i_(n,e.type);n!==r&&(Mt(Bt,e),Mt(wt,r))}function ct(e){Bt.current===e&&(K(wt),K(Bt)),Et.current===e&&(K(Et),nl._currentValue=ht)}var qt,Xt;function oe(e){if(qt===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);qt=n&&n[1]||"",Xt=-1<r.stack.indexOf(`
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Kh={exports:{}},rl={};var N_;function nM(){if(N_)return rl;N_=1;var a=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,l,c){var f=null;if(c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),"key"in l){c={};for(var d in l)d!=="key"&&(c[d]=l[d])}else c=l;return l=c.ref,{$$typeof:a,type:s,key:f,ref:l!==void 0?l:null,props:c}}return rl.Fragment=t,rl.jsx=i,rl.jsxs=i,rl}var O_;function iM(){return O_||(O_=1,Kh.exports=nM()),Kh.exports}var Zt=iM(),Qh={exports:{}},ge={};var P_;function aM(){if(P_)return ge;P_=1;var a=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),g=Symbol.iterator;function S(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,x={};function y(I,K,Mt){this.props=I,this.context=K,this.refs=x,this.updater=Mt||b}y.prototype.isReactComponent={},y.prototype.setState=function(I,K){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,K,"setState")},y.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function w(){}w.prototype=y.prototype;function D(I,K,Mt){this.props=I,this.context=K,this.refs=x,this.updater=Mt||b}var C=D.prototype=new w;C.constructor=D,R(C,y.prototype),C.isPureReactComponent=!0;var G=Array.isArray;function B(){}var F={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function U(I,K,Mt){var wt=Mt.ref;return{$$typeof:a,type:I,key:K,ref:wt!==void 0?wt:null,props:Mt}}function et(I,K){return U(I.type,K,I.props)}function H(I){return typeof I=="object"&&I!==null&&I.$$typeof===a}function q(I){var K={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Mt){return K[Mt]})}var nt=/\/+/g;function ot(I,K){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):K.toString(36)}function Y(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(B,B):(I.status="pending",I.then(function(K){I.status==="pending"&&(I.status="fulfilled",I.value=K)},function(K){I.status==="pending"&&(I.status="rejected",I.reason=K)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function z(I,K,Mt,wt,Bt){var st=typeof I;(st==="undefined"||st==="boolean")&&(I=null);var Et=!1;if(I===null)Et=!0;else switch(st){case"bigint":case"string":case"number":Et=!0;break;case"object":switch(I.$$typeof){case a:case t:Et=!0;break;case v:return Et=I._init,z(Et(I._payload),K,Mt,wt,Bt)}}if(Et)return Bt=Bt(I),Et=wt===""?"."+ot(I,0):wt,G(Bt)?(Mt="",Et!=null&&(Mt=Et.replace(nt,"$&/")+"/"),z(Bt,K,Mt,"",function(tt){return tt})):Bt!=null&&(H(Bt)&&(Bt=et(Bt,Mt+(Bt.key==null||I&&I.key===Bt.key?"":(""+Bt.key).replace(nt,"$&/")+"/")+Et)),K.push(Bt)),1;Et=0;var gt=wt===""?".":wt+":";if(G(I))for(var Ut=0;Ut<I.length;Ut++)wt=I[Ut],st=gt+ot(wt,Ut),Et+=z(wt,K,Mt,st,Bt);else if(Ut=S(I),typeof Ut=="function")for(I=Ut.call(I),Ut=0;!(wt=I.next()).done;)wt=wt.value,st=gt+ot(wt,Ut++),Et+=z(wt,K,Mt,st,Bt);else if(st==="object"){if(typeof I.then=="function")return z(Y(I),K,Mt,wt,Bt);throw K=String(I),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Et}function A(I,K,Mt){if(I==null)return I;var wt=[],Bt=0;return z(I,wt,"","",function(st){return K.call(Mt,st,Bt++)}),wt}function ht(I){if(I._status===-1){var K=I._result;K=K(),K.then(function(Mt){(I._status===0||I._status===-1)&&(I._status=1,I._result=Mt)},function(Mt){(I._status===0||I._status===-1)&&(I._status=2,I._result=Mt)}),I._status===-1&&(I._status=0,I._result=K)}if(I._status===1)return I._result.default;throw I._result}var lt=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},Ct={map:A,forEach:function(I,K,Mt){A(I,function(){K.apply(this,arguments)},Mt)},count:function(I){var K=0;return A(I,function(){K++}),K},toArray:function(I){return A(I,function(K){return K})||[]},only:function(I){if(!H(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return ge.Activity=_,ge.Children=Ct,ge.Component=y,ge.Fragment=i,ge.Profiler=l,ge.PureComponent=D,ge.StrictMode=s,ge.Suspense=m,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,ge.__COMPILER_RUNTIME={__proto__:null,c:function(I){return F.H.useMemoCache(I)}},ge.cache=function(I){return function(){return I.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(I,K,Mt){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var wt=R({},I.props),Bt=I.key;if(K!=null)for(st in K.key!==void 0&&(Bt=""+K.key),K)!T.call(K,st)||st==="key"||st==="__self"||st==="__source"||st==="ref"&&K.ref===void 0||(wt[st]=K[st]);var st=arguments.length-2;if(st===1)wt.children=Mt;else if(1<st){for(var Et=Array(st),gt=0;gt<st;gt++)Et[gt]=arguments[gt+2];wt.children=Et}return U(I.type,Bt,wt)},ge.createContext=function(I){return I={$$typeof:f,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:c,_context:I},I},ge.createElement=function(I,K,Mt){var wt,Bt={},st=null;if(K!=null)for(wt in K.key!==void 0&&(st=""+K.key),K)T.call(K,wt)&&wt!=="key"&&wt!=="__self"&&wt!=="__source"&&(Bt[wt]=K[wt]);var Et=arguments.length-2;if(Et===1)Bt.children=Mt;else if(1<Et){for(var gt=Array(Et),Ut=0;Ut<Et;Ut++)gt[Ut]=arguments[Ut+2];Bt.children=gt}if(I&&I.defaultProps)for(wt in Et=I.defaultProps,Et)Bt[wt]===void 0&&(Bt[wt]=Et[wt]);return U(I,st,Bt)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(I){return{$$typeof:d,render:I}},ge.isValidElement=H,ge.lazy=function(I){return{$$typeof:v,_payload:{_status:-1,_result:I},_init:ht}},ge.memo=function(I,K){return{$$typeof:p,type:I,compare:K===void 0?null:K}},ge.startTransition=function(I){var K=F.T,Mt={};F.T=Mt;try{var wt=I(),Bt=F.S;Bt!==null&&Bt(Mt,wt),typeof wt=="object"&&wt!==null&&typeof wt.then=="function"&&wt.then(B,lt)}catch(st){lt(st)}finally{K!==null&&Mt.types!==null&&(K.types=Mt.types),F.T=K}},ge.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},ge.use=function(I){return F.H.use(I)},ge.useActionState=function(I,K,Mt){return F.H.useActionState(I,K,Mt)},ge.useCallback=function(I,K){return F.H.useCallback(I,K)},ge.useContext=function(I){return F.H.useContext(I)},ge.useDebugValue=function(){},ge.useDeferredValue=function(I,K){return F.H.useDeferredValue(I,K)},ge.useEffect=function(I,K){return F.H.useEffect(I,K)},ge.useEffectEvent=function(I){return F.H.useEffectEvent(I)},ge.useId=function(){return F.H.useId()},ge.useImperativeHandle=function(I,K,Mt){return F.H.useImperativeHandle(I,K,Mt)},ge.useInsertionEffect=function(I,K){return F.H.useInsertionEffect(I,K)},ge.useLayoutEffect=function(I,K){return F.H.useLayoutEffect(I,K)},ge.useMemo=function(I,K){return F.H.useMemo(I,K)},ge.useOptimistic=function(I,K){return F.H.useOptimistic(I,K)},ge.useReducer=function(I,K,Mt){return F.H.useReducer(I,K,Mt)},ge.useRef=function(I){return F.H.useRef(I)},ge.useState=function(I){return F.H.useState(I)},ge.useSyncExternalStore=function(I,K,Mt){return F.H.useSyncExternalStore(I,K,Mt)},ge.useTransition=function(){return F.H.useTransition()},ge.version="19.2.4",ge}var z_;function zp(){return z_||(z_=1,Qh.exports=aM()),Qh.exports}var Pn=zp(),Jh={exports:{}},ol={},$h={exports:{}},td={};var F_;function sM(){return F_||(F_=1,(function(a){function t(z,A){var ht=z.length;z.push(A);t:for(;0<ht;){var lt=ht-1>>>1,Ct=z[lt];if(0<l(Ct,A))z[lt]=A,z[ht]=Ct,ht=lt;else break t}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var A=z[0],ht=z.pop();if(ht!==A){z[0]=ht;t:for(var lt=0,Ct=z.length,I=Ct>>>1;lt<I;){var K=2*(lt+1)-1,Mt=z[K],wt=K+1,Bt=z[wt];if(0>l(Mt,ht))wt<Ct&&0>l(Bt,Mt)?(z[lt]=Bt,z[wt]=ht,lt=wt):(z[lt]=Mt,z[K]=ht,lt=K);else if(wt<Ct&&0>l(Bt,ht))z[lt]=Bt,z[wt]=ht,lt=wt;else break t}}return A}function l(z,A){var ht=z.sortIndex-A.sortIndex;return ht!==0?ht:z.id-A.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;a.unstable_now=function(){return c.now()}}else{var f=Date,d=f.now();a.unstable_now=function(){return f.now()-d}}var m=[],p=[],v=1,_=null,g=3,S=!1,b=!1,R=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function C(z){for(var A=i(p);A!==null;){if(A.callback===null)s(p);else if(A.startTime<=z)s(p),A.sortIndex=A.expirationTime,t(m,A);else break;A=i(p)}}function G(z){if(R=!1,C(z),!b)if(i(m)!==null)b=!0,B||(B=!0,q());else{var A=i(p);A!==null&&Y(G,A.startTime-z)}}var B=!1,F=-1,T=5,U=-1;function et(){return x?!0:!(a.unstable_now()-U<T)}function H(){if(x=!1,B){var z=a.unstable_now();U=z;var A=!0;try{t:{b=!1,R&&(R=!1,w(F),F=-1),S=!0;var ht=g;try{e:{for(C(z),_=i(m);_!==null&&!(_.expirationTime>z&&et());){var lt=_.callback;if(typeof lt=="function"){_.callback=null,g=_.priorityLevel;var Ct=lt(_.expirationTime<=z);if(z=a.unstable_now(),typeof Ct=="function"){_.callback=Ct,C(z),A=!0;break e}_===i(m)&&s(m),C(z)}else s(m);_=i(m)}if(_!==null)A=!0;else{var I=i(p);I!==null&&Y(G,I.startTime-z),A=!1}}break t}finally{_=null,g=ht,S=!1}A=void 0}}finally{A?q():B=!1}}}var q;if(typeof D=="function")q=function(){D(H)};else if(typeof MessageChannel<"u"){var nt=new MessageChannel,ot=nt.port2;nt.port1.onmessage=H,q=function(){ot.postMessage(null)}}else q=function(){y(H,0)};function Y(z,A){F=y(function(){z(a.unstable_now())},A)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(z){z.callback=null},a.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<z?Math.floor(1e3/z):5},a.unstable_getCurrentPriorityLevel=function(){return g},a.unstable_next=function(z){switch(g){case 1:case 2:case 3:var A=3;break;default:A=g}var ht=g;g=A;try{return z()}finally{g=ht}},a.unstable_requestPaint=function(){x=!0},a.unstable_runWithPriority=function(z,A){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ht=g;g=z;try{return A()}finally{g=ht}},a.unstable_scheduleCallback=function(z,A,ht){var lt=a.unstable_now();switch(typeof ht=="object"&&ht!==null?(ht=ht.delay,ht=typeof ht=="number"&&0<ht?lt+ht:lt):ht=lt,z){case 1:var Ct=-1;break;case 2:Ct=250;break;case 5:Ct=1073741823;break;case 4:Ct=1e4;break;default:Ct=5e3}return Ct=ht+Ct,z={id:v++,callback:A,priorityLevel:z,startTime:ht,expirationTime:Ct,sortIndex:-1},ht>lt?(z.sortIndex=ht,t(p,z),i(m)===null&&z===i(p)&&(R?(w(F),F=-1):R=!0,Y(G,ht-lt))):(z.sortIndex=Ct,t(m,z),b||S||(b=!0,B||(B=!0,q()))),z},a.unstable_shouldYield=et,a.unstable_wrapCallback=function(z){var A=g;return function(){var ht=g;g=A;try{return z.apply(this,arguments)}finally{g=ht}}}})(td)),td}var I_;function rM(){return I_||(I_=1,$h.exports=sM()),$h.exports}var ed={exports:{}},In={};var B_;function oM(){if(B_)return In;B_=1;var a=zp();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(m,p,v){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:_==null?null:""+_,children:m,containerInfo:p,implementation:v}}var f=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return In.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,In.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(m,p,null,v)},In.flushSync=function(m){var p=f.T,v=s.p;try{if(f.T=null,s.p=2,m)return m()}finally{f.T=p,s.p=v,s.d.f()}},In.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(m,p))},In.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},In.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,_=d(v,p.crossOrigin),g=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?s.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:_,integrity:g,fetchPriority:S}):v==="script"&&s.d.X(m,{crossOrigin:_,integrity:g,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},In.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);s.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(m)},In.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,_=d(v,p.crossOrigin);s.d.L(m,v,{crossOrigin:_,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},In.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=d(p.as,p.crossOrigin);s.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(m)},In.requestFormReset=function(m){s.d.r(m)},In.unstable_batchedUpdates=function(m,p){return m(p)},In.useFormState=function(m,p,v){return f.H.useFormState(m,p,v)},In.useFormStatus=function(){return f.H.useHostTransitionStatus()},In.version="19.2.4",In}var H_;function lM(){if(H_)return ed.exports;H_=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(t){console.error(t)}}return a(),ed.exports=oM(),ed.exports}var G_;function cM(){if(G_)return ol;G_=1;var a=rM(),t=zp(),i=lM();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function d(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(s(188))}function p(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(s(188));return n!==e?null:e}for(var r=e,o=n;;){var u=r.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){r=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===r)return m(u),e;if(h===o)return m(u),n;h=h.sibling}throw Error(s(188))}if(r.return!==o.return)r=u,o=h;else{for(var M=!1,L=u.child;L;){if(L===r){M=!0,r=u,o=h;break}if(L===o){M=!0,o=u,r=h;break}L=L.sibling}if(!M){for(L=h.child;L;){if(L===r){M=!0,r=h,o=u;break}if(L===o){M=!0,o=h,r=u;break}L=L.sibling}if(!M)throw Error(s(189))}}if(r.alternate!==o)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var _=Object.assign,g=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),D=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),et=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var nt=Symbol.for("react.client.reference");function ot(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===nt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case y:return"Profiler";case x:return"StrictMode";case G:return"Suspense";case B:return"SuspenseList";case U:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case b:return"Portal";case D:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case C:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return n=e.displayName||null,n!==null?n:ot(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return ot(e(n))}catch{}}return null}var Y=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ht={pending:!1,data:null,method:null,action:null},lt=[],Ct=-1;function I(e){return{current:e}}function K(e){0>Ct||(e.current=lt[Ct],lt[Ct]=null,Ct--)}function Mt(e,n){Ct++,lt[Ct]=e.current,e.current=n}var wt=I(null),Bt=I(null),st=I(null),Et=I(null);function gt(e,n){switch(Mt(st,n),Mt(Bt,e),Mt(wt,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?n_(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=n_(n),e=i_(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K(wt),Mt(wt,e)}function Ut(){K(wt),K(Bt),K(st)}function tt(e){e.memoizedState!==null&&Mt(Et,e);var n=wt.current,r=i_(n,e.type);n!==r&&(Mt(Bt,e),Mt(wt,r))}function ct(e){Bt.current===e&&(K(wt),K(Bt)),Et.current===e&&(K(Et),nl._currentValue=ht)}var qt,Xt;function oe(e){if(qt===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);qt=n&&n[1]||"",Xt=-1<r.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+qt+e+Xt}var de=!1;function Yt(e,n){if(!e||de)return"";de=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var Dt=function(){throw Error()};if(Object.defineProperty(Dt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Dt,[])}catch(yt){var mt=yt}Reflect.construct(e,[],Dt)}else{try{Dt.call()}catch(yt){mt=yt}e.call(Dt.prototype)}}else{try{throw Error()}catch(yt){mt=yt}(Dt=e())&&typeof Dt.catch=="function"&&Dt.catch(function(){})}}catch(yt){if(yt&&mt&&typeof yt.stack=="string")return[yt.stack,mt.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),
|
|
3
|
+
`+qt+e+Xt}var de=!1;function Yt(e,n){if(!e||de)return"";de=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var Dt=function(){throw Error()};if(Object.defineProperty(Dt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Dt,[])}catch(yt){var mt=yt}Reflect.construct(e,[],Dt)}else{try{Dt.call()}catch(yt){mt=yt}e.call(Dt.prototype)}}else{try{throw Error()}catch(yt){mt=yt}(Dt=e())&&typeof Dt.catch=="function"&&Dt.catch(function(){})}}catch(yt){if(yt&&mt&&typeof yt.stack=="string")return[yt.stack,mt.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),M=h[0],L=h[1];if(M&&L){var W=M.split(`
|
|
4
4
|
`),dt=L.split(`
|
|
5
5
|
`);for(u=o=0;o<W.length&&!W[o].includes("DetermineComponentFrameRoot");)o++;for(;u<dt.length&&!dt[u].includes("DetermineComponentFrameRoot");)u++;if(o===W.length||u===dt.length)for(o=W.length-1,u=dt.length-1;1<=o&&0<=u&&W[o]!==dt[u];)u--;for(;1<=o&&0<=u;o--,u--)if(W[o]!==dt[u]){if(o!==1||u!==1)do if(o--,u--,0>u||W[o]!==dt[u]){var Tt=`
|
|
6
6
|
`+W[o].replace(" at new "," at ");return e.displayName&&Tt.includes("<anonymous>")&&(Tt=Tt.replace("<anonymous>",e.displayName)),Tt}while(1<=o&&0<=u);break}}}finally{de=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?oe(r):""}function se(e,n){switch(e.tag){case 26:case 27:case 5:return oe(e.type);case 16:return oe("Lazy");case 13:return e.child!==n&&n!==null?oe("Suspense Fallback"):oe("Suspense");case 19:return oe("SuspenseList");case 0:case 15:return Yt(e.type,!1);case 11:return Yt(e.type.render,!1);case 1:return Yt(e.type,!0);case 31:return oe("Activity");default:return""}}function X(e){try{var n="",r=null;do n+=se(e,r),r=e,e=e.return;while(e);return n}catch(o){return`
|
|
7
7
|
Error generating stack: `+o.message+`
|
|
8
|
-
`+o.stack}}var ce=Object.prototype.hasOwnProperty,Jt=a.unstable_scheduleCallback,ne=a.unstable_cancelCallback,Pt=a.unstable_shouldYield,O=a.unstable_requestPaint,b=a.unstable_now,V=a.unstable_getCurrentPriorityLevel,$=a.unstable_ImmediatePriority,k=a.unstable_UserBlockingPriority,P=a.unstable_NormalPriority,it=a.unstable_LowPriority,rt=a.unstable_IdlePriority,_t=a.log,At=a.unstable_setDisableYieldValue,xt=null,St=null;function Nt(e){if(typeof _t=="function"&&At(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(xt,e)}catch{}}var Lt=Math.clz32?Math.clz32:j,It=Math.log,$t=Math.LN2;function j(e){return e>>>=0,e===0?32:31-(It(e)/$t|0)|0}var zt=256,Ft=262144,kt=4194304;function Ot(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bt(e,n,r){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var L=o&134217727;return L!==0?(o=L&~h,o!==0?u=Ot(o):(S&=L,S!==0?u=Ot(S):r||(r=L&~e,r!==0&&(u=Ot(r))))):(L=o&~h,L!==0?u=Ot(L):S!==0?u=Ot(S):r||(r=o&~e,r!==0&&(u=Ot(r)))),u===0?0:n!==0&&n!==u&&(n&h)===0&&(h=u&-u,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:u}function jt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function he(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var e=kt;return kt<<=1,(kt&62914560)===0&&(kt=4194304),e}function De(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function kn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ui(e,n,r,o,u,h){var S=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var L=e.entanglements,W=e.expirationTimes,dt=e.hiddenUpdates;for(r=S&~r;0<r;){var Tt=31-Lt(r),Dt=1<<Tt;L[Tt]=0,W[Tt]=-1;var mt=dt[Tt];if(mt!==null)for(dt[Tt]=null,Tt=0;Tt<mt.length;Tt++){var yt=mt[Tt];yt!==null&&(yt.lane&=-536870913)}r&=~Dt}o!==0&&_o(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(S&~n))}function _o(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-Lt(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|r&261930}function sr(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var o=31-Lt(r),u=1<<o;u&n|e[o]&n&&(e[o]|=n),r&=~u}}function El(e,n){var r=n&-n;return r=(r&42)!==0?1:rr(r),(r&(e.suspendedLanes|n))!==0?0:r}function rr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function or(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yi(){var e=A.p;return e!==0?e:(e=window.event,e===void 0?32:A_(e.type))}function lr(e,n){var r=A.p;try{return A.p=e,n()}finally{A.p=r}}var Li=Math.random().toString(36).slice(2),cn="__reactFiber$"+Li,vn="__reactProps$"+Li,ua="__reactContainer$"+Li,Ga="__reactEvents$"+Li,Tl="__reactListeners$"+Li,Al="__reactHandles$"+Li,Rl="__reactResources$"+Li,Rs="__reactMarker$"+Li;function vo(e){delete e[cn],delete e[vn],delete e[Ga],delete e[Tl],delete e[Al]}function Va(e){var n=e[cn];if(n)return n;for(var r=e.parentNode;r;){if(n=r[ua]||r[cn]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=u_(e);e!==null;){if(r=e[cn])return r;e=u_(e)}return n}e=r,r=e.parentNode}return null}function ka(e){if(e=e[cn]||e[ua]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function ws(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(s(33))}function N(e){var n=e[Rl];return n||(n=e[Rl]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function J(e){e[Rs]=!0}var vt=new Set,pt={};function ut(e,n){Ht(e,n),Ht(e+"Capture",n)}function Ht(e,n){for(pt[e]=n,e=0;e<n.length;e++)vt.add(n[e])}var Wt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Vt={},ee={};function ae(e){return ce.call(ee,e)?!0:ce.call(Vt,e)?!1:Wt.test(e)?ee[e]=!0:(Vt[e]=!0,!1)}function fe(e,n,r){if(ae(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function me(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function Zt(e,n,r,o){if(o===null)e.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+o)}}function ye(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Je(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function $e(e,n,r){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(S){r=""+S,h.call(this,S)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return r},setValue:function(S){r=""+S},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Le(e){if(!e._valueTracker){var n=Je(e)?"checked":"value";e._valueTracker=$e(e,n,""+e[n])}}function xn(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),o="";return e&&(o=Je(e)?e.checked?"true":"false":e.value),e=o,e!==r?(n.setValue(e),!0):!1}function te(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Xn=/[\n"\\]/g;function pe(e){return e.replace(Xn,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Wn(e,n,r,o,u,h,S,L){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),n!=null?S==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+ye(n)):e.value!==""+ye(n)&&(e.value=""+ye(n)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),n!=null?Ni(e,S,ye(n)):r!=null?Ni(e,S,ye(r)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.name=""+ye(L):e.removeAttribute("name")}function ri(e,n,r,o,u,h,S,L){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Le(e);return}r=r!=null?""+ye(r):"",n=n!=null?""+ye(n):r,L||n===e.value||(e.value=n),e.defaultValue=n}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=L?e.checked:!!o,e.defaultChecked=!!o,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),Le(e)}function Ni(e,n,r){n==="number"&&te(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function oi(e,n,r,o){if(e=e.options,n){n={};for(var u=0;u<r.length;u++)n["$"+r[u]]=!0;for(r=0;r<e.length;r++)u=n.hasOwnProperty("$"+e[r].value),e[r].selected!==u&&(e[r].selected=u),u&&o&&(e[r].defaultSelected=!0)}else{for(r=""+ye(r),n=null,u=0;u<e.length;u++){if(e[u].value===r){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function Fe(e,n,r){if(n!=null&&(n=""+ye(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+ye(r):""}function un(e,n,r,o){if(n==null){if(o!=null){if(r!=null)throw Error(s(92));if(Y(o)){if(1<o.length)throw Error(s(93));o=o[0]}r=o}r==null&&(r=""),n=r}r=ye(n),e.defaultValue=r,o=e.textContent,o===r&&o!==""&&o!==null&&(e.value=o),Le(e)}function qn(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var fn=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Oi(e,n,r){var o=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,r):typeof r!="number"||r===0||fn.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function fa(e,n,r){if(n!=null&&typeof n!="object")throw Error(s(62));if(e=e.style,r!=null){for(var o in r)!r.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in n)o=n[u],n.hasOwnProperty(u)&&r[u]!==o&&Oi(e,u,o)}else for(var h in n)n.hasOwnProperty(h)&&Oi(e,h,n[h])}function cr(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Qx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Jx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wl(e){return Jx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ha(){}var qu=null;function Yu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ur=null,fr=null;function em(e){var n=ka(e);if(n&&(e=n.stateNode)){var r=e[vn]||null;t:switch(e=n.stateNode,n.type){case"input":if(Wn(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+pe(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var o=r[n];if(o!==e&&o.form===e.form){var u=o[vn]||null;if(!u)throw Error(s(90));Wn(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<r.length;n++)o=r[n],o.form===e.form&&xn(o)}break t;case"textarea":Fe(e,r.value,r.defaultValue);break t;case"select":n=r.value,n!=null&&oi(e,!!r.multiple,n,!1)}}}var ju=!1;function nm(e,n,r){if(ju)return e(n,r);ju=!0;try{var o=e(n);return o}finally{if(ju=!1,(ur!==null||fr!==null)&&(mc(),ur&&(n=ur,e=fr,fr=ur=null,em(n),e)))for(n=0;n<e.length;n++)em(e[n])}}function xo(e,n){var r=e.stateNode;if(r===null)return null;var o=r[vn]||null;if(o===null)return null;r=o[n];t:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break t;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(s(231,n,typeof r));return r}var da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zu=!1;if(da)try{var yo={};Object.defineProperty(yo,"passive",{get:function(){Zu=!0}}),window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{Zu=!1}var Xa=null,Ku=null,Cl=null;function im(){if(Cl)return Cl;var e,n=Ku,r=n.length,o,u="value"in Xa?Xa.value:Xa.textContent,h=u.length;for(e=0;e<r&&n[e]===u[e];e++);var S=r-e;for(o=1;o<=S&&n[r-o]===u[h-o];o++);return Cl=u.slice(e,1<o?1-o:void 0)}function Dl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ul(){return!0}function am(){return!1}function Qn(e){function n(r,o,u,h,S){this._reactName=r,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=S,this.currentTarget=null;for(var L in e)e.hasOwnProperty(L)&&(r=e[L],this[L]=r?r(h):h[L]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ul:am,this.isPropagationStopped=am,this}return _(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ul)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ul)},persist:function(){},isPersistent:Ul}),n}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=Qn(Cs),So=_({},Cs,{view:0,detail:0}),$x=Qn(So),Qu,Ju,Mo,Nl=_({},So,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Mo&&(Mo&&e.type==="mousemove"?(Qu=e.screenX-Mo.screenX,Ju=e.screenY-Mo.screenY):Ju=Qu=0,Mo=e),Qu)},movementY:function(e){return"movementY"in e?e.movementY:Ju}}),sm=Qn(Nl),ty=_({},Nl,{dataTransfer:0}),ey=Qn(ty),ny=_({},So,{relatedTarget:0}),$u=Qn(ny),iy=_({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),ay=Qn(iy),sy=_({},Cs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ry=Qn(sy),oy=_({},Cs,{data:0}),rm=Qn(oy),ly={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cy={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"},uy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fy(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=uy[e])?!!n[e]:!1}function tf(){return fy}var hy=_({},So,{key:function(e){if(e.key){var n=ly[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tf,charCode:function(e){return e.type==="keypress"?Dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),dy=Qn(hy),py=_({},Nl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),om=Qn(py),my=_({},So,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tf}),gy=Qn(my),_y=_({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),vy=Qn(_y),xy=_({},Nl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),yy=Qn(xy),Sy=_({},Cs,{newState:0,oldState:0}),My=Qn(Sy),by=[9,13,27,32],ef=da&&"CompositionEvent"in window,bo=null;da&&"documentMode"in document&&(bo=document.documentMode);var Ey=da&&"TextEvent"in window&&!bo,lm=da&&(!ef||bo&&8<bo&&11>=bo),cm=" ",um=!1;function fm(e,n){switch(e){case"keyup":return by.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var hr=!1;function Ty(e,n){switch(e){case"compositionend":return hm(n);case"keypress":return n.which!==32?null:(um=!0,cm);case"textInput":return e=n.data,e===cm&&um?null:e;default:return null}}function Ay(e,n){if(hr)return e==="compositionend"||!ef&&fm(e,n)?(e=im(),Cl=Ku=Xa=null,hr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return lm&&n.locale!=="ko"?null:n.data;default:return null}}var Ry={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 dm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Ry[e.type]:n==="textarea"}function pm(e,n,r,o){ur?fr?fr.push(o):fr=[o]:ur=o,n=Mc(n,"onChange"),0<n.length&&(r=new Ll("onChange","change",null,r,o),e.push({event:r,listeners:n}))}var Eo=null,To=null;function wy(e){K0(e,0)}function Ol(e){var n=ws(e);if(xn(n))return e}function mm(e,n){if(e==="change")return n}var gm=!1;if(da){var nf;if(da){var af="oninput"in document;if(!af){var _m=document.createElement("div");_m.setAttribute("oninput","return;"),af=typeof _m.oninput=="function"}nf=af}else nf=!1;gm=nf&&(!document.documentMode||9<document.documentMode)}function vm(){Eo&&(Eo.detachEvent("onpropertychange",xm),To=Eo=null)}function xm(e){if(e.propertyName==="value"&&Ol(To)){var n=[];pm(n,To,e,Yu(e)),nm(wy,n)}}function Cy(e,n,r){e==="focusin"?(vm(),Eo=n,To=r,Eo.attachEvent("onpropertychange",xm)):e==="focusout"&&vm()}function Dy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ol(To)}function Uy(e,n){if(e==="click")return Ol(n)}function Ly(e,n){if(e==="input"||e==="change")return Ol(n)}function Ny(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var li=typeof Object.is=="function"?Object.is:Ny;function Ao(e,n){if(li(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),o=Object.keys(n);if(r.length!==o.length)return!1;for(o=0;o<r.length;o++){var u=r[o];if(!ce.call(n,u)||!li(e[u],n[u]))return!1}return!0}function ym(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sm(e,n){var r=ym(e);e=0;for(var o;r;){if(r.nodeType===3){if(o=e+r.textContent.length,e<=n&&o>=n)return{node:r,offset:n-e};e=o}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=ym(r)}}function Mm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Mm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function bm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=te(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=te(e.document)}return n}function sf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var Oy=da&&"documentMode"in document&&11>=document.documentMode,dr=null,rf=null,Ro=null,of=!1;function Em(e,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;of||dr==null||dr!==te(o)||(o=dr,"selectionStart"in o&&sf(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ro&&Ao(Ro,o)||(Ro=o,o=Mc(rf,"onSelect"),0<o.length&&(n=new Ll("onSelect","select",null,n,r),e.push({event:n,listeners:o}),n.target=dr)))}function Ds(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var pr={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionrun:Ds("Transition","TransitionRun"),transitionstart:Ds("Transition","TransitionStart"),transitioncancel:Ds("Transition","TransitionCancel"),transitionend:Ds("Transition","TransitionEnd")},lf={},Tm={};da&&(Tm=document.createElement("div").style,"AnimationEvent"in window||(delete pr.animationend.animation,delete pr.animationiteration.animation,delete pr.animationstart.animation),"TransitionEvent"in window||delete pr.transitionend.transition);function Us(e){if(lf[e])return lf[e];if(!pr[e])return e;var n=pr[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Tm)return lf[e]=n[r];return e}var Am=Us("animationend"),Rm=Us("animationiteration"),wm=Us("animationstart"),Py=Us("transitionrun"),zy=Us("transitionstart"),Fy=Us("transitioncancel"),Cm=Us("transitionend"),Dm=new Map,cf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");cf.push("scrollEnd");function Pi(e,n){Dm.set(e,n),ut(n,[e])}var Pl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},yi=[],mr=0,uf=0;function zl(){for(var e=mr,n=uf=mr=0;n<e;){var r=yi[n];yi[n++]=null;var o=yi[n];yi[n++]=null;var u=yi[n];yi[n++]=null;var h=yi[n];if(yi[n++]=null,o!==null&&u!==null){var S=o.pending;S===null?u.next=u:(u.next=S.next,S.next=u),o.pending=u}h!==0&&Um(r,u,h)}}function Fl(e,n,r,o){yi[mr++]=e,yi[mr++]=n,yi[mr++]=r,yi[mr++]=o,uf|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function ff(e,n,r,o){return Fl(e,n,r,o),Il(e)}function Ls(e,n){return Fl(e,null,null,n),Il(e)}function Um(e,n,r){e.lanes|=r;var o=e.alternate;o!==null&&(o.lanes|=r);for(var u=!1,h=e.return;h!==null;)h.childLanes|=r,o=h.alternate,o!==null&&(o.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&n!==null&&(u=31-Lt(r),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[n]:o.push(n),n.lane=r|536870912),h):null}function Il(e){if(50<Zo)throw Zo=0,yh=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var gr={};function Iy(e,n,r,o){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,n,r,o){return new Iy(e,n,r,o)}function hf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pa(e,n){var r=e.alternate;return r===null?(r=ci(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Lm(e,n){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Bl(e,n,r,o,u,h){var S=0;if(o=e,typeof e=="function")hf(e)&&(S=1);else if(typeof e=="string")S=kS(e,r,wt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case U:return e=ci(31,r,n,u),e.elementType=U,e.lanes=h,e;case R:return Ns(r.children,u,h,n);case x:S=8,u|=24;break;case y:return e=ci(12,r,n,u|2),e.elementType=y,e.lanes=h,e;case G:return e=ci(13,r,n,u),e.elementType=G,e.lanes=h,e;case B:return e=ci(19,r,n,u),e.elementType=B,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:S=10;break t;case w:S=9;break t;case C:S=11;break t;case F:S=14;break t;case T:S=16,o=null;break t}S=29,r=Error(s(130,e===null?"null":typeof e,"")),o=null}return n=ci(S,r,n,u),n.elementType=e,n.type=o,n.lanes=h,n}function Ns(e,n,r,o){return e=ci(7,e,o,n),e.lanes=r,e}function df(e,n,r){return e=ci(6,e,null,n),e.lanes=r,e}function Nm(e){var n=ci(18,null,null,0);return n.stateNode=e,n}function pf(e,n,r){return n=ci(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Om=new WeakMap;function Si(e,n){if(typeof e=="object"&&e!==null){var r=Om.get(e);return r!==void 0?r:(n={value:e,source:n,stack:X(n)},Om.set(e,n),n)}return{value:e,source:n,stack:X(n)}}var _r=[],vr=0,Hl=null,wo=0,Mi=[],bi=0,Wa=null,ji=1,Zi="";function ma(e,n){_r[vr++]=wo,_r[vr++]=Hl,Hl=e,wo=n}function Pm(e,n,r){Mi[bi++]=ji,Mi[bi++]=Zi,Mi[bi++]=Wa,Wa=e;var o=ji;e=Zi;var u=32-Lt(o)-1;o&=~(1<<u),r+=1;var h=32-Lt(n)+u;if(30<h){var S=u-u%5;h=(o&(1<<S)-1).toString(32),o>>=S,u-=S,ji=1<<32-Lt(n)+u|r<<u|o,Zi=h+e}else ji=1<<h|r<<u|o,Zi=e}function mf(e){e.return!==null&&(ma(e,1),Pm(e,1,0))}function gf(e){for(;e===Hl;)Hl=_r[--vr],_r[vr]=null,wo=_r[--vr],_r[vr]=null;for(;e===Wa;)Wa=Mi[--bi],Mi[bi]=null,Zi=Mi[--bi],Mi[bi]=null,ji=Mi[--bi],Mi[bi]=null}function zm(e,n){Mi[bi++]=ji,Mi[bi++]=Zi,Mi[bi++]=Wa,ji=n.id,Zi=n.overflow,Wa=e}var wn=null,Ke=null,Ce=!1,qa=null,Ei=!1,_f=Error(s(519));function Ya(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(Si(n,e)),_f}function Fm(e){var n=e.stateNode,r=e.type,o=e.memoizedProps;switch(n[cn]=e,n[vn]=o,r){case"dialog":Ae("cancel",n),Ae("close",n);break;case"iframe":case"object":case"embed":Ae("load",n);break;case"video":case"audio":for(r=0;r<Qo.length;r++)Ae(Qo[r],n);break;case"source":Ae("error",n);break;case"img":case"image":case"link":Ae("error",n),Ae("load",n);break;case"details":Ae("toggle",n);break;case"input":Ae("invalid",n),ri(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ae("invalid",n);break;case"textarea":Ae("invalid",n),un(n,o.value,o.defaultValue,o.children)}r=o.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||o.suppressHydrationWarning===!0||t_(n.textContent,r)?(o.popover!=null&&(Ae("beforetoggle",n),Ae("toggle",n)),o.onScroll!=null&&Ae("scroll",n),o.onScrollEnd!=null&&Ae("scrollend",n),o.onClick!=null&&(n.onclick=ha),n=!0):n=!1,n||Ya(e,!0)}function Im(e){for(wn=e.return;wn;)switch(wn.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:wn=wn.return}}function xr(e){if(e!==wn)return!1;if(!Ce)return Im(e),Ce=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Ph(e.type,e.memoizedProps)),r=!r),r&&Ke&&Ya(e),Im(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ke=c_(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ke=c_(e)}else n===27?(n=Ke,os(e.type)?(e=Hh,Hh=null,Ke=e):Ke=n):Ke=wn?Ai(e.stateNode.nextSibling):null;return!0}function Os(){Ke=wn=null,Ce=!1}function vf(){var e=qa;return e!==null&&(ei===null?ei=e:ei.push.apply(ei,e),qa=null),e}function Co(e){qa===null?qa=[e]:qa.push(e)}var xf=I(null),Ps=null,ga=null;function ja(e,n,r){Mt(xf,n._currentValue),n._currentValue=r}function _a(e){e._currentValue=xf.current,K(xf)}function yf(e,n,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===r)break;e=e.return}}function Sf(e,n,r,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var S=u.child;h=h.firstContext;t:for(;h!==null;){var L=h;h=u;for(var W=0;W<n.length;W++)if(L.context===n[W]){h.lanes|=r,L=h.alternate,L!==null&&(L.lanes|=r),yf(h.return,r,e),o||(S=null);break t}h=L.next}}else if(u.tag===18){if(S=u.return,S===null)throw Error(s(341));S.lanes|=r,h=S.alternate,h!==null&&(h.lanes|=r),yf(S,r,e),S=null}else S=u.child;if(S!==null)S.return=u;else for(S=u;S!==null;){if(S===e){S=null;break}if(u=S.sibling,u!==null){u.return=S.return,S=u;break}S=S.return}u=S}}function yr(e,n,r,o){e=null;for(var u=n,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var S=u.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var L=u.type;li(u.pendingProps.value,S.value)||(e!==null?e.push(L):e=[L])}}else if(u===Et.current){if(S=u.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(nl):e=[nl])}u=u.return}e!==null&&Sf(n,e,r,o),n.flags|=262144}function Gl(e){for(e=e.firstContext;e!==null;){if(!li(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function zs(e){Ps=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Cn(e){return Bm(Ps,e)}function Vl(e,n){return Ps===null&&zs(e),Bm(e,n)}function Bm(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},ga===null){if(e===null)throw Error(s(308));ga=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else ga=ga.next=n;return r}var By=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},Hy=a.unstable_scheduleCallback,Gy=a.unstable_NormalPriority,hn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mf(){return{controller:new By,data:new Map,refCount:0}}function Do(e){e.refCount--,e.refCount===0&&Hy(Gy,function(){e.controller.abort()})}var Uo=null,bf=0,Sr=0,Mr=null;function Vy(e,n){if(Uo===null){var r=Uo=[];bf=0,Sr=Ah(),Mr={status:"pending",value:void 0,then:function(o){r.push(o)}}}return bf++,n.then(Hm,Hm),n}function Hm(){if(--bf===0&&Uo!==null){Mr!==null&&(Mr.status="fulfilled");var e=Uo;Uo=null,Sr=0,Mr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function ky(e,n){var r=[],o={status:"pending",value:null,reason:null,then:function(u){r.push(u)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var u=0;u<r.length;u++)(0,r[u])(n)},function(u){for(o.status="rejected",o.reason=u,u=0;u<r.length;u++)(0,r[u])(void 0)}),o}var Gm=z.S;z.S=function(e,n){E0=b(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Vy(e,n),Gm!==null&&Gm(e,n)};var Fs=I(null);function Ef(){var e=Fs.current;return e!==null?e:Ye.pooledCache}function kl(e,n){n===null?Mt(Fs,Fs.current):Mt(Fs,n.pool)}function Vm(){var e=Ef();return e===null?null:{parent:hn._currentValue,pool:e}}var br=Error(s(460)),Tf=Error(s(474)),Xl=Error(s(542)),Wl={then:function(){}};function km(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xm(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(ha,ha),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,qm(e),e;default:if(typeof n.status=="string")n.then(ha,ha);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=o}},function(o){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,qm(e),e}throw Bs=n,br}}function Is(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Bs=r,br):r}}var Bs=null;function Wm(){if(Bs===null)throw Error(s(459));var e=Bs;return Bs=null,e}function qm(e){if(e===br||e===Xl)throw Error(s(483))}var Er=null,Lo=0;function ql(e){var n=Lo;return Lo+=1,Er===null&&(Er=[]),Xm(Er,e,n)}function No(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Yl(e,n){throw n.$$typeof===g?Error(s(525)):(e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Ym(e){function n(at,Z){if(e){var ft=at.deletions;ft===null?(at.deletions=[Z],at.flags|=16):ft.push(Z)}}function r(at,Z){if(!e)return null;for(;Z!==null;)n(at,Z),Z=Z.sibling;return null}function o(at){for(var Z=new Map;at!==null;)at.key!==null?Z.set(at.key,at):Z.set(at.index,at),at=at.sibling;return Z}function u(at,Z){return at=pa(at,Z),at.index=0,at.sibling=null,at}function h(at,Z,ft){return at.index=ft,e?(ft=at.alternate,ft!==null?(ft=ft.index,ft<Z?(at.flags|=67108866,Z):ft):(at.flags|=67108866,Z)):(at.flags|=1048576,Z)}function S(at){return e&&at.alternate===null&&(at.flags|=67108866),at}function L(at,Z,ft,Rt){return Z===null||Z.tag!==6?(Z=df(ft,at.mode,Rt),Z.return=at,Z):(Z=u(Z,ft),Z.return=at,Z)}function W(at,Z,ft,Rt){var re=ft.type;return re===R?Tt(at,Z,ft.props.children,Rt,ft.key):Z!==null&&(Z.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===T&&Is(re)===Z.type)?(Z=u(Z,ft.props),No(Z,ft),Z.return=at,Z):(Z=Bl(ft.type,ft.key,ft.props,null,at.mode,Rt),No(Z,ft),Z.return=at,Z)}function dt(at,Z,ft,Rt){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ft.containerInfo||Z.stateNode.implementation!==ft.implementation?(Z=pf(ft,at.mode,Rt),Z.return=at,Z):(Z=u(Z,ft.children||[]),Z.return=at,Z)}function Tt(at,Z,ft,Rt,re){return Z===null||Z.tag!==7?(Z=Ns(ft,at.mode,Rt,re),Z.return=at,Z):(Z=u(Z,ft),Z.return=at,Z)}function Dt(at,Z,ft){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=df(""+Z,at.mode,ft),Z.return=at,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case M:return ft=Bl(Z.type,Z.key,Z.props,null,at.mode,ft),No(ft,Z),ft.return=at,ft;case E:return Z=pf(Z,at.mode,ft),Z.return=at,Z;case T:return Z=Is(Z),Dt(at,Z,ft)}if(Y(Z)||q(Z))return Z=Ns(Z,at.mode,ft,null),Z.return=at,Z;if(typeof Z.then=="function")return Dt(at,ql(Z),ft);if(Z.$$typeof===D)return Dt(at,Vl(at,Z),ft);Yl(at,Z)}return null}function mt(at,Z,ft,Rt){var re=Z!==null?Z.key:null;if(typeof ft=="string"&&ft!==""||typeof ft=="number"||typeof ft=="bigint")return re!==null?null:L(at,Z,""+ft,Rt);if(typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case M:return ft.key===re?W(at,Z,ft,Rt):null;case E:return ft.key===re?dt(at,Z,ft,Rt):null;case T:return ft=Is(ft),mt(at,Z,ft,Rt)}if(Y(ft)||q(ft))return re!==null?null:Tt(at,Z,ft,Rt,null);if(typeof ft.then=="function")return mt(at,Z,ql(ft),Rt);if(ft.$$typeof===D)return mt(at,Z,Vl(at,ft),Rt);Yl(at,ft)}return null}function yt(at,Z,ft,Rt,re){if(typeof Rt=="string"&&Rt!==""||typeof Rt=="number"||typeof Rt=="bigint")return at=at.get(ft)||null,L(Z,at,""+Rt,re);if(typeof Rt=="object"&&Rt!==null){switch(Rt.$$typeof){case M:return at=at.get(Rt.key===null?ft:Rt.key)||null,W(Z,at,Rt,re);case E:return at=at.get(Rt.key===null?ft:Rt.key)||null,dt(Z,at,Rt,re);case T:return Rt=Is(Rt),yt(at,Z,ft,Rt,re)}if(Y(Rt)||q(Rt))return at=at.get(ft)||null,Tt(Z,at,Rt,re,null);if(typeof Rt.then=="function")return yt(at,Z,ft,ql(Rt),re);if(Rt.$$typeof===D)return yt(at,Z,ft,Vl(Z,Rt),re);Yl(Z,Rt)}return null}function Qt(at,Z,ft,Rt){for(var re=null,Ne=null,ie=Z,Se=Z=0,we=null;ie!==null&&Se<ft.length;Se++){ie.index>Se?(we=ie,ie=null):we=ie.sibling;var Oe=mt(at,ie,ft[Se],Rt);if(Oe===null){ie===null&&(ie=we);break}e&&ie&&Oe.alternate===null&&n(at,ie),Z=h(Oe,Z,Se),Ne===null?re=Oe:Ne.sibling=Oe,Ne=Oe,ie=we}if(Se===ft.length)return r(at,ie),Ce&&ma(at,Se),re;if(ie===null){for(;Se<ft.length;Se++)ie=Dt(at,ft[Se],Rt),ie!==null&&(Z=h(ie,Z,Se),Ne===null?re=ie:Ne.sibling=ie,Ne=ie);return Ce&&ma(at,Se),re}for(ie=o(ie);Se<ft.length;Se++)we=yt(ie,at,Se,ft[Se],Rt),we!==null&&(e&&we.alternate!==null&&ie.delete(we.key===null?Se:we.key),Z=h(we,Z,Se),Ne===null?re=we:Ne.sibling=we,Ne=we);return e&&ie.forEach(function(hs){return n(at,hs)}),Ce&&ma(at,Se),re}function le(at,Z,ft,Rt){if(ft==null)throw Error(s(151));for(var re=null,Ne=null,ie=Z,Se=Z=0,we=null,Oe=ft.next();ie!==null&&!Oe.done;Se++,Oe=ft.next()){ie.index>Se?(we=ie,ie=null):we=ie.sibling;var hs=mt(at,ie,Oe.value,Rt);if(hs===null){ie===null&&(ie=we);break}e&&ie&&hs.alternate===null&&n(at,ie),Z=h(hs,Z,Se),Ne===null?re=hs:Ne.sibling=hs,Ne=hs,ie=we}if(Oe.done)return r(at,ie),Ce&&ma(at,Se),re;if(ie===null){for(;!Oe.done;Se++,Oe=ft.next())Oe=Dt(at,Oe.value,Rt),Oe!==null&&(Z=h(Oe,Z,Se),Ne===null?re=Oe:Ne.sibling=Oe,Ne=Oe);return Ce&&ma(at,Se),re}for(ie=o(ie);!Oe.done;Se++,Oe=ft.next())Oe=yt(ie,at,Se,Oe.value,Rt),Oe!==null&&(e&&Oe.alternate!==null&&ie.delete(Oe.key===null?Se:Oe.key),Z=h(Oe,Z,Se),Ne===null?re=Oe:Ne.sibling=Oe,Ne=Oe);return e&&ie.forEach(function(tM){return n(at,tM)}),Ce&&ma(at,Se),re}function We(at,Z,ft,Rt){if(typeof ft=="object"&&ft!==null&&ft.type===R&&ft.key===null&&(ft=ft.props.children),typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case M:t:{for(var re=ft.key;Z!==null;){if(Z.key===re){if(re=ft.type,re===R){if(Z.tag===7){r(at,Z.sibling),Rt=u(Z,ft.props.children),Rt.return=at,at=Rt;break t}}else if(Z.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===T&&Is(re)===Z.type){r(at,Z.sibling),Rt=u(Z,ft.props),No(Rt,ft),Rt.return=at,at=Rt;break t}r(at,Z);break}else n(at,Z);Z=Z.sibling}ft.type===R?(Rt=Ns(ft.props.children,at.mode,Rt,ft.key),Rt.return=at,at=Rt):(Rt=Bl(ft.type,ft.key,ft.props,null,at.mode,Rt),No(Rt,ft),Rt.return=at,at=Rt)}return S(at);case E:t:{for(re=ft.key;Z!==null;){if(Z.key===re)if(Z.tag===4&&Z.stateNode.containerInfo===ft.containerInfo&&Z.stateNode.implementation===ft.implementation){r(at,Z.sibling),Rt=u(Z,ft.children||[]),Rt.return=at,at=Rt;break t}else{r(at,Z);break}else n(at,Z);Z=Z.sibling}Rt=pf(ft,at.mode,Rt),Rt.return=at,at=Rt}return S(at);case T:return ft=Is(ft),We(at,Z,ft,Rt)}if(Y(ft))return Qt(at,Z,ft,Rt);if(q(ft)){if(re=q(ft),typeof re!="function")throw Error(s(150));return ft=re.call(ft),le(at,Z,ft,Rt)}if(typeof ft.then=="function")return We(at,Z,ql(ft),Rt);if(ft.$$typeof===D)return We(at,Z,Vl(at,ft),Rt);Yl(at,ft)}return typeof ft=="string"&&ft!==""||typeof ft=="number"||typeof ft=="bigint"?(ft=""+ft,Z!==null&&Z.tag===6?(r(at,Z.sibling),Rt=u(Z,ft),Rt.return=at,at=Rt):(r(at,Z),Rt=df(ft,at.mode,Rt),Rt.return=at,at=Rt),S(at)):r(at,Z)}return function(at,Z,ft,Rt){try{Lo=0;var re=We(at,Z,ft,Rt);return Er=null,re}catch(ie){if(ie===br||ie===Xl)throw ie;var Ne=ci(29,ie,null,at.mode);return Ne.lanes=Rt,Ne.return=at,Ne}}}var Hs=Ym(!0),jm=Ym(!1),Za=!1;function Af(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qa(e,n,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(ze&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=Il(e),Um(e,null,r),n}return Fl(e,o,n,r),Il(e)}function Oo(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,r|=o,n.lanes=r,sr(e,r)}}function wf(e,n){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var u=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var S={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?u=h=S:h=h.next=S,r=r.next}while(r!==null);h===null?u=h=n:h=h.next=n}else u=h=n;r={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var Cf=!1;function Po(){if(Cf){var e=Mr;if(e!==null)throw e}}function zo(e,n,r,o){Cf=!1;var u=e.updateQueue;Za=!1;var h=u.firstBaseUpdate,S=u.lastBaseUpdate,L=u.shared.pending;if(L!==null){u.shared.pending=null;var W=L,dt=W.next;W.next=null,S===null?h=dt:S.next=dt,S=W;var Tt=e.alternate;Tt!==null&&(Tt=Tt.updateQueue,L=Tt.lastBaseUpdate,L!==S&&(L===null?Tt.firstBaseUpdate=dt:L.next=dt,Tt.lastBaseUpdate=W))}if(h!==null){var Dt=u.baseState;S=0,Tt=dt=W=null,L=h;do{var mt=L.lane&-536870913,yt=mt!==L.lane;if(yt?(Re&mt)===mt:(o&mt)===mt){mt!==0&&mt===Sr&&(Cf=!0),Tt!==null&&(Tt=Tt.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});t:{var Qt=e,le=L;mt=n;var We=r;switch(le.tag){case 1:if(Qt=le.payload,typeof Qt=="function"){Dt=Qt.call(We,Dt,mt);break t}Dt=Qt;break t;case 3:Qt.flags=Qt.flags&-65537|128;case 0:if(Qt=le.payload,mt=typeof Qt=="function"?Qt.call(We,Dt,mt):Qt,mt==null)break t;Dt=_({},Dt,mt);break t;case 2:Za=!0}}mt=L.callback,mt!==null&&(e.flags|=64,yt&&(e.flags|=8192),yt=u.callbacks,yt===null?u.callbacks=[mt]:yt.push(mt))}else yt={lane:mt,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Tt===null?(dt=Tt=yt,W=Dt):Tt=Tt.next=yt,S|=mt;if(L=L.next,L===null){if(L=u.shared.pending,L===null)break;yt=L,L=yt.next,yt.next=null,u.lastBaseUpdate=yt,u.shared.pending=null}}while(!0);Tt===null&&(W=Dt),u.baseState=W,u.firstBaseUpdate=dt,u.lastBaseUpdate=Tt,h===null&&(u.shared.lanes=0),ns|=S,e.lanes=S,e.memoizedState=Dt}}function Zm(e,n){if(typeof e!="function")throw Error(s(191,e));e.call(n)}function Km(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Zm(r[e],n)}var Tr=I(null),jl=I(0);function Qm(e,n){e=Aa,Mt(jl,e),Mt(Tr,n),Aa=e|n.baseLanes}function Df(){Mt(jl,Aa),Mt(Tr,Tr.current)}function Uf(){Aa=jl.current,K(Tr),K(jl)}var ui=I(null),Ti=null;function Ja(e){var n=e.alternate;Mt(on,on.current&1),Mt(ui,e),Ti===null&&(n===null||Tr.current!==null||n.memoizedState!==null)&&(Ti=e)}function Lf(e){Mt(on,on.current),Mt(ui,e),Ti===null&&(Ti=e)}function Jm(e){e.tag===22?(Mt(on,on.current),Mt(ui,e),Ti===null&&(Ti=e)):$a()}function $a(){Mt(on,on.current),Mt(ui,ui.current)}function fi(e){K(ui),Ti===e&&(Ti=null),K(on)}var on=I(0);function Zl(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Ih(r)||Bh(r)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var va=0,xe=null,ke=null,dn=null,Kl=!1,Ar=!1,Gs=!1,Ql=0,Fo=0,Rr=null,Xy=0;function sn(){throw Error(s(321))}function Nf(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!li(e[r],n[r]))return!1;return!0}function Of(e,n,r,o,u,h){return va=h,xe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,z.H=e===null||e.memoizedState===null?Pg:Zf,Gs=!1,h=r(o,u),Gs=!1,Ar&&(h=tg(n,r,o,u)),$m(e),h}function $m(e){z.H=Ho;var n=ke!==null&&ke.next!==null;if(va=0,dn=ke=xe=null,Kl=!1,Fo=0,Rr=null,n)throw Error(s(300));e===null||pn||(e=e.dependencies,e!==null&&Gl(e)&&(pn=!0))}function tg(e,n,r,o){xe=e;var u=0;do{if(Ar&&(Rr=null),Fo=0,Ar=!1,25<=u)throw Error(s(301));if(u+=1,dn=ke=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}z.H=zg,h=n(r,o)}while(Ar);return h}function Wy(){var e=z.H,n=e.useState()[0];return n=typeof n.then=="function"?Io(n):n,e=e.useState()[0],(ke!==null?ke.memoizedState:null)!==e&&(xe.flags|=1024),n}function Pf(){var e=Ql!==0;return Ql=0,e}function zf(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Ff(e){if(Kl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Kl=!1}va=0,dn=ke=xe=null,Ar=!1,Fo=Ql=0,Rr=null}function Yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?xe.memoizedState=dn=e:dn=dn.next=e,dn}function ln(){if(ke===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var n=dn===null?xe.memoizedState:dn.next;if(n!==null)dn=n,ke=e;else{if(e===null)throw xe.alternate===null?Error(s(467)):Error(s(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},dn===null?xe.memoizedState=dn=e:dn=dn.next=e}return dn}function Jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var n=Fo;return Fo+=1,Rr===null&&(Rr=[]),e=Xm(Rr,e,n),n=xe,(dn===null?n.memoizedState:dn.next)===null&&(n=n.alternate,z.H=n===null||n.memoizedState===null?Pg:Zf),e}function $l(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Io(e);if(e.$$typeof===D)return Cn(e)}throw Error(s(438,String(e)))}function If(e){var n=null,r=xe.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var o=xe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=Jl(),xe.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),o=0;o<e;o++)r[o]=et;return n.index++,r}function xa(e,n){return typeof n=="function"?n(e):n}function tc(e){var n=ln();return Bf(n,ke,e)}function Bf(e,n,r){var o=e.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=r;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var S=u.next;u.next=h.next,h.next=S}n.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{n=u.next;var L=S=null,W=null,dt=n,Tt=!1;do{var Dt=dt.lane&-536870913;if(Dt!==dt.lane?(Re&Dt)===Dt:(va&Dt)===Dt){var mt=dt.revertLane;if(mt===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:dt.action,hasEagerState:dt.hasEagerState,eagerState:dt.eagerState,next:null}),Dt===Sr&&(Tt=!0);else if((va&mt)===mt){dt=dt.next,mt===Sr&&(Tt=!0);continue}else Dt={lane:0,revertLane:dt.revertLane,gesture:null,action:dt.action,hasEagerState:dt.hasEagerState,eagerState:dt.eagerState,next:null},W===null?(L=W=Dt,S=h):W=W.next=Dt,xe.lanes|=mt,ns|=mt;Dt=dt.action,Gs&&r(h,Dt),h=dt.hasEagerState?dt.eagerState:r(h,Dt)}else mt={lane:Dt,revertLane:dt.revertLane,gesture:dt.gesture,action:dt.action,hasEagerState:dt.hasEagerState,eagerState:dt.eagerState,next:null},W===null?(L=W=mt,S=h):W=W.next=mt,xe.lanes|=Dt,ns|=Dt;dt=dt.next}while(dt!==null&&dt!==n);if(W===null?S=h:W.next=L,!li(h,e.memoizedState)&&(pn=!0,Tt&&(r=Mr,r!==null)))throw r;e.memoizedState=h,e.baseState=S,e.baseQueue=W,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Hf(e){var n=ln(),r=n.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var o=r.dispatch,u=r.pending,h=n.memoizedState;if(u!==null){r.pending=null;var S=u=u.next;do h=e(h,S.action),S=S.next;while(S!==u);li(h,n.memoizedState)||(pn=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,o]}function eg(e,n,r){var o=xe,u=ln(),h=Ce;if(h){if(r===void 0)throw Error(s(407));r=r()}else r=n();var S=!li((ke||u).memoizedState,r);if(S&&(u.memoizedState=r,pn=!0),u=u.queue,kf(ag.bind(null,o,u,e),[e]),u.getSnapshot!==n||S||dn!==null&&dn.memoizedState.tag&1){if(o.flags|=2048,wr(9,{destroy:void 0},ig.bind(null,o,u,r,n),null),Ye===null)throw Error(s(349));h||(va&127)!==0||ng(o,n,r)}return r}function ng(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=xe.updateQueue,n===null?(n=Jl(),xe.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function ig(e,n,r,o){n.value=r,n.getSnapshot=o,sg(n)&&rg(e)}function ag(e,n,r){return r(function(){sg(n)&&rg(e)})}function sg(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!li(e,r)}catch{return!0}}function rg(e){var n=Ls(e,2);n!==null&&ni(n,e,2)}function Gf(e){var n=Yn();if(typeof e=="function"){var r=e;if(e=r(),Gs){Nt(!0);try{r()}finally{Nt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:e},n}function og(e,n,r,o){return e.baseState=r,Bf(e,ke,typeof o=="function"?o:xa)}function qy(e,n,r,o,u){if(ic(e))throw Error(s(485));if(e=n.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){h.listeners.push(S)}};z.T!==null?r(!0):h.isTransition=!1,o(h),r=n.pending,r===null?(h.next=n.pending=h,lg(n,h)):(h.next=r.next,n.pending=r.next=h)}}function lg(e,n){var r=n.action,o=n.payload,u=e.state;if(n.isTransition){var h=z.T,S={};z.T=S;try{var L=r(u,o),W=z.S;W!==null&&W(S,L),cg(e,n,L)}catch(dt){Vf(e,n,dt)}finally{h!==null&&S.types!==null&&(h.types=S.types),z.T=h}}else try{h=r(u,o),cg(e,n,h)}catch(dt){Vf(e,n,dt)}}function cg(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(o){ug(e,n,o)},function(o){return Vf(e,n,o)}):ug(e,n,r)}function ug(e,n,r){n.status="fulfilled",n.value=r,fg(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,lg(e,r)))}function Vf(e,n,r){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=r,fg(n),n=n.next;while(n!==o)}e.action=null}function fg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function hg(e,n){return n}function dg(e,n){if(Ce){var r=Ye.formState;if(r!==null){t:{var o=xe;if(Ce){if(Ke){e:{for(var u=Ke,h=Ei;u.nodeType!==8;){if(!h){u=null;break e}if(u=Ai(u.nextSibling),u===null){u=null;break e}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){Ke=Ai(u.nextSibling),o=u.data==="F!";break t}}Ya(o)}o=!1}o&&(n=r[0])}}return r=Yn(),r.memoizedState=r.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hg,lastRenderedState:n},r.queue=o,r=Lg.bind(null,xe,o),o.dispatch=r,o=Gf(!1),h=jf.bind(null,xe,!1,o.queue),o=Yn(),u={state:n,dispatch:null,action:e,pending:null},o.queue=u,r=qy.bind(null,xe,u,h,r),u.dispatch=r,o.memoizedState=e,[n,r,!1]}function pg(e){var n=ln();return mg(n,ke,e)}function mg(e,n,r){if(n=Bf(e,n,hg)[0],e=tc(xa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Io(n)}catch(S){throw S===br?Xl:S}else o=n;n=ln();var u=n.queue,h=u.dispatch;return r!==n.memoizedState&&(xe.flags|=2048,wr(9,{destroy:void 0},Yy.bind(null,u,r),null)),[o,h,e]}function Yy(e,n){e.action=n}function gg(e){var n=ln(),r=ke;if(r!==null)return mg(n,r,e);ln(),n=n.memoizedState,r=ln();var o=r.queue.dispatch;return r.memoizedState=e,[n,o,!1]}function wr(e,n,r,o){return e={tag:e,create:r,deps:o,inst:n,next:null},n=xe.updateQueue,n===null&&(n=Jl(),xe.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(o=r.next,r.next=e,e.next=o,n.lastEffect=e),e}function _g(){return ln().memoizedState}function ec(e,n,r,o){var u=Yn();xe.flags|=e,u.memoizedState=wr(1|n,{destroy:void 0},r,o===void 0?null:o)}function nc(e,n,r,o){var u=ln();o=o===void 0?null:o;var h=u.memoizedState.inst;ke!==null&&o!==null&&Nf(o,ke.memoizedState.deps)?u.memoizedState=wr(n,h,r,o):(xe.flags|=e,u.memoizedState=wr(1|n,h,r,o))}function vg(e,n){ec(8390656,8,e,n)}function kf(e,n){nc(2048,8,e,n)}function jy(e){xe.flags|=4;var n=xe.updateQueue;if(n===null)n=Jl(),xe.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function xg(e){var n=ln().memoizedState;return jy({ref:n,nextImpl:e}),function(){if((ze&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function yg(e,n){return nc(4,2,e,n)}function Sg(e,n){return nc(4,4,e,n)}function Mg(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function bg(e,n,r){r=r!=null?r.concat([e]):null,nc(4,4,Mg.bind(null,n,e),r)}function Xf(){}function Eg(e,n){var r=ln();n=n===void 0?null:n;var o=r.memoizedState;return n!==null&&Nf(n,o[1])?o[0]:(r.memoizedState=[e,n],e)}function Tg(e,n){var r=ln();n=n===void 0?null:n;var o=r.memoizedState;if(n!==null&&Nf(n,o[1]))return o[0];if(o=e(),Gs){Nt(!0);try{e()}finally{Nt(!1)}}return r.memoizedState=[o,n],o}function Wf(e,n,r){return r===void 0||(va&1073741824)!==0&&(Re&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=A0(),xe.lanes|=e,ns|=e,r)}function Ag(e,n,r,o){return li(r,n)?r:Tr.current!==null?(e=Wf(e,r,o),li(e,n)||(pn=!0),e):(va&42)===0||(va&1073741824)!==0&&(Re&261930)===0?(pn=!0,e.memoizedState=r):(e=A0(),xe.lanes|=e,ns|=e,n)}function Rg(e,n,r,o,u){var h=A.p;A.p=h!==0&&8>h?h:8;var S=z.T,L={};z.T=L,jf(e,!1,n,r);try{var W=u(),dt=z.S;if(dt!==null&&dt(L,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var Tt=ky(W,o);Bo(e,n,Tt,pi(e))}else Bo(e,n,o,pi(e))}catch(Dt){Bo(e,n,{then:function(){},status:"rejected",reason:Dt},pi())}finally{A.p=h,S!==null&&L.types!==null&&(S.types=L.types),z.T=S}}function Zy(){}function qf(e,n,r,o){if(e.tag!==5)throw Error(s(476));var u=wg(e).queue;Rg(e,u,n,ht,r===null?Zy:function(){return Cg(e),r(o)})}function wg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ht,baseState:ht,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:ht},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Cg(e){var n=wg(e);n.next===null&&(n=e.alternate.memoizedState),Bo(e,n.next.queue,{},pi())}function Yf(){return Cn(nl)}function Dg(){return ln().memoizedState}function Ug(){return ln().memoizedState}function Ky(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=pi();e=Ka(r);var o=Qa(n,e,r);o!==null&&(ni(o,n,r),Oo(o,n,r)),n={cache:Mf()},e.payload=n;return}n=n.return}}function Qy(e,n,r){var o=pi();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)?Ng(n,r):(r=ff(e,n,r,o),r!==null&&(ni(r,e,o),Og(r,n,o)))}function Lg(e,n,r){var o=pi();Bo(e,n,r,o)}function Bo(e,n,r,o){var u={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(ic(e))Ng(n,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var S=n.lastRenderedState,L=h(S,r);if(u.hasEagerState=!0,u.eagerState=L,li(L,S))return Fl(e,n,u,0),Ye===null&&zl(),!1}catch{}if(r=ff(e,n,u,o),r!==null)return ni(r,e,o),Og(r,n,o),!0}return!1}function jf(e,n,r,o){if(o={lane:2,revertLane:Ah(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(n)throw Error(s(479))}else n=ff(e,r,o,2),n!==null&&ni(n,e,2)}function ic(e){var n=e.alternate;return e===xe||n!==null&&n===xe}function Ng(e,n){Ar=Kl=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Og(e,n,r){if((r&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,r|=o,n.lanes=r,sr(e,r)}}var Ho={readContext:Cn,use:$l,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useLayoutEffect:sn,useInsertionEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useSyncExternalStore:sn,useId:sn,useHostTransitionStatus:sn,useFormState:sn,useActionState:sn,useOptimistic:sn,useMemoCache:sn,useCacheRefresh:sn};Ho.useEffectEvent=sn;var Pg={readContext:Cn,use:$l,useCallback:function(e,n){return Yn().memoizedState=[e,n===void 0?null:n],e},useContext:Cn,useEffect:vg,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,ec(4194308,4,Mg.bind(null,n,e),r)},useLayoutEffect:function(e,n){return ec(4194308,4,e,n)},useInsertionEffect:function(e,n){ec(4,2,e,n)},useMemo:function(e,n){var r=Yn();n=n===void 0?null:n;var o=e();if(Gs){Nt(!0);try{e()}finally{Nt(!1)}}return r.memoizedState=[o,n],o},useReducer:function(e,n,r){var o=Yn();if(r!==void 0){var u=r(n);if(Gs){Nt(!0);try{r(n)}finally{Nt(!1)}}}else u=n;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=Qy.bind(null,xe,e),[o.memoizedState,e]},useRef:function(e){var n=Yn();return e={current:e},n.memoizedState=e},useState:function(e){e=Gf(e);var n=e.queue,r=Lg.bind(null,xe,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Xf,useDeferredValue:function(e,n){var r=Yn();return Wf(r,e,n)},useTransition:function(){var e=Gf(!1);return e=Rg.bind(null,xe,e.queue,!0,!1),Yn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var o=xe,u=Yn();if(Ce){if(r===void 0)throw Error(s(407));r=r()}else{if(r=n(),Ye===null)throw Error(s(349));(Re&127)!==0||ng(o,n,r)}u.memoizedState=r;var h={value:r,getSnapshot:n};return u.queue=h,vg(ag.bind(null,o,h,e),[e]),o.flags|=2048,wr(9,{destroy:void 0},ig.bind(null,o,h,r,n),null),r},useId:function(){var e=Yn(),n=Ye.identifierPrefix;if(Ce){var r=Zi,o=ji;r=(o&~(1<<32-Lt(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ql++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=Xy++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Yf,useFormState:dg,useActionState:dg,useOptimistic:function(e){var n=Yn();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=jf.bind(null,xe,!0,r),r.dispatch=n,[e,n]},useMemoCache:If,useCacheRefresh:function(){return Yn().memoizedState=Ky.bind(null,xe)},useEffectEvent:function(e){var n=Yn(),r={impl:e};return n.memoizedState=r,function(){if((ze&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},Zf={readContext:Cn,use:$l,useCallback:Eg,useContext:Cn,useEffect:kf,useImperativeHandle:bg,useInsertionEffect:yg,useLayoutEffect:Sg,useMemo:Tg,useReducer:tc,useRef:_g,useState:function(){return tc(xa)},useDebugValue:Xf,useDeferredValue:function(e,n){var r=ln();return Ag(r,ke.memoizedState,e,n)},useTransition:function(){var e=tc(xa)[0],n=ln().memoizedState;return[typeof e=="boolean"?e:Io(e),n]},useSyncExternalStore:eg,useId:Dg,useHostTransitionStatus:Yf,useFormState:pg,useActionState:pg,useOptimistic:function(e,n){var r=ln();return og(r,ke,e,n)},useMemoCache:If,useCacheRefresh:Ug};Zf.useEffectEvent=xg;var zg={readContext:Cn,use:$l,useCallback:Eg,useContext:Cn,useEffect:kf,useImperativeHandle:bg,useInsertionEffect:yg,useLayoutEffect:Sg,useMemo:Tg,useReducer:Hf,useRef:_g,useState:function(){return Hf(xa)},useDebugValue:Xf,useDeferredValue:function(e,n){var r=ln();return ke===null?Wf(r,e,n):Ag(r,ke.memoizedState,e,n)},useTransition:function(){var e=Hf(xa)[0],n=ln().memoizedState;return[typeof e=="boolean"?e:Io(e),n]},useSyncExternalStore:eg,useId:Dg,useHostTransitionStatus:Yf,useFormState:gg,useActionState:gg,useOptimistic:function(e,n){var r=ln();return ke!==null?og(r,ke,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:If,useCacheRefresh:Ug};zg.useEffectEvent=xg;function Kf(e,n,r,o){n=e.memoizedState,r=r(o,n),r=r==null?n:_({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Qf={enqueueSetState:function(e,n,r){e=e._reactInternals;var o=pi(),u=Ka(o);u.payload=n,r!=null&&(u.callback=r),n=Qa(e,u,o),n!==null&&(ni(n,e,o),Oo(n,e,o))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var o=pi(),u=Ka(o);u.tag=1,u.payload=n,r!=null&&(u.callback=r),n=Qa(e,u,o),n!==null&&(ni(n,e,o),Oo(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=pi(),o=Ka(r);o.tag=2,n!=null&&(o.callback=n),n=Qa(e,o,r),n!==null&&(ni(n,e,r),Oo(n,e,r))}};function Fg(e,n,r,o,u,h,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,S):n.prototype&&n.prototype.isPureReactComponent?!Ao(r,o)||!Ao(u,h):!0}function Ig(e,n,r,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,o),n.state!==e&&Qf.enqueueReplaceState(n,n.state,null)}function Vs(e,n){var r=n;if("ref"in n){r={};for(var o in n)o!=="ref"&&(r[o]=n[o])}if(e=e.defaultProps){r===n&&(r=_({},r));for(var u in e)r[u]===void 0&&(r[u]=e[u])}return r}function Bg(e){Pl(e)}function Hg(e){console.error(e)}function Gg(e){Pl(e)}function ac(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Vg(e,n,r){try{var o=e.onCaughtError;o(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Jf(e,n,r){return r=Ka(r),r.tag=3,r.payload={element:null},r.callback=function(){ac(e,n)},r}function kg(e){return e=Ka(e),e.tag=3,e}function Xg(e,n,r,o){var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){Vg(n,r,o)}}var S=r.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Vg(n,r,o),typeof u!="function"&&(is===null?is=new Set([this]):is.add(this));var L=o.stack;this.componentDidCatch(o.value,{componentStack:L!==null?L:""})})}function Jy(e,n,r,o,u){if(r.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=r.alternate,n!==null&&yr(n,r,u,!0),r=ui.current,r!==null){switch(r.tag){case 31:case 13:return Ti===null?gc():r.alternate===null&&rn===0&&(rn=3),r.flags&=-257,r.flags|=65536,r.lanes=u,o===Wl?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([o]):n.add(o),bh(e,o,u)),!1;case 22:return r.flags|=65536,o===Wl?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([o]):r.add(o)),bh(e,o,u)),!1}throw Error(s(435,r.tag))}return bh(e,o,u),gc(),!1}if(Ce)return n=ui.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,o!==_f&&(e=Error(s(422),{cause:o}),Co(Si(e,r)))):(o!==_f&&(n=Error(s(423),{cause:o}),Co(Si(n,r))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=Si(o,r),u=Jf(e.stateNode,o,u),wf(e,u),rn!==4&&(rn=2)),!1;var h=Error(s(520),{cause:o});if(h=Si(h,r),jo===null?jo=[h]:jo.push(h),rn!==4&&(rn=2),n===null)return!0;o=Si(o,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=u&-u,r.lanes|=e,e=Jf(r.stateNode,o,e),wf(r,e),!1;case 1:if(n=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(is===null||!is.has(h))))return r.flags|=65536,u&=-u,r.lanes|=u,u=kg(u),Xg(u,e,r,o),wf(r,u),!1}r=r.return}while(r!==null);return!1}var $f=Error(s(461)),pn=!1;function Dn(e,n,r,o){n.child=e===null?jm(n,null,r,o):Hs(n,e.child,r,o)}function Wg(e,n,r,o,u){r=r.render;var h=n.ref;if("ref"in o){var S={};for(var L in o)L!=="ref"&&(S[L]=o[L])}else S=o;return zs(n),o=Of(e,n,r,S,h,u),L=Pf(),e!==null&&!pn?(zf(e,n,u),ya(e,n,u)):(Ce&&L&&mf(n),n.flags|=1,Dn(e,n,o,u),n.child)}function qg(e,n,r,o,u){if(e===null){var h=r.type;return typeof h=="function"&&!hf(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,Yg(e,n,h,o,u)):(e=Bl(r.type,null,o,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!oh(e,u)){var S=h.memoizedProps;if(r=r.compare,r=r!==null?r:Ao,r(S,o)&&e.ref===n.ref)return ya(e,n,u)}return n.flags|=1,e=pa(h,o),e.ref=n.ref,e.return=n,n.child=e}function Yg(e,n,r,o,u){if(e!==null){var h=e.memoizedProps;if(Ao(h,o)&&e.ref===n.ref)if(pn=!1,n.pendingProps=o=h,oh(e,u))(e.flags&131072)!==0&&(pn=!0);else return n.lanes=e.lanes,ya(e,n,u)}return th(e,n,r,o,u)}function jg(e,n,r,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|r:r,e!==null){for(o=n.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,n.child=null;return Zg(e,n,h,r,o)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&kl(n,h!==null?h.cachePool:null),h!==null?Qm(n,h):Df(),Jm(n);else return o=n.lanes=536870912,Zg(e,n,h!==null?h.baseLanes|r:r,r,o)}else h!==null?(kl(n,h.cachePool),Qm(n,h),$a(),n.memoizedState=null):(e!==null&&kl(n,null),Df(),$a());return Dn(e,n,u,r),n.child}function Go(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Zg(e,n,r,o,u){var h=Ef();return h=h===null?null:{parent:hn._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&kl(n,null),Df(),Jm(n),e!==null&&yr(e,n,o,!0),n.childLanes=u,null}function sc(e,n){return n=oc({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Kg(e,n,r){return Hs(n,e.child,null,r),e=sc(n,n.pendingProps),e.flags|=2,fi(n),n.memoizedState=null,e}function $y(e,n,r){var o=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ce){if(o.mode==="hidden")return e=sc(n,o),n.lanes=536870912,Go(null,e);if(Lf(n),(e=Ke)?(e=l_(e,Ei),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Wa!==null?{id:ji,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},r=Nm(e),r.return=n,n.child=r,wn=n,Ke=null)):e=null,e===null)throw Ya(n);return n.lanes=536870912,null}return sc(n,o)}var h=e.memoizedState;if(h!==null){var S=h.dehydrated;if(Lf(n),u)if(n.flags&256)n.flags&=-257,n=Kg(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(s(558));else if(pn||yr(e,n,r,!1),u=(r&e.childLanes)!==0,pn||u){if(o=Ye,o!==null&&(S=El(o,r),S!==0&&S!==h.retryLane))throw h.retryLane=S,Ls(e,S),ni(o,e,S),$f;gc(),n=Kg(e,n,r)}else e=h.treeContext,Ke=Ai(S.nextSibling),wn=n,Ce=!0,qa=null,Ei=!1,e!==null&&zm(n,e),n=sc(n,o),n.flags|=4096;return n}return e=pa(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function rc(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function th(e,n,r,o,u){return zs(n),r=Of(e,n,r,o,void 0,u),o=Pf(),e!==null&&!pn?(zf(e,n,u),ya(e,n,u)):(Ce&&o&&mf(n),n.flags|=1,Dn(e,n,r,u),n.child)}function Qg(e,n,r,o,u,h){return zs(n),n.updateQueue=null,r=tg(n,o,r,u),$m(e),o=Pf(),e!==null&&!pn?(zf(e,n,h),ya(e,n,h)):(Ce&&o&&mf(n),n.flags|=1,Dn(e,n,r,h),n.child)}function Jg(e,n,r,o,u){if(zs(n),n.stateNode===null){var h=gr,S=r.contextType;typeof S=="object"&&S!==null&&(h=Cn(S)),h=new r(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Qf,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},Af(n),S=r.contextType,h.context=typeof S=="object"&&S!==null?Cn(S):gr,h.state=n.memoizedState,S=r.getDerivedStateFromProps,typeof S=="function"&&(Kf(n,r,S,o),h.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(S=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),S!==h.state&&Qf.enqueueReplaceState(h,h.state,null),zo(n,o,h,u),Po(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){h=n.stateNode;var L=n.memoizedProps,W=Vs(r,L);h.props=W;var dt=h.context,Tt=r.contextType;S=gr,typeof Tt=="object"&&Tt!==null&&(S=Cn(Tt));var Dt=r.getDerivedStateFromProps;Tt=typeof Dt=="function"||typeof h.getSnapshotBeforeUpdate=="function",L=n.pendingProps!==L,Tt||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(L||dt!==S)&&Ig(n,h,o,S),Za=!1;var mt=n.memoizedState;h.state=mt,zo(n,o,h,u),Po(),dt=n.memoizedState,L||mt!==dt||Za?(typeof Dt=="function"&&(Kf(n,r,Dt,o),dt=n.memoizedState),(W=Za||Fg(n,r,W,o,mt,dt,S))?(Tt||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=dt),h.props=o,h.state=dt,h.context=S,o=W):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,Rf(e,n),S=n.memoizedProps,Tt=Vs(r,S),h.props=Tt,Dt=n.pendingProps,mt=h.context,dt=r.contextType,W=gr,typeof dt=="object"&&dt!==null&&(W=Cn(dt)),L=r.getDerivedStateFromProps,(dt=typeof L=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==Dt||mt!==W)&&Ig(n,h,o,W),Za=!1,mt=n.memoizedState,h.state=mt,zo(n,o,h,u),Po();var yt=n.memoizedState;S!==Dt||mt!==yt||Za||e!==null&&e.dependencies!==null&&Gl(e.dependencies)?(typeof L=="function"&&(Kf(n,r,L,o),yt=n.memoizedState),(Tt=Za||Fg(n,r,Tt,o,mt,yt,W)||e!==null&&e.dependencies!==null&&Gl(e.dependencies))?(dt||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,yt,W),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,yt,W)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&mt===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&mt===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=yt),h.props=o,h.state=yt,h.context=W,o=Tt):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&mt===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&mt===e.memoizedState||(n.flags|=1024),o=!1)}return h=o,rc(e,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,r=o&&typeof r.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&o?(n.child=Hs(n,e.child,null,u),n.child=Hs(n,null,r,u)):Dn(e,n,r,u),n.memoizedState=h.state,e=n.child):e=ya(e,n,u),e}function $g(e,n,r,o){return Os(),n.flags|=256,Dn(e,n,r,o),n.child}var eh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nh(e){return{baseLanes:e,cachePool:Vm()}}function ih(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=di),e}function t0(e,n,r){var o=n.pendingProps,u=!1,h=(n.flags&128)!==0,S;if((S=h)||(S=e!==null&&e.memoizedState===null?!1:(on.current&2)!==0),S&&(u=!0,n.flags&=-129),S=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ce){if(u?Ja(n):$a(),(e=Ke)?(e=l_(e,Ei),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Wa!==null?{id:ji,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},r=Nm(e),r.return=n,n.child=r,wn=n,Ke=null)):e=null,e===null)throw Ya(n);return Bh(e)?n.lanes=32:n.lanes=536870912,null}var L=o.children;return o=o.fallback,u?($a(),u=n.mode,L=oc({mode:"hidden",children:L},u),o=Ns(o,u,r,null),L.return=n,o.return=n,L.sibling=o,n.child=L,o=n.child,o.memoizedState=nh(r),o.childLanes=ih(e,S,r),n.memoizedState=eh,Go(null,o)):(Ja(n),ah(n,L))}var W=e.memoizedState;if(W!==null&&(L=W.dehydrated,L!==null)){if(h)n.flags&256?(Ja(n),n.flags&=-257,n=sh(e,n,r)):n.memoizedState!==null?($a(),n.child=e.child,n.flags|=128,n=null):($a(),L=o.fallback,u=n.mode,o=oc({mode:"visible",children:o.children},u),L=Ns(L,u,r,null),L.flags|=2,o.return=n,L.return=n,o.sibling=L,n.child=o,Hs(n,e.child,null,r),o=n.child,o.memoizedState=nh(r),o.childLanes=ih(e,S,r),n.memoizedState=eh,n=Go(null,o));else if(Ja(n),Bh(L)){if(S=L.nextSibling&&L.nextSibling.dataset,S)var dt=S.dgst;S=dt,o=Error(s(419)),o.stack="",o.digest=S,Co({value:o,source:null,stack:null}),n=sh(e,n,r)}else if(pn||yr(e,n,r,!1),S=(r&e.childLanes)!==0,pn||S){if(S=Ye,S!==null&&(o=El(S,r),o!==0&&o!==W.retryLane))throw W.retryLane=o,Ls(e,o),ni(S,e,o),$f;Ih(L)||gc(),n=sh(e,n,r)}else Ih(L)?(n.flags|=192,n.child=e.child,n=null):(e=W.treeContext,Ke=Ai(L.nextSibling),wn=n,Ce=!0,qa=null,Ei=!1,e!==null&&zm(n,e),n=ah(n,o.children),n.flags|=4096);return n}return u?($a(),L=o.fallback,u=n.mode,W=e.child,dt=W.sibling,o=pa(W,{mode:"hidden",children:o.children}),o.subtreeFlags=W.subtreeFlags&65011712,dt!==null?L=pa(dt,L):(L=Ns(L,u,r,null),L.flags|=2),L.return=n,o.return=n,o.sibling=L,n.child=o,Go(null,o),o=n.child,L=e.child.memoizedState,L===null?L=nh(r):(u=L.cachePool,u!==null?(W=hn._currentValue,u=u.parent!==W?{parent:W,pool:W}:u):u=Vm(),L={baseLanes:L.baseLanes|r,cachePool:u}),o.memoizedState=L,o.childLanes=ih(e,S,r),n.memoizedState=eh,Go(e.child,o)):(Ja(n),r=e.child,e=r.sibling,r=pa(r,{mode:"visible",children:o.children}),r.return=n,r.sibling=null,e!==null&&(S=n.deletions,S===null?(n.deletions=[e],n.flags|=16):S.push(e)),n.child=r,n.memoizedState=null,r)}function ah(e,n){return n=oc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function oc(e,n){return e=ci(22,e,null,n),e.lanes=0,e}function sh(e,n,r){return Hs(n,e.child,null,r),e=ah(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function e0(e,n,r){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),yf(e.return,n,r)}function rh(e,n,r,o,u,h){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:r,tailMode:u,treeForkCount:h}:(S.isBackwards=n,S.rendering=null,S.renderingStartTime=0,S.last=o,S.tail=r,S.tailMode=u,S.treeForkCount=h)}function n0(e,n,r){var o=n.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var S=on.current,L=(S&2)!==0;if(L?(S=S&1|2,n.flags|=128):S&=1,Mt(on,S),Dn(e,n,o,r),o=Ce?wo:0,!L&&e!==null&&(e.flags&128)!==0)t:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&e0(e,r,n);else if(e.tag===19)e0(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break t;for(;e.sibling===null;){if(e.return===null||e.return===n)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(r=n.child,u=null;r!==null;)e=r.alternate,e!==null&&Zl(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=n.child,n.child=null):(u=r.sibling,r.sibling=null),rh(n,!1,u,r,h,o);break;case"backwards":case"unstable_legacy-backwards":for(r=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&Zl(e)===null){n.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}rh(n,!0,r,null,h,o);break;case"together":rh(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function ya(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),ns|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(yr(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,r=pa(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=pa(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function oh(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Gl(e)))}function tS(e,n,r){switch(n.tag){case 3:gt(n,n.stateNode.containerInfo),ja(n,hn,e.memoizedState.cache),Os();break;case 27:case 5:tt(n);break;case 4:gt(n,n.stateNode.containerInfo);break;case 10:ja(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Lf(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Ja(n),n.flags|=128,null):(r&n.child.childLanes)!==0?t0(e,n,r):(Ja(n),e=ya(e,n,r),e!==null?e.sibling:null);Ja(n);break;case 19:var u=(e.flags&128)!==0;if(o=(r&n.childLanes)!==0,o||(yr(e,n,r,!1),o=(r&n.childLanes)!==0),u){if(o)return n0(e,n,r);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Mt(on,on.current),o)break;return null;case 22:return n.lanes=0,jg(e,n,r,n.pendingProps);case 24:ja(n,hn,e.memoizedState.cache)}return ya(e,n,r)}function i0(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)pn=!0;else{if(!oh(e,r)&&(n.flags&128)===0)return pn=!1,tS(e,n,r);pn=(e.flags&131072)!==0}else pn=!1,Ce&&(n.flags&1048576)!==0&&Pm(n,wo,n.index);switch(n.lanes=0,n.tag){case 16:t:{var o=n.pendingProps;if(e=Is(n.elementType),n.type=e,typeof e=="function")hf(e)?(o=Vs(e,o),n.tag=1,n=Jg(null,n,e,o,r)):(n.tag=0,n=th(null,n,e,o,r));else{if(e!=null){var u=e.$$typeof;if(u===C){n.tag=11,n=Wg(null,n,e,o,r);break t}else if(u===F){n.tag=14,n=qg(null,n,e,o,r);break t}}throw n=ot(e)||e,Error(s(306,n,""))}}return n;case 0:return th(e,n,n.type,n.pendingProps,r);case 1:return o=n.type,u=Vs(o,n.pendingProps),Jg(e,n,o,u,r);case 3:t:{if(gt(n,n.stateNode.containerInfo),e===null)throw Error(s(387));o=n.pendingProps;var h=n.memoizedState;u=h.element,Rf(e,n),zo(n,o,null,r);var S=n.memoizedState;if(o=S.cache,ja(n,hn,o),o!==h.cache&&Sf(n,[hn],r,!0),Po(),o=S.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:S.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=$g(e,n,o,r);break t}else if(o!==u){u=Si(Error(s(424)),n),Co(u),n=$g(e,n,o,r);break t}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ke=Ai(e.firstChild),wn=n,Ce=!0,qa=null,Ei=!0,r=jm(n,null,o,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Os(),o===u){n=ya(e,n,r);break t}Dn(e,n,o,r)}n=n.child}return n;case 26:return rc(e,n),e===null?(r=p_(n.type,null,n.pendingProps,null))?n.memoizedState=r:Ce||(r=n.type,e=n.pendingProps,o=bc(st.current).createElement(r),o[cn]=n,o[vn]=e,Un(o,r,e),J(o),n.stateNode=o):n.memoizedState=p_(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return tt(n),e===null&&Ce&&(o=n.stateNode=f_(n.type,n.pendingProps,st.current),wn=n,Ei=!0,u=Ke,os(n.type)?(Hh=u,Ke=Ai(o.firstChild)):Ke=u),Dn(e,n,n.pendingProps.children,r),rc(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ce&&((u=o=Ke)&&(o=DS(o,n.type,n.pendingProps,Ei),o!==null?(n.stateNode=o,wn=n,Ke=Ai(o.firstChild),Ei=!1,u=!0):u=!1),u||Ya(n)),tt(n),u=n.type,h=n.pendingProps,S=e!==null?e.memoizedProps:null,o=h.children,Ph(u,h)?o=null:S!==null&&Ph(u,S)&&(n.flags|=32),n.memoizedState!==null&&(u=Of(e,n,Wy,null,null,r),nl._currentValue=u),rc(e,n),Dn(e,n,o,r),n.child;case 6:return e===null&&Ce&&((e=r=Ke)&&(r=US(r,n.pendingProps,Ei),r!==null?(n.stateNode=r,wn=n,Ke=null,e=!0):e=!1),e||Ya(n)),null;case 13:return t0(e,n,r);case 4:return gt(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Hs(n,null,o,r):Dn(e,n,o,r),n.child;case 11:return Wg(e,n,n.type,n.pendingProps,r);case 7:return Dn(e,n,n.pendingProps,r),n.child;case 8:return Dn(e,n,n.pendingProps.children,r),n.child;case 12:return Dn(e,n,n.pendingProps.children,r),n.child;case 10:return o=n.pendingProps,ja(n,n.type,o.value),Dn(e,n,o.children,r),n.child;case 9:return u=n.type._context,o=n.pendingProps.children,zs(n),u=Cn(u),o=o(u),n.flags|=1,Dn(e,n,o,r),n.child;case 14:return qg(e,n,n.type,n.pendingProps,r);case 15:return Yg(e,n,n.type,n.pendingProps,r);case 19:return n0(e,n,r);case 31:return $y(e,n,r);case 22:return jg(e,n,r,n.pendingProps);case 24:return zs(n),o=Cn(hn),e===null?(u=Ef(),u===null&&(u=Ye,h=Mf(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=r),u=h),n.memoizedState={parent:o,cache:u},Af(n),ja(n,hn,u)):((e.lanes&r)!==0&&(Rf(e,n),zo(n,null,null,r),Po()),u=e.memoizedState,h=n.memoizedState,u.parent!==o?(u={parent:o,cache:o},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),ja(n,hn,o)):(o=h.cache,ja(n,hn,o),o!==u.cache&&Sf(n,[hn],r,!0))),Dn(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function Sa(e){e.flags|=4}function lh(e,n,r,o,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(D0())e.flags|=8192;else throw Bs=Wl,Tf}else e.flags&=-16777217}function a0(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!x_(n))if(D0())e.flags|=8192;else throw Bs=Wl,Tf}function lc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Ie():536870912,e.lanes|=n,Lr|=n)}function Vo(e,n){if(!Ce)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Qe(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,o=0;if(n)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=r,n}function eS(e,n,r){var o=n.pendingProps;switch(gf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(n),null;case 1:return Qe(n),null;case 3:return r=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),_a(hn),Ut(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xr(n)?Sa(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,vf())),Qe(n),null;case 26:var u=n.type,h=n.memoizedState;return e===null?(Sa(n),h!==null?(Qe(n),a0(n,h)):(Qe(n),lh(n,u,null,o,r))):h?h!==e.memoizedState?(Sa(n),Qe(n),a0(n,h)):(Qe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&Sa(n),Qe(n),lh(n,u,e,o,r)),null;case 27:if(ct(n),r=st.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Sa(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Qe(n),null}e=wt.current,xr(n)?Fm(n):(e=f_(u,o,r),n.stateNode=e,Sa(n))}return Qe(n),null;case 5:if(ct(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Sa(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Qe(n),null}if(h=wt.current,xr(n))Fm(n);else{var S=bc(st.current);switch(h){case 1:h=S.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=S.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=S.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?S.createElement("select",{is:o.is}):S.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?S.createElement(u,{is:o.is}):S.createElement(u)}}h[cn]=n,h[vn]=o;t:for(S=n.child;S!==null;){if(S.tag===5||S.tag===6)h.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===n)break t;for(;S.sibling===null;){if(S.return===null||S.return===n)break t;S=S.return}S.sibling.return=S.return,S=S.sibling}n.stateNode=h;t:switch(Un(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break t;case"img":o=!0;break t;default:o=!1}o&&Sa(n)}}return Qe(n),lh(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&Sa(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(s(166));if(e=st.current,xr(n)){if(e=n.stateNode,r=n.memoizedProps,o=null,u=wn,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[cn]=n,e=!!(e.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||t_(e.nodeValue,r)),e||Ya(n,!0)}else e=bc(e).createTextNode(o),e[cn]=n,n.stateNode=e}return Qe(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(o=xr(n),r!==null){if(e===null){if(!o)throw Error(s(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[cn]=n}else Os(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Qe(n),e=!1}else r=vf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(fi(n),n):(fi(n),null);if((n.flags&128)!==0)throw Error(s(558))}return Qe(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=xr(n),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[cn]=n}else Os(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Qe(n),u=!1}else u=vf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(fi(n),n):(fi(n),null)}return fi(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,e=e!==null&&e.memoizedState!==null,r&&(o=n.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),lc(n,n.updateQueue),Qe(n),null);case 4:return Ut(),e===null&&Dh(n.stateNode.containerInfo),Qe(n),null;case 10:return _a(n.type),Qe(n),null;case 19:if(K(on),o=n.memoizedState,o===null)return Qe(n),null;if(u=(n.flags&128)!==0,h=o.rendering,h===null)if(u)Vo(o,!1);else{if(rn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Zl(e),h!==null){for(n.flags|=128,Vo(o,!1),e=h.updateQueue,n.updateQueue=e,lc(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Lm(r,e),r=r.sibling;return Mt(on,on.current&1|2),Ce&&ma(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&b()>dc&&(n.flags|=128,u=!0,Vo(o,!1),n.lanes=4194304)}else{if(!u)if(e=Zl(h),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,lc(n,e),Vo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ce)return Qe(n),null}else 2*b()-o.renderingStartTime>dc&&r!==536870912&&(n.flags|=128,u=!0,Vo(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(e=o.last,e!==null?e.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=b(),e.sibling=null,r=on.current,Mt(on,u?r&1|2:r&1),Ce&&ma(n,o.treeForkCount),e):(Qe(n),null);case 22:case 23:return fi(n),Uf(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(Qe(n),n.subtreeFlags&6&&(n.flags|=8192)):Qe(n),r=n.updateQueue,r!==null&&lc(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),e!==null&&K(Fs),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),_a(hn),Qe(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function nS(e,n){switch(gf(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return _a(hn),Ut(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return ct(n),null;case 31:if(n.memoizedState!==null){if(fi(n),n.alternate===null)throw Error(s(340));Os()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(fi(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Os()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return K(on),null;case 4:return Ut(),null;case 10:return _a(n.type),null;case 22:case 23:return fi(n),Uf(),e!==null&&K(Fs),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return _a(hn),null;case 25:return null;default:return null}}function s0(e,n){switch(gf(n),n.tag){case 3:_a(hn),Ut();break;case 26:case 27:case 5:ct(n);break;case 4:Ut();break;case 31:n.memoizedState!==null&&fi(n);break;case 13:fi(n);break;case 19:K(on);break;case 10:_a(n.type);break;case 22:case 23:fi(n),Uf(),e!==null&&K(Fs);break;case 24:_a(hn)}}function ko(e,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var u=o.next;r=u;do{if((r.tag&e)===e){o=void 0;var h=r.create,S=r.inst;o=h(),S.destroy=o}r=r.next}while(r!==u)}}catch(L){He(n,n.return,L)}}function ts(e,n,r){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var S=o.inst,L=S.destroy;if(L!==void 0){S.destroy=void 0,u=n;var W=r,dt=L;try{dt()}catch(Tt){He(u,W,Tt)}}}o=o.next}while(o!==h)}}catch(Tt){He(n,n.return,Tt)}}function r0(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{Km(n,r)}catch(o){He(e,e.return,o)}}}function o0(e,n,r){r.props=Vs(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(o){He(e,n,o)}}function Xo(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof r=="function"?e.refCleanup=r(o):r.current=o}}catch(u){He(e,n,u)}}function Ki(e,n){var r=e.ref,o=e.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(u){He(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(u){He(e,n,u)}else r.current=null}function l0(e){var n=e.type,r=e.memoizedProps,o=e.stateNode;try{t:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break t;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(u){He(e,e.return,u)}}function ch(e,n,r){try{var o=e.stateNode;ES(o,e.type,r,n),o[vn]=n}catch(u){He(e,e.return,u)}}function c0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&os(e.type)||e.tag===4}function uh(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||c0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&os(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fh(e,n,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ha));else if(o!==4&&(o===27&&os(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(fh(e,n,r),e=e.sibling;e!==null;)fh(e,n,r),e=e.sibling}function cc(e,n,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(o!==4&&(o===27&&os(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(cc(e,n,r),e=e.sibling;e!==null;)cc(e,n,r),e=e.sibling}function u0(e){var n=e.stateNode,r=e.memoizedProps;try{for(var o=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);Un(n,o,r),n[cn]=e,n[vn]=r}catch(h){He(e,e.return,h)}}var Ma=!1,mn=!1,hh=!1,f0=typeof WeakSet=="function"?WeakSet:Set,Tn=null;function iS(e,n){if(e=e.containerInfo,Nh=Dc,e=bm(e),sf(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else t:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break t}var S=0,L=-1,W=-1,dt=0,Tt=0,Dt=e,mt=null;e:for(;;){for(var yt;Dt!==r||u!==0&&Dt.nodeType!==3||(L=S+u),Dt!==h||o!==0&&Dt.nodeType!==3||(W=S+o),Dt.nodeType===3&&(S+=Dt.nodeValue.length),(yt=Dt.firstChild)!==null;)mt=Dt,Dt=yt;for(;;){if(Dt===e)break e;if(mt===r&&++dt===u&&(L=S),mt===h&&++Tt===o&&(W=S),(yt=Dt.nextSibling)!==null)break;Dt=mt,mt=Dt.parentNode}Dt=yt}r=L===-1||W===-1?null:{start:L,end:W}}else r=null}r=r||{start:0,end:0}}else r=null;for(Oh={focusedElem:e,selectionRange:r},Dc=!1,Tn=n;Tn!==null;)if(n=Tn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Tn=e;else for(;Tn!==null;){switch(n=Tn,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)u=e[r],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,u=h.memoizedProps,h=h.memoizedState,o=r.stateNode;try{var Qt=Vs(r.type,u);e=o.getSnapshotBeforeUpdate(Qt,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(le){He(r,r.return,le)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)Fh(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Fh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=n.sibling,e!==null){e.return=n.return,Tn=e;break}Tn=n.return}}function h0(e,n,r){var o=r.flags;switch(r.tag){case 0:case 11:case 15:Ea(e,r),o&4&&ko(5,r);break;case 1:if(Ea(e,r),o&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(S){He(r,r.return,S)}else{var u=Vs(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(S){He(r,r.return,S)}}o&64&&r0(r),o&512&&Xo(r,r.return);break;case 3:if(Ea(e,r),o&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{Km(e,n)}catch(S){He(r,r.return,S)}}break;case 27:n===null&&o&4&&u0(r);case 26:case 5:Ea(e,r),n===null&&o&4&&l0(r),o&512&&Xo(r,r.return);break;case 12:Ea(e,r);break;case 31:Ea(e,r),o&4&&m0(e,r);break;case 13:Ea(e,r),o&4&&g0(e,r),o&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=hS.bind(null,r),LS(e,r))));break;case 22:if(o=r.memoizedState!==null||Ma,!o){n=n!==null&&n.memoizedState!==null||mn,u=Ma;var h=mn;Ma=o,(mn=n)&&!h?Ta(e,r,(r.subtreeFlags&8772)!==0):Ea(e,r),Ma=u,mn=h}break;case 30:break;default:Ea(e,r)}}function d0(e){var n=e.alternate;n!==null&&(e.alternate=null,d0(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&vo(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var tn=null,Jn=!1;function ba(e,n,r){for(r=r.child;r!==null;)p0(e,n,r),r=r.sibling}function p0(e,n,r){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(xt,r)}catch{}switch(r.tag){case 26:mn||Ki(r,n),ba(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:mn||Ki(r,n);var o=tn,u=Jn;os(r.type)&&(tn=r.stateNode,Jn=!1),ba(e,n,r),$o(r.stateNode),tn=o,Jn=u;break;case 5:mn||Ki(r,n);case 6:if(o=tn,u=Jn,tn=null,ba(e,n,r),tn=o,Jn=u,tn!==null)if(Jn)try{(tn.nodeType===9?tn.body:tn.nodeName==="HTML"?tn.ownerDocument.body:tn).removeChild(r.stateNode)}catch(h){He(r,n,h)}else try{tn.removeChild(r.stateNode)}catch(h){He(r,n,h)}break;case 18:tn!==null&&(Jn?(e=tn,r_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Hr(e)):r_(tn,r.stateNode));break;case 4:o=tn,u=Jn,tn=r.stateNode.containerInfo,Jn=!0,ba(e,n,r),tn=o,Jn=u;break;case 0:case 11:case 14:case 15:ts(2,r,n),mn||ts(4,r,n),ba(e,n,r);break;case 1:mn||(Ki(r,n),o=r.stateNode,typeof o.componentWillUnmount=="function"&&o0(r,n,o)),ba(e,n,r);break;case 21:ba(e,n,r);break;case 22:mn=(o=mn)||r.memoizedState!==null,ba(e,n,r),mn=o;break;default:ba(e,n,r)}}function m0(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hr(e)}catch(r){He(n,n.return,r)}}}function g0(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hr(e)}catch(r){He(n,n.return,r)}}function aS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new f0),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new f0),n;default:throw Error(s(435,e.tag))}}function uc(e,n){var r=aS(e);n.forEach(function(o){if(!r.has(o)){r.add(o);var u=dS.bind(null,e,o);o.then(u,u)}})}function $n(e,n){var r=n.deletions;if(r!==null)for(var o=0;o<r.length;o++){var u=r[o],h=e,S=n,L=S;t:for(;L!==null;){switch(L.tag){case 27:if(os(L.type)){tn=L.stateNode,Jn=!1;break t}break;case 5:tn=L.stateNode,Jn=!1;break t;case 3:case 4:tn=L.stateNode.containerInfo,Jn=!0;break t}L=L.return}if(tn===null)throw Error(s(160));p0(h,S,u),tn=null,Jn=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)_0(n,e),n=n.sibling}var zi=null;function _0(e,n){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$n(n,e),ti(e),o&4&&(ts(3,e,e.return),ko(3,e),ts(5,e,e.return));break;case 1:$n(n,e),ti(e),o&512&&(mn||r===null||Ki(r,r.return)),o&64&&Ma&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?o:r.concat(o))));break;case 26:var u=zi;if($n(n,e),ti(e),o&512&&(mn||r===null||Ki(r,r.return)),o&4){var h=r!==null?r.memoizedState:null;if(o=e.memoizedState,r===null)if(o===null)if(e.stateNode===null){t:{o=e.type,r=e.memoizedProps,u=u.ownerDocument||u;e:switch(o){case"title":h=u.getElementsByTagName("title")[0],(!h||h[Rs]||h[cn]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),Un(h,o,r),h[cn]=e,J(h),o=h;break t;case"link":var S=__("link","href",u).get(o+(r.href||""));if(S){for(var L=0;L<S.length;L++)if(h=S[L],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){S.splice(L,1);break e}}h=u.createElement(o),Un(h,o,r),u.head.appendChild(h);break;case"meta":if(S=__("meta","content",u).get(o+(r.content||""))){for(L=0;L<S.length;L++)if(h=S[L],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){S.splice(L,1);break e}}h=u.createElement(o),Un(h,o,r),u.head.appendChild(h);break;default:throw Error(s(468,o))}h[cn]=e,J(h),o=h}e.stateNode=o}else v_(u,e.type,e.stateNode);else e.stateNode=g_(u,o,e.memoizedProps);else h!==o?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,o===null?v_(u,e.type,e.stateNode):g_(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&ch(e,e.memoizedProps,r.memoizedProps)}break;case 27:$n(n,e),ti(e),o&512&&(mn||r===null||Ki(r,r.return)),r!==null&&o&4&&ch(e,e.memoizedProps,r.memoizedProps);break;case 5:if($n(n,e),ti(e),o&512&&(mn||r===null||Ki(r,r.return)),e.flags&32){u=e.stateNode;try{qn(u,"")}catch(Qt){He(e,e.return,Qt)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,ch(e,u,r!==null?r.memoizedProps:u)),o&1024&&(hh=!0);break;case 6:if($n(n,e),ti(e),o&4){if(e.stateNode===null)throw Error(s(162));o=e.memoizedProps,r=e.stateNode;try{r.nodeValue=o}catch(Qt){He(e,e.return,Qt)}}break;case 3:if(Ac=null,u=zi,zi=Ec(n.containerInfo),$n(n,e),zi=u,ti(e),o&4&&r!==null&&r.memoizedState.isDehydrated)try{Hr(n.containerInfo)}catch(Qt){He(e,e.return,Qt)}hh&&(hh=!1,v0(e));break;case 4:o=zi,zi=Ec(e.stateNode.containerInfo),$n(n,e),ti(e),zi=o;break;case 12:$n(n,e),ti(e);break;case 31:$n(n,e),ti(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,uc(e,o)));break;case 13:$n(n,e),ti(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hc=b()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,uc(e,o)));break;case 22:u=e.memoizedState!==null;var W=r!==null&&r.memoizedState!==null,dt=Ma,Tt=mn;if(Ma=dt||u,mn=Tt||W,$n(n,e),mn=Tt,Ma=dt,ti(e),o&8192)t:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(r===null||W||Ma||mn||ks(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){W=r=n;try{if(h=W.stateNode,u)S=h.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{L=W.stateNode;var Dt=W.memoizedProps.style,mt=Dt!=null&&Dt.hasOwnProperty("display")?Dt.display:null;L.style.display=mt==null||typeof mt=="boolean"?"":(""+mt).trim()}}catch(Qt){He(W,W.return,Qt)}}}else if(n.tag===6){if(r===null){W=n;try{W.stateNode.nodeValue=u?"":W.memoizedProps}catch(Qt){He(W,W.return,Qt)}}}else if(n.tag===18){if(r===null){W=n;try{var yt=W.stateNode;u?o_(yt,!0):o_(W.stateNode,!1)}catch(Qt){He(W,W.return,Qt)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break t;for(;n.sibling===null;){if(n.return===null||n.return===e)break t;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(r=o.retryQueue,r!==null&&(o.retryQueue=null,uc(e,r))));break;case 19:$n(n,e),ti(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,uc(e,o)));break;case 30:break;case 21:break;default:$n(n,e),ti(e)}}function ti(e){var n=e.flags;if(n&2){try{for(var r,o=e.return;o!==null;){if(c0(o)){r=o;break}o=o.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var u=r.stateNode,h=uh(e);cc(e,h,u);break;case 5:var S=r.stateNode;r.flags&32&&(qn(S,""),r.flags&=-33);var L=uh(e);cc(e,L,S);break;case 3:case 4:var W=r.stateNode.containerInfo,dt=uh(e);fh(e,dt,W);break;default:throw Error(s(161))}}catch(Tt){He(e,e.return,Tt)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function v0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;v0(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Ea(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)h0(e,n.alternate,n),n=n.sibling}function ks(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ts(4,n,n.return),ks(n);break;case 1:Ki(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&o0(n,n.return,r),ks(n);break;case 27:$o(n.stateNode);case 26:case 5:Ki(n,n.return),ks(n);break;case 22:n.memoizedState===null&&ks(n);break;case 30:ks(n);break;default:ks(n)}e=e.sibling}}function Ta(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,u=e,h=n,S=h.flags;switch(h.tag){case 0:case 11:case 15:Ta(u,h,r),ko(4,h);break;case 1:if(Ta(u,h,r),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(dt){He(o,o.return,dt)}if(o=h,u=o.updateQueue,u!==null){var L=o.stateNode;try{var W=u.shared.hiddenCallbacks;if(W!==null)for(u.shared.hiddenCallbacks=null,u=0;u<W.length;u++)Zm(W[u],L)}catch(dt){He(o,o.return,dt)}}r&&S&64&&r0(h),Xo(h,h.return);break;case 27:u0(h);case 26:case 5:Ta(u,h,r),r&&o===null&&S&4&&l0(h),Xo(h,h.return);break;case 12:Ta(u,h,r);break;case 31:Ta(u,h,r),r&&S&4&&m0(u,h);break;case 13:Ta(u,h,r),r&&S&4&&g0(u,h);break;case 22:h.memoizedState===null&&Ta(u,h,r),Xo(h,h.return);break;case 30:break;default:Ta(u,h,r)}n=n.sibling}}function dh(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Do(r))}function ph(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Do(e))}function Fi(e,n,r,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)x0(e,n,r,o),n=n.sibling}function x0(e,n,r,o){var u=n.flags;switch(n.tag){case 0:case 11:case 15:Fi(e,n,r,o),u&2048&&ko(9,n);break;case 1:Fi(e,n,r,o);break;case 3:Fi(e,n,r,o),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Do(e)));break;case 12:if(u&2048){Fi(e,n,r,o),e=n.stateNode;try{var h=n.memoizedProps,S=h.id,L=h.onPostCommit;typeof L=="function"&&L(S,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(W){He(n,n.return,W)}}else Fi(e,n,r,o);break;case 31:Fi(e,n,r,o);break;case 13:Fi(e,n,r,o);break;case 23:break;case 22:h=n.stateNode,S=n.alternate,n.memoizedState!==null?h._visibility&2?Fi(e,n,r,o):Wo(e,n):h._visibility&2?Fi(e,n,r,o):(h._visibility|=2,Cr(e,n,r,o,(n.subtreeFlags&10256)!==0||!1)),u&2048&&dh(S,n);break;case 24:Fi(e,n,r,o),u&2048&&ph(n.alternate,n);break;default:Fi(e,n,r,o)}}function Cr(e,n,r,o,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,S=n,L=r,W=o,dt=S.flags;switch(S.tag){case 0:case 11:case 15:Cr(h,S,L,W,u),ko(8,S);break;case 23:break;case 22:var Tt=S.stateNode;S.memoizedState!==null?Tt._visibility&2?Cr(h,S,L,W,u):Wo(h,S):(Tt._visibility|=2,Cr(h,S,L,W,u)),u&&dt&2048&&dh(S.alternate,S);break;case 24:Cr(h,S,L,W,u),u&&dt&2048&&ph(S.alternate,S);break;default:Cr(h,S,L,W,u)}n=n.sibling}}function Wo(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,o=n,u=o.flags;switch(o.tag){case 22:Wo(r,o),u&2048&&dh(o.alternate,o);break;case 24:Wo(r,o),u&2048&&ph(o.alternate,o);break;default:Wo(r,o)}n=n.sibling}}var qo=8192;function Dr(e,n,r){if(e.subtreeFlags&qo)for(e=e.child;e!==null;)y0(e,n,r),e=e.sibling}function y0(e,n,r){switch(e.tag){case 26:Dr(e,n,r),e.flags&qo&&e.memoizedState!==null&&XS(r,zi,e.memoizedState,e.memoizedProps);break;case 5:Dr(e,n,r);break;case 3:case 4:var o=zi;zi=Ec(e.stateNode.containerInfo),Dr(e,n,r),zi=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=qo,qo=16777216,Dr(e,n,r),qo=o):Dr(e,n,r));break;default:Dr(e,n,r)}}function S0(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Yo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];Tn=o,b0(o,e)}S0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)M0(e),e=e.sibling}function M0(e){switch(e.tag){case 0:case 11:case 15:Yo(e),e.flags&2048&&ts(9,e,e.return);break;case 3:Yo(e);break;case 12:Yo(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,fc(e)):Yo(e);break;default:Yo(e)}}function fc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];Tn=o,b0(o,e)}S0(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ts(8,n,n.return),fc(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,fc(n));break;default:fc(n)}e=e.sibling}}function b0(e,n){for(;Tn!==null;){var r=Tn;switch(r.tag){case 0:case 11:case 15:ts(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var o=r.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Do(r.memoizedState.cache)}if(o=r.child,o!==null)o.return=r,Tn=o;else t:for(r=e;Tn!==null;){o=Tn;var u=o.sibling,h=o.return;if(d0(o),o===r){Tn=null;break t}if(u!==null){u.return=h,Tn=u;break t}Tn=h}}}var sS={getCacheForType:function(e){var n=Cn(hn),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return Cn(hn).controller.signal}},rS=typeof WeakMap=="function"?WeakMap:Map,ze=0,Ye=null,Te=null,Re=0,Be=0,hi=null,es=!1,Ur=!1,mh=!1,Aa=0,rn=0,ns=0,Xs=0,gh=0,di=0,Lr=0,jo=null,ei=null,_h=!1,hc=0,E0=0,dc=1/0,pc=null,is=null,yn=0,as=null,Nr=null,Ra=0,vh=0,xh=null,T0=null,Zo=0,yh=null;function pi(){return(ze&2)!==0&&Re!==0?Re&-Re:z.T!==null?Ah():Yi()}function A0(){if(di===0)if((Re&536870912)===0||Ce){var e=Ft;Ft<<=1,(Ft&3932160)===0&&(Ft=262144),di=e}else di=536870912;return e=ui.current,e!==null&&(e.flags|=32),di}function ni(e,n,r){(e===Ye&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(Or(e,0),ss(e,Re,di,!1)),kn(e,r),((ze&2)===0||e!==Ye)&&(e===Ye&&((ze&2)===0&&(Xs|=r),rn===4&&ss(e,Re,di,!1)),Qi(e))}function R0(e,n,r){if((ze&6)!==0)throw Error(s(327));var o=!r&&(n&127)===0&&(n&e.expiredLanes)===0||jt(e,n),u=o?cS(e,n):Mh(e,n,!0),h=o;do{if(u===0){Ur&&!o&&ss(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!oS(r)){u=Mh(e,n,!1),h=!1;continue}if(u===2){if(h=n,e.errorRecoveryDisabledLanes&h)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){n=S;t:{var L=e;u=jo;var W=L.current.memoizedState.isDehydrated;if(W&&(Or(L,S).flags|=256),S=Mh(L,S,!1),S!==2){if(mh&&!W){L.errorRecoveryDisabledLanes|=h,Xs|=h,u=4;break t}h=ei,ei=u,h!==null&&(ei===null?ei=h:ei.push.apply(ei,h))}u=S}if(h=!1,u!==2)continue}}if(u===1){Or(e,0),ss(e,n,0,!0);break}t:{switch(o=e,h=u,h){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:ss(o,n,di,!es);break t;case 2:ei=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(u=hc+300-b(),10<u)){if(ss(o,n,di,!es),bt(o,0,!0)!==0)break t;Ra=n,o.timeoutHandle=a_(w0.bind(null,o,r,ei,pc,_h,n,di,Xs,Lr,es,h,"Throttled",-0,0),u);break t}w0(o,r,ei,pc,_h,n,di,Xs,Lr,es,h,null,-0,0)}}break}while(!0);Qi(e)}function w0(e,n,r,o,u,h,S,L,W,dt,Tt,Dt,mt,yt){if(e.timeoutHandle=-1,Dt=n.subtreeFlags,Dt&8192||(Dt&16785408)===16785408){Dt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ha},y0(n,h,Dt);var Qt=(h&62914560)===h?hc-b():(h&4194048)===h?E0-b():0;if(Qt=WS(Dt,Qt),Qt!==null){Ra=h,e.cancelPendingCommit=Qt(z0.bind(null,e,n,h,r,o,u,S,L,W,Tt,Dt,null,mt,yt)),ss(e,h,S,!dt);return}}z0(e,n,h,r,o,u,S,L,W)}function oS(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var o=0;o<r.length;o++){var u=r[o],h=u.getSnapshot;u=u.value;try{if(!li(h(),u))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ss(e,n,r,o){n&=~gh,n&=~Xs,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var u=n;0<u;){var h=31-Lt(u),S=1<<h;o[h]=-1,u&=~S}r!==0&&_o(e,r,n)}function mc(){return(ze&6)===0?(Ko(0),!1):!0}function Sh(){if(Te!==null){if(Be===0)var e=Te.return;else e=Te,ga=Ps=null,Ff(e),Er=null,Lo=0,e=Te;for(;e!==null;)s0(e.alternate,e),e=e.return;Te=null}}function Or(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,RS(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Ra=0,Sh(),Ye=e,Te=r=pa(e.current,null),Re=n,Be=0,hi=null,es=!1,Ur=jt(e,n),mh=!1,Lr=di=gh=Xs=ns=rn=0,ei=jo=null,_h=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var u=31-Lt(o),h=1<<u;n|=e[u],o&=~h}return Aa=n,zl(),r}function C0(e,n){xe=null,z.H=Ho,n===br||n===Xl?(n=Wm(),Be=3):n===Tf?(n=Wm(),Be=4):Be=n===$f?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,hi=n,Te===null&&(rn=1,ac(e,Si(n,e.current)))}function D0(){var e=ui.current;return e===null?!0:(Re&4194048)===Re?Ti===null:(Re&62914560)===Re||(Re&536870912)!==0?e===Ti:!1}function U0(){var e=z.H;return z.H=Ho,e===null?Ho:e}function L0(){var e=z.A;return z.A=sS,e}function gc(){rn=4,es||(Re&4194048)!==Re&&ui.current!==null||(Ur=!0),(ns&134217727)===0&&(Xs&134217727)===0||Ye===null||ss(Ye,Re,di,!1)}function Mh(e,n,r){var o=ze;ze|=2;var u=U0(),h=L0();(Ye!==e||Re!==n)&&(pc=null,Or(e,n)),n=!1;var S=rn;t:do try{if(Be!==0&&Te!==null){var L=Te,W=hi;switch(Be){case 8:Sh(),S=6;break t;case 3:case 2:case 9:case 6:ui.current===null&&(n=!0);var dt=Be;if(Be=0,hi=null,Pr(e,L,W,dt),r&&Ur){S=0;break t}break;default:dt=Be,Be=0,hi=null,Pr(e,L,W,dt)}}lS(),S=rn;break}catch(Tt){C0(e,Tt)}while(!0);return n&&e.shellSuspendCounter++,ga=Ps=null,ze=o,z.H=u,z.A=h,Te===null&&(Ye=null,Re=0,zl()),S}function lS(){for(;Te!==null;)N0(Te)}function cS(e,n){var r=ze;ze|=2;var o=U0(),u=L0();Ye!==e||Re!==n?(pc=null,dc=b()+500,Or(e,n)):Ur=jt(e,n);t:do try{if(Be!==0&&Te!==null){n=Te;var h=hi;e:switch(Be){case 1:Be=0,hi=null,Pr(e,n,h,1);break;case 2:case 9:if(km(h)){Be=0,hi=null,O0(n);break}n=function(){Be!==2&&Be!==9||Ye!==e||(Be=7),Qi(e)},h.then(n,n);break t;case 3:Be=7;break t;case 4:Be=5;break t;case 7:km(h)?(Be=0,hi=null,O0(n)):(Be=0,hi=null,Pr(e,n,h,7));break;case 5:var S=null;switch(Te.tag){case 26:S=Te.memoizedState;case 5:case 27:var L=Te;if(S?x_(S):L.stateNode.complete){Be=0,hi=null;var W=L.sibling;if(W!==null)Te=W;else{var dt=L.return;dt!==null?(Te=dt,_c(dt)):Te=null}break e}}Be=0,hi=null,Pr(e,n,h,5);break;case 6:Be=0,hi=null,Pr(e,n,h,6);break;case 8:Sh(),rn=6;break t;default:throw Error(s(462))}}uS();break}catch(Tt){C0(e,Tt)}while(!0);return ga=Ps=null,z.H=o,z.A=u,ze=r,Te!==null?0:(Ye=null,Re=0,zl(),rn)}function uS(){for(;Te!==null&&!Pt();)N0(Te)}function N0(e){var n=i0(e.alternate,e,Aa);e.memoizedProps=e.pendingProps,n===null?_c(e):Te=n}function O0(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=Qg(r,n,n.pendingProps,n.type,void 0,Re);break;case 11:n=Qg(r,n,n.pendingProps,n.type.render,n.ref,Re);break;case 5:Ff(n);default:s0(r,n),n=Te=Lm(n,Aa),n=i0(r,n,Aa)}e.memoizedProps=e.pendingProps,n===null?_c(e):Te=n}function Pr(e,n,r,o){ga=Ps=null,Ff(n),Er=null,Lo=0;var u=n.return;try{if(Jy(e,u,n,r,Re)){rn=1,ac(e,Si(r,e.current)),Te=null;return}}catch(h){if(u!==null)throw Te=u,h;rn=1,ac(e,Si(r,e.current)),Te=null;return}n.flags&32768?(Ce||o===1?e=!0:Ur||(Re&536870912)!==0?e=!1:(es=e=!0,(o===2||o===9||o===3||o===6)&&(o=ui.current,o!==null&&o.tag===13&&(o.flags|=16384))),P0(n,e)):_c(n)}function _c(e){var n=e;do{if((n.flags&32768)!==0){P0(n,es);return}e=n.return;var r=eS(n.alternate,n,Aa);if(r!==null){Te=r;return}if(n=n.sibling,n!==null){Te=n;return}Te=n=e}while(n!==null);rn===0&&(rn=5)}function P0(e,n){do{var r=nS(e.alternate,e);if(r!==null){r.flags&=32767,Te=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){Te=e;return}Te=e=r}while(e!==null);rn=6,Te=null}function z0(e,n,r,o,u,h,S,L,W){e.cancelPendingCommit=null;do vc();while(yn!==0);if((ze&6)!==0)throw Error(s(327));if(n!==null){if(n===e.current)throw Error(s(177));if(h=n.lanes|n.childLanes,h|=uf,Ui(e,r,h,S,L,W),e===Ye&&(Te=Ye=null,Re=0),Nr=n,as=e,Ra=r,vh=h,xh=u,T0=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,pS(P,function(){return G0(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=z.T,z.T=null,u=A.p,A.p=2,S=ze,ze|=4;try{iS(e,n,r)}finally{ze=S,A.p=u,z.T=o}}yn=1,F0(),I0(),B0()}}function F0(){if(yn===1){yn=0;var e=as,n=Nr,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=z.T,z.T=null;var o=A.p;A.p=2;var u=ze;ze|=4;try{_0(n,e);var h=Oh,S=bm(e.containerInfo),L=h.focusedElem,W=h.selectionRange;if(S!==L&&L&&L.ownerDocument&&Mm(L.ownerDocument.documentElement,L)){if(W!==null&&sf(L)){var dt=W.start,Tt=W.end;if(Tt===void 0&&(Tt=dt),"selectionStart"in L)L.selectionStart=dt,L.selectionEnd=Math.min(Tt,L.value.length);else{var Dt=L.ownerDocument||document,mt=Dt&&Dt.defaultView||window;if(mt.getSelection){var yt=mt.getSelection(),Qt=L.textContent.length,le=Math.min(W.start,Qt),We=W.end===void 0?le:Math.min(W.end,Qt);!yt.extend&&le>We&&(S=We,We=le,le=S);var at=Sm(L,le),Z=Sm(L,We);if(at&&Z&&(yt.rangeCount!==1||yt.anchorNode!==at.node||yt.anchorOffset!==at.offset||yt.focusNode!==Z.node||yt.focusOffset!==Z.offset)){var ft=Dt.createRange();ft.setStart(at.node,at.offset),yt.removeAllRanges(),le>We?(yt.addRange(ft),yt.extend(Z.node,Z.offset)):(ft.setEnd(Z.node,Z.offset),yt.addRange(ft))}}}}for(Dt=[],yt=L;yt=yt.parentNode;)yt.nodeType===1&&Dt.push({element:yt,left:yt.scrollLeft,top:yt.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Dt.length;L++){var Rt=Dt[L];Rt.element.scrollLeft=Rt.left,Rt.element.scrollTop=Rt.top}}Dc=!!Nh,Oh=Nh=null}finally{ze=u,A.p=o,z.T=r}}e.current=n,yn=2}}function I0(){if(yn===2){yn=0;var e=as,n=Nr,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=z.T,z.T=null;var o=A.p;A.p=2;var u=ze;ze|=4;try{h0(e,n.alternate,n)}finally{ze=u,A.p=o,z.T=r}}yn=3}}function B0(){if(yn===4||yn===3){yn=0,O();var e=as,n=Nr,r=Ra,o=T0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?yn=5:(yn=0,Nr=as=null,H0(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(is=null),or(r),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(xt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=z.T,u=A.p,A.p=2,z.T=null;try{for(var h=e.onRecoverableError,S=0;S<o.length;S++){var L=o[S];h(L.value,{componentStack:L.stack})}}finally{z.T=n,A.p=u}}(Ra&3)!==0&&vc(),Qi(e),u=e.pendingLanes,(r&261930)!==0&&(u&42)!==0?e===yh?Zo++:(Zo=0,yh=e):Zo=0,Ko(0)}}function H0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Do(n)))}function vc(){return F0(),I0(),B0(),G0()}function G0(){if(yn!==5)return!1;var e=as,n=vh;vh=0;var r=or(Ra),o=z.T,u=A.p;try{A.p=32>r?32:r,z.T=null,r=xh,xh=null;var h=as,S=Ra;if(yn=0,Nr=as=null,Ra=0,(ze&6)!==0)throw Error(s(331));var L=ze;if(ze|=4,M0(h.current),x0(h,h.current,S,r),ze=L,Ko(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(xt,h)}catch{}return!0}finally{A.p=u,z.T=o,H0(e,n)}}function V0(e,n,r){n=Si(r,n),n=Jf(e.stateNode,n,2),e=Qa(e,n,2),e!==null&&(kn(e,2),Qi(e))}function He(e,n,r){if(e.tag===3)V0(e,e,r);else for(;n!==null;){if(n.tag===3){V0(n,e,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(is===null||!is.has(o))){e=Si(r,e),r=kg(2),o=Qa(n,r,2),o!==null&&(Xg(r,o,n,e),kn(o,2),Qi(o));break}}n=n.return}}function bh(e,n,r){var o=e.pingCache;if(o===null){o=e.pingCache=new rS;var u=new Set;o.set(n,u)}else u=o.get(n),u===void 0&&(u=new Set,o.set(n,u));u.has(r)||(mh=!0,u.add(r),e=fS.bind(null,e,n,r),n.then(e,e))}function fS(e,n,r){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Ye===e&&(Re&r)===r&&(rn===4||rn===3&&(Re&62914560)===Re&&300>b()-hc?(ze&2)===0&&Or(e,0):gh|=r,Lr===Re&&(Lr=0)),Qi(e)}function k0(e,n){n===0&&(n=Ie()),e=Ls(e,n),e!==null&&(kn(e,n),Qi(e))}function hS(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),k0(e,r)}function dS(e,n){var r=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(r=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(n),k0(e,r)}function pS(e,n){return Jt(e,n)}var xc=null,zr=null,Eh=!1,yc=!1,Th=!1,rs=0;function Qi(e){e!==zr&&e.next===null&&(zr===null?xc=zr=e:zr=zr.next=e),yc=!0,Eh||(Eh=!0,gS())}function Ko(e,n){if(!Th&&yc){Th=!0;do for(var r=!1,o=xc;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var S=o.suspendedLanes,L=o.pingedLanes;h=(1<<31-Lt(42|e)+1)-1,h&=u&~(S&~L),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,Y0(o,h))}else h=Re,h=bt(o,o===Ye?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||jt(o,h)||(r=!0,Y0(o,h));o=o.next}while(r);Th=!1}}function mS(){X0()}function X0(){yc=Eh=!1;var e=0;rs!==0&&AS()&&(e=rs);for(var n=b(),r=null,o=xc;o!==null;){var u=o.next,h=W0(o,n);h===0?(o.next=null,r===null?xc=u:r.next=u,u===null&&(zr=r)):(r=o,(e!==0||(h&3)!==0)&&(yc=!0)),o=u}yn!==0&&yn!==5||Ko(e),rs!==0&&(rs=0)}function W0(e,n){for(var r=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var S=31-Lt(h),L=1<<S,W=u[S];W===-1?((L&r)===0||(L&o)!==0)&&(u[S]=he(L,n)):W<=n&&(e.expiredLanes|=L),h&=~L}if(n=Ye,r=Re,r=bt(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,r===0||e===n&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&ne(o),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||jt(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(o!==null&&ne(o),or(r)){case 2:case 8:r=k;break;case 32:r=P;break;case 268435456:r=rt;break;default:r=P}return o=q0.bind(null,e),r=Jt(r,o),e.callbackPriority=n,e.callbackNode=r,n}return o!==null&&o!==null&&ne(o),e.callbackPriority=2,e.callbackNode=null,2}function q0(e,n){if(yn!==0&&yn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(vc()&&e.callbackNode!==r)return null;var o=Re;return o=bt(e,e===Ye?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(R0(e,o,n),W0(e,b()),e.callbackNode!=null&&e.callbackNode===r?q0.bind(null,e):null)}function Y0(e,n){if(vc())return null;R0(e,n,!0)}function gS(){wS(function(){(ze&6)!==0?Jt($,mS):X0()})}function Ah(){if(rs===0){var e=Sr;e===0&&(e=zt,zt<<=1,(zt&261888)===0&&(zt=256)),rs=e}return rs}function j0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:wl(""+e)}function Z0(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function _S(e,n,r,o,u){if(n==="submit"&&r&&r.stateNode===u){var h=j0((u[vn]||null).action),S=o.submitter;S&&(n=(n=S[vn]||null)?j0(n.formAction):S.getAttribute("formAction"),n!==null&&(h=n,S=null));var L=new Ll("action","action",null,o,u);e.push({event:L,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(rs!==0){var W=S?Z0(u,S):new FormData(u);qf(r,{pending:!0,data:W,method:u.method,action:h},null,W)}}else typeof h=="function"&&(L.preventDefault(),W=S?Z0(u,S):new FormData(u),qf(r,{pending:!0,data:W,method:u.method,action:h},h,W))},currentTarget:u}]})}}for(var Rh=0;Rh<cf.length;Rh++){var wh=cf[Rh],vS=wh.toLowerCase(),xS=wh[0].toUpperCase()+wh.slice(1);Pi(vS,"on"+xS)}Pi(Am,"onAnimationEnd"),Pi(Rm,"onAnimationIteration"),Pi(wm,"onAnimationStart"),Pi("dblclick","onDoubleClick"),Pi("focusin","onFocus"),Pi("focusout","onBlur"),Pi(Py,"onTransitionRun"),Pi(zy,"onTransitionStart"),Pi(Fy,"onTransitionCancel"),Pi(Cm,"onTransitionEnd"),Ht("onMouseEnter",["mouseout","mouseover"]),Ht("onMouseLeave",["mouseout","mouseover"]),Ht("onPointerEnter",["pointerout","pointerover"]),Ht("onPointerLeave",["pointerout","pointerover"]),ut("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ut("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ut("onBeforeInput",["compositionend","keypress","textInput","paste"]),ut("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ut("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ut("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="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(" "),yS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function K0(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var o=e[r],u=o.event;o=o.listeners;t:{var h=void 0;if(n)for(var S=o.length-1;0<=S;S--){var L=o[S],W=L.instance,dt=L.currentTarget;if(L=L.listener,W!==h&&u.isPropagationStopped())break t;h=L,u.currentTarget=dt;try{h(u)}catch(Tt){Pl(Tt)}u.currentTarget=null,h=W}else for(S=0;S<o.length;S++){if(L=o[S],W=L.instance,dt=L.currentTarget,L=L.listener,W!==h&&u.isPropagationStopped())break t;h=L,u.currentTarget=dt;try{h(u)}catch(Tt){Pl(Tt)}u.currentTarget=null,h=W}}}}function Ae(e,n){var r=n[Ga];r===void 0&&(r=n[Ga]=new Set);var o=e+"__bubble";r.has(o)||(Q0(n,e,2,!1),r.add(o))}function Ch(e,n,r){var o=0;n&&(o|=4),Q0(r,e,o,n)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function Dh(e){if(!e[Sc]){e[Sc]=!0,vt.forEach(function(r){r!=="selectionchange"&&(yS.has(r)||Ch(r,!1,e),Ch(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Sc]||(n[Sc]=!0,Ch("selectionchange",!1,n))}}function Q0(e,n,r,o){switch(A_(n)){case 2:var u=jS;break;case 8:u=ZS;break;default:u=Wh}r=u.bind(null,n,r,e),u=void 0,!Zu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(n,r,{capture:!0,passive:u}):e.addEventListener(n,r,!0):u!==void 0?e.addEventListener(n,r,{passive:u}):e.addEventListener(n,r,!1)}function Uh(e,n,r,o,u){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)t:for(;;){if(o===null)return;var S=o.tag;if(S===3||S===4){var L=o.stateNode.containerInfo;if(L===u)break;if(S===4)for(S=o.return;S!==null;){var W=S.tag;if((W===3||W===4)&&S.stateNode.containerInfo===u)return;S=S.return}for(;L!==null;){if(S=Va(L),S===null)return;if(W=S.tag,W===5||W===6||W===26||W===27){o=h=S;continue t}L=L.parentNode}}o=o.return}nm(function(){var dt=h,Tt=Yu(r),Dt=[];t:{var mt=Dm.get(e);if(mt!==void 0){var yt=Ll,Qt=e;switch(e){case"keypress":if(Dl(r)===0)break t;case"keydown":case"keyup":yt=dy;break;case"focusin":Qt="focus",yt=$u;break;case"focusout":Qt="blur",yt=$u;break;case"beforeblur":case"afterblur":yt=$u;break;case"click":if(r.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":yt=sm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":yt=ey;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":yt=gy;break;case Am:case Rm:case wm:yt=ay;break;case Cm:yt=vy;break;case"scroll":case"scrollend":yt=$x;break;case"wheel":yt=yy;break;case"copy":case"cut":case"paste":yt=ry;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":yt=om;break;case"toggle":case"beforetoggle":yt=My}var le=(n&4)!==0,We=!le&&(e==="scroll"||e==="scrollend"),at=le?mt!==null?mt+"Capture":null:mt;le=[];for(var Z=dt,ft;Z!==null;){var Rt=Z;if(ft=Rt.stateNode,Rt=Rt.tag,Rt!==5&&Rt!==26&&Rt!==27||ft===null||at===null||(Rt=xo(Z,at),Rt!=null&&le.push(Jo(Z,Rt,ft))),We)break;Z=Z.return}0<le.length&&(mt=new yt(mt,Qt,null,r,Tt),Dt.push({event:mt,listeners:le}))}}if((n&7)===0){t:{if(mt=e==="mouseover"||e==="pointerover",yt=e==="mouseout"||e==="pointerout",mt&&r!==qu&&(Qt=r.relatedTarget||r.fromElement)&&(Va(Qt)||Qt[ua]))break t;if((yt||mt)&&(mt=Tt.window===Tt?Tt:(mt=Tt.ownerDocument)?mt.defaultView||mt.parentWindow:window,yt?(Qt=r.relatedTarget||r.toElement,yt=dt,Qt=Qt?Va(Qt):null,Qt!==null&&(We=c(Qt),le=Qt.tag,Qt!==We||le!==5&&le!==27&&le!==6)&&(Qt=null)):(yt=null,Qt=dt),yt!==Qt)){if(le=sm,Rt="onMouseLeave",at="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(le=om,Rt="onPointerLeave",at="onPointerEnter",Z="pointer"),We=yt==null?mt:ws(yt),ft=Qt==null?mt:ws(Qt),mt=new le(Rt,Z+"leave",yt,r,Tt),mt.target=We,mt.relatedTarget=ft,Rt=null,Va(Tt)===dt&&(le=new le(at,Z+"enter",Qt,r,Tt),le.target=ft,le.relatedTarget=We,Rt=le),We=Rt,yt&&Qt)e:{for(le=SS,at=yt,Z=Qt,ft=0,Rt=at;Rt;Rt=le(Rt))ft++;Rt=0;for(var re=Z;re;re=le(re))Rt++;for(;0<ft-Rt;)at=le(at),ft--;for(;0<Rt-ft;)Z=le(Z),Rt--;for(;ft--;){if(at===Z||Z!==null&&at===Z.alternate){le=at;break e}at=le(at),Z=le(Z)}le=null}else le=null;yt!==null&&J0(Dt,mt,yt,le,!1),Qt!==null&&We!==null&&J0(Dt,We,Qt,le,!0)}}t:{if(mt=dt?ws(dt):window,yt=mt.nodeName&&mt.nodeName.toLowerCase(),yt==="select"||yt==="input"&&mt.type==="file")var Ne=mm;else if(dm(mt))if(gm)Ne=Ly;else{Ne=Dy;var ie=Cy}else yt=mt.nodeName,!yt||yt.toLowerCase()!=="input"||mt.type!=="checkbox"&&mt.type!=="radio"?dt&&cr(dt.elementType)&&(Ne=mm):Ne=Uy;if(Ne&&(Ne=Ne(e,dt))){pm(Dt,Ne,r,Tt);break t}ie&&ie(e,mt,dt),e==="focusout"&&dt&&mt.type==="number"&&dt.memoizedProps.value!=null&&Ni(mt,"number",mt.value)}switch(ie=dt?ws(dt):window,e){case"focusin":(dm(ie)||ie.contentEditable==="true")&&(dr=ie,rf=dt,Ro=null);break;case"focusout":Ro=rf=dr=null;break;case"mousedown":of=!0;break;case"contextmenu":case"mouseup":case"dragend":of=!1,Em(Dt,r,Tt);break;case"selectionchange":if(Oy)break;case"keydown":case"keyup":Em(Dt,r,Tt)}var Se;if(ef)t:{switch(e){case"compositionstart":var we="onCompositionStart";break t;case"compositionend":we="onCompositionEnd";break t;case"compositionupdate":we="onCompositionUpdate";break t}we=void 0}else hr?fm(e,r)&&(we="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(we="onCompositionStart");we&&(lm&&r.locale!=="ko"&&(hr||we!=="onCompositionStart"?we==="onCompositionEnd"&&hr&&(Se=im()):(Xa=Tt,Ku="value"in Xa?Xa.value:Xa.textContent,hr=!0)),ie=Mc(dt,we),0<ie.length&&(we=new rm(we,e,null,r,Tt),Dt.push({event:we,listeners:ie}),Se?we.data=Se:(Se=hm(r),Se!==null&&(we.data=Se)))),(Se=Ey?Ty(e,r):Ay(e,r))&&(we=Mc(dt,"onBeforeInput"),0<we.length&&(ie=new rm("onBeforeInput","beforeinput",null,r,Tt),Dt.push({event:ie,listeners:we}),ie.data=Se)),_S(Dt,e,dt,r,Tt)}K0(Dt,n)})}function Jo(e,n,r){return{instance:e,listener:n,currentTarget:r}}function Mc(e,n){for(var r=n+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=xo(e,r),u!=null&&o.unshift(Jo(e,u,h)),u=xo(e,n),u!=null&&o.push(Jo(e,u,h))),e.tag===3)return o;e=e.return}return[]}function SS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function J0(e,n,r,o,u){for(var h=n._reactName,S=[];r!==null&&r!==o;){var L=r,W=L.alternate,dt=L.stateNode;if(L=L.tag,W!==null&&W===o)break;L!==5&&L!==26&&L!==27||dt===null||(W=dt,u?(dt=xo(r,h),dt!=null&&S.unshift(Jo(r,dt,W))):u||(dt=xo(r,h),dt!=null&&S.push(Jo(r,dt,W)))),r=r.return}S.length!==0&&e.push({event:n,listeners:S})}var MS=/\r\n?/g,bS=/\u0000|\uFFFD/g;function $0(e){return(typeof e=="string"?e:""+e).replace(MS,`
|
|
9
|
-
`).replace(bS,"")}function t_(e,n){return n=$0(n),$0(e)===n}function Xe(e,n,r,o,u,h){switch(r){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||qn(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&qn(e,""+o);break;case"className":me(e,"class",o);break;case"tabIndex":me(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":me(e,r,o);break;case"style":fa(e,o,h);break;case"data":if(n!=="object"){me(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=wl(""+o),e.setAttribute(r,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(r==="formAction"?(n!=="input"&&Xe(e,n,"name",u.name,u,null),Xe(e,n,"formEncType",u.formEncType,u,null),Xe(e,n,"formMethod",u.formMethod,u,null),Xe(e,n,"formTarget",u.formTarget,u,null)):(Xe(e,n,"encType",u.encType,u,null),Xe(e,n,"method",u.method,u,null),Xe(e,n,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=wl(""+o),e.setAttribute(r,o);break;case"onClick":o!=null&&(e.onclick=ha);break;case"onScroll":o!=null&&Ae("scroll",e);break;case"onScrollEnd":o!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(r=o.__html,r!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}r=wl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""+o):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":o===!0?e.setAttribute(r,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,o):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(r,o):e.removeAttribute(r);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(r):e.setAttribute(r,o);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),fe(e,"popover",o);break;case"xlinkActuate":Zt(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Zt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Zt(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Zt(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Zt(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Zt(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":fe(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=Qx.get(r)||r,fe(e,r,o))}}function Lh(e,n,r,o,u,h){switch(r){case"style":fa(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(r=o.__html,r!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"children":typeof o=="string"?qn(e,o):(typeof o=="number"||typeof o=="bigint")&&qn(e,""+o);break;case"onScroll":o!=null&&Ae("scroll",e);break;case"onScrollEnd":o!=null&&Ae("scrollend",e);break;case"onClick":o!=null&&(e.onclick=ha);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pt.hasOwnProperty(r))t:{if(r[0]==="o"&&r[1]==="n"&&(u=r.endsWith("Capture"),n=r.slice(2,u?r.length-7:void 0),h=e[vn]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(n,h,u),typeof o=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,o,u);break t}r in e?e[r]=o:o===!0?e.setAttribute(r,""):fe(e,r,o)}}}function Un(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var o=!1,u=!1,h;for(h in r)if(r.hasOwnProperty(h)){var S=r[h];if(S!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Xe(e,n,h,S,r,null)}}u&&Xe(e,n,"srcSet",r.srcSet,r,null),o&&Xe(e,n,"src",r.src,r,null);return;case"input":Ae("invalid",e);var L=h=S=u=null,W=null,dt=null;for(o in r)if(r.hasOwnProperty(o)){var Tt=r[o];if(Tt!=null)switch(o){case"name":u=Tt;break;case"type":S=Tt;break;case"checked":W=Tt;break;case"defaultChecked":dt=Tt;break;case"value":h=Tt;break;case"defaultValue":L=Tt;break;case"children":case"dangerouslySetInnerHTML":if(Tt!=null)throw Error(s(137,n));break;default:Xe(e,n,o,Tt,r,null)}}ri(e,h,L,W,dt,S,u,!1);return;case"select":Ae("invalid",e),o=S=h=null;for(u in r)if(r.hasOwnProperty(u)&&(L=r[u],L!=null))switch(u){case"value":h=L;break;case"defaultValue":S=L;break;case"multiple":o=L;default:Xe(e,n,u,L,r,null)}n=h,r=S,e.multiple=!!o,n!=null?oi(e,!!o,n,!1):r!=null&&oi(e,!!o,r,!0);return;case"textarea":Ae("invalid",e),h=u=o=null;for(S in r)if(r.hasOwnProperty(S)&&(L=r[S],L!=null))switch(S){case"value":o=L;break;case"defaultValue":u=L;break;case"children":h=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:Xe(e,n,S,L,r,null)}un(e,o,u,h);return;case"option":for(W in r)r.hasOwnProperty(W)&&(o=r[W],o!=null)&&(W==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Xe(e,n,W,o,r,null));return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(o=0;o<Qo.length;o++)Ae(Qo[o],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(dt in r)if(r.hasOwnProperty(dt)&&(o=r[dt],o!=null))switch(dt){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Xe(e,n,dt,o,r,null)}return;default:if(cr(n)){for(Tt in r)r.hasOwnProperty(Tt)&&(o=r[Tt],o!==void 0&&Lh(e,n,Tt,o,r,void 0));return}}for(L in r)r.hasOwnProperty(L)&&(o=r[L],o!=null&&Xe(e,n,L,o,r,null))}function ES(e,n,r,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,S=null,L=null,W=null,dt=null,Tt=null;for(yt in r){var Dt=r[yt];if(r.hasOwnProperty(yt)&&Dt!=null)switch(yt){case"checked":break;case"value":break;case"defaultValue":W=Dt;default:o.hasOwnProperty(yt)||Xe(e,n,yt,null,o,Dt)}}for(var mt in o){var yt=o[mt];if(Dt=r[mt],o.hasOwnProperty(mt)&&(yt!=null||Dt!=null))switch(mt){case"type":h=yt;break;case"name":u=yt;break;case"checked":dt=yt;break;case"defaultChecked":Tt=yt;break;case"value":S=yt;break;case"defaultValue":L=yt;break;case"children":case"dangerouslySetInnerHTML":if(yt!=null)throw Error(s(137,n));break;default:yt!==Dt&&Xe(e,n,mt,yt,o,Dt)}}Wn(e,S,L,W,dt,Tt,h,u);return;case"select":yt=S=L=mt=null;for(h in r)if(W=r[h],r.hasOwnProperty(h)&&W!=null)switch(h){case"value":break;case"multiple":yt=W;default:o.hasOwnProperty(h)||Xe(e,n,h,null,o,W)}for(u in o)if(h=o[u],W=r[u],o.hasOwnProperty(u)&&(h!=null||W!=null))switch(u){case"value":mt=h;break;case"defaultValue":L=h;break;case"multiple":S=h;default:h!==W&&Xe(e,n,u,h,o,W)}n=L,r=S,o=yt,mt!=null?oi(e,!!r,mt,!1):!!o!=!!r&&(n!=null?oi(e,!!r,n,!0):oi(e,!!r,r?[]:"",!1));return;case"textarea":yt=mt=null;for(L in r)if(u=r[L],r.hasOwnProperty(L)&&u!=null&&!o.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Xe(e,n,L,null,o,u)}for(S in o)if(u=o[S],h=r[S],o.hasOwnProperty(S)&&(u!=null||h!=null))switch(S){case"value":mt=u;break;case"defaultValue":yt=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==h&&Xe(e,n,S,u,o,h)}Fe(e,mt,yt);return;case"option":for(var Qt in r)mt=r[Qt],r.hasOwnProperty(Qt)&&mt!=null&&!o.hasOwnProperty(Qt)&&(Qt==="selected"?e.selected=!1:Xe(e,n,Qt,null,o,mt));for(W in o)mt=o[W],yt=r[W],o.hasOwnProperty(W)&&mt!==yt&&(mt!=null||yt!=null)&&(W==="selected"?e.selected=mt&&typeof mt!="function"&&typeof mt!="symbol":Xe(e,n,W,mt,o,yt));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var le in r)mt=r[le],r.hasOwnProperty(le)&&mt!=null&&!o.hasOwnProperty(le)&&Xe(e,n,le,null,o,mt);for(dt in o)if(mt=o[dt],yt=r[dt],o.hasOwnProperty(dt)&&mt!==yt&&(mt!=null||yt!=null))switch(dt){case"children":case"dangerouslySetInnerHTML":if(mt!=null)throw Error(s(137,n));break;default:Xe(e,n,dt,mt,o,yt)}return;default:if(cr(n)){for(var We in r)mt=r[We],r.hasOwnProperty(We)&&mt!==void 0&&!o.hasOwnProperty(We)&&Lh(e,n,We,void 0,o,mt);for(Tt in o)mt=o[Tt],yt=r[Tt],!o.hasOwnProperty(Tt)||mt===yt||mt===void 0&&yt===void 0||Lh(e,n,Tt,mt,o,yt);return}}for(var at in r)mt=r[at],r.hasOwnProperty(at)&&mt!=null&&!o.hasOwnProperty(at)&&Xe(e,n,at,null,o,mt);for(Dt in o)mt=o[Dt],yt=r[Dt],!o.hasOwnProperty(Dt)||mt===yt||mt==null&&yt==null||Xe(e,n,Dt,mt,o,yt)}function e_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),o=0;o<r.length;o++){var u=r[o],h=u.transferSize,S=u.initiatorType,L=u.duration;if(h&&L&&e_(S)){for(S=0,L=u.responseEnd,o+=1;o<r.length;o++){var W=r[o],dt=W.startTime;if(dt>L)break;var Tt=W.transferSize,Dt=W.initiatorType;Tt&&e_(Dt)&&(W=W.responseEnd,S+=Tt*(W<L?1:(L-dt)/(W-dt)))}if(--o,n+=8*(h+S)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Nh=null,Oh=null;function bc(e){return e.nodeType===9?e:e.ownerDocument}function n_(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function i_(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Ph(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var zh=null;function AS(){var e=window.event;return e&&e.type==="popstate"?e===zh?!1:(zh=e,!0):(zh=null,!1)}var a_=typeof setTimeout=="function"?setTimeout:void 0,RS=typeof clearTimeout=="function"?clearTimeout:void 0,s_=typeof Promise=="function"?Promise:void 0,wS=typeof queueMicrotask=="function"?queueMicrotask:typeof s_<"u"?function(e){return s_.resolve(null).then(e).catch(CS)}:a_;function CS(e){setTimeout(function(){throw e})}function os(e){return e==="head"}function r_(e,n){var r=n,o=0;do{var u=r.nextSibling;if(e.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"||r==="/&"){if(o===0){e.removeChild(u),Hr(n);return}o--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")o++;else if(r==="html")$o(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,$o(r);for(var h=r.firstChild;h;){var S=h.nextSibling,L=h.nodeName;h[Rs]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=S}}else r==="body"&&$o(e.ownerDocument.body);r=u}while(r);Hr(n)}function o_(e,n){var r=e;e=0;do{var o=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=o}while(r)}function Fh(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Fh(r),vo(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function DS(e,n,r,o){for(;e.nodeType===1;){var u=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Rs])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Ai(e.nextSibling),e===null)break}return null}function US(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Ai(e.nextSibling),e===null))return null;return e}function l_(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ai(e.nextSibling),e===null))return null;return e}function Ih(e){return e.data==="$?"||e.data==="$~"}function Bh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function LS(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var o=function(){n(),r.removeEventListener("DOMContentLoaded",o)};r.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Ai(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Hh=null;function c_(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return Ai(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function u_(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function f_(e,n,r){switch(n=bc(r),e){case"html":if(e=n.documentElement,!e)throw Error(s(452));return e;case"head":if(e=n.head,!e)throw Error(s(453));return e;case"body":if(e=n.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function $o(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);vo(e)}var Ri=new Map,h_=new Set;function Ec(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wa=A.d;A.d={f:NS,r:OS,D:PS,C:zS,L:FS,m:IS,X:HS,S:BS,M:GS};function NS(){var e=wa.f(),n=mc();return e||n}function OS(e){var n=ka(e);n!==null&&n.tag===5&&n.type==="form"?Cg(n):wa.r(e)}var Fr=typeof document>"u"?null:document;function d_(e,n,r){var o=Fr;if(o&&typeof n=="string"&&n){var u=pe(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof r=="string"&&(u+='[crossorigin="'+r+'"]'),h_.has(u)||(h_.add(u),e={rel:e,crossOrigin:r,href:n},o.querySelector(u)===null&&(n=o.createElement("link"),Un(n,"link",e),J(n),o.head.appendChild(n)))}}function PS(e){wa.D(e),d_("dns-prefetch",e,null)}function zS(e,n){wa.C(e,n),d_("preconnect",e,n)}function FS(e,n,r){wa.L(e,n,r);var o=Fr;if(o&&e&&n){var u='link[rel="preload"][as="'+pe(n)+'"]';n==="image"&&r&&r.imageSrcSet?(u+='[imagesrcset="'+pe(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(u+='[imagesizes="'+pe(r.imageSizes)+'"]')):u+='[href="'+pe(e)+'"]';var h=u;switch(n){case"style":h=Ir(e);break;case"script":h=Br(e)}Ri.has(h)||(e=_({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Ri.set(h,e),o.querySelector(u)!==null||n==="style"&&o.querySelector(tl(h))||n==="script"&&o.querySelector(el(h))||(n=o.createElement("link"),Un(n,"link",e),J(n),o.head.appendChild(n)))}}function IS(e,n){wa.m(e,n);var r=Fr;if(r&&e){var o=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+pe(o)+'"][href="'+pe(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Br(e)}if(!Ri.has(h)&&(e=_({rel:"modulepreload",href:e},n),Ri.set(h,e),r.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(el(h)))return}o=r.createElement("link"),Un(o,"link",e),J(o),r.head.appendChild(o)}}}function BS(e,n,r){wa.S(e,n,r);var o=Fr;if(o&&e){var u=N(o).hoistableStyles,h=Ir(e);n=n||"default";var S=u.get(h);if(!S){var L={loading:0,preload:null};if(S=o.querySelector(tl(h)))L.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Ri.get(h))&&Gh(e,r);var W=S=o.createElement("link");J(W),Un(W,"link",e),W._p=new Promise(function(dt,Tt){W.onload=dt,W.onerror=Tt}),W.addEventListener("load",function(){L.loading|=1}),W.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Tc(S,n,o)}S={type:"stylesheet",instance:S,count:1,state:L},u.set(h,S)}}}function HS(e,n){wa.X(e,n);var r=Fr;if(r&&e){var o=N(r).hoistableScripts,u=Br(e),h=o.get(u);h||(h=r.querySelector(el(u)),h||(e=_({src:e,async:!0},n),(n=Ri.get(u))&&Vh(e,n),h=r.createElement("script"),J(h),Un(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function GS(e,n){wa.M(e,n);var r=Fr;if(r&&e){var o=N(r).hoistableScripts,u=Br(e),h=o.get(u);h||(h=r.querySelector(el(u)),h||(e=_({src:e,async:!0,type:"module"},n),(n=Ri.get(u))&&Vh(e,n),h=r.createElement("script"),J(h),Un(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function p_(e,n,r,o){var u=(u=st.current)?Ec(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Ir(r.href),r=N(u).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Ir(r.href);var h=N(u).hoistableStyles,S=h.get(e);if(S||(u=u.ownerDocument||u,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,S),(h=u.querySelector(tl(e)))&&!h._p&&(S.instance=h,S.state.loading=5),Ri.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Ri.set(e,r),h||VS(u,e,r,S.state))),n&&o===null)throw Error(s(528,""));return S}if(n&&o!==null)throw Error(s(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Br(r),r=N(u).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Ir(e){return'href="'+pe(e)+'"'}function tl(e){return'link[rel="stylesheet"]['+e+"]"}function m_(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function VS(e,n,r,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Un(n,"link",r),J(n),e.head.appendChild(n))}function Br(e){return'[src="'+pe(e)+'"]'}function el(e){return"script[async]"+e}function g_(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+pe(r.href)+'"]');if(o)return n.instance=o,J(o),o;var u=_({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),J(o),Un(o,"style",u),Tc(o,r.precedence,e),n.instance=o;case"stylesheet":u=Ir(r.href);var h=e.querySelector(tl(u));if(h)return n.state.loading|=4,n.instance=h,J(h),h;o=m_(r),(u=Ri.get(u))&&Gh(o,u),h=(e.ownerDocument||e).createElement("link"),J(h);var S=h;return S._p=new Promise(function(L,W){S.onload=L,S.onerror=W}),Un(h,"link",o),n.state.loading|=4,Tc(h,r.precedence,e),n.instance=h;case"script":return h=Br(r.src),(u=e.querySelector(el(h)))?(n.instance=u,J(u),u):(o=r,(u=Ri.get(h))&&(o=_({},r),Vh(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),J(u),Un(u,"link",o),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Tc(o,r.precedence,e));return n.instance}function Tc(e,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,S=0;S<o.length;S++){var L=o[S];if(L.dataset.precedence===n)h=L;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function Gh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Vh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Ac=null;function __(e,n,r){if(Ac===null){var o=new Map,u=Ac=new Map;u.set(r,o)}else u=Ac,o=u.get(r),o||(o=new Map,u.set(r,o));if(o.has(e))return o;for(o.set(e,null),r=r.getElementsByTagName(e),u=0;u<r.length;u++){var h=r[u];if(!(h[Rs]||h[cn]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var S=h.getAttribute(n)||"";S=e+S;var L=o.get(S);L?L.push(h):o.set(S,[h])}}return o}function v_(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function kS(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function x_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function XS(e,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var u=Ir(o.href),h=n.querySelector(tl(u));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Rc.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,J(h);return}h=n.ownerDocument||n,o=m_(o),(u=Ri.get(u))&&Gh(o,u),h=h.createElement("link"),J(h);var S=h;S._p=new Promise(function(L,W){S.onload=L,S.onerror=W}),Un(h,"link",o),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Rc.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var kh=0;function WS(e,n){return e.stylesheets&&e.count===0&&Cc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var o=setTimeout(function(){if(e.stylesheets&&Cc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&kh===0&&(kh=62500*TS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Cc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>kh?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var wc=null;function Cc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wc=new Map,n.forEach(qS,e),wc=null,Rc.call(e))}function qS(e,n){if(!(n.state.loading&4)){var r=wc.get(e);if(r)var o=r.get(null);else{r=new Map,wc.set(e,r);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var S=u[h];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(r.set(S.dataset.precedence,S),o=S)}o&&r.set(null,o)}u=n.instance,S=u.getAttribute("data-precedence"),h=r.get(S)||o,h===o&&r.set(null,u),r.set(S,u),this.count++,o=Rc.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var nl={$$typeof:D,Provider:null,Consumer:null,_currentValue:ht,_currentValue2:ht,_threadCount:0};function YS(e,n,r,o,u,h,S,L,W){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=De(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=De(0),this.hiddenUpdates=De(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function y_(e,n,r,o,u,h,S,L,W,dt,Tt,Dt){return e=new YS(e,n,r,S,W,dt,Tt,Dt,L),n=1,h===!0&&(n|=24),h=ci(3,null,null,n),e.current=h,h.stateNode=e,n=Mf(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:r,cache:n},Af(h),e}function S_(e){return e?(e=gr,e):gr}function M_(e,n,r,o,u,h){u=S_(u),o.context===null?o.context=u:o.pendingContext=u,o=Ka(n),o.payload={element:r},h=h===void 0?null:h,h!==null&&(o.callback=h),r=Qa(e,o,n),r!==null&&(ni(r,e,n),Oo(r,e,n))}function b_(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Xh(e,n){b_(e,n),(e=e.alternate)&&b_(e,n)}function E_(e){if(e.tag===13||e.tag===31){var n=Ls(e,67108864);n!==null&&ni(n,e,67108864),Xh(e,67108864)}}function T_(e){if(e.tag===13||e.tag===31){var n=pi();n=rr(n);var r=Ls(e,n);r!==null&&ni(r,e,n),Xh(e,n)}}var Dc=!0;function jS(e,n,r,o){var u=z.T;z.T=null;var h=A.p;try{A.p=2,Wh(e,n,r,o)}finally{A.p=h,z.T=u}}function ZS(e,n,r,o){var u=z.T;z.T=null;var h=A.p;try{A.p=8,Wh(e,n,r,o)}finally{A.p=h,z.T=u}}function Wh(e,n,r,o){if(Dc){var u=qh(o);if(u===null)Uh(e,n,o,Uc,r),R_(e,o);else if(QS(u,e,n,r,o))o.stopPropagation();else if(R_(e,o),n&4&&-1<KS.indexOf(e)){for(;u!==null;){var h=ka(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var S=Ot(h.pendingLanes);if(S!==0){var L=h;for(L.pendingLanes|=2,L.entangledLanes|=2;S;){var W=1<<31-Lt(S);L.entanglements[1]|=W,S&=~W}Qi(h),(ze&6)===0&&(dc=b()+500,Ko(0))}}break;case 31:case 13:L=Ls(h,2),L!==null&&ni(L,h,2),mc(),Xh(h,2)}if(h=qh(o),h===null&&Uh(e,n,o,Uc,r),h===u)break;u=h}u!==null&&o.stopPropagation()}else Uh(e,n,o,null,r)}}function qh(e){return e=Yu(e),Yh(e)}var Uc=null;function Yh(e){if(Uc=null,e=Va(e),e!==null){var n=c(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=f(n),e!==null)return e;e=null}else if(r===31){if(e=d(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Uc=e,null}function A_(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(V()){case $:return 2;case k:return 8;case P:case it:return 32;case rt:return 268435456;default:return 32}default:return 32}}var jh=!1,ls=null,cs=null,us=null,il=new Map,al=new Map,fs=[],KS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function R_(e,n){switch(e){case"focusin":case"focusout":ls=null;break;case"dragenter":case"dragleave":cs=null;break;case"mouseover":case"mouseout":us=null;break;case"pointerover":case"pointerout":il.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(n.pointerId)}}function sl(e,n,r,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:r,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},n!==null&&(n=ka(n),n!==null&&E_(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function QS(e,n,r,o,u){switch(n){case"focusin":return ls=sl(ls,e,n,r,o,u),!0;case"dragenter":return cs=sl(cs,e,n,r,o,u),!0;case"mouseover":return us=sl(us,e,n,r,o,u),!0;case"pointerover":var h=u.pointerId;return il.set(h,sl(il.get(h)||null,e,n,r,o,u)),!0;case"gotpointercapture":return h=u.pointerId,al.set(h,sl(al.get(h)||null,e,n,r,o,u)),!0}return!1}function w_(e){var n=Va(e.target);if(n!==null){var r=c(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,lr(e.priority,function(){T_(r)});return}}else if(n===31){if(n=d(r),n!==null){e.blockedOn=n,lr(e.priority,function(){T_(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=qh(e.nativeEvent);if(r===null){r=e.nativeEvent;var o=new r.constructor(r.type,r);qu=o,r.target.dispatchEvent(o),qu=null}else return n=ka(r),n!==null&&E_(n),e.blockedOn=r,!1;n.shift()}return!0}function C_(e,n,r){Lc(e)&&r.delete(n)}function JS(){jh=!1,ls!==null&&Lc(ls)&&(ls=null),cs!==null&&Lc(cs)&&(cs=null),us!==null&&Lc(us)&&(us=null),il.forEach(C_),al.forEach(C_)}function Nc(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,JS)))}var Oc=null;function D_(e){Oc!==e&&(Oc=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Oc===e&&(Oc=null);for(var n=0;n<e.length;n+=3){var r=e[n],o=e[n+1],u=e[n+2];if(typeof o!="function"){if(Yh(o||r)===null)continue;break}var h=ka(r);h!==null&&(e.splice(n,3),n-=3,qf(h,{pending:!0,data:u,method:r.method,action:o},o,u))}}))}function Hr(e){function n(W){return Nc(W,e)}ls!==null&&Nc(ls,e),cs!==null&&Nc(cs,e),us!==null&&Nc(us,e),il.forEach(n),al.forEach(n);for(var r=0;r<fs.length;r++){var o=fs[r];o.blockedOn===e&&(o.blockedOn=null)}for(;0<fs.length&&(r=fs[0],r.blockedOn===null);)w_(r),r.blockedOn===null&&fs.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(o=0;o<r.length;o+=3){var u=r[o],h=r[o+1],S=u[vn]||null;if(typeof h=="function")S||D_(r);else if(S){var L=null;if(h&&h.hasAttribute("formAction")){if(u=h,S=h[vn]||null)L=S.formAction;else if(Yh(u)!==null)continue}else L=S.action;typeof L=="function"?r[o+1]=L:(r.splice(o,3),o-=3),D_(r)}}}function U_(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(S){return u=S})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),o||setTimeout(r,20)}function r(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Zh(e){this._internalRoot=e}Pc.prototype.render=Zh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));var r=n.current,o=pi();M_(r,o,e,n,null,null)},Pc.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;M_(e.current,2,null,e,null,null),mc(),n[ua]=null}};function Pc(e){this._internalRoot=e}Pc.prototype.unstable_scheduleHydration=function(e){if(e){var n=Yi();e={blockedOn:null,target:e,priority:n};for(var r=0;r<fs.length&&n!==0&&n<fs[r].priority;r++);fs.splice(r,0,e),r===0&&w_(e)}};var L_=t.version;if(L_!=="19.2.4")throw Error(s(527,L_,"19.2.4"));A.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=p(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var $S={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{xt=zc.inject($S),St=zc}catch{}}return ol.createRoot=function(e,n){if(!l(e))throw Error(s(299));var r=!1,o="",u=Bg,h=Hg,S=Gg;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError)),n=y_(e,1,!1,null,null,r,o,null,u,h,S,U_),e[ua]=n.current,Dh(e),new Zh(n)},ol.hydrateRoot=function(e,n,r){if(!l(e))throw Error(s(299));var o=!1,u="",h=Bg,S=Hg,L=Gg,W=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(L=r.onRecoverableError),r.formState!==void 0&&(W=r.formState)),n=y_(e,1,!0,n,r??null,o,u,W,h,S,L,U_),n.context=S_(null),r=n.current,o=pi(),o=rr(o),u=Ka(o),u.callback=null,Qa(r,u,o),r=o,n.current.lanes=r,kn(n,r),Qi(n),e[ua]=n.current,Dh(e),new Pc(n)},ol.version="19.2.4",ol}var V_;function cM(){if(V_)return Jh.exports;V_=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(t){console.error(t)}}return a(),Jh.exports=lM(),Jh.exports}var uM=cM();const Fp="183",ao={ROTATE:0,DOLLY:1,PAN:2},io={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},fM=0,k_=1,hM=2,Mu=1,dM=2,gl=3,Es=0,si=1,ki=2,Pa=0,so=1,X_=2,W_=3,q_=4,pM=5,Qs=100,mM=101,gM=102,_M=103,vM=104,xM=200,yM=201,SM=202,MM=203,Gd=204,Vd=205,bM=206,EM=207,TM=208,AM=209,RM=210,wM=211,CM=212,DM=213,UM=214,kd=0,Xd=1,Wd=2,lo=3,qd=4,Yd=5,jd=6,Zd=7,Ip=0,LM=1,NM=2,ra=0,ux=1,fx=2,hx=3,dx=4,px=5,mx=6,gx=7,_x=300,nr=301,co=302,nd=303,id=304,Hu=306,Kd=1e3,Oa=1001,Qd=1002,Pn=1003,OM=1004,Fc=1005,Vn=1006,ad=1007,$s=1008,vi=1009,vx=1010,xx=1011,xl=1012,Bp=1013,la=1014,ia=1015,Ia=1016,Hp=1017,Gp=1018,yl=1020,yx=35902,Sx=35899,Mx=1021,bx=1022,Wi=1023,Ba=1026,tr=1027,Ex=1028,Vp=1029,uo=1030,kp=1031,Xp=1033,bu=33776,Eu=33777,Tu=33778,Au=33779,Jd=35840,$d=35841,tp=35842,ep=35843,np=36196,ip=37492,ap=37496,sp=37488,rp=37489,op=37490,lp=37491,cp=37808,up=37809,fp=37810,hp=37811,dp=37812,pp=37813,mp=37814,gp=37815,_p=37816,vp=37817,xp=37818,yp=37819,Sp=37820,Mp=37821,bp=36492,Ep=36494,Tp=36495,Ap=36283,Rp=36284,wp=36285,Cp=36286,PM=3200,Tx=0,zM=1,ys="",Ci="srgb",fo="srgb-linear",Uu="linear",Ge="srgb",Gr=7680,Y_=519,FM=512,IM=513,BM=514,Wp=515,HM=516,GM=517,qp=518,VM=519,Dp=35044,j_="300 es",aa=2e3,Sl=2001;function kM(a){for(let t=a.length-1;t>=0;--t)if(a[t]>=65535)return!0;return!1}function Lu(a){return document.createElementNS("http://www.w3.org/1999/xhtml",a)}function XM(){const a=Lu("canvas");return a.style.display="block",a}const Z_={};function Nu(...a){const t="THREE."+a.shift();console.log(t,...a)}function Ax(a){const t=a[0];if(typeof t=="string"&&t.startsWith("TSL:")){const i=a[1];i&&i.isStackTrace?a[0]+=" "+i.getLocation():a[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return a}function ue(...a){a=Ax(a);const t="THREE."+a.shift();{const i=a[0];i&&i.isStackTrace?console.warn(i.getError(t)):console.warn(t,...a)}}function Pe(...a){a=Ax(a);const t="THREE."+a.shift();{const i=a[0];i&&i.isStackTrace?console.error(i.getError(t)):console.error(t,...a)}}function Ou(...a){const t=a.join(" ");t in Z_||(Z_[t]=!0,ue(...a))}function WM(a,t,i){return new Promise(function(s,l){function c(){switch(a.clientWaitSync(t,a.SYNC_FLUSH_COMMANDS_BIT,0)){case a.WAIT_FAILED:l();break;case a.TIMEOUT_EXPIRED:setTimeout(c,i);break;default:s()}}setTimeout(c,i)})}const qM={[kd]:Xd,[Wd]:jd,[qd]:Zd,[lo]:Yd,[Xd]:kd,[jd]:Wd,[Zd]:qd,[Yd]:lo};class ar{addEventListener(t,i){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(i)===-1&&s[t].push(i)}hasEventListener(t,i){const s=this._listeners;return s===void 0?!1:s[t]!==void 0&&s[t].indexOf(i)!==-1}removeEventListener(t,i){const s=this._listeners;if(s===void 0)return;const l=s[t];if(l!==void 0){const c=l.indexOf(i);c!==-1&&l.splice(c,1)}}dispatchEvent(t){const i=this._listeners;if(i===void 0)return;const s=i[t.type];if(s!==void 0){t.target=this;const l=s.slice(0);for(let c=0,f=l.length;c<f;c++)l[c].call(this,t);t.target=null}}}const In=["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 K_=1234567;const ro=Math.PI/180,Ml=180/Math.PI;function za(){const a=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(In[a&255]+In[a>>8&255]+In[a>>16&255]+In[a>>24&255]+"-"+In[t&255]+In[t>>8&255]+"-"+In[t>>16&15|64]+In[t>>24&255]+"-"+In[i&63|128]+In[i>>8&255]+"-"+In[i>>16&255]+In[i>>24&255]+In[s&255]+In[s>>8&255]+In[s>>16&255]+In[s>>24&255]).toLowerCase()}function ve(a,t,i){return Math.max(t,Math.min(i,a))}function Yp(a,t){return(a%t+t)%t}function YM(a,t,i,s,l){return s+(a-t)*(l-s)/(i-t)}function jM(a,t,i){return a!==t?(i-a)/(t-a):0}function vl(a,t,i){return(1-i)*a+i*t}function ZM(a,t,i,s){return vl(a,t,1-Math.exp(-i*s))}function KM(a,t=1){return t-Math.abs(Yp(a,t*2)-t)}function QM(a,t,i){return a<=t?0:a>=i?1:(a=(a-t)/(i-t),a*a*(3-2*a))}function JM(a,t,i){return a<=t?0:a>=i?1:(a=(a-t)/(i-t),a*a*a*(a*(a*6-15)+10))}function $M(a,t){return a+Math.floor(Math.random()*(t-a+1))}function tb(a,t){return a+Math.random()*(t-a)}function eb(a){return a*(.5-Math.random())}function nb(a){a!==void 0&&(K_=a);let t=K_+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function ib(a){return a*ro}function ab(a){return a*Ml}function sb(a){return(a&a-1)===0&&a!==0}function rb(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))}function ob(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}function lb(a,t,i,s,l){const c=Math.cos,f=Math.sin,d=c(i/2),m=f(i/2),p=c((t+s)/2),v=f((t+s)/2),_=c((t-s)/2),g=f((t-s)/2),M=c((s-t)/2),E=f((s-t)/2);switch(l){case"XYX":a.set(d*v,m*_,m*g,d*p);break;case"YZY":a.set(m*g,d*v,m*_,d*p);break;case"ZXZ":a.set(m*_,m*g,d*v,d*p);break;case"XZX":a.set(d*v,m*E,m*M,d*p);break;case"YXY":a.set(m*M,d*v,m*E,d*p);break;case"ZYZ":a.set(m*E,m*M,d*v,d*p);break;default:ue("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+l)}}function Xi(a,t){switch(t.constructor){case Float32Array:return a;case Uint32Array:return a/4294967295;case Uint16Array:return a/65535;case Uint8Array:return a/255;case Int32Array:return Math.max(a/2147483647,-1);case Int16Array:return Math.max(a/32767,-1);case Int8Array:return Math.max(a/127,-1);default:throw new Error("Invalid component type.")}}function Ve(a,t){switch(t.constructor){case Float32Array:return a;case Uint32Array:return Math.round(a*4294967295);case Uint16Array:return Math.round(a*65535);case Uint8Array:return Math.round(a*255);case Int32Array:return Math.round(a*2147483647);case Int16Array:return Math.round(a*32767);case Int8Array:return Math.round(a*127);default:throw new Error("Invalid component type.")}}const Rx={DEG2RAD:ro,RAD2DEG:Ml,generateUUID:za,clamp:ve,euclideanModulo:Yp,mapLinear:YM,inverseLerp:jM,lerp:vl,damp:ZM,pingpong:KM,smoothstep:QM,smootherstep:JM,randInt:$M,randFloat:tb,randFloatSpread:eb,seededRandom:nb,degToRad:ib,radToDeg:ab,isPowerOfTwo:sb,ceilPowerOfTwo:rb,floorPowerOfTwo:ob,setQuaternionFromProperEuler:lb,normalize:Ve,denormalize:Xi};class _e{constructor(t=0,i=0){_e.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const i=this.x,s=this.y,l=t.elements;return this.x=l[0]*i+l[3]*s+l[6],this.y=l[1]*i+l[4]*s+l[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=ve(this.x,t.x,i.x),this.y=ve(this.y,t.y,i.y),this}clampScalar(t,i){return this.x=ve(this.x,t,i),this.y=ve(this.y,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ve(s,t,i))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(t)/i;return Math.acos(ve(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,s=this.y-t.y;return i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){const s=Math.cos(i),l=Math.sin(i),c=this.x-t.x,f=this.y-t.y;return this.x=c*s-f*l+t.x,this.y=c*l+f*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ts{constructor(t=0,i=0,s=0,l=1){this.isQuaternion=!0,this._x=t,this._y=i,this._z=s,this._w=l}static slerpFlat(t,i,s,l,c,f,d){let m=s[l+0],p=s[l+1],v=s[l+2],_=s[l+3],g=c[f+0],M=c[f+1],E=c[f+2],R=c[f+3];if(_!==R||m!==g||p!==M||v!==E){let x=m*g+p*M+v*E+_*R;x<0&&(g=-g,M=-M,E=-E,R=-R,x=-x);let y=1-d;if(x<.9995){const w=Math.acos(x),D=Math.sin(w);y=Math.sin(y*w)/D,d=Math.sin(d*w)/D,m=m*y+g*d,p=p*y+M*d,v=v*y+E*d,_=_*y+R*d}else{m=m*y+g*d,p=p*y+M*d,v=v*y+E*d,_=_*y+R*d;const w=1/Math.sqrt(m*m+p*p+v*v+_*_);m*=w,p*=w,v*=w,_*=w}}t[i]=m,t[i+1]=p,t[i+2]=v,t[i+3]=_}static multiplyQuaternionsFlat(t,i,s,l,c,f){const d=s[l],m=s[l+1],p=s[l+2],v=s[l+3],_=c[f],g=c[f+1],M=c[f+2],E=c[f+3];return t[i]=d*E+v*_+m*M-p*g,t[i+1]=m*E+v*g+p*_-d*M,t[i+2]=p*E+v*M+d*g-m*_,t[i+3]=v*E-d*_-m*g-p*M,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,i,s,l){return this._x=t,this._y=i,this._z=s,this._w=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,i=!0){const s=t._x,l=t._y,c=t._z,f=t._order,d=Math.cos,m=Math.sin,p=d(s/2),v=d(l/2),_=d(c/2),g=m(s/2),M=m(l/2),E=m(c/2);switch(f){case"XYZ":this._x=g*v*_+p*M*E,this._y=p*M*_-g*v*E,this._z=p*v*E+g*M*_,this._w=p*v*_-g*M*E;break;case"YXZ":this._x=g*v*_+p*M*E,this._y=p*M*_-g*v*E,this._z=p*v*E-g*M*_,this._w=p*v*_+g*M*E;break;case"ZXY":this._x=g*v*_-p*M*E,this._y=p*M*_+g*v*E,this._z=p*v*E+g*M*_,this._w=p*v*_-g*M*E;break;case"ZYX":this._x=g*v*_-p*M*E,this._y=p*M*_+g*v*E,this._z=p*v*E-g*M*_,this._w=p*v*_+g*M*E;break;case"YZX":this._x=g*v*_+p*M*E,this._y=p*M*_+g*v*E,this._z=p*v*E-g*M*_,this._w=p*v*_-g*M*E;break;case"XZY":this._x=g*v*_-p*M*E,this._y=p*M*_-g*v*E,this._z=p*v*E+g*M*_,this._w=p*v*_+g*M*E;break;default:ue("Quaternion: .setFromEuler() encountered an unknown order: "+f)}return i===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,i){const s=i/2,l=Math.sin(s);return this._x=t.x*l,this._y=t.y*l,this._z=t.z*l,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const i=t.elements,s=i[0],l=i[4],c=i[8],f=i[1],d=i[5],m=i[9],p=i[2],v=i[6],_=i[10],g=s+d+_;if(g>0){const M=.5/Math.sqrt(g+1);this._w=.25/M,this._x=(v-m)*M,this._y=(c-p)*M,this._z=(f-l)*M}else if(s>d&&s>_){const M=2*Math.sqrt(1+s-d-_);this._w=(v-m)/M,this._x=.25*M,this._y=(l+f)/M,this._z=(c+p)/M}else if(d>_){const M=2*Math.sqrt(1+d-s-_);this._w=(c-p)/M,this._x=(l+f)/M,this._y=.25*M,this._z=(m+v)/M}else{const M=2*Math.sqrt(1+_-s-d);this._w=(f-l)/M,this._x=(c+p)/M,this._y=(m+v)/M,this._z=.25*M}return this._onChangeCallback(),this}setFromUnitVectors(t,i){let s=t.dot(i)+1;return s<1e-8?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*i.z-t.z*i.y,this._y=t.z*i.x-t.x*i.z,this._z=t.x*i.y-t.y*i.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ve(this.dot(t),-1,1)))}rotateTowards(t,i){const s=this.angleTo(t);if(s===0)return this;const l=Math.min(1,i/s);return this.slerp(t,l),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,i){const s=t._x,l=t._y,c=t._z,f=t._w,d=i._x,m=i._y,p=i._z,v=i._w;return this._x=s*v+f*d+l*p-c*m,this._y=l*v+f*m+c*d-s*p,this._z=c*v+f*p+s*m-l*d,this._w=f*v-s*d-l*m-c*p,this._onChangeCallback(),this}slerp(t,i){let s=t._x,l=t._y,c=t._z,f=t._w,d=this.dot(t);d<0&&(s=-s,l=-l,c=-c,f=-f,d=-d);let m=1-i;if(d<.9995){const p=Math.acos(d),v=Math.sin(p);m=Math.sin(m*p)/v,i=Math.sin(i*p)/v,this._x=this._x*m+s*i,this._y=this._y*m+l*i,this._z=this._z*m+c*i,this._w=this._w*m+f*i,this._onChangeCallback()}else this._x=this._x*m+s*i,this._y=this._y*m+l*i,this._z=this._z*m+c*i,this._w=this._w*m+f*i,this.normalize();return this}slerpQuaternions(t,i,s){return this.copy(t).slerp(i,s)}random(){const t=2*Math.PI*Math.random(),i=2*Math.PI*Math.random(),s=Math.random(),l=Math.sqrt(1-s),c=Math.sqrt(s);return this.set(l*Math.sin(t),l*Math.cos(t),c*Math.sin(i),c*Math.cos(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,i=0){return this._x=t[i],this._y=t[i+1],this._z=t[i+2],this._w=t[i+3],this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._w,t}fromBufferAttribute(t,i){return this._x=t.getX(i),this._y=t.getY(i),this._z=t.getZ(i),this._w=t.getW(i),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Q{constructor(t=0,i=0,s=0){Q.prototype.isVector3=!0,this.x=t,this.y=i,this.z=s}set(t,i,s){return s===void 0&&(s=this.z),this.x=t,this.y=i,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(Q_.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(Q_.setFromAxisAngle(t,i))}applyMatrix3(t){const i=this.x,s=this.y,l=this.z,c=t.elements;return this.x=c[0]*i+c[3]*s+c[6]*l,this.y=c[1]*i+c[4]*s+c[7]*l,this.z=c[2]*i+c[5]*s+c[8]*l,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const i=this.x,s=this.y,l=this.z,c=t.elements,f=1/(c[3]*i+c[7]*s+c[11]*l+c[15]);return this.x=(c[0]*i+c[4]*s+c[8]*l+c[12])*f,this.y=(c[1]*i+c[5]*s+c[9]*l+c[13])*f,this.z=(c[2]*i+c[6]*s+c[10]*l+c[14])*f,this}applyQuaternion(t){const i=this.x,s=this.y,l=this.z,c=t.x,f=t.y,d=t.z,m=t.w,p=2*(f*l-d*s),v=2*(d*i-c*l),_=2*(c*s-f*i);return this.x=i+m*p+f*_-d*v,this.y=s+m*v+d*p-c*_,this.z=l+m*_+c*v-f*p,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const i=this.x,s=this.y,l=this.z,c=t.elements;return this.x=c[0]*i+c[4]*s+c[8]*l,this.y=c[1]*i+c[5]*s+c[9]*l,this.z=c[2]*i+c[6]*s+c[10]*l,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=ve(this.x,t.x,i.x),this.y=ve(this.y,t.y,i.y),this.z=ve(this.z,t.z,i.z),this}clampScalar(t,i){return this.x=ve(this.x,t,i),this.y=ve(this.y,t,i),this.z=ve(this.z,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ve(s,t,i))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this.z=t.z+(i.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){const s=t.x,l=t.y,c=t.z,f=i.x,d=i.y,m=i.z;return this.x=l*m-c*d,this.y=c*f-s*m,this.z=s*d-l*f,this}projectOnVector(t){const i=t.lengthSq();if(i===0)return this.set(0,0,0);const s=t.dot(this)/i;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return sd.copy(this).projectOnVector(t),this.sub(sd)}reflect(t){return this.sub(sd.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(t)/i;return Math.acos(ve(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,s=this.y-t.y,l=this.z-t.z;return i*i+s*s+l*l}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,s){const l=Math.sin(i)*t;return this.x=l*Math.sin(s),this.y=Math.cos(i)*t,this.z=l*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,s){return this.x=t*Math.sin(i),this.y=s,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){const i=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),l=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=s,this.z=l,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,i=Math.random()*2-1,s=Math.sqrt(1-i*i);return this.x=s*Math.cos(t),this.y=i,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const sd=new Q,Q_=new Ts;class Me{constructor(t,i,s,l,c,f,d,m,p){Me.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,i,s,l,c,f,d,m,p)}set(t,i,s,l,c,f,d,m,p){const v=this.elements;return v[0]=t,v[1]=l,v[2]=d,v[3]=i,v[4]=c,v[5]=m,v[6]=s,v[7]=f,v[8]=p,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const i=this.elements,s=t.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],this}extractBasis(t,i,s){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const s=t.elements,l=i.elements,c=this.elements,f=s[0],d=s[3],m=s[6],p=s[1],v=s[4],_=s[7],g=s[2],M=s[5],E=s[8],R=l[0],x=l[3],y=l[6],w=l[1],D=l[4],C=l[7],G=l[2],B=l[5],F=l[8];return c[0]=f*R+d*w+m*G,c[3]=f*x+d*D+m*B,c[6]=f*y+d*C+m*F,c[1]=p*R+v*w+_*G,c[4]=p*x+v*D+_*B,c[7]=p*y+v*C+_*F,c[2]=g*R+M*w+E*G,c[5]=g*x+M*D+E*B,c[8]=g*y+M*C+E*F,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],f=t[4],d=t[5],m=t[6],p=t[7],v=t[8];return i*f*v-i*d*p-s*c*v+s*d*m+l*c*p-l*f*m}invert(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],f=t[4],d=t[5],m=t[6],p=t[7],v=t[8],_=v*f-d*p,g=d*m-v*c,M=p*c-f*m,E=i*_+s*g+l*M;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const R=1/E;return t[0]=_*R,t[1]=(l*p-v*s)*R,t[2]=(d*s-l*f)*R,t[3]=g*R,t[4]=(v*i-l*m)*R,t[5]=(l*c-d*i)*R,t[6]=M*R,t[7]=(s*m-p*i)*R,t[8]=(f*i-s*c)*R,this}transpose(){let t;const i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,s,l,c,f,d){const m=Math.cos(c),p=Math.sin(c);return this.set(s*m,s*p,-s*(m*f+p*d)+f+t,-l*p,l*m,-l*(-p*f+m*d)+d+i,0,0,1),this}scale(t,i){return this.premultiply(rd.makeScale(t,i)),this}rotate(t){return this.premultiply(rd.makeRotation(-t)),this}translate(t,i){return this.premultiply(rd.makeTranslation(t,i)),this}makeTranslation(t,i){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,-s,0,s,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){const i=this.elements,s=t.elements;for(let l=0;l<9;l++)if(i[l]!==s[l])return!1;return!0}fromArray(t,i=0){for(let s=0;s<9;s++)this.elements[s]=t[s+i];return this}toArray(t=[],i=0){const s=this.elements;return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],t[i+4]=s[4],t[i+5]=s[5],t[i+6]=s[6],t[i+7]=s[7],t[i+8]=s[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const rd=new Me,J_=new Me().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),$_=new Me().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function cb(){const a={enabled:!0,workingColorSpace:fo,spaces:{},convert:function(l,c,f){return this.enabled===!1||c===f||!c||!f||(this.spaces[c].transfer===Ge&&(l.r=Fa(l.r),l.g=Fa(l.g),l.b=Fa(l.b)),this.spaces[c].primaries!==this.spaces[f].primaries&&(l.applyMatrix3(this.spaces[c].toXYZ),l.applyMatrix3(this.spaces[f].fromXYZ)),this.spaces[f].transfer===Ge&&(l.r=oo(l.r),l.g=oo(l.g),l.b=oo(l.b))),l},workingToColorSpace:function(l,c){return this.convert(l,this.workingColorSpace,c)},colorSpaceToWorking:function(l,c){return this.convert(l,c,this.workingColorSpace)},getPrimaries:function(l){return this.spaces[l].primaries},getTransfer:function(l){return l===ys?Uu:this.spaces[l].transfer},getToneMappingMode:function(l){return this.spaces[l].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(l,c=this.workingColorSpace){return l.fromArray(this.spaces[c].luminanceCoefficients)},define:function(l){Object.assign(this.spaces,l)},_getMatrix:function(l,c,f){return l.copy(this.spaces[c].toXYZ).multiply(this.spaces[f].fromXYZ)},_getDrawingBufferColorSpace:function(l){return this.spaces[l].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(l=this.workingColorSpace){return this.spaces[l].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(l,c){return Ou("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),a.workingToColorSpace(l,c)},toWorkingColorSpace:function(l,c){return Ou("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),a.colorSpaceToWorking(l,c)}},t=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return a.define({[fo]:{primaries:t,whitePoint:s,transfer:Uu,toXYZ:J_,fromXYZ:$_,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:Ci},outputColorSpaceConfig:{drawingBufferColorSpace:Ci}},[Ci]:{primaries:t,whitePoint:s,transfer:Ge,toXYZ:J_,fromXYZ:$_,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:Ci}}}),a}const Ue=cb();function Fa(a){return a<.04045?a*.0773993808:Math.pow(a*.9478672986+.0521327014,2.4)}function oo(a){return a<.0031308?a*12.92:1.055*Math.pow(a,.41666)-.055}let Vr;class ub{static getDataURL(t,i="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let s;if(t instanceof HTMLCanvasElement)s=t;else{Vr===void 0&&(Vr=Lu("canvas")),Vr.width=t.width,Vr.height=t.height;const l=Vr.getContext("2d");t instanceof ImageData?l.putImageData(t,0,0):l.drawImage(t,0,0,t.width,t.height),s=Vr}return s.toDataURL(i)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const i=Lu("canvas");i.width=t.width,i.height=t.height;const s=i.getContext("2d");s.drawImage(t,0,0,t.width,t.height);const l=s.getImageData(0,0,t.width,t.height),c=l.data;for(let f=0;f<c.length;f++)c[f]=Fa(c[f]/255)*255;return s.putImageData(l,0,0),i}else if(t.data){const i=t.data.slice(0);for(let s=0;s<i.length;s++)i instanceof Uint8Array||i instanceof Uint8ClampedArray?i[s]=Math.floor(Fa(i[s]/255)*255):i[s]=Fa(i[s]);return{data:i,width:t.width,height:t.height}}else return ue("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let fb=0;class jp{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:fb++}),this.uuid=za(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const i=this.data;return typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?t.set(i.videoWidth,i.videoHeight,0):typeof VideoFrame<"u"&&i instanceof VideoFrame?t.set(i.displayHeight,i.displayWidth,0):i!==null?t.set(i.width,i.height,i.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const i=t===void 0||typeof t=="string";if(!i&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const s={uuid:this.uuid,url:""},l=this.data;if(l!==null){let c;if(Array.isArray(l)){c=[];for(let f=0,d=l.length;f<d;f++)l[f].isDataTexture?c.push(od(l[f].image)):c.push(od(l[f]))}else c=od(l);s.url=c}return i||(t.images[this.uuid]=s),s}}function od(a){return typeof HTMLImageElement<"u"&&a instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&a instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&a instanceof ImageBitmap?ub.getDataURL(a):a.data?{data:Array.from(a.data),width:a.width,height:a.height,type:a.data.constructor.name}:(ue("Texture: Unable to serialize Texture."),{})}let hb=0;const ld=new Q;class Kn extends ar{constructor(t=Kn.DEFAULT_IMAGE,i=Kn.DEFAULT_MAPPING,s=Oa,l=Oa,c=Vn,f=$s,d=Wi,m=vi,p=Kn.DEFAULT_ANISOTROPY,v=ys){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:hb++}),this.uuid=za(),this.name="",this.source=new jp(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=s,this.wrapT=l,this.magFilter=c,this.minFilter=f,this.anisotropy=p,this.format=d,this.internalFormat=null,this.type=m,this.offset=new _e(0,0),this.repeat=new _e(1,1),this.center=new _e(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Me,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=v,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(ld).x}get height(){return this.source.getSize(ld).y}get depth(){return this.source.getSize(ld).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const i in t){const s=t[i];if(s===void 0){ue(`Texture.setValues(): parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ue(`Texture.setValues(): property '${i}' does not exist.`);continue}l&&s&&l.isVector2&&s.isVector2||l&&s&&l.isVector3&&s.isVector3||l&&s&&l.isMatrix3&&s.isMatrix3?l.copy(s):this[i]=s}}toJSON(t){const i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const s={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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&&(s.userData=this.userData),i||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==_x)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Kd:t.x=t.x-Math.floor(t.x);break;case Oa:t.x=t.x<0?0:1;break;case Qd:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Kd:t.y=t.y-Math.floor(t.y);break;case Oa:t.y=t.y<0?0:1;break;case Qd:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Kn.DEFAULT_IMAGE=null;Kn.DEFAULT_MAPPING=_x;Kn.DEFAULT_ANISOTROPY=1;class je{constructor(t=0,i=0,s=0,l=1){je.prototype.isVector4=!0,this.x=t,this.y=i,this.z=s,this.w=l}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,s,l){return this.x=t,this.y=i,this.z=s,this.w=l,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const i=this.x,s=this.y,l=this.z,c=this.w,f=t.elements;return this.x=f[0]*i+f[4]*s+f[8]*l+f[12]*c,this.y=f[1]*i+f[5]*s+f[9]*l+f[13]*c,this.z=f[2]*i+f[6]*s+f[10]*l+f[14]*c,this.w=f[3]*i+f[7]*s+f[11]*l+f[15]*c,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,s,l,c;const m=t.elements,p=m[0],v=m[4],_=m[8],g=m[1],M=m[5],E=m[9],R=m[2],x=m[6],y=m[10];if(Math.abs(v-g)<.01&&Math.abs(_-R)<.01&&Math.abs(E-x)<.01){if(Math.abs(v+g)<.1&&Math.abs(_+R)<.1&&Math.abs(E+x)<.1&&Math.abs(p+M+y-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;const D=(p+1)/2,C=(M+1)/2,G=(y+1)/2,B=(v+g)/4,F=(_+R)/4,T=(E+x)/4;return D>C&&D>G?D<.01?(s=0,l=.707106781,c=.707106781):(s=Math.sqrt(D),l=B/s,c=F/s):C>G?C<.01?(s=.707106781,l=0,c=.707106781):(l=Math.sqrt(C),s=B/l,c=T/l):G<.01?(s=.707106781,l=.707106781,c=0):(c=Math.sqrt(G),s=F/c,l=T/c),this.set(s,l,c,i),this}let w=Math.sqrt((x-E)*(x-E)+(_-R)*(_-R)+(g-v)*(g-v));return Math.abs(w)<.001&&(w=1),this.x=(x-E)/w,this.y=(_-R)/w,this.z=(g-v)/w,this.w=Math.acos((p+M+y-1)/2),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this.w=i[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=ve(this.x,t.x,i.x),this.y=ve(this.y,t.y,i.y),this.z=ve(this.z,t.z,i.z),this.w=ve(this.w,t.w,i.w),this}clampScalar(t,i){return this.x=ve(this.x,t,i),this.y=ve(this.y,t,i),this.z=ve(this.z,t,i),this.w=ve(this.w,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ve(s,t,i))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this.z=t.z+(i.z-t.z)*s,this.w=t.w+(i.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),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 db extends ar{constructor(t=1,i=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Vn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},s),this.isRenderTarget=!0,this.width=t,this.height=i,this.depth=s.depth,this.scissor=new je(0,0,t,i),this.scissorTest=!1,this.viewport=new je(0,0,t,i),this.textures=[];const l={width:t,height:i,depth:s.depth},c=new Kn(l),f=s.count;for(let d=0;d<f;d++)this.textures[d]=c.clone(),this.textures[d].isRenderTargetTexture=!0,this.textures[d].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview}_setTextureOptions(t={}){const i={minFilter:Vn,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(i.mapping=t.mapping),t.wrapS!==void 0&&(i.wrapS=t.wrapS),t.wrapT!==void 0&&(i.wrapT=t.wrapT),t.wrapR!==void 0&&(i.wrapR=t.wrapR),t.magFilter!==void 0&&(i.magFilter=t.magFilter),t.minFilter!==void 0&&(i.minFilter=t.minFilter),t.format!==void 0&&(i.format=t.format),t.type!==void 0&&(i.type=t.type),t.anisotropy!==void 0&&(i.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(i.colorSpace=t.colorSpace),t.flipY!==void 0&&(i.flipY=t.flipY),t.generateMipmaps!==void 0&&(i.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(i.internalFormat=t.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(i)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,i,s=1){if(this.width!==t||this.height!==i||this.depth!==s){this.width=t,this.height=i,this.depth=s;for(let l=0,c=this.textures.length;l<c;l++)this.textures[l].image.width=t,this.textures[l].image.height=i,this.textures[l].image.depth=s,this.textures[l].isData3DTexture!==!0&&(this.textures[l].isArrayTexture=this.textures[l].image.depth>1);this.dispose()}this.viewport.set(0,0,t,i),this.scissor.set(0,0,t,i)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let i=0,s=t.textures.length;i<s;i++){this.textures[i]=t.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0,this.textures[i].renderTarget=this;const l=Object.assign({},t.textures[i].image);this.textures[i].source=new jp(l)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class oa extends db{constructor(t=1,i=1,s={}){super(t,i,s),this.isWebGLRenderTarget=!0}}class wx extends Kn{constructor(t=null,i=1,s=1,l=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:i,height:s,depth:l},this.magFilter=Pn,this.minFilter=Pn,this.wrapR=Oa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class pb extends Kn{constructor(t=null,i=1,s=1,l=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:i,height:s,depth:l},this.magFilter=Pn,this.minFilter=Pn,this.wrapR=Oa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class nn{constructor(t,i,s,l,c,f,d,m,p,v,_,g,M,E,R,x){nn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,i,s,l,c,f,d,m,p,v,_,g,M,E,R,x)}set(t,i,s,l,c,f,d,m,p,v,_,g,M,E,R,x){const y=this.elements;return y[0]=t,y[4]=i,y[8]=s,y[12]=l,y[1]=c,y[5]=f,y[9]=d,y[13]=m,y[2]=p,y[6]=v,y[10]=_,y[14]=g,y[3]=M,y[7]=E,y[11]=R,y[15]=x,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 nn().fromArray(this.elements)}copy(t){const i=this.elements,s=t.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],this}copyPosition(t){const i=this.elements,s=t.elements;return i[12]=s[12],i[13]=s[13],i[14]=s[14],this}setFromMatrix3(t){const i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,s){return this.determinant()===0?(t.set(1,0,0),i.set(0,1,0),s.set(0,0,1),this):(t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this)}makeBasis(t,i,s){return this.set(t.x,i.x,s.x,0,t.y,i.y,s.y,0,t.z,i.z,s.z,0,0,0,0,1),this}extractRotation(t){if(t.determinant()===0)return this.identity();const i=this.elements,s=t.elements,l=1/kr.setFromMatrixColumn(t,0).length(),c=1/kr.setFromMatrixColumn(t,1).length(),f=1/kr.setFromMatrixColumn(t,2).length();return i[0]=s[0]*l,i[1]=s[1]*l,i[2]=s[2]*l,i[3]=0,i[4]=s[4]*c,i[5]=s[5]*c,i[6]=s[6]*c,i[7]=0,i[8]=s[8]*f,i[9]=s[9]*f,i[10]=s[10]*f,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){const i=this.elements,s=t.x,l=t.y,c=t.z,f=Math.cos(s),d=Math.sin(s),m=Math.cos(l),p=Math.sin(l),v=Math.cos(c),_=Math.sin(c);if(t.order==="XYZ"){const g=f*v,M=f*_,E=d*v,R=d*_;i[0]=m*v,i[4]=-m*_,i[8]=p,i[1]=M+E*p,i[5]=g-R*p,i[9]=-d*m,i[2]=R-g*p,i[6]=E+M*p,i[10]=f*m}else if(t.order==="YXZ"){const g=m*v,M=m*_,E=p*v,R=p*_;i[0]=g+R*d,i[4]=E*d-M,i[8]=f*p,i[1]=f*_,i[5]=f*v,i[9]=-d,i[2]=M*d-E,i[6]=R+g*d,i[10]=f*m}else if(t.order==="ZXY"){const g=m*v,M=m*_,E=p*v,R=p*_;i[0]=g-R*d,i[4]=-f*_,i[8]=E+M*d,i[1]=M+E*d,i[5]=f*v,i[9]=R-g*d,i[2]=-f*p,i[6]=d,i[10]=f*m}else if(t.order==="ZYX"){const g=f*v,M=f*_,E=d*v,R=d*_;i[0]=m*v,i[4]=E*p-M,i[8]=g*p+R,i[1]=m*_,i[5]=R*p+g,i[9]=M*p-E,i[2]=-p,i[6]=d*m,i[10]=f*m}else if(t.order==="YZX"){const g=f*m,M=f*p,E=d*m,R=d*p;i[0]=m*v,i[4]=R-g*_,i[8]=E*_+M,i[1]=_,i[5]=f*v,i[9]=-d*v,i[2]=-p*v,i[6]=M*_+E,i[10]=g-R*_}else if(t.order==="XZY"){const g=f*m,M=f*p,E=d*m,R=d*p;i[0]=m*v,i[4]=-_,i[8]=p*v,i[1]=g*_+R,i[5]=f*v,i[9]=M*_-E,i[2]=E*_-M,i[6]=d*v,i[10]=R*_+g}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(mb,t,gb)}lookAt(t,i,s){const l=this.elements;return mi.subVectors(t,i),mi.lengthSq()===0&&(mi.z=1),mi.normalize(),ds.crossVectors(s,mi),ds.lengthSq()===0&&(Math.abs(s.z)===1?mi.x+=1e-4:mi.z+=1e-4,mi.normalize(),ds.crossVectors(s,mi)),ds.normalize(),Ic.crossVectors(mi,ds),l[0]=ds.x,l[4]=Ic.x,l[8]=mi.x,l[1]=ds.y,l[5]=Ic.y,l[9]=mi.y,l[2]=ds.z,l[6]=Ic.z,l[10]=mi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const s=t.elements,l=i.elements,c=this.elements,f=s[0],d=s[4],m=s[8],p=s[12],v=s[1],_=s[5],g=s[9],M=s[13],E=s[2],R=s[6],x=s[10],y=s[14],w=s[3],D=s[7],C=s[11],G=s[15],B=l[0],F=l[4],T=l[8],U=l[12],et=l[1],H=l[5],q=l[9],nt=l[13],ot=l[2],Y=l[6],z=l[10],A=l[14],ht=l[3],lt=l[7],Ct=l[11],I=l[15];return c[0]=f*B+d*et+m*ot+p*ht,c[4]=f*F+d*H+m*Y+p*lt,c[8]=f*T+d*q+m*z+p*Ct,c[12]=f*U+d*nt+m*A+p*I,c[1]=v*B+_*et+g*ot+M*ht,c[5]=v*F+_*H+g*Y+M*lt,c[9]=v*T+_*q+g*z+M*Ct,c[13]=v*U+_*nt+g*A+M*I,c[2]=E*B+R*et+x*ot+y*ht,c[6]=E*F+R*H+x*Y+y*lt,c[10]=E*T+R*q+x*z+y*Ct,c[14]=E*U+R*nt+x*A+y*I,c[3]=w*B+D*et+C*ot+G*ht,c[7]=w*F+D*H+C*Y+G*lt,c[11]=w*T+D*q+C*z+G*Ct,c[15]=w*U+D*nt+C*A+G*I,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){const t=this.elements,i=t[0],s=t[4],l=t[8],c=t[12],f=t[1],d=t[5],m=t[9],p=t[13],v=t[2],_=t[6],g=t[10],M=t[14],E=t[3],R=t[7],x=t[11],y=t[15],w=m*M-p*g,D=d*M-p*_,C=d*g-m*_,G=f*M-p*v,B=f*g-m*v,F=f*_-d*v;return i*(R*w-x*D+y*C)-s*(E*w-x*G+y*B)+l*(E*D-R*G+y*F)-c*(E*C-R*B+x*F)}transpose(){const t=this.elements;let i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,s){const l=this.elements;return t.isVector3?(l[12]=t.x,l[13]=t.y,l[14]=t.z):(l[12]=t,l[13]=i,l[14]=s),this}invert(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],f=t[4],d=t[5],m=t[6],p=t[7],v=t[8],_=t[9],g=t[10],M=t[11],E=t[12],R=t[13],x=t[14],y=t[15],w=i*d-s*f,D=i*m-l*f,C=i*p-c*f,G=s*m-l*d,B=s*p-c*d,F=l*p-c*m,T=v*R-_*E,U=v*x-g*E,et=v*y-M*E,H=_*x-g*R,q=_*y-M*R,nt=g*y-M*x,ot=w*nt-D*q+C*H+G*et-B*U+F*T;if(ot===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const Y=1/ot;return t[0]=(d*nt-m*q+p*H)*Y,t[1]=(l*q-s*nt-c*H)*Y,t[2]=(R*F-x*B+y*G)*Y,t[3]=(g*B-_*F-M*G)*Y,t[4]=(m*et-f*nt-p*U)*Y,t[5]=(i*nt-l*et+c*U)*Y,t[6]=(x*C-E*F-y*D)*Y,t[7]=(v*F-g*C+M*D)*Y,t[8]=(f*q-d*et+p*T)*Y,t[9]=(s*et-i*q-c*T)*Y,t[10]=(E*B-R*C+y*w)*Y,t[11]=(_*C-v*B-M*w)*Y,t[12]=(d*U-f*H-m*T)*Y,t[13]=(i*H-s*U+l*T)*Y,t[14]=(R*D-E*G-x*w)*Y,t[15]=(v*G-_*D+g*w)*Y,this}scale(t){const i=this.elements,s=t.x,l=t.y,c=t.z;return i[0]*=s,i[4]*=l,i[8]*=c,i[1]*=s,i[5]*=l,i[9]*=c,i[2]*=s,i[6]*=l,i[10]*=c,i[3]*=s,i[7]*=l,i[11]*=c,this}getMaxScaleOnAxis(){const t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],l=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,s,l))}makeTranslation(t,i,s){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,i,0,0,1,s,0,0,0,1),this}makeRotationX(t){const i=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,i,-s,0,0,s,i,0,0,0,0,1),this}makeRotationY(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,0,s,0,0,1,0,0,-s,0,i,0,0,0,0,1),this}makeRotationZ(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,-s,0,0,s,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){const s=Math.cos(i),l=Math.sin(i),c=1-s,f=t.x,d=t.y,m=t.z,p=c*f,v=c*d;return this.set(p*f+s,p*d-l*m,p*m+l*d,0,p*d+l*m,v*d+s,v*m-l*f,0,p*m-l*d,v*m+l*f,c*m*m+s,0,0,0,0,1),this}makeScale(t,i,s){return this.set(t,0,0,0,0,i,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,i,s,l,c,f){return this.set(1,s,c,0,t,1,f,0,i,l,1,0,0,0,0,1),this}compose(t,i,s){const l=this.elements,c=i._x,f=i._y,d=i._z,m=i._w,p=c+c,v=f+f,_=d+d,g=c*p,M=c*v,E=c*_,R=f*v,x=f*_,y=d*_,w=m*p,D=m*v,C=m*_,G=s.x,B=s.y,F=s.z;return l[0]=(1-(R+y))*G,l[1]=(M+C)*G,l[2]=(E-D)*G,l[3]=0,l[4]=(M-C)*B,l[5]=(1-(g+y))*B,l[6]=(x+w)*B,l[7]=0,l[8]=(E+D)*F,l[9]=(x-w)*F,l[10]=(1-(g+R))*F,l[11]=0,l[12]=t.x,l[13]=t.y,l[14]=t.z,l[15]=1,this}decompose(t,i,s){const l=this.elements;t.x=l[12],t.y=l[13],t.z=l[14];const c=this.determinant();if(c===0)return s.set(1,1,1),i.identity(),this;let f=kr.set(l[0],l[1],l[2]).length();const d=kr.set(l[4],l[5],l[6]).length(),m=kr.set(l[8],l[9],l[10]).length();c<0&&(f=-f),Ii.copy(this);const p=1/f,v=1/d,_=1/m;return Ii.elements[0]*=p,Ii.elements[1]*=p,Ii.elements[2]*=p,Ii.elements[4]*=v,Ii.elements[5]*=v,Ii.elements[6]*=v,Ii.elements[8]*=_,Ii.elements[9]*=_,Ii.elements[10]*=_,i.setFromRotationMatrix(Ii),s.x=f,s.y=d,s.z=m,this}makePerspective(t,i,s,l,c,f,d=aa,m=!1){const p=this.elements,v=2*c/(i-t),_=2*c/(s-l),g=(i+t)/(i-t),M=(s+l)/(s-l);let E,R;if(m)E=c/(f-c),R=f*c/(f-c);else if(d===aa)E=-(f+c)/(f-c),R=-2*f*c/(f-c);else if(d===Sl)E=-f/(f-c),R=-f*c/(f-c);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+d);return p[0]=v,p[4]=0,p[8]=g,p[12]=0,p[1]=0,p[5]=_,p[9]=M,p[13]=0,p[2]=0,p[6]=0,p[10]=E,p[14]=R,p[3]=0,p[7]=0,p[11]=-1,p[15]=0,this}makeOrthographic(t,i,s,l,c,f,d=aa,m=!1){const p=this.elements,v=2/(i-t),_=2/(s-l),g=-(i+t)/(i-t),M=-(s+l)/(s-l);let E,R;if(m)E=1/(f-c),R=f/(f-c);else if(d===aa)E=-2/(f-c),R=-(f+c)/(f-c);else if(d===Sl)E=-1/(f-c),R=-c/(f-c);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+d);return p[0]=v,p[4]=0,p[8]=0,p[12]=g,p[1]=0,p[5]=_,p[9]=0,p[13]=M,p[2]=0,p[6]=0,p[10]=E,p[14]=R,p[3]=0,p[7]=0,p[11]=0,p[15]=1,this}equals(t){const i=this.elements,s=t.elements;for(let l=0;l<16;l++)if(i[l]!==s[l])return!1;return!0}fromArray(t,i=0){for(let s=0;s<16;s++)this.elements[s]=t[s+i];return this}toArray(t=[],i=0){const s=this.elements;return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],t[i+4]=s[4],t[i+5]=s[5],t[i+6]=s[6],t[i+7]=s[7],t[i+8]=s[8],t[i+9]=s[9],t[i+10]=s[10],t[i+11]=s[11],t[i+12]=s[12],t[i+13]=s[13],t[i+14]=s[14],t[i+15]=s[15],t}}const kr=new Q,Ii=new nn,mb=new Q(0,0,0),gb=new Q(1,1,1),ds=new Q,Ic=new Q,mi=new Q,tv=new nn,ev=new Ts;class ca{constructor(t=0,i=0,s=0,l=ca.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=s,this._order=l}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,s,l=this._order){return this._x=t,this._y=i,this._z=s,this._order=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,s=!0){const l=t.elements,c=l[0],f=l[4],d=l[8],m=l[1],p=l[5],v=l[9],_=l[2],g=l[6],M=l[10];switch(i){case"XYZ":this._y=Math.asin(ve(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-v,M),this._z=Math.atan2(-f,c)):(this._x=Math.atan2(g,p),this._z=0);break;case"YXZ":this._x=Math.asin(-ve(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(d,M),this._z=Math.atan2(m,p)):(this._y=Math.atan2(-_,c),this._z=0);break;case"ZXY":this._x=Math.asin(ve(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(-_,M),this._z=Math.atan2(-f,p)):(this._y=0,this._z=Math.atan2(m,c));break;case"ZYX":this._y=Math.asin(-ve(_,-1,1)),Math.abs(_)<.9999999?(this._x=Math.atan2(g,M),this._z=Math.atan2(m,c)):(this._x=0,this._z=Math.atan2(-f,p));break;case"YZX":this._z=Math.asin(ve(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(-v,p),this._y=Math.atan2(-_,c)):(this._x=0,this._y=Math.atan2(d,M));break;case"XZY":this._z=Math.asin(-ve(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(g,p),this._y=Math.atan2(d,c)):(this._x=Math.atan2(-v,M),this._y=0);break;default:ue("Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,s===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,s){return tv.makeRotationFromQuaternion(t),this.setFromRotationMatrix(tv,i,s)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return ev.setFromEuler(this),this.setFromQuaternion(ev,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ca.DEFAULT_ORDER="XYZ";class Cx{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let _b=0;const nv=new Q,Xr=new Ts,Ca=new nn,Bc=new Q,ll=new Q,vb=new Q,xb=new Ts,iv=new Q(1,0,0),av=new Q(0,1,0),sv=new Q(0,0,1),rv={type:"added"},yb={type:"removed"},Wr={type:"childadded",child:null},cd={type:"childremoved",child:null};class zn extends ar{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:_b++}),this.uuid=za(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=zn.DEFAULT_UP.clone();const t=new Q,i=new ca,s=new Ts,l=new Q(1,1,1);function c(){s.setFromEuler(i,!1)}function f(){i.setFromQuaternion(s,void 0,!1)}i._onChange(c),s._onChange(f),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:l},modelViewMatrix:{value:new nn},normalMatrix:{value:new Me}}),this.matrix=new nn,this.matrixWorld=new nn,this.matrixAutoUpdate=zn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=zn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Cx,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Xr.setFromAxisAngle(t,i),this.quaternion.multiply(Xr),this}rotateOnWorldAxis(t,i){return Xr.setFromAxisAngle(t,i),this.quaternion.premultiply(Xr),this}rotateX(t){return this.rotateOnAxis(iv,t)}rotateY(t){return this.rotateOnAxis(av,t)}rotateZ(t){return this.rotateOnAxis(sv,t)}translateOnAxis(t,i){return nv.copy(t).applyQuaternion(this.quaternion),this.position.add(nv.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(iv,t)}translateY(t){return this.translateOnAxis(av,t)}translateZ(t){return this.translateOnAxis(sv,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ca.copy(this.matrixWorld).invert())}lookAt(t,i,s){t.isVector3?Bc.copy(t):Bc.set(t,i,s);const l=this.parent;this.updateWorldMatrix(!0,!1),ll.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ca.lookAt(ll,Bc,this.up):Ca.lookAt(Bc,ll,this.up),this.quaternion.setFromRotationMatrix(Ca),l&&(Ca.extractRotation(l.matrixWorld),Xr.setFromRotationMatrix(Ca),this.quaternion.premultiply(Xr.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}return t===this?(Pe("Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(rv),Wr.child=t,this.dispatchEvent(Wr),Wr.child=null):Pe("Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const i=this.children.indexOf(t);return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(yb),cd.child=t,this.dispatchEvent(cd),cd.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ca.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Ca.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ca),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(rv),Wr.child=t,this.dispatchEvent(Wr),Wr.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let s=0,l=this.children.length;s<l;s++){const f=this.children[s].getObjectByProperty(t,i);if(f!==void 0)return f}}getObjectsByProperty(t,i,s=[]){this[t]===i&&s.push(this);const l=this.children;for(let c=0,f=l.length;c<f;c++)l[c].getObjectsByProperty(t,i,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ll,t,vb),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ll,xb,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverseVisible(t)}traverseAncestors(t){const i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const t=this.pivot;if(t!==null){const i=t.x,s=t.y,l=t.z,c=this.matrix.elements;c[12]+=i-c[0]*i-c[4]*s-c[8]*l,c[13]+=s-c[1]*i-c[5]*s-c[9]*l,c[14]+=l-c[2]*i-c[6]*s-c[10]*l}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].updateMatrixWorld(t)}updateWorldMatrix(t,i){const s=this.parent;if(t===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),i===!0){const l=this.children;for(let c=0,f=l.length;c<f;c++)l[c].updateWorldMatrix(!1,!0)}}toJSON(t){const i=t===void 0||typeof t=="string",s={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const l={};l.uuid=this.uuid,l.type=this.type,this.name!==""&&(l.name=this.name),this.castShadow===!0&&(l.castShadow=!0),this.receiveShadow===!0&&(l.receiveShadow=!0),this.visible===!1&&(l.visible=!1),this.frustumCulled===!1&&(l.frustumCulled=!1),this.renderOrder!==0&&(l.renderOrder=this.renderOrder),this.static!==!1&&(l.static=this.static),Object.keys(this.userData).length>0&&(l.userData=this.userData),l.layers=this.layers.mask,l.matrix=this.matrix.toArray(),l.up=this.up.toArray(),this.pivot!==null&&(l.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(l.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(l.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(l.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(l.type="InstancedMesh",l.count=this.count,l.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(l.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(l.type="BatchedMesh",l.perObjectFrustumCulled=this.perObjectFrustumCulled,l.sortObjects=this.sortObjects,l.drawRanges=this._drawRanges,l.reservedRanges=this._reservedRanges,l.geometryInfo=this._geometryInfo.map(d=>({...d,boundingBox:d.boundingBox?d.boundingBox.toJSON():void 0,boundingSphere:d.boundingSphere?d.boundingSphere.toJSON():void 0})),l.instanceInfo=this._instanceInfo.map(d=>({...d})),l.availableInstanceIds=this._availableInstanceIds.slice(),l.availableGeometryIds=this._availableGeometryIds.slice(),l.nextIndexStart=this._nextIndexStart,l.nextVertexStart=this._nextVertexStart,l.geometryCount=this._geometryCount,l.maxInstanceCount=this._maxInstanceCount,l.maxVertexCount=this._maxVertexCount,l.maxIndexCount=this._maxIndexCount,l.geometryInitialized=this._geometryInitialized,l.matricesTexture=this._matricesTexture.toJSON(t),l.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(l.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(l.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(l.boundingBox=this.boundingBox.toJSON()));function c(d,m){return d[m.uuid]===void 0&&(d[m.uuid]=m.toJSON(t)),m.uuid}if(this.isScene)this.background&&(this.background.isColor?l.background=this.background.toJSON():this.background.isTexture&&(l.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(l.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){l.geometry=c(t.geometries,this.geometry);const d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){const m=d.shapes;if(Array.isArray(m))for(let p=0,v=m.length;p<v;p++){const _=m[p];c(t.shapes,_)}else c(t.shapes,m)}}if(this.isSkinnedMesh&&(l.bindMode=this.bindMode,l.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(c(t.skeletons,this.skeleton),l.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const d=[];for(let m=0,p=this.material.length;m<p;m++)d.push(c(t.materials,this.material[m]));l.material=d}else l.material=c(t.materials,this.material);if(this.children.length>0){l.children=[];for(let d=0;d<this.children.length;d++)l.children.push(this.children[d].toJSON(t).object)}if(this.animations.length>0){l.animations=[];for(let d=0;d<this.animations.length;d++){const m=this.animations[d];l.animations.push(c(t.animations,m))}}if(i){const d=f(t.geometries),m=f(t.materials),p=f(t.textures),v=f(t.images),_=f(t.shapes),g=f(t.skeletons),M=f(t.animations),E=f(t.nodes);d.length>0&&(s.geometries=d),m.length>0&&(s.materials=m),p.length>0&&(s.textures=p),v.length>0&&(s.images=v),_.length>0&&(s.shapes=_),g.length>0&&(s.skeletons=g),M.length>0&&(s.animations=M),E.length>0&&(s.nodes=E)}return s.object=l,s;function f(d){const m=[];for(const p in d){const v=d[p];delete v.metadata,m.push(v)}return m}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),t.pivot!==null&&(this.pivot=t.pivot.clone()),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let s=0;s<t.children.length;s++){const l=t.children[s];this.add(l.clone())}return this}}zn.DEFAULT_UP=new Q(0,1,0);zn.DEFAULT_MATRIX_AUTO_UPDATE=!0;zn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class Hc extends zn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Sb={type:"move"};class ud{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Hc,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 Hc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Hc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Q),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const i=this._hand;if(i)for(const s of t.hand.values())this._getHandJoint(i,s)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,i,s){let l=null,c=null,f=null;const d=this._targetRay,m=this._grip,p=this._hand;if(t&&i.session.visibilityState!=="visible-blurred"){if(p&&t.hand){f=!0;for(const R of t.hand.values()){const x=i.getJointPose(R,s),y=this._getHandJoint(p,R);x!==null&&(y.matrix.fromArray(x.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=x.radius),y.visible=x!==null}const v=p.joints["index-finger-tip"],_=p.joints["thumb-tip"],g=v.position.distanceTo(_.position),M=.02,E=.005;p.inputState.pinching&&g>M+E?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!p.inputState.pinching&&g<=M-E&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else m!==null&&t.gripSpace&&(c=i.getPose(t.gripSpace,s),c!==null&&(m.matrix.fromArray(c.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,c.linearVelocity?(m.hasLinearVelocity=!0,m.linearVelocity.copy(c.linearVelocity)):m.hasLinearVelocity=!1,c.angularVelocity?(m.hasAngularVelocity=!0,m.angularVelocity.copy(c.angularVelocity)):m.hasAngularVelocity=!1));d!==null&&(l=i.getPose(t.targetRaySpace,s),l===null&&c!==null&&(l=c),l!==null&&(d.matrix.fromArray(l.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,l.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(l.linearVelocity)):d.hasLinearVelocity=!1,l.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(l.angularVelocity)):d.hasAngularVelocity=!1,this.dispatchEvent(Sb)))}return d!==null&&(d.visible=l!==null),m!==null&&(m.visible=c!==null),p!==null&&(p.visible=f!==null),this}_getHandJoint(t,i){if(t.joints[i.jointName]===void 0){const s=new Hc;s.matrixAutoUpdate=!1,s.visible=!1,t.joints[i.jointName]=s,t.add(s)}return t.joints[i.jointName]}}const Dx={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},ps={h:0,s:0,l:0},Gc={h:0,s:0,l:0};function fd(a,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?a+(t-a)*6*i:i<1/2?t:i<2/3?a+(t-a)*6*(2/3-i):a}class Ee{constructor(t,i,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,s)}set(t,i,s){if(i===void 0&&s===void 0){const l=t;l&&l.isColor?this.copy(l):typeof l=="number"?this.setHex(l):typeof l=="string"&&this.setStyle(l)}else this.setRGB(t,i,s);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,i=Ci){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Ue.colorSpaceToWorking(this,i),this}setRGB(t,i,s,l=Ue.workingColorSpace){return this.r=t,this.g=i,this.b=s,Ue.colorSpaceToWorking(this,l),this}setHSL(t,i,s,l=Ue.workingColorSpace){if(t=Yp(t,1),i=ve(i,0,1),s=ve(s,0,1),i===0)this.r=this.g=this.b=s;else{const c=s<=.5?s*(1+i):s+i-s*i,f=2*s-c;this.r=fd(f,c,t+1/3),this.g=fd(f,c,t),this.b=fd(f,c,t-1/3)}return Ue.colorSpaceToWorking(this,l),this}setStyle(t,i=Ci){function s(c){c!==void 0&&parseFloat(c)<1&&ue("Color: Alpha component of "+t+" will be ignored.")}let l;if(l=/^(\w+)\(([^\)]*)\)/.exec(t)){let c;const f=l[1],d=l[2];switch(f){case"rgb":case"rgba":if(c=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setRGB(Math.min(255,parseInt(c[1],10))/255,Math.min(255,parseInt(c[2],10))/255,Math.min(255,parseInt(c[3],10))/255,i);if(c=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setRGB(Math.min(100,parseInt(c[1],10))/100,Math.min(100,parseInt(c[2],10))/100,Math.min(100,parseInt(c[3],10))/100,i);break;case"hsl":case"hsla":if(c=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setHSL(parseFloat(c[1])/360,parseFloat(c[2])/100,parseFloat(c[3])/100,i);break;default:ue("Color: Unknown color model "+t)}}else if(l=/^\#([A-Fa-f\d]+)$/.exec(t)){const c=l[1],f=c.length;if(f===3)return this.setRGB(parseInt(c.charAt(0),16)/15,parseInt(c.charAt(1),16)/15,parseInt(c.charAt(2),16)/15,i);if(f===6)return this.setHex(parseInt(c,16),i);ue("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}setColorName(t,i=Ci){const s=Dx[t.toLowerCase()];return s!==void 0?this.setHex(s,i):ue("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Fa(t.r),this.g=Fa(t.g),this.b=Fa(t.b),this}copyLinearToSRGB(t){return this.r=oo(t.r),this.g=oo(t.g),this.b=oo(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ci){return Ue.workingToColorSpace(Bn.copy(this),t),Math.round(ve(Bn.r*255,0,255))*65536+Math.round(ve(Bn.g*255,0,255))*256+Math.round(ve(Bn.b*255,0,255))}getHexString(t=Ci){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,i=Ue.workingColorSpace){Ue.workingToColorSpace(Bn.copy(this),i);const s=Bn.r,l=Bn.g,c=Bn.b,f=Math.max(s,l,c),d=Math.min(s,l,c);let m,p;const v=(d+f)/2;if(d===f)m=0,p=0;else{const _=f-d;switch(p=v<=.5?_/(f+d):_/(2-f-d),f){case s:m=(l-c)/_+(l<c?6:0);break;case l:m=(c-s)/_+2;break;case c:m=(s-l)/_+4;break}m/=6}return t.h=m,t.s=p,t.l=v,t}getRGB(t,i=Ue.workingColorSpace){return Ue.workingToColorSpace(Bn.copy(this),i),t.r=Bn.r,t.g=Bn.g,t.b=Bn.b,t}getStyle(t=Ci){Ue.workingToColorSpace(Bn.copy(this),t);const i=Bn.r,s=Bn.g,l=Bn.b;return t!==Ci?`color(${t} ${i.toFixed(3)} ${s.toFixed(3)} ${l.toFixed(3)})`:`rgb(${Math.round(i*255)},${Math.round(s*255)},${Math.round(l*255)})`}offsetHSL(t,i,s){return this.getHSL(ps),this.setHSL(ps.h+t,ps.s+i,ps.l+s)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,i){return this.r=t.r+i.r,this.g=t.g+i.g,this.b=t.b+i.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,i){return this.r+=(t.r-this.r)*i,this.g+=(t.g-this.g)*i,this.b+=(t.b-this.b)*i,this}lerpColors(t,i,s){return this.r=t.r+(i.r-t.r)*s,this.g=t.g+(i.g-t.g)*s,this.b=t.b+(i.b-t.b)*s,this}lerpHSL(t,i){this.getHSL(ps),t.getHSL(Gc);const s=vl(ps.h,Gc.h,i),l=vl(ps.s,Gc.s,i),c=vl(ps.l,Gc.l,i);return this.setHSL(s,l,c),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const i=this.r,s=this.g,l=this.b,c=t.elements;return this.r=c[0]*i+c[3]*s+c[6]*l,this.g=c[1]*i+c[4]*s+c[7]*l,this.b=c[2]*i+c[5]*s+c[8]*l,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,i=0){return this.r=t[i],this.g=t[i+1],this.b=t[i+2],this}toArray(t=[],i=0){return t[i]=this.r,t[i+1]=this.g,t[i+2]=this.b,t}fromBufferAttribute(t,i){return this.r=t.getX(i),this.g=t.getY(i),this.b=t.getZ(i),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Bn=new Ee;Ee.NAMES=Dx;class Mb extends zn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ca,this.environmentIntensity=1,this.environmentRotation=new ca,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,i){return super.copy(t,i),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const i=super.toJSON(t);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(i.object.environmentIntensity=this.environmentIntensity),i.object.environmentRotation=this.environmentRotation.toArray(),i}}const Bi=new Q,Da=new Q,hd=new Q,Ua=new Q,qr=new Q,Yr=new Q,ov=new Q,dd=new Q,pd=new Q,md=new Q,gd=new je,_d=new je,vd=new je;class Di{constructor(t=new Q,i=new Q,s=new Q){this.a=t,this.b=i,this.c=s}static getNormal(t,i,s,l){l.subVectors(s,i),Bi.subVectors(t,i),l.cross(Bi);const c=l.lengthSq();return c>0?l.multiplyScalar(1/Math.sqrt(c)):l.set(0,0,0)}static getBarycoord(t,i,s,l,c){Bi.subVectors(l,i),Da.subVectors(s,i),hd.subVectors(t,i);const f=Bi.dot(Bi),d=Bi.dot(Da),m=Bi.dot(hd),p=Da.dot(Da),v=Da.dot(hd),_=f*p-d*d;if(_===0)return c.set(0,0,0),null;const g=1/_,M=(p*m-d*v)*g,E=(f*v-d*m)*g;return c.set(1-M-E,E,M)}static containsPoint(t,i,s,l){return this.getBarycoord(t,i,s,l,Ua)===null?!1:Ua.x>=0&&Ua.y>=0&&Ua.x+Ua.y<=1}static getInterpolation(t,i,s,l,c,f,d,m){return this.getBarycoord(t,i,s,l,Ua)===null?(m.x=0,m.y=0,"z"in m&&(m.z=0),"w"in m&&(m.w=0),null):(m.setScalar(0),m.addScaledVector(c,Ua.x),m.addScaledVector(f,Ua.y),m.addScaledVector(d,Ua.z),m)}static getInterpolatedAttribute(t,i,s,l,c,f){return gd.setScalar(0),_d.setScalar(0),vd.setScalar(0),gd.fromBufferAttribute(t,i),_d.fromBufferAttribute(t,s),vd.fromBufferAttribute(t,l),f.setScalar(0),f.addScaledVector(gd,c.x),f.addScaledVector(_d,c.y),f.addScaledVector(vd,c.z),f}static isFrontFacing(t,i,s,l){return Bi.subVectors(s,i),Da.subVectors(t,i),Bi.cross(Da).dot(l)<0}set(t,i,s){return this.a.copy(t),this.b.copy(i),this.c.copy(s),this}setFromPointsAndIndices(t,i,s,l){return this.a.copy(t[i]),this.b.copy(t[s]),this.c.copy(t[l]),this}setFromAttributeAndIndices(t,i,s,l){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,s),this.c.fromBufferAttribute(t,l),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Bi.subVectors(this.c,this.b),Da.subVectors(this.a,this.b),Bi.cross(Da).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Di.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return Di.getBarycoord(t,this.a,this.b,this.c,i)}getInterpolation(t,i,s,l,c){return Di.getInterpolation(t,this.a,this.b,this.c,i,s,l,c)}containsPoint(t){return Di.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Di.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){const s=this.a,l=this.b,c=this.c;let f,d;qr.subVectors(l,s),Yr.subVectors(c,s),dd.subVectors(t,s);const m=qr.dot(dd),p=Yr.dot(dd);if(m<=0&&p<=0)return i.copy(s);pd.subVectors(t,l);const v=qr.dot(pd),_=Yr.dot(pd);if(v>=0&&_<=v)return i.copy(l);const g=m*_-v*p;if(g<=0&&m>=0&&v<=0)return f=m/(m-v),i.copy(s).addScaledVector(qr,f);md.subVectors(t,c);const M=qr.dot(md),E=Yr.dot(md);if(E>=0&&M<=E)return i.copy(c);const R=M*p-m*E;if(R<=0&&p>=0&&E<=0)return d=p/(p-E),i.copy(s).addScaledVector(Yr,d);const x=v*E-M*_;if(x<=0&&_-v>=0&&M-E>=0)return ov.subVectors(c,l),d=(_-v)/(_-v+(M-E)),i.copy(l).addScaledVector(ov,d);const y=1/(x+R+g);return f=R*y,d=g*y,i.copy(s).addScaledVector(qr,f).addScaledVector(Yr,d)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class As{constructor(t=new Q(1/0,1/0,1/0),i=new Q(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=i}set(t,i){return this.min.copy(t),this.max.copy(i),this}setFromArray(t){this.makeEmpty();for(let i=0,s=t.length;i<s;i+=3)this.expandByPoint(Hi.fromArray(t,i));return this}setFromBufferAttribute(t){this.makeEmpty();for(let i=0,s=t.count;i<s;i++)this.expandByPoint(Hi.fromBufferAttribute(t,i));return this}setFromPoints(t){this.makeEmpty();for(let i=0,s=t.length;i<s;i++)this.expandByPoint(t[i]);return this}setFromCenterAndSize(t,i){const s=Hi.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(s),this.max.copy(t).add(s),this}setFromObject(t,i=!1){return this.makeEmpty(),this.expandByObject(t,i)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,i=!1){t.updateWorldMatrix(!1,!1);const s=t.geometry;if(s!==void 0){const c=s.getAttribute("position");if(i===!0&&c!==void 0&&t.isInstancedMesh!==!0)for(let f=0,d=c.count;f<d;f++)t.isMesh===!0?t.getVertexPosition(f,Hi):Hi.fromBufferAttribute(c,f),Hi.applyMatrix4(t.matrixWorld),this.expandByPoint(Hi);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Vc.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Vc.copy(s.boundingBox)),Vc.applyMatrix4(t.matrixWorld),this.union(Vc)}const l=t.children;for(let c=0,f=l.length;c<f;c++)this.expandByObject(l[c],i);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Hi),Hi.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let i,s;return t.normal.x>0?(i=t.normal.x*this.min.x,s=t.normal.x*this.max.x):(i=t.normal.x*this.max.x,s=t.normal.x*this.min.x),t.normal.y>0?(i+=t.normal.y*this.min.y,s+=t.normal.y*this.max.y):(i+=t.normal.y*this.max.y,s+=t.normal.y*this.min.y),t.normal.z>0?(i+=t.normal.z*this.min.z,s+=t.normal.z*this.max.z):(i+=t.normal.z*this.max.z,s+=t.normal.z*this.min.z),i<=-t.constant&&s>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(cl),kc.subVectors(this.max,cl),jr.subVectors(t.a,cl),Zr.subVectors(t.b,cl),Kr.subVectors(t.c,cl),ms.subVectors(Zr,jr),gs.subVectors(Kr,Zr),Ws.subVectors(jr,Kr);let i=[0,-ms.z,ms.y,0,-gs.z,gs.y,0,-Ws.z,Ws.y,ms.z,0,-ms.x,gs.z,0,-gs.x,Ws.z,0,-Ws.x,-ms.y,ms.x,0,-gs.y,gs.x,0,-Ws.y,Ws.x,0];return!xd(i,jr,Zr,Kr,kc)||(i=[1,0,0,0,1,0,0,0,1],!xd(i,jr,Zr,Kr,kc))?!1:(Xc.crossVectors(ms,gs),i=[Xc.x,Xc.y,Xc.z],xd(i,jr,Zr,Kr,kc))}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Hi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Hi).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(La[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),La[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),La[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),La[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),La[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),La[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),La[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),La[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(La),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const La=[new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q],Hi=new Q,Vc=new As,jr=new Q,Zr=new Q,Kr=new Q,ms=new Q,gs=new Q,Ws=new Q,cl=new Q,kc=new Q,Xc=new Q,qs=new Q;function xd(a,t,i,s,l){for(let c=0,f=a.length-3;c<=f;c+=3){qs.fromArray(a,c);const d=l.x*Math.abs(qs.x)+l.y*Math.abs(qs.y)+l.z*Math.abs(qs.z),m=t.dot(qs),p=i.dot(qs),v=s.dot(qs);if(Math.max(-Math.max(m,p,v),Math.min(m,p,v))>d)return!1}return!0}const gn=new Q,Wc=new _e;let bb=0;class xi{constructor(t,i,s=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:bb++}),this.name="",this.array=t,this.itemSize=i,this.count=t!==void 0?t.length/i:0,this.normalized=s,this.usage=Dp,this.updateRanges=[],this.gpuType=ia,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,i,s){t*=this.itemSize,s*=i.itemSize;for(let l=0,c=this.itemSize;l<c;l++)this.array[t+l]=i.array[s+l];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let i=0,s=this.count;i<s;i++)Wc.fromBufferAttribute(this,i),Wc.applyMatrix3(t),this.setXY(i,Wc.x,Wc.y);else if(this.itemSize===3)for(let i=0,s=this.count;i<s;i++)gn.fromBufferAttribute(this,i),gn.applyMatrix3(t),this.setXYZ(i,gn.x,gn.y,gn.z);return this}applyMatrix4(t){for(let i=0,s=this.count;i<s;i++)gn.fromBufferAttribute(this,i),gn.applyMatrix4(t),this.setXYZ(i,gn.x,gn.y,gn.z);return this}applyNormalMatrix(t){for(let i=0,s=this.count;i<s;i++)gn.fromBufferAttribute(this,i),gn.applyNormalMatrix(t),this.setXYZ(i,gn.x,gn.y,gn.z);return this}transformDirection(t){for(let i=0,s=this.count;i<s;i++)gn.fromBufferAttribute(this,i),gn.transformDirection(t),this.setXYZ(i,gn.x,gn.y,gn.z);return this}set(t,i=0){return this.array.set(t,i),this}getComponent(t,i){let s=this.array[t*this.itemSize+i];return this.normalized&&(s=Xi(s,this.array)),s}setComponent(t,i,s){return this.normalized&&(s=Ve(s,this.array)),this.array[t*this.itemSize+i]=s,this}getX(t){let i=this.array[t*this.itemSize];return this.normalized&&(i=Xi(i,this.array)),i}setX(t,i){return this.normalized&&(i=Ve(i,this.array)),this.array[t*this.itemSize]=i,this}getY(t){let i=this.array[t*this.itemSize+1];return this.normalized&&(i=Xi(i,this.array)),i}setY(t,i){return this.normalized&&(i=Ve(i,this.array)),this.array[t*this.itemSize+1]=i,this}getZ(t){let i=this.array[t*this.itemSize+2];return this.normalized&&(i=Xi(i,this.array)),i}setZ(t,i){return this.normalized&&(i=Ve(i,this.array)),this.array[t*this.itemSize+2]=i,this}getW(t){let i=this.array[t*this.itemSize+3];return this.normalized&&(i=Xi(i,this.array)),i}setW(t,i){return this.normalized&&(i=Ve(i,this.array)),this.array[t*this.itemSize+3]=i,this}setXY(t,i,s){return t*=this.itemSize,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array)),this.array[t+0]=i,this.array[t+1]=s,this}setXYZ(t,i,s,l){return t*=this.itemSize,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array),l=Ve(l,this.array)),this.array[t+0]=i,this.array[t+1]=s,this.array[t+2]=l,this}setXYZW(t,i,s,l,c){return t*=this.itemSize,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array),l=Ve(l,this.array),c=Ve(c,this.array)),this.array[t+0]=i,this.array[t+1]=s,this.array[t+2]=l,this.array[t+3]=c,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==Dp&&(t.usage=this.usage),t}}class Ux extends xi{constructor(t,i,s){super(new Uint16Array(t),i,s)}}class Lx extends xi{constructor(t,i,s){super(new Uint32Array(t),i,s)}}class _n extends xi{constructor(t,i,s){super(new Float32Array(t),i,s)}}const Eb=new As,ul=new Q,yd=new Q;class po{constructor(t=new Q,i=-1){this.isSphere=!0,this.center=t,this.radius=i}set(t,i){return this.center.copy(t),this.radius=i,this}setFromPoints(t,i){const s=this.center;i!==void 0?s.copy(i):Eb.setFromPoints(t).getCenter(s);let l=0;for(let c=0,f=t.length;c<f;c++)l=Math.max(l,s.distanceToSquared(t[c]));return this.radius=Math.sqrt(l),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const i=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=i*i}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,i){const s=this.center.distanceToSquared(t);return i.copy(t),s>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ul.subVectors(t,this.center);const i=ul.lengthSq();if(i>this.radius*this.radius){const s=Math.sqrt(i),l=(s-this.radius)*.5;this.center.addScaledVector(ul,l/s),this.radius+=l}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(yd.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ul.copy(t.center).add(yd)),this.expandByPoint(ul.copy(t.center).sub(yd))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let Tb=0;const wi=new nn,Sd=new zn,Qr=new Q,gi=new As,fl=new As,An=new Q;class Mn extends ar{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Tb++}),this.uuid=za(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,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(t){return Array.isArray(t)?this.index=new(kM(t)?Lx:Ux)(t,1):this.index=t,this}setIndirect(t,i=0){return this.indirect=t,this.indirectOffset=i,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,i){return this.attributes[t]=i,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,i,s=0){this.groups.push({start:t,count:i,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(t,i){this.drawRange.start=t,this.drawRange.count=i}applyMatrix4(t){const i=this.attributes.position;i!==void 0&&(i.applyMatrix4(t),i.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const c=new Me().getNormalMatrix(t);s.applyNormalMatrix(c),s.needsUpdate=!0}const l=this.attributes.tangent;return l!==void 0&&(l.transformDirection(t),l.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return wi.makeRotationFromQuaternion(t),this.applyMatrix4(wi),this}rotateX(t){return wi.makeRotationX(t),this.applyMatrix4(wi),this}rotateY(t){return wi.makeRotationY(t),this.applyMatrix4(wi),this}rotateZ(t){return wi.makeRotationZ(t),this.applyMatrix4(wi),this}translate(t,i,s){return wi.makeTranslation(t,i,s),this.applyMatrix4(wi),this}scale(t,i,s){return wi.makeScale(t,i,s),this.applyMatrix4(wi),this}lookAt(t){return Sd.lookAt(t),Sd.updateMatrix(),this.applyMatrix4(Sd.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qr).negate(),this.translate(Qr.x,Qr.y,Qr.z),this}setFromPoints(t){const i=this.getAttribute("position");if(i===void 0){const s=[];for(let l=0,c=t.length;l<c;l++){const f=t[l];s.push(f.x,f.y,f.z||0)}this.setAttribute("position",new _n(s,3))}else{const s=Math.min(t.length,i.count);for(let l=0;l<s;l++){const c=t[l];i.setXYZ(l,c.x,c.y,c.z||0)}t.length>i.count&&ue("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),i.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new As);const t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Pe("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Q(-1/0,-1/0,-1/0),new Q(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),i)for(let s=0,l=i.length;s<l;s++){const c=i[s];gi.setFromBufferAttribute(c),this.morphTargetsRelative?(An.addVectors(this.boundingBox.min,gi.min),this.boundingBox.expandByPoint(An),An.addVectors(this.boundingBox.max,gi.max),this.boundingBox.expandByPoint(An)):(this.boundingBox.expandByPoint(gi.min),this.boundingBox.expandByPoint(gi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Pe('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 po);const t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Pe("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Q,1/0);return}if(t){const s=this.boundingSphere.center;if(gi.setFromBufferAttribute(t),i)for(let c=0,f=i.length;c<f;c++){const d=i[c];fl.setFromBufferAttribute(d),this.morphTargetsRelative?(An.addVectors(gi.min,fl.min),gi.expandByPoint(An),An.addVectors(gi.max,fl.max),gi.expandByPoint(An)):(gi.expandByPoint(fl.min),gi.expandByPoint(fl.max))}gi.getCenter(s);let l=0;for(let c=0,f=t.count;c<f;c++)An.fromBufferAttribute(t,c),l=Math.max(l,s.distanceToSquared(An));if(i)for(let c=0,f=i.length;c<f;c++){const d=i[c],m=this.morphTargetsRelative;for(let p=0,v=d.count;p<v;p++)An.fromBufferAttribute(d,p),m&&(Qr.fromBufferAttribute(t,p),An.add(Qr)),l=Math.max(l,s.distanceToSquared(An))}this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&Pe('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,i=this.attributes;if(t===null||i.position===void 0||i.normal===void 0||i.uv===void 0){Pe("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=i.position,l=i.normal,c=i.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new xi(new Float32Array(4*s.count),4));const f=this.getAttribute("tangent"),d=[],m=[];for(let T=0;T<s.count;T++)d[T]=new Q,m[T]=new Q;const p=new Q,v=new Q,_=new Q,g=new _e,M=new _e,E=new _e,R=new Q,x=new Q;function y(T,U,et){p.fromBufferAttribute(s,T),v.fromBufferAttribute(s,U),_.fromBufferAttribute(s,et),g.fromBufferAttribute(c,T),M.fromBufferAttribute(c,U),E.fromBufferAttribute(c,et),v.sub(p),_.sub(p),M.sub(g),E.sub(g);const H=1/(M.x*E.y-E.x*M.y);isFinite(H)&&(R.copy(v).multiplyScalar(E.y).addScaledVector(_,-M.y).multiplyScalar(H),x.copy(_).multiplyScalar(M.x).addScaledVector(v,-E.x).multiplyScalar(H),d[T].add(R),d[U].add(R),d[et].add(R),m[T].add(x),m[U].add(x),m[et].add(x))}let w=this.groups;w.length===0&&(w=[{start:0,count:t.count}]);for(let T=0,U=w.length;T<U;++T){const et=w[T],H=et.start,q=et.count;for(let nt=H,ot=H+q;nt<ot;nt+=3)y(t.getX(nt+0),t.getX(nt+1),t.getX(nt+2))}const D=new Q,C=new Q,G=new Q,B=new Q;function F(T){G.fromBufferAttribute(l,T),B.copy(G);const U=d[T];D.copy(U),D.sub(G.multiplyScalar(G.dot(U))).normalize(),C.crossVectors(B,U);const H=C.dot(m[T])<0?-1:1;f.setXYZW(T,D.x,D.y,D.z,H)}for(let T=0,U=w.length;T<U;++T){const et=w[T],H=et.start,q=et.count;for(let nt=H,ot=H+q;nt<ot;nt+=3)F(t.getX(nt+0)),F(t.getX(nt+1)),F(t.getX(nt+2))}}computeVertexNormals(){const t=this.index,i=this.getAttribute("position");if(i!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new xi(new Float32Array(i.count*3),3),this.setAttribute("normal",s);else for(let g=0,M=s.count;g<M;g++)s.setXYZ(g,0,0,0);const l=new Q,c=new Q,f=new Q,d=new Q,m=new Q,p=new Q,v=new Q,_=new Q;if(t)for(let g=0,M=t.count;g<M;g+=3){const E=t.getX(g+0),R=t.getX(g+1),x=t.getX(g+2);l.fromBufferAttribute(i,E),c.fromBufferAttribute(i,R),f.fromBufferAttribute(i,x),v.subVectors(f,c),_.subVectors(l,c),v.cross(_),d.fromBufferAttribute(s,E),m.fromBufferAttribute(s,R),p.fromBufferAttribute(s,x),d.add(v),m.add(v),p.add(v),s.setXYZ(E,d.x,d.y,d.z),s.setXYZ(R,m.x,m.y,m.z),s.setXYZ(x,p.x,p.y,p.z)}else for(let g=0,M=i.count;g<M;g+=3)l.fromBufferAttribute(i,g+0),c.fromBufferAttribute(i,g+1),f.fromBufferAttribute(i,g+2),v.subVectors(f,c),_.subVectors(l,c),v.cross(_),s.setXYZ(g+0,v.x,v.y,v.z),s.setXYZ(g+1,v.x,v.y,v.z),s.setXYZ(g+2,v.x,v.y,v.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let i=0,s=t.count;i<s;i++)An.fromBufferAttribute(t,i),An.normalize(),t.setXYZ(i,An.x,An.y,An.z)}toNonIndexed(){function t(d,m){const p=d.array,v=d.itemSize,_=d.normalized,g=new p.constructor(m.length*v);let M=0,E=0;for(let R=0,x=m.length;R<x;R++){d.isInterleavedBufferAttribute?M=m[R]*d.data.stride+d.offset:M=m[R]*v;for(let y=0;y<v;y++)g[E++]=p[M++]}return new xi(g,v,_)}if(this.index===null)return ue("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const i=new Mn,s=this.index.array,l=this.attributes;for(const d in l){const m=l[d],p=t(m,s);i.setAttribute(d,p)}const c=this.morphAttributes;for(const d in c){const m=[],p=c[d];for(let v=0,_=p.length;v<_;v++){const g=p[v],M=t(g,s);m.push(M)}i.morphAttributes[d]=m}i.morphTargetsRelative=this.morphTargetsRelative;const f=this.groups;for(let d=0,m=f.length;d<m;d++){const p=f[d];i.addGroup(p.start,p.count,p.materialIndex)}return i}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const m=this.parameters;for(const p in m)m[p]!==void 0&&(t[p]=m[p]);return t}t.data={attributes:{}};const i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});const s=this.attributes;for(const m in s){const p=s[m];t.data.attributes[m]=p.toJSON(t.data)}const l={};let c=!1;for(const m in this.morphAttributes){const p=this.morphAttributes[m],v=[];for(let _=0,g=p.length;_<g;_++){const M=p[_];v.push(M.toJSON(t.data))}v.length>0&&(l[m]=v,c=!0)}c&&(t.data.morphAttributes=l,t.data.morphTargetsRelative=this.morphTargetsRelative);const f=this.groups;f.length>0&&(t.data.groups=JSON.parse(JSON.stringify(f)));const d=this.boundingSphere;return d!==null&&(t.data.boundingSphere=d.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={};this.name=t.name;const s=t.index;s!==null&&this.setIndex(s.clone());const l=t.attributes;for(const p in l){const v=l[p];this.setAttribute(p,v.clone(i))}const c=t.morphAttributes;for(const p in c){const v=[],_=c[p];for(let g=0,M=_.length;g<M;g++)v.push(_[g].clone(i));this.morphAttributes[p]=v}this.morphTargetsRelative=t.morphTargetsRelative;const f=t.groups;for(let p=0,v=f.length;p<v;p++){const _=f[p];this.addGroup(_.start,_.count,_.materialIndex)}const d=t.boundingBox;d!==null&&(this.boundingBox=d.clone());const m=t.boundingSphere;return m!==null&&(this.boundingSphere=m.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ab{constructor(t,i){this.isInterleavedBuffer=!0,this.array=t,this.stride=i,this.count=t!==void 0?t.length/i:0,this.usage=Dp,this.updateRanges=[],this.version=0,this.uuid=za()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,i,s){t*=this.stride,s*=i.stride;for(let l=0,c=this.stride;l<c;l++)this.array[t+l]=i.array[s+l];return this}set(t,i=0){return this.array.set(t,i),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=za()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const i=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),s=new this.constructor(i,this.stride);return s.setUsage(this.usage),s}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=za()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.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 jn=new Q;class Ms{constructor(t,i,s,l=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=i,this.offset=s,this.normalized=l}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let i=0,s=this.data.count;i<s;i++)jn.fromBufferAttribute(this,i),jn.applyMatrix4(t),this.setXYZ(i,jn.x,jn.y,jn.z);return this}applyNormalMatrix(t){for(let i=0,s=this.count;i<s;i++)jn.fromBufferAttribute(this,i),jn.applyNormalMatrix(t),this.setXYZ(i,jn.x,jn.y,jn.z);return this}transformDirection(t){for(let i=0,s=this.count;i<s;i++)jn.fromBufferAttribute(this,i),jn.transformDirection(t),this.setXYZ(i,jn.x,jn.y,jn.z);return this}getComponent(t,i){let s=this.array[t*this.data.stride+this.offset+i];return this.normalized&&(s=Xi(s,this.array)),s}setComponent(t,i,s){return this.normalized&&(s=Ve(s,this.array)),this.data.array[t*this.data.stride+this.offset+i]=s,this}setX(t,i){return this.normalized&&(i=Ve(i,this.array)),this.data.array[t*this.data.stride+this.offset]=i,this}setY(t,i){return this.normalized&&(i=Ve(i,this.array)),this.data.array[t*this.data.stride+this.offset+1]=i,this}setZ(t,i){return this.normalized&&(i=Ve(i,this.array)),this.data.array[t*this.data.stride+this.offset+2]=i,this}setW(t,i){return this.normalized&&(i=Ve(i,this.array)),this.data.array[t*this.data.stride+this.offset+3]=i,this}getX(t){let i=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(i=Xi(i,this.array)),i}getY(t){let i=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(i=Xi(i,this.array)),i}getZ(t){let i=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(i=Xi(i,this.array)),i}getW(t){let i=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(i=Xi(i,this.array)),i}setXY(t,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this}setXYZ(t,i,s,l){return t=t*this.data.stride+this.offset,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array),l=Ve(l,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this.data.array[t+2]=l,this}setXYZW(t,i,s,l,c){return t=t*this.data.stride+this.offset,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array),l=Ve(l,this.array),c=Ve(c,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this.data.array[t+2]=l,this.data.array[t+3]=c,this}clone(t){if(t===void 0){Nu("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const i=[];for(let s=0;s<this.count;s++){const l=s*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)i.push(this.data.array[l+c])}return new xi(new this.array.constructor(i),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Ms(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){Nu("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const i=[];for(let s=0;s<this.count;s++){const l=s*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)i.push(this.data.array[l+c])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:i,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let Rb=0;class mo extends ar{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Rb++}),this.uuid=za(),this.name="",this.type="Material",this.blending=so,this.side=Es,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Gd,this.blendDst=Vd,this.blendEquation=Qs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ee(0,0,0),this.blendAlpha=0,this.depthFunc=lo,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Y_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Gr,this.stencilZFail=Gr,this.stencilZPass=Gr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const i in t){const s=t[i];if(s===void 0){ue(`Material: parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ue(`Material: '${i}' is not a property of THREE.${this.type}.`);continue}l&&l.isColor?l.set(s):l&&l.isVector3&&s&&s.isVector3?l.copy(s):this[i]=s}}toJSON(t){const i=t===void 0||typeof t=="string";i&&(t={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(s.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(s.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(t).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(t).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(t).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(t).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(t).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==so&&(s.blending=this.blending),this.side!==Es&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==Gd&&(s.blendSrc=this.blendSrc),this.blendDst!==Vd&&(s.blendDst=this.blendDst),this.blendEquation!==Qs&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==lo&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Y_&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Gr&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Gr&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Gr&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.allowOverride===!1&&(s.allowOverride=!1),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function l(c){const f=[];for(const d in c){const m=c[d];delete m.metadata,f.push(m)}return f}if(i){const c=l(t.textures),f=l(t.images);c.length>0&&(s.textures=c),f.length>0&&(s.images=f)}return s}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const i=t.clippingPlanes;let s=null;if(i!==null){const l=i.length;s=new Array(l);for(let c=0;c!==l;++c)s[c]=i[c].clone()}return this.clippingPlanes=s,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}const Na=new Q,Md=new Q,qc=new Q,_s=new Q,bd=new Q,Yc=new Q,Ed=new Q;class Zp{constructor(t=new Q,i=new Q(0,0,-1)){this.origin=t,this.direction=i}set(t,i){return this.origin.copy(t),this.direction.copy(i),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,i){return i.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Na)),this}closestPointToPoint(t,i){i.subVectors(t,this.origin);const s=i.dot(this.direction);return s<0?i.copy(this.origin):i.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const i=Na.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(Na.copy(this.origin).addScaledVector(this.direction,i),Na.distanceToSquared(t))}distanceSqToSegment(t,i,s,l){Md.copy(t).add(i).multiplyScalar(.5),qc.copy(i).sub(t).normalize(),_s.copy(this.origin).sub(Md);const c=t.distanceTo(i)*.5,f=-this.direction.dot(qc),d=_s.dot(this.direction),m=-_s.dot(qc),p=_s.lengthSq(),v=Math.abs(1-f*f);let _,g,M,E;if(v>0)if(_=f*m-d,g=f*d-m,E=c*v,_>=0)if(g>=-E)if(g<=E){const R=1/v;_*=R,g*=R,M=_*(_+f*g+2*d)+g*(f*_+g+2*m)+p}else g=c,_=Math.max(0,-(f*g+d)),M=-_*_+g*(g+2*m)+p;else g=-c,_=Math.max(0,-(f*g+d)),M=-_*_+g*(g+2*m)+p;else g<=-E?(_=Math.max(0,-(-f*c+d)),g=_>0?-c:Math.min(Math.max(-c,-m),c),M=-_*_+g*(g+2*m)+p):g<=E?(_=0,g=Math.min(Math.max(-c,-m),c),M=g*(g+2*m)+p):(_=Math.max(0,-(f*c+d)),g=_>0?c:Math.min(Math.max(-c,-m),c),M=-_*_+g*(g+2*m)+p);else g=f>0?-c:c,_=Math.max(0,-(f*g+d)),M=-_*_+g*(g+2*m)+p;return s&&s.copy(this.origin).addScaledVector(this.direction,_),l&&l.copy(Md).addScaledVector(qc,g),M}intersectSphere(t,i){Na.subVectors(t.center,this.origin);const s=Na.dot(this.direction),l=Na.dot(Na)-s*s,c=t.radius*t.radius;if(l>c)return null;const f=Math.sqrt(c-l),d=s-f,m=s+f;return m<0?null:d<0?this.at(m,i):this.at(d,i)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const i=t.normal.dot(this.direction);if(i===0)return t.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(t.normal)+t.constant)/i;return s>=0?s:null}intersectPlane(t,i){const s=this.distanceToPlane(t);return s===null?null:this.at(s,i)}intersectsPlane(t){const i=t.distanceToPoint(this.origin);return i===0||t.normal.dot(this.direction)*i<0}intersectBox(t,i){let s,l,c,f,d,m;const p=1/this.direction.x,v=1/this.direction.y,_=1/this.direction.z,g=this.origin;return p>=0?(s=(t.min.x-g.x)*p,l=(t.max.x-g.x)*p):(s=(t.max.x-g.x)*p,l=(t.min.x-g.x)*p),v>=0?(c=(t.min.y-g.y)*v,f=(t.max.y-g.y)*v):(c=(t.max.y-g.y)*v,f=(t.min.y-g.y)*v),s>f||c>l||((c>s||isNaN(s))&&(s=c),(f<l||isNaN(l))&&(l=f),_>=0?(d=(t.min.z-g.z)*_,m=(t.max.z-g.z)*_):(d=(t.max.z-g.z)*_,m=(t.min.z-g.z)*_),s>m||d>l)||((d>s||s!==s)&&(s=d),(m<l||l!==l)&&(l=m),l<0)?null:this.at(s>=0?s:l,i)}intersectsBox(t){return this.intersectBox(t,Na)!==null}intersectTriangle(t,i,s,l,c){bd.subVectors(i,t),Yc.subVectors(s,t),Ed.crossVectors(bd,Yc);let f=this.direction.dot(Ed),d;if(f>0){if(l)return null;d=1}else if(f<0)d=-1,f=-f;else return null;_s.subVectors(this.origin,t);const m=d*this.direction.dot(Yc.crossVectors(_s,Yc));if(m<0)return null;const p=d*this.direction.dot(bd.cross(_s));if(p<0||m+p>f)return null;const v=-d*_s.dot(Ed);return v<0?null:this.at(v/f,c)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Pu extends mo{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ee(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ca,this.combine=Ip,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const lv=new nn,Ys=new Zp,jc=new po,cv=new Q,Zc=new Q,Kc=new Q,Qc=new Q,Td=new Q,Jc=new Q,uv=new Q,$c=new Q;class Gn extends zn{constructor(t=new Mn,i=new Pu){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,f=l.length;c<f;c++){const d=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=c}}}}getVertexPosition(t,i){const s=this.geometry,l=s.attributes.position,c=s.morphAttributes.position,f=s.morphTargetsRelative;i.fromBufferAttribute(l,t);const d=this.morphTargetInfluences;if(c&&d){Jc.set(0,0,0);for(let m=0,p=c.length;m<p;m++){const v=d[m],_=c[m];v!==0&&(Td.fromBufferAttribute(_,t),f?Jc.addScaledVector(Td,v):Jc.addScaledVector(Td.sub(i),v))}i.add(Jc)}return i}raycast(t,i){const s=this.geometry,l=this.material,c=this.matrixWorld;l!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),jc.copy(s.boundingSphere),jc.applyMatrix4(c),Ys.copy(t.ray).recast(t.near),!(jc.containsPoint(Ys.origin)===!1&&(Ys.intersectSphere(jc,cv)===null||Ys.origin.distanceToSquared(cv)>(t.far-t.near)**2))&&(lv.copy(c).invert(),Ys.copy(t.ray).applyMatrix4(lv),!(s.boundingBox!==null&&Ys.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,i,Ys)))}_computeIntersections(t,i,s){let l;const c=this.geometry,f=this.material,d=c.index,m=c.attributes.position,p=c.attributes.uv,v=c.attributes.uv1,_=c.attributes.normal,g=c.groups,M=c.drawRange;if(d!==null)if(Array.isArray(f))for(let E=0,R=g.length;E<R;E++){const x=g[E],y=f[x.materialIndex],w=Math.max(x.start,M.start),D=Math.min(d.count,Math.min(x.start+x.count,M.start+M.count));for(let C=w,G=D;C<G;C+=3){const B=d.getX(C),F=d.getX(C+1),T=d.getX(C+2);l=tu(this,y,t,s,p,v,_,B,F,T),l&&(l.faceIndex=Math.floor(C/3),l.face.materialIndex=x.materialIndex,i.push(l))}}else{const E=Math.max(0,M.start),R=Math.min(d.count,M.start+M.count);for(let x=E,y=R;x<y;x+=3){const w=d.getX(x),D=d.getX(x+1),C=d.getX(x+2);l=tu(this,f,t,s,p,v,_,w,D,C),l&&(l.faceIndex=Math.floor(x/3),i.push(l))}}else if(m!==void 0)if(Array.isArray(f))for(let E=0,R=g.length;E<R;E++){const x=g[E],y=f[x.materialIndex],w=Math.max(x.start,M.start),D=Math.min(m.count,Math.min(x.start+x.count,M.start+M.count));for(let C=w,G=D;C<G;C+=3){const B=C,F=C+1,T=C+2;l=tu(this,y,t,s,p,v,_,B,F,T),l&&(l.faceIndex=Math.floor(C/3),l.face.materialIndex=x.materialIndex,i.push(l))}}else{const E=Math.max(0,M.start),R=Math.min(m.count,M.start+M.count);for(let x=E,y=R;x<y;x+=3){const w=x,D=x+1,C=x+2;l=tu(this,f,t,s,p,v,_,w,D,C),l&&(l.faceIndex=Math.floor(x/3),i.push(l))}}}}function wb(a,t,i,s,l,c,f,d){let m;if(t.side===si?m=s.intersectTriangle(f,c,l,!0,d):m=s.intersectTriangle(l,c,f,t.side===Es,d),m===null)return null;$c.copy(d),$c.applyMatrix4(a.matrixWorld);const p=i.ray.origin.distanceTo($c);return p<i.near||p>i.far?null:{distance:p,point:$c.clone(),object:a}}function tu(a,t,i,s,l,c,f,d,m,p){a.getVertexPosition(d,Zc),a.getVertexPosition(m,Kc),a.getVertexPosition(p,Qc);const v=wb(a,t,i,s,Zc,Kc,Qc,uv);if(v){const _=new Q;Di.getBarycoord(uv,Zc,Kc,Qc,_),l&&(v.uv=Di.getInterpolatedAttribute(l,d,m,p,_,new _e)),c&&(v.uv1=Di.getInterpolatedAttribute(c,d,m,p,_,new _e)),f&&(v.normal=Di.getInterpolatedAttribute(f,d,m,p,_,new Q),v.normal.dot(s.direction)>0&&v.normal.multiplyScalar(-1));const g={a:d,b:m,c:p,normal:new Q,materialIndex:0};Di.getNormal(Zc,Kc,Qc,g.normal),v.face=g,v.barycoord=_}return v}class Cb extends Kn{constructor(t=null,i=1,s=1,l,c,f,d,m,p=Pn,v=Pn,_,g){super(null,f,d,m,p,v,l,c,_,g),this.isDataTexture=!0,this.image={data:t,width:i,height:s},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ad=new Q,Db=new Q,Ub=new Me;class xs{constructor(t=new Q(1,0,0),i=0){this.isPlane=!0,this.normal=t,this.constant=i}set(t,i){return this.normal.copy(t),this.constant=i,this}setComponents(t,i,s,l){return this.normal.set(t,i,s),this.constant=l,this}setFromNormalAndCoplanarPoint(t,i){return this.normal.copy(t),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(t,i,s){const l=Ad.subVectors(s,i).cross(Db.subVectors(t,i)).normalize();return this.setFromNormalAndCoplanarPoint(l,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,i){return i.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,i){const s=t.delta(Ad),l=this.normal.dot(s);if(l===0)return this.distanceToPoint(t.start)===0?i.copy(t.start):null;const c=-(t.start.dot(this.normal)+this.constant)/l;return c<0||c>1?null:i.copy(t.start).addScaledVector(s,c)}intersectsLine(t){const i=this.distanceToPoint(t.start),s=this.distanceToPoint(t.end);return i<0&&s>0||s<0&&i>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,i){const s=i||Ub.getNormalMatrix(t),l=this.coplanarPoint(Ad).applyMatrix4(t),c=this.normal.applyMatrix3(s).normalize();return this.constant=-l.dot(c),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const js=new po,Lb=new _e(.5,.5),eu=new Q;class Kp{constructor(t=new xs,i=new xs,s=new xs,l=new xs,c=new xs,f=new xs){this.planes=[t,i,s,l,c,f]}set(t,i,s,l,c,f){const d=this.planes;return d[0].copy(t),d[1].copy(i),d[2].copy(s),d[3].copy(l),d[4].copy(c),d[5].copy(f),this}copy(t){const i=this.planes;for(let s=0;s<6;s++)i[s].copy(t.planes[s]);return this}setFromProjectionMatrix(t,i=aa,s=!1){const l=this.planes,c=t.elements,f=c[0],d=c[1],m=c[2],p=c[3],v=c[4],_=c[5],g=c[6],M=c[7],E=c[8],R=c[9],x=c[10],y=c[11],w=c[12],D=c[13],C=c[14],G=c[15];if(l[0].setComponents(p-f,M-v,y-E,G-w).normalize(),l[1].setComponents(p+f,M+v,y+E,G+w).normalize(),l[2].setComponents(p+d,M+_,y+R,G+D).normalize(),l[3].setComponents(p-d,M-_,y-R,G-D).normalize(),s)l[4].setComponents(m,g,x,C).normalize(),l[5].setComponents(p-m,M-g,y-x,G-C).normalize();else if(l[4].setComponents(p-m,M-g,y-x,G-C).normalize(),i===aa)l[5].setComponents(p+m,M+g,y+x,G+C).normalize();else if(i===Sl)l[5].setComponents(m,g,x,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+i);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),js.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const i=t.geometry;i.boundingSphere===null&&i.computeBoundingSphere(),js.copy(i.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(js)}intersectsSprite(t){js.center.set(0,0,0);const i=Lb.distanceTo(t.center);return js.radius=.7071067811865476+i,js.applyMatrix4(t.matrixWorld),this.intersectsSphere(js)}intersectsSphere(t){const i=this.planes,s=t.center,l=-t.radius;for(let c=0;c<6;c++)if(i[c].distanceToPoint(s)<l)return!1;return!0}intersectsBox(t){const i=this.planes;for(let s=0;s<6;s++){const l=i[s];if(eu.x=l.normal.x>0?t.max.x:t.min.x,eu.y=l.normal.y>0?t.max.y:t.min.y,eu.z=l.normal.z>0?t.max.z:t.min.z,l.distanceToPoint(eu)<0)return!1}return!0}containsPoint(t){const i=this.planes;for(let s=0;s<6;s++)if(i[s].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Ss extends mo{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ee(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const zu=new Q,Fu=new Q,fv=new nn,hl=new Zp,nu=new po,Rd=new Q,hv=new Q;class Iu extends zn{constructor(t=new Mn,i=new Ss){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const i=t.attributes.position,s=[0];for(let l=1,c=i.count;l<c;l++)zu.fromBufferAttribute(i,l-1),Fu.fromBufferAttribute(i,l),s[l]=s[l-1],s[l]+=zu.distanceTo(Fu);t.setAttribute("lineDistance",new _n(s,1))}else ue("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,i){const s=this.geometry,l=this.matrixWorld,c=t.params.Line.threshold,f=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),nu.copy(s.boundingSphere),nu.applyMatrix4(l),nu.radius+=c,t.ray.intersectsSphere(nu)===!1)return;fv.copy(l).invert(),hl.copy(t.ray).applyMatrix4(fv);const d=c/((this.scale.x+this.scale.y+this.scale.z)/3),m=d*d,p=this.isLineSegments?2:1,v=s.index,g=s.attributes.position;if(v!==null){const M=Math.max(0,f.start),E=Math.min(v.count,f.start+f.count);for(let R=M,x=E-1;R<x;R+=p){const y=v.getX(R),w=v.getX(R+1),D=iu(this,t,hl,m,y,w,R);D&&i.push(D)}if(this.isLineLoop){const R=v.getX(E-1),x=v.getX(M),y=iu(this,t,hl,m,R,x,E-1);y&&i.push(y)}}else{const M=Math.max(0,f.start),E=Math.min(g.count,f.start+f.count);for(let R=M,x=E-1;R<x;R+=p){const y=iu(this,t,hl,m,R,R+1,R);y&&i.push(y)}if(this.isLineLoop){const R=iu(this,t,hl,m,E-1,M,E-1);R&&i.push(R)}}}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,f=l.length;c<f;c++){const d=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=c}}}}}function iu(a,t,i,s,l,c,f){const d=a.geometry.attributes.position;if(zu.fromBufferAttribute(d,l),Fu.fromBufferAttribute(d,c),i.distanceSqToSegment(zu,Fu,Rd,hv)>s)return;Rd.applyMatrix4(a.matrixWorld);const p=t.ray.origin.distanceTo(Rd);if(!(p<t.near||p>t.far))return{distance:p,point:hv.clone().applyMatrix4(a.matrixWorld),index:f,face:null,faceIndex:null,barycoord:null,object:a}}const dv=new Q,pv=new Q;class dl extends Iu{constructor(t,i){super(t,i),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const i=t.attributes.position,s=[];for(let l=0,c=i.count;l<c;l+=2)dv.fromBufferAttribute(i,l),pv.fromBufferAttribute(i,l+1),s[l]=l===0?0:s[l-1],s[l+1]=s[l]+dv.distanceTo(pv);t.setAttribute("lineDistance",new _n(s,1))}else ue("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Nx extends Kn{constructor(t=[],i=nr,s,l,c,f,d,m,p,v){super(t,i,s,l,c,f,d,m,p,v),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class bl extends Kn{constructor(t,i,s=la,l,c,f,d=Pn,m=Pn,p,v=Ba,_=1){if(v!==Ba&&v!==tr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const g={width:t,height:i,depth:_};super(g,l,c,f,d,m,v,s,p),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new jp(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const i=super.toJSON(t);return this.compareFunction!==null&&(i.compareFunction=this.compareFunction),i}}class Nb extends bl{constructor(t,i=la,s=nr,l,c,f=Pn,d=Pn,m,p=Ba){const v={width:t,height:t,depth:1},_=[v,v,v,v,v,v];super(t,t,i,s,l,c,f,d,m,p),this.image=_,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class Ox extends Kn{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class ir extends Mn{constructor(t=1,i=1,s=1,l=1,c=1,f=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:s,widthSegments:l,heightSegments:c,depthSegments:f};const d=this;l=Math.floor(l),c=Math.floor(c),f=Math.floor(f);const m=[],p=[],v=[],_=[];let g=0,M=0;E("z","y","x",-1,-1,s,i,t,f,c,0),E("z","y","x",1,-1,s,i,-t,f,c,1),E("x","z","y",1,1,t,s,i,l,f,2),E("x","z","y",1,-1,t,s,-i,l,f,3),E("x","y","z",1,-1,t,i,s,l,c,4),E("x","y","z",-1,-1,t,i,-s,l,c,5),this.setIndex(m),this.setAttribute("position",new _n(p,3)),this.setAttribute("normal",new _n(v,3)),this.setAttribute("uv",new _n(_,2));function E(R,x,y,w,D,C,G,B,F,T,U){const et=C/F,H=G/T,q=C/2,nt=G/2,ot=B/2,Y=F+1,z=T+1;let A=0,ht=0;const lt=new Q;for(let Ct=0;Ct<z;Ct++){const I=Ct*H-nt;for(let K=0;K<Y;K++){const Mt=K*et-q;lt[R]=Mt*w,lt[x]=I*D,lt[y]=ot,p.push(lt.x,lt.y,lt.z),lt[R]=0,lt[x]=0,lt[y]=B>0?1:-1,v.push(lt.x,lt.y,lt.z),_.push(K/F),_.push(1-Ct/T),A+=1}}for(let Ct=0;Ct<T;Ct++)for(let I=0;I<F;I++){const K=g+I+Y*Ct,Mt=g+I+Y*(Ct+1),wt=g+(I+1)+Y*(Ct+1),Bt=g+(I+1)+Y*Ct;m.push(K,Mt,Bt),m.push(Mt,wt,Bt),ht+=6}d.addGroup(M,ht,U),M+=ht,g+=A}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ir(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}const au=new Q,su=new Q,wd=new Q,ru=new Di;class mv extends Mn{constructor(t=null,i=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:i},t!==null){const l=Math.pow(10,4),c=Math.cos(ro*i),f=t.getIndex(),d=t.getAttribute("position"),m=f?f.count:d.count,p=[0,0,0],v=["a","b","c"],_=new Array(3),g={},M=[];for(let E=0;E<m;E+=3){f?(p[0]=f.getX(E),p[1]=f.getX(E+1),p[2]=f.getX(E+2)):(p[0]=E,p[1]=E+1,p[2]=E+2);const{a:R,b:x,c:y}=ru;if(R.fromBufferAttribute(d,p[0]),x.fromBufferAttribute(d,p[1]),y.fromBufferAttribute(d,p[2]),ru.getNormal(wd),_[0]=`${Math.round(R.x*l)},${Math.round(R.y*l)},${Math.round(R.z*l)}`,_[1]=`${Math.round(x.x*l)},${Math.round(x.y*l)},${Math.round(x.z*l)}`,_[2]=`${Math.round(y.x*l)},${Math.round(y.y*l)},${Math.round(y.z*l)}`,!(_[0]===_[1]||_[1]===_[2]||_[2]===_[0]))for(let w=0;w<3;w++){const D=(w+1)%3,C=_[w],G=_[D],B=ru[v[w]],F=ru[v[D]],T=`${C}_${G}`,U=`${G}_${C}`;U in g&&g[U]?(wd.dot(g[U].normal)<=c&&(M.push(B.x,B.y,B.z),M.push(F.x,F.y,F.z)),g[U]=null):T in g||(g[T]={index0:p[w],index1:p[D],normal:wd.clone()})}}for(const E in g)if(g[E]){const{index0:R,index1:x}=g[E];au.fromBufferAttribute(d,R),su.fromBufferAttribute(d,x),M.push(au.x,au.y,au.z),M.push(su.x,su.y,su.z)}this.setAttribute("position",new _n(M,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class Gu extends Mn{constructor(t=1,i=1,s=1,l=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:i,widthSegments:s,heightSegments:l};const c=t/2,f=i/2,d=Math.floor(s),m=Math.floor(l),p=d+1,v=m+1,_=t/d,g=i/m,M=[],E=[],R=[],x=[];for(let y=0;y<v;y++){const w=y*g-f;for(let D=0;D<p;D++){const C=D*_-c;E.push(C,-w,0),R.push(0,0,1),x.push(D/d),x.push(1-y/m)}}for(let y=0;y<m;y++)for(let w=0;w<d;w++){const D=w+p*y,C=w+p*(y+1),G=w+1+p*(y+1),B=w+1+p*y;M.push(D,C,B),M.push(C,G,B)}this.setIndex(M),this.setAttribute("position",new _n(E,3)),this.setAttribute("normal",new _n(R,3)),this.setAttribute("uv",new _n(x,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Gu(t.width,t.height,t.widthSegments,t.heightSegments)}}class Bu extends Mn{constructor(t=1,i=32,s=16,l=0,c=Math.PI*2,f=0,d=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:i,heightSegments:s,phiStart:l,phiLength:c,thetaStart:f,thetaLength:d},i=Math.max(3,Math.floor(i)),s=Math.max(2,Math.floor(s));const m=Math.min(f+d,Math.PI);let p=0;const v=[],_=new Q,g=new Q,M=[],E=[],R=[],x=[];for(let y=0;y<=s;y++){const w=[],D=y/s;let C=0;y===0&&f===0?C=.5/i:y===s&&m===Math.PI&&(C=-.5/i);for(let G=0;G<=i;G++){const B=G/i;_.x=-t*Math.cos(l+B*c)*Math.sin(f+D*d),_.y=t*Math.cos(f+D*d),_.z=t*Math.sin(l+B*c)*Math.sin(f+D*d),E.push(_.x,_.y,_.z),g.copy(_).normalize(),R.push(g.x,g.y,g.z),x.push(B+C,1-D),w.push(p++)}v.push(w)}for(let y=0;y<s;y++)for(let w=0;w<i;w++){const D=v[y][w+1],C=v[y][w],G=v[y+1][w],B=v[y+1][w+1];(y!==0||f>0)&&M.push(D,C,B),(y!==s-1||m<Math.PI)&&M.push(C,G,B)}this.setIndex(M),this.setAttribute("position",new _n(E,3)),this.setAttribute("normal",new _n(R,3)),this.setAttribute("uv",new _n(x,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Bu(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Ob extends Mn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const i=[],s=new Set,l=new Q,c=new Q;if(t.index!==null){const f=t.attributes.position,d=t.index;let m=t.groups;m.length===0&&(m=[{start:0,count:d.count,materialIndex:0}]);for(let p=0,v=m.length;p<v;++p){const _=m[p],g=_.start,M=_.count;for(let E=g,R=g+M;E<R;E+=3)for(let x=0;x<3;x++){const y=d.getX(E+x),w=d.getX(E+(x+1)%3);l.fromBufferAttribute(f,y),c.fromBufferAttribute(f,w),gv(l,c,s)===!0&&(i.push(l.x,l.y,l.z),i.push(c.x,c.y,c.z))}}}else{const f=t.attributes.position;for(let d=0,m=f.count/3;d<m;d++)for(let p=0;p<3;p++){const v=3*d+p,_=3*d+(p+1)%3;l.fromBufferAttribute(f,v),c.fromBufferAttribute(f,_),gv(l,c,s)===!0&&(i.push(l.x,l.y,l.z),i.push(c.x,c.y,c.z))}}this.setAttribute("position",new _n(i,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function gv(a,t,i){const s=`${a.x},${a.y},${a.z}-${t.x},${t.y},${t.z}`,l=`${t.x},${t.y},${t.z}-${a.x},${a.y},${a.z}`;return i.has(s)===!0||i.has(l)===!0?!1:(i.add(s),i.add(l),!0)}function ho(a){const t={};for(const i in a){t[i]={};for(const s in a[i]){const l=a[i][s];l&&(l.isColor||l.isMatrix3||l.isMatrix4||l.isVector2||l.isVector3||l.isVector4||l.isTexture||l.isQuaternion)?l.isRenderTargetTexture?(ue("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][s]=null):t[i][s]=l.clone():Array.isArray(l)?t[i][s]=l.slice():t[i][s]=l}}return t}function Zn(a){const t={};for(let i=0;i<a.length;i++){const s=ho(a[i]);for(const l in s)t[l]=s[l]}return t}function Pb(a){const t=[];for(let i=0;i<a.length;i++)t.push(a[i].clone());return t}function Px(a){const t=a.getRenderTarget();return t===null?a.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Ue.workingColorSpace}const Qp={clone:ho,merge:Zn};var zb=`void main() {
|
|
8
|
+
`+o.stack}}var ce=Object.prototype.hasOwnProperty,Jt=a.unstable_scheduleCallback,ne=a.unstable_cancelCallback,Pt=a.unstable_shouldYield,O=a.unstable_requestPaint,E=a.unstable_now,V=a.unstable_getCurrentPriorityLevel,$=a.unstable_ImmediatePriority,k=a.unstable_UserBlockingPriority,P=a.unstable_NormalPriority,it=a.unstable_LowPriority,rt=a.unstable_IdlePriority,_t=a.log,At=a.unstable_setDisableYieldValue,xt=null,St=null;function Nt(e){if(typeof _t=="function"&&At(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(xt,e)}catch{}}var Lt=Math.clz32?Math.clz32:j,It=Math.log,$t=Math.LN2;function j(e){return e>>>=0,e===0?32:31-(It(e)/$t|0)|0}var zt=256,Ft=262144,kt=4194304;function Ot(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bt(e,n,r){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,M=e.pingedLanes;e=e.warmLanes;var L=o&134217727;return L!==0?(o=L&~h,o!==0?u=Ot(o):(M&=L,M!==0?u=Ot(M):r||(r=L&~e,r!==0&&(u=Ot(r))))):(L=o&~h,L!==0?u=Ot(L):M!==0?u=Ot(M):r||(r=o&~e,r!==0&&(u=Ot(r)))),u===0?0:n!==0&&n!==u&&(n&h)===0&&(h=u&-u,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:u}function jt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function he(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var e=kt;return kt<<=1,(kt&62914560)===0&&(kt=4194304),e}function De(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function kn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ui(e,n,r,o,u,h){var M=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var L=e.entanglements,W=e.expirationTimes,dt=e.hiddenUpdates;for(r=M&~r;0<r;){var Tt=31-Lt(r),Dt=1<<Tt;L[Tt]=0,W[Tt]=-1;var mt=dt[Tt];if(mt!==null)for(dt[Tt]=null,Tt=0;Tt<mt.length;Tt++){var yt=mt[Tt];yt!==null&&(yt.lane&=-536870913)}r&=~Dt}o!==0&&_o(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(M&~n))}function _o(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-Lt(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|r&261930}function sr(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var o=31-Lt(r),u=1<<o;u&n|e[o]&n&&(e[o]|=n),r&=~u}}function El(e,n){var r=n&-n;return r=(r&42)!==0?1:rr(r),(r&(e.suspendedLanes|n))!==0?0:r}function rr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function or(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yi(){var e=A.p;return e!==0?e:(e=window.event,e===void 0?32:A_(e.type))}function lr(e,n){var r=A.p;try{return A.p=e,n()}finally{A.p=r}}var Li=Math.random().toString(36).slice(2),cn="__reactFiber$"+Li,vn="__reactProps$"+Li,ua="__reactContainer$"+Li,Ga="__reactEvents$"+Li,Tl="__reactListeners$"+Li,Al="__reactHandles$"+Li,Rl="__reactResources$"+Li,Rs="__reactMarker$"+Li;function vo(e){delete e[cn],delete e[vn],delete e[Ga],delete e[Tl],delete e[Al]}function Va(e){var n=e[cn];if(n)return n;for(var r=e.parentNode;r;){if(n=r[ua]||r[cn]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=u_(e);e!==null;){if(r=e[cn])return r;e=u_(e)}return n}e=r,r=e.parentNode}return null}function ka(e){if(e=e[cn]||e[ua]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function ws(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(s(33))}function N(e){var n=e[Rl];return n||(n=e[Rl]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function J(e){e[Rs]=!0}var vt=new Set,pt={};function ut(e,n){Ht(e,n),Ht(e+"Capture",n)}function Ht(e,n){for(pt[e]=n,e=0;e<n.length;e++)vt.add(n[e])}var Wt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Vt={},ee={};function ae(e){return ce.call(ee,e)?!0:ce.call(Vt,e)?!1:Wt.test(e)?ee[e]=!0:(Vt[e]=!0,!1)}function fe(e,n,r){if(ae(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function me(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function Kt(e,n,r,o){if(o===null)e.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+o)}}function ye(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Je(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function $e(e,n,r){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(M){r=""+M,h.call(this,M)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return r},setValue:function(M){r=""+M},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Le(e){if(!e._valueTracker){var n=Je(e)?"checked":"value";e._valueTracker=$e(e,n,""+e[n])}}function xn(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),o="";return e&&(o=Je(e)?e.checked?"true":"false":e.value),e=o,e!==r?(n.setValue(e),!0):!1}function te(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Xn=/[\n"\\]/g;function pe(e){return e.replace(Xn,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Wn(e,n,r,o,u,h,M,L){e.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?e.type=M:e.removeAttribute("type"),n!=null?M==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+ye(n)):e.value!==""+ye(n)&&(e.value=""+ye(n)):M!=="submit"&&M!=="reset"||e.removeAttribute("value"),n!=null?Ni(e,M,ye(n)):r!=null?Ni(e,M,ye(r)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.name=""+ye(L):e.removeAttribute("name")}function ri(e,n,r,o,u,h,M,L){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Le(e);return}r=r!=null?""+ye(r):"",n=n!=null?""+ye(n):r,L||n===e.value||(e.value=n),e.defaultValue=n}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=L?e.checked:!!o,e.defaultChecked=!!o,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(e.name=M),Le(e)}function Ni(e,n,r){n==="number"&&te(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function oi(e,n,r,o){if(e=e.options,n){n={};for(var u=0;u<r.length;u++)n["$"+r[u]]=!0;for(r=0;r<e.length;r++)u=n.hasOwnProperty("$"+e[r].value),e[r].selected!==u&&(e[r].selected=u),u&&o&&(e[r].defaultSelected=!0)}else{for(r=""+ye(r),n=null,u=0;u<e.length;u++){if(e[u].value===r){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function Fe(e,n,r){if(n!=null&&(n=""+ye(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+ye(r):""}function un(e,n,r,o){if(n==null){if(o!=null){if(r!=null)throw Error(s(92));if(Y(o)){if(1<o.length)throw Error(s(93));o=o[0]}r=o}r==null&&(r=""),n=r}r=ye(n),e.defaultValue=r,o=e.textContent,o===r&&o!==""&&o!==null&&(e.value=o),Le(e)}function qn(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var fn=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Oi(e,n,r){var o=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,r):typeof r!="number"||r===0||fn.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function fa(e,n,r){if(n!=null&&typeof n!="object")throw Error(s(62));if(e=e.style,r!=null){for(var o in r)!r.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in n)o=n[u],n.hasOwnProperty(u)&&r[u]!==o&&Oi(e,u,o)}else for(var h in n)n.hasOwnProperty(h)&&Oi(e,h,n[h])}function cr(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Jx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$x=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wl(e){return $x.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ha(){}var qu=null;function Yu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ur=null,fr=null;function em(e){var n=ka(e);if(n&&(e=n.stateNode)){var r=e[vn]||null;t:switch(e=n.stateNode,n.type){case"input":if(Wn(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+pe(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var o=r[n];if(o!==e&&o.form===e.form){var u=o[vn]||null;if(!u)throw Error(s(90));Wn(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<r.length;n++)o=r[n],o.form===e.form&&xn(o)}break t;case"textarea":Fe(e,r.value,r.defaultValue);break t;case"select":n=r.value,n!=null&&oi(e,!!r.multiple,n,!1)}}}var ju=!1;function nm(e,n,r){if(ju)return e(n,r);ju=!0;try{var o=e(n);return o}finally{if(ju=!1,(ur!==null||fr!==null)&&(mc(),ur&&(n=ur,e=fr,fr=ur=null,em(n),e)))for(n=0;n<e.length;n++)em(e[n])}}function xo(e,n){var r=e.stateNode;if(r===null)return null;var o=r[vn]||null;if(o===null)return null;r=o[n];t:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break t;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(s(231,n,typeof r));return r}var da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zu=!1;if(da)try{var yo={};Object.defineProperty(yo,"passive",{get:function(){Zu=!0}}),window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{Zu=!1}var Xa=null,Ku=null,Cl=null;function im(){if(Cl)return Cl;var e,n=Ku,r=n.length,o,u="value"in Xa?Xa.value:Xa.textContent,h=u.length;for(e=0;e<r&&n[e]===u[e];e++);var M=r-e;for(o=1;o<=M&&n[r-o]===u[h-o];o++);return Cl=u.slice(e,1<o?1-o:void 0)}function Dl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ul(){return!0}function am(){return!1}function Qn(e){function n(r,o,u,h,M){this._reactName=r,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=M,this.currentTarget=null;for(var L in e)e.hasOwnProperty(L)&&(r=e[L],this[L]=r?r(h):h[L]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ul:am,this.isPropagationStopped=am,this}return _(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ul)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ul)},persist:function(){},isPersistent:Ul}),n}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=Qn(Cs),So=_({},Cs,{view:0,detail:0}),ty=Qn(So),Qu,Ju,Mo,Nl=_({},So,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Mo&&(Mo&&e.type==="mousemove"?(Qu=e.screenX-Mo.screenX,Ju=e.screenY-Mo.screenY):Ju=Qu=0,Mo=e),Qu)},movementY:function(e){return"movementY"in e?e.movementY:Ju}}),sm=Qn(Nl),ey=_({},Nl,{dataTransfer:0}),ny=Qn(ey),iy=_({},So,{relatedTarget:0}),$u=Qn(iy),ay=_({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),sy=Qn(ay),ry=_({},Cs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oy=Qn(ry),ly=_({},Cs,{data:0}),rm=Qn(ly),cy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uy={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"},fy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hy(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=fy[e])?!!n[e]:!1}function tf(){return hy}var dy=_({},So,{key:function(e){if(e.key){var n=cy[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?uy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tf,charCode:function(e){return e.type==="keypress"?Dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),py=Qn(dy),my=_({},Nl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),om=Qn(my),gy=_({},So,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tf}),_y=Qn(gy),vy=_({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),xy=Qn(vy),yy=_({},Nl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Sy=Qn(yy),My=_({},Cs,{newState:0,oldState:0}),by=Qn(My),Ey=[9,13,27,32],ef=da&&"CompositionEvent"in window,bo=null;da&&"documentMode"in document&&(bo=document.documentMode);var Ty=da&&"TextEvent"in window&&!bo,lm=da&&(!ef||bo&&8<bo&&11>=bo),cm=" ",um=!1;function fm(e,n){switch(e){case"keyup":return Ey.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var hr=!1;function Ay(e,n){switch(e){case"compositionend":return hm(n);case"keypress":return n.which!==32?null:(um=!0,cm);case"textInput":return e=n.data,e===cm&&um?null:e;default:return null}}function Ry(e,n){if(hr)return e==="compositionend"||!ef&&fm(e,n)?(e=im(),Cl=Ku=Xa=null,hr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return lm&&n.locale!=="ko"?null:n.data;default:return null}}var wy={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 dm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!wy[e.type]:n==="textarea"}function pm(e,n,r,o){ur?fr?fr.push(o):fr=[o]:ur=o,n=Mc(n,"onChange"),0<n.length&&(r=new Ll("onChange","change",null,r,o),e.push({event:r,listeners:n}))}var Eo=null,To=null;function Cy(e){K0(e,0)}function Ol(e){var n=ws(e);if(xn(n))return e}function mm(e,n){if(e==="change")return n}var gm=!1;if(da){var nf;if(da){var af="oninput"in document;if(!af){var _m=document.createElement("div");_m.setAttribute("oninput","return;"),af=typeof _m.oninput=="function"}nf=af}else nf=!1;gm=nf&&(!document.documentMode||9<document.documentMode)}function vm(){Eo&&(Eo.detachEvent("onpropertychange",xm),To=Eo=null)}function xm(e){if(e.propertyName==="value"&&Ol(To)){var n=[];pm(n,To,e,Yu(e)),nm(Cy,n)}}function Dy(e,n,r){e==="focusin"?(vm(),Eo=n,To=r,Eo.attachEvent("onpropertychange",xm)):e==="focusout"&&vm()}function Uy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ol(To)}function Ly(e,n){if(e==="click")return Ol(n)}function Ny(e,n){if(e==="input"||e==="change")return Ol(n)}function Oy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var li=typeof Object.is=="function"?Object.is:Oy;function Ao(e,n){if(li(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),o=Object.keys(n);if(r.length!==o.length)return!1;for(o=0;o<r.length;o++){var u=r[o];if(!ce.call(n,u)||!li(e[u],n[u]))return!1}return!0}function ym(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sm(e,n){var r=ym(e);e=0;for(var o;r;){if(r.nodeType===3){if(o=e+r.textContent.length,e<=n&&o>=n)return{node:r,offset:n-e};e=o}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=ym(r)}}function Mm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Mm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function bm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=te(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=te(e.document)}return n}function sf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var Py=da&&"documentMode"in document&&11>=document.documentMode,dr=null,rf=null,Ro=null,of=!1;function Em(e,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;of||dr==null||dr!==te(o)||(o=dr,"selectionStart"in o&&sf(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ro&&Ao(Ro,o)||(Ro=o,o=Mc(rf,"onSelect"),0<o.length&&(n=new Ll("onSelect","select",null,n,r),e.push({event:n,listeners:o}),n.target=dr)))}function Ds(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var pr={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionrun:Ds("Transition","TransitionRun"),transitionstart:Ds("Transition","TransitionStart"),transitioncancel:Ds("Transition","TransitionCancel"),transitionend:Ds("Transition","TransitionEnd")},lf={},Tm={};da&&(Tm=document.createElement("div").style,"AnimationEvent"in window||(delete pr.animationend.animation,delete pr.animationiteration.animation,delete pr.animationstart.animation),"TransitionEvent"in window||delete pr.transitionend.transition);function Us(e){if(lf[e])return lf[e];if(!pr[e])return e;var n=pr[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Tm)return lf[e]=n[r];return e}var Am=Us("animationend"),Rm=Us("animationiteration"),wm=Us("animationstart"),zy=Us("transitionrun"),Fy=Us("transitionstart"),Iy=Us("transitioncancel"),Cm=Us("transitionend"),Dm=new Map,cf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");cf.push("scrollEnd");function Pi(e,n){Dm.set(e,n),ut(n,[e])}var Pl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},yi=[],mr=0,uf=0;function zl(){for(var e=mr,n=uf=mr=0;n<e;){var r=yi[n];yi[n++]=null;var o=yi[n];yi[n++]=null;var u=yi[n];yi[n++]=null;var h=yi[n];if(yi[n++]=null,o!==null&&u!==null){var M=o.pending;M===null?u.next=u:(u.next=M.next,M.next=u),o.pending=u}h!==0&&Um(r,u,h)}}function Fl(e,n,r,o){yi[mr++]=e,yi[mr++]=n,yi[mr++]=r,yi[mr++]=o,uf|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function ff(e,n,r,o){return Fl(e,n,r,o),Il(e)}function Ls(e,n){return Fl(e,null,null,n),Il(e)}function Um(e,n,r){e.lanes|=r;var o=e.alternate;o!==null&&(o.lanes|=r);for(var u=!1,h=e.return;h!==null;)h.childLanes|=r,o=h.alternate,o!==null&&(o.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&n!==null&&(u=31-Lt(r),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[n]:o.push(n),n.lane=r|536870912),h):null}function Il(e){if(50<Zo)throw Zo=0,yh=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var gr={};function By(e,n,r,o){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,n,r,o){return new By(e,n,r,o)}function hf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pa(e,n){var r=e.alternate;return r===null?(r=ci(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Lm(e,n){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Bl(e,n,r,o,u,h){var M=0;if(o=e,typeof e=="function")hf(e)&&(M=1);else if(typeof e=="string")M=XS(e,r,wt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case U:return e=ci(31,r,n,u),e.elementType=U,e.lanes=h,e;case R:return Ns(r.children,u,h,n);case x:M=8,u|=24;break;case y:return e=ci(12,r,n,u|2),e.elementType=y,e.lanes=h,e;case G:return e=ci(13,r,n,u),e.elementType=G,e.lanes=h,e;case B:return e=ci(19,r,n,u),e.elementType=B,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:M=10;break t;case w:M=9;break t;case C:M=11;break t;case F:M=14;break t;case T:M=16,o=null;break t}M=29,r=Error(s(130,e===null?"null":typeof e,"")),o=null}return n=ci(M,r,n,u),n.elementType=e,n.type=o,n.lanes=h,n}function Ns(e,n,r,o){return e=ci(7,e,o,n),e.lanes=r,e}function df(e,n,r){return e=ci(6,e,null,n),e.lanes=r,e}function Nm(e){var n=ci(18,null,null,0);return n.stateNode=e,n}function pf(e,n,r){return n=ci(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Om=new WeakMap;function Si(e,n){if(typeof e=="object"&&e!==null){var r=Om.get(e);return r!==void 0?r:(n={value:e,source:n,stack:X(n)},Om.set(e,n),n)}return{value:e,source:n,stack:X(n)}}var _r=[],vr=0,Hl=null,wo=0,Mi=[],bi=0,Wa=null,ji=1,Zi="";function ma(e,n){_r[vr++]=wo,_r[vr++]=Hl,Hl=e,wo=n}function Pm(e,n,r){Mi[bi++]=ji,Mi[bi++]=Zi,Mi[bi++]=Wa,Wa=e;var o=ji;e=Zi;var u=32-Lt(o)-1;o&=~(1<<u),r+=1;var h=32-Lt(n)+u;if(30<h){var M=u-u%5;h=(o&(1<<M)-1).toString(32),o>>=M,u-=M,ji=1<<32-Lt(n)+u|r<<u|o,Zi=h+e}else ji=1<<h|r<<u|o,Zi=e}function mf(e){e.return!==null&&(ma(e,1),Pm(e,1,0))}function gf(e){for(;e===Hl;)Hl=_r[--vr],_r[vr]=null,wo=_r[--vr],_r[vr]=null;for(;e===Wa;)Wa=Mi[--bi],Mi[bi]=null,Zi=Mi[--bi],Mi[bi]=null,ji=Mi[--bi],Mi[bi]=null}function zm(e,n){Mi[bi++]=ji,Mi[bi++]=Zi,Mi[bi++]=Wa,ji=n.id,Zi=n.overflow,Wa=e}var wn=null,Ke=null,Ce=!1,qa=null,Ei=!1,_f=Error(s(519));function Ya(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Co(Si(n,e)),_f}function Fm(e){var n=e.stateNode,r=e.type,o=e.memoizedProps;switch(n[cn]=e,n[vn]=o,r){case"dialog":Ae("cancel",n),Ae("close",n);break;case"iframe":case"object":case"embed":Ae("load",n);break;case"video":case"audio":for(r=0;r<Qo.length;r++)Ae(Qo[r],n);break;case"source":Ae("error",n);break;case"img":case"image":case"link":Ae("error",n),Ae("load",n);break;case"details":Ae("toggle",n);break;case"input":Ae("invalid",n),ri(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ae("invalid",n);break;case"textarea":Ae("invalid",n),un(n,o.value,o.defaultValue,o.children)}r=o.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||o.suppressHydrationWarning===!0||t_(n.textContent,r)?(o.popover!=null&&(Ae("beforetoggle",n),Ae("toggle",n)),o.onScroll!=null&&Ae("scroll",n),o.onScrollEnd!=null&&Ae("scrollend",n),o.onClick!=null&&(n.onclick=ha),n=!0):n=!1,n||Ya(e,!0)}function Im(e){for(wn=e.return;wn;)switch(wn.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:wn=wn.return}}function xr(e){if(e!==wn)return!1;if(!Ce)return Im(e),Ce=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Ph(e.type,e.memoizedProps)),r=!r),r&&Ke&&Ya(e),Im(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ke=c_(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ke=c_(e)}else n===27?(n=Ke,os(e.type)?(e=Hh,Hh=null,Ke=e):Ke=n):Ke=wn?Ai(e.stateNode.nextSibling):null;return!0}function Os(){Ke=wn=null,Ce=!1}function vf(){var e=qa;return e!==null&&(ei===null?ei=e:ei.push.apply(ei,e),qa=null),e}function Co(e){qa===null?qa=[e]:qa.push(e)}var xf=I(null),Ps=null,ga=null;function ja(e,n,r){Mt(xf,n._currentValue),n._currentValue=r}function _a(e){e._currentValue=xf.current,K(xf)}function yf(e,n,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===r)break;e=e.return}}function Sf(e,n,r,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var M=u.child;h=h.firstContext;t:for(;h!==null;){var L=h;h=u;for(var W=0;W<n.length;W++)if(L.context===n[W]){h.lanes|=r,L=h.alternate,L!==null&&(L.lanes|=r),yf(h.return,r,e),o||(M=null);break t}h=L.next}}else if(u.tag===18){if(M=u.return,M===null)throw Error(s(341));M.lanes|=r,h=M.alternate,h!==null&&(h.lanes|=r),yf(M,r,e),M=null}else M=u.child;if(M!==null)M.return=u;else for(M=u;M!==null;){if(M===e){M=null;break}if(u=M.sibling,u!==null){u.return=M.return,M=u;break}M=M.return}u=M}}function yr(e,n,r,o){e=null;for(var u=n,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var M=u.alternate;if(M===null)throw Error(s(387));if(M=M.memoizedProps,M!==null){var L=u.type;li(u.pendingProps.value,M.value)||(e!==null?e.push(L):e=[L])}}else if(u===Et.current){if(M=u.alternate,M===null)throw Error(s(387));M.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(nl):e=[nl])}u=u.return}e!==null&&Sf(n,e,r,o),n.flags|=262144}function Gl(e){for(e=e.firstContext;e!==null;){if(!li(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function zs(e){Ps=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Cn(e){return Bm(Ps,e)}function Vl(e,n){return Ps===null&&zs(e),Bm(e,n)}function Bm(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},ga===null){if(e===null)throw Error(s(308));ga=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else ga=ga.next=n;return r}var Hy=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},Gy=a.unstable_scheduleCallback,Vy=a.unstable_NormalPriority,hn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mf(){return{controller:new Hy,data:new Map,refCount:0}}function Do(e){e.refCount--,e.refCount===0&&Gy(Vy,function(){e.controller.abort()})}var Uo=null,bf=0,Sr=0,Mr=null;function ky(e,n){if(Uo===null){var r=Uo=[];bf=0,Sr=Ah(),Mr={status:"pending",value:void 0,then:function(o){r.push(o)}}}return bf++,n.then(Hm,Hm),n}function Hm(){if(--bf===0&&Uo!==null){Mr!==null&&(Mr.status="fulfilled");var e=Uo;Uo=null,Sr=0,Mr=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Xy(e,n){var r=[],o={status:"pending",value:null,reason:null,then:function(u){r.push(u)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var u=0;u<r.length;u++)(0,r[u])(n)},function(u){for(o.status="rejected",o.reason=u,u=0;u<r.length;u++)(0,r[u])(void 0)}),o}var Gm=z.S;z.S=function(e,n){E0=E(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&ky(e,n),Gm!==null&&Gm(e,n)};var Fs=I(null);function Ef(){var e=Fs.current;return e!==null?e:Ye.pooledCache}function kl(e,n){n===null?Mt(Fs,Fs.current):Mt(Fs,n.pool)}function Vm(){var e=Ef();return e===null?null:{parent:hn._currentValue,pool:e}}var br=Error(s(460)),Tf=Error(s(474)),Xl=Error(s(542)),Wl={then:function(){}};function km(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xm(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(ha,ha),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,qm(e),e;default:if(typeof n.status=="string")n.then(ha,ha);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=o}},function(o){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,qm(e),e}throw Bs=n,br}}function Is(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Bs=r,br):r}}var Bs=null;function Wm(){if(Bs===null)throw Error(s(459));var e=Bs;return Bs=null,e}function qm(e){if(e===br||e===Xl)throw Error(s(483))}var Er=null,Lo=0;function ql(e){var n=Lo;return Lo+=1,Er===null&&(Er=[]),Xm(Er,e,n)}function No(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Yl(e,n){throw n.$$typeof===g?Error(s(525)):(e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Ym(e){function n(at,Z){if(e){var ft=at.deletions;ft===null?(at.deletions=[Z],at.flags|=16):ft.push(Z)}}function r(at,Z){if(!e)return null;for(;Z!==null;)n(at,Z),Z=Z.sibling;return null}function o(at){for(var Z=new Map;at!==null;)at.key!==null?Z.set(at.key,at):Z.set(at.index,at),at=at.sibling;return Z}function u(at,Z){return at=pa(at,Z),at.index=0,at.sibling=null,at}function h(at,Z,ft){return at.index=ft,e?(ft=at.alternate,ft!==null?(ft=ft.index,ft<Z?(at.flags|=67108866,Z):ft):(at.flags|=67108866,Z)):(at.flags|=1048576,Z)}function M(at){return e&&at.alternate===null&&(at.flags|=67108866),at}function L(at,Z,ft,Rt){return Z===null||Z.tag!==6?(Z=df(ft,at.mode,Rt),Z.return=at,Z):(Z=u(Z,ft),Z.return=at,Z)}function W(at,Z,ft,Rt){var re=ft.type;return re===R?Tt(at,Z,ft.props.children,Rt,ft.key):Z!==null&&(Z.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===T&&Is(re)===Z.type)?(Z=u(Z,ft.props),No(Z,ft),Z.return=at,Z):(Z=Bl(ft.type,ft.key,ft.props,null,at.mode,Rt),No(Z,ft),Z.return=at,Z)}function dt(at,Z,ft,Rt){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ft.containerInfo||Z.stateNode.implementation!==ft.implementation?(Z=pf(ft,at.mode,Rt),Z.return=at,Z):(Z=u(Z,ft.children||[]),Z.return=at,Z)}function Tt(at,Z,ft,Rt,re){return Z===null||Z.tag!==7?(Z=Ns(ft,at.mode,Rt,re),Z.return=at,Z):(Z=u(Z,ft),Z.return=at,Z)}function Dt(at,Z,ft){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=df(""+Z,at.mode,ft),Z.return=at,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return ft=Bl(Z.type,Z.key,Z.props,null,at.mode,ft),No(ft,Z),ft.return=at,ft;case b:return Z=pf(Z,at.mode,ft),Z.return=at,Z;case T:return Z=Is(Z),Dt(at,Z,ft)}if(Y(Z)||q(Z))return Z=Ns(Z,at.mode,ft,null),Z.return=at,Z;if(typeof Z.then=="function")return Dt(at,ql(Z),ft);if(Z.$$typeof===D)return Dt(at,Vl(at,Z),ft);Yl(at,Z)}return null}function mt(at,Z,ft,Rt){var re=Z!==null?Z.key:null;if(typeof ft=="string"&&ft!==""||typeof ft=="number"||typeof ft=="bigint")return re!==null?null:L(at,Z,""+ft,Rt);if(typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case S:return ft.key===re?W(at,Z,ft,Rt):null;case b:return ft.key===re?dt(at,Z,ft,Rt):null;case T:return ft=Is(ft),mt(at,Z,ft,Rt)}if(Y(ft)||q(ft))return re!==null?null:Tt(at,Z,ft,Rt,null);if(typeof ft.then=="function")return mt(at,Z,ql(ft),Rt);if(ft.$$typeof===D)return mt(at,Z,Vl(at,ft),Rt);Yl(at,ft)}return null}function yt(at,Z,ft,Rt,re){if(typeof Rt=="string"&&Rt!==""||typeof Rt=="number"||typeof Rt=="bigint")return at=at.get(ft)||null,L(Z,at,""+Rt,re);if(typeof Rt=="object"&&Rt!==null){switch(Rt.$$typeof){case S:return at=at.get(Rt.key===null?ft:Rt.key)||null,W(Z,at,Rt,re);case b:return at=at.get(Rt.key===null?ft:Rt.key)||null,dt(Z,at,Rt,re);case T:return Rt=Is(Rt),yt(at,Z,ft,Rt,re)}if(Y(Rt)||q(Rt))return at=at.get(ft)||null,Tt(Z,at,Rt,re,null);if(typeof Rt.then=="function")return yt(at,Z,ft,ql(Rt),re);if(Rt.$$typeof===D)return yt(at,Z,ft,Vl(Z,Rt),re);Yl(Z,Rt)}return null}function Qt(at,Z,ft,Rt){for(var re=null,Ne=null,ie=Z,Se=Z=0,we=null;ie!==null&&Se<ft.length;Se++){ie.index>Se?(we=ie,ie=null):we=ie.sibling;var Oe=mt(at,ie,ft[Se],Rt);if(Oe===null){ie===null&&(ie=we);break}e&&ie&&Oe.alternate===null&&n(at,ie),Z=h(Oe,Z,Se),Ne===null?re=Oe:Ne.sibling=Oe,Ne=Oe,ie=we}if(Se===ft.length)return r(at,ie),Ce&&ma(at,Se),re;if(ie===null){for(;Se<ft.length;Se++)ie=Dt(at,ft[Se],Rt),ie!==null&&(Z=h(ie,Z,Se),Ne===null?re=ie:Ne.sibling=ie,Ne=ie);return Ce&&ma(at,Se),re}for(ie=o(ie);Se<ft.length;Se++)we=yt(ie,at,Se,ft[Se],Rt),we!==null&&(e&&we.alternate!==null&&ie.delete(we.key===null?Se:we.key),Z=h(we,Z,Se),Ne===null?re=we:Ne.sibling=we,Ne=we);return e&&ie.forEach(function(hs){return n(at,hs)}),Ce&&ma(at,Se),re}function le(at,Z,ft,Rt){if(ft==null)throw Error(s(151));for(var re=null,Ne=null,ie=Z,Se=Z=0,we=null,Oe=ft.next();ie!==null&&!Oe.done;Se++,Oe=ft.next()){ie.index>Se?(we=ie,ie=null):we=ie.sibling;var hs=mt(at,ie,Oe.value,Rt);if(hs===null){ie===null&&(ie=we);break}e&&ie&&hs.alternate===null&&n(at,ie),Z=h(hs,Z,Se),Ne===null?re=hs:Ne.sibling=hs,Ne=hs,ie=we}if(Oe.done)return r(at,ie),Ce&&ma(at,Se),re;if(ie===null){for(;!Oe.done;Se++,Oe=ft.next())Oe=Dt(at,Oe.value,Rt),Oe!==null&&(Z=h(Oe,Z,Se),Ne===null?re=Oe:Ne.sibling=Oe,Ne=Oe);return Ce&&ma(at,Se),re}for(ie=o(ie);!Oe.done;Se++,Oe=ft.next())Oe=yt(ie,at,Se,Oe.value,Rt),Oe!==null&&(e&&Oe.alternate!==null&&ie.delete(Oe.key===null?Se:Oe.key),Z=h(Oe,Z,Se),Ne===null?re=Oe:Ne.sibling=Oe,Ne=Oe);return e&&ie.forEach(function(eM){return n(at,eM)}),Ce&&ma(at,Se),re}function We(at,Z,ft,Rt){if(typeof ft=="object"&&ft!==null&&ft.type===R&&ft.key===null&&(ft=ft.props.children),typeof ft=="object"&&ft!==null){switch(ft.$$typeof){case S:t:{for(var re=ft.key;Z!==null;){if(Z.key===re){if(re=ft.type,re===R){if(Z.tag===7){r(at,Z.sibling),Rt=u(Z,ft.props.children),Rt.return=at,at=Rt;break t}}else if(Z.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===T&&Is(re)===Z.type){r(at,Z.sibling),Rt=u(Z,ft.props),No(Rt,ft),Rt.return=at,at=Rt;break t}r(at,Z);break}else n(at,Z);Z=Z.sibling}ft.type===R?(Rt=Ns(ft.props.children,at.mode,Rt,ft.key),Rt.return=at,at=Rt):(Rt=Bl(ft.type,ft.key,ft.props,null,at.mode,Rt),No(Rt,ft),Rt.return=at,at=Rt)}return M(at);case b:t:{for(re=ft.key;Z!==null;){if(Z.key===re)if(Z.tag===4&&Z.stateNode.containerInfo===ft.containerInfo&&Z.stateNode.implementation===ft.implementation){r(at,Z.sibling),Rt=u(Z,ft.children||[]),Rt.return=at,at=Rt;break t}else{r(at,Z);break}else n(at,Z);Z=Z.sibling}Rt=pf(ft,at.mode,Rt),Rt.return=at,at=Rt}return M(at);case T:return ft=Is(ft),We(at,Z,ft,Rt)}if(Y(ft))return Qt(at,Z,ft,Rt);if(q(ft)){if(re=q(ft),typeof re!="function")throw Error(s(150));return ft=re.call(ft),le(at,Z,ft,Rt)}if(typeof ft.then=="function")return We(at,Z,ql(ft),Rt);if(ft.$$typeof===D)return We(at,Z,Vl(at,ft),Rt);Yl(at,ft)}return typeof ft=="string"&&ft!==""||typeof ft=="number"||typeof ft=="bigint"?(ft=""+ft,Z!==null&&Z.tag===6?(r(at,Z.sibling),Rt=u(Z,ft),Rt.return=at,at=Rt):(r(at,Z),Rt=df(ft,at.mode,Rt),Rt.return=at,at=Rt),M(at)):r(at,Z)}return function(at,Z,ft,Rt){try{Lo=0;var re=We(at,Z,ft,Rt);return Er=null,re}catch(ie){if(ie===br||ie===Xl)throw ie;var Ne=ci(29,ie,null,at.mode);return Ne.lanes=Rt,Ne.return=at,Ne}}}var Hs=Ym(!0),jm=Ym(!1),Za=!1;function Af(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qa(e,n,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(ze&2)!==0){var u=o.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),o.pending=n,n=Il(e),Um(e,null,r),n}return Fl(e,o,n,r),Il(e)}function Oo(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,r|=o,n.lanes=r,sr(e,r)}}function wf(e,n){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var u=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var M={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?u=h=M:h=h.next=M,r=r.next}while(r!==null);h===null?u=h=n:h=h.next=n}else u=h=n;r={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var Cf=!1;function Po(){if(Cf){var e=Mr;if(e!==null)throw e}}function zo(e,n,r,o){Cf=!1;var u=e.updateQueue;Za=!1;var h=u.firstBaseUpdate,M=u.lastBaseUpdate,L=u.shared.pending;if(L!==null){u.shared.pending=null;var W=L,dt=W.next;W.next=null,M===null?h=dt:M.next=dt,M=W;var Tt=e.alternate;Tt!==null&&(Tt=Tt.updateQueue,L=Tt.lastBaseUpdate,L!==M&&(L===null?Tt.firstBaseUpdate=dt:L.next=dt,Tt.lastBaseUpdate=W))}if(h!==null){var Dt=u.baseState;M=0,Tt=dt=W=null,L=h;do{var mt=L.lane&-536870913,yt=mt!==L.lane;if(yt?(Re&mt)===mt:(o&mt)===mt){mt!==0&&mt===Sr&&(Cf=!0),Tt!==null&&(Tt=Tt.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});t:{var Qt=e,le=L;mt=n;var We=r;switch(le.tag){case 1:if(Qt=le.payload,typeof Qt=="function"){Dt=Qt.call(We,Dt,mt);break t}Dt=Qt;break t;case 3:Qt.flags=Qt.flags&-65537|128;case 0:if(Qt=le.payload,mt=typeof Qt=="function"?Qt.call(We,Dt,mt):Qt,mt==null)break t;Dt=_({},Dt,mt);break t;case 2:Za=!0}}mt=L.callback,mt!==null&&(e.flags|=64,yt&&(e.flags|=8192),yt=u.callbacks,yt===null?u.callbacks=[mt]:yt.push(mt))}else yt={lane:mt,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Tt===null?(dt=Tt=yt,W=Dt):Tt=Tt.next=yt,M|=mt;if(L=L.next,L===null){if(L=u.shared.pending,L===null)break;yt=L,L=yt.next,yt.next=null,u.lastBaseUpdate=yt,u.shared.pending=null}}while(!0);Tt===null&&(W=Dt),u.baseState=W,u.firstBaseUpdate=dt,u.lastBaseUpdate=Tt,h===null&&(u.shared.lanes=0),ns|=M,e.lanes=M,e.memoizedState=Dt}}function Zm(e,n){if(typeof e!="function")throw Error(s(191,e));e.call(n)}function Km(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Zm(r[e],n)}var Tr=I(null),jl=I(0);function Qm(e,n){e=Aa,Mt(jl,e),Mt(Tr,n),Aa=e|n.baseLanes}function Df(){Mt(jl,Aa),Mt(Tr,Tr.current)}function Uf(){Aa=jl.current,K(Tr),K(jl)}var ui=I(null),Ti=null;function Ja(e){var n=e.alternate;Mt(on,on.current&1),Mt(ui,e),Ti===null&&(n===null||Tr.current!==null||n.memoizedState!==null)&&(Ti=e)}function Lf(e){Mt(on,on.current),Mt(ui,e),Ti===null&&(Ti=e)}function Jm(e){e.tag===22?(Mt(on,on.current),Mt(ui,e),Ti===null&&(Ti=e)):$a()}function $a(){Mt(on,on.current),Mt(ui,ui.current)}function fi(e){K(ui),Ti===e&&(Ti=null),K(on)}var on=I(0);function Zl(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Ih(r)||Bh(r)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var va=0,xe=null,ke=null,dn=null,Kl=!1,Ar=!1,Gs=!1,Ql=0,Fo=0,Rr=null,Wy=0;function sn(){throw Error(s(321))}function Nf(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!li(e[r],n[r]))return!1;return!0}function Of(e,n,r,o,u,h){return va=h,xe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,z.H=e===null||e.memoizedState===null?Pg:Zf,Gs=!1,h=r(o,u),Gs=!1,Ar&&(h=tg(n,r,o,u)),$m(e),h}function $m(e){z.H=Ho;var n=ke!==null&&ke.next!==null;if(va=0,dn=ke=xe=null,Kl=!1,Fo=0,Rr=null,n)throw Error(s(300));e===null||pn||(e=e.dependencies,e!==null&&Gl(e)&&(pn=!0))}function tg(e,n,r,o){xe=e;var u=0;do{if(Ar&&(Rr=null),Fo=0,Ar=!1,25<=u)throw Error(s(301));if(u+=1,dn=ke=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}z.H=zg,h=n(r,o)}while(Ar);return h}function qy(){var e=z.H,n=e.useState()[0];return n=typeof n.then=="function"?Io(n):n,e=e.useState()[0],(ke!==null?ke.memoizedState:null)!==e&&(xe.flags|=1024),n}function Pf(){var e=Ql!==0;return Ql=0,e}function zf(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Ff(e){if(Kl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Kl=!1}va=0,dn=ke=xe=null,Ar=!1,Fo=Ql=0,Rr=null}function Yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?xe.memoizedState=dn=e:dn=dn.next=e,dn}function ln(){if(ke===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var n=dn===null?xe.memoizedState:dn.next;if(n!==null)dn=n,ke=e;else{if(e===null)throw xe.alternate===null?Error(s(467)):Error(s(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},dn===null?xe.memoizedState=dn=e:dn=dn.next=e}return dn}function Jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var n=Fo;return Fo+=1,Rr===null&&(Rr=[]),e=Xm(Rr,e,n),n=xe,(dn===null?n.memoizedState:dn.next)===null&&(n=n.alternate,z.H=n===null||n.memoizedState===null?Pg:Zf),e}function $l(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Io(e);if(e.$$typeof===D)return Cn(e)}throw Error(s(438,String(e)))}function If(e){var n=null,r=xe.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var o=xe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=Jl(),xe.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),o=0;o<e;o++)r[o]=et;return n.index++,r}function xa(e,n){return typeof n=="function"?n(e):n}function tc(e){var n=ln();return Bf(n,ke,e)}function Bf(e,n,r){var o=e.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=r;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var M=u.next;u.next=h.next,h.next=M}n.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{n=u.next;var L=M=null,W=null,dt=n,Tt=!1;do{var Dt=dt.lane&-536870913;if(Dt!==dt.lane?(Re&Dt)===Dt:(va&Dt)===Dt){var mt=dt.revertLane;if(mt===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:dt.action,hasEagerState:dt.hasEagerState,eagerState:dt.eagerState,next:null}),Dt===Sr&&(Tt=!0);else if((va&mt)===mt){dt=dt.next,mt===Sr&&(Tt=!0);continue}else Dt={lane:0,revertLane:dt.revertLane,gesture:null,action:dt.action,hasEagerState:dt.hasEagerState,eagerState:dt.eagerState,next:null},W===null?(L=W=Dt,M=h):W=W.next=Dt,xe.lanes|=mt,ns|=mt;Dt=dt.action,Gs&&r(h,Dt),h=dt.hasEagerState?dt.eagerState:r(h,Dt)}else mt={lane:Dt,revertLane:dt.revertLane,gesture:dt.gesture,action:dt.action,hasEagerState:dt.hasEagerState,eagerState:dt.eagerState,next:null},W===null?(L=W=mt,M=h):W=W.next=mt,xe.lanes|=Dt,ns|=Dt;dt=dt.next}while(dt!==null&&dt!==n);if(W===null?M=h:W.next=L,!li(h,e.memoizedState)&&(pn=!0,Tt&&(r=Mr,r!==null)))throw r;e.memoizedState=h,e.baseState=M,e.baseQueue=W,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Hf(e){var n=ln(),r=n.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var o=r.dispatch,u=r.pending,h=n.memoizedState;if(u!==null){r.pending=null;var M=u=u.next;do h=e(h,M.action),M=M.next;while(M!==u);li(h,n.memoizedState)||(pn=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,o]}function eg(e,n,r){var o=xe,u=ln(),h=Ce;if(h){if(r===void 0)throw Error(s(407));r=r()}else r=n();var M=!li((ke||u).memoizedState,r);if(M&&(u.memoizedState=r,pn=!0),u=u.queue,kf(ag.bind(null,o,u,e),[e]),u.getSnapshot!==n||M||dn!==null&&dn.memoizedState.tag&1){if(o.flags|=2048,wr(9,{destroy:void 0},ig.bind(null,o,u,r,n),null),Ye===null)throw Error(s(349));h||(va&127)!==0||ng(o,n,r)}return r}function ng(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=xe.updateQueue,n===null?(n=Jl(),xe.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function ig(e,n,r,o){n.value=r,n.getSnapshot=o,sg(n)&&rg(e)}function ag(e,n,r){return r(function(){sg(n)&&rg(e)})}function sg(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!li(e,r)}catch{return!0}}function rg(e){var n=Ls(e,2);n!==null&&ni(n,e,2)}function Gf(e){var n=Yn();if(typeof e=="function"){var r=e;if(e=r(),Gs){Nt(!0);try{r()}finally{Nt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:e},n}function og(e,n,r,o){return e.baseState=r,Bf(e,ke,typeof o=="function"?o:xa)}function Yy(e,n,r,o,u){if(ic(e))throw Error(s(485));if(e=n.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){h.listeners.push(M)}};z.T!==null?r(!0):h.isTransition=!1,o(h),r=n.pending,r===null?(h.next=n.pending=h,lg(n,h)):(h.next=r.next,n.pending=r.next=h)}}function lg(e,n){var r=n.action,o=n.payload,u=e.state;if(n.isTransition){var h=z.T,M={};z.T=M;try{var L=r(u,o),W=z.S;W!==null&&W(M,L),cg(e,n,L)}catch(dt){Vf(e,n,dt)}finally{h!==null&&M.types!==null&&(h.types=M.types),z.T=h}}else try{h=r(u,o),cg(e,n,h)}catch(dt){Vf(e,n,dt)}}function cg(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(o){ug(e,n,o)},function(o){return Vf(e,n,o)}):ug(e,n,r)}function ug(e,n,r){n.status="fulfilled",n.value=r,fg(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,lg(e,r)))}function Vf(e,n,r){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=r,fg(n),n=n.next;while(n!==o)}e.action=null}function fg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function hg(e,n){return n}function dg(e,n){if(Ce){var r=Ye.formState;if(r!==null){t:{var o=xe;if(Ce){if(Ke){e:{for(var u=Ke,h=Ei;u.nodeType!==8;){if(!h){u=null;break e}if(u=Ai(u.nextSibling),u===null){u=null;break e}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){Ke=Ai(u.nextSibling),o=u.data==="F!";break t}}Ya(o)}o=!1}o&&(n=r[0])}}return r=Yn(),r.memoizedState=r.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hg,lastRenderedState:n},r.queue=o,r=Lg.bind(null,xe,o),o.dispatch=r,o=Gf(!1),h=jf.bind(null,xe,!1,o.queue),o=Yn(),u={state:n,dispatch:null,action:e,pending:null},o.queue=u,r=Yy.bind(null,xe,u,h,r),u.dispatch=r,o.memoizedState=e,[n,r,!1]}function pg(e){var n=ln();return mg(n,ke,e)}function mg(e,n,r){if(n=Bf(e,n,hg)[0],e=tc(xa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Io(n)}catch(M){throw M===br?Xl:M}else o=n;n=ln();var u=n.queue,h=u.dispatch;return r!==n.memoizedState&&(xe.flags|=2048,wr(9,{destroy:void 0},jy.bind(null,u,r),null)),[o,h,e]}function jy(e,n){e.action=n}function gg(e){var n=ln(),r=ke;if(r!==null)return mg(n,r,e);ln(),n=n.memoizedState,r=ln();var o=r.queue.dispatch;return r.memoizedState=e,[n,o,!1]}function wr(e,n,r,o){return e={tag:e,create:r,deps:o,inst:n,next:null},n=xe.updateQueue,n===null&&(n=Jl(),xe.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(o=r.next,r.next=e,e.next=o,n.lastEffect=e),e}function _g(){return ln().memoizedState}function ec(e,n,r,o){var u=Yn();xe.flags|=e,u.memoizedState=wr(1|n,{destroy:void 0},r,o===void 0?null:o)}function nc(e,n,r,o){var u=ln();o=o===void 0?null:o;var h=u.memoizedState.inst;ke!==null&&o!==null&&Nf(o,ke.memoizedState.deps)?u.memoizedState=wr(n,h,r,o):(xe.flags|=e,u.memoizedState=wr(1|n,h,r,o))}function vg(e,n){ec(8390656,8,e,n)}function kf(e,n){nc(2048,8,e,n)}function Zy(e){xe.flags|=4;var n=xe.updateQueue;if(n===null)n=Jl(),xe.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function xg(e){var n=ln().memoizedState;return Zy({ref:n,nextImpl:e}),function(){if((ze&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function yg(e,n){return nc(4,2,e,n)}function Sg(e,n){return nc(4,4,e,n)}function Mg(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function bg(e,n,r){r=r!=null?r.concat([e]):null,nc(4,4,Mg.bind(null,n,e),r)}function Xf(){}function Eg(e,n){var r=ln();n=n===void 0?null:n;var o=r.memoizedState;return n!==null&&Nf(n,o[1])?o[0]:(r.memoizedState=[e,n],e)}function Tg(e,n){var r=ln();n=n===void 0?null:n;var o=r.memoizedState;if(n!==null&&Nf(n,o[1]))return o[0];if(o=e(),Gs){Nt(!0);try{e()}finally{Nt(!1)}}return r.memoizedState=[o,n],o}function Wf(e,n,r){return r===void 0||(va&1073741824)!==0&&(Re&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=A0(),xe.lanes|=e,ns|=e,r)}function Ag(e,n,r,o){return li(r,n)?r:Tr.current!==null?(e=Wf(e,r,o),li(e,n)||(pn=!0),e):(va&42)===0||(va&1073741824)!==0&&(Re&261930)===0?(pn=!0,e.memoizedState=r):(e=A0(),xe.lanes|=e,ns|=e,n)}function Rg(e,n,r,o,u){var h=A.p;A.p=h!==0&&8>h?h:8;var M=z.T,L={};z.T=L,jf(e,!1,n,r);try{var W=u(),dt=z.S;if(dt!==null&&dt(L,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var Tt=Xy(W,o);Bo(e,n,Tt,pi(e))}else Bo(e,n,o,pi(e))}catch(Dt){Bo(e,n,{then:function(){},status:"rejected",reason:Dt},pi())}finally{A.p=h,M!==null&&L.types!==null&&(M.types=L.types),z.T=M}}function Ky(){}function qf(e,n,r,o){if(e.tag!==5)throw Error(s(476));var u=wg(e).queue;Rg(e,u,n,ht,r===null?Ky:function(){return Cg(e),r(o)})}function wg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ht,baseState:ht,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:ht},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Cg(e){var n=wg(e);n.next===null&&(n=e.alternate.memoizedState),Bo(e,n.next.queue,{},pi())}function Yf(){return Cn(nl)}function Dg(){return ln().memoizedState}function Ug(){return ln().memoizedState}function Qy(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=pi();e=Ka(r);var o=Qa(n,e,r);o!==null&&(ni(o,n,r),Oo(o,n,r)),n={cache:Mf()},e.payload=n;return}n=n.return}}function Jy(e,n,r){var o=pi();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)?Ng(n,r):(r=ff(e,n,r,o),r!==null&&(ni(r,e,o),Og(r,n,o)))}function Lg(e,n,r){var o=pi();Bo(e,n,r,o)}function Bo(e,n,r,o){var u={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(ic(e))Ng(n,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var M=n.lastRenderedState,L=h(M,r);if(u.hasEagerState=!0,u.eagerState=L,li(L,M))return Fl(e,n,u,0),Ye===null&&zl(),!1}catch{}if(r=ff(e,n,u,o),r!==null)return ni(r,e,o),Og(r,n,o),!0}return!1}function jf(e,n,r,o){if(o={lane:2,revertLane:Ah(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(n)throw Error(s(479))}else n=ff(e,r,o,2),n!==null&&ni(n,e,2)}function ic(e){var n=e.alternate;return e===xe||n!==null&&n===xe}function Ng(e,n){Ar=Kl=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Og(e,n,r){if((r&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,r|=o,n.lanes=r,sr(e,r)}}var Ho={readContext:Cn,use:$l,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useLayoutEffect:sn,useInsertionEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useSyncExternalStore:sn,useId:sn,useHostTransitionStatus:sn,useFormState:sn,useActionState:sn,useOptimistic:sn,useMemoCache:sn,useCacheRefresh:sn};Ho.useEffectEvent=sn;var Pg={readContext:Cn,use:$l,useCallback:function(e,n){return Yn().memoizedState=[e,n===void 0?null:n],e},useContext:Cn,useEffect:vg,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,ec(4194308,4,Mg.bind(null,n,e),r)},useLayoutEffect:function(e,n){return ec(4194308,4,e,n)},useInsertionEffect:function(e,n){ec(4,2,e,n)},useMemo:function(e,n){var r=Yn();n=n===void 0?null:n;var o=e();if(Gs){Nt(!0);try{e()}finally{Nt(!1)}}return r.memoizedState=[o,n],o},useReducer:function(e,n,r){var o=Yn();if(r!==void 0){var u=r(n);if(Gs){Nt(!0);try{r(n)}finally{Nt(!1)}}}else u=n;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=Jy.bind(null,xe,e),[o.memoizedState,e]},useRef:function(e){var n=Yn();return e={current:e},n.memoizedState=e},useState:function(e){e=Gf(e);var n=e.queue,r=Lg.bind(null,xe,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:Xf,useDeferredValue:function(e,n){var r=Yn();return Wf(r,e,n)},useTransition:function(){var e=Gf(!1);return e=Rg.bind(null,xe,e.queue,!0,!1),Yn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var o=xe,u=Yn();if(Ce){if(r===void 0)throw Error(s(407));r=r()}else{if(r=n(),Ye===null)throw Error(s(349));(Re&127)!==0||ng(o,n,r)}u.memoizedState=r;var h={value:r,getSnapshot:n};return u.queue=h,vg(ag.bind(null,o,h,e),[e]),o.flags|=2048,wr(9,{destroy:void 0},ig.bind(null,o,h,r,n),null),r},useId:function(){var e=Yn(),n=Ye.identifierPrefix;if(Ce){var r=Zi,o=ji;r=(o&~(1<<32-Lt(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Ql++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=Wy++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Yf,useFormState:dg,useActionState:dg,useOptimistic:function(e){var n=Yn();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=jf.bind(null,xe,!0,r),r.dispatch=n,[e,n]},useMemoCache:If,useCacheRefresh:function(){return Yn().memoizedState=Qy.bind(null,xe)},useEffectEvent:function(e){var n=Yn(),r={impl:e};return n.memoizedState=r,function(){if((ze&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},Zf={readContext:Cn,use:$l,useCallback:Eg,useContext:Cn,useEffect:kf,useImperativeHandle:bg,useInsertionEffect:yg,useLayoutEffect:Sg,useMemo:Tg,useReducer:tc,useRef:_g,useState:function(){return tc(xa)},useDebugValue:Xf,useDeferredValue:function(e,n){var r=ln();return Ag(r,ke.memoizedState,e,n)},useTransition:function(){var e=tc(xa)[0],n=ln().memoizedState;return[typeof e=="boolean"?e:Io(e),n]},useSyncExternalStore:eg,useId:Dg,useHostTransitionStatus:Yf,useFormState:pg,useActionState:pg,useOptimistic:function(e,n){var r=ln();return og(r,ke,e,n)},useMemoCache:If,useCacheRefresh:Ug};Zf.useEffectEvent=xg;var zg={readContext:Cn,use:$l,useCallback:Eg,useContext:Cn,useEffect:kf,useImperativeHandle:bg,useInsertionEffect:yg,useLayoutEffect:Sg,useMemo:Tg,useReducer:Hf,useRef:_g,useState:function(){return Hf(xa)},useDebugValue:Xf,useDeferredValue:function(e,n){var r=ln();return ke===null?Wf(r,e,n):Ag(r,ke.memoizedState,e,n)},useTransition:function(){var e=Hf(xa)[0],n=ln().memoizedState;return[typeof e=="boolean"?e:Io(e),n]},useSyncExternalStore:eg,useId:Dg,useHostTransitionStatus:Yf,useFormState:gg,useActionState:gg,useOptimistic:function(e,n){var r=ln();return ke!==null?og(r,ke,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:If,useCacheRefresh:Ug};zg.useEffectEvent=xg;function Kf(e,n,r,o){n=e.memoizedState,r=r(o,n),r=r==null?n:_({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Qf={enqueueSetState:function(e,n,r){e=e._reactInternals;var o=pi(),u=Ka(o);u.payload=n,r!=null&&(u.callback=r),n=Qa(e,u,o),n!==null&&(ni(n,e,o),Oo(n,e,o))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var o=pi(),u=Ka(o);u.tag=1,u.payload=n,r!=null&&(u.callback=r),n=Qa(e,u,o),n!==null&&(ni(n,e,o),Oo(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=pi(),o=Ka(r);o.tag=2,n!=null&&(o.callback=n),n=Qa(e,o,r),n!==null&&(ni(n,e,r),Oo(n,e,r))}};function Fg(e,n,r,o,u,h,M){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,M):n.prototype&&n.prototype.isPureReactComponent?!Ao(r,o)||!Ao(u,h):!0}function Ig(e,n,r,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,o),n.state!==e&&Qf.enqueueReplaceState(n,n.state,null)}function Vs(e,n){var r=n;if("ref"in n){r={};for(var o in n)o!=="ref"&&(r[o]=n[o])}if(e=e.defaultProps){r===n&&(r=_({},r));for(var u in e)r[u]===void 0&&(r[u]=e[u])}return r}function Bg(e){Pl(e)}function Hg(e){console.error(e)}function Gg(e){Pl(e)}function ac(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Vg(e,n,r){try{var o=e.onCaughtError;o(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Jf(e,n,r){return r=Ka(r),r.tag=3,r.payload={element:null},r.callback=function(){ac(e,n)},r}function kg(e){return e=Ka(e),e.tag=3,e}function Xg(e,n,r,o){var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){Vg(n,r,o)}}var M=r.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(e.callback=function(){Vg(n,r,o),typeof u!="function"&&(is===null?is=new Set([this]):is.add(this));var L=o.stack;this.componentDidCatch(o.value,{componentStack:L!==null?L:""})})}function $y(e,n,r,o,u){if(r.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=r.alternate,n!==null&&yr(n,r,u,!0),r=ui.current,r!==null){switch(r.tag){case 31:case 13:return Ti===null?gc():r.alternate===null&&rn===0&&(rn=3),r.flags&=-257,r.flags|=65536,r.lanes=u,o===Wl?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([o]):n.add(o),bh(e,o,u)),!1;case 22:return r.flags|=65536,o===Wl?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([o]):r.add(o)),bh(e,o,u)),!1}throw Error(s(435,r.tag))}return bh(e,o,u),gc(),!1}if(Ce)return n=ui.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,o!==_f&&(e=Error(s(422),{cause:o}),Co(Si(e,r)))):(o!==_f&&(n=Error(s(423),{cause:o}),Co(Si(n,r))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=Si(o,r),u=Jf(e.stateNode,o,u),wf(e,u),rn!==4&&(rn=2)),!1;var h=Error(s(520),{cause:o});if(h=Si(h,r),jo===null?jo=[h]:jo.push(h),rn!==4&&(rn=2),n===null)return!0;o=Si(o,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=u&-u,r.lanes|=e,e=Jf(r.stateNode,o,e),wf(r,e),!1;case 1:if(n=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(is===null||!is.has(h))))return r.flags|=65536,u&=-u,r.lanes|=u,u=kg(u),Xg(u,e,r,o),wf(r,u),!1}r=r.return}while(r!==null);return!1}var $f=Error(s(461)),pn=!1;function Dn(e,n,r,o){n.child=e===null?jm(n,null,r,o):Hs(n,e.child,r,o)}function Wg(e,n,r,o,u){r=r.render;var h=n.ref;if("ref"in o){var M={};for(var L in o)L!=="ref"&&(M[L]=o[L])}else M=o;return zs(n),o=Of(e,n,r,M,h,u),L=Pf(),e!==null&&!pn?(zf(e,n,u),ya(e,n,u)):(Ce&&L&&mf(n),n.flags|=1,Dn(e,n,o,u),n.child)}function qg(e,n,r,o,u){if(e===null){var h=r.type;return typeof h=="function"&&!hf(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,Yg(e,n,h,o,u)):(e=Bl(r.type,null,o,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!oh(e,u)){var M=h.memoizedProps;if(r=r.compare,r=r!==null?r:Ao,r(M,o)&&e.ref===n.ref)return ya(e,n,u)}return n.flags|=1,e=pa(h,o),e.ref=n.ref,e.return=n,n.child=e}function Yg(e,n,r,o,u){if(e!==null){var h=e.memoizedProps;if(Ao(h,o)&&e.ref===n.ref)if(pn=!1,n.pendingProps=o=h,oh(e,u))(e.flags&131072)!==0&&(pn=!0);else return n.lanes=e.lanes,ya(e,n,u)}return th(e,n,r,o,u)}function jg(e,n,r,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|r:r,e!==null){for(o=n.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,n.child=null;return Zg(e,n,h,r,o)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&kl(n,h!==null?h.cachePool:null),h!==null?Qm(n,h):Df(),Jm(n);else return o=n.lanes=536870912,Zg(e,n,h!==null?h.baseLanes|r:r,r,o)}else h!==null?(kl(n,h.cachePool),Qm(n,h),$a(),n.memoizedState=null):(e!==null&&kl(n,null),Df(),$a());return Dn(e,n,u,r),n.child}function Go(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Zg(e,n,r,o,u){var h=Ef();return h=h===null?null:{parent:hn._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&kl(n,null),Df(),Jm(n),e!==null&&yr(e,n,o,!0),n.childLanes=u,null}function sc(e,n){return n=oc({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Kg(e,n,r){return Hs(n,e.child,null,r),e=sc(n,n.pendingProps),e.flags|=2,fi(n),n.memoizedState=null,e}function tS(e,n,r){var o=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ce){if(o.mode==="hidden")return e=sc(n,o),n.lanes=536870912,Go(null,e);if(Lf(n),(e=Ke)?(e=l_(e,Ei),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Wa!==null?{id:ji,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},r=Nm(e),r.return=n,n.child=r,wn=n,Ke=null)):e=null,e===null)throw Ya(n);return n.lanes=536870912,null}return sc(n,o)}var h=e.memoizedState;if(h!==null){var M=h.dehydrated;if(Lf(n),u)if(n.flags&256)n.flags&=-257,n=Kg(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(s(558));else if(pn||yr(e,n,r,!1),u=(r&e.childLanes)!==0,pn||u){if(o=Ye,o!==null&&(M=El(o,r),M!==0&&M!==h.retryLane))throw h.retryLane=M,Ls(e,M),ni(o,e,M),$f;gc(),n=Kg(e,n,r)}else e=h.treeContext,Ke=Ai(M.nextSibling),wn=n,Ce=!0,qa=null,Ei=!1,e!==null&&zm(n,e),n=sc(n,o),n.flags|=4096;return n}return e=pa(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function rc(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function th(e,n,r,o,u){return zs(n),r=Of(e,n,r,o,void 0,u),o=Pf(),e!==null&&!pn?(zf(e,n,u),ya(e,n,u)):(Ce&&o&&mf(n),n.flags|=1,Dn(e,n,r,u),n.child)}function Qg(e,n,r,o,u,h){return zs(n),n.updateQueue=null,r=tg(n,o,r,u),$m(e),o=Pf(),e!==null&&!pn?(zf(e,n,h),ya(e,n,h)):(Ce&&o&&mf(n),n.flags|=1,Dn(e,n,r,h),n.child)}function Jg(e,n,r,o,u){if(zs(n),n.stateNode===null){var h=gr,M=r.contextType;typeof M=="object"&&M!==null&&(h=Cn(M)),h=new r(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Qf,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},Af(n),M=r.contextType,h.context=typeof M=="object"&&M!==null?Cn(M):gr,h.state=n.memoizedState,M=r.getDerivedStateFromProps,typeof M=="function"&&(Kf(n,r,M,o),h.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(M=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),M!==h.state&&Qf.enqueueReplaceState(h,h.state,null),zo(n,o,h,u),Po(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){h=n.stateNode;var L=n.memoizedProps,W=Vs(r,L);h.props=W;var dt=h.context,Tt=r.contextType;M=gr,typeof Tt=="object"&&Tt!==null&&(M=Cn(Tt));var Dt=r.getDerivedStateFromProps;Tt=typeof Dt=="function"||typeof h.getSnapshotBeforeUpdate=="function",L=n.pendingProps!==L,Tt||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(L||dt!==M)&&Ig(n,h,o,M),Za=!1;var mt=n.memoizedState;h.state=mt,zo(n,o,h,u),Po(),dt=n.memoizedState,L||mt!==dt||Za?(typeof Dt=="function"&&(Kf(n,r,Dt,o),dt=n.memoizedState),(W=Za||Fg(n,r,W,o,mt,dt,M))?(Tt||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=dt),h.props=o,h.state=dt,h.context=M,o=W):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,Rf(e,n),M=n.memoizedProps,Tt=Vs(r,M),h.props=Tt,Dt=n.pendingProps,mt=h.context,dt=r.contextType,W=gr,typeof dt=="object"&&dt!==null&&(W=Cn(dt)),L=r.getDerivedStateFromProps,(dt=typeof L=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(M!==Dt||mt!==W)&&Ig(n,h,o,W),Za=!1,mt=n.memoizedState,h.state=mt,zo(n,o,h,u),Po();var yt=n.memoizedState;M!==Dt||mt!==yt||Za||e!==null&&e.dependencies!==null&&Gl(e.dependencies)?(typeof L=="function"&&(Kf(n,r,L,o),yt=n.memoizedState),(Tt=Za||Fg(n,r,Tt,o,mt,yt,W)||e!==null&&e.dependencies!==null&&Gl(e.dependencies))?(dt||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,yt,W),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,yt,W)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||M===e.memoizedProps&&mt===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&mt===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=yt),h.props=o,h.state=yt,h.context=W,o=Tt):(typeof h.componentDidUpdate!="function"||M===e.memoizedProps&&mt===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&mt===e.memoizedState||(n.flags|=1024),o=!1)}return h=o,rc(e,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,r=o&&typeof r.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&o?(n.child=Hs(n,e.child,null,u),n.child=Hs(n,null,r,u)):Dn(e,n,r,u),n.memoizedState=h.state,e=n.child):e=ya(e,n,u),e}function $g(e,n,r,o){return Os(),n.flags|=256,Dn(e,n,r,o),n.child}var eh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nh(e){return{baseLanes:e,cachePool:Vm()}}function ih(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=di),e}function t0(e,n,r){var o=n.pendingProps,u=!1,h=(n.flags&128)!==0,M;if((M=h)||(M=e!==null&&e.memoizedState===null?!1:(on.current&2)!==0),M&&(u=!0,n.flags&=-129),M=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ce){if(u?Ja(n):$a(),(e=Ke)?(e=l_(e,Ei),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Wa!==null?{id:ji,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},r=Nm(e),r.return=n,n.child=r,wn=n,Ke=null)):e=null,e===null)throw Ya(n);return Bh(e)?n.lanes=32:n.lanes=536870912,null}var L=o.children;return o=o.fallback,u?($a(),u=n.mode,L=oc({mode:"hidden",children:L},u),o=Ns(o,u,r,null),L.return=n,o.return=n,L.sibling=o,n.child=L,o=n.child,o.memoizedState=nh(r),o.childLanes=ih(e,M,r),n.memoizedState=eh,Go(null,o)):(Ja(n),ah(n,L))}var W=e.memoizedState;if(W!==null&&(L=W.dehydrated,L!==null)){if(h)n.flags&256?(Ja(n),n.flags&=-257,n=sh(e,n,r)):n.memoizedState!==null?($a(),n.child=e.child,n.flags|=128,n=null):($a(),L=o.fallback,u=n.mode,o=oc({mode:"visible",children:o.children},u),L=Ns(L,u,r,null),L.flags|=2,o.return=n,L.return=n,o.sibling=L,n.child=o,Hs(n,e.child,null,r),o=n.child,o.memoizedState=nh(r),o.childLanes=ih(e,M,r),n.memoizedState=eh,n=Go(null,o));else if(Ja(n),Bh(L)){if(M=L.nextSibling&&L.nextSibling.dataset,M)var dt=M.dgst;M=dt,o=Error(s(419)),o.stack="",o.digest=M,Co({value:o,source:null,stack:null}),n=sh(e,n,r)}else if(pn||yr(e,n,r,!1),M=(r&e.childLanes)!==0,pn||M){if(M=Ye,M!==null&&(o=El(M,r),o!==0&&o!==W.retryLane))throw W.retryLane=o,Ls(e,o),ni(M,e,o),$f;Ih(L)||gc(),n=sh(e,n,r)}else Ih(L)?(n.flags|=192,n.child=e.child,n=null):(e=W.treeContext,Ke=Ai(L.nextSibling),wn=n,Ce=!0,qa=null,Ei=!1,e!==null&&zm(n,e),n=ah(n,o.children),n.flags|=4096);return n}return u?($a(),L=o.fallback,u=n.mode,W=e.child,dt=W.sibling,o=pa(W,{mode:"hidden",children:o.children}),o.subtreeFlags=W.subtreeFlags&65011712,dt!==null?L=pa(dt,L):(L=Ns(L,u,r,null),L.flags|=2),L.return=n,o.return=n,o.sibling=L,n.child=o,Go(null,o),o=n.child,L=e.child.memoizedState,L===null?L=nh(r):(u=L.cachePool,u!==null?(W=hn._currentValue,u=u.parent!==W?{parent:W,pool:W}:u):u=Vm(),L={baseLanes:L.baseLanes|r,cachePool:u}),o.memoizedState=L,o.childLanes=ih(e,M,r),n.memoizedState=eh,Go(e.child,o)):(Ja(n),r=e.child,e=r.sibling,r=pa(r,{mode:"visible",children:o.children}),r.return=n,r.sibling=null,e!==null&&(M=n.deletions,M===null?(n.deletions=[e],n.flags|=16):M.push(e)),n.child=r,n.memoizedState=null,r)}function ah(e,n){return n=oc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function oc(e,n){return e=ci(22,e,null,n),e.lanes=0,e}function sh(e,n,r){return Hs(n,e.child,null,r),e=ah(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function e0(e,n,r){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),yf(e.return,n,r)}function rh(e,n,r,o,u,h){var M=e.memoizedState;M===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:r,tailMode:u,treeForkCount:h}:(M.isBackwards=n,M.rendering=null,M.renderingStartTime=0,M.last=o,M.tail=r,M.tailMode=u,M.treeForkCount=h)}function n0(e,n,r){var o=n.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var M=on.current,L=(M&2)!==0;if(L?(M=M&1|2,n.flags|=128):M&=1,Mt(on,M),Dn(e,n,o,r),o=Ce?wo:0,!L&&e!==null&&(e.flags&128)!==0)t:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&e0(e,r,n);else if(e.tag===19)e0(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break t;for(;e.sibling===null;){if(e.return===null||e.return===n)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(r=n.child,u=null;r!==null;)e=r.alternate,e!==null&&Zl(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=n.child,n.child=null):(u=r.sibling,r.sibling=null),rh(n,!1,u,r,h,o);break;case"backwards":case"unstable_legacy-backwards":for(r=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&Zl(e)===null){n.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}rh(n,!0,r,null,h,o);break;case"together":rh(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function ya(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),ns|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(yr(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,r=pa(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=pa(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function oh(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Gl(e)))}function eS(e,n,r){switch(n.tag){case 3:gt(n,n.stateNode.containerInfo),ja(n,hn,e.memoizedState.cache),Os();break;case 27:case 5:tt(n);break;case 4:gt(n,n.stateNode.containerInfo);break;case 10:ja(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Lf(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Ja(n),n.flags|=128,null):(r&n.child.childLanes)!==0?t0(e,n,r):(Ja(n),e=ya(e,n,r),e!==null?e.sibling:null);Ja(n);break;case 19:var u=(e.flags&128)!==0;if(o=(r&n.childLanes)!==0,o||(yr(e,n,r,!1),o=(r&n.childLanes)!==0),u){if(o)return n0(e,n,r);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Mt(on,on.current),o)break;return null;case 22:return n.lanes=0,jg(e,n,r,n.pendingProps);case 24:ja(n,hn,e.memoizedState.cache)}return ya(e,n,r)}function i0(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)pn=!0;else{if(!oh(e,r)&&(n.flags&128)===0)return pn=!1,eS(e,n,r);pn=(e.flags&131072)!==0}else pn=!1,Ce&&(n.flags&1048576)!==0&&Pm(n,wo,n.index);switch(n.lanes=0,n.tag){case 16:t:{var o=n.pendingProps;if(e=Is(n.elementType),n.type=e,typeof e=="function")hf(e)?(o=Vs(e,o),n.tag=1,n=Jg(null,n,e,o,r)):(n.tag=0,n=th(null,n,e,o,r));else{if(e!=null){var u=e.$$typeof;if(u===C){n.tag=11,n=Wg(null,n,e,o,r);break t}else if(u===F){n.tag=14,n=qg(null,n,e,o,r);break t}}throw n=ot(e)||e,Error(s(306,n,""))}}return n;case 0:return th(e,n,n.type,n.pendingProps,r);case 1:return o=n.type,u=Vs(o,n.pendingProps),Jg(e,n,o,u,r);case 3:t:{if(gt(n,n.stateNode.containerInfo),e===null)throw Error(s(387));o=n.pendingProps;var h=n.memoizedState;u=h.element,Rf(e,n),zo(n,o,null,r);var M=n.memoizedState;if(o=M.cache,ja(n,hn,o),o!==h.cache&&Sf(n,[hn],r,!0),Po(),o=M.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:M.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=$g(e,n,o,r);break t}else if(o!==u){u=Si(Error(s(424)),n),Co(u),n=$g(e,n,o,r);break t}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ke=Ai(e.firstChild),wn=n,Ce=!0,qa=null,Ei=!0,r=jm(n,null,o,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Os(),o===u){n=ya(e,n,r);break t}Dn(e,n,o,r)}n=n.child}return n;case 26:return rc(e,n),e===null?(r=p_(n.type,null,n.pendingProps,null))?n.memoizedState=r:Ce||(r=n.type,e=n.pendingProps,o=bc(st.current).createElement(r),o[cn]=n,o[vn]=e,Un(o,r,e),J(o),n.stateNode=o):n.memoizedState=p_(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return tt(n),e===null&&Ce&&(o=n.stateNode=f_(n.type,n.pendingProps,st.current),wn=n,Ei=!0,u=Ke,os(n.type)?(Hh=u,Ke=Ai(o.firstChild)):Ke=u),Dn(e,n,n.pendingProps.children,r),rc(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ce&&((u=o=Ke)&&(o=US(o,n.type,n.pendingProps,Ei),o!==null?(n.stateNode=o,wn=n,Ke=Ai(o.firstChild),Ei=!1,u=!0):u=!1),u||Ya(n)),tt(n),u=n.type,h=n.pendingProps,M=e!==null?e.memoizedProps:null,o=h.children,Ph(u,h)?o=null:M!==null&&Ph(u,M)&&(n.flags|=32),n.memoizedState!==null&&(u=Of(e,n,qy,null,null,r),nl._currentValue=u),rc(e,n),Dn(e,n,o,r),n.child;case 6:return e===null&&Ce&&((e=r=Ke)&&(r=LS(r,n.pendingProps,Ei),r!==null?(n.stateNode=r,wn=n,Ke=null,e=!0):e=!1),e||Ya(n)),null;case 13:return t0(e,n,r);case 4:return gt(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Hs(n,null,o,r):Dn(e,n,o,r),n.child;case 11:return Wg(e,n,n.type,n.pendingProps,r);case 7:return Dn(e,n,n.pendingProps,r),n.child;case 8:return Dn(e,n,n.pendingProps.children,r),n.child;case 12:return Dn(e,n,n.pendingProps.children,r),n.child;case 10:return o=n.pendingProps,ja(n,n.type,o.value),Dn(e,n,o.children,r),n.child;case 9:return u=n.type._context,o=n.pendingProps.children,zs(n),u=Cn(u),o=o(u),n.flags|=1,Dn(e,n,o,r),n.child;case 14:return qg(e,n,n.type,n.pendingProps,r);case 15:return Yg(e,n,n.type,n.pendingProps,r);case 19:return n0(e,n,r);case 31:return tS(e,n,r);case 22:return jg(e,n,r,n.pendingProps);case 24:return zs(n),o=Cn(hn),e===null?(u=Ef(),u===null&&(u=Ye,h=Mf(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=r),u=h),n.memoizedState={parent:o,cache:u},Af(n),ja(n,hn,u)):((e.lanes&r)!==0&&(Rf(e,n),zo(n,null,null,r),Po()),u=e.memoizedState,h=n.memoizedState,u.parent!==o?(u={parent:o,cache:o},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),ja(n,hn,o)):(o=h.cache,ja(n,hn,o),o!==u.cache&&Sf(n,[hn],r,!0))),Dn(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function Sa(e){e.flags|=4}function lh(e,n,r,o,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(D0())e.flags|=8192;else throw Bs=Wl,Tf}else e.flags&=-16777217}function a0(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!x_(n))if(D0())e.flags|=8192;else throw Bs=Wl,Tf}function lc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Ie():536870912,e.lanes|=n,Lr|=n)}function Vo(e,n){if(!Ce)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Qe(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,o=0;if(n)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=r,n}function nS(e,n,r){var o=n.pendingProps;switch(gf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(n),null;case 1:return Qe(n),null;case 3:return r=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),_a(hn),Ut(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xr(n)?Sa(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,vf())),Qe(n),null;case 26:var u=n.type,h=n.memoizedState;return e===null?(Sa(n),h!==null?(Qe(n),a0(n,h)):(Qe(n),lh(n,u,null,o,r))):h?h!==e.memoizedState?(Sa(n),Qe(n),a0(n,h)):(Qe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&Sa(n),Qe(n),lh(n,u,e,o,r)),null;case 27:if(ct(n),r=st.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Sa(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Qe(n),null}e=wt.current,xr(n)?Fm(n):(e=f_(u,o,r),n.stateNode=e,Sa(n))}return Qe(n),null;case 5:if(ct(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Sa(n);else{if(!o){if(n.stateNode===null)throw Error(s(166));return Qe(n),null}if(h=wt.current,xr(n))Fm(n);else{var M=bc(st.current);switch(h){case 1:h=M.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=M.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=M.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=M.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=M.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?M.createElement("select",{is:o.is}):M.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?M.createElement(u,{is:o.is}):M.createElement(u)}}h[cn]=n,h[vn]=o;t:for(M=n.child;M!==null;){if(M.tag===5||M.tag===6)h.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===n)break t;for(;M.sibling===null;){if(M.return===null||M.return===n)break t;M=M.return}M.sibling.return=M.return,M=M.sibling}n.stateNode=h;t:switch(Un(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break t;case"img":o=!0;break t;default:o=!1}o&&Sa(n)}}return Qe(n),lh(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&Sa(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(s(166));if(e=st.current,xr(n)){if(e=n.stateNode,r=n.memoizedProps,o=null,u=wn,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[cn]=n,e=!!(e.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||t_(e.nodeValue,r)),e||Ya(n,!0)}else e=bc(e).createTextNode(o),e[cn]=n,n.stateNode=e}return Qe(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(o=xr(n),r!==null){if(e===null){if(!o)throw Error(s(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[cn]=n}else Os(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Qe(n),e=!1}else r=vf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(fi(n),n):(fi(n),null);if((n.flags&128)!==0)throw Error(s(558))}return Qe(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=xr(n),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[cn]=n}else Os(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Qe(n),u=!1}else u=vf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(fi(n),n):(fi(n),null)}return fi(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,e=e!==null&&e.memoizedState!==null,r&&(o=n.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),lc(n,n.updateQueue),Qe(n),null);case 4:return Ut(),e===null&&Dh(n.stateNode.containerInfo),Qe(n),null;case 10:return _a(n.type),Qe(n),null;case 19:if(K(on),o=n.memoizedState,o===null)return Qe(n),null;if(u=(n.flags&128)!==0,h=o.rendering,h===null)if(u)Vo(o,!1);else{if(rn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Zl(e),h!==null){for(n.flags|=128,Vo(o,!1),e=h.updateQueue,n.updateQueue=e,lc(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)Lm(r,e),r=r.sibling;return Mt(on,on.current&1|2),Ce&&ma(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&E()>dc&&(n.flags|=128,u=!0,Vo(o,!1),n.lanes=4194304)}else{if(!u)if(e=Zl(h),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,lc(n,e),Vo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ce)return Qe(n),null}else 2*E()-o.renderingStartTime>dc&&r!==536870912&&(n.flags|=128,u=!0,Vo(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(e=o.last,e!==null?e.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=E(),e.sibling=null,r=on.current,Mt(on,u?r&1|2:r&1),Ce&&ma(n,o.treeForkCount),e):(Qe(n),null);case 22:case 23:return fi(n),Uf(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(Qe(n),n.subtreeFlags&6&&(n.flags|=8192)):Qe(n),r=n.updateQueue,r!==null&&lc(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),e!==null&&K(Fs),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),_a(hn),Qe(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function iS(e,n){switch(gf(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return _a(hn),Ut(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return ct(n),null;case 31:if(n.memoizedState!==null){if(fi(n),n.alternate===null)throw Error(s(340));Os()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(fi(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Os()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return K(on),null;case 4:return Ut(),null;case 10:return _a(n.type),null;case 22:case 23:return fi(n),Uf(),e!==null&&K(Fs),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return _a(hn),null;case 25:return null;default:return null}}function s0(e,n){switch(gf(n),n.tag){case 3:_a(hn),Ut();break;case 26:case 27:case 5:ct(n);break;case 4:Ut();break;case 31:n.memoizedState!==null&&fi(n);break;case 13:fi(n);break;case 19:K(on);break;case 10:_a(n.type);break;case 22:case 23:fi(n),Uf(),e!==null&&K(Fs);break;case 24:_a(hn)}}function ko(e,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var u=o.next;r=u;do{if((r.tag&e)===e){o=void 0;var h=r.create,M=r.inst;o=h(),M.destroy=o}r=r.next}while(r!==u)}}catch(L){He(n,n.return,L)}}function ts(e,n,r){try{var o=n.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var M=o.inst,L=M.destroy;if(L!==void 0){M.destroy=void 0,u=n;var W=r,dt=L;try{dt()}catch(Tt){He(u,W,Tt)}}}o=o.next}while(o!==h)}}catch(Tt){He(n,n.return,Tt)}}function r0(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{Km(n,r)}catch(o){He(e,e.return,o)}}}function o0(e,n,r){r.props=Vs(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(o){He(e,n,o)}}function Xo(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof r=="function"?e.refCleanup=r(o):r.current=o}}catch(u){He(e,n,u)}}function Ki(e,n){var r=e.ref,o=e.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(u){He(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(u){He(e,n,u)}else r.current=null}function l0(e){var n=e.type,r=e.memoizedProps,o=e.stateNode;try{t:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break t;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(u){He(e,e.return,u)}}function ch(e,n,r){try{var o=e.stateNode;TS(o,e.type,r,n),o[vn]=n}catch(u){He(e,e.return,u)}}function c0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&os(e.type)||e.tag===4}function uh(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||c0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&os(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fh(e,n,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=ha));else if(o!==4&&(o===27&&os(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(fh(e,n,r),e=e.sibling;e!==null;)fh(e,n,r),e=e.sibling}function cc(e,n,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(o!==4&&(o===27&&os(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(cc(e,n,r),e=e.sibling;e!==null;)cc(e,n,r),e=e.sibling}function u0(e){var n=e.stateNode,r=e.memoizedProps;try{for(var o=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);Un(n,o,r),n[cn]=e,n[vn]=r}catch(h){He(e,e.return,h)}}var Ma=!1,mn=!1,hh=!1,f0=typeof WeakSet=="function"?WeakSet:Set,Tn=null;function aS(e,n){if(e=e.containerInfo,Nh=Dc,e=bm(e),sf(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else t:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break t}var M=0,L=-1,W=-1,dt=0,Tt=0,Dt=e,mt=null;e:for(;;){for(var yt;Dt!==r||u!==0&&Dt.nodeType!==3||(L=M+u),Dt!==h||o!==0&&Dt.nodeType!==3||(W=M+o),Dt.nodeType===3&&(M+=Dt.nodeValue.length),(yt=Dt.firstChild)!==null;)mt=Dt,Dt=yt;for(;;){if(Dt===e)break e;if(mt===r&&++dt===u&&(L=M),mt===h&&++Tt===o&&(W=M),(yt=Dt.nextSibling)!==null)break;Dt=mt,mt=Dt.parentNode}Dt=yt}r=L===-1||W===-1?null:{start:L,end:W}}else r=null}r=r||{start:0,end:0}}else r=null;for(Oh={focusedElem:e,selectionRange:r},Dc=!1,Tn=n;Tn!==null;)if(n=Tn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Tn=e;else for(;Tn!==null;){switch(n=Tn,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)u=e[r],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,u=h.memoizedProps,h=h.memoizedState,o=r.stateNode;try{var Qt=Vs(r.type,u);e=o.getSnapshotBeforeUpdate(Qt,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(le){He(r,r.return,le)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)Fh(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Fh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=n.sibling,e!==null){e.return=n.return,Tn=e;break}Tn=n.return}}function h0(e,n,r){var o=r.flags;switch(r.tag){case 0:case 11:case 15:Ea(e,r),o&4&&ko(5,r);break;case 1:if(Ea(e,r),o&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(M){He(r,r.return,M)}else{var u=Vs(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(M){He(r,r.return,M)}}o&64&&r0(r),o&512&&Xo(r,r.return);break;case 3:if(Ea(e,r),o&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{Km(e,n)}catch(M){He(r,r.return,M)}}break;case 27:n===null&&o&4&&u0(r);case 26:case 5:Ea(e,r),n===null&&o&4&&l0(r),o&512&&Xo(r,r.return);break;case 12:Ea(e,r);break;case 31:Ea(e,r),o&4&&m0(e,r);break;case 13:Ea(e,r),o&4&&g0(e,r),o&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=dS.bind(null,r),NS(e,r))));break;case 22:if(o=r.memoizedState!==null||Ma,!o){n=n!==null&&n.memoizedState!==null||mn,u=Ma;var h=mn;Ma=o,(mn=n)&&!h?Ta(e,r,(r.subtreeFlags&8772)!==0):Ea(e,r),Ma=u,mn=h}break;case 30:break;default:Ea(e,r)}}function d0(e){var n=e.alternate;n!==null&&(e.alternate=null,d0(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&vo(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var tn=null,Jn=!1;function ba(e,n,r){for(r=r.child;r!==null;)p0(e,n,r),r=r.sibling}function p0(e,n,r){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(xt,r)}catch{}switch(r.tag){case 26:mn||Ki(r,n),ba(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:mn||Ki(r,n);var o=tn,u=Jn;os(r.type)&&(tn=r.stateNode,Jn=!1),ba(e,n,r),$o(r.stateNode),tn=o,Jn=u;break;case 5:mn||Ki(r,n);case 6:if(o=tn,u=Jn,tn=null,ba(e,n,r),tn=o,Jn=u,tn!==null)if(Jn)try{(tn.nodeType===9?tn.body:tn.nodeName==="HTML"?tn.ownerDocument.body:tn).removeChild(r.stateNode)}catch(h){He(r,n,h)}else try{tn.removeChild(r.stateNode)}catch(h){He(r,n,h)}break;case 18:tn!==null&&(Jn?(e=tn,r_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Hr(e)):r_(tn,r.stateNode));break;case 4:o=tn,u=Jn,tn=r.stateNode.containerInfo,Jn=!0,ba(e,n,r),tn=o,Jn=u;break;case 0:case 11:case 14:case 15:ts(2,r,n),mn||ts(4,r,n),ba(e,n,r);break;case 1:mn||(Ki(r,n),o=r.stateNode,typeof o.componentWillUnmount=="function"&&o0(r,n,o)),ba(e,n,r);break;case 21:ba(e,n,r);break;case 22:mn=(o=mn)||r.memoizedState!==null,ba(e,n,r),mn=o;break;default:ba(e,n,r)}}function m0(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hr(e)}catch(r){He(n,n.return,r)}}}function g0(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hr(e)}catch(r){He(n,n.return,r)}}function sS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new f0),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new f0),n;default:throw Error(s(435,e.tag))}}function uc(e,n){var r=sS(e);n.forEach(function(o){if(!r.has(o)){r.add(o);var u=pS.bind(null,e,o);o.then(u,u)}})}function $n(e,n){var r=n.deletions;if(r!==null)for(var o=0;o<r.length;o++){var u=r[o],h=e,M=n,L=M;t:for(;L!==null;){switch(L.tag){case 27:if(os(L.type)){tn=L.stateNode,Jn=!1;break t}break;case 5:tn=L.stateNode,Jn=!1;break t;case 3:case 4:tn=L.stateNode.containerInfo,Jn=!0;break t}L=L.return}if(tn===null)throw Error(s(160));p0(h,M,u),tn=null,Jn=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)_0(n,e),n=n.sibling}var zi=null;function _0(e,n){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$n(n,e),ti(e),o&4&&(ts(3,e,e.return),ko(3,e),ts(5,e,e.return));break;case 1:$n(n,e),ti(e),o&512&&(mn||r===null||Ki(r,r.return)),o&64&&Ma&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?o:r.concat(o))));break;case 26:var u=zi;if($n(n,e),ti(e),o&512&&(mn||r===null||Ki(r,r.return)),o&4){var h=r!==null?r.memoizedState:null;if(o=e.memoizedState,r===null)if(o===null)if(e.stateNode===null){t:{o=e.type,r=e.memoizedProps,u=u.ownerDocument||u;e:switch(o){case"title":h=u.getElementsByTagName("title")[0],(!h||h[Rs]||h[cn]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),Un(h,o,r),h[cn]=e,J(h),o=h;break t;case"link":var M=__("link","href",u).get(o+(r.href||""));if(M){for(var L=0;L<M.length;L++)if(h=M[L],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){M.splice(L,1);break e}}h=u.createElement(o),Un(h,o,r),u.head.appendChild(h);break;case"meta":if(M=__("meta","content",u).get(o+(r.content||""))){for(L=0;L<M.length;L++)if(h=M[L],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){M.splice(L,1);break e}}h=u.createElement(o),Un(h,o,r),u.head.appendChild(h);break;default:throw Error(s(468,o))}h[cn]=e,J(h),o=h}e.stateNode=o}else v_(u,e.type,e.stateNode);else e.stateNode=g_(u,o,e.memoizedProps);else h!==o?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,o===null?v_(u,e.type,e.stateNode):g_(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&ch(e,e.memoizedProps,r.memoizedProps)}break;case 27:$n(n,e),ti(e),o&512&&(mn||r===null||Ki(r,r.return)),r!==null&&o&4&&ch(e,e.memoizedProps,r.memoizedProps);break;case 5:if($n(n,e),ti(e),o&512&&(mn||r===null||Ki(r,r.return)),e.flags&32){u=e.stateNode;try{qn(u,"")}catch(Qt){He(e,e.return,Qt)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,ch(e,u,r!==null?r.memoizedProps:u)),o&1024&&(hh=!0);break;case 6:if($n(n,e),ti(e),o&4){if(e.stateNode===null)throw Error(s(162));o=e.memoizedProps,r=e.stateNode;try{r.nodeValue=o}catch(Qt){He(e,e.return,Qt)}}break;case 3:if(Ac=null,u=zi,zi=Ec(n.containerInfo),$n(n,e),zi=u,ti(e),o&4&&r!==null&&r.memoizedState.isDehydrated)try{Hr(n.containerInfo)}catch(Qt){He(e,e.return,Qt)}hh&&(hh=!1,v0(e));break;case 4:o=zi,zi=Ec(e.stateNode.containerInfo),$n(n,e),ti(e),zi=o;break;case 12:$n(n,e),ti(e);break;case 31:$n(n,e),ti(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,uc(e,o)));break;case 13:$n(n,e),ti(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hc=E()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,uc(e,o)));break;case 22:u=e.memoizedState!==null;var W=r!==null&&r.memoizedState!==null,dt=Ma,Tt=mn;if(Ma=dt||u,mn=Tt||W,$n(n,e),mn=Tt,Ma=dt,ti(e),o&8192)t:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(r===null||W||Ma||mn||ks(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){W=r=n;try{if(h=W.stateNode,u)M=h.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{L=W.stateNode;var Dt=W.memoizedProps.style,mt=Dt!=null&&Dt.hasOwnProperty("display")?Dt.display:null;L.style.display=mt==null||typeof mt=="boolean"?"":(""+mt).trim()}}catch(Qt){He(W,W.return,Qt)}}}else if(n.tag===6){if(r===null){W=n;try{W.stateNode.nodeValue=u?"":W.memoizedProps}catch(Qt){He(W,W.return,Qt)}}}else if(n.tag===18){if(r===null){W=n;try{var yt=W.stateNode;u?o_(yt,!0):o_(W.stateNode,!1)}catch(Qt){He(W,W.return,Qt)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break t;for(;n.sibling===null;){if(n.return===null||n.return===e)break t;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(r=o.retryQueue,r!==null&&(o.retryQueue=null,uc(e,r))));break;case 19:$n(n,e),ti(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,uc(e,o)));break;case 30:break;case 21:break;default:$n(n,e),ti(e)}}function ti(e){var n=e.flags;if(n&2){try{for(var r,o=e.return;o!==null;){if(c0(o)){r=o;break}o=o.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var u=r.stateNode,h=uh(e);cc(e,h,u);break;case 5:var M=r.stateNode;r.flags&32&&(qn(M,""),r.flags&=-33);var L=uh(e);cc(e,L,M);break;case 3:case 4:var W=r.stateNode.containerInfo,dt=uh(e);fh(e,dt,W);break;default:throw Error(s(161))}}catch(Tt){He(e,e.return,Tt)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function v0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;v0(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Ea(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)h0(e,n.alternate,n),n=n.sibling}function ks(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ts(4,n,n.return),ks(n);break;case 1:Ki(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&o0(n,n.return,r),ks(n);break;case 27:$o(n.stateNode);case 26:case 5:Ki(n,n.return),ks(n);break;case 22:n.memoizedState===null&&ks(n);break;case 30:ks(n);break;default:ks(n)}e=e.sibling}}function Ta(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,u=e,h=n,M=h.flags;switch(h.tag){case 0:case 11:case 15:Ta(u,h,r),ko(4,h);break;case 1:if(Ta(u,h,r),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(dt){He(o,o.return,dt)}if(o=h,u=o.updateQueue,u!==null){var L=o.stateNode;try{var W=u.shared.hiddenCallbacks;if(W!==null)for(u.shared.hiddenCallbacks=null,u=0;u<W.length;u++)Zm(W[u],L)}catch(dt){He(o,o.return,dt)}}r&&M&64&&r0(h),Xo(h,h.return);break;case 27:u0(h);case 26:case 5:Ta(u,h,r),r&&o===null&&M&4&&l0(h),Xo(h,h.return);break;case 12:Ta(u,h,r);break;case 31:Ta(u,h,r),r&&M&4&&m0(u,h);break;case 13:Ta(u,h,r),r&&M&4&&g0(u,h);break;case 22:h.memoizedState===null&&Ta(u,h,r),Xo(h,h.return);break;case 30:break;default:Ta(u,h,r)}n=n.sibling}}function dh(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Do(r))}function ph(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Do(e))}function Fi(e,n,r,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)x0(e,n,r,o),n=n.sibling}function x0(e,n,r,o){var u=n.flags;switch(n.tag){case 0:case 11:case 15:Fi(e,n,r,o),u&2048&&ko(9,n);break;case 1:Fi(e,n,r,o);break;case 3:Fi(e,n,r,o),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Do(e)));break;case 12:if(u&2048){Fi(e,n,r,o),e=n.stateNode;try{var h=n.memoizedProps,M=h.id,L=h.onPostCommit;typeof L=="function"&&L(M,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(W){He(n,n.return,W)}}else Fi(e,n,r,o);break;case 31:Fi(e,n,r,o);break;case 13:Fi(e,n,r,o);break;case 23:break;case 22:h=n.stateNode,M=n.alternate,n.memoizedState!==null?h._visibility&2?Fi(e,n,r,o):Wo(e,n):h._visibility&2?Fi(e,n,r,o):(h._visibility|=2,Cr(e,n,r,o,(n.subtreeFlags&10256)!==0||!1)),u&2048&&dh(M,n);break;case 24:Fi(e,n,r,o),u&2048&&ph(n.alternate,n);break;default:Fi(e,n,r,o)}}function Cr(e,n,r,o,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,M=n,L=r,W=o,dt=M.flags;switch(M.tag){case 0:case 11:case 15:Cr(h,M,L,W,u),ko(8,M);break;case 23:break;case 22:var Tt=M.stateNode;M.memoizedState!==null?Tt._visibility&2?Cr(h,M,L,W,u):Wo(h,M):(Tt._visibility|=2,Cr(h,M,L,W,u)),u&&dt&2048&&dh(M.alternate,M);break;case 24:Cr(h,M,L,W,u),u&&dt&2048&&ph(M.alternate,M);break;default:Cr(h,M,L,W,u)}n=n.sibling}}function Wo(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,o=n,u=o.flags;switch(o.tag){case 22:Wo(r,o),u&2048&&dh(o.alternate,o);break;case 24:Wo(r,o),u&2048&&ph(o.alternate,o);break;default:Wo(r,o)}n=n.sibling}}var qo=8192;function Dr(e,n,r){if(e.subtreeFlags&qo)for(e=e.child;e!==null;)y0(e,n,r),e=e.sibling}function y0(e,n,r){switch(e.tag){case 26:Dr(e,n,r),e.flags&qo&&e.memoizedState!==null&&WS(r,zi,e.memoizedState,e.memoizedProps);break;case 5:Dr(e,n,r);break;case 3:case 4:var o=zi;zi=Ec(e.stateNode.containerInfo),Dr(e,n,r),zi=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=qo,qo=16777216,Dr(e,n,r),qo=o):Dr(e,n,r));break;default:Dr(e,n,r)}}function S0(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Yo(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];Tn=o,b0(o,e)}S0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)M0(e),e=e.sibling}function M0(e){switch(e.tag){case 0:case 11:case 15:Yo(e),e.flags&2048&&ts(9,e,e.return);break;case 3:Yo(e);break;case 12:Yo(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,fc(e)):Yo(e);break;default:Yo(e)}}function fc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];Tn=o,b0(o,e)}S0(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ts(8,n,n.return),fc(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,fc(n));break;default:fc(n)}e=e.sibling}}function b0(e,n){for(;Tn!==null;){var r=Tn;switch(r.tag){case 0:case 11:case 15:ts(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var o=r.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Do(r.memoizedState.cache)}if(o=r.child,o!==null)o.return=r,Tn=o;else t:for(r=e;Tn!==null;){o=Tn;var u=o.sibling,h=o.return;if(d0(o),o===r){Tn=null;break t}if(u!==null){u.return=h,Tn=u;break t}Tn=h}}}var rS={getCacheForType:function(e){var n=Cn(hn),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return Cn(hn).controller.signal}},oS=typeof WeakMap=="function"?WeakMap:Map,ze=0,Ye=null,Te=null,Re=0,Be=0,hi=null,es=!1,Ur=!1,mh=!1,Aa=0,rn=0,ns=0,Xs=0,gh=0,di=0,Lr=0,jo=null,ei=null,_h=!1,hc=0,E0=0,dc=1/0,pc=null,is=null,yn=0,as=null,Nr=null,Ra=0,vh=0,xh=null,T0=null,Zo=0,yh=null;function pi(){return(ze&2)!==0&&Re!==0?Re&-Re:z.T!==null?Ah():Yi()}function A0(){if(di===0)if((Re&536870912)===0||Ce){var e=Ft;Ft<<=1,(Ft&3932160)===0&&(Ft=262144),di=e}else di=536870912;return e=ui.current,e!==null&&(e.flags|=32),di}function ni(e,n,r){(e===Ye&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(Or(e,0),ss(e,Re,di,!1)),kn(e,r),((ze&2)===0||e!==Ye)&&(e===Ye&&((ze&2)===0&&(Xs|=r),rn===4&&ss(e,Re,di,!1)),Qi(e))}function R0(e,n,r){if((ze&6)!==0)throw Error(s(327));var o=!r&&(n&127)===0&&(n&e.expiredLanes)===0||jt(e,n),u=o?uS(e,n):Mh(e,n,!0),h=o;do{if(u===0){Ur&&!o&&ss(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!lS(r)){u=Mh(e,n,!1),h=!1;continue}if(u===2){if(h=n,e.errorRecoveryDisabledLanes&h)var M=0;else M=e.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){n=M;t:{var L=e;u=jo;var W=L.current.memoizedState.isDehydrated;if(W&&(Or(L,M).flags|=256),M=Mh(L,M,!1),M!==2){if(mh&&!W){L.errorRecoveryDisabledLanes|=h,Xs|=h,u=4;break t}h=ei,ei=u,h!==null&&(ei===null?ei=h:ei.push.apply(ei,h))}u=M}if(h=!1,u!==2)continue}}if(u===1){Or(e,0),ss(e,n,0,!0);break}t:{switch(o=e,h=u,h){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:ss(o,n,di,!es);break t;case 2:ei=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(u=hc+300-E(),10<u)){if(ss(o,n,di,!es),bt(o,0,!0)!==0)break t;Ra=n,o.timeoutHandle=a_(w0.bind(null,o,r,ei,pc,_h,n,di,Xs,Lr,es,h,"Throttled",-0,0),u);break t}w0(o,r,ei,pc,_h,n,di,Xs,Lr,es,h,null,-0,0)}}break}while(!0);Qi(e)}function w0(e,n,r,o,u,h,M,L,W,dt,Tt,Dt,mt,yt){if(e.timeoutHandle=-1,Dt=n.subtreeFlags,Dt&8192||(Dt&16785408)===16785408){Dt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ha},y0(n,h,Dt);var Qt=(h&62914560)===h?hc-E():(h&4194048)===h?E0-E():0;if(Qt=qS(Dt,Qt),Qt!==null){Ra=h,e.cancelPendingCommit=Qt(z0.bind(null,e,n,h,r,o,u,M,L,W,Tt,Dt,null,mt,yt)),ss(e,h,M,!dt);return}}z0(e,n,h,r,o,u,M,L,W)}function lS(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var o=0;o<r.length;o++){var u=r[o],h=u.getSnapshot;u=u.value;try{if(!li(h(),u))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ss(e,n,r,o){n&=~gh,n&=~Xs,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var u=n;0<u;){var h=31-Lt(u),M=1<<h;o[h]=-1,u&=~M}r!==0&&_o(e,r,n)}function mc(){return(ze&6)===0?(Ko(0),!1):!0}function Sh(){if(Te!==null){if(Be===0)var e=Te.return;else e=Te,ga=Ps=null,Ff(e),Er=null,Lo=0,e=Te;for(;e!==null;)s0(e.alternate,e),e=e.return;Te=null}}function Or(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,wS(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Ra=0,Sh(),Ye=e,Te=r=pa(e.current,null),Re=n,Be=0,hi=null,es=!1,Ur=jt(e,n),mh=!1,Lr=di=gh=Xs=ns=rn=0,ei=jo=null,_h=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var u=31-Lt(o),h=1<<u;n|=e[u],o&=~h}return Aa=n,zl(),r}function C0(e,n){xe=null,z.H=Ho,n===br||n===Xl?(n=Wm(),Be=3):n===Tf?(n=Wm(),Be=4):Be=n===$f?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,hi=n,Te===null&&(rn=1,ac(e,Si(n,e.current)))}function D0(){var e=ui.current;return e===null?!0:(Re&4194048)===Re?Ti===null:(Re&62914560)===Re||(Re&536870912)!==0?e===Ti:!1}function U0(){var e=z.H;return z.H=Ho,e===null?Ho:e}function L0(){var e=z.A;return z.A=rS,e}function gc(){rn=4,es||(Re&4194048)!==Re&&ui.current!==null||(Ur=!0),(ns&134217727)===0&&(Xs&134217727)===0||Ye===null||ss(Ye,Re,di,!1)}function Mh(e,n,r){var o=ze;ze|=2;var u=U0(),h=L0();(Ye!==e||Re!==n)&&(pc=null,Or(e,n)),n=!1;var M=rn;t:do try{if(Be!==0&&Te!==null){var L=Te,W=hi;switch(Be){case 8:Sh(),M=6;break t;case 3:case 2:case 9:case 6:ui.current===null&&(n=!0);var dt=Be;if(Be=0,hi=null,Pr(e,L,W,dt),r&&Ur){M=0;break t}break;default:dt=Be,Be=0,hi=null,Pr(e,L,W,dt)}}cS(),M=rn;break}catch(Tt){C0(e,Tt)}while(!0);return n&&e.shellSuspendCounter++,ga=Ps=null,ze=o,z.H=u,z.A=h,Te===null&&(Ye=null,Re=0,zl()),M}function cS(){for(;Te!==null;)N0(Te)}function uS(e,n){var r=ze;ze|=2;var o=U0(),u=L0();Ye!==e||Re!==n?(pc=null,dc=E()+500,Or(e,n)):Ur=jt(e,n);t:do try{if(Be!==0&&Te!==null){n=Te;var h=hi;e:switch(Be){case 1:Be=0,hi=null,Pr(e,n,h,1);break;case 2:case 9:if(km(h)){Be=0,hi=null,O0(n);break}n=function(){Be!==2&&Be!==9||Ye!==e||(Be=7),Qi(e)},h.then(n,n);break t;case 3:Be=7;break t;case 4:Be=5;break t;case 7:km(h)?(Be=0,hi=null,O0(n)):(Be=0,hi=null,Pr(e,n,h,7));break;case 5:var M=null;switch(Te.tag){case 26:M=Te.memoizedState;case 5:case 27:var L=Te;if(M?x_(M):L.stateNode.complete){Be=0,hi=null;var W=L.sibling;if(W!==null)Te=W;else{var dt=L.return;dt!==null?(Te=dt,_c(dt)):Te=null}break e}}Be=0,hi=null,Pr(e,n,h,5);break;case 6:Be=0,hi=null,Pr(e,n,h,6);break;case 8:Sh(),rn=6;break t;default:throw Error(s(462))}}fS();break}catch(Tt){C0(e,Tt)}while(!0);return ga=Ps=null,z.H=o,z.A=u,ze=r,Te!==null?0:(Ye=null,Re=0,zl(),rn)}function fS(){for(;Te!==null&&!Pt();)N0(Te)}function N0(e){var n=i0(e.alternate,e,Aa);e.memoizedProps=e.pendingProps,n===null?_c(e):Te=n}function O0(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=Qg(r,n,n.pendingProps,n.type,void 0,Re);break;case 11:n=Qg(r,n,n.pendingProps,n.type.render,n.ref,Re);break;case 5:Ff(n);default:s0(r,n),n=Te=Lm(n,Aa),n=i0(r,n,Aa)}e.memoizedProps=e.pendingProps,n===null?_c(e):Te=n}function Pr(e,n,r,o){ga=Ps=null,Ff(n),Er=null,Lo=0;var u=n.return;try{if($y(e,u,n,r,Re)){rn=1,ac(e,Si(r,e.current)),Te=null;return}}catch(h){if(u!==null)throw Te=u,h;rn=1,ac(e,Si(r,e.current)),Te=null;return}n.flags&32768?(Ce||o===1?e=!0:Ur||(Re&536870912)!==0?e=!1:(es=e=!0,(o===2||o===9||o===3||o===6)&&(o=ui.current,o!==null&&o.tag===13&&(o.flags|=16384))),P0(n,e)):_c(n)}function _c(e){var n=e;do{if((n.flags&32768)!==0){P0(n,es);return}e=n.return;var r=nS(n.alternate,n,Aa);if(r!==null){Te=r;return}if(n=n.sibling,n!==null){Te=n;return}Te=n=e}while(n!==null);rn===0&&(rn=5)}function P0(e,n){do{var r=iS(e.alternate,e);if(r!==null){r.flags&=32767,Te=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){Te=e;return}Te=e=r}while(e!==null);rn=6,Te=null}function z0(e,n,r,o,u,h,M,L,W){e.cancelPendingCommit=null;do vc();while(yn!==0);if((ze&6)!==0)throw Error(s(327));if(n!==null){if(n===e.current)throw Error(s(177));if(h=n.lanes|n.childLanes,h|=uf,Ui(e,r,h,M,L,W),e===Ye&&(Te=Ye=null,Re=0),Nr=n,as=e,Ra=r,vh=h,xh=u,T0=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,mS(P,function(){return G0(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=z.T,z.T=null,u=A.p,A.p=2,M=ze,ze|=4;try{aS(e,n,r)}finally{ze=M,A.p=u,z.T=o}}yn=1,F0(),I0(),B0()}}function F0(){if(yn===1){yn=0;var e=as,n=Nr,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=z.T,z.T=null;var o=A.p;A.p=2;var u=ze;ze|=4;try{_0(n,e);var h=Oh,M=bm(e.containerInfo),L=h.focusedElem,W=h.selectionRange;if(M!==L&&L&&L.ownerDocument&&Mm(L.ownerDocument.documentElement,L)){if(W!==null&&sf(L)){var dt=W.start,Tt=W.end;if(Tt===void 0&&(Tt=dt),"selectionStart"in L)L.selectionStart=dt,L.selectionEnd=Math.min(Tt,L.value.length);else{var Dt=L.ownerDocument||document,mt=Dt&&Dt.defaultView||window;if(mt.getSelection){var yt=mt.getSelection(),Qt=L.textContent.length,le=Math.min(W.start,Qt),We=W.end===void 0?le:Math.min(W.end,Qt);!yt.extend&&le>We&&(M=We,We=le,le=M);var at=Sm(L,le),Z=Sm(L,We);if(at&&Z&&(yt.rangeCount!==1||yt.anchorNode!==at.node||yt.anchorOffset!==at.offset||yt.focusNode!==Z.node||yt.focusOffset!==Z.offset)){var ft=Dt.createRange();ft.setStart(at.node,at.offset),yt.removeAllRanges(),le>We?(yt.addRange(ft),yt.extend(Z.node,Z.offset)):(ft.setEnd(Z.node,Z.offset),yt.addRange(ft))}}}}for(Dt=[],yt=L;yt=yt.parentNode;)yt.nodeType===1&&Dt.push({element:yt,left:yt.scrollLeft,top:yt.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Dt.length;L++){var Rt=Dt[L];Rt.element.scrollLeft=Rt.left,Rt.element.scrollTop=Rt.top}}Dc=!!Nh,Oh=Nh=null}finally{ze=u,A.p=o,z.T=r}}e.current=n,yn=2}}function I0(){if(yn===2){yn=0;var e=as,n=Nr,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=z.T,z.T=null;var o=A.p;A.p=2;var u=ze;ze|=4;try{h0(e,n.alternate,n)}finally{ze=u,A.p=o,z.T=r}}yn=3}}function B0(){if(yn===4||yn===3){yn=0,O();var e=as,n=Nr,r=Ra,o=T0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?yn=5:(yn=0,Nr=as=null,H0(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(is=null),or(r),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(xt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=z.T,u=A.p,A.p=2,z.T=null;try{for(var h=e.onRecoverableError,M=0;M<o.length;M++){var L=o[M];h(L.value,{componentStack:L.stack})}}finally{z.T=n,A.p=u}}(Ra&3)!==0&&vc(),Qi(e),u=e.pendingLanes,(r&261930)!==0&&(u&42)!==0?e===yh?Zo++:(Zo=0,yh=e):Zo=0,Ko(0)}}function H0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Do(n)))}function vc(){return F0(),I0(),B0(),G0()}function G0(){if(yn!==5)return!1;var e=as,n=vh;vh=0;var r=or(Ra),o=z.T,u=A.p;try{A.p=32>r?32:r,z.T=null,r=xh,xh=null;var h=as,M=Ra;if(yn=0,Nr=as=null,Ra=0,(ze&6)!==0)throw Error(s(331));var L=ze;if(ze|=4,M0(h.current),x0(h,h.current,M,r),ze=L,Ko(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(xt,h)}catch{}return!0}finally{A.p=u,z.T=o,H0(e,n)}}function V0(e,n,r){n=Si(r,n),n=Jf(e.stateNode,n,2),e=Qa(e,n,2),e!==null&&(kn(e,2),Qi(e))}function He(e,n,r){if(e.tag===3)V0(e,e,r);else for(;n!==null;){if(n.tag===3){V0(n,e,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(is===null||!is.has(o))){e=Si(r,e),r=kg(2),o=Qa(n,r,2),o!==null&&(Xg(r,o,n,e),kn(o,2),Qi(o));break}}n=n.return}}function bh(e,n,r){var o=e.pingCache;if(o===null){o=e.pingCache=new oS;var u=new Set;o.set(n,u)}else u=o.get(n),u===void 0&&(u=new Set,o.set(n,u));u.has(r)||(mh=!0,u.add(r),e=hS.bind(null,e,n,r),n.then(e,e))}function hS(e,n,r){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Ye===e&&(Re&r)===r&&(rn===4||rn===3&&(Re&62914560)===Re&&300>E()-hc?(ze&2)===0&&Or(e,0):gh|=r,Lr===Re&&(Lr=0)),Qi(e)}function k0(e,n){n===0&&(n=Ie()),e=Ls(e,n),e!==null&&(kn(e,n),Qi(e))}function dS(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),k0(e,r)}function pS(e,n){var r=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(r=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(n),k0(e,r)}function mS(e,n){return Jt(e,n)}var xc=null,zr=null,Eh=!1,yc=!1,Th=!1,rs=0;function Qi(e){e!==zr&&e.next===null&&(zr===null?xc=zr=e:zr=zr.next=e),yc=!0,Eh||(Eh=!0,_S())}function Ko(e,n){if(!Th&&yc){Th=!0;do for(var r=!1,o=xc;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var M=o.suspendedLanes,L=o.pingedLanes;h=(1<<31-Lt(42|e)+1)-1,h&=u&~(M&~L),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,Y0(o,h))}else h=Re,h=bt(o,o===Ye?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||jt(o,h)||(r=!0,Y0(o,h));o=o.next}while(r);Th=!1}}function gS(){X0()}function X0(){yc=Eh=!1;var e=0;rs!==0&&RS()&&(e=rs);for(var n=E(),r=null,o=xc;o!==null;){var u=o.next,h=W0(o,n);h===0?(o.next=null,r===null?xc=u:r.next=u,u===null&&(zr=r)):(r=o,(e!==0||(h&3)!==0)&&(yc=!0)),o=u}yn!==0&&yn!==5||Ko(e),rs!==0&&(rs=0)}function W0(e,n){for(var r=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var M=31-Lt(h),L=1<<M,W=u[M];W===-1?((L&r)===0||(L&o)!==0)&&(u[M]=he(L,n)):W<=n&&(e.expiredLanes|=L),h&=~L}if(n=Ye,r=Re,r=bt(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,r===0||e===n&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&ne(o),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||jt(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(o!==null&&ne(o),or(r)){case 2:case 8:r=k;break;case 32:r=P;break;case 268435456:r=rt;break;default:r=P}return o=q0.bind(null,e),r=Jt(r,o),e.callbackPriority=n,e.callbackNode=r,n}return o!==null&&o!==null&&ne(o),e.callbackPriority=2,e.callbackNode=null,2}function q0(e,n){if(yn!==0&&yn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(vc()&&e.callbackNode!==r)return null;var o=Re;return o=bt(e,e===Ye?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(R0(e,o,n),W0(e,E()),e.callbackNode!=null&&e.callbackNode===r?q0.bind(null,e):null)}function Y0(e,n){if(vc())return null;R0(e,n,!0)}function _S(){CS(function(){(ze&6)!==0?Jt($,gS):X0()})}function Ah(){if(rs===0){var e=Sr;e===0&&(e=zt,zt<<=1,(zt&261888)===0&&(zt=256)),rs=e}return rs}function j0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:wl(""+e)}function Z0(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function vS(e,n,r,o,u){if(n==="submit"&&r&&r.stateNode===u){var h=j0((u[vn]||null).action),M=o.submitter;M&&(n=(n=M[vn]||null)?j0(n.formAction):M.getAttribute("formAction"),n!==null&&(h=n,M=null));var L=new Ll("action","action",null,o,u);e.push({event:L,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(rs!==0){var W=M?Z0(u,M):new FormData(u);qf(r,{pending:!0,data:W,method:u.method,action:h},null,W)}}else typeof h=="function"&&(L.preventDefault(),W=M?Z0(u,M):new FormData(u),qf(r,{pending:!0,data:W,method:u.method,action:h},h,W))},currentTarget:u}]})}}for(var Rh=0;Rh<cf.length;Rh++){var wh=cf[Rh],xS=wh.toLowerCase(),yS=wh[0].toUpperCase()+wh.slice(1);Pi(xS,"on"+yS)}Pi(Am,"onAnimationEnd"),Pi(Rm,"onAnimationIteration"),Pi(wm,"onAnimationStart"),Pi("dblclick","onDoubleClick"),Pi("focusin","onFocus"),Pi("focusout","onBlur"),Pi(zy,"onTransitionRun"),Pi(Fy,"onTransitionStart"),Pi(Iy,"onTransitionCancel"),Pi(Cm,"onTransitionEnd"),Ht("onMouseEnter",["mouseout","mouseover"]),Ht("onMouseLeave",["mouseout","mouseover"]),Ht("onPointerEnter",["pointerout","pointerover"]),Ht("onPointerLeave",["pointerout","pointerover"]),ut("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ut("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ut("onBeforeInput",["compositionend","keypress","textInput","paste"]),ut("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ut("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ut("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="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(" "),SS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function K0(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var o=e[r],u=o.event;o=o.listeners;t:{var h=void 0;if(n)for(var M=o.length-1;0<=M;M--){var L=o[M],W=L.instance,dt=L.currentTarget;if(L=L.listener,W!==h&&u.isPropagationStopped())break t;h=L,u.currentTarget=dt;try{h(u)}catch(Tt){Pl(Tt)}u.currentTarget=null,h=W}else for(M=0;M<o.length;M++){if(L=o[M],W=L.instance,dt=L.currentTarget,L=L.listener,W!==h&&u.isPropagationStopped())break t;h=L,u.currentTarget=dt;try{h(u)}catch(Tt){Pl(Tt)}u.currentTarget=null,h=W}}}}function Ae(e,n){var r=n[Ga];r===void 0&&(r=n[Ga]=new Set);var o=e+"__bubble";r.has(o)||(Q0(n,e,2,!1),r.add(o))}function Ch(e,n,r){var o=0;n&&(o|=4),Q0(r,e,o,n)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function Dh(e){if(!e[Sc]){e[Sc]=!0,vt.forEach(function(r){r!=="selectionchange"&&(SS.has(r)||Ch(r,!1,e),Ch(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Sc]||(n[Sc]=!0,Ch("selectionchange",!1,n))}}function Q0(e,n,r,o){switch(A_(n)){case 2:var u=ZS;break;case 8:u=KS;break;default:u=Wh}r=u.bind(null,n,r,e),u=void 0,!Zu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(n,r,{capture:!0,passive:u}):e.addEventListener(n,r,!0):u!==void 0?e.addEventListener(n,r,{passive:u}):e.addEventListener(n,r,!1)}function Uh(e,n,r,o,u){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)t:for(;;){if(o===null)return;var M=o.tag;if(M===3||M===4){var L=o.stateNode.containerInfo;if(L===u)break;if(M===4)for(M=o.return;M!==null;){var W=M.tag;if((W===3||W===4)&&M.stateNode.containerInfo===u)return;M=M.return}for(;L!==null;){if(M=Va(L),M===null)return;if(W=M.tag,W===5||W===6||W===26||W===27){o=h=M;continue t}L=L.parentNode}}o=o.return}nm(function(){var dt=h,Tt=Yu(r),Dt=[];t:{var mt=Dm.get(e);if(mt!==void 0){var yt=Ll,Qt=e;switch(e){case"keypress":if(Dl(r)===0)break t;case"keydown":case"keyup":yt=py;break;case"focusin":Qt="focus",yt=$u;break;case"focusout":Qt="blur",yt=$u;break;case"beforeblur":case"afterblur":yt=$u;break;case"click":if(r.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":yt=sm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":yt=ny;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":yt=_y;break;case Am:case Rm:case wm:yt=sy;break;case Cm:yt=xy;break;case"scroll":case"scrollend":yt=ty;break;case"wheel":yt=Sy;break;case"copy":case"cut":case"paste":yt=oy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":yt=om;break;case"toggle":case"beforetoggle":yt=by}var le=(n&4)!==0,We=!le&&(e==="scroll"||e==="scrollend"),at=le?mt!==null?mt+"Capture":null:mt;le=[];for(var Z=dt,ft;Z!==null;){var Rt=Z;if(ft=Rt.stateNode,Rt=Rt.tag,Rt!==5&&Rt!==26&&Rt!==27||ft===null||at===null||(Rt=xo(Z,at),Rt!=null&&le.push(Jo(Z,Rt,ft))),We)break;Z=Z.return}0<le.length&&(mt=new yt(mt,Qt,null,r,Tt),Dt.push({event:mt,listeners:le}))}}if((n&7)===0){t:{if(mt=e==="mouseover"||e==="pointerover",yt=e==="mouseout"||e==="pointerout",mt&&r!==qu&&(Qt=r.relatedTarget||r.fromElement)&&(Va(Qt)||Qt[ua]))break t;if((yt||mt)&&(mt=Tt.window===Tt?Tt:(mt=Tt.ownerDocument)?mt.defaultView||mt.parentWindow:window,yt?(Qt=r.relatedTarget||r.toElement,yt=dt,Qt=Qt?Va(Qt):null,Qt!==null&&(We=c(Qt),le=Qt.tag,Qt!==We||le!==5&&le!==27&&le!==6)&&(Qt=null)):(yt=null,Qt=dt),yt!==Qt)){if(le=sm,Rt="onMouseLeave",at="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(le=om,Rt="onPointerLeave",at="onPointerEnter",Z="pointer"),We=yt==null?mt:ws(yt),ft=Qt==null?mt:ws(Qt),mt=new le(Rt,Z+"leave",yt,r,Tt),mt.target=We,mt.relatedTarget=ft,Rt=null,Va(Tt)===dt&&(le=new le(at,Z+"enter",Qt,r,Tt),le.target=ft,le.relatedTarget=We,Rt=le),We=Rt,yt&&Qt)e:{for(le=MS,at=yt,Z=Qt,ft=0,Rt=at;Rt;Rt=le(Rt))ft++;Rt=0;for(var re=Z;re;re=le(re))Rt++;for(;0<ft-Rt;)at=le(at),ft--;for(;0<Rt-ft;)Z=le(Z),Rt--;for(;ft--;){if(at===Z||Z!==null&&at===Z.alternate){le=at;break e}at=le(at),Z=le(Z)}le=null}else le=null;yt!==null&&J0(Dt,mt,yt,le,!1),Qt!==null&&We!==null&&J0(Dt,We,Qt,le,!0)}}t:{if(mt=dt?ws(dt):window,yt=mt.nodeName&&mt.nodeName.toLowerCase(),yt==="select"||yt==="input"&&mt.type==="file")var Ne=mm;else if(dm(mt))if(gm)Ne=Ny;else{Ne=Uy;var ie=Dy}else yt=mt.nodeName,!yt||yt.toLowerCase()!=="input"||mt.type!=="checkbox"&&mt.type!=="radio"?dt&&cr(dt.elementType)&&(Ne=mm):Ne=Ly;if(Ne&&(Ne=Ne(e,dt))){pm(Dt,Ne,r,Tt);break t}ie&&ie(e,mt,dt),e==="focusout"&&dt&&mt.type==="number"&&dt.memoizedProps.value!=null&&Ni(mt,"number",mt.value)}switch(ie=dt?ws(dt):window,e){case"focusin":(dm(ie)||ie.contentEditable==="true")&&(dr=ie,rf=dt,Ro=null);break;case"focusout":Ro=rf=dr=null;break;case"mousedown":of=!0;break;case"contextmenu":case"mouseup":case"dragend":of=!1,Em(Dt,r,Tt);break;case"selectionchange":if(Py)break;case"keydown":case"keyup":Em(Dt,r,Tt)}var Se;if(ef)t:{switch(e){case"compositionstart":var we="onCompositionStart";break t;case"compositionend":we="onCompositionEnd";break t;case"compositionupdate":we="onCompositionUpdate";break t}we=void 0}else hr?fm(e,r)&&(we="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(we="onCompositionStart");we&&(lm&&r.locale!=="ko"&&(hr||we!=="onCompositionStart"?we==="onCompositionEnd"&&hr&&(Se=im()):(Xa=Tt,Ku="value"in Xa?Xa.value:Xa.textContent,hr=!0)),ie=Mc(dt,we),0<ie.length&&(we=new rm(we,e,null,r,Tt),Dt.push({event:we,listeners:ie}),Se?we.data=Se:(Se=hm(r),Se!==null&&(we.data=Se)))),(Se=Ty?Ay(e,r):Ry(e,r))&&(we=Mc(dt,"onBeforeInput"),0<we.length&&(ie=new rm("onBeforeInput","beforeinput",null,r,Tt),Dt.push({event:ie,listeners:we}),ie.data=Se)),vS(Dt,e,dt,r,Tt)}K0(Dt,n)})}function Jo(e,n,r){return{instance:e,listener:n,currentTarget:r}}function Mc(e,n){for(var r=n+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=xo(e,r),u!=null&&o.unshift(Jo(e,u,h)),u=xo(e,n),u!=null&&o.push(Jo(e,u,h))),e.tag===3)return o;e=e.return}return[]}function MS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function J0(e,n,r,o,u){for(var h=n._reactName,M=[];r!==null&&r!==o;){var L=r,W=L.alternate,dt=L.stateNode;if(L=L.tag,W!==null&&W===o)break;L!==5&&L!==26&&L!==27||dt===null||(W=dt,u?(dt=xo(r,h),dt!=null&&M.unshift(Jo(r,dt,W))):u||(dt=xo(r,h),dt!=null&&M.push(Jo(r,dt,W)))),r=r.return}M.length!==0&&e.push({event:n,listeners:M})}var bS=/\r\n?/g,ES=/\u0000|\uFFFD/g;function $0(e){return(typeof e=="string"?e:""+e).replace(bS,`
|
|
9
|
+
`).replace(ES,"")}function t_(e,n){return n=$0(n),$0(e)===n}function Xe(e,n,r,o,u,h){switch(r){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||qn(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&qn(e,""+o);break;case"className":me(e,"class",o);break;case"tabIndex":me(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":me(e,r,o);break;case"style":fa(e,o,h);break;case"data":if(n!=="object"){me(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=wl(""+o),e.setAttribute(r,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(r==="formAction"?(n!=="input"&&Xe(e,n,"name",u.name,u,null),Xe(e,n,"formEncType",u.formEncType,u,null),Xe(e,n,"formMethod",u.formMethod,u,null),Xe(e,n,"formTarget",u.formTarget,u,null)):(Xe(e,n,"encType",u.encType,u,null),Xe(e,n,"method",u.method,u,null),Xe(e,n,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=wl(""+o),e.setAttribute(r,o);break;case"onClick":o!=null&&(e.onclick=ha);break;case"onScroll":o!=null&&Ae("scroll",e);break;case"onScrollEnd":o!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(r=o.__html,r!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}r=wl(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""+o):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":o===!0?e.setAttribute(r,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,o):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(r,o):e.removeAttribute(r);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(r):e.setAttribute(r,o);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),fe(e,"popover",o);break;case"xlinkActuate":Kt(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Kt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Kt(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Kt(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Kt(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Kt(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":fe(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=Jx.get(r)||r,fe(e,r,o))}}function Lh(e,n,r,o,u,h){switch(r){case"style":fa(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(r=o.__html,r!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"children":typeof o=="string"?qn(e,o):(typeof o=="number"||typeof o=="bigint")&&qn(e,""+o);break;case"onScroll":o!=null&&Ae("scroll",e);break;case"onScrollEnd":o!=null&&Ae("scrollend",e);break;case"onClick":o!=null&&(e.onclick=ha);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pt.hasOwnProperty(r))t:{if(r[0]==="o"&&r[1]==="n"&&(u=r.endsWith("Capture"),n=r.slice(2,u?r.length-7:void 0),h=e[vn]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(n,h,u),typeof o=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,o,u);break t}r in e?e[r]=o:o===!0?e.setAttribute(r,""):fe(e,r,o)}}}function Un(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var o=!1,u=!1,h;for(h in r)if(r.hasOwnProperty(h)){var M=r[h];if(M!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Xe(e,n,h,M,r,null)}}u&&Xe(e,n,"srcSet",r.srcSet,r,null),o&&Xe(e,n,"src",r.src,r,null);return;case"input":Ae("invalid",e);var L=h=M=u=null,W=null,dt=null;for(o in r)if(r.hasOwnProperty(o)){var Tt=r[o];if(Tt!=null)switch(o){case"name":u=Tt;break;case"type":M=Tt;break;case"checked":W=Tt;break;case"defaultChecked":dt=Tt;break;case"value":h=Tt;break;case"defaultValue":L=Tt;break;case"children":case"dangerouslySetInnerHTML":if(Tt!=null)throw Error(s(137,n));break;default:Xe(e,n,o,Tt,r,null)}}ri(e,h,L,W,dt,M,u,!1);return;case"select":Ae("invalid",e),o=M=h=null;for(u in r)if(r.hasOwnProperty(u)&&(L=r[u],L!=null))switch(u){case"value":h=L;break;case"defaultValue":M=L;break;case"multiple":o=L;default:Xe(e,n,u,L,r,null)}n=h,r=M,e.multiple=!!o,n!=null?oi(e,!!o,n,!1):r!=null&&oi(e,!!o,r,!0);return;case"textarea":Ae("invalid",e),h=u=o=null;for(M in r)if(r.hasOwnProperty(M)&&(L=r[M],L!=null))switch(M){case"value":o=L;break;case"defaultValue":u=L;break;case"children":h=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(91));break;default:Xe(e,n,M,L,r,null)}un(e,o,u,h);return;case"option":for(W in r)r.hasOwnProperty(W)&&(o=r[W],o!=null)&&(W==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Xe(e,n,W,o,r,null));return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(o=0;o<Qo.length;o++)Ae(Qo[o],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(dt in r)if(r.hasOwnProperty(dt)&&(o=r[dt],o!=null))switch(dt){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Xe(e,n,dt,o,r,null)}return;default:if(cr(n)){for(Tt in r)r.hasOwnProperty(Tt)&&(o=r[Tt],o!==void 0&&Lh(e,n,Tt,o,r,void 0));return}}for(L in r)r.hasOwnProperty(L)&&(o=r[L],o!=null&&Xe(e,n,L,o,r,null))}function TS(e,n,r,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,M=null,L=null,W=null,dt=null,Tt=null;for(yt in r){var Dt=r[yt];if(r.hasOwnProperty(yt)&&Dt!=null)switch(yt){case"checked":break;case"value":break;case"defaultValue":W=Dt;default:o.hasOwnProperty(yt)||Xe(e,n,yt,null,o,Dt)}}for(var mt in o){var yt=o[mt];if(Dt=r[mt],o.hasOwnProperty(mt)&&(yt!=null||Dt!=null))switch(mt){case"type":h=yt;break;case"name":u=yt;break;case"checked":dt=yt;break;case"defaultChecked":Tt=yt;break;case"value":M=yt;break;case"defaultValue":L=yt;break;case"children":case"dangerouslySetInnerHTML":if(yt!=null)throw Error(s(137,n));break;default:yt!==Dt&&Xe(e,n,mt,yt,o,Dt)}}Wn(e,M,L,W,dt,Tt,h,u);return;case"select":yt=M=L=mt=null;for(h in r)if(W=r[h],r.hasOwnProperty(h)&&W!=null)switch(h){case"value":break;case"multiple":yt=W;default:o.hasOwnProperty(h)||Xe(e,n,h,null,o,W)}for(u in o)if(h=o[u],W=r[u],o.hasOwnProperty(u)&&(h!=null||W!=null))switch(u){case"value":mt=h;break;case"defaultValue":L=h;break;case"multiple":M=h;default:h!==W&&Xe(e,n,u,h,o,W)}n=L,r=M,o=yt,mt!=null?oi(e,!!r,mt,!1):!!o!=!!r&&(n!=null?oi(e,!!r,n,!0):oi(e,!!r,r?[]:"",!1));return;case"textarea":yt=mt=null;for(L in r)if(u=r[L],r.hasOwnProperty(L)&&u!=null&&!o.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Xe(e,n,L,null,o,u)}for(M in o)if(u=o[M],h=r[M],o.hasOwnProperty(M)&&(u!=null||h!=null))switch(M){case"value":mt=u;break;case"defaultValue":yt=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==h&&Xe(e,n,M,u,o,h)}Fe(e,mt,yt);return;case"option":for(var Qt in r)mt=r[Qt],r.hasOwnProperty(Qt)&&mt!=null&&!o.hasOwnProperty(Qt)&&(Qt==="selected"?e.selected=!1:Xe(e,n,Qt,null,o,mt));for(W in o)mt=o[W],yt=r[W],o.hasOwnProperty(W)&&mt!==yt&&(mt!=null||yt!=null)&&(W==="selected"?e.selected=mt&&typeof mt!="function"&&typeof mt!="symbol":Xe(e,n,W,mt,o,yt));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var le in r)mt=r[le],r.hasOwnProperty(le)&&mt!=null&&!o.hasOwnProperty(le)&&Xe(e,n,le,null,o,mt);for(dt in o)if(mt=o[dt],yt=r[dt],o.hasOwnProperty(dt)&&mt!==yt&&(mt!=null||yt!=null))switch(dt){case"children":case"dangerouslySetInnerHTML":if(mt!=null)throw Error(s(137,n));break;default:Xe(e,n,dt,mt,o,yt)}return;default:if(cr(n)){for(var We in r)mt=r[We],r.hasOwnProperty(We)&&mt!==void 0&&!o.hasOwnProperty(We)&&Lh(e,n,We,void 0,o,mt);for(Tt in o)mt=o[Tt],yt=r[Tt],!o.hasOwnProperty(Tt)||mt===yt||mt===void 0&&yt===void 0||Lh(e,n,Tt,mt,o,yt);return}}for(var at in r)mt=r[at],r.hasOwnProperty(at)&&mt!=null&&!o.hasOwnProperty(at)&&Xe(e,n,at,null,o,mt);for(Dt in o)mt=o[Dt],yt=r[Dt],!o.hasOwnProperty(Dt)||mt===yt||mt==null&&yt==null||Xe(e,n,Dt,mt,o,yt)}function e_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function AS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),o=0;o<r.length;o++){var u=r[o],h=u.transferSize,M=u.initiatorType,L=u.duration;if(h&&L&&e_(M)){for(M=0,L=u.responseEnd,o+=1;o<r.length;o++){var W=r[o],dt=W.startTime;if(dt>L)break;var Tt=W.transferSize,Dt=W.initiatorType;Tt&&e_(Dt)&&(W=W.responseEnd,M+=Tt*(W<L?1:(L-dt)/(W-dt)))}if(--o,n+=8*(h+M)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Nh=null,Oh=null;function bc(e){return e.nodeType===9?e:e.ownerDocument}function n_(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function i_(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Ph(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var zh=null;function RS(){var e=window.event;return e&&e.type==="popstate"?e===zh?!1:(zh=e,!0):(zh=null,!1)}var a_=typeof setTimeout=="function"?setTimeout:void 0,wS=typeof clearTimeout=="function"?clearTimeout:void 0,s_=typeof Promise=="function"?Promise:void 0,CS=typeof queueMicrotask=="function"?queueMicrotask:typeof s_<"u"?function(e){return s_.resolve(null).then(e).catch(DS)}:a_;function DS(e){setTimeout(function(){throw e})}function os(e){return e==="head"}function r_(e,n){var r=n,o=0;do{var u=r.nextSibling;if(e.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"||r==="/&"){if(o===0){e.removeChild(u),Hr(n);return}o--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")o++;else if(r==="html")$o(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,$o(r);for(var h=r.firstChild;h;){var M=h.nextSibling,L=h.nodeName;h[Rs]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=M}}else r==="body"&&$o(e.ownerDocument.body);r=u}while(r);Hr(n)}function o_(e,n){var r=e;e=0;do{var o=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=o}while(r)}function Fh(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Fh(r),vo(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function US(e,n,r,o){for(;e.nodeType===1;){var u=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Rs])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Ai(e.nextSibling),e===null)break}return null}function LS(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Ai(e.nextSibling),e===null))return null;return e}function l_(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ai(e.nextSibling),e===null))return null;return e}function Ih(e){return e.data==="$?"||e.data==="$~"}function Bh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function NS(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var o=function(){n(),r.removeEventListener("DOMContentLoaded",o)};r.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Ai(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Hh=null;function c_(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return Ai(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function u_(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function f_(e,n,r){switch(n=bc(r),e){case"html":if(e=n.documentElement,!e)throw Error(s(452));return e;case"head":if(e=n.head,!e)throw Error(s(453));return e;case"body":if(e=n.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function $o(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);vo(e)}var Ri=new Map,h_=new Set;function Ec(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wa=A.d;A.d={f:OS,r:PS,D:zS,C:FS,L:IS,m:BS,X:GS,S:HS,M:VS};function OS(){var e=wa.f(),n=mc();return e||n}function PS(e){var n=ka(e);n!==null&&n.tag===5&&n.type==="form"?Cg(n):wa.r(e)}var Fr=typeof document>"u"?null:document;function d_(e,n,r){var o=Fr;if(o&&typeof n=="string"&&n){var u=pe(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof r=="string"&&(u+='[crossorigin="'+r+'"]'),h_.has(u)||(h_.add(u),e={rel:e,crossOrigin:r,href:n},o.querySelector(u)===null&&(n=o.createElement("link"),Un(n,"link",e),J(n),o.head.appendChild(n)))}}function zS(e){wa.D(e),d_("dns-prefetch",e,null)}function FS(e,n){wa.C(e,n),d_("preconnect",e,n)}function IS(e,n,r){wa.L(e,n,r);var o=Fr;if(o&&e&&n){var u='link[rel="preload"][as="'+pe(n)+'"]';n==="image"&&r&&r.imageSrcSet?(u+='[imagesrcset="'+pe(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(u+='[imagesizes="'+pe(r.imageSizes)+'"]')):u+='[href="'+pe(e)+'"]';var h=u;switch(n){case"style":h=Ir(e);break;case"script":h=Br(e)}Ri.has(h)||(e=_({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Ri.set(h,e),o.querySelector(u)!==null||n==="style"&&o.querySelector(tl(h))||n==="script"&&o.querySelector(el(h))||(n=o.createElement("link"),Un(n,"link",e),J(n),o.head.appendChild(n)))}}function BS(e,n){wa.m(e,n);var r=Fr;if(r&&e){var o=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+pe(o)+'"][href="'+pe(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Br(e)}if(!Ri.has(h)&&(e=_({rel:"modulepreload",href:e},n),Ri.set(h,e),r.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(el(h)))return}o=r.createElement("link"),Un(o,"link",e),J(o),r.head.appendChild(o)}}}function HS(e,n,r){wa.S(e,n,r);var o=Fr;if(o&&e){var u=N(o).hoistableStyles,h=Ir(e);n=n||"default";var M=u.get(h);if(!M){var L={loading:0,preload:null};if(M=o.querySelector(tl(h)))L.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Ri.get(h))&&Gh(e,r);var W=M=o.createElement("link");J(W),Un(W,"link",e),W._p=new Promise(function(dt,Tt){W.onload=dt,W.onerror=Tt}),W.addEventListener("load",function(){L.loading|=1}),W.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Tc(M,n,o)}M={type:"stylesheet",instance:M,count:1,state:L},u.set(h,M)}}}function GS(e,n){wa.X(e,n);var r=Fr;if(r&&e){var o=N(r).hoistableScripts,u=Br(e),h=o.get(u);h||(h=r.querySelector(el(u)),h||(e=_({src:e,async:!0},n),(n=Ri.get(u))&&Vh(e,n),h=r.createElement("script"),J(h),Un(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function VS(e,n){wa.M(e,n);var r=Fr;if(r&&e){var o=N(r).hoistableScripts,u=Br(e),h=o.get(u);h||(h=r.querySelector(el(u)),h||(e=_({src:e,async:!0,type:"module"},n),(n=Ri.get(u))&&Vh(e,n),h=r.createElement("script"),J(h),Un(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function p_(e,n,r,o){var u=(u=st.current)?Ec(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Ir(r.href),r=N(u).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Ir(r.href);var h=N(u).hoistableStyles,M=h.get(e);if(M||(u=u.ownerDocument||u,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,M),(h=u.querySelector(tl(e)))&&!h._p&&(M.instance=h,M.state.loading=5),Ri.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Ri.set(e,r),h||kS(u,e,r,M.state))),n&&o===null)throw Error(s(528,""));return M}if(n&&o!==null)throw Error(s(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Br(r),r=N(u).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Ir(e){return'href="'+pe(e)+'"'}function tl(e){return'link[rel="stylesheet"]['+e+"]"}function m_(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function kS(e,n,r,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),Un(n,"link",r),J(n),e.head.appendChild(n))}function Br(e){return'[src="'+pe(e)+'"]'}function el(e){return"script[async]"+e}function g_(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+pe(r.href)+'"]');if(o)return n.instance=o,J(o),o;var u=_({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),J(o),Un(o,"style",u),Tc(o,r.precedence,e),n.instance=o;case"stylesheet":u=Ir(r.href);var h=e.querySelector(tl(u));if(h)return n.state.loading|=4,n.instance=h,J(h),h;o=m_(r),(u=Ri.get(u))&&Gh(o,u),h=(e.ownerDocument||e).createElement("link"),J(h);var M=h;return M._p=new Promise(function(L,W){M.onload=L,M.onerror=W}),Un(h,"link",o),n.state.loading|=4,Tc(h,r.precedence,e),n.instance=h;case"script":return h=Br(r.src),(u=e.querySelector(el(h)))?(n.instance=u,J(u),u):(o=r,(u=Ri.get(h))&&(o=_({},r),Vh(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),J(u),Un(u,"link",o),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Tc(o,r.precedence,e));return n.instance}function Tc(e,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,M=0;M<o.length;M++){var L=o[M];if(L.dataset.precedence===n)h=L;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function Gh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Vh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Ac=null;function __(e,n,r){if(Ac===null){var o=new Map,u=Ac=new Map;u.set(r,o)}else u=Ac,o=u.get(r),o||(o=new Map,u.set(r,o));if(o.has(e))return o;for(o.set(e,null),r=r.getElementsByTagName(e),u=0;u<r.length;u++){var h=r[u];if(!(h[Rs]||h[cn]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var M=h.getAttribute(n)||"";M=e+M;var L=o.get(M);L?L.push(h):o.set(M,[h])}}return o}function v_(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function XS(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function x_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function WS(e,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var u=Ir(o.href),h=n.querySelector(tl(u));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Rc.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,J(h);return}h=n.ownerDocument||n,o=m_(o),(u=Ri.get(u))&&Gh(o,u),h=h.createElement("link"),J(h);var M=h;M._p=new Promise(function(L,W){M.onload=L,M.onerror=W}),Un(h,"link",o),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Rc.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var kh=0;function qS(e,n){return e.stylesheets&&e.count===0&&Cc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var o=setTimeout(function(){if(e.stylesheets&&Cc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&kh===0&&(kh=62500*AS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Cc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>kh?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var wc=null;function Cc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wc=new Map,n.forEach(YS,e),wc=null,Rc.call(e))}function YS(e,n){if(!(n.state.loading&4)){var r=wc.get(e);if(r)var o=r.get(null);else{r=new Map,wc.set(e,r);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var M=u[h];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(r.set(M.dataset.precedence,M),o=M)}o&&r.set(null,o)}u=n.instance,M=u.getAttribute("data-precedence"),h=r.get(M)||o,h===o&&r.set(null,u),r.set(M,u),this.count++,o=Rc.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var nl={$$typeof:D,Provider:null,Consumer:null,_currentValue:ht,_currentValue2:ht,_threadCount:0};function jS(e,n,r,o,u,h,M,L,W){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=De(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=De(0),this.hiddenUpdates=De(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function y_(e,n,r,o,u,h,M,L,W,dt,Tt,Dt){return e=new jS(e,n,r,M,W,dt,Tt,Dt,L),n=1,h===!0&&(n|=24),h=ci(3,null,null,n),e.current=h,h.stateNode=e,n=Mf(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:r,cache:n},Af(h),e}function S_(e){return e?(e=gr,e):gr}function M_(e,n,r,o,u,h){u=S_(u),o.context===null?o.context=u:o.pendingContext=u,o=Ka(n),o.payload={element:r},h=h===void 0?null:h,h!==null&&(o.callback=h),r=Qa(e,o,n),r!==null&&(ni(r,e,n),Oo(r,e,n))}function b_(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function Xh(e,n){b_(e,n),(e=e.alternate)&&b_(e,n)}function E_(e){if(e.tag===13||e.tag===31){var n=Ls(e,67108864);n!==null&&ni(n,e,67108864),Xh(e,67108864)}}function T_(e){if(e.tag===13||e.tag===31){var n=pi();n=rr(n);var r=Ls(e,n);r!==null&&ni(r,e,n),Xh(e,n)}}var Dc=!0;function ZS(e,n,r,o){var u=z.T;z.T=null;var h=A.p;try{A.p=2,Wh(e,n,r,o)}finally{A.p=h,z.T=u}}function KS(e,n,r,o){var u=z.T;z.T=null;var h=A.p;try{A.p=8,Wh(e,n,r,o)}finally{A.p=h,z.T=u}}function Wh(e,n,r,o){if(Dc){var u=qh(o);if(u===null)Uh(e,n,o,Uc,r),R_(e,o);else if(JS(u,e,n,r,o))o.stopPropagation();else if(R_(e,o),n&4&&-1<QS.indexOf(e)){for(;u!==null;){var h=ka(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var M=Ot(h.pendingLanes);if(M!==0){var L=h;for(L.pendingLanes|=2,L.entangledLanes|=2;M;){var W=1<<31-Lt(M);L.entanglements[1]|=W,M&=~W}Qi(h),(ze&6)===0&&(dc=E()+500,Ko(0))}}break;case 31:case 13:L=Ls(h,2),L!==null&&ni(L,h,2),mc(),Xh(h,2)}if(h=qh(o),h===null&&Uh(e,n,o,Uc,r),h===u)break;u=h}u!==null&&o.stopPropagation()}else Uh(e,n,o,null,r)}}function qh(e){return e=Yu(e),Yh(e)}var Uc=null;function Yh(e){if(Uc=null,e=Va(e),e!==null){var n=c(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=f(n),e!==null)return e;e=null}else if(r===31){if(e=d(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Uc=e,null}function A_(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(V()){case $:return 2;case k:return 8;case P:case it:return 32;case rt:return 268435456;default:return 32}default:return 32}}var jh=!1,ls=null,cs=null,us=null,il=new Map,al=new Map,fs=[],QS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function R_(e,n){switch(e){case"focusin":case"focusout":ls=null;break;case"dragenter":case"dragleave":cs=null;break;case"mouseover":case"mouseout":us=null;break;case"pointerover":case"pointerout":il.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(n.pointerId)}}function sl(e,n,r,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:r,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},n!==null&&(n=ka(n),n!==null&&E_(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function JS(e,n,r,o,u){switch(n){case"focusin":return ls=sl(ls,e,n,r,o,u),!0;case"dragenter":return cs=sl(cs,e,n,r,o,u),!0;case"mouseover":return us=sl(us,e,n,r,o,u),!0;case"pointerover":var h=u.pointerId;return il.set(h,sl(il.get(h)||null,e,n,r,o,u)),!0;case"gotpointercapture":return h=u.pointerId,al.set(h,sl(al.get(h)||null,e,n,r,o,u)),!0}return!1}function w_(e){var n=Va(e.target);if(n!==null){var r=c(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,lr(e.priority,function(){T_(r)});return}}else if(n===31){if(n=d(r),n!==null){e.blockedOn=n,lr(e.priority,function(){T_(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=qh(e.nativeEvent);if(r===null){r=e.nativeEvent;var o=new r.constructor(r.type,r);qu=o,r.target.dispatchEvent(o),qu=null}else return n=ka(r),n!==null&&E_(n),e.blockedOn=r,!1;n.shift()}return!0}function C_(e,n,r){Lc(e)&&r.delete(n)}function $S(){jh=!1,ls!==null&&Lc(ls)&&(ls=null),cs!==null&&Lc(cs)&&(cs=null),us!==null&&Lc(us)&&(us=null),il.forEach(C_),al.forEach(C_)}function Nc(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,$S)))}var Oc=null;function D_(e){Oc!==e&&(Oc=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Oc===e&&(Oc=null);for(var n=0;n<e.length;n+=3){var r=e[n],o=e[n+1],u=e[n+2];if(typeof o!="function"){if(Yh(o||r)===null)continue;break}var h=ka(r);h!==null&&(e.splice(n,3),n-=3,qf(h,{pending:!0,data:u,method:r.method,action:o},o,u))}}))}function Hr(e){function n(W){return Nc(W,e)}ls!==null&&Nc(ls,e),cs!==null&&Nc(cs,e),us!==null&&Nc(us,e),il.forEach(n),al.forEach(n);for(var r=0;r<fs.length;r++){var o=fs[r];o.blockedOn===e&&(o.blockedOn=null)}for(;0<fs.length&&(r=fs[0],r.blockedOn===null);)w_(r),r.blockedOn===null&&fs.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(o=0;o<r.length;o+=3){var u=r[o],h=r[o+1],M=u[vn]||null;if(typeof h=="function")M||D_(r);else if(M){var L=null;if(h&&h.hasAttribute("formAction")){if(u=h,M=h[vn]||null)L=M.formAction;else if(Yh(u)!==null)continue}else L=M.action;typeof L=="function"?r[o+1]=L:(r.splice(o,3),o-=3),D_(r)}}}function U_(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(M){return u=M})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),o||setTimeout(r,20)}function r(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Zh(e){this._internalRoot=e}Pc.prototype.render=Zh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));var r=n.current,o=pi();M_(r,o,e,n,null,null)},Pc.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;M_(e.current,2,null,e,null,null),mc(),n[ua]=null}};function Pc(e){this._internalRoot=e}Pc.prototype.unstable_scheduleHydration=function(e){if(e){var n=Yi();e={blockedOn:null,target:e,priority:n};for(var r=0;r<fs.length&&n!==0&&n<fs[r].priority;r++);fs.splice(r,0,e),r===0&&w_(e)}};var L_=t.version;if(L_!=="19.2.4")throw Error(s(527,L_,"19.2.4"));A.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=p(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var tM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zc.isDisabled&&zc.supportsFiber)try{xt=zc.inject(tM),St=zc}catch{}}return ol.createRoot=function(e,n){if(!l(e))throw Error(s(299));var r=!1,o="",u=Bg,h=Hg,M=Gg;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(M=n.onRecoverableError)),n=y_(e,1,!1,null,null,r,o,null,u,h,M,U_),e[ua]=n.current,Dh(e),new Zh(n)},ol.hydrateRoot=function(e,n,r){if(!l(e))throw Error(s(299));var o=!1,u="",h=Bg,M=Hg,L=Gg,W=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(M=r.onCaughtError),r.onRecoverableError!==void 0&&(L=r.onRecoverableError),r.formState!==void 0&&(W=r.formState)),n=y_(e,1,!0,n,r??null,o,u,W,h,M,L,U_),n.context=S_(null),r=n.current,o=pi(),o=rr(o),u=Ka(o),u.callback=null,Qa(r,u,o),r=o,n.current.lanes=r,kn(n,r),Qi(n),e[ua]=n.current,Dh(e),new Pc(n)},ol.version="19.2.4",ol}var V_;function uM(){if(V_)return Jh.exports;V_=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(t){console.error(t)}}return a(),Jh.exports=cM(),Jh.exports}var fM=uM();const Fp="183",ao={ROTATE:0,DOLLY:1,PAN:2},io={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},hM=0,k_=1,dM=2,Mu=1,pM=2,gl=3,Es=0,si=1,ki=2,Pa=0,so=1,X_=2,W_=3,q_=4,mM=5,Qs=100,gM=101,_M=102,vM=103,xM=104,yM=200,SM=201,MM=202,bM=203,Gd=204,Vd=205,EM=206,TM=207,AM=208,RM=209,wM=210,CM=211,DM=212,UM=213,LM=214,kd=0,Xd=1,Wd=2,lo=3,qd=4,Yd=5,jd=6,Zd=7,Ip=0,NM=1,OM=2,ra=0,fx=1,hx=2,dx=3,px=4,mx=5,gx=6,_x=7,vx=300,nr=301,co=302,nd=303,id=304,Hu=306,Kd=1e3,Oa=1001,Qd=1002,zn=1003,PM=1004,Fc=1005,Vn=1006,ad=1007,$s=1008,vi=1009,xx=1010,yx=1011,xl=1012,Bp=1013,la=1014,ia=1015,Ia=1016,Hp=1017,Gp=1018,yl=1020,Sx=35902,Mx=35899,bx=1021,Ex=1022,Wi=1023,Ba=1026,tr=1027,Tx=1028,Vp=1029,uo=1030,kp=1031,Xp=1033,bu=33776,Eu=33777,Tu=33778,Au=33779,Jd=35840,$d=35841,tp=35842,ep=35843,np=36196,ip=37492,ap=37496,sp=37488,rp=37489,op=37490,lp=37491,cp=37808,up=37809,fp=37810,hp=37811,dp=37812,pp=37813,mp=37814,gp=37815,_p=37816,vp=37817,xp=37818,yp=37819,Sp=37820,Mp=37821,bp=36492,Ep=36494,Tp=36495,Ap=36283,Rp=36284,wp=36285,Cp=36286,zM=3200,Ax=0,FM=1,ys="",Ci="srgb",fo="srgb-linear",Uu="linear",Ge="srgb",Gr=7680,Y_=519,IM=512,BM=513,HM=514,Wp=515,GM=516,VM=517,qp=518,kM=519,Dp=35044,j_="300 es",aa=2e3,Sl=2001;function XM(a){for(let t=a.length-1;t>=0;--t)if(a[t]>=65535)return!0;return!1}function Lu(a){return document.createElementNS("http://www.w3.org/1999/xhtml",a)}function WM(){const a=Lu("canvas");return a.style.display="block",a}const Z_={};function Nu(...a){const t="THREE."+a.shift();console.log(t,...a)}function Rx(a){const t=a[0];if(typeof t=="string"&&t.startsWith("TSL:")){const i=a[1];i&&i.isStackTrace?a[0]+=" "+i.getLocation():a[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return a}function ue(...a){a=Rx(a);const t="THREE."+a.shift();{const i=a[0];i&&i.isStackTrace?console.warn(i.getError(t)):console.warn(t,...a)}}function Pe(...a){a=Rx(a);const t="THREE."+a.shift();{const i=a[0];i&&i.isStackTrace?console.error(i.getError(t)):console.error(t,...a)}}function Ou(...a){const t=a.join(" ");t in Z_||(Z_[t]=!0,ue(...a))}function qM(a,t,i){return new Promise(function(s,l){function c(){switch(a.clientWaitSync(t,a.SYNC_FLUSH_COMMANDS_BIT,0)){case a.WAIT_FAILED:l();break;case a.TIMEOUT_EXPIRED:setTimeout(c,i);break;default:s()}}setTimeout(c,i)})}const YM={[kd]:Xd,[Wd]:jd,[qd]:Zd,[lo]:Yd,[Xd]:kd,[jd]:Wd,[Zd]:qd,[Yd]:lo};class ar{addEventListener(t,i){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(i)===-1&&s[t].push(i)}hasEventListener(t,i){const s=this._listeners;return s===void 0?!1:s[t]!==void 0&&s[t].indexOf(i)!==-1}removeEventListener(t,i){const s=this._listeners;if(s===void 0)return;const l=s[t];if(l!==void 0){const c=l.indexOf(i);c!==-1&&l.splice(c,1)}}dispatchEvent(t){const i=this._listeners;if(i===void 0)return;const s=i[t.type];if(s!==void 0){t.target=this;const l=s.slice(0);for(let c=0,f=l.length;c<f;c++)l[c].call(this,t);t.target=null}}}const Bn=["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 K_=1234567;const ro=Math.PI/180,Ml=180/Math.PI;function za(){const a=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(Bn[a&255]+Bn[a>>8&255]+Bn[a>>16&255]+Bn[a>>24&255]+"-"+Bn[t&255]+Bn[t>>8&255]+"-"+Bn[t>>16&15|64]+Bn[t>>24&255]+"-"+Bn[i&63|128]+Bn[i>>8&255]+"-"+Bn[i>>16&255]+Bn[i>>24&255]+Bn[s&255]+Bn[s>>8&255]+Bn[s>>16&255]+Bn[s>>24&255]).toLowerCase()}function ve(a,t,i){return Math.max(t,Math.min(i,a))}function Yp(a,t){return(a%t+t)%t}function jM(a,t,i,s,l){return s+(a-t)*(l-s)/(i-t)}function ZM(a,t,i){return a!==t?(i-a)/(t-a):0}function vl(a,t,i){return(1-i)*a+i*t}function KM(a,t,i,s){return vl(a,t,1-Math.exp(-i*s))}function QM(a,t=1){return t-Math.abs(Yp(a,t*2)-t)}function JM(a,t,i){return a<=t?0:a>=i?1:(a=(a-t)/(i-t),a*a*(3-2*a))}function $M(a,t,i){return a<=t?0:a>=i?1:(a=(a-t)/(i-t),a*a*a*(a*(a*6-15)+10))}function tb(a,t){return a+Math.floor(Math.random()*(t-a+1))}function eb(a,t){return a+Math.random()*(t-a)}function nb(a){return a*(.5-Math.random())}function ib(a){a!==void 0&&(K_=a);let t=K_+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function ab(a){return a*ro}function sb(a){return a*Ml}function rb(a){return(a&a-1)===0&&a!==0}function ob(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))}function lb(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}function cb(a,t,i,s,l){const c=Math.cos,f=Math.sin,d=c(i/2),m=f(i/2),p=c((t+s)/2),v=f((t+s)/2),_=c((t-s)/2),g=f((t-s)/2),S=c((s-t)/2),b=f((s-t)/2);switch(l){case"XYX":a.set(d*v,m*_,m*g,d*p);break;case"YZY":a.set(m*g,d*v,m*_,d*p);break;case"ZXZ":a.set(m*_,m*g,d*v,d*p);break;case"XZX":a.set(d*v,m*b,m*S,d*p);break;case"YXY":a.set(m*S,d*v,m*b,d*p);break;case"ZYZ":a.set(m*b,m*S,d*v,d*p);break;default:ue("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+l)}}function Xi(a,t){switch(t.constructor){case Float32Array:return a;case Uint32Array:return a/4294967295;case Uint16Array:return a/65535;case Uint8Array:return a/255;case Int32Array:return Math.max(a/2147483647,-1);case Int16Array:return Math.max(a/32767,-1);case Int8Array:return Math.max(a/127,-1);default:throw new Error("Invalid component type.")}}function Ve(a,t){switch(t.constructor){case Float32Array:return a;case Uint32Array:return Math.round(a*4294967295);case Uint16Array:return Math.round(a*65535);case Uint8Array:return Math.round(a*255);case Int32Array:return Math.round(a*2147483647);case Int16Array:return Math.round(a*32767);case Int8Array:return Math.round(a*127);default:throw new Error("Invalid component type.")}}const wx={DEG2RAD:ro,RAD2DEG:Ml,generateUUID:za,clamp:ve,euclideanModulo:Yp,mapLinear:jM,inverseLerp:ZM,lerp:vl,damp:KM,pingpong:QM,smoothstep:JM,smootherstep:$M,randInt:tb,randFloat:eb,randFloatSpread:nb,seededRandom:ib,degToRad:ab,radToDeg:sb,isPowerOfTwo:rb,ceilPowerOfTwo:ob,floorPowerOfTwo:lb,setQuaternionFromProperEuler:cb,normalize:Ve,denormalize:Xi};class _e{constructor(t=0,i=0){_e.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const i=this.x,s=this.y,l=t.elements;return this.x=l[0]*i+l[3]*s+l[6],this.y=l[1]*i+l[4]*s+l[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=ve(this.x,t.x,i.x),this.y=ve(this.y,t.y,i.y),this}clampScalar(t,i){return this.x=ve(this.x,t,i),this.y=ve(this.y,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ve(s,t,i))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(t)/i;return Math.acos(ve(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,s=this.y-t.y;return i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){const s=Math.cos(i),l=Math.sin(i),c=this.x-t.x,f=this.y-t.y;return this.x=c*s-f*l+t.x,this.y=c*l+f*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ts{constructor(t=0,i=0,s=0,l=1){this.isQuaternion=!0,this._x=t,this._y=i,this._z=s,this._w=l}static slerpFlat(t,i,s,l,c,f,d){let m=s[l+0],p=s[l+1],v=s[l+2],_=s[l+3],g=c[f+0],S=c[f+1],b=c[f+2],R=c[f+3];if(_!==R||m!==g||p!==S||v!==b){let x=m*g+p*S+v*b+_*R;x<0&&(g=-g,S=-S,b=-b,R=-R,x=-x);let y=1-d;if(x<.9995){const w=Math.acos(x),D=Math.sin(w);y=Math.sin(y*w)/D,d=Math.sin(d*w)/D,m=m*y+g*d,p=p*y+S*d,v=v*y+b*d,_=_*y+R*d}else{m=m*y+g*d,p=p*y+S*d,v=v*y+b*d,_=_*y+R*d;const w=1/Math.sqrt(m*m+p*p+v*v+_*_);m*=w,p*=w,v*=w,_*=w}}t[i]=m,t[i+1]=p,t[i+2]=v,t[i+3]=_}static multiplyQuaternionsFlat(t,i,s,l,c,f){const d=s[l],m=s[l+1],p=s[l+2],v=s[l+3],_=c[f],g=c[f+1],S=c[f+2],b=c[f+3];return t[i]=d*b+v*_+m*S-p*g,t[i+1]=m*b+v*g+p*_-d*S,t[i+2]=p*b+v*S+d*g-m*_,t[i+3]=v*b-d*_-m*g-p*S,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,i,s,l){return this._x=t,this._y=i,this._z=s,this._w=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,i=!0){const s=t._x,l=t._y,c=t._z,f=t._order,d=Math.cos,m=Math.sin,p=d(s/2),v=d(l/2),_=d(c/2),g=m(s/2),S=m(l/2),b=m(c/2);switch(f){case"XYZ":this._x=g*v*_+p*S*b,this._y=p*S*_-g*v*b,this._z=p*v*b+g*S*_,this._w=p*v*_-g*S*b;break;case"YXZ":this._x=g*v*_+p*S*b,this._y=p*S*_-g*v*b,this._z=p*v*b-g*S*_,this._w=p*v*_+g*S*b;break;case"ZXY":this._x=g*v*_-p*S*b,this._y=p*S*_+g*v*b,this._z=p*v*b+g*S*_,this._w=p*v*_-g*S*b;break;case"ZYX":this._x=g*v*_-p*S*b,this._y=p*S*_+g*v*b,this._z=p*v*b-g*S*_,this._w=p*v*_+g*S*b;break;case"YZX":this._x=g*v*_+p*S*b,this._y=p*S*_+g*v*b,this._z=p*v*b-g*S*_,this._w=p*v*_-g*S*b;break;case"XZY":this._x=g*v*_-p*S*b,this._y=p*S*_-g*v*b,this._z=p*v*b+g*S*_,this._w=p*v*_+g*S*b;break;default:ue("Quaternion: .setFromEuler() encountered an unknown order: "+f)}return i===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,i){const s=i/2,l=Math.sin(s);return this._x=t.x*l,this._y=t.y*l,this._z=t.z*l,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const i=t.elements,s=i[0],l=i[4],c=i[8],f=i[1],d=i[5],m=i[9],p=i[2],v=i[6],_=i[10],g=s+d+_;if(g>0){const S=.5/Math.sqrt(g+1);this._w=.25/S,this._x=(v-m)*S,this._y=(c-p)*S,this._z=(f-l)*S}else if(s>d&&s>_){const S=2*Math.sqrt(1+s-d-_);this._w=(v-m)/S,this._x=.25*S,this._y=(l+f)/S,this._z=(c+p)/S}else if(d>_){const S=2*Math.sqrt(1+d-s-_);this._w=(c-p)/S,this._x=(l+f)/S,this._y=.25*S,this._z=(m+v)/S}else{const S=2*Math.sqrt(1+_-s-d);this._w=(f-l)/S,this._x=(c+p)/S,this._y=(m+v)/S,this._z=.25*S}return this._onChangeCallback(),this}setFromUnitVectors(t,i){let s=t.dot(i)+1;return s<1e-8?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*i.z-t.z*i.y,this._y=t.z*i.x-t.x*i.z,this._z=t.x*i.y-t.y*i.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ve(this.dot(t),-1,1)))}rotateTowards(t,i){const s=this.angleTo(t);if(s===0)return this;const l=Math.min(1,i/s);return this.slerp(t,l),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,i){const s=t._x,l=t._y,c=t._z,f=t._w,d=i._x,m=i._y,p=i._z,v=i._w;return this._x=s*v+f*d+l*p-c*m,this._y=l*v+f*m+c*d-s*p,this._z=c*v+f*p+s*m-l*d,this._w=f*v-s*d-l*m-c*p,this._onChangeCallback(),this}slerp(t,i){let s=t._x,l=t._y,c=t._z,f=t._w,d=this.dot(t);d<0&&(s=-s,l=-l,c=-c,f=-f,d=-d);let m=1-i;if(d<.9995){const p=Math.acos(d),v=Math.sin(p);m=Math.sin(m*p)/v,i=Math.sin(i*p)/v,this._x=this._x*m+s*i,this._y=this._y*m+l*i,this._z=this._z*m+c*i,this._w=this._w*m+f*i,this._onChangeCallback()}else this._x=this._x*m+s*i,this._y=this._y*m+l*i,this._z=this._z*m+c*i,this._w=this._w*m+f*i,this.normalize();return this}slerpQuaternions(t,i,s){return this.copy(t).slerp(i,s)}random(){const t=2*Math.PI*Math.random(),i=2*Math.PI*Math.random(),s=Math.random(),l=Math.sqrt(1-s),c=Math.sqrt(s);return this.set(l*Math.sin(t),l*Math.cos(t),c*Math.sin(i),c*Math.cos(i))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,i=0){return this._x=t[i],this._y=t[i+1],this._z=t[i+2],this._w=t[i+3],this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._w,t}fromBufferAttribute(t,i){return this._x=t.getX(i),this._y=t.getY(i),this._z=t.getZ(i),this._w=t.getW(i),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Q{constructor(t=0,i=0,s=0){Q.prototype.isVector3=!0,this.x=t,this.y=i,this.z=s}set(t,i,s){return s===void 0&&(s=this.z),this.x=t,this.y=i,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(Q_.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(Q_.setFromAxisAngle(t,i))}applyMatrix3(t){const i=this.x,s=this.y,l=this.z,c=t.elements;return this.x=c[0]*i+c[3]*s+c[6]*l,this.y=c[1]*i+c[4]*s+c[7]*l,this.z=c[2]*i+c[5]*s+c[8]*l,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const i=this.x,s=this.y,l=this.z,c=t.elements,f=1/(c[3]*i+c[7]*s+c[11]*l+c[15]);return this.x=(c[0]*i+c[4]*s+c[8]*l+c[12])*f,this.y=(c[1]*i+c[5]*s+c[9]*l+c[13])*f,this.z=(c[2]*i+c[6]*s+c[10]*l+c[14])*f,this}applyQuaternion(t){const i=this.x,s=this.y,l=this.z,c=t.x,f=t.y,d=t.z,m=t.w,p=2*(f*l-d*s),v=2*(d*i-c*l),_=2*(c*s-f*i);return this.x=i+m*p+f*_-d*v,this.y=s+m*v+d*p-c*_,this.z=l+m*_+c*v-f*p,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const i=this.x,s=this.y,l=this.z,c=t.elements;return this.x=c[0]*i+c[4]*s+c[8]*l,this.y=c[1]*i+c[5]*s+c[9]*l,this.z=c[2]*i+c[6]*s+c[10]*l,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=ve(this.x,t.x,i.x),this.y=ve(this.y,t.y,i.y),this.z=ve(this.z,t.z,i.z),this}clampScalar(t,i){return this.x=ve(this.x,t,i),this.y=ve(this.y,t,i),this.z=ve(this.z,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ve(s,t,i))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this.z=t.z+(i.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){const s=t.x,l=t.y,c=t.z,f=i.x,d=i.y,m=i.z;return this.x=l*m-c*d,this.y=c*f-s*m,this.z=s*d-l*f,this}projectOnVector(t){const i=t.lengthSq();if(i===0)return this.set(0,0,0);const s=t.dot(this)/i;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return sd.copy(this).projectOnVector(t),this.sub(sd)}reflect(t){return this.sub(sd.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const s=this.dot(t)/i;return Math.acos(ve(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,s=this.y-t.y,l=this.z-t.z;return i*i+s*s+l*l}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,s){const l=Math.sin(i)*t;return this.x=l*Math.sin(s),this.y=Math.cos(i)*t,this.z=l*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,s){return this.x=t*Math.sin(i),this.y=s,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){const i=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),l=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=s,this.z=l,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,i=Math.random()*2-1,s=Math.sqrt(1-i*i);return this.x=s*Math.cos(t),this.y=i,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const sd=new Q,Q_=new Ts;class Me{constructor(t,i,s,l,c,f,d,m,p){Me.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,i,s,l,c,f,d,m,p)}set(t,i,s,l,c,f,d,m,p){const v=this.elements;return v[0]=t,v[1]=l,v[2]=d,v[3]=i,v[4]=c,v[5]=m,v[6]=s,v[7]=f,v[8]=p,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const i=this.elements,s=t.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],this}extractBasis(t,i,s){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const s=t.elements,l=i.elements,c=this.elements,f=s[0],d=s[3],m=s[6],p=s[1],v=s[4],_=s[7],g=s[2],S=s[5],b=s[8],R=l[0],x=l[3],y=l[6],w=l[1],D=l[4],C=l[7],G=l[2],B=l[5],F=l[8];return c[0]=f*R+d*w+m*G,c[3]=f*x+d*D+m*B,c[6]=f*y+d*C+m*F,c[1]=p*R+v*w+_*G,c[4]=p*x+v*D+_*B,c[7]=p*y+v*C+_*F,c[2]=g*R+S*w+b*G,c[5]=g*x+S*D+b*B,c[8]=g*y+S*C+b*F,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],f=t[4],d=t[5],m=t[6],p=t[7],v=t[8];return i*f*v-i*d*p-s*c*v+s*d*m+l*c*p-l*f*m}invert(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],f=t[4],d=t[5],m=t[6],p=t[7],v=t[8],_=v*f-d*p,g=d*m-v*c,S=p*c-f*m,b=i*_+s*g+l*S;if(b===0)return this.set(0,0,0,0,0,0,0,0,0);const R=1/b;return t[0]=_*R,t[1]=(l*p-v*s)*R,t[2]=(d*s-l*f)*R,t[3]=g*R,t[4]=(v*i-l*m)*R,t[5]=(l*c-d*i)*R,t[6]=S*R,t[7]=(s*m-p*i)*R,t[8]=(f*i-s*c)*R,this}transpose(){let t;const i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,s,l,c,f,d){const m=Math.cos(c),p=Math.sin(c);return this.set(s*m,s*p,-s*(m*f+p*d)+f+t,-l*p,l*m,-l*(-p*f+m*d)+d+i,0,0,1),this}scale(t,i){return this.premultiply(rd.makeScale(t,i)),this}rotate(t){return this.premultiply(rd.makeRotation(-t)),this}translate(t,i){return this.premultiply(rd.makeTranslation(t,i)),this}makeTranslation(t,i){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,-s,0,s,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){const i=this.elements,s=t.elements;for(let l=0;l<9;l++)if(i[l]!==s[l])return!1;return!0}fromArray(t,i=0){for(let s=0;s<9;s++)this.elements[s]=t[s+i];return this}toArray(t=[],i=0){const s=this.elements;return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],t[i+4]=s[4],t[i+5]=s[5],t[i+6]=s[6],t[i+7]=s[7],t[i+8]=s[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const rd=new Me,J_=new Me().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),$_=new Me().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function ub(){const a={enabled:!0,workingColorSpace:fo,spaces:{},convert:function(l,c,f){return this.enabled===!1||c===f||!c||!f||(this.spaces[c].transfer===Ge&&(l.r=Fa(l.r),l.g=Fa(l.g),l.b=Fa(l.b)),this.spaces[c].primaries!==this.spaces[f].primaries&&(l.applyMatrix3(this.spaces[c].toXYZ),l.applyMatrix3(this.spaces[f].fromXYZ)),this.spaces[f].transfer===Ge&&(l.r=oo(l.r),l.g=oo(l.g),l.b=oo(l.b))),l},workingToColorSpace:function(l,c){return this.convert(l,this.workingColorSpace,c)},colorSpaceToWorking:function(l,c){return this.convert(l,c,this.workingColorSpace)},getPrimaries:function(l){return this.spaces[l].primaries},getTransfer:function(l){return l===ys?Uu:this.spaces[l].transfer},getToneMappingMode:function(l){return this.spaces[l].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(l,c=this.workingColorSpace){return l.fromArray(this.spaces[c].luminanceCoefficients)},define:function(l){Object.assign(this.spaces,l)},_getMatrix:function(l,c,f){return l.copy(this.spaces[c].toXYZ).multiply(this.spaces[f].fromXYZ)},_getDrawingBufferColorSpace:function(l){return this.spaces[l].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(l=this.workingColorSpace){return this.spaces[l].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(l,c){return Ou("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),a.workingToColorSpace(l,c)},toWorkingColorSpace:function(l,c){return Ou("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),a.colorSpaceToWorking(l,c)}},t=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],s=[.3127,.329];return a.define({[fo]:{primaries:t,whitePoint:s,transfer:Uu,toXYZ:J_,fromXYZ:$_,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:Ci},outputColorSpaceConfig:{drawingBufferColorSpace:Ci}},[Ci]:{primaries:t,whitePoint:s,transfer:Ge,toXYZ:J_,fromXYZ:$_,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:Ci}}}),a}const Ue=ub();function Fa(a){return a<.04045?a*.0773993808:Math.pow(a*.9478672986+.0521327014,2.4)}function oo(a){return a<.0031308?a*12.92:1.055*Math.pow(a,.41666)-.055}let Vr;class fb{static getDataURL(t,i="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let s;if(t instanceof HTMLCanvasElement)s=t;else{Vr===void 0&&(Vr=Lu("canvas")),Vr.width=t.width,Vr.height=t.height;const l=Vr.getContext("2d");t instanceof ImageData?l.putImageData(t,0,0):l.drawImage(t,0,0,t.width,t.height),s=Vr}return s.toDataURL(i)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const i=Lu("canvas");i.width=t.width,i.height=t.height;const s=i.getContext("2d");s.drawImage(t,0,0,t.width,t.height);const l=s.getImageData(0,0,t.width,t.height),c=l.data;for(let f=0;f<c.length;f++)c[f]=Fa(c[f]/255)*255;return s.putImageData(l,0,0),i}else if(t.data){const i=t.data.slice(0);for(let s=0;s<i.length;s++)i instanceof Uint8Array||i instanceof Uint8ClampedArray?i[s]=Math.floor(Fa(i[s]/255)*255):i[s]=Fa(i[s]);return{data:i,width:t.width,height:t.height}}else return ue("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let hb=0;class jp{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hb++}),this.uuid=za(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const i=this.data;return typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement?t.set(i.videoWidth,i.videoHeight,0):typeof VideoFrame<"u"&&i instanceof VideoFrame?t.set(i.displayHeight,i.displayWidth,0):i!==null?t.set(i.width,i.height,i.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const i=t===void 0||typeof t=="string";if(!i&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const s={uuid:this.uuid,url:""},l=this.data;if(l!==null){let c;if(Array.isArray(l)){c=[];for(let f=0,d=l.length;f<d;f++)l[f].isDataTexture?c.push(od(l[f].image)):c.push(od(l[f]))}else c=od(l);s.url=c}return i||(t.images[this.uuid]=s),s}}function od(a){return typeof HTMLImageElement<"u"&&a instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&a instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&a instanceof ImageBitmap?fb.getDataURL(a):a.data?{data:Array.from(a.data),width:a.width,height:a.height,type:a.data.constructor.name}:(ue("Texture: Unable to serialize Texture."),{})}let db=0;const ld=new Q;class Kn extends ar{constructor(t=Kn.DEFAULT_IMAGE,i=Kn.DEFAULT_MAPPING,s=Oa,l=Oa,c=Vn,f=$s,d=Wi,m=vi,p=Kn.DEFAULT_ANISOTROPY,v=ys){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:db++}),this.uuid=za(),this.name="",this.source=new jp(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=s,this.wrapT=l,this.magFilter=c,this.minFilter=f,this.anisotropy=p,this.format=d,this.internalFormat=null,this.type=m,this.offset=new _e(0,0),this.repeat=new _e(1,1),this.center=new _e(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Me,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=v,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(ld).x}get height(){return this.source.getSize(ld).y}get depth(){return this.source.getSize(ld).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const i in t){const s=t[i];if(s===void 0){ue(`Texture.setValues(): parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ue(`Texture.setValues(): property '${i}' does not exist.`);continue}l&&s&&l.isVector2&&s.isVector2||l&&s&&l.isVector3&&s.isVector3||l&&s&&l.isMatrix3&&s.isMatrix3?l.copy(s):this[i]=s}}toJSON(t){const i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const s={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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&&(s.userData=this.userData),i||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==vx)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Kd:t.x=t.x-Math.floor(t.x);break;case Oa:t.x=t.x<0?0:1;break;case Qd:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Kd:t.y=t.y-Math.floor(t.y);break;case Oa:t.y=t.y<0?0:1;break;case Qd:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}}Kn.DEFAULT_IMAGE=null;Kn.DEFAULT_MAPPING=vx;Kn.DEFAULT_ANISOTROPY=1;class Ze{constructor(t=0,i=0,s=0,l=1){Ze.prototype.isVector4=!0,this.x=t,this.y=i,this.z=s,this.w=l}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,s,l){return this.x=t,this.y=i,this.z=s,this.w=l,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const i=this.x,s=this.y,l=this.z,c=this.w,f=t.elements;return this.x=f[0]*i+f[4]*s+f[8]*l+f[12]*c,this.y=f[1]*i+f[5]*s+f[9]*l+f[13]*c,this.z=f[2]*i+f[6]*s+f[10]*l+f[14]*c,this.w=f[3]*i+f[7]*s+f[11]*l+f[15]*c,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,s,l,c;const m=t.elements,p=m[0],v=m[4],_=m[8],g=m[1],S=m[5],b=m[9],R=m[2],x=m[6],y=m[10];if(Math.abs(v-g)<.01&&Math.abs(_-R)<.01&&Math.abs(b-x)<.01){if(Math.abs(v+g)<.1&&Math.abs(_+R)<.1&&Math.abs(b+x)<.1&&Math.abs(p+S+y-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;const D=(p+1)/2,C=(S+1)/2,G=(y+1)/2,B=(v+g)/4,F=(_+R)/4,T=(b+x)/4;return D>C&&D>G?D<.01?(s=0,l=.707106781,c=.707106781):(s=Math.sqrt(D),l=B/s,c=F/s):C>G?C<.01?(s=.707106781,l=0,c=.707106781):(l=Math.sqrt(C),s=B/l,c=T/l):G<.01?(s=.707106781,l=.707106781,c=0):(c=Math.sqrt(G),s=F/c,l=T/c),this.set(s,l,c,i),this}let w=Math.sqrt((x-b)*(x-b)+(_-R)*(_-R)+(g-v)*(g-v));return Math.abs(w)<.001&&(w=1),this.x=(x-b)/w,this.y=(_-R)/w,this.z=(g-v)/w,this.w=Math.acos((p+S+y-1)/2),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this.w=i[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=ve(this.x,t.x,i.x),this.y=ve(this.y,t.y,i.y),this.z=ve(this.z,t.z,i.z),this.w=ve(this.w,t.w,i.w),this}clampScalar(t,i){return this.x=ve(this.x,t,i),this.y=ve(this.y,t,i),this.z=ve(this.z,t,i),this.w=ve(this.w,t,i),this}clampLength(t,i){const s=this.length();return this.divideScalar(s||1).multiplyScalar(ve(s,t,i))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,s){return this.x=t.x+(i.x-t.x)*s,this.y=t.y+(i.y-t.y)*s,this.z=t.z+(i.z-t.z)*s,this.w=t.w+(i.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),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 pb extends ar{constructor(t=1,i=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Vn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},s),this.isRenderTarget=!0,this.width=t,this.height=i,this.depth=s.depth,this.scissor=new Ze(0,0,t,i),this.scissorTest=!1,this.viewport=new Ze(0,0,t,i),this.textures=[];const l={width:t,height:i,depth:s.depth},c=new Kn(l),f=s.count;for(let d=0;d<f;d++)this.textures[d]=c.clone(),this.textures[d].isRenderTargetTexture=!0,this.textures[d].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview}_setTextureOptions(t={}){const i={minFilter:Vn,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(i.mapping=t.mapping),t.wrapS!==void 0&&(i.wrapS=t.wrapS),t.wrapT!==void 0&&(i.wrapT=t.wrapT),t.wrapR!==void 0&&(i.wrapR=t.wrapR),t.magFilter!==void 0&&(i.magFilter=t.magFilter),t.minFilter!==void 0&&(i.minFilter=t.minFilter),t.format!==void 0&&(i.format=t.format),t.type!==void 0&&(i.type=t.type),t.anisotropy!==void 0&&(i.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(i.colorSpace=t.colorSpace),t.flipY!==void 0&&(i.flipY=t.flipY),t.generateMipmaps!==void 0&&(i.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(i.internalFormat=t.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(i)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,i,s=1){if(this.width!==t||this.height!==i||this.depth!==s){this.width=t,this.height=i,this.depth=s;for(let l=0,c=this.textures.length;l<c;l++)this.textures[l].image.width=t,this.textures[l].image.height=i,this.textures[l].image.depth=s,this.textures[l].isData3DTexture!==!0&&(this.textures[l].isArrayTexture=this.textures[l].image.depth>1);this.dispose()}this.viewport.set(0,0,t,i),this.scissor.set(0,0,t,i)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let i=0,s=t.textures.length;i<s;i++){this.textures[i]=t.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0,this.textures[i].renderTarget=this;const l=Object.assign({},t.textures[i].image);this.textures[i].source=new jp(l)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class oa extends pb{constructor(t=1,i=1,s={}){super(t,i,s),this.isWebGLRenderTarget=!0}}class Cx extends Kn{constructor(t=null,i=1,s=1,l=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:i,height:s,depth:l},this.magFilter=zn,this.minFilter=zn,this.wrapR=Oa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class mb extends Kn{constructor(t=null,i=1,s=1,l=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:i,height:s,depth:l},this.magFilter=zn,this.minFilter=zn,this.wrapR=Oa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class nn{constructor(t,i,s,l,c,f,d,m,p,v,_,g,S,b,R,x){nn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,i,s,l,c,f,d,m,p,v,_,g,S,b,R,x)}set(t,i,s,l,c,f,d,m,p,v,_,g,S,b,R,x){const y=this.elements;return y[0]=t,y[4]=i,y[8]=s,y[12]=l,y[1]=c,y[5]=f,y[9]=d,y[13]=m,y[2]=p,y[6]=v,y[10]=_,y[14]=g,y[3]=S,y[7]=b,y[11]=R,y[15]=x,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 nn().fromArray(this.elements)}copy(t){const i=this.elements,s=t.elements;return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],this}copyPosition(t){const i=this.elements,s=t.elements;return i[12]=s[12],i[13]=s[13],i[14]=s[14],this}setFromMatrix3(t){const i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,s){return this.determinant()===0?(t.set(1,0,0),i.set(0,1,0),s.set(0,0,1),this):(t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this)}makeBasis(t,i,s){return this.set(t.x,i.x,s.x,0,t.y,i.y,s.y,0,t.z,i.z,s.z,0,0,0,0,1),this}extractRotation(t){if(t.determinant()===0)return this.identity();const i=this.elements,s=t.elements,l=1/kr.setFromMatrixColumn(t,0).length(),c=1/kr.setFromMatrixColumn(t,1).length(),f=1/kr.setFromMatrixColumn(t,2).length();return i[0]=s[0]*l,i[1]=s[1]*l,i[2]=s[2]*l,i[3]=0,i[4]=s[4]*c,i[5]=s[5]*c,i[6]=s[6]*c,i[7]=0,i[8]=s[8]*f,i[9]=s[9]*f,i[10]=s[10]*f,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){const i=this.elements,s=t.x,l=t.y,c=t.z,f=Math.cos(s),d=Math.sin(s),m=Math.cos(l),p=Math.sin(l),v=Math.cos(c),_=Math.sin(c);if(t.order==="XYZ"){const g=f*v,S=f*_,b=d*v,R=d*_;i[0]=m*v,i[4]=-m*_,i[8]=p,i[1]=S+b*p,i[5]=g-R*p,i[9]=-d*m,i[2]=R-g*p,i[6]=b+S*p,i[10]=f*m}else if(t.order==="YXZ"){const g=m*v,S=m*_,b=p*v,R=p*_;i[0]=g+R*d,i[4]=b*d-S,i[8]=f*p,i[1]=f*_,i[5]=f*v,i[9]=-d,i[2]=S*d-b,i[6]=R+g*d,i[10]=f*m}else if(t.order==="ZXY"){const g=m*v,S=m*_,b=p*v,R=p*_;i[0]=g-R*d,i[4]=-f*_,i[8]=b+S*d,i[1]=S+b*d,i[5]=f*v,i[9]=R-g*d,i[2]=-f*p,i[6]=d,i[10]=f*m}else if(t.order==="ZYX"){const g=f*v,S=f*_,b=d*v,R=d*_;i[0]=m*v,i[4]=b*p-S,i[8]=g*p+R,i[1]=m*_,i[5]=R*p+g,i[9]=S*p-b,i[2]=-p,i[6]=d*m,i[10]=f*m}else if(t.order==="YZX"){const g=f*m,S=f*p,b=d*m,R=d*p;i[0]=m*v,i[4]=R-g*_,i[8]=b*_+S,i[1]=_,i[5]=f*v,i[9]=-d*v,i[2]=-p*v,i[6]=S*_+b,i[10]=g-R*_}else if(t.order==="XZY"){const g=f*m,S=f*p,b=d*m,R=d*p;i[0]=m*v,i[4]=-_,i[8]=p*v,i[1]=g*_+R,i[5]=f*v,i[9]=S*_-b,i[2]=b*_-S,i[6]=d*v,i[10]=R*_+g}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(gb,t,_b)}lookAt(t,i,s){const l=this.elements;return mi.subVectors(t,i),mi.lengthSq()===0&&(mi.z=1),mi.normalize(),ds.crossVectors(s,mi),ds.lengthSq()===0&&(Math.abs(s.z)===1?mi.x+=1e-4:mi.z+=1e-4,mi.normalize(),ds.crossVectors(s,mi)),ds.normalize(),Ic.crossVectors(mi,ds),l[0]=ds.x,l[4]=Ic.x,l[8]=mi.x,l[1]=ds.y,l[5]=Ic.y,l[9]=mi.y,l[2]=ds.z,l[6]=Ic.z,l[10]=mi.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const s=t.elements,l=i.elements,c=this.elements,f=s[0],d=s[4],m=s[8],p=s[12],v=s[1],_=s[5],g=s[9],S=s[13],b=s[2],R=s[6],x=s[10],y=s[14],w=s[3],D=s[7],C=s[11],G=s[15],B=l[0],F=l[4],T=l[8],U=l[12],et=l[1],H=l[5],q=l[9],nt=l[13],ot=l[2],Y=l[6],z=l[10],A=l[14],ht=l[3],lt=l[7],Ct=l[11],I=l[15];return c[0]=f*B+d*et+m*ot+p*ht,c[4]=f*F+d*H+m*Y+p*lt,c[8]=f*T+d*q+m*z+p*Ct,c[12]=f*U+d*nt+m*A+p*I,c[1]=v*B+_*et+g*ot+S*ht,c[5]=v*F+_*H+g*Y+S*lt,c[9]=v*T+_*q+g*z+S*Ct,c[13]=v*U+_*nt+g*A+S*I,c[2]=b*B+R*et+x*ot+y*ht,c[6]=b*F+R*H+x*Y+y*lt,c[10]=b*T+R*q+x*z+y*Ct,c[14]=b*U+R*nt+x*A+y*I,c[3]=w*B+D*et+C*ot+G*ht,c[7]=w*F+D*H+C*Y+G*lt,c[11]=w*T+D*q+C*z+G*Ct,c[15]=w*U+D*nt+C*A+G*I,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){const t=this.elements,i=t[0],s=t[4],l=t[8],c=t[12],f=t[1],d=t[5],m=t[9],p=t[13],v=t[2],_=t[6],g=t[10],S=t[14],b=t[3],R=t[7],x=t[11],y=t[15],w=m*S-p*g,D=d*S-p*_,C=d*g-m*_,G=f*S-p*v,B=f*g-m*v,F=f*_-d*v;return i*(R*w-x*D+y*C)-s*(b*w-x*G+y*B)+l*(b*D-R*G+y*F)-c*(b*C-R*B+x*F)}transpose(){const t=this.elements;let i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,s){const l=this.elements;return t.isVector3?(l[12]=t.x,l[13]=t.y,l[14]=t.z):(l[12]=t,l[13]=i,l[14]=s),this}invert(){const t=this.elements,i=t[0],s=t[1],l=t[2],c=t[3],f=t[4],d=t[5],m=t[6],p=t[7],v=t[8],_=t[9],g=t[10],S=t[11],b=t[12],R=t[13],x=t[14],y=t[15],w=i*d-s*f,D=i*m-l*f,C=i*p-c*f,G=s*m-l*d,B=s*p-c*d,F=l*p-c*m,T=v*R-_*b,U=v*x-g*b,et=v*y-S*b,H=_*x-g*R,q=_*y-S*R,nt=g*y-S*x,ot=w*nt-D*q+C*H+G*et-B*U+F*T;if(ot===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const Y=1/ot;return t[0]=(d*nt-m*q+p*H)*Y,t[1]=(l*q-s*nt-c*H)*Y,t[2]=(R*F-x*B+y*G)*Y,t[3]=(g*B-_*F-S*G)*Y,t[4]=(m*et-f*nt-p*U)*Y,t[5]=(i*nt-l*et+c*U)*Y,t[6]=(x*C-b*F-y*D)*Y,t[7]=(v*F-g*C+S*D)*Y,t[8]=(f*q-d*et+p*T)*Y,t[9]=(s*et-i*q-c*T)*Y,t[10]=(b*B-R*C+y*w)*Y,t[11]=(_*C-v*B-S*w)*Y,t[12]=(d*U-f*H-m*T)*Y,t[13]=(i*H-s*U+l*T)*Y,t[14]=(R*D-b*G-x*w)*Y,t[15]=(v*G-_*D+g*w)*Y,this}scale(t){const i=this.elements,s=t.x,l=t.y,c=t.z;return i[0]*=s,i[4]*=l,i[8]*=c,i[1]*=s,i[5]*=l,i[9]*=c,i[2]*=s,i[6]*=l,i[10]*=c,i[3]*=s,i[7]*=l,i[11]*=c,this}getMaxScaleOnAxis(){const t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],l=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,s,l))}makeTranslation(t,i,s){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,i,0,0,1,s,0,0,0,1),this}makeRotationX(t){const i=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,i,-s,0,0,s,i,0,0,0,0,1),this}makeRotationY(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,0,s,0,0,1,0,0,-s,0,i,0,0,0,0,1),this}makeRotationZ(t){const i=Math.cos(t),s=Math.sin(t);return this.set(i,-s,0,0,s,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){const s=Math.cos(i),l=Math.sin(i),c=1-s,f=t.x,d=t.y,m=t.z,p=c*f,v=c*d;return this.set(p*f+s,p*d-l*m,p*m+l*d,0,p*d+l*m,v*d+s,v*m-l*f,0,p*m-l*d,v*m+l*f,c*m*m+s,0,0,0,0,1),this}makeScale(t,i,s){return this.set(t,0,0,0,0,i,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,i,s,l,c,f){return this.set(1,s,c,0,t,1,f,0,i,l,1,0,0,0,0,1),this}compose(t,i,s){const l=this.elements,c=i._x,f=i._y,d=i._z,m=i._w,p=c+c,v=f+f,_=d+d,g=c*p,S=c*v,b=c*_,R=f*v,x=f*_,y=d*_,w=m*p,D=m*v,C=m*_,G=s.x,B=s.y,F=s.z;return l[0]=(1-(R+y))*G,l[1]=(S+C)*G,l[2]=(b-D)*G,l[3]=0,l[4]=(S-C)*B,l[5]=(1-(g+y))*B,l[6]=(x+w)*B,l[7]=0,l[8]=(b+D)*F,l[9]=(x-w)*F,l[10]=(1-(g+R))*F,l[11]=0,l[12]=t.x,l[13]=t.y,l[14]=t.z,l[15]=1,this}decompose(t,i,s){const l=this.elements;t.x=l[12],t.y=l[13],t.z=l[14];const c=this.determinant();if(c===0)return s.set(1,1,1),i.identity(),this;let f=kr.set(l[0],l[1],l[2]).length();const d=kr.set(l[4],l[5],l[6]).length(),m=kr.set(l[8],l[9],l[10]).length();c<0&&(f=-f),Ii.copy(this);const p=1/f,v=1/d,_=1/m;return Ii.elements[0]*=p,Ii.elements[1]*=p,Ii.elements[2]*=p,Ii.elements[4]*=v,Ii.elements[5]*=v,Ii.elements[6]*=v,Ii.elements[8]*=_,Ii.elements[9]*=_,Ii.elements[10]*=_,i.setFromRotationMatrix(Ii),s.x=f,s.y=d,s.z=m,this}makePerspective(t,i,s,l,c,f,d=aa,m=!1){const p=this.elements,v=2*c/(i-t),_=2*c/(s-l),g=(i+t)/(i-t),S=(s+l)/(s-l);let b,R;if(m)b=c/(f-c),R=f*c/(f-c);else if(d===aa)b=-(f+c)/(f-c),R=-2*f*c/(f-c);else if(d===Sl)b=-f/(f-c),R=-f*c/(f-c);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+d);return p[0]=v,p[4]=0,p[8]=g,p[12]=0,p[1]=0,p[5]=_,p[9]=S,p[13]=0,p[2]=0,p[6]=0,p[10]=b,p[14]=R,p[3]=0,p[7]=0,p[11]=-1,p[15]=0,this}makeOrthographic(t,i,s,l,c,f,d=aa,m=!1){const p=this.elements,v=2/(i-t),_=2/(s-l),g=-(i+t)/(i-t),S=-(s+l)/(s-l);let b,R;if(m)b=1/(f-c),R=f/(f-c);else if(d===aa)b=-2/(f-c),R=-(f+c)/(f-c);else if(d===Sl)b=-1/(f-c),R=-c/(f-c);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+d);return p[0]=v,p[4]=0,p[8]=0,p[12]=g,p[1]=0,p[5]=_,p[9]=0,p[13]=S,p[2]=0,p[6]=0,p[10]=b,p[14]=R,p[3]=0,p[7]=0,p[11]=0,p[15]=1,this}equals(t){const i=this.elements,s=t.elements;for(let l=0;l<16;l++)if(i[l]!==s[l])return!1;return!0}fromArray(t,i=0){for(let s=0;s<16;s++)this.elements[s]=t[s+i];return this}toArray(t=[],i=0){const s=this.elements;return t[i]=s[0],t[i+1]=s[1],t[i+2]=s[2],t[i+3]=s[3],t[i+4]=s[4],t[i+5]=s[5],t[i+6]=s[6],t[i+7]=s[7],t[i+8]=s[8],t[i+9]=s[9],t[i+10]=s[10],t[i+11]=s[11],t[i+12]=s[12],t[i+13]=s[13],t[i+14]=s[14],t[i+15]=s[15],t}}const kr=new Q,Ii=new nn,gb=new Q(0,0,0),_b=new Q(1,1,1),ds=new Q,Ic=new Q,mi=new Q,tv=new nn,ev=new Ts;class ca{constructor(t=0,i=0,s=0,l=ca.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=s,this._order=l}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,s,l=this._order){return this._x=t,this._y=i,this._z=s,this._order=l,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,s=!0){const l=t.elements,c=l[0],f=l[4],d=l[8],m=l[1],p=l[5],v=l[9],_=l[2],g=l[6],S=l[10];switch(i){case"XYZ":this._y=Math.asin(ve(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-v,S),this._z=Math.atan2(-f,c)):(this._x=Math.atan2(g,p),this._z=0);break;case"YXZ":this._x=Math.asin(-ve(v,-1,1)),Math.abs(v)<.9999999?(this._y=Math.atan2(d,S),this._z=Math.atan2(m,p)):(this._y=Math.atan2(-_,c),this._z=0);break;case"ZXY":this._x=Math.asin(ve(g,-1,1)),Math.abs(g)<.9999999?(this._y=Math.atan2(-_,S),this._z=Math.atan2(-f,p)):(this._y=0,this._z=Math.atan2(m,c));break;case"ZYX":this._y=Math.asin(-ve(_,-1,1)),Math.abs(_)<.9999999?(this._x=Math.atan2(g,S),this._z=Math.atan2(m,c)):(this._x=0,this._z=Math.atan2(-f,p));break;case"YZX":this._z=Math.asin(ve(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(-v,p),this._y=Math.atan2(-_,c)):(this._x=0,this._y=Math.atan2(d,S));break;case"XZY":this._z=Math.asin(-ve(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(g,p),this._y=Math.atan2(d,c)):(this._x=Math.atan2(-v,S),this._y=0);break;default:ue("Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,s===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,s){return tv.makeRotationFromQuaternion(t),this.setFromRotationMatrix(tv,i,s)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return ev.setFromEuler(this),this.setFromQuaternion(ev,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ca.DEFAULT_ORDER="XYZ";class Dx{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}}let vb=0;const nv=new Q,Xr=new Ts,Ca=new nn,Bc=new Q,ll=new Q,xb=new Q,yb=new Ts,iv=new Q(1,0,0),av=new Q(0,1,0),sv=new Q(0,0,1),rv={type:"added"},Sb={type:"removed"},Wr={type:"childadded",child:null},cd={type:"childremoved",child:null};class Fn extends ar{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:vb++}),this.uuid=za(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Fn.DEFAULT_UP.clone();const t=new Q,i=new ca,s=new Ts,l=new Q(1,1,1);function c(){s.setFromEuler(i,!1)}function f(){i.setFromQuaternion(s,void 0,!1)}i._onChange(c),s._onChange(f),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:l},modelViewMatrix:{value:new nn},normalMatrix:{value:new Me}}),this.matrix=new nn,this.matrixWorld=new nn,this.matrixAutoUpdate=Fn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Fn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Dx,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Xr.setFromAxisAngle(t,i),this.quaternion.multiply(Xr),this}rotateOnWorldAxis(t,i){return Xr.setFromAxisAngle(t,i),this.quaternion.premultiply(Xr),this}rotateX(t){return this.rotateOnAxis(iv,t)}rotateY(t){return this.rotateOnAxis(av,t)}rotateZ(t){return this.rotateOnAxis(sv,t)}translateOnAxis(t,i){return nv.copy(t).applyQuaternion(this.quaternion),this.position.add(nv.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(iv,t)}translateY(t){return this.translateOnAxis(av,t)}translateZ(t){return this.translateOnAxis(sv,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ca.copy(this.matrixWorld).invert())}lookAt(t,i,s){t.isVector3?Bc.copy(t):Bc.set(t,i,s);const l=this.parent;this.updateWorldMatrix(!0,!1),ll.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ca.lookAt(ll,Bc,this.up):Ca.lookAt(Bc,ll,this.up),this.quaternion.setFromRotationMatrix(Ca),l&&(Ca.extractRotation(l.matrixWorld),Xr.setFromRotationMatrix(Ca),this.quaternion.premultiply(Xr.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}return t===this?(Pe("Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(rv),Wr.child=t,this.dispatchEvent(Wr),Wr.child=null):Pe("Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const i=this.children.indexOf(t);return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(Sb),cd.child=t,this.dispatchEvent(cd),cd.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ca.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Ca.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ca),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(rv),Wr.child=t,this.dispatchEvent(Wr),Wr.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let s=0,l=this.children.length;s<l;s++){const f=this.children[s].getObjectByProperty(t,i);if(f!==void 0)return f}}getObjectsByProperty(t,i,s=[]){this[t]===i&&s.push(this);const l=this.children;for(let c=0,f=l.length;c<f;c++)l[c].getObjectsByProperty(t,i,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ll,t,xb),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ll,yb,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].traverseVisible(t)}traverseAncestors(t){const i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const t=this.pivot;if(t!==null){const i=t.x,s=t.y,l=t.z,c=this.matrix.elements;c[12]+=i-c[0]*i-c[4]*s-c[8]*l,c[13]+=s-c[1]*i-c[5]*s-c[9]*l,c[14]+=l-c[2]*i-c[6]*s-c[10]*l}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const i=this.children;for(let s=0,l=i.length;s<l;s++)i[s].updateMatrixWorld(t)}updateWorldMatrix(t,i){const s=this.parent;if(t===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),i===!0){const l=this.children;for(let c=0,f=l.length;c<f;c++)l[c].updateWorldMatrix(!1,!0)}}toJSON(t){const i=t===void 0||typeof t=="string",s={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const l={};l.uuid=this.uuid,l.type=this.type,this.name!==""&&(l.name=this.name),this.castShadow===!0&&(l.castShadow=!0),this.receiveShadow===!0&&(l.receiveShadow=!0),this.visible===!1&&(l.visible=!1),this.frustumCulled===!1&&(l.frustumCulled=!1),this.renderOrder!==0&&(l.renderOrder=this.renderOrder),this.static!==!1&&(l.static=this.static),Object.keys(this.userData).length>0&&(l.userData=this.userData),l.layers=this.layers.mask,l.matrix=this.matrix.toArray(),l.up=this.up.toArray(),this.pivot!==null&&(l.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(l.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(l.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(l.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(l.type="InstancedMesh",l.count=this.count,l.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(l.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(l.type="BatchedMesh",l.perObjectFrustumCulled=this.perObjectFrustumCulled,l.sortObjects=this.sortObjects,l.drawRanges=this._drawRanges,l.reservedRanges=this._reservedRanges,l.geometryInfo=this._geometryInfo.map(d=>({...d,boundingBox:d.boundingBox?d.boundingBox.toJSON():void 0,boundingSphere:d.boundingSphere?d.boundingSphere.toJSON():void 0})),l.instanceInfo=this._instanceInfo.map(d=>({...d})),l.availableInstanceIds=this._availableInstanceIds.slice(),l.availableGeometryIds=this._availableGeometryIds.slice(),l.nextIndexStart=this._nextIndexStart,l.nextVertexStart=this._nextVertexStart,l.geometryCount=this._geometryCount,l.maxInstanceCount=this._maxInstanceCount,l.maxVertexCount=this._maxVertexCount,l.maxIndexCount=this._maxIndexCount,l.geometryInitialized=this._geometryInitialized,l.matricesTexture=this._matricesTexture.toJSON(t),l.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(l.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(l.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(l.boundingBox=this.boundingBox.toJSON()));function c(d,m){return d[m.uuid]===void 0&&(d[m.uuid]=m.toJSON(t)),m.uuid}if(this.isScene)this.background&&(this.background.isColor?l.background=this.background.toJSON():this.background.isTexture&&(l.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(l.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){l.geometry=c(t.geometries,this.geometry);const d=this.geometry.parameters;if(d!==void 0&&d.shapes!==void 0){const m=d.shapes;if(Array.isArray(m))for(let p=0,v=m.length;p<v;p++){const _=m[p];c(t.shapes,_)}else c(t.shapes,m)}}if(this.isSkinnedMesh&&(l.bindMode=this.bindMode,l.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(c(t.skeletons,this.skeleton),l.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const d=[];for(let m=0,p=this.material.length;m<p;m++)d.push(c(t.materials,this.material[m]));l.material=d}else l.material=c(t.materials,this.material);if(this.children.length>0){l.children=[];for(let d=0;d<this.children.length;d++)l.children.push(this.children[d].toJSON(t).object)}if(this.animations.length>0){l.animations=[];for(let d=0;d<this.animations.length;d++){const m=this.animations[d];l.animations.push(c(t.animations,m))}}if(i){const d=f(t.geometries),m=f(t.materials),p=f(t.textures),v=f(t.images),_=f(t.shapes),g=f(t.skeletons),S=f(t.animations),b=f(t.nodes);d.length>0&&(s.geometries=d),m.length>0&&(s.materials=m),p.length>0&&(s.textures=p),v.length>0&&(s.images=v),_.length>0&&(s.shapes=_),g.length>0&&(s.skeletons=g),S.length>0&&(s.animations=S),b.length>0&&(s.nodes=b)}return s.object=l,s;function f(d){const m=[];for(const p in d){const v=d[p];delete v.metadata,m.push(v)}return m}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),t.pivot!==null&&(this.pivot=t.pivot.clone()),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.static=t.static,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let s=0;s<t.children.length;s++){const l=t.children[s];this.add(l.clone())}return this}}Fn.DEFAULT_UP=new Q(0,1,0);Fn.DEFAULT_MATRIX_AUTO_UPDATE=!0;Fn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class Hc extends Fn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Mb={type:"move"};class ud{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Hc,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 Hc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Hc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Q),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const i=this._hand;if(i)for(const s of t.hand.values())this._getHandJoint(i,s)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,i,s){let l=null,c=null,f=null;const d=this._targetRay,m=this._grip,p=this._hand;if(t&&i.session.visibilityState!=="visible-blurred"){if(p&&t.hand){f=!0;for(const R of t.hand.values()){const x=i.getJointPose(R,s),y=this._getHandJoint(p,R);x!==null&&(y.matrix.fromArray(x.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,y.jointRadius=x.radius),y.visible=x!==null}const v=p.joints["index-finger-tip"],_=p.joints["thumb-tip"],g=v.position.distanceTo(_.position),S=.02,b=.005;p.inputState.pinching&&g>S+b?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!p.inputState.pinching&&g<=S-b&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else m!==null&&t.gripSpace&&(c=i.getPose(t.gripSpace,s),c!==null&&(m.matrix.fromArray(c.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,c.linearVelocity?(m.hasLinearVelocity=!0,m.linearVelocity.copy(c.linearVelocity)):m.hasLinearVelocity=!1,c.angularVelocity?(m.hasAngularVelocity=!0,m.angularVelocity.copy(c.angularVelocity)):m.hasAngularVelocity=!1));d!==null&&(l=i.getPose(t.targetRaySpace,s),l===null&&c!==null&&(l=c),l!==null&&(d.matrix.fromArray(l.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,l.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(l.linearVelocity)):d.hasLinearVelocity=!1,l.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(l.angularVelocity)):d.hasAngularVelocity=!1,this.dispatchEvent(Mb)))}return d!==null&&(d.visible=l!==null),m!==null&&(m.visible=c!==null),p!==null&&(p.visible=f!==null),this}_getHandJoint(t,i){if(t.joints[i.jointName]===void 0){const s=new Hc;s.matrixAutoUpdate=!1,s.visible=!1,t.joints[i.jointName]=s,t.add(s)}return t.joints[i.jointName]}}const Ux={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},ps={h:0,s:0,l:0},Gc={h:0,s:0,l:0};function fd(a,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?a+(t-a)*6*i:i<1/2?t:i<2/3?a+(t-a)*6*(2/3-i):a}class Ee{constructor(t,i,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,s)}set(t,i,s){if(i===void 0&&s===void 0){const l=t;l&&l.isColor?this.copy(l):typeof l=="number"?this.setHex(l):typeof l=="string"&&this.setStyle(l)}else this.setRGB(t,i,s);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,i=Ci){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Ue.colorSpaceToWorking(this,i),this}setRGB(t,i,s,l=Ue.workingColorSpace){return this.r=t,this.g=i,this.b=s,Ue.colorSpaceToWorking(this,l),this}setHSL(t,i,s,l=Ue.workingColorSpace){if(t=Yp(t,1),i=ve(i,0,1),s=ve(s,0,1),i===0)this.r=this.g=this.b=s;else{const c=s<=.5?s*(1+i):s+i-s*i,f=2*s-c;this.r=fd(f,c,t+1/3),this.g=fd(f,c,t),this.b=fd(f,c,t-1/3)}return Ue.colorSpaceToWorking(this,l),this}setStyle(t,i=Ci){function s(c){c!==void 0&&parseFloat(c)<1&&ue("Color: Alpha component of "+t+" will be ignored.")}let l;if(l=/^(\w+)\(([^\)]*)\)/.exec(t)){let c;const f=l[1],d=l[2];switch(f){case"rgb":case"rgba":if(c=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setRGB(Math.min(255,parseInt(c[1],10))/255,Math.min(255,parseInt(c[2],10))/255,Math.min(255,parseInt(c[3],10))/255,i);if(c=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setRGB(Math.min(100,parseInt(c[1],10))/100,Math.min(100,parseInt(c[2],10))/100,Math.min(100,parseInt(c[3],10))/100,i);break;case"hsl":case"hsla":if(c=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(d))return s(c[4]),this.setHSL(parseFloat(c[1])/360,parseFloat(c[2])/100,parseFloat(c[3])/100,i);break;default:ue("Color: Unknown color model "+t)}}else if(l=/^\#([A-Fa-f\d]+)$/.exec(t)){const c=l[1],f=c.length;if(f===3)return this.setRGB(parseInt(c.charAt(0),16)/15,parseInt(c.charAt(1),16)/15,parseInt(c.charAt(2),16)/15,i);if(f===6)return this.setHex(parseInt(c,16),i);ue("Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}setColorName(t,i=Ci){const s=Ux[t.toLowerCase()];return s!==void 0?this.setHex(s,i):ue("Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Fa(t.r),this.g=Fa(t.g),this.b=Fa(t.b),this}copyLinearToSRGB(t){return this.r=oo(t.r),this.g=oo(t.g),this.b=oo(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ci){return Ue.workingToColorSpace(Hn.copy(this),t),Math.round(ve(Hn.r*255,0,255))*65536+Math.round(ve(Hn.g*255,0,255))*256+Math.round(ve(Hn.b*255,0,255))}getHexString(t=Ci){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,i=Ue.workingColorSpace){Ue.workingToColorSpace(Hn.copy(this),i);const s=Hn.r,l=Hn.g,c=Hn.b,f=Math.max(s,l,c),d=Math.min(s,l,c);let m,p;const v=(d+f)/2;if(d===f)m=0,p=0;else{const _=f-d;switch(p=v<=.5?_/(f+d):_/(2-f-d),f){case s:m=(l-c)/_+(l<c?6:0);break;case l:m=(c-s)/_+2;break;case c:m=(s-l)/_+4;break}m/=6}return t.h=m,t.s=p,t.l=v,t}getRGB(t,i=Ue.workingColorSpace){return Ue.workingToColorSpace(Hn.copy(this),i),t.r=Hn.r,t.g=Hn.g,t.b=Hn.b,t}getStyle(t=Ci){Ue.workingToColorSpace(Hn.copy(this),t);const i=Hn.r,s=Hn.g,l=Hn.b;return t!==Ci?`color(${t} ${i.toFixed(3)} ${s.toFixed(3)} ${l.toFixed(3)})`:`rgb(${Math.round(i*255)},${Math.round(s*255)},${Math.round(l*255)})`}offsetHSL(t,i,s){return this.getHSL(ps),this.setHSL(ps.h+t,ps.s+i,ps.l+s)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,i){return this.r=t.r+i.r,this.g=t.g+i.g,this.b=t.b+i.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,i){return this.r+=(t.r-this.r)*i,this.g+=(t.g-this.g)*i,this.b+=(t.b-this.b)*i,this}lerpColors(t,i,s){return this.r=t.r+(i.r-t.r)*s,this.g=t.g+(i.g-t.g)*s,this.b=t.b+(i.b-t.b)*s,this}lerpHSL(t,i){this.getHSL(ps),t.getHSL(Gc);const s=vl(ps.h,Gc.h,i),l=vl(ps.s,Gc.s,i),c=vl(ps.l,Gc.l,i);return this.setHSL(s,l,c),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const i=this.r,s=this.g,l=this.b,c=t.elements;return this.r=c[0]*i+c[3]*s+c[6]*l,this.g=c[1]*i+c[4]*s+c[7]*l,this.b=c[2]*i+c[5]*s+c[8]*l,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,i=0){return this.r=t[i],this.g=t[i+1],this.b=t[i+2],this}toArray(t=[],i=0){return t[i]=this.r,t[i+1]=this.g,t[i+2]=this.b,t}fromBufferAttribute(t,i){return this.r=t.getX(i),this.g=t.getY(i),this.b=t.getZ(i),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Hn=new Ee;Ee.NAMES=Ux;class bb extends Fn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ca,this.environmentIntensity=1,this.environmentRotation=new ca,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,i){return super.copy(t,i),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const i=super.toJSON(t);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(i.object.environmentIntensity=this.environmentIntensity),i.object.environmentRotation=this.environmentRotation.toArray(),i}}const Bi=new Q,Da=new Q,hd=new Q,Ua=new Q,qr=new Q,Yr=new Q,ov=new Q,dd=new Q,pd=new Q,md=new Q,gd=new Ze,_d=new Ze,vd=new Ze;class Di{constructor(t=new Q,i=new Q,s=new Q){this.a=t,this.b=i,this.c=s}static getNormal(t,i,s,l){l.subVectors(s,i),Bi.subVectors(t,i),l.cross(Bi);const c=l.lengthSq();return c>0?l.multiplyScalar(1/Math.sqrt(c)):l.set(0,0,0)}static getBarycoord(t,i,s,l,c){Bi.subVectors(l,i),Da.subVectors(s,i),hd.subVectors(t,i);const f=Bi.dot(Bi),d=Bi.dot(Da),m=Bi.dot(hd),p=Da.dot(Da),v=Da.dot(hd),_=f*p-d*d;if(_===0)return c.set(0,0,0),null;const g=1/_,S=(p*m-d*v)*g,b=(f*v-d*m)*g;return c.set(1-S-b,b,S)}static containsPoint(t,i,s,l){return this.getBarycoord(t,i,s,l,Ua)===null?!1:Ua.x>=0&&Ua.y>=0&&Ua.x+Ua.y<=1}static getInterpolation(t,i,s,l,c,f,d,m){return this.getBarycoord(t,i,s,l,Ua)===null?(m.x=0,m.y=0,"z"in m&&(m.z=0),"w"in m&&(m.w=0),null):(m.setScalar(0),m.addScaledVector(c,Ua.x),m.addScaledVector(f,Ua.y),m.addScaledVector(d,Ua.z),m)}static getInterpolatedAttribute(t,i,s,l,c,f){return gd.setScalar(0),_d.setScalar(0),vd.setScalar(0),gd.fromBufferAttribute(t,i),_d.fromBufferAttribute(t,s),vd.fromBufferAttribute(t,l),f.setScalar(0),f.addScaledVector(gd,c.x),f.addScaledVector(_d,c.y),f.addScaledVector(vd,c.z),f}static isFrontFacing(t,i,s,l){return Bi.subVectors(s,i),Da.subVectors(t,i),Bi.cross(Da).dot(l)<0}set(t,i,s){return this.a.copy(t),this.b.copy(i),this.c.copy(s),this}setFromPointsAndIndices(t,i,s,l){return this.a.copy(t[i]),this.b.copy(t[s]),this.c.copy(t[l]),this}setFromAttributeAndIndices(t,i,s,l){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,s),this.c.fromBufferAttribute(t,l),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Bi.subVectors(this.c,this.b),Da.subVectors(this.a,this.b),Bi.cross(Da).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Di.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return Di.getBarycoord(t,this.a,this.b,this.c,i)}getInterpolation(t,i,s,l,c){return Di.getInterpolation(t,this.a,this.b,this.c,i,s,l,c)}containsPoint(t){return Di.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Di.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){const s=this.a,l=this.b,c=this.c;let f,d;qr.subVectors(l,s),Yr.subVectors(c,s),dd.subVectors(t,s);const m=qr.dot(dd),p=Yr.dot(dd);if(m<=0&&p<=0)return i.copy(s);pd.subVectors(t,l);const v=qr.dot(pd),_=Yr.dot(pd);if(v>=0&&_<=v)return i.copy(l);const g=m*_-v*p;if(g<=0&&m>=0&&v<=0)return f=m/(m-v),i.copy(s).addScaledVector(qr,f);md.subVectors(t,c);const S=qr.dot(md),b=Yr.dot(md);if(b>=0&&S<=b)return i.copy(c);const R=S*p-m*b;if(R<=0&&p>=0&&b<=0)return d=p/(p-b),i.copy(s).addScaledVector(Yr,d);const x=v*b-S*_;if(x<=0&&_-v>=0&&S-b>=0)return ov.subVectors(c,l),d=(_-v)/(_-v+(S-b)),i.copy(l).addScaledVector(ov,d);const y=1/(x+R+g);return f=R*y,d=g*y,i.copy(s).addScaledVector(qr,f).addScaledVector(Yr,d)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}class As{constructor(t=new Q(1/0,1/0,1/0),i=new Q(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=i}set(t,i){return this.min.copy(t),this.max.copy(i),this}setFromArray(t){this.makeEmpty();for(let i=0,s=t.length;i<s;i+=3)this.expandByPoint(Hi.fromArray(t,i));return this}setFromBufferAttribute(t){this.makeEmpty();for(let i=0,s=t.count;i<s;i++)this.expandByPoint(Hi.fromBufferAttribute(t,i));return this}setFromPoints(t){this.makeEmpty();for(let i=0,s=t.length;i<s;i++)this.expandByPoint(t[i]);return this}setFromCenterAndSize(t,i){const s=Hi.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(s),this.max.copy(t).add(s),this}setFromObject(t,i=!1){return this.makeEmpty(),this.expandByObject(t,i)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,i=!1){t.updateWorldMatrix(!1,!1);const s=t.geometry;if(s!==void 0){const c=s.getAttribute("position");if(i===!0&&c!==void 0&&t.isInstancedMesh!==!0)for(let f=0,d=c.count;f<d;f++)t.isMesh===!0?t.getVertexPosition(f,Hi):Hi.fromBufferAttribute(c,f),Hi.applyMatrix4(t.matrixWorld),this.expandByPoint(Hi);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Vc.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Vc.copy(s.boundingBox)),Vc.applyMatrix4(t.matrixWorld),this.union(Vc)}const l=t.children;for(let c=0,f=l.length;c<f;c++)this.expandByObject(l[c],i);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Hi),Hi.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let i,s;return t.normal.x>0?(i=t.normal.x*this.min.x,s=t.normal.x*this.max.x):(i=t.normal.x*this.max.x,s=t.normal.x*this.min.x),t.normal.y>0?(i+=t.normal.y*this.min.y,s+=t.normal.y*this.max.y):(i+=t.normal.y*this.max.y,s+=t.normal.y*this.min.y),t.normal.z>0?(i+=t.normal.z*this.min.z,s+=t.normal.z*this.max.z):(i+=t.normal.z*this.max.z,s+=t.normal.z*this.min.z),i<=-t.constant&&s>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(cl),kc.subVectors(this.max,cl),jr.subVectors(t.a,cl),Zr.subVectors(t.b,cl),Kr.subVectors(t.c,cl),ms.subVectors(Zr,jr),gs.subVectors(Kr,Zr),Ws.subVectors(jr,Kr);let i=[0,-ms.z,ms.y,0,-gs.z,gs.y,0,-Ws.z,Ws.y,ms.z,0,-ms.x,gs.z,0,-gs.x,Ws.z,0,-Ws.x,-ms.y,ms.x,0,-gs.y,gs.x,0,-Ws.y,Ws.x,0];return!xd(i,jr,Zr,Kr,kc)||(i=[1,0,0,0,1,0,0,0,1],!xd(i,jr,Zr,Kr,kc))?!1:(Xc.crossVectors(ms,gs),i=[Xc.x,Xc.y,Xc.z],xd(i,jr,Zr,Kr,kc))}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Hi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Hi).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(La[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),La[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),La[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),La[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),La[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),La[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),La[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),La[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(La),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const La=[new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q],Hi=new Q,Vc=new As,jr=new Q,Zr=new Q,Kr=new Q,ms=new Q,gs=new Q,Ws=new Q,cl=new Q,kc=new Q,Xc=new Q,qs=new Q;function xd(a,t,i,s,l){for(let c=0,f=a.length-3;c<=f;c+=3){qs.fromArray(a,c);const d=l.x*Math.abs(qs.x)+l.y*Math.abs(qs.y)+l.z*Math.abs(qs.z),m=t.dot(qs),p=i.dot(qs),v=s.dot(qs);if(Math.max(-Math.max(m,p,v),Math.min(m,p,v))>d)return!1}return!0}const gn=new Q,Wc=new _e;let Eb=0;class xi{constructor(t,i,s=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Eb++}),this.name="",this.array=t,this.itemSize=i,this.count=t!==void 0?t.length/i:0,this.normalized=s,this.usage=Dp,this.updateRanges=[],this.gpuType=ia,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,i,s){t*=this.itemSize,s*=i.itemSize;for(let l=0,c=this.itemSize;l<c;l++)this.array[t+l]=i.array[s+l];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let i=0,s=this.count;i<s;i++)Wc.fromBufferAttribute(this,i),Wc.applyMatrix3(t),this.setXY(i,Wc.x,Wc.y);else if(this.itemSize===3)for(let i=0,s=this.count;i<s;i++)gn.fromBufferAttribute(this,i),gn.applyMatrix3(t),this.setXYZ(i,gn.x,gn.y,gn.z);return this}applyMatrix4(t){for(let i=0,s=this.count;i<s;i++)gn.fromBufferAttribute(this,i),gn.applyMatrix4(t),this.setXYZ(i,gn.x,gn.y,gn.z);return this}applyNormalMatrix(t){for(let i=0,s=this.count;i<s;i++)gn.fromBufferAttribute(this,i),gn.applyNormalMatrix(t),this.setXYZ(i,gn.x,gn.y,gn.z);return this}transformDirection(t){for(let i=0,s=this.count;i<s;i++)gn.fromBufferAttribute(this,i),gn.transformDirection(t),this.setXYZ(i,gn.x,gn.y,gn.z);return this}set(t,i=0){return this.array.set(t,i),this}getComponent(t,i){let s=this.array[t*this.itemSize+i];return this.normalized&&(s=Xi(s,this.array)),s}setComponent(t,i,s){return this.normalized&&(s=Ve(s,this.array)),this.array[t*this.itemSize+i]=s,this}getX(t){let i=this.array[t*this.itemSize];return this.normalized&&(i=Xi(i,this.array)),i}setX(t,i){return this.normalized&&(i=Ve(i,this.array)),this.array[t*this.itemSize]=i,this}getY(t){let i=this.array[t*this.itemSize+1];return this.normalized&&(i=Xi(i,this.array)),i}setY(t,i){return this.normalized&&(i=Ve(i,this.array)),this.array[t*this.itemSize+1]=i,this}getZ(t){let i=this.array[t*this.itemSize+2];return this.normalized&&(i=Xi(i,this.array)),i}setZ(t,i){return this.normalized&&(i=Ve(i,this.array)),this.array[t*this.itemSize+2]=i,this}getW(t){let i=this.array[t*this.itemSize+3];return this.normalized&&(i=Xi(i,this.array)),i}setW(t,i){return this.normalized&&(i=Ve(i,this.array)),this.array[t*this.itemSize+3]=i,this}setXY(t,i,s){return t*=this.itemSize,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array)),this.array[t+0]=i,this.array[t+1]=s,this}setXYZ(t,i,s,l){return t*=this.itemSize,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array),l=Ve(l,this.array)),this.array[t+0]=i,this.array[t+1]=s,this.array[t+2]=l,this}setXYZW(t,i,s,l,c){return t*=this.itemSize,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array),l=Ve(l,this.array),c=Ve(c,this.array)),this.array[t+0]=i,this.array[t+1]=s,this.array[t+2]=l,this.array[t+3]=c,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==Dp&&(t.usage=this.usage),t}}class Lx extends xi{constructor(t,i,s){super(new Uint16Array(t),i,s)}}class Nx extends xi{constructor(t,i,s){super(new Uint32Array(t),i,s)}}class _n extends xi{constructor(t,i,s){super(new Float32Array(t),i,s)}}const Tb=new As,ul=new Q,yd=new Q;class po{constructor(t=new Q,i=-1){this.isSphere=!0,this.center=t,this.radius=i}set(t,i){return this.center.copy(t),this.radius=i,this}setFromPoints(t,i){const s=this.center;i!==void 0?s.copy(i):Tb.setFromPoints(t).getCenter(s);let l=0;for(let c=0,f=t.length;c<f;c++)l=Math.max(l,s.distanceToSquared(t[c]));return this.radius=Math.sqrt(l),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const i=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=i*i}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,i){const s=this.center.distanceToSquared(t);return i.copy(t),s>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;ul.subVectors(t,this.center);const i=ul.lengthSq();if(i>this.radius*this.radius){const s=Math.sqrt(i),l=(s-this.radius)*.5;this.center.addScaledVector(ul,l/s),this.radius+=l}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(yd.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(ul.copy(t.center).add(yd)),this.expandByPoint(ul.copy(t.center).sub(yd))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}let Ab=0;const wi=new nn,Sd=new Fn,Qr=new Q,gi=new As,fl=new As,An=new Q;class Mn extends ar{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ab++}),this.uuid=za(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,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(t){return Array.isArray(t)?this.index=new(XM(t)?Nx:Lx)(t,1):this.index=t,this}setIndirect(t,i=0){return this.indirect=t,this.indirectOffset=i,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,i){return this.attributes[t]=i,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,i,s=0){this.groups.push({start:t,count:i,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(t,i){this.drawRange.start=t,this.drawRange.count=i}applyMatrix4(t){const i=this.attributes.position;i!==void 0&&(i.applyMatrix4(t),i.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const c=new Me().getNormalMatrix(t);s.applyNormalMatrix(c),s.needsUpdate=!0}const l=this.attributes.tangent;return l!==void 0&&(l.transformDirection(t),l.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return wi.makeRotationFromQuaternion(t),this.applyMatrix4(wi),this}rotateX(t){return wi.makeRotationX(t),this.applyMatrix4(wi),this}rotateY(t){return wi.makeRotationY(t),this.applyMatrix4(wi),this}rotateZ(t){return wi.makeRotationZ(t),this.applyMatrix4(wi),this}translate(t,i,s){return wi.makeTranslation(t,i,s),this.applyMatrix4(wi),this}scale(t,i,s){return wi.makeScale(t,i,s),this.applyMatrix4(wi),this}lookAt(t){return Sd.lookAt(t),Sd.updateMatrix(),this.applyMatrix4(Sd.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qr).negate(),this.translate(Qr.x,Qr.y,Qr.z),this}setFromPoints(t){const i=this.getAttribute("position");if(i===void 0){const s=[];for(let l=0,c=t.length;l<c;l++){const f=t[l];s.push(f.x,f.y,f.z||0)}this.setAttribute("position",new _n(s,3))}else{const s=Math.min(t.length,i.count);for(let l=0;l<s;l++){const c=t[l];i.setXYZ(l,c.x,c.y,c.z||0)}t.length>i.count&&ue("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),i.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new As);const t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Pe("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new Q(-1/0,-1/0,-1/0),new Q(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),i)for(let s=0,l=i.length;s<l;s++){const c=i[s];gi.setFromBufferAttribute(c),this.morphTargetsRelative?(An.addVectors(this.boundingBox.min,gi.min),this.boundingBox.expandByPoint(An),An.addVectors(this.boundingBox.max,gi.max),this.boundingBox.expandByPoint(An)):(this.boundingBox.expandByPoint(gi.min),this.boundingBox.expandByPoint(gi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Pe('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 po);const t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){Pe("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new Q,1/0);return}if(t){const s=this.boundingSphere.center;if(gi.setFromBufferAttribute(t),i)for(let c=0,f=i.length;c<f;c++){const d=i[c];fl.setFromBufferAttribute(d),this.morphTargetsRelative?(An.addVectors(gi.min,fl.min),gi.expandByPoint(An),An.addVectors(gi.max,fl.max),gi.expandByPoint(An)):(gi.expandByPoint(fl.min),gi.expandByPoint(fl.max))}gi.getCenter(s);let l=0;for(let c=0,f=t.count;c<f;c++)An.fromBufferAttribute(t,c),l=Math.max(l,s.distanceToSquared(An));if(i)for(let c=0,f=i.length;c<f;c++){const d=i[c],m=this.morphTargetsRelative;for(let p=0,v=d.count;p<v;p++)An.fromBufferAttribute(d,p),m&&(Qr.fromBufferAttribute(t,p),An.add(Qr)),l=Math.max(l,s.distanceToSquared(An))}this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&Pe('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,i=this.attributes;if(t===null||i.position===void 0||i.normal===void 0||i.uv===void 0){Pe("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=i.position,l=i.normal,c=i.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new xi(new Float32Array(4*s.count),4));const f=this.getAttribute("tangent"),d=[],m=[];for(let T=0;T<s.count;T++)d[T]=new Q,m[T]=new Q;const p=new Q,v=new Q,_=new Q,g=new _e,S=new _e,b=new _e,R=new Q,x=new Q;function y(T,U,et){p.fromBufferAttribute(s,T),v.fromBufferAttribute(s,U),_.fromBufferAttribute(s,et),g.fromBufferAttribute(c,T),S.fromBufferAttribute(c,U),b.fromBufferAttribute(c,et),v.sub(p),_.sub(p),S.sub(g),b.sub(g);const H=1/(S.x*b.y-b.x*S.y);isFinite(H)&&(R.copy(v).multiplyScalar(b.y).addScaledVector(_,-S.y).multiplyScalar(H),x.copy(_).multiplyScalar(S.x).addScaledVector(v,-b.x).multiplyScalar(H),d[T].add(R),d[U].add(R),d[et].add(R),m[T].add(x),m[U].add(x),m[et].add(x))}let w=this.groups;w.length===0&&(w=[{start:0,count:t.count}]);for(let T=0,U=w.length;T<U;++T){const et=w[T],H=et.start,q=et.count;for(let nt=H,ot=H+q;nt<ot;nt+=3)y(t.getX(nt+0),t.getX(nt+1),t.getX(nt+2))}const D=new Q,C=new Q,G=new Q,B=new Q;function F(T){G.fromBufferAttribute(l,T),B.copy(G);const U=d[T];D.copy(U),D.sub(G.multiplyScalar(G.dot(U))).normalize(),C.crossVectors(B,U);const H=C.dot(m[T])<0?-1:1;f.setXYZW(T,D.x,D.y,D.z,H)}for(let T=0,U=w.length;T<U;++T){const et=w[T],H=et.start,q=et.count;for(let nt=H,ot=H+q;nt<ot;nt+=3)F(t.getX(nt+0)),F(t.getX(nt+1)),F(t.getX(nt+2))}}computeVertexNormals(){const t=this.index,i=this.getAttribute("position");if(i!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new xi(new Float32Array(i.count*3),3),this.setAttribute("normal",s);else for(let g=0,S=s.count;g<S;g++)s.setXYZ(g,0,0,0);const l=new Q,c=new Q,f=new Q,d=new Q,m=new Q,p=new Q,v=new Q,_=new Q;if(t)for(let g=0,S=t.count;g<S;g+=3){const b=t.getX(g+0),R=t.getX(g+1),x=t.getX(g+2);l.fromBufferAttribute(i,b),c.fromBufferAttribute(i,R),f.fromBufferAttribute(i,x),v.subVectors(f,c),_.subVectors(l,c),v.cross(_),d.fromBufferAttribute(s,b),m.fromBufferAttribute(s,R),p.fromBufferAttribute(s,x),d.add(v),m.add(v),p.add(v),s.setXYZ(b,d.x,d.y,d.z),s.setXYZ(R,m.x,m.y,m.z),s.setXYZ(x,p.x,p.y,p.z)}else for(let g=0,S=i.count;g<S;g+=3)l.fromBufferAttribute(i,g+0),c.fromBufferAttribute(i,g+1),f.fromBufferAttribute(i,g+2),v.subVectors(f,c),_.subVectors(l,c),v.cross(_),s.setXYZ(g+0,v.x,v.y,v.z),s.setXYZ(g+1,v.x,v.y,v.z),s.setXYZ(g+2,v.x,v.y,v.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let i=0,s=t.count;i<s;i++)An.fromBufferAttribute(t,i),An.normalize(),t.setXYZ(i,An.x,An.y,An.z)}toNonIndexed(){function t(d,m){const p=d.array,v=d.itemSize,_=d.normalized,g=new p.constructor(m.length*v);let S=0,b=0;for(let R=0,x=m.length;R<x;R++){d.isInterleavedBufferAttribute?S=m[R]*d.data.stride+d.offset:S=m[R]*v;for(let y=0;y<v;y++)g[b++]=p[S++]}return new xi(g,v,_)}if(this.index===null)return ue("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const i=new Mn,s=this.index.array,l=this.attributes;for(const d in l){const m=l[d],p=t(m,s);i.setAttribute(d,p)}const c=this.morphAttributes;for(const d in c){const m=[],p=c[d];for(let v=0,_=p.length;v<_;v++){const g=p[v],S=t(g,s);m.push(S)}i.morphAttributes[d]=m}i.morphTargetsRelative=this.morphTargetsRelative;const f=this.groups;for(let d=0,m=f.length;d<m;d++){const p=f[d];i.addGroup(p.start,p.count,p.materialIndex)}return i}toJSON(){const t={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){const m=this.parameters;for(const p in m)m[p]!==void 0&&(t[p]=m[p]);return t}t.data={attributes:{}};const i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});const s=this.attributes;for(const m in s){const p=s[m];t.data.attributes[m]=p.toJSON(t.data)}const l={};let c=!1;for(const m in this.morphAttributes){const p=this.morphAttributes[m],v=[];for(let _=0,g=p.length;_<g;_++){const S=p[_];v.push(S.toJSON(t.data))}v.length>0&&(l[m]=v,c=!0)}c&&(t.data.morphAttributes=l,t.data.morphTargetsRelative=this.morphTargetsRelative);const f=this.groups;f.length>0&&(t.data.groups=JSON.parse(JSON.stringify(f)));const d=this.boundingSphere;return d!==null&&(t.data.boundingSphere=d.toJSON()),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={};this.name=t.name;const s=t.index;s!==null&&this.setIndex(s.clone());const l=t.attributes;for(const p in l){const v=l[p];this.setAttribute(p,v.clone(i))}const c=t.morphAttributes;for(const p in c){const v=[],_=c[p];for(let g=0,S=_.length;g<S;g++)v.push(_[g].clone(i));this.morphAttributes[p]=v}this.morphTargetsRelative=t.morphTargetsRelative;const f=t.groups;for(let p=0,v=f.length;p<v;p++){const _=f[p];this.addGroup(_.start,_.count,_.materialIndex)}const d=t.boundingBox;d!==null&&(this.boundingBox=d.clone());const m=t.boundingSphere;return m!==null&&(this.boundingSphere=m.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Rb{constructor(t,i){this.isInterleavedBuffer=!0,this.array=t,this.stride=i,this.count=t!==void 0?t.length/i:0,this.usage=Dp,this.updateRanges=[],this.version=0,this.uuid=za()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,i,s){t*=this.stride,s*=i.stride;for(let l=0,c=this.stride;l<c;l++)this.array[t+l]=i.array[s+l];return this}set(t,i=0){return this.array.set(t,i),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=za()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const i=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),s=new this.constructor(i,this.stride);return s.setUsage(this.usage),s}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=za()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.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 jn=new Q;class Ms{constructor(t,i,s,l=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=i,this.offset=s,this.normalized=l}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let i=0,s=this.data.count;i<s;i++)jn.fromBufferAttribute(this,i),jn.applyMatrix4(t),this.setXYZ(i,jn.x,jn.y,jn.z);return this}applyNormalMatrix(t){for(let i=0,s=this.count;i<s;i++)jn.fromBufferAttribute(this,i),jn.applyNormalMatrix(t),this.setXYZ(i,jn.x,jn.y,jn.z);return this}transformDirection(t){for(let i=0,s=this.count;i<s;i++)jn.fromBufferAttribute(this,i),jn.transformDirection(t),this.setXYZ(i,jn.x,jn.y,jn.z);return this}getComponent(t,i){let s=this.array[t*this.data.stride+this.offset+i];return this.normalized&&(s=Xi(s,this.array)),s}setComponent(t,i,s){return this.normalized&&(s=Ve(s,this.array)),this.data.array[t*this.data.stride+this.offset+i]=s,this}setX(t,i){return this.normalized&&(i=Ve(i,this.array)),this.data.array[t*this.data.stride+this.offset]=i,this}setY(t,i){return this.normalized&&(i=Ve(i,this.array)),this.data.array[t*this.data.stride+this.offset+1]=i,this}setZ(t,i){return this.normalized&&(i=Ve(i,this.array)),this.data.array[t*this.data.stride+this.offset+2]=i,this}setW(t,i){return this.normalized&&(i=Ve(i,this.array)),this.data.array[t*this.data.stride+this.offset+3]=i,this}getX(t){let i=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(i=Xi(i,this.array)),i}getY(t){let i=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(i=Xi(i,this.array)),i}getZ(t){let i=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(i=Xi(i,this.array)),i}getW(t){let i=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(i=Xi(i,this.array)),i}setXY(t,i,s){return t=t*this.data.stride+this.offset,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this}setXYZ(t,i,s,l){return t=t*this.data.stride+this.offset,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array),l=Ve(l,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this.data.array[t+2]=l,this}setXYZW(t,i,s,l,c){return t=t*this.data.stride+this.offset,this.normalized&&(i=Ve(i,this.array),s=Ve(s,this.array),l=Ve(l,this.array),c=Ve(c,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=s,this.data.array[t+2]=l,this.data.array[t+3]=c,this}clone(t){if(t===void 0){Nu("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const i=[];for(let s=0;s<this.count;s++){const l=s*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)i.push(this.data.array[l+c])}return new xi(new this.array.constructor(i),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Ms(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){Nu("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const i=[];for(let s=0;s<this.count;s++){const l=s*this.data.stride+this.offset;for(let c=0;c<this.itemSize;c++)i.push(this.data.array[l+c])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:i,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let wb=0;class mo extends ar{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:wb++}),this.uuid=za(),this.name="",this.type="Material",this.blending=so,this.side=Es,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Gd,this.blendDst=Vd,this.blendEquation=Qs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ee(0,0,0),this.blendAlpha=0,this.depthFunc=lo,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Y_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Gr,this.stencilZFail=Gr,this.stencilZPass=Gr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const i in t){const s=t[i];if(s===void 0){ue(`Material: parameter '${i}' has value of undefined.`);continue}const l=this[i];if(l===void 0){ue(`Material: '${i}' is not a property of THREE.${this.type}.`);continue}l&&l.isColor?l.set(s):l&&l.isVector3&&s&&s.isVector3?l.copy(s):this[i]=s}}toJSON(t){const i=t===void 0||typeof t=="string";i&&(t={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(s.sheenColorMap=this.sheenColorMap.toJSON(t).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(s.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(t).uuid),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(t).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(t).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(t).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(t).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(t).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==so&&(s.blending=this.blending),this.side!==Es&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==Gd&&(s.blendSrc=this.blendSrc),this.blendDst!==Vd&&(s.blendDst=this.blendDst),this.blendEquation!==Qs&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==lo&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Y_&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Gr&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Gr&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Gr&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.allowOverride===!1&&(s.allowOverride=!1),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function l(c){const f=[];for(const d in c){const m=c[d];delete m.metadata,f.push(m)}return f}if(i){const c=l(t.textures),f=l(t.images);c.length>0&&(s.textures=c),f.length>0&&(s.images=f)}return s}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const i=t.clippingPlanes;let s=null;if(i!==null){const l=i.length;s=new Array(l);for(let c=0;c!==l;++c)s[c]=i[c].clone()}return this.clippingPlanes=s,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.allowOverride=t.allowOverride,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}const Na=new Q,Md=new Q,qc=new Q,_s=new Q,bd=new Q,Yc=new Q,Ed=new Q;class Zp{constructor(t=new Q,i=new Q(0,0,-1)){this.origin=t,this.direction=i}set(t,i){return this.origin.copy(t),this.direction.copy(i),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,i){return i.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Na)),this}closestPointToPoint(t,i){i.subVectors(t,this.origin);const s=i.dot(this.direction);return s<0?i.copy(this.origin):i.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const i=Na.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(Na.copy(this.origin).addScaledVector(this.direction,i),Na.distanceToSquared(t))}distanceSqToSegment(t,i,s,l){Md.copy(t).add(i).multiplyScalar(.5),qc.copy(i).sub(t).normalize(),_s.copy(this.origin).sub(Md);const c=t.distanceTo(i)*.5,f=-this.direction.dot(qc),d=_s.dot(this.direction),m=-_s.dot(qc),p=_s.lengthSq(),v=Math.abs(1-f*f);let _,g,S,b;if(v>0)if(_=f*m-d,g=f*d-m,b=c*v,_>=0)if(g>=-b)if(g<=b){const R=1/v;_*=R,g*=R,S=_*(_+f*g+2*d)+g*(f*_+g+2*m)+p}else g=c,_=Math.max(0,-(f*g+d)),S=-_*_+g*(g+2*m)+p;else g=-c,_=Math.max(0,-(f*g+d)),S=-_*_+g*(g+2*m)+p;else g<=-b?(_=Math.max(0,-(-f*c+d)),g=_>0?-c:Math.min(Math.max(-c,-m),c),S=-_*_+g*(g+2*m)+p):g<=b?(_=0,g=Math.min(Math.max(-c,-m),c),S=g*(g+2*m)+p):(_=Math.max(0,-(f*c+d)),g=_>0?c:Math.min(Math.max(-c,-m),c),S=-_*_+g*(g+2*m)+p);else g=f>0?-c:c,_=Math.max(0,-(f*g+d)),S=-_*_+g*(g+2*m)+p;return s&&s.copy(this.origin).addScaledVector(this.direction,_),l&&l.copy(Md).addScaledVector(qc,g),S}intersectSphere(t,i){Na.subVectors(t.center,this.origin);const s=Na.dot(this.direction),l=Na.dot(Na)-s*s,c=t.radius*t.radius;if(l>c)return null;const f=Math.sqrt(c-l),d=s-f,m=s+f;return m<0?null:d<0?this.at(m,i):this.at(d,i)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const i=t.normal.dot(this.direction);if(i===0)return t.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(t.normal)+t.constant)/i;return s>=0?s:null}intersectPlane(t,i){const s=this.distanceToPlane(t);return s===null?null:this.at(s,i)}intersectsPlane(t){const i=t.distanceToPoint(this.origin);return i===0||t.normal.dot(this.direction)*i<0}intersectBox(t,i){let s,l,c,f,d,m;const p=1/this.direction.x,v=1/this.direction.y,_=1/this.direction.z,g=this.origin;return p>=0?(s=(t.min.x-g.x)*p,l=(t.max.x-g.x)*p):(s=(t.max.x-g.x)*p,l=(t.min.x-g.x)*p),v>=0?(c=(t.min.y-g.y)*v,f=(t.max.y-g.y)*v):(c=(t.max.y-g.y)*v,f=(t.min.y-g.y)*v),s>f||c>l||((c>s||isNaN(s))&&(s=c),(f<l||isNaN(l))&&(l=f),_>=0?(d=(t.min.z-g.z)*_,m=(t.max.z-g.z)*_):(d=(t.max.z-g.z)*_,m=(t.min.z-g.z)*_),s>m||d>l)||((d>s||s!==s)&&(s=d),(m<l||l!==l)&&(l=m),l<0)?null:this.at(s>=0?s:l,i)}intersectsBox(t){return this.intersectBox(t,Na)!==null}intersectTriangle(t,i,s,l,c){bd.subVectors(i,t),Yc.subVectors(s,t),Ed.crossVectors(bd,Yc);let f=this.direction.dot(Ed),d;if(f>0){if(l)return null;d=1}else if(f<0)d=-1,f=-f;else return null;_s.subVectors(this.origin,t);const m=d*this.direction.dot(Yc.crossVectors(_s,Yc));if(m<0)return null;const p=d*this.direction.dot(bd.cross(_s));if(p<0||m+p>f)return null;const v=-d*_s.dot(Ed);return v<0?null:this.at(v/f,c)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Pu extends mo{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ee(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ca,this.combine=Ip,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const lv=new nn,Ys=new Zp,jc=new po,cv=new Q,Zc=new Q,Kc=new Q,Qc=new Q,Td=new Q,Jc=new Q,uv=new Q,$c=new Q;class Gn extends Fn{constructor(t=new Mn,i=new Pu){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,f=l.length;c<f;c++){const d=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=c}}}}getVertexPosition(t,i){const s=this.geometry,l=s.attributes.position,c=s.morphAttributes.position,f=s.morphTargetsRelative;i.fromBufferAttribute(l,t);const d=this.morphTargetInfluences;if(c&&d){Jc.set(0,0,0);for(let m=0,p=c.length;m<p;m++){const v=d[m],_=c[m];v!==0&&(Td.fromBufferAttribute(_,t),f?Jc.addScaledVector(Td,v):Jc.addScaledVector(Td.sub(i),v))}i.add(Jc)}return i}raycast(t,i){const s=this.geometry,l=this.material,c=this.matrixWorld;l!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),jc.copy(s.boundingSphere),jc.applyMatrix4(c),Ys.copy(t.ray).recast(t.near),!(jc.containsPoint(Ys.origin)===!1&&(Ys.intersectSphere(jc,cv)===null||Ys.origin.distanceToSquared(cv)>(t.far-t.near)**2))&&(lv.copy(c).invert(),Ys.copy(t.ray).applyMatrix4(lv),!(s.boundingBox!==null&&Ys.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,i,Ys)))}_computeIntersections(t,i,s){let l;const c=this.geometry,f=this.material,d=c.index,m=c.attributes.position,p=c.attributes.uv,v=c.attributes.uv1,_=c.attributes.normal,g=c.groups,S=c.drawRange;if(d!==null)if(Array.isArray(f))for(let b=0,R=g.length;b<R;b++){const x=g[b],y=f[x.materialIndex],w=Math.max(x.start,S.start),D=Math.min(d.count,Math.min(x.start+x.count,S.start+S.count));for(let C=w,G=D;C<G;C+=3){const B=d.getX(C),F=d.getX(C+1),T=d.getX(C+2);l=tu(this,y,t,s,p,v,_,B,F,T),l&&(l.faceIndex=Math.floor(C/3),l.face.materialIndex=x.materialIndex,i.push(l))}}else{const b=Math.max(0,S.start),R=Math.min(d.count,S.start+S.count);for(let x=b,y=R;x<y;x+=3){const w=d.getX(x),D=d.getX(x+1),C=d.getX(x+2);l=tu(this,f,t,s,p,v,_,w,D,C),l&&(l.faceIndex=Math.floor(x/3),i.push(l))}}else if(m!==void 0)if(Array.isArray(f))for(let b=0,R=g.length;b<R;b++){const x=g[b],y=f[x.materialIndex],w=Math.max(x.start,S.start),D=Math.min(m.count,Math.min(x.start+x.count,S.start+S.count));for(let C=w,G=D;C<G;C+=3){const B=C,F=C+1,T=C+2;l=tu(this,y,t,s,p,v,_,B,F,T),l&&(l.faceIndex=Math.floor(C/3),l.face.materialIndex=x.materialIndex,i.push(l))}}else{const b=Math.max(0,S.start),R=Math.min(m.count,S.start+S.count);for(let x=b,y=R;x<y;x+=3){const w=x,D=x+1,C=x+2;l=tu(this,f,t,s,p,v,_,w,D,C),l&&(l.faceIndex=Math.floor(x/3),i.push(l))}}}}function Cb(a,t,i,s,l,c,f,d){let m;if(t.side===si?m=s.intersectTriangle(f,c,l,!0,d):m=s.intersectTriangle(l,c,f,t.side===Es,d),m===null)return null;$c.copy(d),$c.applyMatrix4(a.matrixWorld);const p=i.ray.origin.distanceTo($c);return p<i.near||p>i.far?null:{distance:p,point:$c.clone(),object:a}}function tu(a,t,i,s,l,c,f,d,m,p){a.getVertexPosition(d,Zc),a.getVertexPosition(m,Kc),a.getVertexPosition(p,Qc);const v=Cb(a,t,i,s,Zc,Kc,Qc,uv);if(v){const _=new Q;Di.getBarycoord(uv,Zc,Kc,Qc,_),l&&(v.uv=Di.getInterpolatedAttribute(l,d,m,p,_,new _e)),c&&(v.uv1=Di.getInterpolatedAttribute(c,d,m,p,_,new _e)),f&&(v.normal=Di.getInterpolatedAttribute(f,d,m,p,_,new Q),v.normal.dot(s.direction)>0&&v.normal.multiplyScalar(-1));const g={a:d,b:m,c:p,normal:new Q,materialIndex:0};Di.getNormal(Zc,Kc,Qc,g.normal),v.face=g,v.barycoord=_}return v}class Db extends Kn{constructor(t=null,i=1,s=1,l,c,f,d,m,p=zn,v=zn,_,g){super(null,f,d,m,p,v,l,c,_,g),this.isDataTexture=!0,this.image={data:t,width:i,height:s},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ad=new Q,Ub=new Q,Lb=new Me;class xs{constructor(t=new Q(1,0,0),i=0){this.isPlane=!0,this.normal=t,this.constant=i}set(t,i){return this.normal.copy(t),this.constant=i,this}setComponents(t,i,s,l){return this.normal.set(t,i,s),this.constant=l,this}setFromNormalAndCoplanarPoint(t,i){return this.normal.copy(t),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(t,i,s){const l=Ad.subVectors(s,i).cross(Ub.subVectors(t,i)).normalize();return this.setFromNormalAndCoplanarPoint(l,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,i){return i.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,i){const s=t.delta(Ad),l=this.normal.dot(s);if(l===0)return this.distanceToPoint(t.start)===0?i.copy(t.start):null;const c=-(t.start.dot(this.normal)+this.constant)/l;return c<0||c>1?null:i.copy(t.start).addScaledVector(s,c)}intersectsLine(t){const i=this.distanceToPoint(t.start),s=this.distanceToPoint(t.end);return i<0&&s>0||s<0&&i>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,i){const s=i||Lb.getNormalMatrix(t),l=this.coplanarPoint(Ad).applyMatrix4(t),c=this.normal.applyMatrix3(s).normalize();return this.constant=-l.dot(c),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const js=new po,Nb=new _e(.5,.5),eu=new Q;class Kp{constructor(t=new xs,i=new xs,s=new xs,l=new xs,c=new xs,f=new xs){this.planes=[t,i,s,l,c,f]}set(t,i,s,l,c,f){const d=this.planes;return d[0].copy(t),d[1].copy(i),d[2].copy(s),d[3].copy(l),d[4].copy(c),d[5].copy(f),this}copy(t){const i=this.planes;for(let s=0;s<6;s++)i[s].copy(t.planes[s]);return this}setFromProjectionMatrix(t,i=aa,s=!1){const l=this.planes,c=t.elements,f=c[0],d=c[1],m=c[2],p=c[3],v=c[4],_=c[5],g=c[6],S=c[7],b=c[8],R=c[9],x=c[10],y=c[11],w=c[12],D=c[13],C=c[14],G=c[15];if(l[0].setComponents(p-f,S-v,y-b,G-w).normalize(),l[1].setComponents(p+f,S+v,y+b,G+w).normalize(),l[2].setComponents(p+d,S+_,y+R,G+D).normalize(),l[3].setComponents(p-d,S-_,y-R,G-D).normalize(),s)l[4].setComponents(m,g,x,C).normalize(),l[5].setComponents(p-m,S-g,y-x,G-C).normalize();else if(l[4].setComponents(p-m,S-g,y-x,G-C).normalize(),i===aa)l[5].setComponents(p+m,S+g,y+x,G+C).normalize();else if(i===Sl)l[5].setComponents(m,g,x,C).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+i);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),js.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const i=t.geometry;i.boundingSphere===null&&i.computeBoundingSphere(),js.copy(i.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(js)}intersectsSprite(t){js.center.set(0,0,0);const i=Nb.distanceTo(t.center);return js.radius=.7071067811865476+i,js.applyMatrix4(t.matrixWorld),this.intersectsSphere(js)}intersectsSphere(t){const i=this.planes,s=t.center,l=-t.radius;for(let c=0;c<6;c++)if(i[c].distanceToPoint(s)<l)return!1;return!0}intersectsBox(t){const i=this.planes;for(let s=0;s<6;s++){const l=i[s];if(eu.x=l.normal.x>0?t.max.x:t.min.x,eu.y=l.normal.y>0?t.max.y:t.min.y,eu.z=l.normal.z>0?t.max.z:t.min.z,l.distanceToPoint(eu)<0)return!1}return!0}containsPoint(t){const i=this.planes;for(let s=0;s<6;s++)if(i[s].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Ss extends mo{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ee(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const zu=new Q,Fu=new Q,fv=new nn,hl=new Zp,nu=new po,Rd=new Q,hv=new Q;class Iu extends Fn{constructor(t=new Mn,i=new Ss){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=i,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const i=t.attributes.position,s=[0];for(let l=1,c=i.count;l<c;l++)zu.fromBufferAttribute(i,l-1),Fu.fromBufferAttribute(i,l),s[l]=s[l-1],s[l]+=zu.distanceTo(Fu);t.setAttribute("lineDistance",new _n(s,1))}else ue("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,i){const s=this.geometry,l=this.matrixWorld,c=t.params.Line.threshold,f=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),nu.copy(s.boundingSphere),nu.applyMatrix4(l),nu.radius+=c,t.ray.intersectsSphere(nu)===!1)return;fv.copy(l).invert(),hl.copy(t.ray).applyMatrix4(fv);const d=c/((this.scale.x+this.scale.y+this.scale.z)/3),m=d*d,p=this.isLineSegments?2:1,v=s.index,g=s.attributes.position;if(v!==null){const S=Math.max(0,f.start),b=Math.min(v.count,f.start+f.count);for(let R=S,x=b-1;R<x;R+=p){const y=v.getX(R),w=v.getX(R+1),D=iu(this,t,hl,m,y,w,R);D&&i.push(D)}if(this.isLineLoop){const R=v.getX(b-1),x=v.getX(S),y=iu(this,t,hl,m,R,x,b-1);y&&i.push(y)}}else{const S=Math.max(0,f.start),b=Math.min(g.count,f.start+f.count);for(let R=S,x=b-1;R<x;R+=p){const y=iu(this,t,hl,m,R,R+1,R);y&&i.push(y)}if(this.isLineLoop){const R=iu(this,t,hl,m,b-1,S,b-1);R&&i.push(R)}}}updateMorphTargets(){const i=this.geometry.morphAttributes,s=Object.keys(i);if(s.length>0){const l=i[s[0]];if(l!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let c=0,f=l.length;c<f;c++){const d=l[c].name||String(c);this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=c}}}}}function iu(a,t,i,s,l,c,f){const d=a.geometry.attributes.position;if(zu.fromBufferAttribute(d,l),Fu.fromBufferAttribute(d,c),i.distanceSqToSegment(zu,Fu,Rd,hv)>s)return;Rd.applyMatrix4(a.matrixWorld);const p=t.ray.origin.distanceTo(Rd);if(!(p<t.near||p>t.far))return{distance:p,point:hv.clone().applyMatrix4(a.matrixWorld),index:f,face:null,faceIndex:null,barycoord:null,object:a}}const dv=new Q,pv=new Q;class dl extends Iu{constructor(t,i){super(t,i),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const i=t.attributes.position,s=[];for(let l=0,c=i.count;l<c;l+=2)dv.fromBufferAttribute(i,l),pv.fromBufferAttribute(i,l+1),s[l]=l===0?0:s[l-1],s[l+1]=s[l]+dv.distanceTo(pv);t.setAttribute("lineDistance",new _n(s,1))}else ue("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Ox extends Kn{constructor(t=[],i=nr,s,l,c,f,d,m,p,v){super(t,i,s,l,c,f,d,m,p,v),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class bl extends Kn{constructor(t,i,s=la,l,c,f,d=zn,m=zn,p,v=Ba,_=1){if(v!==Ba&&v!==tr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const g={width:t,height:i,depth:_};super(g,l,c,f,d,m,v,s,p),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new jp(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const i=super.toJSON(t);return this.compareFunction!==null&&(i.compareFunction=this.compareFunction),i}}class Ob extends bl{constructor(t,i=la,s=nr,l,c,f=zn,d=zn,m,p=Ba){const v={width:t,height:t,depth:1},_=[v,v,v,v,v,v];super(t,t,i,s,l,c,f,d,m,p),this.image=_,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(t){this.image=t}}class Px extends Kn{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}copy(t){return super.copy(t),this.sourceTexture=t.sourceTexture,this}}class ir extends Mn{constructor(t=1,i=1,s=1,l=1,c=1,f=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:s,widthSegments:l,heightSegments:c,depthSegments:f};const d=this;l=Math.floor(l),c=Math.floor(c),f=Math.floor(f);const m=[],p=[],v=[],_=[];let g=0,S=0;b("z","y","x",-1,-1,s,i,t,f,c,0),b("z","y","x",1,-1,s,i,-t,f,c,1),b("x","z","y",1,1,t,s,i,l,f,2),b("x","z","y",1,-1,t,s,-i,l,f,3),b("x","y","z",1,-1,t,i,s,l,c,4),b("x","y","z",-1,-1,t,i,-s,l,c,5),this.setIndex(m),this.setAttribute("position",new _n(p,3)),this.setAttribute("normal",new _n(v,3)),this.setAttribute("uv",new _n(_,2));function b(R,x,y,w,D,C,G,B,F,T,U){const et=C/F,H=G/T,q=C/2,nt=G/2,ot=B/2,Y=F+1,z=T+1;let A=0,ht=0;const lt=new Q;for(let Ct=0;Ct<z;Ct++){const I=Ct*H-nt;for(let K=0;K<Y;K++){const Mt=K*et-q;lt[R]=Mt*w,lt[x]=I*D,lt[y]=ot,p.push(lt.x,lt.y,lt.z),lt[R]=0,lt[x]=0,lt[y]=B>0?1:-1,v.push(lt.x,lt.y,lt.z),_.push(K/F),_.push(1-Ct/T),A+=1}}for(let Ct=0;Ct<T;Ct++)for(let I=0;I<F;I++){const K=g+I+Y*Ct,Mt=g+I+Y*(Ct+1),wt=g+(I+1)+Y*(Ct+1),Bt=g+(I+1)+Y*Ct;m.push(K,Mt,Bt),m.push(Mt,wt,Bt),ht+=6}d.addGroup(S,ht,U),S+=ht,g+=A}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ir(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}const au=new Q,su=new Q,wd=new Q,ru=new Di;class mv extends Mn{constructor(t=null,i=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:i},t!==null){const l=Math.pow(10,4),c=Math.cos(ro*i),f=t.getIndex(),d=t.getAttribute("position"),m=f?f.count:d.count,p=[0,0,0],v=["a","b","c"],_=new Array(3),g={},S=[];for(let b=0;b<m;b+=3){f?(p[0]=f.getX(b),p[1]=f.getX(b+1),p[2]=f.getX(b+2)):(p[0]=b,p[1]=b+1,p[2]=b+2);const{a:R,b:x,c:y}=ru;if(R.fromBufferAttribute(d,p[0]),x.fromBufferAttribute(d,p[1]),y.fromBufferAttribute(d,p[2]),ru.getNormal(wd),_[0]=`${Math.round(R.x*l)},${Math.round(R.y*l)},${Math.round(R.z*l)}`,_[1]=`${Math.round(x.x*l)},${Math.round(x.y*l)},${Math.round(x.z*l)}`,_[2]=`${Math.round(y.x*l)},${Math.round(y.y*l)},${Math.round(y.z*l)}`,!(_[0]===_[1]||_[1]===_[2]||_[2]===_[0]))for(let w=0;w<3;w++){const D=(w+1)%3,C=_[w],G=_[D],B=ru[v[w]],F=ru[v[D]],T=`${C}_${G}`,U=`${G}_${C}`;U in g&&g[U]?(wd.dot(g[U].normal)<=c&&(S.push(B.x,B.y,B.z),S.push(F.x,F.y,F.z)),g[U]=null):T in g||(g[T]={index0:p[w],index1:p[D],normal:wd.clone()})}}for(const b in g)if(g[b]){const{index0:R,index1:x}=g[b];au.fromBufferAttribute(d,R),su.fromBufferAttribute(d,x),S.push(au.x,au.y,au.z),S.push(su.x,su.y,su.z)}this.setAttribute("position",new _n(S,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}class Gu extends Mn{constructor(t=1,i=1,s=1,l=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:i,widthSegments:s,heightSegments:l};const c=t/2,f=i/2,d=Math.floor(s),m=Math.floor(l),p=d+1,v=m+1,_=t/d,g=i/m,S=[],b=[],R=[],x=[];for(let y=0;y<v;y++){const w=y*g-f;for(let D=0;D<p;D++){const C=D*_-c;b.push(C,-w,0),R.push(0,0,1),x.push(D/d),x.push(1-y/m)}}for(let y=0;y<m;y++)for(let w=0;w<d;w++){const D=w+p*y,C=w+p*(y+1),G=w+1+p*(y+1),B=w+1+p*y;S.push(D,C,B),S.push(C,G,B)}this.setIndex(S),this.setAttribute("position",new _n(b,3)),this.setAttribute("normal",new _n(R,3)),this.setAttribute("uv",new _n(x,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Gu(t.width,t.height,t.widthSegments,t.heightSegments)}}class Bu extends Mn{constructor(t=1,i=32,s=16,l=0,c=Math.PI*2,f=0,d=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:i,heightSegments:s,phiStart:l,phiLength:c,thetaStart:f,thetaLength:d},i=Math.max(3,Math.floor(i)),s=Math.max(2,Math.floor(s));const m=Math.min(f+d,Math.PI);let p=0;const v=[],_=new Q,g=new Q,S=[],b=[],R=[],x=[];for(let y=0;y<=s;y++){const w=[],D=y/s;let C=0;y===0&&f===0?C=.5/i:y===s&&m===Math.PI&&(C=-.5/i);for(let G=0;G<=i;G++){const B=G/i;_.x=-t*Math.cos(l+B*c)*Math.sin(f+D*d),_.y=t*Math.cos(f+D*d),_.z=t*Math.sin(l+B*c)*Math.sin(f+D*d),b.push(_.x,_.y,_.z),g.copy(_).normalize(),R.push(g.x,g.y,g.z),x.push(B+C,1-D),w.push(p++)}v.push(w)}for(let y=0;y<s;y++)for(let w=0;w<i;w++){const D=v[y][w+1],C=v[y][w],G=v[y+1][w],B=v[y+1][w+1];(y!==0||f>0)&&S.push(D,C,B),(y!==s-1||m<Math.PI)&&S.push(C,G,B)}this.setIndex(S),this.setAttribute("position",new _n(b,3)),this.setAttribute("normal",new _n(R,3)),this.setAttribute("uv",new _n(x,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Bu(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Pb extends Mn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const i=[],s=new Set,l=new Q,c=new Q;if(t.index!==null){const f=t.attributes.position,d=t.index;let m=t.groups;m.length===0&&(m=[{start:0,count:d.count,materialIndex:0}]);for(let p=0,v=m.length;p<v;++p){const _=m[p],g=_.start,S=_.count;for(let b=g,R=g+S;b<R;b+=3)for(let x=0;x<3;x++){const y=d.getX(b+x),w=d.getX(b+(x+1)%3);l.fromBufferAttribute(f,y),c.fromBufferAttribute(f,w),gv(l,c,s)===!0&&(i.push(l.x,l.y,l.z),i.push(c.x,c.y,c.z))}}}else{const f=t.attributes.position;for(let d=0,m=f.count/3;d<m;d++)for(let p=0;p<3;p++){const v=3*d+p,_=3*d+(p+1)%3;l.fromBufferAttribute(f,v),c.fromBufferAttribute(f,_),gv(l,c,s)===!0&&(i.push(l.x,l.y,l.z),i.push(c.x,c.y,c.z))}}this.setAttribute("position",new _n(i,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function gv(a,t,i){const s=`${a.x},${a.y},${a.z}-${t.x},${t.y},${t.z}`,l=`${t.x},${t.y},${t.z}-${a.x},${a.y},${a.z}`;return i.has(s)===!0||i.has(l)===!0?!1:(i.add(s),i.add(l),!0)}function ho(a){const t={};for(const i in a){t[i]={};for(const s in a[i]){const l=a[i][s];l&&(l.isColor||l.isMatrix3||l.isMatrix4||l.isVector2||l.isVector3||l.isVector4||l.isTexture||l.isQuaternion)?l.isRenderTargetTexture?(ue("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][s]=null):t[i][s]=l.clone():Array.isArray(l)?t[i][s]=l.slice():t[i][s]=l}}return t}function Zn(a){const t={};for(let i=0;i<a.length;i++){const s=ho(a[i]);for(const l in s)t[l]=s[l]}return t}function zb(a){const t=[];for(let i=0;i<a.length;i++)t.push(a[i].clone());return t}function zx(a){const t=a.getRenderTarget();return t===null?a.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Ue.workingColorSpace}const Qp={clone:ho,merge:Zn};var Fb=`void main() {
|
|
10
10
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
11
|
-
}`,
|
|
11
|
+
}`,Ib=`void main() {
|
|
12
12
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
13
|
-
}`;class qi extends mo{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=zb,this.fragmentShader=Fb,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ho(t.uniforms),this.uniformsGroups=Pb(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){const i=super.toJSON(t);i.glslVersion=this.glslVersion,i.uniforms={};for(const l in this.uniforms){const f=this.uniforms[l].value;f&&f.isTexture?i.uniforms[l]={type:"t",value:f.toJSON(t).uuid}:f&&f.isColor?i.uniforms[l]={type:"c",value:f.getHex()}:f&&f.isVector2?i.uniforms[l]={type:"v2",value:f.toArray()}:f&&f.isVector3?i.uniforms[l]={type:"v3",value:f.toArray()}:f&&f.isVector4?i.uniforms[l]={type:"v4",value:f.toArray()}:f&&f.isMatrix3?i.uniforms[l]={type:"m3",value:f.toArray()}:f&&f.isMatrix4?i.uniforms[l]={type:"m4",value:f.toArray()}:i.uniforms[l]={value:f}}Object.keys(this.defines).length>0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,i.lights=this.lights,i.clipping=this.clipping;const s={};for(const l in this.extensions)this.extensions[l]===!0&&(s[l]=!0);return Object.keys(s).length>0&&(i.extensions=s),i}}class Ib extends qi{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ou extends mo{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ee(16777215),this.specular=new Ee(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tx,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ca,this.combine=Ip,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Bb extends mo{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=PM,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Hb extends mo{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class Gb extends Ss{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}class zx extends zn{constructor(t,i=1){super(),this.isLight=!0,this.type="Light",this.color=new Ee(t),this.intensity=i}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,i){return super.copy(t,i),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const i=super.toJSON(t);return i.object.color=this.color.getHex(),i.object.intensity=this.intensity,i}}const Cd=new nn,_v=new Q,vv=new Q;class Vb{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _e(512,512),this.mapType=vi,this.map=null,this.mapPass=null,this.matrix=new nn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Kp,this._frameExtents=new _e(1,1),this._viewportCount=1,this._viewports=[new je(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const i=this.camera,s=this.matrix;_v.setFromMatrixPosition(t.matrixWorld),i.position.copy(_v),vv.setFromMatrixPosition(t.target.matrixWorld),i.lookAt(vv),i.updateMatrixWorld(),Cd.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Cd,i.coordinateSystem,i.reversedDepth),i.coordinateSystem===Sl||i.reversedDepth?s.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(Cd)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}const lu=new Q,cu=new Ts,Ji=new Q;class Fx extends zn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new nn,this.projectionMatrix=new nn,this.projectionMatrixInverse=new nn,this.coordinateSystem=aa,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,i){return super.copy(t,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(lu,cu,Ji),Ji.x===1&&Ji.y===1&&Ji.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(lu,cu,Ji.set(1,1,1)).invert()}updateWorldMatrix(t,i){super.updateWorldMatrix(t,i),this.matrixWorld.decompose(lu,cu,Ji),Ji.x===1&&Ji.y===1&&Ji.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(lu,cu,Ji.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const vs=new Q,xv=new _e,yv=new _e;class Vi extends Fx{constructor(t=50,i=1,s=.1,l=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=s,this.far=l,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const i=.5*this.getFilmHeight()/t;this.fov=Ml*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(ro*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Ml*2*Math.atan(Math.tan(ro*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,i,s){vs.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(vs.x,vs.y).multiplyScalar(-t/vs.z),vs.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(vs.x,vs.y).multiplyScalar(-t/vs.z)}getViewSize(t,i){return this.getViewBounds(t,xv,yv),i.subVectors(yv,xv)}setViewOffset(t,i,s,l,c,f){this.aspect=t/i,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=t,this.view.fullHeight=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=f,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let i=t*Math.tan(ro*.5*this.fov)/this.zoom,s=2*i,l=this.aspect*s,c=-.5*l;const f=this.view;if(this.view!==null&&this.view.enabled){const m=f.fullWidth,p=f.fullHeight;c+=f.offsetX*l/m,i-=f.offsetY*s/p,l*=f.width/m,s*=f.height/p}const d=this.filmOffset;d!==0&&(c+=t*d/this.getFilmWidth()),this.projectionMatrix.makePerspective(c,c+l,i,i-s,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}}class Vu extends Fx{constructor(t=-1,i=1,s=1,l=-1,c=.1,f=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=i,this.top=s,this.bottom=l,this.near=c,this.far=f,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,i,s,l,c,f){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=t,this.view.fullHeight=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=f,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,l=(this.top+this.bottom)/2;let c=s-t,f=s+t,d=l+i,m=l-i;if(this.view!==null&&this.view.enabled){const p=(this.right-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;c+=p*this.view.offsetX,f=c+p*this.view.width,d-=v*this.view.offsetY,m=d-v*this.view.height}this.projectionMatrix.makeOrthographic(c,f,d,m,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}}class kb extends Vb{constructor(){super(new Vu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Xb extends zx{constructor(t,i){super(t,i),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(zn.DEFAULT_UP),this.updateMatrix(),this.target=new zn,this.shadow=new kb}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){const i=super.toJSON(t);return i.object.shadow=this.shadow.toJSON(),i.object.target=this.target.uuid,i}}class Wb extends zx{constructor(t,i){super(t,i),this.isAmbientLight=!0,this.type="AmbientLight"}}class qb extends Mn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}const Jr=-90,$r=1;class Yb extends zn{constructor(t,i,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const l=new Vi(Jr,$r,t,i);l.layers=this.layers,this.add(l);const c=new Vi(Jr,$r,t,i);c.layers=this.layers,this.add(c);const f=new Vi(Jr,$r,t,i);f.layers=this.layers,this.add(f);const d=new Vi(Jr,$r,t,i);d.layers=this.layers,this.add(d);const m=new Vi(Jr,$r,t,i);m.layers=this.layers,this.add(m);const p=new Vi(Jr,$r,t,i);p.layers=this.layers,this.add(p)}updateCoordinateSystem(){const t=this.coordinateSystem,i=this.children.concat(),[s,l,c,f,d,m]=i;for(const p of i)this.remove(p);if(t===aa)s.up.set(0,1,0),s.lookAt(1,0,0),l.up.set(0,1,0),l.lookAt(-1,0,0),c.up.set(0,0,-1),c.lookAt(0,1,0),f.up.set(0,0,1),f.lookAt(0,-1,0),d.up.set(0,1,0),d.lookAt(0,0,1),m.up.set(0,1,0),m.lookAt(0,0,-1);else if(t===Sl)s.up.set(0,-1,0),s.lookAt(-1,0,0),l.up.set(0,-1,0),l.lookAt(1,0,0),c.up.set(0,0,1),c.lookAt(0,1,0),f.up.set(0,0,-1),f.lookAt(0,-1,0),d.up.set(0,-1,0),d.lookAt(0,0,1),m.up.set(0,-1,0),m.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const p of i)this.add(p),p.updateMatrixWorld()}update(t,i){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:l}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[c,f,d,m,p,v]=this.children,_=t.getRenderTarget(),g=t.getActiveCubeFace(),M=t.getActiveMipmapLevel(),E=t.xr.enabled;t.xr.enabled=!1;const R=s.texture.generateMipmaps;s.texture.generateMipmaps=!1;let x=!1;t.isWebGLRenderer===!0?x=t.state.buffers.depth.getReversed():x=t.reversedDepthBuffer,t.setRenderTarget(s,0,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,c),t.setRenderTarget(s,1,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,f),t.setRenderTarget(s,2,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,d),t.setRenderTarget(s,3,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,m),t.setRenderTarget(s,4,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,p),s.texture.generateMipmaps=R,t.setRenderTarget(s,5,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,v),t.setRenderTarget(_,g,M),t.xr.enabled=E,s.texture.needsPMREMUpdate=!0}}class jb extends Vi{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class Up extends Ab{constructor(t,i,s=1){super(t,i),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const i=super.clone(t);return i.meshPerAttribute=this.meshPerAttribute,i}toJSON(t){const i=super.toJSON(t);return i.isInstancedInterleavedBuffer=!0,i.meshPerAttribute=this.meshPerAttribute,i}}class Sv{constructor(t=1,i=0,s=0){this.radius=t,this.phi=i,this.theta=s}set(t,i,s){return this.radius=t,this.phi=i,this.theta=s,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=ve(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,i,s){return this.radius=Math.sqrt(t*t+i*i+s*s),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,s),this.phi=Math.acos(ve(i/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Mv=new Q,uu=new Q,to=new Q,eo=new Q,Dd=new Q,Zb=new Q,Kb=new Q;class Qb{constructor(t=new Q,i=new Q){this.start=t,this.end=i}set(t,i){return this.start.copy(t),this.end.copy(i),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,i){return this.delta(i).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,i){Mv.subVectors(t,this.start),uu.subVectors(this.end,this.start);const s=uu.dot(uu);let c=uu.dot(Mv)/s;return i&&(c=ve(c,0,1)),c}closestPointToPoint(t,i,s){const l=this.closestPointToPointParameter(t,i);return this.delta(s).multiplyScalar(l).add(this.start)}distanceSqToLine3(t,i=Zb,s=Kb){const l=10000000000000001e-32;let c,f;const d=this.start,m=t.start,p=this.end,v=t.end;to.subVectors(p,d),eo.subVectors(v,m),Dd.subVectors(d,m);const _=to.dot(to),g=eo.dot(eo),M=eo.dot(Dd);if(_<=l&&g<=l)return i.copy(d),s.copy(m),i.sub(s),i.dot(i);if(_<=l)c=0,f=M/g,f=ve(f,0,1);else{const E=to.dot(Dd);if(g<=l)f=0,c=ve(-E/_,0,1);else{const R=to.dot(eo),x=_*g-R*R;x!==0?c=ve((R*M-E*g)/x,0,1):c=0,f=(R*c+M)/g,f<0?(f=0,c=ve(-E/_,0,1)):f>1&&(f=1,c=ve((R-E)/_,0,1))}}return i.copy(d).addScaledVector(to,c),s.copy(m).addScaledVector(eo,f),i.distanceToSquared(s)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Jb extends ar{constructor(t,i=null){super(),this.object=t,this.domElement=i,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){if(t===void 0){ue("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}}function bv(a,t,i,s){const l=$b(s);switch(i){case Mx:return a*t;case Ex:return a*t/l.components*l.byteLength;case Vp:return a*t/l.components*l.byteLength;case uo:return a*t*2/l.components*l.byteLength;case kp:return a*t*2/l.components*l.byteLength;case bx:return a*t*3/l.components*l.byteLength;case Wi:return a*t*4/l.components*l.byteLength;case Xp:return a*t*4/l.components*l.byteLength;case bu:case Eu:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*8;case Tu:case Au:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*16;case $d:case ep:return Math.max(a,16)*Math.max(t,8)/4;case Jd:case tp:return Math.max(a,8)*Math.max(t,8)/2;case np:case ip:case sp:case rp:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*8;case ap:case op:case lp:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*16;case cp:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*16;case up:return Math.floor((a+4)/5)*Math.floor((t+3)/4)*16;case fp:return Math.floor((a+4)/5)*Math.floor((t+4)/5)*16;case hp:return Math.floor((a+5)/6)*Math.floor((t+4)/5)*16;case dp:return Math.floor((a+5)/6)*Math.floor((t+5)/6)*16;case pp:return Math.floor((a+7)/8)*Math.floor((t+4)/5)*16;case mp:return Math.floor((a+7)/8)*Math.floor((t+5)/6)*16;case gp:return Math.floor((a+7)/8)*Math.floor((t+7)/8)*16;case _p:return Math.floor((a+9)/10)*Math.floor((t+4)/5)*16;case vp:return Math.floor((a+9)/10)*Math.floor((t+5)/6)*16;case xp:return Math.floor((a+9)/10)*Math.floor((t+7)/8)*16;case yp:return Math.floor((a+9)/10)*Math.floor((t+9)/10)*16;case Sp:return Math.floor((a+11)/12)*Math.floor((t+9)/10)*16;case Mp:return Math.floor((a+11)/12)*Math.floor((t+11)/12)*16;case bp:case Ep:case Tp:return Math.ceil(a/4)*Math.ceil(t/4)*16;case Ap:case Rp:return Math.ceil(a/4)*Math.ceil(t/4)*8;case wp:case Cp:return Math.ceil(a/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${i} format.`)}function $b(a){switch(a){case vi:case vx:return{byteLength:1,components:1};case xl:case xx:case Ia:return{byteLength:2,components:1};case Hp:case Gp:return{byteLength:2,components:4};case la:case Bp:case ia:return{byteLength:4,components:1};case yx:case Sx:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${a}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Fp}}));typeof window<"u"&&(window.__THREE__?ue("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Fp);function Ix(){let a=null,t=!1,i=null,s=null;function l(c,f){i(c,f),s=a.requestAnimationFrame(l)}return{start:function(){t!==!0&&i!==null&&(s=a.requestAnimationFrame(l),t=!0)},stop:function(){a.cancelAnimationFrame(s),t=!1},setAnimationLoop:function(c){i=c},setContext:function(c){a=c}}}function tE(a){const t=new WeakMap;function i(d,m){const p=d.array,v=d.usage,_=p.byteLength,g=a.createBuffer();a.bindBuffer(m,g),a.bufferData(m,p,v),d.onUploadCallback();let M;if(p instanceof Float32Array)M=a.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)M=a.HALF_FLOAT;else if(p instanceof Uint16Array)d.isFloat16BufferAttribute?M=a.HALF_FLOAT:M=a.UNSIGNED_SHORT;else if(p instanceof Int16Array)M=a.SHORT;else if(p instanceof Uint32Array)M=a.UNSIGNED_INT;else if(p instanceof Int32Array)M=a.INT;else if(p instanceof Int8Array)M=a.BYTE;else if(p instanceof Uint8Array)M=a.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)M=a.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:g,type:M,bytesPerElement:p.BYTES_PER_ELEMENT,version:d.version,size:_}}function s(d,m,p){const v=m.array,_=m.updateRanges;if(a.bindBuffer(p,d),_.length===0)a.bufferSubData(p,0,v);else{_.sort((M,E)=>M.start-E.start);let g=0;for(let M=1;M<_.length;M++){const E=_[g],R=_[M];R.start<=E.start+E.count+1?E.count=Math.max(E.count,R.start+R.count-E.start):(++g,_[g]=R)}_.length=g+1;for(let M=0,E=_.length;M<E;M++){const R=_[M];a.bufferSubData(p,R.start*v.BYTES_PER_ELEMENT,v,R.start,R.count)}m.clearUpdateRanges()}m.onUploadCallback()}function l(d){return d.isInterleavedBufferAttribute&&(d=d.data),t.get(d)}function c(d){d.isInterleavedBufferAttribute&&(d=d.data);const m=t.get(d);m&&(a.deleteBuffer(m.buffer),t.delete(d))}function f(d,m){if(d.isInterleavedBufferAttribute&&(d=d.data),d.isGLBufferAttribute){const v=t.get(d);(!v||v.version<d.version)&&t.set(d,{buffer:d.buffer,type:d.type,bytesPerElement:d.elementSize,version:d.version});return}const p=t.get(d);if(p===void 0)t.set(d,i(d,m));else if(p.version<d.version){if(p.size!==d.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(p.buffer,d,m),p.version=d.version}}return{get:l,remove:c,update:f}}var eE=`#ifdef USE_ALPHAHASH
|
|
13
|
+
}`;class qi extends mo{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Fb,this.fragmentShader=Ib,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ho(t.uniforms),this.uniformsGroups=zb(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this.defaultAttributeValues=Object.assign({},t.defaultAttributeValues),this.index0AttributeName=t.index0AttributeName,this.uniformsNeedUpdate=t.uniformsNeedUpdate,this}toJSON(t){const i=super.toJSON(t);i.glslVersion=this.glslVersion,i.uniforms={};for(const l in this.uniforms){const f=this.uniforms[l].value;f&&f.isTexture?i.uniforms[l]={type:"t",value:f.toJSON(t).uuid}:f&&f.isColor?i.uniforms[l]={type:"c",value:f.getHex()}:f&&f.isVector2?i.uniforms[l]={type:"v2",value:f.toArray()}:f&&f.isVector3?i.uniforms[l]={type:"v3",value:f.toArray()}:f&&f.isVector4?i.uniforms[l]={type:"v4",value:f.toArray()}:f&&f.isMatrix3?i.uniforms[l]={type:"m3",value:f.toArray()}:f&&f.isMatrix4?i.uniforms[l]={type:"m4",value:f.toArray()}:i.uniforms[l]={value:f}}Object.keys(this.defines).length>0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,i.lights=this.lights,i.clipping=this.clipping;const s={};for(const l in this.extensions)this.extensions[l]===!0&&(s[l]=!0);return Object.keys(s).length>0&&(i.extensions=s),i}}class Bb extends qi{constructor(t){super(t),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ou extends mo{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ee(16777215),this.specular=new Ee(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ax,this.normalScale=new _e(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ca,this.combine=Ip,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Hb extends mo{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=zM,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Gb extends mo{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}class Vb extends Ss{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}class Fx extends Fn{constructor(t,i=1){super(),this.isLight=!0,this.type="Light",this.color=new Ee(t),this.intensity=i}dispose(){this.dispatchEvent({type:"dispose"})}copy(t,i){return super.copy(t,i),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const i=super.toJSON(t);return i.object.color=this.color.getHex(),i.object.intensity=this.intensity,i}}const Cd=new nn,_v=new Q,vv=new Q;class kb{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _e(512,512),this.mapType=vi,this.map=null,this.mapPass=null,this.matrix=new nn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Kp,this._frameExtents=new _e(1,1),this._viewportCount=1,this._viewports=[new Ze(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const i=this.camera,s=this.matrix;_v.setFromMatrixPosition(t.matrixWorld),i.position.copy(_v),vv.setFromMatrixPosition(t.target.matrixWorld),i.lookAt(vv),i.updateMatrixWorld(),Cd.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Cd,i.coordinateSystem,i.reversedDepth),i.coordinateSystem===Sl||i.reversedDepth?s.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(Cd)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.autoUpdate=t.autoUpdate,this.needsUpdate=t.needsUpdate,this.normalBias=t.normalBias,this.blurSamples=t.blurSamples,this.mapSize.copy(t.mapSize),this.biasNode=t.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){const t={};return this.intensity!==1&&(t.intensity=this.intensity),this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}const lu=new Q,cu=new Ts,Ji=new Q;class Ix extends Fn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new nn,this.projectionMatrix=new nn,this.projectionMatrixInverse=new nn,this.coordinateSystem=aa,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,i){return super.copy(t,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorld.decompose(lu,cu,Ji),Ji.x===1&&Ji.y===1&&Ji.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(lu,cu,Ji.set(1,1,1)).invert()}updateWorldMatrix(t,i){super.updateWorldMatrix(t,i),this.matrixWorld.decompose(lu,cu,Ji),Ji.x===1&&Ji.y===1&&Ji.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(lu,cu,Ji.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const vs=new Q,xv=new _e,yv=new _e;class Vi extends Ix{constructor(t=50,i=1,s=.1,l=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=s,this.far=l,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const i=.5*this.getFilmHeight()/t;this.fov=Ml*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(ro*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Ml*2*Math.atan(Math.tan(ro*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,i,s){vs.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(vs.x,vs.y).multiplyScalar(-t/vs.z),vs.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(vs.x,vs.y).multiplyScalar(-t/vs.z)}getViewSize(t,i){return this.getViewBounds(t,xv,yv),i.subVectors(yv,xv)}setViewOffset(t,i,s,l,c,f){this.aspect=t/i,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=t,this.view.fullHeight=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=f,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let i=t*Math.tan(ro*.5*this.fov)/this.zoom,s=2*i,l=this.aspect*s,c=-.5*l;const f=this.view;if(this.view!==null&&this.view.enabled){const m=f.fullWidth,p=f.fullHeight;c+=f.offsetX*l/m,i-=f.offsetY*s/p,l*=f.width/m,s*=f.height/p}const d=this.filmOffset;d!==0&&(c+=t*d/this.getFilmWidth()),this.projectionMatrix.makePerspective(c,c+l,i,i-s,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}}class Vu extends Ix{constructor(t=-1,i=1,s=1,l=-1,c=.1,f=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=i,this.top=s,this.bottom=l,this.near=c,this.far=f,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,i,s,l,c,f){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=t,this.view.fullHeight=i,this.view.offsetX=s,this.view.offsetY=l,this.view.width=c,this.view.height=f,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,l=(this.top+this.bottom)/2;let c=s-t,f=s+t,d=l+i,m=l-i;if(this.view!==null&&this.view.enabled){const p=(this.right-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;c+=p*this.view.offsetX,f=c+p*this.view.width,d-=v*this.view.offsetY,m=d-v*this.view.height}this.projectionMatrix.makeOrthographic(c,f,d,m,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}}class Xb extends kb{constructor(){super(new Vu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Wb extends Fx{constructor(t,i){super(t,i),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Fn.DEFAULT_UP),this.updateMatrix(),this.target=new Fn,this.shadow=new Xb}dispose(){super.dispose(),this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}toJSON(t){const i=super.toJSON(t);return i.object.shadow=this.shadow.toJSON(),i.object.target=this.target.uuid,i}}class qb extends Fx{constructor(t,i){super(t,i),this.isAmbientLight=!0,this.type="AmbientLight"}}class Yb extends Mn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}const Jr=-90,$r=1;class jb extends Fn{constructor(t,i,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const l=new Vi(Jr,$r,t,i);l.layers=this.layers,this.add(l);const c=new Vi(Jr,$r,t,i);c.layers=this.layers,this.add(c);const f=new Vi(Jr,$r,t,i);f.layers=this.layers,this.add(f);const d=new Vi(Jr,$r,t,i);d.layers=this.layers,this.add(d);const m=new Vi(Jr,$r,t,i);m.layers=this.layers,this.add(m);const p=new Vi(Jr,$r,t,i);p.layers=this.layers,this.add(p)}updateCoordinateSystem(){const t=this.coordinateSystem,i=this.children.concat(),[s,l,c,f,d,m]=i;for(const p of i)this.remove(p);if(t===aa)s.up.set(0,1,0),s.lookAt(1,0,0),l.up.set(0,1,0),l.lookAt(-1,0,0),c.up.set(0,0,-1),c.lookAt(0,1,0),f.up.set(0,0,1),f.lookAt(0,-1,0),d.up.set(0,1,0),d.lookAt(0,0,1),m.up.set(0,1,0),m.lookAt(0,0,-1);else if(t===Sl)s.up.set(0,-1,0),s.lookAt(-1,0,0),l.up.set(0,-1,0),l.lookAt(1,0,0),c.up.set(0,0,1),c.lookAt(0,1,0),f.up.set(0,0,-1),f.lookAt(0,-1,0),d.up.set(0,-1,0),d.lookAt(0,0,1),m.up.set(0,-1,0),m.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const p of i)this.add(p),p.updateMatrixWorld()}update(t,i){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:l}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[c,f,d,m,p,v]=this.children,_=t.getRenderTarget(),g=t.getActiveCubeFace(),S=t.getActiveMipmapLevel(),b=t.xr.enabled;t.xr.enabled=!1;const R=s.texture.generateMipmaps;s.texture.generateMipmaps=!1;let x=!1;t.isWebGLRenderer===!0?x=t.state.buffers.depth.getReversed():x=t.reversedDepthBuffer,t.setRenderTarget(s,0,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,c),t.setRenderTarget(s,1,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,f),t.setRenderTarget(s,2,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,d),t.setRenderTarget(s,3,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,m),t.setRenderTarget(s,4,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,p),s.texture.generateMipmaps=R,t.setRenderTarget(s,5,l),x&&t.autoClear===!1&&t.clearDepth(),t.render(i,v),t.setRenderTarget(_,g,S),t.xr.enabled=b,s.texture.needsPMREMUpdate=!0}}class Zb extends Vi{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}class Up extends Rb{constructor(t,i,s=1){super(t,i),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=s}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const i=super.clone(t);return i.meshPerAttribute=this.meshPerAttribute,i}toJSON(t){const i=super.toJSON(t);return i.isInstancedInterleavedBuffer=!0,i.meshPerAttribute=this.meshPerAttribute,i}}class Sv{constructor(t=1,i=0,s=0){this.radius=t,this.phi=i,this.theta=s}set(t,i,s){return this.radius=t,this.phi=i,this.theta=s,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=ve(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,i,s){return this.radius=Math.sqrt(t*t+i*i+s*s),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,s),this.phi=Math.acos(ve(i/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const Mv=new Q,uu=new Q,to=new Q,eo=new Q,Dd=new Q,Kb=new Q,Qb=new Q;class Jb{constructor(t=new Q,i=new Q){this.start=t,this.end=i}set(t,i){return this.start.copy(t),this.end.copy(i),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,i){return this.delta(i).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,i){Mv.subVectors(t,this.start),uu.subVectors(this.end,this.start);const s=uu.dot(uu);let c=uu.dot(Mv)/s;return i&&(c=ve(c,0,1)),c}closestPointToPoint(t,i,s){const l=this.closestPointToPointParameter(t,i);return this.delta(s).multiplyScalar(l).add(this.start)}distanceSqToLine3(t,i=Kb,s=Qb){const l=10000000000000001e-32;let c,f;const d=this.start,m=t.start,p=this.end,v=t.end;to.subVectors(p,d),eo.subVectors(v,m),Dd.subVectors(d,m);const _=to.dot(to),g=eo.dot(eo),S=eo.dot(Dd);if(_<=l&&g<=l)return i.copy(d),s.copy(m),i.sub(s),i.dot(i);if(_<=l)c=0,f=S/g,f=ve(f,0,1);else{const b=to.dot(Dd);if(g<=l)f=0,c=ve(-b/_,0,1);else{const R=to.dot(eo),x=_*g-R*R;x!==0?c=ve((R*S-b*g)/x,0,1):c=0,f=(R*c+S)/g,f<0?(f=0,c=ve(-b/_,0,1)):f>1&&(f=1,c=ve((R-b)/_,0,1))}}return i.copy(d).addScaledVector(to,c),s.copy(m).addScaledVector(eo,f),i.distanceToSquared(s)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class $b extends ar{constructor(t,i=null){super(),this.object=t,this.domElement=i,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(t){if(t===void 0){ue("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=t}disconnect(){}dispose(){}update(){}}function bv(a,t,i,s){const l=tE(s);switch(i){case bx:return a*t;case Tx:return a*t/l.components*l.byteLength;case Vp:return a*t/l.components*l.byteLength;case uo:return a*t*2/l.components*l.byteLength;case kp:return a*t*2/l.components*l.byteLength;case Ex:return a*t*3/l.components*l.byteLength;case Wi:return a*t*4/l.components*l.byteLength;case Xp:return a*t*4/l.components*l.byteLength;case bu:case Eu:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*8;case Tu:case Au:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*16;case $d:case ep:return Math.max(a,16)*Math.max(t,8)/4;case Jd:case tp:return Math.max(a,8)*Math.max(t,8)/2;case np:case ip:case sp:case rp:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*8;case ap:case op:case lp:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*16;case cp:return Math.floor((a+3)/4)*Math.floor((t+3)/4)*16;case up:return Math.floor((a+4)/5)*Math.floor((t+3)/4)*16;case fp:return Math.floor((a+4)/5)*Math.floor((t+4)/5)*16;case hp:return Math.floor((a+5)/6)*Math.floor((t+4)/5)*16;case dp:return Math.floor((a+5)/6)*Math.floor((t+5)/6)*16;case pp:return Math.floor((a+7)/8)*Math.floor((t+4)/5)*16;case mp:return Math.floor((a+7)/8)*Math.floor((t+5)/6)*16;case gp:return Math.floor((a+7)/8)*Math.floor((t+7)/8)*16;case _p:return Math.floor((a+9)/10)*Math.floor((t+4)/5)*16;case vp:return Math.floor((a+9)/10)*Math.floor((t+5)/6)*16;case xp:return Math.floor((a+9)/10)*Math.floor((t+7)/8)*16;case yp:return Math.floor((a+9)/10)*Math.floor((t+9)/10)*16;case Sp:return Math.floor((a+11)/12)*Math.floor((t+9)/10)*16;case Mp:return Math.floor((a+11)/12)*Math.floor((t+11)/12)*16;case bp:case Ep:case Tp:return Math.ceil(a/4)*Math.ceil(t/4)*16;case Ap:case Rp:return Math.ceil(a/4)*Math.ceil(t/4)*8;case wp:case Cp:return Math.ceil(a/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${i} format.`)}function tE(a){switch(a){case vi:case xx:return{byteLength:1,components:1};case xl:case yx:case Ia:return{byteLength:2,components:1};case Hp:case Gp:return{byteLength:2,components:4};case la:case Bp:case ia:return{byteLength:4,components:1};case Sx:case Mx:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${a}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Fp}}));typeof window<"u"&&(window.__THREE__?ue("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Fp);function Bx(){let a=null,t=!1,i=null,s=null;function l(c,f){i(c,f),s=a.requestAnimationFrame(l)}return{start:function(){t!==!0&&i!==null&&(s=a.requestAnimationFrame(l),t=!0)},stop:function(){a.cancelAnimationFrame(s),t=!1},setAnimationLoop:function(c){i=c},setContext:function(c){a=c}}}function eE(a){const t=new WeakMap;function i(d,m){const p=d.array,v=d.usage,_=p.byteLength,g=a.createBuffer();a.bindBuffer(m,g),a.bufferData(m,p,v),d.onUploadCallback();let S;if(p instanceof Float32Array)S=a.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)S=a.HALF_FLOAT;else if(p instanceof Uint16Array)d.isFloat16BufferAttribute?S=a.HALF_FLOAT:S=a.UNSIGNED_SHORT;else if(p instanceof Int16Array)S=a.SHORT;else if(p instanceof Uint32Array)S=a.UNSIGNED_INT;else if(p instanceof Int32Array)S=a.INT;else if(p instanceof Int8Array)S=a.BYTE;else if(p instanceof Uint8Array)S=a.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)S=a.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:g,type:S,bytesPerElement:p.BYTES_PER_ELEMENT,version:d.version,size:_}}function s(d,m,p){const v=m.array,_=m.updateRanges;if(a.bindBuffer(p,d),_.length===0)a.bufferSubData(p,0,v);else{_.sort((S,b)=>S.start-b.start);let g=0;for(let S=1;S<_.length;S++){const b=_[g],R=_[S];R.start<=b.start+b.count+1?b.count=Math.max(b.count,R.start+R.count-b.start):(++g,_[g]=R)}_.length=g+1;for(let S=0,b=_.length;S<b;S++){const R=_[S];a.bufferSubData(p,R.start*v.BYTES_PER_ELEMENT,v,R.start,R.count)}m.clearUpdateRanges()}m.onUploadCallback()}function l(d){return d.isInterleavedBufferAttribute&&(d=d.data),t.get(d)}function c(d){d.isInterleavedBufferAttribute&&(d=d.data);const m=t.get(d);m&&(a.deleteBuffer(m.buffer),t.delete(d))}function f(d,m){if(d.isInterleavedBufferAttribute&&(d=d.data),d.isGLBufferAttribute){const v=t.get(d);(!v||v.version<d.version)&&t.set(d,{buffer:d.buffer,type:d.type,bytesPerElement:d.elementSize,version:d.version});return}const p=t.get(d);if(p===void 0)t.set(d,i(d,m));else if(p.version<d.version){if(p.size!==d.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(p.buffer,d,m),p.version=d.version}}return{get:l,remove:c,update:f}}var nE=`#ifdef USE_ALPHAHASH
|
|
14
14
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
15
|
-
#endif`,
|
|
15
|
+
#endif`,iE=`#ifdef USE_ALPHAHASH
|
|
16
16
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
17
17
|
float hash2D( vec2 value ) {
|
|
18
18
|
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
|
|
@@ -47,20 +47,20 @@ Error generating stack: `+o.message+`
|
|
|
47
47
|
: cases.z;
|
|
48
48
|
return clamp( threshold , 1.0e-6, 1.0 );
|
|
49
49
|
}
|
|
50
|
-
#endif`,iE=`#ifdef USE_ALPHAMAP
|
|
51
|
-
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
|
52
50
|
#endif`,aE=`#ifdef USE_ALPHAMAP
|
|
51
|
+
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
|
52
|
+
#endif`,sE=`#ifdef USE_ALPHAMAP
|
|
53
53
|
uniform sampler2D alphaMap;
|
|
54
|
-
#endif`,
|
|
54
|
+
#endif`,rE=`#ifdef USE_ALPHATEST
|
|
55
55
|
#ifdef ALPHA_TO_COVERAGE
|
|
56
56
|
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
|
|
57
57
|
if ( diffuseColor.a == 0.0 ) discard;
|
|
58
58
|
#else
|
|
59
59
|
if ( diffuseColor.a < alphaTest ) discard;
|
|
60
60
|
#endif
|
|
61
|
-
#endif`,
|
|
61
|
+
#endif`,oE=`#ifdef USE_ALPHATEST
|
|
62
62
|
uniform float alphaTest;
|
|
63
|
-
#endif`,
|
|
63
|
+
#endif`,lE=`#ifdef USE_AOMAP
|
|
64
64
|
float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
|
|
65
65
|
reflectedLight.indirectDiffuse *= ambientOcclusion;
|
|
66
66
|
#if defined( USE_CLEARCOAT )
|
|
@@ -73,10 +73,10 @@ Error generating stack: `+o.message+`
|
|
|
73
73
|
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
|
|
74
74
|
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
|
|
75
75
|
#endif
|
|
76
|
-
#endif`,
|
|
76
|
+
#endif`,cE=`#ifdef USE_AOMAP
|
|
77
77
|
uniform sampler2D aoMap;
|
|
78
78
|
uniform float aoMapIntensity;
|
|
79
|
-
#endif`,
|
|
79
|
+
#endif`,uE=`#ifdef USE_BATCHING
|
|
80
80
|
#if ! defined( GL_ANGLE_multi_draw )
|
|
81
81
|
#define gl_DrawID _gl_DrawID
|
|
82
82
|
uniform int _gl_DrawID;
|
|
@@ -110,15 +110,15 @@ Error generating stack: `+o.message+`
|
|
|
110
110
|
int y = j / size;
|
|
111
111
|
return texelFetch( batchingColorTexture, ivec2( x, y ), 0 );
|
|
112
112
|
}
|
|
113
|
-
#endif`,
|
|
113
|
+
#endif`,fE=`#ifdef USE_BATCHING
|
|
114
114
|
mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
|
|
115
|
-
#endif`,
|
|
115
|
+
#endif`,hE=`vec3 transformed = vec3( position );
|
|
116
116
|
#ifdef USE_ALPHAHASH
|
|
117
117
|
vPosition = vec3( position );
|
|
118
|
-
#endif`,
|
|
118
|
+
#endif`,dE=`vec3 objectNormal = vec3( normal );
|
|
119
119
|
#ifdef USE_TANGENT
|
|
120
120
|
vec3 objectTangent = vec3( tangent.xyz );
|
|
121
|
-
#endif`,
|
|
121
|
+
#endif`,pE=`float G_BlinnPhong_Implicit( ) {
|
|
122
122
|
return 0.25;
|
|
123
123
|
}
|
|
124
124
|
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
|
|
@@ -132,7 +132,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
132
132
|
float G = G_BlinnPhong_Implicit( );
|
|
133
133
|
float D = D_BlinnPhong( shininess, dotNH );
|
|
134
134
|
return F * ( G * D );
|
|
135
|
-
} // validated`,
|
|
135
|
+
} // validated`,mE=`#ifdef USE_IRIDESCENCE
|
|
136
136
|
const mat3 XYZ_TO_REC709 = mat3(
|
|
137
137
|
3.2404542, -0.9692660, 0.0556434,
|
|
138
138
|
-1.5371385, 1.8760108, -0.2040259,
|
|
@@ -195,7 +195,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
195
195
|
}
|
|
196
196
|
return max( I, vec3( 0.0 ) );
|
|
197
197
|
}
|
|
198
|
-
#endif`,
|
|
198
|
+
#endif`,gE=`#ifdef USE_BUMPMAP
|
|
199
199
|
uniform sampler2D bumpMap;
|
|
200
200
|
uniform float bumpScale;
|
|
201
201
|
vec2 dHdxy_fwd() {
|
|
@@ -216,7 +216,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
216
216
|
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
|
|
217
217
|
return normalize( abs( fDet ) * surf_norm - vGrad );
|
|
218
218
|
}
|
|
219
|
-
#endif`,
|
|
219
|
+
#endif`,_E=`#if NUM_CLIPPING_PLANES > 0
|
|
220
220
|
vec4 plane;
|
|
221
221
|
#ifdef ALPHA_TO_COVERAGE
|
|
222
222
|
float distanceToPlane, distanceGradient;
|
|
@@ -262,20 +262,20 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
262
262
|
if ( clipped ) discard;
|
|
263
263
|
#endif
|
|
264
264
|
#endif
|
|
265
|
-
#endif`,_E=`#if NUM_CLIPPING_PLANES > 0
|
|
266
|
-
varying vec3 vClipPosition;
|
|
267
|
-
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
268
265
|
#endif`,vE=`#if NUM_CLIPPING_PLANES > 0
|
|
269
266
|
varying vec3 vClipPosition;
|
|
267
|
+
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
270
268
|
#endif`,xE=`#if NUM_CLIPPING_PLANES > 0
|
|
269
|
+
varying vec3 vClipPosition;
|
|
270
|
+
#endif`,yE=`#if NUM_CLIPPING_PLANES > 0
|
|
271
271
|
vClipPosition = - mvPosition.xyz;
|
|
272
|
-
#endif`,yE=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
|
|
273
|
-
diffuseColor *= vColor;
|
|
274
272
|
#endif`,SE=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
|
|
275
|
-
|
|
276
|
-
#endif`,ME=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
|
|
273
|
+
diffuseColor *= vColor;
|
|
274
|
+
#endif`,ME=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA )
|
|
277
275
|
varying vec4 vColor;
|
|
278
276
|
#endif`,bE=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
|
277
|
+
varying vec4 vColor;
|
|
278
|
+
#endif`,EE=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
|
279
279
|
vColor = vec4( 1.0 );
|
|
280
280
|
#endif
|
|
281
281
|
#ifdef USE_COLOR_ALPHA
|
|
@@ -288,7 +288,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
288
288
|
#endif
|
|
289
289
|
#ifdef USE_BATCHING_COLOR
|
|
290
290
|
vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) );
|
|
291
|
-
#endif`,
|
|
291
|
+
#endif`,TE=`#define PI 3.141592653589793
|
|
292
292
|
#define PI2 6.283185307179586
|
|
293
293
|
#define PI_HALF 1.5707963267948966
|
|
294
294
|
#define RECIPROCAL_PI 0.3183098861837907
|
|
@@ -355,7 +355,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
|
|
|
355
355
|
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
|
|
356
356
|
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
|
|
357
357
|
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
|
|
358
|
-
} // validated`,
|
|
358
|
+
} // validated`,AE=`#ifdef ENVMAP_TYPE_CUBE_UV
|
|
359
359
|
#define cubeUV_minMipLevel 4.0
|
|
360
360
|
#define cubeUV_minTileSize 16.0
|
|
361
361
|
float getFace( vec3 direction ) {
|
|
@@ -448,7 +448,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
|
|
|
448
448
|
return vec4( mix( color0, color1, mipF ), 1.0 );
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
#endif`,
|
|
451
|
+
#endif`,RE=`vec3 transformedNormal = objectNormal;
|
|
452
452
|
#ifdef USE_TANGENT
|
|
453
453
|
vec3 transformedTangent = objectTangent;
|
|
454
454
|
#endif
|
|
@@ -477,21 +477,21 @@ transformedNormal = normalMatrix * transformedNormal;
|
|
|
477
477
|
#ifdef FLIP_SIDED
|
|
478
478
|
transformedTangent = - transformedTangent;
|
|
479
479
|
#endif
|
|
480
|
-
#endif`,
|
|
480
|
+
#endif`,wE=`#ifdef USE_DISPLACEMENTMAP
|
|
481
481
|
uniform sampler2D displacementMap;
|
|
482
482
|
uniform float displacementScale;
|
|
483
483
|
uniform float displacementBias;
|
|
484
|
-
#endif`,
|
|
484
|
+
#endif`,CE=`#ifdef USE_DISPLACEMENTMAP
|
|
485
485
|
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
|
|
486
|
-
#endif`,
|
|
486
|
+
#endif`,DE=`#ifdef USE_EMISSIVEMAP
|
|
487
487
|
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
|
|
488
488
|
#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
|
|
489
489
|
emissiveColor = sRGBTransferEOTF( emissiveColor );
|
|
490
490
|
#endif
|
|
491
491
|
totalEmissiveRadiance *= emissiveColor.rgb;
|
|
492
|
-
#endif`,
|
|
492
|
+
#endif`,UE=`#ifdef USE_EMISSIVEMAP
|
|
493
493
|
uniform sampler2D emissiveMap;
|
|
494
|
-
#endif`,
|
|
494
|
+
#endif`,LE="gl_FragColor = linearToOutputTexel( gl_FragColor );",NE=`vec4 LinearTransferOETF( in vec4 value ) {
|
|
495
495
|
return value;
|
|
496
496
|
}
|
|
497
497
|
vec4 sRGBTransferEOTF( in vec4 value ) {
|
|
@@ -499,7 +499,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) {
|
|
|
499
499
|
}
|
|
500
500
|
vec4 sRGBTransferOETF( in vec4 value ) {
|
|
501
501
|
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 );
|
|
502
|
-
}`,
|
|
502
|
+
}`,OE=`#ifdef USE_ENVMAP
|
|
503
503
|
#ifdef ENV_WORLDPOS
|
|
504
504
|
vec3 cameraToFrag;
|
|
505
505
|
if ( isOrthographic ) {
|
|
@@ -526,7 +526,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
526
526
|
outgoingLight += envColor.xyz * specularStrength * reflectivity;
|
|
527
527
|
#endif
|
|
528
528
|
#endif
|
|
529
|
-
#endif`,
|
|
529
|
+
#endif`,PE=`#ifdef USE_ENVMAP
|
|
530
530
|
uniform float envMapIntensity;
|
|
531
531
|
uniform float flipEnvMap;
|
|
532
532
|
uniform mat3 envMapRotation;
|
|
@@ -535,7 +535,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
535
535
|
#else
|
|
536
536
|
uniform sampler2D envMap;
|
|
537
537
|
#endif
|
|
538
|
-
#endif`,
|
|
538
|
+
#endif`,zE=`#ifdef USE_ENVMAP
|
|
539
539
|
uniform float reflectivity;
|
|
540
540
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
|
541
541
|
#define ENV_WORLDPOS
|
|
@@ -546,7 +546,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
546
546
|
#else
|
|
547
547
|
varying vec3 vReflect;
|
|
548
548
|
#endif
|
|
549
|
-
#endif`,
|
|
549
|
+
#endif`,FE=`#ifdef USE_ENVMAP
|
|
550
550
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
|
551
551
|
#define ENV_WORLDPOS
|
|
552
552
|
#endif
|
|
@@ -557,7 +557,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
557
557
|
varying vec3 vReflect;
|
|
558
558
|
uniform float refractionRatio;
|
|
559
559
|
#endif
|
|
560
|
-
#endif`,
|
|
560
|
+
#endif`,IE=`#ifdef USE_ENVMAP
|
|
561
561
|
#ifdef ENV_WORLDPOS
|
|
562
562
|
vWorldPosition = worldPosition.xyz;
|
|
563
563
|
#else
|
|
@@ -574,18 +574,18 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
574
574
|
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
|
|
575
575
|
#endif
|
|
576
576
|
#endif
|
|
577
|
-
#endif`,IE=`#ifdef USE_FOG
|
|
578
|
-
vFogDepth = - mvPosition.z;
|
|
579
577
|
#endif`,BE=`#ifdef USE_FOG
|
|
580
|
-
|
|
578
|
+
vFogDepth = - mvPosition.z;
|
|
581
579
|
#endif`,HE=`#ifdef USE_FOG
|
|
580
|
+
varying float vFogDepth;
|
|
581
|
+
#endif`,GE=`#ifdef USE_FOG
|
|
582
582
|
#ifdef FOG_EXP2
|
|
583
583
|
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
|
|
584
584
|
#else
|
|
585
585
|
float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
|
|
586
586
|
#endif
|
|
587
587
|
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
|
|
588
|
-
#endif`,
|
|
588
|
+
#endif`,VE=`#ifdef USE_FOG
|
|
589
589
|
uniform vec3 fogColor;
|
|
590
590
|
varying float vFogDepth;
|
|
591
591
|
#ifdef FOG_EXP2
|
|
@@ -594,7 +594,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
594
594
|
uniform float fogNear;
|
|
595
595
|
uniform float fogFar;
|
|
596
596
|
#endif
|
|
597
|
-
#endif`,
|
|
597
|
+
#endif`,kE=`#ifdef USE_GRADIENTMAP
|
|
598
598
|
uniform sampler2D gradientMap;
|
|
599
599
|
#endif
|
|
600
600
|
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
|
@@ -606,12 +606,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
|
|
606
606
|
vec2 fw = fwidth( coord ) * 0.5;
|
|
607
607
|
return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
|
|
608
608
|
#endif
|
|
609
|
-
}`,
|
|
609
|
+
}`,XE=`#ifdef USE_LIGHTMAP
|
|
610
610
|
uniform sampler2D lightMap;
|
|
611
611
|
uniform float lightMapIntensity;
|
|
612
|
-
#endif`,
|
|
612
|
+
#endif`,WE=`LambertMaterial material;
|
|
613
613
|
material.diffuseColor = diffuseColor.rgb;
|
|
614
|
-
material.specularStrength = specularStrength;`,
|
|
614
|
+
material.specularStrength = specularStrength;`,qE=`varying vec3 vViewPosition;
|
|
615
615
|
struct LambertMaterial {
|
|
616
616
|
vec3 diffuseColor;
|
|
617
617
|
float specularStrength;
|
|
@@ -625,7 +625,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr
|
|
|
625
625
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
626
626
|
}
|
|
627
627
|
#define RE_Direct RE_Direct_Lambert
|
|
628
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,
|
|
628
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,YE=`uniform bool receiveShadow;
|
|
629
629
|
uniform vec3 ambientLightColor;
|
|
630
630
|
#if defined( USE_LIGHT_PROBES )
|
|
631
631
|
uniform vec3 lightProbe[ 9 ];
|
|
@@ -741,7 +741,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
|
|
|
741
741
|
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
|
|
742
742
|
return irradiance;
|
|
743
743
|
}
|
|
744
|
-
#endif`,
|
|
744
|
+
#endif`,jE=`#ifdef USE_ENVMAP
|
|
745
745
|
vec3 getIBLIrradiance( const in vec3 normal ) {
|
|
746
746
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
|
747
747
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
@@ -774,8 +774,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
|
|
|
774
774
|
#endif
|
|
775
775
|
}
|
|
776
776
|
#endif
|
|
777
|
-
#endif`,
|
|
778
|
-
material.diffuseColor = diffuseColor.rgb;`,
|
|
777
|
+
#endif`,ZE=`ToonMaterial material;
|
|
778
|
+
material.diffuseColor = diffuseColor.rgb;`,KE=`varying vec3 vViewPosition;
|
|
779
779
|
struct ToonMaterial {
|
|
780
780
|
vec3 diffuseColor;
|
|
781
781
|
};
|
|
@@ -787,11 +787,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo
|
|
|
787
787
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
788
788
|
}
|
|
789
789
|
#define RE_Direct RE_Direct_Toon
|
|
790
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,
|
|
790
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,QE=`BlinnPhongMaterial material;
|
|
791
791
|
material.diffuseColor = diffuseColor.rgb;
|
|
792
792
|
material.specularColor = specular;
|
|
793
793
|
material.specularShininess = shininess;
|
|
794
|
-
material.specularStrength = specularStrength;`,
|
|
794
|
+
material.specularStrength = specularStrength;`,JE=`varying vec3 vViewPosition;
|
|
795
795
|
struct BlinnPhongMaterial {
|
|
796
796
|
vec3 diffuseColor;
|
|
797
797
|
vec3 specularColor;
|
|
@@ -808,7 +808,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom
|
|
|
808
808
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
809
809
|
}
|
|
810
810
|
#define RE_Direct RE_Direct_BlinnPhong
|
|
811
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong
|
|
811
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,$E=`PhysicalMaterial material;
|
|
812
812
|
material.diffuseColor = diffuseColor.rgb;
|
|
813
813
|
material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );
|
|
814
814
|
material.metalness = metalnessFactor;
|
|
@@ -898,7 +898,7 @@ material.roughness = min( material.roughness, 1.0 );
|
|
|
898
898
|
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
|
|
899
899
|
material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
|
|
900
900
|
material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
|
|
901
|
-
#endif
|
|
901
|
+
#endif`,t1=`uniform sampler2D dfgLUT;
|
|
902
902
|
struct PhysicalMaterial {
|
|
903
903
|
vec3 diffuseColor;
|
|
904
904
|
vec3 diffuseContribution;
|
|
@@ -1259,7 +1259,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
|
|
|
1259
1259
|
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
|
|
1260
1260
|
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
|
|
1261
1261
|
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
|
|
1262
|
-
}`,
|
|
1262
|
+
}`,e1=`
|
|
1263
1263
|
vec3 geometryPosition = - vViewPosition;
|
|
1264
1264
|
vec3 geometryNormal = normal;
|
|
1265
1265
|
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
|
@@ -1376,7 +1376,7 @@ IncidentLight directLight;
|
|
|
1376
1376
|
#if defined( RE_IndirectSpecular )
|
|
1377
1377
|
vec3 radiance = vec3( 0.0 );
|
|
1378
1378
|
vec3 clearcoatRadiance = vec3( 0.0 );
|
|
1379
|
-
#endif`,
|
|
1379
|
+
#endif`,n1=`#if defined( RE_IndirectDiffuse )
|
|
1380
1380
|
#ifdef USE_LIGHTMAP
|
|
1381
1381
|
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
|
|
1382
1382
|
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
|
|
@@ -1397,7 +1397,7 @@ IncidentLight directLight;
|
|
|
1397
1397
|
#ifdef USE_CLEARCOAT
|
|
1398
1398
|
clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
|
|
1399
1399
|
#endif
|
|
1400
|
-
#endif`,
|
|
1400
|
+
#endif`,i1=`#if defined( RE_IndirectDiffuse )
|
|
1401
1401
|
#if defined( LAMBERT ) || defined( PHONG )
|
|
1402
1402
|
irradiance += iblIrradiance;
|
|
1403
1403
|
#endif
|
|
@@ -1405,27 +1405,27 @@ IncidentLight directLight;
|
|
|
1405
1405
|
#endif
|
|
1406
1406
|
#if defined( RE_IndirectSpecular )
|
|
1407
1407
|
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
1408
|
-
#endif`,i1=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
|
|
1409
|
-
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
1410
1408
|
#endif`,a1=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
|
|
1409
|
+
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
1410
|
+
#endif`,s1=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
|
|
1411
1411
|
uniform float logDepthBufFC;
|
|
1412
1412
|
varying float vFragDepth;
|
|
1413
1413
|
varying float vIsPerspective;
|
|
1414
|
-
#endif`,
|
|
1414
|
+
#endif`,r1=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
|
|
1415
1415
|
varying float vFragDepth;
|
|
1416
1416
|
varying float vIsPerspective;
|
|
1417
|
-
#endif`,
|
|
1417
|
+
#endif`,o1=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
|
|
1418
1418
|
vFragDepth = 1.0 + gl_Position.w;
|
|
1419
1419
|
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
|
|
1420
|
-
#endif`,
|
|
1420
|
+
#endif`,l1=`#ifdef USE_MAP
|
|
1421
1421
|
vec4 sampledDiffuseColor = texture2D( map, vMapUv );
|
|
1422
1422
|
#ifdef DECODE_VIDEO_TEXTURE
|
|
1423
1423
|
sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
|
|
1424
1424
|
#endif
|
|
1425
1425
|
diffuseColor *= sampledDiffuseColor;
|
|
1426
|
-
#endif`,
|
|
1426
|
+
#endif`,c1=`#ifdef USE_MAP
|
|
1427
1427
|
uniform sampler2D map;
|
|
1428
|
-
#endif`,
|
|
1428
|
+
#endif`,u1=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
1429
1429
|
#if defined( USE_POINTS_UV )
|
|
1430
1430
|
vec2 uv = vUv;
|
|
1431
1431
|
#else
|
|
@@ -1437,7 +1437,7 @@ IncidentLight directLight;
|
|
|
1437
1437
|
#endif
|
|
1438
1438
|
#ifdef USE_ALPHAMAP
|
|
1439
1439
|
diffuseColor.a *= texture2D( alphaMap, uv ).g;
|
|
1440
|
-
#endif`,
|
|
1440
|
+
#endif`,f1=`#if defined( USE_POINTS_UV )
|
|
1441
1441
|
varying vec2 vUv;
|
|
1442
1442
|
#else
|
|
1443
1443
|
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
@@ -1449,19 +1449,19 @@ IncidentLight directLight;
|
|
|
1449
1449
|
#endif
|
|
1450
1450
|
#ifdef USE_ALPHAMAP
|
|
1451
1451
|
uniform sampler2D alphaMap;
|
|
1452
|
-
#endif`,
|
|
1452
|
+
#endif`,h1=`float metalnessFactor = metalness;
|
|
1453
1453
|
#ifdef USE_METALNESSMAP
|
|
1454
1454
|
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
|
|
1455
1455
|
metalnessFactor *= texelMetalness.b;
|
|
1456
|
-
#endif`,
|
|
1456
|
+
#endif`,d1=`#ifdef USE_METALNESSMAP
|
|
1457
1457
|
uniform sampler2D metalnessMap;
|
|
1458
|
-
#endif`,
|
|
1458
|
+
#endif`,p1=`#ifdef USE_INSTANCING_MORPH
|
|
1459
1459
|
float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
1460
1460
|
float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
|
|
1461
1461
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1462
1462
|
morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
|
|
1463
1463
|
}
|
|
1464
|
-
#endif`,
|
|
1464
|
+
#endif`,m1=`#if defined( USE_MORPHCOLORS )
|
|
1465
1465
|
vColor *= morphTargetBaseInfluence;
|
|
1466
1466
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1467
1467
|
#if defined( USE_COLOR_ALPHA )
|
|
@@ -1470,12 +1470,12 @@ IncidentLight directLight;
|
|
|
1470
1470
|
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
|
|
1471
1471
|
#endif
|
|
1472
1472
|
}
|
|
1473
|
-
#endif`,
|
|
1473
|
+
#endif`,g1=`#ifdef USE_MORPHNORMALS
|
|
1474
1474
|
objectNormal *= morphTargetBaseInfluence;
|
|
1475
1475
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1476
1476
|
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
|
|
1477
1477
|
}
|
|
1478
|
-
#endif`,
|
|
1478
|
+
#endif`,_1=`#ifdef USE_MORPHTARGETS
|
|
1479
1479
|
#ifndef USE_INSTANCING_MORPH
|
|
1480
1480
|
uniform float morphTargetBaseInfluence;
|
|
1481
1481
|
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
@@ -1489,12 +1489,12 @@ IncidentLight directLight;
|
|
|
1489
1489
|
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
|
|
1490
1490
|
return texelFetch( morphTargetsTexture, morphUV, 0 );
|
|
1491
1491
|
}
|
|
1492
|
-
#endif`,
|
|
1492
|
+
#endif`,v1=`#ifdef USE_MORPHTARGETS
|
|
1493
1493
|
transformed *= morphTargetBaseInfluence;
|
|
1494
1494
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1495
1495
|
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
|
|
1496
1496
|
}
|
|
1497
|
-
#endif`,
|
|
1497
|
+
#endif`,x1=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
|
|
1498
1498
|
#ifdef FLAT_SHADED
|
|
1499
1499
|
vec3 fdx = dFdx( vViewPosition );
|
|
1500
1500
|
vec3 fdy = dFdy( vViewPosition );
|
|
@@ -1535,7 +1535,7 @@ IncidentLight directLight;
|
|
|
1535
1535
|
tbn2[1] *= faceDirection;
|
|
1536
1536
|
#endif
|
|
1537
1537
|
#endif
|
|
1538
|
-
vec3 nonPerturbedNormal = normal;`,
|
|
1538
|
+
vec3 nonPerturbedNormal = normal;`,y1=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
1539
1539
|
normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
|
|
1540
1540
|
#ifdef FLIP_SIDED
|
|
1541
1541
|
normal = - normal;
|
|
@@ -1550,25 +1550,25 @@ vec3 nonPerturbedNormal = normal;`,x1=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1550
1550
|
normal = normalize( tbn * mapN );
|
|
1551
1551
|
#elif defined( USE_BUMPMAP )
|
|
1552
1552
|
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
|
|
1553
|
-
#endif`,
|
|
1553
|
+
#endif`,S1=`#ifndef FLAT_SHADED
|
|
1554
1554
|
varying vec3 vNormal;
|
|
1555
1555
|
#ifdef USE_TANGENT
|
|
1556
1556
|
varying vec3 vTangent;
|
|
1557
1557
|
varying vec3 vBitangent;
|
|
1558
1558
|
#endif
|
|
1559
|
-
#endif`,
|
|
1559
|
+
#endif`,M1=`#ifndef FLAT_SHADED
|
|
1560
1560
|
varying vec3 vNormal;
|
|
1561
1561
|
#ifdef USE_TANGENT
|
|
1562
1562
|
varying vec3 vTangent;
|
|
1563
1563
|
varying vec3 vBitangent;
|
|
1564
1564
|
#endif
|
|
1565
|
-
#endif`,
|
|
1565
|
+
#endif`,b1=`#ifndef FLAT_SHADED
|
|
1566
1566
|
vNormal = normalize( transformedNormal );
|
|
1567
1567
|
#ifdef USE_TANGENT
|
|
1568
1568
|
vTangent = normalize( transformedTangent );
|
|
1569
1569
|
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
|
|
1570
1570
|
#endif
|
|
1571
|
-
#endif`,
|
|
1571
|
+
#endif`,E1=`#ifdef USE_NORMALMAP
|
|
1572
1572
|
uniform sampler2D normalMap;
|
|
1573
1573
|
uniform vec2 normalScale;
|
|
1574
1574
|
#endif
|
|
@@ -1590,13 +1590,13 @@ vec3 nonPerturbedNormal = normal;`,x1=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1590
1590
|
float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
|
|
1591
1591
|
return mat3( T * scale, B * scale, N );
|
|
1592
1592
|
}
|
|
1593
|
-
#endif`,
|
|
1593
|
+
#endif`,T1=`#ifdef USE_CLEARCOAT
|
|
1594
1594
|
vec3 clearcoatNormal = nonPerturbedNormal;
|
|
1595
|
-
#endif`,
|
|
1595
|
+
#endif`,A1=`#ifdef USE_CLEARCOAT_NORMALMAP
|
|
1596
1596
|
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
|
|
1597
1597
|
clearcoatMapN.xy *= clearcoatNormalScale;
|
|
1598
1598
|
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
|
|
1599
|
-
#endif`,
|
|
1599
|
+
#endif`,R1=`#ifdef USE_CLEARCOATMAP
|
|
1600
1600
|
uniform sampler2D clearcoatMap;
|
|
1601
1601
|
#endif
|
|
1602
1602
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
@@ -1605,18 +1605,18 @@ vec3 nonPerturbedNormal = normal;`,x1=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1605
1605
|
#endif
|
|
1606
1606
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
1607
1607
|
uniform sampler2D clearcoatRoughnessMap;
|
|
1608
|
-
#endif`,
|
|
1608
|
+
#endif`,w1=`#ifdef USE_IRIDESCENCEMAP
|
|
1609
1609
|
uniform sampler2D iridescenceMap;
|
|
1610
1610
|
#endif
|
|
1611
1611
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
1612
1612
|
uniform sampler2D iridescenceThicknessMap;
|
|
1613
|
-
#endif`,
|
|
1613
|
+
#endif`,C1=`#ifdef OPAQUE
|
|
1614
1614
|
diffuseColor.a = 1.0;
|
|
1615
1615
|
#endif
|
|
1616
1616
|
#ifdef USE_TRANSMISSION
|
|
1617
1617
|
diffuseColor.a *= material.transmissionAlpha;
|
|
1618
1618
|
#endif
|
|
1619
|
-
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,
|
|
1619
|
+
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,D1=`vec3 packNormalToRGB( const in vec3 normal ) {
|
|
1620
1620
|
return normalize( normal ) * 0.5 + 0.5;
|
|
1621
1621
|
}
|
|
1622
1622
|
vec3 unpackRGBToNormal( const in vec3 rgb ) {
|
|
@@ -1695,9 +1695,9 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
|
|
|
1695
1695
|
#else
|
|
1696
1696
|
return ( near * far ) / ( ( far - near ) * depth - far );
|
|
1697
1697
|
#endif
|
|
1698
|
-
}`,
|
|
1698
|
+
}`,U1=`#ifdef PREMULTIPLIED_ALPHA
|
|
1699
1699
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
1700
|
-
#endif`,
|
|
1700
|
+
#endif`,L1=`vec4 mvPosition = vec4( transformed, 1.0 );
|
|
1701
1701
|
#ifdef USE_BATCHING
|
|
1702
1702
|
mvPosition = batchingMatrix * mvPosition;
|
|
1703
1703
|
#endif
|
|
@@ -1705,22 +1705,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
|
|
|
1705
1705
|
mvPosition = instanceMatrix * mvPosition;
|
|
1706
1706
|
#endif
|
|
1707
1707
|
mvPosition = modelViewMatrix * mvPosition;
|
|
1708
|
-
gl_Position = projectionMatrix * mvPosition;`,
|
|
1708
|
+
gl_Position = projectionMatrix * mvPosition;`,N1=`#ifdef DITHERING
|
|
1709
1709
|
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
|
|
1710
|
-
#endif`,
|
|
1710
|
+
#endif`,O1=`#ifdef DITHERING
|
|
1711
1711
|
vec3 dithering( vec3 color ) {
|
|
1712
1712
|
float grid_position = rand( gl_FragCoord.xy );
|
|
1713
1713
|
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
|
|
1714
1714
|
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
|
|
1715
1715
|
return color + dither_shift_RGB;
|
|
1716
1716
|
}
|
|
1717
|
-
#endif`,
|
|
1717
|
+
#endif`,P1=`float roughnessFactor = roughness;
|
|
1718
1718
|
#ifdef USE_ROUGHNESSMAP
|
|
1719
1719
|
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
|
|
1720
1720
|
roughnessFactor *= texelRoughness.g;
|
|
1721
|
-
#endif`,
|
|
1721
|
+
#endif`,z1=`#ifdef USE_ROUGHNESSMAP
|
|
1722
1722
|
uniform sampler2D roughnessMap;
|
|
1723
|
-
#endif`,
|
|
1723
|
+
#endif`,F1=`#if NUM_SPOT_LIGHT_COORDS > 0
|
|
1724
1724
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
|
1725
1725
|
#endif
|
|
1726
1726
|
#if NUM_SPOT_LIGHT_MAPS > 0
|
|
@@ -1920,7 +1920,7 @@ gl_Position = projectionMatrix * mvPosition;`,L1=`#ifdef DITHERING
|
|
|
1920
1920
|
}
|
|
1921
1921
|
#endif
|
|
1922
1922
|
#endif
|
|
1923
|
-
#endif`,
|
|
1923
|
+
#endif`,I1=`#if NUM_SPOT_LIGHT_COORDS > 0
|
|
1924
1924
|
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
|
|
1925
1925
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
|
1926
1926
|
#endif
|
|
@@ -1961,7 +1961,7 @@ gl_Position = projectionMatrix * mvPosition;`,L1=`#ifdef DITHERING
|
|
|
1961
1961
|
};
|
|
1962
1962
|
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
|
|
1963
1963
|
#endif
|
|
1964
|
-
#endif`,
|
|
1964
|
+
#endif`,B1=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
|
|
1965
1965
|
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
|
|
1966
1966
|
vec4 shadowWorldPosition;
|
|
1967
1967
|
#endif
|
|
@@ -1993,7 +1993,7 @@ gl_Position = projectionMatrix * mvPosition;`,L1=`#ifdef DITHERING
|
|
|
1993
1993
|
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
|
|
1994
1994
|
}
|
|
1995
1995
|
#pragma unroll_loop_end
|
|
1996
|
-
#endif`,
|
|
1996
|
+
#endif`,H1=`float getShadowMask() {
|
|
1997
1997
|
float shadow = 1.0;
|
|
1998
1998
|
#ifdef USE_SHADOWMAP
|
|
1999
1999
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
@@ -2025,12 +2025,12 @@ gl_Position = projectionMatrix * mvPosition;`,L1=`#ifdef DITHERING
|
|
|
2025
2025
|
#endif
|
|
2026
2026
|
#endif
|
|
2027
2027
|
return shadow;
|
|
2028
|
-
}`,
|
|
2028
|
+
}`,G1=`#ifdef USE_SKINNING
|
|
2029
2029
|
mat4 boneMatX = getBoneMatrix( skinIndex.x );
|
|
2030
2030
|
mat4 boneMatY = getBoneMatrix( skinIndex.y );
|
|
2031
2031
|
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
|
|
2032
2032
|
mat4 boneMatW = getBoneMatrix( skinIndex.w );
|
|
2033
|
-
#endif`,
|
|
2033
|
+
#endif`,V1=`#ifdef USE_SKINNING
|
|
2034
2034
|
uniform mat4 bindMatrix;
|
|
2035
2035
|
uniform mat4 bindMatrixInverse;
|
|
2036
2036
|
uniform highp sampler2D boneTexture;
|
|
@@ -2045,7 +2045,7 @@ gl_Position = projectionMatrix * mvPosition;`,L1=`#ifdef DITHERING
|
|
|
2045
2045
|
vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
|
|
2046
2046
|
return mat4( v1, v2, v3, v4 );
|
|
2047
2047
|
}
|
|
2048
|
-
#endif`,
|
|
2048
|
+
#endif`,k1=`#ifdef USE_SKINNING
|
|
2049
2049
|
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
|
|
2050
2050
|
vec4 skinned = vec4( 0.0 );
|
|
2051
2051
|
skinned += boneMatX * skinVertex * skinWeight.x;
|
|
@@ -2053,7 +2053,7 @@ gl_Position = projectionMatrix * mvPosition;`,L1=`#ifdef DITHERING
|
|
|
2053
2053
|
skinned += boneMatZ * skinVertex * skinWeight.z;
|
|
2054
2054
|
skinned += boneMatW * skinVertex * skinWeight.w;
|
|
2055
2055
|
transformed = ( bindMatrixInverse * skinned ).xyz;
|
|
2056
|
-
#endif`,
|
|
2056
|
+
#endif`,X1=`#ifdef USE_SKINNING
|
|
2057
2057
|
mat4 skinMatrix = mat4( 0.0 );
|
|
2058
2058
|
skinMatrix += skinWeight.x * boneMatX;
|
|
2059
2059
|
skinMatrix += skinWeight.y * boneMatY;
|
|
@@ -2064,17 +2064,17 @@ gl_Position = projectionMatrix * mvPosition;`,L1=`#ifdef DITHERING
|
|
|
2064
2064
|
#ifdef USE_TANGENT
|
|
2065
2065
|
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
|
|
2066
2066
|
#endif
|
|
2067
|
-
#endif`,
|
|
2067
|
+
#endif`,W1=`float specularStrength;
|
|
2068
2068
|
#ifdef USE_SPECULARMAP
|
|
2069
2069
|
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
|
|
2070
2070
|
specularStrength = texelSpecular.r;
|
|
2071
2071
|
#else
|
|
2072
2072
|
specularStrength = 1.0;
|
|
2073
|
-
#endif`,
|
|
2073
|
+
#endif`,q1=`#ifdef USE_SPECULARMAP
|
|
2074
2074
|
uniform sampler2D specularMap;
|
|
2075
|
-
#endif`,
|
|
2075
|
+
#endif`,Y1=`#if defined( TONE_MAPPING )
|
|
2076
2076
|
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
|
|
2077
|
-
#endif`,
|
|
2077
|
+
#endif`,j1=`#ifndef saturate
|
|
2078
2078
|
#define saturate( a ) clamp( a, 0.0, 1.0 )
|
|
2079
2079
|
#endif
|
|
2080
2080
|
uniform float toneMappingExposure;
|
|
@@ -2171,7 +2171,7 @@ vec3 NeutralToneMapping( vec3 color ) {
|
|
|
2171
2171
|
float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
|
|
2172
2172
|
return mix( color, vec3( newPeak ), g );
|
|
2173
2173
|
}
|
|
2174
|
-
vec3 CustomToneMapping( vec3 color ) { return color; }`,
|
|
2174
|
+
vec3 CustomToneMapping( vec3 color ) { return color; }`,Z1=`#ifdef USE_TRANSMISSION
|
|
2175
2175
|
material.transmission = transmission;
|
|
2176
2176
|
material.transmissionAlpha = 1.0;
|
|
2177
2177
|
material.thickness = thickness;
|
|
@@ -2192,7 +2192,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,j1=`#ifdef USE_TRANSMISS
|
|
|
2192
2192
|
material.attenuationColor, material.attenuationDistance );
|
|
2193
2193
|
material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
|
|
2194
2194
|
totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
|
|
2195
|
-
#endif`,
|
|
2195
|
+
#endif`,K1=`#ifdef USE_TRANSMISSION
|
|
2196
2196
|
uniform float transmission;
|
|
2197
2197
|
uniform float thickness;
|
|
2198
2198
|
uniform float attenuationDistance;
|
|
@@ -2318,7 +2318,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,j1=`#ifdef USE_TRANSMISS
|
|
|
2318
2318
|
float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
|
|
2319
2319
|
return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
|
|
2320
2320
|
}
|
|
2321
|
-
#endif`,
|
|
2321
|
+
#endif`,Q1=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2322
2322
|
varying vec2 vUv;
|
|
2323
2323
|
#endif
|
|
2324
2324
|
#ifdef USE_MAP
|
|
@@ -2388,7 +2388,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,j1=`#ifdef USE_TRANSMISS
|
|
|
2388
2388
|
#ifdef USE_THICKNESSMAP
|
|
2389
2389
|
uniform mat3 thicknessMapTransform;
|
|
2390
2390
|
varying vec2 vThicknessMapUv;
|
|
2391
|
-
#endif`,
|
|
2391
|
+
#endif`,J1=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2392
2392
|
varying vec2 vUv;
|
|
2393
2393
|
#endif
|
|
2394
2394
|
#ifdef USE_MAP
|
|
@@ -2482,7 +2482,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,j1=`#ifdef USE_TRANSMISS
|
|
|
2482
2482
|
#ifdef USE_THICKNESSMAP
|
|
2483
2483
|
uniform mat3 thicknessMapTransform;
|
|
2484
2484
|
varying vec2 vThicknessMapUv;
|
|
2485
|
-
#endif
|
|
2485
|
+
#endif`,$1=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2486
2486
|
vUv = vec3( uv, 1 ).xy;
|
|
2487
2487
|
#endif
|
|
2488
2488
|
#ifdef USE_MAP
|
|
@@ -2553,7 +2553,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,j1=`#ifdef USE_TRANSMISS
|
|
|
2553
2553
|
#endif
|
|
2554
2554
|
#ifdef USE_THICKNESSMAP
|
|
2555
2555
|
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
|
|
2556
|
-
#endif
|
|
2556
|
+
#endif`,tT=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
|
|
2557
2557
|
vec4 worldPosition = vec4( transformed, 1.0 );
|
|
2558
2558
|
#ifdef USE_BATCHING
|
|
2559
2559
|
worldPosition = batchingMatrix * worldPosition;
|
|
@@ -2562,12 +2562,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,j1=`#ifdef USE_TRANSMISS
|
|
|
2562
2562
|
worldPosition = instanceMatrix * worldPosition;
|
|
2563
2563
|
#endif
|
|
2564
2564
|
worldPosition = modelMatrix * worldPosition;
|
|
2565
|
-
#endif`;const
|
|
2565
|
+
#endif`;const eT=`varying vec2 vUv;
|
|
2566
2566
|
uniform mat3 uvTransform;
|
|
2567
2567
|
void main() {
|
|
2568
2568
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
2569
2569
|
gl_Position = vec4( position.xy, 1.0, 1.0 );
|
|
2570
|
-
}`,
|
|
2570
|
+
}`,nT=`uniform sampler2D t2D;
|
|
2571
2571
|
uniform float backgroundIntensity;
|
|
2572
2572
|
varying vec2 vUv;
|
|
2573
2573
|
void main() {
|
|
@@ -2579,14 +2579,14 @@ void main() {
|
|
|
2579
2579
|
gl_FragColor = texColor;
|
|
2580
2580
|
#include <tonemapping_fragment>
|
|
2581
2581
|
#include <colorspace_fragment>
|
|
2582
|
-
}`,
|
|
2582
|
+
}`,iT=`varying vec3 vWorldDirection;
|
|
2583
2583
|
#include <common>
|
|
2584
2584
|
void main() {
|
|
2585
2585
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
2586
2586
|
#include <begin_vertex>
|
|
2587
2587
|
#include <project_vertex>
|
|
2588
2588
|
gl_Position.z = gl_Position.w;
|
|
2589
|
-
}`,
|
|
2589
|
+
}`,aT=`#ifdef ENVMAP_TYPE_CUBE
|
|
2590
2590
|
uniform samplerCube envMap;
|
|
2591
2591
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
|
2592
2592
|
uniform sampler2D envMap;
|
|
@@ -2609,14 +2609,14 @@ void main() {
|
|
|
2609
2609
|
gl_FragColor = texColor;
|
|
2610
2610
|
#include <tonemapping_fragment>
|
|
2611
2611
|
#include <colorspace_fragment>
|
|
2612
|
-
}`,
|
|
2612
|
+
}`,sT=`varying vec3 vWorldDirection;
|
|
2613
2613
|
#include <common>
|
|
2614
2614
|
void main() {
|
|
2615
2615
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
2616
2616
|
#include <begin_vertex>
|
|
2617
2617
|
#include <project_vertex>
|
|
2618
2618
|
gl_Position.z = gl_Position.w;
|
|
2619
|
-
}`,
|
|
2619
|
+
}`,rT=`uniform samplerCube tCube;
|
|
2620
2620
|
uniform float tFlip;
|
|
2621
2621
|
uniform float opacity;
|
|
2622
2622
|
varying vec3 vWorldDirection;
|
|
@@ -2626,7 +2626,7 @@ void main() {
|
|
|
2626
2626
|
gl_FragColor.a *= opacity;
|
|
2627
2627
|
#include <tonemapping_fragment>
|
|
2628
2628
|
#include <colorspace_fragment>
|
|
2629
|
-
}`,
|
|
2629
|
+
}`,oT=`#include <common>
|
|
2630
2630
|
#include <batching_pars_vertex>
|
|
2631
2631
|
#include <uv_pars_vertex>
|
|
2632
2632
|
#include <displacementmap_pars_vertex>
|
|
@@ -2653,7 +2653,7 @@ void main() {
|
|
|
2653
2653
|
#include <logdepthbuf_vertex>
|
|
2654
2654
|
#include <clipping_planes_vertex>
|
|
2655
2655
|
vHighPrecisionZW = gl_Position.zw;
|
|
2656
|
-
}`,
|
|
2656
|
+
}`,lT=`#if DEPTH_PACKING == 3200
|
|
2657
2657
|
uniform float opacity;
|
|
2658
2658
|
#endif
|
|
2659
2659
|
#include <common>
|
|
@@ -2691,7 +2691,7 @@ void main() {
|
|
|
2691
2691
|
#elif DEPTH_PACKING == 3203
|
|
2692
2692
|
gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
|
|
2693
2693
|
#endif
|
|
2694
|
-
}`,
|
|
2694
|
+
}`,cT=`#define DISTANCE
|
|
2695
2695
|
varying vec3 vWorldPosition;
|
|
2696
2696
|
#include <common>
|
|
2697
2697
|
#include <batching_pars_vertex>
|
|
@@ -2718,7 +2718,7 @@ void main() {
|
|
|
2718
2718
|
#include <worldpos_vertex>
|
|
2719
2719
|
#include <clipping_planes_vertex>
|
|
2720
2720
|
vWorldPosition = worldPosition.xyz;
|
|
2721
|
-
}`,
|
|
2721
|
+
}`,uT=`#define DISTANCE
|
|
2722
2722
|
uniform vec3 referencePosition;
|
|
2723
2723
|
uniform float nearDistance;
|
|
2724
2724
|
uniform float farDistance;
|
|
@@ -2741,13 +2741,13 @@ void main () {
|
|
|
2741
2741
|
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
|
|
2742
2742
|
dist = saturate( dist );
|
|
2743
2743
|
gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 );
|
|
2744
|
-
}`,
|
|
2744
|
+
}`,fT=`varying vec3 vWorldDirection;
|
|
2745
2745
|
#include <common>
|
|
2746
2746
|
void main() {
|
|
2747
2747
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
2748
2748
|
#include <begin_vertex>
|
|
2749
2749
|
#include <project_vertex>
|
|
2750
|
-
}`,
|
|
2750
|
+
}`,hT=`uniform sampler2D tEquirect;
|
|
2751
2751
|
varying vec3 vWorldDirection;
|
|
2752
2752
|
#include <common>
|
|
2753
2753
|
void main() {
|
|
@@ -2756,7 +2756,7 @@ void main() {
|
|
|
2756
2756
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
2757
2757
|
#include <tonemapping_fragment>
|
|
2758
2758
|
#include <colorspace_fragment>
|
|
2759
|
-
}`,
|
|
2759
|
+
}`,dT=`uniform float scale;
|
|
2760
2760
|
attribute float lineDistance;
|
|
2761
2761
|
varying float vLineDistance;
|
|
2762
2762
|
#include <common>
|
|
@@ -2778,7 +2778,7 @@ void main() {
|
|
|
2778
2778
|
#include <logdepthbuf_vertex>
|
|
2779
2779
|
#include <clipping_planes_vertex>
|
|
2780
2780
|
#include <fog_vertex>
|
|
2781
|
-
}`,
|
|
2781
|
+
}`,pT=`uniform vec3 diffuse;
|
|
2782
2782
|
uniform float opacity;
|
|
2783
2783
|
uniform float dashSize;
|
|
2784
2784
|
uniform float totalSize;
|
|
@@ -2806,7 +2806,7 @@ void main() {
|
|
|
2806
2806
|
#include <colorspace_fragment>
|
|
2807
2807
|
#include <fog_fragment>
|
|
2808
2808
|
#include <premultiplied_alpha_fragment>
|
|
2809
|
-
}`,
|
|
2809
|
+
}`,mT=`#include <common>
|
|
2810
2810
|
#include <batching_pars_vertex>
|
|
2811
2811
|
#include <uv_pars_vertex>
|
|
2812
2812
|
#include <envmap_pars_vertex>
|
|
@@ -2838,7 +2838,7 @@ void main() {
|
|
|
2838
2838
|
#include <worldpos_vertex>
|
|
2839
2839
|
#include <envmap_vertex>
|
|
2840
2840
|
#include <fog_vertex>
|
|
2841
|
-
}`,
|
|
2841
|
+
}`,gT=`uniform vec3 diffuse;
|
|
2842
2842
|
uniform float opacity;
|
|
2843
2843
|
#ifndef FLAT_SHADED
|
|
2844
2844
|
varying vec3 vNormal;
|
|
@@ -2886,7 +2886,7 @@ void main() {
|
|
|
2886
2886
|
#include <fog_fragment>
|
|
2887
2887
|
#include <premultiplied_alpha_fragment>
|
|
2888
2888
|
#include <dithering_fragment>
|
|
2889
|
-
}`,
|
|
2889
|
+
}`,_T=`#define LAMBERT
|
|
2890
2890
|
varying vec3 vViewPosition;
|
|
2891
2891
|
#include <common>
|
|
2892
2892
|
#include <batching_pars_vertex>
|
|
@@ -2925,7 +2925,7 @@ void main() {
|
|
|
2925
2925
|
#include <envmap_vertex>
|
|
2926
2926
|
#include <shadowmap_vertex>
|
|
2927
2927
|
#include <fog_vertex>
|
|
2928
|
-
}`,
|
|
2928
|
+
}`,vT=`#define LAMBERT
|
|
2929
2929
|
uniform vec3 diffuse;
|
|
2930
2930
|
uniform vec3 emissive;
|
|
2931
2931
|
uniform float opacity;
|
|
@@ -2983,7 +2983,7 @@ void main() {
|
|
|
2983
2983
|
#include <fog_fragment>
|
|
2984
2984
|
#include <premultiplied_alpha_fragment>
|
|
2985
2985
|
#include <dithering_fragment>
|
|
2986
|
-
}`,
|
|
2986
|
+
}`,xT=`#define MATCAP
|
|
2987
2987
|
varying vec3 vViewPosition;
|
|
2988
2988
|
#include <common>
|
|
2989
2989
|
#include <batching_pars_vertex>
|
|
@@ -3017,7 +3017,7 @@ void main() {
|
|
|
3017
3017
|
#include <clipping_planes_vertex>
|
|
3018
3018
|
#include <fog_vertex>
|
|
3019
3019
|
vViewPosition = - mvPosition.xyz;
|
|
3020
|
-
}`,
|
|
3020
|
+
}`,yT=`#define MATCAP
|
|
3021
3021
|
uniform vec3 diffuse;
|
|
3022
3022
|
uniform float opacity;
|
|
3023
3023
|
uniform sampler2D matcap;
|
|
@@ -3063,7 +3063,7 @@ void main() {
|
|
|
3063
3063
|
#include <fog_fragment>
|
|
3064
3064
|
#include <premultiplied_alpha_fragment>
|
|
3065
3065
|
#include <dithering_fragment>
|
|
3066
|
-
}`,
|
|
3066
|
+
}`,ST=`#define NORMAL
|
|
3067
3067
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
3068
3068
|
varying vec3 vViewPosition;
|
|
3069
3069
|
#endif
|
|
@@ -3096,7 +3096,7 @@ void main() {
|
|
|
3096
3096
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
3097
3097
|
vViewPosition = - mvPosition.xyz;
|
|
3098
3098
|
#endif
|
|
3099
|
-
}`,
|
|
3099
|
+
}`,MT=`#define NORMAL
|
|
3100
3100
|
uniform float opacity;
|
|
3101
3101
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
3102
3102
|
varying vec3 vViewPosition;
|
|
@@ -3117,7 +3117,7 @@ void main() {
|
|
|
3117
3117
|
#ifdef OPAQUE
|
|
3118
3118
|
gl_FragColor.a = 1.0;
|
|
3119
3119
|
#endif
|
|
3120
|
-
}`,
|
|
3120
|
+
}`,bT=`#define PHONG
|
|
3121
3121
|
varying vec3 vViewPosition;
|
|
3122
3122
|
#include <common>
|
|
3123
3123
|
#include <batching_pars_vertex>
|
|
@@ -3156,7 +3156,7 @@ void main() {
|
|
|
3156
3156
|
#include <envmap_vertex>
|
|
3157
3157
|
#include <shadowmap_vertex>
|
|
3158
3158
|
#include <fog_vertex>
|
|
3159
|
-
}`,
|
|
3159
|
+
}`,ET=`#define PHONG
|
|
3160
3160
|
uniform vec3 diffuse;
|
|
3161
3161
|
uniform vec3 emissive;
|
|
3162
3162
|
uniform vec3 specular;
|
|
@@ -3216,7 +3216,7 @@ void main() {
|
|
|
3216
3216
|
#include <fog_fragment>
|
|
3217
3217
|
#include <premultiplied_alpha_fragment>
|
|
3218
3218
|
#include <dithering_fragment>
|
|
3219
|
-
}`,
|
|
3219
|
+
}`,TT=`#define STANDARD
|
|
3220
3220
|
varying vec3 vViewPosition;
|
|
3221
3221
|
#ifdef USE_TRANSMISSION
|
|
3222
3222
|
varying vec3 vWorldPosition;
|
|
@@ -3259,7 +3259,7 @@ void main() {
|
|
|
3259
3259
|
#ifdef USE_TRANSMISSION
|
|
3260
3260
|
vWorldPosition = worldPosition.xyz;
|
|
3261
3261
|
#endif
|
|
3262
|
-
}`,
|
|
3262
|
+
}`,AT=`#define STANDARD
|
|
3263
3263
|
#ifdef PHYSICAL
|
|
3264
3264
|
#define IOR
|
|
3265
3265
|
#define USE_SPECULAR
|
|
@@ -3384,7 +3384,7 @@ void main() {
|
|
|
3384
3384
|
#include <fog_fragment>
|
|
3385
3385
|
#include <premultiplied_alpha_fragment>
|
|
3386
3386
|
#include <dithering_fragment>
|
|
3387
|
-
}`,
|
|
3387
|
+
}`,RT=`#define TOON
|
|
3388
3388
|
varying vec3 vViewPosition;
|
|
3389
3389
|
#include <common>
|
|
3390
3390
|
#include <batching_pars_vertex>
|
|
@@ -3421,7 +3421,7 @@ void main() {
|
|
|
3421
3421
|
#include <worldpos_vertex>
|
|
3422
3422
|
#include <shadowmap_vertex>
|
|
3423
3423
|
#include <fog_vertex>
|
|
3424
|
-
}`,
|
|
3424
|
+
}`,wT=`#define TOON
|
|
3425
3425
|
uniform vec3 diffuse;
|
|
3426
3426
|
uniform vec3 emissive;
|
|
3427
3427
|
uniform float opacity;
|
|
@@ -3473,7 +3473,7 @@ void main() {
|
|
|
3473
3473
|
#include <fog_fragment>
|
|
3474
3474
|
#include <premultiplied_alpha_fragment>
|
|
3475
3475
|
#include <dithering_fragment>
|
|
3476
|
-
}`,
|
|
3476
|
+
}`,CT=`uniform float size;
|
|
3477
3477
|
uniform float scale;
|
|
3478
3478
|
#include <common>
|
|
3479
3479
|
#include <color_pars_vertex>
|
|
@@ -3504,7 +3504,7 @@ void main() {
|
|
|
3504
3504
|
#include <clipping_planes_vertex>
|
|
3505
3505
|
#include <worldpos_vertex>
|
|
3506
3506
|
#include <fog_vertex>
|
|
3507
|
-
}`,
|
|
3507
|
+
}`,DT=`uniform vec3 diffuse;
|
|
3508
3508
|
uniform float opacity;
|
|
3509
3509
|
#include <common>
|
|
3510
3510
|
#include <color_pars_fragment>
|
|
@@ -3529,7 +3529,7 @@ void main() {
|
|
|
3529
3529
|
#include <colorspace_fragment>
|
|
3530
3530
|
#include <fog_fragment>
|
|
3531
3531
|
#include <premultiplied_alpha_fragment>
|
|
3532
|
-
}`,
|
|
3532
|
+
}`,UT=`#include <common>
|
|
3533
3533
|
#include <batching_pars_vertex>
|
|
3534
3534
|
#include <fog_pars_vertex>
|
|
3535
3535
|
#include <morphtarget_pars_vertex>
|
|
@@ -3552,7 +3552,7 @@ void main() {
|
|
|
3552
3552
|
#include <worldpos_vertex>
|
|
3553
3553
|
#include <shadowmap_vertex>
|
|
3554
3554
|
#include <fog_vertex>
|
|
3555
|
-
}`,
|
|
3555
|
+
}`,LT=`uniform vec3 color;
|
|
3556
3556
|
uniform float opacity;
|
|
3557
3557
|
#include <common>
|
|
3558
3558
|
#include <fog_pars_fragment>
|
|
@@ -3568,7 +3568,7 @@ void main() {
|
|
|
3568
3568
|
#include <colorspace_fragment>
|
|
3569
3569
|
#include <fog_fragment>
|
|
3570
3570
|
#include <premultiplied_alpha_fragment>
|
|
3571
|
-
}`,
|
|
3571
|
+
}`,NT=`uniform float rotation;
|
|
3572
3572
|
uniform vec2 center;
|
|
3573
3573
|
#include <common>
|
|
3574
3574
|
#include <uv_pars_vertex>
|
|
@@ -3592,7 +3592,7 @@ void main() {
|
|
|
3592
3592
|
#include <logdepthbuf_vertex>
|
|
3593
3593
|
#include <clipping_planes_vertex>
|
|
3594
3594
|
#include <fog_vertex>
|
|
3595
|
-
}`,
|
|
3595
|
+
}`,OT=`uniform vec3 diffuse;
|
|
3596
3596
|
uniform float opacity;
|
|
3597
3597
|
#include <common>
|
|
3598
3598
|
#include <uv_pars_fragment>
|
|
@@ -3617,7 +3617,7 @@ void main() {
|
|
|
3617
3617
|
#include <tonemapping_fragment>
|
|
3618
3618
|
#include <colorspace_fragment>
|
|
3619
3619
|
#include <fog_fragment>
|
|
3620
|
-
}`,be={alphahash_fragment:eE,alphahash_pars_fragment:nE,alphamap_fragment:iE,alphamap_pars_fragment:aE,alphatest_fragment:sE,alphatest_pars_fragment:rE,aomap_fragment:oE,aomap_pars_fragment:lE,batching_pars_vertex:cE,batching_vertex:uE,begin_vertex:fE,beginnormal_vertex:hE,bsdfs:dE,iridescence_fragment:pE,bumpmap_pars_fragment:mE,clipping_planes_fragment:gE,clipping_planes_pars_fragment:_E,clipping_planes_pars_vertex:vE,clipping_planes_vertex:xE,color_fragment:yE,color_pars_fragment:SE,color_pars_vertex:ME,color_vertex:bE,common:EE,cube_uv_reflection_fragment:TE,defaultnormal_vertex:AE,displacementmap_pars_vertex:RE,displacementmap_vertex:wE,emissivemap_fragment:CE,emissivemap_pars_fragment:DE,colorspace_fragment:UE,colorspace_pars_fragment:LE,envmap_fragment:NE,envmap_common_pars_fragment:OE,envmap_pars_fragment:PE,envmap_pars_vertex:zE,envmap_physical_pars_fragment:YE,envmap_vertex:FE,fog_vertex:IE,fog_pars_vertex:BE,fog_fragment:HE,fog_pars_fragment:GE,gradientmap_pars_fragment:VE,lightmap_pars_fragment:kE,lights_lambert_fragment:XE,lights_lambert_pars_fragment:WE,lights_pars_begin:qE,lights_toon_fragment:jE,lights_toon_pars_fragment:ZE,lights_phong_fragment:KE,lights_phong_pars_fragment:QE,lights_physical_fragment:JE,lights_physical_pars_fragment:$E,lights_fragment_begin:t1,lights_fragment_maps:e1,lights_fragment_end:n1,logdepthbuf_fragment:i1,logdepthbuf_pars_fragment:a1,logdepthbuf_pars_vertex:s1,logdepthbuf_vertex:r1,map_fragment:o1,map_pars_fragment:l1,map_particle_fragment:c1,map_particle_pars_fragment:u1,metalnessmap_fragment:f1,metalnessmap_pars_fragment:h1,morphinstance_vertex:d1,morphcolor_vertex:p1,morphnormal_vertex:m1,morphtarget_pars_vertex:g1,morphtarget_vertex:_1,normal_fragment_begin:v1,normal_fragment_maps:x1,normal_pars_fragment:y1,normal_pars_vertex:S1,normal_vertex:M1,normalmap_pars_fragment:b1,clearcoat_normal_fragment_begin:E1,clearcoat_normal_fragment_maps:T1,clearcoat_pars_fragment:A1,iridescence_pars_fragment:R1,opaque_fragment:w1,packing:C1,premultiplied_alpha_fragment:D1,project_vertex:U1,dithering_fragment:L1,dithering_pars_fragment:N1,roughnessmap_fragment:O1,roughnessmap_pars_fragment:P1,shadowmap_pars_fragment:z1,shadowmap_pars_vertex:F1,shadowmap_vertex:I1,shadowmask_pars_fragment:B1,skinbase_vertex:H1,skinning_pars_vertex:G1,skinning_vertex:V1,skinnormal_vertex:k1,specularmap_fragment:X1,specularmap_pars_fragment:W1,tonemapping_fragment:q1,tonemapping_pars_fragment:Y1,transmission_fragment:j1,transmission_pars_fragment:Z1,uv_pars_fragment:K1,uv_pars_vertex:Q1,uv_vertex:J1,worldpos_vertex:$1,background_vert:tT,background_frag:eT,backgroundCube_vert:nT,backgroundCube_frag:iT,cube_vert:aT,cube_frag:sT,depth_vert:rT,depth_frag:oT,distance_vert:lT,distance_frag:cT,equirect_vert:uT,equirect_frag:fT,linedashed_vert:hT,linedashed_frag:dT,meshbasic_vert:pT,meshbasic_frag:mT,meshlambert_vert:gT,meshlambert_frag:_T,meshmatcap_vert:vT,meshmatcap_frag:xT,meshnormal_vert:yT,meshnormal_frag:ST,meshphong_vert:MT,meshphong_frag:bT,meshphysical_vert:ET,meshphysical_frag:TT,meshtoon_vert:AT,meshtoon_frag:RT,points_vert:wT,points_frag:CT,shadow_vert:DT,shadow_frag:UT,sprite_vert:LT,sprite_frag:NT},Gt={common:{diffuse:{value:new Ee(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Me},alphaMap:{value:null},alphaMapTransform:{value:new Me},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Me}},envmap:{envMap:{value:null},envMapRotation:{value:new Me},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Me}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Me}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Me},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Me},normalScale:{value:new _e(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Me},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Me}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Me}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Me}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ee(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},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 Ee(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Me},alphaTest:{value:0},uvTransform:{value:new Me}},sprite:{diffuse:{value:new Ee(16777215)},opacity:{value:1},center:{value:new _e(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Me},alphaMap:{value:null},alphaMapTransform:{value:new Me},alphaTest:{value:0}}},ai={basic:{uniforms:Zn([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.fog]),vertexShader:be.meshbasic_vert,fragmentShader:be.meshbasic_frag},lambert:{uniforms:Zn([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,Gt.lights,{emissive:{value:new Ee(0)},envMapIntensity:{value:1}}]),vertexShader:be.meshlambert_vert,fragmentShader:be.meshlambert_frag},phong:{uniforms:Zn([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,Gt.lights,{emissive:{value:new Ee(0)},specular:{value:new Ee(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:be.meshphong_vert,fragmentShader:be.meshphong_frag},standard:{uniforms:Zn([Gt.common,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.roughnessmap,Gt.metalnessmap,Gt.fog,Gt.lights,{emissive:{value:new Ee(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:be.meshphysical_vert,fragmentShader:be.meshphysical_frag},toon:{uniforms:Zn([Gt.common,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.gradientmap,Gt.fog,Gt.lights,{emissive:{value:new Ee(0)}}]),vertexShader:be.meshtoon_vert,fragmentShader:be.meshtoon_frag},matcap:{uniforms:Zn([Gt.common,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,{matcap:{value:null}}]),vertexShader:be.meshmatcap_vert,fragmentShader:be.meshmatcap_frag},points:{uniforms:Zn([Gt.points,Gt.fog]),vertexShader:be.points_vert,fragmentShader:be.points_frag},dashed:{uniforms:Zn([Gt.common,Gt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:be.linedashed_vert,fragmentShader:be.linedashed_frag},depth:{uniforms:Zn([Gt.common,Gt.displacementmap]),vertexShader:be.depth_vert,fragmentShader:be.depth_frag},normal:{uniforms:Zn([Gt.common,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,{opacity:{value:1}}]),vertexShader:be.meshnormal_vert,fragmentShader:be.meshnormal_frag},sprite:{uniforms:Zn([Gt.sprite,Gt.fog]),vertexShader:be.sprite_vert,fragmentShader:be.sprite_frag},background:{uniforms:{uvTransform:{value:new Me},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:be.background_vert,fragmentShader:be.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Me}},vertexShader:be.backgroundCube_vert,fragmentShader:be.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:be.cube_vert,fragmentShader:be.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:be.equirect_vert,fragmentShader:be.equirect_frag},distance:{uniforms:Zn([Gt.common,Gt.displacementmap,{referencePosition:{value:new Q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:be.distance_vert,fragmentShader:be.distance_frag},shadow:{uniforms:Zn([Gt.lights,Gt.fog,{color:{value:new Ee(0)},opacity:{value:1}}]),vertexShader:be.shadow_vert,fragmentShader:be.shadow_frag}};ai.physical={uniforms:Zn([ai.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Me},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Me},clearcoatNormalScale:{value:new _e(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Me},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Me},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Me},sheen:{value:0},sheenColor:{value:new Ee(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Me},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Me},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Me},transmissionSamplerSize:{value:new _e},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Me},attenuationDistance:{value:0},attenuationColor:{value:new Ee(0)},specularColor:{value:new Ee(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Me},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Me},anisotropyVector:{value:new _e},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Me}}]),vertexShader:be.meshphysical_vert,fragmentShader:be.meshphysical_frag};const fu={r:0,b:0,g:0},Zs=new ca,OT=new nn;function PT(a,t,i,s,l,c){const f=new Ee(0);let d=l===!0?0:1,m,p,v=null,_=0,g=null;function M(w){let D=w.isScene===!0?w.background:null;if(D&&D.isTexture){const C=w.backgroundBlurriness>0;D=t.get(D,C)}return D}function E(w){let D=!1;const C=M(w);C===null?x(f,d):C&&C.isColor&&(x(C,1),D=!0);const G=a.xr.getEnvironmentBlendMode();G==="additive"?i.buffers.color.setClear(0,0,0,1,c):G==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,c),(a.autoClear||D)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil))}function R(w,D){const C=M(D);C&&(C.isCubeTexture||C.mapping===Hu)?(p===void 0&&(p=new Gn(new ir(1,1,1),new qi({name:"BackgroundCubeMaterial",uniforms:ho(ai.backgroundCube.uniforms),vertexShader:ai.backgroundCube.vertexShader,fragmentShader:ai.backgroundCube.fragmentShader,side:si,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(G,B,F){this.matrixWorld.copyPosition(F.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(p)),Zs.copy(D.backgroundRotation),Zs.x*=-1,Zs.y*=-1,Zs.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Zs.y*=-1,Zs.z*=-1),p.material.uniforms.envMap.value=C,p.material.uniforms.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=D.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=D.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(OT.makeRotationFromEuler(Zs)),p.material.toneMapped=Ue.getTransfer(C.colorSpace)!==Ge,(v!==C||_!==C.version||g!==a.toneMapping)&&(p.material.needsUpdate=!0,v=C,_=C.version,g=a.toneMapping),p.layers.enableAll(),w.unshift(p,p.geometry,p.material,0,0,null)):C&&C.isTexture&&(m===void 0&&(m=new Gn(new Gu(2,2),new qi({name:"BackgroundMaterial",uniforms:ho(ai.background.uniforms),vertexShader:ai.background.vertexShader,fragmentShader:ai.background.fragmentShader,side:Es,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(m)),m.material.uniforms.t2D.value=C,m.material.uniforms.backgroundIntensity.value=D.backgroundIntensity,m.material.toneMapped=Ue.getTransfer(C.colorSpace)!==Ge,C.matrixAutoUpdate===!0&&C.updateMatrix(),m.material.uniforms.uvTransform.value.copy(C.matrix),(v!==C||_!==C.version||g!==a.toneMapping)&&(m.material.needsUpdate=!0,v=C,_=C.version,g=a.toneMapping),m.layers.enableAll(),w.unshift(m,m.geometry,m.material,0,0,null))}function x(w,D){w.getRGB(fu,Px(a)),i.buffers.color.setClear(fu.r,fu.g,fu.b,D,c)}function y(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0)}return{getClearColor:function(){return f},setClearColor:function(w,D=1){f.set(w),d=D,x(f,d)},getClearAlpha:function(){return d},setClearAlpha:function(w){d=w,x(f,d)},render:E,addToRenderList:R,dispose:y}}function zT(a,t){const i=a.getParameter(a.MAX_VERTEX_ATTRIBS),s={},l=g(null);let c=l,f=!1;function d(H,q,nt,ot,Y){let z=!1;const A=_(H,ot,nt,q);c!==A&&(c=A,p(c.object)),z=M(H,ot,nt,Y),z&&E(H,ot,nt,Y),Y!==null&&t.update(Y,a.ELEMENT_ARRAY_BUFFER),(z||f)&&(f=!1,C(H,q,nt,ot),Y!==null&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,t.get(Y).buffer))}function m(){return a.createVertexArray()}function p(H){return a.bindVertexArray(H)}function v(H){return a.deleteVertexArray(H)}function _(H,q,nt,ot){const Y=ot.wireframe===!0;let z=s[q.id];z===void 0&&(z={},s[q.id]=z);const A=H.isInstancedMesh===!0?H.id:0;let ht=z[A];ht===void 0&&(ht={},z[A]=ht);let lt=ht[nt.id];lt===void 0&&(lt={},ht[nt.id]=lt);let Ct=lt[Y];return Ct===void 0&&(Ct=g(m()),lt[Y]=Ct),Ct}function g(H){const q=[],nt=[],ot=[];for(let Y=0;Y<i;Y++)q[Y]=0,nt[Y]=0,ot[Y]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:q,enabledAttributes:nt,attributeDivisors:ot,object:H,attributes:{},index:null}}function M(H,q,nt,ot){const Y=c.attributes,z=q.attributes;let A=0;const ht=nt.getAttributes();for(const lt in ht)if(ht[lt].location>=0){const I=Y[lt];let K=z[lt];if(K===void 0&&(lt==="instanceMatrix"&&H.instanceMatrix&&(K=H.instanceMatrix),lt==="instanceColor"&&H.instanceColor&&(K=H.instanceColor)),I===void 0||I.attribute!==K||K&&I.data!==K.data)return!0;A++}return c.attributesNum!==A||c.index!==ot}function E(H,q,nt,ot){const Y={},z=q.attributes;let A=0;const ht=nt.getAttributes();for(const lt in ht)if(ht[lt].location>=0){let I=z[lt];I===void 0&&(lt==="instanceMatrix"&&H.instanceMatrix&&(I=H.instanceMatrix),lt==="instanceColor"&&H.instanceColor&&(I=H.instanceColor));const K={};K.attribute=I,I&&I.data&&(K.data=I.data),Y[lt]=K,A++}c.attributes=Y,c.attributesNum=A,c.index=ot}function R(){const H=c.newAttributes;for(let q=0,nt=H.length;q<nt;q++)H[q]=0}function x(H){y(H,0)}function y(H,q){const nt=c.newAttributes,ot=c.enabledAttributes,Y=c.attributeDivisors;nt[H]=1,ot[H]===0&&(a.enableVertexAttribArray(H),ot[H]=1),Y[H]!==q&&(a.vertexAttribDivisor(H,q),Y[H]=q)}function w(){const H=c.newAttributes,q=c.enabledAttributes;for(let nt=0,ot=q.length;nt<ot;nt++)q[nt]!==H[nt]&&(a.disableVertexAttribArray(nt),q[nt]=0)}function D(H,q,nt,ot,Y,z,A){A===!0?a.vertexAttribIPointer(H,q,nt,Y,z):a.vertexAttribPointer(H,q,nt,ot,Y,z)}function C(H,q,nt,ot){R();const Y=ot.attributes,z=nt.getAttributes(),A=q.defaultAttributeValues;for(const ht in z){const lt=z[ht];if(lt.location>=0){let Ct=Y[ht];if(Ct===void 0&&(ht==="instanceMatrix"&&H.instanceMatrix&&(Ct=H.instanceMatrix),ht==="instanceColor"&&H.instanceColor&&(Ct=H.instanceColor)),Ct!==void 0){const I=Ct.normalized,K=Ct.itemSize,Mt=t.get(Ct);if(Mt===void 0)continue;const wt=Mt.buffer,Bt=Mt.type,st=Mt.bytesPerElement,Et=Bt===a.INT||Bt===a.UNSIGNED_INT||Ct.gpuType===Bp;if(Ct.isInterleavedBufferAttribute){const gt=Ct.data,Ut=gt.stride,tt=Ct.offset;if(gt.isInstancedInterleavedBuffer){for(let ct=0;ct<lt.locationSize;ct++)y(lt.location+ct,gt.meshPerAttribute);H.isInstancedMesh!==!0&&ot._maxInstanceCount===void 0&&(ot._maxInstanceCount=gt.meshPerAttribute*gt.count)}else for(let ct=0;ct<lt.locationSize;ct++)x(lt.location+ct);a.bindBuffer(a.ARRAY_BUFFER,wt);for(let ct=0;ct<lt.locationSize;ct++)D(lt.location+ct,K/lt.locationSize,Bt,I,Ut*st,(tt+K/lt.locationSize*ct)*st,Et)}else{if(Ct.isInstancedBufferAttribute){for(let gt=0;gt<lt.locationSize;gt++)y(lt.location+gt,Ct.meshPerAttribute);H.isInstancedMesh!==!0&&ot._maxInstanceCount===void 0&&(ot._maxInstanceCount=Ct.meshPerAttribute*Ct.count)}else for(let gt=0;gt<lt.locationSize;gt++)x(lt.location+gt);a.bindBuffer(a.ARRAY_BUFFER,wt);for(let gt=0;gt<lt.locationSize;gt++)D(lt.location+gt,K/lt.locationSize,Bt,I,K*st,K/lt.locationSize*gt*st,Et)}}else if(A!==void 0){const I=A[ht];if(I!==void 0)switch(I.length){case 2:a.vertexAttrib2fv(lt.location,I);break;case 3:a.vertexAttrib3fv(lt.location,I);break;case 4:a.vertexAttrib4fv(lt.location,I);break;default:a.vertexAttrib1fv(lt.location,I)}}}}w()}function G(){U();for(const H in s){const q=s[H];for(const nt in q){const ot=q[nt];for(const Y in ot){const z=ot[Y];for(const A in z)v(z[A].object),delete z[A];delete ot[Y]}}delete s[H]}}function B(H){if(s[H.id]===void 0)return;const q=s[H.id];for(const nt in q){const ot=q[nt];for(const Y in ot){const z=ot[Y];for(const A in z)v(z[A].object),delete z[A];delete ot[Y]}}delete s[H.id]}function F(H){for(const q in s){const nt=s[q];for(const ot in nt){const Y=nt[ot];if(Y[H.id]===void 0)continue;const z=Y[H.id];for(const A in z)v(z[A].object),delete z[A];delete Y[H.id]}}}function T(H){for(const q in s){const nt=s[q],ot=H.isInstancedMesh===!0?H.id:0,Y=nt[ot];if(Y!==void 0){for(const z in Y){const A=Y[z];for(const ht in A)v(A[ht].object),delete A[ht];delete Y[z]}delete nt[ot],Object.keys(nt).length===0&&delete s[q]}}}function U(){et(),f=!0,c!==l&&(c=l,p(c.object))}function et(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:d,reset:U,resetDefaultState:et,dispose:G,releaseStatesOfGeometry:B,releaseStatesOfObject:T,releaseStatesOfProgram:F,initAttributes:R,enableAttribute:x,disableUnusedAttributes:w}}function FT(a,t,i){let s;function l(p){s=p}function c(p,v){a.drawArrays(s,p,v),i.update(v,s,1)}function f(p,v,_){_!==0&&(a.drawArraysInstanced(s,p,v,_),i.update(v,s,_))}function d(p,v,_){if(_===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,p,0,v,0,_);let M=0;for(let E=0;E<_;E++)M+=v[E];i.update(M,s,1)}function m(p,v,_,g){if(_===0)return;const M=t.get("WEBGL_multi_draw");if(M===null)for(let E=0;E<p.length;E++)f(p[E],v[E],g[E]);else{M.multiDrawArraysInstancedWEBGL(s,p,0,v,0,g,0,_);let E=0;for(let R=0;R<_;R++)E+=v[R]*g[R];i.update(E,s,1)}}this.setMode=l,this.render=c,this.renderInstances=f,this.renderMultiDraw=d,this.renderMultiDrawInstances=m}function IT(a,t,i,s){let l;function c(){if(l!==void 0)return l;if(t.has("EXT_texture_filter_anisotropic")===!0){const F=t.get("EXT_texture_filter_anisotropic");l=a.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else l=0;return l}function f(F){return!(F!==Wi&&s.convert(F)!==a.getParameter(a.IMPLEMENTATION_COLOR_READ_FORMAT))}function d(F){const T=F===Ia&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(F!==vi&&s.convert(F)!==a.getParameter(a.IMPLEMENTATION_COLOR_READ_TYPE)&&F!==ia&&!T)}function m(F){if(F==="highp"){if(a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision>0&&a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision>0)return"highp";F="mediump"}return F==="mediump"&&a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision>0&&a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=i.precision!==void 0?i.precision:"highp";const v=m(p);v!==p&&(ue("WebGLRenderer:",p,"not supported, using",v,"instead."),p=v);const _=i.logarithmicDepthBuffer===!0,g=i.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),M=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),E=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),R=a.getParameter(a.MAX_TEXTURE_SIZE),x=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),y=a.getParameter(a.MAX_VERTEX_ATTRIBS),w=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),D=a.getParameter(a.MAX_VARYING_VECTORS),C=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),G=a.getParameter(a.MAX_SAMPLES),B=a.getParameter(a.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:c,getMaxPrecision:m,textureFormatReadable:f,textureTypeReadable:d,precision:p,logarithmicDepthBuffer:_,reversedDepthBuffer:g,maxTextures:M,maxVertexTextures:E,maxTextureSize:R,maxCubemapSize:x,maxAttributes:y,maxVertexUniforms:w,maxVaryings:D,maxFragmentUniforms:C,maxSamples:G,samples:B}}function BT(a){const t=this;let i=null,s=0,l=!1,c=!1;const f=new xs,d=new Me,m={value:null,needsUpdate:!1};this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(_,g){const M=_.length!==0||g||s!==0||l;return l=g,s=_.length,M},this.beginShadows=function(){c=!0,v(null)},this.endShadows=function(){c=!1},this.setGlobalState=function(_,g){i=v(_,g,0)},this.setState=function(_,g,M){const E=_.clippingPlanes,R=_.clipIntersection,x=_.clipShadows,y=a.get(_);if(!l||E===null||E.length===0||c&&!x)c?v(null):p();else{const w=c?0:s,D=w*4;let C=y.clippingState||null;m.value=C,C=v(E,g,D,M);for(let G=0;G!==D;++G)C[G]=i[G];y.clippingState=C,this.numIntersection=R?this.numPlanes:0,this.numPlanes+=w}};function p(){m.value!==i&&(m.value=i,m.needsUpdate=s>0),t.numPlanes=s,t.numIntersection=0}function v(_,g,M,E){const R=_!==null?_.length:0;let x=null;if(R!==0){if(x=m.value,E!==!0||x===null){const y=M+R*4,w=g.matrixWorldInverse;d.getNormalMatrix(w),(x===null||x.length<y)&&(x=new Float32Array(y));for(let D=0,C=M;D!==R;++D,C+=4)f.copy(_[D]).applyMatrix4(w,d),f.normal.toArray(x,C),x[C+3]=f.constant}m.value=x,m.needsUpdate=!0}return t.numPlanes=R,t.numIntersection=0,x}}const bs=4,Ev=[.125,.215,.35,.446,.526,.582],Js=20,HT=256,pl=new Vu,Tv=new Ee;let Ud=null,Ld=0,Nd=0,Od=!1;const GT=new Q;class Av{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(t,i=0,s=.1,l=100,c={}){const{size:f=256,position:d=GT}=c;Ud=this._renderer.getRenderTarget(),Ld=this._renderer.getActiveCubeFace(),Nd=this._renderer.getActiveMipmapLevel(),Od=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(f);const m=this._allocateTargets();return m.depthBuffer=!0,this._sceneToCubeUV(t,s,l,m,d),i>0&&this._blur(m,0,0,i),this._applyPMREM(m),this._cleanup(m),m}fromEquirectangular(t,i=null){return this._fromTexture(t,i)}fromCubemap(t,i=null){return this._fromTexture(t,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Cv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=wv(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodMeshes.length;t++)this._lodMeshes[t].geometry.dispose()}_cleanup(t){this._renderer.setRenderTarget(Ud,Ld,Nd),this._renderer.xr.enabled=Od,t.scissorTest=!1,no(t,0,0,t.width,t.height)}_fromTexture(t,i){t.mapping===nr||t.mapping===co?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Ud=this._renderer.getRenderTarget(),Ld=this._renderer.getActiveCubeFace(),Nd=this._renderer.getActiveMipmapLevel(),Od=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=i||this._allocateTargets();return this._textureToCubeUV(t,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),i=4*this._cubeSize,s={magFilter:Vn,minFilter:Vn,generateMipmaps:!1,type:Ia,format:Wi,colorSpace:fo,depthBuffer:!1},l=Rv(t,i,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==i){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Rv(t,i,s);const{_lodMax:c}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=VT(c)),this._blurMaterial=XT(c,t,i),this._ggxMaterial=kT(c,t,i)}return l}_compileMaterial(t){const i=new Gn(new Mn,t);this._renderer.compile(i,pl)}_sceneToCubeUV(t,i,s,l,c){const m=new Vi(90,1,i,s),p=[1,-1,1,1,1,1],v=[1,1,1,-1,-1,-1],_=this._renderer,g=_.autoClear,M=_.toneMapping;_.getClearColor(Tv),_.toneMapping=ra,_.autoClear=!1,_.state.buffers.depth.getReversed()&&(_.setRenderTarget(l),_.clearDepth(),_.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Gn(new ir,new Pu({name:"PMREM.Background",side:si,depthWrite:!1,depthTest:!1})));const R=this._backgroundBox,x=R.material;let y=!1;const w=t.background;w?w.isColor&&(x.color.copy(w),t.background=null,y=!0):(x.color.copy(Tv),y=!0);for(let D=0;D<6;D++){const C=D%3;C===0?(m.up.set(0,p[D],0),m.position.set(c.x,c.y,c.z),m.lookAt(c.x+v[D],c.y,c.z)):C===1?(m.up.set(0,0,p[D]),m.position.set(c.x,c.y,c.z),m.lookAt(c.x,c.y+v[D],c.z)):(m.up.set(0,p[D],0),m.position.set(c.x,c.y,c.z),m.lookAt(c.x,c.y,c.z+v[D]));const G=this._cubeSize;no(l,C*G,D>2?G:0,G,G),_.setRenderTarget(l),y&&_.render(R,m),_.render(t,m)}_.toneMapping=M,_.autoClear=g,t.background=w}_textureToCubeUV(t,i){const s=this._renderer,l=t.mapping===nr||t.mapping===co;l?(this._cubemapMaterial===null&&(this._cubemapMaterial=Cv()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=wv());const c=l?this._cubemapMaterial:this._equirectMaterial,f=this._lodMeshes[0];f.material=c;const d=c.uniforms;d.envMap.value=t;const m=this._cubeSize;no(i,0,0,3*m,2*m),s.setRenderTarget(i),s.render(f,pl)}_applyPMREM(t){const i=this._renderer,s=i.autoClear;i.autoClear=!1;const l=this._lodMeshes.length;for(let c=1;c<l;c++)this._applyGGXFilter(t,c-1,c);i.autoClear=s}_applyGGXFilter(t,i,s){const l=this._renderer,c=this._pingPongRenderTarget,f=this._ggxMaterial,d=this._lodMeshes[s];d.material=f;const m=f.uniforms,p=s/(this._lodMeshes.length-1),v=i/(this._lodMeshes.length-1),_=Math.sqrt(p*p-v*v),g=0+p*1.25,M=_*g,{_lodMax:E}=this,R=this._sizeLods[s],x=3*R*(s>E-bs?s-E+bs:0),y=4*(this._cubeSize-R);m.envMap.value=t.texture,m.roughness.value=M,m.mipInt.value=E-i,no(c,x,y,3*R,2*R),l.setRenderTarget(c),l.render(d,pl),m.envMap.value=c.texture,m.roughness.value=0,m.mipInt.value=E-s,no(t,x,y,3*R,2*R),l.setRenderTarget(t),l.render(d,pl)}_blur(t,i,s,l,c){const f=this._pingPongRenderTarget;this._halfBlur(t,f,i,s,l,"latitudinal",c),this._halfBlur(f,t,s,s,l,"longitudinal",c)}_halfBlur(t,i,s,l,c,f,d){const m=this._renderer,p=this._blurMaterial;f!=="latitudinal"&&f!=="longitudinal"&&Pe("blur direction must be either latitudinal or longitudinal!");const v=3,_=this._lodMeshes[l];_.material=p;const g=p.uniforms,M=this._sizeLods[s]-1,E=isFinite(c)?Math.PI/(2*M):2*Math.PI/(2*Js-1),R=c/E,x=isFinite(c)?1+Math.floor(v*R):Js;x>Js&&ue(`sigmaRadians, ${c}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Js}`);const y=[];let w=0;for(let F=0;F<Js;++F){const T=F/R,U=Math.exp(-T*T/2);y.push(U),F===0?w+=U:F<x&&(w+=2*U)}for(let F=0;F<y.length;F++)y[F]=y[F]/w;g.envMap.value=t.texture,g.samples.value=x,g.weights.value=y,g.latitudinal.value=f==="latitudinal",d&&(g.poleAxis.value=d);const{_lodMax:D}=this;g.dTheta.value=E,g.mipInt.value=D-s;const C=this._sizeLods[l],G=3*C*(l>D-bs?l-D+bs:0),B=4*(this._cubeSize-C);no(i,G,B,3*C,2*C),m.setRenderTarget(i),m.render(_,pl)}}function VT(a){const t=[],i=[],s=[];let l=a;const c=a-bs+1+Ev.length;for(let f=0;f<c;f++){const d=Math.pow(2,l);t.push(d);let m=1/d;f>a-bs?m=Ev[f-a+bs-1]:f===0&&(m=0),i.push(m);const p=1/(d-2),v=-p,_=1+p,g=[v,v,_,v,_,_,v,v,_,_,v,_],M=6,E=6,R=3,x=2,y=1,w=new Float32Array(R*E*M),D=new Float32Array(x*E*M),C=new Float32Array(y*E*M);for(let B=0;B<M;B++){const F=B%3*2/3-1,T=B>2?0:-1,U=[F,T,0,F+2/3,T,0,F+2/3,T+1,0,F,T,0,F+2/3,T+1,0,F,T+1,0];w.set(U,R*E*B),D.set(g,x*E*B);const et=[B,B,B,B,B,B];C.set(et,y*E*B)}const G=new Mn;G.setAttribute("position",new xi(w,R)),G.setAttribute("uv",new xi(D,x)),G.setAttribute("faceIndex",new xi(C,y)),s.push(new Gn(G,null)),l>bs&&l--}return{lodMeshes:s,sizeLods:t,sigmas:i}}function Rv(a,t,i){const s=new oa(a,t,i);return s.texture.mapping=Hu,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function no(a,t,i,s,l){a.viewport.set(t,i,s,l),a.scissor.set(t,i,s,l)}function kT(a,t,i){return new qi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:HT,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:ku(),fragmentShader:`
|
|
3620
|
+
}`,be={alphahash_fragment:nE,alphahash_pars_fragment:iE,alphamap_fragment:aE,alphamap_pars_fragment:sE,alphatest_fragment:rE,alphatest_pars_fragment:oE,aomap_fragment:lE,aomap_pars_fragment:cE,batching_pars_vertex:uE,batching_vertex:fE,begin_vertex:hE,beginnormal_vertex:dE,bsdfs:pE,iridescence_fragment:mE,bumpmap_pars_fragment:gE,clipping_planes_fragment:_E,clipping_planes_pars_fragment:vE,clipping_planes_pars_vertex:xE,clipping_planes_vertex:yE,color_fragment:SE,color_pars_fragment:ME,color_pars_vertex:bE,color_vertex:EE,common:TE,cube_uv_reflection_fragment:AE,defaultnormal_vertex:RE,displacementmap_pars_vertex:wE,displacementmap_vertex:CE,emissivemap_fragment:DE,emissivemap_pars_fragment:UE,colorspace_fragment:LE,colorspace_pars_fragment:NE,envmap_fragment:OE,envmap_common_pars_fragment:PE,envmap_pars_fragment:zE,envmap_pars_vertex:FE,envmap_physical_pars_fragment:jE,envmap_vertex:IE,fog_vertex:BE,fog_pars_vertex:HE,fog_fragment:GE,fog_pars_fragment:VE,gradientmap_pars_fragment:kE,lightmap_pars_fragment:XE,lights_lambert_fragment:WE,lights_lambert_pars_fragment:qE,lights_pars_begin:YE,lights_toon_fragment:ZE,lights_toon_pars_fragment:KE,lights_phong_fragment:QE,lights_phong_pars_fragment:JE,lights_physical_fragment:$E,lights_physical_pars_fragment:t1,lights_fragment_begin:e1,lights_fragment_maps:n1,lights_fragment_end:i1,logdepthbuf_fragment:a1,logdepthbuf_pars_fragment:s1,logdepthbuf_pars_vertex:r1,logdepthbuf_vertex:o1,map_fragment:l1,map_pars_fragment:c1,map_particle_fragment:u1,map_particle_pars_fragment:f1,metalnessmap_fragment:h1,metalnessmap_pars_fragment:d1,morphinstance_vertex:p1,morphcolor_vertex:m1,morphnormal_vertex:g1,morphtarget_pars_vertex:_1,morphtarget_vertex:v1,normal_fragment_begin:x1,normal_fragment_maps:y1,normal_pars_fragment:S1,normal_pars_vertex:M1,normal_vertex:b1,normalmap_pars_fragment:E1,clearcoat_normal_fragment_begin:T1,clearcoat_normal_fragment_maps:A1,clearcoat_pars_fragment:R1,iridescence_pars_fragment:w1,opaque_fragment:C1,packing:D1,premultiplied_alpha_fragment:U1,project_vertex:L1,dithering_fragment:N1,dithering_pars_fragment:O1,roughnessmap_fragment:P1,roughnessmap_pars_fragment:z1,shadowmap_pars_fragment:F1,shadowmap_pars_vertex:I1,shadowmap_vertex:B1,shadowmask_pars_fragment:H1,skinbase_vertex:G1,skinning_pars_vertex:V1,skinning_vertex:k1,skinnormal_vertex:X1,specularmap_fragment:W1,specularmap_pars_fragment:q1,tonemapping_fragment:Y1,tonemapping_pars_fragment:j1,transmission_fragment:Z1,transmission_pars_fragment:K1,uv_pars_fragment:Q1,uv_pars_vertex:J1,uv_vertex:$1,worldpos_vertex:tT,background_vert:eT,background_frag:nT,backgroundCube_vert:iT,backgroundCube_frag:aT,cube_vert:sT,cube_frag:rT,depth_vert:oT,depth_frag:lT,distance_vert:cT,distance_frag:uT,equirect_vert:fT,equirect_frag:hT,linedashed_vert:dT,linedashed_frag:pT,meshbasic_vert:mT,meshbasic_frag:gT,meshlambert_vert:_T,meshlambert_frag:vT,meshmatcap_vert:xT,meshmatcap_frag:yT,meshnormal_vert:ST,meshnormal_frag:MT,meshphong_vert:bT,meshphong_frag:ET,meshphysical_vert:TT,meshphysical_frag:AT,meshtoon_vert:RT,meshtoon_frag:wT,points_vert:CT,points_frag:DT,shadow_vert:UT,shadow_frag:LT,sprite_vert:NT,sprite_frag:OT},Gt={common:{diffuse:{value:new Ee(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Me},alphaMap:{value:null},alphaMapTransform:{value:new Me},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Me}},envmap:{envMap:{value:null},envMapRotation:{value:new Me},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Me}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Me}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Me},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Me},normalScale:{value:new _e(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Me},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Me}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Me}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Me}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ee(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},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 Ee(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Me},alphaTest:{value:0},uvTransform:{value:new Me}},sprite:{diffuse:{value:new Ee(16777215)},opacity:{value:1},center:{value:new _e(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Me},alphaMap:{value:null},alphaMapTransform:{value:new Me},alphaTest:{value:0}}},ai={basic:{uniforms:Zn([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.fog]),vertexShader:be.meshbasic_vert,fragmentShader:be.meshbasic_frag},lambert:{uniforms:Zn([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,Gt.lights,{emissive:{value:new Ee(0)},envMapIntensity:{value:1}}]),vertexShader:be.meshlambert_vert,fragmentShader:be.meshlambert_frag},phong:{uniforms:Zn([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,Gt.lights,{emissive:{value:new Ee(0)},specular:{value:new Ee(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:be.meshphong_vert,fragmentShader:be.meshphong_frag},standard:{uniforms:Zn([Gt.common,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.roughnessmap,Gt.metalnessmap,Gt.fog,Gt.lights,{emissive:{value:new Ee(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:be.meshphysical_vert,fragmentShader:be.meshphysical_frag},toon:{uniforms:Zn([Gt.common,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.gradientmap,Gt.fog,Gt.lights,{emissive:{value:new Ee(0)}}]),vertexShader:be.meshtoon_vert,fragmentShader:be.meshtoon_frag},matcap:{uniforms:Zn([Gt.common,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,{matcap:{value:null}}]),vertexShader:be.meshmatcap_vert,fragmentShader:be.meshmatcap_frag},points:{uniforms:Zn([Gt.points,Gt.fog]),vertexShader:be.points_vert,fragmentShader:be.points_frag},dashed:{uniforms:Zn([Gt.common,Gt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:be.linedashed_vert,fragmentShader:be.linedashed_frag},depth:{uniforms:Zn([Gt.common,Gt.displacementmap]),vertexShader:be.depth_vert,fragmentShader:be.depth_frag},normal:{uniforms:Zn([Gt.common,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,{opacity:{value:1}}]),vertexShader:be.meshnormal_vert,fragmentShader:be.meshnormal_frag},sprite:{uniforms:Zn([Gt.sprite,Gt.fog]),vertexShader:be.sprite_vert,fragmentShader:be.sprite_frag},background:{uniforms:{uvTransform:{value:new Me},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:be.background_vert,fragmentShader:be.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Me}},vertexShader:be.backgroundCube_vert,fragmentShader:be.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:be.cube_vert,fragmentShader:be.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:be.equirect_vert,fragmentShader:be.equirect_frag},distance:{uniforms:Zn([Gt.common,Gt.displacementmap,{referencePosition:{value:new Q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:be.distance_vert,fragmentShader:be.distance_frag},shadow:{uniforms:Zn([Gt.lights,Gt.fog,{color:{value:new Ee(0)},opacity:{value:1}}]),vertexShader:be.shadow_vert,fragmentShader:be.shadow_frag}};ai.physical={uniforms:Zn([ai.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Me},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Me},clearcoatNormalScale:{value:new _e(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Me},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Me},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Me},sheen:{value:0},sheenColor:{value:new Ee(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Me},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Me},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Me},transmissionSamplerSize:{value:new _e},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Me},attenuationDistance:{value:0},attenuationColor:{value:new Ee(0)},specularColor:{value:new Ee(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Me},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Me},anisotropyVector:{value:new _e},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Me}}]),vertexShader:be.meshphysical_vert,fragmentShader:be.meshphysical_frag};const fu={r:0,b:0,g:0},Zs=new ca,PT=new nn;function zT(a,t,i,s,l,c){const f=new Ee(0);let d=l===!0?0:1,m,p,v=null,_=0,g=null;function S(w){let D=w.isScene===!0?w.background:null;if(D&&D.isTexture){const C=w.backgroundBlurriness>0;D=t.get(D,C)}return D}function b(w){let D=!1;const C=S(w);C===null?x(f,d):C&&C.isColor&&(x(C,1),D=!0);const G=a.xr.getEnvironmentBlendMode();G==="additive"?i.buffers.color.setClear(0,0,0,1,c):G==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,c),(a.autoClear||D)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil))}function R(w,D){const C=S(D);C&&(C.isCubeTexture||C.mapping===Hu)?(p===void 0&&(p=new Gn(new ir(1,1,1),new qi({name:"BackgroundCubeMaterial",uniforms:ho(ai.backgroundCube.uniforms),vertexShader:ai.backgroundCube.vertexShader,fragmentShader:ai.backgroundCube.fragmentShader,side:si,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(G,B,F){this.matrixWorld.copyPosition(F.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(p)),Zs.copy(D.backgroundRotation),Zs.x*=-1,Zs.y*=-1,Zs.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Zs.y*=-1,Zs.z*=-1),p.material.uniforms.envMap.value=C,p.material.uniforms.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=D.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=D.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(PT.makeRotationFromEuler(Zs)),p.material.toneMapped=Ue.getTransfer(C.colorSpace)!==Ge,(v!==C||_!==C.version||g!==a.toneMapping)&&(p.material.needsUpdate=!0,v=C,_=C.version,g=a.toneMapping),p.layers.enableAll(),w.unshift(p,p.geometry,p.material,0,0,null)):C&&C.isTexture&&(m===void 0&&(m=new Gn(new Gu(2,2),new qi({name:"BackgroundMaterial",uniforms:ho(ai.background.uniforms),vertexShader:ai.background.vertexShader,fragmentShader:ai.background.fragmentShader,side:Es,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),Object.defineProperty(m.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(m)),m.material.uniforms.t2D.value=C,m.material.uniforms.backgroundIntensity.value=D.backgroundIntensity,m.material.toneMapped=Ue.getTransfer(C.colorSpace)!==Ge,C.matrixAutoUpdate===!0&&C.updateMatrix(),m.material.uniforms.uvTransform.value.copy(C.matrix),(v!==C||_!==C.version||g!==a.toneMapping)&&(m.material.needsUpdate=!0,v=C,_=C.version,g=a.toneMapping),m.layers.enableAll(),w.unshift(m,m.geometry,m.material,0,0,null))}function x(w,D){w.getRGB(fu,zx(a)),i.buffers.color.setClear(fu.r,fu.g,fu.b,D,c)}function y(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0)}return{getClearColor:function(){return f},setClearColor:function(w,D=1){f.set(w),d=D,x(f,d)},getClearAlpha:function(){return d},setClearAlpha:function(w){d=w,x(f,d)},render:b,addToRenderList:R,dispose:y}}function FT(a,t){const i=a.getParameter(a.MAX_VERTEX_ATTRIBS),s={},l=g(null);let c=l,f=!1;function d(H,q,nt,ot,Y){let z=!1;const A=_(H,ot,nt,q);c!==A&&(c=A,p(c.object)),z=S(H,ot,nt,Y),z&&b(H,ot,nt,Y),Y!==null&&t.update(Y,a.ELEMENT_ARRAY_BUFFER),(z||f)&&(f=!1,C(H,q,nt,ot),Y!==null&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,t.get(Y).buffer))}function m(){return a.createVertexArray()}function p(H){return a.bindVertexArray(H)}function v(H){return a.deleteVertexArray(H)}function _(H,q,nt,ot){const Y=ot.wireframe===!0;let z=s[q.id];z===void 0&&(z={},s[q.id]=z);const A=H.isInstancedMesh===!0?H.id:0;let ht=z[A];ht===void 0&&(ht={},z[A]=ht);let lt=ht[nt.id];lt===void 0&&(lt={},ht[nt.id]=lt);let Ct=lt[Y];return Ct===void 0&&(Ct=g(m()),lt[Y]=Ct),Ct}function g(H){const q=[],nt=[],ot=[];for(let Y=0;Y<i;Y++)q[Y]=0,nt[Y]=0,ot[Y]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:q,enabledAttributes:nt,attributeDivisors:ot,object:H,attributes:{},index:null}}function S(H,q,nt,ot){const Y=c.attributes,z=q.attributes;let A=0;const ht=nt.getAttributes();for(const lt in ht)if(ht[lt].location>=0){const I=Y[lt];let K=z[lt];if(K===void 0&&(lt==="instanceMatrix"&&H.instanceMatrix&&(K=H.instanceMatrix),lt==="instanceColor"&&H.instanceColor&&(K=H.instanceColor)),I===void 0||I.attribute!==K||K&&I.data!==K.data)return!0;A++}return c.attributesNum!==A||c.index!==ot}function b(H,q,nt,ot){const Y={},z=q.attributes;let A=0;const ht=nt.getAttributes();for(const lt in ht)if(ht[lt].location>=0){let I=z[lt];I===void 0&&(lt==="instanceMatrix"&&H.instanceMatrix&&(I=H.instanceMatrix),lt==="instanceColor"&&H.instanceColor&&(I=H.instanceColor));const K={};K.attribute=I,I&&I.data&&(K.data=I.data),Y[lt]=K,A++}c.attributes=Y,c.attributesNum=A,c.index=ot}function R(){const H=c.newAttributes;for(let q=0,nt=H.length;q<nt;q++)H[q]=0}function x(H){y(H,0)}function y(H,q){const nt=c.newAttributes,ot=c.enabledAttributes,Y=c.attributeDivisors;nt[H]=1,ot[H]===0&&(a.enableVertexAttribArray(H),ot[H]=1),Y[H]!==q&&(a.vertexAttribDivisor(H,q),Y[H]=q)}function w(){const H=c.newAttributes,q=c.enabledAttributes;for(let nt=0,ot=q.length;nt<ot;nt++)q[nt]!==H[nt]&&(a.disableVertexAttribArray(nt),q[nt]=0)}function D(H,q,nt,ot,Y,z,A){A===!0?a.vertexAttribIPointer(H,q,nt,Y,z):a.vertexAttribPointer(H,q,nt,ot,Y,z)}function C(H,q,nt,ot){R();const Y=ot.attributes,z=nt.getAttributes(),A=q.defaultAttributeValues;for(const ht in z){const lt=z[ht];if(lt.location>=0){let Ct=Y[ht];if(Ct===void 0&&(ht==="instanceMatrix"&&H.instanceMatrix&&(Ct=H.instanceMatrix),ht==="instanceColor"&&H.instanceColor&&(Ct=H.instanceColor)),Ct!==void 0){const I=Ct.normalized,K=Ct.itemSize,Mt=t.get(Ct);if(Mt===void 0)continue;const wt=Mt.buffer,Bt=Mt.type,st=Mt.bytesPerElement,Et=Bt===a.INT||Bt===a.UNSIGNED_INT||Ct.gpuType===Bp;if(Ct.isInterleavedBufferAttribute){const gt=Ct.data,Ut=gt.stride,tt=Ct.offset;if(gt.isInstancedInterleavedBuffer){for(let ct=0;ct<lt.locationSize;ct++)y(lt.location+ct,gt.meshPerAttribute);H.isInstancedMesh!==!0&&ot._maxInstanceCount===void 0&&(ot._maxInstanceCount=gt.meshPerAttribute*gt.count)}else for(let ct=0;ct<lt.locationSize;ct++)x(lt.location+ct);a.bindBuffer(a.ARRAY_BUFFER,wt);for(let ct=0;ct<lt.locationSize;ct++)D(lt.location+ct,K/lt.locationSize,Bt,I,Ut*st,(tt+K/lt.locationSize*ct)*st,Et)}else{if(Ct.isInstancedBufferAttribute){for(let gt=0;gt<lt.locationSize;gt++)y(lt.location+gt,Ct.meshPerAttribute);H.isInstancedMesh!==!0&&ot._maxInstanceCount===void 0&&(ot._maxInstanceCount=Ct.meshPerAttribute*Ct.count)}else for(let gt=0;gt<lt.locationSize;gt++)x(lt.location+gt);a.bindBuffer(a.ARRAY_BUFFER,wt);for(let gt=0;gt<lt.locationSize;gt++)D(lt.location+gt,K/lt.locationSize,Bt,I,K*st,K/lt.locationSize*gt*st,Et)}}else if(A!==void 0){const I=A[ht];if(I!==void 0)switch(I.length){case 2:a.vertexAttrib2fv(lt.location,I);break;case 3:a.vertexAttrib3fv(lt.location,I);break;case 4:a.vertexAttrib4fv(lt.location,I);break;default:a.vertexAttrib1fv(lt.location,I)}}}}w()}function G(){U();for(const H in s){const q=s[H];for(const nt in q){const ot=q[nt];for(const Y in ot){const z=ot[Y];for(const A in z)v(z[A].object),delete z[A];delete ot[Y]}}delete s[H]}}function B(H){if(s[H.id]===void 0)return;const q=s[H.id];for(const nt in q){const ot=q[nt];for(const Y in ot){const z=ot[Y];for(const A in z)v(z[A].object),delete z[A];delete ot[Y]}}delete s[H.id]}function F(H){for(const q in s){const nt=s[q];for(const ot in nt){const Y=nt[ot];if(Y[H.id]===void 0)continue;const z=Y[H.id];for(const A in z)v(z[A].object),delete z[A];delete Y[H.id]}}}function T(H){for(const q in s){const nt=s[q],ot=H.isInstancedMesh===!0?H.id:0,Y=nt[ot];if(Y!==void 0){for(const z in Y){const A=Y[z];for(const ht in A)v(A[ht].object),delete A[ht];delete Y[z]}delete nt[ot],Object.keys(nt).length===0&&delete s[q]}}}function U(){et(),f=!0,c!==l&&(c=l,p(c.object))}function et(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:d,reset:U,resetDefaultState:et,dispose:G,releaseStatesOfGeometry:B,releaseStatesOfObject:T,releaseStatesOfProgram:F,initAttributes:R,enableAttribute:x,disableUnusedAttributes:w}}function IT(a,t,i){let s;function l(p){s=p}function c(p,v){a.drawArrays(s,p,v),i.update(v,s,1)}function f(p,v,_){_!==0&&(a.drawArraysInstanced(s,p,v,_),i.update(v,s,_))}function d(p,v,_){if(_===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,p,0,v,0,_);let S=0;for(let b=0;b<_;b++)S+=v[b];i.update(S,s,1)}function m(p,v,_,g){if(_===0)return;const S=t.get("WEBGL_multi_draw");if(S===null)for(let b=0;b<p.length;b++)f(p[b],v[b],g[b]);else{S.multiDrawArraysInstancedWEBGL(s,p,0,v,0,g,0,_);let b=0;for(let R=0;R<_;R++)b+=v[R]*g[R];i.update(b,s,1)}}this.setMode=l,this.render=c,this.renderInstances=f,this.renderMultiDraw=d,this.renderMultiDrawInstances=m}function BT(a,t,i,s){let l;function c(){if(l!==void 0)return l;if(t.has("EXT_texture_filter_anisotropic")===!0){const F=t.get("EXT_texture_filter_anisotropic");l=a.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else l=0;return l}function f(F){return!(F!==Wi&&s.convert(F)!==a.getParameter(a.IMPLEMENTATION_COLOR_READ_FORMAT))}function d(F){const T=F===Ia&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(F!==vi&&s.convert(F)!==a.getParameter(a.IMPLEMENTATION_COLOR_READ_TYPE)&&F!==ia&&!T)}function m(F){if(F==="highp"){if(a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision>0&&a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision>0)return"highp";F="mediump"}return F==="mediump"&&a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision>0&&a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=i.precision!==void 0?i.precision:"highp";const v=m(p);v!==p&&(ue("WebGLRenderer:",p,"not supported, using",v,"instead."),p=v);const _=i.logarithmicDepthBuffer===!0,g=i.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),S=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),b=a.getParameter(a.MAX_VERTEX_TEXTURE_IMAGE_UNITS),R=a.getParameter(a.MAX_TEXTURE_SIZE),x=a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE),y=a.getParameter(a.MAX_VERTEX_ATTRIBS),w=a.getParameter(a.MAX_VERTEX_UNIFORM_VECTORS),D=a.getParameter(a.MAX_VARYING_VECTORS),C=a.getParameter(a.MAX_FRAGMENT_UNIFORM_VECTORS),G=a.getParameter(a.MAX_SAMPLES),B=a.getParameter(a.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:c,getMaxPrecision:m,textureFormatReadable:f,textureTypeReadable:d,precision:p,logarithmicDepthBuffer:_,reversedDepthBuffer:g,maxTextures:S,maxVertexTextures:b,maxTextureSize:R,maxCubemapSize:x,maxAttributes:y,maxVertexUniforms:w,maxVaryings:D,maxFragmentUniforms:C,maxSamples:G,samples:B}}function HT(a){const t=this;let i=null,s=0,l=!1,c=!1;const f=new xs,d=new Me,m={value:null,needsUpdate:!1};this.uniform=m,this.numPlanes=0,this.numIntersection=0,this.init=function(_,g){const S=_.length!==0||g||s!==0||l;return l=g,s=_.length,S},this.beginShadows=function(){c=!0,v(null)},this.endShadows=function(){c=!1},this.setGlobalState=function(_,g){i=v(_,g,0)},this.setState=function(_,g,S){const b=_.clippingPlanes,R=_.clipIntersection,x=_.clipShadows,y=a.get(_);if(!l||b===null||b.length===0||c&&!x)c?v(null):p();else{const w=c?0:s,D=w*4;let C=y.clippingState||null;m.value=C,C=v(b,g,D,S);for(let G=0;G!==D;++G)C[G]=i[G];y.clippingState=C,this.numIntersection=R?this.numPlanes:0,this.numPlanes+=w}};function p(){m.value!==i&&(m.value=i,m.needsUpdate=s>0),t.numPlanes=s,t.numIntersection=0}function v(_,g,S,b){const R=_!==null?_.length:0;let x=null;if(R!==0){if(x=m.value,b!==!0||x===null){const y=S+R*4,w=g.matrixWorldInverse;d.getNormalMatrix(w),(x===null||x.length<y)&&(x=new Float32Array(y));for(let D=0,C=S;D!==R;++D,C+=4)f.copy(_[D]).applyMatrix4(w,d),f.normal.toArray(x,C),x[C+3]=f.constant}m.value=x,m.needsUpdate=!0}return t.numPlanes=R,t.numIntersection=0,x}}const bs=4,Ev=[.125,.215,.35,.446,.526,.582],Js=20,GT=256,pl=new Vu,Tv=new Ee;let Ud=null,Ld=0,Nd=0,Od=!1;const VT=new Q;class Av{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(t,i=0,s=.1,l=100,c={}){const{size:f=256,position:d=VT}=c;Ud=this._renderer.getRenderTarget(),Ld=this._renderer.getActiveCubeFace(),Nd=this._renderer.getActiveMipmapLevel(),Od=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(f);const m=this._allocateTargets();return m.depthBuffer=!0,this._sceneToCubeUV(t,s,l,m,d),i>0&&this._blur(m,0,0,i),this._applyPMREM(m),this._cleanup(m),m}fromEquirectangular(t,i=null){return this._fromTexture(t,i)}fromCubemap(t,i=null){return this._fromTexture(t,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Cv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=wv(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodMeshes.length;t++)this._lodMeshes[t].geometry.dispose()}_cleanup(t){this._renderer.setRenderTarget(Ud,Ld,Nd),this._renderer.xr.enabled=Od,t.scissorTest=!1,no(t,0,0,t.width,t.height)}_fromTexture(t,i){t.mapping===nr||t.mapping===co?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Ud=this._renderer.getRenderTarget(),Ld=this._renderer.getActiveCubeFace(),Nd=this._renderer.getActiveMipmapLevel(),Od=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=i||this._allocateTargets();return this._textureToCubeUV(t,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),i=4*this._cubeSize,s={magFilter:Vn,minFilter:Vn,generateMipmaps:!1,type:Ia,format:Wi,colorSpace:fo,depthBuffer:!1},l=Rv(t,i,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==i){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Rv(t,i,s);const{_lodMax:c}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=kT(c)),this._blurMaterial=WT(c,t,i),this._ggxMaterial=XT(c,t,i)}return l}_compileMaterial(t){const i=new Gn(new Mn,t);this._renderer.compile(i,pl)}_sceneToCubeUV(t,i,s,l,c){const m=new Vi(90,1,i,s),p=[1,-1,1,1,1,1],v=[1,1,1,-1,-1,-1],_=this._renderer,g=_.autoClear,S=_.toneMapping;_.getClearColor(Tv),_.toneMapping=ra,_.autoClear=!1,_.state.buffers.depth.getReversed()&&(_.setRenderTarget(l),_.clearDepth(),_.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Gn(new ir,new Pu({name:"PMREM.Background",side:si,depthWrite:!1,depthTest:!1})));const R=this._backgroundBox,x=R.material;let y=!1;const w=t.background;w?w.isColor&&(x.color.copy(w),t.background=null,y=!0):(x.color.copy(Tv),y=!0);for(let D=0;D<6;D++){const C=D%3;C===0?(m.up.set(0,p[D],0),m.position.set(c.x,c.y,c.z),m.lookAt(c.x+v[D],c.y,c.z)):C===1?(m.up.set(0,0,p[D]),m.position.set(c.x,c.y,c.z),m.lookAt(c.x,c.y+v[D],c.z)):(m.up.set(0,p[D],0),m.position.set(c.x,c.y,c.z),m.lookAt(c.x,c.y,c.z+v[D]));const G=this._cubeSize;no(l,C*G,D>2?G:0,G,G),_.setRenderTarget(l),y&&_.render(R,m),_.render(t,m)}_.toneMapping=S,_.autoClear=g,t.background=w}_textureToCubeUV(t,i){const s=this._renderer,l=t.mapping===nr||t.mapping===co;l?(this._cubemapMaterial===null&&(this._cubemapMaterial=Cv()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=wv());const c=l?this._cubemapMaterial:this._equirectMaterial,f=this._lodMeshes[0];f.material=c;const d=c.uniforms;d.envMap.value=t;const m=this._cubeSize;no(i,0,0,3*m,2*m),s.setRenderTarget(i),s.render(f,pl)}_applyPMREM(t){const i=this._renderer,s=i.autoClear;i.autoClear=!1;const l=this._lodMeshes.length;for(let c=1;c<l;c++)this._applyGGXFilter(t,c-1,c);i.autoClear=s}_applyGGXFilter(t,i,s){const l=this._renderer,c=this._pingPongRenderTarget,f=this._ggxMaterial,d=this._lodMeshes[s];d.material=f;const m=f.uniforms,p=s/(this._lodMeshes.length-1),v=i/(this._lodMeshes.length-1),_=Math.sqrt(p*p-v*v),g=0+p*1.25,S=_*g,{_lodMax:b}=this,R=this._sizeLods[s],x=3*R*(s>b-bs?s-b+bs:0),y=4*(this._cubeSize-R);m.envMap.value=t.texture,m.roughness.value=S,m.mipInt.value=b-i,no(c,x,y,3*R,2*R),l.setRenderTarget(c),l.render(d,pl),m.envMap.value=c.texture,m.roughness.value=0,m.mipInt.value=b-s,no(t,x,y,3*R,2*R),l.setRenderTarget(t),l.render(d,pl)}_blur(t,i,s,l,c){const f=this._pingPongRenderTarget;this._halfBlur(t,f,i,s,l,"latitudinal",c),this._halfBlur(f,t,s,s,l,"longitudinal",c)}_halfBlur(t,i,s,l,c,f,d){const m=this._renderer,p=this._blurMaterial;f!=="latitudinal"&&f!=="longitudinal"&&Pe("blur direction must be either latitudinal or longitudinal!");const v=3,_=this._lodMeshes[l];_.material=p;const g=p.uniforms,S=this._sizeLods[s]-1,b=isFinite(c)?Math.PI/(2*S):2*Math.PI/(2*Js-1),R=c/b,x=isFinite(c)?1+Math.floor(v*R):Js;x>Js&&ue(`sigmaRadians, ${c}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Js}`);const y=[];let w=0;for(let F=0;F<Js;++F){const T=F/R,U=Math.exp(-T*T/2);y.push(U),F===0?w+=U:F<x&&(w+=2*U)}for(let F=0;F<y.length;F++)y[F]=y[F]/w;g.envMap.value=t.texture,g.samples.value=x,g.weights.value=y,g.latitudinal.value=f==="latitudinal",d&&(g.poleAxis.value=d);const{_lodMax:D}=this;g.dTheta.value=b,g.mipInt.value=D-s;const C=this._sizeLods[l],G=3*C*(l>D-bs?l-D+bs:0),B=4*(this._cubeSize-C);no(i,G,B,3*C,2*C),m.setRenderTarget(i),m.render(_,pl)}}function kT(a){const t=[],i=[],s=[];let l=a;const c=a-bs+1+Ev.length;for(let f=0;f<c;f++){const d=Math.pow(2,l);t.push(d);let m=1/d;f>a-bs?m=Ev[f-a+bs-1]:f===0&&(m=0),i.push(m);const p=1/(d-2),v=-p,_=1+p,g=[v,v,_,v,_,_,v,v,_,_,v,_],S=6,b=6,R=3,x=2,y=1,w=new Float32Array(R*b*S),D=new Float32Array(x*b*S),C=new Float32Array(y*b*S);for(let B=0;B<S;B++){const F=B%3*2/3-1,T=B>2?0:-1,U=[F,T,0,F+2/3,T,0,F+2/3,T+1,0,F,T,0,F+2/3,T+1,0,F,T+1,0];w.set(U,R*b*B),D.set(g,x*b*B);const et=[B,B,B,B,B,B];C.set(et,y*b*B)}const G=new Mn;G.setAttribute("position",new xi(w,R)),G.setAttribute("uv",new xi(D,x)),G.setAttribute("faceIndex",new xi(C,y)),s.push(new Gn(G,null)),l>bs&&l--}return{lodMeshes:s,sizeLods:t,sigmas:i}}function Rv(a,t,i){const s=new oa(a,t,i);return s.texture.mapping=Hu,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function no(a,t,i,s,l){a.viewport.set(t,i,s,l),a.scissor.set(t,i,s,l)}function XT(a,t,i){return new qi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:GT,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:ku(),fragmentShader:`
|
|
3621
3621
|
|
|
3622
3622
|
precision highp float;
|
|
3623
3623
|
precision highp int;
|
|
@@ -3721,7 +3721,7 @@ void main() {
|
|
|
3721
3721
|
|
|
3722
3722
|
gl_FragColor = vec4(prefilteredColor, 1.0);
|
|
3723
3723
|
}
|
|
3724
|
-
`,blending:Pa,depthTest:!1,depthWrite:!1})}function
|
|
3724
|
+
`,blending:Pa,depthTest:!1,depthWrite:!1})}function WT(a,t,i){const s=new Float32Array(Js),l=new Q(0,1,0);return new qi({name:"SphericalGaussianBlur",defines:{n:Js,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:l}},vertexShader:ku(),fragmentShader:`
|
|
3725
3725
|
|
|
3726
3726
|
precision mediump float;
|
|
3727
3727
|
precision mediump int;
|
|
@@ -3871,7 +3871,7 @@ void main() {
|
|
|
3871
3871
|
gl_Position = vec4( position, 1.0 );
|
|
3872
3872
|
|
|
3873
3873
|
}
|
|
3874
|
-
`}class
|
|
3874
|
+
`}class Hx extends oa{constructor(t=1,i={}){super(t,t,i),this.isWebGLCubeRenderTarget=!0;const s={width:t,height:t,depth:1},l=[s,s,s,s,s,s];this.texture=new Ox(l),this._setTextureOptions(i),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,i){this.texture.type=i.type,this.texture.colorSpace=i.colorSpace,this.texture.generateMipmaps=i.generateMipmaps,this.texture.minFilter=i.minFilter,this.texture.magFilter=i.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
3875
3875
|
|
|
3876
3876
|
varying vec3 vWorldDirection;
|
|
3877
3877
|
|
|
@@ -3906,7 +3906,7 @@ void main() {
|
|
|
3906
3906
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
3907
3907
|
|
|
3908
3908
|
}
|
|
3909
|
-
`},l=new ir(5,5,5),c=new qi({name:"CubemapFromEquirect",uniforms:ho(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:si,blending:Pa});c.uniforms.tEquirect.value=i;const f=new Gn(l,c),d=i.minFilter;return i.minFilter===$s&&(i.minFilter=Vn),new
|
|
3909
|
+
`},l=new ir(5,5,5),c=new qi({name:"CubemapFromEquirect",uniforms:ho(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:si,blending:Pa});c.uniforms.tEquirect.value=i;const f=new Gn(l,c),d=i.minFilter;return i.minFilter===$s&&(i.minFilter=Vn),new jb(1,10,this).update(t,f),i.minFilter=d,f.geometry.dispose(),f.material.dispose(),this}clear(t,i=!0,s=!0,l=!0){const c=t.getRenderTarget();for(let f=0;f<6;f++)t.setRenderTarget(this,f),t.clear(i,s,l);t.setRenderTarget(c)}}function qT(a){let t=new WeakMap,i=new WeakMap,s=null;function l(g,S=!1){return g==null?null:S?f(g):c(g)}function c(g){if(g&&g.isTexture){const S=g.mapping;if(S===nd||S===id)if(t.has(g)){const b=t.get(g).texture;return d(b,g.mapping)}else{const b=g.image;if(b&&b.height>0){const R=new Hx(b.height);return R.fromEquirectangularTexture(a,g),t.set(g,R),g.addEventListener("dispose",p),d(R.texture,g.mapping)}else return null}}return g}function f(g){if(g&&g.isTexture){const S=g.mapping,b=S===nd||S===id,R=S===nr||S===co;if(b||R){let x=i.get(g);const y=x!==void 0?x.texture.pmremVersion:0;if(g.isRenderTargetTexture&&g.pmremVersion!==y)return s===null&&(s=new Av(a)),x=b?s.fromEquirectangular(g,x):s.fromCubemap(g,x),x.texture.pmremVersion=g.pmremVersion,i.set(g,x),x.texture;if(x!==void 0)return x.texture;{const w=g.image;return b&&w&&w.height>0||R&&w&&m(w)?(s===null&&(s=new Av(a)),x=b?s.fromEquirectangular(g):s.fromCubemap(g),x.texture.pmremVersion=g.pmremVersion,i.set(g,x),g.addEventListener("dispose",v),x.texture):null}}}return g}function d(g,S){return S===nd?g.mapping=nr:S===id&&(g.mapping=co),g}function m(g){let S=0;const b=6;for(let R=0;R<b;R++)g[R]!==void 0&&S++;return S===b}function p(g){const S=g.target;S.removeEventListener("dispose",p);const b=t.get(S);b!==void 0&&(t.delete(S),b.dispose())}function v(g){const S=g.target;S.removeEventListener("dispose",v);const b=i.get(S);b!==void 0&&(i.delete(S),b.dispose())}function _(){t=new WeakMap,i=new WeakMap,s!==null&&(s.dispose(),s=null)}return{get:l,dispose:_}}function YT(a){const t={};function i(s){if(t[s]!==void 0)return t[s];const l=a.getExtension(s);return t[s]=l,l}return{has:function(s){return i(s)!==null},init:function(){i("EXT_color_buffer_float"),i("WEBGL_clip_cull_distance"),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture"),i("WEBGL_render_shared_exponent")},get:function(s){const l=i(s);return l===null&&Ou("WebGLRenderer: "+s+" extension not supported."),l}}}function jT(a,t,i,s){const l={},c=new WeakMap;function f(_){const g=_.target;g.index!==null&&t.remove(g.index);for(const b in g.attributes)t.remove(g.attributes[b]);g.removeEventListener("dispose",f),delete l[g.id];const S=c.get(g);S&&(t.remove(S),c.delete(g)),s.releaseStatesOfGeometry(g),g.isInstancedBufferGeometry===!0&&delete g._maxInstanceCount,i.memory.geometries--}function d(_,g){return l[g.id]===!0||(g.addEventListener("dispose",f),l[g.id]=!0,i.memory.geometries++),g}function m(_){const g=_.attributes;for(const S in g)t.update(g[S],a.ARRAY_BUFFER)}function p(_){const g=[],S=_.index,b=_.attributes.position;let R=0;if(b===void 0)return;if(S!==null){const w=S.array;R=S.version;for(let D=0,C=w.length;D<C;D+=3){const G=w[D+0],B=w[D+1],F=w[D+2];g.push(G,B,B,F,F,G)}}else{const w=b.array;R=b.version;for(let D=0,C=w.length/3-1;D<C;D+=3){const G=D+0,B=D+1,F=D+2;g.push(G,B,B,F,F,G)}}const x=new(b.count>=65535?Nx:Lx)(g,1);x.version=R;const y=c.get(_);y&&t.remove(y),c.set(_,x)}function v(_){const g=c.get(_);if(g){const S=_.index;S!==null&&g.version<S.version&&p(_)}else p(_);return c.get(_)}return{get:d,update:m,getWireframeAttribute:v}}function ZT(a,t,i){let s;function l(g){s=g}let c,f;function d(g){c=g.type,f=g.bytesPerElement}function m(g,S){a.drawElements(s,S,c,g*f),i.update(S,s,1)}function p(g,S,b){b!==0&&(a.drawElementsInstanced(s,S,c,g*f,b),i.update(S,s,b))}function v(g,S,b){if(b===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(s,S,0,c,g,0,b);let x=0;for(let y=0;y<b;y++)x+=S[y];i.update(x,s,1)}function _(g,S,b,R){if(b===0)return;const x=t.get("WEBGL_multi_draw");if(x===null)for(let y=0;y<g.length;y++)p(g[y]/f,S[y],R[y]);else{x.multiDrawElementsInstancedWEBGL(s,S,0,c,g,0,R,0,b);let y=0;for(let w=0;w<b;w++)y+=S[w]*R[w];i.update(y,s,1)}}this.setMode=l,this.setIndex=d,this.render=m,this.renderInstances=p,this.renderMultiDraw=v,this.renderMultiDrawInstances=_}function KT(a){const t={geometries:0,textures:0},i={frame:0,calls:0,triangles:0,points:0,lines:0};function s(c,f,d){switch(i.calls++,f){case a.TRIANGLES:i.triangles+=d*(c/3);break;case a.LINES:i.lines+=d*(c/2);break;case a.LINE_STRIP:i.lines+=d*(c-1);break;case a.LINE_LOOP:i.lines+=d*c;break;case a.POINTS:i.points+=d*c;break;default:Pe("WebGLInfo: Unknown draw mode:",f);break}}function l(){i.calls=0,i.triangles=0,i.points=0,i.lines=0}return{memory:t,render:i,programs:null,autoReset:!0,reset:l,update:s}}function QT(a,t,i){const s=new WeakMap,l=new Ze;function c(f,d,m){const p=f.morphTargetInfluences,v=d.morphAttributes.position||d.morphAttributes.normal||d.morphAttributes.color,_=v!==void 0?v.length:0;let g=s.get(d);if(g===void 0||g.count!==_){let et=function(){T.dispose(),s.delete(d),d.removeEventListener("dispose",et)};var S=et;g!==void 0&&g.texture.dispose();const b=d.morphAttributes.position!==void 0,R=d.morphAttributes.normal!==void 0,x=d.morphAttributes.color!==void 0,y=d.morphAttributes.position||[],w=d.morphAttributes.normal||[],D=d.morphAttributes.color||[];let C=0;b===!0&&(C=1),R===!0&&(C=2),x===!0&&(C=3);let G=d.attributes.position.count*C,B=1;G>t.maxTextureSize&&(B=Math.ceil(G/t.maxTextureSize),G=t.maxTextureSize);const F=new Float32Array(G*B*4*_),T=new Cx(F,G,B,_);T.type=ia,T.needsUpdate=!0;const U=C*4;for(let H=0;H<_;H++){const q=y[H],nt=w[H],ot=D[H],Y=G*B*4*H;for(let z=0;z<q.count;z++){const A=z*U;b===!0&&(l.fromBufferAttribute(q,z),F[Y+A+0]=l.x,F[Y+A+1]=l.y,F[Y+A+2]=l.z,F[Y+A+3]=0),R===!0&&(l.fromBufferAttribute(nt,z),F[Y+A+4]=l.x,F[Y+A+5]=l.y,F[Y+A+6]=l.z,F[Y+A+7]=0),x===!0&&(l.fromBufferAttribute(ot,z),F[Y+A+8]=l.x,F[Y+A+9]=l.y,F[Y+A+10]=l.z,F[Y+A+11]=ot.itemSize===4?l.w:1)}}g={count:_,texture:T,size:new _e(G,B)},s.set(d,g),d.addEventListener("dispose",et)}if(f.isInstancedMesh===!0&&f.morphTexture!==null)m.getUniforms().setValue(a,"morphTexture",f.morphTexture,i);else{let b=0;for(let x=0;x<p.length;x++)b+=p[x];const R=d.morphTargetsRelative?1:1-b;m.getUniforms().setValue(a,"morphTargetBaseInfluence",R),m.getUniforms().setValue(a,"morphTargetInfluences",p)}m.getUniforms().setValue(a,"morphTargetsTexture",g.texture,i),m.getUniforms().setValue(a,"morphTargetsTextureSize",g.size)}return{update:c}}function JT(a,t,i,s,l){let c=new WeakMap;function f(p){const v=l.render.frame,_=p.geometry,g=t.get(p,_);if(c.get(g)!==v&&(t.update(g),c.set(g,v)),p.isInstancedMesh&&(p.hasEventListener("dispose",m)===!1&&p.addEventListener("dispose",m),c.get(p)!==v&&(i.update(p.instanceMatrix,a.ARRAY_BUFFER),p.instanceColor!==null&&i.update(p.instanceColor,a.ARRAY_BUFFER),c.set(p,v))),p.isSkinnedMesh){const S=p.skeleton;c.get(S)!==v&&(S.update(),c.set(S,v))}return g}function d(){c=new WeakMap}function m(p){const v=p.target;v.removeEventListener("dispose",m),s.releaseStatesOfObject(v),i.remove(v.instanceMatrix),v.instanceColor!==null&&i.remove(v.instanceColor)}return{update:f,dispose:d}}const $T={[fx]:"LINEAR_TONE_MAPPING",[hx]:"REINHARD_TONE_MAPPING",[dx]:"CINEON_TONE_MAPPING",[px]:"ACES_FILMIC_TONE_MAPPING",[gx]:"AGX_TONE_MAPPING",[_x]:"NEUTRAL_TONE_MAPPING",[mx]:"CUSTOM_TONE_MAPPING"};function tA(a,t,i,s,l){const c=new oa(t,i,{type:a,depthBuffer:s,stencilBuffer:l}),f=new oa(t,i,{type:Ia,depthBuffer:!1,stencilBuffer:!1}),d=new Mn;d.setAttribute("position",new _n([-1,3,0,-1,-1,0,3,-1,0],3)),d.setAttribute("uv",new _n([0,2,0,0,2,0],2));const m=new Bb({uniforms:{tDiffuse:{value:null}},vertexShader:`
|
|
3910
3910
|
precision highp float;
|
|
3911
3911
|
|
|
3912
3912
|
uniform mat4 modelViewMatrix;
|
|
@@ -3952,17 +3952,17 @@ void main() {
|
|
|
3952
3952
|
#ifdef SRGB_TRANSFER
|
|
3953
3953
|
gl_FragColor = sRGBTransferOETF( gl_FragColor );
|
|
3954
3954
|
#endif
|
|
3955
|
-
}`,depthTest:!1,depthWrite:!1}),p=new Gn(d,m),v=new Vu(-1,1,1,-1,0,1);let _=null,g=null,
|
|
3955
|
+
}`,depthTest:!1,depthWrite:!1}),p=new Gn(d,m),v=new Vu(-1,1,1,-1,0,1);let _=null,g=null,S=!1,b,R=null,x=[],y=!1;this.setSize=function(w,D){c.setSize(w,D),f.setSize(w,D);for(let C=0;C<x.length;C++){const G=x[C];G.setSize&&G.setSize(w,D)}},this.setEffects=function(w){x=w,y=x.length>0&&x[0].isRenderPass===!0;const D=c.width,C=c.height;for(let G=0;G<x.length;G++){const B=x[G];B.setSize&&B.setSize(D,C)}},this.begin=function(w,D){if(S||w.toneMapping===ra&&x.length===0)return!1;if(R=D,D!==null){const C=D.width,G=D.height;(c.width!==C||c.height!==G)&&this.setSize(C,G)}return y===!1&&w.setRenderTarget(c),b=w.toneMapping,w.toneMapping=ra,!0},this.hasRenderPass=function(){return y},this.end=function(w,D){w.toneMapping=b,S=!0;let C=c,G=f;for(let B=0;B<x.length;B++){const F=x[B];if(F.enabled!==!1&&(F.render(w,G,C,D),F.needsSwap!==!1)){const T=C;C=G,G=T}}if(_!==w.outputColorSpace||g!==w.toneMapping){_=w.outputColorSpace,g=w.toneMapping,m.defines={},Ue.getTransfer(_)===Ge&&(m.defines.SRGB_TRANSFER="");const B=$T[g];B&&(m.defines[B]=""),m.needsUpdate=!0}m.uniforms.tDiffuse.value=C.texture,w.setRenderTarget(R),w.render(p,v),R=null,S=!1},this.isCompositing=function(){return S},this.dispose=function(){c.dispose(),f.dispose(),d.dispose(),m.dispose()}}const Gx=new Kn,Lp=new bl(1,1),Vx=new Cx,kx=new mb,Xx=new Ox,Dv=[],Uv=[],Lv=new Float32Array(16),Nv=new Float32Array(9),Ov=new Float32Array(4);function go(a,t,i){const s=a[0];if(s<=0||s>0)return a;const l=t*i;let c=Dv[l];if(c===void 0&&(c=new Float32Array(l),Dv[l]=c),t!==0){s.toArray(c,0);for(let f=1,d=0;f!==t;++f)d+=i,a[f].toArray(c,d)}return c}function bn(a,t){if(a.length!==t.length)return!1;for(let i=0,s=a.length;i<s;i++)if(a[i]!==t[i])return!1;return!0}function En(a,t){for(let i=0,s=t.length;i<s;i++)a[i]=t[i]}function Xu(a,t){let i=Uv[t];i===void 0&&(i=new Int32Array(t),Uv[t]=i);for(let s=0;s!==t;++s)i[s]=a.allocateTextureUnit();return i}function eA(a,t){const i=this.cache;i[0]!==t&&(a.uniform1f(this.addr,t),i[0]=t)}function nA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(a.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(bn(i,t))return;a.uniform2fv(this.addr,t),En(i,t)}}function iA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(a.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(t.r!==void 0)(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(a.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(bn(i,t))return;a.uniform3fv(this.addr,t),En(i,t)}}function aA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(a.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(bn(i,t))return;a.uniform4fv(this.addr,t),En(i,t)}}function sA(a,t){const i=this.cache,s=t.elements;if(s===void 0){if(bn(i,t))return;a.uniformMatrix2fv(this.addr,!1,t),En(i,t)}else{if(bn(i,s))return;Ov.set(s),a.uniformMatrix2fv(this.addr,!1,Ov),En(i,s)}}function rA(a,t){const i=this.cache,s=t.elements;if(s===void 0){if(bn(i,t))return;a.uniformMatrix3fv(this.addr,!1,t),En(i,t)}else{if(bn(i,s))return;Nv.set(s),a.uniformMatrix3fv(this.addr,!1,Nv),En(i,s)}}function oA(a,t){const i=this.cache,s=t.elements;if(s===void 0){if(bn(i,t))return;a.uniformMatrix4fv(this.addr,!1,t),En(i,t)}else{if(bn(i,s))return;Lv.set(s),a.uniformMatrix4fv(this.addr,!1,Lv),En(i,s)}}function lA(a,t){const i=this.cache;i[0]!==t&&(a.uniform1i(this.addr,t),i[0]=t)}function cA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(a.uniform2i(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(bn(i,t))return;a.uniform2iv(this.addr,t),En(i,t)}}function uA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(a.uniform3i(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(bn(i,t))return;a.uniform3iv(this.addr,t),En(i,t)}}function fA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(a.uniform4i(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(bn(i,t))return;a.uniform4iv(this.addr,t),En(i,t)}}function hA(a,t){const i=this.cache;i[0]!==t&&(a.uniform1ui(this.addr,t),i[0]=t)}function dA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(a.uniform2ui(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(bn(i,t))return;a.uniform2uiv(this.addr,t),En(i,t)}}function pA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(a.uniform3ui(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(bn(i,t))return;a.uniform3uiv(this.addr,t),En(i,t)}}function mA(a,t){const i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(a.uniform4ui(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(bn(i,t))return;a.uniform4uiv(this.addr,t),En(i,t)}}function gA(a,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(a.uniform1i(this.addr,l),s[0]=l);let c;this.type===a.SAMPLER_2D_SHADOW?(Lp.compareFunction=i.isReversedDepthBuffer()?qp:Wp,c=Lp):c=Gx,i.setTexture2D(t||c,l)}function _A(a,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(a.uniform1i(this.addr,l),s[0]=l),i.setTexture3D(t||kx,l)}function vA(a,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(a.uniform1i(this.addr,l),s[0]=l),i.setTextureCube(t||Xx,l)}function xA(a,t,i){const s=this.cache,l=i.allocateTextureUnit();s[0]!==l&&(a.uniform1i(this.addr,l),s[0]=l),i.setTexture2DArray(t||Vx,l)}function yA(a){switch(a){case 5126:return eA;case 35664:return nA;case 35665:return iA;case 35666:return aA;case 35674:return sA;case 35675:return rA;case 35676:return oA;case 5124:case 35670:return lA;case 35667:case 35671:return cA;case 35668:case 35672:return uA;case 35669:case 35673:return fA;case 5125:return hA;case 36294:return dA;case 36295:return pA;case 36296:return mA;case 35678:case 36198:case 36298:case 36306:case 35682:return gA;case 35679:case 36299:case 36307:return _A;case 35680:case 36300:case 36308:case 36293:return vA;case 36289:case 36303:case 36311:case 36292:return xA}}function SA(a,t){a.uniform1fv(this.addr,t)}function MA(a,t){const i=go(t,this.size,2);a.uniform2fv(this.addr,i)}function bA(a,t){const i=go(t,this.size,3);a.uniform3fv(this.addr,i)}function EA(a,t){const i=go(t,this.size,4);a.uniform4fv(this.addr,i)}function TA(a,t){const i=go(t,this.size,4);a.uniformMatrix2fv(this.addr,!1,i)}function AA(a,t){const i=go(t,this.size,9);a.uniformMatrix3fv(this.addr,!1,i)}function RA(a,t){const i=go(t,this.size,16);a.uniformMatrix4fv(this.addr,!1,i)}function wA(a,t){a.uniform1iv(this.addr,t)}function CA(a,t){a.uniform2iv(this.addr,t)}function DA(a,t){a.uniform3iv(this.addr,t)}function UA(a,t){a.uniform4iv(this.addr,t)}function LA(a,t){a.uniform1uiv(this.addr,t)}function NA(a,t){a.uniform2uiv(this.addr,t)}function OA(a,t){a.uniform3uiv(this.addr,t)}function PA(a,t){a.uniform4uiv(this.addr,t)}function zA(a,t,i){const s=this.cache,l=t.length,c=Xu(i,l);bn(s,c)||(a.uniform1iv(this.addr,c),En(s,c));let f;this.type===a.SAMPLER_2D_SHADOW?f=Lp:f=Gx;for(let d=0;d!==l;++d)i.setTexture2D(t[d]||f,c[d])}function FA(a,t,i){const s=this.cache,l=t.length,c=Xu(i,l);bn(s,c)||(a.uniform1iv(this.addr,c),En(s,c));for(let f=0;f!==l;++f)i.setTexture3D(t[f]||kx,c[f])}function IA(a,t,i){const s=this.cache,l=t.length,c=Xu(i,l);bn(s,c)||(a.uniform1iv(this.addr,c),En(s,c));for(let f=0;f!==l;++f)i.setTextureCube(t[f]||Xx,c[f])}function BA(a,t,i){const s=this.cache,l=t.length,c=Xu(i,l);bn(s,c)||(a.uniform1iv(this.addr,c),En(s,c));for(let f=0;f!==l;++f)i.setTexture2DArray(t[f]||Vx,c[f])}function HA(a){switch(a){case 5126:return SA;case 35664:return MA;case 35665:return bA;case 35666:return EA;case 35674:return TA;case 35675:return AA;case 35676:return RA;case 5124:case 35670:return wA;case 35667:case 35671:return CA;case 35668:case 35672:return DA;case 35669:case 35673:return UA;case 5125:return LA;case 36294:return NA;case 36295:return OA;case 36296:return PA;case 35678:case 36198:case 36298:case 36306:case 35682:return zA;case 35679:case 36299:case 36307:return FA;case 35680:case 36300:case 36308:case 36293:return IA;case 36289:case 36303:case 36311:case 36292:return BA}}class GA{constructor(t,i,s){this.id=t,this.addr=s,this.cache=[],this.type=i.type,this.setValue=yA(i.type)}}class VA{constructor(t,i,s){this.id=t,this.addr=s,this.cache=[],this.type=i.type,this.size=i.size,this.setValue=HA(i.type)}}class kA{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,i,s){const l=this.seq;for(let c=0,f=l.length;c!==f;++c){const d=l[c];d.setValue(t,i[d.id],s)}}}const Pd=/(\w+)(\])?(\[|\.)?/g;function Pv(a,t){a.seq.push(t),a.map[t.id]=t}function XA(a,t,i){const s=a.name,l=s.length;for(Pd.lastIndex=0;;){const c=Pd.exec(s),f=Pd.lastIndex;let d=c[1];const m=c[2]==="]",p=c[3];if(m&&(d=d|0),p===void 0||p==="["&&f+2===l){Pv(i,p===void 0?new GA(d,a,t):new VA(d,a,t));break}else{let _=i.map[d];_===void 0&&(_=new kA(d),Pv(i,_)),i=_}}}class Ru{constructor(t,i){this.seq=[],this.map={};const s=t.getProgramParameter(i,t.ACTIVE_UNIFORMS);for(let f=0;f<s;++f){const d=t.getActiveUniform(i,f),m=t.getUniformLocation(i,d.name);XA(d,m,this)}const l=[],c=[];for(const f of this.seq)f.type===t.SAMPLER_2D_SHADOW||f.type===t.SAMPLER_CUBE_SHADOW||f.type===t.SAMPLER_2D_ARRAY_SHADOW?l.push(f):c.push(f);l.length>0&&(this.seq=l.concat(c))}setValue(t,i,s,l){const c=this.map[i];c!==void 0&&c.setValue(t,s,l)}setOptional(t,i,s){const l=i[s];l!==void 0&&this.setValue(t,s,l)}static upload(t,i,s,l){for(let c=0,f=i.length;c!==f;++c){const d=i[c],m=s[d.id];m.needsUpdate!==!1&&d.setValue(t,m.value,l)}}static seqWithValue(t,i){const s=[];for(let l=0,c=t.length;l!==c;++l){const f=t[l];f.id in i&&s.push(f)}return s}}function zv(a,t,i){const s=a.createShader(t);return a.shaderSource(s,i),a.compileShader(s),s}const WA=37297;let qA=0;function YA(a,t){const i=a.split(`
|
|
3956
3956
|
`),s=[],l=Math.max(t-6,0),c=Math.min(t+6,i.length);for(let f=l;f<c;f++){const d=f+1;s.push(`${d===t?">":" "} ${d}: ${i[f]}`)}return s.join(`
|
|
3957
|
-
`)}const Fv=new Me;function
|
|
3957
|
+
`)}const Fv=new Me;function jA(a){Ue._getMatrix(Fv,Ue.workingColorSpace,a);const t=`mat3( ${Fv.elements.map(i=>i.toFixed(4))} )`;switch(Ue.getTransfer(a)){case Uu:return[t,"LinearTransferOETF"];case Ge:return[t,"sRGBTransferOETF"];default:return ue("WebGLProgram: Unsupported color space: ",a),[t,"LinearTransferOETF"]}}function Iv(a,t,i){const s=a.getShaderParameter(t,a.COMPILE_STATUS),c=(a.getShaderInfoLog(t)||"").trim();if(s&&c==="")return"";const f=/ERROR: 0:(\d+)/.exec(c);if(f){const d=parseInt(f[1]);return i.toUpperCase()+`
|
|
3958
3958
|
|
|
3959
3959
|
`+c+`
|
|
3960
3960
|
|
|
3961
|
-
`+
|
|
3962
|
-
`)}const
|
|
3963
|
-
`)}function
|
|
3964
|
-
`)}function
|
|
3965
|
-
`)}function
|
|
3961
|
+
`+YA(a.getShaderSource(t),d)}else return c}function ZA(a,t){const i=jA(t);return[`vec4 ${a}( vec4 value ) {`,` return ${i[1]}( vec4( value.rgb * ${i[0]}, value.a ) );`,"}"].join(`
|
|
3962
|
+
`)}const KA={[fx]:"Linear",[hx]:"Reinhard",[dx]:"Cineon",[px]:"ACESFilmic",[gx]:"AgX",[_x]:"Neutral",[mx]:"Custom"};function QA(a,t){const i=KA[t];return i===void 0?(ue("WebGLProgram: Unsupported toneMapping:",t),"vec3 "+a+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+a+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}const hu=new Q;function JA(){Ue.getLuminanceCoefficients(hu);const a=hu.x.toFixed(4),t=hu.y.toFixed(4),i=hu.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${a}, ${t}, ${i} );`," return dot( weights, rgb );","}"].join(`
|
|
3963
|
+
`)}function $A(a){return[a.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",a.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(_l).join(`
|
|
3964
|
+
`)}function t2(a){const t=[];for(const i in a){const s=a[i];s!==!1&&t.push("#define "+i+" "+s)}return t.join(`
|
|
3965
|
+
`)}function e2(a,t){const i={},s=a.getProgramParameter(t,a.ACTIVE_ATTRIBUTES);for(let l=0;l<s;l++){const c=a.getActiveAttrib(t,l),f=c.name;let d=1;c.type===a.FLOAT_MAT2&&(d=2),c.type===a.FLOAT_MAT3&&(d=3),c.type===a.FLOAT_MAT4&&(d=4),i[f]={type:c.type,location:a.getAttribLocation(t,f),locationSize:d}}return i}function _l(a){return a!==""}function Bv(a,t){const i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return a.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Hv(a,t){return a.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const n2=/^[ \t]*#include +<([\w\d./]+)>/gm;function Np(a){return a.replace(n2,a2)}const i2=new Map;function a2(a,t){let i=be[t];if(i===void 0){const s=i2.get(t);if(s!==void 0)i=be[s],ue('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,s);else throw new Error("Can not resolve #include <"+t+">")}return Np(i)}const s2=/#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 Gv(a){return a.replace(s2,r2)}function r2(a,t,i,s){let l="";for(let c=parseInt(t);c<parseInt(i);c++)l+=s.replace(/\[\s*i\s*\]/g,"[ "+c+" ]").replace(/UNROLLED_LOOP_INDEX/g,c);return l}function Vv(a){let t=`precision ${a.precision} float;
|
|
3966
3966
|
precision ${a.precision} int;
|
|
3967
3967
|
precision ${a.precision} sampler2D;
|
|
3968
3968
|
precision ${a.precision} samplerCube;
|
|
@@ -3982,17 +3982,17 @@ void main() {
|
|
|
3982
3982
|
`;return a.precision==="highp"?t+=`
|
|
3983
3983
|
#define HIGH_PRECISION`:a.precision==="mediump"?t+=`
|
|
3984
3984
|
#define MEDIUM_PRECISION`:a.precision==="lowp"&&(t+=`
|
|
3985
|
-
#define LOW_PRECISION`),t}const
|
|
3986
|
-
`:"";i.isRawShaderMaterial?(x=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,
|
|
3985
|
+
#define LOW_PRECISION`),t}const o2={[Mu]:"SHADOWMAP_TYPE_PCF",[gl]:"SHADOWMAP_TYPE_VSM"};function l2(a){return o2[a.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const c2={[nr]:"ENVMAP_TYPE_CUBE",[co]:"ENVMAP_TYPE_CUBE",[Hu]:"ENVMAP_TYPE_CUBE_UV"};function u2(a){return a.envMap===!1?"ENVMAP_TYPE_CUBE":c2[a.envMapMode]||"ENVMAP_TYPE_CUBE"}const f2={[co]:"ENVMAP_MODE_REFRACTION"};function h2(a){return a.envMap===!1?"ENVMAP_MODE_REFLECTION":f2[a.envMapMode]||"ENVMAP_MODE_REFLECTION"}const d2={[Ip]:"ENVMAP_BLENDING_MULTIPLY",[NM]:"ENVMAP_BLENDING_MIX",[OM]:"ENVMAP_BLENDING_ADD"};function p2(a){return a.envMap===!1?"ENVMAP_BLENDING_NONE":d2[a.combine]||"ENVMAP_BLENDING_NONE"}function m2(a){const t=a.envMapCubeUVHeight;if(t===null)return null;const i=Math.log2(t)-2,s=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:s,maxMip:i}}function g2(a,t,i,s){const l=a.getContext(),c=i.defines;let f=i.vertexShader,d=i.fragmentShader;const m=l2(i),p=u2(i),v=h2(i),_=p2(i),g=m2(i),S=$A(i),b=t2(c),R=l.createProgram();let x,y,w=i.glslVersion?"#version "+i.glslVersion+`
|
|
3986
|
+
`:"";i.isRawShaderMaterial?(x=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,b].filter(_l).join(`
|
|
3987
3987
|
`),x.length>0&&(x+=`
|
|
3988
|
-
`),y=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,
|
|
3988
|
+
`),y=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,b].filter(_l).join(`
|
|
3989
3989
|
`),y.length>0&&(y+=`
|
|
3990
|
-
`)):(x=[Vv(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,
|
|
3990
|
+
`)):(x=[Vv(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,b,i.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.batchingColor?"#define USE_BATCHING_COLOR":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.instancingMorph?"#define USE_INSTANCING_MORPH":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+v:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.morphColors?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+m:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
|
|
3991
3991
|
`].filter(_l).join(`
|
|
3992
|
-
`),y=[Vv(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,
|
|
3992
|
+
`),y=[Vv(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,b,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.envMap?"#define "+v:"",i.envMap?"#define "+_:"",g?"#define CUBEUV_TEXEL_WIDTH "+g.texelWidth:"",g?"#define CUBEUV_TEXEL_HEIGHT "+g.texelHeight:"",g?"#define CUBEUV_MAX_MIP "+g.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.dispersion?"#define USE_DISPERSION":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas||i.batchingColor?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+m:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==ra?"#define TONE_MAPPING":"",i.toneMapping!==ra?be.tonemapping_pars_fragment:"",i.toneMapping!==ra?QA("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",be.colorspace_pars_fragment,ZA("linearToOutputTexel",i.outputColorSpace),JA(),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",`
|
|
3993
3993
|
`].filter(_l).join(`
|
|
3994
3994
|
`)),f=Np(f),f=Bv(f,i),f=Hv(f,i),d=Np(d),d=Bv(d,i),d=Hv(d,i),f=Gv(f),d=Gv(d),i.isRawShaderMaterial!==!0&&(w=`#version 300 es
|
|
3995
|
-
`,x=[
|
|
3995
|
+
`,x=[S,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
3996
3996
|
`)+`
|
|
3997
3997
|
`+x,y=["#define varying in",i.glslVersion===j_?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===j_?"":"#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(`
|
|
3998
3998
|
`)+`
|
|
@@ -4003,9 +4003,9 @@ Material Type: `+H.type+`
|
|
|
4003
4003
|
|
|
4004
4004
|
Program Info Log: `+Y+`
|
|
4005
4005
|
`+Ct+`
|
|
4006
|
-
`+I)}else Y!==""?ue("WebGLProgram: Program Info Log:",Y):(z===""||A==="")&&(lt=!1);lt&&(H.diagnostics={runnable:ht,programLog:Y,vertexShader:{log:z,prefix:x},fragmentShader:{log:A,prefix:y}})}l.deleteShader(G),l.deleteShader(B),T=new Ru(l,R),U=t2(l,R)}let T;this.getUniforms=function(){return T===void 0&&F(this),T};let U;this.getAttributes=function(){return U===void 0&&F(this),U};let et=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return et===!1&&(et=l.getProgramParameter(R,XA)),et},this.destroy=function(){s.releaseStatesOfProgram(this),l.deleteProgram(R),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=WA++,this.cacheKey=t,this.usedTimes=1,this.program=R,this.vertexShader=G,this.fragmentShader=B,this}let g2=0;class _2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const i=t.vertexShader,s=t.fragmentShader,l=this._getShaderStage(i),c=this._getShaderStage(s),f=this._getShaderCacheForMaterial(t);return f.has(l)===!1&&(f.add(l),l.usedTimes++),f.has(c)===!1&&(f.add(c),c.usedTimes++),this}remove(t){const i=this.materialCache.get(t);for(const s of i)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const i=this.materialCache;let s=i.get(t);return s===void 0&&(s=new Set,i.set(t,s)),s}_getShaderStage(t){const i=this.shaderCache;let s=i.get(t);return s===void 0&&(s=new v2(t),i.set(t,s)),s}}class v2{constructor(t){this.id=g2++,this.code=t,this.usedTimes=0}}function x2(a,t,i,s,l,c){const f=new Cx,d=new _2,m=new Set,p=[],v=new Map,_=s.logarithmicDepthBuffer;let g=s.precision;const M={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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 E(T){return m.add(T),T===0?"uv":`uv${T}`}function R(T,U,et,H,q){const nt=H.fog,ot=q.geometry,Y=T.isMeshStandardMaterial||T.isMeshLambertMaterial||T.isMeshPhongMaterial?H.environment:null,z=T.isMeshStandardMaterial||T.isMeshLambertMaterial&&!T.envMap||T.isMeshPhongMaterial&&!T.envMap,A=t.get(T.envMap||Y,z),ht=A&&A.mapping===Hu?A.image.height:null,lt=M[T.type];T.precision!==null&&(g=s.getMaxPrecision(T.precision),g!==T.precision&&ue("WebGLProgram.getParameters:",T.precision,"not supported, using",g,"instead."));const Ct=ot.morphAttributes.position||ot.morphAttributes.normal||ot.morphAttributes.color,I=Ct!==void 0?Ct.length:0;let K=0;ot.morphAttributes.position!==void 0&&(K=1),ot.morphAttributes.normal!==void 0&&(K=2),ot.morphAttributes.color!==void 0&&(K=3);let Mt,wt,Bt,st;if(lt){const De=ai[lt];Mt=De.vertexShader,wt=De.fragmentShader}else Mt=T.vertexShader,wt=T.fragmentShader,d.update(T),Bt=d.getVertexShaderID(T),st=d.getFragmentShaderID(T);const Et=a.getRenderTarget(),gt=a.state.buffers.depth.getReversed(),Ut=q.isInstancedMesh===!0,tt=q.isBatchedMesh===!0,ct=!!T.map,qt=!!T.matcap,Xt=!!A,oe=!!T.aoMap,de=!!T.lightMap,Yt=!!T.bumpMap,se=!!T.normalMap,X=!!T.displacementMap,ce=!!T.emissiveMap,Jt=!!T.metalnessMap,ne=!!T.roughnessMap,Pt=T.anisotropy>0,O=T.clearcoat>0,b=T.dispersion>0,V=T.iridescence>0,$=T.sheen>0,k=T.transmission>0,P=Pt&&!!T.anisotropyMap,it=O&&!!T.clearcoatMap,rt=O&&!!T.clearcoatNormalMap,_t=O&&!!T.clearcoatRoughnessMap,At=V&&!!T.iridescenceMap,xt=V&&!!T.iridescenceThicknessMap,St=$&&!!T.sheenColorMap,Nt=$&&!!T.sheenRoughnessMap,Lt=!!T.specularMap,It=!!T.specularColorMap,$t=!!T.specularIntensityMap,j=k&&!!T.transmissionMap,zt=k&&!!T.thicknessMap,Ft=!!T.gradientMap,kt=!!T.alphaMap,Ot=T.alphaTest>0,bt=!!T.alphaHash,jt=!!T.extensions;let he=ra;T.toneMapped&&(Et===null||Et.isXRRenderTarget===!0)&&(he=a.toneMapping);const Ie={shaderID:lt,shaderType:T.type,shaderName:T.name,vertexShader:Mt,fragmentShader:wt,defines:T.defines,customVertexShaderID:Bt,customFragmentShaderID:st,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:g,batching:tt,batchingColor:tt&&q._colorsTexture!==null,instancing:Ut,instancingColor:Ut&&q.instanceColor!==null,instancingMorph:Ut&&q.morphTexture!==null,outputColorSpace:Et===null?a.outputColorSpace:Et.isXRRenderTarget===!0?Et.texture.colorSpace:fo,alphaToCoverage:!!T.alphaToCoverage,map:ct,matcap:qt,envMap:Xt,envMapMode:Xt&&A.mapping,envMapCubeUVHeight:ht,aoMap:oe,lightMap:de,bumpMap:Yt,normalMap:se,displacementMap:X,emissiveMap:ce,normalMapObjectSpace:se&&T.normalMapType===zM,normalMapTangentSpace:se&&T.normalMapType===Tx,metalnessMap:Jt,roughnessMap:ne,anisotropy:Pt,anisotropyMap:P,clearcoat:O,clearcoatMap:it,clearcoatNormalMap:rt,clearcoatRoughnessMap:_t,dispersion:b,iridescence:V,iridescenceMap:At,iridescenceThicknessMap:xt,sheen:$,sheenColorMap:St,sheenRoughnessMap:Nt,specularMap:Lt,specularColorMap:It,specularIntensityMap:$t,transmission:k,transmissionMap:j,thicknessMap:zt,gradientMap:Ft,opaque:T.transparent===!1&&T.blending===so&&T.alphaToCoverage===!1,alphaMap:kt,alphaTest:Ot,alphaHash:bt,combine:T.combine,mapUv:ct&&E(T.map.channel),aoMapUv:oe&&E(T.aoMap.channel),lightMapUv:de&&E(T.lightMap.channel),bumpMapUv:Yt&&E(T.bumpMap.channel),normalMapUv:se&&E(T.normalMap.channel),displacementMapUv:X&&E(T.displacementMap.channel),emissiveMapUv:ce&&E(T.emissiveMap.channel),metalnessMapUv:Jt&&E(T.metalnessMap.channel),roughnessMapUv:ne&&E(T.roughnessMap.channel),anisotropyMapUv:P&&E(T.anisotropyMap.channel),clearcoatMapUv:it&&E(T.clearcoatMap.channel),clearcoatNormalMapUv:rt&&E(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_t&&E(T.clearcoatRoughnessMap.channel),iridescenceMapUv:At&&E(T.iridescenceMap.channel),iridescenceThicknessMapUv:xt&&E(T.iridescenceThicknessMap.channel),sheenColorMapUv:St&&E(T.sheenColorMap.channel),sheenRoughnessMapUv:Nt&&E(T.sheenRoughnessMap.channel),specularMapUv:Lt&&E(T.specularMap.channel),specularColorMapUv:It&&E(T.specularColorMap.channel),specularIntensityMapUv:$t&&E(T.specularIntensityMap.channel),transmissionMapUv:j&&E(T.transmissionMap.channel),thicknessMapUv:zt&&E(T.thicknessMap.channel),alphaMapUv:kt&&E(T.alphaMap.channel),vertexTangents:!!ot.attributes.tangent&&(se||Pt),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!ot.attributes.color&&ot.attributes.color.itemSize===4,pointsUvs:q.isPoints===!0&&!!ot.attributes.uv&&(ct||kt),fog:!!nt,useFog:T.fog===!0,fogExp2:!!nt&&nt.isFogExp2,flatShading:T.wireframe===!1&&(T.flatShading===!0||ot.attributes.normal===void 0&&se===!1&&(T.isMeshLambertMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isMeshPhysicalMaterial)),sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:_,reversedDepthBuffer:gt,skinning:q.isSkinnedMesh===!0,morphTargets:ot.morphAttributes.position!==void 0,morphNormals:ot.morphAttributes.normal!==void 0,morphColors:ot.morphAttributes.color!==void 0,morphTargetsCount:I,morphTextureStride:K,numDirLights:U.directional.length,numPointLights:U.point.length,numSpotLights:U.spot.length,numSpotLightMaps:U.spotLightMap.length,numRectAreaLights:U.rectArea.length,numHemiLights:U.hemi.length,numDirLightShadows:U.directionalShadowMap.length,numPointLightShadows:U.pointShadowMap.length,numSpotLightShadows:U.spotShadowMap.length,numSpotLightShadowsWithMaps:U.numSpotLightShadowsWithMaps,numLightProbes:U.numLightProbes,numClippingPlanes:c.numPlanes,numClipIntersection:c.numIntersection,dithering:T.dithering,shadowMapEnabled:a.shadowMap.enabled&&et.length>0,shadowMapType:a.shadowMap.type,toneMapping:he,decodeVideoTexture:ct&&T.map.isVideoTexture===!0&&Ue.getTransfer(T.map.colorSpace)===Ge,decodeVideoTextureEmissive:ce&&T.emissiveMap.isVideoTexture===!0&&Ue.getTransfer(T.emissiveMap.colorSpace)===Ge,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===ki,flipSided:T.side===si,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionClipCullDistance:jt&&T.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(jt&&T.extensions.multiDraw===!0||tt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()};return Ie.vertexUv1s=m.has(1),Ie.vertexUv2s=m.has(2),Ie.vertexUv3s=m.has(3),m.clear(),Ie}function x(T){const U=[];if(T.shaderID?U.push(T.shaderID):(U.push(T.customVertexShaderID),U.push(T.customFragmentShaderID)),T.defines!==void 0)for(const et in T.defines)U.push(et),U.push(T.defines[et]);return T.isRawShaderMaterial===!1&&(y(U,T),w(U,T),U.push(a.outputColorSpace)),U.push(T.customProgramCacheKey),U.join()}function y(T,U){T.push(U.precision),T.push(U.outputColorSpace),T.push(U.envMapMode),T.push(U.envMapCubeUVHeight),T.push(U.mapUv),T.push(U.alphaMapUv),T.push(U.lightMapUv),T.push(U.aoMapUv),T.push(U.bumpMapUv),T.push(U.normalMapUv),T.push(U.displacementMapUv),T.push(U.emissiveMapUv),T.push(U.metalnessMapUv),T.push(U.roughnessMapUv),T.push(U.anisotropyMapUv),T.push(U.clearcoatMapUv),T.push(U.clearcoatNormalMapUv),T.push(U.clearcoatRoughnessMapUv),T.push(U.iridescenceMapUv),T.push(U.iridescenceThicknessMapUv),T.push(U.sheenColorMapUv),T.push(U.sheenRoughnessMapUv),T.push(U.specularMapUv),T.push(U.specularColorMapUv),T.push(U.specularIntensityMapUv),T.push(U.transmissionMapUv),T.push(U.thicknessMapUv),T.push(U.combine),T.push(U.fogExp2),T.push(U.sizeAttenuation),T.push(U.morphTargetsCount),T.push(U.morphAttributeCount),T.push(U.numDirLights),T.push(U.numPointLights),T.push(U.numSpotLights),T.push(U.numSpotLightMaps),T.push(U.numHemiLights),T.push(U.numRectAreaLights),T.push(U.numDirLightShadows),T.push(U.numPointLightShadows),T.push(U.numSpotLightShadows),T.push(U.numSpotLightShadowsWithMaps),T.push(U.numLightProbes),T.push(U.shadowMapType),T.push(U.toneMapping),T.push(U.numClippingPlanes),T.push(U.numClipIntersection),T.push(U.depthPacking)}function w(T,U){f.disableAll(),U.instancing&&f.enable(0),U.instancingColor&&f.enable(1),U.instancingMorph&&f.enable(2),U.matcap&&f.enable(3),U.envMap&&f.enable(4),U.normalMapObjectSpace&&f.enable(5),U.normalMapTangentSpace&&f.enable(6),U.clearcoat&&f.enable(7),U.iridescence&&f.enable(8),U.alphaTest&&f.enable(9),U.vertexColors&&f.enable(10),U.vertexAlphas&&f.enable(11),U.vertexUv1s&&f.enable(12),U.vertexUv2s&&f.enable(13),U.vertexUv3s&&f.enable(14),U.vertexTangents&&f.enable(15),U.anisotropy&&f.enable(16),U.alphaHash&&f.enable(17),U.batching&&f.enable(18),U.dispersion&&f.enable(19),U.batchingColor&&f.enable(20),U.gradientMap&&f.enable(21),T.push(f.mask),f.disableAll(),U.fog&&f.enable(0),U.useFog&&f.enable(1),U.flatShading&&f.enable(2),U.logarithmicDepthBuffer&&f.enable(3),U.reversedDepthBuffer&&f.enable(4),U.skinning&&f.enable(5),U.morphTargets&&f.enable(6),U.morphNormals&&f.enable(7),U.morphColors&&f.enable(8),U.premultipliedAlpha&&f.enable(9),U.shadowMapEnabled&&f.enable(10),U.doubleSided&&f.enable(11),U.flipSided&&f.enable(12),U.useDepthPacking&&f.enable(13),U.dithering&&f.enable(14),U.transmission&&f.enable(15),U.sheen&&f.enable(16),U.opaque&&f.enable(17),U.pointsUvs&&f.enable(18),U.decodeVideoTexture&&f.enable(19),U.decodeVideoTextureEmissive&&f.enable(20),U.alphaToCoverage&&f.enable(21),T.push(f.mask)}function D(T){const U=M[T.type];let et;if(U){const H=ai[U];et=Qp.clone(H.uniforms)}else et=T.uniforms;return et}function C(T,U){let et=v.get(U);return et!==void 0?++et.usedTimes:(et=new m2(a,U,T,l),p.push(et),v.set(U,et)),et}function G(T){if(--T.usedTimes===0){const U=p.indexOf(T);p[U]=p[p.length-1],p.pop(),v.delete(T.cacheKey),T.destroy()}}function B(T){d.remove(T)}function F(){d.dispose()}return{getParameters:R,getProgramCacheKey:x,getUniforms:D,acquireProgram:C,releaseProgram:G,releaseShaderCache:B,programs:p,dispose:F}}function y2(){let a=new WeakMap;function t(f){return a.has(f)}function i(f){let d=a.get(f);return d===void 0&&(d={},a.set(f,d)),d}function s(f){a.delete(f)}function l(f,d,m){a.get(f)[d]=m}function c(){a=new WeakMap}return{has:t,get:i,remove:s,update:l,dispose:c}}function S2(a,t){return a.groupOrder!==t.groupOrder?a.groupOrder-t.groupOrder:a.renderOrder!==t.renderOrder?a.renderOrder-t.renderOrder:a.material.id!==t.material.id?a.material.id-t.material.id:a.materialVariant!==t.materialVariant?a.materialVariant-t.materialVariant:a.z!==t.z?a.z-t.z:a.id-t.id}function kv(a,t){return a.groupOrder!==t.groupOrder?a.groupOrder-t.groupOrder:a.renderOrder!==t.renderOrder?a.renderOrder-t.renderOrder:a.z!==t.z?t.z-a.z:a.id-t.id}function Xv(){const a=[];let t=0;const i=[],s=[],l=[];function c(){t=0,i.length=0,s.length=0,l.length=0}function f(g){let M=0;return g.isInstancedMesh&&(M+=2),g.isSkinnedMesh&&(M+=1),M}function d(g,M,E,R,x,y){let w=a[t];return w===void 0?(w={id:g.id,object:g,geometry:M,material:E,materialVariant:f(g),groupOrder:R,renderOrder:g.renderOrder,z:x,group:y},a[t]=w):(w.id=g.id,w.object=g,w.geometry=M,w.material=E,w.materialVariant=f(g),w.groupOrder=R,w.renderOrder=g.renderOrder,w.z=x,w.group=y),t++,w}function m(g,M,E,R,x,y){const w=d(g,M,E,R,x,y);E.transmission>0?s.push(w):E.transparent===!0?l.push(w):i.push(w)}function p(g,M,E,R,x,y){const w=d(g,M,E,R,x,y);E.transmission>0?s.unshift(w):E.transparent===!0?l.unshift(w):i.unshift(w)}function v(g,M){i.length>1&&i.sort(g||S2),s.length>1&&s.sort(M||kv),l.length>1&&l.sort(M||kv)}function _(){for(let g=t,M=a.length;g<M;g++){const E=a[g];if(E.id===null)break;E.id=null,E.object=null,E.geometry=null,E.material=null,E.group=null}}return{opaque:i,transmissive:s,transparent:l,init:c,push:m,unshift:p,finish:_,sort:v}}function M2(){let a=new WeakMap;function t(s,l){const c=a.get(s);let f;return c===void 0?(f=new Xv,a.set(s,[f])):l>=c.length?(f=new Xv,c.push(f)):f=c[l],f}function i(){a=new WeakMap}return{get:t,dispose:i}}function b2(){const a={};return{get:function(t){if(a[t.id]!==void 0)return a[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new Q,color:new Ee};break;case"SpotLight":i={position:new Q,direction:new Q,color:new Ee,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Q,color:new Ee,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Q,skyColor:new Ee,groundColor:new Ee};break;case"RectAreaLight":i={color:new Ee,position:new Q,halfWidth:new Q,halfHeight:new Q};break}return a[t.id]=i,i}}}function E2(){const a={};return{get:function(t){if(a[t.id]!==void 0)return a[t.id];let i;switch(t.type){case"DirectionalLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"SpotLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"PointLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e,shadowCameraNear:1,shadowCameraFar:1e3};break}return a[t.id]=i,i}}}let T2=0;function A2(a,t){return(t.castShadow?2:0)-(a.castShadow?2:0)+(t.map?1:0)-(a.map?1:0)}function R2(a){const t=new b2,i=E2(),s={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 p=0;p<9;p++)s.probe.push(new Q);const l=new Q,c=new nn,f=new nn;function d(p){let v=0,_=0,g=0;for(let U=0;U<9;U++)s.probe[U].set(0,0,0);let M=0,E=0,R=0,x=0,y=0,w=0,D=0,C=0,G=0,B=0,F=0;p.sort(A2);for(let U=0,et=p.length;U<et;U++){const H=p[U],q=H.color,nt=H.intensity,ot=H.distance;let Y=null;if(H.shadow&&H.shadow.map&&(H.shadow.map.texture.format===uo?Y=H.shadow.map.texture:Y=H.shadow.map.depthTexture||H.shadow.map.texture),H.isAmbientLight)v+=q.r*nt,_+=q.g*nt,g+=q.b*nt;else if(H.isLightProbe){for(let z=0;z<9;z++)s.probe[z].addScaledVector(H.sh.coefficients[z],nt);F++}else if(H.isDirectionalLight){const z=t.get(H);if(z.color.copy(H.color).multiplyScalar(H.intensity),H.castShadow){const A=H.shadow,ht=i.get(H);ht.shadowIntensity=A.intensity,ht.shadowBias=A.bias,ht.shadowNormalBias=A.normalBias,ht.shadowRadius=A.radius,ht.shadowMapSize=A.mapSize,s.directionalShadow[M]=ht,s.directionalShadowMap[M]=Y,s.directionalShadowMatrix[M]=H.shadow.matrix,w++}s.directional[M]=z,M++}else if(H.isSpotLight){const z=t.get(H);z.position.setFromMatrixPosition(H.matrixWorld),z.color.copy(q).multiplyScalar(nt),z.distance=ot,z.coneCos=Math.cos(H.angle),z.penumbraCos=Math.cos(H.angle*(1-H.penumbra)),z.decay=H.decay,s.spot[R]=z;const A=H.shadow;if(H.map&&(s.spotLightMap[G]=H.map,G++,A.updateMatrices(H),H.castShadow&&B++),s.spotLightMatrix[R]=A.matrix,H.castShadow){const ht=i.get(H);ht.shadowIntensity=A.intensity,ht.shadowBias=A.bias,ht.shadowNormalBias=A.normalBias,ht.shadowRadius=A.radius,ht.shadowMapSize=A.mapSize,s.spotShadow[R]=ht,s.spotShadowMap[R]=Y,C++}R++}else if(H.isRectAreaLight){const z=t.get(H);z.color.copy(q).multiplyScalar(nt),z.halfWidth.set(H.width*.5,0,0),z.halfHeight.set(0,H.height*.5,0),s.rectArea[x]=z,x++}else if(H.isPointLight){const z=t.get(H);if(z.color.copy(H.color).multiplyScalar(H.intensity),z.distance=H.distance,z.decay=H.decay,H.castShadow){const A=H.shadow,ht=i.get(H);ht.shadowIntensity=A.intensity,ht.shadowBias=A.bias,ht.shadowNormalBias=A.normalBias,ht.shadowRadius=A.radius,ht.shadowMapSize=A.mapSize,ht.shadowCameraNear=A.camera.near,ht.shadowCameraFar=A.camera.far,s.pointShadow[E]=ht,s.pointShadowMap[E]=Y,s.pointShadowMatrix[E]=H.shadow.matrix,D++}s.point[E]=z,E++}else if(H.isHemisphereLight){const z=t.get(H);z.skyColor.copy(H.color).multiplyScalar(nt),z.groundColor.copy(H.groundColor).multiplyScalar(nt),s.hemi[y]=z,y++}}x>0&&(a.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Gt.LTC_FLOAT_1,s.rectAreaLTC2=Gt.LTC_FLOAT_2):(s.rectAreaLTC1=Gt.LTC_HALF_1,s.rectAreaLTC2=Gt.LTC_HALF_2)),s.ambient[0]=v,s.ambient[1]=_,s.ambient[2]=g;const T=s.hash;(T.directionalLength!==M||T.pointLength!==E||T.spotLength!==R||T.rectAreaLength!==x||T.hemiLength!==y||T.numDirectionalShadows!==w||T.numPointShadows!==D||T.numSpotShadows!==C||T.numSpotMaps!==G||T.numLightProbes!==F)&&(s.directional.length=M,s.spot.length=R,s.rectArea.length=x,s.point.length=E,s.hemi.length=y,s.directionalShadow.length=w,s.directionalShadowMap.length=w,s.pointShadow.length=D,s.pointShadowMap.length=D,s.spotShadow.length=C,s.spotShadowMap.length=C,s.directionalShadowMatrix.length=w,s.pointShadowMatrix.length=D,s.spotLightMatrix.length=C+G-B,s.spotLightMap.length=G,s.numSpotLightShadowsWithMaps=B,s.numLightProbes=F,T.directionalLength=M,T.pointLength=E,T.spotLength=R,T.rectAreaLength=x,T.hemiLength=y,T.numDirectionalShadows=w,T.numPointShadows=D,T.numSpotShadows=C,T.numSpotMaps=G,T.numLightProbes=F,s.version=T2++)}function m(p,v){let _=0,g=0,M=0,E=0,R=0;const x=v.matrixWorldInverse;for(let y=0,w=p.length;y<w;y++){const D=p[y];if(D.isDirectionalLight){const C=s.directional[_];C.direction.setFromMatrixPosition(D.matrixWorld),l.setFromMatrixPosition(D.target.matrixWorld),C.direction.sub(l),C.direction.transformDirection(x),_++}else if(D.isSpotLight){const C=s.spot[M];C.position.setFromMatrixPosition(D.matrixWorld),C.position.applyMatrix4(x),C.direction.setFromMatrixPosition(D.matrixWorld),l.setFromMatrixPosition(D.target.matrixWorld),C.direction.sub(l),C.direction.transformDirection(x),M++}else if(D.isRectAreaLight){const C=s.rectArea[E];C.position.setFromMatrixPosition(D.matrixWorld),C.position.applyMatrix4(x),f.identity(),c.copy(D.matrixWorld),c.premultiply(x),f.extractRotation(c),C.halfWidth.set(D.width*.5,0,0),C.halfHeight.set(0,D.height*.5,0),C.halfWidth.applyMatrix4(f),C.halfHeight.applyMatrix4(f),E++}else if(D.isPointLight){const C=s.point[g];C.position.setFromMatrixPosition(D.matrixWorld),C.position.applyMatrix4(x),g++}else if(D.isHemisphereLight){const C=s.hemi[R];C.direction.setFromMatrixPosition(D.matrixWorld),C.direction.transformDirection(x),R++}}}return{setup:d,setupView:m,state:s}}function Wv(a){const t=new R2(a),i=[],s=[];function l(v){p.camera=v,i.length=0,s.length=0}function c(v){i.push(v)}function f(v){s.push(v)}function d(){t.setup(i)}function m(v){t.setupView(i,v)}const p={lightsArray:i,shadowsArray:s,camera:null,lights:t,transmissionRenderTarget:{}};return{init:l,state:p,setupLights:d,setupLightsView:m,pushLight:c,pushShadow:f}}function w2(a){let t=new WeakMap;function i(l,c=0){const f=t.get(l);let d;return f===void 0?(d=new Wv(a),t.set(l,[d])):c>=f.length?(d=new Wv(a),f.push(d)):d=f[c],d}function s(){t=new WeakMap}return{get:i,dispose:s}}const C2=`void main() {
|
|
4006
|
+
`+I)}else Y!==""?ue("WebGLProgram: Program Info Log:",Y):(z===""||A==="")&&(lt=!1);lt&&(H.diagnostics={runnable:ht,programLog:Y,vertexShader:{log:z,prefix:x},fragmentShader:{log:A,prefix:y}})}l.deleteShader(G),l.deleteShader(B),T=new Ru(l,R),U=e2(l,R)}let T;this.getUniforms=function(){return T===void 0&&F(this),T};let U;this.getAttributes=function(){return U===void 0&&F(this),U};let et=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return et===!1&&(et=l.getProgramParameter(R,WA)),et},this.destroy=function(){s.releaseStatesOfProgram(this),l.deleteProgram(R),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=qA++,this.cacheKey=t,this.usedTimes=1,this.program=R,this.vertexShader=G,this.fragmentShader=B,this}let _2=0;class v2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const i=t.vertexShader,s=t.fragmentShader,l=this._getShaderStage(i),c=this._getShaderStage(s),f=this._getShaderCacheForMaterial(t);return f.has(l)===!1&&(f.add(l),l.usedTimes++),f.has(c)===!1&&(f.add(c),c.usedTimes++),this}remove(t){const i=this.materialCache.get(t);for(const s of i)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const i=this.materialCache;let s=i.get(t);return s===void 0&&(s=new Set,i.set(t,s)),s}_getShaderStage(t){const i=this.shaderCache;let s=i.get(t);return s===void 0&&(s=new x2(t),i.set(t,s)),s}}class x2{constructor(t){this.id=_2++,this.code=t,this.usedTimes=0}}function y2(a,t,i,s,l,c){const f=new Dx,d=new v2,m=new Set,p=[],v=new Map,_=s.logarithmicDepthBuffer;let g=s.precision;const S={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function b(T){return m.add(T),T===0?"uv":`uv${T}`}function R(T,U,et,H,q){const nt=H.fog,ot=q.geometry,Y=T.isMeshStandardMaterial||T.isMeshLambertMaterial||T.isMeshPhongMaterial?H.environment:null,z=T.isMeshStandardMaterial||T.isMeshLambertMaterial&&!T.envMap||T.isMeshPhongMaterial&&!T.envMap,A=t.get(T.envMap||Y,z),ht=A&&A.mapping===Hu?A.image.height:null,lt=S[T.type];T.precision!==null&&(g=s.getMaxPrecision(T.precision),g!==T.precision&&ue("WebGLProgram.getParameters:",T.precision,"not supported, using",g,"instead."));const Ct=ot.morphAttributes.position||ot.morphAttributes.normal||ot.morphAttributes.color,I=Ct!==void 0?Ct.length:0;let K=0;ot.morphAttributes.position!==void 0&&(K=1),ot.morphAttributes.normal!==void 0&&(K=2),ot.morphAttributes.color!==void 0&&(K=3);let Mt,wt,Bt,st;if(lt){const De=ai[lt];Mt=De.vertexShader,wt=De.fragmentShader}else Mt=T.vertexShader,wt=T.fragmentShader,d.update(T),Bt=d.getVertexShaderID(T),st=d.getFragmentShaderID(T);const Et=a.getRenderTarget(),gt=a.state.buffers.depth.getReversed(),Ut=q.isInstancedMesh===!0,tt=q.isBatchedMesh===!0,ct=!!T.map,qt=!!T.matcap,Xt=!!A,oe=!!T.aoMap,de=!!T.lightMap,Yt=!!T.bumpMap,se=!!T.normalMap,X=!!T.displacementMap,ce=!!T.emissiveMap,Jt=!!T.metalnessMap,ne=!!T.roughnessMap,Pt=T.anisotropy>0,O=T.clearcoat>0,E=T.dispersion>0,V=T.iridescence>0,$=T.sheen>0,k=T.transmission>0,P=Pt&&!!T.anisotropyMap,it=O&&!!T.clearcoatMap,rt=O&&!!T.clearcoatNormalMap,_t=O&&!!T.clearcoatRoughnessMap,At=V&&!!T.iridescenceMap,xt=V&&!!T.iridescenceThicknessMap,St=$&&!!T.sheenColorMap,Nt=$&&!!T.sheenRoughnessMap,Lt=!!T.specularMap,It=!!T.specularColorMap,$t=!!T.specularIntensityMap,j=k&&!!T.transmissionMap,zt=k&&!!T.thicknessMap,Ft=!!T.gradientMap,kt=!!T.alphaMap,Ot=T.alphaTest>0,bt=!!T.alphaHash,jt=!!T.extensions;let he=ra;T.toneMapped&&(Et===null||Et.isXRRenderTarget===!0)&&(he=a.toneMapping);const Ie={shaderID:lt,shaderType:T.type,shaderName:T.name,vertexShader:Mt,fragmentShader:wt,defines:T.defines,customVertexShaderID:Bt,customFragmentShaderID:st,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:g,batching:tt,batchingColor:tt&&q._colorsTexture!==null,instancing:Ut,instancingColor:Ut&&q.instanceColor!==null,instancingMorph:Ut&&q.morphTexture!==null,outputColorSpace:Et===null?a.outputColorSpace:Et.isXRRenderTarget===!0?Et.texture.colorSpace:fo,alphaToCoverage:!!T.alphaToCoverage,map:ct,matcap:qt,envMap:Xt,envMapMode:Xt&&A.mapping,envMapCubeUVHeight:ht,aoMap:oe,lightMap:de,bumpMap:Yt,normalMap:se,displacementMap:X,emissiveMap:ce,normalMapObjectSpace:se&&T.normalMapType===FM,normalMapTangentSpace:se&&T.normalMapType===Ax,metalnessMap:Jt,roughnessMap:ne,anisotropy:Pt,anisotropyMap:P,clearcoat:O,clearcoatMap:it,clearcoatNormalMap:rt,clearcoatRoughnessMap:_t,dispersion:E,iridescence:V,iridescenceMap:At,iridescenceThicknessMap:xt,sheen:$,sheenColorMap:St,sheenRoughnessMap:Nt,specularMap:Lt,specularColorMap:It,specularIntensityMap:$t,transmission:k,transmissionMap:j,thicknessMap:zt,gradientMap:Ft,opaque:T.transparent===!1&&T.blending===so&&T.alphaToCoverage===!1,alphaMap:kt,alphaTest:Ot,alphaHash:bt,combine:T.combine,mapUv:ct&&b(T.map.channel),aoMapUv:oe&&b(T.aoMap.channel),lightMapUv:de&&b(T.lightMap.channel),bumpMapUv:Yt&&b(T.bumpMap.channel),normalMapUv:se&&b(T.normalMap.channel),displacementMapUv:X&&b(T.displacementMap.channel),emissiveMapUv:ce&&b(T.emissiveMap.channel),metalnessMapUv:Jt&&b(T.metalnessMap.channel),roughnessMapUv:ne&&b(T.roughnessMap.channel),anisotropyMapUv:P&&b(T.anisotropyMap.channel),clearcoatMapUv:it&&b(T.clearcoatMap.channel),clearcoatNormalMapUv:rt&&b(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:_t&&b(T.clearcoatRoughnessMap.channel),iridescenceMapUv:At&&b(T.iridescenceMap.channel),iridescenceThicknessMapUv:xt&&b(T.iridescenceThicknessMap.channel),sheenColorMapUv:St&&b(T.sheenColorMap.channel),sheenRoughnessMapUv:Nt&&b(T.sheenRoughnessMap.channel),specularMapUv:Lt&&b(T.specularMap.channel),specularColorMapUv:It&&b(T.specularColorMap.channel),specularIntensityMapUv:$t&&b(T.specularIntensityMap.channel),transmissionMapUv:j&&b(T.transmissionMap.channel),thicknessMapUv:zt&&b(T.thicknessMap.channel),alphaMapUv:kt&&b(T.alphaMap.channel),vertexTangents:!!ot.attributes.tangent&&(se||Pt),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!ot.attributes.color&&ot.attributes.color.itemSize===4,pointsUvs:q.isPoints===!0&&!!ot.attributes.uv&&(ct||kt),fog:!!nt,useFog:T.fog===!0,fogExp2:!!nt&&nt.isFogExp2,flatShading:T.wireframe===!1&&(T.flatShading===!0||ot.attributes.normal===void 0&&se===!1&&(T.isMeshLambertMaterial||T.isMeshPhongMaterial||T.isMeshStandardMaterial||T.isMeshPhysicalMaterial)),sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:_,reversedDepthBuffer:gt,skinning:q.isSkinnedMesh===!0,morphTargets:ot.morphAttributes.position!==void 0,morphNormals:ot.morphAttributes.normal!==void 0,morphColors:ot.morphAttributes.color!==void 0,morphTargetsCount:I,morphTextureStride:K,numDirLights:U.directional.length,numPointLights:U.point.length,numSpotLights:U.spot.length,numSpotLightMaps:U.spotLightMap.length,numRectAreaLights:U.rectArea.length,numHemiLights:U.hemi.length,numDirLightShadows:U.directionalShadowMap.length,numPointLightShadows:U.pointShadowMap.length,numSpotLightShadows:U.spotShadowMap.length,numSpotLightShadowsWithMaps:U.numSpotLightShadowsWithMaps,numLightProbes:U.numLightProbes,numClippingPlanes:c.numPlanes,numClipIntersection:c.numIntersection,dithering:T.dithering,shadowMapEnabled:a.shadowMap.enabled&&et.length>0,shadowMapType:a.shadowMap.type,toneMapping:he,decodeVideoTexture:ct&&T.map.isVideoTexture===!0&&Ue.getTransfer(T.map.colorSpace)===Ge,decodeVideoTextureEmissive:ce&&T.emissiveMap.isVideoTexture===!0&&Ue.getTransfer(T.emissiveMap.colorSpace)===Ge,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===ki,flipSided:T.side===si,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionClipCullDistance:jt&&T.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(jt&&T.extensions.multiDraw===!0||tt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()};return Ie.vertexUv1s=m.has(1),Ie.vertexUv2s=m.has(2),Ie.vertexUv3s=m.has(3),m.clear(),Ie}function x(T){const U=[];if(T.shaderID?U.push(T.shaderID):(U.push(T.customVertexShaderID),U.push(T.customFragmentShaderID)),T.defines!==void 0)for(const et in T.defines)U.push(et),U.push(T.defines[et]);return T.isRawShaderMaterial===!1&&(y(U,T),w(U,T),U.push(a.outputColorSpace)),U.push(T.customProgramCacheKey),U.join()}function y(T,U){T.push(U.precision),T.push(U.outputColorSpace),T.push(U.envMapMode),T.push(U.envMapCubeUVHeight),T.push(U.mapUv),T.push(U.alphaMapUv),T.push(U.lightMapUv),T.push(U.aoMapUv),T.push(U.bumpMapUv),T.push(U.normalMapUv),T.push(U.displacementMapUv),T.push(U.emissiveMapUv),T.push(U.metalnessMapUv),T.push(U.roughnessMapUv),T.push(U.anisotropyMapUv),T.push(U.clearcoatMapUv),T.push(U.clearcoatNormalMapUv),T.push(U.clearcoatRoughnessMapUv),T.push(U.iridescenceMapUv),T.push(U.iridescenceThicknessMapUv),T.push(U.sheenColorMapUv),T.push(U.sheenRoughnessMapUv),T.push(U.specularMapUv),T.push(U.specularColorMapUv),T.push(U.specularIntensityMapUv),T.push(U.transmissionMapUv),T.push(U.thicknessMapUv),T.push(U.combine),T.push(U.fogExp2),T.push(U.sizeAttenuation),T.push(U.morphTargetsCount),T.push(U.morphAttributeCount),T.push(U.numDirLights),T.push(U.numPointLights),T.push(U.numSpotLights),T.push(U.numSpotLightMaps),T.push(U.numHemiLights),T.push(U.numRectAreaLights),T.push(U.numDirLightShadows),T.push(U.numPointLightShadows),T.push(U.numSpotLightShadows),T.push(U.numSpotLightShadowsWithMaps),T.push(U.numLightProbes),T.push(U.shadowMapType),T.push(U.toneMapping),T.push(U.numClippingPlanes),T.push(U.numClipIntersection),T.push(U.depthPacking)}function w(T,U){f.disableAll(),U.instancing&&f.enable(0),U.instancingColor&&f.enable(1),U.instancingMorph&&f.enable(2),U.matcap&&f.enable(3),U.envMap&&f.enable(4),U.normalMapObjectSpace&&f.enable(5),U.normalMapTangentSpace&&f.enable(6),U.clearcoat&&f.enable(7),U.iridescence&&f.enable(8),U.alphaTest&&f.enable(9),U.vertexColors&&f.enable(10),U.vertexAlphas&&f.enable(11),U.vertexUv1s&&f.enable(12),U.vertexUv2s&&f.enable(13),U.vertexUv3s&&f.enable(14),U.vertexTangents&&f.enable(15),U.anisotropy&&f.enable(16),U.alphaHash&&f.enable(17),U.batching&&f.enable(18),U.dispersion&&f.enable(19),U.batchingColor&&f.enable(20),U.gradientMap&&f.enable(21),T.push(f.mask),f.disableAll(),U.fog&&f.enable(0),U.useFog&&f.enable(1),U.flatShading&&f.enable(2),U.logarithmicDepthBuffer&&f.enable(3),U.reversedDepthBuffer&&f.enable(4),U.skinning&&f.enable(5),U.morphTargets&&f.enable(6),U.morphNormals&&f.enable(7),U.morphColors&&f.enable(8),U.premultipliedAlpha&&f.enable(9),U.shadowMapEnabled&&f.enable(10),U.doubleSided&&f.enable(11),U.flipSided&&f.enable(12),U.useDepthPacking&&f.enable(13),U.dithering&&f.enable(14),U.transmission&&f.enable(15),U.sheen&&f.enable(16),U.opaque&&f.enable(17),U.pointsUvs&&f.enable(18),U.decodeVideoTexture&&f.enable(19),U.decodeVideoTextureEmissive&&f.enable(20),U.alphaToCoverage&&f.enable(21),T.push(f.mask)}function D(T){const U=S[T.type];let et;if(U){const H=ai[U];et=Qp.clone(H.uniforms)}else et=T.uniforms;return et}function C(T,U){let et=v.get(U);return et!==void 0?++et.usedTimes:(et=new g2(a,U,T,l),p.push(et),v.set(U,et)),et}function G(T){if(--T.usedTimes===0){const U=p.indexOf(T);p[U]=p[p.length-1],p.pop(),v.delete(T.cacheKey),T.destroy()}}function B(T){d.remove(T)}function F(){d.dispose()}return{getParameters:R,getProgramCacheKey:x,getUniforms:D,acquireProgram:C,releaseProgram:G,releaseShaderCache:B,programs:p,dispose:F}}function S2(){let a=new WeakMap;function t(f){return a.has(f)}function i(f){let d=a.get(f);return d===void 0&&(d={},a.set(f,d)),d}function s(f){a.delete(f)}function l(f,d,m){a.get(f)[d]=m}function c(){a=new WeakMap}return{has:t,get:i,remove:s,update:l,dispose:c}}function M2(a,t){return a.groupOrder!==t.groupOrder?a.groupOrder-t.groupOrder:a.renderOrder!==t.renderOrder?a.renderOrder-t.renderOrder:a.material.id!==t.material.id?a.material.id-t.material.id:a.materialVariant!==t.materialVariant?a.materialVariant-t.materialVariant:a.z!==t.z?a.z-t.z:a.id-t.id}function kv(a,t){return a.groupOrder!==t.groupOrder?a.groupOrder-t.groupOrder:a.renderOrder!==t.renderOrder?a.renderOrder-t.renderOrder:a.z!==t.z?t.z-a.z:a.id-t.id}function Xv(){const a=[];let t=0;const i=[],s=[],l=[];function c(){t=0,i.length=0,s.length=0,l.length=0}function f(g){let S=0;return g.isInstancedMesh&&(S+=2),g.isSkinnedMesh&&(S+=1),S}function d(g,S,b,R,x,y){let w=a[t];return w===void 0?(w={id:g.id,object:g,geometry:S,material:b,materialVariant:f(g),groupOrder:R,renderOrder:g.renderOrder,z:x,group:y},a[t]=w):(w.id=g.id,w.object=g,w.geometry=S,w.material=b,w.materialVariant=f(g),w.groupOrder=R,w.renderOrder=g.renderOrder,w.z=x,w.group=y),t++,w}function m(g,S,b,R,x,y){const w=d(g,S,b,R,x,y);b.transmission>0?s.push(w):b.transparent===!0?l.push(w):i.push(w)}function p(g,S,b,R,x,y){const w=d(g,S,b,R,x,y);b.transmission>0?s.unshift(w):b.transparent===!0?l.unshift(w):i.unshift(w)}function v(g,S){i.length>1&&i.sort(g||M2),s.length>1&&s.sort(S||kv),l.length>1&&l.sort(S||kv)}function _(){for(let g=t,S=a.length;g<S;g++){const b=a[g];if(b.id===null)break;b.id=null,b.object=null,b.geometry=null,b.material=null,b.group=null}}return{opaque:i,transmissive:s,transparent:l,init:c,push:m,unshift:p,finish:_,sort:v}}function b2(){let a=new WeakMap;function t(s,l){const c=a.get(s);let f;return c===void 0?(f=new Xv,a.set(s,[f])):l>=c.length?(f=new Xv,c.push(f)):f=c[l],f}function i(){a=new WeakMap}return{get:t,dispose:i}}function E2(){const a={};return{get:function(t){if(a[t.id]!==void 0)return a[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new Q,color:new Ee};break;case"SpotLight":i={position:new Q,direction:new Q,color:new Ee,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Q,color:new Ee,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Q,skyColor:new Ee,groundColor:new Ee};break;case"RectAreaLight":i={color:new Ee,position:new Q,halfWidth:new Q,halfHeight:new Q};break}return a[t.id]=i,i}}}function T2(){const a={};return{get:function(t){if(a[t.id]!==void 0)return a[t.id];let i;switch(t.type){case"DirectionalLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"SpotLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"PointLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e,shadowCameraNear:1,shadowCameraFar:1e3};break}return a[t.id]=i,i}}}let A2=0;function R2(a,t){return(t.castShadow?2:0)-(a.castShadow?2:0)+(t.map?1:0)-(a.map?1:0)}function w2(a){const t=new E2,i=T2(),s={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 p=0;p<9;p++)s.probe.push(new Q);const l=new Q,c=new nn,f=new nn;function d(p){let v=0,_=0,g=0;for(let U=0;U<9;U++)s.probe[U].set(0,0,0);let S=0,b=0,R=0,x=0,y=0,w=0,D=0,C=0,G=0,B=0,F=0;p.sort(R2);for(let U=0,et=p.length;U<et;U++){const H=p[U],q=H.color,nt=H.intensity,ot=H.distance;let Y=null;if(H.shadow&&H.shadow.map&&(H.shadow.map.texture.format===uo?Y=H.shadow.map.texture:Y=H.shadow.map.depthTexture||H.shadow.map.texture),H.isAmbientLight)v+=q.r*nt,_+=q.g*nt,g+=q.b*nt;else if(H.isLightProbe){for(let z=0;z<9;z++)s.probe[z].addScaledVector(H.sh.coefficients[z],nt);F++}else if(H.isDirectionalLight){const z=t.get(H);if(z.color.copy(H.color).multiplyScalar(H.intensity),H.castShadow){const A=H.shadow,ht=i.get(H);ht.shadowIntensity=A.intensity,ht.shadowBias=A.bias,ht.shadowNormalBias=A.normalBias,ht.shadowRadius=A.radius,ht.shadowMapSize=A.mapSize,s.directionalShadow[S]=ht,s.directionalShadowMap[S]=Y,s.directionalShadowMatrix[S]=H.shadow.matrix,w++}s.directional[S]=z,S++}else if(H.isSpotLight){const z=t.get(H);z.position.setFromMatrixPosition(H.matrixWorld),z.color.copy(q).multiplyScalar(nt),z.distance=ot,z.coneCos=Math.cos(H.angle),z.penumbraCos=Math.cos(H.angle*(1-H.penumbra)),z.decay=H.decay,s.spot[R]=z;const A=H.shadow;if(H.map&&(s.spotLightMap[G]=H.map,G++,A.updateMatrices(H),H.castShadow&&B++),s.spotLightMatrix[R]=A.matrix,H.castShadow){const ht=i.get(H);ht.shadowIntensity=A.intensity,ht.shadowBias=A.bias,ht.shadowNormalBias=A.normalBias,ht.shadowRadius=A.radius,ht.shadowMapSize=A.mapSize,s.spotShadow[R]=ht,s.spotShadowMap[R]=Y,C++}R++}else if(H.isRectAreaLight){const z=t.get(H);z.color.copy(q).multiplyScalar(nt),z.halfWidth.set(H.width*.5,0,0),z.halfHeight.set(0,H.height*.5,0),s.rectArea[x]=z,x++}else if(H.isPointLight){const z=t.get(H);if(z.color.copy(H.color).multiplyScalar(H.intensity),z.distance=H.distance,z.decay=H.decay,H.castShadow){const A=H.shadow,ht=i.get(H);ht.shadowIntensity=A.intensity,ht.shadowBias=A.bias,ht.shadowNormalBias=A.normalBias,ht.shadowRadius=A.radius,ht.shadowMapSize=A.mapSize,ht.shadowCameraNear=A.camera.near,ht.shadowCameraFar=A.camera.far,s.pointShadow[b]=ht,s.pointShadowMap[b]=Y,s.pointShadowMatrix[b]=H.shadow.matrix,D++}s.point[b]=z,b++}else if(H.isHemisphereLight){const z=t.get(H);z.skyColor.copy(H.color).multiplyScalar(nt),z.groundColor.copy(H.groundColor).multiplyScalar(nt),s.hemi[y]=z,y++}}x>0&&(a.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Gt.LTC_FLOAT_1,s.rectAreaLTC2=Gt.LTC_FLOAT_2):(s.rectAreaLTC1=Gt.LTC_HALF_1,s.rectAreaLTC2=Gt.LTC_HALF_2)),s.ambient[0]=v,s.ambient[1]=_,s.ambient[2]=g;const T=s.hash;(T.directionalLength!==S||T.pointLength!==b||T.spotLength!==R||T.rectAreaLength!==x||T.hemiLength!==y||T.numDirectionalShadows!==w||T.numPointShadows!==D||T.numSpotShadows!==C||T.numSpotMaps!==G||T.numLightProbes!==F)&&(s.directional.length=S,s.spot.length=R,s.rectArea.length=x,s.point.length=b,s.hemi.length=y,s.directionalShadow.length=w,s.directionalShadowMap.length=w,s.pointShadow.length=D,s.pointShadowMap.length=D,s.spotShadow.length=C,s.spotShadowMap.length=C,s.directionalShadowMatrix.length=w,s.pointShadowMatrix.length=D,s.spotLightMatrix.length=C+G-B,s.spotLightMap.length=G,s.numSpotLightShadowsWithMaps=B,s.numLightProbes=F,T.directionalLength=S,T.pointLength=b,T.spotLength=R,T.rectAreaLength=x,T.hemiLength=y,T.numDirectionalShadows=w,T.numPointShadows=D,T.numSpotShadows=C,T.numSpotMaps=G,T.numLightProbes=F,s.version=A2++)}function m(p,v){let _=0,g=0,S=0,b=0,R=0;const x=v.matrixWorldInverse;for(let y=0,w=p.length;y<w;y++){const D=p[y];if(D.isDirectionalLight){const C=s.directional[_];C.direction.setFromMatrixPosition(D.matrixWorld),l.setFromMatrixPosition(D.target.matrixWorld),C.direction.sub(l),C.direction.transformDirection(x),_++}else if(D.isSpotLight){const C=s.spot[S];C.position.setFromMatrixPosition(D.matrixWorld),C.position.applyMatrix4(x),C.direction.setFromMatrixPosition(D.matrixWorld),l.setFromMatrixPosition(D.target.matrixWorld),C.direction.sub(l),C.direction.transformDirection(x),S++}else if(D.isRectAreaLight){const C=s.rectArea[b];C.position.setFromMatrixPosition(D.matrixWorld),C.position.applyMatrix4(x),f.identity(),c.copy(D.matrixWorld),c.premultiply(x),f.extractRotation(c),C.halfWidth.set(D.width*.5,0,0),C.halfHeight.set(0,D.height*.5,0),C.halfWidth.applyMatrix4(f),C.halfHeight.applyMatrix4(f),b++}else if(D.isPointLight){const C=s.point[g];C.position.setFromMatrixPosition(D.matrixWorld),C.position.applyMatrix4(x),g++}else if(D.isHemisphereLight){const C=s.hemi[R];C.direction.setFromMatrixPosition(D.matrixWorld),C.direction.transformDirection(x),R++}}}return{setup:d,setupView:m,state:s}}function Wv(a){const t=new w2(a),i=[],s=[];function l(v){p.camera=v,i.length=0,s.length=0}function c(v){i.push(v)}function f(v){s.push(v)}function d(){t.setup(i)}function m(v){t.setupView(i,v)}const p={lightsArray:i,shadowsArray:s,camera:null,lights:t,transmissionRenderTarget:{}};return{init:l,state:p,setupLights:d,setupLightsView:m,pushLight:c,pushShadow:f}}function C2(a){let t=new WeakMap;function i(l,c=0){const f=t.get(l);let d;return f===void 0?(d=new Wv(a),t.set(l,[d])):c>=f.length?(d=new Wv(a),f.push(d)):d=f[c],d}function s(){t=new WeakMap}return{get:i,dispose:s}}const D2=`void main() {
|
|
4007
4007
|
gl_Position = vec4( position, 1.0 );
|
|
4008
|
-
}`,
|
|
4008
|
+
}`,U2=`uniform sampler2D shadow_pass;
|
|
4009
4009
|
uniform vec2 resolution;
|
|
4010
4010
|
uniform float radius;
|
|
4011
4011
|
void main() {
|
|
@@ -4030,12 +4030,12 @@ void main() {
|
|
|
4030
4030
|
squared_mean = squared_mean / samples;
|
|
4031
4031
|
float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );
|
|
4032
4032
|
gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );
|
|
4033
|
-
}`,U2=[new Q(1,0,0),new Q(-1,0,0),new Q(0,1,0),new Q(0,-1,0),new Q(0,0,1),new Q(0,0,-1)],L2=[new Q(0,-1,0),new Q(0,-1,0),new Q(0,0,1),new Q(0,0,-1),new Q(0,-1,0),new Q(0,-1,0)],qv=new nn,ml=new Q,zd=new Q;function N2(a,t,i){let s=new Kp;const l=new _e,c=new _e,f=new je,d=new Bb,m=new Hb,p={},v=i.maxTextureSize,_={[Es]:si,[si]:Es,[ki]:ki},g=new qi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _e},radius:{value:4}},vertexShader:C2,fragmentShader:D2}),M=g.clone();M.defines.HORIZONTAL_PASS=1;const E=new Mn;E.setAttribute("position",new xi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const R=new Gn(E,g),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Mu;let y=this.type;this.render=function(B,F,T){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||B.length===0)return;this.type===dM&&(ue("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Mu);const U=a.getRenderTarget(),et=a.getActiveCubeFace(),H=a.getActiveMipmapLevel(),q=a.state;q.setBlending(Pa),q.buffers.depth.getReversed()===!0?q.buffers.color.setClear(0,0,0,0):q.buffers.color.setClear(1,1,1,1),q.buffers.depth.setTest(!0),q.setScissorTest(!1);const nt=y!==this.type;nt&&F.traverse(function(ot){ot.material&&(Array.isArray(ot.material)?ot.material.forEach(Y=>Y.needsUpdate=!0):ot.material.needsUpdate=!0)});for(let ot=0,Y=B.length;ot<Y;ot++){const z=B[ot],A=z.shadow;if(A===void 0){ue("WebGLShadowMap:",z,"has no shadow.");continue}if(A.autoUpdate===!1&&A.needsUpdate===!1)continue;l.copy(A.mapSize);const ht=A.getFrameExtents();l.multiply(ht),c.copy(A.mapSize),(l.x>v||l.y>v)&&(l.x>v&&(c.x=Math.floor(v/ht.x),l.x=c.x*ht.x,A.mapSize.x=c.x),l.y>v&&(c.y=Math.floor(v/ht.y),l.y=c.y*ht.y,A.mapSize.y=c.y));const lt=a.state.buffers.depth.getReversed();if(A.camera._reversedDepth=lt,A.map===null||nt===!0){if(A.map!==null&&(A.map.depthTexture!==null&&(A.map.depthTexture.dispose(),A.map.depthTexture=null),A.map.dispose()),this.type===gl){if(z.isPointLight){ue("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}A.map=new oa(l.x,l.y,{format:uo,type:Ia,minFilter:Vn,magFilter:Vn,generateMipmaps:!1}),A.map.texture.name=z.name+".shadowMap",A.map.depthTexture=new bl(l.x,l.y,ia),A.map.depthTexture.name=z.name+".shadowMapDepth",A.map.depthTexture.format=Ba,A.map.depthTexture.compareFunction=null,A.map.depthTexture.minFilter=Pn,A.map.depthTexture.magFilter=Pn}else z.isPointLight?(A.map=new Bx(l.x),A.map.depthTexture=new Nb(l.x,la)):(A.map=new oa(l.x,l.y),A.map.depthTexture=new bl(l.x,l.y,la)),A.map.depthTexture.name=z.name+".shadowMap",A.map.depthTexture.format=Ba,this.type===Mu?(A.map.depthTexture.compareFunction=lt?qp:Wp,A.map.depthTexture.minFilter=Vn,A.map.depthTexture.magFilter=Vn):(A.map.depthTexture.compareFunction=null,A.map.depthTexture.minFilter=Pn,A.map.depthTexture.magFilter=Pn);A.camera.updateProjectionMatrix()}const Ct=A.map.isWebGLCubeRenderTarget?6:1;for(let I=0;I<Ct;I++){if(A.map.isWebGLCubeRenderTarget)a.setRenderTarget(A.map,I),a.clear();else{I===0&&(a.setRenderTarget(A.map),a.clear());const K=A.getViewport(I);f.set(c.x*K.x,c.y*K.y,c.x*K.z,c.y*K.w),q.viewport(f)}if(z.isPointLight){const K=A.camera,Mt=A.matrix,wt=z.distance||K.far;wt!==K.far&&(K.far=wt,K.updateProjectionMatrix()),ml.setFromMatrixPosition(z.matrixWorld),K.position.copy(ml),zd.copy(K.position),zd.add(U2[I]),K.up.copy(L2[I]),K.lookAt(zd),K.updateMatrixWorld(),Mt.makeTranslation(-ml.x,-ml.y,-ml.z),qv.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse),A._frustum.setFromProjectionMatrix(qv,K.coordinateSystem,K.reversedDepth)}else A.updateMatrices(z);s=A.getFrustum(),C(F,T,A.camera,z,this.type)}A.isPointLightShadow!==!0&&this.type===gl&&w(A,T),A.needsUpdate=!1}y=this.type,x.needsUpdate=!1,a.setRenderTarget(U,et,H)};function w(B,F){const T=t.update(R);g.defines.VSM_SAMPLES!==B.blurSamples&&(g.defines.VSM_SAMPLES=B.blurSamples,M.defines.VSM_SAMPLES=B.blurSamples,g.needsUpdate=!0,M.needsUpdate=!0),B.mapPass===null&&(B.mapPass=new oa(l.x,l.y,{format:uo,type:Ia})),g.uniforms.shadow_pass.value=B.map.depthTexture,g.uniforms.resolution.value=B.mapSize,g.uniforms.radius.value=B.radius,a.setRenderTarget(B.mapPass),a.clear(),a.renderBufferDirect(F,null,T,g,R,null),M.uniforms.shadow_pass.value=B.mapPass.texture,M.uniforms.resolution.value=B.mapSize,M.uniforms.radius.value=B.radius,a.setRenderTarget(B.map),a.clear(),a.renderBufferDirect(F,null,T,M,R,null)}function D(B,F,T,U){let et=null;const H=T.isPointLight===!0?B.customDistanceMaterial:B.customDepthMaterial;if(H!==void 0)et=H;else if(et=T.isPointLight===!0?m:d,a.localClippingEnabled&&F.clipShadows===!0&&Array.isArray(F.clippingPlanes)&&F.clippingPlanes.length!==0||F.displacementMap&&F.displacementScale!==0||F.alphaMap&&F.alphaTest>0||F.map&&F.alphaTest>0||F.alphaToCoverage===!0){const q=et.uuid,nt=F.uuid;let ot=p[q];ot===void 0&&(ot={},p[q]=ot);let Y=ot[nt];Y===void 0&&(Y=et.clone(),ot[nt]=Y,F.addEventListener("dispose",G)),et=Y}if(et.visible=F.visible,et.wireframe=F.wireframe,U===gl?et.side=F.shadowSide!==null?F.shadowSide:F.side:et.side=F.shadowSide!==null?F.shadowSide:_[F.side],et.alphaMap=F.alphaMap,et.alphaTest=F.alphaToCoverage===!0?.5:F.alphaTest,et.map=F.map,et.clipShadows=F.clipShadows,et.clippingPlanes=F.clippingPlanes,et.clipIntersection=F.clipIntersection,et.displacementMap=F.displacementMap,et.displacementScale=F.displacementScale,et.displacementBias=F.displacementBias,et.wireframeLinewidth=F.wireframeLinewidth,et.linewidth=F.linewidth,T.isPointLight===!0&&et.isMeshDistanceMaterial===!0){const q=a.properties.get(et);q.light=T}return et}function C(B,F,T,U,et){if(B.visible===!1)return;if(B.layers.test(F.layers)&&(B.isMesh||B.isLine||B.isPoints)&&(B.castShadow||B.receiveShadow&&et===gl)&&(!B.frustumCulled||s.intersectsObject(B))){B.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,B.matrixWorld);const nt=t.update(B),ot=B.material;if(Array.isArray(ot)){const Y=nt.groups;for(let z=0,A=Y.length;z<A;z++){const ht=Y[z],lt=ot[ht.materialIndex];if(lt&<.visible){const Ct=D(B,lt,U,et);B.onBeforeShadow(a,B,F,T,nt,Ct,ht),a.renderBufferDirect(T,null,nt,Ct,B,ht),B.onAfterShadow(a,B,F,T,nt,Ct,ht)}}}else if(ot.visible){const Y=D(B,ot,U,et);B.onBeforeShadow(a,B,F,T,nt,Y,null),a.renderBufferDirect(T,null,nt,Y,B,null),B.onAfterShadow(a,B,F,T,nt,Y,null)}}const q=B.children;for(let nt=0,ot=q.length;nt<ot;nt++)C(q[nt],F,T,U,et)}function G(B){B.target.removeEventListener("dispose",G);for(const T in p){const U=p[T],et=B.target.uuid;et in U&&(U[et].dispose(),delete U[et])}}}function O2(a,t){function i(){let j=!1;const zt=new je;let Ft=null;const kt=new je(0,0,0,0);return{setMask:function(Ot){Ft!==Ot&&!j&&(a.colorMask(Ot,Ot,Ot,Ot),Ft=Ot)},setLocked:function(Ot){j=Ot},setClear:function(Ot,bt,jt,he,Ie){Ie===!0&&(Ot*=he,bt*=he,jt*=he),zt.set(Ot,bt,jt,he),kt.equals(zt)===!1&&(a.clearColor(Ot,bt,jt,he),kt.copy(zt))},reset:function(){j=!1,Ft=null,kt.set(-1,0,0,0)}}}function s(){let j=!1,zt=!1,Ft=null,kt=null,Ot=null;return{setReversed:function(bt){if(zt!==bt){const jt=t.get("EXT_clip_control");bt?jt.clipControlEXT(jt.LOWER_LEFT_EXT,jt.ZERO_TO_ONE_EXT):jt.clipControlEXT(jt.LOWER_LEFT_EXT,jt.NEGATIVE_ONE_TO_ONE_EXT),zt=bt;const he=Ot;Ot=null,this.setClear(he)}},getReversed:function(){return zt},setTest:function(bt){bt?Et(a.DEPTH_TEST):gt(a.DEPTH_TEST)},setMask:function(bt){Ft!==bt&&!j&&(a.depthMask(bt),Ft=bt)},setFunc:function(bt){if(zt&&(bt=qM[bt]),kt!==bt){switch(bt){case kd:a.depthFunc(a.NEVER);break;case Xd:a.depthFunc(a.ALWAYS);break;case Wd:a.depthFunc(a.LESS);break;case lo:a.depthFunc(a.LEQUAL);break;case qd:a.depthFunc(a.EQUAL);break;case Yd:a.depthFunc(a.GEQUAL);break;case jd:a.depthFunc(a.GREATER);break;case Zd:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}kt=bt}},setLocked:function(bt){j=bt},setClear:function(bt){Ot!==bt&&(Ot=bt,zt&&(bt=1-bt),a.clearDepth(bt))},reset:function(){j=!1,Ft=null,kt=null,Ot=null,zt=!1}}}function l(){let j=!1,zt=null,Ft=null,kt=null,Ot=null,bt=null,jt=null,he=null,Ie=null;return{setTest:function(De){j||(De?Et(a.STENCIL_TEST):gt(a.STENCIL_TEST))},setMask:function(De){zt!==De&&!j&&(a.stencilMask(De),zt=De)},setFunc:function(De,kn,Ui){(Ft!==De||kt!==kn||Ot!==Ui)&&(a.stencilFunc(De,kn,Ui),Ft=De,kt=kn,Ot=Ui)},setOp:function(De,kn,Ui){(bt!==De||jt!==kn||he!==Ui)&&(a.stencilOp(De,kn,Ui),bt=De,jt=kn,he=Ui)},setLocked:function(De){j=De},setClear:function(De){Ie!==De&&(a.clearStencil(De),Ie=De)},reset:function(){j=!1,zt=null,Ft=null,kt=null,Ot=null,bt=null,jt=null,he=null,Ie=null}}}const c=new i,f=new s,d=new l,m=new WeakMap,p=new WeakMap;let v={},_={},g=new WeakMap,M=[],E=null,R=!1,x=null,y=null,w=null,D=null,C=null,G=null,B=null,F=new Ee(0,0,0),T=0,U=!1,et=null,H=null,q=null,nt=null,ot=null;const Y=a.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let z=!1,A=0;const ht=a.getParameter(a.VERSION);ht.indexOf("WebGL")!==-1?(A=parseFloat(/^WebGL (\d)/.exec(ht)[1]),z=A>=1):ht.indexOf("OpenGL ES")!==-1&&(A=parseFloat(/^OpenGL ES (\d)/.exec(ht)[1]),z=A>=2);let lt=null,Ct={};const I=a.getParameter(a.SCISSOR_BOX),K=a.getParameter(a.VIEWPORT),Mt=new je().fromArray(I),wt=new je().fromArray(K);function Bt(j,zt,Ft,kt){const Ot=new Uint8Array(4),bt=a.createTexture();a.bindTexture(j,bt),a.texParameteri(j,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(j,a.TEXTURE_MAG_FILTER,a.NEAREST);for(let jt=0;jt<Ft;jt++)j===a.TEXTURE_3D||j===a.TEXTURE_2D_ARRAY?a.texImage3D(zt,0,a.RGBA,1,1,kt,0,a.RGBA,a.UNSIGNED_BYTE,Ot):a.texImage2D(zt+jt,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,Ot);return bt}const st={};st[a.TEXTURE_2D]=Bt(a.TEXTURE_2D,a.TEXTURE_2D,1),st[a.TEXTURE_CUBE_MAP]=Bt(a.TEXTURE_CUBE_MAP,a.TEXTURE_CUBE_MAP_POSITIVE_X,6),st[a.TEXTURE_2D_ARRAY]=Bt(a.TEXTURE_2D_ARRAY,a.TEXTURE_2D_ARRAY,1,1),st[a.TEXTURE_3D]=Bt(a.TEXTURE_3D,a.TEXTURE_3D,1,1),c.setClear(0,0,0,1),f.setClear(1),d.setClear(0),Et(a.DEPTH_TEST),f.setFunc(lo),Yt(!1),se(k_),Et(a.CULL_FACE),oe(Pa);function Et(j){v[j]!==!0&&(a.enable(j),v[j]=!0)}function gt(j){v[j]!==!1&&(a.disable(j),v[j]=!1)}function Ut(j,zt){return _[j]!==zt?(a.bindFramebuffer(j,zt),_[j]=zt,j===a.DRAW_FRAMEBUFFER&&(_[a.FRAMEBUFFER]=zt),j===a.FRAMEBUFFER&&(_[a.DRAW_FRAMEBUFFER]=zt),!0):!1}function tt(j,zt){let Ft=M,kt=!1;if(j){Ft=g.get(zt),Ft===void 0&&(Ft=[],g.set(zt,Ft));const Ot=j.textures;if(Ft.length!==Ot.length||Ft[0]!==a.COLOR_ATTACHMENT0){for(let bt=0,jt=Ot.length;bt<jt;bt++)Ft[bt]=a.COLOR_ATTACHMENT0+bt;Ft.length=Ot.length,kt=!0}}else Ft[0]!==a.BACK&&(Ft[0]=a.BACK,kt=!0);kt&&a.drawBuffers(Ft)}function ct(j){return E!==j?(a.useProgram(j),E=j,!0):!1}const qt={[Qs]:a.FUNC_ADD,[mM]:a.FUNC_SUBTRACT,[gM]:a.FUNC_REVERSE_SUBTRACT};qt[_M]=a.MIN,qt[vM]=a.MAX;const Xt={[xM]:a.ZERO,[yM]:a.ONE,[SM]:a.SRC_COLOR,[Gd]:a.SRC_ALPHA,[RM]:a.SRC_ALPHA_SATURATE,[TM]:a.DST_COLOR,[bM]:a.DST_ALPHA,[MM]:a.ONE_MINUS_SRC_COLOR,[Vd]:a.ONE_MINUS_SRC_ALPHA,[AM]:a.ONE_MINUS_DST_COLOR,[EM]:a.ONE_MINUS_DST_ALPHA,[wM]:a.CONSTANT_COLOR,[CM]:a.ONE_MINUS_CONSTANT_COLOR,[DM]:a.CONSTANT_ALPHA,[UM]:a.ONE_MINUS_CONSTANT_ALPHA};function oe(j,zt,Ft,kt,Ot,bt,jt,he,Ie,De){if(j===Pa){R===!0&&(gt(a.BLEND),R=!1);return}if(R===!1&&(Et(a.BLEND),R=!0),j!==pM){if(j!==x||De!==U){if((y!==Qs||C!==Qs)&&(a.blendEquation(a.FUNC_ADD),y=Qs,C=Qs),De)switch(j){case so:a.blendFuncSeparate(a.ONE,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA);break;case X_:a.blendFunc(a.ONE,a.ONE);break;case W_:a.blendFuncSeparate(a.ZERO,a.ONE_MINUS_SRC_COLOR,a.ZERO,a.ONE);break;case q_:a.blendFuncSeparate(a.DST_COLOR,a.ONE_MINUS_SRC_ALPHA,a.ZERO,a.ONE);break;default:Pe("WebGLState: Invalid blending: ",j);break}else switch(j){case so:a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA);break;case X_:a.blendFuncSeparate(a.SRC_ALPHA,a.ONE,a.ONE,a.ONE);break;case W_:Pe("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case q_:Pe("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Pe("WebGLState: Invalid blending: ",j);break}w=null,D=null,G=null,B=null,F.set(0,0,0),T=0,x=j,U=De}return}Ot=Ot||zt,bt=bt||Ft,jt=jt||kt,(zt!==y||Ot!==C)&&(a.blendEquationSeparate(qt[zt],qt[Ot]),y=zt,C=Ot),(Ft!==w||kt!==D||bt!==G||jt!==B)&&(a.blendFuncSeparate(Xt[Ft],Xt[kt],Xt[bt],Xt[jt]),w=Ft,D=kt,G=bt,B=jt),(he.equals(F)===!1||Ie!==T)&&(a.blendColor(he.r,he.g,he.b,Ie),F.copy(he),T=Ie),x=j,U=!1}function de(j,zt){j.side===ki?gt(a.CULL_FACE):Et(a.CULL_FACE);let Ft=j.side===si;zt&&(Ft=!Ft),Yt(Ft),j.blending===so&&j.transparent===!1?oe(Pa):oe(j.blending,j.blendEquation,j.blendSrc,j.blendDst,j.blendEquationAlpha,j.blendSrcAlpha,j.blendDstAlpha,j.blendColor,j.blendAlpha,j.premultipliedAlpha),f.setFunc(j.depthFunc),f.setTest(j.depthTest),f.setMask(j.depthWrite),c.setMask(j.colorWrite);const kt=j.stencilWrite;d.setTest(kt),kt&&(d.setMask(j.stencilWriteMask),d.setFunc(j.stencilFunc,j.stencilRef,j.stencilFuncMask),d.setOp(j.stencilFail,j.stencilZFail,j.stencilZPass)),ce(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits),j.alphaToCoverage===!0?Et(a.SAMPLE_ALPHA_TO_COVERAGE):gt(a.SAMPLE_ALPHA_TO_COVERAGE)}function Yt(j){et!==j&&(j?a.frontFace(a.CW):a.frontFace(a.CCW),et=j)}function se(j){j!==fM?(Et(a.CULL_FACE),j!==H&&(j===k_?a.cullFace(a.BACK):j===hM?a.cullFace(a.FRONT):a.cullFace(a.FRONT_AND_BACK))):gt(a.CULL_FACE),H=j}function X(j){j!==q&&(z&&a.lineWidth(j),q=j)}function ce(j,zt,Ft){j?(Et(a.POLYGON_OFFSET_FILL),(nt!==zt||ot!==Ft)&&(nt=zt,ot=Ft,f.getReversed()&&(zt=-zt),a.polygonOffset(zt,Ft))):gt(a.POLYGON_OFFSET_FILL)}function Jt(j){j?Et(a.SCISSOR_TEST):gt(a.SCISSOR_TEST)}function ne(j){j===void 0&&(j=a.TEXTURE0+Y-1),lt!==j&&(a.activeTexture(j),lt=j)}function Pt(j,zt,Ft){Ft===void 0&&(lt===null?Ft=a.TEXTURE0+Y-1:Ft=lt);let kt=Ct[Ft];kt===void 0&&(kt={type:void 0,texture:void 0},Ct[Ft]=kt),(kt.type!==j||kt.texture!==zt)&&(lt!==Ft&&(a.activeTexture(Ft),lt=Ft),a.bindTexture(j,zt||st[j]),kt.type=j,kt.texture=zt)}function O(){const j=Ct[lt];j!==void 0&&j.type!==void 0&&(a.bindTexture(j.type,null),j.type=void 0,j.texture=void 0)}function b(){try{a.compressedTexImage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function V(){try{a.compressedTexImage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function $(){try{a.texSubImage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function k(){try{a.texSubImage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function P(){try{a.compressedTexSubImage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function it(){try{a.compressedTexSubImage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function rt(){try{a.texStorage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function _t(){try{a.texStorage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function At(){try{a.texImage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function xt(){try{a.texImage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function St(j){Mt.equals(j)===!1&&(a.scissor(j.x,j.y,j.z,j.w),Mt.copy(j))}function Nt(j){wt.equals(j)===!1&&(a.viewport(j.x,j.y,j.z,j.w),wt.copy(j))}function Lt(j,zt){let Ft=p.get(zt);Ft===void 0&&(Ft=new WeakMap,p.set(zt,Ft));let kt=Ft.get(j);kt===void 0&&(kt=a.getUniformBlockIndex(zt,j.name),Ft.set(j,kt))}function It(j,zt){const kt=p.get(zt).get(j);m.get(zt)!==kt&&(a.uniformBlockBinding(zt,kt,j.__bindingPointIndex),m.set(zt,kt))}function $t(){a.disable(a.BLEND),a.disable(a.CULL_FACE),a.disable(a.DEPTH_TEST),a.disable(a.POLYGON_OFFSET_FILL),a.disable(a.SCISSOR_TEST),a.disable(a.STENCIL_TEST),a.disable(a.SAMPLE_ALPHA_TO_COVERAGE),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ONE,a.ZERO),a.blendFuncSeparate(a.ONE,a.ZERO,a.ONE,a.ZERO),a.blendColor(0,0,0,0),a.colorMask(!0,!0,!0,!0),a.clearColor(0,0,0,0),a.depthMask(!0),a.depthFunc(a.LESS),f.setReversed(!1),a.clearDepth(1),a.stencilMask(4294967295),a.stencilFunc(a.ALWAYS,0,4294967295),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),a.clearStencil(0),a.cullFace(a.BACK),a.frontFace(a.CCW),a.polygonOffset(0,0),a.activeTexture(a.TEXTURE0),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,null),a.bindFramebuffer(a.READ_FRAMEBUFFER,null),a.useProgram(null),a.lineWidth(1),a.scissor(0,0,a.canvas.width,a.canvas.height),a.viewport(0,0,a.canvas.width,a.canvas.height),v={},lt=null,Ct={},_={},g=new WeakMap,M=[],E=null,R=!1,x=null,y=null,w=null,D=null,C=null,G=null,B=null,F=new Ee(0,0,0),T=0,U=!1,et=null,H=null,q=null,nt=null,ot=null,Mt.set(0,0,a.canvas.width,a.canvas.height),wt.set(0,0,a.canvas.width,a.canvas.height),c.reset(),f.reset(),d.reset()}return{buffers:{color:c,depth:f,stencil:d},enable:Et,disable:gt,bindFramebuffer:Ut,drawBuffers:tt,useProgram:ct,setBlending:oe,setMaterial:de,setFlipSided:Yt,setCullFace:se,setLineWidth:X,setPolygonOffset:ce,setScissorTest:Jt,activeTexture:ne,bindTexture:Pt,unbindTexture:O,compressedTexImage2D:b,compressedTexImage3D:V,texImage2D:At,texImage3D:xt,updateUBOMapping:Lt,uniformBlockBinding:It,texStorage2D:rt,texStorage3D:_t,texSubImage2D:$,texSubImage3D:k,compressedTexSubImage2D:P,compressedTexSubImage3D:it,scissor:St,viewport:Nt,reset:$t}}function P2(a,t,i,s,l,c,f){const d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,m=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new _e,v=new WeakMap;let _;const g=new WeakMap;let M=!1;try{M=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function E(O,b){return M?new OffscreenCanvas(O,b):Lu("canvas")}function R(O,b,V){let $=1;const k=Pt(O);if((k.width>V||k.height>V)&&($=V/Math.max(k.width,k.height)),$<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const P=Math.floor($*k.width),it=Math.floor($*k.height);_===void 0&&(_=E(P,it));const rt=b?E(P,it):_;return rt.width=P,rt.height=it,rt.getContext("2d").drawImage(O,0,0,P,it),ue("WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+P+"x"+it+")."),rt}else return"data"in O&&ue("WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),O;return O}function x(O){return O.generateMipmaps}function y(O){a.generateMipmap(O)}function w(O){return O.isWebGLCubeRenderTarget?a.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?a.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?a.TEXTURE_2D_ARRAY:a.TEXTURE_2D}function D(O,b,V,$,k=!1){if(O!==null){if(a[O]!==void 0)return a[O];ue("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let P=b;if(b===a.RED&&(V===a.FLOAT&&(P=a.R32F),V===a.HALF_FLOAT&&(P=a.R16F),V===a.UNSIGNED_BYTE&&(P=a.R8)),b===a.RED_INTEGER&&(V===a.UNSIGNED_BYTE&&(P=a.R8UI),V===a.UNSIGNED_SHORT&&(P=a.R16UI),V===a.UNSIGNED_INT&&(P=a.R32UI),V===a.BYTE&&(P=a.R8I),V===a.SHORT&&(P=a.R16I),V===a.INT&&(P=a.R32I)),b===a.RG&&(V===a.FLOAT&&(P=a.RG32F),V===a.HALF_FLOAT&&(P=a.RG16F),V===a.UNSIGNED_BYTE&&(P=a.RG8)),b===a.RG_INTEGER&&(V===a.UNSIGNED_BYTE&&(P=a.RG8UI),V===a.UNSIGNED_SHORT&&(P=a.RG16UI),V===a.UNSIGNED_INT&&(P=a.RG32UI),V===a.BYTE&&(P=a.RG8I),V===a.SHORT&&(P=a.RG16I),V===a.INT&&(P=a.RG32I)),b===a.RGB_INTEGER&&(V===a.UNSIGNED_BYTE&&(P=a.RGB8UI),V===a.UNSIGNED_SHORT&&(P=a.RGB16UI),V===a.UNSIGNED_INT&&(P=a.RGB32UI),V===a.BYTE&&(P=a.RGB8I),V===a.SHORT&&(P=a.RGB16I),V===a.INT&&(P=a.RGB32I)),b===a.RGBA_INTEGER&&(V===a.UNSIGNED_BYTE&&(P=a.RGBA8UI),V===a.UNSIGNED_SHORT&&(P=a.RGBA16UI),V===a.UNSIGNED_INT&&(P=a.RGBA32UI),V===a.BYTE&&(P=a.RGBA8I),V===a.SHORT&&(P=a.RGBA16I),V===a.INT&&(P=a.RGBA32I)),b===a.RGB&&(V===a.UNSIGNED_INT_5_9_9_9_REV&&(P=a.RGB9_E5),V===a.UNSIGNED_INT_10F_11F_11F_REV&&(P=a.R11F_G11F_B10F)),b===a.RGBA){const it=k?Uu:Ue.getTransfer($);V===a.FLOAT&&(P=a.RGBA32F),V===a.HALF_FLOAT&&(P=a.RGBA16F),V===a.UNSIGNED_BYTE&&(P=it===Ge?a.SRGB8_ALPHA8:a.RGBA8),V===a.UNSIGNED_SHORT_4_4_4_4&&(P=a.RGBA4),V===a.UNSIGNED_SHORT_5_5_5_1&&(P=a.RGB5_A1)}return(P===a.R16F||P===a.R32F||P===a.RG16F||P===a.RG32F||P===a.RGBA16F||P===a.RGBA32F)&&t.get("EXT_color_buffer_float"),P}function C(O,b){let V;return O?b===null||b===la||b===yl?V=a.DEPTH24_STENCIL8:b===ia?V=a.DEPTH32F_STENCIL8:b===xl&&(V=a.DEPTH24_STENCIL8,ue("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===la||b===yl?V=a.DEPTH_COMPONENT24:b===ia?V=a.DEPTH_COMPONENT32F:b===xl&&(V=a.DEPTH_COMPONENT16),V}function G(O,b){return x(O)===!0||O.isFramebufferTexture&&O.minFilter!==Pn&&O.minFilter!==Vn?Math.log2(Math.max(b.width,b.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?b.mipmaps.length:1}function B(O){const b=O.target;b.removeEventListener("dispose",B),T(b),b.isVideoTexture&&v.delete(b)}function F(O){const b=O.target;b.removeEventListener("dispose",F),et(b)}function T(O){const b=s.get(O);if(b.__webglInit===void 0)return;const V=O.source,$=g.get(V);if($){const k=$[b.__cacheKey];k.usedTimes--,k.usedTimes===0&&U(O),Object.keys($).length===0&&g.delete(V)}s.remove(O)}function U(O){const b=s.get(O);a.deleteTexture(b.__webglTexture);const V=O.source,$=g.get(V);delete $[b.__cacheKey],f.memory.textures--}function et(O){const b=s.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),s.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let $=0;$<6;$++){if(Array.isArray(b.__webglFramebuffer[$]))for(let k=0;k<b.__webglFramebuffer[$].length;k++)a.deleteFramebuffer(b.__webglFramebuffer[$][k]);else a.deleteFramebuffer(b.__webglFramebuffer[$]);b.__webglDepthbuffer&&a.deleteRenderbuffer(b.__webglDepthbuffer[$])}else{if(Array.isArray(b.__webglFramebuffer))for(let $=0;$<b.__webglFramebuffer.length;$++)a.deleteFramebuffer(b.__webglFramebuffer[$]);else a.deleteFramebuffer(b.__webglFramebuffer);if(b.__webglDepthbuffer&&a.deleteRenderbuffer(b.__webglDepthbuffer),b.__webglMultisampledFramebuffer&&a.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer)for(let $=0;$<b.__webglColorRenderbuffer.length;$++)b.__webglColorRenderbuffer[$]&&a.deleteRenderbuffer(b.__webglColorRenderbuffer[$]);b.__webglDepthRenderbuffer&&a.deleteRenderbuffer(b.__webglDepthRenderbuffer)}const V=O.textures;for(let $=0,k=V.length;$<k;$++){const P=s.get(V[$]);P.__webglTexture&&(a.deleteTexture(P.__webglTexture),f.memory.textures--),s.remove(V[$])}s.remove(O)}let H=0;function q(){H=0}function nt(){const O=H;return O>=l.maxTextures&&ue("WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+l.maxTextures),H+=1,O}function ot(O){const b=[];return b.push(O.wrapS),b.push(O.wrapT),b.push(O.wrapR||0),b.push(O.magFilter),b.push(O.minFilter),b.push(O.anisotropy),b.push(O.internalFormat),b.push(O.format),b.push(O.type),b.push(O.generateMipmaps),b.push(O.premultiplyAlpha),b.push(O.flipY),b.push(O.unpackAlignment),b.push(O.colorSpace),b.join()}function Y(O,b){const V=s.get(O);if(O.isVideoTexture&&Jt(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&V.__version!==O.version){const $=O.image;if($===null)ue("WebGLRenderer: Texture marked for update but no image data found.");else if($.complete===!1)ue("WebGLRenderer: Texture marked for update but image is incomplete");else{st(V,O,b);return}}else O.isExternalTexture&&(V.__webglTexture=O.sourceTexture?O.sourceTexture:null);i.bindTexture(a.TEXTURE_2D,V.__webglTexture,a.TEXTURE0+b)}function z(O,b){const V=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&V.__version!==O.version){st(V,O,b);return}else O.isExternalTexture&&(V.__webglTexture=O.sourceTexture?O.sourceTexture:null);i.bindTexture(a.TEXTURE_2D_ARRAY,V.__webglTexture,a.TEXTURE0+b)}function A(O,b){const V=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&V.__version!==O.version){st(V,O,b);return}i.bindTexture(a.TEXTURE_3D,V.__webglTexture,a.TEXTURE0+b)}function ht(O,b){const V=s.get(O);if(O.isCubeDepthTexture!==!0&&O.version>0&&V.__version!==O.version){Et(V,O,b);return}i.bindTexture(a.TEXTURE_CUBE_MAP,V.__webglTexture,a.TEXTURE0+b)}const lt={[Kd]:a.REPEAT,[Oa]:a.CLAMP_TO_EDGE,[Qd]:a.MIRRORED_REPEAT},Ct={[Pn]:a.NEAREST,[OM]:a.NEAREST_MIPMAP_NEAREST,[Fc]:a.NEAREST_MIPMAP_LINEAR,[Vn]:a.LINEAR,[ad]:a.LINEAR_MIPMAP_NEAREST,[$s]:a.LINEAR_MIPMAP_LINEAR},I={[FM]:a.NEVER,[VM]:a.ALWAYS,[IM]:a.LESS,[Wp]:a.LEQUAL,[BM]:a.EQUAL,[qp]:a.GEQUAL,[HM]:a.GREATER,[GM]:a.NOTEQUAL};function K(O,b){if(b.type===ia&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===Vn||b.magFilter===ad||b.magFilter===Fc||b.magFilter===$s||b.minFilter===Vn||b.minFilter===ad||b.minFilter===Fc||b.minFilter===$s)&&ue("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),a.texParameteri(O,a.TEXTURE_WRAP_S,lt[b.wrapS]),a.texParameteri(O,a.TEXTURE_WRAP_T,lt[b.wrapT]),(O===a.TEXTURE_3D||O===a.TEXTURE_2D_ARRAY)&&a.texParameteri(O,a.TEXTURE_WRAP_R,lt[b.wrapR]),a.texParameteri(O,a.TEXTURE_MAG_FILTER,Ct[b.magFilter]),a.texParameteri(O,a.TEXTURE_MIN_FILTER,Ct[b.minFilter]),b.compareFunction&&(a.texParameteri(O,a.TEXTURE_COMPARE_MODE,a.COMPARE_REF_TO_TEXTURE),a.texParameteri(O,a.TEXTURE_COMPARE_FUNC,I[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Pn||b.minFilter!==Fc&&b.minFilter!==$s||b.type===ia&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||s.get(b).__currentAnisotropy){const V=t.get("EXT_texture_filter_anisotropic");a.texParameterf(O,V.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,l.getMaxAnisotropy())),s.get(b).__currentAnisotropy=b.anisotropy}}}function Mt(O,b){let V=!1;O.__webglInit===void 0&&(O.__webglInit=!0,b.addEventListener("dispose",B));const $=b.source;let k=g.get($);k===void 0&&(k={},g.set($,k));const P=ot(b);if(P!==O.__cacheKey){k[P]===void 0&&(k[P]={texture:a.createTexture(),usedTimes:0},f.memory.textures++,V=!0),k[P].usedTimes++;const it=k[O.__cacheKey];it!==void 0&&(k[O.__cacheKey].usedTimes--,it.usedTimes===0&&U(b)),O.__cacheKey=P,O.__webglTexture=k[P].texture}return V}function wt(O,b,V){return Math.floor(Math.floor(O/V)/b)}function Bt(O,b,V,$){const P=O.updateRanges;if(P.length===0)i.texSubImage2D(a.TEXTURE_2D,0,0,0,b.width,b.height,V,$,b.data);else{P.sort((xt,St)=>xt.start-St.start);let it=0;for(let xt=1;xt<P.length;xt++){const St=P[it],Nt=P[xt],Lt=St.start+St.count,It=wt(Nt.start,b.width,4),$t=wt(St.start,b.width,4);Nt.start<=Lt+1&&It===$t&&wt(Nt.start+Nt.count-1,b.width,4)===It?St.count=Math.max(St.count,Nt.start+Nt.count-St.start):(++it,P[it]=Nt)}P.length=it+1;const rt=a.getParameter(a.UNPACK_ROW_LENGTH),_t=a.getParameter(a.UNPACK_SKIP_PIXELS),At=a.getParameter(a.UNPACK_SKIP_ROWS);a.pixelStorei(a.UNPACK_ROW_LENGTH,b.width);for(let xt=0,St=P.length;xt<St;xt++){const Nt=P[xt],Lt=Math.floor(Nt.start/4),It=Math.ceil(Nt.count/4),$t=Lt%b.width,j=Math.floor(Lt/b.width),zt=It,Ft=1;a.pixelStorei(a.UNPACK_SKIP_PIXELS,$t),a.pixelStorei(a.UNPACK_SKIP_ROWS,j),i.texSubImage2D(a.TEXTURE_2D,0,$t,j,zt,Ft,V,$,b.data)}O.clearUpdateRanges(),a.pixelStorei(a.UNPACK_ROW_LENGTH,rt),a.pixelStorei(a.UNPACK_SKIP_PIXELS,_t),a.pixelStorei(a.UNPACK_SKIP_ROWS,At)}}function st(O,b,V){let $=a.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&($=a.TEXTURE_2D_ARRAY),b.isData3DTexture&&($=a.TEXTURE_3D);const k=Mt(O,b),P=b.source;i.bindTexture($,O.__webglTexture,a.TEXTURE0+V);const it=s.get(P);if(P.version!==it.__version||k===!0){i.activeTexture(a.TEXTURE0+V);const rt=Ue.getPrimaries(Ue.workingColorSpace),_t=b.colorSpace===ys?null:Ue.getPrimaries(b.colorSpace),At=b.colorSpace===ys||rt===_t?a.NONE:a.BROWSER_DEFAULT_WEBGL;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),a.pixelStorei(a.UNPACK_ALIGNMENT,b.unpackAlignment),a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,At);let xt=R(b.image,!1,l.maxTextureSize);xt=ne(b,xt);const St=c.convert(b.format,b.colorSpace),Nt=c.convert(b.type);let Lt=D(b.internalFormat,St,Nt,b.colorSpace,b.isVideoTexture);K($,b);let It;const $t=b.mipmaps,j=b.isVideoTexture!==!0,zt=it.__version===void 0||k===!0,Ft=P.dataReady,kt=G(b,xt);if(b.isDepthTexture)Lt=C(b.format===tr,b.type),zt&&(j?i.texStorage2D(a.TEXTURE_2D,1,Lt,xt.width,xt.height):i.texImage2D(a.TEXTURE_2D,0,Lt,xt.width,xt.height,0,St,Nt,null));else if(b.isDataTexture)if($t.length>0){j&&zt&&i.texStorage2D(a.TEXTURE_2D,kt,Lt,$t[0].width,$t[0].height);for(let Ot=0,bt=$t.length;Ot<bt;Ot++)It=$t[Ot],j?Ft&&i.texSubImage2D(a.TEXTURE_2D,Ot,0,0,It.width,It.height,St,Nt,It.data):i.texImage2D(a.TEXTURE_2D,Ot,Lt,It.width,It.height,0,St,Nt,It.data);b.generateMipmaps=!1}else j?(zt&&i.texStorage2D(a.TEXTURE_2D,kt,Lt,xt.width,xt.height),Ft&&Bt(b,xt,St,Nt)):i.texImage2D(a.TEXTURE_2D,0,Lt,xt.width,xt.height,0,St,Nt,xt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){j&&zt&&i.texStorage3D(a.TEXTURE_2D_ARRAY,kt,Lt,$t[0].width,$t[0].height,xt.depth);for(let Ot=0,bt=$t.length;Ot<bt;Ot++)if(It=$t[Ot],b.format!==Wi)if(St!==null)if(j){if(Ft)if(b.layerUpdates.size>0){const jt=bv(It.width,It.height,b.format,b.type);for(const he of b.layerUpdates){const Ie=It.data.subarray(he*jt/It.data.BYTES_PER_ELEMENT,(he+1)*jt/It.data.BYTES_PER_ELEMENT);i.compressedTexSubImage3D(a.TEXTURE_2D_ARRAY,Ot,0,0,he,It.width,It.height,1,St,Ie)}b.clearLayerUpdates()}else i.compressedTexSubImage3D(a.TEXTURE_2D_ARRAY,Ot,0,0,0,It.width,It.height,xt.depth,St,It.data)}else i.compressedTexImage3D(a.TEXTURE_2D_ARRAY,Ot,Lt,It.width,It.height,xt.depth,0,It.data,0,0);else ue("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else j?Ft&&i.texSubImage3D(a.TEXTURE_2D_ARRAY,Ot,0,0,0,It.width,It.height,xt.depth,St,Nt,It.data):i.texImage3D(a.TEXTURE_2D_ARRAY,Ot,Lt,It.width,It.height,xt.depth,0,St,Nt,It.data)}else{j&&zt&&i.texStorage2D(a.TEXTURE_2D,kt,Lt,$t[0].width,$t[0].height);for(let Ot=0,bt=$t.length;Ot<bt;Ot++)It=$t[Ot],b.format!==Wi?St!==null?j?Ft&&i.compressedTexSubImage2D(a.TEXTURE_2D,Ot,0,0,It.width,It.height,St,It.data):i.compressedTexImage2D(a.TEXTURE_2D,Ot,Lt,It.width,It.height,0,It.data):ue("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):j?Ft&&i.texSubImage2D(a.TEXTURE_2D,Ot,0,0,It.width,It.height,St,Nt,It.data):i.texImage2D(a.TEXTURE_2D,Ot,Lt,It.width,It.height,0,St,Nt,It.data)}else if(b.isDataArrayTexture)if(j){if(zt&&i.texStorage3D(a.TEXTURE_2D_ARRAY,kt,Lt,xt.width,xt.height,xt.depth),Ft)if(b.layerUpdates.size>0){const Ot=bv(xt.width,xt.height,b.format,b.type);for(const bt of b.layerUpdates){const jt=xt.data.subarray(bt*Ot/xt.data.BYTES_PER_ELEMENT,(bt+1)*Ot/xt.data.BYTES_PER_ELEMENT);i.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,bt,xt.width,xt.height,1,St,Nt,jt)}b.clearLayerUpdates()}else i.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,0,xt.width,xt.height,xt.depth,St,Nt,xt.data)}else i.texImage3D(a.TEXTURE_2D_ARRAY,0,Lt,xt.width,xt.height,xt.depth,0,St,Nt,xt.data);else if(b.isData3DTexture)j?(zt&&i.texStorage3D(a.TEXTURE_3D,kt,Lt,xt.width,xt.height,xt.depth),Ft&&i.texSubImage3D(a.TEXTURE_3D,0,0,0,0,xt.width,xt.height,xt.depth,St,Nt,xt.data)):i.texImage3D(a.TEXTURE_3D,0,Lt,xt.width,xt.height,xt.depth,0,St,Nt,xt.data);else if(b.isFramebufferTexture){if(zt)if(j)i.texStorage2D(a.TEXTURE_2D,kt,Lt,xt.width,xt.height);else{let Ot=xt.width,bt=xt.height;for(let jt=0;jt<kt;jt++)i.texImage2D(a.TEXTURE_2D,jt,Lt,Ot,bt,0,St,Nt,null),Ot>>=1,bt>>=1}}else if($t.length>0){if(j&&zt){const Ot=Pt($t[0]);i.texStorage2D(a.TEXTURE_2D,kt,Lt,Ot.width,Ot.height)}for(let Ot=0,bt=$t.length;Ot<bt;Ot++)It=$t[Ot],j?Ft&&i.texSubImage2D(a.TEXTURE_2D,Ot,0,0,St,Nt,It):i.texImage2D(a.TEXTURE_2D,Ot,Lt,St,Nt,It);b.generateMipmaps=!1}else if(j){if(zt){const Ot=Pt(xt);i.texStorage2D(a.TEXTURE_2D,kt,Lt,Ot.width,Ot.height)}Ft&&i.texSubImage2D(a.TEXTURE_2D,0,0,0,St,Nt,xt)}else i.texImage2D(a.TEXTURE_2D,0,Lt,St,Nt,xt);x(b)&&y($),it.__version=P.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function Et(O,b,V){if(b.image.length!==6)return;const $=Mt(O,b),k=b.source;i.bindTexture(a.TEXTURE_CUBE_MAP,O.__webglTexture,a.TEXTURE0+V);const P=s.get(k);if(k.version!==P.__version||$===!0){i.activeTexture(a.TEXTURE0+V);const it=Ue.getPrimaries(Ue.workingColorSpace),rt=b.colorSpace===ys?null:Ue.getPrimaries(b.colorSpace),_t=b.colorSpace===ys||it===rt?a.NONE:a.BROWSER_DEFAULT_WEBGL;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),a.pixelStorei(a.UNPACK_ALIGNMENT,b.unpackAlignment),a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,_t);const At=b.isCompressedTexture||b.image[0].isCompressedTexture,xt=b.image[0]&&b.image[0].isDataTexture,St=[];for(let bt=0;bt<6;bt++)!At&&!xt?St[bt]=R(b.image[bt],!0,l.maxCubemapSize):St[bt]=xt?b.image[bt].image:b.image[bt],St[bt]=ne(b,St[bt]);const Nt=St[0],Lt=c.convert(b.format,b.colorSpace),It=c.convert(b.type),$t=D(b.internalFormat,Lt,It,b.colorSpace),j=b.isVideoTexture!==!0,zt=P.__version===void 0||$===!0,Ft=k.dataReady;let kt=G(b,Nt);K(a.TEXTURE_CUBE_MAP,b);let Ot;if(At){j&&zt&&i.texStorage2D(a.TEXTURE_CUBE_MAP,kt,$t,Nt.width,Nt.height);for(let bt=0;bt<6;bt++){Ot=St[bt].mipmaps;for(let jt=0;jt<Ot.length;jt++){const he=Ot[jt];b.format!==Wi?Lt!==null?j?Ft&&i.compressedTexSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt,0,0,he.width,he.height,Lt,he.data):i.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt,$t,he.width,he.height,0,he.data):ue("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt,0,0,he.width,he.height,Lt,It,he.data):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt,$t,he.width,he.height,0,Lt,It,he.data)}}}else{if(Ot=b.mipmaps,j&&zt){Ot.length>0&&kt++;const bt=Pt(St[0]);i.texStorage2D(a.TEXTURE_CUBE_MAP,kt,$t,bt.width,bt.height)}for(let bt=0;bt<6;bt++)if(xt){j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,0,0,St[bt].width,St[bt].height,Lt,It,St[bt].data):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,$t,St[bt].width,St[bt].height,0,Lt,It,St[bt].data);for(let jt=0;jt<Ot.length;jt++){const Ie=Ot[jt].image[bt].image;j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt+1,0,0,Ie.width,Ie.height,Lt,It,Ie.data):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt+1,$t,Ie.width,Ie.height,0,Lt,It,Ie.data)}}else{j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,0,0,Lt,It,St[bt]):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,$t,Lt,It,St[bt]);for(let jt=0;jt<Ot.length;jt++){const he=Ot[jt];j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt+1,0,0,Lt,It,he.image[bt]):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt+1,$t,Lt,It,he.image[bt])}}}x(b)&&y(a.TEXTURE_CUBE_MAP),P.__version=k.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function gt(O,b,V,$,k,P){const it=c.convert(V.format,V.colorSpace),rt=c.convert(V.type),_t=D(V.internalFormat,it,rt,V.colorSpace),At=s.get(b),xt=s.get(V);if(xt.__renderTarget=b,!At.__hasExternalTextures){const St=Math.max(1,b.width>>P),Nt=Math.max(1,b.height>>P);k===a.TEXTURE_3D||k===a.TEXTURE_2D_ARRAY?i.texImage3D(k,P,_t,St,Nt,b.depth,0,it,rt,null):i.texImage2D(k,P,_t,St,Nt,0,it,rt,null)}i.bindFramebuffer(a.FRAMEBUFFER,O),ce(b)?d.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,$,k,xt.__webglTexture,0,X(b)):(k===a.TEXTURE_2D||k>=a.TEXTURE_CUBE_MAP_POSITIVE_X&&k<=a.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&a.framebufferTexture2D(a.FRAMEBUFFER,$,k,xt.__webglTexture,P),i.bindFramebuffer(a.FRAMEBUFFER,null)}function Ut(O,b,V){if(a.bindRenderbuffer(a.RENDERBUFFER,O),b.depthBuffer){const $=b.depthTexture,k=$&&$.isDepthTexture?$.type:null,P=C(b.stencilBuffer,k),it=b.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;ce(b)?d.renderbufferStorageMultisampleEXT(a.RENDERBUFFER,X(b),P,b.width,b.height):V?a.renderbufferStorageMultisample(a.RENDERBUFFER,X(b),P,b.width,b.height):a.renderbufferStorage(a.RENDERBUFFER,P,b.width,b.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,it,a.RENDERBUFFER,O)}else{const $=b.textures;for(let k=0;k<$.length;k++){const P=$[k],it=c.convert(P.format,P.colorSpace),rt=c.convert(P.type),_t=D(P.internalFormat,it,rt,P.colorSpace);ce(b)?d.renderbufferStorageMultisampleEXT(a.RENDERBUFFER,X(b),_t,b.width,b.height):V?a.renderbufferStorageMultisample(a.RENDERBUFFER,X(b),_t,b.width,b.height):a.renderbufferStorage(a.RENDERBUFFER,_t,b.width,b.height)}}a.bindRenderbuffer(a.RENDERBUFFER,null)}function tt(O,b,V){const $=b.isWebGLCubeRenderTarget===!0;if(i.bindFramebuffer(a.FRAMEBUFFER,O),!(b.depthTexture&&b.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const k=s.get(b.depthTexture);if(k.__renderTarget=b,(!k.__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),$){if(k.__webglInit===void 0&&(k.__webglInit=!0,b.depthTexture.addEventListener("dispose",B)),k.__webglTexture===void 0){k.__webglTexture=a.createTexture(),i.bindTexture(a.TEXTURE_CUBE_MAP,k.__webglTexture),K(a.TEXTURE_CUBE_MAP,b.depthTexture);const At=c.convert(b.depthTexture.format),xt=c.convert(b.depthTexture.type);let St;b.depthTexture.format===Ba?St=a.DEPTH_COMPONENT24:b.depthTexture.format===tr&&(St=a.DEPTH24_STENCIL8);for(let Nt=0;Nt<6;Nt++)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+Nt,0,St,b.width,b.height,0,At,xt,null)}}else Y(b.depthTexture,0);const P=k.__webglTexture,it=X(b),rt=$?a.TEXTURE_CUBE_MAP_POSITIVE_X+V:a.TEXTURE_2D,_t=b.depthTexture.format===tr?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;if(b.depthTexture.format===Ba)ce(b)?d.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,_t,rt,P,0,it):a.framebufferTexture2D(a.FRAMEBUFFER,_t,rt,P,0);else if(b.depthTexture.format===tr)ce(b)?d.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,_t,rt,P,0,it):a.framebufferTexture2D(a.FRAMEBUFFER,_t,rt,P,0);else throw new Error("Unknown depthTexture format")}function ct(O){const b=s.get(O),V=O.isWebGLCubeRenderTarget===!0;if(b.__boundDepthTexture!==O.depthTexture){const $=O.depthTexture;if(b.__depthDisposeCallback&&b.__depthDisposeCallback(),$){const k=()=>{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,$.removeEventListener("dispose",k)};$.addEventListener("dispose",k),b.__depthDisposeCallback=k}b.__boundDepthTexture=$}if(O.depthTexture&&!b.__autoAllocateDepthBuffer)if(V)for(let $=0;$<6;$++)tt(b.__webglFramebuffer[$],O,$);else{const $=O.texture.mipmaps;$&&$.length>0?tt(b.__webglFramebuffer[0],O,0):tt(b.__webglFramebuffer,O,0)}else if(V){b.__webglDepthbuffer=[];for(let $=0;$<6;$++)if(i.bindFramebuffer(a.FRAMEBUFFER,b.__webglFramebuffer[$]),b.__webglDepthbuffer[$]===void 0)b.__webglDepthbuffer[$]=a.createRenderbuffer(),Ut(b.__webglDepthbuffer[$],O,!1);else{const k=O.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,P=b.__webglDepthbuffer[$];a.bindRenderbuffer(a.RENDERBUFFER,P),a.framebufferRenderbuffer(a.FRAMEBUFFER,k,a.RENDERBUFFER,P)}}else{const $=O.texture.mipmaps;if($&&$.length>0?i.bindFramebuffer(a.FRAMEBUFFER,b.__webglFramebuffer[0]):i.bindFramebuffer(a.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=a.createRenderbuffer(),Ut(b.__webglDepthbuffer,O,!1);else{const k=O.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,P=b.__webglDepthbuffer;a.bindRenderbuffer(a.RENDERBUFFER,P),a.framebufferRenderbuffer(a.FRAMEBUFFER,k,a.RENDERBUFFER,P)}}i.bindFramebuffer(a.FRAMEBUFFER,null)}function qt(O,b,V){const $=s.get(O);b!==void 0&>($.__webglFramebuffer,O,O.texture,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,0),V!==void 0&&ct(O)}function Xt(O){const b=O.texture,V=s.get(O),$=s.get(b);O.addEventListener("dispose",F);const k=O.textures,P=O.isWebGLCubeRenderTarget===!0,it=k.length>1;if(it||($.__webglTexture===void 0&&($.__webglTexture=a.createTexture()),$.__version=b.version,f.memory.textures++),P){V.__webglFramebuffer=[];for(let rt=0;rt<6;rt++)if(b.mipmaps&&b.mipmaps.length>0){V.__webglFramebuffer[rt]=[];for(let _t=0;_t<b.mipmaps.length;_t++)V.__webglFramebuffer[rt][_t]=a.createFramebuffer()}else V.__webglFramebuffer[rt]=a.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){V.__webglFramebuffer=[];for(let rt=0;rt<b.mipmaps.length;rt++)V.__webglFramebuffer[rt]=a.createFramebuffer()}else V.__webglFramebuffer=a.createFramebuffer();if(it)for(let rt=0,_t=k.length;rt<_t;rt++){const At=s.get(k[rt]);At.__webglTexture===void 0&&(At.__webglTexture=a.createTexture(),f.memory.textures++)}if(O.samples>0&&ce(O)===!1){V.__webglMultisampledFramebuffer=a.createFramebuffer(),V.__webglColorRenderbuffer=[],i.bindFramebuffer(a.FRAMEBUFFER,V.__webglMultisampledFramebuffer);for(let rt=0;rt<k.length;rt++){const _t=k[rt];V.__webglColorRenderbuffer[rt]=a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,V.__webglColorRenderbuffer[rt]);const At=c.convert(_t.format,_t.colorSpace),xt=c.convert(_t.type),St=D(_t.internalFormat,At,xt,_t.colorSpace,O.isXRRenderTarget===!0),Nt=X(O);a.renderbufferStorageMultisample(a.RENDERBUFFER,Nt,St,O.width,O.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+rt,a.RENDERBUFFER,V.__webglColorRenderbuffer[rt])}a.bindRenderbuffer(a.RENDERBUFFER,null),O.depthBuffer&&(V.__webglDepthRenderbuffer=a.createRenderbuffer(),Ut(V.__webglDepthRenderbuffer,O,!0)),i.bindFramebuffer(a.FRAMEBUFFER,null)}}if(P){i.bindTexture(a.TEXTURE_CUBE_MAP,$.__webglTexture),K(a.TEXTURE_CUBE_MAP,b);for(let rt=0;rt<6;rt++)if(b.mipmaps&&b.mipmaps.length>0)for(let _t=0;_t<b.mipmaps.length;_t++)gt(V.__webglFramebuffer[rt][_t],O,b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+rt,_t);else gt(V.__webglFramebuffer[rt],O,b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0);x(b)&&y(a.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(it){for(let rt=0,_t=k.length;rt<_t;rt++){const At=k[rt],xt=s.get(At);let St=a.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(St=O.isWebGL3DRenderTarget?a.TEXTURE_3D:a.TEXTURE_2D_ARRAY),i.bindTexture(St,xt.__webglTexture),K(St,At),gt(V.__webglFramebuffer,O,At,a.COLOR_ATTACHMENT0+rt,St,0),x(At)&&y(St)}i.unbindTexture()}else{let rt=a.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(rt=O.isWebGL3DRenderTarget?a.TEXTURE_3D:a.TEXTURE_2D_ARRAY),i.bindTexture(rt,$.__webglTexture),K(rt,b),b.mipmaps&&b.mipmaps.length>0)for(let _t=0;_t<b.mipmaps.length;_t++)gt(V.__webglFramebuffer[_t],O,b,a.COLOR_ATTACHMENT0,rt,_t);else gt(V.__webglFramebuffer,O,b,a.COLOR_ATTACHMENT0,rt,0);x(b)&&y(rt),i.unbindTexture()}O.depthBuffer&&ct(O)}function oe(O){const b=O.textures;for(let V=0,$=b.length;V<$;V++){const k=b[V];if(x(k)){const P=w(O),it=s.get(k).__webglTexture;i.bindTexture(P,it),y(P),i.unbindTexture()}}}const de=[],Yt=[];function se(O){if(O.samples>0){if(ce(O)===!1){const b=O.textures,V=O.width,$=O.height;let k=a.COLOR_BUFFER_BIT;const P=O.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,it=s.get(O),rt=b.length>1;if(rt)for(let At=0;At<b.length;At++)i.bindFramebuffer(a.FRAMEBUFFER,it.__webglMultisampledFramebuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+At,a.RENDERBUFFER,null),i.bindFramebuffer(a.FRAMEBUFFER,it.__webglFramebuffer),a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0+At,a.TEXTURE_2D,null,0);i.bindFramebuffer(a.READ_FRAMEBUFFER,it.__webglMultisampledFramebuffer);const _t=O.texture.mipmaps;_t&&_t.length>0?i.bindFramebuffer(a.DRAW_FRAMEBUFFER,it.__webglFramebuffer[0]):i.bindFramebuffer(a.DRAW_FRAMEBUFFER,it.__webglFramebuffer);for(let At=0;At<b.length;At++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(k|=a.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(k|=a.STENCIL_BUFFER_BIT)),rt){a.framebufferRenderbuffer(a.READ_FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,it.__webglColorRenderbuffer[At]);const xt=s.get(b[At]).__webglTexture;a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,xt,0)}a.blitFramebuffer(0,0,V,$,0,0,V,$,k,a.NEAREST),m===!0&&(de.length=0,Yt.length=0,de.push(a.COLOR_ATTACHMENT0+At),O.depthBuffer&&O.resolveDepthBuffer===!1&&(de.push(P),Yt.push(P),a.invalidateFramebuffer(a.DRAW_FRAMEBUFFER,Yt)),a.invalidateFramebuffer(a.READ_FRAMEBUFFER,de))}if(i.bindFramebuffer(a.READ_FRAMEBUFFER,null),i.bindFramebuffer(a.DRAW_FRAMEBUFFER,null),rt)for(let At=0;At<b.length;At++){i.bindFramebuffer(a.FRAMEBUFFER,it.__webglMultisampledFramebuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+At,a.RENDERBUFFER,it.__webglColorRenderbuffer[At]);const xt=s.get(b[At]).__webglTexture;i.bindFramebuffer(a.FRAMEBUFFER,it.__webglFramebuffer),a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0+At,a.TEXTURE_2D,xt,0)}i.bindFramebuffer(a.DRAW_FRAMEBUFFER,it.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&m){const b=O.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;a.invalidateFramebuffer(a.DRAW_FRAMEBUFFER,[b])}}}function X(O){return Math.min(l.maxSamples,O.samples)}function ce(O){const b=s.get(O);return O.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function Jt(O){const b=f.render.frame;v.get(O)!==b&&(v.set(O,b),O.update())}function ne(O,b){const V=O.colorSpace,$=O.format,k=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||V!==fo&&V!==ys&&(Ue.getTransfer(V)===Ge?($!==Wi||k!==vi)&&ue("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Pe("WebGLTextures: Unsupported texture color space:",V)),b}function Pt(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(p.width=O.naturalWidth||O.width,p.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(p.width=O.displayWidth,p.height=O.displayHeight):(p.width=O.width,p.height=O.height),p}this.allocateTextureUnit=nt,this.resetTextureUnits=q,this.setTexture2D=Y,this.setTexture2DArray=z,this.setTexture3D=A,this.setTextureCube=ht,this.rebindTextures=qt,this.setupRenderTarget=Xt,this.updateRenderTargetMipmap=oe,this.updateMultisampleRenderTarget=se,this.setupDepthRenderbuffer=ct,this.setupFrameBufferTexture=gt,this.useMultisampledRTT=ce,this.isReversedDepthBuffer=function(){return i.buffers.depth.getReversed()}}function z2(a,t){function i(s,l=ys){let c;const f=Ue.getTransfer(l);if(s===vi)return a.UNSIGNED_BYTE;if(s===Hp)return a.UNSIGNED_SHORT_4_4_4_4;if(s===Gp)return a.UNSIGNED_SHORT_5_5_5_1;if(s===yx)return a.UNSIGNED_INT_5_9_9_9_REV;if(s===Sx)return a.UNSIGNED_INT_10F_11F_11F_REV;if(s===vx)return a.BYTE;if(s===xx)return a.SHORT;if(s===xl)return a.UNSIGNED_SHORT;if(s===Bp)return a.INT;if(s===la)return a.UNSIGNED_INT;if(s===ia)return a.FLOAT;if(s===Ia)return a.HALF_FLOAT;if(s===Mx)return a.ALPHA;if(s===bx)return a.RGB;if(s===Wi)return a.RGBA;if(s===Ba)return a.DEPTH_COMPONENT;if(s===tr)return a.DEPTH_STENCIL;if(s===Ex)return a.RED;if(s===Vp)return a.RED_INTEGER;if(s===uo)return a.RG;if(s===kp)return a.RG_INTEGER;if(s===Xp)return a.RGBA_INTEGER;if(s===bu||s===Eu||s===Tu||s===Au)if(f===Ge)if(c=t.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(s===bu)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Eu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Tu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Au)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=t.get("WEBGL_compressed_texture_s3tc"),c!==null){if(s===bu)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Eu)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Tu)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Au)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Jd||s===$d||s===tp||s===ep)if(c=t.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(s===Jd)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===$d)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===tp)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===ep)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===np||s===ip||s===ap||s===sp||s===rp||s===op||s===lp)if(c=t.get("WEBGL_compressed_texture_etc"),c!==null){if(s===np||s===ip)return f===Ge?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(s===ap)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC;if(s===sp)return c.COMPRESSED_R11_EAC;if(s===rp)return c.COMPRESSED_SIGNED_R11_EAC;if(s===op)return c.COMPRESSED_RG11_EAC;if(s===lp)return c.COMPRESSED_SIGNED_RG11_EAC}else return null;if(s===cp||s===up||s===fp||s===hp||s===dp||s===pp||s===mp||s===gp||s===_p||s===vp||s===xp||s===yp||s===Sp||s===Mp)if(c=t.get("WEBGL_compressed_texture_astc"),c!==null){if(s===cp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===up)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===fp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===hp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===dp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===pp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===mp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===gp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===_p)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===vp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===xp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===yp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Sp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Mp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===bp||s===Ep||s===Tp)if(c=t.get("EXT_texture_compression_bptc"),c!==null){if(s===bp)return f===Ge?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Ep)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Tp)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===Ap||s===Rp||s===wp||s===Cp)if(c=t.get("EXT_texture_compression_rgtc"),c!==null){if(s===Ap)return c.COMPRESSED_RED_RGTC1_EXT;if(s===Rp)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===wp)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Cp)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===yl?a.UNSIGNED_INT_24_8:a[s]!==void 0?a[s]:null}return{convert:i}}const F2=`
|
|
4033
|
+
}`,L2=[new Q(1,0,0),new Q(-1,0,0),new Q(0,1,0),new Q(0,-1,0),new Q(0,0,1),new Q(0,0,-1)],N2=[new Q(0,-1,0),new Q(0,-1,0),new Q(0,0,1),new Q(0,0,-1),new Q(0,-1,0),new Q(0,-1,0)],qv=new nn,ml=new Q,zd=new Q;function O2(a,t,i){let s=new Kp;const l=new _e,c=new _e,f=new Ze,d=new Hb,m=new Gb,p={},v=i.maxTextureSize,_={[Es]:si,[si]:Es,[ki]:ki},g=new qi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _e},radius:{value:4}},vertexShader:D2,fragmentShader:U2}),S=g.clone();S.defines.HORIZONTAL_PASS=1;const b=new Mn;b.setAttribute("position",new xi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const R=new Gn(b,g),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Mu;let y=this.type;this.render=function(B,F,T){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||B.length===0)return;this.type===pM&&(ue("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=Mu);const U=a.getRenderTarget(),et=a.getActiveCubeFace(),H=a.getActiveMipmapLevel(),q=a.state;q.setBlending(Pa),q.buffers.depth.getReversed()===!0?q.buffers.color.setClear(0,0,0,0):q.buffers.color.setClear(1,1,1,1),q.buffers.depth.setTest(!0),q.setScissorTest(!1);const nt=y!==this.type;nt&&F.traverse(function(ot){ot.material&&(Array.isArray(ot.material)?ot.material.forEach(Y=>Y.needsUpdate=!0):ot.material.needsUpdate=!0)});for(let ot=0,Y=B.length;ot<Y;ot++){const z=B[ot],A=z.shadow;if(A===void 0){ue("WebGLShadowMap:",z,"has no shadow.");continue}if(A.autoUpdate===!1&&A.needsUpdate===!1)continue;l.copy(A.mapSize);const ht=A.getFrameExtents();l.multiply(ht),c.copy(A.mapSize),(l.x>v||l.y>v)&&(l.x>v&&(c.x=Math.floor(v/ht.x),l.x=c.x*ht.x,A.mapSize.x=c.x),l.y>v&&(c.y=Math.floor(v/ht.y),l.y=c.y*ht.y,A.mapSize.y=c.y));const lt=a.state.buffers.depth.getReversed();if(A.camera._reversedDepth=lt,A.map===null||nt===!0){if(A.map!==null&&(A.map.depthTexture!==null&&(A.map.depthTexture.dispose(),A.map.depthTexture=null),A.map.dispose()),this.type===gl){if(z.isPointLight){ue("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}A.map=new oa(l.x,l.y,{format:uo,type:Ia,minFilter:Vn,magFilter:Vn,generateMipmaps:!1}),A.map.texture.name=z.name+".shadowMap",A.map.depthTexture=new bl(l.x,l.y,ia),A.map.depthTexture.name=z.name+".shadowMapDepth",A.map.depthTexture.format=Ba,A.map.depthTexture.compareFunction=null,A.map.depthTexture.minFilter=zn,A.map.depthTexture.magFilter=zn}else z.isPointLight?(A.map=new Hx(l.x),A.map.depthTexture=new Ob(l.x,la)):(A.map=new oa(l.x,l.y),A.map.depthTexture=new bl(l.x,l.y,la)),A.map.depthTexture.name=z.name+".shadowMap",A.map.depthTexture.format=Ba,this.type===Mu?(A.map.depthTexture.compareFunction=lt?qp:Wp,A.map.depthTexture.minFilter=Vn,A.map.depthTexture.magFilter=Vn):(A.map.depthTexture.compareFunction=null,A.map.depthTexture.minFilter=zn,A.map.depthTexture.magFilter=zn);A.camera.updateProjectionMatrix()}const Ct=A.map.isWebGLCubeRenderTarget?6:1;for(let I=0;I<Ct;I++){if(A.map.isWebGLCubeRenderTarget)a.setRenderTarget(A.map,I),a.clear();else{I===0&&(a.setRenderTarget(A.map),a.clear());const K=A.getViewport(I);f.set(c.x*K.x,c.y*K.y,c.x*K.z,c.y*K.w),q.viewport(f)}if(z.isPointLight){const K=A.camera,Mt=A.matrix,wt=z.distance||K.far;wt!==K.far&&(K.far=wt,K.updateProjectionMatrix()),ml.setFromMatrixPosition(z.matrixWorld),K.position.copy(ml),zd.copy(K.position),zd.add(L2[I]),K.up.copy(N2[I]),K.lookAt(zd),K.updateMatrixWorld(),Mt.makeTranslation(-ml.x,-ml.y,-ml.z),qv.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse),A._frustum.setFromProjectionMatrix(qv,K.coordinateSystem,K.reversedDepth)}else A.updateMatrices(z);s=A.getFrustum(),C(F,T,A.camera,z,this.type)}A.isPointLightShadow!==!0&&this.type===gl&&w(A,T),A.needsUpdate=!1}y=this.type,x.needsUpdate=!1,a.setRenderTarget(U,et,H)};function w(B,F){const T=t.update(R);g.defines.VSM_SAMPLES!==B.blurSamples&&(g.defines.VSM_SAMPLES=B.blurSamples,S.defines.VSM_SAMPLES=B.blurSamples,g.needsUpdate=!0,S.needsUpdate=!0),B.mapPass===null&&(B.mapPass=new oa(l.x,l.y,{format:uo,type:Ia})),g.uniforms.shadow_pass.value=B.map.depthTexture,g.uniforms.resolution.value=B.mapSize,g.uniforms.radius.value=B.radius,a.setRenderTarget(B.mapPass),a.clear(),a.renderBufferDirect(F,null,T,g,R,null),S.uniforms.shadow_pass.value=B.mapPass.texture,S.uniforms.resolution.value=B.mapSize,S.uniforms.radius.value=B.radius,a.setRenderTarget(B.map),a.clear(),a.renderBufferDirect(F,null,T,S,R,null)}function D(B,F,T,U){let et=null;const H=T.isPointLight===!0?B.customDistanceMaterial:B.customDepthMaterial;if(H!==void 0)et=H;else if(et=T.isPointLight===!0?m:d,a.localClippingEnabled&&F.clipShadows===!0&&Array.isArray(F.clippingPlanes)&&F.clippingPlanes.length!==0||F.displacementMap&&F.displacementScale!==0||F.alphaMap&&F.alphaTest>0||F.map&&F.alphaTest>0||F.alphaToCoverage===!0){const q=et.uuid,nt=F.uuid;let ot=p[q];ot===void 0&&(ot={},p[q]=ot);let Y=ot[nt];Y===void 0&&(Y=et.clone(),ot[nt]=Y,F.addEventListener("dispose",G)),et=Y}if(et.visible=F.visible,et.wireframe=F.wireframe,U===gl?et.side=F.shadowSide!==null?F.shadowSide:F.side:et.side=F.shadowSide!==null?F.shadowSide:_[F.side],et.alphaMap=F.alphaMap,et.alphaTest=F.alphaToCoverage===!0?.5:F.alphaTest,et.map=F.map,et.clipShadows=F.clipShadows,et.clippingPlanes=F.clippingPlanes,et.clipIntersection=F.clipIntersection,et.displacementMap=F.displacementMap,et.displacementScale=F.displacementScale,et.displacementBias=F.displacementBias,et.wireframeLinewidth=F.wireframeLinewidth,et.linewidth=F.linewidth,T.isPointLight===!0&&et.isMeshDistanceMaterial===!0){const q=a.properties.get(et);q.light=T}return et}function C(B,F,T,U,et){if(B.visible===!1)return;if(B.layers.test(F.layers)&&(B.isMesh||B.isLine||B.isPoints)&&(B.castShadow||B.receiveShadow&&et===gl)&&(!B.frustumCulled||s.intersectsObject(B))){B.modelViewMatrix.multiplyMatrices(T.matrixWorldInverse,B.matrixWorld);const nt=t.update(B),ot=B.material;if(Array.isArray(ot)){const Y=nt.groups;for(let z=0,A=Y.length;z<A;z++){const ht=Y[z],lt=ot[ht.materialIndex];if(lt&<.visible){const Ct=D(B,lt,U,et);B.onBeforeShadow(a,B,F,T,nt,Ct,ht),a.renderBufferDirect(T,null,nt,Ct,B,ht),B.onAfterShadow(a,B,F,T,nt,Ct,ht)}}}else if(ot.visible){const Y=D(B,ot,U,et);B.onBeforeShadow(a,B,F,T,nt,Y,null),a.renderBufferDirect(T,null,nt,Y,B,null),B.onAfterShadow(a,B,F,T,nt,Y,null)}}const q=B.children;for(let nt=0,ot=q.length;nt<ot;nt++)C(q[nt],F,T,U,et)}function G(B){B.target.removeEventListener("dispose",G);for(const T in p){const U=p[T],et=B.target.uuid;et in U&&(U[et].dispose(),delete U[et])}}}function P2(a,t){function i(){let j=!1;const zt=new Ze;let Ft=null;const kt=new Ze(0,0,0,0);return{setMask:function(Ot){Ft!==Ot&&!j&&(a.colorMask(Ot,Ot,Ot,Ot),Ft=Ot)},setLocked:function(Ot){j=Ot},setClear:function(Ot,bt,jt,he,Ie){Ie===!0&&(Ot*=he,bt*=he,jt*=he),zt.set(Ot,bt,jt,he),kt.equals(zt)===!1&&(a.clearColor(Ot,bt,jt,he),kt.copy(zt))},reset:function(){j=!1,Ft=null,kt.set(-1,0,0,0)}}}function s(){let j=!1,zt=!1,Ft=null,kt=null,Ot=null;return{setReversed:function(bt){if(zt!==bt){const jt=t.get("EXT_clip_control");bt?jt.clipControlEXT(jt.LOWER_LEFT_EXT,jt.ZERO_TO_ONE_EXT):jt.clipControlEXT(jt.LOWER_LEFT_EXT,jt.NEGATIVE_ONE_TO_ONE_EXT),zt=bt;const he=Ot;Ot=null,this.setClear(he)}},getReversed:function(){return zt},setTest:function(bt){bt?Et(a.DEPTH_TEST):gt(a.DEPTH_TEST)},setMask:function(bt){Ft!==bt&&!j&&(a.depthMask(bt),Ft=bt)},setFunc:function(bt){if(zt&&(bt=YM[bt]),kt!==bt){switch(bt){case kd:a.depthFunc(a.NEVER);break;case Xd:a.depthFunc(a.ALWAYS);break;case Wd:a.depthFunc(a.LESS);break;case lo:a.depthFunc(a.LEQUAL);break;case qd:a.depthFunc(a.EQUAL);break;case Yd:a.depthFunc(a.GEQUAL);break;case jd:a.depthFunc(a.GREATER);break;case Zd:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}kt=bt}},setLocked:function(bt){j=bt},setClear:function(bt){Ot!==bt&&(Ot=bt,zt&&(bt=1-bt),a.clearDepth(bt))},reset:function(){j=!1,Ft=null,kt=null,Ot=null,zt=!1}}}function l(){let j=!1,zt=null,Ft=null,kt=null,Ot=null,bt=null,jt=null,he=null,Ie=null;return{setTest:function(De){j||(De?Et(a.STENCIL_TEST):gt(a.STENCIL_TEST))},setMask:function(De){zt!==De&&!j&&(a.stencilMask(De),zt=De)},setFunc:function(De,kn,Ui){(Ft!==De||kt!==kn||Ot!==Ui)&&(a.stencilFunc(De,kn,Ui),Ft=De,kt=kn,Ot=Ui)},setOp:function(De,kn,Ui){(bt!==De||jt!==kn||he!==Ui)&&(a.stencilOp(De,kn,Ui),bt=De,jt=kn,he=Ui)},setLocked:function(De){j=De},setClear:function(De){Ie!==De&&(a.clearStencil(De),Ie=De)},reset:function(){j=!1,zt=null,Ft=null,kt=null,Ot=null,bt=null,jt=null,he=null,Ie=null}}}const c=new i,f=new s,d=new l,m=new WeakMap,p=new WeakMap;let v={},_={},g=new WeakMap,S=[],b=null,R=!1,x=null,y=null,w=null,D=null,C=null,G=null,B=null,F=new Ee(0,0,0),T=0,U=!1,et=null,H=null,q=null,nt=null,ot=null;const Y=a.getParameter(a.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let z=!1,A=0;const ht=a.getParameter(a.VERSION);ht.indexOf("WebGL")!==-1?(A=parseFloat(/^WebGL (\d)/.exec(ht)[1]),z=A>=1):ht.indexOf("OpenGL ES")!==-1&&(A=parseFloat(/^OpenGL ES (\d)/.exec(ht)[1]),z=A>=2);let lt=null,Ct={};const I=a.getParameter(a.SCISSOR_BOX),K=a.getParameter(a.VIEWPORT),Mt=new Ze().fromArray(I),wt=new Ze().fromArray(K);function Bt(j,zt,Ft,kt){const Ot=new Uint8Array(4),bt=a.createTexture();a.bindTexture(j,bt),a.texParameteri(j,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(j,a.TEXTURE_MAG_FILTER,a.NEAREST);for(let jt=0;jt<Ft;jt++)j===a.TEXTURE_3D||j===a.TEXTURE_2D_ARRAY?a.texImage3D(zt,0,a.RGBA,1,1,kt,0,a.RGBA,a.UNSIGNED_BYTE,Ot):a.texImage2D(zt+jt,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,Ot);return bt}const st={};st[a.TEXTURE_2D]=Bt(a.TEXTURE_2D,a.TEXTURE_2D,1),st[a.TEXTURE_CUBE_MAP]=Bt(a.TEXTURE_CUBE_MAP,a.TEXTURE_CUBE_MAP_POSITIVE_X,6),st[a.TEXTURE_2D_ARRAY]=Bt(a.TEXTURE_2D_ARRAY,a.TEXTURE_2D_ARRAY,1,1),st[a.TEXTURE_3D]=Bt(a.TEXTURE_3D,a.TEXTURE_3D,1,1),c.setClear(0,0,0,1),f.setClear(1),d.setClear(0),Et(a.DEPTH_TEST),f.setFunc(lo),Yt(!1),se(k_),Et(a.CULL_FACE),oe(Pa);function Et(j){v[j]!==!0&&(a.enable(j),v[j]=!0)}function gt(j){v[j]!==!1&&(a.disable(j),v[j]=!1)}function Ut(j,zt){return _[j]!==zt?(a.bindFramebuffer(j,zt),_[j]=zt,j===a.DRAW_FRAMEBUFFER&&(_[a.FRAMEBUFFER]=zt),j===a.FRAMEBUFFER&&(_[a.DRAW_FRAMEBUFFER]=zt),!0):!1}function tt(j,zt){let Ft=S,kt=!1;if(j){Ft=g.get(zt),Ft===void 0&&(Ft=[],g.set(zt,Ft));const Ot=j.textures;if(Ft.length!==Ot.length||Ft[0]!==a.COLOR_ATTACHMENT0){for(let bt=0,jt=Ot.length;bt<jt;bt++)Ft[bt]=a.COLOR_ATTACHMENT0+bt;Ft.length=Ot.length,kt=!0}}else Ft[0]!==a.BACK&&(Ft[0]=a.BACK,kt=!0);kt&&a.drawBuffers(Ft)}function ct(j){return b!==j?(a.useProgram(j),b=j,!0):!1}const qt={[Qs]:a.FUNC_ADD,[gM]:a.FUNC_SUBTRACT,[_M]:a.FUNC_REVERSE_SUBTRACT};qt[vM]=a.MIN,qt[xM]=a.MAX;const Xt={[yM]:a.ZERO,[SM]:a.ONE,[MM]:a.SRC_COLOR,[Gd]:a.SRC_ALPHA,[wM]:a.SRC_ALPHA_SATURATE,[AM]:a.DST_COLOR,[EM]:a.DST_ALPHA,[bM]:a.ONE_MINUS_SRC_COLOR,[Vd]:a.ONE_MINUS_SRC_ALPHA,[RM]:a.ONE_MINUS_DST_COLOR,[TM]:a.ONE_MINUS_DST_ALPHA,[CM]:a.CONSTANT_COLOR,[DM]:a.ONE_MINUS_CONSTANT_COLOR,[UM]:a.CONSTANT_ALPHA,[LM]:a.ONE_MINUS_CONSTANT_ALPHA};function oe(j,zt,Ft,kt,Ot,bt,jt,he,Ie,De){if(j===Pa){R===!0&&(gt(a.BLEND),R=!1);return}if(R===!1&&(Et(a.BLEND),R=!0),j!==mM){if(j!==x||De!==U){if((y!==Qs||C!==Qs)&&(a.blendEquation(a.FUNC_ADD),y=Qs,C=Qs),De)switch(j){case so:a.blendFuncSeparate(a.ONE,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA);break;case X_:a.blendFunc(a.ONE,a.ONE);break;case W_:a.blendFuncSeparate(a.ZERO,a.ONE_MINUS_SRC_COLOR,a.ZERO,a.ONE);break;case q_:a.blendFuncSeparate(a.DST_COLOR,a.ONE_MINUS_SRC_ALPHA,a.ZERO,a.ONE);break;default:Pe("WebGLState: Invalid blending: ",j);break}else switch(j){case so:a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA);break;case X_:a.blendFuncSeparate(a.SRC_ALPHA,a.ONE,a.ONE,a.ONE);break;case W_:Pe("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case q_:Pe("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Pe("WebGLState: Invalid blending: ",j);break}w=null,D=null,G=null,B=null,F.set(0,0,0),T=0,x=j,U=De}return}Ot=Ot||zt,bt=bt||Ft,jt=jt||kt,(zt!==y||Ot!==C)&&(a.blendEquationSeparate(qt[zt],qt[Ot]),y=zt,C=Ot),(Ft!==w||kt!==D||bt!==G||jt!==B)&&(a.blendFuncSeparate(Xt[Ft],Xt[kt],Xt[bt],Xt[jt]),w=Ft,D=kt,G=bt,B=jt),(he.equals(F)===!1||Ie!==T)&&(a.blendColor(he.r,he.g,he.b,Ie),F.copy(he),T=Ie),x=j,U=!1}function de(j,zt){j.side===ki?gt(a.CULL_FACE):Et(a.CULL_FACE);let Ft=j.side===si;zt&&(Ft=!Ft),Yt(Ft),j.blending===so&&j.transparent===!1?oe(Pa):oe(j.blending,j.blendEquation,j.blendSrc,j.blendDst,j.blendEquationAlpha,j.blendSrcAlpha,j.blendDstAlpha,j.blendColor,j.blendAlpha,j.premultipliedAlpha),f.setFunc(j.depthFunc),f.setTest(j.depthTest),f.setMask(j.depthWrite),c.setMask(j.colorWrite);const kt=j.stencilWrite;d.setTest(kt),kt&&(d.setMask(j.stencilWriteMask),d.setFunc(j.stencilFunc,j.stencilRef,j.stencilFuncMask),d.setOp(j.stencilFail,j.stencilZFail,j.stencilZPass)),ce(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits),j.alphaToCoverage===!0?Et(a.SAMPLE_ALPHA_TO_COVERAGE):gt(a.SAMPLE_ALPHA_TO_COVERAGE)}function Yt(j){et!==j&&(j?a.frontFace(a.CW):a.frontFace(a.CCW),et=j)}function se(j){j!==hM?(Et(a.CULL_FACE),j!==H&&(j===k_?a.cullFace(a.BACK):j===dM?a.cullFace(a.FRONT):a.cullFace(a.FRONT_AND_BACK))):gt(a.CULL_FACE),H=j}function X(j){j!==q&&(z&&a.lineWidth(j),q=j)}function ce(j,zt,Ft){j?(Et(a.POLYGON_OFFSET_FILL),(nt!==zt||ot!==Ft)&&(nt=zt,ot=Ft,f.getReversed()&&(zt=-zt),a.polygonOffset(zt,Ft))):gt(a.POLYGON_OFFSET_FILL)}function Jt(j){j?Et(a.SCISSOR_TEST):gt(a.SCISSOR_TEST)}function ne(j){j===void 0&&(j=a.TEXTURE0+Y-1),lt!==j&&(a.activeTexture(j),lt=j)}function Pt(j,zt,Ft){Ft===void 0&&(lt===null?Ft=a.TEXTURE0+Y-1:Ft=lt);let kt=Ct[Ft];kt===void 0&&(kt={type:void 0,texture:void 0},Ct[Ft]=kt),(kt.type!==j||kt.texture!==zt)&&(lt!==Ft&&(a.activeTexture(Ft),lt=Ft),a.bindTexture(j,zt||st[j]),kt.type=j,kt.texture=zt)}function O(){const j=Ct[lt];j!==void 0&&j.type!==void 0&&(a.bindTexture(j.type,null),j.type=void 0,j.texture=void 0)}function E(){try{a.compressedTexImage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function V(){try{a.compressedTexImage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function $(){try{a.texSubImage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function k(){try{a.texSubImage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function P(){try{a.compressedTexSubImage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function it(){try{a.compressedTexSubImage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function rt(){try{a.texStorage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function _t(){try{a.texStorage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function At(){try{a.texImage2D(...arguments)}catch(j){Pe("WebGLState:",j)}}function xt(){try{a.texImage3D(...arguments)}catch(j){Pe("WebGLState:",j)}}function St(j){Mt.equals(j)===!1&&(a.scissor(j.x,j.y,j.z,j.w),Mt.copy(j))}function Nt(j){wt.equals(j)===!1&&(a.viewport(j.x,j.y,j.z,j.w),wt.copy(j))}function Lt(j,zt){let Ft=p.get(zt);Ft===void 0&&(Ft=new WeakMap,p.set(zt,Ft));let kt=Ft.get(j);kt===void 0&&(kt=a.getUniformBlockIndex(zt,j.name),Ft.set(j,kt))}function It(j,zt){const kt=p.get(zt).get(j);m.get(zt)!==kt&&(a.uniformBlockBinding(zt,kt,j.__bindingPointIndex),m.set(zt,kt))}function $t(){a.disable(a.BLEND),a.disable(a.CULL_FACE),a.disable(a.DEPTH_TEST),a.disable(a.POLYGON_OFFSET_FILL),a.disable(a.SCISSOR_TEST),a.disable(a.STENCIL_TEST),a.disable(a.SAMPLE_ALPHA_TO_COVERAGE),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ONE,a.ZERO),a.blendFuncSeparate(a.ONE,a.ZERO,a.ONE,a.ZERO),a.blendColor(0,0,0,0),a.colorMask(!0,!0,!0,!0),a.clearColor(0,0,0,0),a.depthMask(!0),a.depthFunc(a.LESS),f.setReversed(!1),a.clearDepth(1),a.stencilMask(4294967295),a.stencilFunc(a.ALWAYS,0,4294967295),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),a.clearStencil(0),a.cullFace(a.BACK),a.frontFace(a.CCW),a.polygonOffset(0,0),a.activeTexture(a.TEXTURE0),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,null),a.bindFramebuffer(a.READ_FRAMEBUFFER,null),a.useProgram(null),a.lineWidth(1),a.scissor(0,0,a.canvas.width,a.canvas.height),a.viewport(0,0,a.canvas.width,a.canvas.height),v={},lt=null,Ct={},_={},g=new WeakMap,S=[],b=null,R=!1,x=null,y=null,w=null,D=null,C=null,G=null,B=null,F=new Ee(0,0,0),T=0,U=!1,et=null,H=null,q=null,nt=null,ot=null,Mt.set(0,0,a.canvas.width,a.canvas.height),wt.set(0,0,a.canvas.width,a.canvas.height),c.reset(),f.reset(),d.reset()}return{buffers:{color:c,depth:f,stencil:d},enable:Et,disable:gt,bindFramebuffer:Ut,drawBuffers:tt,useProgram:ct,setBlending:oe,setMaterial:de,setFlipSided:Yt,setCullFace:se,setLineWidth:X,setPolygonOffset:ce,setScissorTest:Jt,activeTexture:ne,bindTexture:Pt,unbindTexture:O,compressedTexImage2D:E,compressedTexImage3D:V,texImage2D:At,texImage3D:xt,updateUBOMapping:Lt,uniformBlockBinding:It,texStorage2D:rt,texStorage3D:_t,texSubImage2D:$,texSubImage3D:k,compressedTexSubImage2D:P,compressedTexSubImage3D:it,scissor:St,viewport:Nt,reset:$t}}function z2(a,t,i,s,l,c,f){const d=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,m=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new _e,v=new WeakMap;let _;const g=new WeakMap;let S=!1;try{S=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(O,E){return S?new OffscreenCanvas(O,E):Lu("canvas")}function R(O,E,V){let $=1;const k=Pt(O);if((k.width>V||k.height>V)&&($=V/Math.max(k.width,k.height)),$<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const P=Math.floor($*k.width),it=Math.floor($*k.height);_===void 0&&(_=b(P,it));const rt=E?b(P,it):_;return rt.width=P,rt.height=it,rt.getContext("2d").drawImage(O,0,0,P,it),ue("WebGLRenderer: Texture has been resized from ("+k.width+"x"+k.height+") to ("+P+"x"+it+")."),rt}else return"data"in O&&ue("WebGLRenderer: Image in DataTexture is too big ("+k.width+"x"+k.height+")."),O;return O}function x(O){return O.generateMipmaps}function y(O){a.generateMipmap(O)}function w(O){return O.isWebGLCubeRenderTarget?a.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?a.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?a.TEXTURE_2D_ARRAY:a.TEXTURE_2D}function D(O,E,V,$,k=!1){if(O!==null){if(a[O]!==void 0)return a[O];ue("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let P=E;if(E===a.RED&&(V===a.FLOAT&&(P=a.R32F),V===a.HALF_FLOAT&&(P=a.R16F),V===a.UNSIGNED_BYTE&&(P=a.R8)),E===a.RED_INTEGER&&(V===a.UNSIGNED_BYTE&&(P=a.R8UI),V===a.UNSIGNED_SHORT&&(P=a.R16UI),V===a.UNSIGNED_INT&&(P=a.R32UI),V===a.BYTE&&(P=a.R8I),V===a.SHORT&&(P=a.R16I),V===a.INT&&(P=a.R32I)),E===a.RG&&(V===a.FLOAT&&(P=a.RG32F),V===a.HALF_FLOAT&&(P=a.RG16F),V===a.UNSIGNED_BYTE&&(P=a.RG8)),E===a.RG_INTEGER&&(V===a.UNSIGNED_BYTE&&(P=a.RG8UI),V===a.UNSIGNED_SHORT&&(P=a.RG16UI),V===a.UNSIGNED_INT&&(P=a.RG32UI),V===a.BYTE&&(P=a.RG8I),V===a.SHORT&&(P=a.RG16I),V===a.INT&&(P=a.RG32I)),E===a.RGB_INTEGER&&(V===a.UNSIGNED_BYTE&&(P=a.RGB8UI),V===a.UNSIGNED_SHORT&&(P=a.RGB16UI),V===a.UNSIGNED_INT&&(P=a.RGB32UI),V===a.BYTE&&(P=a.RGB8I),V===a.SHORT&&(P=a.RGB16I),V===a.INT&&(P=a.RGB32I)),E===a.RGBA_INTEGER&&(V===a.UNSIGNED_BYTE&&(P=a.RGBA8UI),V===a.UNSIGNED_SHORT&&(P=a.RGBA16UI),V===a.UNSIGNED_INT&&(P=a.RGBA32UI),V===a.BYTE&&(P=a.RGBA8I),V===a.SHORT&&(P=a.RGBA16I),V===a.INT&&(P=a.RGBA32I)),E===a.RGB&&(V===a.UNSIGNED_INT_5_9_9_9_REV&&(P=a.RGB9_E5),V===a.UNSIGNED_INT_10F_11F_11F_REV&&(P=a.R11F_G11F_B10F)),E===a.RGBA){const it=k?Uu:Ue.getTransfer($);V===a.FLOAT&&(P=a.RGBA32F),V===a.HALF_FLOAT&&(P=a.RGBA16F),V===a.UNSIGNED_BYTE&&(P=it===Ge?a.SRGB8_ALPHA8:a.RGBA8),V===a.UNSIGNED_SHORT_4_4_4_4&&(P=a.RGBA4),V===a.UNSIGNED_SHORT_5_5_5_1&&(P=a.RGB5_A1)}return(P===a.R16F||P===a.R32F||P===a.RG16F||P===a.RG32F||P===a.RGBA16F||P===a.RGBA32F)&&t.get("EXT_color_buffer_float"),P}function C(O,E){let V;return O?E===null||E===la||E===yl?V=a.DEPTH24_STENCIL8:E===ia?V=a.DEPTH32F_STENCIL8:E===xl&&(V=a.DEPTH24_STENCIL8,ue("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):E===null||E===la||E===yl?V=a.DEPTH_COMPONENT24:E===ia?V=a.DEPTH_COMPONENT32F:E===xl&&(V=a.DEPTH_COMPONENT16),V}function G(O,E){return x(O)===!0||O.isFramebufferTexture&&O.minFilter!==zn&&O.minFilter!==Vn?Math.log2(Math.max(E.width,E.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?E.mipmaps.length:1}function B(O){const E=O.target;E.removeEventListener("dispose",B),T(E),E.isVideoTexture&&v.delete(E)}function F(O){const E=O.target;E.removeEventListener("dispose",F),et(E)}function T(O){const E=s.get(O);if(E.__webglInit===void 0)return;const V=O.source,$=g.get(V);if($){const k=$[E.__cacheKey];k.usedTimes--,k.usedTimes===0&&U(O),Object.keys($).length===0&&g.delete(V)}s.remove(O)}function U(O){const E=s.get(O);a.deleteTexture(E.__webglTexture);const V=O.source,$=g.get(V);delete $[E.__cacheKey],f.memory.textures--}function et(O){const E=s.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),s.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let $=0;$<6;$++){if(Array.isArray(E.__webglFramebuffer[$]))for(let k=0;k<E.__webglFramebuffer[$].length;k++)a.deleteFramebuffer(E.__webglFramebuffer[$][k]);else a.deleteFramebuffer(E.__webglFramebuffer[$]);E.__webglDepthbuffer&&a.deleteRenderbuffer(E.__webglDepthbuffer[$])}else{if(Array.isArray(E.__webglFramebuffer))for(let $=0;$<E.__webglFramebuffer.length;$++)a.deleteFramebuffer(E.__webglFramebuffer[$]);else a.deleteFramebuffer(E.__webglFramebuffer);if(E.__webglDepthbuffer&&a.deleteRenderbuffer(E.__webglDepthbuffer),E.__webglMultisampledFramebuffer&&a.deleteFramebuffer(E.__webglMultisampledFramebuffer),E.__webglColorRenderbuffer)for(let $=0;$<E.__webglColorRenderbuffer.length;$++)E.__webglColorRenderbuffer[$]&&a.deleteRenderbuffer(E.__webglColorRenderbuffer[$]);E.__webglDepthRenderbuffer&&a.deleteRenderbuffer(E.__webglDepthRenderbuffer)}const V=O.textures;for(let $=0,k=V.length;$<k;$++){const P=s.get(V[$]);P.__webglTexture&&(a.deleteTexture(P.__webglTexture),f.memory.textures--),s.remove(V[$])}s.remove(O)}let H=0;function q(){H=0}function nt(){const O=H;return O>=l.maxTextures&&ue("WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+l.maxTextures),H+=1,O}function ot(O){const E=[];return E.push(O.wrapS),E.push(O.wrapT),E.push(O.wrapR||0),E.push(O.magFilter),E.push(O.minFilter),E.push(O.anisotropy),E.push(O.internalFormat),E.push(O.format),E.push(O.type),E.push(O.generateMipmaps),E.push(O.premultiplyAlpha),E.push(O.flipY),E.push(O.unpackAlignment),E.push(O.colorSpace),E.join()}function Y(O,E){const V=s.get(O);if(O.isVideoTexture&&Jt(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&V.__version!==O.version){const $=O.image;if($===null)ue("WebGLRenderer: Texture marked for update but no image data found.");else if($.complete===!1)ue("WebGLRenderer: Texture marked for update but image is incomplete");else{st(V,O,E);return}}else O.isExternalTexture&&(V.__webglTexture=O.sourceTexture?O.sourceTexture:null);i.bindTexture(a.TEXTURE_2D,V.__webglTexture,a.TEXTURE0+E)}function z(O,E){const V=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&V.__version!==O.version){st(V,O,E);return}else O.isExternalTexture&&(V.__webglTexture=O.sourceTexture?O.sourceTexture:null);i.bindTexture(a.TEXTURE_2D_ARRAY,V.__webglTexture,a.TEXTURE0+E)}function A(O,E){const V=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&V.__version!==O.version){st(V,O,E);return}i.bindTexture(a.TEXTURE_3D,V.__webglTexture,a.TEXTURE0+E)}function ht(O,E){const V=s.get(O);if(O.isCubeDepthTexture!==!0&&O.version>0&&V.__version!==O.version){Et(V,O,E);return}i.bindTexture(a.TEXTURE_CUBE_MAP,V.__webglTexture,a.TEXTURE0+E)}const lt={[Kd]:a.REPEAT,[Oa]:a.CLAMP_TO_EDGE,[Qd]:a.MIRRORED_REPEAT},Ct={[zn]:a.NEAREST,[PM]:a.NEAREST_MIPMAP_NEAREST,[Fc]:a.NEAREST_MIPMAP_LINEAR,[Vn]:a.LINEAR,[ad]:a.LINEAR_MIPMAP_NEAREST,[$s]:a.LINEAR_MIPMAP_LINEAR},I={[IM]:a.NEVER,[kM]:a.ALWAYS,[BM]:a.LESS,[Wp]:a.LEQUAL,[HM]:a.EQUAL,[qp]:a.GEQUAL,[GM]:a.GREATER,[VM]:a.NOTEQUAL};function K(O,E){if(E.type===ia&&t.has("OES_texture_float_linear")===!1&&(E.magFilter===Vn||E.magFilter===ad||E.magFilter===Fc||E.magFilter===$s||E.minFilter===Vn||E.minFilter===ad||E.minFilter===Fc||E.minFilter===$s)&&ue("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),a.texParameteri(O,a.TEXTURE_WRAP_S,lt[E.wrapS]),a.texParameteri(O,a.TEXTURE_WRAP_T,lt[E.wrapT]),(O===a.TEXTURE_3D||O===a.TEXTURE_2D_ARRAY)&&a.texParameteri(O,a.TEXTURE_WRAP_R,lt[E.wrapR]),a.texParameteri(O,a.TEXTURE_MAG_FILTER,Ct[E.magFilter]),a.texParameteri(O,a.TEXTURE_MIN_FILTER,Ct[E.minFilter]),E.compareFunction&&(a.texParameteri(O,a.TEXTURE_COMPARE_MODE,a.COMPARE_REF_TO_TEXTURE),a.texParameteri(O,a.TEXTURE_COMPARE_FUNC,I[E.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(E.magFilter===zn||E.minFilter!==Fc&&E.minFilter!==$s||E.type===ia&&t.has("OES_texture_float_linear")===!1)return;if(E.anisotropy>1||s.get(E).__currentAnisotropy){const V=t.get("EXT_texture_filter_anisotropic");a.texParameterf(O,V.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,l.getMaxAnisotropy())),s.get(E).__currentAnisotropy=E.anisotropy}}}function Mt(O,E){let V=!1;O.__webglInit===void 0&&(O.__webglInit=!0,E.addEventListener("dispose",B));const $=E.source;let k=g.get($);k===void 0&&(k={},g.set($,k));const P=ot(E);if(P!==O.__cacheKey){k[P]===void 0&&(k[P]={texture:a.createTexture(),usedTimes:0},f.memory.textures++,V=!0),k[P].usedTimes++;const it=k[O.__cacheKey];it!==void 0&&(k[O.__cacheKey].usedTimes--,it.usedTimes===0&&U(E)),O.__cacheKey=P,O.__webglTexture=k[P].texture}return V}function wt(O,E,V){return Math.floor(Math.floor(O/V)/E)}function Bt(O,E,V,$){const P=O.updateRanges;if(P.length===0)i.texSubImage2D(a.TEXTURE_2D,0,0,0,E.width,E.height,V,$,E.data);else{P.sort((xt,St)=>xt.start-St.start);let it=0;for(let xt=1;xt<P.length;xt++){const St=P[it],Nt=P[xt],Lt=St.start+St.count,It=wt(Nt.start,E.width,4),$t=wt(St.start,E.width,4);Nt.start<=Lt+1&&It===$t&&wt(Nt.start+Nt.count-1,E.width,4)===It?St.count=Math.max(St.count,Nt.start+Nt.count-St.start):(++it,P[it]=Nt)}P.length=it+1;const rt=a.getParameter(a.UNPACK_ROW_LENGTH),_t=a.getParameter(a.UNPACK_SKIP_PIXELS),At=a.getParameter(a.UNPACK_SKIP_ROWS);a.pixelStorei(a.UNPACK_ROW_LENGTH,E.width);for(let xt=0,St=P.length;xt<St;xt++){const Nt=P[xt],Lt=Math.floor(Nt.start/4),It=Math.ceil(Nt.count/4),$t=Lt%E.width,j=Math.floor(Lt/E.width),zt=It,Ft=1;a.pixelStorei(a.UNPACK_SKIP_PIXELS,$t),a.pixelStorei(a.UNPACK_SKIP_ROWS,j),i.texSubImage2D(a.TEXTURE_2D,0,$t,j,zt,Ft,V,$,E.data)}O.clearUpdateRanges(),a.pixelStorei(a.UNPACK_ROW_LENGTH,rt),a.pixelStorei(a.UNPACK_SKIP_PIXELS,_t),a.pixelStorei(a.UNPACK_SKIP_ROWS,At)}}function st(O,E,V){let $=a.TEXTURE_2D;(E.isDataArrayTexture||E.isCompressedArrayTexture)&&($=a.TEXTURE_2D_ARRAY),E.isData3DTexture&&($=a.TEXTURE_3D);const k=Mt(O,E),P=E.source;i.bindTexture($,O.__webglTexture,a.TEXTURE0+V);const it=s.get(P);if(P.version!==it.__version||k===!0){i.activeTexture(a.TEXTURE0+V);const rt=Ue.getPrimaries(Ue.workingColorSpace),_t=E.colorSpace===ys?null:Ue.getPrimaries(E.colorSpace),At=E.colorSpace===ys||rt===_t?a.NONE:a.BROWSER_DEFAULT_WEBGL;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,E.flipY),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),a.pixelStorei(a.UNPACK_ALIGNMENT,E.unpackAlignment),a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,At);let xt=R(E.image,!1,l.maxTextureSize);xt=ne(E,xt);const St=c.convert(E.format,E.colorSpace),Nt=c.convert(E.type);let Lt=D(E.internalFormat,St,Nt,E.colorSpace,E.isVideoTexture);K($,E);let It;const $t=E.mipmaps,j=E.isVideoTexture!==!0,zt=it.__version===void 0||k===!0,Ft=P.dataReady,kt=G(E,xt);if(E.isDepthTexture)Lt=C(E.format===tr,E.type),zt&&(j?i.texStorage2D(a.TEXTURE_2D,1,Lt,xt.width,xt.height):i.texImage2D(a.TEXTURE_2D,0,Lt,xt.width,xt.height,0,St,Nt,null));else if(E.isDataTexture)if($t.length>0){j&&zt&&i.texStorage2D(a.TEXTURE_2D,kt,Lt,$t[0].width,$t[0].height);for(let Ot=0,bt=$t.length;Ot<bt;Ot++)It=$t[Ot],j?Ft&&i.texSubImage2D(a.TEXTURE_2D,Ot,0,0,It.width,It.height,St,Nt,It.data):i.texImage2D(a.TEXTURE_2D,Ot,Lt,It.width,It.height,0,St,Nt,It.data);E.generateMipmaps=!1}else j?(zt&&i.texStorage2D(a.TEXTURE_2D,kt,Lt,xt.width,xt.height),Ft&&Bt(E,xt,St,Nt)):i.texImage2D(a.TEXTURE_2D,0,Lt,xt.width,xt.height,0,St,Nt,xt.data);else if(E.isCompressedTexture)if(E.isCompressedArrayTexture){j&&zt&&i.texStorage3D(a.TEXTURE_2D_ARRAY,kt,Lt,$t[0].width,$t[0].height,xt.depth);for(let Ot=0,bt=$t.length;Ot<bt;Ot++)if(It=$t[Ot],E.format!==Wi)if(St!==null)if(j){if(Ft)if(E.layerUpdates.size>0){const jt=bv(It.width,It.height,E.format,E.type);for(const he of E.layerUpdates){const Ie=It.data.subarray(he*jt/It.data.BYTES_PER_ELEMENT,(he+1)*jt/It.data.BYTES_PER_ELEMENT);i.compressedTexSubImage3D(a.TEXTURE_2D_ARRAY,Ot,0,0,he,It.width,It.height,1,St,Ie)}E.clearLayerUpdates()}else i.compressedTexSubImage3D(a.TEXTURE_2D_ARRAY,Ot,0,0,0,It.width,It.height,xt.depth,St,It.data)}else i.compressedTexImage3D(a.TEXTURE_2D_ARRAY,Ot,Lt,It.width,It.height,xt.depth,0,It.data,0,0);else ue("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else j?Ft&&i.texSubImage3D(a.TEXTURE_2D_ARRAY,Ot,0,0,0,It.width,It.height,xt.depth,St,Nt,It.data):i.texImage3D(a.TEXTURE_2D_ARRAY,Ot,Lt,It.width,It.height,xt.depth,0,St,Nt,It.data)}else{j&&zt&&i.texStorage2D(a.TEXTURE_2D,kt,Lt,$t[0].width,$t[0].height);for(let Ot=0,bt=$t.length;Ot<bt;Ot++)It=$t[Ot],E.format!==Wi?St!==null?j?Ft&&i.compressedTexSubImage2D(a.TEXTURE_2D,Ot,0,0,It.width,It.height,St,It.data):i.compressedTexImage2D(a.TEXTURE_2D,Ot,Lt,It.width,It.height,0,It.data):ue("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):j?Ft&&i.texSubImage2D(a.TEXTURE_2D,Ot,0,0,It.width,It.height,St,Nt,It.data):i.texImage2D(a.TEXTURE_2D,Ot,Lt,It.width,It.height,0,St,Nt,It.data)}else if(E.isDataArrayTexture)if(j){if(zt&&i.texStorage3D(a.TEXTURE_2D_ARRAY,kt,Lt,xt.width,xt.height,xt.depth),Ft)if(E.layerUpdates.size>0){const Ot=bv(xt.width,xt.height,E.format,E.type);for(const bt of E.layerUpdates){const jt=xt.data.subarray(bt*Ot/xt.data.BYTES_PER_ELEMENT,(bt+1)*Ot/xt.data.BYTES_PER_ELEMENT);i.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,bt,xt.width,xt.height,1,St,Nt,jt)}E.clearLayerUpdates()}else i.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,0,xt.width,xt.height,xt.depth,St,Nt,xt.data)}else i.texImage3D(a.TEXTURE_2D_ARRAY,0,Lt,xt.width,xt.height,xt.depth,0,St,Nt,xt.data);else if(E.isData3DTexture)j?(zt&&i.texStorage3D(a.TEXTURE_3D,kt,Lt,xt.width,xt.height,xt.depth),Ft&&i.texSubImage3D(a.TEXTURE_3D,0,0,0,0,xt.width,xt.height,xt.depth,St,Nt,xt.data)):i.texImage3D(a.TEXTURE_3D,0,Lt,xt.width,xt.height,xt.depth,0,St,Nt,xt.data);else if(E.isFramebufferTexture){if(zt)if(j)i.texStorage2D(a.TEXTURE_2D,kt,Lt,xt.width,xt.height);else{let Ot=xt.width,bt=xt.height;for(let jt=0;jt<kt;jt++)i.texImage2D(a.TEXTURE_2D,jt,Lt,Ot,bt,0,St,Nt,null),Ot>>=1,bt>>=1}}else if($t.length>0){if(j&&zt){const Ot=Pt($t[0]);i.texStorage2D(a.TEXTURE_2D,kt,Lt,Ot.width,Ot.height)}for(let Ot=0,bt=$t.length;Ot<bt;Ot++)It=$t[Ot],j?Ft&&i.texSubImage2D(a.TEXTURE_2D,Ot,0,0,St,Nt,It):i.texImage2D(a.TEXTURE_2D,Ot,Lt,St,Nt,It);E.generateMipmaps=!1}else if(j){if(zt){const Ot=Pt(xt);i.texStorage2D(a.TEXTURE_2D,kt,Lt,Ot.width,Ot.height)}Ft&&i.texSubImage2D(a.TEXTURE_2D,0,0,0,St,Nt,xt)}else i.texImage2D(a.TEXTURE_2D,0,Lt,St,Nt,xt);x(E)&&y($),it.__version=P.version,E.onUpdate&&E.onUpdate(E)}O.__version=E.version}function Et(O,E,V){if(E.image.length!==6)return;const $=Mt(O,E),k=E.source;i.bindTexture(a.TEXTURE_CUBE_MAP,O.__webglTexture,a.TEXTURE0+V);const P=s.get(k);if(k.version!==P.__version||$===!0){i.activeTexture(a.TEXTURE0+V);const it=Ue.getPrimaries(Ue.workingColorSpace),rt=E.colorSpace===ys?null:Ue.getPrimaries(E.colorSpace),_t=E.colorSpace===ys||it===rt?a.NONE:a.BROWSER_DEFAULT_WEBGL;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,E.flipY),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),a.pixelStorei(a.UNPACK_ALIGNMENT,E.unpackAlignment),a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,_t);const At=E.isCompressedTexture||E.image[0].isCompressedTexture,xt=E.image[0]&&E.image[0].isDataTexture,St=[];for(let bt=0;bt<6;bt++)!At&&!xt?St[bt]=R(E.image[bt],!0,l.maxCubemapSize):St[bt]=xt?E.image[bt].image:E.image[bt],St[bt]=ne(E,St[bt]);const Nt=St[0],Lt=c.convert(E.format,E.colorSpace),It=c.convert(E.type),$t=D(E.internalFormat,Lt,It,E.colorSpace),j=E.isVideoTexture!==!0,zt=P.__version===void 0||$===!0,Ft=k.dataReady;let kt=G(E,Nt);K(a.TEXTURE_CUBE_MAP,E);let Ot;if(At){j&&zt&&i.texStorage2D(a.TEXTURE_CUBE_MAP,kt,$t,Nt.width,Nt.height);for(let bt=0;bt<6;bt++){Ot=St[bt].mipmaps;for(let jt=0;jt<Ot.length;jt++){const he=Ot[jt];E.format!==Wi?Lt!==null?j?Ft&&i.compressedTexSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt,0,0,he.width,he.height,Lt,he.data):i.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt,$t,he.width,he.height,0,he.data):ue("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt,0,0,he.width,he.height,Lt,It,he.data):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt,$t,he.width,he.height,0,Lt,It,he.data)}}}else{if(Ot=E.mipmaps,j&&zt){Ot.length>0&&kt++;const bt=Pt(St[0]);i.texStorage2D(a.TEXTURE_CUBE_MAP,kt,$t,bt.width,bt.height)}for(let bt=0;bt<6;bt++)if(xt){j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,0,0,St[bt].width,St[bt].height,Lt,It,St[bt].data):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,$t,St[bt].width,St[bt].height,0,Lt,It,St[bt].data);for(let jt=0;jt<Ot.length;jt++){const Ie=Ot[jt].image[bt].image;j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt+1,0,0,Ie.width,Ie.height,Lt,It,Ie.data):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt+1,$t,Ie.width,Ie.height,0,Lt,It,Ie.data)}}else{j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,0,0,Lt,It,St[bt]):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,$t,Lt,It,St[bt]);for(let jt=0;jt<Ot.length;jt++){const he=Ot[jt];j?Ft&&i.texSubImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt+1,0,0,Lt,It,he.image[bt]):i.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+bt,jt+1,$t,Lt,It,he.image[bt])}}}x(E)&&y(a.TEXTURE_CUBE_MAP),P.__version=k.version,E.onUpdate&&E.onUpdate(E)}O.__version=E.version}function gt(O,E,V,$,k,P){const it=c.convert(V.format,V.colorSpace),rt=c.convert(V.type),_t=D(V.internalFormat,it,rt,V.colorSpace),At=s.get(E),xt=s.get(V);if(xt.__renderTarget=E,!At.__hasExternalTextures){const St=Math.max(1,E.width>>P),Nt=Math.max(1,E.height>>P);k===a.TEXTURE_3D||k===a.TEXTURE_2D_ARRAY?i.texImage3D(k,P,_t,St,Nt,E.depth,0,it,rt,null):i.texImage2D(k,P,_t,St,Nt,0,it,rt,null)}i.bindFramebuffer(a.FRAMEBUFFER,O),ce(E)?d.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,$,k,xt.__webglTexture,0,X(E)):(k===a.TEXTURE_2D||k>=a.TEXTURE_CUBE_MAP_POSITIVE_X&&k<=a.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&a.framebufferTexture2D(a.FRAMEBUFFER,$,k,xt.__webglTexture,P),i.bindFramebuffer(a.FRAMEBUFFER,null)}function Ut(O,E,V){if(a.bindRenderbuffer(a.RENDERBUFFER,O),E.depthBuffer){const $=E.depthTexture,k=$&&$.isDepthTexture?$.type:null,P=C(E.stencilBuffer,k),it=E.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;ce(E)?d.renderbufferStorageMultisampleEXT(a.RENDERBUFFER,X(E),P,E.width,E.height):V?a.renderbufferStorageMultisample(a.RENDERBUFFER,X(E),P,E.width,E.height):a.renderbufferStorage(a.RENDERBUFFER,P,E.width,E.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,it,a.RENDERBUFFER,O)}else{const $=E.textures;for(let k=0;k<$.length;k++){const P=$[k],it=c.convert(P.format,P.colorSpace),rt=c.convert(P.type),_t=D(P.internalFormat,it,rt,P.colorSpace);ce(E)?d.renderbufferStorageMultisampleEXT(a.RENDERBUFFER,X(E),_t,E.width,E.height):V?a.renderbufferStorageMultisample(a.RENDERBUFFER,X(E),_t,E.width,E.height):a.renderbufferStorage(a.RENDERBUFFER,_t,E.width,E.height)}}a.bindRenderbuffer(a.RENDERBUFFER,null)}function tt(O,E,V){const $=E.isWebGLCubeRenderTarget===!0;if(i.bindFramebuffer(a.FRAMEBUFFER,O),!(E.depthTexture&&E.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const k=s.get(E.depthTexture);if(k.__renderTarget=E,(!k.__webglTexture||E.depthTexture.image.width!==E.width||E.depthTexture.image.height!==E.height)&&(E.depthTexture.image.width=E.width,E.depthTexture.image.height=E.height,E.depthTexture.needsUpdate=!0),$){if(k.__webglInit===void 0&&(k.__webglInit=!0,E.depthTexture.addEventListener("dispose",B)),k.__webglTexture===void 0){k.__webglTexture=a.createTexture(),i.bindTexture(a.TEXTURE_CUBE_MAP,k.__webglTexture),K(a.TEXTURE_CUBE_MAP,E.depthTexture);const At=c.convert(E.depthTexture.format),xt=c.convert(E.depthTexture.type);let St;E.depthTexture.format===Ba?St=a.DEPTH_COMPONENT24:E.depthTexture.format===tr&&(St=a.DEPTH24_STENCIL8);for(let Nt=0;Nt<6;Nt++)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+Nt,0,St,E.width,E.height,0,At,xt,null)}}else Y(E.depthTexture,0);const P=k.__webglTexture,it=X(E),rt=$?a.TEXTURE_CUBE_MAP_POSITIVE_X+V:a.TEXTURE_2D,_t=E.depthTexture.format===tr?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;if(E.depthTexture.format===Ba)ce(E)?d.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,_t,rt,P,0,it):a.framebufferTexture2D(a.FRAMEBUFFER,_t,rt,P,0);else if(E.depthTexture.format===tr)ce(E)?d.framebufferTexture2DMultisampleEXT(a.FRAMEBUFFER,_t,rt,P,0,it):a.framebufferTexture2D(a.FRAMEBUFFER,_t,rt,P,0);else throw new Error("Unknown depthTexture format")}function ct(O){const E=s.get(O),V=O.isWebGLCubeRenderTarget===!0;if(E.__boundDepthTexture!==O.depthTexture){const $=O.depthTexture;if(E.__depthDisposeCallback&&E.__depthDisposeCallback(),$){const k=()=>{delete E.__boundDepthTexture,delete E.__depthDisposeCallback,$.removeEventListener("dispose",k)};$.addEventListener("dispose",k),E.__depthDisposeCallback=k}E.__boundDepthTexture=$}if(O.depthTexture&&!E.__autoAllocateDepthBuffer)if(V)for(let $=0;$<6;$++)tt(E.__webglFramebuffer[$],O,$);else{const $=O.texture.mipmaps;$&&$.length>0?tt(E.__webglFramebuffer[0],O,0):tt(E.__webglFramebuffer,O,0)}else if(V){E.__webglDepthbuffer=[];for(let $=0;$<6;$++)if(i.bindFramebuffer(a.FRAMEBUFFER,E.__webglFramebuffer[$]),E.__webglDepthbuffer[$]===void 0)E.__webglDepthbuffer[$]=a.createRenderbuffer(),Ut(E.__webglDepthbuffer[$],O,!1);else{const k=O.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,P=E.__webglDepthbuffer[$];a.bindRenderbuffer(a.RENDERBUFFER,P),a.framebufferRenderbuffer(a.FRAMEBUFFER,k,a.RENDERBUFFER,P)}}else{const $=O.texture.mipmaps;if($&&$.length>0?i.bindFramebuffer(a.FRAMEBUFFER,E.__webglFramebuffer[0]):i.bindFramebuffer(a.FRAMEBUFFER,E.__webglFramebuffer),E.__webglDepthbuffer===void 0)E.__webglDepthbuffer=a.createRenderbuffer(),Ut(E.__webglDepthbuffer,O,!1);else{const k=O.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,P=E.__webglDepthbuffer;a.bindRenderbuffer(a.RENDERBUFFER,P),a.framebufferRenderbuffer(a.FRAMEBUFFER,k,a.RENDERBUFFER,P)}}i.bindFramebuffer(a.FRAMEBUFFER,null)}function qt(O,E,V){const $=s.get(O);E!==void 0&>($.__webglFramebuffer,O,O.texture,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,0),V!==void 0&&ct(O)}function Xt(O){const E=O.texture,V=s.get(O),$=s.get(E);O.addEventListener("dispose",F);const k=O.textures,P=O.isWebGLCubeRenderTarget===!0,it=k.length>1;if(it||($.__webglTexture===void 0&&($.__webglTexture=a.createTexture()),$.__version=E.version,f.memory.textures++),P){V.__webglFramebuffer=[];for(let rt=0;rt<6;rt++)if(E.mipmaps&&E.mipmaps.length>0){V.__webglFramebuffer[rt]=[];for(let _t=0;_t<E.mipmaps.length;_t++)V.__webglFramebuffer[rt][_t]=a.createFramebuffer()}else V.__webglFramebuffer[rt]=a.createFramebuffer()}else{if(E.mipmaps&&E.mipmaps.length>0){V.__webglFramebuffer=[];for(let rt=0;rt<E.mipmaps.length;rt++)V.__webglFramebuffer[rt]=a.createFramebuffer()}else V.__webglFramebuffer=a.createFramebuffer();if(it)for(let rt=0,_t=k.length;rt<_t;rt++){const At=s.get(k[rt]);At.__webglTexture===void 0&&(At.__webglTexture=a.createTexture(),f.memory.textures++)}if(O.samples>0&&ce(O)===!1){V.__webglMultisampledFramebuffer=a.createFramebuffer(),V.__webglColorRenderbuffer=[],i.bindFramebuffer(a.FRAMEBUFFER,V.__webglMultisampledFramebuffer);for(let rt=0;rt<k.length;rt++){const _t=k[rt];V.__webglColorRenderbuffer[rt]=a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,V.__webglColorRenderbuffer[rt]);const At=c.convert(_t.format,_t.colorSpace),xt=c.convert(_t.type),St=D(_t.internalFormat,At,xt,_t.colorSpace,O.isXRRenderTarget===!0),Nt=X(O);a.renderbufferStorageMultisample(a.RENDERBUFFER,Nt,St,O.width,O.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+rt,a.RENDERBUFFER,V.__webglColorRenderbuffer[rt])}a.bindRenderbuffer(a.RENDERBUFFER,null),O.depthBuffer&&(V.__webglDepthRenderbuffer=a.createRenderbuffer(),Ut(V.__webglDepthRenderbuffer,O,!0)),i.bindFramebuffer(a.FRAMEBUFFER,null)}}if(P){i.bindTexture(a.TEXTURE_CUBE_MAP,$.__webglTexture),K(a.TEXTURE_CUBE_MAP,E);for(let rt=0;rt<6;rt++)if(E.mipmaps&&E.mipmaps.length>0)for(let _t=0;_t<E.mipmaps.length;_t++)gt(V.__webglFramebuffer[rt][_t],O,E,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+rt,_t);else gt(V.__webglFramebuffer[rt],O,E,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+rt,0);x(E)&&y(a.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(it){for(let rt=0,_t=k.length;rt<_t;rt++){const At=k[rt],xt=s.get(At);let St=a.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(St=O.isWebGL3DRenderTarget?a.TEXTURE_3D:a.TEXTURE_2D_ARRAY),i.bindTexture(St,xt.__webglTexture),K(St,At),gt(V.__webglFramebuffer,O,At,a.COLOR_ATTACHMENT0+rt,St,0),x(At)&&y(St)}i.unbindTexture()}else{let rt=a.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(rt=O.isWebGL3DRenderTarget?a.TEXTURE_3D:a.TEXTURE_2D_ARRAY),i.bindTexture(rt,$.__webglTexture),K(rt,E),E.mipmaps&&E.mipmaps.length>0)for(let _t=0;_t<E.mipmaps.length;_t++)gt(V.__webglFramebuffer[_t],O,E,a.COLOR_ATTACHMENT0,rt,_t);else gt(V.__webglFramebuffer,O,E,a.COLOR_ATTACHMENT0,rt,0);x(E)&&y(rt),i.unbindTexture()}O.depthBuffer&&ct(O)}function oe(O){const E=O.textures;for(let V=0,$=E.length;V<$;V++){const k=E[V];if(x(k)){const P=w(O),it=s.get(k).__webglTexture;i.bindTexture(P,it),y(P),i.unbindTexture()}}}const de=[],Yt=[];function se(O){if(O.samples>0){if(ce(O)===!1){const E=O.textures,V=O.width,$=O.height;let k=a.COLOR_BUFFER_BIT;const P=O.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT,it=s.get(O),rt=E.length>1;if(rt)for(let At=0;At<E.length;At++)i.bindFramebuffer(a.FRAMEBUFFER,it.__webglMultisampledFramebuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+At,a.RENDERBUFFER,null),i.bindFramebuffer(a.FRAMEBUFFER,it.__webglFramebuffer),a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0+At,a.TEXTURE_2D,null,0);i.bindFramebuffer(a.READ_FRAMEBUFFER,it.__webglMultisampledFramebuffer);const _t=O.texture.mipmaps;_t&&_t.length>0?i.bindFramebuffer(a.DRAW_FRAMEBUFFER,it.__webglFramebuffer[0]):i.bindFramebuffer(a.DRAW_FRAMEBUFFER,it.__webglFramebuffer);for(let At=0;At<E.length;At++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(k|=a.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(k|=a.STENCIL_BUFFER_BIT)),rt){a.framebufferRenderbuffer(a.READ_FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,it.__webglColorRenderbuffer[At]);const xt=s.get(E[At]).__webglTexture;a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,xt,0)}a.blitFramebuffer(0,0,V,$,0,0,V,$,k,a.NEAREST),m===!0&&(de.length=0,Yt.length=0,de.push(a.COLOR_ATTACHMENT0+At),O.depthBuffer&&O.resolveDepthBuffer===!1&&(de.push(P),Yt.push(P),a.invalidateFramebuffer(a.DRAW_FRAMEBUFFER,Yt)),a.invalidateFramebuffer(a.READ_FRAMEBUFFER,de))}if(i.bindFramebuffer(a.READ_FRAMEBUFFER,null),i.bindFramebuffer(a.DRAW_FRAMEBUFFER,null),rt)for(let At=0;At<E.length;At++){i.bindFramebuffer(a.FRAMEBUFFER,it.__webglMultisampledFramebuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0+At,a.RENDERBUFFER,it.__webglColorRenderbuffer[At]);const xt=s.get(E[At]).__webglTexture;i.bindFramebuffer(a.FRAMEBUFFER,it.__webglFramebuffer),a.framebufferTexture2D(a.DRAW_FRAMEBUFFER,a.COLOR_ATTACHMENT0+At,a.TEXTURE_2D,xt,0)}i.bindFramebuffer(a.DRAW_FRAMEBUFFER,it.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&m){const E=O.stencilBuffer?a.DEPTH_STENCIL_ATTACHMENT:a.DEPTH_ATTACHMENT;a.invalidateFramebuffer(a.DRAW_FRAMEBUFFER,[E])}}}function X(O){return Math.min(l.maxSamples,O.samples)}function ce(O){const E=s.get(O);return O.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&E.__useRenderToTexture!==!1}function Jt(O){const E=f.render.frame;v.get(O)!==E&&(v.set(O,E),O.update())}function ne(O,E){const V=O.colorSpace,$=O.format,k=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||V!==fo&&V!==ys&&(Ue.getTransfer(V)===Ge?($!==Wi||k!==vi)&&ue("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Pe("WebGLTextures: Unsupported texture color space:",V)),E}function Pt(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(p.width=O.naturalWidth||O.width,p.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(p.width=O.displayWidth,p.height=O.displayHeight):(p.width=O.width,p.height=O.height),p}this.allocateTextureUnit=nt,this.resetTextureUnits=q,this.setTexture2D=Y,this.setTexture2DArray=z,this.setTexture3D=A,this.setTextureCube=ht,this.rebindTextures=qt,this.setupRenderTarget=Xt,this.updateRenderTargetMipmap=oe,this.updateMultisampleRenderTarget=se,this.setupDepthRenderbuffer=ct,this.setupFrameBufferTexture=gt,this.useMultisampledRTT=ce,this.isReversedDepthBuffer=function(){return i.buffers.depth.getReversed()}}function F2(a,t){function i(s,l=ys){let c;const f=Ue.getTransfer(l);if(s===vi)return a.UNSIGNED_BYTE;if(s===Hp)return a.UNSIGNED_SHORT_4_4_4_4;if(s===Gp)return a.UNSIGNED_SHORT_5_5_5_1;if(s===Sx)return a.UNSIGNED_INT_5_9_9_9_REV;if(s===Mx)return a.UNSIGNED_INT_10F_11F_11F_REV;if(s===xx)return a.BYTE;if(s===yx)return a.SHORT;if(s===xl)return a.UNSIGNED_SHORT;if(s===Bp)return a.INT;if(s===la)return a.UNSIGNED_INT;if(s===ia)return a.FLOAT;if(s===Ia)return a.HALF_FLOAT;if(s===bx)return a.ALPHA;if(s===Ex)return a.RGB;if(s===Wi)return a.RGBA;if(s===Ba)return a.DEPTH_COMPONENT;if(s===tr)return a.DEPTH_STENCIL;if(s===Tx)return a.RED;if(s===Vp)return a.RED_INTEGER;if(s===uo)return a.RG;if(s===kp)return a.RG_INTEGER;if(s===Xp)return a.RGBA_INTEGER;if(s===bu||s===Eu||s===Tu||s===Au)if(f===Ge)if(c=t.get("WEBGL_compressed_texture_s3tc_srgb"),c!==null){if(s===bu)return c.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===Eu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===Tu)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===Au)return c.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(c=t.get("WEBGL_compressed_texture_s3tc"),c!==null){if(s===bu)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===Eu)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===Tu)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===Au)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Jd||s===$d||s===tp||s===ep)if(c=t.get("WEBGL_compressed_texture_pvrtc"),c!==null){if(s===Jd)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===$d)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===tp)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===ep)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===np||s===ip||s===ap||s===sp||s===rp||s===op||s===lp)if(c=t.get("WEBGL_compressed_texture_etc"),c!==null){if(s===np||s===ip)return f===Ge?c.COMPRESSED_SRGB8_ETC2:c.COMPRESSED_RGB8_ETC2;if(s===ap)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:c.COMPRESSED_RGBA8_ETC2_EAC;if(s===sp)return c.COMPRESSED_R11_EAC;if(s===rp)return c.COMPRESSED_SIGNED_R11_EAC;if(s===op)return c.COMPRESSED_RG11_EAC;if(s===lp)return c.COMPRESSED_SIGNED_RG11_EAC}else return null;if(s===cp||s===up||s===fp||s===hp||s===dp||s===pp||s===mp||s===gp||s===_p||s===vp||s===xp||s===yp||s===Sp||s===Mp)if(c=t.get("WEBGL_compressed_texture_astc"),c!==null){if(s===cp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:c.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===up)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:c.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===fp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:c.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===hp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:c.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===dp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:c.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===pp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:c.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===mp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:c.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===gp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:c.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===_p)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:c.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===vp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:c.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===xp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:c.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===yp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:c.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Sp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:c.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Mp)return f===Ge?c.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:c.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===bp||s===Ep||s===Tp)if(c=t.get("EXT_texture_compression_bptc"),c!==null){if(s===bp)return f===Ge?c.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:c.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Ep)return c.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Tp)return c.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===Ap||s===Rp||s===wp||s===Cp)if(c=t.get("EXT_texture_compression_rgtc"),c!==null){if(s===Ap)return c.COMPRESSED_RED_RGTC1_EXT;if(s===Rp)return c.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===wp)return c.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Cp)return c.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===yl?a.UNSIGNED_INT_24_8:a[s]!==void 0?a[s]:null}return{convert:i}}const I2=`
|
|
4034
4034
|
void main() {
|
|
4035
4035
|
|
|
4036
4036
|
gl_Position = vec4( position, 1.0 );
|
|
4037
4037
|
|
|
4038
|
-
}`,
|
|
4038
|
+
}`,B2=`
|
|
4039
4039
|
uniform sampler2DArray depthColor;
|
|
4040
4040
|
uniform float depthWidth;
|
|
4041
4041
|
uniform float depthHeight;
|
|
@@ -4054,7 +4054,7 @@ void main() {
|
|
|
4054
4054
|
|
|
4055
4055
|
}
|
|
4056
4056
|
|
|
4057
|
-
}`;class B2{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,i){if(this.texture===null){const s=new Ox(t.texture);(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const i=t.cameras[0].viewport,s=new qi({vertexShader:F2,fragmentShader:I2,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new Gn(new Gu(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class H2 extends ar{constructor(t,i){super();const s=this;let l=null,c=1,f=null,d="local-floor",m=1,p=null,v=null,_=null,g=null,M=null,E=null;const R=typeof XRWebGLBinding<"u",x=new B2,y={},w=i.getContextAttributes();let D=null,C=null;const G=[],B=[],F=new _e;let T=null;const U=new Vi;U.viewport=new je;const et=new Vi;et.viewport=new je;const H=[U,et],q=new jb;let nt=null,ot=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(st){let Et=G[st];return Et===void 0&&(Et=new ud,G[st]=Et),Et.getTargetRaySpace()},this.getControllerGrip=function(st){let Et=G[st];return Et===void 0&&(Et=new ud,G[st]=Et),Et.getGripSpace()},this.getHand=function(st){let Et=G[st];return Et===void 0&&(Et=new ud,G[st]=Et),Et.getHandSpace()};function Y(st){const Et=B.indexOf(st.inputSource);if(Et===-1)return;const gt=G[Et];gt!==void 0&&(gt.update(st.inputSource,st.frame,p||f),gt.dispatchEvent({type:st.type,data:st.inputSource}))}function z(){l.removeEventListener("select",Y),l.removeEventListener("selectstart",Y),l.removeEventListener("selectend",Y),l.removeEventListener("squeeze",Y),l.removeEventListener("squeezestart",Y),l.removeEventListener("squeezeend",Y),l.removeEventListener("end",z),l.removeEventListener("inputsourceschange",A);for(let st=0;st<G.length;st++){const Et=B[st];Et!==null&&(B[st]=null,G[st].disconnect(Et))}nt=null,ot=null,x.reset();for(const st in y)delete y[st];t.setRenderTarget(D),M=null,g=null,_=null,l=null,C=null,Bt.stop(),s.isPresenting=!1,t.setPixelRatio(T),t.setSize(F.width,F.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(st){c=st,s.isPresenting===!0&&ue("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(st){d=st,s.isPresenting===!0&&ue("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||f},this.setReferenceSpace=function(st){p=st},this.getBaseLayer=function(){return g!==null?g:M},this.getBinding=function(){return _===null&&R&&(_=new XRWebGLBinding(l,i)),_},this.getFrame=function(){return E},this.getSession=function(){return l},this.setSession=async function(st){if(l=st,l!==null){if(D=t.getRenderTarget(),l.addEventListener("select",Y),l.addEventListener("selectstart",Y),l.addEventListener("selectend",Y),l.addEventListener("squeeze",Y),l.addEventListener("squeezestart",Y),l.addEventListener("squeezeend",Y),l.addEventListener("end",z),l.addEventListener("inputsourceschange",A),w.xrCompatible!==!0&&await i.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(F),R&&"createProjectionLayer"in XRWebGLBinding.prototype){let gt=null,Ut=null,tt=null;w.depth&&(tt=w.stencil?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24,gt=w.stencil?tr:Ba,Ut=w.stencil?yl:la);const ct={colorFormat:i.RGBA8,depthFormat:tt,scaleFactor:c};_=this.getBinding(),g=_.createProjectionLayer(ct),l.updateRenderState({layers:[g]}),t.setPixelRatio(1),t.setSize(g.textureWidth,g.textureHeight,!1),C=new oa(g.textureWidth,g.textureHeight,{format:Wi,type:vi,depthTexture:new bl(g.textureWidth,g.textureHeight,Ut,void 0,void 0,void 0,void 0,void 0,void 0,gt),stencilBuffer:w.stencil,colorSpace:t.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}else{const gt={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:c};M=new XRWebGLLayer(l,i,gt),l.updateRenderState({baseLayer:M}),t.setPixelRatio(1),t.setSize(M.framebufferWidth,M.framebufferHeight,!1),C=new oa(M.framebufferWidth,M.framebufferHeight,{format:Wi,type:vi,colorSpace:t.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:M.ignoreDepthValues===!1,resolveStencilBuffer:M.ignoreDepthValues===!1})}C.isXRRenderTarget=!0,this.setFoveation(m),p=null,f=await l.requestReferenceSpace(d),Bt.setContext(l),Bt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(l!==null)return l.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};function A(st){for(let Et=0;Et<st.removed.length;Et++){const gt=st.removed[Et],Ut=B.indexOf(gt);Ut>=0&&(B[Ut]=null,G[Ut].disconnect(gt))}for(let Et=0;Et<st.added.length;Et++){const gt=st.added[Et];let Ut=B.indexOf(gt);if(Ut===-1){for(let ct=0;ct<G.length;ct++)if(ct>=B.length){B.push(gt),Ut=ct;break}else if(B[ct]===null){B[ct]=gt,Ut=ct;break}if(Ut===-1)break}const tt=G[Ut];tt&&tt.connect(gt)}}const ht=new Q,lt=new Q;function Ct(st,Et,gt){ht.setFromMatrixPosition(Et.matrixWorld),lt.setFromMatrixPosition(gt.matrixWorld);const Ut=ht.distanceTo(lt),tt=Et.projectionMatrix.elements,ct=gt.projectionMatrix.elements,qt=tt[14]/(tt[10]-1),Xt=tt[14]/(tt[10]+1),oe=(tt[9]+1)/tt[5],de=(tt[9]-1)/tt[5],Yt=(tt[8]-1)/tt[0],se=(ct[8]+1)/ct[0],X=qt*Yt,ce=qt*se,Jt=Ut/(-Yt+se),ne=Jt*-Yt;if(Et.matrixWorld.decompose(st.position,st.quaternion,st.scale),st.translateX(ne),st.translateZ(Jt),st.matrixWorld.compose(st.position,st.quaternion,st.scale),st.matrixWorldInverse.copy(st.matrixWorld).invert(),tt[10]===-1)st.projectionMatrix.copy(Et.projectionMatrix),st.projectionMatrixInverse.copy(Et.projectionMatrixInverse);else{const Pt=qt+Jt,O=Xt+Jt,b=X-ne,V=ce+(Ut-ne),$=oe*Xt/O*Pt,k=de*Xt/O*Pt;st.projectionMatrix.makePerspective(b,V,$,k,Pt,O),st.projectionMatrixInverse.copy(st.projectionMatrix).invert()}}function I(st,Et){Et===null?st.matrixWorld.copy(st.matrix):st.matrixWorld.multiplyMatrices(Et.matrixWorld,st.matrix),st.matrixWorldInverse.copy(st.matrixWorld).invert()}this.updateCamera=function(st){if(l===null)return;let Et=st.near,gt=st.far;x.texture!==null&&(x.depthNear>0&&(Et=x.depthNear),x.depthFar>0&&(gt=x.depthFar)),q.near=et.near=U.near=Et,q.far=et.far=U.far=gt,(nt!==q.near||ot!==q.far)&&(l.updateRenderState({depthNear:q.near,depthFar:q.far}),nt=q.near,ot=q.far),q.layers.mask=st.layers.mask|6,U.layers.mask=q.layers.mask&-5,et.layers.mask=q.layers.mask&-3;const Ut=st.parent,tt=q.cameras;I(q,Ut);for(let ct=0;ct<tt.length;ct++)I(tt[ct],Ut);tt.length===2?Ct(q,U,et):q.projectionMatrix.copy(U.projectionMatrix),K(st,q,Ut)};function K(st,Et,gt){gt===null?st.matrix.copy(Et.matrixWorld):(st.matrix.copy(gt.matrixWorld),st.matrix.invert(),st.matrix.multiply(Et.matrixWorld)),st.matrix.decompose(st.position,st.quaternion,st.scale),st.updateMatrixWorld(!0),st.projectionMatrix.copy(Et.projectionMatrix),st.projectionMatrixInverse.copy(Et.projectionMatrixInverse),st.isPerspectiveCamera&&(st.fov=Ml*2*Math.atan(1/st.projectionMatrix.elements[5]),st.zoom=1)}this.getCamera=function(){return q},this.getFoveation=function(){if(!(g===null&&M===null))return m},this.setFoveation=function(st){m=st,g!==null&&(g.fixedFoveation=st),M!==null&&M.fixedFoveation!==void 0&&(M.fixedFoveation=st)},this.hasDepthSensing=function(){return x.texture!==null},this.getDepthSensingMesh=function(){return x.getMesh(q)},this.getCameraTexture=function(st){return y[st]};let Mt=null;function wt(st,Et){if(v=Et.getViewerPose(p||f),E=Et,v!==null){const gt=v.views;M!==null&&(t.setRenderTargetFramebuffer(C,M.framebuffer),t.setRenderTarget(C));let Ut=!1;gt.length!==q.cameras.length&&(q.cameras.length=0,Ut=!0);for(let Xt=0;Xt<gt.length;Xt++){const oe=gt[Xt];let de=null;if(M!==null)de=M.getViewport(oe);else{const se=_.getViewSubImage(g,oe);de=se.viewport,Xt===0&&(t.setRenderTargetTextures(C,se.colorTexture,se.depthStencilTexture),t.setRenderTarget(C))}let Yt=H[Xt];Yt===void 0&&(Yt=new Vi,Yt.layers.enable(Xt),Yt.viewport=new je,H[Xt]=Yt),Yt.matrix.fromArray(oe.transform.matrix),Yt.matrix.decompose(Yt.position,Yt.quaternion,Yt.scale),Yt.projectionMatrix.fromArray(oe.projectionMatrix),Yt.projectionMatrixInverse.copy(Yt.projectionMatrix).invert(),Yt.viewport.set(de.x,de.y,de.width,de.height),Xt===0&&(q.matrix.copy(Yt.matrix),q.matrix.decompose(q.position,q.quaternion,q.scale)),Ut===!0&&q.cameras.push(Yt)}const tt=l.enabledFeatures;if(tt&&tt.includes("depth-sensing")&&l.depthUsage=="gpu-optimized"&&R){_=s.getBinding();const Xt=_.getDepthInformation(gt[0]);Xt&&Xt.isValid&&Xt.texture&&x.init(Xt,l.renderState)}if(tt&&tt.includes("camera-access")&&R){t.state.unbindTexture(),_=s.getBinding();for(let Xt=0;Xt<gt.length;Xt++){const oe=gt[Xt].camera;if(oe){let de=y[oe];de||(de=new Ox,y[oe]=de);const Yt=_.getCameraImage(oe);de.sourceTexture=Yt}}}}for(let gt=0;gt<G.length;gt++){const Ut=B[gt],tt=G[gt];Ut!==null&&tt!==void 0&&tt.update(Ut,Et,p||f)}Mt&&Mt(st,Et),Et.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:Et}),E=null}const Bt=new Ix;Bt.setAnimationLoop(wt),this.setAnimationLoop=function(st){Mt=st},this.dispose=function(){}}}const Ks=new ca,G2=new nn;function V2(a,t){function i(x,y){x.matrixAutoUpdate===!0&&x.updateMatrix(),y.value.copy(x.matrix)}function s(x,y){y.color.getRGB(x.fogColor.value,Px(a)),y.isFog?(x.fogNear.value=y.near,x.fogFar.value=y.far):y.isFogExp2&&(x.fogDensity.value=y.density)}function l(x,y,w,D,C){y.isMeshBasicMaterial?c(x,y):y.isMeshLambertMaterial?(c(x,y),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)):y.isMeshToonMaterial?(c(x,y),_(x,y)):y.isMeshPhongMaterial?(c(x,y),v(x,y),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)):y.isMeshStandardMaterial?(c(x,y),g(x,y),y.isMeshPhysicalMaterial&&M(x,y,C)):y.isMeshMatcapMaterial?(c(x,y),E(x,y)):y.isMeshDepthMaterial?c(x,y):y.isMeshDistanceMaterial?(c(x,y),R(x,y)):y.isMeshNormalMaterial?c(x,y):y.isLineBasicMaterial?(f(x,y),y.isLineDashedMaterial&&d(x,y)):y.isPointsMaterial?m(x,y,w,D):y.isSpriteMaterial?p(x,y):y.isShadowMaterial?(x.color.value.copy(y.color),x.opacity.value=y.opacity):y.isShaderMaterial&&(y.uniformsNeedUpdate=!1)}function c(x,y){x.opacity.value=y.opacity,y.color&&x.diffuse.value.copy(y.color),y.emissive&&x.emissive.value.copy(y.emissive).multiplyScalar(y.emissiveIntensity),y.map&&(x.map.value=y.map,i(y.map,x.mapTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.bumpMap&&(x.bumpMap.value=y.bumpMap,i(y.bumpMap,x.bumpMapTransform),x.bumpScale.value=y.bumpScale,y.side===si&&(x.bumpScale.value*=-1)),y.normalMap&&(x.normalMap.value=y.normalMap,i(y.normalMap,x.normalMapTransform),x.normalScale.value.copy(y.normalScale),y.side===si&&x.normalScale.value.negate()),y.displacementMap&&(x.displacementMap.value=y.displacementMap,i(y.displacementMap,x.displacementMapTransform),x.displacementScale.value=y.displacementScale,x.displacementBias.value=y.displacementBias),y.emissiveMap&&(x.emissiveMap.value=y.emissiveMap,i(y.emissiveMap,x.emissiveMapTransform)),y.specularMap&&(x.specularMap.value=y.specularMap,i(y.specularMap,x.specularMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest);const w=t.get(y),D=w.envMap,C=w.envMapRotation;D&&(x.envMap.value=D,Ks.copy(C),Ks.x*=-1,Ks.y*=-1,Ks.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(Ks.y*=-1,Ks.z*=-1),x.envMapRotation.value.setFromMatrix4(G2.makeRotationFromEuler(Ks)),x.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=y.reflectivity,x.ior.value=y.ior,x.refractionRatio.value=y.refractionRatio),y.lightMap&&(x.lightMap.value=y.lightMap,x.lightMapIntensity.value=y.lightMapIntensity,i(y.lightMap,x.lightMapTransform)),y.aoMap&&(x.aoMap.value=y.aoMap,x.aoMapIntensity.value=y.aoMapIntensity,i(y.aoMap,x.aoMapTransform))}function f(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,y.map&&(x.map.value=y.map,i(y.map,x.mapTransform))}function d(x,y){x.dashSize.value=y.dashSize,x.totalSize.value=y.dashSize+y.gapSize,x.scale.value=y.scale}function m(x,y,w,D){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.size.value=y.size*w,x.scale.value=D*.5,y.map&&(x.map.value=y.map,i(y.map,x.uvTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function p(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.rotation.value=y.rotation,y.map&&(x.map.value=y.map,i(y.map,x.mapTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function v(x,y){x.specular.value.copy(y.specular),x.shininess.value=Math.max(y.shininess,1e-4)}function _(x,y){y.gradientMap&&(x.gradientMap.value=y.gradientMap)}function g(x,y){x.metalness.value=y.metalness,y.metalnessMap&&(x.metalnessMap.value=y.metalnessMap,i(y.metalnessMap,x.metalnessMapTransform)),x.roughness.value=y.roughness,y.roughnessMap&&(x.roughnessMap.value=y.roughnessMap,i(y.roughnessMap,x.roughnessMapTransform)),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)}function M(x,y,w){x.ior.value=y.ior,y.sheen>0&&(x.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),x.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(x.sheenColorMap.value=y.sheenColorMap,i(y.sheenColorMap,x.sheenColorMapTransform)),y.sheenRoughnessMap&&(x.sheenRoughnessMap.value=y.sheenRoughnessMap,i(y.sheenRoughnessMap,x.sheenRoughnessMapTransform))),y.clearcoat>0&&(x.clearcoat.value=y.clearcoat,x.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(x.clearcoatMap.value=y.clearcoatMap,i(y.clearcoatMap,x.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,i(y.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(x.clearcoatNormalMap.value=y.clearcoatNormalMap,i(y.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===si&&x.clearcoatNormalScale.value.negate())),y.dispersion>0&&(x.dispersion.value=y.dispersion),y.iridescence>0&&(x.iridescence.value=y.iridescence,x.iridescenceIOR.value=y.iridescenceIOR,x.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(x.iridescenceMap.value=y.iridescenceMap,i(y.iridescenceMap,x.iridescenceMapTransform)),y.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=y.iridescenceThicknessMap,i(y.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),y.transmission>0&&(x.transmission.value=y.transmission,x.transmissionSamplerMap.value=w.texture,x.transmissionSamplerSize.value.set(w.width,w.height),y.transmissionMap&&(x.transmissionMap.value=y.transmissionMap,i(y.transmissionMap,x.transmissionMapTransform)),x.thickness.value=y.thickness,y.thicknessMap&&(x.thicknessMap.value=y.thicknessMap,i(y.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=y.attenuationDistance,x.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(x.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(x.anisotropyMap.value=y.anisotropyMap,i(y.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=y.specularIntensity,x.specularColor.value.copy(y.specularColor),y.specularColorMap&&(x.specularColorMap.value=y.specularColorMap,i(y.specularColorMap,x.specularColorMapTransform)),y.specularIntensityMap&&(x.specularIntensityMap.value=y.specularIntensityMap,i(y.specularIntensityMap,x.specularIntensityMapTransform))}function E(x,y){y.matcap&&(x.matcap.value=y.matcap)}function R(x,y){const w=t.get(y).light;x.referencePosition.value.setFromMatrixPosition(w.matrixWorld),x.nearDistance.value=w.shadow.camera.near,x.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:l}}function k2(a,t,i,s){let l={},c={},f=[];const d=a.getParameter(a.MAX_UNIFORM_BUFFER_BINDINGS);function m(w,D){const C=D.program;s.uniformBlockBinding(w,C)}function p(w,D){let C=l[w.id];C===void 0&&(E(w),C=v(w),l[w.id]=C,w.addEventListener("dispose",x));const G=D.program;s.updateUBOMapping(w,G);const B=t.render.frame;c[w.id]!==B&&(g(w),c[w.id]=B)}function v(w){const D=_();w.__bindingPointIndex=D;const C=a.createBuffer(),G=w.__size,B=w.usage;return a.bindBuffer(a.UNIFORM_BUFFER,C),a.bufferData(a.UNIFORM_BUFFER,G,B),a.bindBuffer(a.UNIFORM_BUFFER,null),a.bindBufferBase(a.UNIFORM_BUFFER,D,C),C}function _(){for(let w=0;w<d;w++)if(f.indexOf(w)===-1)return f.push(w),w;return Pe("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function g(w){const D=l[w.id],C=w.uniforms,G=w.__cache;a.bindBuffer(a.UNIFORM_BUFFER,D);for(let B=0,F=C.length;B<F;B++){const T=Array.isArray(C[B])?C[B]:[C[B]];for(let U=0,et=T.length;U<et;U++){const H=T[U];if(M(H,B,U,G)===!0){const q=H.__offset,nt=Array.isArray(H.value)?H.value:[H.value];let ot=0;for(let Y=0;Y<nt.length;Y++){const z=nt[Y],A=R(z);typeof z=="number"||typeof z=="boolean"?(H.__data[0]=z,a.bufferSubData(a.UNIFORM_BUFFER,q+ot,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,ot),ot+=A.storage/Float32Array.BYTES_PER_ELEMENT)}a.bufferSubData(a.UNIFORM_BUFFER,q,H.__data)}}}a.bindBuffer(a.UNIFORM_BUFFER,null)}function M(w,D,C,G){const B=w.value,F=D+"_"+C;if(G[F]===void 0)return typeof B=="number"||typeof B=="boolean"?G[F]=B:G[F]=B.clone(),!0;{const T=G[F];if(typeof B=="number"||typeof B=="boolean"){if(T!==B)return G[F]=B,!0}else if(T.equals(B)===!1)return T.copy(B),!0}return!1}function E(w){const D=w.uniforms;let C=0;const G=16;for(let F=0,T=D.length;F<T;F++){const U=Array.isArray(D[F])?D[F]:[D[F]];for(let et=0,H=U.length;et<H;et++){const q=U[et],nt=Array.isArray(q.value)?q.value:[q.value];for(let ot=0,Y=nt.length;ot<Y;ot++){const z=nt[ot],A=R(z),ht=C%G,lt=ht%A.boundary,Ct=ht+lt;C+=lt,Ct!==0&&G-Ct<A.storage&&(C+=G-Ct),q.__data=new Float32Array(A.storage/Float32Array.BYTES_PER_ELEMENT),q.__offset=C,C+=A.storage}}}const B=C%G;return B>0&&(C+=G-B),w.__size=C,w.__cache={},this}function R(w){const D={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(D.boundary=4,D.storage=4):w.isVector2?(D.boundary=8,D.storage=8):w.isVector3||w.isColor?(D.boundary=16,D.storage=12):w.isVector4?(D.boundary=16,D.storage=16):w.isMatrix3?(D.boundary=48,D.storage=48):w.isMatrix4?(D.boundary=64,D.storage=64):w.isTexture?ue("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ue("WebGLRenderer: Unsupported uniform value type.",w),D}function x(w){const D=w.target;D.removeEventListener("dispose",x);const C=f.indexOf(D.__bindingPointIndex);f.splice(C,1),a.deleteBuffer(l[D.id]),delete l[D.id],delete c[D.id]}function y(){for(const w in l)a.deleteBuffer(l[w]);f=[],l={},c={}}return{bind:m,update:p,dispose:y}}const X2=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let $i=null;function W2(){return $i===null&&($i=new Cb(X2,16,16,uo,Ia),$i.name="DFG_LUT",$i.minFilter=Vn,$i.magFilter=Vn,$i.wrapS=Oa,$i.wrapT=Oa,$i.generateMipmaps=!1,$i.needsUpdate=!0),$i}class q2{constructor(t={}){const{canvas:i=XM(),context:s=null,depth:l=!0,stencil:c=!1,alpha:f=!1,antialias:d=!1,premultipliedAlpha:m=!0,preserveDrawingBuffer:p=!1,powerPreference:v="default",failIfMajorPerformanceCaveat:_=!1,reversedDepthBuffer:g=!1,outputBufferType:M=vi}=t;this.isWebGLRenderer=!0;let E;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");E=s.getContextAttributes().alpha}else E=f;const R=M,x=new Set([Xp,kp,Vp]),y=new Set([vi,la,xl,yl,Hp,Gp]),w=new Uint32Array(4),D=new Int32Array(4);let C=null,G=null;const B=[],F=[];let T=null;this.domElement=i,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ra,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const U=this;let et=!1;this._outputColorSpace=Ci;let H=0,q=0,nt=null,ot=-1,Y=null;const z=new je,A=new je;let ht=null;const lt=new Ee(0);let Ct=0,I=i.width,K=i.height,Mt=1,wt=null,Bt=null;const st=new je(0,0,I,K),Et=new je(0,0,I,K);let gt=!1;const Ut=new Kp;let tt=!1,ct=!1;const qt=new nn,Xt=new Q,oe=new je,de={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Yt=!1;function se(){return nt===null?Mt:1}let X=s;function ce(N,J){return i.getContext(N,J)}try{const N={alpha:!0,depth:l,stencil:c,antialias:d,premultipliedAlpha:m,preserveDrawingBuffer:p,powerPreference:v,failIfMajorPerformanceCaveat:_};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${Fp}`),i.addEventListener("webglcontextlost",jt,!1),i.addEventListener("webglcontextrestored",he,!1),i.addEventListener("webglcontextcreationerror",Ie,!1),X===null){const J="webgl2";if(X=ce(J,N),X===null)throw ce(J)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(N){throw Pe("WebGLRenderer: "+N.message),N}let Jt,ne,Pt,O,b,V,$,k,P,it,rt,_t,At,xt,St,Nt,Lt,It,$t,j,zt,Ft,kt;function Ot(){Jt=new qT(X),Jt.init(),zt=new z2(X,Jt),ne=new IT(X,Jt,t,zt),Pt=new O2(X,Jt),ne.reversedDepthBuffer&&g&&Pt.buffers.depth.setReversed(!0),O=new ZT(X),b=new y2,V=new P2(X,Jt,Pt,b,ne,zt,O),$=new WT(U),k=new tE(X),Ft=new zT(X,k),P=new YT(X,k,O,Ft),it=new QT(X,P,k,Ft,O),It=new KT(X,ne,V),St=new BT(b),rt=new x2(U,$,Jt,ne,Ft,St),_t=new V2(U,b),At=new M2,xt=new w2(Jt),Lt=new PT(U,$,Pt,it,E,m),Nt=new N2(U,it,ne),kt=new k2(X,O,ne,Pt),$t=new FT(X,Jt,O),j=new jT(X,Jt,O),O.programs=rt.programs,U.capabilities=ne,U.extensions=Jt,U.properties=b,U.renderLists=At,U.shadowMap=Nt,U.state=Pt,U.info=O}Ot(),R!==vi&&(T=new $T(R,i.width,i.height,l,c));const bt=new H2(U,X);this.xr=bt,this.getContext=function(){return X},this.getContextAttributes=function(){return X.getContextAttributes()},this.forceContextLoss=function(){const N=Jt.get("WEBGL_lose_context");N&&N.loseContext()},this.forceContextRestore=function(){const N=Jt.get("WEBGL_lose_context");N&&N.restoreContext()},this.getPixelRatio=function(){return Mt},this.setPixelRatio=function(N){N!==void 0&&(Mt=N,this.setSize(I,K,!1))},this.getSize=function(N){return N.set(I,K)},this.setSize=function(N,J,vt=!0){if(bt.isPresenting){ue("WebGLRenderer: Can't change size while VR device is presenting.");return}I=N,K=J,i.width=Math.floor(N*Mt),i.height=Math.floor(J*Mt),vt===!0&&(i.style.width=N+"px",i.style.height=J+"px"),T!==null&&T.setSize(i.width,i.height),this.setViewport(0,0,N,J)},this.getDrawingBufferSize=function(N){return N.set(I*Mt,K*Mt).floor()},this.setDrawingBufferSize=function(N,J,vt){I=N,K=J,Mt=vt,i.width=Math.floor(N*vt),i.height=Math.floor(J*vt),this.setViewport(0,0,N,J)},this.setEffects=function(N){if(R===vi){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(N){for(let J=0;J<N.length;J++)if(N[J].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}T.setEffects(N||[])},this.getCurrentViewport=function(N){return N.copy(z)},this.getViewport=function(N){return N.copy(st)},this.setViewport=function(N,J,vt,pt){N.isVector4?st.set(N.x,N.y,N.z,N.w):st.set(N,J,vt,pt),Pt.viewport(z.copy(st).multiplyScalar(Mt).round())},this.getScissor=function(N){return N.copy(Et)},this.setScissor=function(N,J,vt,pt){N.isVector4?Et.set(N.x,N.y,N.z,N.w):Et.set(N,J,vt,pt),Pt.scissor(A.copy(Et).multiplyScalar(Mt).round())},this.getScissorTest=function(){return gt},this.setScissorTest=function(N){Pt.setScissorTest(gt=N)},this.setOpaqueSort=function(N){wt=N},this.setTransparentSort=function(N){Bt=N},this.getClearColor=function(N){return N.copy(Lt.getClearColor())},this.setClearColor=function(){Lt.setClearColor(...arguments)},this.getClearAlpha=function(){return Lt.getClearAlpha()},this.setClearAlpha=function(){Lt.setClearAlpha(...arguments)},this.clear=function(N=!0,J=!0,vt=!0){let pt=0;if(N){let ut=!1;if(nt!==null){const Ht=nt.texture.format;ut=x.has(Ht)}if(ut){const Ht=nt.texture.type,Wt=y.has(Ht),Vt=Lt.getClearColor(),ee=Lt.getClearAlpha(),ae=Vt.r,fe=Vt.g,me=Vt.b;Wt?(w[0]=ae,w[1]=fe,w[2]=me,w[3]=ee,X.clearBufferuiv(X.COLOR,0,w)):(D[0]=ae,D[1]=fe,D[2]=me,D[3]=ee,X.clearBufferiv(X.COLOR,0,D))}else pt|=X.COLOR_BUFFER_BIT}J&&(pt|=X.DEPTH_BUFFER_BIT),vt&&(pt|=X.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),pt!==0&&X.clear(pt)},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(){i.removeEventListener("webglcontextlost",jt,!1),i.removeEventListener("webglcontextrestored",he,!1),i.removeEventListener("webglcontextcreationerror",Ie,!1),Lt.dispose(),At.dispose(),xt.dispose(),b.dispose(),$.dispose(),it.dispose(),Ft.dispose(),kt.dispose(),rt.dispose(),bt.dispose(),bt.removeEventListener("sessionstart",rr),bt.removeEventListener("sessionend",or),Yi.stop()};function jt(N){N.preventDefault(),Nu("WebGLRenderer: Context Lost."),et=!0}function he(){Nu("WebGLRenderer: Context Restored."),et=!1;const N=O.autoReset,J=Nt.enabled,vt=Nt.autoUpdate,pt=Nt.needsUpdate,ut=Nt.type;Ot(),O.autoReset=N,Nt.enabled=J,Nt.autoUpdate=vt,Nt.needsUpdate=pt,Nt.type=ut}function Ie(N){Pe("WebGLRenderer: A WebGL context could not be created. Reason: ",N.statusMessage)}function De(N){const J=N.target;J.removeEventListener("dispose",De),kn(J)}function kn(N){Ui(N),b.remove(N)}function Ui(N){const J=b.get(N).programs;J!==void 0&&(J.forEach(function(vt){rt.releaseProgram(vt)}),N.isShaderMaterial&&rt.releaseShaderCache(N))}this.renderBufferDirect=function(N,J,vt,pt,ut,Ht){J===null&&(J=de);const Wt=ut.isMesh&&ut.matrixWorld.determinant()<0,Vt=Rl(N,J,vt,pt,ut);Pt.setMaterial(pt,Wt);let ee=vt.index,ae=1;if(pt.wireframe===!0){if(ee=P.getWireframeAttribute(vt),ee===void 0)return;ae=2}const fe=vt.drawRange,me=vt.attributes.position;let Zt=fe.start*ae,ye=(fe.start+fe.count)*ae;Ht!==null&&(Zt=Math.max(Zt,Ht.start*ae),ye=Math.min(ye,(Ht.start+Ht.count)*ae)),ee!==null?(Zt=Math.max(Zt,0),ye=Math.min(ye,ee.count)):me!=null&&(Zt=Math.max(Zt,0),ye=Math.min(ye,me.count));const Je=ye-Zt;if(Je<0||Je===1/0)return;Ft.setup(ut,pt,Vt,vt,ee);let $e,Le=$t;if(ee!==null&&($e=k.get(ee),Le=j,Le.setIndex($e)),ut.isMesh)pt.wireframe===!0?(Pt.setLineWidth(pt.wireframeLinewidth*se()),Le.setMode(X.LINES)):Le.setMode(X.TRIANGLES);else if(ut.isLine){let xn=pt.linewidth;xn===void 0&&(xn=1),Pt.setLineWidth(xn*se()),ut.isLineSegments?Le.setMode(X.LINES):ut.isLineLoop?Le.setMode(X.LINE_LOOP):Le.setMode(X.LINE_STRIP)}else ut.isPoints?Le.setMode(X.POINTS):ut.isSprite&&Le.setMode(X.TRIANGLES);if(ut.isBatchedMesh)if(ut._multiDrawInstances!==null)Ou("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Le.renderMultiDrawInstances(ut._multiDrawStarts,ut._multiDrawCounts,ut._multiDrawCount,ut._multiDrawInstances);else if(Jt.get("WEBGL_multi_draw"))Le.renderMultiDraw(ut._multiDrawStarts,ut._multiDrawCounts,ut._multiDrawCount);else{const xn=ut._multiDrawStarts,te=ut._multiDrawCounts,Xn=ut._multiDrawCount,pe=ee?k.get(ee).bytesPerElement:1,Wn=b.get(pt).currentProgram.getUniforms();for(let ri=0;ri<Xn;ri++)Wn.setValue(X,"_gl_DrawID",ri),Le.render(xn[ri]/pe,te[ri])}else if(ut.isInstancedMesh)Le.renderInstances(Zt,Je,ut.count);else if(vt.isInstancedBufferGeometry){const xn=vt._maxInstanceCount!==void 0?vt._maxInstanceCount:1/0,te=Math.min(vt.instanceCount,xn);Le.renderInstances(Zt,Je,te)}else Le.render(Zt,Je)};function _o(N,J,vt){N.transparent===!0&&N.side===ki&&N.forceSinglePass===!1?(N.side=si,N.needsUpdate=!0,Ga(N,J,vt),N.side=Es,N.needsUpdate=!0,Ga(N,J,vt),N.side=ki):Ga(N,J,vt)}this.compile=function(N,J,vt=null){vt===null&&(vt=N),G=xt.get(vt),G.init(J),F.push(G),vt.traverseVisible(function(ut){ut.isLight&&ut.layers.test(J.layers)&&(G.pushLight(ut),ut.castShadow&&G.pushShadow(ut))}),N!==vt&&N.traverseVisible(function(ut){ut.isLight&&ut.layers.test(J.layers)&&(G.pushLight(ut),ut.castShadow&&G.pushShadow(ut))}),G.setupLights();const pt=new Set;return N.traverse(function(ut){if(!(ut.isMesh||ut.isPoints||ut.isLine||ut.isSprite))return;const Ht=ut.material;if(Ht)if(Array.isArray(Ht))for(let Wt=0;Wt<Ht.length;Wt++){const Vt=Ht[Wt];_o(Vt,vt,ut),pt.add(Vt)}else _o(Ht,vt,ut),pt.add(Ht)}),G=F.pop(),pt},this.compileAsync=function(N,J,vt=null){const pt=this.compile(N,J,vt);return new Promise(ut=>{function Ht(){if(pt.forEach(function(Wt){b.get(Wt).currentProgram.isReady()&&pt.delete(Wt)}),pt.size===0){ut(N);return}setTimeout(Ht,10)}Jt.get("KHR_parallel_shader_compile")!==null?Ht():setTimeout(Ht,10)})};let sr=null;function El(N){sr&&sr(N)}function rr(){Yi.stop()}function or(){Yi.start()}const Yi=new Ix;Yi.setAnimationLoop(El),typeof self<"u"&&Yi.setContext(self),this.setAnimationLoop=function(N){sr=N,bt.setAnimationLoop(N),N===null?Yi.stop():Yi.start()},bt.addEventListener("sessionstart",rr),bt.addEventListener("sessionend",or),this.render=function(N,J){if(J!==void 0&&J.isCamera!==!0){Pe("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(et===!0)return;const vt=bt.enabled===!0&&bt.isPresenting===!0,pt=T!==null&&(nt===null||vt)&&T.begin(U,nt);if(N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),J.parent===null&&J.matrixWorldAutoUpdate===!0&&J.updateMatrixWorld(),bt.enabled===!0&&bt.isPresenting===!0&&(T===null||T.isCompositing()===!1)&&(bt.cameraAutoUpdate===!0&&bt.updateCamera(J),J=bt.getCamera()),N.isScene===!0&&N.onBeforeRender(U,N,J,nt),G=xt.get(N,F.length),G.init(J),F.push(G),qt.multiplyMatrices(J.projectionMatrix,J.matrixWorldInverse),Ut.setFromProjectionMatrix(qt,aa,J.reversedDepth),ct=this.localClippingEnabled,tt=St.init(this.clippingPlanes,ct),C=At.get(N,B.length),C.init(),B.push(C),bt.enabled===!0&&bt.isPresenting===!0){const Wt=U.xr.getDepthSensingMesh();Wt!==null&&lr(Wt,J,-1/0,U.sortObjects)}lr(N,J,0,U.sortObjects),C.finish(),U.sortObjects===!0&&C.sort(wt,Bt),Yt=bt.enabled===!1||bt.isPresenting===!1||bt.hasDepthSensing()===!1,Yt&&Lt.addToRenderList(C,N),this.info.render.frame++,tt===!0&&St.beginShadows();const ut=G.state.shadowsArray;if(Nt.render(ut,N,J),tt===!0&&St.endShadows(),this.info.autoReset===!0&&this.info.reset(),(pt&&T.hasRenderPass())===!1){const Wt=C.opaque,Vt=C.transmissive;if(G.setupLights(),J.isArrayCamera){const ee=J.cameras;if(Vt.length>0)for(let ae=0,fe=ee.length;ae<fe;ae++){const me=ee[ae];cn(Wt,Vt,N,me)}Yt&&Lt.render(N);for(let ae=0,fe=ee.length;ae<fe;ae++){const me=ee[ae];Li(C,N,me,me.viewport)}}else Vt.length>0&&cn(Wt,Vt,N,J),Yt&&Lt.render(N),Li(C,N,J)}nt!==null&&q===0&&(V.updateMultisampleRenderTarget(nt),V.updateRenderTargetMipmap(nt)),pt&&T.end(U),N.isScene===!0&&N.onAfterRender(U,N,J),Ft.resetDefaultState(),ot=-1,Y=null,F.pop(),F.length>0?(G=F[F.length-1],tt===!0&&St.setGlobalState(U.clippingPlanes,G.state.camera)):G=null,B.pop(),B.length>0?C=B[B.length-1]:C=null};function lr(N,J,vt,pt){if(N.visible===!1)return;if(N.layers.test(J.layers)){if(N.isGroup)vt=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(J);else if(N.isLight)G.pushLight(N),N.castShadow&&G.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||Ut.intersectsSprite(N)){pt&&oe.setFromMatrixPosition(N.matrixWorld).applyMatrix4(qt);const Wt=it.update(N),Vt=N.material;Vt.visible&&C.push(N,Wt,Vt,vt,oe.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||Ut.intersectsObject(N))){const Wt=it.update(N),Vt=N.material;if(pt&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),oe.copy(N.boundingSphere.center)):(Wt.boundingSphere===null&&Wt.computeBoundingSphere(),oe.copy(Wt.boundingSphere.center)),oe.applyMatrix4(N.matrixWorld).applyMatrix4(qt)),Array.isArray(Vt)){const ee=Wt.groups;for(let ae=0,fe=ee.length;ae<fe;ae++){const me=ee[ae],Zt=Vt[me.materialIndex];Zt&&Zt.visible&&C.push(N,Wt,Zt,vt,oe.z,me)}}else Vt.visible&&C.push(N,Wt,Vt,vt,oe.z,null)}}const Ht=N.children;for(let Wt=0,Vt=Ht.length;Wt<Vt;Wt++)lr(Ht[Wt],J,vt,pt)}function Li(N,J,vt,pt){const{opaque:ut,transmissive:Ht,transparent:Wt}=N;G.setupLightsView(vt),tt===!0&&St.setGlobalState(U.clippingPlanes,vt),pt&&Pt.viewport(z.copy(pt)),ut.length>0&&vn(ut,J,vt),Ht.length>0&&vn(Ht,J,vt),Wt.length>0&&vn(Wt,J,vt),Pt.buffers.depth.setTest(!0),Pt.buffers.depth.setMask(!0),Pt.buffers.color.setMask(!0),Pt.setPolygonOffset(!1)}function cn(N,J,vt,pt){if((vt.isScene===!0?vt.overrideMaterial:null)!==null)return;if(G.state.transmissionRenderTarget[pt.id]===void 0){const Zt=Jt.has("EXT_color_buffer_half_float")||Jt.has("EXT_color_buffer_float");G.state.transmissionRenderTarget[pt.id]=new oa(1,1,{generateMipmaps:!0,type:Zt?Ia:vi,minFilter:$s,samples:Math.max(4,ne.samples),stencilBuffer:c,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Ue.workingColorSpace})}const Ht=G.state.transmissionRenderTarget[pt.id],Wt=pt.viewport||z;Ht.setSize(Wt.z*U.transmissionResolutionScale,Wt.w*U.transmissionResolutionScale);const Vt=U.getRenderTarget(),ee=U.getActiveCubeFace(),ae=U.getActiveMipmapLevel();U.setRenderTarget(Ht),U.getClearColor(lt),Ct=U.getClearAlpha(),Ct<1&&U.setClearColor(16777215,.5),U.clear(),Yt&&Lt.render(vt);const fe=U.toneMapping;U.toneMapping=ra;const me=pt.viewport;if(pt.viewport!==void 0&&(pt.viewport=void 0),G.setupLightsView(pt),tt===!0&&St.setGlobalState(U.clippingPlanes,pt),vn(N,vt,pt),V.updateMultisampleRenderTarget(Ht),V.updateRenderTargetMipmap(Ht),Jt.has("WEBGL_multisampled_render_to_texture")===!1){let Zt=!1;for(let ye=0,Je=J.length;ye<Je;ye++){const $e=J[ye],{object:Le,geometry:xn,material:te,group:Xn}=$e;if(te.side===ki&&Le.layers.test(pt.layers)){const pe=te.side;te.side=si,te.needsUpdate=!0,ua(Le,vt,pt,xn,te,Xn),te.side=pe,te.needsUpdate=!0,Zt=!0}}Zt===!0&&(V.updateMultisampleRenderTarget(Ht),V.updateRenderTargetMipmap(Ht))}U.setRenderTarget(Vt,ee,ae),U.setClearColor(lt,Ct),me!==void 0&&(pt.viewport=me),U.toneMapping=fe}function vn(N,J,vt){const pt=J.isScene===!0?J.overrideMaterial:null;for(let ut=0,Ht=N.length;ut<Ht;ut++){const Wt=N[ut],{object:Vt,geometry:ee,group:ae}=Wt;let fe=Wt.material;fe.allowOverride===!0&&pt!==null&&(fe=pt),Vt.layers.test(vt.layers)&&ua(Vt,J,vt,ee,fe,ae)}}function ua(N,J,vt,pt,ut,Ht){N.onBeforeRender(U,J,vt,pt,ut,Ht),N.modelViewMatrix.multiplyMatrices(vt.matrixWorldInverse,N.matrixWorld),N.normalMatrix.getNormalMatrix(N.modelViewMatrix),ut.onBeforeRender(U,J,vt,pt,N,Ht),ut.transparent===!0&&ut.side===ki&&ut.forceSinglePass===!1?(ut.side=si,ut.needsUpdate=!0,U.renderBufferDirect(vt,J,pt,ut,N,Ht),ut.side=Es,ut.needsUpdate=!0,U.renderBufferDirect(vt,J,pt,ut,N,Ht),ut.side=ki):U.renderBufferDirect(vt,J,pt,ut,N,Ht),N.onAfterRender(U,J,vt,pt,ut,Ht)}function Ga(N,J,vt){J.isScene!==!0&&(J=de);const pt=b.get(N),ut=G.state.lights,Ht=G.state.shadowsArray,Wt=ut.state.version,Vt=rt.getParameters(N,ut.state,Ht,J,vt),ee=rt.getProgramCacheKey(Vt);let ae=pt.programs;pt.environment=N.isMeshStandardMaterial||N.isMeshLambertMaterial||N.isMeshPhongMaterial?J.environment:null,pt.fog=J.fog;const fe=N.isMeshStandardMaterial||N.isMeshLambertMaterial&&!N.envMap||N.isMeshPhongMaterial&&!N.envMap;pt.envMap=$.get(N.envMap||pt.environment,fe),pt.envMapRotation=pt.environment!==null&&N.envMap===null?J.environmentRotation:N.envMapRotation,ae===void 0&&(N.addEventListener("dispose",De),ae=new Map,pt.programs=ae);let me=ae.get(ee);if(me!==void 0){if(pt.currentProgram===me&&pt.lightsStateVersion===Wt)return Al(N,Vt),me}else Vt.uniforms=rt.getUniforms(N),N.onBeforeCompile(Vt,U),me=rt.acquireProgram(Vt,ee),ae.set(ee,me),pt.uniforms=Vt.uniforms;const Zt=pt.uniforms;return(!N.isShaderMaterial&&!N.isRawShaderMaterial||N.clipping===!0)&&(Zt.clippingPlanes=St.uniform),Al(N,Vt),pt.needsLights=vo(N),pt.lightsStateVersion=Wt,pt.needsLights&&(Zt.ambientLightColor.value=ut.state.ambient,Zt.lightProbe.value=ut.state.probe,Zt.directionalLights.value=ut.state.directional,Zt.directionalLightShadows.value=ut.state.directionalShadow,Zt.spotLights.value=ut.state.spot,Zt.spotLightShadows.value=ut.state.spotShadow,Zt.rectAreaLights.value=ut.state.rectArea,Zt.ltc_1.value=ut.state.rectAreaLTC1,Zt.ltc_2.value=ut.state.rectAreaLTC2,Zt.pointLights.value=ut.state.point,Zt.pointLightShadows.value=ut.state.pointShadow,Zt.hemisphereLights.value=ut.state.hemi,Zt.directionalShadowMatrix.value=ut.state.directionalShadowMatrix,Zt.spotLightMatrix.value=ut.state.spotLightMatrix,Zt.spotLightMap.value=ut.state.spotLightMap,Zt.pointShadowMatrix.value=ut.state.pointShadowMatrix),pt.currentProgram=me,pt.uniformsList=null,me}function Tl(N){if(N.uniformsList===null){const J=N.currentProgram.getUniforms();N.uniformsList=Ru.seqWithValue(J.seq,N.uniforms)}return N.uniformsList}function Al(N,J){const vt=b.get(N);vt.outputColorSpace=J.outputColorSpace,vt.batching=J.batching,vt.batchingColor=J.batchingColor,vt.instancing=J.instancing,vt.instancingColor=J.instancingColor,vt.instancingMorph=J.instancingMorph,vt.skinning=J.skinning,vt.morphTargets=J.morphTargets,vt.morphNormals=J.morphNormals,vt.morphColors=J.morphColors,vt.morphTargetsCount=J.morphTargetsCount,vt.numClippingPlanes=J.numClippingPlanes,vt.numIntersection=J.numClipIntersection,vt.vertexAlphas=J.vertexAlphas,vt.vertexTangents=J.vertexTangents,vt.toneMapping=J.toneMapping}function Rl(N,J,vt,pt,ut){J.isScene!==!0&&(J=de),V.resetTextureUnits();const Ht=J.fog,Wt=pt.isMeshStandardMaterial||pt.isMeshLambertMaterial||pt.isMeshPhongMaterial?J.environment:null,Vt=nt===null?U.outputColorSpace:nt.isXRRenderTarget===!0?nt.texture.colorSpace:fo,ee=pt.isMeshStandardMaterial||pt.isMeshLambertMaterial&&!pt.envMap||pt.isMeshPhongMaterial&&!pt.envMap,ae=$.get(pt.envMap||Wt,ee),fe=pt.vertexColors===!0&&!!vt.attributes.color&&vt.attributes.color.itemSize===4,me=!!vt.attributes.tangent&&(!!pt.normalMap||pt.anisotropy>0),Zt=!!vt.morphAttributes.position,ye=!!vt.morphAttributes.normal,Je=!!vt.morphAttributes.color;let $e=ra;pt.toneMapped&&(nt===null||nt.isXRRenderTarget===!0)&&($e=U.toneMapping);const Le=vt.morphAttributes.position||vt.morphAttributes.normal||vt.morphAttributes.color,xn=Le!==void 0?Le.length:0,te=b.get(pt),Xn=G.state.lights;if(tt===!0&&(ct===!0||N!==Y)){const fn=N===Y&&pt.id===ot;St.setState(pt,N,fn)}let pe=!1;pt.version===te.__version?(te.needsLights&&te.lightsStateVersion!==Xn.state.version||te.outputColorSpace!==Vt||ut.isBatchedMesh&&te.batching===!1||!ut.isBatchedMesh&&te.batching===!0||ut.isBatchedMesh&&te.batchingColor===!0&&ut.colorTexture===null||ut.isBatchedMesh&&te.batchingColor===!1&&ut.colorTexture!==null||ut.isInstancedMesh&&te.instancing===!1||!ut.isInstancedMesh&&te.instancing===!0||ut.isSkinnedMesh&&te.skinning===!1||!ut.isSkinnedMesh&&te.skinning===!0||ut.isInstancedMesh&&te.instancingColor===!0&&ut.instanceColor===null||ut.isInstancedMesh&&te.instancingColor===!1&&ut.instanceColor!==null||ut.isInstancedMesh&&te.instancingMorph===!0&&ut.morphTexture===null||ut.isInstancedMesh&&te.instancingMorph===!1&&ut.morphTexture!==null||te.envMap!==ae||pt.fog===!0&&te.fog!==Ht||te.numClippingPlanes!==void 0&&(te.numClippingPlanes!==St.numPlanes||te.numIntersection!==St.numIntersection)||te.vertexAlphas!==fe||te.vertexTangents!==me||te.morphTargets!==Zt||te.morphNormals!==ye||te.morphColors!==Je||te.toneMapping!==$e||te.morphTargetsCount!==xn)&&(pe=!0):(pe=!0,te.__version=pt.version);let Wn=te.currentProgram;pe===!0&&(Wn=Ga(pt,J,ut));let ri=!1,Ni=!1,oi=!1;const Fe=Wn.getUniforms(),un=te.uniforms;if(Pt.useProgram(Wn.program)&&(ri=!0,Ni=!0,oi=!0),pt.id!==ot&&(ot=pt.id,Ni=!0),ri||Y!==N){Pt.buffers.depth.getReversed()&&N.reversedDepth!==!0&&(N._reversedDepth=!0,N.updateProjectionMatrix()),Fe.setValue(X,"projectionMatrix",N.projectionMatrix),Fe.setValue(X,"viewMatrix",N.matrixWorldInverse);const Oi=Fe.map.cameraPosition;Oi!==void 0&&Oi.setValue(X,Xt.setFromMatrixPosition(N.matrixWorld)),ne.logarithmicDepthBuffer&&Fe.setValue(X,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),(pt.isMeshPhongMaterial||pt.isMeshToonMaterial||pt.isMeshLambertMaterial||pt.isMeshBasicMaterial||pt.isMeshStandardMaterial||pt.isShaderMaterial)&&Fe.setValue(X,"isOrthographic",N.isOrthographicCamera===!0),Y!==N&&(Y=N,Ni=!0,oi=!0)}if(te.needsLights&&(Xn.state.directionalShadowMap.length>0&&Fe.setValue(X,"directionalShadowMap",Xn.state.directionalShadowMap,V),Xn.state.spotShadowMap.length>0&&Fe.setValue(X,"spotShadowMap",Xn.state.spotShadowMap,V),Xn.state.pointShadowMap.length>0&&Fe.setValue(X,"pointShadowMap",Xn.state.pointShadowMap,V)),ut.isSkinnedMesh){Fe.setOptional(X,ut,"bindMatrix"),Fe.setOptional(X,ut,"bindMatrixInverse");const fn=ut.skeleton;fn&&(fn.boneTexture===null&&fn.computeBoneTexture(),Fe.setValue(X,"boneTexture",fn.boneTexture,V))}ut.isBatchedMesh&&(Fe.setOptional(X,ut,"batchingTexture"),Fe.setValue(X,"batchingTexture",ut._matricesTexture,V),Fe.setOptional(X,ut,"batchingIdTexture"),Fe.setValue(X,"batchingIdTexture",ut._indirectTexture,V),Fe.setOptional(X,ut,"batchingColorTexture"),ut._colorsTexture!==null&&Fe.setValue(X,"batchingColorTexture",ut._colorsTexture,V));const qn=vt.morphAttributes;if((qn.position!==void 0||qn.normal!==void 0||qn.color!==void 0)&&It.update(ut,vt,Wn),(Ni||te.receiveShadow!==ut.receiveShadow)&&(te.receiveShadow=ut.receiveShadow,Fe.setValue(X,"receiveShadow",ut.receiveShadow)),(pt.isMeshStandardMaterial||pt.isMeshLambertMaterial||pt.isMeshPhongMaterial)&&pt.envMap===null&&J.environment!==null&&(un.envMapIntensity.value=J.environmentIntensity),un.dfgLUT!==void 0&&(un.dfgLUT.value=W2()),Ni&&(Fe.setValue(X,"toneMappingExposure",U.toneMappingExposure),te.needsLights&&Rs(un,oi),Ht&&pt.fog===!0&&_t.refreshFogUniforms(un,Ht),_t.refreshMaterialUniforms(un,pt,Mt,K,G.state.transmissionRenderTarget[N.id]),Ru.upload(X,Tl(te),un,V)),pt.isShaderMaterial&&pt.uniformsNeedUpdate===!0&&(Ru.upload(X,Tl(te),un,V),pt.uniformsNeedUpdate=!1),pt.isSpriteMaterial&&Fe.setValue(X,"center",ut.center),Fe.setValue(X,"modelViewMatrix",ut.modelViewMatrix),Fe.setValue(X,"normalMatrix",ut.normalMatrix),Fe.setValue(X,"modelMatrix",ut.matrixWorld),pt.isShaderMaterial||pt.isRawShaderMaterial){const fn=pt.uniformsGroups;for(let Oi=0,fa=fn.length;Oi<fa;Oi++){const cr=fn[Oi];kt.update(cr,Wn),kt.bind(cr,Wn)}}return Wn}function Rs(N,J){N.ambientLightColor.needsUpdate=J,N.lightProbe.needsUpdate=J,N.directionalLights.needsUpdate=J,N.directionalLightShadows.needsUpdate=J,N.pointLights.needsUpdate=J,N.pointLightShadows.needsUpdate=J,N.spotLights.needsUpdate=J,N.spotLightShadows.needsUpdate=J,N.rectAreaLights.needsUpdate=J,N.hemisphereLights.needsUpdate=J}function vo(N){return N.isMeshLambertMaterial||N.isMeshToonMaterial||N.isMeshPhongMaterial||N.isMeshStandardMaterial||N.isShadowMaterial||N.isShaderMaterial&&N.lights===!0}this.getActiveCubeFace=function(){return H},this.getActiveMipmapLevel=function(){return q},this.getRenderTarget=function(){return nt},this.setRenderTargetTextures=function(N,J,vt){const pt=b.get(N);pt.__autoAllocateDepthBuffer=N.resolveDepthBuffer===!1,pt.__autoAllocateDepthBuffer===!1&&(pt.__useRenderToTexture=!1),b.get(N.texture).__webglTexture=J,b.get(N.depthTexture).__webglTexture=pt.__autoAllocateDepthBuffer?void 0:vt,pt.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(N,J){const vt=b.get(N);vt.__webglFramebuffer=J,vt.__useDefaultFramebuffer=J===void 0};const Va=X.createFramebuffer();this.setRenderTarget=function(N,J=0,vt=0){nt=N,H=J,q=vt;let pt=null,ut=!1,Ht=!1;if(N){const Vt=b.get(N);if(Vt.__useDefaultFramebuffer!==void 0){Pt.bindFramebuffer(X.FRAMEBUFFER,Vt.__webglFramebuffer),z.copy(N.viewport),A.copy(N.scissor),ht=N.scissorTest,Pt.viewport(z),Pt.scissor(A),Pt.setScissorTest(ht),ot=-1;return}else if(Vt.__webglFramebuffer===void 0)V.setupRenderTarget(N);else if(Vt.__hasExternalTextures)V.rebindTextures(N,b.get(N.texture).__webglTexture,b.get(N.depthTexture).__webglTexture);else if(N.depthBuffer){const fe=N.depthTexture;if(Vt.__boundDepthTexture!==fe){if(fe!==null&&b.has(fe)&&(N.width!==fe.image.width||N.height!==fe.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");V.setupDepthRenderbuffer(N)}}const ee=N.texture;(ee.isData3DTexture||ee.isDataArrayTexture||ee.isCompressedArrayTexture)&&(Ht=!0);const ae=b.get(N).__webglFramebuffer;N.isWebGLCubeRenderTarget?(Array.isArray(ae[J])?pt=ae[J][vt]:pt=ae[J],ut=!0):N.samples>0&&V.useMultisampledRTT(N)===!1?pt=b.get(N).__webglMultisampledFramebuffer:Array.isArray(ae)?pt=ae[vt]:pt=ae,z.copy(N.viewport),A.copy(N.scissor),ht=N.scissorTest}else z.copy(st).multiplyScalar(Mt).floor(),A.copy(Et).multiplyScalar(Mt).floor(),ht=gt;if(vt!==0&&(pt=Va),Pt.bindFramebuffer(X.FRAMEBUFFER,pt)&&Pt.drawBuffers(N,pt),Pt.viewport(z),Pt.scissor(A),Pt.setScissorTest(ht),ut){const Vt=b.get(N.texture);X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_CUBE_MAP_POSITIVE_X+J,Vt.__webglTexture,vt)}else if(Ht){const Vt=J;for(let ee=0;ee<N.textures.length;ee++){const ae=b.get(N.textures[ee]);X.framebufferTextureLayer(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0+ee,ae.__webglTexture,vt,Vt)}}else if(N!==null&&vt!==0){const Vt=b.get(N.texture);X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,Vt.__webglTexture,vt)}ot=-1},this.readRenderTargetPixels=function(N,J,vt,pt,ut,Ht,Wt,Vt=0){if(!(N&&N.isWebGLRenderTarget)){Pe("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ee=b.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&Wt!==void 0&&(ee=ee[Wt]),ee){Pt.bindFramebuffer(X.FRAMEBUFFER,ee);try{const ae=N.textures[Vt],fe=ae.format,me=ae.type;if(N.textures.length>1&&X.readBuffer(X.COLOR_ATTACHMENT0+Vt),!ne.textureFormatReadable(fe)){Pe("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ne.textureTypeReadable(me)){Pe("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}J>=0&&J<=N.width-pt&&vt>=0&&vt<=N.height-ut&&X.readPixels(J,vt,pt,ut,zt.convert(fe),zt.convert(me),Ht)}finally{const ae=nt!==null?b.get(nt).__webglFramebuffer:null;Pt.bindFramebuffer(X.FRAMEBUFFER,ae)}}},this.readRenderTargetPixelsAsync=async function(N,J,vt,pt,ut,Ht,Wt,Vt=0){if(!(N&&N.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ee=b.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&Wt!==void 0&&(ee=ee[Wt]),ee)if(J>=0&&J<=N.width-pt&&vt>=0&&vt<=N.height-ut){Pt.bindFramebuffer(X.FRAMEBUFFER,ee);const ae=N.textures[Vt],fe=ae.format,me=ae.type;if(N.textures.length>1&&X.readBuffer(X.COLOR_ATTACHMENT0+Vt),!ne.textureFormatReadable(fe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ne.textureTypeReadable(me))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Zt=X.createBuffer();X.bindBuffer(X.PIXEL_PACK_BUFFER,Zt),X.bufferData(X.PIXEL_PACK_BUFFER,Ht.byteLength,X.STREAM_READ),X.readPixels(J,vt,pt,ut,zt.convert(fe),zt.convert(me),0);const ye=nt!==null?b.get(nt).__webglFramebuffer:null;Pt.bindFramebuffer(X.FRAMEBUFFER,ye);const Je=X.fenceSync(X.SYNC_GPU_COMMANDS_COMPLETE,0);return X.flush(),await WM(X,Je,4),X.bindBuffer(X.PIXEL_PACK_BUFFER,Zt),X.getBufferSubData(X.PIXEL_PACK_BUFFER,0,Ht),X.deleteBuffer(Zt),X.deleteSync(Je),Ht}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(N,J=null,vt=0){const pt=Math.pow(2,-vt),ut=Math.floor(N.image.width*pt),Ht=Math.floor(N.image.height*pt),Wt=J!==null?J.x:0,Vt=J!==null?J.y:0;V.setTexture2D(N,0),X.copyTexSubImage2D(X.TEXTURE_2D,vt,0,0,Wt,Vt,ut,Ht),Pt.unbindTexture()};const ka=X.createFramebuffer(),ws=X.createFramebuffer();this.copyTextureToTexture=function(N,J,vt=null,pt=null,ut=0,Ht=0){let Wt,Vt,ee,ae,fe,me,Zt,ye,Je;const $e=N.isCompressedTexture?N.mipmaps[Ht]:N.image;if(vt!==null)Wt=vt.max.x-vt.min.x,Vt=vt.max.y-vt.min.y,ee=vt.isBox3?vt.max.z-vt.min.z:1,ae=vt.min.x,fe=vt.min.y,me=vt.isBox3?vt.min.z:0;else{const un=Math.pow(2,-ut);Wt=Math.floor($e.width*un),Vt=Math.floor($e.height*un),N.isDataArrayTexture?ee=$e.depth:N.isData3DTexture?ee=Math.floor($e.depth*un):ee=1,ae=0,fe=0,me=0}pt!==null?(Zt=pt.x,ye=pt.y,Je=pt.z):(Zt=0,ye=0,Je=0);const Le=zt.convert(J.format),xn=zt.convert(J.type);let te;J.isData3DTexture?(V.setTexture3D(J,0),te=X.TEXTURE_3D):J.isDataArrayTexture||J.isCompressedArrayTexture?(V.setTexture2DArray(J,0),te=X.TEXTURE_2D_ARRAY):(V.setTexture2D(J,0),te=X.TEXTURE_2D),X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL,J.flipY),X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL,J.premultiplyAlpha),X.pixelStorei(X.UNPACK_ALIGNMENT,J.unpackAlignment);const Xn=X.getParameter(X.UNPACK_ROW_LENGTH),pe=X.getParameter(X.UNPACK_IMAGE_HEIGHT),Wn=X.getParameter(X.UNPACK_SKIP_PIXELS),ri=X.getParameter(X.UNPACK_SKIP_ROWS),Ni=X.getParameter(X.UNPACK_SKIP_IMAGES);X.pixelStorei(X.UNPACK_ROW_LENGTH,$e.width),X.pixelStorei(X.UNPACK_IMAGE_HEIGHT,$e.height),X.pixelStorei(X.UNPACK_SKIP_PIXELS,ae),X.pixelStorei(X.UNPACK_SKIP_ROWS,fe),X.pixelStorei(X.UNPACK_SKIP_IMAGES,me);const oi=N.isDataArrayTexture||N.isData3DTexture,Fe=J.isDataArrayTexture||J.isData3DTexture;if(N.isDepthTexture){const un=b.get(N),qn=b.get(J),fn=b.get(un.__renderTarget),Oi=b.get(qn.__renderTarget);Pt.bindFramebuffer(X.READ_FRAMEBUFFER,fn.__webglFramebuffer),Pt.bindFramebuffer(X.DRAW_FRAMEBUFFER,Oi.__webglFramebuffer);for(let fa=0;fa<ee;fa++)oi&&(X.framebufferTextureLayer(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,b.get(N).__webglTexture,ut,me+fa),X.framebufferTextureLayer(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,b.get(J).__webglTexture,Ht,Je+fa)),X.blitFramebuffer(ae,fe,Wt,Vt,Zt,ye,Wt,Vt,X.DEPTH_BUFFER_BIT,X.NEAREST);Pt.bindFramebuffer(X.READ_FRAMEBUFFER,null),Pt.bindFramebuffer(X.DRAW_FRAMEBUFFER,null)}else if(ut!==0||N.isRenderTargetTexture||b.has(N)){const un=b.get(N),qn=b.get(J);Pt.bindFramebuffer(X.READ_FRAMEBUFFER,ka),Pt.bindFramebuffer(X.DRAW_FRAMEBUFFER,ws);for(let fn=0;fn<ee;fn++)oi?X.framebufferTextureLayer(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,un.__webglTexture,ut,me+fn):X.framebufferTexture2D(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,un.__webglTexture,ut),Fe?X.framebufferTextureLayer(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,qn.__webglTexture,Ht,Je+fn):X.framebufferTexture2D(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,qn.__webglTexture,Ht),ut!==0?X.blitFramebuffer(ae,fe,Wt,Vt,Zt,ye,Wt,Vt,X.COLOR_BUFFER_BIT,X.NEAREST):Fe?X.copyTexSubImage3D(te,Ht,Zt,ye,Je+fn,ae,fe,Wt,Vt):X.copyTexSubImage2D(te,Ht,Zt,ye,ae,fe,Wt,Vt);Pt.bindFramebuffer(X.READ_FRAMEBUFFER,null),Pt.bindFramebuffer(X.DRAW_FRAMEBUFFER,null)}else Fe?N.isDataTexture||N.isData3DTexture?X.texSubImage3D(te,Ht,Zt,ye,Je,Wt,Vt,ee,Le,xn,$e.data):J.isCompressedArrayTexture?X.compressedTexSubImage3D(te,Ht,Zt,ye,Je,Wt,Vt,ee,Le,$e.data):X.texSubImage3D(te,Ht,Zt,ye,Je,Wt,Vt,ee,Le,xn,$e):N.isDataTexture?X.texSubImage2D(X.TEXTURE_2D,Ht,Zt,ye,Wt,Vt,Le,xn,$e.data):N.isCompressedTexture?X.compressedTexSubImage2D(X.TEXTURE_2D,Ht,Zt,ye,$e.width,$e.height,Le,$e.data):X.texSubImage2D(X.TEXTURE_2D,Ht,Zt,ye,Wt,Vt,Le,xn,$e);X.pixelStorei(X.UNPACK_ROW_LENGTH,Xn),X.pixelStorei(X.UNPACK_IMAGE_HEIGHT,pe),X.pixelStorei(X.UNPACK_SKIP_PIXELS,Wn),X.pixelStorei(X.UNPACK_SKIP_ROWS,ri),X.pixelStorei(X.UNPACK_SKIP_IMAGES,Ni),Ht===0&&J.generateMipmaps&&X.generateMipmap(te),Pt.unbindTexture()},this.initRenderTarget=function(N){b.get(N).__webglFramebuffer===void 0&&V.setupRenderTarget(N)},this.initTexture=function(N){N.isCubeTexture?V.setTextureCube(N,0):N.isData3DTexture?V.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?V.setTexture2DArray(N,0):V.setTexture2D(N,0),Pt.unbindTexture()},this.resetState=function(){H=0,q=0,nt=null,Pt.reset(),Ft.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return aa}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const i=this.getContext();i.drawingBufferColorSpace=Ue._getDrawingBufferColorSpace(t),i.unpackColorSpace=Ue._getUnpackColorSpace()}}const Yv={type:"change"},Jp={type:"start"},Xx={type:"end"},du=new Zp,jv=new xs,Y2=Math.cos(70*Rx.DEG2RAD),Sn=new Q,ii=2*Math.PI,qe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Fd=1e-6;class j2 extends Jb{constructor(t,i=null){super(t,i),this.state=qe.NONE,this.target=new Q,this.cursor=new Q,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:ao.ROTATE,MIDDLE:ao.DOLLY,RIGHT:ao.PAN},this.touches={ONE:io.ROTATE,TWO:io.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new Q,this._lastQuaternion=new Ts,this._lastTargetPosition=new Q,this._quat=new Ts().setFromUnitVectors(t.up,new Q(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Sv,this._sphericalDelta=new Sv,this._scale=1,this._panOffset=new Q,this._rotateStart=new _e,this._rotateEnd=new _e,this._rotateDelta=new _e,this._panStart=new _e,this._panEnd=new _e,this._panDelta=new _e,this._dollyStart=new _e,this._dollyEnd=new _e,this._dollyDelta=new _e,this._dollyDirection=new Q,this._mouse=new _e,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=K2.bind(this),this._onPointerDown=Z2.bind(this),this._onPointerUp=Q2.bind(this),this._onContextMenu=aR.bind(this),this._onMouseWheel=tR.bind(this),this._onKeyDown=eR.bind(this),this._onTouchStart=nR.bind(this),this._onTouchMove=iR.bind(this),this._onMouseDown=J2.bind(this),this._onMouseMove=$2.bind(this),this._interceptControlDown=sR.bind(this),this._interceptControlUp=rR.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(t){this._cursorStyle=t,t==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Yv),this.update(),this.state=qe.NONE}pan(t,i){this._pan(t,i),this.update()}dollyIn(t){this._dollyIn(t),this.update()}dollyOut(t){this._dollyOut(t),this.update()}rotateLeft(t){this._rotateLeft(t),this.update()}rotateUp(t){this._rotateUp(t),this.update()}update(t=null){const i=this.object.position;Sn.copy(i).sub(this.target),Sn.applyQuaternion(this._quat),this._spherical.setFromVector3(Sn),this.autoRotate&&this.state===qe.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(s)&&isFinite(l)&&(s<-Math.PI?s+=ii:s>Math.PI&&(s-=ii),l<-Math.PI?l+=ii:l>Math.PI&&(l-=ii),s<=l?this._spherical.theta=Math.max(s,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+l)/2?Math.max(s,this._spherical.theta):Math.min(l,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let c=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const f=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),c=f!=this._spherical.radius}if(Sn.setFromSpherical(this._spherical),Sn.applyQuaternion(this._quatInverse),i.copy(this.target).add(Sn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let f=null;if(this.object.isPerspectiveCamera){const d=Sn.length();f=this._clampDistance(d*this._scale);const m=d-f;this.object.position.addScaledVector(this._dollyDirection,m),this.object.updateMatrixWorld(),c=!!m}else if(this.object.isOrthographicCamera){const d=new Q(this._mouse.x,this._mouse.y,0);d.unproject(this.object);const m=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),c=m!==this.object.zoom;const p=new Q(this._mouse.x,this._mouse.y,0);p.unproject(this.object),this.object.position.sub(p).add(d),this.object.updateMatrixWorld(),f=Sn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;f!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(f).add(this.object.position):(du.origin.copy(this.object.position),du.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(du.direction))<Y2?this.object.lookAt(this.target):(jv.setFromNormalAndCoplanarPoint(this.object.up,this.target),du.intersectPlane(jv,this.target))))}else if(this.object.isOrthographicCamera){const f=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),f!==this.object.zoom&&(this.object.updateProjectionMatrix(),c=!0)}return this._scale=1,this._performCursorZoom=!1,c||this._lastPosition.distanceToSquared(this.object.position)>Fd||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Fd||this._lastTargetPosition.distanceToSquared(this.target)>Fd?(this.dispatchEvent(Yv),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?ii/60*this.autoRotateSpeed*t:ii/60/60*this.autoRotateSpeed}_getZoomScale(t){const i=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*i)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,i){Sn.setFromMatrixColumn(i,0),Sn.multiplyScalar(-t),this._panOffset.add(Sn)}_panUp(t,i){this.screenSpacePanning===!0?Sn.setFromMatrixColumn(i,1):(Sn.setFromMatrixColumn(i,0),Sn.crossVectors(this.object.up,Sn)),Sn.multiplyScalar(t),this._panOffset.add(Sn)}_pan(t,i){const s=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;Sn.copy(l).sub(this.target);let c=Sn.length();c*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*c/s.clientHeight,this.object.matrix),this._panUp(2*i*c/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,i){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),l=t-s.left,c=i-s.top,f=s.width,d=s.height;this._mouse.x=l/f*2-1,this._mouse.y=-(c/d)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(ii*this._rotateDelta.x/i.clientHeight),this._rotateUp(ii*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let i=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(ii*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),i=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-ii*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),i=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(ii*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),i=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-ii*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),i=!0;break}i&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._rotateStart.set(s,l)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panStart.set(s,l)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,c=Math.sqrt(s*s+l*l);this._dollyStart.set(0,c)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),l=.5*(t.pageX+s.x),c=.5*(t.pageY+s.y);this._rotateEnd.set(l,c)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(ii*this._rotateDelta.x/i.clientHeight),this._rotateUp(ii*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panEnd.set(s,l)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,c=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,c),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const f=(t.pageX+i.x)*.5,d=(t.pageY+i.y)*.5;this._updateZoomParameters(f,d)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId){this._pointers.splice(i,1);return}}_isTrackingPointer(t){for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId)return!0;return!1}_trackPointer(t){let i=this._pointerPositions[t.pointerId];i===void 0&&(i=new _e,this._pointerPositions[t.pointerId]=i),i.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const i=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[i]}_customWheelEvent(t){const i=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(i){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function Z2(a){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(a.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(a)&&(this._addPointer(a),a.pointerType==="touch"?this._onTouchStart(a):this._onMouseDown(a),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function K2(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function Q2(a){switch(this._removePointer(a),this._pointers.length){case 0:this.domElement.releasePointerCapture(a.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Xx),this.state=qe.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const t=this._pointers[0],i=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:i.x,pageY:i.y});break}}function J2(a){let t;switch(a.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case ao.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(a),this.state=qe.DOLLY;break;case ao.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=qe.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=qe.ROTATE}break;case ao.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=qe.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=qe.PAN}break;default:this.state=qe.NONE}this.state!==qe.NONE&&this.dispatchEvent(Jp)}function $2(a){switch(this.state){case qe.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case qe.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case qe.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function tR(a){this.enabled===!1||this.enableZoom===!1||this.state!==qe.NONE||(a.preventDefault(),this.dispatchEvent(Jp),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(Xx))}function eR(a){this.enabled!==!1&&this._handleKeyDown(a)}function nR(a){switch(this._trackPointer(a),this._pointers.length){case 1:switch(this.touches.ONE){case io.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(a),this.state=qe.TOUCH_ROTATE;break;case io.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=qe.TOUCH_PAN;break;default:this.state=qe.NONE}break;case 2:switch(this.touches.TWO){case io.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=qe.TOUCH_DOLLY_PAN;break;case io.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=qe.TOUCH_DOLLY_ROTATE;break;default:this.state=qe.NONE}break;default:this.state=qe.NONE}this.state!==qe.NONE&&this.dispatchEvent(Jp)}function iR(a){switch(this._trackPointer(a),this.state){case qe.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case qe.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case qe.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case qe.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=qe.NONE}}function aR(a){this.enabled!==!1&&a.preventDefault()}function sR(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function rR(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const Zv=new As,pu=new Q;class Wx extends qb{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(s),this.setAttribute("position",new _n(t,3)),this.setAttribute("uv",new _n(i,2))}applyMatrix4(t){const i=this.attributes.instanceStart,s=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(t),s.applyMatrix4(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));const s=new Up(i,6,1);return this.setAttribute("instanceStart",new Ms(s,3,0)),this.setAttribute("instanceEnd",new Ms(s,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));const s=new Up(i,6,1);return this.setAttribute("instanceColorStart",new Ms(s,3,0)),this.setAttribute("instanceColorEnd",new Ms(s,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Ob(t.geometry)),this}fromLineSegments(t){const i=t.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new As);const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;t!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(t),Zv.setFromBufferAttribute(i),this.boundingBox.union(Zv))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new po),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(t!==void 0&&i!==void 0){const s=this.boundingSphere.center;this.boundingBox.getCenter(s);let l=0;for(let c=0,f=t.count;c<f;c++)pu.fromBufferAttribute(t,c),l=Math.max(l,s.distanceToSquared(pu)),pu.fromBufferAttribute(i,c),l=Math.max(l,s.distanceToSquared(pu));this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}Gt.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new _e(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};ai.line={uniforms:Qp.merge([Gt.common,Gt.fog,Gt.line]),vertexShader:`
|
|
4057
|
+
}`;class H2{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,i){if(this.texture===null){const s=new Px(t.texture);(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const i=t.cameras[0].viewport,s=new qi({vertexShader:I2,fragmentShader:B2,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new Gn(new Gu(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class G2 extends ar{constructor(t,i){super();const s=this;let l=null,c=1,f=null,d="local-floor",m=1,p=null,v=null,_=null,g=null,S=null,b=null;const R=typeof XRWebGLBinding<"u",x=new H2,y={},w=i.getContextAttributes();let D=null,C=null;const G=[],B=[],F=new _e;let T=null;const U=new Vi;U.viewport=new Ze;const et=new Vi;et.viewport=new Ze;const H=[U,et],q=new Zb;let nt=null,ot=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(st){let Et=G[st];return Et===void 0&&(Et=new ud,G[st]=Et),Et.getTargetRaySpace()},this.getControllerGrip=function(st){let Et=G[st];return Et===void 0&&(Et=new ud,G[st]=Et),Et.getGripSpace()},this.getHand=function(st){let Et=G[st];return Et===void 0&&(Et=new ud,G[st]=Et),Et.getHandSpace()};function Y(st){const Et=B.indexOf(st.inputSource);if(Et===-1)return;const gt=G[Et];gt!==void 0&&(gt.update(st.inputSource,st.frame,p||f),gt.dispatchEvent({type:st.type,data:st.inputSource}))}function z(){l.removeEventListener("select",Y),l.removeEventListener("selectstart",Y),l.removeEventListener("selectend",Y),l.removeEventListener("squeeze",Y),l.removeEventListener("squeezestart",Y),l.removeEventListener("squeezeend",Y),l.removeEventListener("end",z),l.removeEventListener("inputsourceschange",A);for(let st=0;st<G.length;st++){const Et=B[st];Et!==null&&(B[st]=null,G[st].disconnect(Et))}nt=null,ot=null,x.reset();for(const st in y)delete y[st];t.setRenderTarget(D),S=null,g=null,_=null,l=null,C=null,Bt.stop(),s.isPresenting=!1,t.setPixelRatio(T),t.setSize(F.width,F.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(st){c=st,s.isPresenting===!0&&ue("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(st){d=st,s.isPresenting===!0&&ue("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||f},this.setReferenceSpace=function(st){p=st},this.getBaseLayer=function(){return g!==null?g:S},this.getBinding=function(){return _===null&&R&&(_=new XRWebGLBinding(l,i)),_},this.getFrame=function(){return b},this.getSession=function(){return l},this.setSession=async function(st){if(l=st,l!==null){if(D=t.getRenderTarget(),l.addEventListener("select",Y),l.addEventListener("selectstart",Y),l.addEventListener("selectend",Y),l.addEventListener("squeeze",Y),l.addEventListener("squeezestart",Y),l.addEventListener("squeezeend",Y),l.addEventListener("end",z),l.addEventListener("inputsourceschange",A),w.xrCompatible!==!0&&await i.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(F),R&&"createProjectionLayer"in XRWebGLBinding.prototype){let gt=null,Ut=null,tt=null;w.depth&&(tt=w.stencil?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24,gt=w.stencil?tr:Ba,Ut=w.stencil?yl:la);const ct={colorFormat:i.RGBA8,depthFormat:tt,scaleFactor:c};_=this.getBinding(),g=_.createProjectionLayer(ct),l.updateRenderState({layers:[g]}),t.setPixelRatio(1),t.setSize(g.textureWidth,g.textureHeight,!1),C=new oa(g.textureWidth,g.textureHeight,{format:Wi,type:vi,depthTexture:new bl(g.textureWidth,g.textureHeight,Ut,void 0,void 0,void 0,void 0,void 0,void 0,gt),stencilBuffer:w.stencil,colorSpace:t.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}else{const gt={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:c};S=new XRWebGLLayer(l,i,gt),l.updateRenderState({baseLayer:S}),t.setPixelRatio(1),t.setSize(S.framebufferWidth,S.framebufferHeight,!1),C=new oa(S.framebufferWidth,S.framebufferHeight,{format:Wi,type:vi,colorSpace:t.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:S.ignoreDepthValues===!1,resolveStencilBuffer:S.ignoreDepthValues===!1})}C.isXRRenderTarget=!0,this.setFoveation(m),p=null,f=await l.requestReferenceSpace(d),Bt.setContext(l),Bt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(l!==null)return l.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};function A(st){for(let Et=0;Et<st.removed.length;Et++){const gt=st.removed[Et],Ut=B.indexOf(gt);Ut>=0&&(B[Ut]=null,G[Ut].disconnect(gt))}for(let Et=0;Et<st.added.length;Et++){const gt=st.added[Et];let Ut=B.indexOf(gt);if(Ut===-1){for(let ct=0;ct<G.length;ct++)if(ct>=B.length){B.push(gt),Ut=ct;break}else if(B[ct]===null){B[ct]=gt,Ut=ct;break}if(Ut===-1)break}const tt=G[Ut];tt&&tt.connect(gt)}}const ht=new Q,lt=new Q;function Ct(st,Et,gt){ht.setFromMatrixPosition(Et.matrixWorld),lt.setFromMatrixPosition(gt.matrixWorld);const Ut=ht.distanceTo(lt),tt=Et.projectionMatrix.elements,ct=gt.projectionMatrix.elements,qt=tt[14]/(tt[10]-1),Xt=tt[14]/(tt[10]+1),oe=(tt[9]+1)/tt[5],de=(tt[9]-1)/tt[5],Yt=(tt[8]-1)/tt[0],se=(ct[8]+1)/ct[0],X=qt*Yt,ce=qt*se,Jt=Ut/(-Yt+se),ne=Jt*-Yt;if(Et.matrixWorld.decompose(st.position,st.quaternion,st.scale),st.translateX(ne),st.translateZ(Jt),st.matrixWorld.compose(st.position,st.quaternion,st.scale),st.matrixWorldInverse.copy(st.matrixWorld).invert(),tt[10]===-1)st.projectionMatrix.copy(Et.projectionMatrix),st.projectionMatrixInverse.copy(Et.projectionMatrixInverse);else{const Pt=qt+Jt,O=Xt+Jt,E=X-ne,V=ce+(Ut-ne),$=oe*Xt/O*Pt,k=de*Xt/O*Pt;st.projectionMatrix.makePerspective(E,V,$,k,Pt,O),st.projectionMatrixInverse.copy(st.projectionMatrix).invert()}}function I(st,Et){Et===null?st.matrixWorld.copy(st.matrix):st.matrixWorld.multiplyMatrices(Et.matrixWorld,st.matrix),st.matrixWorldInverse.copy(st.matrixWorld).invert()}this.updateCamera=function(st){if(l===null)return;let Et=st.near,gt=st.far;x.texture!==null&&(x.depthNear>0&&(Et=x.depthNear),x.depthFar>0&&(gt=x.depthFar)),q.near=et.near=U.near=Et,q.far=et.far=U.far=gt,(nt!==q.near||ot!==q.far)&&(l.updateRenderState({depthNear:q.near,depthFar:q.far}),nt=q.near,ot=q.far),q.layers.mask=st.layers.mask|6,U.layers.mask=q.layers.mask&-5,et.layers.mask=q.layers.mask&-3;const Ut=st.parent,tt=q.cameras;I(q,Ut);for(let ct=0;ct<tt.length;ct++)I(tt[ct],Ut);tt.length===2?Ct(q,U,et):q.projectionMatrix.copy(U.projectionMatrix),K(st,q,Ut)};function K(st,Et,gt){gt===null?st.matrix.copy(Et.matrixWorld):(st.matrix.copy(gt.matrixWorld),st.matrix.invert(),st.matrix.multiply(Et.matrixWorld)),st.matrix.decompose(st.position,st.quaternion,st.scale),st.updateMatrixWorld(!0),st.projectionMatrix.copy(Et.projectionMatrix),st.projectionMatrixInverse.copy(Et.projectionMatrixInverse),st.isPerspectiveCamera&&(st.fov=Ml*2*Math.atan(1/st.projectionMatrix.elements[5]),st.zoom=1)}this.getCamera=function(){return q},this.getFoveation=function(){if(!(g===null&&S===null))return m},this.setFoveation=function(st){m=st,g!==null&&(g.fixedFoveation=st),S!==null&&S.fixedFoveation!==void 0&&(S.fixedFoveation=st)},this.hasDepthSensing=function(){return x.texture!==null},this.getDepthSensingMesh=function(){return x.getMesh(q)},this.getCameraTexture=function(st){return y[st]};let Mt=null;function wt(st,Et){if(v=Et.getViewerPose(p||f),b=Et,v!==null){const gt=v.views;S!==null&&(t.setRenderTargetFramebuffer(C,S.framebuffer),t.setRenderTarget(C));let Ut=!1;gt.length!==q.cameras.length&&(q.cameras.length=0,Ut=!0);for(let Xt=0;Xt<gt.length;Xt++){const oe=gt[Xt];let de=null;if(S!==null)de=S.getViewport(oe);else{const se=_.getViewSubImage(g,oe);de=se.viewport,Xt===0&&(t.setRenderTargetTextures(C,se.colorTexture,se.depthStencilTexture),t.setRenderTarget(C))}let Yt=H[Xt];Yt===void 0&&(Yt=new Vi,Yt.layers.enable(Xt),Yt.viewport=new Ze,H[Xt]=Yt),Yt.matrix.fromArray(oe.transform.matrix),Yt.matrix.decompose(Yt.position,Yt.quaternion,Yt.scale),Yt.projectionMatrix.fromArray(oe.projectionMatrix),Yt.projectionMatrixInverse.copy(Yt.projectionMatrix).invert(),Yt.viewport.set(de.x,de.y,de.width,de.height),Xt===0&&(q.matrix.copy(Yt.matrix),q.matrix.decompose(q.position,q.quaternion,q.scale)),Ut===!0&&q.cameras.push(Yt)}const tt=l.enabledFeatures;if(tt&&tt.includes("depth-sensing")&&l.depthUsage=="gpu-optimized"&&R){_=s.getBinding();const Xt=_.getDepthInformation(gt[0]);Xt&&Xt.isValid&&Xt.texture&&x.init(Xt,l.renderState)}if(tt&&tt.includes("camera-access")&&R){t.state.unbindTexture(),_=s.getBinding();for(let Xt=0;Xt<gt.length;Xt++){const oe=gt[Xt].camera;if(oe){let de=y[oe];de||(de=new Px,y[oe]=de);const Yt=_.getCameraImage(oe);de.sourceTexture=Yt}}}}for(let gt=0;gt<G.length;gt++){const Ut=B[gt],tt=G[gt];Ut!==null&&tt!==void 0&&tt.update(Ut,Et,p||f)}Mt&&Mt(st,Et),Et.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:Et}),b=null}const Bt=new Bx;Bt.setAnimationLoop(wt),this.setAnimationLoop=function(st){Mt=st},this.dispose=function(){}}}const Ks=new ca,V2=new nn;function k2(a,t){function i(x,y){x.matrixAutoUpdate===!0&&x.updateMatrix(),y.value.copy(x.matrix)}function s(x,y){y.color.getRGB(x.fogColor.value,zx(a)),y.isFog?(x.fogNear.value=y.near,x.fogFar.value=y.far):y.isFogExp2&&(x.fogDensity.value=y.density)}function l(x,y,w,D,C){y.isMeshBasicMaterial?c(x,y):y.isMeshLambertMaterial?(c(x,y),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)):y.isMeshToonMaterial?(c(x,y),_(x,y)):y.isMeshPhongMaterial?(c(x,y),v(x,y),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)):y.isMeshStandardMaterial?(c(x,y),g(x,y),y.isMeshPhysicalMaterial&&S(x,y,C)):y.isMeshMatcapMaterial?(c(x,y),b(x,y)):y.isMeshDepthMaterial?c(x,y):y.isMeshDistanceMaterial?(c(x,y),R(x,y)):y.isMeshNormalMaterial?c(x,y):y.isLineBasicMaterial?(f(x,y),y.isLineDashedMaterial&&d(x,y)):y.isPointsMaterial?m(x,y,w,D):y.isSpriteMaterial?p(x,y):y.isShadowMaterial?(x.color.value.copy(y.color),x.opacity.value=y.opacity):y.isShaderMaterial&&(y.uniformsNeedUpdate=!1)}function c(x,y){x.opacity.value=y.opacity,y.color&&x.diffuse.value.copy(y.color),y.emissive&&x.emissive.value.copy(y.emissive).multiplyScalar(y.emissiveIntensity),y.map&&(x.map.value=y.map,i(y.map,x.mapTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.bumpMap&&(x.bumpMap.value=y.bumpMap,i(y.bumpMap,x.bumpMapTransform),x.bumpScale.value=y.bumpScale,y.side===si&&(x.bumpScale.value*=-1)),y.normalMap&&(x.normalMap.value=y.normalMap,i(y.normalMap,x.normalMapTransform),x.normalScale.value.copy(y.normalScale),y.side===si&&x.normalScale.value.negate()),y.displacementMap&&(x.displacementMap.value=y.displacementMap,i(y.displacementMap,x.displacementMapTransform),x.displacementScale.value=y.displacementScale,x.displacementBias.value=y.displacementBias),y.emissiveMap&&(x.emissiveMap.value=y.emissiveMap,i(y.emissiveMap,x.emissiveMapTransform)),y.specularMap&&(x.specularMap.value=y.specularMap,i(y.specularMap,x.specularMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest);const w=t.get(y),D=w.envMap,C=w.envMapRotation;D&&(x.envMap.value=D,Ks.copy(C),Ks.x*=-1,Ks.y*=-1,Ks.z*=-1,D.isCubeTexture&&D.isRenderTargetTexture===!1&&(Ks.y*=-1,Ks.z*=-1),x.envMapRotation.value.setFromMatrix4(V2.makeRotationFromEuler(Ks)),x.flipEnvMap.value=D.isCubeTexture&&D.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=y.reflectivity,x.ior.value=y.ior,x.refractionRatio.value=y.refractionRatio),y.lightMap&&(x.lightMap.value=y.lightMap,x.lightMapIntensity.value=y.lightMapIntensity,i(y.lightMap,x.lightMapTransform)),y.aoMap&&(x.aoMap.value=y.aoMap,x.aoMapIntensity.value=y.aoMapIntensity,i(y.aoMap,x.aoMapTransform))}function f(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,y.map&&(x.map.value=y.map,i(y.map,x.mapTransform))}function d(x,y){x.dashSize.value=y.dashSize,x.totalSize.value=y.dashSize+y.gapSize,x.scale.value=y.scale}function m(x,y,w,D){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.size.value=y.size*w,x.scale.value=D*.5,y.map&&(x.map.value=y.map,i(y.map,x.uvTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function p(x,y){x.diffuse.value.copy(y.color),x.opacity.value=y.opacity,x.rotation.value=y.rotation,y.map&&(x.map.value=y.map,i(y.map,x.mapTransform)),y.alphaMap&&(x.alphaMap.value=y.alphaMap,i(y.alphaMap,x.alphaMapTransform)),y.alphaTest>0&&(x.alphaTest.value=y.alphaTest)}function v(x,y){x.specular.value.copy(y.specular),x.shininess.value=Math.max(y.shininess,1e-4)}function _(x,y){y.gradientMap&&(x.gradientMap.value=y.gradientMap)}function g(x,y){x.metalness.value=y.metalness,y.metalnessMap&&(x.metalnessMap.value=y.metalnessMap,i(y.metalnessMap,x.metalnessMapTransform)),x.roughness.value=y.roughness,y.roughnessMap&&(x.roughnessMap.value=y.roughnessMap,i(y.roughnessMap,x.roughnessMapTransform)),y.envMap&&(x.envMapIntensity.value=y.envMapIntensity)}function S(x,y,w){x.ior.value=y.ior,y.sheen>0&&(x.sheenColor.value.copy(y.sheenColor).multiplyScalar(y.sheen),x.sheenRoughness.value=y.sheenRoughness,y.sheenColorMap&&(x.sheenColorMap.value=y.sheenColorMap,i(y.sheenColorMap,x.sheenColorMapTransform)),y.sheenRoughnessMap&&(x.sheenRoughnessMap.value=y.sheenRoughnessMap,i(y.sheenRoughnessMap,x.sheenRoughnessMapTransform))),y.clearcoat>0&&(x.clearcoat.value=y.clearcoat,x.clearcoatRoughness.value=y.clearcoatRoughness,y.clearcoatMap&&(x.clearcoatMap.value=y.clearcoatMap,i(y.clearcoatMap,x.clearcoatMapTransform)),y.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=y.clearcoatRoughnessMap,i(y.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),y.clearcoatNormalMap&&(x.clearcoatNormalMap.value=y.clearcoatNormalMap,i(y.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(y.clearcoatNormalScale),y.side===si&&x.clearcoatNormalScale.value.negate())),y.dispersion>0&&(x.dispersion.value=y.dispersion),y.iridescence>0&&(x.iridescence.value=y.iridescence,x.iridescenceIOR.value=y.iridescenceIOR,x.iridescenceThicknessMinimum.value=y.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=y.iridescenceThicknessRange[1],y.iridescenceMap&&(x.iridescenceMap.value=y.iridescenceMap,i(y.iridescenceMap,x.iridescenceMapTransform)),y.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=y.iridescenceThicknessMap,i(y.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),y.transmission>0&&(x.transmission.value=y.transmission,x.transmissionSamplerMap.value=w.texture,x.transmissionSamplerSize.value.set(w.width,w.height),y.transmissionMap&&(x.transmissionMap.value=y.transmissionMap,i(y.transmissionMap,x.transmissionMapTransform)),x.thickness.value=y.thickness,y.thicknessMap&&(x.thicknessMap.value=y.thicknessMap,i(y.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=y.attenuationDistance,x.attenuationColor.value.copy(y.attenuationColor)),y.anisotropy>0&&(x.anisotropyVector.value.set(y.anisotropy*Math.cos(y.anisotropyRotation),y.anisotropy*Math.sin(y.anisotropyRotation)),y.anisotropyMap&&(x.anisotropyMap.value=y.anisotropyMap,i(y.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=y.specularIntensity,x.specularColor.value.copy(y.specularColor),y.specularColorMap&&(x.specularColorMap.value=y.specularColorMap,i(y.specularColorMap,x.specularColorMapTransform)),y.specularIntensityMap&&(x.specularIntensityMap.value=y.specularIntensityMap,i(y.specularIntensityMap,x.specularIntensityMapTransform))}function b(x,y){y.matcap&&(x.matcap.value=y.matcap)}function R(x,y){const w=t.get(y).light;x.referencePosition.value.setFromMatrixPosition(w.matrixWorld),x.nearDistance.value=w.shadow.camera.near,x.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:l}}function X2(a,t,i,s){let l={},c={},f=[];const d=a.getParameter(a.MAX_UNIFORM_BUFFER_BINDINGS);function m(w,D){const C=D.program;s.uniformBlockBinding(w,C)}function p(w,D){let C=l[w.id];C===void 0&&(b(w),C=v(w),l[w.id]=C,w.addEventListener("dispose",x));const G=D.program;s.updateUBOMapping(w,G);const B=t.render.frame;c[w.id]!==B&&(g(w),c[w.id]=B)}function v(w){const D=_();w.__bindingPointIndex=D;const C=a.createBuffer(),G=w.__size,B=w.usage;return a.bindBuffer(a.UNIFORM_BUFFER,C),a.bufferData(a.UNIFORM_BUFFER,G,B),a.bindBuffer(a.UNIFORM_BUFFER,null),a.bindBufferBase(a.UNIFORM_BUFFER,D,C),C}function _(){for(let w=0;w<d;w++)if(f.indexOf(w)===-1)return f.push(w),w;return Pe("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function g(w){const D=l[w.id],C=w.uniforms,G=w.__cache;a.bindBuffer(a.UNIFORM_BUFFER,D);for(let B=0,F=C.length;B<F;B++){const T=Array.isArray(C[B])?C[B]:[C[B]];for(let U=0,et=T.length;U<et;U++){const H=T[U];if(S(H,B,U,G)===!0){const q=H.__offset,nt=Array.isArray(H.value)?H.value:[H.value];let ot=0;for(let Y=0;Y<nt.length;Y++){const z=nt[Y],A=R(z);typeof z=="number"||typeof z=="boolean"?(H.__data[0]=z,a.bufferSubData(a.UNIFORM_BUFFER,q+ot,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,ot),ot+=A.storage/Float32Array.BYTES_PER_ELEMENT)}a.bufferSubData(a.UNIFORM_BUFFER,q,H.__data)}}}a.bindBuffer(a.UNIFORM_BUFFER,null)}function S(w,D,C,G){const B=w.value,F=D+"_"+C;if(G[F]===void 0)return typeof B=="number"||typeof B=="boolean"?G[F]=B:G[F]=B.clone(),!0;{const T=G[F];if(typeof B=="number"||typeof B=="boolean"){if(T!==B)return G[F]=B,!0}else if(T.equals(B)===!1)return T.copy(B),!0}return!1}function b(w){const D=w.uniforms;let C=0;const G=16;for(let F=0,T=D.length;F<T;F++){const U=Array.isArray(D[F])?D[F]:[D[F]];for(let et=0,H=U.length;et<H;et++){const q=U[et],nt=Array.isArray(q.value)?q.value:[q.value];for(let ot=0,Y=nt.length;ot<Y;ot++){const z=nt[ot],A=R(z),ht=C%G,lt=ht%A.boundary,Ct=ht+lt;C+=lt,Ct!==0&&G-Ct<A.storage&&(C+=G-Ct),q.__data=new Float32Array(A.storage/Float32Array.BYTES_PER_ELEMENT),q.__offset=C,C+=A.storage}}}const B=C%G;return B>0&&(C+=G-B),w.__size=C,w.__cache={},this}function R(w){const D={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(D.boundary=4,D.storage=4):w.isVector2?(D.boundary=8,D.storage=8):w.isVector3||w.isColor?(D.boundary=16,D.storage=12):w.isVector4?(D.boundary=16,D.storage=16):w.isMatrix3?(D.boundary=48,D.storage=48):w.isMatrix4?(D.boundary=64,D.storage=64):w.isTexture?ue("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ue("WebGLRenderer: Unsupported uniform value type.",w),D}function x(w){const D=w.target;D.removeEventListener("dispose",x);const C=f.indexOf(D.__bindingPointIndex);f.splice(C,1),a.deleteBuffer(l[D.id]),delete l[D.id],delete c[D.id]}function y(){for(const w in l)a.deleteBuffer(l[w]);f=[],l={},c={}}return{bind:m,update:p,dispose:y}}const W2=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let $i=null;function q2(){return $i===null&&($i=new Db(W2,16,16,uo,Ia),$i.name="DFG_LUT",$i.minFilter=Vn,$i.magFilter=Vn,$i.wrapS=Oa,$i.wrapT=Oa,$i.generateMipmaps=!1,$i.needsUpdate=!0),$i}class Y2{constructor(t={}){const{canvas:i=WM(),context:s=null,depth:l=!0,stencil:c=!1,alpha:f=!1,antialias:d=!1,premultipliedAlpha:m=!0,preserveDrawingBuffer:p=!1,powerPreference:v="default",failIfMajorPerformanceCaveat:_=!1,reversedDepthBuffer:g=!1,outputBufferType:S=vi}=t;this.isWebGLRenderer=!0;let b;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");b=s.getContextAttributes().alpha}else b=f;const R=S,x=new Set([Xp,kp,Vp]),y=new Set([vi,la,xl,yl,Hp,Gp]),w=new Uint32Array(4),D=new Int32Array(4);let C=null,G=null;const B=[],F=[];let T=null;this.domElement=i,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ra,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const U=this;let et=!1;this._outputColorSpace=Ci;let H=0,q=0,nt=null,ot=-1,Y=null;const z=new Ze,A=new Ze;let ht=null;const lt=new Ee(0);let Ct=0,I=i.width,K=i.height,Mt=1,wt=null,Bt=null;const st=new Ze(0,0,I,K),Et=new Ze(0,0,I,K);let gt=!1;const Ut=new Kp;let tt=!1,ct=!1;const qt=new nn,Xt=new Q,oe=new Ze,de={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Yt=!1;function se(){return nt===null?Mt:1}let X=s;function ce(N,J){return i.getContext(N,J)}try{const N={alpha:!0,depth:l,stencil:c,antialias:d,premultipliedAlpha:m,preserveDrawingBuffer:p,powerPreference:v,failIfMajorPerformanceCaveat:_};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${Fp}`),i.addEventListener("webglcontextlost",jt,!1),i.addEventListener("webglcontextrestored",he,!1),i.addEventListener("webglcontextcreationerror",Ie,!1),X===null){const J="webgl2";if(X=ce(J,N),X===null)throw ce(J)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(N){throw Pe("WebGLRenderer: "+N.message),N}let Jt,ne,Pt,O,E,V,$,k,P,it,rt,_t,At,xt,St,Nt,Lt,It,$t,j,zt,Ft,kt;function Ot(){Jt=new YT(X),Jt.init(),zt=new F2(X,Jt),ne=new BT(X,Jt,t,zt),Pt=new P2(X,Jt),ne.reversedDepthBuffer&&g&&Pt.buffers.depth.setReversed(!0),O=new KT(X),E=new S2,V=new z2(X,Jt,Pt,E,ne,zt,O),$=new qT(U),k=new eE(X),Ft=new FT(X,k),P=new jT(X,k,O,Ft),it=new JT(X,P,k,Ft,O),It=new QT(X,ne,V),St=new HT(E),rt=new y2(U,$,Jt,ne,Ft,St),_t=new k2(U,E),At=new b2,xt=new C2(Jt),Lt=new zT(U,$,Pt,it,b,m),Nt=new O2(U,it,ne),kt=new X2(X,O,ne,Pt),$t=new IT(X,Jt,O),j=new ZT(X,Jt,O),O.programs=rt.programs,U.capabilities=ne,U.extensions=Jt,U.properties=E,U.renderLists=At,U.shadowMap=Nt,U.state=Pt,U.info=O}Ot(),R!==vi&&(T=new tA(R,i.width,i.height,l,c));const bt=new G2(U,X);this.xr=bt,this.getContext=function(){return X},this.getContextAttributes=function(){return X.getContextAttributes()},this.forceContextLoss=function(){const N=Jt.get("WEBGL_lose_context");N&&N.loseContext()},this.forceContextRestore=function(){const N=Jt.get("WEBGL_lose_context");N&&N.restoreContext()},this.getPixelRatio=function(){return Mt},this.setPixelRatio=function(N){N!==void 0&&(Mt=N,this.setSize(I,K,!1))},this.getSize=function(N){return N.set(I,K)},this.setSize=function(N,J,vt=!0){if(bt.isPresenting){ue("WebGLRenderer: Can't change size while VR device is presenting.");return}I=N,K=J,i.width=Math.floor(N*Mt),i.height=Math.floor(J*Mt),vt===!0&&(i.style.width=N+"px",i.style.height=J+"px"),T!==null&&T.setSize(i.width,i.height),this.setViewport(0,0,N,J)},this.getDrawingBufferSize=function(N){return N.set(I*Mt,K*Mt).floor()},this.setDrawingBufferSize=function(N,J,vt){I=N,K=J,Mt=vt,i.width=Math.floor(N*vt),i.height=Math.floor(J*vt),this.setViewport(0,0,N,J)},this.setEffects=function(N){if(R===vi){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(N){for(let J=0;J<N.length;J++)if(N[J].isOutputPass===!0){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}T.setEffects(N||[])},this.getCurrentViewport=function(N){return N.copy(z)},this.getViewport=function(N){return N.copy(st)},this.setViewport=function(N,J,vt,pt){N.isVector4?st.set(N.x,N.y,N.z,N.w):st.set(N,J,vt,pt),Pt.viewport(z.copy(st).multiplyScalar(Mt).round())},this.getScissor=function(N){return N.copy(Et)},this.setScissor=function(N,J,vt,pt){N.isVector4?Et.set(N.x,N.y,N.z,N.w):Et.set(N,J,vt,pt),Pt.scissor(A.copy(Et).multiplyScalar(Mt).round())},this.getScissorTest=function(){return gt},this.setScissorTest=function(N){Pt.setScissorTest(gt=N)},this.setOpaqueSort=function(N){wt=N},this.setTransparentSort=function(N){Bt=N},this.getClearColor=function(N){return N.copy(Lt.getClearColor())},this.setClearColor=function(){Lt.setClearColor(...arguments)},this.getClearAlpha=function(){return Lt.getClearAlpha()},this.setClearAlpha=function(){Lt.setClearAlpha(...arguments)},this.clear=function(N=!0,J=!0,vt=!0){let pt=0;if(N){let ut=!1;if(nt!==null){const Ht=nt.texture.format;ut=x.has(Ht)}if(ut){const Ht=nt.texture.type,Wt=y.has(Ht),Vt=Lt.getClearColor(),ee=Lt.getClearAlpha(),ae=Vt.r,fe=Vt.g,me=Vt.b;Wt?(w[0]=ae,w[1]=fe,w[2]=me,w[3]=ee,X.clearBufferuiv(X.COLOR,0,w)):(D[0]=ae,D[1]=fe,D[2]=me,D[3]=ee,X.clearBufferiv(X.COLOR,0,D))}else pt|=X.COLOR_BUFFER_BIT}J&&(pt|=X.DEPTH_BUFFER_BIT),vt&&(pt|=X.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),pt!==0&&X.clear(pt)},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(){i.removeEventListener("webglcontextlost",jt,!1),i.removeEventListener("webglcontextrestored",he,!1),i.removeEventListener("webglcontextcreationerror",Ie,!1),Lt.dispose(),At.dispose(),xt.dispose(),E.dispose(),$.dispose(),it.dispose(),Ft.dispose(),kt.dispose(),rt.dispose(),bt.dispose(),bt.removeEventListener("sessionstart",rr),bt.removeEventListener("sessionend",or),Yi.stop()};function jt(N){N.preventDefault(),Nu("WebGLRenderer: Context Lost."),et=!0}function he(){Nu("WebGLRenderer: Context Restored."),et=!1;const N=O.autoReset,J=Nt.enabled,vt=Nt.autoUpdate,pt=Nt.needsUpdate,ut=Nt.type;Ot(),O.autoReset=N,Nt.enabled=J,Nt.autoUpdate=vt,Nt.needsUpdate=pt,Nt.type=ut}function Ie(N){Pe("WebGLRenderer: A WebGL context could not be created. Reason: ",N.statusMessage)}function De(N){const J=N.target;J.removeEventListener("dispose",De),kn(J)}function kn(N){Ui(N),E.remove(N)}function Ui(N){const J=E.get(N).programs;J!==void 0&&(J.forEach(function(vt){rt.releaseProgram(vt)}),N.isShaderMaterial&&rt.releaseShaderCache(N))}this.renderBufferDirect=function(N,J,vt,pt,ut,Ht){J===null&&(J=de);const Wt=ut.isMesh&&ut.matrixWorld.determinant()<0,Vt=Rl(N,J,vt,pt,ut);Pt.setMaterial(pt,Wt);let ee=vt.index,ae=1;if(pt.wireframe===!0){if(ee=P.getWireframeAttribute(vt),ee===void 0)return;ae=2}const fe=vt.drawRange,me=vt.attributes.position;let Kt=fe.start*ae,ye=(fe.start+fe.count)*ae;Ht!==null&&(Kt=Math.max(Kt,Ht.start*ae),ye=Math.min(ye,(Ht.start+Ht.count)*ae)),ee!==null?(Kt=Math.max(Kt,0),ye=Math.min(ye,ee.count)):me!=null&&(Kt=Math.max(Kt,0),ye=Math.min(ye,me.count));const Je=ye-Kt;if(Je<0||Je===1/0)return;Ft.setup(ut,pt,Vt,vt,ee);let $e,Le=$t;if(ee!==null&&($e=k.get(ee),Le=j,Le.setIndex($e)),ut.isMesh)pt.wireframe===!0?(Pt.setLineWidth(pt.wireframeLinewidth*se()),Le.setMode(X.LINES)):Le.setMode(X.TRIANGLES);else if(ut.isLine){let xn=pt.linewidth;xn===void 0&&(xn=1),Pt.setLineWidth(xn*se()),ut.isLineSegments?Le.setMode(X.LINES):ut.isLineLoop?Le.setMode(X.LINE_LOOP):Le.setMode(X.LINE_STRIP)}else ut.isPoints?Le.setMode(X.POINTS):ut.isSprite&&Le.setMode(X.TRIANGLES);if(ut.isBatchedMesh)if(ut._multiDrawInstances!==null)Ou("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Le.renderMultiDrawInstances(ut._multiDrawStarts,ut._multiDrawCounts,ut._multiDrawCount,ut._multiDrawInstances);else if(Jt.get("WEBGL_multi_draw"))Le.renderMultiDraw(ut._multiDrawStarts,ut._multiDrawCounts,ut._multiDrawCount);else{const xn=ut._multiDrawStarts,te=ut._multiDrawCounts,Xn=ut._multiDrawCount,pe=ee?k.get(ee).bytesPerElement:1,Wn=E.get(pt).currentProgram.getUniforms();for(let ri=0;ri<Xn;ri++)Wn.setValue(X,"_gl_DrawID",ri),Le.render(xn[ri]/pe,te[ri])}else if(ut.isInstancedMesh)Le.renderInstances(Kt,Je,ut.count);else if(vt.isInstancedBufferGeometry){const xn=vt._maxInstanceCount!==void 0?vt._maxInstanceCount:1/0,te=Math.min(vt.instanceCount,xn);Le.renderInstances(Kt,Je,te)}else Le.render(Kt,Je)};function _o(N,J,vt){N.transparent===!0&&N.side===ki&&N.forceSinglePass===!1?(N.side=si,N.needsUpdate=!0,Ga(N,J,vt),N.side=Es,N.needsUpdate=!0,Ga(N,J,vt),N.side=ki):Ga(N,J,vt)}this.compile=function(N,J,vt=null){vt===null&&(vt=N),G=xt.get(vt),G.init(J),F.push(G),vt.traverseVisible(function(ut){ut.isLight&&ut.layers.test(J.layers)&&(G.pushLight(ut),ut.castShadow&&G.pushShadow(ut))}),N!==vt&&N.traverseVisible(function(ut){ut.isLight&&ut.layers.test(J.layers)&&(G.pushLight(ut),ut.castShadow&&G.pushShadow(ut))}),G.setupLights();const pt=new Set;return N.traverse(function(ut){if(!(ut.isMesh||ut.isPoints||ut.isLine||ut.isSprite))return;const Ht=ut.material;if(Ht)if(Array.isArray(Ht))for(let Wt=0;Wt<Ht.length;Wt++){const Vt=Ht[Wt];_o(Vt,vt,ut),pt.add(Vt)}else _o(Ht,vt,ut),pt.add(Ht)}),G=F.pop(),pt},this.compileAsync=function(N,J,vt=null){const pt=this.compile(N,J,vt);return new Promise(ut=>{function Ht(){if(pt.forEach(function(Wt){E.get(Wt).currentProgram.isReady()&&pt.delete(Wt)}),pt.size===0){ut(N);return}setTimeout(Ht,10)}Jt.get("KHR_parallel_shader_compile")!==null?Ht():setTimeout(Ht,10)})};let sr=null;function El(N){sr&&sr(N)}function rr(){Yi.stop()}function or(){Yi.start()}const Yi=new Bx;Yi.setAnimationLoop(El),typeof self<"u"&&Yi.setContext(self),this.setAnimationLoop=function(N){sr=N,bt.setAnimationLoop(N),N===null?Yi.stop():Yi.start()},bt.addEventListener("sessionstart",rr),bt.addEventListener("sessionend",or),this.render=function(N,J){if(J!==void 0&&J.isCamera!==!0){Pe("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(et===!0)return;const vt=bt.enabled===!0&&bt.isPresenting===!0,pt=T!==null&&(nt===null||vt)&&T.begin(U,nt);if(N.matrixWorldAutoUpdate===!0&&N.updateMatrixWorld(),J.parent===null&&J.matrixWorldAutoUpdate===!0&&J.updateMatrixWorld(),bt.enabled===!0&&bt.isPresenting===!0&&(T===null||T.isCompositing()===!1)&&(bt.cameraAutoUpdate===!0&&bt.updateCamera(J),J=bt.getCamera()),N.isScene===!0&&N.onBeforeRender(U,N,J,nt),G=xt.get(N,F.length),G.init(J),F.push(G),qt.multiplyMatrices(J.projectionMatrix,J.matrixWorldInverse),Ut.setFromProjectionMatrix(qt,aa,J.reversedDepth),ct=this.localClippingEnabled,tt=St.init(this.clippingPlanes,ct),C=At.get(N,B.length),C.init(),B.push(C),bt.enabled===!0&&bt.isPresenting===!0){const Wt=U.xr.getDepthSensingMesh();Wt!==null&&lr(Wt,J,-1/0,U.sortObjects)}lr(N,J,0,U.sortObjects),C.finish(),U.sortObjects===!0&&C.sort(wt,Bt),Yt=bt.enabled===!1||bt.isPresenting===!1||bt.hasDepthSensing()===!1,Yt&&Lt.addToRenderList(C,N),this.info.render.frame++,tt===!0&&St.beginShadows();const ut=G.state.shadowsArray;if(Nt.render(ut,N,J),tt===!0&&St.endShadows(),this.info.autoReset===!0&&this.info.reset(),(pt&&T.hasRenderPass())===!1){const Wt=C.opaque,Vt=C.transmissive;if(G.setupLights(),J.isArrayCamera){const ee=J.cameras;if(Vt.length>0)for(let ae=0,fe=ee.length;ae<fe;ae++){const me=ee[ae];cn(Wt,Vt,N,me)}Yt&&Lt.render(N);for(let ae=0,fe=ee.length;ae<fe;ae++){const me=ee[ae];Li(C,N,me,me.viewport)}}else Vt.length>0&&cn(Wt,Vt,N,J),Yt&&Lt.render(N),Li(C,N,J)}nt!==null&&q===0&&(V.updateMultisampleRenderTarget(nt),V.updateRenderTargetMipmap(nt)),pt&&T.end(U),N.isScene===!0&&N.onAfterRender(U,N,J),Ft.resetDefaultState(),ot=-1,Y=null,F.pop(),F.length>0?(G=F[F.length-1],tt===!0&&St.setGlobalState(U.clippingPlanes,G.state.camera)):G=null,B.pop(),B.length>0?C=B[B.length-1]:C=null};function lr(N,J,vt,pt){if(N.visible===!1)return;if(N.layers.test(J.layers)){if(N.isGroup)vt=N.renderOrder;else if(N.isLOD)N.autoUpdate===!0&&N.update(J);else if(N.isLight)G.pushLight(N),N.castShadow&&G.pushShadow(N);else if(N.isSprite){if(!N.frustumCulled||Ut.intersectsSprite(N)){pt&&oe.setFromMatrixPosition(N.matrixWorld).applyMatrix4(qt);const Wt=it.update(N),Vt=N.material;Vt.visible&&C.push(N,Wt,Vt,vt,oe.z,null)}}else if((N.isMesh||N.isLine||N.isPoints)&&(!N.frustumCulled||Ut.intersectsObject(N))){const Wt=it.update(N),Vt=N.material;if(pt&&(N.boundingSphere!==void 0?(N.boundingSphere===null&&N.computeBoundingSphere(),oe.copy(N.boundingSphere.center)):(Wt.boundingSphere===null&&Wt.computeBoundingSphere(),oe.copy(Wt.boundingSphere.center)),oe.applyMatrix4(N.matrixWorld).applyMatrix4(qt)),Array.isArray(Vt)){const ee=Wt.groups;for(let ae=0,fe=ee.length;ae<fe;ae++){const me=ee[ae],Kt=Vt[me.materialIndex];Kt&&Kt.visible&&C.push(N,Wt,Kt,vt,oe.z,me)}}else Vt.visible&&C.push(N,Wt,Vt,vt,oe.z,null)}}const Ht=N.children;for(let Wt=0,Vt=Ht.length;Wt<Vt;Wt++)lr(Ht[Wt],J,vt,pt)}function Li(N,J,vt,pt){const{opaque:ut,transmissive:Ht,transparent:Wt}=N;G.setupLightsView(vt),tt===!0&&St.setGlobalState(U.clippingPlanes,vt),pt&&Pt.viewport(z.copy(pt)),ut.length>0&&vn(ut,J,vt),Ht.length>0&&vn(Ht,J,vt),Wt.length>0&&vn(Wt,J,vt),Pt.buffers.depth.setTest(!0),Pt.buffers.depth.setMask(!0),Pt.buffers.color.setMask(!0),Pt.setPolygonOffset(!1)}function cn(N,J,vt,pt){if((vt.isScene===!0?vt.overrideMaterial:null)!==null)return;if(G.state.transmissionRenderTarget[pt.id]===void 0){const Kt=Jt.has("EXT_color_buffer_half_float")||Jt.has("EXT_color_buffer_float");G.state.transmissionRenderTarget[pt.id]=new oa(1,1,{generateMipmaps:!0,type:Kt?Ia:vi,minFilter:$s,samples:Math.max(4,ne.samples),stencilBuffer:c,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Ue.workingColorSpace})}const Ht=G.state.transmissionRenderTarget[pt.id],Wt=pt.viewport||z;Ht.setSize(Wt.z*U.transmissionResolutionScale,Wt.w*U.transmissionResolutionScale);const Vt=U.getRenderTarget(),ee=U.getActiveCubeFace(),ae=U.getActiveMipmapLevel();U.setRenderTarget(Ht),U.getClearColor(lt),Ct=U.getClearAlpha(),Ct<1&&U.setClearColor(16777215,.5),U.clear(),Yt&&Lt.render(vt);const fe=U.toneMapping;U.toneMapping=ra;const me=pt.viewport;if(pt.viewport!==void 0&&(pt.viewport=void 0),G.setupLightsView(pt),tt===!0&&St.setGlobalState(U.clippingPlanes,pt),vn(N,vt,pt),V.updateMultisampleRenderTarget(Ht),V.updateRenderTargetMipmap(Ht),Jt.has("WEBGL_multisampled_render_to_texture")===!1){let Kt=!1;for(let ye=0,Je=J.length;ye<Je;ye++){const $e=J[ye],{object:Le,geometry:xn,material:te,group:Xn}=$e;if(te.side===ki&&Le.layers.test(pt.layers)){const pe=te.side;te.side=si,te.needsUpdate=!0,ua(Le,vt,pt,xn,te,Xn),te.side=pe,te.needsUpdate=!0,Kt=!0}}Kt===!0&&(V.updateMultisampleRenderTarget(Ht),V.updateRenderTargetMipmap(Ht))}U.setRenderTarget(Vt,ee,ae),U.setClearColor(lt,Ct),me!==void 0&&(pt.viewport=me),U.toneMapping=fe}function vn(N,J,vt){const pt=J.isScene===!0?J.overrideMaterial:null;for(let ut=0,Ht=N.length;ut<Ht;ut++){const Wt=N[ut],{object:Vt,geometry:ee,group:ae}=Wt;let fe=Wt.material;fe.allowOverride===!0&&pt!==null&&(fe=pt),Vt.layers.test(vt.layers)&&ua(Vt,J,vt,ee,fe,ae)}}function ua(N,J,vt,pt,ut,Ht){N.onBeforeRender(U,J,vt,pt,ut,Ht),N.modelViewMatrix.multiplyMatrices(vt.matrixWorldInverse,N.matrixWorld),N.normalMatrix.getNormalMatrix(N.modelViewMatrix),ut.onBeforeRender(U,J,vt,pt,N,Ht),ut.transparent===!0&&ut.side===ki&&ut.forceSinglePass===!1?(ut.side=si,ut.needsUpdate=!0,U.renderBufferDirect(vt,J,pt,ut,N,Ht),ut.side=Es,ut.needsUpdate=!0,U.renderBufferDirect(vt,J,pt,ut,N,Ht),ut.side=ki):U.renderBufferDirect(vt,J,pt,ut,N,Ht),N.onAfterRender(U,J,vt,pt,ut,Ht)}function Ga(N,J,vt){J.isScene!==!0&&(J=de);const pt=E.get(N),ut=G.state.lights,Ht=G.state.shadowsArray,Wt=ut.state.version,Vt=rt.getParameters(N,ut.state,Ht,J,vt),ee=rt.getProgramCacheKey(Vt);let ae=pt.programs;pt.environment=N.isMeshStandardMaterial||N.isMeshLambertMaterial||N.isMeshPhongMaterial?J.environment:null,pt.fog=J.fog;const fe=N.isMeshStandardMaterial||N.isMeshLambertMaterial&&!N.envMap||N.isMeshPhongMaterial&&!N.envMap;pt.envMap=$.get(N.envMap||pt.environment,fe),pt.envMapRotation=pt.environment!==null&&N.envMap===null?J.environmentRotation:N.envMapRotation,ae===void 0&&(N.addEventListener("dispose",De),ae=new Map,pt.programs=ae);let me=ae.get(ee);if(me!==void 0){if(pt.currentProgram===me&&pt.lightsStateVersion===Wt)return Al(N,Vt),me}else Vt.uniforms=rt.getUniforms(N),N.onBeforeCompile(Vt,U),me=rt.acquireProgram(Vt,ee),ae.set(ee,me),pt.uniforms=Vt.uniforms;const Kt=pt.uniforms;return(!N.isShaderMaterial&&!N.isRawShaderMaterial||N.clipping===!0)&&(Kt.clippingPlanes=St.uniform),Al(N,Vt),pt.needsLights=vo(N),pt.lightsStateVersion=Wt,pt.needsLights&&(Kt.ambientLightColor.value=ut.state.ambient,Kt.lightProbe.value=ut.state.probe,Kt.directionalLights.value=ut.state.directional,Kt.directionalLightShadows.value=ut.state.directionalShadow,Kt.spotLights.value=ut.state.spot,Kt.spotLightShadows.value=ut.state.spotShadow,Kt.rectAreaLights.value=ut.state.rectArea,Kt.ltc_1.value=ut.state.rectAreaLTC1,Kt.ltc_2.value=ut.state.rectAreaLTC2,Kt.pointLights.value=ut.state.point,Kt.pointLightShadows.value=ut.state.pointShadow,Kt.hemisphereLights.value=ut.state.hemi,Kt.directionalShadowMatrix.value=ut.state.directionalShadowMatrix,Kt.spotLightMatrix.value=ut.state.spotLightMatrix,Kt.spotLightMap.value=ut.state.spotLightMap,Kt.pointShadowMatrix.value=ut.state.pointShadowMatrix),pt.currentProgram=me,pt.uniformsList=null,me}function Tl(N){if(N.uniformsList===null){const J=N.currentProgram.getUniforms();N.uniformsList=Ru.seqWithValue(J.seq,N.uniforms)}return N.uniformsList}function Al(N,J){const vt=E.get(N);vt.outputColorSpace=J.outputColorSpace,vt.batching=J.batching,vt.batchingColor=J.batchingColor,vt.instancing=J.instancing,vt.instancingColor=J.instancingColor,vt.instancingMorph=J.instancingMorph,vt.skinning=J.skinning,vt.morphTargets=J.morphTargets,vt.morphNormals=J.morphNormals,vt.morphColors=J.morphColors,vt.morphTargetsCount=J.morphTargetsCount,vt.numClippingPlanes=J.numClippingPlanes,vt.numIntersection=J.numClipIntersection,vt.vertexAlphas=J.vertexAlphas,vt.vertexTangents=J.vertexTangents,vt.toneMapping=J.toneMapping}function Rl(N,J,vt,pt,ut){J.isScene!==!0&&(J=de),V.resetTextureUnits();const Ht=J.fog,Wt=pt.isMeshStandardMaterial||pt.isMeshLambertMaterial||pt.isMeshPhongMaterial?J.environment:null,Vt=nt===null?U.outputColorSpace:nt.isXRRenderTarget===!0?nt.texture.colorSpace:fo,ee=pt.isMeshStandardMaterial||pt.isMeshLambertMaterial&&!pt.envMap||pt.isMeshPhongMaterial&&!pt.envMap,ae=$.get(pt.envMap||Wt,ee),fe=pt.vertexColors===!0&&!!vt.attributes.color&&vt.attributes.color.itemSize===4,me=!!vt.attributes.tangent&&(!!pt.normalMap||pt.anisotropy>0),Kt=!!vt.morphAttributes.position,ye=!!vt.morphAttributes.normal,Je=!!vt.morphAttributes.color;let $e=ra;pt.toneMapped&&(nt===null||nt.isXRRenderTarget===!0)&&($e=U.toneMapping);const Le=vt.morphAttributes.position||vt.morphAttributes.normal||vt.morphAttributes.color,xn=Le!==void 0?Le.length:0,te=E.get(pt),Xn=G.state.lights;if(tt===!0&&(ct===!0||N!==Y)){const fn=N===Y&&pt.id===ot;St.setState(pt,N,fn)}let pe=!1;pt.version===te.__version?(te.needsLights&&te.lightsStateVersion!==Xn.state.version||te.outputColorSpace!==Vt||ut.isBatchedMesh&&te.batching===!1||!ut.isBatchedMesh&&te.batching===!0||ut.isBatchedMesh&&te.batchingColor===!0&&ut.colorTexture===null||ut.isBatchedMesh&&te.batchingColor===!1&&ut.colorTexture!==null||ut.isInstancedMesh&&te.instancing===!1||!ut.isInstancedMesh&&te.instancing===!0||ut.isSkinnedMesh&&te.skinning===!1||!ut.isSkinnedMesh&&te.skinning===!0||ut.isInstancedMesh&&te.instancingColor===!0&&ut.instanceColor===null||ut.isInstancedMesh&&te.instancingColor===!1&&ut.instanceColor!==null||ut.isInstancedMesh&&te.instancingMorph===!0&&ut.morphTexture===null||ut.isInstancedMesh&&te.instancingMorph===!1&&ut.morphTexture!==null||te.envMap!==ae||pt.fog===!0&&te.fog!==Ht||te.numClippingPlanes!==void 0&&(te.numClippingPlanes!==St.numPlanes||te.numIntersection!==St.numIntersection)||te.vertexAlphas!==fe||te.vertexTangents!==me||te.morphTargets!==Kt||te.morphNormals!==ye||te.morphColors!==Je||te.toneMapping!==$e||te.morphTargetsCount!==xn)&&(pe=!0):(pe=!0,te.__version=pt.version);let Wn=te.currentProgram;pe===!0&&(Wn=Ga(pt,J,ut));let ri=!1,Ni=!1,oi=!1;const Fe=Wn.getUniforms(),un=te.uniforms;if(Pt.useProgram(Wn.program)&&(ri=!0,Ni=!0,oi=!0),pt.id!==ot&&(ot=pt.id,Ni=!0),ri||Y!==N){Pt.buffers.depth.getReversed()&&N.reversedDepth!==!0&&(N._reversedDepth=!0,N.updateProjectionMatrix()),Fe.setValue(X,"projectionMatrix",N.projectionMatrix),Fe.setValue(X,"viewMatrix",N.matrixWorldInverse);const Oi=Fe.map.cameraPosition;Oi!==void 0&&Oi.setValue(X,Xt.setFromMatrixPosition(N.matrixWorld)),ne.logarithmicDepthBuffer&&Fe.setValue(X,"logDepthBufFC",2/(Math.log(N.far+1)/Math.LN2)),(pt.isMeshPhongMaterial||pt.isMeshToonMaterial||pt.isMeshLambertMaterial||pt.isMeshBasicMaterial||pt.isMeshStandardMaterial||pt.isShaderMaterial)&&Fe.setValue(X,"isOrthographic",N.isOrthographicCamera===!0),Y!==N&&(Y=N,Ni=!0,oi=!0)}if(te.needsLights&&(Xn.state.directionalShadowMap.length>0&&Fe.setValue(X,"directionalShadowMap",Xn.state.directionalShadowMap,V),Xn.state.spotShadowMap.length>0&&Fe.setValue(X,"spotShadowMap",Xn.state.spotShadowMap,V),Xn.state.pointShadowMap.length>0&&Fe.setValue(X,"pointShadowMap",Xn.state.pointShadowMap,V)),ut.isSkinnedMesh){Fe.setOptional(X,ut,"bindMatrix"),Fe.setOptional(X,ut,"bindMatrixInverse");const fn=ut.skeleton;fn&&(fn.boneTexture===null&&fn.computeBoneTexture(),Fe.setValue(X,"boneTexture",fn.boneTexture,V))}ut.isBatchedMesh&&(Fe.setOptional(X,ut,"batchingTexture"),Fe.setValue(X,"batchingTexture",ut._matricesTexture,V),Fe.setOptional(X,ut,"batchingIdTexture"),Fe.setValue(X,"batchingIdTexture",ut._indirectTexture,V),Fe.setOptional(X,ut,"batchingColorTexture"),ut._colorsTexture!==null&&Fe.setValue(X,"batchingColorTexture",ut._colorsTexture,V));const qn=vt.morphAttributes;if((qn.position!==void 0||qn.normal!==void 0||qn.color!==void 0)&&It.update(ut,vt,Wn),(Ni||te.receiveShadow!==ut.receiveShadow)&&(te.receiveShadow=ut.receiveShadow,Fe.setValue(X,"receiveShadow",ut.receiveShadow)),(pt.isMeshStandardMaterial||pt.isMeshLambertMaterial||pt.isMeshPhongMaterial)&&pt.envMap===null&&J.environment!==null&&(un.envMapIntensity.value=J.environmentIntensity),un.dfgLUT!==void 0&&(un.dfgLUT.value=q2()),Ni&&(Fe.setValue(X,"toneMappingExposure",U.toneMappingExposure),te.needsLights&&Rs(un,oi),Ht&&pt.fog===!0&&_t.refreshFogUniforms(un,Ht),_t.refreshMaterialUniforms(un,pt,Mt,K,G.state.transmissionRenderTarget[N.id]),Ru.upload(X,Tl(te),un,V)),pt.isShaderMaterial&&pt.uniformsNeedUpdate===!0&&(Ru.upload(X,Tl(te),un,V),pt.uniformsNeedUpdate=!1),pt.isSpriteMaterial&&Fe.setValue(X,"center",ut.center),Fe.setValue(X,"modelViewMatrix",ut.modelViewMatrix),Fe.setValue(X,"normalMatrix",ut.normalMatrix),Fe.setValue(X,"modelMatrix",ut.matrixWorld),pt.isShaderMaterial||pt.isRawShaderMaterial){const fn=pt.uniformsGroups;for(let Oi=0,fa=fn.length;Oi<fa;Oi++){const cr=fn[Oi];kt.update(cr,Wn),kt.bind(cr,Wn)}}return Wn}function Rs(N,J){N.ambientLightColor.needsUpdate=J,N.lightProbe.needsUpdate=J,N.directionalLights.needsUpdate=J,N.directionalLightShadows.needsUpdate=J,N.pointLights.needsUpdate=J,N.pointLightShadows.needsUpdate=J,N.spotLights.needsUpdate=J,N.spotLightShadows.needsUpdate=J,N.rectAreaLights.needsUpdate=J,N.hemisphereLights.needsUpdate=J}function vo(N){return N.isMeshLambertMaterial||N.isMeshToonMaterial||N.isMeshPhongMaterial||N.isMeshStandardMaterial||N.isShadowMaterial||N.isShaderMaterial&&N.lights===!0}this.getActiveCubeFace=function(){return H},this.getActiveMipmapLevel=function(){return q},this.getRenderTarget=function(){return nt},this.setRenderTargetTextures=function(N,J,vt){const pt=E.get(N);pt.__autoAllocateDepthBuffer=N.resolveDepthBuffer===!1,pt.__autoAllocateDepthBuffer===!1&&(pt.__useRenderToTexture=!1),E.get(N.texture).__webglTexture=J,E.get(N.depthTexture).__webglTexture=pt.__autoAllocateDepthBuffer?void 0:vt,pt.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(N,J){const vt=E.get(N);vt.__webglFramebuffer=J,vt.__useDefaultFramebuffer=J===void 0};const Va=X.createFramebuffer();this.setRenderTarget=function(N,J=0,vt=0){nt=N,H=J,q=vt;let pt=null,ut=!1,Ht=!1;if(N){const Vt=E.get(N);if(Vt.__useDefaultFramebuffer!==void 0){Pt.bindFramebuffer(X.FRAMEBUFFER,Vt.__webglFramebuffer),z.copy(N.viewport),A.copy(N.scissor),ht=N.scissorTest,Pt.viewport(z),Pt.scissor(A),Pt.setScissorTest(ht),ot=-1;return}else if(Vt.__webglFramebuffer===void 0)V.setupRenderTarget(N);else if(Vt.__hasExternalTextures)V.rebindTextures(N,E.get(N.texture).__webglTexture,E.get(N.depthTexture).__webglTexture);else if(N.depthBuffer){const fe=N.depthTexture;if(Vt.__boundDepthTexture!==fe){if(fe!==null&&E.has(fe)&&(N.width!==fe.image.width||N.height!==fe.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");V.setupDepthRenderbuffer(N)}}const ee=N.texture;(ee.isData3DTexture||ee.isDataArrayTexture||ee.isCompressedArrayTexture)&&(Ht=!0);const ae=E.get(N).__webglFramebuffer;N.isWebGLCubeRenderTarget?(Array.isArray(ae[J])?pt=ae[J][vt]:pt=ae[J],ut=!0):N.samples>0&&V.useMultisampledRTT(N)===!1?pt=E.get(N).__webglMultisampledFramebuffer:Array.isArray(ae)?pt=ae[vt]:pt=ae,z.copy(N.viewport),A.copy(N.scissor),ht=N.scissorTest}else z.copy(st).multiplyScalar(Mt).floor(),A.copy(Et).multiplyScalar(Mt).floor(),ht=gt;if(vt!==0&&(pt=Va),Pt.bindFramebuffer(X.FRAMEBUFFER,pt)&&Pt.drawBuffers(N,pt),Pt.viewport(z),Pt.scissor(A),Pt.setScissorTest(ht),ut){const Vt=E.get(N.texture);X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_CUBE_MAP_POSITIVE_X+J,Vt.__webglTexture,vt)}else if(Ht){const Vt=J;for(let ee=0;ee<N.textures.length;ee++){const ae=E.get(N.textures[ee]);X.framebufferTextureLayer(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0+ee,ae.__webglTexture,vt,Vt)}}else if(N!==null&&vt!==0){const Vt=E.get(N.texture);X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,Vt.__webglTexture,vt)}ot=-1},this.readRenderTargetPixels=function(N,J,vt,pt,ut,Ht,Wt,Vt=0){if(!(N&&N.isWebGLRenderTarget)){Pe("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ee=E.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&Wt!==void 0&&(ee=ee[Wt]),ee){Pt.bindFramebuffer(X.FRAMEBUFFER,ee);try{const ae=N.textures[Vt],fe=ae.format,me=ae.type;if(N.textures.length>1&&X.readBuffer(X.COLOR_ATTACHMENT0+Vt),!ne.textureFormatReadable(fe)){Pe("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!ne.textureTypeReadable(me)){Pe("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}J>=0&&J<=N.width-pt&&vt>=0&&vt<=N.height-ut&&X.readPixels(J,vt,pt,ut,zt.convert(fe),zt.convert(me),Ht)}finally{const ae=nt!==null?E.get(nt).__webglFramebuffer:null;Pt.bindFramebuffer(X.FRAMEBUFFER,ae)}}},this.readRenderTargetPixelsAsync=async function(N,J,vt,pt,ut,Ht,Wt,Vt=0){if(!(N&&N.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let ee=E.get(N).__webglFramebuffer;if(N.isWebGLCubeRenderTarget&&Wt!==void 0&&(ee=ee[Wt]),ee)if(J>=0&&J<=N.width-pt&&vt>=0&&vt<=N.height-ut){Pt.bindFramebuffer(X.FRAMEBUFFER,ee);const ae=N.textures[Vt],fe=ae.format,me=ae.type;if(N.textures.length>1&&X.readBuffer(X.COLOR_ATTACHMENT0+Vt),!ne.textureFormatReadable(fe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ne.textureTypeReadable(me))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Kt=X.createBuffer();X.bindBuffer(X.PIXEL_PACK_BUFFER,Kt),X.bufferData(X.PIXEL_PACK_BUFFER,Ht.byteLength,X.STREAM_READ),X.readPixels(J,vt,pt,ut,zt.convert(fe),zt.convert(me),0);const ye=nt!==null?E.get(nt).__webglFramebuffer:null;Pt.bindFramebuffer(X.FRAMEBUFFER,ye);const Je=X.fenceSync(X.SYNC_GPU_COMMANDS_COMPLETE,0);return X.flush(),await qM(X,Je,4),X.bindBuffer(X.PIXEL_PACK_BUFFER,Kt),X.getBufferSubData(X.PIXEL_PACK_BUFFER,0,Ht),X.deleteBuffer(Kt),X.deleteSync(Je),Ht}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(N,J=null,vt=0){const pt=Math.pow(2,-vt),ut=Math.floor(N.image.width*pt),Ht=Math.floor(N.image.height*pt),Wt=J!==null?J.x:0,Vt=J!==null?J.y:0;V.setTexture2D(N,0),X.copyTexSubImage2D(X.TEXTURE_2D,vt,0,0,Wt,Vt,ut,Ht),Pt.unbindTexture()};const ka=X.createFramebuffer(),ws=X.createFramebuffer();this.copyTextureToTexture=function(N,J,vt=null,pt=null,ut=0,Ht=0){let Wt,Vt,ee,ae,fe,me,Kt,ye,Je;const $e=N.isCompressedTexture?N.mipmaps[Ht]:N.image;if(vt!==null)Wt=vt.max.x-vt.min.x,Vt=vt.max.y-vt.min.y,ee=vt.isBox3?vt.max.z-vt.min.z:1,ae=vt.min.x,fe=vt.min.y,me=vt.isBox3?vt.min.z:0;else{const un=Math.pow(2,-ut);Wt=Math.floor($e.width*un),Vt=Math.floor($e.height*un),N.isDataArrayTexture?ee=$e.depth:N.isData3DTexture?ee=Math.floor($e.depth*un):ee=1,ae=0,fe=0,me=0}pt!==null?(Kt=pt.x,ye=pt.y,Je=pt.z):(Kt=0,ye=0,Je=0);const Le=zt.convert(J.format),xn=zt.convert(J.type);let te;J.isData3DTexture?(V.setTexture3D(J,0),te=X.TEXTURE_3D):J.isDataArrayTexture||J.isCompressedArrayTexture?(V.setTexture2DArray(J,0),te=X.TEXTURE_2D_ARRAY):(V.setTexture2D(J,0),te=X.TEXTURE_2D),X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL,J.flipY),X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL,J.premultiplyAlpha),X.pixelStorei(X.UNPACK_ALIGNMENT,J.unpackAlignment);const Xn=X.getParameter(X.UNPACK_ROW_LENGTH),pe=X.getParameter(X.UNPACK_IMAGE_HEIGHT),Wn=X.getParameter(X.UNPACK_SKIP_PIXELS),ri=X.getParameter(X.UNPACK_SKIP_ROWS),Ni=X.getParameter(X.UNPACK_SKIP_IMAGES);X.pixelStorei(X.UNPACK_ROW_LENGTH,$e.width),X.pixelStorei(X.UNPACK_IMAGE_HEIGHT,$e.height),X.pixelStorei(X.UNPACK_SKIP_PIXELS,ae),X.pixelStorei(X.UNPACK_SKIP_ROWS,fe),X.pixelStorei(X.UNPACK_SKIP_IMAGES,me);const oi=N.isDataArrayTexture||N.isData3DTexture,Fe=J.isDataArrayTexture||J.isData3DTexture;if(N.isDepthTexture){const un=E.get(N),qn=E.get(J),fn=E.get(un.__renderTarget),Oi=E.get(qn.__renderTarget);Pt.bindFramebuffer(X.READ_FRAMEBUFFER,fn.__webglFramebuffer),Pt.bindFramebuffer(X.DRAW_FRAMEBUFFER,Oi.__webglFramebuffer);for(let fa=0;fa<ee;fa++)oi&&(X.framebufferTextureLayer(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,E.get(N).__webglTexture,ut,me+fa),X.framebufferTextureLayer(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,E.get(J).__webglTexture,Ht,Je+fa)),X.blitFramebuffer(ae,fe,Wt,Vt,Kt,ye,Wt,Vt,X.DEPTH_BUFFER_BIT,X.NEAREST);Pt.bindFramebuffer(X.READ_FRAMEBUFFER,null),Pt.bindFramebuffer(X.DRAW_FRAMEBUFFER,null)}else if(ut!==0||N.isRenderTargetTexture||E.has(N)){const un=E.get(N),qn=E.get(J);Pt.bindFramebuffer(X.READ_FRAMEBUFFER,ka),Pt.bindFramebuffer(X.DRAW_FRAMEBUFFER,ws);for(let fn=0;fn<ee;fn++)oi?X.framebufferTextureLayer(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,un.__webglTexture,ut,me+fn):X.framebufferTexture2D(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,un.__webglTexture,ut),Fe?X.framebufferTextureLayer(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,qn.__webglTexture,Ht,Je+fn):X.framebufferTexture2D(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,qn.__webglTexture,Ht),ut!==0?X.blitFramebuffer(ae,fe,Wt,Vt,Kt,ye,Wt,Vt,X.COLOR_BUFFER_BIT,X.NEAREST):Fe?X.copyTexSubImage3D(te,Ht,Kt,ye,Je+fn,ae,fe,Wt,Vt):X.copyTexSubImage2D(te,Ht,Kt,ye,ae,fe,Wt,Vt);Pt.bindFramebuffer(X.READ_FRAMEBUFFER,null),Pt.bindFramebuffer(X.DRAW_FRAMEBUFFER,null)}else Fe?N.isDataTexture||N.isData3DTexture?X.texSubImage3D(te,Ht,Kt,ye,Je,Wt,Vt,ee,Le,xn,$e.data):J.isCompressedArrayTexture?X.compressedTexSubImage3D(te,Ht,Kt,ye,Je,Wt,Vt,ee,Le,$e.data):X.texSubImage3D(te,Ht,Kt,ye,Je,Wt,Vt,ee,Le,xn,$e):N.isDataTexture?X.texSubImage2D(X.TEXTURE_2D,Ht,Kt,ye,Wt,Vt,Le,xn,$e.data):N.isCompressedTexture?X.compressedTexSubImage2D(X.TEXTURE_2D,Ht,Kt,ye,$e.width,$e.height,Le,$e.data):X.texSubImage2D(X.TEXTURE_2D,Ht,Kt,ye,Wt,Vt,Le,xn,$e);X.pixelStorei(X.UNPACK_ROW_LENGTH,Xn),X.pixelStorei(X.UNPACK_IMAGE_HEIGHT,pe),X.pixelStorei(X.UNPACK_SKIP_PIXELS,Wn),X.pixelStorei(X.UNPACK_SKIP_ROWS,ri),X.pixelStorei(X.UNPACK_SKIP_IMAGES,Ni),Ht===0&&J.generateMipmaps&&X.generateMipmap(te),Pt.unbindTexture()},this.initRenderTarget=function(N){E.get(N).__webglFramebuffer===void 0&&V.setupRenderTarget(N)},this.initTexture=function(N){N.isCubeTexture?V.setTextureCube(N,0):N.isData3DTexture?V.setTexture3D(N,0):N.isDataArrayTexture||N.isCompressedArrayTexture?V.setTexture2DArray(N,0):V.setTexture2D(N,0),Pt.unbindTexture()},this.resetState=function(){H=0,q=0,nt=null,Pt.reset(),Ft.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return aa}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const i=this.getContext();i.drawingBufferColorSpace=Ue._getDrawingBufferColorSpace(t),i.unpackColorSpace=Ue._getUnpackColorSpace()}}const Yv={type:"change"},Jp={type:"start"},Wx={type:"end"},du=new Zp,jv=new xs,j2=Math.cos(70*wx.DEG2RAD),Sn=new Q,ii=2*Math.PI,qe={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Fd=1e-6;class Z2 extends $b{constructor(t,i=null){super(t,i),this.state=qe.NONE,this.target=new Q,this.cursor=new Q,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:ao.ROTATE,MIDDLE:ao.DOLLY,RIGHT:ao.PAN},this.touches={ONE:io.ROTATE,TWO:io.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._cursorStyle="auto",this._domElementKeyEvents=null,this._lastPosition=new Q,this._lastQuaternion=new Ts,this._lastTargetPosition=new Q,this._quat=new Ts().setFromUnitVectors(t.up,new Q(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Sv,this._sphericalDelta=new Sv,this._scale=1,this._panOffset=new Q,this._rotateStart=new _e,this._rotateEnd=new _e,this._rotateDelta=new _e,this._panStart=new _e,this._panEnd=new _e,this._panDelta=new _e,this._dollyStart=new _e,this._dollyEnd=new _e,this._dollyDelta=new _e,this._dollyDirection=new Q,this._mouse=new _e,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Q2.bind(this),this._onPointerDown=K2.bind(this),this._onPointerUp=J2.bind(this),this._onContextMenu=sR.bind(this),this._onMouseWheel=eR.bind(this),this._onKeyDown=nR.bind(this),this._onTouchStart=iR.bind(this),this._onTouchMove=aR.bind(this),this._onMouseDown=$2.bind(this),this._onMouseMove=tR.bind(this),this._interceptControlDown=rR.bind(this),this._interceptControlUp=oR.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}set cursorStyle(t){this._cursorStyle=t,t==="grab"?this.domElement.style.cursor="grab":this.domElement.style.cursor="auto"}get cursorStyle(){return this._cursorStyle}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Yv),this.update(),this.state=qe.NONE}pan(t,i){this._pan(t,i),this.update()}dollyIn(t){this._dollyIn(t),this.update()}dollyOut(t){this._dollyOut(t),this.update()}rotateLeft(t){this._rotateLeft(t),this.update()}rotateUp(t){this._rotateUp(t),this.update()}update(t=null){const i=this.object.position;Sn.copy(i).sub(this.target),Sn.applyQuaternion(this._quat),this._spherical.setFromVector3(Sn),this.autoRotate&&this.state===qe.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(s)&&isFinite(l)&&(s<-Math.PI?s+=ii:s>Math.PI&&(s-=ii),l<-Math.PI?l+=ii:l>Math.PI&&(l-=ii),s<=l?this._spherical.theta=Math.max(s,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+l)/2?Math.max(s,this._spherical.theta):Math.min(l,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let c=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const f=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),c=f!=this._spherical.radius}if(Sn.setFromSpherical(this._spherical),Sn.applyQuaternion(this._quatInverse),i.copy(this.target).add(Sn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let f=null;if(this.object.isPerspectiveCamera){const d=Sn.length();f=this._clampDistance(d*this._scale);const m=d-f;this.object.position.addScaledVector(this._dollyDirection,m),this.object.updateMatrixWorld(),c=!!m}else if(this.object.isOrthographicCamera){const d=new Q(this._mouse.x,this._mouse.y,0);d.unproject(this.object);const m=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),c=m!==this.object.zoom;const p=new Q(this._mouse.x,this._mouse.y,0);p.unproject(this.object),this.object.position.sub(p).add(d),this.object.updateMatrixWorld(),f=Sn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;f!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(f).add(this.object.position):(du.origin.copy(this.object.position),du.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(du.direction))<j2?this.object.lookAt(this.target):(jv.setFromNormalAndCoplanarPoint(this.object.up,this.target),du.intersectPlane(jv,this.target))))}else if(this.object.isOrthographicCamera){const f=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),f!==this.object.zoom&&(this.object.updateProjectionMatrix(),c=!0)}return this._scale=1,this._performCursorZoom=!1,c||this._lastPosition.distanceToSquared(this.object.position)>Fd||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Fd||this._lastTargetPosition.distanceToSquared(this.target)>Fd?(this.dispatchEvent(Yv),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?ii/60*this.autoRotateSpeed*t:ii/60/60*this.autoRotateSpeed}_getZoomScale(t){const i=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*i)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,i){Sn.setFromMatrixColumn(i,0),Sn.multiplyScalar(-t),this._panOffset.add(Sn)}_panUp(t,i){this.screenSpacePanning===!0?Sn.setFromMatrixColumn(i,1):(Sn.setFromMatrixColumn(i,0),Sn.crossVectors(this.object.up,Sn)),Sn.multiplyScalar(t),this._panOffset.add(Sn)}_pan(t,i){const s=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;Sn.copy(l).sub(this.target);let c=Sn.length();c*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*c/s.clientHeight,this.object.matrix),this._panUp(2*i*c/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,i){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),l=t-s.left,c=i-s.top,f=s.width,d=s.height;this._mouse.x=l/f*2-1,this._mouse.y=-(c/d)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(ii*this._rotateDelta.x/i.clientHeight),this._rotateUp(ii*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let i=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(ii*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),i=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-ii*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),i=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(ii*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),i=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-ii*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),i=!0;break}i&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._rotateStart.set(s,l)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panStart.set(s,l)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,c=Math.sqrt(s*s+l*l);this._dollyStart.set(0,c)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),l=.5*(t.pageX+s.x),c=.5*(t.pageY+s.y);this._rotateEnd.set(l,c)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(ii*this._rotateDelta.x/i.clientHeight),this._rotateUp(ii*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panEnd.set(s,l)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,c=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,c),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const f=(t.pageX+i.x)*.5,d=(t.pageY+i.y)*.5;this._updateZoomParameters(f,d)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId){this._pointers.splice(i,1);return}}_isTrackingPointer(t){for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId)return!0;return!1}_trackPointer(t){let i=this._pointerPositions[t.pointerId];i===void 0&&(i=new _e,this._pointerPositions[t.pointerId]=i),i.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const i=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[i]}_customWheelEvent(t){const i=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(i){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function K2(a){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(a.pointerId),this.domElement.ownerDocument.addEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(a)&&(this._addPointer(a),a.pointerType==="touch"?this._onTouchStart(a):this._onMouseDown(a),this._cursorStyle==="grab"&&(this.domElement.style.cursor="grabbing")))}function Q2(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function J2(a){switch(this._removePointer(a),this._pointers.length){case 0:this.domElement.releasePointerCapture(a.pointerId),this.domElement.ownerDocument.removeEventListener("pointermove",this._onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(Wx),this.state=qe.NONE,this._cursorStyle==="grab"&&(this.domElement.style.cursor="grab");break;case 1:const t=this._pointers[0],i=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:i.x,pageY:i.y});break}}function $2(a){let t;switch(a.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case ao.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(a),this.state=qe.DOLLY;break;case ao.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=qe.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=qe.ROTATE}break;case ao.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=qe.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=qe.PAN}break;default:this.state=qe.NONE}this.state!==qe.NONE&&this.dispatchEvent(Jp)}function tR(a){switch(this.state){case qe.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case qe.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case qe.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function eR(a){this.enabled===!1||this.enableZoom===!1||this.state!==qe.NONE||(a.preventDefault(),this.dispatchEvent(Jp),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(Wx))}function nR(a){this.enabled!==!1&&this._handleKeyDown(a)}function iR(a){switch(this._trackPointer(a),this._pointers.length){case 1:switch(this.touches.ONE){case io.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(a),this.state=qe.TOUCH_ROTATE;break;case io.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=qe.TOUCH_PAN;break;default:this.state=qe.NONE}break;case 2:switch(this.touches.TWO){case io.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=qe.TOUCH_DOLLY_PAN;break;case io.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=qe.TOUCH_DOLLY_ROTATE;break;default:this.state=qe.NONE}break;default:this.state=qe.NONE}this.state!==qe.NONE&&this.dispatchEvent(Jp)}function aR(a){switch(this._trackPointer(a),this.state){case qe.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case qe.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case qe.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case qe.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=qe.NONE}}function sR(a){this.enabled!==!1&&a.preventDefault()}function rR(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function oR(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const Zv=new As,pu=new Q;class qx extends Yb{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],s=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(s),this.setAttribute("position",new _n(t,3)),this.setAttribute("uv",new _n(i,2))}applyMatrix4(t){const i=this.attributes.instanceStart,s=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(t),s.applyMatrix4(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));const s=new Up(i,6,1);return this.setAttribute("instanceStart",new Ms(s,3,0)),this.setAttribute("instanceEnd",new Ms(s,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let i;t instanceof Float32Array?i=t:Array.isArray(t)&&(i=new Float32Array(t));const s=new Up(i,6,1);return this.setAttribute("instanceColorStart",new Ms(s,3,0)),this.setAttribute("instanceColorEnd",new Ms(s,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Pb(t.geometry)),this}fromLineSegments(t){const i=t.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new As);const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;t!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(t),Zv.setFromBufferAttribute(i),this.boundingBox.union(Zv))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new po),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(t!==void 0&&i!==void 0){const s=this.boundingSphere.center;this.boundingBox.getCenter(s);let l=0;for(let c=0,f=t.count;c<f;c++)pu.fromBufferAttribute(t,c),l=Math.max(l,s.distanceToSquared(pu)),pu.fromBufferAttribute(i,c),l=Math.max(l,s.distanceToSquared(pu));this.boundingSphere.radius=Math.sqrt(l),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}Gt.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new _e(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};ai.line={uniforms:Qp.merge([Gt.common,Gt.fog,Gt.line]),vertexShader:`
|
|
4058
4058
|
#include <common>
|
|
4059
4059
|
#include <color_pars_vertex>
|
|
4060
4060
|
#include <fog_pars_vertex>
|
|
@@ -4423,4 +4423,82 @@ void main() {
|
|
|
4423
4423
|
#include <premultiplied_alpha_fragment>
|
|
4424
4424
|
|
|
4425
4425
|
}
|
|
4426
|
-
`};class $p extends qi{constructor(t){super({type:"LineMaterial",uniforms:Qp.clone(ai.line.uniforms),vertexShader:ai.line.vertexShader,fragmentShader:ai.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0!==this.worldUnits&&(this.needsUpdate=!0),t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Id=new je,Kv=new Q,Qv=new Q,Ln=new je,Nn=new je,ta=new je,Bd=new Q,Hd=new nn,On=new Qb,Jv=new Q,mu=new As,gu=new po,ea=new je;let na,er;function $v(a,t,i){return ea.set(0,0,-t,1).applyMatrix4(a.projectionMatrix),ea.multiplyScalar(1/ea.w),ea.x=er/i.width,ea.y=er/i.height,ea.applyMatrix4(a.projectionMatrixInverse),ea.multiplyScalar(1/ea.w),Math.abs(Math.max(ea.x,ea.y))}function oR(a,t){const i=a.matrixWorld,s=a.geometry,l=s.attributes.instanceStart,c=s.attributes.instanceEnd,f=Math.min(s.instanceCount,l.count);for(let d=0,m=f;d<m;d++){On.start.fromBufferAttribute(l,d),On.end.fromBufferAttribute(c,d),On.applyMatrix4(i);const p=new Q,v=new Q;na.distanceSqToSegment(On.start,On.end,v,p),v.distanceTo(p)<er*.5&&t.push({point:v,pointOnLine:p,distance:na.origin.distanceTo(v),object:a,face:null,faceIndex:d,uv:null,uv1:null})}}function lR(a,t,i){const s=t.projectionMatrix,c=a.material.resolution,f=a.matrixWorld,d=a.geometry,m=d.attributes.instanceStart,p=d.attributes.instanceEnd,v=Math.min(d.instanceCount,m.count),_=-t.near;na.at(1,ta),ta.w=1,ta.applyMatrix4(t.matrixWorldInverse),ta.applyMatrix4(s),ta.multiplyScalar(1/ta.w),ta.x*=c.x/2,ta.y*=c.y/2,ta.z=0,Bd.copy(ta),Hd.multiplyMatrices(t.matrixWorldInverse,f);for(let g=0,M=v;g<M;g++){if(Ln.fromBufferAttribute(m,g),Nn.fromBufferAttribute(p,g),Ln.w=1,Nn.w=1,Ln.applyMatrix4(Hd),Nn.applyMatrix4(Hd),Ln.z>_&&Nn.z>_)continue;if(Ln.z>_){const D=Ln.z-Nn.z,C=(Ln.z-_)/D;Ln.lerp(Nn,C)}else if(Nn.z>_){const D=Nn.z-Ln.z,C=(Nn.z-_)/D;Nn.lerp(Ln,C)}Ln.applyMatrix4(s),Nn.applyMatrix4(s),Ln.multiplyScalar(1/Ln.w),Nn.multiplyScalar(1/Nn.w),Ln.x*=c.x/2,Ln.y*=c.y/2,Nn.x*=c.x/2,Nn.y*=c.y/2,On.start.copy(Ln),On.start.z=0,On.end.copy(Nn),On.end.z=0;const R=On.closestPointToPointParameter(Bd,!0);On.at(R,Jv);const x=Rx.lerp(Ln.z,Nn.z,R),y=x>=-1&&x<=1,w=Bd.distanceTo(Jv)<er*.5;if(y&&w){On.start.fromBufferAttribute(m,g),On.end.fromBufferAttribute(p,g),On.start.applyMatrix4(f),On.end.applyMatrix4(f);const D=new Q,C=new Q;na.distanceSqToSegment(On.start,On.end,C,D),i.push({point:C,pointOnLine:D,distance:na.origin.distanceTo(C),object:a,face:null,faceIndex:g,uv:null,uv1:null})}}}class cR extends Gn{constructor(t=new Wx,i=new $p({color:Math.random()*16777215})){super(t,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,i=t.attributes.instanceStart,s=t.attributes.instanceEnd,l=new Float32Array(2*i.count);for(let f=0,d=0,m=i.count;f<m;f++,d+=2)Kv.fromBufferAttribute(i,f),Qv.fromBufferAttribute(s,f),l[d]=d===0?0:l[d-1],l[d+1]=l[d]+Kv.distanceTo(Qv);const c=new Up(l,2,1);return t.setAttribute("instanceDistanceStart",new Ms(c,1,0)),t.setAttribute("instanceDistanceEnd",new Ms(c,1,1)),this}raycast(t,i){const s=this.material.worldUnits,l=t.camera;l===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const c=t.params.Line2!==void 0&&t.params.Line2.threshold||0;na=t.ray;const f=this.matrixWorld,d=this.geometry,m=this.material;er=m.linewidth+c,d.boundingSphere===null&&d.computeBoundingSphere(),gu.copy(d.boundingSphere).applyMatrix4(f);let p;if(s)p=er*.5;else{const _=Math.max(l.near,gu.distanceToPoint(na.origin));p=$v(l,_,m.resolution)}if(gu.radius+=p,na.intersectsSphere(gu)===!1)return;d.boundingBox===null&&d.computeBoundingBox(),mu.copy(d.boundingBox).applyMatrix4(f);let v;if(s)v=er*.5;else{const _=Math.max(l.near,mu.distanceToPoint(na.origin));v=$v(l,_,m.resolution)}mu.expandByScalar(v),na.intersectsBox(mu)!==!1&&(s?oR(this,i):lR(this,l,i))}onBeforeRender(t){const i=this.material.uniforms;i&&i.resolution&&(t.getViewport(Id),this.material.uniforms.resolution.value.set(Id.z,Id.w))}}class qx extends Wx{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const i=t.length-3,s=new Float32Array(2*i);for(let l=0;l<i;l+=3)s[2*l]=t[l],s[2*l+1]=t[l+1],s[2*l+2]=t[l+2],s[2*l+3]=t[l+3],s[2*l+4]=t[l+4],s[2*l+5]=t[l+5];return super.setPositions(s),this}setColors(t){const i=t.length-3,s=new Float32Array(2*i);for(let l=0;l<i;l+=3)s[2*l]=t[l],s[2*l+1]=t[l+1],s[2*l+2]=t[l+2],s[2*l+3]=t[l+3],s[2*l+4]=t[l+4],s[2*l+5]=t[l+5];return super.setColors(s),this}setFromPoints(t){const i=t.length-1,s=new Float32Array(6*i);for(let l=0;l<i;l++)s[6*l]=t[l].x,s[6*l+1]=t[l].y,s[6*l+2]=t[l].z||0,s[6*l+3]=t[l+1].x,s[6*l+4]=t[l+1].y,s[6*l+5]=t[l+1].z||0;return super.setPositions(s),this}fromLine(t){const i=t.geometry;return this.setPositions(i.attributes.position.array),this}}class uR extends cR{constructor(t=new qx,i=new $p({color:Math.random()*16777215})){super(t,i),this.isLine2=!0,this.type="Line2"}}const Gi=[[.2422,.1504,.6603],[.281,.3228,.9579],[.1786,.5289,.9682],[.0689,.6948,.8394],[.128,.789,.5927],[.3391,.849,.3798],[.633,.8518,.2091],[.8902,.8044,.1137],[.9905,.6816,.0235],[.9763,.517,.034]];function wu(a){const t=Number.isFinite(a)?a:0,s=Math.max(0,Math.min(1,t))*(Gi.length-1),l=Math.floor(s),c=Math.min(l+1,Gi.length-1),f=s-l;return[Gi[l][0]+f*(Gi[c][0]-Gi[l][0]),Gi[l][1]+f*(Gi[c][1]-Gi[l][1]),Gi[l][2]+f*(Gi[c][2]-Gi[l][2])]}const tx=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188],[.301,.745,.933],[.635,.078,.184]];function fR({surfTraces:a,plot3Traces:t=[],bar3Traces:i=[],bar3hTraces:s=[],quiver3Traces:l=[],shading:c,colorbar:f,colorbarLocation:d,colormap:m,axisVisible:p}){const v=Hn.useRef(null),_=Hn.useRef(null);Hn.useEffect(()=>{const R=v.current;if(!R)return;const x=new q2({antialias:!0});x.setPixelRatio(window.devicePixelRatio),x.setClearColor(16777215),R.appendChild(x.domElement);const y=new Mb,w=new Vu(-1,1,1,-1,.01,100);w.position.set(1.2,.8,1.2),w.lookAt(0,0,0);const D=new j2(w,x.domElement);D.enablePan=!1,D.enableZoom=!0,y.add(new Wb(16777215,.6));const C=new Xb(16777215,.6);C.position.set(2,3,2),y.add(C);const G=requestAnimationFrame(function F(){D.update(),x.render(y,w),_.current.animId=requestAnimationFrame(F)});_.current={renderer:x,scene:y,camera:w,controls:D,animId:G};const B=new ResizeObserver(()=>{const F=R.getBoundingClientRect();if(F.width===0||F.height===0)return;x.setSize(F.width,F.height);const T=F.width/F.height,U=1.2;w.left=-U*T,w.right=U*T,w.top=U,w.bottom=-U,w.updateProjectionMatrix()});return B.observe(R),()=>{B.disconnect(),cancelAnimationFrame(_.current?.animId??G),D.dispose(),x.dispose(),R.removeChild(x.domElement),_.current=null}},[]),Hn.useEffect(()=>{const R=_.current;if(!R)return;const{scene:x}=R,y=[];x.traverse(tt=>{(tt instanceof Gn||tt instanceof dl||tt instanceof Iu)&&y.push(tt)});for(const tt of y)x.remove(tt),tt.geometry&&tt.geometry.dispose();if(a.length===0&&t.length===0&&i.length===0&&s.length===0&&l.length===0)return;let w=1/0,D=-1/0,C=1/0,G=-1/0,B=1/0,F=-1/0;const T=(tt,ct,qt)=>{for(const Xt of tt)isFinite(Xt)&&(Xt<ct.v&&(ct.v=Xt),Xt>qt.v&&(qt.v=Xt))},U={v:w},et={v:D},H={v:C},q={v:G},nt={v:B},ot={v:F};for(const tt of a)T(tt.x,U,et),T(tt.y,H,q),T(tt.z,nt,ot);for(const tt of t)T(tt.x,U,et),T(tt.y,H,q),T(tt.z,nt,ot);for(const tt of i)T(tt.x,U,et),T(tt.y,H,q),T(tt.z,nt,ot),0<nt.v&&(nt.v=0);for(const tt of s)T(tt.y,H,q),T(tt.z,nt,ot),T(tt.x,U,et),0<U.v&&(U.v=0);for(const tt of l)T(tt.x,U,et),T(tt.y,H,q),T(tt.z,nt,ot),T(tt.x.map((ct,qt)=>ct+(tt.u[qt]??0)),U,et),T(tt.y.map((ct,qt)=>ct+(tt.v[qt]??0)),H,q),T(tt.z.map((ct,qt)=>ct+(tt.w[qt]??0)),nt,ot);if(w=U.v,D=et.v,C=H.v,G=q.v,B=nt.v,F=ot.v,!isFinite(w))return;D===w&&(w-=1,D+=1),G===C&&(C-=1,G+=1),F===B&&(B-=1,F+=1);const Y=D-w||1,z=G-C||1,A=F-B||1,ht=Math.max(Y,z,A),lt=(w+D)/2,Ct=(C+G)/2,I=(B+F)/2,K=a.length===0&&t.length===0&&(i.length>0||s.length>0),Mt=K?Math.max(Y,z):ht,wt=(tt,ct)=>(tt-ct)/Mt,Bt=(tt,ct)=>(tt-ct)/(K?Math.max(Mt,A):ht),st=(tt,ct)=>(tt-ct)/ht;let Et=1/0,gt=-1/0;for(const tt of a)for(const ct of tt.c??tt.z)isFinite(ct)&&(ct<Et&&(Et=ct),ct>gt&&(gt=ct));isFinite(Et)||(Et=B,gt=F);const Ut=gt-Et||1;for(const tt of a){const{rows:ct,cols:qt,x:Xt,y:oe,z:de}=tt,Yt=tt.faceAlpha??1,se=new Float32Array(ct*qt*3),X=new Float32Array(ct*qt*3);for(let V=0;V<qt;V++)for(let $=0;$<ct;$++){const k=V*ct+$,P=$*qt+V,it=st(Xt[k],lt),rt=st(oe[k],Ct),_t=st(de[k],I);se[P*3]=it,se[P*3+1]=_t,se[P*3+2]=rt;const xt=((tt.c?tt.c[k]:de[k])-Et)/Ut,[St,Nt,Lt]=wu(xt);X[P*3]=St,X[P*3+1]=Nt,X[P*3+2]=Lt}const ce=[];for(let V=0;V<ct-1;V++)for(let $=0;$<qt-1;$++){const k=V*qt+$,P=V*qt+($+1),it=(V+1)*qt+$,rt=(V+1)*qt+($+1);ce.push(k,it,P),ce.push(P,it,rt)}const Jt=new Mn;Jt.setAttribute("position",new xi(se,3)),Jt.setAttribute("color",new xi(X,3)),Jt.setIndex(ce),Jt.computeVertexNormals();const ne=c??"faceted",Pt=ne==="faceted"||ne==="flat";if(tt.faceColor!=="none"){let V;if(Array.isArray(tt.faceColor)){const[$,k,P]=tt.faceColor;V=new ou({color:new Ee($,k,P),flatShading:Pt,opacity:Yt,transparent:Yt<1,side:ki})}else V=new ou({vertexColors:!0,flatShading:Pt,opacity:Yt,transparent:Yt<1,side:ki});x.add(new Gn(Jt,V))}if(tt.edgeColor!=="none"&&ne==="faceted"){const V=[],$=[];for(let it=0;it<ct;it++)for(let rt=0;rt<qt;rt++){const _t=it*qt+rt;if(rt<qt-1){const At=it*qt+(rt+1);V.push(se[_t*3],se[_t*3+1],se[_t*3+2],se[At*3],se[At*3+1],se[At*3+2]),$.push(X[_t*3],X[_t*3+1],X[_t*3+2],X[At*3],X[At*3+1],X[At*3+2])}if(it<ct-1){const At=(it+1)*qt+rt;V.push(se[_t*3],se[_t*3+1],se[_t*3+2],se[At*3],se[At*3+1],se[At*3+2]),$.push(X[_t*3],X[_t*3+1],X[_t*3+2],X[At*3],X[At*3+1],X[At*3+2])}}const k=new Mn;k.setAttribute("position",new _n(V,3));let P;if(Array.isArray(tt.edgeColor)){const[it,rt,_t]=tt.edgeColor;P=new Ss({color:new Ee(it,rt,_t)})}else P=new Ss({color:0,opacity:.3,transparent:!0});x.add(new dl(k,P))}}for(let tt=0;tt<t.length;tt++){const ct=t[tt],{x:qt,y:Xt,z:oe}=ct,de=tx[tt%tx.length],Yt=ct.color??de,se=new Ee(Yt[0],Yt[1],Yt[2]);if(ct.lineStyle!=="none"){const ce=[];let Jt=[];for(let O=0;O<qt.length;O++)if(isFinite(qt[O])&&isFinite(Xt[O])&&isFinite(oe[O])){const b=st(qt[O],lt),V=st(Xt[O],Ct),$=st(oe[O],I);Jt.push(new Q(b,$,V))}else Jt.length>0&&(ce.push(Jt),Jt=[]);Jt.length>0&&ce.push(Jt);const ne=ct.lineWidth??2,Pt=ct.lineStyle==="--"||ct.lineStyle===":"||ct.lineStyle==="-.";for(const O of ce){if(O.length<2)continue;const b=[];for(const V of O)b.push(V.x,V.y,V.z);if(Pt){const V=new Gb({color:se,linewidth:ne,dashSize:ct.lineStyle===":"?.01:.03,gapSize:ct.lineStyle===":"?.02:.015}),$=new Mn().setFromPoints(O),k=new Iu($,V);k.computeLineDistances(),x.add(k)}else{const V=new qx;V.setPositions(b);const $=new $p({color:se.getHex(),linewidth:ne,worldUnits:!1,resolution:new _e(R.renderer.domElement.width||800,R.renderer.domElement.height||600)});x.add(new uR(V,$))}}}if(ct.marker&&ct.marker!=="none"){const ce=(ct.markerSize??6)/600,Jt=ct.markerEdgeColor?new Ee(ct.markerEdgeColor[0],ct.markerEdgeColor[1],ct.markerEdgeColor[2]):se,ne=ct.markerIndices?ct.markerIndices.map(b=>b-1):Array.from({length:qt.length},(b,V)=>V),Pt=new Bu(ce,8,8),O=new Pu({color:Jt});for(const b of ne){if(b<0||b>=qt.length||!isFinite(qt[b])||!isFinite(Xt[b])||!isFinite(oe[b]))continue;const V=st(qt[b],lt),$=st(Xt[b],Ct),k=st(oe[b],I),P=new Gn(Pt,O);P.position.set(V,k,$),x.add(P)}}}for(const tt of l){const{x:ct,y:qt,z:Xt,u:oe,v:de,w:Yt}=tt,se=tt.color??[0,.447,.741],X=new Ee(se[0],se[1],se[2]),ce=tt.lineWidth??.5,Jt=(O,b,V)=>new Q(st(O,lt),st(V,I),st(b,Ct)),ne=new Q(0,1,0),Pt=[];for(let O=0;O<ct.length;O++){if(!isFinite(ct[O])||!isFinite(qt[O])||!isFinite(Xt[O])||!isFinite(oe[O])||!isFinite(de[O])||!isFinite(Yt[O]))continue;const b=Jt(ct[O],qt[O],Xt[O]),V=Jt(ct[O]+oe[O],qt[O]+de[O],Xt[O]+Yt[O]);if(Pt.push(b.x,b.y,b.z,V.x,V.y,V.z),tt.showArrowHead){const $=new Q().subVectors(V,b),k=$.length();if(k>1e-9){$.multiplyScalar(1/k);let P=new Q().crossVectors($,ne);P.lengthSq()<1e-12&&(P=new Q().crossVectors($,new Q(1,0,0))),P.normalize();const it=Math.min(.3*k,k),rt=$.clone().multiplyScalar(-1),_t=Math.cos(20*Math.PI/180),At=Math.sin(20*Math.PI/180),xt=V.clone().addScaledVector(rt,it*_t).addScaledVector(P,it*At),St=V.clone().addScaledVector(rt,it*_t).addScaledVector(P,-it*At);Pt.push(V.x,V.y,V.z,xt.x,xt.y,xt.z),Pt.push(V.x,V.y,V.z,St.x,St.y,St.z)}}}if(Pt.length>0){const O=new Mn;O.setAttribute("position",new _n(Pt,3));const b=new Ss({color:X,linewidth:ce});x.add(new dl(O,b))}if(tt.marker&&tt.marker!=="none"){const b=new Bu(.01,8,8),V=new Pu({color:X});for(let $=0;$<ct.length;$++){if(!isFinite(ct[$])||!isFinite(qt[$])||!isFinite(Xt[$]))continue;const k=Jt(ct[$],qt[$],Xt[$]),P=new Gn(b,V);P.position.set(k.x,k.y,k.z),x.add(P)}}}for(const tt of i){const ct=tt.width/2*.9,qt=F-B||1;for(let Xt=0;Xt<tt.x.length;Xt++){const oe=tt.x[Xt],de=tt.y[Xt],Yt=tt.z[Xt];if(!isFinite(Yt))continue;const se=Math.abs(Bt(Yt,I)-Bt(0,I)),X=(Bt(Yt,I)+Bt(0,I))/2,ce=new ir(ct*2/Mt,se,ct*2/Mt),Jt=(Yt-B)/qt,[ne,Pt,O]=tt.color??wu(Jt),b=new ou({color:new Ee(ne,Pt,O)}),V=new Gn(ce,b);V.position.set(wt(oe,lt),X,wt(de,Ct)),x.add(V);const $=new mv(ce),k=new Ss({color:0,opacity:.3,transparent:!0}),P=new dl($,k);P.position.copy(V.position),x.add(P)}}for(const tt of s){const ct=tt.width/2*.9,qt=D-w||1;for(let Xt=0;Xt<tt.x.length;Xt++){const oe=tt.y[Xt],de=tt.x[Xt],Yt=tt.z[Xt];if(!isFinite(Yt))continue;const se=Math.abs(wt(Yt,lt)-wt(0,lt)),X=(wt(Yt,lt)+wt(0,lt))/2,ce=new ir(se,ct*2/Mt,ct*2/Mt),Jt=(Yt-w)/qt,[ne,Pt,O]=tt.color??wu(Jt),b=new ou({color:new Ee(ne,Pt,O)}),V=new Gn(ce,b);V.position.set(X,wt(de,I),wt(oe,Ct)),x.add(V);const $=new mv(ce),k=new Ss({color:0,opacity:.3,transparent:!0}),P=new dl($,k);P.position.copy(V.position),x.add(P)}}p!==!1&&dR(x,w,D,C,G,B,F,ht,lt,Ct,I)},[a,t,i,s,l,c,p]);let g=1/0,M=-1/0;for(const R of a){const x=R.c??R.z;for(const y of x)isFinite(y)&&(y<g&&(g=y),y>M&&(M=y))}if(!isFinite(g))for(const R of i)for(const x of R.z)isFinite(x)&&(x<g&&(g=x),x>M&&(M=x));const E=isFinite(g)&&isFinite(M);return g===M&&(g-=.5,M+=.5),Kt.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Kt.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),f&&E&&Kt.jsx(hR,{location:(d??"eastoutside").toLowerCase(),dMin:g,dMax:M,colormap:m})]})}function hR({location:a,dMin:t,dMax:i,colormap:s}){const c=[];for(let g=0;g<32;g++){const M=g/31,[E,R,x]=wu(M),y=`rgb(${Math.round(E*255)},${Math.round(R*255)},${Math.round(x*255)})`;c.push(`${y} ${(M*100).toFixed(2)}%`)}const d=a==="northoutside"||a==="southoutside"||a==="north"||a==="south"?`linear-gradient(to right, ${c.join(",")})`:`linear-gradient(to top, ${c.join(",")})`,m=g=>Number.isInteger(g)?String(g):g.toPrecision(3),p=16,v={position:"absolute",pointerEvents:"none",fontFamily:"sans-serif",fontSize:10,color:"#333"},_={background:d,border:"1px solid #999",boxSizing:"border-box"};switch(a){case"eastoutside":return Kt.jsxs("div",{style:{...v,top:12,bottom:12,right:8,width:50,display:"flex",alignItems:"stretch"},children:[Kt.jsx("div",{style:{..._,width:p,height:"100%"}}),Kt.jsxs("div",{style:{marginLeft:4,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[Kt.jsx("span",{children:m(i)}),Kt.jsx("span",{children:m(t)})]})]});case"westoutside":return Kt.jsxs("div",{style:{...v,top:12,bottom:12,left:8,width:50,display:"flex",alignItems:"stretch",flexDirection:"row-reverse"},children:[Kt.jsx("div",{style:{..._,width:p,height:"100%"}}),Kt.jsxs("div",{style:{marginRight:4,display:"flex",flexDirection:"column",justifyContent:"space-between",textAlign:"right"},children:[Kt.jsx("span",{children:m(i)}),Kt.jsx("span",{children:m(t)})]})]});case"northoutside":return Kt.jsxs("div",{style:{...v,left:12,right:12,top:8,height:32,display:"flex",flexDirection:"column"},children:[Kt.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:2},children:[Kt.jsx("span",{children:m(t)}),Kt.jsx("span",{children:m(i)})]}),Kt.jsx("div",{style:{..._,height:p,width:"100%"}})]});case"southoutside":return Kt.jsxs("div",{style:{...v,left:12,right:12,bottom:8,height:32,display:"flex",flexDirection:"column-reverse"},children:[Kt.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:2},children:[Kt.jsx("span",{children:m(t)}),Kt.jsx("span",{children:m(i)})]}),Kt.jsx("div",{style:{..._,height:p,width:"100%"}})]});case"east":return Kt.jsxs("div",{style:{...v,top:24,bottom:24,right:24,width:50,display:"flex",flexDirection:"row-reverse",alignItems:"stretch"},children:[Kt.jsx("div",{style:{..._,width:p,height:"100%"}}),Kt.jsxs("div",{style:{marginRight:4,display:"flex",flexDirection:"column",justifyContent:"space-between",textAlign:"right"},children:[Kt.jsx("span",{children:m(i)}),Kt.jsx("span",{children:m(t)})]})]});case"west":return Kt.jsxs("div",{style:{...v,top:24,bottom:24,left:24,width:50,display:"flex",alignItems:"stretch"},children:[Kt.jsx("div",{style:{..._,width:p,height:"100%"}}),Kt.jsxs("div",{style:{marginLeft:4,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[Kt.jsx("span",{children:m(i)}),Kt.jsx("span",{children:m(t)})]})]});case"north":return Kt.jsxs("div",{style:{...v,left:24,right:24,top:24,height:32,display:"flex",flexDirection:"column-reverse"},children:[Kt.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:2},children:[Kt.jsx("span",{children:m(t)}),Kt.jsx("span",{children:m(i)})]}),Kt.jsx("div",{style:{..._,height:p,width:"100%"}})]});case"south":return Kt.jsxs("div",{style:{...v,left:24,right:24,bottom:24,height:32,display:"flex",flexDirection:"column"},children:[Kt.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:2},children:[Kt.jsx("span",{children:m(t)}),Kt.jsx("span",{children:m(i)})]}),Kt.jsx("div",{style:{..._,height:p,width:"100%"}})]});default:return null}}function dR(a,t,i,s,l,c,f,d,m,p,v){const _=(E,R)=>(E-R)/d,g=[{from:[t,s,c],to:[i,s,c]},{from:[t,s,c],to:[t,l,c]},{from:[t,s,c],to:[t,s,f]}],M=new Ss({color:3355443});for(const E of g){const R=[E.from,E.to].map(([y,w,D])=>{const C=_(y,m),G=_(w,p),B=_(D,v);return new Q(C,B,G)}),x=new Mn().setFromPoints(R);a.add(new Iu(x,M))}}const ex=["#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F"];function Op(a){return`rgb(${Math.round(a[0]*255)}, ${Math.round(a[1]*255)}, ${Math.round(a[2]*255)})`}function Pp(a,t){return a.color?Op(a.color):ex[t%ex.length]}function Wu(a){switch(a){case"--":return[8,4];case":":return[2,4];case"-.":return[8,4,2,4];default:return[]}}function pR(a,t){const i=a/t,s=Math.pow(10,Math.floor(Math.log10(i))),l=i/s;let c;return l<=1.5?c=1:l<=3.5?c=2:l<=7.5?c=5:c=10,c*s}function _u(a,t,i){const s=pR(t-a,i),l=[],c=Math.ceil(a/s)*s;for(let f=c;f<=t+s*.001;f+=s)l.push(f);return l}function nx(a){return Math.abs(a)<1e-10?"0":Math.abs(a)>=1e4||Math.abs(a)<.01&&a!==0?a.toExponential(1):parseFloat(a.toPrecision(6)).toString()}function Yx(a,t,i,s,l){if(!t.marker||t.marker==="none")return;const c=(t.markerSize??6)/2,f=t.markerEdgeColor?Op(t.markerEdgeColor):l,d=t.markerFaceColor?Op(t.markerFaceColor):void 0,m=t.markerIndices?t.markerIndices.map(p=>p-1):Array.from({length:t.x.length},(p,v)=>v);a.lineWidth=1.5;for(const p of m){if(p<0||p>=t.x.length)continue;const v=t.x[p],_=t.y[p];if(!isFinite(v)||!isFinite(_))continue;const g=i(v),M=s(_);mR(a,t.marker,g,M,c,f,d)}}function mR(a,t,i,s,l,c,f){switch(a.strokeStyle=c,a.fillStyle=f??"transparent",t){case"o":{a.beginPath(),a.arc(i,s,l,0,Math.PI*2),f&&a.fill(),a.stroke();break}case"+":{a.beginPath(),a.moveTo(i-l,s),a.lineTo(i+l,s),a.moveTo(i,s-l),a.lineTo(i,s+l),a.stroke();break}case"*":{a.beginPath();for(let d=0;d<6;d++){const m=d*Math.PI/3;a.moveTo(i,s),a.lineTo(i+l*Math.cos(m),s+l*Math.sin(m))}a.stroke();break}case".":{a.beginPath(),a.arc(i,s,Math.max(l/3,1.5),0,Math.PI*2),a.fillStyle=c,a.fill();break}case"x":{const d=l*.707;a.beginPath(),a.moveTo(i-d,s-d),a.lineTo(i+d,s+d),a.moveTo(i+d,s-d),a.lineTo(i-d,s+d),a.stroke();break}case"_":{a.beginPath(),a.moveTo(i-l,s),a.lineTo(i+l,s),a.stroke();break}case"|":{a.beginPath(),a.moveTo(i,s-l),a.lineTo(i,s+l),a.stroke();break}case"s":{a.beginPath(),a.rect(i-l,s-l,l*2,l*2),f&&a.fill(),a.stroke();break}case"d":{a.beginPath(),a.moveTo(i,s-l),a.lineTo(i+l,s),a.lineTo(i,s+l),a.lineTo(i-l,s),a.closePath(),f&&a.fill(),a.stroke();break}case"^":{vu(a,i,s,l,0,f);break}case"v":{vu(a,i,s,l,Math.PI,f);break}case"<":{vu(a,i,s,l,-Math.PI/2,f);break}case">":{vu(a,i,s,l,Math.PI/2,f);break}case"p":{ix(a,i,s,l,5,f);break}case"h":{ix(a,i,s,l,6,f);break}}}function vu(a,t,i,s,l,c){a.beginPath();for(let f=0;f<3;f++){const d=l-Math.PI/2+f*2*Math.PI/3,m=t+s*Math.cos(d),p=i+s*Math.sin(d);f===0?a.moveTo(m,p):a.lineTo(m,p)}a.closePath(),c&&a.fill(),a.stroke()}function ix(a,t,i,s,l,c){const f=s*.4;a.beginPath();for(let d=0;d<l*2;d++){const m=-Math.PI/2+d*Math.PI/l,p=d%2===0?s:f,v=t+p*Math.cos(m),_=i+p*Math.sin(m);d===0?a.moveTo(v,_):a.lineTo(v,_)}a.closePath(),c&&a.fill(),a.stroke()}function gR(a,t,i,s,l){a.font="11px sans-serif";let v=0;for(const R of i){const x=a.measureText(R).width;x>v&&(v=x)}const _=34+v+8,g=8+i.length*17+8,M=s-_-8,E=l+8;a.fillStyle="rgba(255,255,255,0.9)",a.fillRect(M,E,_,g),a.strokeStyle="#999",a.lineWidth=.5,a.strokeRect(M,E,_,g);for(let R=0;R<i.length;R++){const x=R<t.length?Pp(t[R],R):"#333",y=R<t.length?t[R].lineWidth??2:2,w=R<t.length?t[R].lineStyle:void 0,D=E+8+R*17+17/2;a.strokeStyle=x,a.lineWidth=y,a.setLineDash(Wu(w)),a.beginPath(),a.moveTo(M+8,D),a.lineTo(M+8+20,D),a.stroke(),a.setLineDash([]),a.fillStyle="#333",a.font="11px sans-serif",a.textAlign="left",a.textBaseline="middle",a.fillText(i[R],M+8+20+6,D)}}function xu(a,t){const i=Math.max(a,Number.MIN_VALUE),s=Math.max(t,Number.MIN_VALUE),l=Math.floor(Math.log10(i)),c=Math.ceil(Math.log10(s)),f=[];for(let d=l;d<=c;d++){const m=Math.pow(10,d);m>=i&&m<=s&&f.push(m)}if(f.length<3){for(let d=l;d<=c;d++)for(const m of[2,5]){const p=m*Math.pow(10,d);p>=i&&p<=s&&!f.includes(p)&&f.push(p)}f.sort((d,m)=>d-m)}return f}function ax(a){return a>=1&&a<1e6&&Number.isInteger(a)?a.toString():a.toExponential(0)}function _R(a,t,i,s,l,c,f,d,m,p,v,_,g,M,E,R,x,y,w,D,C,G,B,F,T,U,et,H,q,nt,ot,Y,z){Cu=U;const A=a.getContext("2d"),ht=t.length>0||d!==void 0||C&&C.length>0||m&&m.length>0||g&&g.length>0||M&&M.length>0||E&&E.length>0||R&&R.length>0||x!==void 0||y!==void 0||w&&w.length>0||et&&et.length>0||z&&z.length>0;if(!A||!ht)return;const lt=window.devicePixelRatio||1,Ct=a.width,I=a.height;A.setTransform(lt,0,0,lt,0,0);const K=Ct/lt,Mt=I/lt;if(A.fillStyle="#fff",A.fillRect(0,0,K,Mt),x){AR(A,K,Mt,x,i);return}if(y){RR(A,K,Mt,y,i,p);return}const wt={top:i?40:20,right:20,bottom:s?56:40,left:l?76:60},Bt=(F??"eastoutside").toLowerCase();B&&(Bt==="eastoutside"?wt.right+=70:Bt==="westoutside"?wt.left+=70:Bt==="northoutside"?wt.top+=50:Bt==="southoutside"&&(wt.bottom+=50));const st=K-wt.left-wt.right,Et=Mt-wt.top-wt.bottom;if(st<=0||Et<=0)return;let gt=1/0,Ut=-1/0,tt=1/0,ct=-1/0;for(const k of t){for(const P of k.x)isFinite(P)&&(P<gt&&(gt=P),P>Ut&&(Ut=P));for(const P of k.y)isFinite(P)&&(P<tt&&(tt=P),P>ct&&(ct=P))}if(d&&(d.x[0]<gt&&(gt=d.x[0]),d.x[1]>Ut&&(Ut=d.x[1]),d.y[0]<tt&&(tt=d.y[0]),d.y[1]>ct&&(ct=d.y[1])),C)for(const k of C){for(const P of k.x)isFinite(P)&&(P<gt&&(gt=P),P>Ut&&(Ut=P));for(const P of k.y)isFinite(P)&&(P<tt&&(tt=P),P>ct&&(ct=P))}if(m)for(const k of m){for(const P of k.x)isFinite(P)&&(P<gt&&(gt=P),P>Ut&&(Ut=P));for(const P of k.y)isFinite(P)&&(P<tt&&(tt=P),P>ct&&(ct=P))}if(z)for(const k of z)for(const P of k.vertices)isFinite(P[0])&&(P[0]<gt&&(gt=P[0]),P[0]>Ut&&(Ut=P[0])),isFinite(P[1])&&(P[1]<tt&&(tt=P[1]),P[1]>ct&&(ct=P[1]));if(g)for(const k of g){const P=k.width/2;for(let it=0;it<k.x.length;it++){const rt=k.x[it];isFinite(rt)&&(rt-P<gt&&(gt=rt-P),rt+P>Ut&&(Ut=rt+P));const _t=k.y[it];isFinite(_t)&&(_t<tt&&(tt=_t),_t>ct&&(ct=_t))}0<tt&&(tt=0),0>ct&&(ct=0)}if(M)for(const k of M){const P=k.width/2;for(let it=0;it<k.x.length;it++){const rt=k.x[it];isFinite(rt)&&(rt-P<tt&&(tt=rt-P),rt+P>ct&&(ct=rt+P));const _t=k.y[it];isFinite(_t)&&(_t<gt&&(gt=_t),_t>Ut&&(Ut=_t))}0<gt&&(gt=0),0>Ut&&(Ut=0)}if(E)for(const k of E)for(let P=0;P<k.x.length;P++){const it=k.x[P],rt=k.y[P];if(isFinite(it)){const _t=k.xNeg?it-k.xNeg[P]:it,At=k.xPos?it+k.xPos[P]:it;_t<gt&&(gt=_t),At>Ut&&(Ut=At)}if(isFinite(rt)){const _t=rt-k.yNeg[P],At=rt+k.yPos[P];_t<tt&&(tt=_t),At>ct&&(ct=At)}}if(R)for(const k of R){const P=k.width/2;k.x-P<gt&&(gt=k.x-P),k.x+P>Ut&&(Ut=k.x+P),k.whiskerLow<tt&&(tt=k.whiskerLow),k.whiskerHigh>ct&&(ct=k.whiskerHigh);for(const it of k.outliers)it<tt&&(tt=it),it>ct&&(ct=it)}if(w&&w.length>0){const k=D??0;k<tt&&(tt=k),k>ct&&(ct=k);const P=w[0].x.length;for(let it=0;it<P;it++){let rt=k;for(const _t of w)if(it<_t.x.length){const At=_t.x[it];isFinite(At)&&(At<gt&&(gt=At),At>Ut&&(Ut=At)),rt+=_t.y[it]-k,isFinite(rt)&&(rt<tt&&(tt=rt),rt>ct&&(ct=rt))}}}if(et)for(const k of et)for(let P=0;P<k.x.length;P++){const it=k.x[P],rt=k.y[P],_t=it+k.u[P],At=rt+k.v[P];isFinite(it)&&(it<gt&&(gt=it),it>Ut&&(Ut=it)),isFinite(_t)&&(_t<gt&&(gt=_t),_t>Ut&&(Ut=_t)),isFinite(rt)&&(rt<tt&&(tt=rt),rt>ct&&(ct=rt)),isFinite(At)&&(At<tt&&(tt=At),At>ct&&(ct=At))}if(!isFinite(gt))return;Ut===gt&&(gt-=1,Ut+=1),ct===tt&&(tt-=1,ct+=1);const qt=v?.includes("image")??!1,Xt=(v?.includes("tight")??!1)||qt,oe=(v?.includes("equal")??!1)||qt,de=v?.includes("square")??!1,Yt=v?.includes("padded")??!1,se=ot!==!1,X=nt==="reverse",ce=_==="semilogx"||_==="loglog",Jt=_==="semilogy"||_==="loglog";if(ce&><=0&&(gt=Ut>0?Ut*1e-6:1),Jt&&tt<=0&&(tt=ct>0?ct*1e-6:1),!Xt){const k=Yt?.07:.05;if(ce){const P=(Math.log10(Ut)-Math.log10(gt))*k;gt=Math.pow(10,Math.log10(gt)-P),Ut=Math.pow(10,Math.log10(Ut)+P)}else{const P=(Ut-gt)*k;gt-=P,Ut+=P}if(Jt){const P=(Math.log10(ct)-Math.log10(tt))*k;tt=Math.pow(10,Math.log10(tt)-P),ct=Math.pow(10,Math.log10(ct)+P)}else{const P=(ct-tt)*k;tt-=P,ct+=P}}H&&(H[0]!=null&&(gt=H[0]),H[1]!=null&&(Ut=H[1])),q&&(q[0]!=null&&(tt=q[0]),q[1]!=null&&(ct=q[1])),Ut===gt&&(gt-=1,Ut+=1),ct===tt&&(tt-=1,ct+=1);let ne=st,Pt=Et,O=wt.left,b=wt.top;if(oe){const k=Ut-gt,P=ct-tt,it=k/st,rt=P/Et;if(Xt)it>rt?(Pt=P/it,b=wt.top+(Et-Pt)/2):(ne=k/rt,O=wt.left+(st-ne)/2);else if(it>rt){const _t=it*Et,At=(tt+ct)/2;tt=At-_t/2,ct=At+_t/2}else{const _t=rt*st,At=(gt+Ut)/2;gt=At-_t/2,Ut=At+_t/2}}else if(de){const k=Math.min(st,Et);O=wt.left+(st-k)/2,b=wt.top+(Et-k)/2,ne=k,Pt=k}const V=ce?k=>{const P=Math.log10(Math.max(k,Number.MIN_VALUE)),it=Math.log10(Math.max(gt,Number.MIN_VALUE)),rt=Math.log10(Math.max(Ut,Number.MIN_VALUE));return O+(P-it)/(rt-it)*ne}:k=>O+(k-gt)/(Ut-gt)*ne,$=Jt?k=>{const P=Math.log10(Math.max(k,Number.MIN_VALUE)),it=Math.log10(Math.max(tt,Number.MIN_VALUE)),rt=Math.log10(Math.max(ct,Number.MIN_VALUE)),_t=(P-it)/(rt-it);return X?b+_t*Pt:b+Pt-_t*Pt}:k=>{const P=(k-tt)/(ct-tt);return X?b+P*Pt:b+Pt-P*Pt};if(f!==!1&&se){A.strokeStyle="#ddd",A.lineWidth=.5;const k=ce?xu(gt,Ut):_u(gt,Ut,Math.max(3,Math.floor(ne/80))),P=Jt?xu(tt,ct):_u(tt,ct,Math.max(3,Math.floor(Pt/50)));for(const it of k){const rt=V(it);A.beginPath(),A.moveTo(rt,b),A.lineTo(rt,b+Pt),A.stroke()}for(const it of P){const rt=$(it);A.beginPath(),A.moveTo(O,rt),A.lineTo(O+ne,rt),A.stroke()}}if(se){A.strokeStyle="#333",A.lineWidth=1,Y===!1?(A.beginPath(),A.moveTo(O,b),A.lineTo(O,b+Pt),A.lineTo(O+ne,b+Pt),A.stroke()):A.strokeRect(O,b,ne,Pt);const k=ce?xu(gt,Ut):_u(gt,Ut,Math.max(3,Math.floor(ne/80))),P=Jt?xu(tt,ct):_u(tt,ct,Math.max(3,Math.floor(Pt/50)));A.fillStyle="#333",A.font="11px monospace",A.textAlign="center",A.textBaseline="top";for(const it of k)A.fillText(ce?ax(it):nx(it),V(it),b+Pt+5);A.textAlign="right",A.textBaseline="middle";for(const it of P)A.fillText(Jt?ax(it):nx(it),O-5,$(it))}if(A.fillStyle="#222",i&&(A.font="bold 13px sans-serif",A.textAlign="center",A.textBaseline="middle",A.fillText(i,O+ne/2,b/2)),s&&se&&(A.font="12px sans-serif",A.textAlign="center",A.textBaseline="bottom",A.fillText(s,O+ne/2,Mt-4)),l&&se&&(A.font="12px sans-serif",A.textAlign="center",A.textBaseline="middle",A.save(),A.translate(14,b+Pt/2),A.rotate(-Math.PI/2),A.fillText(l,0,0),A.restore()),A.save(),A.beginPath(),A.rect(O,b,ne,Pt),A.clip(),d&&bR(A,d,V,$,p),C)for(const k of C)CR(A,k,V,$,p,G,T);if(m)for(const k of m)ER(A,k,V,$,p);if(z)for(const k of z)wR(A,k,V,$,p,T);if(g){const k=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188]];for(let P=0;P<g.length;P++){const it=g[P],[rt,_t,At]=it.color??k[P%k.length];A.fillStyle=`rgb(${Math.round(rt*255)},${Math.round(_t*255)},${Math.round(At*255)})`,A.strokeStyle=`rgb(${Math.round(rt*180)},${Math.round(_t*180)},${Math.round(At*180)})`,A.lineWidth=1;const xt=$(0);for(let St=0;St<it.x.length;St++){const Nt=V(it.x[St]),Lt=$(it.y[St]),It=(V(it.x[St]+it.width)-V(it.x[St]))/2;A.fillRect(Nt-It,Math.min(Lt,xt),It*2,Math.abs(Lt-xt)),A.strokeRect(Nt-It,Math.min(Lt,xt),It*2,Math.abs(Lt-xt))}}}if(M){const k=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188]];for(let P=0;P<M.length;P++){const it=M[P],[rt,_t,At]=it.color??k[P%k.length];A.fillStyle=`rgb(${Math.round(rt*255)},${Math.round(_t*255)},${Math.round(At*255)})`,A.strokeStyle=`rgb(${Math.round(rt*180)},${Math.round(_t*180)},${Math.round(At*180)})`,A.lineWidth=1;const xt=V(0);for(let St=0;St<it.x.length;St++){const Nt=$(it.x[St]),Lt=V(it.y[St]),It=($(it.x[St]-it.width)-$(it.x[St]))/2;A.fillRect(Math.min(xt,Lt),Nt-It,Math.abs(Lt-xt),It*2),A.strokeRect(Math.min(xt,Lt),Nt-It,Math.abs(Lt-xt),It*2)}}}if(R){const k=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188]];for(let P=0;P<R.length;P++){const it=R[P],[rt,_t,At]=it.color??k[P%k.length],xt=`rgba(${Math.round(rt*255)},${Math.round(_t*255)},${Math.round(At*255)},0.3)`,St=`rgb(${Math.round(rt*255)},${Math.round(_t*255)},${Math.round(At*255)})`,Nt=V(it.x),Lt=Math.abs(V(it.x+it.width)-V(it.x))/2,It=$(it.q1),$t=$(it.q3),j=$(it.median),zt=$(it.whiskerLow),Ft=$(it.whiskerHigh);A.fillStyle=xt,A.fillRect(Nt-Lt,Math.min(It,$t),Lt*2,Math.abs($t-It)),A.strokeStyle=St,A.lineWidth=1.5,A.strokeRect(Nt-Lt,Math.min(It,$t),Lt*2,Math.abs($t-It)),A.lineWidth=2,A.beginPath(),A.moveTo(Nt-Lt,j),A.lineTo(Nt+Lt,j),A.stroke(),A.lineWidth=1,A.setLineDash([4,2]),A.beginPath(),A.moveTo(Nt,$t),A.lineTo(Nt,Ft),A.moveTo(Nt,It),A.lineTo(Nt,zt),A.stroke(),A.setLineDash([]);const kt=Lt*.5;A.beginPath(),A.moveTo(Nt-kt,Ft),A.lineTo(Nt+kt,Ft),A.moveTo(Nt-kt,zt),A.lineTo(Nt+kt,zt),A.stroke(),A.fillStyle=St;for(const Ot of it.outliers){const bt=$(Ot);A.beginPath(),A.arc(Nt,bt,3,0,Math.PI*2),A.fill()}}}if(w&&w.length>0){const k=D??0,P=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188],[.301,.745,.933],[.635,.078,.184]],it=w[0].x.length,rt=[],_t=[];let At=new Array(it).fill(k);for(let xt=0;xt<w.length;xt++){const St=w[xt];rt.push([...At]);const Nt=[];for(let Lt=0;Lt<it;Lt++)Nt.push(At[Lt]+(Lt<St.y.length?St.y[Lt]-k:0));_t.push(Nt),At=Nt}for(let xt=w.length-1;xt>=0;xt--){const St=w[xt],[Nt,Lt,It]=St.color??P[xt%P.length];A.fillStyle=`rgba(${Math.round(Nt*255)},${Math.round(Lt*255)},${Math.round(It*255)},0.6)`,A.beginPath();for(let $t=0;$t<it;$t++){const j=V(St.x[$t]),zt=$(_t[xt][$t]);$t===0?A.moveTo(j,zt):A.lineTo(j,zt)}for(let $t=it-1;$t>=0;$t--)A.lineTo(V(St.x[$t]),$(rt[xt][$t]));A.closePath(),A.fill(),A.strokeStyle=`rgb(${Math.round(Nt*255)},${Math.round(Lt*255)},${Math.round(It*255)})`,A.lineWidth=1,A.beginPath();for(let $t=0;$t<it;$t++){const j=V(St.x[$t]),zt=$(_t[xt][$t]);$t===0?A.moveTo(j,zt):A.lineTo(j,zt)}A.stroke()}}if(E)for(let k=0;k<E.length;k++){const P=E[k],it=P.color?`rgb(${Math.round(P.color[0]*255)},${Math.round(P.color[1]*255)},${Math.round(P.color[2]*255)})`:Pp({},k);A.strokeStyle=it,A.fillStyle=it,A.lineWidth=(P.lineWidth??1)*lt;const rt=3*lt;A.beginPath();for(let _t=0;_t<P.x.length;_t++){const At=V(P.x[_t]),xt=$(P.y[_t]);_t===0?A.moveTo(At,xt):A.lineTo(At,xt)}A.stroke();for(let _t=0;_t<P.x.length;_t++){const At=V(P.x[_t]),xt=$(P.y[_t]),St=$(P.y[_t]-P.yNeg[_t]),Nt=$(P.y[_t]+P.yPos[_t]);if(A.beginPath(),A.moveTo(At,St),A.lineTo(At,Nt),A.stroke(),A.beginPath(),A.moveTo(At-rt,St),A.lineTo(At+rt,St),A.stroke(),A.beginPath(),A.moveTo(At-rt,Nt),A.lineTo(At+rt,Nt),A.stroke(),P.xNeg&&P.xPos){const Lt=V(P.x[_t]-P.xNeg[_t]),It=V(P.x[_t]+P.xPos[_t]);A.beginPath(),A.moveTo(Lt,xt),A.lineTo(It,xt),A.stroke(),A.beginPath(),A.moveTo(Lt,xt-rt),A.lineTo(Lt,xt+rt),A.stroke(),A.beginPath(),A.moveTo(It,xt-rt),A.lineTo(It,xt+rt),A.stroke()}A.beginPath(),A.arc(At,xt,2*lt,0,2*Math.PI),A.fill()}}et&&xR(A,et,V,$,lt);for(let k=0;k<t.length;k++){const P=t[k],it=Pp(P,k);if(P.lineStyle!=="none"){A.strokeStyle=it,A.lineWidth=P.lineWidth??2,A.lineJoin="round",A.setLineDash(Wu(P.lineStyle)),A.beginPath();let rt=!1;for(let _t=0;_t<P.x.length;_t++){const At=P.x[_t],xt=P.y[_t];if(!isFinite(At)||!isFinite(xt)){rt=!1;continue}const St=V(At),Nt=$(xt);rt?A.lineTo(St,Nt):(A.moveTo(St,Nt),rt=!0)}A.stroke(),A.setLineDash([])}P.marker&&Yx(A,P,V,$,it)}if(A.restore(),c&&c.length>0&&gR(A,t,c,O+ne,b),B){const k=T??DR(C,d,m,z);k&&UR(A,Bt,O,b,ne,Pt,k[0],k[1],p)}}const sx=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188]];function vR(a){return`rgb(${Math.round(a[0]*255)},${Math.round(a[1]*255)},${Math.round(a[2]*255)})`}function xR(a,t,i,s,l){for(let c=0;c<t.length;c++){const f=t[c],d=f.color??sx[c%sx.length],m=vR(d),p=(f.lineWidth??.5)*l*2;a.strokeStyle=m,a.fillStyle=m,a.lineWidth=p,a.lineJoin="round",a.lineCap="round",a.setLineDash(Wu(f.lineStyle));const v=f.x.length;for(let _=0;_<v;_++){const g=f.x[_],M=f.y[_],E=f.u[_],R=f.v[_];if(!isFinite(g)||!isFinite(M)||!isFinite(E)||!isFinite(R))continue;const x=g+E,y=M+R,w=i(g),D=s(M),C=i(x),G=s(y);if(a.beginPath(),a.moveTo(w,D),a.lineTo(C,G),a.stroke(),f.showArrowHead){const B=C-w,F=G-D,T=Math.sqrt(B*B+F*F);if(T>1){const U=Math.min(T*.3,12*l),et=Math.PI/9,H=Math.atan2(F,B),q=C-U*Math.cos(H-et),nt=G-U*Math.sin(H-et),ot=C-U*Math.cos(H+et),Y=G-U*Math.sin(H+et);a.beginPath(),a.moveTo(q,nt),a.lineTo(C,G),a.lineTo(ot,Y),a.stroke()}}if(f.marker){const B=3*l;a.beginPath(),a.arc(w,D,B,0,Math.PI*2),f.markerFilled?a.fill():a.stroke()}}a.setLineDash([])}}let Cu;function Ha(a,t){const i=Math.max(0,Math.min(1,a));if(Cu&&Cu.length>0){const s=Cu,l=s.length;if(l===1)return s[0];const c=i*(l-1),f=Math.floor(c),d=Math.min(f+1,l-1),m=c-f;return[s[f][0]+m*(s[d][0]-s[f][0]),s[f][1]+m*(s[d][1]-s[f][1]),s[f][2]+m*(s[d][2]-s[f][2])]}return t==="jet"?SR(i):t==="redblue"?MR(i):yR(i)}function yR(a){if(a<.5){const i=a*2;return[.2*(1-i),.1+.6*i,.9-.3*i]}const t=(a-.5)*2;return[.2+.8*t,.7+.3*t,.6-.5*t]}function SR(a){let t,i,s;return a<.125?(t=0,i=0,s=.5+a*4):a<.375?(t=0,i=(a-.125)*4,s=1):a<.625?(t=(a-.375)*4,i=1,s=1-(a-.375)*4):a<.875?(t=1,i=1-(a-.625)*4,s=0):(t=1-(a-.875)*4,i=0,s=0),[Math.max(0,Math.min(1,t)),Math.max(0,Math.min(1,i)),Math.max(0,Math.min(1,s))]}function MR(a){if(a<.5){const i=a*2;return[i,i,1]}const t=(a-.5)*2;return[1,1-t,1-t]}function bR(a,t,i,s,l){const{rows:c,cols:f,z:d,x:m,y:p}=t;if(c===0||f===0)return;let v=1/0,_=-1/0;for(const R of d)isFinite(R)&&(R<v&&(v=R),R>_&&(_=R));if(!isFinite(v))return;const g=_-v||1,M=(m[1]-m[0])/f,E=(p[1]-p[0])/c;for(let R=0;R<f;R++)for(let x=0;x<c;x++){const w=(d[R*c+x]-v)/g,[D,C,G]=Ha(w,l),B=i(m[0]+R*M),F=s(p[0]+(x+1)*E),T=i(m[0]+(R+1)*M),U=s(p[0]+x*E);a.fillStyle=`rgb(${Math.round(D*255)},${Math.round(C*255)},${Math.round(G*255)})`,a.fillRect(B,F,T-B,U-F)}}function ER(a,t,i,s,l){const{rows:c,cols:f,z:d,x:m,y:p,nLevels:v,filled:_}=t;if(c<2||f<2)return;let g=1/0,M=-1/0;for(const D of d)isFinite(D)&&(D<g&&(g=D),D>M&&(M=D));if(!isFinite(g))return;const E=M-g||1;let R;if(t.levels&&t.levels.length>0)R=[g-E,...t.levels,M+E];else{R=[];for(let D=0;D<=v;D++)R.push(g+D/v*E)}const x=(D,C)=>d[C*c+D],y=(D,C)=>m[C*c+D],w=(D,C)=>p[C*c+D];if(_)for(let D=0;D<f-1;D++)for(let C=0;C<c-1;C++){const B=((x(C,D)+x(C+1,D)+x(C,D+1)+x(C+1,D+1))/4-g)/E,[F,T,U]=Ha(B,l),et=i(y(C,D)),H=s(w(C,D)),q=i(y(C+1,D+1)),nt=s(w(C+1,D+1));a.fillStyle=`rgb(${Math.round(F*255)},${Math.round(T*255)},${Math.round(U*255)})`,a.fillRect(Math.min(et,q),Math.min(H,nt),Math.abs(q-et)||1,Math.abs(nt-H)||1)}else for(let D=1;D<R.length-1;D++){const C=R[D],G=(C-g)/E,[B,F,T]=Ha(G,l);a.strokeStyle=`rgb(${Math.round(B*255)},${Math.round(F*255)},${Math.round(T*255)})`,a.lineWidth=t.lineWidth??1;for(let U=0;U<f-1;U++)for(let et=0;et<c-1;et++){const H=x(et,U),q=x(et+1,U),nt=x(et,U+1),ot=x(et+1,U+1),Y=y(et,U),z=w(et,U),A=y(et+1,U),ht=w(et+1,U),lt=y(et,U+1),Ct=w(et,U+1),I=y(et+1,U+1),K=w(et+1,U+1),Mt=TR(H,q,nt,ot,Y,z,A,ht,lt,Ct,I,K,C);for(const wt of Mt)a.beginPath(),a.moveTo(i(wt[0]),s(wt[1])),a.lineTo(i(wt[2]),s(wt[3])),a.stroke()}}}function TR(a,t,i,s,l,c,f,d,m,p,v,_,g){const M=a>=g?1:0,E=t>=g?1:0,R=i>=g?1:0,x=s>=g?1:0,y=M|E<<1|R<<2|x<<3;if(y===0||y===15)return[];const w=(q,nt,ot,Y)=>{const z=(g-ot)/(Y-ot||1);return q+z*(nt-q)},D=w(l,f,a,t),C=w(c,d,a,t),G=w(f,v,t,s),B=w(d,_,t,s),F=w(m,v,i,s),T=w(p,_,i,s),U=w(l,m,a,i),et=w(c,p,a,i),H=[];switch(y){case 1:case 14:H.push([D,C,U,et]);break;case 2:case 13:H.push([D,C,G,B]);break;case 3:case 12:H.push([U,et,G,B]);break;case 4:case 11:H.push([U,et,F,T]);break;case 5:case 10:H.push([D,C,F,T]);break;case 6:case 9:H.push([D,C,U,et]),H.push([F,T,G,B]);break;case 7:case 8:H.push([F,T,G,B]);break}return H}const rx=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188],[.301,.745,.933],[.635,.078,.184]];function AR(a,t,i,s,l){const c=s.values.reduce((M,E)=>M+E,0);if(c<=0)return;const f=l?36:0,d=60,m=t/2,p=f+(i-f)/2,v=Math.min(t/2-d,(i-f)/2-d);if(v<=0)return;const _=v*s.innerRadius;l&&(a.font="bold 14px sans-serif",a.fillStyle="#000",a.textAlign="center",a.textBaseline="top",a.fillText(l,m,10));let g=-Math.PI/2;for(let M=0;M<s.values.length;M++){const E=s.values[M]/c*2*Math.PI,R=g+E,[x,y,w]=s.colors?.[M]??rx[M%rx.length];a.beginPath(),_>0?(a.arc(m,p,v,g,R),a.arc(m,p,_,R,g,!0)):(a.moveTo(m,p),a.arc(m,p,v,g,R),a.closePath()),a.fillStyle=`rgb(${Math.round(x*255)},${Math.round(y*255)},${Math.round(w*255)})`,a.fill(),a.strokeStyle="#fff",a.lineWidth=2,a.stroke();const D=g+E/2,C=(s.values[M]/c*100).toFixed(1)+"%",G=v+16,B=m+G*Math.cos(D),F=p+G*Math.sin(D);a.font="12px sans-serif",a.fillStyle="#333",a.textAlign=D>Math.PI/2||D<-Math.PI/2?"right":"left",a.textBaseline="middle";const T=s.names?.[M]?`${s.names[M]} (${C})`:C;a.fillText(T,B,F),g=R}}function RR(a,t,i,s,l,c){const{data:f,rows:d,cols:m}=s;if(d===0||m===0)return;let p=1/0,v=-1/0;for(const Y of f)isFinite(Y)&&(Y<p&&(p=Y),Y>v&&(v=Y));if(!isFinite(p))return;const _=v-p||1;a.font="12px sans-serif";const g=s.yLabels??Array.from({length:d},(Y,z)=>String(z+1)),M=s.xLabels??Array.from({length:m},(Y,z)=>String(z+1));let E=0;for(const Y of g){const z=a.measureText(Y).width;z>E&&(E=z)}const R=l?30:10,x=24,y=E+12,w=50,D=y,C=R,G=t-D-w,B=i-C-x;if(G<=0||B<=0)return;const F=G/m,T=B/d;l&&(a.font="bold 14px sans-serif",a.fillStyle="#000",a.textAlign="center",a.textBaseline="top",a.fillText(l,t/2,8));const U=Math.max(8,Math.min(14,Math.min(F,T)*.35));a.font=`${U}px sans-serif`,a.textAlign="center",a.textBaseline="middle";for(let Y=0;Y<m;Y++)for(let z=0;z<d;z++){const A=f[Y*d+z],ht=D+Y*F,lt=C+z*T,Ct=isFinite(A)?(A-p)/_:0,[I,K,Mt]=Ha(Ct,c);if(a.fillStyle=`rgb(${Math.round(I*255)},${Math.round(K*255)},${Math.round(Mt*255)})`,a.fillRect(ht,lt,F,T),a.strokeStyle="#fff",a.lineWidth=1,a.strokeRect(ht,lt,F,T),isFinite(A)&&F>16&&T>12){const wt=I*.299+K*.587+Mt*.114;a.fillStyle=wt>.5?"#000":"#fff";const Bt=Number.isInteger(A)?String(A):A.toFixed(2);a.fillText(Bt,ht+F/2,lt+T/2)}}a.font="11px sans-serif",a.fillStyle="#333",a.textAlign="center",a.textBaseline="top";for(let Y=0;Y<m;Y++)a.fillText(M[Y]??"",D+Y*F+F/2,C+B+4);a.textAlign="right",a.textBaseline="middle";for(let Y=0;Y<d;Y++)a.fillText(g[Y]??"",D-6,C+Y*T+T/2);const et=D+G+10,H=16,q=C,nt=B,ot=Math.max(1,Math.round(nt));for(let Y=0;Y<ot;Y++){const z=1-Y/ot,[A,ht,lt]=Ha(z,c);a.fillStyle=`rgb(${Math.round(A*255)},${Math.round(ht*255)},${Math.round(lt*255)})`,a.fillRect(et,q+Y/ot*nt,H,nt/ot+1)}a.strokeStyle="#999",a.lineWidth=1,a.strokeRect(et,q,H,nt),a.font="10px sans-serif",a.fillStyle="#333",a.textAlign="left",a.textBaseline="top",a.fillText(sa(v),et+H+4,q),a.textBaseline="bottom",a.fillText(sa(p),et+H+4,q+nt)}function sa(a){return Number.isInteger(a)?String(a):a.toPrecision(3)}function wR(a,t,i,s,l,c){const{vertices:f,faces:d}=t;if(!d||d.length===0||f.length===0)return;const m=t.faceVertexCData;let p=1/0,v=-1/0;if(c)[p,v]=c;else if(m)for(const C of m)typeof C=="number"&&isFinite(C)&&(C<p&&(p=C),C>v&&(v=C));const _=isFinite(p)&&v>p?v-p:1,g=C=>{if(Array.isArray(C))return C;if(typeof C!="number")return[0,0,0];const G=isFinite(p)?(C-p)/_:.5;return Ha(G,l)},M=C=>m?g(m[Math.min(Math.max(C,0),m.length-1)]):void 0,E=C=>`rgb(${Math.round(C[0]*255)},${Math.round(C[1]*255)},${Math.round(C[2]*255)})`,R=t.faceColor??"none",x=t.edgeColor??[0,0,0],y=t.faceAlpha??1,w=t.lineWidth??.5,D=t.lineStyle??"-";a.save();for(let C=0;C<d.length;C++){const G=d[C];if(G.length===0)continue;const B=G.map(U=>f[U]).filter(Boolean),F=B.every(U=>isFinite(U[0])&&isFinite(U[1]));let T=null;if(R==="none")T=null;else if(Array.isArray(R))T=R;else if(R==="flat"){const U=m&&m.length===d.length?C:G[0];T=M(U)??[0,0,0]}else if(R==="interp"){let U=0,et=0,H=0,q=0;for(const nt of G){const ot=M(nt);ot&&(U+=ot[0],et+=ot[1],H+=ot[2],q++)}T=q?[U/q,et/q,H/q]:[0,0,0]}if(T&&F&&(a.globalAlpha=y,a.fillStyle=E(T),a.beginPath(),B.forEach((U,et)=>{const H=i(U[0]),q=s(U[1]);et===0?a.moveTo(H,q):a.lineTo(H,q)}),a.closePath(),a.fill(),a.globalAlpha=1),x!=="none"&&D!=="none"){if(a.lineWidth=w,a.setLineDash(Wu(D)),Array.isArray(x)){a.strokeStyle=E(x),a.beginPath();let U=!1;for(const et of G){const H=f[et];if(!H||!isFinite(H[0])||!isFinite(H[1])){U=!1;continue}const q=i(H[0]),nt=s(H[1]);U?a.lineTo(q,nt):(a.moveTo(q,nt),U=!0)}F&&a.closePath(),a.stroke()}else{const U=F?G.length:G.length-1;for(let et=0;et<U;et++){const H=f[G[et]],q=f[G[(et+1)%G.length]];if(!H||!q||!isFinite(H[0])||!isFinite(H[1])||!isFinite(q[0])||!isFinite(q[1]))continue;const nt=M(G[et])??[0,0,0],ot=i(H[0]),Y=s(H[1]),z=i(q[0]),A=s(q[1]);if(x==="interp"){const ht=M(G[(et+1)%G.length])??nt,lt=a.createLinearGradient(ot,Y,z,A);lt.addColorStop(0,E(nt)),lt.addColorStop(1,E(ht)),a.strokeStyle=lt}else a.strokeStyle=E(nt);a.beginPath(),a.moveTo(ot,Y),a.lineTo(z,A),a.stroke()}}a.setLineDash([])}if(t.marker&&t.marker!=="none"){const U=t.markerFaceColor==="flat"?T??void 0:Array.isArray(t.markerFaceColor)?t.markerFaceColor:void 0,et={x:B.map(q=>q[0]),y:B.map(q=>q[1]),marker:t.marker,...U?{markerFaceColor:U}:{}},H=Array.isArray(x)?E(x):"rgb(0,0,0)";Yx(a,et,i,s,H)}}a.restore()}function CR(a,t,i,s,l,c,f){const d=c??"faceted";if(d==="interp"){ox(a,t,i,s,l,!1,f);return}ox(a,t,i,s,l,d==="faceted",f)}function ox(a,t,i,s,l,c,f){const{rows:d,cols:m,x:p,y:v,c:_}=t;if(d<2||m<2)return;let g,M;if(f)[g,M]=f;else{g=1/0,M=-1/0;for(const x of _)isFinite(x)&&(x<g&&(g=x),x>M&&(M=x))}if(!isFinite(g))return;const E=M-g||1,R=t.faceAlpha??1;a.save(),R<1&&(a.globalAlpha=R);for(let x=0;x<m-1;x++)for(let y=0;y<d-1;y++){const w=x*d+y,D=x*d+(y+1),C=(x+1)*d+y,G=(x+1)*d+(y+1),B=_[w];if(!isFinite(B))continue;const F=(B-g)/E,[T,U,et]=Ha(F,l),H=`rgb(${Math.round(T*255)},${Math.round(U*255)},${Math.round(et*255)})`,q=i(p[w]),nt=s(v[w]),ot=i(p[D]),Y=s(v[D]),z=i(p[G]),A=s(v[G]),ht=i(p[C]),lt=s(v[C]);if(a.beginPath(),a.moveTo(q,nt),a.lineTo(ot,Y),a.lineTo(z,A),a.lineTo(ht,lt),a.closePath(),a.fillStyle=H,a.fill(),c&&t.edgeColor!=="none"){if(Array.isArray(t.edgeColor)){const[Ct,I,K]=t.edgeColor;a.strokeStyle=`rgb(${Math.round(Ct*255)},${Math.round(I*255)},${Math.round(K*255)})`}else a.strokeStyle="rgba(0,0,0,0.3)";a.lineWidth=.5,a.stroke()}else t.edgeColor==="none"&&(a.strokeStyle=H,a.lineWidth=1,a.stroke())}a.restore()}function DR(a,t,i,s){let l=1/0,c=-1/0;const f=d=>{for(const m of d)isFinite(m)&&(m<l&&(l=m),m>c&&(c=m))};if(a)for(const d of a)f(d.c);if(t&&f(t.z),i)for(const d of i)f(d.z);if(s){for(const d of s)if(d.faceVertexCData)for(const m of d.faceVertexCData)typeof m=="number"&&f([m])}return!isFinite(l)||!isFinite(c)?null:(l===c&&(l-=.5,c+=.5),[l,c])}function UR(a,t,i,s,l,c,f,d,m){switch(t){case"eastoutside":{const g=i+l+10;yu(a,g,s,16,c,f,d,m,"right");break}case"westoutside":{const g=i-10-16;yu(a,g,s,16,c,f,d,m,"left");break}case"northoutside":{const g=s-10-16;Su(a,i,g,l,16,f,d,m,"top");break}case"southoutside":{const g=s+c+10;Su(a,i,g,l,16,f,d,m,"bottom");break}case"east":{const g=i+l-8-16;yu(a,g,s+8,16,c-16,f,d,m,"left");break}case"west":{const g=i+8;yu(a,g,s+8,16,c-16,f,d,m,"right");break}case"north":{const g=s+8;Su(a,i+8,g,l-16,16,f,d,m,"bottom");break}case"south":{const g=s+c-8-16;Su(a,i+8,g,l-16,16,f,d,m,"top");break}}}function yu(a,t,i,s,l,c,f,d,m){const p=Math.max(1,Math.round(l));for(let v=0;v<p;v++){const _=1-v/p,[g,M,E]=Ha(_,d);a.fillStyle=`rgb(${Math.round(g*255)},${Math.round(M*255)},${Math.round(E*255)})`,a.fillRect(t,i+v/p*l,s,l/p+1)}a.strokeStyle="#999",a.lineWidth=1,a.strokeRect(t,i,s,l),a.font="10px sans-serif",a.fillStyle="#333",m==="right"?(a.textAlign="left",a.textBaseline="top",a.fillText(sa(f),t+s+4,i),a.textBaseline="bottom",a.fillText(sa(c),t+s+4,i+l)):(a.textAlign="right",a.textBaseline="top",a.fillText(sa(f),t-4,i),a.textBaseline="bottom",a.fillText(sa(c),t-4,i+l))}function Su(a,t,i,s,l,c,f,d,m){const p=Math.max(1,Math.round(s));for(let v=0;v<p;v++){const _=v/p,[g,M,E]=Ha(_,d);a.fillStyle=`rgb(${Math.round(g*255)},${Math.round(M*255)},${Math.round(E*255)})`,a.fillRect(t+v/p*s,i,s/p+1,l)}a.strokeStyle="#999",a.lineWidth=1,a.strokeRect(t,i,s,l),a.font="10px sans-serif",a.fillStyle="#333",m==="bottom"?(a.textBaseline="top",a.textAlign="left",a.fillText(sa(c),t,i+l+4),a.textAlign="right",a.fillText(sa(f),t+s,i+l+4)):(a.textBaseline="bottom",a.textAlign="left",a.fillText(sa(c),t,i-4),a.textAlign="right",a.fillText(sa(f),t+s,i-4))}class lx extends Hn.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,i){console.error("Axes render error:",t,i)}render(){return this.state.error?Kt.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:8,color:"#a00",fontFamily:"sans-serif",fontSize:12,textAlign:"center",boxSizing:"border-box"},children:["Plot render error: ",this.state.error.message]}):this.props.children}}function LR({figure:a}){const{subplotGrid:t,sgtitle:i,axes:s}=a,l=Object.keys(s).map(Number).sort((d,m)=>d-m);if(l.length===0)return null;if(!t){const d=s[l[0]];return d?Kt.jsx(lx,{children:Kt.jsx(cx,{axes:d})}):null}const{rows:c,cols:f}=t;return Kt.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[i&&Kt.jsx("div",{style:{textAlign:"center",fontWeight:"bold",fontSize:16,fontFamily:"sans-serif",padding:"8px 0 4px 0",flexShrink:0},children:i}),Kt.jsx("div",{style:{flex:1,display:"grid",gridTemplateRows:`repeat(${c}, 1fr)`,gridTemplateColumns:`repeat(${f}, 1fr)`,gap:4,padding:4,minHeight:0},children:Array.from({length:c*f},(d,m)=>{const p=m+1,v=s[p],_=Math.floor(m/f),g=m%f;return Kt.jsx("div",{style:{gridRow:_+1,gridColumn:g+1,minWidth:0,minHeight:0,overflow:"hidden"},children:v?Kt.jsx(lx,{children:Kt.jsx(cx,{axes:v})}):null},p)})})]})}function cx({axes:a}){return a.surfTraces&&a.surfTraces.length>0||a.plot3Traces&&a.plot3Traces.length>0||a.bar3Traces&&a.bar3Traces.length>0||a.bar3hTraces&&a.bar3hTraces.length>0||a.quiver3Traces&&a.quiver3Traces.length>0?Kt.jsx(fR,{surfTraces:a.surfTraces??[],plot3Traces:a.plot3Traces??[],bar3Traces:a.bar3Traces??[],bar3hTraces:a.bar3hTraces??[],quiver3Traces:a.quiver3Traces??[],shading:a.shading,colorbar:a.colorbar,colorbarLocation:a.colorbarLocation,colormap:a.colormap,axisVisible:a.axisVisible}):Kt.jsx(NR,{traces:a.traces,title:a.title,xlabel:a.xlabel,ylabel:a.ylabel,legend:a.legend,gridOn:a.gridOn,boxOn:a.boxOn,imagescTrace:a.imagescTrace,pcolorTraces:a.pcolorTraces,contourTraces:a.contourTraces,colormap:a.colormap,colormapData:a.colormapData,axisMode:a.axisMode,axisScale:a.axisScale,barTraces:a.barTraces,barhTraces:a.barhTraces,errorBarTraces:a.errorBarTraces,boxTraces:a.boxTraces,pieTrace:a.pieTrace,heatmapTrace:a.heatmapTrace,quiverTraces:a.quiverTraces,areaTraces:a.areaTraces,areaBaseValue:a.areaBaseValue,patchTraces:a.patchTraces,shading:a.shading,colorbar:a.colorbar,colorbarLocation:a.colorbarLocation,caxis:a.caxis,xlim:a.xlim,ylim:a.ylim,yDir:a.yDir,axisVisible:a.axisVisible})}function NR({traces:a,title:t,xlabel:i,ylabel:s,legend:l,gridOn:c,boxOn:f,imagescTrace:d,pcolorTraces:m,contourTraces:p,colormap:v,colormapData:_,axisMode:g,axisScale:M,barTraces:E,barhTraces:R,errorBarTraces:x,boxTraces:y,pieTrace:w,heatmapTrace:D,quiverTraces:C,areaTraces:G,areaBaseValue:B,patchTraces:F,shading:T,colorbar:U,colorbarLocation:et,caxis:H,xlim:q,ylim:nt,yDir:ot,axisVisible:Y}){const z=Hn.useRef(null),A=Hn.useRef(null),ht=Hn.useCallback(()=>{const lt=z.current;lt&&_R(lt,a,t,i,s,l,c,d,p,v,g,M,E,R,x,y,w,D,G,B,m,T,U,et,H,_,C,q,nt,ot,Y,f,F)},[a,t,i,s,l,c,d,p,v,_,g,M,E,R,x,y,w,D,G,B,m,T,U,et,H,C,q,nt,ot,Y,f,F]);return Hn.useEffect(()=>{const lt=z.current,Ct=A.current;if(!lt||!Ct)return;const I=new ResizeObserver(()=>{const K=Ct.getBoundingClientRect(),Mt=window.devicePixelRatio||1;lt.width=K.width*Mt,lt.height=K.height*Mt,lt.style.width=`${K.width}px`,lt.style.height=`${K.height}px`,ht()});return I.observe(Ct),()=>I.disconnect()},[ht]),Kt.jsx("div",{ref:A,style:{width:"100%",height:"100%"},children:Kt.jsx("canvas",{ref:z,style:{display:"block"}})})}const Du={holdOn:!1,traces:[],plot3Traces:[],surfTraces:[],pcolorTraces:[],contourTraces:[],barTraces:[],barhTraces:[],bar3Traces:[],bar3hTraces:[],errorBarTraces:[],boxTraces:[],quiverTraces:[],quiver3Traces:[],areaTraces:[],areaBaseValue:0,patchTraces:[]};function en(a){return a.axes[a.currentAxesIndex]||{...Du}}function tm(a,t){return{...a,axes:{...a.axes,[a.currentAxesIndex]:t}}}const jx={currentHandle:1,figs:{}},Zx={currentAxesIndex:1,axes:{}};function Ze(a){return a.figs[a.currentHandle]||{...Zx}}function an(a,t){const i=Ze(a),s=en(i);return{...a,figs:{...a.figs,[a.currentHandle]:tm(i,{...s,...t})}}}function Rn(a,t){const i=Ze(a),s=en(i),l=s.holdOn;return{...a,figs:{...a.figs,[a.currentHandle]:tm(i,{...s,traces:t.traces??(l?s.traces:[]),plot3Traces:t.plot3Traces??(l?s.plot3Traces:[]),surfTraces:t.surfTraces??(l?s.surfTraces:[]),pcolorTraces:t.pcolorTraces??(l?s.pcolorTraces:[]),contourTraces:t.contourTraces??(l?s.contourTraces:[]),barTraces:t.barTraces??(l?s.barTraces:[]),barhTraces:t.barhTraces??(l?s.barhTraces:[]),bar3Traces:t.bar3Traces??(l?s.bar3Traces:[]),bar3hTraces:t.bar3hTraces??(l?s.bar3hTraces:[]),errorBarTraces:t.errorBarTraces??(l?s.errorBarTraces:[]),boxTraces:t.boxTraces??(l?s.boxTraces:[]),pieTrace:t.pieTrace??(l?s.pieTrace:void 0),heatmapTrace:t.heatmapTrace??(l?s.heatmapTrace:void 0),quiverTraces:t.quiverTraces??(l?s.quiverTraces:[]),quiver3Traces:t.quiver3Traces??(l?s.quiver3Traces:[]),areaTraces:t.areaTraces??(l?s.areaTraces:[]),areaBaseValue:t.areaBaseValue??s.areaBaseValue,patchTraces:t.patchTraces??(l?s.patchTraces:[]),...t.imagescTrace!==void 0?{imagescTrace:t.imagescTrace}:{}})}}}const OR=(a,t)=>{switch(t.type){case"set_figure_handle":return{...a,currentHandle:t.handle};case"set_hold":return an(a,{holdOn:t.value});case"plot":{const i=en(Ze(a));return Rn(a,{traces:i.holdOn?[...i.traces,...t.traces]:[...t.traces]})}case"plot3":{const i=en(Ze(a));return Rn(a,{plot3Traces:i.holdOn?[...i.plot3Traces,...t.traces]:[...t.traces]})}case"line":{const i=en(Ze(a));return an(a,{traces:[...i.traces,...t.traces]})}case"line3":{const i=en(Ze(a));return an(a,{plot3Traces:[...i.plot3Traces,...t.traces]})}case"patch":{const i=en(Ze(a));return an(a,{patchTraces:[...i.patchTraces,t.trace]})}case"update_trace":{const i=en(Ze(a)),s=l=>{let c=!1;const f=l.map(d=>d.id===t.id?(c=!0,{...d,...t.props}):d);return c?f:l};return an(a,{traces:s(i.traces),plot3Traces:s(i.plot3Traces),patchTraces:s(i.patchTraces)})}case"surf":{const i=en(Ze(a));return Rn(a,{surfTraces:i.holdOn?[...i.surfTraces,t.trace]:[t.trace]})}case"surface":{const i=en(Ze(a));return an(a,{surfTraces:[...i.surfTraces,t.trace]})}case"imagesc":return Rn(a,{imagescTrace:t.trace});case"pcolor":{const i=en(Ze(a));return Rn(a,{pcolorTraces:i.holdOn?[...i.pcolorTraces,t.trace]:[t.trace]})}case"contour":{const i=en(Ze(a));return Rn(a,{contourTraces:i.holdOn?[...i.contourTraces,t.trace]:[t.trace]})}case"mesh":{const i=en(Ze(a));return Rn(a,{surfTraces:i.holdOn?[...i.surfTraces,t.trace]:[t.trace]})}case"bar":{const i=en(Ze(a));return Rn(a,{barTraces:i.holdOn?[...i.barTraces,...t.traces]:[...t.traces]})}case"barh":{const i=en(Ze(a));return Rn(a,{barhTraces:i.holdOn?[...i.barhTraces,...t.traces]:[...t.traces]})}case"bar3":{const i=en(Ze(a));return Rn(a,{bar3Traces:i.holdOn?[...i.bar3Traces,t.trace]:[t.trace]})}case"bar3h":{const i=en(Ze(a));return Rn(a,{bar3hTraces:i.holdOn?[...i.bar3hTraces,t.trace]:[t.trace]})}case"errorbar":{const i=en(Ze(a));return Rn(a,{errorBarTraces:i.holdOn?[...i.errorBarTraces,...t.traces]:[...t.traces]})}case"boxchart":{const i=en(Ze(a));return Rn(a,{boxTraces:i.holdOn?[...i.boxTraces,...t.traces]:[...t.traces]})}case"piechart":return Rn(a,{pieTrace:t.trace});case"heatmap":return Rn(a,{heatmapTrace:t.trace});case"quiver":{const i=en(Ze(a));return Rn(a,{quiverTraces:i.holdOn?[...i.quiverTraces,...t.traces]:[...t.traces]})}case"quiver3":{const i=en(Ze(a));return Rn(a,{quiver3Traces:i.holdOn?[...i.quiver3Traces,t.trace]:[t.trace]})}case"area":{const i=en(Ze(a));return Rn(a,{areaTraces:i.holdOn?[...i.areaTraces,...t.traces]:[...t.traces],areaBaseValue:t.baseValue})}case"close":{const i=Object.fromEntries(Object.entries(a.figs).filter(([l])=>Number(l)!==a.currentHandle)),s=Object.keys(i).map(Number).sort((l,c)=>l-c);return{...a,currentHandle:s.length>0?s[s.length-1]:1,figs:i}}case"close_all":case"clear":return jx;case"set_title":return an(a,{title:t.text});case"set_xlabel":return an(a,{xlabel:t.text});case"set_ylabel":return an(a,{ylabel:t.text});case"set_zlabel":return an(a,{zlabel:t.text});case"set_shading":return an(a,{shading:t.shading});case"set_legend":return an(a,{legend:t.labels});case"set_sgtitle":{const i=Ze(a);return{...a,figs:{...a.figs,[a.currentHandle]:{...i,sgtitle:t.text}}}}case"set_grid":return an(a,{gridOn:t.value});case"set_box":return an(a,{boxOn:t.value});case"set_colorbar":return an(a,{colorbar:t.value!=="off",colorbarLocation:t.location??"eastoutside"});case"set_colormap":return an(a,{colormap:t.name,colormapData:t.data});case"set_view":return an(a,{view:{az:t.az,el:t.el}});case"set_axis":return an(a,{axisMode:t.value});case"set_axis_limits":{const i=en(Ze(a)),s=(l,c)=>{if(c===void 0)return l;if(c!=="auto")return c};return an(a,{xlim:s(i.xlim,t.xlim),ylim:s(i.ylim,t.ylim),zlim:s(i.zlim,t.zlim)})}case"set_axis_ydir":return an(a,{yDir:t.dir});case"set_axis_visible":return an(a,{axisVisible:t.value});case"set_axis_scale":return an(a,{axisScale:t.value});case"set_caxis":return an(a,{caxis:t.limits});case"clf":return a.figs[a.currentHandle]?{...a,figs:{...a.figs,[a.currentHandle]:{...Zx}}}:a;case"cla":{const i=Ze(a),s=en(i),l=t.reset?{...Du}:{...Du,title:s.title,xlabel:s.xlabel,ylabel:s.ylabel,zlabel:s.zlabel,gridOn:s.gridOn,boxOn:s.boxOn,colorbar:s.colorbar,colorbarLocation:s.colorbarLocation,colormap:s.colormap,colormapData:s.colormapData,view:s.view,axisMode:s.axisMode,axisScale:s.axisScale,caxis:s.caxis,xlim:s.xlim,ylim:s.ylim,zlim:s.zlim,yDir:s.yDir,axisVisible:s.axisVisible,shading:s.shading};return{...a,figs:{...a.figs,[a.currentHandle]:tm(i,l)}}}case"set_subplot":{const s={...Ze(a),subplotGrid:{rows:t.rows,cols:t.cols},currentAxesIndex:t.index};return s.axes[t.index]||(s.axes={...s.axes,[t.index]:{...Du}}),{...a,figs:{...a.figs,[a.currentHandle]:s}}}default:return a}};function _i(a){for(let t=0;t<a.length;t++)a[t]===null&&(a[t]=NaN)}function PR(a){if(a.type==="plot")for(const t of a.traces)_i(t.x),_i(t.y);else if(a.type==="plot3")for(const t of a.traces)_i(t.x),_i(t.y),_i(t.z);else a.type==="surf"||a.type==="mesh"?(_i(a.trace.x),_i(a.trace.y),_i(a.trace.z),a.trace.c&&_i(a.trace.c)):a.type==="imagesc"?_i(a.trace.z):a.type==="contour"&&(_i(a.trace.x),_i(a.trace.y),_i(a.trace.z))}function zR(){const[a,t]=Hn.useReducer(OR,jx),[i,s]=Hn.useState(!1),[l,c]=Hn.useState(1),f=Hn.useRef(l),d=Hn.useCallback(_=>{t(_),_.type==="set_figure_handle"?(f.current=_.handle,c(_.handle)):_.type==="close_all"&&(f.current=1,c(1))},[]),m=(()=>{if(a.figs[l])return l;const _=Object.keys(a.figs).map(Number);return _.length===0?l:_.sort((M,E)=>M-E)[_.length-1]})();Hn.useEffect(()=>{const _=new EventSource("/events");return _.onmessage=g=>{const M=JSON.parse(g.data);for(const E of M)PR(E),d(E)},_.addEventListener("done",()=>{s(!0)}),()=>_.close()},[d]);const p=Object.keys(a.figs).map(Number).sort((_,g)=>_-g),v=a.figs[m];return Kt.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh"},children:[p.length>1&&Kt.jsx("div",{style:FR,children:p.map(_=>Kt.jsxs("button",{onClick:()=>c(_),style:_===m?IR:Kx,children:["Figure ",_]},_))}),Kt.jsx("div",{style:{flex:1,position:"relative"},children:v?Kt.jsx("div",{style:{position:"absolute",inset:0},children:Kt.jsx(LR,{figure:v})}):Kt.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#999",fontFamily:"sans-serif"},children:"Waiting for plot data..."})}),Kt.jsx("div",{style:BR,children:i?"Script complete. Press Ctrl+C in terminal to exit.":"Running..."})]})}const FR={display:"flex",gap:2,padding:"4px 8px",background:"#f0f0f0",borderBottom:"1px solid #ccc"},Kx={padding:"4px 12px",border:"1px solid #ccc",borderBottom:"none",background:"#e0e0e0",cursor:"pointer",fontFamily:"sans-serif",fontSize:13,borderRadius:"4px 4px 0 0"},IR={...Kx,background:"#fff",fontWeight:"bold"},BR={padding:"4px 12px",background:"#f5f5f5",borderTop:"1px solid #ddd",fontSize:12,fontFamily:"sans-serif",color:"#666"};uM.createRoot(document.getElementById("root")).render(Kt.jsx(Hn.StrictMode,{children:Kt.jsx(zR,{})}));
|
|
4426
|
+
`};class $p extends qi{constructor(t){super({type:"LineMaterial",uniforms:Qp.clone(ai.line.uniforms),vertexShader:ai.line.vertexShader,fragmentShader:ai.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0!==this.worldUnits&&(this.needsUpdate=!0),t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Id=new Ze,Kv=new Q,Qv=new Q,Ln=new Ze,Nn=new Ze,ta=new Ze,Bd=new Q,Hd=new nn,On=new Jb,Jv=new Q,mu=new As,gu=new po,ea=new Ze;let na,er;function $v(a,t,i){return ea.set(0,0,-t,1).applyMatrix4(a.projectionMatrix),ea.multiplyScalar(1/ea.w),ea.x=er/i.width,ea.y=er/i.height,ea.applyMatrix4(a.projectionMatrixInverse),ea.multiplyScalar(1/ea.w),Math.abs(Math.max(ea.x,ea.y))}function lR(a,t){const i=a.matrixWorld,s=a.geometry,l=s.attributes.instanceStart,c=s.attributes.instanceEnd,f=Math.min(s.instanceCount,l.count);for(let d=0,m=f;d<m;d++){On.start.fromBufferAttribute(l,d),On.end.fromBufferAttribute(c,d),On.applyMatrix4(i);const p=new Q,v=new Q;na.distanceSqToSegment(On.start,On.end,v,p),v.distanceTo(p)<er*.5&&t.push({point:v,pointOnLine:p,distance:na.origin.distanceTo(v),object:a,face:null,faceIndex:d,uv:null,uv1:null})}}function cR(a,t,i){const s=t.projectionMatrix,c=a.material.resolution,f=a.matrixWorld,d=a.geometry,m=d.attributes.instanceStart,p=d.attributes.instanceEnd,v=Math.min(d.instanceCount,m.count),_=-t.near;na.at(1,ta),ta.w=1,ta.applyMatrix4(t.matrixWorldInverse),ta.applyMatrix4(s),ta.multiplyScalar(1/ta.w),ta.x*=c.x/2,ta.y*=c.y/2,ta.z=0,Bd.copy(ta),Hd.multiplyMatrices(t.matrixWorldInverse,f);for(let g=0,S=v;g<S;g++){if(Ln.fromBufferAttribute(m,g),Nn.fromBufferAttribute(p,g),Ln.w=1,Nn.w=1,Ln.applyMatrix4(Hd),Nn.applyMatrix4(Hd),Ln.z>_&&Nn.z>_)continue;if(Ln.z>_){const D=Ln.z-Nn.z,C=(Ln.z-_)/D;Ln.lerp(Nn,C)}else if(Nn.z>_){const D=Nn.z-Ln.z,C=(Nn.z-_)/D;Nn.lerp(Ln,C)}Ln.applyMatrix4(s),Nn.applyMatrix4(s),Ln.multiplyScalar(1/Ln.w),Nn.multiplyScalar(1/Nn.w),Ln.x*=c.x/2,Ln.y*=c.y/2,Nn.x*=c.x/2,Nn.y*=c.y/2,On.start.copy(Ln),On.start.z=0,On.end.copy(Nn),On.end.z=0;const R=On.closestPointToPointParameter(Bd,!0);On.at(R,Jv);const x=wx.lerp(Ln.z,Nn.z,R),y=x>=-1&&x<=1,w=Bd.distanceTo(Jv)<er*.5;if(y&&w){On.start.fromBufferAttribute(m,g),On.end.fromBufferAttribute(p,g),On.start.applyMatrix4(f),On.end.applyMatrix4(f);const D=new Q,C=new Q;na.distanceSqToSegment(On.start,On.end,C,D),i.push({point:C,pointOnLine:D,distance:na.origin.distanceTo(C),object:a,face:null,faceIndex:g,uv:null,uv1:null})}}}class uR extends Gn{constructor(t=new qx,i=new $p({color:Math.random()*16777215})){super(t,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,i=t.attributes.instanceStart,s=t.attributes.instanceEnd,l=new Float32Array(2*i.count);for(let f=0,d=0,m=i.count;f<m;f++,d+=2)Kv.fromBufferAttribute(i,f),Qv.fromBufferAttribute(s,f),l[d]=d===0?0:l[d-1],l[d+1]=l[d]+Kv.distanceTo(Qv);const c=new Up(l,2,1);return t.setAttribute("instanceDistanceStart",new Ms(c,1,0)),t.setAttribute("instanceDistanceEnd",new Ms(c,1,1)),this}raycast(t,i){const s=this.material.worldUnits,l=t.camera;l===null&&!s&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const c=t.params.Line2!==void 0&&t.params.Line2.threshold||0;na=t.ray;const f=this.matrixWorld,d=this.geometry,m=this.material;er=m.linewidth+c,d.boundingSphere===null&&d.computeBoundingSphere(),gu.copy(d.boundingSphere).applyMatrix4(f);let p;if(s)p=er*.5;else{const _=Math.max(l.near,gu.distanceToPoint(na.origin));p=$v(l,_,m.resolution)}if(gu.radius+=p,na.intersectsSphere(gu)===!1)return;d.boundingBox===null&&d.computeBoundingBox(),mu.copy(d.boundingBox).applyMatrix4(f);let v;if(s)v=er*.5;else{const _=Math.max(l.near,mu.distanceToPoint(na.origin));v=$v(l,_,m.resolution)}mu.expandByScalar(v),na.intersectsBox(mu)!==!1&&(s?lR(this,i):cR(this,l,i))}onBeforeRender(t){const i=this.material.uniforms;i&&i.resolution&&(t.getViewport(Id),this.material.uniforms.resolution.value.set(Id.z,Id.w))}}class Yx extends qx{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const i=t.length-3,s=new Float32Array(2*i);for(let l=0;l<i;l+=3)s[2*l]=t[l],s[2*l+1]=t[l+1],s[2*l+2]=t[l+2],s[2*l+3]=t[l+3],s[2*l+4]=t[l+4],s[2*l+5]=t[l+5];return super.setPositions(s),this}setColors(t){const i=t.length-3,s=new Float32Array(2*i);for(let l=0;l<i;l+=3)s[2*l]=t[l],s[2*l+1]=t[l+1],s[2*l+2]=t[l+2],s[2*l+3]=t[l+3],s[2*l+4]=t[l+4],s[2*l+5]=t[l+5];return super.setColors(s),this}setFromPoints(t){const i=t.length-1,s=new Float32Array(6*i);for(let l=0;l<i;l++)s[6*l]=t[l].x,s[6*l+1]=t[l].y,s[6*l+2]=t[l].z||0,s[6*l+3]=t[l+1].x,s[6*l+4]=t[l+1].y,s[6*l+5]=t[l+1].z||0;return super.setPositions(s),this}fromLine(t){const i=t.geometry;return this.setPositions(i.attributes.position.array),this}}class fR extends uR{constructor(t=new Yx,i=new $p({color:Math.random()*16777215})){super(t,i),this.isLine2=!0,this.type="Line2"}}const Gi=[[.2422,.1504,.6603],[.281,.3228,.9579],[.1786,.5289,.9682],[.0689,.6948,.8394],[.128,.789,.5927],[.3391,.849,.3798],[.633,.8518,.2091],[.8902,.8044,.1137],[.9905,.6816,.0235],[.9763,.517,.034]];function wu(a){const t=Number.isFinite(a)?a:0,s=Math.max(0,Math.min(1,t))*(Gi.length-1),l=Math.floor(s),c=Math.min(l+1,Gi.length-1),f=s-l;return[Gi[l][0]+f*(Gi[c][0]-Gi[l][0]),Gi[l][1]+f*(Gi[c][1]-Gi[l][1]),Gi[l][2]+f*(Gi[c][2]-Gi[l][2])]}const tx=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188],[.301,.745,.933],[.635,.078,.184]];function hR({surfTraces:a,plot3Traces:t=[],bar3Traces:i=[],bar3hTraces:s=[],quiver3Traces:l=[],shading:c,colorbar:f,colorbarLocation:d,colormap:m,axisVisible:p}){const v=Pn.useRef(null),_=Pn.useRef(null);Pn.useEffect(()=>{const R=v.current;if(!R)return;const x=new Y2({antialias:!0});x.setPixelRatio(window.devicePixelRatio),x.setClearColor(16777215),R.appendChild(x.domElement);const y=new bb,w=new Vu(-1,1,1,-1,.01,100);w.position.set(1.2,.8,1.2),w.lookAt(0,0,0);const D=new Z2(w,x.domElement);D.enablePan=!1,D.enableZoom=!0,y.add(new qb(16777215,.6));const C=new Wb(16777215,.6);C.position.set(2,3,2),y.add(C);const G=requestAnimationFrame(function F(){D.update(),x.render(y,w),_.current.animId=requestAnimationFrame(F)});_.current={renderer:x,scene:y,camera:w,controls:D,animId:G};const B=new ResizeObserver(()=>{const F=R.getBoundingClientRect();if(F.width===0||F.height===0)return;x.setSize(F.width,F.height);const T=F.width/F.height,U=1.2;w.left=-U*T,w.right=U*T,w.top=U,w.bottom=-U,w.updateProjectionMatrix()});return B.observe(R),()=>{B.disconnect(),cancelAnimationFrame(_.current?.animId??G),D.dispose(),x.dispose(),R.removeChild(x.domElement),_.current=null}},[]),Pn.useEffect(()=>{const R=_.current;if(!R)return;const{scene:x}=R,y=[];x.traverse(tt=>{(tt instanceof Gn||tt instanceof dl||tt instanceof Iu)&&y.push(tt)});for(const tt of y)x.remove(tt),tt.geometry&&tt.geometry.dispose();if(a.length===0&&t.length===0&&i.length===0&&s.length===0&&l.length===0)return;let w=1/0,D=-1/0,C=1/0,G=-1/0,B=1/0,F=-1/0;const T=(tt,ct,qt)=>{for(const Xt of tt)isFinite(Xt)&&(Xt<ct.v&&(ct.v=Xt),Xt>qt.v&&(qt.v=Xt))},U={v:w},et={v:D},H={v:C},q={v:G},nt={v:B},ot={v:F};for(const tt of a)T(tt.x,U,et),T(tt.y,H,q),T(tt.z,nt,ot);for(const tt of t)T(tt.x,U,et),T(tt.y,H,q),T(tt.z,nt,ot);for(const tt of i)T(tt.x,U,et),T(tt.y,H,q),T(tt.z,nt,ot),0<nt.v&&(nt.v=0);for(const tt of s)T(tt.y,H,q),T(tt.z,nt,ot),T(tt.x,U,et),0<U.v&&(U.v=0);for(const tt of l)T(tt.x,U,et),T(tt.y,H,q),T(tt.z,nt,ot),T(tt.x.map((ct,qt)=>ct+(tt.u[qt]??0)),U,et),T(tt.y.map((ct,qt)=>ct+(tt.v[qt]??0)),H,q),T(tt.z.map((ct,qt)=>ct+(tt.w[qt]??0)),nt,ot);if(w=U.v,D=et.v,C=H.v,G=q.v,B=nt.v,F=ot.v,!isFinite(w))return;D===w&&(w-=1,D+=1),G===C&&(C-=1,G+=1),F===B&&(B-=1,F+=1);const Y=D-w||1,z=G-C||1,A=F-B||1,ht=Math.max(Y,z,A),lt=(w+D)/2,Ct=(C+G)/2,I=(B+F)/2,K=a.length===0&&t.length===0&&(i.length>0||s.length>0),Mt=K?Math.max(Y,z):ht,wt=(tt,ct)=>(tt-ct)/Mt,Bt=(tt,ct)=>(tt-ct)/(K?Math.max(Mt,A):ht),st=(tt,ct)=>(tt-ct)/ht;let Et=1/0,gt=-1/0;for(const tt of a)for(const ct of tt.c??tt.z)isFinite(ct)&&(ct<Et&&(Et=ct),ct>gt&&(gt=ct));isFinite(Et)||(Et=B,gt=F);const Ut=gt-Et||1;for(const tt of a){const{rows:ct,cols:qt,x:Xt,y:oe,z:de}=tt,Yt=tt.faceAlpha??1,se=new Float32Array(ct*qt*3),X=new Float32Array(ct*qt*3);for(let V=0;V<qt;V++)for(let $=0;$<ct;$++){const k=V*ct+$,P=$*qt+V,it=st(Xt[k],lt),rt=st(oe[k],Ct),_t=st(de[k],I);se[P*3]=it,se[P*3+1]=_t,se[P*3+2]=rt;const xt=((tt.c?tt.c[k]:de[k])-Et)/Ut,[St,Nt,Lt]=wu(xt);X[P*3]=St,X[P*3+1]=Nt,X[P*3+2]=Lt}const ce=[];for(let V=0;V<ct-1;V++)for(let $=0;$<qt-1;$++){const k=V*qt+$,P=V*qt+($+1),it=(V+1)*qt+$,rt=(V+1)*qt+($+1);ce.push(k,it,P),ce.push(P,it,rt)}const Jt=new Mn;Jt.setAttribute("position",new xi(se,3)),Jt.setAttribute("color",new xi(X,3)),Jt.setIndex(ce),Jt.computeVertexNormals();const ne=c??"faceted",Pt=ne==="faceted"||ne==="flat";if(tt.faceColor!=="none"){let V;if(Array.isArray(tt.faceColor)){const[$,k,P]=tt.faceColor;V=new ou({color:new Ee($,k,P),flatShading:Pt,opacity:Yt,transparent:Yt<1,side:ki})}else V=new ou({vertexColors:!0,flatShading:Pt,opacity:Yt,transparent:Yt<1,side:ki});x.add(new Gn(Jt,V))}if(tt.edgeColor!=="none"&&ne==="faceted"){const V=[],$=[];for(let it=0;it<ct;it++)for(let rt=0;rt<qt;rt++){const _t=it*qt+rt;if(rt<qt-1){const At=it*qt+(rt+1);V.push(se[_t*3],se[_t*3+1],se[_t*3+2],se[At*3],se[At*3+1],se[At*3+2]),$.push(X[_t*3],X[_t*3+1],X[_t*3+2],X[At*3],X[At*3+1],X[At*3+2])}if(it<ct-1){const At=(it+1)*qt+rt;V.push(se[_t*3],se[_t*3+1],se[_t*3+2],se[At*3],se[At*3+1],se[At*3+2]),$.push(X[_t*3],X[_t*3+1],X[_t*3+2],X[At*3],X[At*3+1],X[At*3+2])}}const k=new Mn;k.setAttribute("position",new _n(V,3));let P;if(Array.isArray(tt.edgeColor)){const[it,rt,_t]=tt.edgeColor;P=new Ss({color:new Ee(it,rt,_t)})}else P=new Ss({color:0,opacity:.3,transparent:!0});x.add(new dl(k,P))}}for(let tt=0;tt<t.length;tt++){const ct=t[tt],{x:qt,y:Xt,z:oe}=ct,de=tx[tt%tx.length],Yt=ct.color??de,se=new Ee(Yt[0],Yt[1],Yt[2]);if(ct.lineStyle!=="none"){const ce=[];let Jt=[];for(let O=0;O<qt.length;O++)if(isFinite(qt[O])&&isFinite(Xt[O])&&isFinite(oe[O])){const E=st(qt[O],lt),V=st(Xt[O],Ct),$=st(oe[O],I);Jt.push(new Q(E,$,V))}else Jt.length>0&&(ce.push(Jt),Jt=[]);Jt.length>0&&ce.push(Jt);const ne=ct.lineWidth??2,Pt=ct.lineStyle==="--"||ct.lineStyle===":"||ct.lineStyle==="-.";for(const O of ce){if(O.length<2)continue;const E=[];for(const V of O)E.push(V.x,V.y,V.z);if(Pt){const V=new Vb({color:se,linewidth:ne,dashSize:ct.lineStyle===":"?.01:.03,gapSize:ct.lineStyle===":"?.02:.015}),$=new Mn().setFromPoints(O),k=new Iu($,V);k.computeLineDistances(),x.add(k)}else{const V=new Yx;V.setPositions(E);const $=new $p({color:se.getHex(),linewidth:ne,worldUnits:!1,resolution:new _e(R.renderer.domElement.width||800,R.renderer.domElement.height||600)});x.add(new fR(V,$))}}}if(ct.marker&&ct.marker!=="none"){const ce=(ct.markerSize??6)/600,Jt=ct.markerEdgeColor?new Ee(ct.markerEdgeColor[0],ct.markerEdgeColor[1],ct.markerEdgeColor[2]):se,ne=ct.markerIndices?ct.markerIndices.map(E=>E-1):Array.from({length:qt.length},(E,V)=>V),Pt=new Bu(ce,8,8),O=new Pu({color:Jt});for(const E of ne){if(E<0||E>=qt.length||!isFinite(qt[E])||!isFinite(Xt[E])||!isFinite(oe[E]))continue;const V=st(qt[E],lt),$=st(Xt[E],Ct),k=st(oe[E],I),P=new Gn(Pt,O);P.position.set(V,k,$),x.add(P)}}}for(const tt of l){const{x:ct,y:qt,z:Xt,u:oe,v:de,w:Yt}=tt,se=tt.color??[0,.447,.741],X=new Ee(se[0],se[1],se[2]),ce=tt.lineWidth??.5,Jt=(O,E,V)=>new Q(st(O,lt),st(V,I),st(E,Ct)),ne=new Q(0,1,0),Pt=[];for(let O=0;O<ct.length;O++){if(!isFinite(ct[O])||!isFinite(qt[O])||!isFinite(Xt[O])||!isFinite(oe[O])||!isFinite(de[O])||!isFinite(Yt[O]))continue;const E=Jt(ct[O],qt[O],Xt[O]),V=Jt(ct[O]+oe[O],qt[O]+de[O],Xt[O]+Yt[O]);if(Pt.push(E.x,E.y,E.z,V.x,V.y,V.z),tt.showArrowHead){const $=new Q().subVectors(V,E),k=$.length();if(k>1e-9){$.multiplyScalar(1/k);let P=new Q().crossVectors($,ne);P.lengthSq()<1e-12&&(P=new Q().crossVectors($,new Q(1,0,0))),P.normalize();const it=Math.min(.3*k,k),rt=$.clone().multiplyScalar(-1),_t=Math.cos(20*Math.PI/180),At=Math.sin(20*Math.PI/180),xt=V.clone().addScaledVector(rt,it*_t).addScaledVector(P,it*At),St=V.clone().addScaledVector(rt,it*_t).addScaledVector(P,-it*At);Pt.push(V.x,V.y,V.z,xt.x,xt.y,xt.z),Pt.push(V.x,V.y,V.z,St.x,St.y,St.z)}}}if(Pt.length>0){const O=new Mn;O.setAttribute("position",new _n(Pt,3));const E=new Ss({color:X,linewidth:ce});x.add(new dl(O,E))}if(tt.marker&&tt.marker!=="none"){const E=new Bu(.01,8,8),V=new Pu({color:X});for(let $=0;$<ct.length;$++){if(!isFinite(ct[$])||!isFinite(qt[$])||!isFinite(Xt[$]))continue;const k=Jt(ct[$],qt[$],Xt[$]),P=new Gn(E,V);P.position.set(k.x,k.y,k.z),x.add(P)}}}for(const tt of i){const ct=tt.width/2*.9,qt=F-B||1;for(let Xt=0;Xt<tt.x.length;Xt++){const oe=tt.x[Xt],de=tt.y[Xt],Yt=tt.z[Xt];if(!isFinite(Yt))continue;const se=Math.abs(Bt(Yt,I)-Bt(0,I)),X=(Bt(Yt,I)+Bt(0,I))/2,ce=new ir(ct*2/Mt,se,ct*2/Mt),Jt=(Yt-B)/qt,[ne,Pt,O]=tt.color??wu(Jt),E=new ou({color:new Ee(ne,Pt,O)}),V=new Gn(ce,E);V.position.set(wt(oe,lt),X,wt(de,Ct)),x.add(V);const $=new mv(ce),k=new Ss({color:0,opacity:.3,transparent:!0}),P=new dl($,k);P.position.copy(V.position),x.add(P)}}for(const tt of s){const ct=tt.width/2*.9,qt=D-w||1;for(let Xt=0;Xt<tt.x.length;Xt++){const oe=tt.y[Xt],de=tt.x[Xt],Yt=tt.z[Xt];if(!isFinite(Yt))continue;const se=Math.abs(wt(Yt,lt)-wt(0,lt)),X=(wt(Yt,lt)+wt(0,lt))/2,ce=new ir(se,ct*2/Mt,ct*2/Mt),Jt=(Yt-w)/qt,[ne,Pt,O]=tt.color??wu(Jt),E=new ou({color:new Ee(ne,Pt,O)}),V=new Gn(ce,E);V.position.set(X,wt(de,I),wt(oe,Ct)),x.add(V);const $=new mv(ce),k=new Ss({color:0,opacity:.3,transparent:!0}),P=new dl($,k);P.position.copy(V.position),x.add(P)}}p!==!1&&pR(x,w,D,C,G,B,F,ht,lt,Ct,I)},[a,t,i,s,l,c,p]);let g=1/0,S=-1/0;for(const R of a){const x=R.c??R.z;for(const y of x)isFinite(y)&&(y<g&&(g=y),y>S&&(S=y))}if(!isFinite(g))for(const R of i)for(const x of R.z)isFinite(x)&&(x<g&&(g=x),x>S&&(S=x));const b=isFinite(g)&&isFinite(S);return g===S&&(g-=.5,S+=.5),Zt.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Zt.jsx("div",{ref:v,style:{position:"absolute",inset:0}}),f&&b&&Zt.jsx(dR,{location:(d??"eastoutside").toLowerCase(),dMin:g,dMax:S,colormap:m})]})}function dR({location:a,dMin:t,dMax:i,colormap:s}){const c=[];for(let g=0;g<32;g++){const S=g/31,[b,R,x]=wu(S),y=`rgb(${Math.round(b*255)},${Math.round(R*255)},${Math.round(x*255)})`;c.push(`${y} ${(S*100).toFixed(2)}%`)}const d=a==="northoutside"||a==="southoutside"||a==="north"||a==="south"?`linear-gradient(to right, ${c.join(",")})`:`linear-gradient(to top, ${c.join(",")})`,m=g=>Number.isInteger(g)?String(g):g.toPrecision(3),p=16,v={position:"absolute",pointerEvents:"none",fontFamily:"sans-serif",fontSize:10,color:"#333"},_={background:d,border:"1px solid #999",boxSizing:"border-box"};switch(a){case"eastoutside":return Zt.jsxs("div",{style:{...v,top:12,bottom:12,right:8,width:50,display:"flex",alignItems:"stretch"},children:[Zt.jsx("div",{style:{..._,width:p,height:"100%"}}),Zt.jsxs("div",{style:{marginLeft:4,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[Zt.jsx("span",{children:m(i)}),Zt.jsx("span",{children:m(t)})]})]});case"westoutside":return Zt.jsxs("div",{style:{...v,top:12,bottom:12,left:8,width:50,display:"flex",alignItems:"stretch",flexDirection:"row-reverse"},children:[Zt.jsx("div",{style:{..._,width:p,height:"100%"}}),Zt.jsxs("div",{style:{marginRight:4,display:"flex",flexDirection:"column",justifyContent:"space-between",textAlign:"right"},children:[Zt.jsx("span",{children:m(i)}),Zt.jsx("span",{children:m(t)})]})]});case"northoutside":return Zt.jsxs("div",{style:{...v,left:12,right:12,top:8,height:32,display:"flex",flexDirection:"column"},children:[Zt.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:2},children:[Zt.jsx("span",{children:m(t)}),Zt.jsx("span",{children:m(i)})]}),Zt.jsx("div",{style:{..._,height:p,width:"100%"}})]});case"southoutside":return Zt.jsxs("div",{style:{...v,left:12,right:12,bottom:8,height:32,display:"flex",flexDirection:"column-reverse"},children:[Zt.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:2},children:[Zt.jsx("span",{children:m(t)}),Zt.jsx("span",{children:m(i)})]}),Zt.jsx("div",{style:{..._,height:p,width:"100%"}})]});case"east":return Zt.jsxs("div",{style:{...v,top:24,bottom:24,right:24,width:50,display:"flex",flexDirection:"row-reverse",alignItems:"stretch"},children:[Zt.jsx("div",{style:{..._,width:p,height:"100%"}}),Zt.jsxs("div",{style:{marginRight:4,display:"flex",flexDirection:"column",justifyContent:"space-between",textAlign:"right"},children:[Zt.jsx("span",{children:m(i)}),Zt.jsx("span",{children:m(t)})]})]});case"west":return Zt.jsxs("div",{style:{...v,top:24,bottom:24,left:24,width:50,display:"flex",alignItems:"stretch"},children:[Zt.jsx("div",{style:{..._,width:p,height:"100%"}}),Zt.jsxs("div",{style:{marginLeft:4,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[Zt.jsx("span",{children:m(i)}),Zt.jsx("span",{children:m(t)})]})]});case"north":return Zt.jsxs("div",{style:{...v,left:24,right:24,top:24,height:32,display:"flex",flexDirection:"column-reverse"},children:[Zt.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:2},children:[Zt.jsx("span",{children:m(t)}),Zt.jsx("span",{children:m(i)})]}),Zt.jsx("div",{style:{..._,height:p,width:"100%"}})]});case"south":return Zt.jsxs("div",{style:{...v,left:24,right:24,bottom:24,height:32,display:"flex",flexDirection:"column"},children:[Zt.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:2},children:[Zt.jsx("span",{children:m(t)}),Zt.jsx("span",{children:m(i)})]}),Zt.jsx("div",{style:{..._,height:p,width:"100%"}})]});default:return null}}function pR(a,t,i,s,l,c,f,d,m,p,v){const _=(b,R)=>(b-R)/d,g=[{from:[t,s,c],to:[i,s,c]},{from:[t,s,c],to:[t,l,c]},{from:[t,s,c],to:[t,s,f]}],S=new Ss({color:3355443});for(const b of g){const R=[b.from,b.to].map(([y,w,D])=>{const C=_(y,m),G=_(w,p),B=_(D,v);return new Q(C,B,G)}),x=new Mn().setFromPoints(R);a.add(new Iu(x,S))}}const ex=["#0072BD","#D95319","#EDB120","#7E2F8E","#77AC30","#4DBEEE","#A2142F"];function Op(a){return`rgb(${Math.round(a[0]*255)}, ${Math.round(a[1]*255)}, ${Math.round(a[2]*255)})`}function Pp(a,t){return a.color?Op(a.color):ex[t%ex.length]}function Wu(a){switch(a){case"--":return[8,4];case":":return[2,4];case"-.":return[8,4,2,4];default:return[]}}function mR(a,t){const i=a/t,s=Math.pow(10,Math.floor(Math.log10(i))),l=i/s;let c;return l<=1.5?c=1:l<=3.5?c=2:l<=7.5?c=5:c=10,c*s}function _u(a,t,i){const s=mR(t-a,i),l=[],c=Math.ceil(a/s)*s;for(let f=c;f<=t+s*.001;f+=s)l.push(f);return l}function nx(a){return Math.abs(a)<1e-10?"0":Math.abs(a)>=1e4||Math.abs(a)<.01&&a!==0?a.toExponential(1):parseFloat(a.toPrecision(6)).toString()}function jx(a,t,i,s,l){if(!t.marker||t.marker==="none")return;const c=(t.markerSize??6)/2,f=t.markerEdgeColor?Op(t.markerEdgeColor):l,d=t.markerFaceColor?Op(t.markerFaceColor):void 0,m=t.markerIndices?t.markerIndices.map(p=>p-1):Array.from({length:t.x.length},(p,v)=>v);a.lineWidth=1.5;for(const p of m){if(p<0||p>=t.x.length)continue;const v=t.x[p],_=t.y[p];if(!isFinite(v)||!isFinite(_))continue;const g=i(v),S=s(_);gR(a,t.marker,g,S,c,f,d)}}function gR(a,t,i,s,l,c,f){switch(a.strokeStyle=c,a.fillStyle=f??"transparent",t){case"o":{a.beginPath(),a.arc(i,s,l,0,Math.PI*2),f&&a.fill(),a.stroke();break}case"+":{a.beginPath(),a.moveTo(i-l,s),a.lineTo(i+l,s),a.moveTo(i,s-l),a.lineTo(i,s+l),a.stroke();break}case"*":{a.beginPath();for(let d=0;d<6;d++){const m=d*Math.PI/3;a.moveTo(i,s),a.lineTo(i+l*Math.cos(m),s+l*Math.sin(m))}a.stroke();break}case".":{a.beginPath(),a.arc(i,s,Math.max(l/3,1.5),0,Math.PI*2),a.fillStyle=c,a.fill();break}case"x":{const d=l*.707;a.beginPath(),a.moveTo(i-d,s-d),a.lineTo(i+d,s+d),a.moveTo(i+d,s-d),a.lineTo(i-d,s+d),a.stroke();break}case"_":{a.beginPath(),a.moveTo(i-l,s),a.lineTo(i+l,s),a.stroke();break}case"|":{a.beginPath(),a.moveTo(i,s-l),a.lineTo(i,s+l),a.stroke();break}case"s":{a.beginPath(),a.rect(i-l,s-l,l*2,l*2),f&&a.fill(),a.stroke();break}case"d":{a.beginPath(),a.moveTo(i,s-l),a.lineTo(i+l,s),a.lineTo(i,s+l),a.lineTo(i-l,s),a.closePath(),f&&a.fill(),a.stroke();break}case"^":{vu(a,i,s,l,0,f);break}case"v":{vu(a,i,s,l,Math.PI,f);break}case"<":{vu(a,i,s,l,-Math.PI/2,f);break}case">":{vu(a,i,s,l,Math.PI/2,f);break}case"p":{ix(a,i,s,l,5,f);break}case"h":{ix(a,i,s,l,6,f);break}}}function vu(a,t,i,s,l,c){a.beginPath();for(let f=0;f<3;f++){const d=l-Math.PI/2+f*2*Math.PI/3,m=t+s*Math.cos(d),p=i+s*Math.sin(d);f===0?a.moveTo(m,p):a.lineTo(m,p)}a.closePath(),c&&a.fill(),a.stroke()}function ix(a,t,i,s,l,c){const f=s*.4;a.beginPath();for(let d=0;d<l*2;d++){const m=-Math.PI/2+d*Math.PI/l,p=d%2===0?s:f,v=t+p*Math.cos(m),_=i+p*Math.sin(m);d===0?a.moveTo(v,_):a.lineTo(v,_)}a.closePath(),c&&a.fill(),a.stroke()}function _R(a,t,i,s,l){a.font="11px sans-serif";let v=0;for(const R of i){const x=a.measureText(R).width;x>v&&(v=x)}const _=34+v+8,g=8+i.length*17+8,S=s-_-8,b=l+8;a.fillStyle="rgba(255,255,255,0.9)",a.fillRect(S,b,_,g),a.strokeStyle="#999",a.lineWidth=.5,a.strokeRect(S,b,_,g);for(let R=0;R<i.length;R++){const x=R<t.length?Pp(t[R],R):"#333",y=R<t.length?t[R].lineWidth??2:2,w=R<t.length?t[R].lineStyle:void 0,D=b+8+R*17+17/2;a.strokeStyle=x,a.lineWidth=y,a.setLineDash(Wu(w)),a.beginPath(),a.moveTo(S+8,D),a.lineTo(S+8+20,D),a.stroke(),a.setLineDash([]),a.fillStyle="#333",a.font="11px sans-serif",a.textAlign="left",a.textBaseline="middle",a.fillText(i[R],S+8+20+6,D)}}function xu(a,t){const i=Math.max(a,Number.MIN_VALUE),s=Math.max(t,Number.MIN_VALUE),l=Math.floor(Math.log10(i)),c=Math.ceil(Math.log10(s)),f=[];for(let d=l;d<=c;d++){const m=Math.pow(10,d);m>=i&&m<=s&&f.push(m)}if(f.length<3){for(let d=l;d<=c;d++)for(const m of[2,5]){const p=m*Math.pow(10,d);p>=i&&p<=s&&!f.includes(p)&&f.push(p)}f.sort((d,m)=>d-m)}return f}function ax(a){return a>=1&&a<1e6&&Number.isInteger(a)?a.toString():a.toExponential(0)}function vR(a,t,i,s,l,c,f,d,m,p,v,_,g,S,b,R,x,y,w,D,C,G,B,F,T,U,et,H,q,nt,ot,Y,z){Cu=U;const A=a.getContext("2d"),ht=t.length>0||d!==void 0||C&&C.length>0||m&&m.length>0||g&&g.length>0||S&&S.length>0||b&&b.length>0||R&&R.length>0||x!==void 0||y!==void 0||w&&w.length>0||et&&et.length>0||z&&z.length>0;if(!A||!ht)return;const lt=window.devicePixelRatio||1,Ct=a.width,I=a.height;A.setTransform(lt,0,0,lt,0,0);const K=Ct/lt,Mt=I/lt;if(A.fillStyle="#fff",A.fillRect(0,0,K,Mt),x){RR(A,K,Mt,x,i);return}if(y){wR(A,K,Mt,y,i,p);return}const wt={top:i?40:20,right:20,bottom:s?56:40,left:l?76:60},Bt=(F??"eastoutside").toLowerCase();B&&(Bt==="eastoutside"?wt.right+=70:Bt==="westoutside"?wt.left+=70:Bt==="northoutside"?wt.top+=50:Bt==="southoutside"&&(wt.bottom+=50));const st=K-wt.left-wt.right,Et=Mt-wt.top-wt.bottom;if(st<=0||Et<=0)return;let gt=1/0,Ut=-1/0,tt=1/0,ct=-1/0;for(const k of t){for(const P of k.x)isFinite(P)&&(P<gt&&(gt=P),P>Ut&&(Ut=P));for(const P of k.y)isFinite(P)&&(P<tt&&(tt=P),P>ct&&(ct=P))}if(d&&(d.x[0]<gt&&(gt=d.x[0]),d.x[1]>Ut&&(Ut=d.x[1]),d.y[0]<tt&&(tt=d.y[0]),d.y[1]>ct&&(ct=d.y[1])),C)for(const k of C){for(const P of k.x)isFinite(P)&&(P<gt&&(gt=P),P>Ut&&(Ut=P));for(const P of k.y)isFinite(P)&&(P<tt&&(tt=P),P>ct&&(ct=P))}if(m)for(const k of m){for(const P of k.x)isFinite(P)&&(P<gt&&(gt=P),P>Ut&&(Ut=P));for(const P of k.y)isFinite(P)&&(P<tt&&(tt=P),P>ct&&(ct=P))}if(z)for(const k of z)for(const P of k.vertices)isFinite(P[0])&&(P[0]<gt&&(gt=P[0]),P[0]>Ut&&(Ut=P[0])),isFinite(P[1])&&(P[1]<tt&&(tt=P[1]),P[1]>ct&&(ct=P[1]));if(g)for(const k of g){const P=k.width/2;for(let it=0;it<k.x.length;it++){const rt=k.x[it];isFinite(rt)&&(rt-P<gt&&(gt=rt-P),rt+P>Ut&&(Ut=rt+P));const _t=k.y[it];isFinite(_t)&&(_t<tt&&(tt=_t),_t>ct&&(ct=_t))}0<tt&&(tt=0),0>ct&&(ct=0)}if(S)for(const k of S){const P=k.width/2;for(let it=0;it<k.x.length;it++){const rt=k.x[it];isFinite(rt)&&(rt-P<tt&&(tt=rt-P),rt+P>ct&&(ct=rt+P));const _t=k.y[it];isFinite(_t)&&(_t<gt&&(gt=_t),_t>Ut&&(Ut=_t))}0<gt&&(gt=0),0>Ut&&(Ut=0)}if(b)for(const k of b)for(let P=0;P<k.x.length;P++){const it=k.x[P],rt=k.y[P];if(isFinite(it)){const _t=k.xNeg?it-k.xNeg[P]:it,At=k.xPos?it+k.xPos[P]:it;_t<gt&&(gt=_t),At>Ut&&(Ut=At)}if(isFinite(rt)){const _t=rt-k.yNeg[P],At=rt+k.yPos[P];_t<tt&&(tt=_t),At>ct&&(ct=At)}}if(R)for(const k of R){const P=k.width/2;k.x-P<gt&&(gt=k.x-P),k.x+P>Ut&&(Ut=k.x+P),k.whiskerLow<tt&&(tt=k.whiskerLow),k.whiskerHigh>ct&&(ct=k.whiskerHigh);for(const it of k.outliers)it<tt&&(tt=it),it>ct&&(ct=it)}if(w&&w.length>0){const k=D??0;k<tt&&(tt=k),k>ct&&(ct=k);const P=w[0].x.length;for(let it=0;it<P;it++){let rt=k;for(const _t of w)if(it<_t.x.length){const At=_t.x[it];isFinite(At)&&(At<gt&&(gt=At),At>Ut&&(Ut=At)),rt+=_t.y[it]-k,isFinite(rt)&&(rt<tt&&(tt=rt),rt>ct&&(ct=rt))}}}if(et)for(const k of et)for(let P=0;P<k.x.length;P++){const it=k.x[P],rt=k.y[P],_t=it+k.u[P],At=rt+k.v[P];isFinite(it)&&(it<gt&&(gt=it),it>Ut&&(Ut=it)),isFinite(_t)&&(_t<gt&&(gt=_t),_t>Ut&&(Ut=_t)),isFinite(rt)&&(rt<tt&&(tt=rt),rt>ct&&(ct=rt)),isFinite(At)&&(At<tt&&(tt=At),At>ct&&(ct=At))}if(!isFinite(gt))return;Ut===gt&&(gt-=1,Ut+=1),ct===tt&&(tt-=1,ct+=1);const qt=v?.includes("image")??!1,Xt=(v?.includes("tight")??!1)||qt,oe=(v?.includes("equal")??!1)||qt,de=v?.includes("square")??!1,Yt=v?.includes("padded")??!1,se=ot!==!1,X=nt==="reverse",ce=_==="semilogx"||_==="loglog",Jt=_==="semilogy"||_==="loglog";if(ce&><=0&&(gt=Ut>0?Ut*1e-6:1),Jt&&tt<=0&&(tt=ct>0?ct*1e-6:1),!Xt){const k=Yt?.07:.05;if(ce){const P=(Math.log10(Ut)-Math.log10(gt))*k;gt=Math.pow(10,Math.log10(gt)-P),Ut=Math.pow(10,Math.log10(Ut)+P)}else{const P=(Ut-gt)*k;gt-=P,Ut+=P}if(Jt){const P=(Math.log10(ct)-Math.log10(tt))*k;tt=Math.pow(10,Math.log10(tt)-P),ct=Math.pow(10,Math.log10(ct)+P)}else{const P=(ct-tt)*k;tt-=P,ct+=P}}H&&(H[0]!=null&&(gt=H[0]),H[1]!=null&&(Ut=H[1])),q&&(q[0]!=null&&(tt=q[0]),q[1]!=null&&(ct=q[1])),Ut===gt&&(gt-=1,Ut+=1),ct===tt&&(tt-=1,ct+=1);let ne=st,Pt=Et,O=wt.left,E=wt.top;if(oe){const k=Ut-gt,P=ct-tt,it=k/st,rt=P/Et;if(Xt)it>rt?(Pt=P/it,E=wt.top+(Et-Pt)/2):(ne=k/rt,O=wt.left+(st-ne)/2);else if(it>rt){const _t=it*Et,At=(tt+ct)/2;tt=At-_t/2,ct=At+_t/2}else{const _t=rt*st,At=(gt+Ut)/2;gt=At-_t/2,Ut=At+_t/2}}else if(de){const k=Math.min(st,Et);O=wt.left+(st-k)/2,E=wt.top+(Et-k)/2,ne=k,Pt=k}const V=ce?k=>{const P=Math.log10(Math.max(k,Number.MIN_VALUE)),it=Math.log10(Math.max(gt,Number.MIN_VALUE)),rt=Math.log10(Math.max(Ut,Number.MIN_VALUE));return O+(P-it)/(rt-it)*ne}:k=>O+(k-gt)/(Ut-gt)*ne,$=Jt?k=>{const P=Math.log10(Math.max(k,Number.MIN_VALUE)),it=Math.log10(Math.max(tt,Number.MIN_VALUE)),rt=Math.log10(Math.max(ct,Number.MIN_VALUE)),_t=(P-it)/(rt-it);return X?E+_t*Pt:E+Pt-_t*Pt}:k=>{const P=(k-tt)/(ct-tt);return X?E+P*Pt:E+Pt-P*Pt};if(f!==!1&&se){A.strokeStyle="#ddd",A.lineWidth=.5;const k=ce?xu(gt,Ut):_u(gt,Ut,Math.max(3,Math.floor(ne/80))),P=Jt?xu(tt,ct):_u(tt,ct,Math.max(3,Math.floor(Pt/50)));for(const it of k){const rt=V(it);A.beginPath(),A.moveTo(rt,E),A.lineTo(rt,E+Pt),A.stroke()}for(const it of P){const rt=$(it);A.beginPath(),A.moveTo(O,rt),A.lineTo(O+ne,rt),A.stroke()}}if(se){A.strokeStyle="#333",A.lineWidth=1,Y===!1?(A.beginPath(),A.moveTo(O,E),A.lineTo(O,E+Pt),A.lineTo(O+ne,E+Pt),A.stroke()):A.strokeRect(O,E,ne,Pt);const k=ce?xu(gt,Ut):_u(gt,Ut,Math.max(3,Math.floor(ne/80))),P=Jt?xu(tt,ct):_u(tt,ct,Math.max(3,Math.floor(Pt/50)));A.fillStyle="#333",A.font="11px monospace",A.textAlign="center",A.textBaseline="top";for(const it of k)A.fillText(ce?ax(it):nx(it),V(it),E+Pt+5);A.textAlign="right",A.textBaseline="middle";for(const it of P)A.fillText(Jt?ax(it):nx(it),O-5,$(it))}if(A.fillStyle="#222",i&&(A.font="bold 13px sans-serif",A.textAlign="center",A.textBaseline="middle",A.fillText(i,O+ne/2,E/2)),s&&se&&(A.font="12px sans-serif",A.textAlign="center",A.textBaseline="bottom",A.fillText(s,O+ne/2,Mt-4)),l&&se&&(A.font="12px sans-serif",A.textAlign="center",A.textBaseline="middle",A.save(),A.translate(14,E+Pt/2),A.rotate(-Math.PI/2),A.fillText(l,0,0),A.restore()),A.save(),A.beginPath(),A.rect(O,E,ne,Pt),A.clip(),d&&ER(A,d,V,$,p),C)for(const k of C)DR(A,k,V,$,p,G,T);if(m)for(const k of m)TR(A,k,V,$,p);if(z)for(const k of z)CR(A,k,V,$,p,T);if(g){const k=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188]];for(let P=0;P<g.length;P++){const it=g[P],[rt,_t,At]=it.color??k[P%k.length];A.fillStyle=`rgb(${Math.round(rt*255)},${Math.round(_t*255)},${Math.round(At*255)})`,A.strokeStyle=`rgb(${Math.round(rt*180)},${Math.round(_t*180)},${Math.round(At*180)})`,A.lineWidth=1;const xt=$(0);for(let St=0;St<it.x.length;St++){const Nt=V(it.x[St]),Lt=$(it.y[St]),It=(V(it.x[St]+it.width)-V(it.x[St]))/2;A.fillRect(Nt-It,Math.min(Lt,xt),It*2,Math.abs(Lt-xt)),A.strokeRect(Nt-It,Math.min(Lt,xt),It*2,Math.abs(Lt-xt))}}}if(S){const k=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188]];for(let P=0;P<S.length;P++){const it=S[P],[rt,_t,At]=it.color??k[P%k.length];A.fillStyle=`rgb(${Math.round(rt*255)},${Math.round(_t*255)},${Math.round(At*255)})`,A.strokeStyle=`rgb(${Math.round(rt*180)},${Math.round(_t*180)},${Math.round(At*180)})`,A.lineWidth=1;const xt=V(0);for(let St=0;St<it.x.length;St++){const Nt=$(it.x[St]),Lt=V(it.y[St]),It=($(it.x[St]-it.width)-$(it.x[St]))/2;A.fillRect(Math.min(xt,Lt),Nt-It,Math.abs(Lt-xt),It*2),A.strokeRect(Math.min(xt,Lt),Nt-It,Math.abs(Lt-xt),It*2)}}}if(R){const k=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188]];for(let P=0;P<R.length;P++){const it=R[P],[rt,_t,At]=it.color??k[P%k.length],xt=`rgba(${Math.round(rt*255)},${Math.round(_t*255)},${Math.round(At*255)},0.3)`,St=`rgb(${Math.round(rt*255)},${Math.round(_t*255)},${Math.round(At*255)})`,Nt=V(it.x),Lt=Math.abs(V(it.x+it.width)-V(it.x))/2,It=$(it.q1),$t=$(it.q3),j=$(it.median),zt=$(it.whiskerLow),Ft=$(it.whiskerHigh);A.fillStyle=xt,A.fillRect(Nt-Lt,Math.min(It,$t),Lt*2,Math.abs($t-It)),A.strokeStyle=St,A.lineWidth=1.5,A.strokeRect(Nt-Lt,Math.min(It,$t),Lt*2,Math.abs($t-It)),A.lineWidth=2,A.beginPath(),A.moveTo(Nt-Lt,j),A.lineTo(Nt+Lt,j),A.stroke(),A.lineWidth=1,A.setLineDash([4,2]),A.beginPath(),A.moveTo(Nt,$t),A.lineTo(Nt,Ft),A.moveTo(Nt,It),A.lineTo(Nt,zt),A.stroke(),A.setLineDash([]);const kt=Lt*.5;A.beginPath(),A.moveTo(Nt-kt,Ft),A.lineTo(Nt+kt,Ft),A.moveTo(Nt-kt,zt),A.lineTo(Nt+kt,zt),A.stroke(),A.fillStyle=St;for(const Ot of it.outliers){const bt=$(Ot);A.beginPath(),A.arc(Nt,bt,3,0,Math.PI*2),A.fill()}}}if(w&&w.length>0){const k=D??0,P=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188],[.301,.745,.933],[.635,.078,.184]],it=w[0].x.length,rt=[],_t=[];let At=new Array(it).fill(k);for(let xt=0;xt<w.length;xt++){const St=w[xt];rt.push([...At]);const Nt=[];for(let Lt=0;Lt<it;Lt++)Nt.push(At[Lt]+(Lt<St.y.length?St.y[Lt]-k:0));_t.push(Nt),At=Nt}for(let xt=w.length-1;xt>=0;xt--){const St=w[xt],[Nt,Lt,It]=St.color??P[xt%P.length];A.fillStyle=`rgba(${Math.round(Nt*255)},${Math.round(Lt*255)},${Math.round(It*255)},0.6)`,A.beginPath();for(let $t=0;$t<it;$t++){const j=V(St.x[$t]),zt=$(_t[xt][$t]);$t===0?A.moveTo(j,zt):A.lineTo(j,zt)}for(let $t=it-1;$t>=0;$t--)A.lineTo(V(St.x[$t]),$(rt[xt][$t]));A.closePath(),A.fill(),A.strokeStyle=`rgb(${Math.round(Nt*255)},${Math.round(Lt*255)},${Math.round(It*255)})`,A.lineWidth=1,A.beginPath();for(let $t=0;$t<it;$t++){const j=V(St.x[$t]),zt=$(_t[xt][$t]);$t===0?A.moveTo(j,zt):A.lineTo(j,zt)}A.stroke()}}if(b)for(let k=0;k<b.length;k++){const P=b[k],it=P.color?`rgb(${Math.round(P.color[0]*255)},${Math.round(P.color[1]*255)},${Math.round(P.color[2]*255)})`:Pp({},k);A.strokeStyle=it,A.fillStyle=it,A.lineWidth=(P.lineWidth??1)*lt;const rt=3*lt;A.beginPath();for(let _t=0;_t<P.x.length;_t++){const At=V(P.x[_t]),xt=$(P.y[_t]);_t===0?A.moveTo(At,xt):A.lineTo(At,xt)}A.stroke();for(let _t=0;_t<P.x.length;_t++){const At=V(P.x[_t]),xt=$(P.y[_t]),St=$(P.y[_t]-P.yNeg[_t]),Nt=$(P.y[_t]+P.yPos[_t]);if(A.beginPath(),A.moveTo(At,St),A.lineTo(At,Nt),A.stroke(),A.beginPath(),A.moveTo(At-rt,St),A.lineTo(At+rt,St),A.stroke(),A.beginPath(),A.moveTo(At-rt,Nt),A.lineTo(At+rt,Nt),A.stroke(),P.xNeg&&P.xPos){const Lt=V(P.x[_t]-P.xNeg[_t]),It=V(P.x[_t]+P.xPos[_t]);A.beginPath(),A.moveTo(Lt,xt),A.lineTo(It,xt),A.stroke(),A.beginPath(),A.moveTo(Lt,xt-rt),A.lineTo(Lt,xt+rt),A.stroke(),A.beginPath(),A.moveTo(It,xt-rt),A.lineTo(It,xt+rt),A.stroke()}A.beginPath(),A.arc(At,xt,2*lt,0,2*Math.PI),A.fill()}}et&&yR(A,et,V,$,lt);for(let k=0;k<t.length;k++){const P=t[k],it=Pp(P,k);if(P.lineStyle!=="none"){A.strokeStyle=it,A.lineWidth=P.lineWidth??2,A.lineJoin="round",A.setLineDash(Wu(P.lineStyle)),A.beginPath();let rt=!1;for(let _t=0;_t<P.x.length;_t++){const At=P.x[_t],xt=P.y[_t];if(!isFinite(At)||!isFinite(xt)){rt=!1;continue}const St=V(At),Nt=$(xt);rt?A.lineTo(St,Nt):(A.moveTo(St,Nt),rt=!0)}A.stroke(),A.setLineDash([])}P.marker&&jx(A,P,V,$,it)}if(A.restore(),c&&c.length>0&&_R(A,t,c,O+ne,E),B){const k=T??UR(C,d,m,z);k&&LR(A,Bt,O,E,ne,Pt,k[0],k[1],p)}}const sx=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188]];function xR(a){return`rgb(${Math.round(a[0]*255)},${Math.round(a[1]*255)},${Math.round(a[2]*255)})`}function yR(a,t,i,s,l){for(let c=0;c<t.length;c++){const f=t[c],d=f.color??sx[c%sx.length],m=xR(d),p=(f.lineWidth??.5)*l*2;a.strokeStyle=m,a.fillStyle=m,a.lineWidth=p,a.lineJoin="round",a.lineCap="round",a.setLineDash(Wu(f.lineStyle));const v=f.x.length;for(let _=0;_<v;_++){const g=f.x[_],S=f.y[_],b=f.u[_],R=f.v[_];if(!isFinite(g)||!isFinite(S)||!isFinite(b)||!isFinite(R))continue;const x=g+b,y=S+R,w=i(g),D=s(S),C=i(x),G=s(y);if(a.beginPath(),a.moveTo(w,D),a.lineTo(C,G),a.stroke(),f.showArrowHead){const B=C-w,F=G-D,T=Math.sqrt(B*B+F*F);if(T>1){const U=Math.min(T*.3,12*l),et=Math.PI/9,H=Math.atan2(F,B),q=C-U*Math.cos(H-et),nt=G-U*Math.sin(H-et),ot=C-U*Math.cos(H+et),Y=G-U*Math.sin(H+et);a.beginPath(),a.moveTo(q,nt),a.lineTo(C,G),a.lineTo(ot,Y),a.stroke()}}if(f.marker){const B=3*l;a.beginPath(),a.arc(w,D,B,0,Math.PI*2),f.markerFilled?a.fill():a.stroke()}}a.setLineDash([])}}let Cu;function Ha(a,t){const i=Math.max(0,Math.min(1,a));if(Cu&&Cu.length>0){const s=Cu,l=s.length;if(l===1)return s[0];const c=i*(l-1),f=Math.floor(c),d=Math.min(f+1,l-1),m=c-f;return[s[f][0]+m*(s[d][0]-s[f][0]),s[f][1]+m*(s[d][1]-s[f][1]),s[f][2]+m*(s[d][2]-s[f][2])]}return t==="jet"?MR(i):t==="redblue"?bR(i):SR(i)}function SR(a){if(a<.5){const i=a*2;return[.2*(1-i),.1+.6*i,.9-.3*i]}const t=(a-.5)*2;return[.2+.8*t,.7+.3*t,.6-.5*t]}function MR(a){let t,i,s;return a<.125?(t=0,i=0,s=.5+a*4):a<.375?(t=0,i=(a-.125)*4,s=1):a<.625?(t=(a-.375)*4,i=1,s=1-(a-.375)*4):a<.875?(t=1,i=1-(a-.625)*4,s=0):(t=1-(a-.875)*4,i=0,s=0),[Math.max(0,Math.min(1,t)),Math.max(0,Math.min(1,i)),Math.max(0,Math.min(1,s))]}function bR(a){if(a<.5){const i=a*2;return[i,i,1]}const t=(a-.5)*2;return[1,1-t,1-t]}function ER(a,t,i,s,l){const{rows:c,cols:f,z:d,x:m,y:p}=t;if(c===0||f===0)return;let v=1/0,_=-1/0;for(const R of d)isFinite(R)&&(R<v&&(v=R),R>_&&(_=R));if(!isFinite(v))return;const g=_-v||1,S=(m[1]-m[0])/f,b=(p[1]-p[0])/c;for(let R=0;R<f;R++)for(let x=0;x<c;x++){const w=(d[R*c+x]-v)/g,[D,C,G]=Ha(w,l),B=i(m[0]+R*S),F=s(p[0]+(x+1)*b),T=i(m[0]+(R+1)*S),U=s(p[0]+x*b);a.fillStyle=`rgb(${Math.round(D*255)},${Math.round(C*255)},${Math.round(G*255)})`,a.fillRect(B,F,T-B,U-F)}}function TR(a,t,i,s,l){const{rows:c,cols:f,z:d,x:m,y:p,nLevels:v,filled:_}=t;if(c<2||f<2)return;let g=1/0,S=-1/0;for(const D of d)isFinite(D)&&(D<g&&(g=D),D>S&&(S=D));if(!isFinite(g))return;const b=S-g||1;let R;if(t.levels&&t.levels.length>0)R=[g-b,...t.levels,S+b];else{R=[];for(let D=0;D<=v;D++)R.push(g+D/v*b)}const x=(D,C)=>d[C*c+D],y=(D,C)=>m[C*c+D],w=(D,C)=>p[C*c+D];if(_)for(let D=0;D<f-1;D++)for(let C=0;C<c-1;C++){const B=((x(C,D)+x(C+1,D)+x(C,D+1)+x(C+1,D+1))/4-g)/b,[F,T,U]=Ha(B,l),et=i(y(C,D)),H=s(w(C,D)),q=i(y(C+1,D+1)),nt=s(w(C+1,D+1));a.fillStyle=`rgb(${Math.round(F*255)},${Math.round(T*255)},${Math.round(U*255)})`,a.fillRect(Math.min(et,q),Math.min(H,nt),Math.abs(q-et)||1,Math.abs(nt-H)||1)}else for(let D=1;D<R.length-1;D++){const C=R[D],G=(C-g)/b,[B,F,T]=Ha(G,l);a.strokeStyle=`rgb(${Math.round(B*255)},${Math.round(F*255)},${Math.round(T*255)})`,a.lineWidth=t.lineWidth??1;for(let U=0;U<f-1;U++)for(let et=0;et<c-1;et++){const H=x(et,U),q=x(et+1,U),nt=x(et,U+1),ot=x(et+1,U+1),Y=y(et,U),z=w(et,U),A=y(et+1,U),ht=w(et+1,U),lt=y(et,U+1),Ct=w(et,U+1),I=y(et+1,U+1),K=w(et+1,U+1),Mt=AR(H,q,nt,ot,Y,z,A,ht,lt,Ct,I,K,C);for(const wt of Mt)a.beginPath(),a.moveTo(i(wt[0]),s(wt[1])),a.lineTo(i(wt[2]),s(wt[3])),a.stroke()}}}function AR(a,t,i,s,l,c,f,d,m,p,v,_,g){const S=a>=g?1:0,b=t>=g?1:0,R=i>=g?1:0,x=s>=g?1:0,y=S|b<<1|R<<2|x<<3;if(y===0||y===15)return[];const w=(q,nt,ot,Y)=>{const z=(g-ot)/(Y-ot||1);return q+z*(nt-q)},D=w(l,f,a,t),C=w(c,d,a,t),G=w(f,v,t,s),B=w(d,_,t,s),F=w(m,v,i,s),T=w(p,_,i,s),U=w(l,m,a,i),et=w(c,p,a,i),H=[];switch(y){case 1:case 14:H.push([D,C,U,et]);break;case 2:case 13:H.push([D,C,G,B]);break;case 3:case 12:H.push([U,et,G,B]);break;case 4:case 11:H.push([U,et,F,T]);break;case 5:case 10:H.push([D,C,F,T]);break;case 6:case 9:H.push([D,C,U,et]),H.push([F,T,G,B]);break;case 7:case 8:H.push([F,T,G,B]);break}return H}const rx=[[0,.447,.741],[.85,.325,.098],[.929,.694,.125],[.494,.184,.556],[.466,.674,.188],[.301,.745,.933],[.635,.078,.184]];function RR(a,t,i,s,l){const c=s.values.reduce((S,b)=>S+b,0);if(c<=0)return;const f=l?36:0,d=60,m=t/2,p=f+(i-f)/2,v=Math.min(t/2-d,(i-f)/2-d);if(v<=0)return;const _=v*s.innerRadius;l&&(a.font="bold 14px sans-serif",a.fillStyle="#000",a.textAlign="center",a.textBaseline="top",a.fillText(l,m,10));let g=-Math.PI/2;for(let S=0;S<s.values.length;S++){const b=s.values[S]/c*2*Math.PI,R=g+b,[x,y,w]=s.colors?.[S]??rx[S%rx.length];a.beginPath(),_>0?(a.arc(m,p,v,g,R),a.arc(m,p,_,R,g,!0)):(a.moveTo(m,p),a.arc(m,p,v,g,R),a.closePath()),a.fillStyle=`rgb(${Math.round(x*255)},${Math.round(y*255)},${Math.round(w*255)})`,a.fill(),a.strokeStyle="#fff",a.lineWidth=2,a.stroke();const D=g+b/2,C=(s.values[S]/c*100).toFixed(1)+"%",G=v+16,B=m+G*Math.cos(D),F=p+G*Math.sin(D);a.font="12px sans-serif",a.fillStyle="#333",a.textAlign=D>Math.PI/2||D<-Math.PI/2?"right":"left",a.textBaseline="middle";const T=s.names?.[S]?`${s.names[S]} (${C})`:C;a.fillText(T,B,F),g=R}}function wR(a,t,i,s,l,c){const{data:f,rows:d,cols:m}=s;if(d===0||m===0)return;let p=1/0,v=-1/0;for(const Y of f)isFinite(Y)&&(Y<p&&(p=Y),Y>v&&(v=Y));if(!isFinite(p))return;const _=v-p||1;a.font="12px sans-serif";const g=s.yLabels??Array.from({length:d},(Y,z)=>String(z+1)),S=s.xLabels??Array.from({length:m},(Y,z)=>String(z+1));let b=0;for(const Y of g){const z=a.measureText(Y).width;z>b&&(b=z)}const R=l?30:10,x=24,y=b+12,w=50,D=y,C=R,G=t-D-w,B=i-C-x;if(G<=0||B<=0)return;const F=G/m,T=B/d;l&&(a.font="bold 14px sans-serif",a.fillStyle="#000",a.textAlign="center",a.textBaseline="top",a.fillText(l,t/2,8));const U=Math.max(8,Math.min(14,Math.min(F,T)*.35));a.font=`${U}px sans-serif`,a.textAlign="center",a.textBaseline="middle";for(let Y=0;Y<m;Y++)for(let z=0;z<d;z++){const A=f[Y*d+z],ht=D+Y*F,lt=C+z*T,Ct=isFinite(A)?(A-p)/_:0,[I,K,Mt]=Ha(Ct,c);if(a.fillStyle=`rgb(${Math.round(I*255)},${Math.round(K*255)},${Math.round(Mt*255)})`,a.fillRect(ht,lt,F,T),a.strokeStyle="#fff",a.lineWidth=1,a.strokeRect(ht,lt,F,T),isFinite(A)&&F>16&&T>12){const wt=I*.299+K*.587+Mt*.114;a.fillStyle=wt>.5?"#000":"#fff";const Bt=Number.isInteger(A)?String(A):A.toFixed(2);a.fillText(Bt,ht+F/2,lt+T/2)}}a.font="11px sans-serif",a.fillStyle="#333",a.textAlign="center",a.textBaseline="top";for(let Y=0;Y<m;Y++)a.fillText(S[Y]??"",D+Y*F+F/2,C+B+4);a.textAlign="right",a.textBaseline="middle";for(let Y=0;Y<d;Y++)a.fillText(g[Y]??"",D-6,C+Y*T+T/2);const et=D+G+10,H=16,q=C,nt=B,ot=Math.max(1,Math.round(nt));for(let Y=0;Y<ot;Y++){const z=1-Y/ot,[A,ht,lt]=Ha(z,c);a.fillStyle=`rgb(${Math.round(A*255)},${Math.round(ht*255)},${Math.round(lt*255)})`,a.fillRect(et,q+Y/ot*nt,H,nt/ot+1)}a.strokeStyle="#999",a.lineWidth=1,a.strokeRect(et,q,H,nt),a.font="10px sans-serif",a.fillStyle="#333",a.textAlign="left",a.textBaseline="top",a.fillText(sa(v),et+H+4,q),a.textBaseline="bottom",a.fillText(sa(p),et+H+4,q+nt)}function sa(a){return Number.isInteger(a)?String(a):a.toPrecision(3)}function CR(a,t,i,s,l,c){const{vertices:f,faces:d}=t;if(!d||d.length===0||f.length===0)return;const m=t.faceVertexCData;let p=1/0,v=-1/0;if(c)[p,v]=c;else if(m)for(const C of m)typeof C=="number"&&isFinite(C)&&(C<p&&(p=C),C>v&&(v=C));const _=isFinite(p)&&v>p?v-p:1,g=C=>{if(Array.isArray(C))return C;if(typeof C!="number")return[0,0,0];const G=isFinite(p)?(C-p)/_:.5;return Ha(G,l)},S=C=>m?g(m[Math.min(Math.max(C,0),m.length-1)]):void 0,b=C=>`rgb(${Math.round(C[0]*255)},${Math.round(C[1]*255)},${Math.round(C[2]*255)})`,R=t.faceColor??"none",x=t.edgeColor??[0,0,0],y=t.faceAlpha??1,w=t.lineWidth??.5,D=t.lineStyle??"-";a.save();for(let C=0;C<d.length;C++){const G=d[C];if(G.length===0)continue;const B=G.map(U=>f[U]).filter(Boolean),F=B.every(U=>isFinite(U[0])&&isFinite(U[1]));let T=null;if(R==="none")T=null;else if(Array.isArray(R))T=R;else if(R==="flat"){const U=m&&m.length===d.length?C:G[0];T=S(U)??[0,0,0]}else if(R==="interp"){let U=0,et=0,H=0,q=0;for(const nt of G){const ot=S(nt);ot&&(U+=ot[0],et+=ot[1],H+=ot[2],q++)}T=q?[U/q,et/q,H/q]:[0,0,0]}if(T&&F&&(a.globalAlpha=y,a.fillStyle=b(T),a.beginPath(),B.forEach((U,et)=>{const H=i(U[0]),q=s(U[1]);et===0?a.moveTo(H,q):a.lineTo(H,q)}),a.closePath(),a.fill(),a.globalAlpha=1),x!=="none"&&D!=="none"){if(a.lineWidth=w,a.setLineDash(Wu(D)),Array.isArray(x)){a.strokeStyle=b(x),a.beginPath();let U=!1;for(const et of G){const H=f[et];if(!H||!isFinite(H[0])||!isFinite(H[1])){U=!1;continue}const q=i(H[0]),nt=s(H[1]);U?a.lineTo(q,nt):(a.moveTo(q,nt),U=!0)}F&&a.closePath(),a.stroke()}else{const U=F?G.length:G.length-1;for(let et=0;et<U;et++){const H=f[G[et]],q=f[G[(et+1)%G.length]];if(!H||!q||!isFinite(H[0])||!isFinite(H[1])||!isFinite(q[0])||!isFinite(q[1]))continue;const nt=S(G[et])??[0,0,0],ot=i(H[0]),Y=s(H[1]),z=i(q[0]),A=s(q[1]);if(x==="interp"){const ht=S(G[(et+1)%G.length])??nt,lt=a.createLinearGradient(ot,Y,z,A);lt.addColorStop(0,b(nt)),lt.addColorStop(1,b(ht)),a.strokeStyle=lt}else a.strokeStyle=b(nt);a.beginPath(),a.moveTo(ot,Y),a.lineTo(z,A),a.stroke()}}a.setLineDash([])}if(t.marker&&t.marker!=="none"){const U=t.markerFaceColor==="flat"?T??void 0:Array.isArray(t.markerFaceColor)?t.markerFaceColor:void 0,et={x:B.map(q=>q[0]),y:B.map(q=>q[1]),marker:t.marker,...U?{markerFaceColor:U}:{}},H=Array.isArray(x)?b(x):"rgb(0,0,0)";jx(a,et,i,s,H)}}a.restore()}function DR(a,t,i,s,l,c,f){const d=c??"faceted";if(d==="interp"){ox(a,t,i,s,l,!1,f);return}ox(a,t,i,s,l,d==="faceted",f)}function ox(a,t,i,s,l,c,f){const{rows:d,cols:m,x:p,y:v,c:_}=t;if(d<2||m<2)return;let g,S;if(f)[g,S]=f;else{g=1/0,S=-1/0;for(const x of _)isFinite(x)&&(x<g&&(g=x),x>S&&(S=x))}if(!isFinite(g))return;const b=S-g||1,R=t.faceAlpha??1;a.save(),R<1&&(a.globalAlpha=R);for(let x=0;x<m-1;x++)for(let y=0;y<d-1;y++){const w=x*d+y,D=x*d+(y+1),C=(x+1)*d+y,G=(x+1)*d+(y+1),B=_[w];if(!isFinite(B))continue;const F=(B-g)/b,[T,U,et]=Ha(F,l),H=`rgb(${Math.round(T*255)},${Math.round(U*255)},${Math.round(et*255)})`,q=i(p[w]),nt=s(v[w]),ot=i(p[D]),Y=s(v[D]),z=i(p[G]),A=s(v[G]),ht=i(p[C]),lt=s(v[C]);if(a.beginPath(),a.moveTo(q,nt),a.lineTo(ot,Y),a.lineTo(z,A),a.lineTo(ht,lt),a.closePath(),a.fillStyle=H,a.fill(),c&&t.edgeColor!=="none"){if(Array.isArray(t.edgeColor)){const[Ct,I,K]=t.edgeColor;a.strokeStyle=`rgb(${Math.round(Ct*255)},${Math.round(I*255)},${Math.round(K*255)})`}else a.strokeStyle="rgba(0,0,0,0.3)";a.lineWidth=.5,a.stroke()}else t.edgeColor==="none"&&(a.strokeStyle=H,a.lineWidth=1,a.stroke())}a.restore()}function UR(a,t,i,s){let l=1/0,c=-1/0;const f=d=>{for(const m of d)isFinite(m)&&(m<l&&(l=m),m>c&&(c=m))};if(a)for(const d of a)f(d.c);if(t&&f(t.z),i)for(const d of i)f(d.z);if(s){for(const d of s)if(d.faceVertexCData)for(const m of d.faceVertexCData)typeof m=="number"&&f([m])}return!isFinite(l)||!isFinite(c)?null:(l===c&&(l-=.5,c+=.5),[l,c])}function LR(a,t,i,s,l,c,f,d,m){switch(t){case"eastoutside":{const g=i+l+10;yu(a,g,s,16,c,f,d,m,"right");break}case"westoutside":{const g=i-10-16;yu(a,g,s,16,c,f,d,m,"left");break}case"northoutside":{const g=s-10-16;Su(a,i,g,l,16,f,d,m,"top");break}case"southoutside":{const g=s+c+10;Su(a,i,g,l,16,f,d,m,"bottom");break}case"east":{const g=i+l-8-16;yu(a,g,s+8,16,c-16,f,d,m,"left");break}case"west":{const g=i+8;yu(a,g,s+8,16,c-16,f,d,m,"right");break}case"north":{const g=s+8;Su(a,i+8,g,l-16,16,f,d,m,"bottom");break}case"south":{const g=s+c-8-16;Su(a,i+8,g,l-16,16,f,d,m,"top");break}}}function yu(a,t,i,s,l,c,f,d,m){const p=Math.max(1,Math.round(l));for(let v=0;v<p;v++){const _=1-v/p,[g,S,b]=Ha(_,d);a.fillStyle=`rgb(${Math.round(g*255)},${Math.round(S*255)},${Math.round(b*255)})`,a.fillRect(t,i+v/p*l,s,l/p+1)}a.strokeStyle="#999",a.lineWidth=1,a.strokeRect(t,i,s,l),a.font="10px sans-serif",a.fillStyle="#333",m==="right"?(a.textAlign="left",a.textBaseline="top",a.fillText(sa(f),t+s+4,i),a.textBaseline="bottom",a.fillText(sa(c),t+s+4,i+l)):(a.textAlign="right",a.textBaseline="top",a.fillText(sa(f),t-4,i),a.textBaseline="bottom",a.fillText(sa(c),t-4,i+l))}function Su(a,t,i,s,l,c,f,d,m){const p=Math.max(1,Math.round(s));for(let v=0;v<p;v++){const _=v/p,[g,S,b]=Ha(_,d);a.fillStyle=`rgb(${Math.round(g*255)},${Math.round(S*255)},${Math.round(b*255)})`,a.fillRect(t+v/p*s,i,s/p+1,l)}a.strokeStyle="#999",a.lineWidth=1,a.strokeRect(t,i,s,l),a.font="10px sans-serif",a.fillStyle="#333",m==="bottom"?(a.textBaseline="top",a.textAlign="left",a.fillText(sa(c),t,i+l+4),a.textAlign="right",a.fillText(sa(f),t+s,i+l+4)):(a.textBaseline="bottom",a.textAlign="left",a.fillText(sa(c),t,i-4),a.textAlign="right",a.fillText(sa(f),t+s,i-4))}function lx(a){return JSON.stringify(a).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function NR(a,t,i){const s=t===void 0?"null":lx(t),c=`
|
|
4427
|
+
<script>
|
|
4428
|
+
(function () {
|
|
4429
|
+
var COMP_ID = ${i===void 0?"null":lx(i)};
|
|
4430
|
+
var _data;
|
|
4431
|
+
var _listeners = Object.create(null);
|
|
4432
|
+
function _emit(name, ev) {
|
|
4433
|
+
var arr = _listeners[name];
|
|
4434
|
+
if (!arr) return;
|
|
4435
|
+
arr.slice().forEach(function (fn) {
|
|
4436
|
+
try { fn(ev); } catch (e) { console.error(e); }
|
|
4437
|
+
});
|
|
4438
|
+
}
|
|
4439
|
+
function _post(msg) {
|
|
4440
|
+
try {
|
|
4441
|
+
msg.source = "numbl-uihtml";
|
|
4442
|
+
msg.compId = COMP_ID;
|
|
4443
|
+
if (window.parent) window.parent.postMessage(msg, "*");
|
|
4444
|
+
} catch (e) {}
|
|
4445
|
+
}
|
|
4446
|
+
var htmlComponent = {
|
|
4447
|
+
addEventListener: function (name, fn) {
|
|
4448
|
+
(_listeners[name] || (_listeners[name] = [])).push(fn);
|
|
4449
|
+
},
|
|
4450
|
+
removeEventListener: function (name, fn) {
|
|
4451
|
+
var arr = _listeners[name];
|
|
4452
|
+
if (!arr) return;
|
|
4453
|
+
var i = arr.indexOf(fn);
|
|
4454
|
+
if (i >= 0) arr.splice(i, 1);
|
|
4455
|
+
},
|
|
4456
|
+
sendEventToMATLAB: function (name, data) {
|
|
4457
|
+
_post({ kind: "htmlEvent", name: name, data: data });
|
|
4458
|
+
}
|
|
4459
|
+
};
|
|
4460
|
+
Object.defineProperty(htmlComponent, "Data", {
|
|
4461
|
+
get: function () { return _data; },
|
|
4462
|
+
set: function (v) {
|
|
4463
|
+
_data = v;
|
|
4464
|
+
// JS -> MATLAB: fires DataChangedFcn (does NOT fire local DataChanged).
|
|
4465
|
+
_post({ kind: "dataChanged", data: v });
|
|
4466
|
+
},
|
|
4467
|
+
enumerable: true,
|
|
4468
|
+
configurable: true
|
|
4469
|
+
});
|
|
4470
|
+
function _pushData(v) {
|
|
4471
|
+
var prev = _data;
|
|
4472
|
+
_data = v;
|
|
4473
|
+
_emit("DataChanged", {
|
|
4474
|
+
Data: v, PreviousData: prev, Source: htmlComponent, EventName: "DataChanged"
|
|
4475
|
+
});
|
|
4476
|
+
}
|
|
4477
|
+
// MATLAB -> JS events (sendEventToHTMLSource) arrive as "numbl-host" messages.
|
|
4478
|
+
window.addEventListener("message", function (e) {
|
|
4479
|
+
var d = e.data;
|
|
4480
|
+
if (!d || d.source !== "numbl-host" || d.compId !== COMP_ID) return;
|
|
4481
|
+
var parsed;
|
|
4482
|
+
try { parsed = JSON.parse(d.dataJson); } catch (err) { parsed = d.dataJson; }
|
|
4483
|
+
_emit(d.name, {
|
|
4484
|
+
Data: parsed, Source: htmlComponent, EventName: d.name
|
|
4485
|
+
});
|
|
4486
|
+
});
|
|
4487
|
+
function boot() {
|
|
4488
|
+
if (typeof window.setup === "function") {
|
|
4489
|
+
try { window.setup(htmlComponent); } catch (e) { console.error(e); }
|
|
4490
|
+
}
|
|
4491
|
+
var payload = ${s};
|
|
4492
|
+
if (payload !== null) {
|
|
4493
|
+
var parsed;
|
|
4494
|
+
try { parsed = JSON.parse(payload); } catch (e) { parsed = payload; }
|
|
4495
|
+
_pushData(parsed);
|
|
4496
|
+
}
|
|
4497
|
+
}
|
|
4498
|
+
if (document.readyState === "loading") {
|
|
4499
|
+
document.addEventListener("DOMContentLoaded", boot);
|
|
4500
|
+
} else {
|
|
4501
|
+
boot();
|
|
4502
|
+
}
|
|
4503
|
+
})();
|
|
4504
|
+
<\/script>`,f=a.toLowerCase().lastIndexOf("</body>");return f===-1?a+c:a.slice(0,f)+c+a.slice(f)}class cx extends Pn.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,i){console.error("Axes render error:",t,i)}render(){return this.state.error?Zt.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:8,color:"#a00",fontFamily:"sans-serif",fontSize:12,textAlign:"center",boxSizing:"border-box"},children:["Plot render error: ",this.state.error.message]}):this.props.children}}function OR({figure:a}){const{subplotGrid:t,sgtitle:i,axes:s}=a;if(a.uihtml)return Zt.jsx("iframe",{title:`uihtml-${a.uihtml.id}`,srcDoc:NR(a.uihtml.html,a.uihtml.data,a.uihtml.id),style:{width:"100%",height:"100%",border:"none",display:"block"}},a.uihtml.id);const l=Object.keys(s).map(Number).sort((d,m)=>d-m);if(l.length===0)return null;if(!t){const d=s[l[0]];return d?Zt.jsx(cx,{children:Zt.jsx(ux,{axes:d})}):null}const{rows:c,cols:f}=t;return Zt.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[i&&Zt.jsx("div",{style:{textAlign:"center",fontWeight:"bold",fontSize:16,fontFamily:"sans-serif",padding:"8px 0 4px 0",flexShrink:0},children:i}),Zt.jsx("div",{style:{flex:1,display:"grid",gridTemplateRows:`repeat(${c}, 1fr)`,gridTemplateColumns:`repeat(${f}, 1fr)`,gap:4,padding:4,minHeight:0},children:Array.from({length:c*f},(d,m)=>{const p=m+1,v=s[p],_=Math.floor(m/f),g=m%f;return Zt.jsx("div",{style:{gridRow:_+1,gridColumn:g+1,minWidth:0,minHeight:0,overflow:"hidden"},children:v?Zt.jsx(cx,{children:Zt.jsx(ux,{axes:v})}):null},p)})})]})}function ux({axes:a}){return a.surfTraces&&a.surfTraces.length>0||a.plot3Traces&&a.plot3Traces.length>0||a.bar3Traces&&a.bar3Traces.length>0||a.bar3hTraces&&a.bar3hTraces.length>0||a.quiver3Traces&&a.quiver3Traces.length>0?Zt.jsx(hR,{surfTraces:a.surfTraces??[],plot3Traces:a.plot3Traces??[],bar3Traces:a.bar3Traces??[],bar3hTraces:a.bar3hTraces??[],quiver3Traces:a.quiver3Traces??[],shading:a.shading,colorbar:a.colorbar,colorbarLocation:a.colorbarLocation,colormap:a.colormap,axisVisible:a.axisVisible}):Zt.jsx(PR,{traces:a.traces,title:a.title,xlabel:a.xlabel,ylabel:a.ylabel,legend:a.legend,gridOn:a.gridOn,boxOn:a.boxOn,imagescTrace:a.imagescTrace,pcolorTraces:a.pcolorTraces,contourTraces:a.contourTraces,colormap:a.colormap,colormapData:a.colormapData,axisMode:a.axisMode,axisScale:a.axisScale,barTraces:a.barTraces,barhTraces:a.barhTraces,errorBarTraces:a.errorBarTraces,boxTraces:a.boxTraces,pieTrace:a.pieTrace,heatmapTrace:a.heatmapTrace,quiverTraces:a.quiverTraces,areaTraces:a.areaTraces,areaBaseValue:a.areaBaseValue,patchTraces:a.patchTraces,shading:a.shading,colorbar:a.colorbar,colorbarLocation:a.colorbarLocation,caxis:a.caxis,xlim:a.xlim,ylim:a.ylim,yDir:a.yDir,axisVisible:a.axisVisible})}function PR({traces:a,title:t,xlabel:i,ylabel:s,legend:l,gridOn:c,boxOn:f,imagescTrace:d,pcolorTraces:m,contourTraces:p,colormap:v,colormapData:_,axisMode:g,axisScale:S,barTraces:b,barhTraces:R,errorBarTraces:x,boxTraces:y,pieTrace:w,heatmapTrace:D,quiverTraces:C,areaTraces:G,areaBaseValue:B,patchTraces:F,shading:T,colorbar:U,colorbarLocation:et,caxis:H,xlim:q,ylim:nt,yDir:ot,axisVisible:Y}){const z=Pn.useRef(null),A=Pn.useRef(null),ht=Pn.useCallback(()=>{const lt=z.current;lt&&vR(lt,a,t,i,s,l,c,d,p,v,g,S,b,R,x,y,w,D,G,B,m,T,U,et,H,_,C,q,nt,ot,Y,f,F)},[a,t,i,s,l,c,d,p,v,_,g,S,b,R,x,y,w,D,G,B,m,T,U,et,H,C,q,nt,ot,Y,f,F]);return Pn.useEffect(()=>{const lt=z.current,Ct=A.current;if(!lt||!Ct)return;const I=new ResizeObserver(()=>{const K=Ct.getBoundingClientRect(),Mt=window.devicePixelRatio||1;lt.width=K.width*Mt,lt.height=K.height*Mt,lt.style.width=`${K.width}px`,lt.style.height=`${K.height}px`,ht()});return I.observe(Ct),()=>I.disconnect()},[ht]),Zt.jsx("div",{ref:A,style:{width:"100%",height:"100%"},children:Zt.jsx("canvas",{ref:z,style:{display:"block"}})})}const Du={holdOn:!1,traces:[],plot3Traces:[],surfTraces:[],pcolorTraces:[],contourTraces:[],barTraces:[],barhTraces:[],bar3Traces:[],bar3hTraces:[],errorBarTraces:[],boxTraces:[],quiverTraces:[],quiver3Traces:[],areaTraces:[],areaBaseValue:0,patchTraces:[]};function en(a){return a.axes[a.currentAxesIndex]||{...Du}}function tm(a,t){return{...a,axes:{...a.axes,[a.currentAxesIndex]:t}}}const Zx={currentHandle:1,figs:{}},Kx={currentAxesIndex:1,axes:{}};function je(a){return a.figs[a.currentHandle]||{...Kx}}function an(a,t){const i=je(a),s=en(i);return{...a,figs:{...a.figs,[a.currentHandle]:tm(i,{...s,...t})}}}function Rn(a,t){const i=je(a),s=en(i),l=s.holdOn;return{...a,figs:{...a.figs,[a.currentHandle]:tm(i,{...s,traces:t.traces??(l?s.traces:[]),plot3Traces:t.plot3Traces??(l?s.plot3Traces:[]),surfTraces:t.surfTraces??(l?s.surfTraces:[]),pcolorTraces:t.pcolorTraces??(l?s.pcolorTraces:[]),contourTraces:t.contourTraces??(l?s.contourTraces:[]),barTraces:t.barTraces??(l?s.barTraces:[]),barhTraces:t.barhTraces??(l?s.barhTraces:[]),bar3Traces:t.bar3Traces??(l?s.bar3Traces:[]),bar3hTraces:t.bar3hTraces??(l?s.bar3hTraces:[]),errorBarTraces:t.errorBarTraces??(l?s.errorBarTraces:[]),boxTraces:t.boxTraces??(l?s.boxTraces:[]),pieTrace:t.pieTrace??(l?s.pieTrace:void 0),heatmapTrace:t.heatmapTrace??(l?s.heatmapTrace:void 0),quiverTraces:t.quiverTraces??(l?s.quiverTraces:[]),quiver3Traces:t.quiver3Traces??(l?s.quiver3Traces:[]),areaTraces:t.areaTraces??(l?s.areaTraces:[]),areaBaseValue:t.areaBaseValue??s.areaBaseValue,patchTraces:t.patchTraces??(l?s.patchTraces:[]),...t.imagescTrace!==void 0?{imagescTrace:t.imagescTrace}:{}})}}}const zR=(a,t)=>{switch(t.type){case"set_figure_handle":return{...a,currentHandle:t.handle};case"uihtml":{const i=je(a);return{...a,figs:{...a.figs,[a.currentHandle]:{...i,uihtml:{id:t.id,html:t.html,data:t.data}}}}}case"set_hold":return an(a,{holdOn:t.value});case"plot":{const i=en(je(a));return Rn(a,{traces:i.holdOn?[...i.traces,...t.traces]:[...t.traces]})}case"plot3":{const i=en(je(a));return Rn(a,{plot3Traces:i.holdOn?[...i.plot3Traces,...t.traces]:[...t.traces]})}case"line":{const i=en(je(a));return an(a,{traces:[...i.traces,...t.traces]})}case"line3":{const i=en(je(a));return an(a,{plot3Traces:[...i.plot3Traces,...t.traces]})}case"patch":{const i=en(je(a));return an(a,{patchTraces:[...i.patchTraces,t.trace]})}case"update_trace":{const i=en(je(a)),s=l=>{let c=!1;const f=l.map(d=>d.id===t.id?(c=!0,{...d,...t.props}):d);return c?f:l};return an(a,{traces:s(i.traces),plot3Traces:s(i.plot3Traces),patchTraces:s(i.patchTraces)})}case"surf":{const i=en(je(a));return Rn(a,{surfTraces:i.holdOn?[...i.surfTraces,t.trace]:[t.trace]})}case"surface":{const i=en(je(a));return an(a,{surfTraces:[...i.surfTraces,t.trace]})}case"imagesc":return Rn(a,{imagescTrace:t.trace});case"pcolor":{const i=en(je(a));return Rn(a,{pcolorTraces:i.holdOn?[...i.pcolorTraces,t.trace]:[t.trace]})}case"contour":{const i=en(je(a));return Rn(a,{contourTraces:i.holdOn?[...i.contourTraces,t.trace]:[t.trace]})}case"mesh":{const i=en(je(a));return Rn(a,{surfTraces:i.holdOn?[...i.surfTraces,t.trace]:[t.trace]})}case"bar":{const i=en(je(a));return Rn(a,{barTraces:i.holdOn?[...i.barTraces,...t.traces]:[...t.traces]})}case"barh":{const i=en(je(a));return Rn(a,{barhTraces:i.holdOn?[...i.barhTraces,...t.traces]:[...t.traces]})}case"bar3":{const i=en(je(a));return Rn(a,{bar3Traces:i.holdOn?[...i.bar3Traces,t.trace]:[t.trace]})}case"bar3h":{const i=en(je(a));return Rn(a,{bar3hTraces:i.holdOn?[...i.bar3hTraces,t.trace]:[t.trace]})}case"errorbar":{const i=en(je(a));return Rn(a,{errorBarTraces:i.holdOn?[...i.errorBarTraces,...t.traces]:[...t.traces]})}case"boxchart":{const i=en(je(a));return Rn(a,{boxTraces:i.holdOn?[...i.boxTraces,...t.traces]:[...t.traces]})}case"piechart":return Rn(a,{pieTrace:t.trace});case"heatmap":return Rn(a,{heatmapTrace:t.trace});case"quiver":{const i=en(je(a));return Rn(a,{quiverTraces:i.holdOn?[...i.quiverTraces,...t.traces]:[...t.traces]})}case"quiver3":{const i=en(je(a));return Rn(a,{quiver3Traces:i.holdOn?[...i.quiver3Traces,t.trace]:[t.trace]})}case"area":{const i=en(je(a));return Rn(a,{areaTraces:i.holdOn?[...i.areaTraces,...t.traces]:[...t.traces],areaBaseValue:t.baseValue})}case"close":{const i=Object.fromEntries(Object.entries(a.figs).filter(([l])=>Number(l)!==a.currentHandle)),s=Object.keys(i).map(Number).sort((l,c)=>l-c);return{...a,currentHandle:s.length>0?s[s.length-1]:1,figs:i}}case"close_all":case"clear":return Zx;case"set_title":return an(a,{title:t.text});case"set_xlabel":return an(a,{xlabel:t.text});case"set_ylabel":return an(a,{ylabel:t.text});case"set_zlabel":return an(a,{zlabel:t.text});case"set_shading":return an(a,{shading:t.shading});case"set_legend":return an(a,{legend:t.labels});case"set_sgtitle":{const i=je(a);return{...a,figs:{...a.figs,[a.currentHandle]:{...i,sgtitle:t.text}}}}case"set_grid":return an(a,{gridOn:t.value});case"set_box":return an(a,{boxOn:t.value});case"set_colorbar":return an(a,{colorbar:t.value!=="off",colorbarLocation:t.location??"eastoutside"});case"set_colormap":return an(a,{colormap:t.name,colormapData:t.data});case"set_view":return an(a,{view:{az:t.az,el:t.el}});case"set_axis":return an(a,{axisMode:t.value});case"set_axis_limits":{const i=en(je(a)),s=(l,c)=>{if(c===void 0)return l;if(c!=="auto")return c};return an(a,{xlim:s(i.xlim,t.xlim),ylim:s(i.ylim,t.ylim),zlim:s(i.zlim,t.zlim)})}case"set_axis_ydir":return an(a,{yDir:t.dir});case"set_axis_visible":return an(a,{axisVisible:t.value});case"set_axis_scale":return an(a,{axisScale:t.value});case"set_caxis":return an(a,{caxis:t.limits});case"clf":return a.figs[a.currentHandle]?{...a,figs:{...a.figs,[a.currentHandle]:{...Kx}}}:a;case"cla":{const i=je(a),s=en(i),l=t.reset?{...Du}:{...Du,title:s.title,xlabel:s.xlabel,ylabel:s.ylabel,zlabel:s.zlabel,gridOn:s.gridOn,boxOn:s.boxOn,colorbar:s.colorbar,colorbarLocation:s.colorbarLocation,colormap:s.colormap,colormapData:s.colormapData,view:s.view,axisMode:s.axisMode,axisScale:s.axisScale,caxis:s.caxis,xlim:s.xlim,ylim:s.ylim,zlim:s.zlim,yDir:s.yDir,axisVisible:s.axisVisible,shading:s.shading};return{...a,figs:{...a.figs,[a.currentHandle]:tm(i,l)}}}case"set_subplot":{const s={...je(a),subplotGrid:{rows:t.rows,cols:t.cols},currentAxesIndex:t.index};return s.axes[t.index]||(s.axes={...s.axes,[t.index]:{...Du}}),{...a,figs:{...a.figs,[a.currentHandle]:s}}}default:return a}};function _i(a){for(let t=0;t<a.length;t++)a[t]===null&&(a[t]=NaN)}function FR(a){if(a.type==="plot")for(const t of a.traces)_i(t.x),_i(t.y);else if(a.type==="plot3")for(const t of a.traces)_i(t.x),_i(t.y),_i(t.z);else a.type==="surf"||a.type==="mesh"?(_i(a.trace.x),_i(a.trace.y),_i(a.trace.z),a.trace.c&&_i(a.trace.c)):a.type==="imagesc"?_i(a.trace.z):a.type==="contour"&&(_i(a.trace.x),_i(a.trace.y),_i(a.trace.z))}function IR(){const[a,t]=Pn.useReducer(zR,Zx),[i,s]=Pn.useState(!1),[l,c]=Pn.useState(1),f=Pn.useRef(l),d=Pn.useCallback(_=>{t(_),_.type==="set_figure_handle"?(f.current=_.handle,c(_.handle)):_.type==="close_all"&&(f.current=1,c(1))},[]),m=(()=>{if(a.figs[l])return l;const _=Object.keys(a.figs).map(Number);return _.length===0?l:_.sort((S,b)=>S-b)[_.length-1]})();Pn.useEffect(()=>{const _=new EventSource("/events");return _.onmessage=g=>{const S=JSON.parse(g.data);for(const b of S)FR(b),d(b)},_.addEventListener("done",()=>{s(!0)}),_.addEventListener("uihtml",g=>{try{const{compId:S,name:b,dataJson:R}=JSON.parse(g.data);document.querySelectorAll(`iframe[title="uihtml-${S}"]`).forEach(y=>y.contentWindow?.postMessage({source:"numbl-host",compId:S,name:b,dataJson:R},"*"))}catch{}}),()=>_.close()},[d]),Pn.useEffect(()=>{const _=g=>{const S=g.data;!S||S.source!=="numbl-uihtml"||fetch("/uihtml-event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({compId:S.compId,kind:S.kind,name:S.name,data:S.data})}).catch(()=>{})};return window.addEventListener("message",_),()=>window.removeEventListener("message",_)},[]);const p=Object.keys(a.figs).map(Number).sort((_,g)=>_-g),v=a.figs[m];return Zt.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh"},children:[p.length>1&&Zt.jsx("div",{style:BR,children:p.map(_=>Zt.jsxs("button",{onClick:()=>c(_),style:_===m?HR:Qx,children:["Figure ",_]},_))}),Zt.jsx("div",{style:{flex:1,position:"relative"},children:v?Zt.jsx("div",{style:{position:"absolute",inset:0},children:Zt.jsx(OR,{figure:v})}):Zt.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#999",fontFamily:"sans-serif"},children:"Waiting for plot data..."})}),Zt.jsx("div",{style:GR,children:i?"Script complete. Press Ctrl+C in terminal to exit.":"Running..."})]})}const BR={display:"flex",gap:2,padding:"4px 8px",background:"#f0f0f0",borderBottom:"1px solid #ccc"},Qx={padding:"4px 12px",border:"1px solid #ccc",borderBottom:"none",background:"#e0e0e0",cursor:"pointer",fontFamily:"sans-serif",fontSize:13,borderRadius:"4px 4px 0 0"},HR={...Qx,background:"#fff",fontWeight:"bold"},GR={padding:"4px 12px",background:"#f5f5f5",borderTop:"1px solid #ddd",fontSize:12,fontFamily:"sans-serif",color:"#666"};fM.createRoot(document.getElementById("root")).render(Zt.jsx(Pn.StrictMode,{children:Zt.jsx(IR,{})}));
|