PageSourceSearch

https://cryptotycoo-b7cf83fu.manus.space/assets/index-DCi2zGI_.js

js cryptotycoo-b7cf83fu.manus.space collected 2026-10-03 05:00:58 UTC 1,529,959 bytes, 206 lines download raw bytes

vendor: 4,518 bytes, lines 1-18
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dds-Babr594Z.js","assets/dds.pure-B8AOwW6Z.js","assets/cubemapToSphericalPolynomial-DlZ2d_xr.js","assets/ddsTextureLoader--NpaO-lG.js","assets/envTextureLoader-C5cghqNR.js","assets/default.vertex-DtXBXzGv.js","assets/logDepthDeclaration-DGdeTdbl.js","assets/helperFunctions-fVIwlelw.js","assets/vertexColorMixing-a1j8yC5t.js","assets/default.fragment-_slWTR4t.js","assets/fogFragment-Dqcu5gON.js","assets/default.vertex-YaDokP-M.js","assets/logDepthDeclaration-rqu8IhNL.js","assets/helperFunctions-DnYC-3KH.js","assets/vertexColorMixing-Cau4RvaW.js","assets/default.fragment-DhVffv6K.js","assets/fogFragment-BRyI1qYv.js","assets/color.vertex-BXUTd24i.js","assets/color.fragment-DkQZMLai.js","assets/color.vertex-iCxL1PG1.js","assets/color.fragment-ByVJmuN4.js"])))=>i.map(i=>d[i]);
2function qS(r,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in r)){const n=Object.getOwnPropertyDescriptor(i,s);n&&Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const n of s)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const n={};return s.integrity&&(n.integrity=s.integrity),s.referrerPolicy&&(n.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?n.credentials="include":s.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(s){if(s.ep)return;s.ep=!0;const n=t(s);fetch(s.href,n)}})();function CE(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $_={exports:{}},qc={};/**
3 * @license React
4 * react-jsx-runtime.production.js
5 *
6 * Copyright (c) Meta Platforms, Inc. and affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var Rb;function KS(){if(Rb)return qc;Rb=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,s,n){var o=null;if(n!==void 0&&(o=""+n),s.key!==void 0&&(o=""+s.key),"key"in s){n={};for(var c in s)c!=="key"&&(n[c]=s[c])}else n=s;return s=n.ref,{$$typeof:r,type:i,key:o,ref:s!==void 0?s:null,props:n}}return qc.Fragment=e,qc.jsx=t,qc.jsxs=t,qc}var Sb;function ZS(){return Sb||(Sb=1,$_.exports=KS()),$_.exports}var le=ZS(),J_={exports:{}},Kc={},em={exports:{}},tm={};/**
11 * @license React
12 * scheduler.production.js
13 *
14 * Copyright (c) Meta Platforms, Inc. and affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var Mb;function QS(){return Mb||(Mb=1,(function(r){function e(X,q){var W=X.length;X.push(q);e:for(;0<W;){var K=W-1>>>1,Z=X[K];if(0<s(Z,q))X[K]=q,X[W]=Z,W=K;else break e}}function t(X){return X.length===0?null:X[0]}function i(X){if(X.length===0)return null;var q=X[0],W=X.pop();if(W!==q){X[0]=W;e:for(var K=0,Z=X.length,F=Z>>>1;K<F;){var A=2*(K+1)-1,N=X[A],Y=A+1,se=X[Y];if(0>s(N,W))Y<Z&&0>s(se,N)?(X[K]=se,X[Y]=W,K=Y):(X[K]=N,X[A]=W,K=A);else if(Y<Z&&0>s(se,W))X[K]=se,X[Y]=W,K=Y;else break e}}return q}function s(X,q){var W=X.sortIndex-q.sortIndex;return W!==0?W:X.id-q.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;r.unstable_now=function(){return n.now()}}else{var o=Date,c=o.now();r.unstable_now=function(){return o.now()-c}}var h=[],f=[],_=1,d=null,g=3,p=!1,b=!1,x=!1,E=!1,v=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function P(X){for(var q=t(f);q!==null;){if(q.callback===null)i(f);else if(q.startTime<=X)i(f),q.sortIndex=q.expirationTime,e(h,q);else break;q=t(f)}}function M(X){if(x=!1,P(X),!b)if(t(h)!==null)b=!0,O||(O=!0,ne());else{var q=t(f);q!==null&&te(M,q.startTime-X)}}var O=!1,D=-1,w=5,G=-1;function H(){return E?!0:!(r.unstable_now()-G<w)}function ie(){if(E=!1,O){var X=r.unstable_now();G=X;var q=!0;try{e:{b=!1,x&&(x=!1,S(D),D=-1),p=!0;var W=g;try{t:{for(P(X),d=t(h);d!==null&&!(d.expirationTime>X&&H());){var K=d.callback;
vendor: 16,872 bytes, lines 18-42
18if(typeof K=="function"){d.callback=null,g=d.priorityLevel;var Z=K(d.expirationTime<=X);if(X=r.unstable_now(),typeof Z=="function"){d.callback=Z,P(X),q=!0;break t}d===t(h)&&i(h),P(X)}else i(h);d=t(h)}if(d!==null)q=!0;else{var F=t(f);F!==null&&te(M,F.startTime-X),q=!1}}break e}finally{d=null,g=W,p=!1}q=void 0}}finally{q?ne():O=!1}}}var ne;if(typeof R=="function")ne=function(){R(ie)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,k=ce.port2;ce.port1.onmessage=ie,ne=function(){k.postMessage(null)}}else ne=function(){v(ie,0)};function te(X,q){D=v(function(){X(r.unstable_now())},q)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(X){X.callback=null},r.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<X?Math.floor(1e3/X):5},r.unstable_getCurrentPriorityLevel=function(){return g},r.unstable_next=function(X){switch(g){case 1:case 2:case 3:var q=3;break;default:q=g}var W=g;g=q;try{return X()}finally{g=W}},r.unstable_requestPaint=function(){E=!0},r.unstable_runWithPriority=function(X,q){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var W=g;g=X;try{return q()}finally{g=W}},r.unstable_scheduleCallback=function(X,q,W){var K=r.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?K+W:K):W=K,X){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=W+Z,X={id:_++,callback:q,priorityLevel:X,startTime:W,expirationTime:Z,sortIndex:-1},W>K?(X.sortIndex=W,e(f,X),t(h)===null&&X===t(f)&&(x?(S(D),D=-1):x=!0,te(M,W-K))):(X.sortIndex=Z,e(h,X),b||p||(b=!0,O||(O=!0,ne()))),X},r.unstable_shouldYield=H,r.unstable_wrapCallback=function(X){var q=g;return function(){var W=g;g=q;try{return X.apply(this,arguments)}finally{g=W}}}})(tm)),tm}var Cb;function $S(){return Cb||(Cb=1,em.exports=QS()),em.exports}var im={exports:{}},Mt={};/**
19 * @license React
20 * react.production.js
21 *
22 * Copyright (c) Meta Platforms, Inc. and affiliates.
23 *
24 * This source code is licensed under the MIT license found in the
25 * LICENSE file in the root directory of this source tree.
26 */var Ib;function JS(){if(Ib)return Mt;Ib=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),n=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),g=Symbol.iterator;function p(F){return F===null||typeof F!="object"?null:(F=g&&F[g]||F["@@iterator"],typeof F=="function"?F:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,E={};function v(F,A,N){this.props=F,this.context=A,this.refs=E,this.updater=N||b}v.prototype.isReactComponent={},v.prototype.setState=function(F,A){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,A,"setState")},v.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function S(){}S.prototype=v.prototype;function R(F,A,N){this.props=F,this.context=A,this.refs=E,this.updater=N||b}var P=R.prototype=new S;P.constructor=R,x(P,v.prototype),P.isPureReactComponent=!0;var M=Array.isArray;function O(){}var D={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function G(F,A,N){var Y=N.ref;return{$$typeof:r,type:F,key:A,ref:Y!==void 0?Y:null,props:N}}function H(F,A){return G(F.type,A,F.props)}function ie(F){return typeof F=="object"&&F!==null&&F.$$typeof===r}function ne(F){var A={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(N){return A[N]})}var ce=/\/+/g;function k(F,A){return typeof F=="object"&&F!==null&&F.key!=null?ne(""+F.key):A.toString(36)}function te(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(O,O):(F.status="pending",F.then(function(A){F.status==="pending"&&(F.status="fulfilled",F.value=A)},function(A){F.status==="pending"&&(F.status="rejected",F.reason=A)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function X(F,A,N,Y,se){var ue=typeof F;(ue==="undefined"||ue==="boolean")&&(F=null);var pe=!1;if(F===null)pe=!0;else switch(ue){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(F.$$typeof){case r:case e:pe=!0;break;case _:return pe=F._init,X(pe(F._payload),A,N,Y,se)}}if(pe)return se=se(F),pe=Y===""?"."+k(F,0):Y,M(se)?(N="",pe!=null&&(N=pe.replace(ce,"$&/")+"/"),X(se,A,N,"",function(J){return J})):se!=null&&(ie(se)&&(se=H(se,N+(se.key==null||F&&F.key===se.key?"":(""+se.key).replace(ce,"$&/")+"/")+pe)),A.push(se)),1;pe=0;var Ie=Y===""?".":Y+":";if(M(F))for(var Le=0;Le<F.length;Le++)Y=F[Le],ue=Ie+k(Y,Le),pe+=X(Y,A,N,ue,se);else if(Le=p(F),typeof Le=="function")for(F=Le.call(F),Le=0;!(Y=F.next()).done;)Y=Y.value,ue=Ie+k(Y,Le++),pe+=X(Y,A,N,ue,se);else if(ue==="object"){if(typeof F.then=="function")return X(te(F),A,N,Y,se);throw A=String(F),Error("Objects are not valid as a React child (found: "+(A==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":A)+"). If you meant to render a collection of children, use an array instead.")}return pe}function q(F,A,N){if(F==null)return F;var Y=[],se=0;return X(F,Y,"","",function(ue){return A.call(N,ue,se++)}),Y}function W(F){if(F._status===-1){var A=F._result;A=A(),A.then(function(N){(F._status===0||F._status===-1)&&(F._status=1,F._result=N)},function(N){(F._status===0||F._status===-1)&&(F._status=2,F._result=N)}),F._status===-1&&(F._status=0,F._result=A)}if(F._status===1)return F._result.default;throw F._result}var K=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var A=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(A))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},Z={map:q,forEach:function(F,A,N){q(F,function(){A.apply(this,arguments)},N)},count:function(F){var A=0;return q(F,function(){A++}),A},toArray:function(F){return q(F,function(A){return A})||[]},only:function(F){if(!ie(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return Mt.Activity=d,Mt.Children=Z,Mt.Component=v,Mt.Fragment=t,Mt.Profiler=s,Mt.PureComponent=R,Mt.StrictMode=i,Mt.Suspense=h,Mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Mt.__COMPILER_RUNTIME={__proto__:null,c:function(F){return D.H.useMemoCache(F)}},Mt.cache=function(F){return function(){return F.apply(null,arguments)}},Mt.cacheSignal=function(){return null},Mt.cloneElement=function(F,A,N){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var Y=x({},F.props),se=F.key;if(A!=null)for(ue in A.key!==void 0&&(se=""+A.key),A)!w.call(A,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&A.ref===void 0||(Y[ue]=A[ue]);var ue=arguments.length-2;if(ue===1)Y.children=N;else if(1<ue){for(var pe=Array(ue),Ie=0;Ie<ue;Ie++)pe[Ie]=arguments[Ie+2];Y.children=pe}return G(F.type,se,Y)},Mt.createContext=function(F){return F={$$typeof:o,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:n,_context:F},F},Mt.createElement=function(F,A,N){var Y,se={},ue=null;if(A!=null)for(Y in A.key!==void 0&&(ue=""+A.key),A)w.call(A,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(se[Y]=A[Y]);var pe=arguments.length-2;if(pe===1)se.children=N;else if(1<pe){for(var Ie=Array(pe),Le=0;Le<pe;Le++)Ie[Le]=arguments[Le+2];se.children=Ie}if(F&&F.defaultProps)for(Y in pe=F.defaultProps,pe)se[Y]===void 0&&(se[Y]=pe[Y]);return G(F,ue,se)},Mt.createRef=function(){return{current:null}},Mt.forwardRef=function(F){return{$$typeof:c,render:F}},Mt.isValidElement=ie,Mt.lazy=function(F){return{$$typeof:_,_payload:{_status:-1,_result:F},_init:W}},Mt.memo=function(F,A){return{$$typeof:f,type:F,compare:A===void 0?null:A}},Mt.startTransition=function(F){var A=D.T,N={};D.T=N;try{var Y=F(),se=D.S;se!==null&&se(N,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(O,K)}catch(ue){K(ue)}finally{A!==null&&N.types!==null&&(A.types=N.types),D.T=A}},Mt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Mt.use=function(F){return D.H.use(F)},Mt.useActionState=function(F,A,N){return D.H.useActionState(F,A,N)},Mt.useCallback=function(F,A){return D.H.useCallback(F,A)},Mt.useContext=function(F){return D.H.useContext(F)},Mt.useDebugValue=function(){},Mt.useDeferredValue=function(F,A){return D.H.useDeferredValue(F,A)},Mt.useEffect=function(F,A){return D.H.useEffect(F,A)},Mt.useEffectEvent=function(F){return D.H.useEffectEvent(F)},Mt.useId=function(){return D.H.useId()},Mt.useImperativeHandle=function(F,A,N){return D.H.useImperativeHandle(F,A,N)},Mt.useInsertionEffect=function(F,A){return D.H.useInsertionEffect(F,A)},Mt.useLayoutEffect=function(F,A){return D.H.useLayoutEffect(F,A)},Mt.useMemo=function(F,A){return D.H.useMemo(F,A)},Mt.useOptimistic=function(F,A){return D.H.useOptimistic(F,A)},Mt.useReducer=function(F,A,N){return D.H.useReducer(F,A,N)},Mt.useRef=function(F){return D.H.useRef(F)},Mt.useState=function(F){return D.H.useState(F)},Mt.useSyncExternalStore=function(F,A,N){return D.H.useSyncExternalStore(F,A,N)},Mt.useTransition=function(){return D.H.useTransition()},Mt.version="19.2.1",Mt}var Db;function td(){return Db||(Db=1,im.exports=JS()),im.exports}var sm={exports:{}},bs={};/**
27 * @license React
28 * react-dom.production.js
29 *
30 * Copyright (c) Meta Platforms, Inc. and affiliates.
31 *
32 * This source code is licensed under the MIT license found in the
33 * LICENSE file in the root directory of this source tree.
34 */var Pb;function eM(){if(Pb)return bs;Pb=1;var r=td();function e(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)f+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},s=Symbol.for("react.portal");function n(h,f,_){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:d==null?null:""+d,children:h,containerInfo:f,implementation:_}}var o=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return bs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,bs.createPortal=function(h,f){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return n(h,f,null,_)},bs.flushSync=function(h){var f=o.T,_=i.p;try{if(o.T=null,i.p=2,h)return h()}finally{o.T=f,i.p=_,i.d.f()}},bs.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(h,f))},bs.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},bs.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var _=f.as,d=c(_,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,p=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;_==="style"?i.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:g,fetchPriority:p}):_==="script"&&i.d.X(h,{crossOrigin:d,integrity:g,fetchPriority:p,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},bs.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var _=c(f.as,f.crossOrigin);i.d.M(h,{crossOrigin:_,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(h)},bs.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var _=f.as,d=c(_,f.crossOrigin);i.d.L(h,_,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},bs.preloadModule=function(h,f){if(typeof h=="string")if(f){var _=c(f.as,f.crossOrigin);i.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:_,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(h)},bs.requestFormReset=function(h){i.d.r(h)},bs.unstable_batchedUpdates=function(h,f){return h(f)},bs.useFormState=function(h,f,_){return o.H.useFormState(h,f,_)},bs.useFormStatus=function(){return o.H.useHostTransitionStatus()},bs.version="19.2.1",bs}var Ob;function IE(){if(Ob)return sm.exports;Ob=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),sm.exports=eM(),sm.exports}/**
35 * @license React
36 * react-dom-client.production.js
37 *
38 * Copyright (c) Meta Platforms, Inc. and affiliates.
39 *
40 * This source code is licensed under the MIT license found in the
41 * LICENSE file in the root directory of this source tree.
42 */var wb;function tM(){if(wb)return Kc;wb=1;var r=$S(),e=td(),t=IE();function i(a){var l="https://react.dev/errors/"+a;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function n(a){var l=a,u=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,(l.flags&4098)!==0&&(u=l.return),a=l.return;while(a)}return l.tag===3?u:null}function o(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function c(a){if(a.tag===31){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function h(a){if(n(a)!==a)throw Error(i(188))}function f(a){var l=a.alternate;if(!l){if(l=n(a),l===null)throw Error(i(188));return l!==a?null:a}for(var u=a,m=l;;){var y=u.return;if(y===null)break;var T=y.alternate;if(T===null){if(m=y.return,m!==null){u=m;continue}break}if(y.child===T.child){for(T=y.child;T;){if(T===u)return h(y),a;if(T===m)return h(y),l;T=T.sibling}throw Error(i(188))}if(u.return!==m.return)u=y,m=T;else{for(var B=!1,j=y.child;j;){if(j===u){B=!0,u=y,m=T;break}if(j===m){B=!0,m=y,u=T;break}j=j.sibling}if(!B){for(j=T.child;j;){if(j===u){B=!0,u=T,m=y;break}if(j===m){B=!0,m=T,u=y;break}j=j.sibling}if(!B)throw Error(i(189))}}if(u.alternate!==m)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?a:l}function _(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a;for(a=a.child;a!==null;){if(l=_(a),l!==null)return l;a=a.sibling}return null}var d=Object.assign,g=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),R=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function ne(a){return a===null||typeof a!="object"?null:(a=ie&&a[ie]||a["@@iterator"],typeof a=="function"?a:null)}var ce=Symbol.for("react.client.reference");function k(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ce?null:a.displayName||a.name||null;
vendor: 11,627 bytes, lines 42-49
42if(typeof a=="string")return a;switch(a){case x:return"Fragment";case v:return"Profiler";case E:return"StrictMode";case M:return"Suspense";case O:return"SuspenseList";case G:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case b:return"Portal";case R:return a.displayName||"Context";case S:return(a._context.displayName||"Context")+".Consumer";case P:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case D:return l=a.displayName||null,l!==null?l:k(a.type)||"Memo";case w:l=a._payload,a=a._init;try{return k(a(l))}catch{}}return null}var te=Array.isArray,X=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},K=[],Z=-1;function F(a){return{current:a}}function A(a){0>Z||(a.current=K[Z],K[Z]=null,Z--)}function N(a,l){Z++,K[Z]=a.current,a.current=l}var Y=F(null),se=F(null),ue=F(null),pe=F(null);function Ie(a,l){switch(N(ue,l),N(se,a),N(Y,null),l.nodeType){case 9:case 11:a=(a=l.documentElement)&&(a=a.namespaceURI)?qy(a):0;break;default:if(a=l.tagName,l=l.namespaceURI)l=qy(l),a=Ky(l,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}A(Y),N(Y,a)}function Le(){A(Y),A(se),A(ue)}function J(a){a.memoizedState!==null&&N(pe,a);var l=Y.current,u=Ky(l,a.type);l!==u&&(N(se,a),N(Y,u))}function _e(a){se.current===a&&(A(Y),A(se)),pe.current===a&&(A(pe),Wc._currentValue=W)}var ye,Ne;function Je(a){if(ye===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);ye=l&&l[1]||"",Ne=-1<u.stack.indexOf(`
43    at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44`+ye+a+Ne}var je=!1;function yt(a,l){if(!a||je)return"";je=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(l){var Fe=function(){throw Error()};if(Object.defineProperty(Fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Fe,[])}catch(Ce){var Se=Ce}Reflect.construct(a,[],Fe)}else{try{Fe.call()}catch(Ce){Se=Ce}a.call(Fe.prototype)}}else{try{throw Error()}catch(Ce){Se=Ce}(Fe=a())&&typeof Fe.catch=="function"&&Fe.catch(function(){})}}catch(Ce){if(Ce&&Se&&typeof Ce.stack=="string")return[Ce.stack,Se.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=m.DetermineComponentFrameRoot(),B=T[0],j=T[1];if(B&&j){var re=B.split(`
45`),Ae=j.split(`
46`);for(y=m=0;m<re.length&&!re[m].includes("DetermineComponentFrameRoot");)m++;for(;y<Ae.length&&!Ae[y].includes("DetermineComponentFrameRoot");)y++;if(m===re.length||y===Ae.length)for(m=re.length-1,y=Ae.length-1;1<=m&&0<=y&&re[m]!==Ae[y];)y--;for(;1<=m&&0<=y;m--,y--)if(re[m]!==Ae[y]){if(m!==1||y!==1)do if(m--,y--,0>y||re[m]!==Ae[y]){var Pe=`
47`+re[m].replace(" at new "," at ");return a.displayName&&Pe.includes("<anonymous>")&&(Pe=Pe.replace("<anonymous>",a.displayName)),Pe}while(1<=m&&0<=y);break}}}finally{je=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Je(u):""}function Yt(a,l){switch(a.tag){case 26:case 27:case 5:return Je(a.type);case 16:return Je("Lazy");case 13:return a.child!==l&&l!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return yt(a.type,!1);case 11:return yt(a.type.render,!1);case 1:return yt(a.type,!0);case 31:return Je("Activity");default:return""}}function kt(a){try{var l="",u=null;do l+=Yt(a,u),u=a,a=a.return;while(a);return l}catch(m){return`
48Error generating stack: `+m.message+`
49`+m.stack}}var Et=Object.prototype.hasOwnProperty,Gt=r.unstable_scheduleCallback,zt=r.unstable_cancelCallback,nt=r.unstable_shouldYield,oe=r.unstable_requestPaint,ze=r.unstable_now,si=r.unstable_getCurrentPriorityLevel,$t=r.unstable_ImmediatePriority,oi=r.unstable_UserBlockingPriority,ti=r.unstable_NormalPriority,ii=r.unstable_LowPriority,Ct=r.unstable_IdlePriority,ni=r.log,Pt=r.unstable_setDisableYieldValue,Ht=null,ri=null;function di(a){if(typeof ni=="function"&&Pt(a),ri&&typeof ri.setStrictMode=="function")try{ri.setStrictMode(Ht,a)}catch{}}var _i=Math.clz32?Math.clz32:Bi,As=Math.log,rs=Math.LN2;function Bi(a){return a>>>=0,a===0?32:31-(As(a)/rs|0)|0}var St=256,Q=262144,V=4194304;function Te(a){var l=a&42;if(l!==0)return l;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function We(a,l,u){var m=a.pendingLanes;if(m===0)return 0;var y=0,T=a.suspendedLanes,B=a.pingedLanes;a=a.warmLanes;var j=m&134217727;return j!==0?(m=j&~T,m!==0?y=Te(m):(B&=j,B!==0?y=Te(B):u||(u=j&~a,u!==0&&(y=Te(u))))):(j=m&~T,j!==0?y=Te(j):B!==0?y=Te(B):u||(u=m&~a,u!==0&&(y=Te(u)))),y===0?0:l!==0&&l!==y&&(l&T)===0&&(T=y&-y,u=l&-l,T>=u||T===32&&(u&4194048)!==0)?l:y}function Me(a,l){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&l)===0}function z(a,l){switch(a){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 be(){var a=V;return V<<=1,(V&62914560)===0&&(V=4194304),a}function ut(a){for(var l=[],u=0;31>u;u++)l.push(a);return l}function Qe(a,l){a.pendingLanes|=l,l!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function it(a,l,u,m,y,T){var B=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var j=a.entanglements,re=a.expirationTimes,Ae=a.hiddenUpdates;for(u=B&~u;0<u;){var Pe=31-_i(u),Fe=1<<Pe;j[Pe]=0,re[Pe]=-1;var Se=Ae[Pe];if(Se!==null)for(Ae[Pe]=null,Pe=0;Pe<Se.length;Pe++){var Ce=Se[Pe];Ce!==null&&(Ce.lane&=-536870913)}u&=~Fe}m!==0&&Ot(a,m,0),T!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=T&~(B&~l))}function Ot(a,l,u){a.pendingLanes|=l,a.suspendedLanes&=~l;var m=31-_i(l);a.entangledLanes|=l,a.entanglements[m]=a.entanglements[m]|1073741824|u&261930}function wt(a,l){var u=a.entangledLanes|=l;for(a=a.entanglements;u;){var m=31-_i(u),y=1<<m;y&l|a[m]&l&&(a[m]|=l),u&=~y}}function li(a,l){var u=l&-l;return u=(u&42)!==0?1:gs(u),(u&(a.suspendedLanes|l))!==0?0:u}function gs(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Ni(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Hs(){var a=q.p;return a!==0?a:(a=window.event,a===void 0?32:yb(a.type))}function $i(a,l){var u=q.p;try{return q.p=a,l()}finally{q.p=u}}var xn=Math.random().toString(36).slice(2),Xi="__reactFiber$"+xn,as="__reactProps$"+xn,tr="__reactContainer$"+xn,yo="__reactEvents$"+xn,Eh="__reactListeners$"+xn,vh="__reactHandles$"+xn,Il="__reactResources$"+xn,Vr="__reactMarker$"+xn;function bo(a){delete a[Xi],delete a[as],delete a[yo],delete a[Eh],delete a[vh]}function ir(a){var l=a[Xi];if(l)return l;for(var u=a.parentNode;u;){if(l=u[tr]||u[Xi]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(a=ib(a);a!==null;){if(u=a[Xi])return u;a=ib(a)}return l}a=u,u=a.parentNode}return null}function sr(a){if(a=a[Xi]||a[tr]){var l=a.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return a}return null}function Gr(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a.stateNode;throw Error(i(33))}function nr(a){var l=a[Il];return l||(l=a[Il]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Vi(a){a[Vr]=!0}var Dl=new Set,Pl={};function wn(a,l){rr(a,l),rr(a+"Capture",l)}function rr(a,l){for(Pl[a]=l,a=0;a<l.length;a++)Dl.add(l[a])}var Ah=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]*$"),Ol={},wl={};function Rh(a){return Et.call(wl,a)?!0:Et.call(Ol,a)?!1:Ah.test(a)?wl[a]=!0:(Ol[a]=!0,!1)}function Fa(a,l,u){if(Rh(l))if(u===null)a.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(l);return;case"boolean":var m=l.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(l);return}}a.setAttribute(l,""+u)}}function La(a,l,u){if(u===null)a.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttribute(l,""+u)}}function nn(a,l,u,m){if(m===null)a.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(l,u,""+m)}}function Rs(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Fl(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Sh(a,l,u){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,l);if(!a.hasOwnProperty(l)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var y=m.get,T=m.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return y.call(this)},set:function(B){u=""+B,T.call(this,B)}}),Object.defineProperty(a,l,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(B){u=""+B},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function xo(a){if(!a._valueTracker){var l=Fl(a)?"checked":"value";a._valueTracker=Sh(a,l,""+a[l])}}function Ll(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var u=l.getValue(),m="";return a&&(m=Fl(a)?a.checked?"true":"false":a.value),a=m,a!==u?(l.setValue(a),!0):!1}function Ba(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Mh=/[\n"\\]/g;function Ss(a){return a.replace(Mh,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function To(a,l,u,m,y,T,B,j){a.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?a.type=B:a.removeAttribute("type"),l!=null?B==="number"?(l===0&&a.value===""||a.value!=l)&&(a.value=""+Rs(l)):a.value!==""+Rs(l)&&(a.value=""+Rs(l)):B!=="submit"&&B!=="reset"||a.removeAttribute("value"),l!=null?Eo(a,B,Rs(l)):u!=null?Eo(a,B,Rs(u)):m!=null&&a.removeAttribute("value"),y==null&&T!=null&&(a.defaultChecked=!!T),y!=null&&(a.checked=y&&t
vendor: 5,691 bytes, line 49
49ypeof y!="function"&&typeof y!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?a.name=""+Rs(j):a.removeAttribute("name")}function Bl(a,l,u,m,y,T,B,j){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(a.type=T),l!=null||u!=null){if(!(T!=="submit"&&T!=="reset"||l!=null)){xo(a);return}u=u!=null?""+Rs(u):"",l=l!=null?""+Rs(l):u,j||l===a.value||(a.value=l),a.defaultValue=l}m=m??y,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=j?a.checked:!!m,a.defaultChecked=!!m,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(a.name=B),xo(a)}function Eo(a,l,u){l==="number"&&Ba(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function ar(a,l,u,m){if(a=a.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<a.length;u++)y=l.hasOwnProperty("$"+a[u].value),a[u].selected!==y&&(a[u].selected=y),y&&m&&(a[u].defaultSelected=!0)}else{for(u=""+Rs(u),l=null,y=0;y<a.length;y++){if(a[y].value===u){a[y].selected=!0,m&&(a[y].defaultSelected=!0);return}l!==null||a[y].disabled||(l=a[y])}l!==null&&(l.selected=!0)}}function Nl(a,l,u){if(l!=null&&(l=""+Rs(l),l!==a.value&&(a.value=l),u==null)){a.defaultValue!==l&&(a.defaultValue=l);return}a.defaultValue=u!=null?""+Rs(u):""}function Ul(a,l,u,m){if(l==null){if(m!=null){if(u!=null)throw Error(i(92));if(te(m)){if(1<m.length)throw Error(i(93));m=m[0]}u=m}u==null&&(u=""),l=u}u=Rs(l),a.defaultValue=u,m=a.textContent,m===u&&m!==""&&m!==null&&(a.value=m),xo(a)}function or(a,l){if(l){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=l;return}}a.textContent=l}var Ch=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 kl(a,l,u){var m=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?a.setProperty(l,""):l==="float"?a.cssFloat="":a[l]="":m?a.setProperty(l,u):typeof u!="number"||u===0||Ch.has(l)?l==="float"?a.cssFloat=u:a[l]=(""+u).trim():a[l]=u+"px"}function zl(a,l,u){if(l!=null&&typeof l!="object")throw Error(i(62));if(a=a.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||l!=null&&l.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var y in l)m=l[y],l.hasOwnProperty(y)&&u[y]!==m&&kl(a,y,m)}else for(var T in l)l.hasOwnProperty(T)&&kl(a,T,l[T])}function vo(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Ih=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
49-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"]]),Dh=/^[\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 Na(a){return Dh.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function rn(){}var Ao=null;function Ro(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var lr=null,cr=null;function Vl(a){var l=sr(a);if(l&&(a=l.stateNode)){var u=a[as]||null;e:switch(a=l.stateNode,l.type){case"input":if(To(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Ss(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var m=u[l];if(m!==a&&m.form===a.form){var y=m[as]||null;if(!y)throw Error(i(90));To(m,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)m=u[l],m.form===a.form&&Ll(m)}break e;case"textarea":Nl(a,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&ar(a,!!u.multiple,l,!1)}}}var So=!1;function Gl(a,l,u){if(So)return a(l,u);So=!0;try{var m=a(l);return m}finally{if(So=!1,(lr!==null||cr!==null)&&(qu(),lr&&(l=lr,a=cr,cr=lr=null,Vl(l),a)))for(l=0;l<a.length;l++)Vl(a[l])}}function Hr(a,l){var u=a.stateNode;if(u===null)return null;var m=u[as]||null;if(m===null)return null;u=m[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(i(231,l,typeof u));return u}var an=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mo=!1;if(an)try{var Wr={};Object.defineProperty(Wr,"passive",{get:function(){Mo=!0}}),window.addEventListener("test",Wr,Wr),window.removeEventListener("test",Wr,Wr)}catch{Mo=!1}var Tn=null,Co=null,Ua=null;function Hl(){if(Ua)return Ua;var a,l=Co,u=l.length,m,y="value"in Tn?Tn.value:Tn.textContent,T=y.length;for(a=0;a<u&&l[a]===y[a];a++);var B=u-a;for(m=1;m<=B&&l[u-m]===y[T-m];m++);return Ua=y.slice(a,1<m?1-m:void 0)}function ka(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function za(){return!0}function Wl(){return!1}function os(a){function l(u,m,y,T,B){this._reactName=u,this._targetInst=y,this.type=m,this.nativeEvent=T,this.target=B,this.currentTarget=null;for(var j in a)a.hasOwnProperty(j)&&(u=a[j],this[j]=u?u(T):T[j]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?za:Wl,this.isPropagationStopped=Wl,this}return d(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=za)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=za)},persist:function(){},isPersistent:za}),l}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Va=os(Fn),Xr=d({},Fn,{view:0,detail:0}),Ph=os(Xr),Io,Do,Yr,Ga=d({},Xr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oo,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Yr&&(Yr&&a.type==="mousemove"?(Io=a.screenX-Yr.screenX,Do=a.screenY-Yr.screenY):Do=Io=0,Yr=a),Io)},movementY:function(a){return"movementY"in a?a.movementY:Do}}),Xl=os(Ga),Oh=d({},Ga,{dataTransfer:0}),wh=os(Oh),Fh=d({},Xr,{relatedTarget:0}),Po=os(Fh),Lh=d({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0}),Bh=os(Lh),Nh=d({},Fn,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Uh=os(Nh),kh=d({},Fn,{data:0}),Yl=os(kh),zh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"}
vendor: 1,038 bytes, line 49
49,Vh={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"},Gh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hh(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=Gh[a])?!!l[a]:!1}function Oo(){return Hh}var Wh=d({},Xr,{key:function(a){if(a.key){var l=zh[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=ka(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Vh[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oo,charCode:function(a){return a.type==="keypress"?ka(a):0},keyCode:function(a){return a.type==="
49keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?ka(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Xh=os(Wh),Yh=d({},Ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jl=os(Yh),jh=d({},Xr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oo}),qh=os(jh),Kh=d({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zh=os(Kh),Qh=d({},Ga,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),$h=os(Qh),Jh=d({},Fn,{newState:0,oldState:0}),eu=os(Jh),tu=[9,13,27,32],wo=an&&"CompositionEvent"in window,jr=null;an&&"documentMode"in document&&(jr=document.documentMode);var iu=an&&"TextEvent"in window&&!jr,ql=an&&(!wo||jr&&8<jr&&11>=jr),Kl=" ",Zl=!1;function Ql(a,l){switch(a){case"keyup":return tu.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $l(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var hr=!1;function su(a,l){switch(a){case"compositionend":return $l(l);case"keypress":return l.which!==32?null:(Zl=!0,Kl);case"textInput":return a=l.data,a===Kl&&Zl?null:a;default:return null}}function nu(a,l){if(hr)return a==="compositionend"||!wo&&Ql(a,l)?(a=Hl(),Ua=Co=Tn=null,hr=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return ql&&l.locale!=="ko"?null:l.data;default:return null}}var ru={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 Jl(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!ru[a.type]:l==="textarea"}function ec(a,l,u,m){lr?cr?cr.push(m):cr=[m]:lr=m,l=tf(l,"onChange"),0<l.length&&(u=new Va("onChange","change",null,u,m),a.push({event:u,listeners:l}))}var qr=null,Kr=null;function au(a){Gy(a,0)}function Ha(a){var l=Gr(a);if(Ll(l))return a}function tc(a,l){if(a==="change")return l}var ic=!1;if(an){var Fo;if(an){var Lo="oninput"in document;if(!Lo){var sc=document.createElement("div");sc.setAttribute("oninput","return;"),Lo=typeof sc.oninput=="function"}Fo=Lo}else Fo=!1;ic=Fo&&(!document.documentMode||9<document.documentMode)}function nc(){qr&&(qr.detachEvent("onpropertychange",rc),Kr=qr=null)}function rc(a){if(a.propertyName==="value"&&Ha(Kr)){var l=[];ec(l,Kr,a,Ro(a)),Gl(au,l)}}function ou(a,l,u){a==="focusin"?(nc(),qr=l,Kr=u,qr.attachEvent("onpropertychange",rc)):a==="focusout"&&nc()}function lu(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ha(Kr)}function cu(a,l){if(a==="click")return Ha(l)}function hu(a,l){if(a==="input"||a==="change")return Ha(l)}function uu(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var ps=typeof Object.is=="function"?Object.is:uu;function Zr(a,l){if(ps(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var u=Object.keys(a),m=Object.keys(l);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var y=u[m];if(!Et.call(l,y)||!ps(a[y],l[y]))return!1}return!0}function ac(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function oc(a,l){var u=ac(a);a=0;for(var m;u;){if(u.nodeType===3){if(m=a+u.textContent.length,a<=l&&m>=l)return{node:u,offset:l-a};a=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=ac(u)}}function lc(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?lc(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function cc(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var l=Ba(a.document);l instanceof a.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)a=l.contentWindow;else break;l=Ba(a.document)}return l}function Bo(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}var fu=an&&"documentMode"in document&&11>=document.documentMode,ur=null,No=null,Qr=null,Uo=!1;function hc(a,l,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Uo||ur==null||ur!==Ba(m)||(m=ur,"selectionStart"in m&&Bo(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focu
vendor: 21,506 bytes, line 49
49sNode:m.focusNode,focusOffset:m.focusOffset}),Qr&&Zr(Qr,m)||(Qr=m,m=tf(No,"onSelect"),0<m.length&&(l=new Va("onSelect","select",null,l,u),a.push({event:l,listeners:m}),l.target=ur)))}function Ln(a,l){var u={};return u[a.toLowerCase()]=l.toLowerCase(),u["Webkit"+a]="webkit"+l,u["Moz"+a]="moz"+l,u}var fr={animationend:Ln("Animation","AnimationEnd"),animationiteration:Ln("Animation","AnimationIteration"),animationstart:Ln("Animation","AnimationStart"),transitionrun:Ln("Transition","TransitionRun"),transitionstart:Ln("Transition","TransitionStart"),transitioncancel:Ln("Transition","TransitionCancel"),transitionend:Ln("Transition","TransitionEnd")},ko={},uc={};an&&(uc=document.createElement("div").style,"AnimationEvent"in window||(delete fr.animationend.animation,delete fr.animationiteration.animation,delete fr.animationstart.animation),"TransitionEvent"in window||delete fr.transitionend.transition);function Bn(a){if(ko[a])return ko[a];if(!fr[a])return a;var l=fr[a],u;for(u in l)if(l.hasOwnProperty(u)&&u in uc)return ko[a]=l[u];return a}var fc=Bn("animationend"),dc=Bn("animationiteration"),_c=Bn("animationstart"),du=Bn("transitionrun"),_u=Bn("transitionstart"),mu=Bn("transitioncancel"),$e=Bn("transitionend"),C=new Map,de="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(" ");de.push("scrollEnd");function ui(a,l){C.set(a,l),wn(l,[a])}var Bt=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Nt=[],xe=0,Ws=0;function on(){for(var a=xe,l=Ws=xe=0;l<a;){var u=Nt[l];Nt[l++]=null;var m=Nt[l];Nt[l++]=null;var y=Nt[l];Nt[l++]=null;var T=Nt[l];if(Nt[l++]=null,m!==null&&y!==null){var B=m.pending;B===null?y.next=y:(y.next=B.next,B.next=y),m.pending=y}T!==0&&Yi(u,y,T)}}function En(a,l,u,m){Nt[xe++]=a,Nt[xe++]=l,Nt[xe++]=u,Nt[xe++]=m,Ws|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function ys(a,l,u,m){return En(a,l,u,m),vn(a)}function rt(a,l){return En(a,null,null,l),vn(a)}function Yi(a,l,u){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u);for(var y=!1,T=a.return;T!==null;)T.childLanes|=u,m=T.alternate,m!==null&&(m.childLanes|=u),T.tag===22&&(a=T.stateNode,a===null||a._visibility&1||(y=!0)),a=T,T=T.return;return a.tag===3?(T=a.stateNode,y&&l!==null&&(y=31-_i(u),a=T.hiddenUpdates,m=a[y],m===null?a[y]=[l]:m.push(l),l.lane=u|536870912),T):null}function vn(a){if(50<Nc)throw Nc=0,E_=null,Error(i(185));for(var l=a.return;l!==null;)a=l,l=a.return;return a.tag===3?a.stateNode:null}var ls={};function dr(a,l,u,m){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ss(a,l,u,m){return new dr(a,l,u,m)}function zo(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ln(a,l){var u=a.alternate;return u===null?(u=ss(a.tag,l,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=l,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,l=a.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function gu(a,l){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=l,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,l=u.dependencies,a.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),a}function Vo(a,l,u,m,y,T){var B=0;if(m=a,typeof a=="function")zo(a)&&(B=1);else if(typeof a=="string")B=BS(a,u,Y.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case G:return a=ss(31,u,l,y),a.elementType=G,a.lanes=T,a;case x:return cn(u.children,y,T,l);case E:B=8,y|=24;break;case v:return a=ss(12,u,l,y|2),a.elementType=v,a.lanes=T,a;case M:return a=ss(13,u,l,y),a.elementType=M,a.lanes=T,a;case O:return a=ss(19,u,l,y),a.elementType=O,a.lanes=T,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:B=10;break e;case S:B=9;break e;case P:B=11;break e;case D:B=14;break e;case w:B=16,m=null;break e}B=29,u=Error(i(130,a===null?"null":typeof a,"")),m=null}return l=ss(B,u,l,y),l.elementType=a,l.type=m,l.lanes=T,l}function cn(a,l,u,m){return a=ss(7,a,m,l),a.lanes=u,a}function Nn(a,l,u){return a=ss(6,a,null,l),a.lanes=u,a}function mc(a){var l=ss(18,null,null,0);return l.stateNode=a,l}function pu(a,l,u){return l=ss(4,a.children!==null?a.children:[],a.key,l),l.lanes=u,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}var yu=new WeakMap;function hn(a,l){if(typeof a=="object"&&a!==null){var u=yu.get(a);return u!==void 0?u:(l={value:a,source:l,stack:kt(l)},yu.set(a,l),l)}return{value:a,source:l,stack:kt(l)}}var Go=[],Ho=0,bu=null,gc=0,un=[],fn=0,$r=null,Un=1,kn="";function _r(a,l){Go[Ho++]=gc,Go[Ho++]=bu,bu=a,gc=l}function Mg(a,l,u){un[fn++]=Un,un[fn++]=kn,un[fn++]=$r,$r=a;var m=Un;a=kn;var y=32-_i(m)-1;m&=~(1<<y),u+=1;var T=32-_i(l)+y;if(30<T){var B=y-y%5;T=(m&(1<<B)-1).toString(32),m>>=B,y-=B,Un=1<<32-_i(l)+y|u<<y|m,kn=T+a}else Un=1<<T|u<<y|m,kn=a}function pd(a){a.return!==null&&(_r(a,1),Mg(a,1,0))}function yd(a){for(;a===bu;)bu=Go[--Ho],Go[Ho]=null,gc=Go[--Ho],Go[Ho]=null;for(;a===$r;)$r=un[--fn],un[fn]=null,kn=un[--fn],un[fn]=null,Un=un[--fn],un[fn]=null}function Cg(a,l){un[fn++]=Un,un[fn++]=kn,un[fn++]=$r,Un=l.id,kn=l.overflow,$r=a}var cs=null,Ii=null,Jt=!1,Jr=null,dn=!1,bd=Error(i(519));function ea(a){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pc(hn(l,a)),bd}function Ig(a){var l=a.stateNode,u=a.type,m=a.memoizedProps;switch(l[Xi]=a,l[as]=m,u){case"dialog":Xt("cancel",l),Xt("close",l);break;case"iframe":case"object":case"embed":Xt("load",l);break;case"video":case"audio":for(u=0;u<kc.length;u++)Xt(kc[u],l);break;case"source":Xt("error",l);break;case"img":case"image":case"link":Xt("error",l),Xt("load",l);break;case"details":Xt("toggle",l);break;case"input":Xt("invalid",l),Bl(l,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Xt("invalid",l);break;case"textarea":Xt("invalid",l),Ul(l,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||m.suppressHydrationWarning===!0||Yy(l.textContent,u)?(m.popover!=null&&(Xt("beforetoggle",l),Xt("toggle",l)),m.onScroll!=null&&Xt("scroll",l),m.onScrollEnd!=null&&Xt("scrollend",l),m.onClick!=null&&(l.onclick=rn),l=!0):l=!1,l||ea(a,!0)}function Dg(a){for(cs=a.return;cs;)switch(cs.tag){case 5:case 31:case 13:dn=!1;return;case 27:case 3:dn=!0;return;default:cs=cs.return}}function Wo(a){if(a!==cs)return!1;if(!Jt)return Dg(a),Jt=!0,!1;var l=a.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||N_(a.type,a.memoizedProps)),u=!u),u&&Ii&&ea(a),Dg(a),l===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Ii=tb(a)}else if(l===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Ii=tb(a)}else l===27?(l=Ii,_a(a.type)?(a=G_,G_=null,Ii=a):Ii=l):Ii=cs?mn(a.stateNode.nextSibling):null;return!0}function Wa(){Ii=cs=null,Jt=!1}function xd(){var a=Jr;return a!==null&&(Ns===null?Ns=a:Ns.push.apply(Ns,a),Jr=null),a}function pc(a){Jr===null?Jr=[a]:Jr.push(a)}var Td=F(null),Xa=null,mr=null;function ta(a,l,u){N(Td,l._currentValue),l._currentValue=u}function gr(a){a._currentValue=Td.current,A(Td)}function Ed(a,l,u){for(;a!==null;){var m=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),a===u)break;a=a.return}}function vd(a,l,u,m){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var T=y.dependencies;if(T!==null){var B=y.child;T=T.firstContext;e:for(;T!==null;){var j=T;T=y;for(var re=0;re<l.length;re++)if(j.context===l[re]){T.lanes|=u,j=T.alternate,j!==null&&(j.lanes|=u),Ed(T.return,u,a),m||(B=null);break e}T=j.next}}else if(y.tag===18){if(B=y.return,B===null)throw Error(i(341));B.lanes|=u,T=B.alternate,T!==null&&(T.lanes|=u),Ed(B,u,a),B=null}else B=y.child;if(B!==null)B.return=y;else for(B=y;B!==null;){if(B===a){B=null;break}if(y=B.sibling,y!==null){y.return=B.return,B=y;break}B=B.return}y=B}}function Xo(a,l,u,m){a=null;for(var y=l,T=!1;y!==null;){if(!T){if((y.flags&524288)!==0)T=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var B=y.alternate;if(B===null)throw Error(i(387));if(B=B.memoizedProps,B!==null){var j=y.type;ps(y.pendingProps.value,B.value)||(a!==null?a.push(j):a=[j])}}else if(y===pe.current){if(B=y.alternate,B===null)throw Error(i(387));B.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(Wc):a=[Wc])}y=y.return}a!==null&&vd(l,a,u,m),l.flags|=262144}function xu(a){for(a=a.firstContext;a!==null;){if(!ps(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Ya(a){Xa=a,mr=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function hs(a){return Pg(Xa,a)}function Tu(a,l){return Xa===null&&Ya(a),Pg(a,l)}function Pg(a,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},mr===null){if(a===null)throw Error(i(308));mr=l,a.dependencies={lanes:0,firstContext:l},a.flags|=524288}else mr=mr.next=l;return u}var OR=typeof AbortController<"u"?AbortController:function(){var a=[],l=this.signal={aborted:!1,addEventListener:function(u,m){a.push(m)}};this.abort=function(){l.aborted=!0,a.forEach(function(u){return u()})}},wR=r.unstable_scheduleCallback,FR=r.unstable_NormalPriority,ji={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ad(){return{controller:new OR,data:new Map,refCount:0}}function yc(a){a.refCount--,a.refCount===0&&wR(FR,function(){a.controller.abort()})}var bc=null,Rd=0,Yo=0,jo=null;function LR(a,l){if(bc===null){var u=bc=[];Rd=0,Yo=C_(),jo={status:"pending",value:void 0,then:function(m){u.push(m)}}}return Rd++,l.then(Og,Og),l}function Og(){if(--Rd===0&&bc!==null){jo!==null&&(jo.status="fulfilled");var a=bc;bc=null,Yo=0,jo=null;for(var l=0;l<a.length;l++)(0,a[l])()}}function BR(a,l){var u=[],m={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return a.then(function(){m.status="fulfilled",m.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(m.status="rejected",m.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),m}var wg=X.S;X.S=function(a,l){gy=ze(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&LR(a,l),wg!==null&&wg(a,l)};var ja=F(null);function Sd(){var a=ja.current;return a!==null?a:Ei.pooledCache}function Eu(a,l){l===null?N(ja,ja.current):N(ja,l.pool)}function Fg(){var a=Sd();return a===null?null:{parent:ji._currentValue,pool:a}}var qo=Error(i(460)),Md=Error(i(474)),vu=Error(i(542)),Au={then:function(){}};function Lg(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Bg(a,l,u){switch(u=a[u],u===void 0?a.push(l):u!==l&&(l.then(rn,rn),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,Ug(a),a;default:if(typeof l.status=="string")l.then(rn,rn);else{if(a=Ei,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=l,a.status="pending",a.then(function(m){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=m}},function(m){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=m}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,Ug(a),a}throw Ka=l,qo}}function qa(a){try{var l=a._init;return l(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ka=u,qo):u}}var Ka=null;function Ng(){if(Ka===null)throw Error(i(459));var a=Ka;return Ka=null,a}function Ug(a){if(a===qo||a===vu)throw Error(i(483))}var Ko=null,xc=0;function Ru(a){var l=xc;return xc+=1,Ko===null&&(Ko=[]),Bg(Ko,a,l)}function Tc(a,l){l=l.props.ref,a.ref=l!==void 0?l:null}function Su(a,l){throw l.$$typeof===g?Error(i(525)):(a=Object.prototype.toString.call(l),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a)))}function kg(a){function l(me,fe){if(a){var ve=me.deletions;ve===null?(me.deletions=[fe],me.flags|=16):ve.push(fe)}}function u(me,fe){if(!a)return null;for(;fe!==null;)l(me,fe),fe=fe.sibling;return null}function m(me){for(var fe=new Map;me!==null;)me.key!==null?fe.set(me.key,me):fe.set(me.index,me),me=me.sibling;return fe}function y(me,fe){return me=ln(me,fe),me.index=0,me.sibling=null,me}function T(me,fe,ve){return me.index=ve,a?(ve=me.alternate,ve!==null?(ve=ve.index,ve<fe?(me.flags|=67108866,fe):ve):(me.flags|=67108866,fe)):(me.flags|=1048576,fe)}function B(me){return a&&me.alternate===null&&(me.flags|=67108866),me}function j(me,fe,ve,we){return fe===null||fe.tag!==6?(fe=Nn(ve,me.mode,we),fe.return=me,fe):(fe=y(fe,ve),fe.return=me,fe)}function re(me,fe,ve,we){var gt=ve.type;return gt===x?Pe(me,fe,ve.props.children,we,ve.key):fe!==null&&(fe.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===w&&qa(gt)===fe.type)?(fe=y(fe,ve.props),Tc(fe,ve),fe.return=me,fe):(fe=Vo(ve.type,ve.key,ve.props,null,me.mode,we),Tc(fe,ve),fe.return=me,fe)}function Ae(me,fe,ve,we){return fe===null||fe.tag!==4||fe.stateNode.containerInfo!==ve.containerInfo||fe.stateNode.implementation!==ve.implementation?(fe=pu(ve,me.mode,we),fe.return=me,fe):(fe=y(fe,ve.children||[]),fe.return=me,fe)}function Pe(me,fe,ve,we,gt){return fe===null||fe.tag!==7?(fe=cn(ve,me.mode,we,gt),fe.return=me,fe):(fe=y(fe,ve),fe.return=me,fe)}function Fe(me,fe,ve){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return fe=Nn(""+fe,me.mode,ve),fe.return=me,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case p:return ve=Vo(fe.type,fe.key,fe.props,null,me.mode,ve),Tc(ve,fe),ve.return=me,ve;case b:return fe=pu(fe,me.mode,ve),fe.return=me,fe;case w:return fe=qa(fe),Fe(me,fe,ve)}if(te(fe)||ne(fe))return fe=cn(fe,me.mode,ve,null),fe.return=me,fe;if(typeof fe.then=="function")return Fe(me,Ru(fe),ve);if(fe.$$typeof===R)return Fe(me,Tu(me,fe),ve);Su(me,fe)}return null}function Se(me,fe,ve,we){var gt=fe!==null?fe.key:null;if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return gt!==null?null:j(me,fe,""+ve,we);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case p:return ve.key===gt?re(me,fe,ve,we):null;case b:return ve.key===gt?Ae(me,fe,ve,we):null;case w:return ve=qa(ve),Se(me,fe,ve,we)}if(te(ve)||ne(ve))return gt!==null?null:Pe(me,fe,ve,we,null);if(typeof ve.then=="function")return Se(me,fe,Ru(ve),we);if(ve.$$typeof===R)return Se(me,fe,Tu(me,ve),we);Su(me,ve)}return null}function Ce(me,fe,ve,we,gt){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return me=me.get(ve)||null,j(fe,me,""+we,gt);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case p:return me=me.get(we.key===null?ve:we.key)||null,re(fe,me,we,gt);case b:return me=me.get(we.key===null?ve:we.key)||null,Ae(fe,me,we,gt);case w:return we=qa(we),Ce(me,fe,ve,we,gt)}if(te(we)||ne(we))return me=me.get(ve)||null,Pe(fe,me,we,gt,null);if(typeof we.then=="function")return Ce(me,fe,ve,Ru(we),gt);if(we.$$typeof===R)return Ce(me,fe,ve,Tu(fe,we),gt);Su(fe,we)}return null}function lt(me,fe,ve,we){for(var gt=null,ci=null,ft=fe,Ft=fe=0,qt=null;ft!==null&&Ft<ve.length;Ft++){ft.index>Ft?(qt=ft,ft=null):qt=ft.sibling;var hi=Se(me,ft,ve[Ft],we);if(hi===null){ft===null&&(ft=qt);break}a&&ft&&hi.alternate===null&&l(me,ft),fe=T(hi,fe,Ft),ci===null?gt=hi:ci.sibling=hi,ci=hi,ft=qt}if(Ft===ve.length)return u(me,ft),Jt&&_r(me,Ft),gt;if(ft===null){for(;Ft<ve.length;Ft++)ft=Fe(me,ve[Ft],we),ft!==null&&(fe=T(ft,fe,Ft),ci===null?gt=ft:ci.sibling=ft,ci=ft);return Jt&&_r(me,Ft),gt}for(ft=m(ft);Ft<ve.length;Ft++)qt=Ce(ft,me,Ft,ve[Ft],we),qt!==null&&(a&&qt.alternate!==null&&ft.delete(qt.key===null?Ft:qt.key),fe=T(qt,fe,Ft),ci===null?gt=qt:ci.sibling=qt,ci=qt);return a&&ft.forEach(function(ba){return l(me,ba)}),Jt&&_r(me,Ft),gt}function bt(me,fe,ve,we){if(ve==null)throw Error(i(151));for(var gt=null,ci=null,ft=fe,Ft=fe=0,qt=null,hi=ve.next();ft!==null&&!hi.done;Ft++,hi=ve.next()){ft.index>Ft?(qt=ft,ft=null):qt=ft.sibling;var ba=Se(me,ft,hi.value,we);if(ba===null){ft===null&&(ft=qt);break}a&&ft&&ba.alternate===null&&l(me,ft),fe=T(ba,fe,Ft),ci===null?gt=ba:ci.sibling=ba,ci=ba,ft=qt}if(hi.done)return u(me,ft),Jt&&_r(me,Ft),gt;if(ft===null){for(;!hi.done;Ft++,hi=ve.next())hi=Fe(me,hi.value,we),hi!==null&&(fe=T(hi,fe,Ft),ci===null?gt=hi:ci.sibling=hi,ci=hi);return Jt&&_r(me,Ft),gt}for(ft=m(ft);!hi.done;Ft++,hi=ve.next())hi=Ce(ft,me,Ft,hi.value,we),hi!==null&&(a&&hi.alternate!==null&&ft.delete(hi.key===null?Ft:hi.key),fe=T(hi,fe,Ft),ci===null?gt=hi:ci.sibling=hi,ci=hi);return a&&ft.forEach(function(jS){return l(me,jS)}),Jt&&_r(me,Ft),gt}function Ti(me,fe,ve,we){if(typeof ve=="object"&&ve!==null&&ve.type===x&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case p:e:{for(var gt=ve.key;fe!==null;){if(fe.key===gt){if(gt=ve.type,gt===x){if(fe.tag===7){u(me,fe.sibling),we=y(fe,ve.props.children),we.return=me,me=we;break e}}else if(fe.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===w&&qa(gt)===fe.type){u(me,fe.sibling),we=y(fe,ve.props),Tc(we,ve),we.return=me,me=we;break e}u(me,fe);break}else l(me,fe);fe=fe.sibling}ve.type===x?(we=cn(ve.props.children,me.mode,we,ve.key),we.return=me,me=we):(we=Vo(ve.type,ve.key,ve.props,null,me.mode,we),Tc(we,ve),we.return=me,me=we)}return B(me);case b:e:{for(gt=ve.key;fe!==null;){if(fe.key===gt)if(fe.tag===4&&fe.stateNode.containerInfo===ve.containerInfo&&fe.stateNode.implementation===ve.implementation){u(me,fe.sibling),we=y(fe,ve.children||[]),we.return=me,me=we;break e}else{u(me,fe);break}else l(me,fe);fe=fe.sibling}we=pu(ve,me.mode,we),we.return=me,me=we}return B(me);case w:return ve=qa(ve),Ti(me,fe,ve,we)}if(te(ve))return lt(me,fe,ve,we);if(ne(ve)){if(gt=ne(ve),typeof gt!="function")throw Error(i(150));return ve=gt.call(ve),bt(me,fe,ve,we)}if(typeof ve.then=="function")return Ti(me,fe,Ru(ve),we);if(ve.$$typeof===R)return Ti(me,fe,Tu(me,ve),we);Su(me,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint"?(ve=""+ve,fe!==null&&fe.tag===6?(u(me,fe.sibling),we=y(fe,ve),we.return=me,me=we):(u(me,fe),we=Nn(ve,me.mode,we),we.return=me,me=we),B(me)):u(me,fe)}return function(me,fe,ve,we){try{xc=0;var gt=Ti(me,fe,ve,we);return Ko=null,gt}catch(ft){if(ft===qo||ft===vu)throw ft;var ci=ss(29,ft,null,me.mode);return ci.lanes=we,ci.return=me,ci}finally{}}}var Za=kg(!0),zg=kg(!1),ia=!1;function Cd(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Id(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function sa(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function na(a,l,u){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(fi&2)!==0){var y=m.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),m.pending=l,l=vn(a),Yi(a,null,u),l}return En(a,m,l,u),vn(a)}function Ec(a,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var m=l.lanes;m&=a.pendingLanes,u|=m,l.lanes=u,wt(a,u)}}function Dd(a,l){var u=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var y=null,T=null;if(u=u.firstBaseUpdate,u!==null){do{var B={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};T===null?y=T=B:T=T.next=B,u=u.next}while(u!==null);T===null?y=T=l:T=T.next=l}else y=T=l;u={baseState:m.baseState,firstBaseUpdate:y,lastBaseUpdate:T,shared:m.shared,callbacks:m.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=l:a.next=l,u.lastBaseUpdate=l}var Pd=!1;function vc(){if(Pd){var a=jo;if(a!==null)throw a}}function Ac(a,l,u,m){Pd=!1;var y=a.updateQueue;ia=!1;var T=y.firstBaseUpdate,B=y.lastBaseUpdate,j=y.shared.pending;if(j!==null){y.shared.pending=null;var re=j,Ae=re.next;
vendor: 6,368 bytes, line 49
49re.next=null,B===null?T=Ae:B.next=Ae,B=re;var Pe=a.alternate;Pe!==null&&(Pe=Pe.updateQueue,j=Pe.lastBaseUpdate,j!==B&&(j===null?Pe.firstBaseUpdate=Ae:j.next=Ae,Pe.lastBaseUpdate=re))}if(T!==null){var Fe=y.baseState;B=0,Pe=Ae=re=null,j=T;do{var Se=j.lane&-536870913,Ce=Se!==j.lane;if(Ce?(jt&Se)===Se:(m&Se)===Se){Se!==0&&Se===Yo&&(Pd=!0),Pe!==null&&(Pe=Pe.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var lt=a,bt=j;Se=l;var Ti=u;switch(bt.tag){case 1:if(lt=bt.payload,typeof lt=="function"){Fe=lt.call(Ti,Fe,Se);break e}Fe=lt;break e;case 3:lt.flags=lt.flags&-65537|128;case 0:if(lt=bt.payload,Se=typeof lt=="function"?lt.call(Ti,Fe,Se):lt,Se==null)break e;Fe=d({},Fe,Se);break e;case 2:ia=!0}}Se=j.callback,Se!==null&&(a.flags|=64,Ce&&(a.flags|=8192),Ce=y.callbacks,Ce===null?y.callbacks=[Se]:Ce.push(Se))}else Ce={lane:Se,tag:j.tag,payload:j.payload,callback:j.callback,next:null},Pe===null?(Ae=Pe=Ce,re=Fe):Pe=Pe.next=Ce,B|=Se;if(j=j.next,j===null){if(j=y.shared.pending,j===null)break;Ce=j,j=Ce.next,Ce.next=null,y.lastBaseUpdate=Ce,y.shared.pending=null}}while(!0);Pe===null&&(re=Fe),y.baseState=re,y.firstBaseUpdate=Ae,y.lastBaseUpdate=Pe,T===null&&(y.shared.lanes=0),ca|=B,a.lanes=B,a.memoizedState=Fe}}function Vg(a,l){if(typeof a!="function")throw Error(i(191,a));a.call(l)}function Gg(a,l){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)Vg(u[a],l)}var Zo=F(null),Mu=F(0);function Hg(a,l){a=Rr,N(Mu,a),N(Zo,l),Rr=a|l.baseLanes}function Od(){N(Mu,Rr),N(Zo,Zo.current)}function wd(){Rr=Mu.current,A(Zo),A(Mu)}var Xs=F(null),_n=null;function ra(a){var l=a.alternate;N(Gi,Gi.current&1),N(Xs,a),_n===null&&(l===null||Zo.current!==null||l.memoizedState!==null)&&(_n=a)}function Fd(a){N(Gi,Gi.current),N(Xs,a),_n===null&&(_n=a)}function Wg(a){a.tag===22?(N(Gi,Gi.current),N(Xs,a),_n===null&&(_n=a)):aa()}function aa(){N(Gi,Gi.current),N(Xs,Xs.current)}function Ys(a){A(Xs),_n===a&&(_n=null),A(Gi)}var Gi=F(0);function Cu(a){for(var l=a;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||z_(u)||V_(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var pr=0,Dt=null,bi=null,qi=null,Iu=!1,Qo=!1,Qa=!1,Du=0,Rc=0,$o=null,NR=0;function Ui(){throw Error(i(321))}function Ld(a,l){if(l===null)return!1;for(var u=0;u<l.length&&u<a.length;u++)if(!ps(a[u],l[u]))return!1;return!0}function Bd(a,l,u,m,y,T){return pr=T,Dt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,X.H=a===null||a.memoizedState===null?Mp:Qd,Qa=!1,T=u(m,y),Qa=!1,Qo&&(T=Yg(l,u,m,y)),Xg(a),T}function Xg(a){X.H=Cc;var l=bi!==null&&bi.next!==null;if(pr=0,qi=bi=Dt=null,Iu=!1,Rc=0,$o=null,l)throw Error(i(300));a===null||Ki||(a=a.dependencies,a!==null&&xu(a)&&(Ki=!0))}function Yg(a,l,u,m){Dt=a;var y=0;do{if(Qo&&($o=null),Rc=0,Qo=!1,25<=y)throw Error(i(301));if(y+=1,qi=bi=null,a.updateQueue!=null){var T=a.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}X.H=Cp,T=l(u,m)}while(Qo);return T}function UR(){var a=X.H,l=a.useState()[0];return l=typeof l.then=="function"?Sc(l):l,a=a.useState()[0],(bi!==null?bi.memoizedState:null)!==a&&(Dt.flags|=1024),l}function Nd(){var a=Du!==0;return Du=0,a}function Ud(a,l,u){l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~u}function kd(a){if(Iu){for(a=a.memoizedState;a!==null;){var l=a.queue;l!==null&&(l.pending=null),a=a.next}Iu=!1}pr=0,qi=bi=Dt=null,Qo=!1,Rc=Du=0,$o=null}function Ms(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qi===null?Dt.memoizedState=qi=a:qi=qi.next=a,qi}function Hi(){if(bi===null){var a=Dt.alternate;a=a!==null?a.memoizedState:null}else a=bi.next;var l=qi===null?Dt.memoizedState:qi.next;if(l!==null)qi=l,bi=a;else{if(a===null)throw Dt.alternate===null?Error(i(467)):Error(i(310));bi=a,a={memoizedState:bi.memoizedState,baseState:bi.baseState,baseQueue:bi.baseQueue,queue:bi.queue,next:null},qi===null?Dt.memoizedState=qi=a:qi=qi.next=a}return qi}function Pu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sc(a){var l=Rc;return Rc+=1,$o===null&&($o=[]),a=Bg($o,a,l),l=Dt,(qi===null?l.memoizedState:qi.next)===null&&(l=l.alternate,X.H=l===null||l.memoizedState===null?Mp:Qd),a}function Ou(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Sc(a);if(a.$$typeof===R)return hs(a)}throw Error(i(438,String(a)))}function zd(a){var l=null,u=Dt.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var m=Dt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(l={data:m.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=Pu(),Dt.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(a),m=0;m<a;m++)u[m]=H;return l.index++,u}function yr(a,l){return typeof l=="function"?l(a):l}function wu(a){var l=Hi();return Vd(l,bi,a)}function Vd(a,l,u){var m=a.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=u;var y=a.baseQueue,T=m.pending;if(T!==null){if(y!==null){var B=y.next;y.next=T.next,T.next=B}l.baseQueue=y=T,m.pending=null}if(T=a.baseState,y===null)a.memoizedState=T;else{l=y.next;var j=B=null,re=null,Ae=l,Pe=!1;do{var Fe=Ae.lane&-536870913;if(Fe!==Ae.lane?(jt&Fe)===Fe:(pr&Fe)===Fe){var Se=Ae.revertLane;if(Se===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null}),Fe===Yo&&(Pe=!0);else if((pr&Se)===Se){Ae=Ae.next,Se===Yo&&(Pe=!0);continue}else Fe={lane:0,revertLane:Ae.revertLane,gesture:null,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null},re===null?(j=re=Fe,B=T):re=re.next=Fe,Dt.lanes|=Se,ca|=Se;Fe=Ae.action,Qa&&u(T,Fe),T=Ae.hasEagerState?Ae.eagerState:u(T,Fe)}else Se={lane:Fe,revertLane:Ae.revertLane,gesture:Ae.gesture,action:Ae.action,hasEagerState:Ae.hasEagerState,eagerState:Ae.eagerState,next:null},re===null?(j=re=Se,B=T):re=re.next=Se,Dt.lanes|=Fe,ca|=Fe;Ae=Ae.next}
vendor: 9,539 bytes, line 49
49while(Ae!==null&&Ae!==l);if(re===null?B=T:re.next=j,!ps(T,a.memoizedState)&&(Ki=!0,Pe&&(u=jo,u!==null)))throw u;a.memoizedState=T,a.baseState=B,a.baseQueue=re,m.lastRenderedState=T}return y===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function Gd(a){var l=Hi(),u=l.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=a;var m=u.dispatch,y=u.pending,T=l.memoizedState;if(y!==null){u.pending=null;var B=y=y.next;do T=a(T,B.action),B=B.next;while(B!==y);ps(T,l.memoizedState)||(Ki=!0),l.memoizedState=T,l.baseQueue===null&&(l.baseState=T),u.lastRenderedState=T}return[T,m]}function jg(a,l,u){var m=Dt,y=Hi(),T=Jt;if(T){if(u===void 0)throw Error(i(407));u=u()}else u=l();var B=!ps((bi||y).memoizedState,u);if(B&&(y.memoizedState=u,Ki=!0),y=y.queue,Xd(Zg.bind(null,m,y,a),[a]),y.getSnapshot!==l||B||qi!==null&&qi.memoizedState.tag&1){if(m.flags|=2048,Jo(9,{destroy:void 0},Kg.bind(null,m,y,u,l),null),Ei===null)throw Error(i(349));T||(pr&127)!==0||qg(m,l,u)}return u}function qg(a,l,u){a.flags|=16384,a={getSnapshot:l,value:u},l=Dt.updateQueue,l===null?(l=Pu(),Dt.updateQueue=l,l.stores=[a]):(u=l.stores,u===null?l.stores=[a]:u.push(a))}function Kg(a,l,u,m){l.value=u,l.getSnapshot=m,Qg(l)&&$g(a)}function Zg(a,l,u){return u(function(){Qg(l)&&$g(a)})}function Qg(a){var l=a.getSnapshot;a=a.value;try{var u=l();return!ps(a,u)}catch{return!0}}function $g(a){var l=rt(a,2);l!==null&&Us(l,a,2)}function Hd(a){var l=Ms();if(typeof a=="function"){var u=a;if(a=u(),Qa){di(!0);try{u()}finally{di(!1)}}}return l.memoizedState=l.baseState=a,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yr,lastRenderedState:a},l}function Jg(a,l,u,m){return a.baseState=u,Vd(a,bi,typeof m=="function"?m:yr)}function kR(a,l,u,m,y){if(Bu(a))throw Error(i(485));if(a=l.action,a!==null){var T={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){T.listeners.push(B)}};X.T!==null?u(!0):T.isTransition=!1,m(T),u=l.pending,u===null?(T.next=l.pending=T,ep(l,T)):(T.next=u.next,l.pending=u.next=T)}}function ep(a,l){var u=l.action,m=l.payload,y=a.state;if(l.isTransition){var T=X.T,B={};X.T=B;try{var j=u(y,m),re=X.S;re!==null&&re(B,j),tp(a,l,j)}catch(Ae){Wd(a,l,Ae)}finally{T!==null&&B.types!==null&&(T.types=B.types),X.T=T}}else try{T=u(y,m),tp(a,l,T)}catch(Ae){Wd(a,l,Ae)}}function tp(a,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){ip(a,l,m)},function(m){return Wd(a,l,m)}):ip(a,l,u)}function ip(a,l,u){l.status="fulfilled",l.value=u,sp(l),a.state=u,l=a.pending,l!==null&&(u=l.next,u===l?a.pending=null:(u=u.next,l.next=u,ep(a,u)))}function Wd(a,l,u){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do l.status="rejected",l.reason=u,sp(l),l=l.next;while(l!==m)}a.action=null}function sp(a){a=a.listeners;for(var l=0;l<a.length;l++)(0,a[l])()}function np(a,l){return l}function rp(a,l){if(Jt){var u=Ei.formState;if(u!==null){e:{var m=Dt;if(Jt){if(Ii){t:{for(var y=Ii,T=dn;y.nodeType!==8;){if(!T){y=null;break t}if(y=mn(y.nextSibling),y===null){y=null;break t}}T=y.data,y=T==="F!"||T==="F"?y:null}if(y){Ii=mn(y.nextSibling),m=y.data==="F!";break e}}ea(m)}m=!1}m&&(l=u[0])}}return u=Ms(),u.memoizedState=u.baseState=l,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:np,lastRenderedState:l},u.queue=m,u=Ap.bind(null,Dt,m),m.dispatch=u,m=Hd(!1),T=Zd.bind(null,Dt,!1,m.queue),m=Ms(),y={state:l,dispatch:null,action:a,pending:null},m.queue=y,u=kR.bind(null,Dt,y,T,u),y.dispatch=u,m.memoizedState=a,[l,u,!1]}function ap(a){var l=Hi();return op(l,bi,a)}function op(a,l,u){if(l=Vd(a,l,np)[0],a=wu(yr)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var m=Sc(l)}catch(B){throw B===qo?vu:B}else m=l;l=Hi();var y=l.queue,T=y.dispatch;return u!==l.memoizedState&&(Dt.flags|=2048,Jo(9,{destroy:void 0},zR.bind(null,y,u),null)),[m,T,a]}function zR(a,l){a.action=l}function lp(a){var l=Hi(),u=bi;if(u!==null)return op(l,u,a);Hi(),l=l.memoizedState,u=Hi();var m=u.queue.dispatch;return u.memoizedState=a,[l,m,!1]}function Jo(a,l,u,m){return a={tag:a,create:u,deps:m,inst:l,next:null},l=Dt.updateQueue,l===null&&(l=Pu(),Dt.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=a.next=a:(m=u.next,u.next=a,a.next=m,l.lastEffect=a),a}function cp(){return Hi().memoizedState}function Fu(a,l,u,m){var y=Ms();Dt.flags|=a,y.memoizedState=Jo(1|l,{destroy:void 0},u,m===void 0?null:m)}function Lu(a,l,u,m){var y=Hi();m=m===void 0?null:m;var T=y.memoizedState.inst;bi!==null&&m!==null&&Ld(m,bi.memoizedState.deps)?y.memoizedState=Jo(l,T,u,m):(Dt.flags|=a,y.memoizedState=Jo(1|l,T,u,m))}function hp(a,l){Fu(8390656,8,a,l)}function Xd(a,l){Lu(2048,8,a,l)}function VR(a){Dt.flags|=4;var l=Dt.updateQueue;if(l===null)l=Pu(),Dt.updateQueue=l,l.events=[a];else{var u=l.events;u===null?l.events=[a]:u.push(a)}}function up(a){var l=Hi().memoizedState;return VR({ref:l,nextImpl:a}),function(){if((fi&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function fp(a,l){return Lu(4,2,a,l)}function dp(a,l){return Lu(4,4,a,l)}function _p(a,l){if(typeof l=="function"){a=a();var u=l(a);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function mp(a,l,u){u=u!=null?u.concat([a]):null,Lu(4,4,_p.bind(null,l,a),u)}function Yd(){}function gp(a,l){var u=Hi();l=l===void 0?null:l;var m=u.memoizedState;return l!==null&&Ld(l,m[1])?m[0]:(u.memoizedState=[a,l],a)}function pp(a,l){var u=Hi();l=l===void 0?null:l;var m=u.memoizedState;if(l!==null&&Ld(l,m[1]))return m[0];if(m=a(),Qa){di(!0);try{a()}finally{di(!1)}}return u.memoizedState=[m,l],m}function jd(a,l,u){return u===void 0||(pr&1073741824)!==0&&(jt&261930)===0?a.memoizedState=l:(a.memoizedState=u,a=yy(),Dt.lanes|=a,ca|=a,u)}function yp(a,l,u,m){return ps(u,l)?u:Zo.current!==null?(a=jd(a,u,m),ps(a,l)||(Ki=!0),a):(pr&42)===0||(pr&1073741824)!==0&&(jt&261930)===0?(Ki=!0,a.memoizedState=u):(a=yy(),Dt.lanes|=a,ca|=a,l)}function bp(a,l,u,m,y){var T=q.p;q.p=T!==0&&8>T?T:8;var B=X.T,j={};X.T=j,Zd(a,!1,l,u);try{var re=y(),Ae=X.S;if(Ae!==null&&Ae(j,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var Pe=BR(re,m);Mc(a,l,Pe,Ks(a))}else Mc(a,l,m,Ks(a))}catch(Fe){Mc(a,l,{then:function(){},status:"rejected",reason:Fe},Ks())}finally{q.p=T,B!==null&&j.types!==null&&(B.types=j.types),X.T=B}}function GR(){}function qd(a,l,u,m){if(a.tag!==5)throw Error(i(476));var y=xp(a).queue;bp(a,y,l,W,u===null?GR:function(){return Tp(a),u(m)})}function xp(a){var l=a.memoizedState;if(l!==null)return l;l={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yr,lastRenderedState:W},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yr,lastRenderedState:u},next:null},a.memoizedState=l,a=a.alternate,a!==null&&(a.memoizedState=l),l}function Tp(a){var l=xp(a);l.next===null&&(l=a.alternate.memoizedState),Mc(a,l.next.queue,{},Ks())}function Kd(){return hs(Wc)}function Ep(){return Hi().memoizedState}function vp(){return Hi().memoizedState}function HR(a){for(var l=a.return;l!==null;){switch(l.tag){case 24:case 3:var u=Ks();a=sa(u);var m=na(l,a,u);m!==null&&(Us(m,l,u),Ec(m,l,u)),l={cache:Ad()},a.payload=l;return}l=l.return}}function WR(a,l,u){var m=Ks();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bu(a)?Rp(l,u):(u=ys(a,l,u,m),u!==null&&(Us(u,a,m),Sp(u,l,m)))}function Ap(a,l,u){var m=Ks();Mc(a,l,u,m)}function Mc(a,l,u,m){var y={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Bu(a))Rp(l,y);else{var T=a.alternate;if(a.lanes===0&&(T===null||T.lanes===0)&&(T=l.lastRenderedReducer,T!==null))try{var B=l.lastRenderedState,j=T(B,u);if(y.hasEagerState=!0,y.eagerState=j,ps(j,B))return En(a,l,y,0),Ei===null&&on(),!1}catch{}finally{}if(u=ys(a,l,y,m),u!==null)return Us(u,a,m),Sp(u,l,m),!0}return!1}function Zd(a,l,u,m){if(m={lane:2,revertLane:C_(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Bu(a)){if(l)throw Error(i(479))}else l=ys(a,u,m,2),l!==null&&Us(l,a,2)}function Bu(a){var l=a.alternate;return a===Dt||l!==null&&l===Dt}function Rp(a,l){Qo=Iu=!0;var u=a.pending;u===null?l.next=l:(l.next=u.next,u.next=l),a.pending=l}function Sp(a,l,u){if((u&4194048)!==0){var m=l.lanes;m&=a.pendingLanes,u|=m,l.lanes=u,wt(a,u)}}var Cc={readContext:hs,use:Ou,useCallback:Ui,useContext:Ui,useEffect:Ui,useImperativeHandle:Ui,useLayoutEffect:Ui,useInsertionEffect:Ui,useMemo:Ui,useReducer:Ui,useRef:Ui,useState:Ui,useDebugValue:Ui,useDeferredValue:Ui,useTransition:Ui,useSyncExternalStore:Ui,useId:Ui,useHostTransitionStatus:Ui,useFormState:Ui,useActionState:Ui,useOptimistic:Ui,useMemoCache:Ui,useCacheRefresh:Ui};Cc.useEffectEvent=Ui;var Mp={readContext:hs,use:Ou,useCallback:function(a,l){return Ms().memoizedState=[a,l===void 0?null:l],a},useContext:hs,useEffect:hp,useImperativeHandle:function(a,l,u){u=u!=null?u.concat([a]):null,Fu(4194308,4,_p.bind(null,l,a),u)},useLayoutEffect:function(a,l){return Fu(4194308,4,a,l)},useInsertionEffect:function(a,l){Fu(4,2,a,l)},useMemo:function(a,l){var u=Ms();l=l===void 0?null:l;var m=a();if(Qa){di(!0);try{a()}finally{di(!1)}}return u.memoizedState=[m,l],m},useReducer:function(a,l,u){var m=Ms();if(u!==void 0){var y=u(l);if(Qa){di(!0);try{u(l)}finally{di(!1)}}}else y=l;return m.memoizedState=m.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},m.queue=a,a=a.dispatch=WR.bind(null,Dt,a),[m.memoizedState,a]}
vendor: 8,501 bytes, line 49
49,useRef:function(a){var l=Ms();return a={current:a},l.memoizedState=a},useState:function(a){a=Hd(a);var l=a.queue,u=Ap.bind(null,Dt,l);return l.dispatch=u,[a.memoizedState,u]},useDebugValue:Yd,useDeferredValue:function(a,l){var u=Ms();return jd(u,a,l)},useTransition:function(){var a=Hd(!1);return a=bp.bind(null,Dt,a.queue,!0,!1),Ms().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,l,u){var m=Dt,y=Ms();if(Jt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=l(),Ei===null)throw Error(i(349));(jt&127)!==0||qg(m,l,u)}y.memoizedState=u;var T={value:u,getSnapshot:l};return y.queue=T,hp(Zg.bind(null,m,T,a),[a]),m.flags|=2048,Jo(9,{destroy:void 0},Kg.bind(null,m,T,u,l),null),u},useId:function(){var a=Ms(),l=Ei.identifierPrefix;if(Jt){var u=kn,m=Un;u=(m&~(1<<32-_i(m)-1)).toString(32)+u,l="_"+l+"R_"+u,u=Du++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=NR++,l="_"+l+"r_"+u.toString(32)+"_";return a.memoizedState=l},useHostTransitionStatus:Kd,useFormState:rp,useActionState:rp,useOptimistic:function(a){var l=Ms();l.memoizedState=l.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Zd.bind(null,Dt,!0,u),u.dispatch=l,[a,l]},useMemoCache:zd,useCacheRefresh:function(){return Ms().memoizedState=HR.bind(null,Dt)},useEffectEvent:function(a){var l=Ms(),u={impl:a};return l.memoizedState=u,function(){if((fi&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Qd={readContext:hs,use:Ou,useCallback:gp,useContext:hs,useEffect:Xd,useImperativeHandle:mp,useInsertionEffect:fp,useLayoutEffect:dp,useMemo:pp,useReducer:wu,useRef:cp,useState:function(){return wu(yr)},useDebugValue:Yd,useDeferredValue:function(a,l){var u=Hi();return yp(u,bi.memoizedState,a,l)},useTransition:function(){var a=wu(yr)[0],l=Hi().memoizedState;return[typeof a=="boolean"?a:Sc(a),l]},useSyncExternalStore:jg,useId:Ep,useHostTransitionStatus:Kd,useFormState:ap,useActionState:ap,useOptimistic:function(a,l){var u=Hi();return Jg(u,bi,a,l)},useMemoCache:zd,useCacheRefresh:vp};Qd.useEffectEvent=up;var Cp={readContext:hs,use:Ou,useCallback:gp,useContext:hs,useEffect:Xd,useImperativeHandle:mp,useInsertionEffect:fp,useLayoutEffect:dp,useMemo:pp,useReducer:Gd,useRef:cp,useState:function(){return Gd(yr)},useDebugValue:Yd,useDeferredValue:function(a,l){var u=Hi();return bi===null?jd(u,a,l):yp(u,bi.memoizedState,a,l)},useTransition:function(){var a=Gd(yr)[0],l=Hi().memoizedState;return[typeof a=="boolean"?a:Sc(a),l]},useSyncExternalStore:jg,useId:Ep,useHostTransitionStatus:Kd,useFormState:lp,useActionState:lp,useOptimistic:function(a,l){var u=Hi();return bi!==null?Jg(u,bi,a,l):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:zd,useCacheRefresh:vp};Cp.useEffectEvent=up;function $d(a,l,u,m){l=a.memoizedState,u=u(m,l),u=u==null?l:d({},l,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var Jd={enqueueSetState:function(a,l,u){a=a._reactInternals;var m=Ks(),y=sa(m);y.payload=l,u!=null&&(y.callback=u),l=na(a,y,m),l!==null&&(Us(l,a,m),Ec(l,a,m))},enqueueReplaceState:function(a,l,u){a=a._reactInternals;var m=Ks(),y=sa(m);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=na(a,y,m),l!==null&&(Us(l,a,m),Ec(l,a,m))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var u=Ks(),m=sa(u);m.tag=2,l!=null&&(m.callback=l),l=na(a,m,u),l!==null&&(Us(l,a,u),Ec(l,a,u))}};function Ip(a,l,u,m,y,T,B){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,T,B):l.prototype&&l.prototype.isPureReactComponent?!Zr(u,m)||!Zr(y,T):!0}function Dp(a,l,u,m){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,m),l.state!==a&&Jd.enqueueReplaceState(l,l.state,null)}function $a(a,l){var u=l;if("ref"in l){u={};for(var m in l)m!=="ref"&&(u[m]=l[m])}if(a=a.defaultProps){u===l&&(u=d({},u));for(var y in a)u[y]===void 0&&(u[y]=a[y])}return u}function Pp(a){Bt(a)}function Op(a){console.error(a)}function wp(a){Bt(a)}function Nu(a,l){try{var u=a.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(m){setTimeout(function(){throw m})}}function Fp(a,l,u){try{var m=a.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function e_(a,l,u){return u=sa(u),u.tag=3,u.payload={element:null},u.callback=function(){Nu(a,l)},u}function Lp(a){return a=sa(a),a.tag=3,a}function Bp(a,l,u,m){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var T=m.value;a.payload=function(){return y(T)},a.callback=function(){Fp(l,u,m)}}var B=u.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(a.callback=function(){Fp(l,u,m),typeof y!="function"&&(ha===null?ha=new Set([this]):ha.add(this));var j=m.stack;this.componentDidCatch(m.value,{componentStack:j!==null?j:""})})}function XR(a,l,u,m,y){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(l=u.alternate,l!==null&&Xo(l,u,y,!0),u=Xs.current,u!==null){switch(u.tag){case 31:case 13:return _n===null?Ku():u.alternate===null&&ki===0&&(ki=3),u.flags&=-257,u.flags|=65536,u.lanes=y,m===Au?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([m]):l.add(m),R_(a,m,y)),!1;case 22:return u.flags|=65536,m===Au?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([m]):u.add(m)),R_(a,m,y)),!1}throw Error(i(435,u.tag))}return R_(a,m,y),Ku(),!1}if(Jt)return l=Xs.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,m!==bd&&(a=Error(i(422),{cause:m}),pc(hn(a,u)))):(m!==bd&&(l=Error(i(423),{cause:m}),pc(hn(l,u))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,m=hn(m,u),y=e_(a.stateNode,m,y),Dd(a,y),ki!==4&&(ki=2)),!1;var T=Error(i(520),{cause:m});if(T=hn(T,u),Bc===null?Bc=[T]:Bc.push(T),ki!==4&&(ki=2),l===null)return!0;m=hn(m,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,a=y&-y,u.lanes|=a,a=e_(u.stateNode,m,a),Dd(u,a),!1;case 1:if(l=u.type,T=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(ha===null||!ha.has(T))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Lp(y),Bp(y,a,u,m),Dd(u,y),!1}u=u.return}while(u!==null);return!1}var t_=Error(i(461)),Ki=!1;function us(a,l,u,m){l.child=a===null?zg(l,null,u,m):Za(l,a.child,u,m)}function Np(a,l,u,m,y){u=u.render;var T=l.ref;if("ref"in m){var B={};for(var j in m)j!=="ref"&&(B[j]=m[j])}else B=m;return Ya(l),m=Bd(a,l,u,B,T,y),j=Nd(),a!==null&&!Ki?(Ud(a,l,y),br(a,l,y)):(Jt&&j&&pd(l),l.flags|=1,us(a,l,m,y),l.child)}function Up(a,l,u,m,y){if(a===null){var T=u.type;return typeof T=="function"&&!zo(T)&&T.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=T,kp(a,l,T,m,y)):(a=Vo(u.type,null,m,l,l.mode,y),a.ref=l.ref,a.return=l,l.child=a)}if(T=a.child,!c_(a,y)){var B=T.memoizedProps;if(u=u.compare,u=u!==null?u:Zr,u(B,m)&&a.ref===l.ref)return br(a,l,y)}return l.flags|=1,a=ln(T,m),a.ref=l.ref,a.return=l,l.child=a}function kp(a,l,u,m,y){if(a!==null){var T=a.memoizedProps;if(Zr(T,m)&&a.ref===l.ref)if(Ki=!1,l.pendingProps=m=T,c_(a,y))(a.flags&131072)!==0&&(Ki=!0);else return l.lanes=a.lanes,br(a,l,y)}return i_(a,l,u,m,y)}function zp(a,l,u,m){var y=m.children,T=a!==null?a.memoizedState:null;if(a===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((l.flags&128)!==0){if(T=T!==null?T.baseLanes|u:u,a!==null){for(m=l.child=a.child,y=0;m!==null;)y=y|m.lanes|m.childLanes,m=m.sibling;m=y&~T}else m=0,l.child=null;return Vp(a,l,T,u,m)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},a!==null&&Eu(l,T!==null?T.cachePool:null),T!==null?Hg(l,T):Od(),Wg(l);else return m=l.lanes=536870912,Vp(a,l,T!==null?T.baseLanes|u:u,u,m)}else T!==null?(Eu(l,T.cachePool),Hg(l,T),aa(),l.memoizedState=null):(a!==null&&Eu(l,null),Od(),aa());return us(a,l,y,u),l.child}function Ic(a,l){return a!==null&&a.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function Vp(a,l,u,m,y){var T=Sd();return T=T===null?null:{parent:ji._currentValue,pool:T},l.memoizedState={baseLanes:u,cachePool:T},a!==null&&Eu(l,null),Od(),Wg(l),a!==null&&Xo(a,l,m,!0),l.childLanes=y,null}function Uu(a,l){return l=zu({mode:l.mode,children:l.children},a.mode),l.ref=a.ref,a.child=l,l.return=a,l}
vendor: 4,184 bytes, line 49
49function Gp(a,l,u){return Za(l,a.child,null,u),a=Uu(l,l.pendingProps),a.flags|=2,Ys(l),l.memoizedState=null,a}function YR(a,l,u){var m=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,a===null){if(Jt){if(m.mode==="hidden")return a=Uu(l,m),l.lanes=536870912,Ic(null,a);if(Fd(l),(a=Ii)?(a=eb(a,dn),a=a!==null&&a.data==="&"?a:null,a!==null&&(l.memoizedState={dehydrated:a,treeContext:$r!==null?{id:Un,overflow:kn}:null,retryLane:536870912,hydrationErrors:null},u=mc(a),u.return=l,l.child=u,cs=l,Ii=null)):a=null,a===null)throw ea(l);return l.lanes=536870912,null}return Uu(l,m)}var T=a.memoizedState;if(T!==null){var B=T.dehydrated;if(Fd(l),y)if(l.flags&256)l.flags&=-257,l=Gp(a,l,u);else if(l.memoizedState!==null)l.child=a.child,l.flags|=128,l=null;else throw Error(i(558));else if(Ki||Xo(a,l,u,!1),y=(u&a.childLanes)!==0,Ki||y){if(m=Ei,m!==null&&(B=li(m,u),B!==0&&B!==T.retryLane))throw T.retryLane=B,rt(a,B),Us(m,a,B),t_;Ku(),l=Gp(a,l,u)}else a=T.treeContext,Ii=mn(B.nextSibling),cs=l,Jt=!0,Jr=null,dn=!1,a!==null&&Cg(l,a),l=Uu(l,m),l.flags|=4096;return l}return a=ln(a.child,{mode:m.mode,children:m.children}),a.ref=l.ref,l.child=a,a.return=l,a}function ku(a,l){var u=l.ref;if(u===null)a!==null&&a.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(a===null||a.ref!==u)&&(l.flags|=4194816)}}function i_(a,l,u,m,y){return Ya(l),u=Bd(a,l,u,m,void 0,y),m=Nd(),a!==null&&!Ki?(Ud(a,l,y),br(a,l,y)):(Jt&&m&&pd(l),l.flags|=1,us(a,l,u,y),l.child)}function Hp(a,l,u,m,y,T){return Ya(l),l.updateQueue=null,u=Yg(l,m,u,y),Xg(a),m=Nd(),a!==null&&!Ki?(Ud(a,l,T),br(a,l,T)):(Jt&&m&&pd(l),l.flags|=1,us(a,l,u,T),l.child)}function Wp(a,l,u,m,y){if(Ya(l),l.stateNode===null){var T=ls,B=u.contextType;typeof B=="object"&&B!==null&&(T=hs(B)),T=new u(m,T),l.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=Jd,l.stateNode=T,T._reactInternals=l,T=l.stateNode,T.props=m,T.state=l.memoizedState,T.refs={},Cd(l),B=u.contextType,T.context=typeof B=="object"&&B!==null?hs(B):ls,T.state=l.memoizedState,B=u.getDerivedStateFromProps,typeof B=="function"&&($d(l,u,B,m),T.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(B=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),B!==T.state&&Jd.enqueueReplaceState(T,T.state,null),Ac(l,m,T,y),vc(),T.state=l.memoizedState),typeof T.componentDidMount=="function"&&(l.flags|=4194308),m=!0}else if(a===null){T=l.stateNode;var j=l.memoizedProps,re=$a(u,j);T.props=re;var Ae=T.context,Pe=u.contextType;B=ls,typeof Pe=="object"&&Pe!==null&&(B=hs(Pe));var Fe=u.getDerivedStateFromProps;Pe=typeof Fe=="function"||typeof T.getSnapshotBeforeUpdate=="function",j=l.pendingProps!==j,Pe||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(j||Ae!==B)&&Dp(l,T,m,B),ia=!1;var Se=l.memoizedState;T.state=Se,Ac(l,m,T,y),vc(),Ae=l.memoizedState,j||Se!==Ae||ia?(typeof Fe=="function"&&($d(l,u,Fe,m),Ae=l.memoizedState),(re=ia||Ip(l,u,re,m,Se,Ae,B))?(Pe||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(l.flags|=4194308)):(typeof T.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=Ae),T.props=m,T.state=Ae,T.context=B,m=re):(typeof T.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{T=l.stateNode,Id(a,l),B=l.memoizedProps,Pe=$a(u,B),T.props=Pe,Fe=l.pendingProps,Se=T.context,Ae=u.contextType,re=ls,typeof Ae=="object"&&Ae!==null&&(re=hs(Ae)),j=u.getDerivedStateFromProps,(Ae=typeof j=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(B!==Fe||Se!==re)&&Dp(l,T,m,re),ia=!1,Se=l.memoizedState,T.state=Se,Ac(l,m,T,y),vc();
vendor: 3,940 bytes, line 49
49var Ce=l.memoizedState;B!==Fe||Se!==Ce||ia||a!==null&&a.dependencies!==null&&xu(a.dependencies)?(typeof j=="function"&&($d(l,u,j,m),Ce=l.memoizedState),(Pe=ia||Ip(l,u,Pe,m,Se,Ce,re)||a!==null&&a.dependencies!==null&&xu(a.dependencies))?(Ae||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(m,Ce,re),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(m,Ce,re)),typeof T.componentDidUpdate=="function"&&(l.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof T.componentDidUpdate!="function"||B===a.memoizedProps&&Se===a.memoizedState||(l.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||B===a.memoizedProps&&Se===a.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=Ce),T.props=m,T.state=Ce,T.context=re,m=Pe):(typeof T.componentDidUpdate!="function"||B===a.memoizedProps&&Se===a.memoizedState||(l.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||B===a.memoizedProps&&Se===a.memoizedState||(l.flags|=1024),m=!1)}return T=m,ku(a,l),m=(l.flags&128)!==0,T||m?(T=l.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:T.render(),l.flags|=1,a!==null&&m?(l.child=Za(l,a.child,null,y),l.child=Za(l,null,u,y)):us(a,l,u,y),l.memoizedState=T.state,a=l.child):a=br(a,l,y),a}function Xp(a,l,u,m){return Wa(),l.flags|=256,us(a,l,u,m),l.child}var s_={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function n_(a){return{baseLanes:a,cachePool:Fg()}}function r_(a,l,u){return a=a!==null?a.childLanes&~u:0,l&&(a|=qs),a}function Yp(a,l,u){var m=l.pendingProps,y=!1,T=(l.flags&128)!==0,B;if((B=T)||(B=a!==null&&a.memoizedState===null?!1:(Gi.current&2)!==0),B&&(y=!0,l.flags&=-129),B=(l.flags&32)!==0,l.flags&=-33,a===null){if(Jt){if(y?ra(l):aa(),(a=Ii)?(a=eb(a,dn),a=a!==null&&a.data!=="&"?a:null,a!==null&&(l.memoizedState={dehydrated:a,treeContext:$r!==null?{id:Un,overflow:kn}:null,retryLane:536870912,hydrationErrors:null},u=mc(a),u.return=l,l.child=u,cs=l,Ii=null)):a=null,a===null)throw ea(l);return V_(a)?l.lanes=32:l.lanes=536870912,null}var j=m.children;return m=m.fallback,y?(aa(),y=l.mode,j=zu({mode:"hidden",children:j},y),m=cn(m,y,u,null),j.return=l,m.return=l,j.sibling=m,l.child=j,m=l.child,m.memoizedState=n_(u),m.childLanes=r_(a,B,u),l.memoizedState=s_,Ic(null,m)):(ra(l),a_(l,j))}var re=a.memoizedState;if(re!==null&&(j=re.dehydrated,j!==null)){if(T)l.flags&256?(ra(l),l.flags&=-257,l=o_(a,l,u)):l.memoizedState!==null?(aa(),l.child=a.child,l.flags|=128,l=null):(aa(),j=m.fallback,y=l.mode,m=zu({mode:"visible",children:m.children},y),j=cn(j,y,u,null),j.flags|=2,m.return=l,j.return=l,m.sibling=j,l.child=m,Za(l,a.child,null,u),m=l.child,m.memoizedState=n_(u),m.childLanes=r_(a,B,u),l.memoizedState=s_,l=Ic(null,m));else if(ra(l),V_(j)){if(B=j.nextSibling&&j.nextSibling.dataset,B)var Ae=B.dgst;B=Ae,m=Error(i(419)),m.stack="",m.digest=B,pc({value:m,source:null,stack:null}),l=o_(a,l,u)}else if(Ki||Xo(a,l,u,!1),B=(u&a.childLanes)!==0,Ki||B){if(B=Ei,B!==null&&(m=li(B,u),m!==0&&m!==re.retryLane))throw re.retryLane=m,rt(a,m),Us(B,a,m),t_;z_(j)||Ku(),l=o_(a,l,u)}else z_(j)?(l.flags|=192,l.child=a.child,l=null):(a=re.treeContext,Ii=mn(j.nextSibling),cs=l,Jt=!0,Jr=null,dn=!1,a!==null&&Cg(l,a),l=a_(l,m.children),l.flags|=4096);return l}return y?(aa(),j=m.fallback,y=l.mode,re=a.child,Ae=re.sibling,m=ln(re,{mode:"hidden",children:m.children}),m.subtreeFlags=re.subtreeFlags&65011712,Ae!==null?j=ln(Ae,j):(j=cn(j,y,u,null),j.flags|=2),j.return=l,m.return=l,m.sibling=j,l.child=m,Ic(null,m),m=l.child,j=a.child.memoizedState,j===null?j=n_(u):(y=j.cachePool,y!==null?(re=ji._currentValue,y=y.parent!==re?{parent:re,pool:re}:y):y=Fg(),j={baseLanes:j.baseLanes|u,cachePool:y}),m.memoizedState=j,m.childLanes=r_(a,B,u),l.memoizedState=s_,Ic(a.child,m)):(ra(l),u=a.child,a=u.sibling,u=ln(u,{mode:"visible",children:m.children}
vendor: 6,075 bytes, line 49
49),u.return=l,u.sibling=null,a!==null&&(B=l.deletions,B===null?(l.deletions=[a],l.flags|=16):B.push(a)),l.child=u,l.memoizedState=null,u)}function a_(a,l){return l=zu({mode:"visible",children:l},a.mode),l.return=a,a.child=l}function zu(a,l){return a=ss(22,a,null,l),a.lanes=0,a}function o_(a,l,u){return Za(l,a.child,null,u),a=a_(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function jp(a,l,u){a.lanes|=l;var m=a.alternate;m!==null&&(m.lanes|=l),Ed(a.return,l,u)}function l_(a,l,u,m,y,T){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:y,treeForkCount:T}:(B.isBackwards=l,B.rendering=null,B.renderingStartTime=0,B.last=m,B.tail=u,B.tailMode=y,B.treeForkCount=T)}function qp(a,l,u){var m=l.pendingProps,y=m.revealOrder,T=m.tail;m=m.children;var B=Gi.current,j=(B&2)!==0;if(j?(B=B&1|2,l.flags|=128):B&=1,N(Gi,B),us(a,l,m,u),m=Jt?gc:0,!j&&a!==null&&(a.flags&128)!==0)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&jp(a,u,l);else if(a.tag===19)jp(a,u,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(u=l.child,y=null;u!==null;)a=u.alternate,a!==null&&Cu(a)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),l_(l,!1,y,u,T,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(a=y.alternate,a!==null&&Cu(a)===null){l.child=y;break}a=y.sibling,y.sibling=u,u=y,y=a}l_(l,!0,u,null,T,m);break;case"together":l_(l,!1,null,null,void 0,m);break;default:l.memoizedState=null}return l.child}function br(a,l,u){if(a!==null&&(l.dependencies=a.dependencies),ca|=l.lanes,(u&l.childLanes)===0)if(a!==null){if(Xo(a,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(a!==null&&l.child!==a.child)throw Error(i(153));if(l.child!==null){for(a=l.child,u=ln(a,a.pendingProps),l.child=u,u.return=l;a.sibling!==null;)a=a.sibling,u=u.sibling=ln(a,a.pendingProps),u.return=l;u.sibling=null}return l.child}function c_(a,l){return(a.lanes&l)!==0?!0:(a=a.dependencies,!!(a!==null&&xu(a)))}function jR(a,l,u){switch(l.tag){case 3:Ie(l,l.stateNode.containerInfo),ta(l,ji,a.memoizedState.cache),Wa();break;case 27:case 5:J(l);break;case 4:Ie(l,l.stateNode.containerInfo);break;case 10:ta(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Fd(l),null;break;case 13:var m=l.memoizedState;if(m!==null)return m.dehydrated!==null?(ra(l),l.flags|=128,null):(u&l.child.childLanes)!==0?Yp(a,l,u):(ra(l),a=br(a,l,u),a!==null?a.sibling:null);ra(l);break;case 19:var y=(a.flags&128)!==0;if(m=(u&l.childLanes)!==0,m||(Xo(a,l,u,!1),m=(u&l.childLanes)!==0),y){if(m)return qp(a,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),N(Gi,Gi.current),m)break;return null;case 22:return l.lanes=0,zp(a,l,u,l.pendingProps);case 24:ta(l,ji,a.memoizedState.cache)}return br(a,l,u)}function Kp(a,l,u){if(a!==null)if(a.memoizedProps!==l.pendingProps)Ki=!0;else{if(!c_(a,u)&&(l.flags&128)===0)return Ki=!1,jR(a,l,u);Ki=(a.flags&131072)!==0}else Ki=!1,Jt&&(l.flags&1048576)!==0&&Mg(l,gc,l.index);switch(l.lanes=0,l.tag){case 16:e:{var m=l.pendingProps;if(a=qa(l.elementType),l.type=a,typeof a=="function")zo(a)?(m=$a(a,m),l.tag=1,l=Wp(null,l,a,m,u)):(l.tag=0,l=i_(null,l,a,m,u));else{if(a!=null){var y=a.$$typeof;if(y===P){l.tag=11,l=Np(null,l,a,m,u);break e}else if(y===D){l.tag=14,l=Up(null,l,a,m,u);break e}}throw l=k(a)||a,Error(i(306,l,""))}}return l;case 0:return i_(a,l,l.type,l.pendingProps,u);case 1:return m=l.type,y=$a(m,l.pendingProps),Wp(a,l,m,y,u);case 3:e:{if(Ie(l,l.stateNode.containerInfo),a===null)throw Error(i(387));m=l.pendingProps;var T=l.memoizedState;y=T.element,Id(a,l),Ac(l,m,null,u);var B=l.memoizedState;if(m=B.cache,ta(l,ji,m),m!==T.cache&&vd(l,[ji],u,!0),vc(),m=B.element,T.isDehydrated)if(T={element:m,isDehydrated:!1,cache:B.cache},l.updateQueue.baseState=T,l.memoizedState=T,l.flags&256){l=Xp(a,l,m,u);break e}else if(m!==y){y=hn(Error(i(424)),l),pc(y),l=Xp(a,l,m,u);break e}else{switch(a=l.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Ii=mn(a.firstChild),cs=l,Jt=!0,Jr=null,dn=!0,u=zg(l,null,m,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Wa(),m===y){l=br(a,l,u);break e}us(a,l,m,u)}l=l.child}return l;case 26:return ku(a,l),a===null?(u=ab(l.type,null,l.pendingProps,null))?l.memoizedState=u:Jt||(u=l.type,a=l.pendingProps,m=sf(ue.current).createElement(u),m[Xi]=l,m[as]=a,fs(m,u,a),Vi(m),l.stateNode=m):l.memoizedState=ab(l.type,a.memoizedProps,l.pendingProps,a.memoizedState),null;case 27:return J(l),a===null&&Jt&&(m=l.stateNode=sb(l.type,l.pendingProps,ue.current),cs=l,dn=!0,y=Ii,_a(l.type)?(G_=y,Ii=mn(m.firstChild)):Ii=y),us(a,l,l.pendingProps.children,u),ku(a,l),a===null&&(l.flags|=4194304),l.child;case 5:return a===null&&Jt&&((y=m=Ii)&&(m=vS(m,l.type,l.pendingProps,dn),m!==null?(l.stateNode=m,cs=l,Ii=mn(m.firstChild),dn=!1,y=!0):y=!1),y||ea(l)),J(l),y=l.type,T=l.pendingProps,B=a!==null?a.memoizedProps:null,m=T.children,N_(y,T)?m=null:B!==null&&N_(y,B)&&(l.flags|=32),l.memoizedState!==null&&(y=Bd(a,l,UR,null,null,u),Wc._currentValue=y),ku(a,l),us(a,l,m,u),l.child;case 6:return a===null&&Jt&&((a=u=Ii)&&(u=AS(u,l.pendingProps,dn),u!==null?(l.stateNode=u,cs=l,Ii=null,a=!0):a=!1),a||ea(l)),null;case 13:return Yp(a,l,u);case 4:return Ie(l,l.stateNode.containerInfo),m=l.pendingProps,a===null?l.child=Za(l,null,m,u):us(a,l,m,u),l.child;case 11:return Np(a,l,l.type,l.pendingProps,u);case 7:return us(a,l,l.pendingProps,u),l.child;case 8:return us(a,l,l.pendingProps.children,u),l.child;case 12:return us(a,l,l.pendingProps.children,u),l.child;case 10:return m=l.pendingProps,ta(l,l.type,m.value),us(a,l,m.children,u),l.child;case 9:return y=l.type._context,m=l.pendingProps.children,Ya(l),y=hs(y),m=m(y),l.flags|=1,us(a,l,m,u),l.child;
vendor: 4,548 bytes, line 49
49case 14:return Up(a,l,l.type,l.pendingProps,u);case 15:return kp(a,l,l.type,l.pendingProps,u);case 19:return qp(a,l,u);case 31:return YR(a,l,u);case 22:return zp(a,l,u,l.pendingProps);case 24:return Ya(l),m=hs(ji),a===null?(y=Sd(),y===null&&(y=Ei,T=Ad(),y.pooledCache=T,T.refCount++,T!==null&&(y.pooledCacheLanes|=u),y=T),l.memoizedState={parent:m,cache:y},Cd(l),ta(l,ji,y)):((a.lanes&u)!==0&&(Id(a,l),Ac(l,null,null,u),vc()),y=a.memoizedState,T=l.memoizedState,y.parent!==m?(y={parent:m,cache:m},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),ta(l,ji,m)):(m=T.cache,ta(l,ji,m),m!==y.cache&&vd(l,[ji],u,!0))),us(a,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function xr(a){a.flags|=4}function h_(a,l,u,m,y){if((l=(a.mode&32)!==0)&&(l=!1),l){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(Ey())a.flags|=8192;else throw Ka=Au,Md}else a.flags&=-16777217}function Zp(a,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!ub(l))if(Ey())a.flags|=8192;else throw Ka=Au,Md}function Vu(a,l){l!==null&&(a.flags|=4),a.flags&16384&&(l=a.tag!==22?be():536870912,a.lanes|=l,sl|=l)}function Dc(a,l){if(!Jt)switch(a.tailMode){case"hidden":l=a.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Di(a){var l=a.alternate!==null&&a.alternate.child===a.child,u=0,m=0;if(l)for(var y=a.child;y!==null;)u|=y.lanes|y.childLanes,m|=y.subtreeFlags&65011712,m|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)u|=y.lanes|y.childLanes,m|=y.subtreeFlags,m|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=m,a.childLanes=u,l}function qR(a,l,u){var m=l.pendingProps;switch(yd(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Di(l),null;case 1:return Di(l),null;case 3:return u=l.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),l.memoizedState.cache!==m&&(l.flags|=2048),gr(ji),Le(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(Wo(l)?xr(l):a===null||a.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,xd())),Di(l),null;case 26:var y=l.type,T=l.memoizedState;return a===null?(xr(l),T!==null?(Di(l),Zp(l,T)):(Di(l),h_(l,y,null,m,u))):T?T!==a.memoizedState?(xr(l),Di(l),Zp(l,T)):(Di(l),l.flags&=-16777217):(a=a.memoizedProps,a!==m&&xr(l),Di(l),h_(l,y,a,m,u)),null;case 27:if(_e(l),u=ue.current,y=l.type,a!==null&&l.stateNode!=null)a.memoizedProps!==m&&xr(l);else{if(!m){if(l.stateNode===null)throw Error(i(166));return Di(l),null}a=Y.current,Wo(l)?Ig(l):(a=sb(y,m,u),l.stateNode=a,xr(l))}return Di(l),null;case 5:if(_e(l),y=l.type,a!==null&&l.stateNode!=null)a.memoizedProps!==m&&xr(l);else{if(!m){if(l.stateNode===null)throw Error(i(166));return Di(l),null}if(T=Y.current,Wo(l))Ig(l);else{var B=sf(ue.current);switch(T){case 1:T=B.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:T=B.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":T=B.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":T=B.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":T=B.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof m.is=="string"?B.createElement("select",{is:m.is}):B.createElement("select"),m.multiple?T.multiple=!0:m.size&&(T.size=m.size);break;default:T=typeof m.is=="string"?B.createElement(y,{is:m.is}):B.createElement(y)}}T[Xi]=l,T[as]=m;e:for(B=l.child;B!==null;){if(B.tag===5||B.tag===6)T.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===l)break e;for(;B.sibling===null;){if(B.return===null||B.return===l)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}l.stateNode=T;e:switch(fs(T,y,m),y){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&xr(l)}}return Di(l),h_(l,l.type,a===null?null:a.memoizedProps,l.pendingProps,u),null;case 6:if(a&&l.stateNode!=null)a.memoizedProps!==m&&xr(l);else{if(typeof m!="string"&&l.stateNode===null)throw Error(i(166));if(a=ue.current,Wo(l)){if(a=l.stateNode,u=l.memoizedProps,m=null,y=cs,y!==null)switch(y.tag){case 27:case 5:m=y.memoizedProps}
vendor: 25,332 bytes, line 49
49a[Xi]=l,a=!!(a.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||Yy(a.nodeValue,u)),a||ea(l,!0)}else a=sf(a).createTextNode(m),a[Xi]=l,l.stateNode=a}return Di(l),null;case 31:if(u=l.memoizedState,a===null||a.memoizedState!==null){if(m=Wo(l),u!==null){if(a===null){if(!m)throw Error(i(318));if(a=l.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[Xi]=l}else Wa(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Di(l),a=!1}else u=xd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return l.flags&256?(Ys(l),l):(Ys(l),null);if((l.flags&128)!==0)throw Error(i(558))}return Di(l),null;case 13:if(m=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Wo(l),m!==null&&m.dehydrated!==null){if(a===null){if(!y)throw Error(i(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Xi]=l}else Wa(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Di(l),y=!1}else y=xd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Ys(l),l):(Ys(l),null)}return Ys(l),(l.flags&128)!==0?(l.lanes=u,l):(u=m!==null,a=a!==null&&a.memoizedState!==null,u&&(m=l.child,y=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(y=m.alternate.memoizedState.cachePool.pool),T=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),T!==y&&(m.flags|=2048)),u!==a&&u&&(l.child.flags|=8192),Vu(l,l.updateQueue),Di(l),null);case 4:return Le(),a===null&&O_(l.stateNode.containerInfo),Di(l),null;case 10:return gr(l.type),Di(l),null;case 19:if(A(Gi),m=l.memoizedState,m===null)return Di(l),null;if(y=(l.flags&128)!==0,T=m.rendering,T===null)if(y)Dc(m,!1);else{if(ki!==0||a!==null&&(a.flags&128)!==0)for(a=l.child;a!==null;){if(T=Cu(a),T!==null){for(l.flags|=128,Dc(m,!1),a=T.updateQueue,l.updateQueue=a,Vu(l,a),l.subtreeFlags=0,a=u,u=l.child;u!==null;)gu(u,a),u=u.sibling;return N(Gi,Gi.current&1|2),Jt&&_r(l,m.treeForkCount),l.child}a=a.sibling}m.tail!==null&&ze()>Yu&&(l.flags|=128,y=!0,Dc(m,!1),l.lanes=4194304)}else{if(!y)if(a=Cu(T),a!==null){if(l.flags|=128,y=!0,a=a.updateQueue,l.updateQueue=a,Vu(l,a),Dc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!T.alternate&&!Jt)return Di(l),null}else 2*ze()-m.renderingStartTime>Yu&&u!==536870912&&(l.flags|=128,y=!0,Dc(m,!1),l.lanes=4194304);m.isBackwards?(T.sibling=l.child,l.child=T):(a=m.last,a!==null?a.sibling=T:l.child=T,m.last=T)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=ze(),a.sibling=null,u=Gi.current,N(Gi,y?u&1|2:u&1),Jt&&_r(l,m.treeForkCount),a):(Di(l),null);case 22:case 23:return Ys(l),wd(),m=l.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(l.flags|=8192):m&&(l.flags|=8192),m?(u&536870912)!==0&&(l.flags&128)===0&&(Di(l),l.subtreeFlags&6&&(l.flags|=8192)):Di(l),u=l.updateQueue,u!==null&&Vu(l,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==u&&(l.flags|=2048),a!==null&&A(ja),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),gr(ji),Di(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function KR(a,l){switch(yd(l),l.tag){case 1:return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return gr(ji),Le(),a=l.flags,(a&65536)!==0&&(a&128)===0?(l.flags=a&-65537|128,l):null;case 26:case 27:case 5:return _e(l),null;case 31:if(l.memoizedState!==null){if(Ys(l),l.alternate===null)throw Error(i(340));Wa()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 13:if(Ys(l),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(i(340));Wa()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return A(Gi),null;case 4:return Le(),null;case 10:return gr(l.type),null;case 22:case 23:return Ys(l),wd(),a!==null&&A(ja),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 24:return gr(ji),null;case 25:return null;default:return null}}function Qp(a,l){switch(yd(l),l.tag){case 3:gr(ji),Le();break;case 26:case 27:case 5:_e(l);break;case 4:Le();break;case 31:l.memoizedState!==null&&Ys(l);break;case 13:Ys(l);break;case 19:A(Gi);break;case 10:gr(l.type);break;case 22:case 23:Ys(l),wd(),a!==null&&A(ja);break;case 24:gr(ji)}}function Pc(a,l){try{var u=l.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var y=m.next;u=y;do{if((u.tag&a)===a){m=void 0;var T=u.create,B=u.inst;m=T(),B.destroy=m}u=u.next}while(u!==y)}}catch(j){gi(l,l.return,j)}}function oa(a,l,u){try{var m=l.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var T=y.next;m=T;do{if((m.tag&a)===a){var B=m.inst,j=B.destroy;if(j!==void 0){B.destroy=void 0,y=l;var re=u,Ae=j;try{Ae()}catch(Pe){gi(y,re,Pe)}}}m=m.next}while(m!==T)}}catch(Pe){gi(l,l.return,Pe)}}function $p(a){var l=a.updateQueue;if(l!==null){var u=a.stateNode;try{Gg(l,u)}catch(m){gi(a,a.return,m)}}}function Jp(a,l,u){u.props=$a(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(m){gi(a,l,m)}}function Oc(a,l){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof u=="function"?a.refCleanup=u(m):u.current=m}}catch(y){gi(a,l,y)}}function zn(a,l){var u=a.ref,m=a.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(y){gi(a,l,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){gi(a,l,y)}else u.current=null}function ey(a){var l=a.type,u=a.memoizedProps,m=a.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break e;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(y){gi(a,a.return,y)}}function u_(a,l,u){try{var m=a.stateNode;pS(m,a.type,u,l),m[as]=l}catch(y){gi(a,a.return,y)}}function ty(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&_a(a.type)||a.tag===4}function f_(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||ty(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&_a(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function d_(a,l,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(a),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=rn));else if(m!==4&&(m===27&&_a(a.type)&&(u=a.stateNode,l=null),a=a.child,a!==null))for(d_(a,l,u),a=a.sibling;a!==null;)d_(a,l,u),a=a.sibling}function Gu(a,l,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,l?u.insertBefore(a,l):u.appendChild(a);else if(m!==4&&(m===27&&_a(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Gu(a,l,u),a=a.sibling;a!==null;)Gu(a,l,u),a=a.sibling}function iy(a){var l=a.stateNode,u=a.memoizedProps;try{for(var m=a.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);fs(l,m,u),l[Xi]=a,l[as]=u}catch(T){gi(a,a.return,T)}}var Tr=!1,Zi=!1,__=!1,sy=typeof WeakSet=="function"?WeakSet:Set,ns=null;function ZR(a,l){if(a=a.containerInfo,L_=hf,a=cc(a),Bo(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var y=m.anchorOffset,T=m.focusNode;m=m.focusOffset;try{u.nodeType,T.nodeType}catch{u=null;break e}var B=0,j=-1,re=-1,Ae=0,Pe=0,Fe=a,Se=null;t:for(;;){for(var Ce;Fe!==u||y!==0&&Fe.nodeType!==3||(j=B+y),Fe!==T||m!==0&&Fe.nodeType!==3||(re=B+m),Fe.nodeType===3&&(B+=Fe.nodeValue.length),(Ce=Fe.firstChild)!==null;)Se=Fe,Fe=Ce;for(;;){if(Fe===a)break t;if(Se===u&&++Ae===y&&(j=B),Se===T&&++Pe===m&&(re=B),(Ce=Fe.nextSibling)!==null)break;Fe=Se,Se=Fe.parentNode}Fe=Ce}u=j===-1||re===-1?null:{start:j,end:re}}else u=null}u=u||{start:0,end:0}}else u=null;for(B_={focusedElem:a,selectionRange:u},hf=!1,ns=l;ns!==null;)if(l=ns,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,ns=a;else for(;ns!==null;){switch(l=ns,T=l.alternate,a=l.flags,l.tag){case 0:if((a&4)!==0&&(a=l.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)y=a[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&T!==null){a=void 0,u=l,y=T.memoizedProps,T=T.memoizedState,m=u.stateNode;try{var lt=$a(u.type,y);a=m.getSnapshotBeforeUpdate(lt,T),m.__reactInternalSnapshotBeforeUpdate=a}catch(bt){gi(u,u.return,bt)}}break;case 3:if((a&1024)!==0){if(a=l.stateNode.containerInfo,u=a.nodeType,u===9)k_(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":k_(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=l.sibling,a!==null){a.return=l.return,ns=a;break}ns=l.return}}function ny(a,l,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:vr(a,u),m&4&&Pc(5,u);break;case 1:if(vr(a,u),m&4)if(a=u.stateNode,l===null)try{a.componentDidMount()}catch(B){gi(u,u.return,B)}else{var y=$a(u.type,l.memoizedProps);l=l.memoizedState;try{a.componentDidUpdate(y,l,a.__reactInternalSnapshotBeforeUpdate)}catch(B){gi(u,u.return,B)}}m&64&&$p(u),m&512&&Oc(u,u.return);break;case 3:if(vr(a,u),m&64&&(a=u.updateQueue,a!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{Gg(a,l)}catch(B){gi(u,u.return,B)}}break;case 27:l===null&&m&4&&iy(u);case 26:case 5:vr(a,u),l===null&&m&4&&ey(u),m&512&&Oc(u,u.return);break;case 12:vr(a,u);break;case 31:vr(a,u),m&4&&oy(a,u);break;case 13:vr(a,u),m&4&&ly(a,u),m&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=rS.bind(null,u),RS(a,u))));break;case 22:if(m=u.memoizedState!==null||Tr,!m){l=l!==null&&l.memoizedState!==null||Zi,y=Tr;var T=Zi;Tr=m,(Zi=l)&&!T?Ar(a,u,(u.subtreeFlags&8772)!==0):vr(a,u),Tr=y,Zi=T}break;case 30:break;default:vr(a,u)}}function ry(a){var l=a.alternate;l!==null&&(a.alternate=null,ry(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&bo(l)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Oi=null,Fs=!1;function Er(a,l,u){for(u=u.child;u!==null;)ay(a,l,u),u=u.sibling}function ay(a,l,u){if(ri&&typeof ri.onCommitFiberUnmount=="function")try{ri.onCommitFiberUnmount(Ht,u)}catch{}switch(u.tag){case 26:Zi||zn(u,l),Er(a,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Zi||zn(u,l);var m=Oi,y=Fs;_a(u.type)&&(Oi=u.stateNode,Fs=!1),Er(a,l,u),Vc(u.stateNode),Oi=m,Fs=y;break;case 5:Zi||zn(u,l);case 6:if(m=Oi,y=Fs,Oi=null,Er(a,l,u),Oi=m,Fs=y,Oi!==null)if(Fs)try{(Oi.nodeType===9?Oi.body:Oi.nodeName==="HTML"?Oi.ownerDocument.body:Oi).removeChild(u.stateNode)}catch(T){gi(u,l,T)}else try{Oi.removeChild(u.stateNode)}catch(T){gi(u,l,T)}break;case 18:Oi!==null&&(Fs?(a=Oi,$y(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),ul(a)):$y(Oi,u.stateNode));break;case 4:m=Oi,y=Fs,Oi=u.stateNode.containerInfo,Fs=!0,Er(a,l,u),Oi=m,Fs=y;break;case 0:case 11:case 14:case 15:oa(2,u,l),Zi||oa(4,u,l),Er(a,l,u);break;case 1:Zi||(zn(u,l),m=u.stateNode,typeof m.componentWillUnmount=="function"&&Jp(u,l,m)),Er(a,l,u);break;case 21:Er(a,l,u);break;case 22:Zi=(m=Zi)||u.memoizedState!==null,Er(a,l,u),Zi=m;break;default:Er(a,l,u)}}function oy(a,l){if(l.memoizedState===null&&(a=l.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{ul(a)}catch(u){gi(l,l.return,u)}}}function ly(a,l){if(l.memoizedState===null&&(a=l.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{ul(a)}catch(u){gi(l,l.return,u)}}function QR(a){switch(a.tag){case 31:case 13:case 19:var l=a.stateNode;return l===null&&(l=a.stateNode=new sy),l;case 22:return a=a.stateNode,l=a._retryCache,l===null&&(l=a._retryCache=new sy),l;default:throw Error(i(435,a.tag))}}function Hu(a,l){var u=QR(a);l.forEach(function(m){if(!u.has(m)){u.add(m);var y=aS.bind(null,a,m);m.then(y,y)}})}function Ls(a,l){var u=l.deletions;if(u!==null)for(var m=0;m<u.length;m++){var y=u[m],T=a,B=l,j=B;e:for(;j!==null;){switch(j.tag){case 27:if(_a(j.type)){Oi=j.stateNode,Fs=!1;break e}break;case 5:Oi=j.stateNode,Fs=!1;break e;case 3:case 4:Oi=j.stateNode.containerInfo,Fs=!0;break e}j=j.return}if(Oi===null)throw Error(i(160));ay(T,B,y),Oi=null,Fs=!1,T=y.alternate,T!==null&&(T.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)cy(l,a),l=l.sibling}var An=null;function cy(a,l){var u=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Ls(l,a),Bs(a),m&4&&(oa(3,a,a.return),Pc(3,a),oa(5,a,a.return));break;case 1:Ls(l,a),Bs(a),m&512&&(Zi||u===null||zn(u,u.return)),m&64&&Tr&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var y=An;if(Ls(l,a),Bs(a),m&512&&(Zi||u===null||zn(u,u.return)),m&4){var T=u!==null?u.memoizedState:null;if(m=a.memoizedState,u===null)if(m===null)if(a.stateNode===null){e:{m=a.type,u=a.memoizedProps,y=y.ownerDocument||y;t:switch(m){case"title":T=y.getElementsByTagName("title")[0],(!T||T[Vr]||T[Xi]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=y.createElement(m),y.head.insertBefore(T,y.querySelector("head > title"))),fs(T,m,u),T[Xi]=a,Vi(T),m=T;break e;case"link":var B=cb("link","href",y).get(m+(u.href||""));if(B){for(var j=0;j<B.length;j++)if(T=B[j],T.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&T.getAttribute("rel")===(u.rel==null?null:u.rel)&&T.getAttribute("title")===(u.title==null?null:u.title)&&T.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){B.splice(j,1);break t}}T=y.createElement(m),fs(T,m,u),y.head.appendChild(T);break;case"meta":if(B=cb("meta","content",y).get(m+(u.content||""))){for(j=0;j<B.length;j++)if(T=B[j],T.getAttribute("content")===(u.content==null?null:""+u.content)&&T.getAttribute("name")===(u.name==null?null:u.name)&&T.getAttribute("property")===(u.property==null?null:u.property)&&T.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&T.getAttribute("charset")===(u.charSet==null?null:u.charSet)){B.splice(j,1);break t}}T=y.createElement(m),fs(T,m,u),y.head.appendChild(T);break;default:throw Error(i(468,m))}T[Xi]=a,Vi(T),m=T}a.stateNode=m}else hb(y,a.type,a.stateNode);else a.stateNode=lb(y,m,a.memoizedProps);else T!==m?(T===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):T.count--,m===null?hb(y,a.type,a.stateNode):lb(y,m,a.memoizedProps)):m===null&&a.stateNode!==null&&u_(a,a.memoizedProps,u.memoizedProps)}break;case 27:Ls(l,a),Bs(a),m&512&&(Zi||u===null||zn(u,u.return)),u!==null&&m&4&&u_(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Ls(l,a),Bs(a),m&512&&(Zi||u===null||zn(u,u.return)),a.flags&32){y=a.stateNode;try{or(y,"")}catch(lt){gi(a,a.return,lt)}}m&4&&a.stateNode!=null&&(y=a.memoizedProps,u_(a,y,u!==null?u.memoizedProps:y)),m&1024&&(__=!0);break;case 6:if(Ls(l,a),Bs(a),m&4){if(a.stateNode===null)throw Error(i(162));m=a.memoizedProps,u=a.stateNode;try{u.nodeValue=m}catch(lt){gi(a,a.return,lt)}}break;case 3:if(af=null,y=An,An=nf(l.containerInfo),Ls(l,a),An=y,Bs(a),m&4&&u!==null&&u.memoizedState.isDehydrated)try{ul(l.containerInfo)}catch(lt){gi(a,a.return,lt)}__&&(__=!1,hy(a));break;case 4:m=An,An=nf(a.stateNode.containerInfo),Ls(l,a),Bs(a),An=m;break;case 12:Ls(l,a),Bs(a);break;case 31:Ls(l,a),Bs(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Hu(a,m)));break;case 13:Ls(l,a),Bs(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Xu=ze()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Hu(a,m)));break;case 22:y=a.memoizedState!==null;var re=u!==null&&u.memoizedState!==null,Ae=Tr,Pe=Zi;if(Tr=Ae||y,Zi=Pe||re,Ls(l,a),Zi=Pe,Tr=Ae,Bs(a),m&8192)e:for(l=a.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||re||Tr||Zi||Ja(a)),u=null,l=a;;){if(l.tag===5||l.tag===26){if(u===null){re=u=l;try{if(T=re.stateNode,y)B=T.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{j=re.stateNode;var Fe=re.memoizedProps.style,Se=Fe!=null&&Fe.hasOwnProperty("display")?Fe.display:null;j.style.display=Se==null||typeof Se=="boolean"?"":(""+Se).trim()}}catch(lt){gi(re,re.return,lt)}}}else if(l.tag===6){if(u===null){re=l;try{re.stateNode.nodeValue=y?"":re.memoizedProps}catch(lt){gi(re,re.return,lt)}}}else if(l.tag===18){if(u===null){re=l;try{var Ce=re.stateNode;y?Jy(Ce,!0):Jy(re.stateNode,!1)}catch(lt){gi(re,re.return,lt)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===a)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}m&4&&(m=a.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,Hu(a,u))));break;case 19:Ls(l,a),Bs(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Hu(a,m)));break;case 30:break;case 21:break;default:Ls(l,a),Bs(a)}}function Bs(a){var l=a.flags;if(l&2){try{for(var u,m=a.return;m!==null;){if(ty(m)){u=m;break}m=m.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var y=u.stateNode,T=f_(a);Gu(a,T,y);break;case 5:var B=u.stateNode;u.flags&32&&(or(B,""),u.flags&=-33);var j=f_(a);Gu(a,j,B);break;case 3:case 4:var re=u.stateNode.containerInfo,Ae=f_(a);d_(a,Ae,re);break;default:throw Error(i(161))}}catch(Pe){gi(a,a.return,Pe)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function hy(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var l=a;hy(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),a=a.sibling}}function vr(a,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)ny(a,l.alternate,l),l=l.sibling}function Ja(a){for(a=a.child;a!==null;){var l=a;switch(l.tag){case 0:case 11:case 14:case 15:oa(4,l,l.return),Ja(l);break;case 1:zn(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&Jp(l,l.return,u),Ja(l);break;case 27:Vc(l.stateNode);case 26:case 5:zn(l,l.return),Ja(l);break;case 22:l.memoizedState===null&&Ja(l);break;case 30:Ja(l);break;default:Ja(l)}a=a.sibling}}function Ar(a,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var m=l.alternate,y=a,T=l,B=T.flags;switch(T.tag){case 0:case 11:case 15:Ar(y,T,u),Pc(4,T);break;case 1:if(Ar(y,T,u),m=T,y=m.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(Ae){gi(m,m.return,Ae)}if(m=T,y=m.updateQueue,y!==null){var j=m.stateNode;try{var re=y.shared.hiddenCallbacks;if(re!==null)for(y.shared.hiddenCallbacks=null,y=0;y<re.length;y++)Vg(re[y],j)}catch(Ae){gi(m,m.return,Ae)}}u&&B&64&&$p(T),Oc(T,T.return);break;case 27:iy(T);case 26:case 5:Ar(y,T,u),u&&m===null&&B&4&&ey(T),Oc(T,T.return);break;case 12:Ar(y,T,u);break;case 31:Ar(y,T,u),u&&B&4&&oy(y,T);break;case 13:Ar(y,T,u),u&&B&4&&ly(y,T);break;case 22:T.memoizedState===null&&Ar(y,T,u),Oc(T,T.return);break;case 30:break;default:Ar(y,T,u)}l=l.sibling}}function m_(a,l){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&yc(u))}function g_(a,l){a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&yc(a))}function Rn(a,l,u,m){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)uy(a,l,u,m),l=l.sibling}function uy(a,l,u,m){var y=l.flags;switch(l.tag){case 0:case 11:case 15:Rn(a,l,u,m),y&2048&&Pc(9,l);break;case 1:Rn(a,l,u,m);break;case 3:Rn(a,l,u,m),y&2048&&(a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&yc(a)));break;case 12:if(y&2048){Rn(a,l,u,m),a=l.stateNode;try{var T=l.memoizedProps,B=T.id,j=T.onPostCommit;typeof j=="function"&&j(B,l.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(re){gi(l,l.return,re)}}else Rn(a,l,u,m);break;case 31:Rn(a,l,u,m);break;case 13:Rn(a,l,u,m);break;case 23:break;case 22:T=l.stateNode,B=l.alternate,l.memoizedState!==null?T._visibility&2?Rn(a,l,u,m):wc(a,l):T._visibility&2?Rn(a,l,u,m):(T._visibility|=2,el(a,l,u,m,(l.subtreeFlags&10256)!==0||!1)),y&2048&&m_(B,l);break;case 24:Rn(a,l,u,m),y&2048&&g_(l.alternate,l);break;default:Rn(a,l,u,m)}}function el(a,l,u,m,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var T=a,B=l,j=u,re=m,Ae=B.flags;switch(B.tag){case 0:case 11:case 15:el(T,B,j,re,y),Pc(8,B);break;case 23:break;case 22:var Pe=B.stateNode;B.memoizedState!==null?Pe._visibility&2?el(T,B,j,re,y):wc(T,B):(Pe._visibility|=2,el(T,B,j,re,y)),y&&Ae&2048&&m_(B.alternate,B);break;case 24:el(T,B,j,re,y),y&&Ae&2048&&g_(B.alternate,B);break;default:el(T,B,j,re,y)}l=l.sibling}}function wc(a,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=a,m=l,y=m.flags;switch(m.tag){case 22:wc(u,m),y&2048&&m_(m.alternate,m);break;case 24:wc(u,m),y&2048&&g_(m.alternate,m);break;default:wc(u,m)}l=l.sibling}}var Fc=8192;function tl(a,l,u){if(a.subtreeFlags&Fc)for(a=a.child;a!==null;)fy(a,l,u),a=a.sibling}function fy(a,l,u){switch(a.tag){case 26:tl(a,l,u),a.flags&Fc&&a.memoizedState!==null&&NS(u,An,a.memoizedState,a.memoizedProps);break;case 5:tl(a,l,u);break;case 3:case 4:var m=An;An=nf(a.stateNode.containerInfo),tl(a,l,u),An=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Fc,Fc=16777216,tl(a,l,u),Fc=m):tl(a,l,u));break;default:tl(a,l,u)}}function dy(a){var l=a.alternate;if(l!==null&&(a=l.child,a!==null)){l.child=null;do l=a.sibling,a.sibling=null,a=l;while(a!==null)}}function Lc(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var m=l[u];ns=m,my(m,a)}dy(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)_y(a),a=a.sibling}function _y(a){switch(a.tag){case 0:case 11:case 15:Lc(a),a.flags&2048&&oa(9,a,a.return);break;case 3:Lc(a);break;case 12:Lc(a);break;case 22:var l=a.stateNode;a.memoizedState!==null&&l._visibility&2&&(a.return===null||a.return.tag!==13)?(l._visibility&=-3,Wu(a)):Lc(a);break;default:Lc(a)}}function Wu(a){var l=a.deletions;if((a.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var m=l[u];ns=m,my(m,a)}dy(a)}for(a=a.child;a!==null;){switch(l=a,l.tag){case 0:case 11:case 15:oa(8,l,l.return),Wu(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Wu(l));break;default:Wu(l)}a=a.sibling}}function my(a,l){for(;ns!==null;){var u=ns;switch(u.tag){case 0:case 11:case 15:oa(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:yc(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,ns=m;else e:for(u=a;ns!==null;){m=ns;var y=m.sibling,T=m.return;if(ry(m),m===u){ns=null;break e}if(y!==null){y.return=T,ns=y;break e}ns=T}}}var $R={getCacheForType:function(a){var l=hs(ji),u=l.data.get(a);return u===void 0&&(u=a(),l.data.set(a,u)),u},cacheSignal:function(){return hs(ji).controller.signal}},JR=typeof WeakMap=="function"?WeakMap:Map,fi=0,Ei=null,Wt=null,jt=0,mi=0,js=null,la=!1,il=!1,p_=!1,Rr=0,ki=0,ca=0,eo=0,y_=0,qs=0,sl=0,Bc=null,Ns=null,b_=!1,Xu=0,gy=0,Yu=1/0,ju=null,ha=null,Ji=0,ua=null,nl=null,Sr=0,x_=0,T_=null,py=null,Nc=0,E_=null;function Ks(){return(fi&2)!==0&&jt!==0?jt&-jt:X.T!==null?C_():Hs()}function yy(){if(qs===0)if((jt&536870912)===0||Jt){var a=Q;Q<<=1,(Q&3932160)===0&&(Q=262144),qs=a}else qs=536870912;return a=Xs.current,a!==null&&(a.flags|=32),qs}function Us(a,l,u){(a===Ei&&(mi===2||mi===9)||a.cancelPendingCommit!==null)&&(rl(a,0),fa(a,jt,qs,!1)),Qe(a,u),((fi&2)===0||a!==Ei)&&(a===Ei&&((fi&2)===0&&(eo|=u),ki===4&&fa(a,jt,qs,!1)),Vn(a))}function by(a,l,u){if((fi&6)!==0)throw Error(i(327));var m=!u&&(l&127)===0&&(l&a.expiredLanes)===0||Me(a,l),y=m?iS(a,l):A_(a,l,!0),T=m;do{if(y===0){il&&!m&&fa(a,l,0,!1);break}else{if(u=a.current.alternate,T&&!eS(u)){y=A_(a,l,!1),T=!1;continue}if(y===2){if(T=l,a.errorRecoveryDisabledLanes&T)var B=0;else B=a.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){l=B;e:{var j=a;y=Bc;var re=j.current.memoizedState.isDehydrated;if(re&&(rl(j,B).flags|=256),B=A_(j,B,!1),B!==2){if(p_&&!re){j.errorRecoveryDisabledLanes|=T,eo|=T,y=4;break e}T=Ns,Ns=y,T!==null&&(Ns===null?Ns=T:Ns.push.apply(Ns,T))}y=B}if(T=!1,y!==2)continue}}if(y===1){rl(a,0),fa(a,l,0,!0);break}e:{switch(m=a,T=y,T){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:fa(m,l,qs,!la);break e;case 2:Ns=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(y=Xu+300-ze(),10<y)){if(fa(m,l,qs,!la),We(m,0,!0)!==0)break e;Sr=l,m.timeoutHandle=Zy(xy.bind(null,m,u,Ns,ju,b_,l,qs,eo,sl,la,T,"Throttled",-0,0),y);break e}xy(m,u,Ns,ju,b_,l,qs,eo,sl,la,T,null,-0,0)}}break}while(!0);Vn(a)}function xy(a,l,u,m,y,T,B,j,re,Ae,Pe,Fe,Se,Ce){if(a.timeoutHandle=-1,Fe=l.subtreeFlags,Fe&8192||(Fe&16
vendor: 15,287 bytes, line 49
49785408)===16785408){Fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rn},fy(l,T,Fe);var lt=(T&62914560)===T?Xu-ze():(T&4194048)===T?gy-ze():0;if(lt=US(Fe,lt),lt!==null){Sr=T,a.cancelPendingCommit=lt(Cy.bind(null,a,l,T,u,m,y,B,j,re,Pe,Fe,null,Se,Ce)),fa(a,T,B,!Ae);return}}Cy(a,l,T,u,m,y,B,j,re)}function eS(a){for(var l=a;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var y=u[m],T=y.getSnapshot;y=y.value;try{if(!ps(T(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function fa(a,l,u,m){l&=~y_,l&=~eo,a.suspendedLanes|=l,a.pingedLanes&=~l,m&&(a.warmLanes|=l),m=a.expirationTimes;for(var y=l;0<y;){var T=31-_i(y),B=1<<T;m[T]=-1,y&=~B}u!==0&&Ot(a,u,l)}function qu(){return(fi&6)===0?(Uc(0),!1):!0}function v_(){if(Wt!==null){if(mi===0)var a=Wt.return;else a=Wt,mr=Xa=null,kd(a),Ko=null,xc=0,a=Wt;for(;a!==null;)Qp(a.alternate,a),a=a.return;Wt=null}}function rl(a,l){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,xS(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),Sr=0,v_(),Ei=a,Wt=u=ln(a.current,null),jt=l,mi=0,js=null,la=!1,il=Me(a,l),p_=!1,sl=qs=y_=eo=ca=ki=0,Ns=Bc=null,b_=!1,(l&8)!==0&&(l|=l&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=l;0<m;){var y=31-_i(m),T=1<<y;l|=a[y],m&=~T}return Rr=l,on(),u}function Ty(a,l){Dt=null,X.H=Cc,l===qo||l===vu?(l=Ng(),mi=3):l===Md?(l=Ng(),mi=4):mi=l===t_?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,js=l,Wt===null&&(ki=1,Nu(a,hn(l,a.current)))}function Ey(){var a=Xs.current;return a===null?!0:(jt&4194048)===jt?_n===null:(jt&62914560)===jt||(jt&536870912)!==0?a===_n:!1}function vy(){var a=X.H;return X.H=Cc,a===null?Cc:a}function Ay(){var a=X.A;return X.A=$R,a}function Ku(){ki=4,la||(jt&4194048)!==jt&&Xs.current!==null||(il=!0),(ca&134217727)===0&&(eo&134217727)===0||Ei===null||fa(Ei,jt,qs,!1)}function A_(a,l,u){var m=fi;fi|=2;var y=vy(),T=Ay();(Ei!==a||jt!==l)&&(ju=null,rl(a,l)),l=!1;var B=ki;e:do try{if(mi!==0&&Wt!==null){var j=Wt,re=js;switch(mi){case 8:v_(),B=6;break e;case 3:case 2:case 9:case 6:Xs.current===null&&(l=!0);var Ae=mi;if(mi=0,js=null,al(a,j,re,Ae),u&&il){B=0;break e}break;default:Ae=mi,mi=0,js=null,al(a,j,re,Ae)}}tS(),B=ki;break}catch(Pe){Ty(a,Pe)}while(!0);return l&&a.shellSuspendCounter++,mr=Xa=null,fi=m,X.H=y,X.A=T,Wt===null&&(Ei=null,jt=0,on()),B}function tS(){for(;Wt!==null;)Ry(Wt)}function iS(a,l){var u=fi;fi|=2;var m=vy(),y=Ay();Ei!==a||jt!==l?(ju=null,Yu=ze()+500,rl(a,l)):il=Me(a,l);e:do try{if(mi!==0&&Wt!==null){l=Wt;var T=js;t:switch(mi){case 1:mi=0,js=null,al(a,l,T,1);break;case 2:case 9:if(Lg(T)){mi=0,js=null,Sy(l);break}l=function(){mi!==2&&mi!==9||Ei!==a||(mi=7),Vn(a)},T.then(l,l);break e;case 3:mi=7;break e;case 4:mi=5;break e;case 7:Lg(T)?(mi=0,js=null,Sy(l)):(mi=0,js=null,al(a,l,T,7));break;case 5:var B=null;switch(Wt.tag){case 26:B=Wt.memoizedState;case 5:case 27:var j=Wt;if(B?ub(B):j.stateNode.complete){mi=0,js=null;var re=j.sibling;if(re!==null)Wt=re;else{var Ae=j.return;Ae!==null?(Wt=Ae,Zu(Ae)):Wt=null}break t}}mi=0,js=null,al(a,l,T,5);break;case 6:mi=0,js=null,al(a,l,T,6);break;case 8:v_(),ki=6;break e;default:throw Error(i(462))}}sS();break}catch(Pe){Ty(a,Pe)}while(!0);return mr=Xa=null,X.H=m,X.A=y,fi=u,Wt!==null?0:(Ei=null,jt=0,on(),ki)}function sS(){for(;Wt!==null&&!nt();)Ry(Wt)}function Ry(a){var l=Kp(a.alternate,a,Rr);a.memoizedProps=a.pendingProps,l===null?Zu(a):Wt=l}function Sy(a){var l=a,u=l.alternate;switch(l.tag){case 15:case 0:l=Hp(u,l,l.pendingProps,l.type,void 0,jt);break;case 11:l=Hp(u,l,l.pendingProps,l.type.render,l.ref,jt);break;case 5:kd(l);default:Qp(u,l),l=Wt=gu(l,Rr),l=Kp(u,l,Rr)}a.memoizedProps=a.pendingProps,l===null?Zu(a):Wt=l}function al(a,l,u,m){mr=Xa=null,kd(l),Ko=null,xc=0;var y=l.return;try{if(XR(a,y,l,u,jt)){ki=1,Nu(a,hn(u,a.current)),Wt=null;return}}catch(T){if(y!==null)throw Wt=y,T;ki=1,Nu(a,hn(u,a.current)),Wt=null;return}l.flags&32768?(Jt||m===1?a=!0:il||(jt&536870912)!==0?a=!1:(la=a=!0,(m===2||m===9||m===3||m===6)&&(m=Xs.current,m!==null&&m.tag===13&&(m.flags|=16384))),My(l,a)):Zu(l)}function Zu(a){var l=a;do{if((l.flags&32768)!==0){My(l,la);return}a=l.return;var u=qR(l.alternate,l,Rr);if(u!==null){Wt=u;return}if(l=l.sibling,l!==null){Wt=l;return}Wt=l=a}while(l!==null);ki===0&&(ki=5)}function My(a,l){do{var u=KR(a.alternate,a);if(u!==null){u.flags&=32767,Wt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(a=a.sibling,a!==null)){Wt=a;return}Wt=a=u}while(a!==null);ki=6,Wt=null}function Cy(a,l,u,m,y,T,B,j,re){a.cancelPendingCommit=null;do Qu();while(Ji!==0);if((fi&6)!==0)throw Error(i(327));if(l!==null){if(l===a.current)throw Error(i(177));if(T=l.lanes|l.childLanes,T|=Ws,it(a,u,T,B,j,re),a===Ei&&(Wt=Ei=null,jt=0),nl=l,ua=a,Sr=u,x_=T,T_=y,py=m,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,oS(ti,function(){return wy(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||m){m=X.T,X.T=null,y=q.p,q.p=2,B=fi,fi|=4;try{ZR(a,l,u)}finally{fi=B,q.p=y,X.T=m}}Ji=1,Iy(),Dy(),Py()}}function Iy(){if(Ji===1){Ji=0;var a=ua,l=nl,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=X.T,X.T=null;var m=q.p;q.p=2;var y=fi;fi|=4;try{cy(l,a);var T=B_,B=cc(a.containerInfo),j=T.focusedElem,re=T.selectionRange;if(B!==j&&j&&j.ownerDocument&&lc(j.ownerDocument.documentElement,j)){if(re!==null&&Bo(j)){var Ae=re.start,Pe=re.end;if(Pe===void 0&&(Pe=Ae),"selectionStart"in j)j.selectionStart=Ae,j.selectionEnd=Math.min(Pe,j.value.length);else{var Fe=j.ownerDocument||document,Se=Fe&&Fe.defaultView||window;if(Se.getSelection){var Ce=Se.getSelection(),lt=j.textContent.length,bt=Math.min(re.start,lt),Ti=re.end===void 0?bt:Math.min(re.end,lt);!Ce.extend&&bt>Ti&&(B=Ti,Ti=bt,bt=B);var me=oc(j,bt),fe=oc(j,Ti);if(me&&fe&&(Ce.rangeCount!==1||Ce.anchorNode!==me.node||Ce.anchorOffset!==me.offset||Ce.focusNode!==fe.node||Ce.focusOffset!==fe.offset)){var ve=Fe.createRange();ve.setStart(me.node,me.offset),Ce.removeAllRanges(),bt>Ti?(Ce.addRange(ve),Ce.extend(fe.node,fe.offset)):(ve.setEnd(fe.node,fe.offset),Ce.addRange(ve))}}}}for(Fe=[],Ce=j;Ce=Ce.parentNode;)Ce.nodeType===1&&Fe.push({element:Ce,left:Ce.scrollLeft,top:Ce.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<Fe.length;j++){var we=Fe[j];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}hf=!!L_,B_=L_=null}finally{fi=y,q.p=m,X.T=u}}a.current=l,Ji=2}}function Dy(){if(Ji===2){Ji=0;var a=ua,l=nl,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=X.T,X.T=null;var m=q.p;q.p=2;var y=fi;fi|=4;try{ny(a,l.alternate,l)}finally{fi=y,q.p=m,X.T=u}}Ji=3}}function Py(){if(Ji===4||Ji===3){Ji=0,oe();var a=ua,l=nl,u=Sr,m=py;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Ji=5:(Ji=0,nl=ua=null,Oy(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(ha=null),Ni(u),l=l.stateNode,ri&&typeof ri.onCommitFiberRoot=="function")try{ri.onCommitFiberRoot(Ht,l,void 0,(l.current.flags&128)===128)}catch{}if(m!==null){l=X.T,y=q.p,q.p=2,X.T=null;try{for(var T=a.onRecoverableError,B=0;B<m.length;B++){var j=m[B];T(j.value,{componentStack:j.stack})}}finally{X.T=l,q.p=y}}(Sr&3)!==0&&Qu(),Vn(a),y=a.pendingLanes,(u&261930)!==0&&(y&42)!==0?a===E_?Nc++:(Nc=0,E_=a):Nc=0,Uc(0)}}function Oy(a,l){(a.pooledCacheLanes&=l)===0&&(l=a.pooledCache,l!=null&&(a.pooledCache=null,yc(l)))}function Qu(){return Iy(),Dy(),Py(),wy()}function wy(){if(Ji!==5)return!1;var a=ua,l=x_;x_=0;var u=Ni(Sr),m=X.T,y=q.p;try{q.p=32>u?32:u,X.T=null,u=T_,T_=null;var T=ua,B=Sr;if(Ji=0,nl=ua=null,Sr=0,(fi&6)!==0)throw Error(i(331));var j=fi;if(fi|=4,_y(T.current),uy(T,T.current,B,u),fi=j,Uc(0,!1),ri&&typeof ri.onPostCommitFiberRoot=="function")try{ri.onPostCommitFiberRoot(Ht,T)}catch{}return!0}finally{q.p=y,X.T=m,Oy(a,l)}}function Fy(a,l,u){l=hn(u,l),l=e_(a.stateNode,l,2),a=na(a,l,2),a!==null&&(Qe(a,2),Vn(a))}function gi(a,l,u){if(a.tag===3)Fy(a,a,u);else for(;l!==null;){if(l.tag===3){Fy(l,a,u);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(ha===null||!ha.has(m))){a=hn(u,a),u=Lp(2),m=na(l,u,2),m!==null&&(Bp(u,m,l,a),Qe(m,2),Vn(m));break}}l=l.return}}function R_(a,l,u){var m=a.pingCache;if(m===null){m=a.pingCache=new JR;var y=new Set;m.set(l,y)}else y=m.get(l),y===void 0&&(y=new Set,m.set(l,y));y.has(u)||(p_=!0,y.add(u),a=nS.bind(null,a,l,u),l.then(a,a))}function nS(a,l,u){var m=a.pingCache;m!==null&&m.delete(l),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Ei===a&&(jt&u)===u&&(ki===4||ki===3&&(jt&62914560)===jt&&300>ze()-Xu?(fi&2)===0&&rl(a,0):y_|=u,sl===jt&&(sl=0)),Vn(a)}function Ly(a,l){l===0&&(l=be()),a=rt(a,l),a!==null&&(Qe(a,l),Vn(a))}function rS(a){var l=a.memoizedState,u=0;l!==null&&(u=l.retryLane),Ly(a,u)}function aS(a,l){var u=0;switch(a.tag){case 31:case 13:var m=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(i(314))}m!==null&&m.delete(l),Ly(a,u)}function oS(a,l){return Gt(a,l)}var $u=null,ol=null,S_=!1,Ju=!1,M_=!1,da=0;function Vn(a){a!==ol&&a.next===null&&(ol===null?$u=ol=a:ol=ol.next=a),Ju=!0,S_||(S_=!0,cS())}function Uc(a,l){if(!M_&&Ju){M_=!0;do for(var u=!1,m=$u;m!==null;){if(a!==0){var y=m.pendingLanes;if(y===0)var T=0;else{var B=m.suspendedLanes,j=m.pingedLanes;T=(1<<31-_i(42|a)+1)-1,T&=y&~(B&~j),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(u=!0,ky(m,T))}else T=jt,T=We(m,m===Ei?T:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(T&3)===0||Me(m,T)||(u=!0,ky(m,T));m=m.next}while(u);M_=!1}}function lS(){By()}function By(){Ju=S_=!1;var a=0;da!==0&&bS()&&(a=da);for(var l=ze(),u=null,m=$u;m!==null;){var y=m.next,T=Ny(m,l);T===0?(m.next=null,u===null?$u=y:u.next=y,y===null&&(ol=u)):(u=m,(a!==0||(T&3)!==0)&&(Ju=!0)),m=y}Ji!==0&&Ji!==5||Uc(a),da!==0&&(da=0)}function Ny(a,l){for(var u=a.suspendedLanes,m=a.pingedLanes,y=a.expirationTimes,T=a.pendingLanes&-62914561;0<T;){var B=31-_i(T),j=1<<B,re=y[B];re===-1?((j&u)===0||(j&m)!==0)&&(y[B]=z(j,l)):re<=l&&(a.expiredLanes|=j),T&=~j}if(l=Ei,u=jt,u=We(a,a===l?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,u===0||a===l&&(mi===2||mi===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&zt(m),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||Me(a,u)){if(l=u&-u,l===a.callbackPriority)return l;switch(m!==null&&zt(m),Ni(u)){case 2:case 8:u=oi;break;case 32:u=ti;break;case 268435456:u=Ct;break;default:u=ti}return m=Uy.bind(null,a),u=Gt(u,m),a.callbackPriority=l,a.callbackNode=u,l}return m!==null&&m!==null&&zt(m),a.callbackPriority=2,a.callbackNode=null,2}function Uy(a,l){if(Ji!==0&&Ji!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Qu()&&a.callbackNode!==u)return null;var m=jt;return m=We(a,a===Ei?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(by(a,m,l),Ny(a,ze()),a.callbackNode!=null&&a.callbackNode===u?Uy.bind(null,a):null)}function ky(a,l){if(Qu())return null;by(a,l,!0)}function cS(){TS(function(){(fi&6)!==0?Gt($t,lS):By()})}function C_(){if(da===0){var a=Yo;a===0&&(a=St,St<<=1,(St&261888)===0&&(St=256)),da=a}return da}function zy(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Na(""+a)}function Vy(a,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,a.id&&u.setAttribute("form",a.id),l.parentNode.insertBefore(u,l),a=new FormData(a),u.parentNode.removeChild(u),a}function hS(a,l,u,m,y){if(l==="submit"&&u&&u.stateNode===y){var T=zy((y[as]||null).action),B=m.submitter;B&&(l=(l=B[as]||null)?zy(l.formAction):B.getAttribute("formAction"),l!==null&&(T=l,B=null));var j=new Va("action","action",null,m,y);a.push({event:j,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(da!==0){var re=B?Vy(y,B):new FormData(y);qd(u,{pending:!0,data:re,method:y.method,action:T},null,re)}}else typeof T=="function"&&(j.preventDefault(),re=B?Vy(y,B):new FormData(y),qd(u,{pending:!0,data:re,method:y.method,action:T},T,re))},currentTarget:y}]})}}for(var I_=0;I_<de.length;I_++){var D_=de[I_],uS=D_.toLowerCase(),fS=D_[0].toUpperCase()+D_.slice(1);ui(uS,"on"+fS)}ui(fc,"onAnimationEnd"),ui(dc,"onAnimationIteration"),ui(_c,"onAnimationStart"),ui("dblclick","onDoubleClick"),ui("focusin","onFocus"),ui("focusout","onBlur"),ui(du,"onTransitionRun"),ui(_u,"onTransitionStart"),ui(mu,"onTransitionCancel"),ui($e,"onTransitionEnd"),rr("onMouseEnter",["mouseout","mouseover"]),rr("onMouseLeave",["mouseout","mouseover"]),rr("onPointerEnter",["pointerout","pointerover"]),rr("onPointerLeave",["pointerout","pointerover"]),wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wn("onBeforeInput",["compositionend","keypress","textInput","paste"]),wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kc="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(" "),dS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kc));function Gy(a,l){l=(l&4)!==0;for(var u=0;u<a.length;u++){var m=a[u],y=m.event;m=m.listeners;e:{var T=void 0;if(l)for(var B=m.length-1;0<=B;B--){var j=m[B],re=j.instance,Ae=j.currentTarget;if(j=j.listener,re!==T&&y.isPropagationStopped())break e;T=j,y.currentTarget=Ae;try{T(y)}catch(Pe){Bt(Pe)}y.currentTarget=null,T=re}else for(B=0;B<m.length;B++){if(j=m[B],re=j.instance,Ae=j.currentTarget,j=j.listener,re!==T&&y.isPropagationStopped())break e;T=j,y.currentTarget=Ae;try{T(y)}catch(Pe){Bt(Pe)}y.currentTarget=null,T=re}}}}function Xt(a,l){var u=l[yo];u===void 0&&(u=l[yo]=new Set);var m=a+"__bubble";u.has(m)||(Hy(l,a,2,!1),u.add(m))}function P_(a,l,u){var m=0;l&&(m|=4),Hy(u,a,m,l)}var ef="_reactListening"+Math.random().toString(36).slice(2);function O_(a){if(!a[ef]){a[ef]=!0,Dl.forEach(function(u){u!=="selectionchange"&&(dS.has(u)||P_(u,!1,a),P_(u,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[ef]||(l[ef]=!0,P_("selectionchange",!1,l))}}function Hy(a,l,u,m){switch(yb(l)){case 2:var y=VS;break;case 8:y=GS;break;default:y=j_}u=y.bind(null,l,u,a),y=void 0,!Mo||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),m?y!==void 0?a.addEventListener(l,u,{capture:!0,passive:y}):a.addEventListener(l,u,!0):y!==void 0?a.addEventListener(l,u,{passive:y}):a.addEventListener(l,u,!1)}function w_(a,l,u,m,y){var T=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var B=m.tag;if(B===3||B===4){var j=m.stateNode.containerInfo;
vendor: 2,797 bytes, line 49
49if(j===y)break;if(B===4)for(B=m.return;B!==null;){var re=B.tag;if((re===3||re===4)&&B.stateNode.containerInfo===y)return;B=B.return}for(;j!==null;){if(B=ir(j),B===null)return;if(re=B.tag,re===5||re===6||re===26||re===27){m=T=B;continue e}j=j.parentNode}}m=m.return}Gl(function(){var Ae=T,Pe=Ro(u),Fe=[];e:{var Se=C.get(a);if(Se!==void 0){var Ce=Va,lt=a;switch(a){case"keypress":if(ka(u)===0)break e;case"keydown":case"keyup":Ce=Xh;break;case"focusin":lt="focus",Ce=Po;break;case"focusout":lt="blur",Ce=Po;break;case"beforeblur":case"afterblur":Ce=Po;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ce=Xl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ce=wh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ce=qh;break;case fc:case dc:case _c:Ce=Bh;break;case $e:Ce=Zh;break;case"scroll":case"scrollend":Ce=Ph;break;case"wheel":Ce=$h;break;case"copy":case"cut":case"paste":Ce=Uh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ce=jl;break;case"toggle":case"beforetoggle":Ce=eu}var bt=(l&4)!==0,Ti=!bt&&(a==="scroll"||a==="scrollend"),me=bt?Se!==null?Se+"Capture":null:Se;bt=[];for(var fe=Ae,ve;fe!==null;){var we=fe;if(ve=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||ve===null||me===null||(we=Hr(fe,me),we!=null&&bt.push(zc(fe,we,ve))),Ti)break;fe=fe.return}0<bt.length&&(Se=new Ce(Se,lt,null,u,Pe),Fe.push({event:Se,listeners:bt}))}}if((l&7)===0){e:{if(Se=a==="mouseover"||a==="pointerover",Ce=a==="mouseout"||a==="pointerout",Se&&u!==Ao&&(lt=u.relatedTarget||u.fromElement)&&(ir(lt)||lt[tr]))break e;if((Ce||Se)&&(Se=Pe.window===Pe?Pe:(Se=Pe.ownerDocument)?Se.defaultView||Se.parentWindow:window,Ce?(lt=u.relatedTarget||u.toElement,Ce=Ae,lt=lt?ir(lt):null,lt!==null&&(Ti=n(lt),bt=lt.tag,lt!==Ti||bt!==5&&bt!==27&&bt!==6)&&(lt=null)):(Ce=null,lt=Ae),Ce!==lt)){if(bt=Xl,we="onMouseLeave",me="onMouseEnter",fe="mouse",(a==="pointerout"||a==="pointerover")&&(bt=jl,we="onPointerLeave",me="onPointerEnter",fe="pointer"),Ti=Ce==null?Se:Gr(Ce),ve=lt==null?Se:Gr(lt),Se=new bt(we,fe+"leave",Ce,u,Pe),Se.target=Ti,Se.relatedTarget=ve,we=null,ir(Pe)===Ae&&(bt=new bt(me,fe+"enter",lt,u,Pe),bt.target=ve,bt.relatedTarget=Ti,we=bt),Ti=we,Ce&&lt)t:{for(bt=_S,me=Ce,fe=lt,ve=0,we=me;we;we=bt(we))ve++;we=0;for(var gt=fe;gt;gt=bt(gt))we++;for(;0<ve-we;)me=bt(me),ve--;for(;0<we-ve;)fe=bt(fe),we--;for(;ve--;){if(me===fe||fe!==null&&me===fe.alternate){bt=me;break t}me=bt(me),fe=bt(fe)}bt=null}else bt=null;Ce!==null&&Wy(Fe,Se,Ce,bt,!1),lt!==null&&Ti!==null&&Wy(Fe,Ti,lt,bt,!0)}}
vendor: 5,250 bytes, lines 49-50
49e:{if(Se=Ae?Gr(Ae):window,Ce=Se.nodeName&&Se.nodeName.toLowerCase(),Ce==="select"||Ce==="input"&&Se.type==="file")var ci=tc;else if(Jl(Se))if(ic)ci=hu;else{ci=lu;var ft=ou}else Ce=Se.nodeName,!Ce||Ce.toLowerCase()!=="input"||Se.type!=="checkbox"&&Se.type!=="radio"?Ae&&vo(Ae.elementType)&&(ci=tc):ci=cu;if(ci&&(ci=ci(a,Ae))){ec(Fe,ci,u,Pe);break e}ft&&ft(a,Se,Ae),a==="focusout"&&Ae&&Se.type==="number"&&Ae.memoizedProps.value!=null&&Eo(Se,"number",Se.value)}switch(ft=Ae?Gr(Ae):window,a){case"focusin":(Jl(ft)||ft.contentEditable==="true")&&(ur=ft,No=Ae,Qr=null);break;case"focusout":Qr=No=ur=null;break;case"mousedown":Uo=!0;break;case"contextmenu":case"mouseup":case"dragend":Uo=!1,hc(Fe,u,Pe);break;case"selectionchange":if(fu)break;case"keydown":case"keyup":hc(Fe,u,Pe)}var Ft;if(wo)e:{switch(a){case"compositionstart":var qt="onCompositionStart";break e;case"compositionend":qt="onCompositionEnd";break e;case"compositionupdate":qt="onCompositionUpdate";break e}qt=void 0}else hr?Ql(a,u)&&(qt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(qt="onCompositionStart");qt&&(ql&&u.locale!=="ko"&&(hr||qt!=="onCompositionStart"?qt==="onCompositionEnd"&&hr&&(Ft=Hl()):(Tn=Pe,Co="value"in Tn?Tn.value:Tn.textContent,hr=!0)),ft=tf(Ae,qt),0<ft.length&&(qt=new Yl(qt,a,null,u,Pe),Fe.push({event:qt,listeners:ft}),Ft?qt.data=Ft:(Ft=$l(u),Ft!==null&&(qt.data=Ft)))),(Ft=iu?su(a,u):nu(a,u))&&(qt=tf(Ae,"onBeforeInput"),0<qt.length&&(ft=new Yl("onBeforeInput","beforeinput",null,u,Pe),Fe.push({event:ft,listeners:qt}),ft.data=Ft)),hS(Fe,a,Ae,u,Pe)}Gy(Fe,l)})}function zc(a,l,u){return{instance:a,listener:l,currentTarget:u}}function tf(a,l){for(var u=l+"Capture",m=[];a!==null;){var y=a,T=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||T===null||(y=Hr(a,u),y!=null&&m.unshift(zc(a,y,T)),y=Hr(a,l),y!=null&&m.push(zc(a,y,T))),a.tag===3)return m;a=a.return}return[]}function _S(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Wy(a,l,u,m,y){for(var T=l._reactName,B=[];u!==null&&u!==m;){var j=u,re=j.alternate,Ae=j.stateNode;if(j=j.tag,re!==null&&re===m)break;j!==5&&j!==26&&j!==27||Ae===null||(re=Ae,y?(Ae=Hr(u,T),Ae!=null&&B.unshift(zc(u,Ae,re))):y||(Ae=Hr(u,T),Ae!=null&&B.push(zc(u,Ae,re)))),u=u.return}B.length!==0&&a.push({event:l,listeners:B})}var mS=/\r\n?/g,gS=/\u0000|\uFFFD/g;function Xy(a){return(typeof a=="string"?a:""+a).replace(mS,`
50`).replace(gS,"")}function Yy(a,l){return l=Xy(l),Xy(a)===l}function xi(a,l,u,m,y,T){switch(u){case"children":typeof m=="string"?l==="body"||l==="textarea"&&m===""||or(a,m):(typeof m=="number"||typeof m=="bigint")&&l!=="body"&&or(a,""+m);break;case"className":La(a,"class",m);break;case"tabIndex":La(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":La(a,u,m);break;case"style":zl(a,m,T);break;case"data":if(l!=="object"){La(a,"data",m);break}case"src":case"href":if(m===""&&(l!=="a"||u!=="href")){a.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=Na(""+m),a.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(u,"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 T=="function"&&(u==="formAction"?(l!=="input"&&xi(a,l,"name",y.name,y,null),xi(a,l,"formEncType",y.formEncType,y,null),xi(a,l,"formMethod",y.formMethod,y,null),xi(a,l,"formTarget",y.formTarget,y,null)):(xi(a,l,"encType",y.encType,y,null),xi(a,l,"method",y.method,y,null),xi(a,l,"target",y.target,y,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=Na(""+m),a.setAttribute(u,m);break;case"onClick":m!=null&&(a.onclick=rn);break;case"onScroll":m!=null&&Xt("scroll",a);break;case"onScrollEnd":m!=null&&Xt("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(u=m.__html,u!=null){if(y.children!=null)throw Error(i(60));a.innerHTML=u}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}u=Na(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""+m):a.removeAttribute(u);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"playsInl
50ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":m===!0?a.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,m):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(u,m):a.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(u):a.setAttribute(u,m);break;case"popover":Xt("beforetoggle",a),Xt("toggle",a),Fa(a,"popover",m);break;case"xlinkActuate":nn(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":nn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":nn(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":nn(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":nn(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":nn(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":nn(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":nn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":nn(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Fa(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Ih.get(u)||u,Fa(a,u,m))}}function F_(a,l,u,m,y,T){switch(u){case"style":zl(a,m,T);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(u=m.__html,u!=null){if(y.children!=null)throw Error(i(60));a.innerHTML=u}}break;case"children":typeof m=="string"?or(a,m):(typeof m=="number"||typeof m=="bigint")&&or(a,""+m);break;case"onScroll":m!=null&&Xt("scroll",a);break;case"onScrollEnd":m!=null&&Xt("scrollend",a);break;case"onClick":m!=null&&(a.onclick=rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pl.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),T=a[as]||null,T=T!=null?T[u]:null,typeof T=="function"&&a.removeEventListener(l,T,y),typeof m=="function")){typeof T!="function"&&T!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(l,m,y);break e}u in a?a[u]=m:m===!0?a.setAttribute(u,""):Fa(a,u,m)}}}function fs(a,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xt("error",a),Xt("load",a);var m=!1,y=!1,T;for(T in u)if(u.hasOwnProperty(T)){var B=u[T];if(B!=null)switch(T){case"src":m=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:xi(a,l,T,B,u,null)}}y&&xi(a,l,"srcSet",u.srcSet,u,null),m&&xi(a,l,"src",u.src,u,null);return;case"input":Xt("invalid",a);var j=T=B=y=null,re=null,Ae=null;for(m in u)if(u.hasOwnProperty(m)){var Pe=u[m];if(Pe!=null)switch(m){case"name":y=Pe;break;case"type":B=Pe;break;case"checked":re=Pe;break;case"defaultChecked":Ae=Pe;break;case"value":T=Pe;break;case"defaultValue":j=Pe;break;case"children":case"dangerouslySetInnerHTML":if(Pe!=null)throw Error(i(137,l));break;default:xi(a,l,m,Pe,u,null)}}Bl(a,T,j,re,Ae,B,y,!1);return;case"select":Xt("invalid",a),m=B=T=null;for(y in u)if(u.hasOwnProperty(y)&&(j=u[y],j!=null))switch(y){case"value":T=j;break;case"defaultValue":B=j;break;case"multiple":m=j;default:xi(a,l,y,j,u,null)}l=T,u=B,a.multiple=!!m,l!=null?ar(a,!!m,l,!1):u!=null&&ar(a,!!m,u,!0);return;case"textarea":Xt("invalid",a),T=y=m=null;for(B in u)if(u.hasOwnProperty(B)&&(j=u[B],j!=null))switch(B){case"value":m=j;break;case"defaultValue":y=j;break;case"children":T=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(i(91));break;default:xi(a,l,B,j,u,null)}Ul(a,m,y,T);return;case"option":for(re in u)if(u.hasOwnProperty(re)&&(m=u[re],m!=null))switch(re){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:xi(a,l,re,m,u,null)}return;case"dialog":Xt("beforetoggle",a),Xt("toggle",a),Xt("cancel",a),Xt("close",a);break;case"iframe":case"object":Xt("load",a);break;case"video":case"audio":for(m=0;m<kc.length;m++)Xt(kc[m],a);break;case"image":Xt("error",a),Xt("load",a);break;case"details":Xt("toggle",a);break;case"embed":case"source":case"link":Xt("error",a),Xt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ae in u)if(u.hasOwnProperty(Ae)&&(m=u[Ae],m!=null))switch(Ae){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:xi(a,l,Ae,m,u,null)}return;default:if(vo(l)){for(Pe in u)u.hasOwnProperty(Pe)&&(m=u[Pe],m!==void 0&&F_(a,l,Pe,m,u,void 0));return}}for(j in u)u.hasOwnProperty(j)&&(m=u[j],m!=null&&xi(a,l,j,m,u,null))}function pS(a,l,u,m){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,T=null,B=null,j=null,re=null,Ae=null,Pe=null;for(Ce in u){var Fe=u[Ce];if(u.hasOwnProperty(Ce)&&Fe!=null)switch(Ce){case"checked":break;case"value":break;case"defaultValue":re=Fe;default:m.hasOwnProperty(Ce)||xi(a,l,Ce,null,m,Fe)}}for(var Se in m){var Ce=m[Se];if(Fe=u[Se],m.hasOwnProperty(Se)&&(Ce!=null||Fe!=null))switch(Se){case"type":T=Ce;break;case"name":y=Ce;break;case"checked":Ae=Ce;break;case"defaultChecked":Pe=Ce;break;case"value":B=Ce;break;case"defaultValue":j=Ce;break;case"children":case"dangerouslySetInnerHTML":if(Ce!=null)throw Error(i(137,l));break;default:Ce!==Fe&&xi(a,l,Se,Ce,m,Fe)}}To(a,B,j,re,Ae,Pe,T,y);return;case"select":Ce=B=j=Se=null;for(T in u)if(re=u[T],u.hasOwnProperty(T)&&re!=null)switch(T){case"value":break;case"multiple":Ce=re;default:m.hasOwnProperty(T)||xi(a,l,T,null,m,re)}for(y in m)if(T=m[y],re=u[y],m.hasOwnProperty(y)&&(T!=null||re!=null))switch(y){case"value":Se=T;break;case"defaultValue":j=T;break;case"multiple":B=T;default:T!==re&&xi(a,l,y,T,m,re)}l=j,u=B,m=Ce,Se!=null?ar(a,!!u,Se,!1):!!m!=!!u&&(l!=null?ar(a,!!u,l,!0):ar(a,!!u,u?[]:"",!1));return;case"textarea":Ce=Se=null;for(j in u)if(y=u[j],u.hasOwnProperty(j)&&y!=null&&!m.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:xi(a,l,j,null,m,y)}for(B in m)if(y=m[B],T=u[B],m.hasOwnProperty(B)&&(y!=null||T!=null))switch(B){case"value":Se=y;break;case"defaultValue":Ce=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==T&&xi(a,l,B,y,m,T)}Nl(a,Se,Ce);return;case"option":for(var lt in u)if(Se=u[lt],u.hasOwnProperty(lt)&&Se!=null&&!m.hasOwnProperty(lt))switch(lt){case"selected":a.selected=!1;break;default:xi(a,l,lt,null,m,Se)}for(re in m)if(Se=m[re],Ce=u[re],m.hasOwnProperty(re)&&Se!==Ce&&(Se!=null||Ce!=null))switch(re){case"selected":a.selected=Se&&typeof Se!="function"&&typeof Se!="symbol";break;default:xi(a,l,re,Se,m,Ce)}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 bt in u)Se=u[bt],u.hasOwnProperty(bt)&&Se!=null&&!m.hasOwnProperty(bt)&&xi(a,l,bt,null,m,Se);for(Ae in m)if(Se=m[Ae],Ce=u[Ae],m.hasOwnProperty(Ae)&&Se!==Ce&&(Se!=null||Ce!=null))switch(Ae){case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(i(137,l));break;default:xi(a,l,Ae,Se,m,Ce)}return;default:if(vo(l)){for(var Ti in u)Se=u[Ti],u.hasOwnProperty(Ti)&&Se!==void 0&&!m.hasOwnProperty(Ti)&&F_(a,l,Ti,void 0,m,Se);for(Pe in m)Se=m[Pe],Ce=u[Pe],!m.hasOwnProperty(Pe)||Se===Ce||Se===void 0&&Ce===void 0||F_(a,l,Pe,Se,m,Ce);return}}for(var me in u)Se=u[me],u.hasOwnProperty(me)&&Se!=null&&!m.hasOwnProperty(me)&&xi(a,l,me,null,m,Se);for(Fe in m)Se=m[Fe],Ce=u[Fe],!m.hasOwnProperty(Fe)||Se===Ce||Se==null&&
vendor: 4,141 bytes, line 50
50Ce==null||xi(a,l,Fe,Se,m,Ce)}function jy(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yS(){if(typeof performance.getEntriesByType=="function"){for(var a=0,l=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var y=u[m],T=y.transferSize,B=y.initiatorType,j=y.duration;if(T&&j&&jy(B)){for(B=0,j=y.responseEnd,m+=1;m<u.length;m++){var re=u[m],Ae=re.startTime;if(Ae>j)break;var Pe=re.transferSize,Fe=re.initiatorType;Pe&&jy(Fe)&&(re=re.responseEnd,B+=Pe*(re<j?1:(j-Ae)/(re-Ae)))}if(--m,l+=8*(T+B)/(y.duration/1e3),a++,10<a)break}}if(0<a)return l/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var L_=null,B_=null;function sf(a){return a.nodeType===9?a:a.ownerDocument}function qy(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ky(a,l){if(a===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&l==="foreignObject"?0:a}function N_(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var U_=null;function bS(){var a=window.event;return a&&a.type==="popstate"?a===U_?!1:(U_=a,!0):(U_=null,!1)}var Zy=typeof setTimeout=="function"?setTimeout:void 0,xS=typeof clearTimeout=="function"?clearTimeout:void 0,Qy=typeof Promise=="function"?Promise:void 0,TS=typeof queueMicrotask=="function"?queueMicrotask:typeof Qy<"u"?function(a){return Qy.resolve(null).then(a).catch(ES)}:Zy;function ES(a){setTimeout(function(){throw a})}function _a(a){return a==="head"}function $y(a,l){var u=l,m=0;do{var y=u.nextSibling;if(a.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(m===0){a.removeChild(y),ul(l);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")Vc(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Vc(u);for(var T=u.firstChild;T;){var B=T.nextSibling,j=T.nodeName;T[Vr]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&T.rel.toLowerCase()==="stylesheet"||u.removeChild(T),T=B}}else u==="body"&&Vc(a.ownerDocument.body);u=y}while(u);ul(l)}function Jy(a,l){var u=a;a=0;do{var m=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=m}while(u)}function k_(a){var l=a.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":k_(u),bo(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function vS(a,l,u,m){for(;a.nodeType===1;){var y=u;if(a.nodeName.toLowerCase()!==l.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Vr])switch(l){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(T=a.getAttribute("rel"),T==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(T!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(T=a.getAttribute("src"),(T!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&T&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(l==="input"&&a.type==="hidden"){var T=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===T)return a}else return a;
vendor: 1,396 bytes, line 50
50if(a=mn(a.nextSibling),a===null)break}return null}function AS(a,l,u){if(l==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=mn(a.nextSibling),a===null))return null;return a}function eb(a,l){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!l||(a=mn(a.nextSibling),a===null))return null;return a}function z_(a){return a.data==="$?"||a.data==="$~"}function V_(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function RS(a,l){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=l;else if(a.data!=="$?"||u.readyState!=="loading")l();else{var m=function(){l(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function mn(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return a}var G_=null;function tb(a){a=a.nextSibling;for(var l=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(l===0)return mn(a.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}a=a.nextSibling}return null}function ib(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return a;l--}
vendor: 11,610 bytes, line 50
50else u!=="/$"&&u!=="/&"||l++}a=a.previousSibling}return null}function sb(a,l,u){switch(l=sf(u),a){case"html":if(a=l.documentElement,!a)throw Error(i(452));return a;case"head":if(a=l.head,!a)throw Error(i(453));return a;case"body":if(a=l.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Vc(a){for(var l=a.attributes;l.length;)a.removeAttributeNode(l[0]);bo(a)}var gn=new Map,nb=new Set;function nf(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Mr=q.d;q.d={f:SS,r:MS,D:CS,C:IS,L:DS,m:PS,X:wS,S:OS,M:FS};function SS(){var a=Mr.f(),l=qu();return a||l}function MS(a){var l=sr(a);l!==null&&l.tag===5&&l.type==="form"?Tp(l):Mr.r(a)}var ll=typeof document>"u"?null:document;function rb(a,l,u){var m=ll;if(m&&typeof l=="string"&&l){var y=Ss(l);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),nb.has(y)||(nb.add(y),a={rel:a,crossOrigin:u,href:l},m.querySelector(y)===null&&(l=m.createElement("link"),fs(l,"link",a),Vi(l),m.head.appendChild(l)))}}function CS(a){Mr.D(a),rb("dns-prefetch",a,null)}function IS(a,l){Mr.C(a,l),rb("preconnect",a,l)}function DS(a,l,u){Mr.L(a,l,u);var m=ll;if(m&&a&&l){var y='link[rel="preload"][as="'+Ss(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Ss(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Ss(u.imageSizes)+'"]')):y+='[href="'+Ss(a)+'"]';var T=y;switch(l){case"style":T=cl(a);break;case"script":T=hl(a)}gn.has(T)||(a=d({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:a,as:l},u),gn.set(T,a),m.querySelector(y)!==null||l==="style"&&m.querySelector(Gc(T))||l==="script"&&m.querySelector(Hc(T))||(l=m.createElement("link"),fs(l,"link",a),Vi(l),m.head.appendChild(l)))}}function PS(a,l){Mr.m(a,l);var u=ll;if(u&&a){var m=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+Ss(m)+'"][href="'+Ss(a)+'"]',T=y;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=hl(a)}if(!gn.has(T)&&(a=d({rel:"modulepreload",href:a},l),gn.set(T,a),u.querySelector(y)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Hc(T)))return}m=u.createElement("link"),fs(m,"link",a),Vi(m),u.head.appendChild(m)}}}function OS(a,l,u){Mr.S(a,l,u);var m=ll;if(m&&a){var y=nr(m).hoistableStyles,T=cl(a);l=l||"default";var B=y.get(T);if(!B){var j={loading:0,preload:null};if(B=m.querySelector(Gc(T)))j.loading=5;else{a=d({rel:"stylesheet",href:a,"data-precedence":l},u),(u=gn.get(T))&&H_(a,u);var re=B=m.createElement("link");Vi(re),fs(re,"link",a),re._p=new Promise(function(Ae,Pe){re.onload=Ae,re.onerror=Pe}),re.addEventListener("load",function(){j.loading|=1}),re.addEventListener("error",function(){j.loading|=2}),j.loading|=4,rf(B,l,m)}B={type:"stylesheet",instance:B,count:1,state:j},y.set(T,B)}}}function wS(a,l){Mr.X(a,l);var u=ll;if(u&&a){var m=nr(u).hoistableScripts,y=hl(a),T=m.get(y);T||(T=u.querySelector(Hc(y)),T||(a=d({src:a,async:!0},l),(l=gn.get(y))&&W_(a,l),T=u.createElement("script"),Vi(T),fs(T,"link",a),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},m.set(y,T))}}function FS(a,l){Mr.M(a,l);var u=ll;if(u&&a){var m=nr(u).hoistableScripts,y=hl(a),T=m.get(y);T||(T=u.querySelector(Hc(y)),T||(a=d({src:a,async:!0,type:"module"},l),(l=gn.get(y))&&W_(a,l),T=u.createElement("script"),Vi(T),fs(T,"link",a),u.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},m.set(y,T))}}function ab(a,l,u,m){var y=(y=ue.current)?nf(y):null;if(!y)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=cl(u.href),u=nr(y).hoistableStyles,m=u.get(l),m||(m={type:"style",instance:null,count:0,state:null},u.set(l,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=cl(u.href);var T=nr(y).hoistableStyles,B=T.get(a);if(B||(y=y.ownerDocument||y,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(a,B),(T=y.querySelector(Gc(a)))&&!T._p&&(B.instance=T,B.state.loading=5),gn.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},gn.set(a,u),T||LS(y,a,u,B.state))),l&&m===null)throw Error(i(528,""));return B}if(l&&m!==null)throw Error(i(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=hl(u),u=nr(y).hoistableScripts,m=u.get(l),m||(m={type:"script",instance:null,count:0,state:null},u.set(l,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function cl(a){return'href="'+Ss(a)+'"'}function Gc(a){return'link[rel="stylesheet"]['+a+"]"}function ob(a){return d({},a,{"data-precedence":a.precedence,precedence:null})}function LS(a,l,u,m){a.querySelector('link[rel="preload"][as="style"]['+l+"]")?m.loading=1:(l=a.createElement("link"),m.preload=l,l.addEventListener("load",function(){return m.loading|=1}),l.addEventListener("error",function(){return m.loading|=2}),fs(l,"link",u),Vi(l),a.head.appendChild(l))}function hl(a){return'[src="'+Ss(a)+'"]'}function Hc(a){return"script[async]"+a}function lb(a,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var m=a.querySelector('style[data-href~="'+Ss(u.href)+'"]');if(m)return l.instance=m,Vi(m),m;var y=d({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Vi(m),fs(m,"style",y),rf(m,u.precedence,a),l.instance=m;case"stylesheet":y=cl(u.href);var T=a.querySelector(Gc(y));if(T)return l.state.loading|=4,l.instance=T,Vi(T),T;m=ob(u),(y=gn.get(y))&&H_(m,y),T=(a.ownerDocument||a).createElement("link"),Vi(T);var B=T;return B._p=new Promise(function(j,re){B.onload=j,B.onerror=re}),fs(T,"link",m),l.state.loading|=4,rf(T,u.precedence,a),l.instance=T;case"script":return T=hl(u.src),(y=a.querySelector(Hc(T)))?(l.instance=y,Vi(y),y):(m=u,(y=gn.get(T))&&(m=d({},u),W_(m,y)),a=a.ownerDocument||a,y=a.createElement("script"),Vi(y),fs(y,"link",m),a.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(m=l.instance,l.state.loading|=4,rf(m,u.precedence,a));return l.instance}function rf(a,l,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=m.length?m[m.length-1]:null,T=y,B=0;B<m.length;B++){var j=m[B];if(j.dataset.precedence===l)T=j;else if(T!==y)break}T?T.parentNode.insertBefore(a,T.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(a,l.firstChild))}function H_(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.title==null&&(a.title=l.title)}function W_(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.integrity==null&&(a.integrity=l.integrity)}var af=null;function cb(a,l,u){if(af===null){var m=new Map,y=af=new Map;y.set(u,m)}else y=af,m=y.get(u),m||(m=new Map,y.set(u,m));if(m.has(a))return m;for(m.set(a,null),u=u.getElementsByTagName(a),y=0;y<u.length;y++){var T=u[y];if(!(T[Vr]||T[Xi]||a==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var B=T.getAttribute(l)||"";B=a+B;var j=m.get(B);j?j.push(T):m.set(B,[T])}}return m}function hb(a,l,u){a=a.ownerDocument||a,a.head.insertBefore(u,l==="title"?a.querySelector("head > title"):null)}function BS(a,l,u){if(u===1||l.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return a=l.disabled,typeof l.precedence=="string"&&a==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function ub(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function NS(a,l,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=cl(m.href),T=l.querySelector(Gc(y));if(T){l=T._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(a.count++,a=of.bind(a),l.then(a,a)),u.state.loading|=4,u.instance=T,Vi(T);return}T=l.ownerDocument||l,m=ob(m),(y=gn.get(y))&&H_(m,y),T=T.createElement("link"),Vi(T);var B=T;B._p=new Promise(function(j,re){B.onload=j,B.onerror=re}),fs(T,"link",m),u.instance=T}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=of.bind(a),l.addEventListener("load",u),l.addEventListener("error",u))}}var X_=0;function US(a,l){return a.stylesheets&&a.count===0&&cf(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var m=setTimeout(function(){if(a.stylesheets&&cf(a,a.stylesheets),a.unsuspend){var T=a.unsuspend;a.unsuspend=null,T()}},6e4+l);0<a.imgBytes&&X_===0&&(X_=62500*yS());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&cf(a,a.stylesheets),a.unsuspend)){var T=a.unsuspend;a.unsuspend=null,T()}},(a.imgBytes>X_?50:800)+l);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(y)}}:null}function of(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cf(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var lf=null;function cf(a,l){a.stylesheets=null,a.unsuspend!==null&&(a.count++,lf=new Map,l.forEach(kS,a),lf=null,of.call(a))}function kS(a,l){if(!(l.state.loading&4)){var u=lf.get(a);if(u)var m=u.get(null);else{u=new Map,lf.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<y.length;T++){var B=y[T];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(u.set(B.dataset.precedence,B),m=B)}m&&u.set(null,m)}y=l.instance,B=y.getAttribute("data-precedence"),T=u.get(B)||m,T===m&&u.set(null,y),u.set(B,y),this.count++,m=of.bind(this),y.addEventListener("load",m),y.addEventListener("error",m),T?T.parentNode.insertBefore(y,T.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),l.state.loading|=4}}var Wc={$$typeof:R,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function zS(a,l,u,m,y,T,B,j,re){this.tag=1,this.containerInfo=a,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=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=m,this.onUncaughtError=y,this.onCaughtError=T,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function fb(a,l,u,m,y,T,B,j,re,Ae,Pe,Fe){return a=new zS(a,l,u,B,re,Ae,Pe,Fe,j),l=1,T===!0&&(l|=24),T=ss(3,null,null,l),a.current=T,T.stateNode=a,l=Ad(),l.refCount++,a.pooledCache=l,l.refCount++,T.memoizedState={element:m,isDehydrated:u,cac
vendor: 9,639 bytes, line 50
50he:l},Cd(T),a}function db(a){return a?(a=ls,a):ls}function _b(a,l,u,m,y,T){y=db(y),m.context===null?m.context=y:m.pendingContext=y,m=sa(l),m.payload={element:u},T=T===void 0?null:T,T!==null&&(m.callback=T),u=na(a,m,l),u!==null&&(Us(u,a,l),Ec(u,a,l))}function mb(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<l?u:l}}function Y_(a,l){mb(a,l),(a=a.alternate)&&mb(a,l)}function gb(a){if(a.tag===13||a.tag===31){var l=rt(a,67108864);l!==null&&Us(l,a,67108864),Y_(a,67108864)}}function pb(a){if(a.tag===13||a.tag===31){var l=Ks();l=gs(l);var u=rt(a,l);u!==null&&Us(u,a,l),Y_(a,l)}}var hf=!0;function VS(a,l,u,m){var y=X.T;X.T=null;var T=q.p;try{q.p=2,j_(a,l,u,m)}finally{q.p=T,X.T=y}}function GS(a,l,u,m){var y=X.T;X.T=null;var T=q.p;try{q.p=8,j_(a,l,u,m)}finally{q.p=T,X.T=y}}function j_(a,l,u,m){if(hf){var y=q_(m);if(y===null)w_(a,l,m,uf,u),bb(a,m);else if(WS(y,a,l,u,m))m.stopPropagation();else if(bb(a,m),l&4&&-1<HS.indexOf(a)){for(;y!==null;){var T=sr(y);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var B=Te(T.pendingLanes);if(B!==0){var j=T;for(j.pendingLanes|=2,j.entangledLanes|=2;B;){var re=1<<31-_i(B);j.entanglements[1]|=re,B&=~re}Vn(T),(fi&6)===0&&(Yu=ze()+500,Uc(0))}}break;case 31:case 13:j=rt(T,2),j!==null&&Us(j,T,2),qu(),Y_(T,2)}if(T=q_(m),T===null&&w_(a,l,m,uf,u),T===y)break;y=T}y!==null&&m.stopPropagation()}else w_(a,l,m,null,u)}}function q_(a){return a=Ro(a),K_(a)}var uf=null;function K_(a){if(uf=null,a=ir(a),a!==null){var l=n(a);if(l===null)a=null;else{var u=l.tag;if(u===13){if(a=o(l),a!==null)return a;a=null}else if(u===31){if(a=c(l),a!==null)return a;a=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null)}}return uf=a,null}function yb(a){switch(a){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(si()){case $t:return 2;case oi:return 8;case ti:case ii:return 32;case Ct:return 268435456;default:return 32}default:return 32}}var Z_=!1,ma=null,ga=null,pa=null,Xc=new Map,Yc=new Map,ya=[],HS="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 bb(a,l){switch(a){case"focusin":case"focusout":ma=null;break;case"dragenter":case"dragleave":ga=null;break;case"mouseover":case"mouseout":pa=null;break;case"pointerover":case"pointerout":Xc.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yc.delete(l.pointerId)}}function jc(a,l,u,m,y,T){return a===null||a.nativeEvent!==T?(a={blockedOn:l,domEventName:u,eventSystemFlags:m,nativeEvent:T,targetContainers:[y]},l!==null&&(l=sr(l),l!==null&&gb(l)),a):(a.eventSystemFlags|=m,l=a.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),a)}function WS(a,l,u,m,y){switch(l){case"focusin":return ma=jc(ma,a,l,u,m,y),!0;case"dragenter":return ga=jc(ga,a,l,u,m,y),!0;case"mouseover":return pa=jc(pa,a,l,u,m,y),!0;case"pointerover":var T=y.pointerId;return Xc.set(T,jc(Xc.get(T)||null,a,l,u,m,y)),!0;case"gotpointercapture":return T=y.pointerId,Yc.set(T,jc(Yc.get(T)||null,a,l,u,m,y)),!0}return!1}function xb(a){var l=ir(a.target);if(l!==null){var u=n(l);if(u!==null){if(l=u.tag,l===13){if(l=o(u),l!==null){a.blockedOn=l,$i(a.priority,function(){pb(u)});return}}else if(l===31){if(l=c(u),l!==null){a.blockedOn=l,$i(a.priority,function(){pb(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function ff(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var u=q_(a.nativeEvent);if(u===null){u=a.nativeEvent;var m=new u.constructor(u.type,u);Ao=m,u.target.dispatchEvent(m),Ao=null}else return l=sr(u),l!==null&&gb(l),a.blockedOn=u,!1;l.shift()}return!0}function Tb(a,l,u){ff(a)&&u.delete(l)}function XS(){Z_=!1,ma!==null&&ff(ma)&&(ma=null),ga!==null&&ff(ga)&&(ga=null),pa!==null&&ff(pa)&&(pa=null),Xc.forEach(Tb),Yc.forEach(Tb)}function df(a,l){a.blockedOn===l&&(a.blockedOn=null,Z_||(Z_=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,XS)))}var _f=null;function Eb(a){_f!==a&&(_f=a,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){_f===a&&(_f=null);for(var l=0;l<a.length;l+=3){var u=a[l],m=a[l+1],y=a[l+2];if(typeof m!="function"){if(K_(m||u)===null)continue;break}var T=sr(u);T!==null&&(a.splice(l,3),l-=3,qd(T,{pending:!0,data:y,method:u.method,action:m},m,y))}}))}function ul(a){function l(re){return df(re,a)}ma!==null&&df(ma,a),ga!==null&&df(ga,a),pa!==null&&df(pa,a),Xc.forEach(l),Yc.forEach(l);for(var u=0;u<ya.length;u++){var m=ya[u];m.blockedOn===a&&(m.blockedOn=null)}for(;0<ya.length&&(u=ya[0],u.blockedOn===null);)xb(u),u.blockedOn===null&&ya.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var y=u[m],T=u[m+1],B=y[as]||null;if(typeof T=="function")B||Eb(u);else if(B){var j=null;if(T&&T.hasAttribute("formAction")){if(y=T,B=T[as]||null)j=B.formAction;else if(K_(y)!==null)continue}else j=B.action;typeof j=="function"?u[m+1]=j:(u.splice(m,3),m-=3),Eb(u)}}}function vb(){function a(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(B){return y=B})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function Q_(a){this._internalRoot=a}mf.prototype.render=Q_.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(i(409));var u=l.current,m=Ks();_b(u,m,a,l,null,null)},mf.prototype.unmount=Q_.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;_b(a.current,2,null,a,null,null),qu(),l[tr]=null}};function mf(a){this._internalRoot=a}mf.prototype.unstable_scheduleHydration=function(a){if(a){var l=Hs();a={blockedOn:null,target:a,priority:l};for(var u=0;u<ya.length&&l!==0&&l<ya[u].priority;u++);ya.splice(u,0,a),u===0&&xb(a)}};var Ab=e.version;if(Ab!=="19.2.1")throw Error(i(527,Ab,"19.2.1"));q.findDOMNode=function(a){var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=f(l),a=a!==null?_(a):null,a=a===null?null:a.stateNode,a};var YS={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gf.isDisabled&&gf.supportsFiber)try{Ht=gf.inject(YS),ri=gf}catch{}}return Kc.createRoot=function(a,l){if(!s(a))throw Error(i(299));var u=!1,m="",y=Pp,T=Op,B=wp;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(B=l.onRecoverableError)),l=fb(a,1,!1,null,null,u,m,null,y,T,B,vb),a[tr]=l.current,O_(a),new Q_(l)},Kc.hydrateRoot=function(a,l,u){if(!s(a))throw Error(i(299));var m=!1,y="",T=Pp,B=Op,j=wp,re=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(T=u.onUncaughtError),u.onCaughtError!==void 0&&(B=u.onCaughtError),u.onRecoverableError!==void 0&&(j=u.onRecoverableError),u.formState!==void 0&&(re=u.formState)),l=fb(a,1,!0,l,u??null,m,y,re,T,B,j,vb),l.context=db(null),u=l.current,m=Ks(),m=gs(m),y=sa(m),y.callback=null,na(u,y,m),u=m,l.current.lanes=u,Qe(l,u),Vn(l),a[tr]=l.current,O_(a),new mf(l)},Kc.version="19.2.1",Kc}var Fb;function iM(){if(Fb)return J_.exports;Fb=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),J_.exports=tM(),J_.exports}
vendor: 7,619 bytes, line 50
50var sM=iM(),Re=td();const Ke=CE(Re),nM=qS({__proto__:null,default:Ke},[Re]);var rM=(r,e,t,i,s,n,o,c)=>{let h=document.documentElement,f=["light","dark"];function _(p){(Array.isArray(r)?r:[r]).forEach(b=>{let x=b==="class",E=x&&n?s.map(v=>n[v]||v):s;x?(h.classList.remove(...E),h.classList.add(n&&n[p]?n[p]:p)):h.setAttribute(b,p)}),d(p)}function d(p){c&&f.includes(p)&&(h.style.colorScheme=p)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)_(i);else try{let p=localStorage.getItem(e)||t,b=o&&p==="system"?g():p;_(b)}catch{}},aM=Re.createContext(void 0),oM={setTheme:r=>{},themes:[]},lM=()=>{var r;return(r=Re.useContext(aM))!=null?r:oM};Re.memo(({forcedTheme:r,storageKey:e,attribute:t,enableSystem:i,enableColorScheme:s,defaultTheme:n,value:o,themes:c,nonce:h,scriptProps:f})=>{let _=JSON.stringify([t,e,n,r,c,o,i,s]).slice(1,-1);return Re.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${rM.toString()})(${_})`}})});var Zm=IE();const cM=CE(Zm);function hM(r){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",e.appendChild(t),t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}const uM=r=>{switch(r){case"success":return _M;case"info":return gM;case"warning":return mM;case"error":return pM;default:return null}},fM=Array(12).fill(0),dM=({visible:r,className:e})=>Ke.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":r},Ke.createElement("div",{className:"sonner-spinner"},fM.map((t,i)=>Ke.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),_M=Ke.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ke.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),mM=Ke.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Ke.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),gM=Ke.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ke.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),pM=Ke.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Ke.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),yM=Ke.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Ke.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ke.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),bM=()=>{const[r,e]=Ke.useState(document.hidden);return Ke.useEffect(()=>{const t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),r};let Rm=1,xM=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:i,...s}=e,n=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Rm++,o=this.toasts.find(h=>h.id===n),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),o?this.toasts=this.toasts.map(h=>h.id===n?(this.publish({...h,...e,id:n,title:i}),{...h,...e,id:n,dismissible:c,title:i}):h):this.addToast({title:i,...s,dismissible:c,id:n}),n},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(i=>i({id:t.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let i;t.loading!==void 0&&(i=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let n=i!==void 0,o;const c=s.then(async f=>{if(o=["resolve",f],Ke.isValidElement(f))n=!1,this.create({id:i,type:"default",message:f});else if(EM(f)&&!f.ok){n=!1;const d=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,g=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description,b=typeof d=="object"&&!Ke.isValidElement(d)?d:{message:d};this.create({id:i,type:"error",description:g,...b})}else if(f instanceof Error){n=!1;const d=typeof t.error=="function"?await t.error(f):t.error,g=typeof t.description=="function"?await t.description(f):t.description,b=typeof d=="object"&&!Ke.isValidElement(d)?d:{message:d};this.create({id:i,type:"error",description:g,...b})}else if(t.success!==void 0){n=!1;const d=typeof t.success=="function"?await t.success(f):t.success,g=typeof t.description=="function"?await t.description(f):t.description,b=typeof d=="object"&&!Ke.isValidElement(d)?d:{message:d};this.create({id:i,type:"success",description:g,...b})}}).catch(async f=>{if(o=["reject",f],t.error!==void 0){n=!1;const _=typeof t.error=="function"?await t.error(f):t.error,d=typeof t.description=="function"?await t.description(f):t.description,p=typeof _=="object"&&!Ke.isValidElement(_)?_:{message:_};this.create({id:i,type:"error",description:d,...p})}}).finally(()=>{n&&(this.dismiss(i),i=void 0),t.finally==null||t.finally.call(t)}),h=()=>new Promise((f,_)=>c.then(()=>o[0]==="reject"?_(o[1]):f(o[1])).catch(_));return typeof i!="string"&&typeof i!="number"?{unwrap:h}:Object.assign(i,{unwrap:h})},this.custom=(e,t)=>{const i=t?.id||Rm++;return this.create({jsx:e(i),id:i,...t}),i},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}};const ks=new xM,TM=(r,e)=>{const t=e?.id||Rm++;return ks.addToast({title:r,...e,id:t}),t},EM=r=>r&&typeof r=="object"&&"ok"in r&&typeof r.ok=="boolean"&&"status"in r&&typeof r.status=="number",vM=TM,AM=()=>ks.toasts,RM=()=>ks.getActiveToasts();Object.assign(vM,{success:ks.success,info:ks.info,warning:ks.warning,error:ks.error,custom:ks.custom,message:ks.message,promise:ks.promise,dismiss:ks.dismiss,loading:ks.loading},{getHistory:AM,getToasts:RM});hM
vendor: 14,873 bytes, line 50
50("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function 
50pf(r){return r.label!==void 0}const SM=3,MM="24px",CM="16px",Lb=4e3,IM=356,DM=14,PM=45,OM=200;function Gn(...r){return r.filter(Boolean).join(" ")}function wM(r){const[e,t]=r.split("-"),i=[];return e&&i.push(e),t&&i.push(t),i}const FM=r=>{var e,t,i,s,n,o,c,h,f;const{invert:_,toast:d,unstyled:g,interacting:p,setHeights:b,visibleToasts:x,heights:E,index:v,toasts:S,exp
vendor: 21,381 bytes, line 50
50anded:R,removeToast:P,defaultRichColors:M,closeButton:O,style:D,cancelButtonStyle:w,actionButtonStyle:G,className:H="",descriptionClassName:ie="",duration:ne,position:ce,gap:k,expandByDefault:te,classNames:X,icons:q,closeButtonAriaLabel:W="Close toast"}=r,[K,Z]=Ke.useState(null),[F,A]=Ke.useState(null),[N,Y]=Ke.useState(!1),[se,ue]=Ke.useState(!1),[pe,Ie]=Ke.useState(!1),[Le,J]=Ke.useState(!1),[_e,ye]=Ke.useState(!1),[Ne,Je]=Ke.useState(0),[je,yt]=Ke.useState(0),Yt=Ke.useRef(d.duration||ne||Lb),kt=Ke.useRef(null),Et=Ke.useRef(null),Gt=v===0,zt=v+1<=x,nt=d.type,oe=d.dismissible!==!1,ze=d.className||"",si=d.descriptionClassName||"",$t=Ke.useMemo(()=>E.findIndex(We=>We.toastId===d.id)||0,[E,d.id]),oi=Ke.useMemo(()=>{var We;return(We=d.closeButton)!=null?We:O},[d.closeButton,O]),ti=Ke.useMemo(()=>d.duration||ne||Lb,[d.duration,ne]),ii=Ke.useRef(0),Ct=Ke.useRef(0),ni=Ke.useRef(0),Pt=Ke.useRef(null),[Ht,ri]=ce.split("-"),di=Ke.useMemo(()=>E.reduce((We,Me,z)=>z>=$t?We:We+Me.height,0),[E,$t]),_i=bM(),As=d.invert||_,rs=nt==="loading";Ct.current=Ke.useMemo(()=>$t*k+di,[$t,di]),Ke.useEffect(()=>{Yt.current=ti},[ti]),Ke.useEffect(()=>{Y(!0)},[]),Ke.useEffect(()=>{const We=Et.current;if(We){const Me=We.getBoundingClientRect().height;return yt(Me),b(z=>[{toastId:d.id,height:Me,position:d.position},...z]),()=>b(z=>z.filter(be=>be.toastId!==d.id))}},[b,d.id]),Ke.useLayoutEffect(()=>{if(!N)return;const We=Et.current,Me=We.style.height;We.style.height="auto";const z=We.getBoundingClientRect().height;We.style.height=Me,yt(z),b(be=>be.find(Qe=>Qe.toastId===d.id)?be.map(Qe=>Qe.toastId===d.id?{...Qe,height:z}:Qe):[{toastId:d.id,height:z,position:d.position},...be])},[N,d.title,d.description,b,d.id,d.jsx,d.action,d.cancel]);const Bi=Ke.useCallback(()=>{ue(!0),Je(Ct.current),b(We=>We.filter(Me=>Me.toastId!==d.id)),setTimeout(()=>{P(d)},OM)},[d,P,b,Ct]);Ke.useEffect(()=>{if(d.promise&&nt==="loading"||d.duration===1/0||d.type==="loading")return;let We;return R||p||_i?(()=>{if(ni.current<ii.current){const be=new Date().getTime()-ii.current;Yt.current=Yt.current-be}ni.current=new Date().getTime()})():(()=>{Yt.current!==1/0&&(ii.current=new Date().getTime(),We=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),Bi()},Yt.current))})(),()=>clearTimeout(We)},[R,p,d,nt,_i,Bi]),Ke.useEffect(()=>{d.delete&&(Bi(),d.onDismiss==null||d.onDismiss.call(d,d))},[Bi,d.delete]);function St(){var We;if(q?.loading){var Me;return Ke.createElement("div",{className:Gn(X?.loader,d==null||(Me=d.classNames)==null?void 0:Me.loader,"sonner-loader"),"data-visible":nt==="loading"},q.loading)}return Ke.createElement(dM,{className:Gn(X?.loader,d==null||(We=d.classNames)==null?void 0:We.loader),visible:nt==="loading"})}const Q=d.icon||q?.[nt]||uM(nt);var V,Te;return Ke.createElement("li",{tabIndex:0,ref:Et,className:Gn(H,ze,X?.toast,d==null||(e=d.classNames)==null?void 0:e.toast,X?.default,X?.[nt],d==null||(t=d.classNames)==null?void 0:t[nt]),"data-sonner-toast":"","data-rich-colors":(V=d.richColors)!=null?V:M,"data-styled":!(d.jsx||d.unstyled||g),"data-mounted":N,"data-promise":!!d.promise,"data-swiped":_e,"data-removed":se,"data-visible":zt,"data-y-position":Ht,"data-x-position":ri,"data-index":v,"data-front":Gt,"data-swiping":pe,"data-dismissible":oe,"data-type":nt,"data-invert":As,"data-swipe-out":Le,"data-swipe-direction":F,"data-expanded":!!(R||te&&N),"data-testid":d.testId,style:{"--index":v,"--toasts-before":v,"--z-index":S.length-v,"--offset":`${se?Ne:Ct.current}px`,"--initial-height":te?"auto":`${je}px`,...D,...d.style},onDragEnd:()=>{Ie(!1),Z(null),Pt.current=null},onPointerDown:We=>{We.button!==2&&(rs||!oe||(kt.current=new Date,Je(Ct.current),We.target.setPointerCapture(We.pointerId),We.target.tagName!=="BUTTON"&&(Ie(!0),Pt.current={x:We.clientX,y:We.clientY})))},onPointerUp:()=>{var We,Me,z;if(Le||!oe)return;Pt.current=null;const be=Number(((We=Et.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ut=Number(((Me=Et.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qe=new Date().getTime()-((z=kt.current)==null?void 0:z.getTime()),it=K==="x"?be:ut,Ot=Math.abs(it)/Qe;if(Math.abs(it)>=PM||Ot>.11){Je(Ct.current),d.onDismiss==null||d.onDismiss.call(d,d),A(K==="x"?be>0?"right":"left":ut>0?"down":"up"),Bi(),J(!0);return}else{var wt,li;(wt=Et.current)==null||wt.style.setProperty("--swipe-amount-x","0px"),(li=Et.current)==null||li.style.setProperty("--swipe-amount-y","0px")}ye(!1),Ie(!1),Z(null)},onPointerMove:We=>{var Me,z,be;if(!Pt.current||!oe||((Me=window.getSelection())==null?void 0:Me.toString().length)>0)return;const Qe=We.clientY-Pt.current.y,it=We.clientX-Pt.current.x;var Ot;const wt=(Ot=r.swipeDirections)!=null?Ot:wM(ce);!K&&(Math.abs(it)>1||Math.abs(Qe)>1)&&Z(Math.abs(it)>Math.abs(Qe)?"x":"y");let li={x:0,y:0};const gs=Ni=>1/(1.5+Math.abs(Ni)/20);if(K==="y"){if(wt.includes("top")||wt.includes("bottom"))if(wt.includes("top")&&Qe<0||wt.includes("bottom")&&Qe>0)li.y=Qe;else{const Ni=Qe*gs(Qe);li.y=Math.abs(Ni)<Math.abs(Qe)?Ni:Qe}}else if(K==="x"&&(wt.includes("left")||wt.includes("right")))if(wt.includes("left")&&it<0||wt.includes("right")&&it>0)li.x=it;else{const Ni=it*gs(it);li.x=Math.abs(Ni)<Math.abs(it)?Ni:it}(Math.abs(li.x)>0||Math.abs(li.y)>0)&&ye(!0),(z=Et.current)==null||z.style.setProperty("--swipe-amount-x",`${li.x}px`),(be=Et.current)==null||be.style.setProperty("--swipe-amount-y",`${li.y}px`)}},oi&&!d.jsx&&nt!=="loading"?Ke.createElement("button",{"aria-label":W,"data-disabled":rs,"data-close-button":!0,onClick:rs||!oe?()=>{}:()=>{Bi(),d.onDismiss==null||d.onDismiss.call(d,d)},className:Gn(X?.closeButton,d==null||(i=d.classNames)==null?void 0:i.closeButton)},(Te=q?.close)!=null?Te:yM):null,(nt||d.icon||d.promise)&&d.icon!==null&&(q?.[nt]!==null||d.icon)?Ke.createElement("div",{"data-icon":"",className:Gn(X?.icon,d==null||(s=d.classNames)==null?void 0:s.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||St():null,d.type!=="loading"?Q:null):null,Ke.createElement("div",{"data-content":"",className:Gn(X?.content,d==null||(n=d.classNames)==null?void 0:n.content)},Ke.createElement("div",{"data-title":"",className:Gn(X?.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?Ke.createElement("div",{"data-description":"",className:Gn(ie,si,X?.description,d==null||(c=d.classNames)==null?void 0:c.description)},typeof d.description=="function"?d.description():d.description):null),Ke.isValidElement(d.cancel)?d.cancel:d.cancel&&pf(d.cancel)?Ke.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||w,onClick:We=>{pf(d.cancel)&&oe&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,We),Bi())},className:Gn(X?.cancelButton,d==null||(h=d.classNames)==null?void 0:h.cancelButton)},d.cancel.label):null,Ke.isValidElement(d.action)?d.action:d.action&&pf(d.action)?Ke.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||G,onClick:We=>{pf(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,We),!We.defaultPrevented&&Bi())},className:Gn(X?.actionButton,d==null||(f=d.classNames)==null?void 0:f.actionButton)},d.action.label):null)};function Bb(){if(typeof window>"u"||typeof document>"u")return"ltr";const r=document.documentElement.getAttribute("dir");return r==="auto"||!r?window.getComputedStyle(document.documentElement).direction:r}function LM(r,e){const t={};return[r,e].forEach((i,s)=>{const n=s===1,o=n?"--mobile-offset":"--offset",c=n?CM:MM;function h(f){["top","right","bottom","left"].forEach(_=>{t[`${o}-${_}`]=typeof f=="number"?`${f}px`:f})}typeof i=="number"||typeof i=="string"?h(i):typeof i=="object"?["top","right","bottom","left"].forEach(f=>{i[f]===void 0?t[`${o}-${f}`]=c:t[`${o}-${f}`]=typeof i[f]=="number"?`${i[f]}px`:i[f]}):h(c)}),t}const BM=Ke.forwardRef(function(e,t){const{id:i,invert:s,position:n="bottom-right",hotkey:o=["altKey","KeyT"],expand:c,closeButton:h,className:f,offset:_,mobileOffset:d,theme:g="light",richColors:p,duration:b,style:x,visibleToasts:E=SM,toastOptions:v,dir:S=Bb(),gap:R=DM,icons:P,containerAriaLabel:M="Notifications"}=e,[O,D]=Ke.useState([]),w=Ke.useMemo(()=>i?O.filter(N=>N.toasterId===i):O.filter(N=>!N.toasterId),[O,i]),G=Ke.useMemo(()=>Array.from(new Set([n].concat(w.filter(N=>N.position).map(N=>N.position)))),[w,n]),[H,ie]=Ke.useState([]),[ne,ce]=Ke.useState(!1),[k,te]=Ke.useState(!1),[X,q]=Ke.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Ke.useRef(null),K=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=Ke.useRef(null),F=Ke.useRef(!1),A=Ke.useCallback(N=>{D(Y=>{var se;return(se=Y.find(ue=>ue.id===N.id))!=null&&se.delete||ks.dismiss(N.id),Y.filter(({id:ue})=>ue!==N.id)})},[]);return Ke.useEffect(()=>ks.subscribe(N=>{if(N.dismiss){requestAnimationFrame(()=>{D(Y=>Y.map(se=>se.id===N.id?{...se,delete:!0}:se))});return}setTimeout(()=>{cM.flushSync(()=>{D(Y=>{const se=Y.findIndex(ue=>ue.id===N.id);return se!==-1?[...Y.slice(0,se),{...Y[se],...N},...Y.slice(se+1)]:[N,...Y]})})})}),[O]),Ke.useEffect(()=>{if(g!=="system"){q(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const N=window.matchMedia("(prefers-color-scheme: dark)");try{N.addEventListener("change",({matches:Y})=>{q(Y?"dark":"light")})}catch{N.addListener(({matches:se})=>{try{q(se?"dark":"light")}catch(ue){console.error(ue)}})}},[g]),Ke.useEffect(()=>{O.length<=1&&ce(!1)},[O]),Ke.useEffect(()=>{const N=Y=>{var se;if(o.every(Ie=>Y[Ie]||Y.code===Ie)){var pe;ce(!0),(pe=W.current)==null||pe.focus()}Y.code==="Escape"&&(document.activeElement===W.current||(se=W.current)!=null&&se.contains(document.activeElement))&&ce(!1)};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[o]),Ke.useEffect(()=>{if(W.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,F.current=!1)}},[W.current]),Ke.createElement("section",{ref:t,"aria-label":`${M} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},G.map((N,Y)=>{var se;const[ue,pe]=N.split("-");return w.length?Ke.createElement("ol",{key:N,dir:S==="auto"?Bb():S,tabIndex:-1,ref:W,className:f,"data-sonner-toaster":!0,"data-sonner-theme":X,"data-y-position":ue,"data-x-position":pe,style:{"--front-toast-height":`${((se=H[0])==null?void 0:se.height)||0}px`,"--width":`${IM}px`,"--gap":`${R}px`,...x,...LM(_,d)},onBlur:Ie=>{F.current&&!Ie.currentTarget.contains(Ie.relatedTarget)&&(F.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:Ie=>{Ie.target instanceof HTMLElement&&Ie.target.dataset.dismissible==="false"||F.current||(F.current=!0,Z.current=Ie.relatedTarget)},onMouseEnter:()=>ce(!0),onMouseMove:()=>ce(!0),onMouseLeave:()=>{k||ce(!1)},onDragEnd:()=>ce(!1),onPointerDown:Ie=>{Ie.target instanceof HTMLElement&&Ie.target.dataset.dismissible==="false"||te(!0)},onPointerUp:()=>te(!1)},w.filter(Ie=>!Ie.position&&Y===0||Ie.position===N).map((Ie,Le)=>{var J,_e;return Ke.createElement(FM,{key:Ie.id,icons:P,index:Le,toast:Ie,defaultRichColors:p,duration:(J=v?.duration)!=null?J:b,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:s,visibleToasts:E,closeButton:(_e=v?.closeButton)!=null?_e:h,interacting:k,position:N,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:A,toasts:w.filter(ye=>ye.position==Ie.position),heights:H.filter(ye=>ye.position==Ie.position),setHeights:ie,expandByDefault:c,gap:R,expanded:ne,swipeDirections:e.swipeDirections})})):null}))}),NM=({...r})=>{const{theme:e="system"}=lM();return le.jsx(BM,{"data-loc":"client/src/components/ui/sonner.tsx:8",theme:e,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...r})};function Fr(r,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(r?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}function Nb(r,e){if(typeof r=="function")return r(e);r!=null&&(r.current=e)}function DE(...r){return e=>{let t=!1;const i=r.map(s=>{const n=Nb(s,e);return!t&&typeof n=="function"&&(t=!0),n});if(t)return()=>{for(let s=0;s<i.length;s++){const n=i[s];typeof n=="function"?n():Nb(r[s],null)}}}}function go(...r){return Re.useCallback(DE(...r),r)}function PE(r,e=[]){let t=[];function i(n,o){const c=Re.createContext(o),h=t.length;t=[...t,o];const f=d=>{const{scope:g,children:p,...b}=d,x=g?.[r]?.[h]||c,E=Re.useMemo(()=>b,Object.values(b));return le.jsx(x.Provider,{value:E,children:p})};f.displayName=n+"Provider";function _(d,g){const p=g?.[r]?.[h]||c,b=Re.useContext(p);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${n}\``)}return[f,_]}const s=()=>{const n=t.map(o=>Re.createContext(o));return function(c){const h=c?.[r]||n;return Re.useMemo(()=>({[`__scope${r}`]:{...c,[r]:h}}),[c,h])}};return s.scopeName=r,[i,UM(s,...e)]}function UM(...r){const e=r[0];if(r.length===1)return e;const t=()=>{const i=r.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(n){const o=i.reduce((c,{useScope:h,scopeName:f})=>{const d=h(n)[`__scope${f}`];return{...c,...d}},{});return Re.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function OE(r){const e=zM(r),t=Re.forwardRef((i,s)=>{const{children:n,...o}=i,c=Re.Children.toArray(n),h=c.find(GM);if(h){const f=h.props.children,_=c.map(d=>d===h?Re.Children.count(f)>1?Re.Children.only(null):Re.isValidElement(f)?f.props.children:null:d);return le.jsx(e,{...o,ref:s,children:Re.isValidElement(f)?Re.cloneElement(f,void 0,_):null})}return le.jsx(e,{...o,ref:s,children:n})});return t.displayName=`${r}.Slot`,t}var kM=OE("Slot");function zM(r){const e=Re.forwardRef((t,i)=>{const{children:s,...n}=t;if(Re.isValidElement(s)){const o=WM(s),c=HM(n,s.props);return s.type!==Re.Fragment&&(c.ref=i?DE(i,o):o),Re.cloneElement(s,c)}return Re.Children.count(s)>1?Re.Children.only(null):null});return e.displayName=`${r}.SlotClone`,e}var wE=Symbol("radix.slottable");function VM(r){const e=({children:t})=>le.jsx(le.Fragment,{children:t});return e.displayName=`${r}.Slottable`,e.__radixId=wE,e}function GM(r){return Re.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===wE}function HM(r,e){const t={...e};for(const i in e){const s=r[i],n=e[i];/^on[A-Z]/.test(i)?s&&n?t[i]=(...c)=>{const h=n(...c);return s(...c),h}:s&&(t[i]=s):i==="style"?t[i]={...s,...n}:i==="className"&&(t[i]=[s,n].filter(Boolean).join(" "))}return{...r,...t}}function WM(r){let e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?r.ref:(e=Object.getOwnPropertyDescriptor(r,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?r.props.ref:r.props.ref||r.ref)}var XM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],po=XM.reduce((r,e)=>{const t=OE(`Primitive.${e}`),i=Re.forwardRef((s,n)=>{const{asChild:o,...c}=s,h=o?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),le.jsx(h,{...c,ref:n})});return i.displayName=`Primitive.${e}`,{...r,[e]:i}},{});function YM(r,e){r&&Zm.flushSync(()=>r.dispatchEvent(e))}function id(r){const e=Re.useRef(r);return Re.useEffect(()=>{e.current=r}),Re.useMemo(()=>(...t)=>e.current?.(...t),[])}function jM(r,e=globalThis?.document){const t=id(r);Re.useEffect(()=>{const i=s=>{s.key==="Escape"&&t(s)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[t,e])}var qM="DismissableLayer",Sm="dismissableLayer.update",KM="dismissableLayer.pointerDownOutside",ZM="dismissableLayer.focusOutside",Ub,FE=Re.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),LE=Re.forwardRef((r,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:n,onInteractOutside:o,onDismiss:c,...h}=r,f=Re.useContext(FE),[_,d]=Re.useState(null),g=_?.ownerDocument??globalThis?.document,[,p]=Re.useState({}),b=go(e,D=>d(D)),x=Array.from(f.layers),[E]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),v=x.indexOf(E),S=_?x.indexOf(_):-1,R=f.layersWithOutsidePointerEventsDisabled.size>0,P=S>=v,M=JM(D=>{const w=D.target,G=[...f.branches].some(H=>H.contains(w));!P||G||(s?.(D),o?.(D),D.defaultPrevented||c?.())},g),O=e1(D=>{const w=D.target;[...f.branches].some(H=>H.contains(w))||(n?.(D),o?.(D),D.defaultPrevented||c?.())},g);return jM(D=>{S===f.layers.size-1&&(i?.(D),!D.defaultPrevented&&c&&(D.preventDefault(),c()))},g),Re.useEffect(()=>{if(_)return t&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Ub=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(_)),f.layers.add(_),kb(),()=>{t&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Ub)}},[_,g,t,f]),Re.useEffect(()=>()=>{_&&(f.layers.delete(_),f.layersWithOutsidePointerEventsDisabled.delete(_),kb())},[_,f]),Re.useEffect(()=>{const D=()=>p({});return document.addEventListener(Sm,D),()=>document.removeEventListener(Sm,D)},[]),le.jsx(po.div,{...h,ref:b,style:{pointerEvents:R?P?"auto":"none":void 0,...r.style},onFocusCapture:Fr(r.onFocusCapture,O.onFocusCapture),onBlurCapture:Fr(r.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Fr(r.onPointerDownCapture,M.onPointerDownCapture)})});LE.displayName=qM;var QM="DismissableLayerBranch",$M=Re.forwardRef((r,e)=>{const t=Re.useContext(FE),i=Re.useRef(null),s=go(e,i);return Re.useEffect(()=>{const n=i.current;if(n)return t.branches.add(n),()=>{t.branches.delete(n)}},[t.branches]),le.jsx(po.div,{...r,ref:s})});$M.displayName=QM;function JM(r,e=globalThis?.document){const t=id(r),i=Re.useRef(!1),s=Re.useRef(()=>{});return Re.useEffect(()=>{const n=c=>{if(c.target&&!i.current){let h=function(){BE(KM,t,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=h,e.addEventListener("click",s.current,{once:!0})):h()}else e.removeEventListener("click",s.current);i.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",n)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",n),e.removeEventListener("click",s.current)}},[e,t]),{onPointerDownCapture:()=>i.current=!0}}function e1(r,e=globalThis?.document){const t=id(r),i=Re.useRef(!1);return Re.useEffect(()=>{const s=n=>{n.target&&!i.current&&BE(ZM,t,{originalEvent:n},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,t]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function kb(){const r=new CustomEvent(Sm);document.dispatchEvent(r)}function BE(r,e,t,{discrete:i}){const s=t.originalEvent.target,n=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:t});e&&s.addEventListener(r,e,{once:!0}),i?YM(s,n):s.dispatchEvent(n)}var sh=globalThis?.document?Re.useLayoutEffect:()=>{};const t1=["top","right","bottom","left"],Pa=Math.min,$s=Math.max,wf=Math.round,yf=Math.floor,Zn=r=>({x:r,y:r}),i1={left:"right",right:"left",bottom:"top",top:"bottom"},s1={start:"end",end:"start"};function Mm(r,e,t){return $s(r,Pa(e,t))}function kr(r,e){return typeof r=="function"?r(e):r}function zr(r){return r.split("-")[0]}function Al(r){return r.split("-")[1]}function Qm(r){return r==="x"?"y":"x"}function $m(r){return r==="y"?"height":"width"}const n1=new Set(["top","bottom"]);function jn(r){return n1.has(zr(r))?"y":"x"}function Jm(r){return Qm(jn(r))}function r1(r,e,t){t===void 0&&(t=!1);const i=Al(r),s=Jm(r),n=$m(s);let o=s==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[n]>e.floating[n]&&(o=Ff(o)),[o,Ff(o)]}function a1(r){const e=Ff(r);return[Cm(r),e,Cm(e)]}function Cm(r){return r.replace(/start|end/g,e=>s1[e])}const zb=["left","right"],Vb=["right","left"],o1=["top","bottom"],l1=["bottom","top"];function c1(r,e,t){switch(r){case"top":case"bottom":return t?e?Vb:zb:e?zb:Vb;case"left":case"right":return e?o1:l1;default:return[]}}function h1(r,e,t,i){const s=Al(r);let n=c1(zr(r),t==="start",i);return s&&(n=n.map(o=>o+"-"+s),e&&(n=n.concat(n.map(Cm)))),n}function Ff(r){return r.replace(/left|right|bottom|top/g,e=>i1[e])}function u1(r){return{top:0,right:0,bottom:0,left:0,...r}}function NE(r){return typeof r!="number"?u1(r):{top:r,right:r,bottom:r,left:r}}function Lf(r){const{x:e,y:t,width:i,height:s}=r;return{width:i,height:s,top:t,left:e,right:e+i,bottom:t+s,x:e,y:t}}function Gb(r,e,t){let{reference:i,floating:s}=r;const n=jn(e),o=Jm(e),c=$m(o),h=zr(e),f=n==="y",_=i.x+i.width/2-s.width/2,d=i.y+i.height/2-s.height/2,g=i[c]/2-s[c]/2;let p;switch(h){case"top":p={x:_,y:i.y-s.height};break;case"bottom":p={x:_,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-s.width,y:d};break;default:p={x:i.x,y:i.y}}switch(Al(e)){case"start":p[o]-=g*(t&&f?-1:1);break;case"end":p[o]+=g*(t&&f?-1:1);break}return p}const f1=async(r,e,t)=>{const{placement:i="bottom",strategy:s="absolute",middleware:n=[],platform:o}
vendor: 15,958 bytes, line 50
50=t,c=n.filter(Boolean),h=await(o.isRTL==null?void 0:o.isRTL(e));let f=await o.getElementRects({reference:r,floating:e,strategy:s}),{x:_,y:d}=Gb(f,i,h),g=i,p={},b=0;for(let x=0;x<c.length;x++){const{name:E,fn:v}=c[x],{x:S,y:R,data:P,reset:M}=await v({x:_,y:d,initialPlacement:i,placement:g,strategy:s,middlewareData:p,rects:f,platform:o,elements:{reference:r,floating:e}});_=S??_,d=R??d,p={...p,[E]:{...p[E],...P}},M&&b<=50&&(b++,typeof M=="object"&&(M.placement&&(g=M.placement),M.rects&&(f=M.rects===!0?await o.getElementRects({reference:r,floating:e,strategy:s}):M.rects),{x:_,y:d}=Gb(f,g,h)),x=-1)}return{x:_,y:d,placement:g,strategy:s,middlewareData:p}};async function nh(r,e){var t;e===void 0&&(e={});const{x:i,y:s,platform:n,rects:o,elements:c,strategy:h}=r,{boundary:f="clippingAncestors",rootBoundary:_="viewport",elementContext:d="floating",altBoundary:g=!1,padding:p=0}=kr(e,r),b=NE(p),E=c[g?d==="floating"?"reference":"floating":d],v=Lf(await n.getClippingRect({element:(t=await(n.isElement==null?void 0:n.isElement(E)))==null||t?E:E.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(c.floating)),boundary:f,rootBoundary:_,strategy:h})),S=d==="floating"?{x:i,y:s,width:o.floating.width,height:o.floating.height}:o.reference,R=await(n.getOffsetParent==null?void 0:n.getOffsetParent(c.floating)),P=await(n.isElement==null?void 0:n.isElement(R))?await(n.getScale==null?void 0:n.getScale(R))||{x:1,y:1}:{x:1,y:1},M=Lf(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:R,strategy:h}):S);return{top:(v.top-M.top+b.top)/P.y,bottom:(M.bottom-v.bottom+b.bottom)/P.y,left:(v.left-M.left+b.left)/P.x,right:(M.right-v.right+b.right)/P.x}}const d1=r=>({name:"arrow",options:r,async fn(e){const{x:t,y:i,placement:s,rects:n,platform:o,elements:c,middlewareData:h}=e,{element:f,padding:_=0}=kr(r,e)||{};if(f==null)return{};const d=NE(_),g={x:t,y:i},p=Jm(s),b=$m(p),x=await o.getDimensions(f),E=p==="y",v=E?"top":"left",S=E?"bottom":"right",R=E?"clientHeight":"clientWidth",P=n.reference[b]+n.reference[p]-g[p]-n.floating[b],M=g[p]-n.reference[p],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let D=O?O[R]:0;(!D||!await(o.isElement==null?void 0:o.isElement(O)))&&(D=c.floating[R]||n.floating[b]);const w=P/2-M/2,G=D/2-x[b]/2-1,H=Pa(d[v],G),ie=Pa(d[S],G),ne=H,ce=D-x[b]-ie,k=D/2-x[b]/2+w,te=Mm(ne,k,ce),X=!h.arrow&&Al(s)!=null&&k!==te&&n.reference[b]/2-(k<ne?H:ie)-x[b]/2<0,q=X?k<ne?k-ne:k-ce:0;return{[p]:g[p]+q,data:{[p]:te,centerOffset:k-te-q,...X&&{alignmentOffset:q}},reset:X}}}),_1=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(e){var t,i;const{placement:s,middlewareData:n,rects:o,initialPlacement:c,platform:h,elements:f}=e,{mainAxis:_=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...E}=kr(r,e);if((t=n.arrow)!=null&&t.alignmentOffset)return{};const v=zr(s),S=jn(c),R=zr(c)===c,P=await(h.isRTL==null?void 0:h.isRTL(f.floating)),M=g||(R||!x?[Ff(c)]:a1(c)),O=b!=="none";!g&&O&&M.push(...h1(c,x,b,P));const D=[c,...M],w=await nh(e,E),G=[];let H=((i=n.flip)==null?void 0:i.overflows)||[];if(_&&G.push(w[v]),d){const k=r1(s,o,P);G.push(w[k[0]],w[k[1]])}if(H=[...H,{placement:s,overflows:G}],!G.every(k=>k<=0)){var ie,ne;const k=(((ie=n.flip)==null?void 0:ie.index)||0)+1,te=D[k];if(te&&(!(d==="alignment"?S!==jn(te):!1)||H.every(W=>jn(W.placement)===S?W.overflows[0]>0:!0)))return{data:{index:k,overflows:H},reset:{placement:te}};let X=(ne=H.filter(q=>q.overflows[0]<=0).sort((q,W)=>q.overflows[1]-W.overflows[1])[0])==null?void 0:ne.placement;if(!X)switch(p){case"bestFit":{var ce;const q=(ce=H.filter(W=>{if(O){const K=jn(W.placement);return K===S||K==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(K=>K>0).reduce((K,Z)=>K+Z,0)]).sort((W,K)=>W[1]-K[1])[0])==null?void 0:ce[0];q&&(X=q);break}case"initialPlacement":X=c;break}if(s!==X)return{reset:{placement:X}}}return{}}}};function Hb(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function Wb(r){return t1.some(e=>r[e]>=0)}const m1=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:i="referenceHidden",...s}=kr(r,e);switch(i){case"referenceHidden":{const n=await nh(e,{...s,elementContext:"reference"}),o=Hb(n,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Wb(o)}}}case"escaped":{const n=await nh(e,{...s,altBoundary:!0}),o=Hb(n,t.floating);return{data:{escapedOffsets:o,escaped:Wb(o)}}}default:return{}}}}},UE=new Set(["left","top"]);async function g1(r,e){const{placement:t,platform:i,elements:s}=r,n=await(i.isRTL==null?void 0:i.isRTL(s.floating)),o=zr(t),c=Al(t),h=jn(t)==="y",f=UE.has(o)?-1:1,_=n&&h?-1:1,d=kr(e,r);let{mainAxis:g,crossAxis:p,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof b=="number"&&(p=c==="end"?b*-1:b),h?{x:p*_,y:g*f}:{x:g*f,y:p*_}}const p1=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,i;const{x:s,y:n,placement:o,middlewareData:c}=e,h=await g1(e,r);return o===((t=c.offset)==null?void 0:t.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:s+h.x,y:n+h.y,data:{...h,placement:o}}}}},y1=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:i,placement:s}=e,{mainAxis:n=!0,crossAxis:o=!1,limiter:c={fn:E=>{let{x:v,y:S}=E;return{x:v,y:S}}},...h}=kr(r,e),f={x:t,y:i},_=await nh(e,h),d=jn(zr(s)),g=Qm(d);let p=f[g],b=f[d];if(n){const E=g==="y"?"top":"left",v=g==="y"?"bottom":"right",S=p+_[E],R=p-_[v];p=Mm(S,p,R)}if(o){const E=d==="y"?"top":"left",v=d==="y"?"bottom":"right",S=b+_[E],R=b-_[v];b=Mm(S,b,R)}const x=c.fn({...e,[g]:p,[d]:b});return{...x,data:{x:x.x-t,y:x.y-i,enabled:{[g]:n,[d]:o}}}}}},b1=function(r){return r===void 0&&(r={}),{options:r,fn(e){const{x:t,y:i,placement:s,rects:n,middlewareData:o}=e,{offset:c=0,mainAxis:h=!0,crossAxis:f=!0}=kr(r,e),_={x:t,y:i},d=jn(s),g=Qm(d);let p=_[g],b=_[d];const x=kr(c,e),E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(h){const R=g==="y"?"height":"width",P=n.reference[g]-n.floating[R]+E.mainAxis,M=n.reference[g]+n.reference[R]-E.mainAxis;p<P?p=P:p>M&&(p=M)}if(f){var v,S;const R=g==="y"?"width":"height",P=UE.has(zr(s)),M=n.reference[d]-n.floating[R]+(P&&((v=o.offset)==null?void 0:v[d])||0)+(P?0:E.crossAxis),O=n.reference[d]+n.reference[R]+(P?0:((S=o.offset)==null?void 0:S[d])||0)-(P?E.crossAxis:0);b<M?b=M:b>O&&(b=O)}return{[g]:p,[d]:b}}}},x1=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,i;const{placement:s,rects:n,platform:o,elements:c}=e,{apply:h=()=>{},...f}=kr(r,e),_=await nh(e,f),d=zr(s),g=Al(s),p=jn(s)==="y",{width:b,height:x}=n.floating;let E,v;d==="top"||d==="bottom"?(E=d,v=g===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(v=d,E=g==="end"?"top":"bottom");const S=x-_.top-_.bottom,R=b-_.left-_.right,P=Pa(x-_[E],S),M=Pa(b-_[v],R),O=!e.middlewareData.shift;let D=P,w=M;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(w=R),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(D=S),O&&!g){const H=$s(_.left,0),ie=$s(_.right,0),ne=$s(_.top,0),ce=$s(_.bottom,0);p?w=b-2*(H!==0||ie!==0?H+ie:$s(_.left,_.right)):D=x-2*(ne!==0||ce!==0?ne+ce:$s(_.top,_.bottom))}await h({...e,availableWidth:w,availableHeight:D});const G=await o.getDimensions(c.floating);return b!==G.width||x!==G.height?{reset:{rects:!0}}:{}}}};function sd(){return typeof window<"u"}function Rl(r){return kE(r)?(r.nodeName||"").toLowerCase():"#document"}function sn(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function Jn(r){var e;return(e=(kE(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function kE(r){return sd()?r instanceof Node||r instanceof sn(r).Node:!1}function Pn(r){return sd()?r instanceof Element||r instanceof sn(r).Element:!1}function $n(r){return sd()?r instanceof HTMLElement||r instanceof sn(r).HTMLElement:!1}function Xb(r){return!sd()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof sn(r).ShadowRoot}const T1=new Set(["inline","contents"]);function ph(r){const{overflow:e,overflowX:t,overflowY:i,display:s}=On(r);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!T1.has(s)}const E1=new Set(["table","td","th"]);function v1(r){return E1.has(Rl(r))}const A1=[":popover-open",":modal"];function nd(r){return A1.some(e=>{try{return r.matches(e)}catch{return!1}})}const R1=["transform","translate","scale","rotate","perspective"],S1=["transform","translate","scale","rotate","perspective","filter"],M1=["paint","layout","strict","content"];function eg(r){const e=tg(),t=Pn(r)?On(r):r;return R1.some(i=>t[i]?t[i]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||S1.some(i=>(t.willChange||"").includes(i))||M1.some(i=>(t.contain||"").includes(i))}function C1(r){let e=Oa(r);for(;$n(e)&&!Tl(e);){if(eg(e))return e;if(nd(e))return null;e=Oa(e)}return null}function tg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const I1=new Set(["html","body","#document"]);function Tl(r){return I1.has(Rl(r))}function On(r){return sn(r).getComputedStyle(r)}function rd(r){return Pn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Oa(r){if(Rl(r)==="html")return r;const e=r.assignedSlot||r.parentNode||Xb(r)&&r.host||Jn(r);return Xb(e)?e.host:e}function zE(r){const e=Oa(r);return Tl(e)?r.ownerDocument?r.ownerDocument.body:r.body:$n(e)&&ph(e)?e:zE(e)}function rh(r,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const s=zE(r),n=s===((i=r.ownerDocument)==null?void 0:i.body),o=sn(s);if(n){const c=Im(o);return e.concat(o,o.visualViewport||[],ph(s)?s:[],c&&t?rh(c):[])}return e.concat(s,rh(s,[],t))}function Im(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function VE(r){const e=On(r);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=$n(r),n=s?r.offsetWidth:t,o=s?r.offsetHeight:i,c=wf(t)!==n||wf(i)!==o;return c&&(t=n,i=o),{width:t,height:i,$:c}}function ig(r){return Pn(r)?r:r.contextElement}function gl(r){const e=ig(r);if(!$n(e))return Zn(1);const t=e.getBoundingClientRect(),{width:i,height:s,$:n}=VE(e);let o=(n?wf(t.width):t.width)/i,c=(n?wf(t.height):t.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const D1=Zn(0);function GE(r){const e=sn(r);return!tg()||!e.visualViewport?D1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function P1(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==sn(r)?!1:e}function fo(r,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const s=r.getBoundingClientRect(),n=ig(r);let o=Zn(1);e&&(i?Pn(i)&&(o=gl(i)):o=gl(r));const c=P1(n,t,i)?GE(n):Zn(0);let h=(s.left+c.x)/o.x,f=(s.top+c.y)/o.y,_=s.width/o.x,d=s.height/o.y;if(n){const g=sn(n),p=i&&Pn(i)?sn(i):i;let b=g,x=Im(b);for(;x&&i&&p!==b;){const E=gl(x),v=x.getBoundingClientRect(),S=On(x),R=v.left+(x.clientLeft+parseFloat(S.paddingLeft))*E.x,P=v.top+(x.clientTop+parseFloat(S.paddingTop))*E.y;h*=E.x,f*=E.y,_*=E.x,d*=E.y,h+=R,f+=P,b=sn(x),x=Im(b)}}return Lf({width:_,height:d,x:h,y:f})}function ad(r,e){const t=rd(r).scrollLeft;return e?e.left+t:fo(Jn(r)).left+t}function HE(r,e){const t=r.getBoundingClientRect(),i=t.left+e.scrollLeft-ad(r,t),s=t.top+e.scrollTop;return{x:i,y:s}}function O1(r){let{elements:e,rect:t,offsetParent:i,strategy:s}=r;const n=s==="fixed",o=Jn(i),c=e?nd(e.floating):!1;if(i===o||c&&n)return t;let h={scrollLeft:0,scrollTop:0},f=Zn(1);const _=Zn(0),d=$n(i);if((d||!d&&!n)&&((Rl(i)!=="body"||ph(o))&&(h=rd(i)),$n(i))){const p=fo(i);f=gl(i),_.x=p.x+i.clientLeft,_.y=p.y+i.clientTop}const g=o&&!d&&!n?HE(o,h):Zn(0);return{width:t.width*f.x,height:t.height*f.y,x:t.x*f.x-h.scrollLeft*f.x+_.x+g.x,y:t.y*f.y-h.scrollTop*f.y+_.y+g.y}}function w1(r){return Array.from(r.getClientRects())}function F1(r){const e=Jn(r),t=rd(r),i=r.ownerDocument.body,s=$s(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),n=$s(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-t.scrollLeft+ad(r);const c=-t.scrollTop;return On(i).direction==="rtl"&&(o+=$s(e.clientWidth,i.clientWidth)-s),{width:s,height:n,x:o,y:c}}const Yb=25;function L1(r,e){const t=sn(r),i=Jn(r),s=t.visualViewport;let n=i.clientWidth,o=i.clientHeight,c=0,h=0;if(s){n=s.width,o=s.height;const _=tg();(!_||_&&e==="fixed")&&(c=s.offsetLeft,h=s.offsetTop)}const f=ad(i);if(f<=0){const _=i.ownerDocument,d=_.body,g=getComputedStyle(d),p=_.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(i.clientWidth-d.clientWidth-p);b<=Yb&&(n-=b)}else f<=Yb&&(n+=f);return{width:n,height:o,x:c,y:h}}const B1=new Set(["absolute","fixed"]);function N1(r,e){const t=fo(r,!0,e==="fixed"),i=t.top+r.clientTop,s=t.left+r.clientLeft,n=$n(r)?gl(r):Zn(1),o=r.clientWidth*n.x,c=r.clientHeight*n.y,h=s*n.x,f=i*n.y;return{width:o,height:c,x:h,y:f}}function jb(r,e,t){let i;if(e==="viewport")i=L1(r,t);else if(e==="document")i=F1(Jn(r));else if(Pn(e))i=N1(e,t);else{const s=GE(r);i={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Lf(i)}function WE(r,e){const t=Oa(r);return t===e||!Pn(t)||Tl(t)?!1:On(t).position==="fixed"||WE(t,e)}function U1(r,e){const t=e.get(r);if(t)return t;let i=rh(r,[],!1).filter(c=>Pn(c)&&Rl(c)!=="body"),s=null;const n=On(r).position==="fixed";let o=n?Oa(r):r;for(;Pn(o)&&!Tl(o);){const c=On(o),h=eg(o);!h&&c.position==="fixed"&&(s=null),(n?!h&&!s:!h&&c.position==="static"&&!!s&&B1.has(s.position)||ph(o)&&!h&&WE(r,o))?i=i.filter(_=>_!==o):s=c,o=Oa(o)}return e.set(r,i),i}function k1(r){let{element:e,boundary:t,rootBoundary:i,strategy:s}=r;const o=[...t==="clippingAncestors"?nd(e)?[]:U1(e,this._c):[].concat(t),i],c=o[0],h=o.reduce((f,_)=>{const d=jb(e,_,s);return f.top=$s(d.top,f.top),f.right=Pa(d.right,f.right),f.bottom=Pa(d.bottom,f.bottom),f.left=$s(d.left,f.left),f},jb(e,c,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function z1(r){const{width:e,height:t}=VE(r);return{width:e,height:t}}function V1(r,e,t){const i=$n(e),s=Jn(e),n=t==="fixed",o=fo(r,!0,n,e);let c={scrollLeft:0,scrollTop:0};const h=Zn(0);function f(){h.x=ad(s)}if(i||!i&&!n)if((Rl(e)!=="body"||ph(s))&&(c=rd(e)),i){const p=fo(e,!0,n,e);h.x=p.x+e.clientLeft,h.y=p.y+e.clientTop}else s&&f();n&&!i&&s&&f();const _=s&&!i&&!n?HE(s,c):Zn(0),d=o.left+c.scrollLeft-h.x-_.x,g=o.top+c.scrollTop-h.y-_.y;return{x:d,y:g,width:o.width,height:o.height}}function nm(r){return On(r).position==="static"}function qb(r,e){if(!$n(r)||On(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return Jn(r)===t&&(t=t.ownerDocument.body),t}function XE(r,e){const t=sn(r);if(nd(r))return t;if(!$n(r)){let s=Oa(r);for(;s&&!Tl(s);){if(Pn(s)&&!nm(s))return s;s=Oa(s)}return t}let i=qb(r,e);for(;i&&v1(i)&&nm(i);)i=qb(i,e);return i&&Tl(i)&&nm(i)&&!eg(i)?t:i||C1(r)||t}const G1=async function(r){const e=this.getOffsetParent||XE,t=this.getDimensions,i=await t(r.floating);return{reference:V1(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function H1(r){return On(r).direction==="rtl"}const W1={convertOffsetParentRelativeRectToViewportRelativeRect:O1,getDocumentElement:Jn,getClippingRect:k1,getOffsetParent:XE,getElementRects:G1,getClientRects:w1,getDimensions:z1,getScale:gl,isElement:Pn,isRTL:H1};function YE(r,e){return r.x===e.x&&r.y===e.y&&r.width===e.width&&r.height===e.height}function X1(r,e){let t=null,i;const s=Jn(r);function n(){var c;clearTimeout(i),(c=t)==null||c.disconnect(),t=null}function o(c,h){c===void 0&&(c=!1),h===void 0&&(h=1),n();const f=r.getBoundingClientRect(),{left:_,top:d,width:g,height:p}=f;
vendor: 4,891 bytes, line 50
50if(c||e(),!g||!p)return;const b=yf(d),x=yf(s.clientWidth-(_+g)),E=yf(s.clientHeight-(d+p)),v=yf(_),R={rootMargin:-b+"px "+-x+"px "+-E+"px "+-v+"px",threshold:$s(0,Pa(1,h))||1};let P=!0;function M(O){const D=O[0].intersectionRatio;if(D!==h){if(!P)return o();D?o(!1,D):i=setTimeout(()=>{o(!1,1e-7)},1e3)}D===1&&!YE(f,r.getBoundingClientRect())&&o(),P=!1}try{t=new IntersectionObserver(M,{...R,root:s.ownerDocument})}catch{t=new IntersectionObserver(M,R)}t.observe(r)}return o(!0),n}function Y1(r,e,t,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:n=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,f=ig(r),_=s||n?[...f?rh(f):[],...rh(e)]:[];_.forEach(v=>{s&&v.addEventListener("scroll",t,{passive:!0}),n&&v.addEventListener("resize",t)});const d=f&&c?X1(f,t):null;let g=-1,p=null;o&&(p=new ResizeObserver(v=>{let[S]=v;S&&S.target===f&&p&&(p.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=p)==null||R.observe(e)})),t()}),f&&!h&&p.observe(f),p.observe(e));let b,x=h?fo(r):null;h&&E();function E(){const v=fo(r);x&&!YE(x,v)&&t(),x=v,b=requestAnimationFrame(E)}return t(),()=>{var v;_.forEach(S=>{s&&S.removeEventListener("scroll",t),n&&S.removeEventListener("resize",t)}),d?.(),(v=p)==null||v.disconnect(),p=null,h&&cancelAnimationFrame(b)}}const j1=p1,q1=y1,K1=_1,Z1=x1,Q1=m1,Kb=d1,$1=b1,J1=(r,e,t)=>{const i=new Map,s={platform:W1,...t},n={...s.platform,_c:i};return f1(r,e,{...s,platform:n})};var eC=typeof document<"u",tC=function(){},If=eC?Re.useLayoutEffect:tC;function Bf(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(typeof r=="function"&&r.toString()===e.toString())return!0;let t,i,s;if(r&&e&&typeof r=="object"){if(Array.isArray(r)){if(t=r.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!Bf(r[i],e[i]))return!1;return!0}if(s=Object.keys(r),t=s.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(e,s[i]))return!1;for(i=t;i--!==0;){const n=s[i];if(!(n==="_owner"&&r.$$typeof)&&!Bf(r[n],e[n]))return!1}return!0}return r!==r&&e!==e}function jE(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Zb(r,e){const t=jE(r);return Math.round(e*t)/t}function rm(r){const e=Re.useRef(r);return If(()=>{e.current=r}),e}function iC(r){r===void 0&&(r={});const{placement:e="bottom",strategy:t="absolute",middleware:i=[],platform:s,elements:{reference:n,floating:o}={},transform:c=!0,whileElementsMounted:h,open:f}=r,[_,d]=Re.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[g,p]=Re.useState(i);Bf(g,i)||p(i);const[b,x]=Re.useState(null),[E,v]=Re.useState(null),S=Re.useCallback(W=>{W!==O.current&&(O.current=W,x(W))},[]),R=Re.useCallback(W=>{W!==D.current&&(D.current=W,v(W))},[]),P=n||b,M=o||E,O=Re.useRef(null),D=Re.useRef(null),w=Re.useRef(_),G=h!=null,H=rm(h),ie=rm(s),ne=rm(f),ce=Re.useCallback(()=>{if(!O.current||!D.current)return;const W={placement:e,strategy:t,middleware:g};ie.current&&(W.platform=ie.current),J1(O.current,D.current,W).then(K=>{const Z={...K,isPositioned:ne.current!==!1};k.current&&!Bf(w.current,Z)&&(w.current=Z,Zm.flushSync(()=>{d(Z)}))})},[g,e,t,ie,ne]);If(()=>{f===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(W=>({...W,isPositioned:!1})))},[f]);const k=Re.useRef(!1);If(()=>(k.current=!0,()=>{k.current=!1}),[]),If(()=>{if(P&&(O.current=P),M&&(D.current=M),P&&M){if(H.current)return H.current(P,M,ce);ce()}},[P,M,ce,H,G]);const te=Re.useMemo(()=>({reference:O,floating:D,setReference:S,setFloating:R}),[S,R]),X=Re.useMemo(()=>({reference:P,floating:M}),[P,M]),q=Re.useMemo(()=>{const W={position:t,left:0,top:0};if(!X.floating)return W;const K=Zb(X.floating,_.x),Z=Zb(X.floating,_.y);return c?{...W,transform:"translate("+K+"px, "+Z+"px)",...jE(X.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:K,top:Z}},[t,c,X.floating,_.x,_.y]);return Re.useMemo(()=>({..._,update:ce,refs:te,elements:X,floatingStyles:q}),[_,ce,te,X,q])}const sC=r=>{function e(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:r,fn(t){const{element:i,padding:s}=typeof r=="function"?r(t):r;return i&&e(i)?i.current!=null?Kb({element:i.current,padding:s}).fn(t):{}:i?Kb({element:i,padding:s}).fn(t):{}}}},nC=(r,e)=>({...j1(r),options:[r,e]}),rC=(r,e)=>({...q1(r),options:[r,e]}),aC=(r,e)=>({...$1(r),options:[r,e]}),oC=(r,e)=>({...K1(r),options:[r,e]}),lC=(r,e)=>({...Z1(r),options:[r,e]}),cC=(r,e)=>({...Q1(r),options:[r,e]}),hC=(r,e)=>({...sC(r),options:[r,e]});var uC="Arrow",qE=Re.forwardRef((r,e)=>{const{children:t,width:i=10,height:s=5,...n}=r;return le.jsx(po.svg,{...n,ref:e,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?t:le.jsx("polygon",{points:"0,0 30,0 15,10"})})});qE.displayName=uC;var fC=qE;function dC(r){const[e,t]=Re.useState(void 0);return sh(()=>
vendor: 11,096 bytes, line 50
50{if(r){t({width:r.offsetWidth,height:r.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const n=s[0];let o,c;if("borderBoxSize"in n){const h=n.borderBoxSize,f=Array.isArray(h)?h[0]:h;o=f.inlineSize,c=f.blockSize}else o=r.offsetWidth,c=r.offsetHeight;t({width:o,height:c})});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else t(void 0)},[r]),e}var KE="Popper",[ZE,QE]=PE(KE),[AL,$E]=ZE(KE),JE="PopperAnchor",ev=Re.forwardRef((r,e)=>{const{__scopePopper:t,virtualRef:i,...s}=r,n=$E(JE,t),o=Re.useRef(null),c=go(e,o),h=Re.useRef(null);return Re.useEffect(()=>{const f=h.current;h.current=i?.current||o.current,f!==h.current&&n.onAnchorChange(h.current)}),i?null:le.jsx(po.div,{...s,ref:c})});ev.displayName=JE;var sg="PopperContent",[_C,mC]=ZE(sg),tv=Re.forwardRef((r,e)=>{const{__scopePopper:t,side:i="bottom",sideOffset:s=0,align:n="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:h=!0,collisionBoundary:f=[],collisionPadding:_=0,sticky:d="partial",hideWhenDetached:g=!1,updatePositionStrategy:p="optimized",onPlaced:b,...x}=r,E=$E(sg,t),[v,S]=Re.useState(null),R=go(e,pe=>S(pe)),[P,M]=Re.useState(null),O=dC(P),D=O?.width??0,w=O?.height??0,G=i+(n!=="center"?"-"+n:""),H=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},ie=Array.isArray(f)?f:[f],ne=ie.length>0,ce={padding:H,boundary:ie.filter(pC),altBoundary:ne},{refs:k,floatingStyles:te,placement:X,isPositioned:q,middlewareData:W}=iC({strategy:"fixed",placement:G,whileElementsMounted:(...pe)=>Y1(...pe,{animationFrame:p==="always"}),elements:{reference:E.anchor},middleware:[nC({mainAxis:s+w,alignmentAxis:o}),h&&rC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?aC():void 0,...ce}),h&&oC({...ce}),lC({...ce,apply:({elements:pe,rects:Ie,availableWidth:Le,availableHeight:J})=>{const{width:_e,height:ye}=Ie.reference,Ne=pe.floating.style;Ne.setProperty("--radix-popper-available-width",`${Le}px`),Ne.setProperty("--radix-popper-available-height",`${J}px`),Ne.setProperty("--radix-popper-anchor-width",`${_e}px`),Ne.setProperty("--radix-popper-anchor-height",`${ye}px`)}}),P&&hC({element:P,padding:c}),yC({arrowWidth:D,arrowHeight:w}),g&&cC({strategy:"referenceHidden",...ce})]}),[K,Z]=nv(X),F=id(b);sh(()=>{q&&F?.()},[q,F]);const A=W.arrow?.x,N=W.arrow?.y,Y=W.arrow?.centerOffset!==0,[se,ue]=Re.useState();return sh(()=>{v&&ue(window.getComputedStyle(v).zIndex)},[v]),le.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:q?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:le.jsx(_C,{scope:t,placedSide:K,onArrowChange:M,arrowX:A,arrowY:N,shouldHideArrow:Y,children:le.jsx(po.div,{"data-side":K,"data-align":Z,...x,ref:R,style:{...x.style,animation:q?void 0:"none"}})})})});tv.displayName=sg;var iv="PopperArrow",gC={top:"bottom",right:"left",bottom:"top",left:"right"},sv=Re.forwardRef(function(e,t){const{__scopePopper:i,...s}=e,n=mC(iv,i),o=gC[n.placedSide];return le.jsx("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:le.jsx(fC,{...s,ref:t,style:{...s.style,display:"block"}})})});sv.displayName=iv;function pC(r){return r!==null}var yC=r=>({name:"transformOrigin",options:r,fn(e){const{placement:t,rects:i,middlewareData:s}=e,o=s.arrow?.centerOffset!==0,c=o?0:r.arrowWidth,h=o?0:r.arrowHeight,[f,_]=nv(t),d={start:"0%",center:"50%",end:"100%"}[_],g=(s.arrow?.x??0)+c/2,p=(s.arrow?.y??0)+h/2;let b="",x="";return f==="bottom"?(b=o?d:`${g}px`,x=`${-h}px`):f==="top"?(b=o?d:`${g}px`,x=`${i.floating.height+h}px`):f==="right"?(b=`${-h}px`,x=o?d:`${p}px`):f==="left"&&(b=`${i.floating.width+h}px`,x=o?d:`${p}px`),{data:{x:b,y:x}}}});function nv(r){const[e,t="center"]=r.split("-");return[e,t]}var bC=ev,xC=tv,TC=sv;function EC(r,e){return Re.useReducer((t,i)=>e[t][i]??t,r)}var rv=r=>{const{present:e,children:t}=r,i=vC(e),s=typeof t=="function"?t({present:i.isPresent}):Re.Children.only(t),n=go(i.ref,AC(s));return typeof t=="function"||i.isPresent?Re.cloneElement(s,{ref:n}):null};rv.displayName="Presence";function vC(r){const[e,t]=Re.useState(),i=Re.useRef(null),s=Re.useRef(r),n=Re.useRef("none"),o=r?"mounted":"unmounted",[c,h]=EC(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Re.useEffect(()=>{const f=bf(i.current);n.current=c==="mounted"?f:"none"},[c]),sh(()=>{const f=i.current,_=s.current;if(_!==r){const g=n.current,p=bf(f);r?h("MOUNT"):p==="none"||f?.display==="none"?h("UNMOUNT"):h(_&&g!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=r}},[r,h]),sh(()=>{if(e){let f;const _=e.ownerDocument.defaultView??window,d=p=>{const x=bf(i.current).includes(CSS.escape(p.animationName));if(p.target===e&&x&&(h("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",f=_.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},g=p=>{p.target===e&&(n.current=bf(i.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{_.clearTimeout(f),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else h("ANIMATION_END")},[e,h]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:Re.useCallback(f=>{i.current=f?getComputedStyle(f):null,t(f)},[])}}function bf(r){return r?.animationName||"none"}function AC(r){let e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?r.ref:(e=Object.getOwnPropertyDescriptor(r,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?r.props.ref:r.props.ref||r.ref)}var RC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),SC="VisuallyHidden",av=Re.forwardRef((r,e)=>le.jsx(po.span,{...r,ref:e,style:{...RC,...r.style}}));av.displayName=SC;var MC=av,[od]=PE("Tooltip",[QE]),ng=QE(),ov="TooltipProvider",CC=700,Qb="tooltip.open",[IC,lv]=od(ov),cv=r=>{const{__scopeTooltip:e,delayDuration:t=CC,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:n}=r,o=Re.useRef(!0),c=Re.useRef(!1),h=Re.useRef(0);return Re.useEffect(()=>{const f=h.current;return()=>window.clearTimeout(f)},[]),le.jsx(IC,{scope:e,isOpenDelayedRef:o,delayDuration:t,onOpen:Re.useCallback(()=>{window.clearTimeout(h.current),o.current=!1},[]),onClose:Re.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>o.current=!0,i)},[i]),isPointerInTransitRef:c,onPointerInTransitChange:Re.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:n})};cv.displayName=ov;var hv="Tooltip",[RL,ld]=od(hv),Dm="TooltipTrigger",DC=Re.forwardRef((r,e)=>{const{__scopeTooltip:t,...i}=r,s=ld(Dm,t),n=lv(Dm,t),o=ng(t),c=Re.useRef(null),h=go(e,c,s.onTriggerChange),f=Re.useRef(!1),_=Re.useRef(!1),d=Re.useCallback(()=>f.current=!1,[]);return Re.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),le.jsx(bC,{asChild:!0,...o,children:le.jsx(po.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:h,onPointerMove:Fr(r.onPointerMove,g=>{g.pointerType!=="touch"&&!_.current&&!n.isPointerInTransitRef.current&&(s.onTriggerEnter(),_.current=!0)}),onPointerLeave:Fr(r.onPointerLeave,()=>{s.onTriggerLeave(),_.current=!1}),onPointerDown:Fr(r.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Fr(r.onFocus,()=>{f.current||s.onOpen()}),onBlur:Fr(r.onBlur,s.onClose),onClick:Fr(r.onClick,s.onClose)})})});DC.displayName=Dm;var PC="TooltipPortal",[SL,OC]=od(PC,{forceMount:void 0}),El="TooltipContent",wC=Re.forwardRef((r,e)=>{const t=OC(El,r.__scopeTooltip),{forceMount:i=t.forceMount,side:s="top",...n}=r,o=ld(El,r.__scopeTooltip);return le.jsx(rv,{present:i||o.open,children:o.disableHoverableContent?le.jsx(uv,{side:s,...n,ref:e}):le.jsx(FC,{side:s,...n,ref:e})})}),FC=Re.forwardRef((r,e)=>{const t=ld(El,r.__scopeTooltip),i=lv(El,r.__scopeTooltip),s=Re.useRef(null),n=go(e,s),[o,c]=Re.useState(null),{trigger:h,onClose:f}=t,_=s.current,{onPointerInTransitChange:d}=i,g=Re.useCallback(()=>{c(null),d(!1)},[d]),p=Re.useCallback((b,x)=>{const E=b.currentTarget,v={x:b.clientX,y:b.clientY},S=kC(v,E.getBoundingClientRect()),R=zC(v,S),P=VC(x.getBoundingClientRect()),M=HC([...R,...P]);c(M),d(!0)},[d]);return Re.useEffect(()=>()=>g(),[g]),Re.useEffect(()=>{if(h&&_){const b=E=>p(E,_),x=E=>p(E,h);return h.addEventListener("pointerleave",b),_.addEventListener("pointerleave",x),()=>{h.removeEventListener("pointerleave",b),_.removeEventListener("pointerleave",x)}}},[h,_,p,g]),Re.useEffect(()=>{if(o){const b=x=>{const E=x.target,v={x:x.clientX,y:x.clientY},S=h?.contains(E)||_?.contains(E),R=!GC(v,o);S?g():R&&(g(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[h,_,o,f,g]),le.jsx(uv,{...r,ref:n})}),[LC,BC]=od(hv,{isInside:!1}),NC=VM("TooltipContent"),uv=Re.forwardRef((r,e)=>{const{__scopeTooltip:t,children:i,"aria-label":s,onEscapeKeyDown:n,onPointerDownOutside:o,...c}=r,h=ld(El,t),f=ng(t),{onClose:_}=h;return Re.useEffect(()=>(document.addEventListener(Qb,_),()=>document.removeEventListener(Qb,_)),[_]),Re.useEffect(()=>{if(h.trigger){const d=g=>{g.target?.contains(h.trigger)&&_()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[h.trigger,_]),le.jsx(LE,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:_,children:le.jsxs(xC,{"data-state":h.stateAttribute,...f,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[le.jsx(NC,{children:i}),le.jsx(LC,{scope:t,isInside:!0,children:le.jsx(MC,{id:h.contentId,role:"tooltip",children:s||i})})]})})});wC.displayName=El;var fv="TooltipArrow",UC=Re.forwardRef((r,e)=>{const{__scopeTooltip:t,...i}=r,s=ng(t);return BC(fv,t).isInside?null:le.jsx(TC,{...s,...i,ref:e})});UC.displayName=fv;function kC(r,e){const t=Math.abs(e.top-r.y),i=Math.abs(e.bottom-r.y),s=Math.abs(e.right-r.x),n=Math.abs(e.left-r.x);
vendor: 9,156 bytes, line 50
50switch(Math.min(t,i,s,n)){case n:return"left";case s:return"right";case t:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function zC(r,e,t=5){const i=[];switch(e){case"top":i.push({x:r.x-t,y:r.y+t},{x:r.x+t,y:r.y+t});break;case"bottom":i.push({x:r.x-t,y:r.y-t},{x:r.x+t,y:r.y-t});break;case"left":i.push({x:r.x+t,y:r.y-t},{x:r.x+t,y:r.y+t});break;case"right":i.push({x:r.x-t,y:r.y-t},{x:r.x-t,y:r.y+t});break}return i}function VC(r){const{top:e,right:t,bottom:i,left:s}=r;return[{x:s,y:e},{x:t,y:e},{x:t,y:i},{x:s,y:i}]}function GC(r,e){const{x:t,y:i}=r;let s=!1;for(let n=0,o=e.length-1;n<e.length;o=n++){const c=e[n],h=e[o],f=c.x,_=c.y,d=h.x,g=h.y;_>i!=g>i&&t<(d-f)*(i-_)/(g-_)+f&&(s=!s)}return s}function HC(r){const e=r.slice();return e.sort((t,i)=>t.x<i.x?-1:t.x>i.x?1:t.y<i.y?-1:t.y>i.y?1:0),WC(e)}function WC(r){if(r.length<=1)return r.slice();const e=[];for(let i=0;i<r.length;i++){const s=r[i];for(;e.length>=2;){const n=e[e.length-1],o=e[e.length-2];if((n.x-o.x)*(s.y-o.y)>=(n.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const t=[];for(let i=r.length-1;i>=0;i--){const s=r[i];for(;t.length>=2;){const n=t[t.length-1],o=t[t.length-2];if((n.x-o.x)*(s.y-o.y)>=(n.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var XC=cv;function dv(r){var e,t,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(e=0;e<s;e++)r[e]&&(t=dv(r[e]))&&(i&&(i+=" "),i+=t)}else for(t in r)r[t]&&(i&&(i+=" "),i+=t);return i}function _v(){for(var r,e,t=0,i="",s=arguments.length;t<s;t++)(r=arguments[t])&&(e=dv(r))&&(i&&(i+=" "),i+=e);return i}const rg="-",YC=r=>{const e=qC(r),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:o=>{const c=o.split(rg);return c[0]===""&&c.length!==1&&c.shift(),mv(c,e)||jC(o)},getConflictingClassGroupIds:(o,c)=>{const h=t[o]||[];return c&&i[o]?[...h,...i[o]]:h}}},mv=(r,e)=>{if(r.length===0)return e.classGroupId;const t=r[0],i=e.nextPart.get(t),s=i?mv(r.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;const n=r.join(rg);return e.validators.find(({validator:o})=>o(n))?.classGroupId},$b=/^\[(.+)\]$/,jC=r=>{if($b.test(r)){const e=$b.exec(r)[1],t=e?.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},qC=r=>{const{theme:e,classGroups:t}=r,i={nextPart:new Map,validators:[]};for(const s in t)Pm(t[s],i,s,e);return i},Pm=(r,e,t,i)=>{r.forEach(s=>{if(typeof s=="string"){const n=s===""?e:Jb(e,s);n.classGroupId=t;return}if(typeof s=="function"){if(KC(s)){Pm(s(i),e,t,i);return}e.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([n,o])=>{Pm(o,Jb(e,n),t,i)})})},Jb=(r,e)=>{let t=r;return e.split(rg).forEach(i=>{t.nextPart.has(i)||t.nextPart.set(i,{nextPart:new Map,validators:[]}),t=t.nextPart.get(i)}),t},KC=r=>r.isThemeGetter,ZC=r=>{if(r<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,i=new Map;const s=(n,o)=>{t.set(n,o),e++,e>r&&(e=0,i=t,t=new Map)};return{get(n){let o=t.get(n);if(o!==void 0)return o;if((o=i.get(n))!==void 0)return s(n,o),o},set(n,o){t.has(n)?t.set(n,o):s(n,o)}}},Om="!",wm=":",QC=wm.length,$C=r=>{const{prefix:e,experimentalParseClassName:t}=r;let i=s=>{const n=[];let o=0,c=0,h=0,f;for(let b=0;b<s.length;b++){let x=s[b];if(o===0&&c===0){if(x===wm){n.push(s.slice(h,b)),h=b+QC;continue}if(x==="/"){f=b;continue}}x==="["?o++:x==="]"?o--:x==="("?c++:x===")"&&c--}const _=n.length===0?s:s.substring(h),d=JC(_),g=d!==_,p=f&&f>h?f-h:void 0;return{modifiers:n,hasImportantModifier:g,baseClassName:d,maybePostfixModifierPosition:p}};if(e){const s=e+wm,n=i;i=o=>o.startsWith(s)?n(o.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(t){const s=i;i=n=>t({className:n,parseClassName:s})}return i},JC=r=>r.endsWith(Om)?r.substring(0,r.length-1):r.startsWith(Om)?r.substring(1):r,eI=r=>{const e=Object.fromEntries(r.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const s=[];let n=[];return i.forEach(o=>{o[0]==="["||e[o]?(s.push(...n.sort(),o),n=[]):n.push(o)}),s.push(...n.sort()),s}},tI=r=>({cache:ZC(r.cacheSize),parseClassName:$C(r),sortModifiers:eI(r),...YC(r)}),iI=/\s+/,sI=(r,e)=>{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:n}=e,o=[],c=r.trim().split(iI);let h="";for(let f=c.length-1;f>=0;f-=1){const _=c[f],{isExternal:d,modifiers:g,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:x}=t(_);if(d){h=_+(h.length>0?" "+h:h);continue}let E=!!x,v=i(E?b.substring(0,x):b);if(!v){if(!E){h=_+(h.length>0?" "+h:h);continue}if(v=i(b),!v){h=_+(h.length>0?" "+h:h);continue}E=!1}const S=n(g).join(":"),R=p?S+Om:S,P=R+v;if(o.includes(P))continue;o.push(P);const M=s(v,E);for(let O=0;O<M.length;++O){const D=M[O];o.push(R+D)}h=_+(h.length>0?" "+h:h)}return h};function nI(){let r=0,e,t,i="";for(;r<arguments.length;)(e=arguments[r++])&&(t=gv(e))&&(i&&(i+=" "),i+=t);return i}const gv=r=>{if(typeof r=="string")return r;let e,t="";for(let i=0;i<r.length;i++)r[i]&&(e=gv(r[i]))&&(t&&(t+=" "),t+=e);return t};function rI(r,...e){let t,i,s,n=o;function o(h){const f=e.reduce((_,d)=>d(_),r());return t=tI(f),i=t.cache.get,s=t.cache.set,n=c,c(h)}function c(h){const f=i(h);if(f)return f;const _=sI(h,t);return s(h,_),_}return function(){return n(nI.apply(null,arguments))}}const es=r=>{const e=t=>t[r]||[];return e.isThemeGetter=!0,e},pv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aI=/^\d+\/\d+$/,oI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fl=r=>aI.test(r),Vt=r=>!!r&&!Number.isNaN(Number(r)),xa=r=>!!r&&Number.isInteger(Number(r)),am=r=>r.endsWith("%")&&Vt(r.slice(0,-1)),Cr=r=>oI.test(r),fI=()=>!0,dI=r=>lI.test(r)&&!cI.test(r),bv=()=>!1,_I=r=>hI.test(r),mI=r=>uI.test(r),gI=r=>!ct(r)&&!ht(r),pI=r=>Sl(r,Ev,bv),ct=r=>pv.test(r),to=r=>Sl(r,vv,dI),om=r=>Sl(r,EI,Vt),ex=r=>Sl(r,xv,bv),yI=r=>Sl(r,Tv,mI),xf=r=>Sl(r,Av,_I),ht=r=>yv.test(r),Zc=r=>Ml(r,vv),bI=r=>Ml(r,vI),tx=r=>Ml(r,xv),xI=r=>Ml(r,Ev),TI=r=>Ml(r,Tv),Tf=r=>Ml(r,Av,!0),Sl=(r,e,t)=>{const i=pv.exec(r);return i?i[1]?e(i[1]):t(i[2]):!1},Ml=(r,e,t=!1)=>{const i=yv.exec(r);return i?i[1]?e(i[1]):t:!1},xv=r=>r==="position"||r==="percentage",Tv=r=>r==="image"||r==="url",Ev=r=>r==="length"||r==="size"||r==="bg-size",vv=r=>r==="length",EI=r=>r==="number",vI=r=>r==="family-name",Av=r=>r==="shadow",AI=()=>{const r=es("color"),e=es("font"),t=es("text"),i=es("font-weight"),s=es("tracking"),n=es("leading"),o=es("breakpoint"),c=es("container"),h=es("spacing"),f=es("radius"),_=es("shadow"),d=es("inset-shadow"),g=es("text-shadow"),p=es("drop-shadow"),b=es("blur"),x=es("perspective"),E=es("aspect"),v=es("ease"),S=es("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...P(),ht,ct],O=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],w=()=>[ht,ct,h],G=()=>[fl,"full","auto",...w()],H=()=>[xa,"none","subgrid",ht,ct],ie=()=>["auto",{span:["full",xa,ht,ct]},xa,ht,ct],ne=()=>[xa,"auto",ht,ct],ce=()=>["auto","min","max","fr",ht,ct],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...w()],q=()=>[fl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],W=()=>[r,ht,ct],K=()=>[...P(),tx,ex,{position:[ht,ct]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",xI,pI,{size:[ht,ct]}],A=()=>[am,Zc,to],N=()=>["","none","full",f,ht,ct],Y=()=>["",Vt,Zc,to],se=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[Vt,am,tx,ex],Ie=()=>["","none",b,ht,ct],Le=()=>["none",Vt,ht,ct],J=()=>["none",Vt,ht,ct],_e=()=>[Vt,ht,ct],ye=()=>[fl,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cr],breakpoint:[Cr],color:[fI],container:[Cr],"drop-shadow":[Cr],ease:["in","out","in-out"],font:[gI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Cr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Cr],shadow:[Cr],spacing:["px",Vt],text:[Cr],"text-shadow":[Cr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fl,ct,ht,E]}
vendor: 12,854 bytes, line 50
50],container:["container"],columns:[{columns:[Vt,ct,ht,c]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[xa,"auto",ht,ct]}],basis:[{basis:[fl,"full","auto",c,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Vt,fl,"auto","initial","none",ct]}],grow:[{grow:["",Vt,ht,ct]}],shrink:[{shrink:["",Vt,ht,ct]}],order:[{order:[xa,"first","last","none",ht,ct]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[c,"screen",...q()]}],"min-w":[{"min-w":[c,"screen","none",...q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",t,Zc,to]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ht,om]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",am,ct]}],"font-family":[{font:[bI,ct,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ht,ct]}],"line-clamp":[{"line-clamp":[Vt,"none",ht,om]}],leading:[{leading:[n,...w()]}],"list-image":[{"list-image":["none",ht,ct]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ht,ct]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Vt,"from-font","auto",ht,to]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Vt,"auto",ht,ct]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht,ct]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ht,ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xa,ht,ct],radial:["",ht,ct],conic:[xa,ht,ct]},TI,yI]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:A()}],"gradient-via-pos":[{via:A()}],"gradient-to-pos":[{to:A()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:N()}],"rounded-s":[{"rounded-s":N()}],"rounded-e":[{"rounded-e":N()}],"rounded-t":[{"rounded-t":N()}],"rounded-r":[{"rounded-r":N()}],"rounded-b":[{"rounded-b":N()}],"rounded-l":[{"rounded-l":N()}],"rounded-ss":[{"rounded-ss":N()}],"rounded-se":[{"rounded-se":N()}],"rounded-ee":[{"rounded-ee":N()}],"rounded-es":[{"rounded-es":N()}],"rounded-tl":[{"rounded-tl":N()}],"rounded-tr":[{"rounded-tr":N()}],"rounded-br":[{"rounded-br":N()}],"rounded-bl":[{"rounded-bl":N()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Vt,ht,ct]}],"outline-w":[{outline:["",Vt,Zc,to]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",_,Tf,xf]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",d,Tf,xf]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Vt,to]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",g,Tf,xf]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Vt,ht,ct]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[ht,ct]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[Vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ht,ct]}],filter:[{filter:["","none",ht,ct]}],blur:[{blur:Ie()}],brightness:[{brightness:[Vt,ht,ct]}],contrast:[{contrast:[Vt,ht,ct]}],"drop-shadow":[{"drop-shadow":["","none",p,Tf,xf]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Vt,ht,ct]}],"hue-rotate":[{"hue-rotate":[Vt,ht,ct]}],invert:[{invert:["",Vt,ht,ct]}],saturate:[{saturate:[Vt,ht,ct]}],sepia:[{sepia:["",Vt,ht,ct]}],"backdrop-filter":[{"backdrop-filter":["","none",ht,ct]}],"backdrop-blur":[{"backdrop-blur":Ie()}],"backdrop-brightness":[{"backdrop-brightness":[Vt,ht,ct]}],"backdrop-contrast":[{"backdrop-contrast":[Vt,ht,ct]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Vt,ht,ct]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Vt,ht,ct]}],"backdrop-invert":[{"backdrop-invert":["",Vt,ht,ct]}],"backdrop-opacity":[{"backdrop-opacity":[Vt,ht,ct]}],"backdrop-saturate":[{"backdrop-saturate":[Vt,ht,ct]}],"backdrop-sepia":[{"backdrop-sepia":["",Vt,ht,ct]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ht,ct]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Vt,"initial",ht,ct]}],ease:[{ease:["linear","initial",v,ht,ct]}],delay:[{delay:[Vt,ht,ct]}],animate:[{animate:["none",S,ht,ct]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,ht,ct]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:J()}],"scale-x":[{"scale-x":J()}],"scale-y":[{"scale-y":J()}],"scale-z":[{"scale-z":J()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[ht,ct,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}
50],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ht,ct]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ht,ct]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Vt,Zc,to,om]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},RI=rI(AI);function cd(...r){return RI(_v(r))}function SI({delayDuration:r=0,...e}){return le.jsx(XC,{"data-loc":"client/src/components/ui/tooltip.tsx:11","data-slot":"tooltip-provider",delayDuration:r,...e})}function MI(r,e){if(r instanceof RegExp)return{keys:!1,pattern:r};var t,i,s,n,o=[],c="",h=r.split("/");for(h[0]||h.shift();s=h.shift();)t=s[0],t==="*"?(o.push(t),c+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):t===":"?(i=s.indexOf("?",1),n=s.indexOf(".",1),o.push(s.substring(1,~i?i:~n?n:s.length)),c+=~i&&!~n?"(?:/([^/]+?))?":"/([^/]+?)",~n&&(c+=(~i?"?":"")+"\\"+s.substring(n))):c+="/"+s;return{keys:o,pattern:new RegExp("^"+c+(e?"(?=$|/)":"/?$"),"i")}}var lm={exports:{}},cm={};/**
51 * @license React
52 * use-sync-external-store-shim.production.js
53 *
54 * Copyright (c) Meta Platforms, Inc. and affiliates.
55 *
56 * This source code is licensed under the MIT license found in the
57 * LICENSE file in the root directory of this source tree.
58 */var ix;function CI(){if(ix)return cm;ix=1;var r=td();function e(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var t=typeof Object.is=="function"?Object.is:e,i=r.useState,s=r.useEffect,n=r.useLayoutEffect,o=r.useDebugValue;function c(d,g){var p=g(),b=i({inst:{value:p,getSnapshot:g}}),x=b[0].inst,E=b[1];return n(function(){x.value=p,x.getSnapshot=g,h(x)&&E({inst:x})},[d,p,g]),s(function(){return h(x)&&E({inst:x}),d(function(){h(x)&&E({inst:x})})},[d]),o(p),p}function h(d){var g=d.getSnapshot;d=d.value;try{var p=g();return!t(d,p)}catch{return!0}}function f(d,g){return g()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return cm.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:_,cm}var sx;
58function II(){return sx||(sx=1,lm.exports=CI()),lm.exports}var DI=II();const PI=nM.useInsertionEffect,OI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wI=OI?Re.useLayoutEffect:Re.useEffect,FI=PI||wI,Rv=r=>{const e=Re.useRef([r,(...t)=>e[0](...t)]).current;return FI(()=>{e[0]=r}),e[1]},LI="popstate",ag="pushState",og="replaceState",BI="hashchange",nx=[LI,ag,og,BI],NI=r=>{for(const e of nx)addEventListener(e,r);return()=>{for(const e of nx)removeEventListener(e,r)}},Sv=(r,e)=>DI.useSyncExternalStore(NI,r,e),UI=()=>location.search,kI=({ssrSearch:r=""}={})=>Sv(UI,()=>r),rx=()=>location.pathname,zI=({ssrPath:r}={})=>Sv(rx,r?()=>r:rx),VI=(r,{replace:e=!1,state:t=null}={})=>history[e?og:ag](t,"",r),GI=(r={})=>[zI(r),VI],ax=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[ax]>"u"){for(const r of[ag,og]){const e=history[r];history[r]=function(){const t=e.apply(this,arguments),i=new Event(r);return i.arguments=arguments,dispatchEvent(i),t}}Object.defineProperty(window,ax,{value:!0})}const HI=(r,e)=>e.toLowerCase().indexOf(r.toLowerCase())?"~"+e:e.slice(r.length)||"/",Mv=(r="")=>r==="/"?"":r,WI=(r,e)=>r[0]==="~"?r.slice(1):Mv(e)+r,XI=(r="",e)=>HI(ox(Mv(r)),ox(e)),ox=r=>{try{return decodeURI(r)}catch{return r}},Cv={hook:GI,searchHook:kI,parser:MI,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:r=>r},Iv=Re.createContext(Cv),yh=()=>Re.useContext(Iv),Dv={},Pv=Re.createContext(Dv),YI=()=>Re.useContext(Pv),hd=r=>{const[e,t]=r.hook(r);return[XI(r.base,e),Rv((i,s)=>t(WI(i,r.base),s))]},jI=()=>hd(yh()),Ov=(r,e,t,i)=>{const{pattern:s,keys:n}=e instanceof RegExp?{keys:!1,pattern:e}:r(e||"*",i),o=s.exec(t)||[],[c,...h]=o;return c!==void 0?[!0,(()=>{const f=n!==!1?Object.fromEntries(n.map((d,g)=>[d,h[g]])):o.groups;let _={...h};return f&&Object.assign(_,f),_})(),...i?[c]:[]]:[!1,null]},qI=({children:r,...e})=>{const t=yh(),i=e.hook?Cv:t;let s=i;const[n,o]=e.ssrPath?.split("?")??[];o&&(e.ssrSearch=o,e.ssrPath=n),e.hrefs=e.hrefs??e.hook?.hrefs;let c=Re.useRef({}),h=c.current,f=h;for(let _ in i){const d=_==="base"?i[_]+(e[_]||""):e[_]||i[_];h===f&&d!==f[_]&&(c.current=f={...f}),f[_]=d,(d!==i[_]||d!==s[_])&&(s=f)}return Re.createElement(Iv.Provider,{value:s,children:r})},lx=({children:r,component:e},t)=>e?Re.createElement(e,{params:t}):typeof r=="function"?r(t):r,KI=r=>{let e=Re.useRef(Dv);const t=e.current;return e.current=Object.keys(r).length!==Object.keys(t).length||Object.entries(r).some(([i,s])=>s!==t[i])?r:t},hm=({path:r,nest:e,match:t,...i})=>{const s=yh(),[n]=hd(s),[o,c,h]=t??Ov(s.parser,r,n,e),f=KI({...YI(),...c});if(!o)return null;const _=h?Re.createElement(qI,{base:h},lx(i,f)):lx(i,f);return Re.createElement(Pv.Provider,{value:f,children:_})};Re.forwardRef((r,e)=>
58{const t=yh(),[i,s]=hd(t),{to:n="",href:o=n,onClick:c,asChild:h,children:f,className:_,replace:d,state:g,...p}=r,b=Rv(E=>{E.ctrlKey||E.metaKey||E.altKey||E.shiftKey||E.button!==0||(c?.(E),E.defaultPrevented||(E.preventDefault(),s(o,r)))}),x=t.hrefs(o[0]==="~"?o.slice(1):t.base+o,t);return h&&Re.isValidElement(f)?Re.cloneElement(f,{onClick:b,href:x}):Re.createElement("a",{...p,onClick:b,href:x,className:_?.call?_(i===o):_,children:f,ref:e})});const Fm=r=>Array.isArray(r)?r.flatMap(e=>Fm(e&&e.type===Re.Fragment?e.props.children:e)):[r],ZI=({children:r,location:e})=>{const t=yh(),[i]=hd(t);typeof window<"u"&&(window.__WOUTER_ROUTES__||(window.__WOUTER_ROUTES__=[]),Fm(r).forEach(n=>{if(Re.isValidElement(n)&&n.props.path){const o=n.props.path;window.__WOUTER_ROUTES__.includes(o)||window.__WOUTER_ROUTES__.push(o)}}));for(const s of Fm(r)){let n=0;if(Re.isValidElement(s)&&(n=Ov(t.parser,s.props.path,e||i,s.props.nest))[0])return Re.cloneElement(s,{match:n})}return null};/**
59 * @license lucide-react v0.453.0 - ISC
60 *
61 * This source code is licensed under the ISC license.
62 * See the LICENSE file in the root directory of this source tree.
63 */const QI=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wv=(...r)=>r.filter((e,t,i)=>!!e&&i.indexOf(e)===t).join(" ");/**
64 * @license lucide-react v0.453.0 - ISC
65 *
66 * This source code is licensed under the ISC license.
67 * See the LICENSE file in the root directory of this source tree.
68 */var $I={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
69 * @license lucide-react v0.453.0 - ISC
70 *
71 * This source code is licensed under the ISC license.
72 * See the LICENSE file in the root directory of this source tree.
73 */const JI=Re.forwardRef(({color:r="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:s="",children:n,iconNode:o,...c},h)=>Re.createElement("svg",{ref:h,...$I,width:e,height:e,stroke:r,strokeWidth:i?Number(t)*24/Number(e):t,className:wv("lucide",s),...c},[...o.map(([f,_])=>Re.createElement(f,_)),...Array.isArray(n)?n:[n]]));/**
74 * @license lucide-react v0.453.0 - ISC
75 *
76 * This source code is licensed under the ISC license.
77 * See the LICENSE file in the root directory of this source tree.
78 */const vs=(r,e)=>{const t=Re.forwardRef(({className:i,...s},n)=>Re.createElement(JI,{ref:n,iconNode:e,className:wv(`lucide-${QI(r)}`,i),...s}));return t.displayName=`${r}`,t};/**
79 * @license lucide-react v0.453.0 - ISC
80 *
81 * This source code is licensed under the ISC license.
82 * See the LICENSE file in the root directory of this source tree.
83 */const eD=vs("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
84 * @license lucide-react v0.453.0 - ISC
85 *
86 * This source code is licensed under the ISC license.
87 * See the LICENSE file in the root directory of this source tree.
88 */const tD=vs("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
89 * @license lucide-react v0.453.0 - ISC
90 *
91 * This source code is licensed under the ISC license.
92 * See the LICENSE file in the root directory of this source tree.
93 */const iD=vs("BatteryCharging",[["path",{d:"M15 7h1a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-2",key:"1sdynx"}],["path",{d:"M6 7H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h1",key:"1gkd3k"}],["path",{d:"m11 7-3 5h4l-3 5",key:"b4a64w"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/**
94 * @license lucide-react v0.453.0 - ISC
95 *
96 * This source code is licensed under the ISC license.
97 * See the LICENSE file in the root directory of this source tree.
98 */const sD=vs("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
99 * @license lucide-react v0.453.0 - ISC
100 *
101 * This source code is licensed under the ISC license.
102 * See the LICENSE file in the root directory of this source tree.
103 */const nD=vs("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
104 * @license lucide-react v0.453.0 - ISC
105 *
106 * This source code is licensed under the ISC license.
107 * See the LICENSE file in the root directory of this source tree.
108 */const rD=vs("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
108],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
109 * @license lucide-react v0.453.0 - ISC
110 *
111 * This source code is licensed under the ISC license.
112 * See the LICENSE file in the root directory of this source tree.
113 */const aD=vs("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
114 * @license lucide-react v0.453.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const oD=vs("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
119 * @license lucide-react v0.453.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */const lD=vs("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
124 * @license lucide-react v0.453.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const cD=vs("Layers3",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m6.08 9.5-3.5 1.6a1 1 0 0 0 0 1.81l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9a1 1 0 0 0 0-1.83l-3.5-1.59",key:"1e5n1m"}],["path",{d:"m6.08 14.5-3.5 1.6a1 1 0 0 0 0 1.81l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9a1 1 0 0 0 0-1.83l-3.5-1.59",key:"1iwflc"}]]);/**
129 * @license lucide-react v0.453.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const hD=vs("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);/**
134 * @license lucide-react v0.453.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const uD=vs("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);/**
139 * @license lucide-react v0.453.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const fD=vs("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
144 * @license lucide-react v0.453.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const Fv=vs("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
149 * @license lucide-react v0.453.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const dD=vs("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
154 * @license lucide-react v0.453.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const _D=vs("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class mD extends Re.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?le.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:27",className:"flex items-center justify-center min-h-screen p-8 bg-background",children:le.jsxs("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:28",className:"flex flex-col items-center w-full max-w-2xl p-8",children:[le.jsx(dD,{"data-loc":"client/src/components/ErrorBoundary.tsx:29",size:48,className:"text-destructive mb-6 flex-shrink-0"}),le.jsx("h2",{"data-loc":"client/src/components/ErrorBoundary.tsx:34",className:"text-xl mb-4",children:"An unexpected error occurred."}),le.jsx("div",{"data-loc":"client/src/components/ErrorBoundary.tsx:36",className:"p-4 w-full rounded bg-muted overflow-auto mb-6",children:le.jsx("pre",{"data-loc":"client/src/components/ErrorBoundary.tsx:37",className:"text-sm text-muted-foreground whitespace-break-spaces",children:this.state.error?.stack})}),le.jsxs("button",{"data-loc":"client/src/components/ErrorBoundary.tsx:42",onClick:()=>window.location.reload(),className:cd("flex items-center gap-2 px-4 py-2 rounded-lg","bg-primary text-primary-foreground","hover:opacity-90 cursor-pointer"),children:[le.jsx(Fv,{"data-loc":"client/src/components/ErrorBoundary.tsx:50",size:16}),"Reload Page"]})]})}):this.props.children}}const gD=Re.createContext(void 0);function pD({children:r,defaultTheme:e="light",switchable:t=!1}){const[i,s]=Re.useState(()=>t&&localStorage.getItem("theme")||e);Re.useEffect(()=>{const o=document.documentElement;i==="dark"?o.classList.add("dark"):o.classList.remove("dark"),t&&localStorage.setItem("theme",i)},[i,t]);const n=t?()=>{s(o=>o==="light"?"dark":"light")}:void 0;return le.jsx(gD.Provider,{"data-loc":"client/src/contexts/ThemeContext.tsx:52",value:{theme:i,toggleTheme:n,switchable:t},children:r})}const yD=typeof WeakRef<"u";class bD{constructor(e,t=!1,i,s){this.initialize(e,t,i,s)}initialize(e,t=!1,i,s){return this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=s,this}}class xD{constructor(e,t,i=null){this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}remove(e=!1){this._remove&&this._remove(e)}}class Oe{static FromPromise(e,t){const i=new Oe;return e.then(s=>{i.notifyObservers(s)}).catch(s=>{if(t)t.notifyObservers(s);else throw s}),i}get observers(){return this._observers}constructor(e,t=!1){this.notifyIfTriggered=t,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new bD(0),e&&(this._onObserverAdded=e)}add(e,t=-1,i=!1,s=null,n=!1){if(!e)return null;const o=new xD(e,t,s);o.unregisterOnNextCall=n,i?this._observers.unshift(o):this._observers.push(o),this._onObserverAdded&&this._onObserverAdded(o),this._hasNotified&&this.notifyIfTriggered&&this._lastNotifiedValue!==void 0&&this.notifyObserver(o,this._lastNotifiedValue);const c=yD?new WeakRef(this):{deref:()=>this};return o._remove=(h=!1)=>{const f=c.deref();f&&(h?f.remove(o):f._remove(o))},o}
vendor: 16,307 bytes, line 158
158addOnce(e){return this.add(e,void 0,void 0,void 0,!0)}remove(e){return e?(e._remove=null,this._observers.indexOf(e)!==-1?(this._deferUnregister(e),!0):!1):!1}removeCallback(e,t){for(let i=0;i<this._observers.length;i++){const s=this._observers[i];if(!s._willBeUnregistered&&s.callback===e&&(!t||t===s.scope))return this._deferUnregister(s),!0}return!1}_deferUnregister(e){e._willBeUnregistered||(this._numObserversMarkedAsDeleted++,e.unregisterOnNextCall=!1,e._willBeUnregistered=!0,setTimeout(()=>{this._remove(e)},0))}_remove(e,t=!0){if(!e)return!1;const i=this._observers.indexOf(e);return i!==-1?(t&&this._numObserversMarkedAsDeleted--,this._observers.splice(i,1),!0):!1}makeObserverTopPriority(e){this._remove(e,!1),this._observers.unshift(e)}makeObserverBottomPriority(e){this._remove(e,!1),this._observers.push(e)}notifyObservers(e,t=-1,i,s,n){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=e),!this._observers.length)return!0;const o=this._eventState;o.mask=t,o.target=i,o.currentTarget=s,o.skipNextObservers=!1,o.lastReturnValue=e,o.userInfo=n;for(const c of this._observers)if(!c._willBeUnregistered&&(c.mask&t&&(c.unregisterOnNextCall&&this._deferUnregister(c),c.scope?o.lastReturnValue=c.callback.apply(c.scope,[e,o]):o.lastReturnValue=c.callback(e,o)),o.skipNextObservers))return!1;return!0}notifyObserver(e,t,i=-1){if(this.notifyIfTriggered&&(this._hasNotified=!0,this._lastNotifiedValue=t),e._willBeUnregistered)return;const s=this._eventState;s.mask=i,s.skipNextObservers=!1,e.unregisterOnNextCall&&this._deferUnregister(e),e.callback(t,s)}hasObservers(){return this._observers.length-this._numObserversMarkedAsDeleted>0}clear(){for(;this._observers.length;){const e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()}cleanLastNotifiedState(){this._hasNotified=!1,this._lastNotifiedValue=void 0}clone(){const e=new Oe;return e._observers=this._observers.slice(0),e}hasSpecificMask(e=-1){for(const t of this._observers)if(t.mask&e||t.mask===e)return!0;return!1}}class TD{get wrapU(){return this._cachedWrapU}set wrapU(e){this._cachedWrapU=e}get wrapV(){return this._cachedWrapV}set wrapV(e){this._cachedWrapV=e}get wrapR(){return this._cachedWrapR}set wrapR(e){this._cachedWrapR=e}get anisotropicFilteringLevel(){return this._cachedAnisotropicFilteringLevel}set anisotropicFilteringLevel(e){this._cachedAnisotropicFilteringLevel=e}get comparisonFunction(){return this._comparisonFunction}set comparisonFunction(e){this._comparisonFunction=e}get useMipMaps(){return this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}constructor(){this.samplingMode=-1,this._useMipMaps=!0,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this._comparisonFunction=0}setParameters(e=1,t=1,i=1,s=1,n=2,o=0){return this._cachedWrapU=e,this._cachedWrapV=t,this._cachedWrapR=i,this._cachedAnisotropicFilteringLevel=s,this.samplingMode=n,this._comparisonFunction=o,this}compareSampler(e){return this._cachedWrapU===e._cachedWrapU&&this._cachedWrapV===e._cachedWrapV&&this._cachedWrapR===e._cachedWrapR&&this._cachedAnisotropicFilteringLevel===e._cachedAnisotropicFilteringLevel&&this.samplingMode===e.samplingMode&&this._comparisonFunction===e._comparisonFunction&&this._useMipMaps===e._useMipMaps}}var cx;(function(r){r[r.Unknown=0]="Unknown",r[r.Url=1]="Url",r[r.Temp=2]="Temp",r[r.Raw=3]="Raw",r[r.Dynamic=4]="Dynamic",r[r.RenderTarget=5]="RenderTarget",r[r.MultiRenderTarget=6]="MultiRenderTarget",r[r.Cube=7]="Cube",r[r.CubeRaw=8]="CubeRaw",r[r.CubePrefiltered=9]="CubePrefiltered",r[r.Raw3D=10]="Raw3D",r[r.Raw2DArray=11]="Raw2DArray",r[r.DepthStencil=12]="DepthStencil",r[r.CubeRawRGBD=13]="CubeRawRGBD",r[r.Depth=14]="Depth",r[r.External=15]="External"})(cx||(cx={}));class ws extends TD{get useMipMaps(){return this._useMipMaps===null?this.generateMipMaps:this._useMipMaps}set useMipMaps(e){this._useMipMaps=e}get uniqueId(){return this._uniqueId}_setUniqueId(e){this._uniqueId=e}getEngine(){return this._engine}get source(){return this._source}constructor(e,t,i=!1){super(),this.isReady=!1,this.isCube=!1,this.is3D=!1,this.is2DArray=!1,this.isMultiview=!1,this.url="",this.generateMipMaps=!1,this._useMipMaps=null,this.mipLevelCount=1,this.samples=0,this.type=-1,this.format=-1,this.onLoadedObservable=new Oe,this.onErrorObservable=new Oe,this.onRebuildCallback=null,this.width=0,this.height=0,this.depth=0,this.baseWidth=0,this.baseHeight=0,this.baseDepth=0,this.invertY=!1,this._invertVScale=!1,this._associatedChannel=-1,this._source=0,this._buffer=null,this._bufferView=null,this._bufferViewArray=null,this._bufferViewArrayArray=null,this._size=0,this._extension="",this._files=null,this._workingCanvas=null,this._workingContext=null,this._cachedCoordinatesMode=null,this._isDisabled=!1,this._compression=null,this._sphericalPolynomial=null,this._sphericalPolynomialPromise=null,this._sphericalPolynomialComputed=!1,this._lodGenerationScale=0,this._lodGenerationOffset=0,this._useSRGBBuffer=!1,this._creationFlags=0,this._lodTextureHigh=null,this._lodTextureMid=null,this._lodTextureLow=null,this._isRGBD=!1,this._linearSpecularLOD=!1,this._irradianceTexture=null,this._hardwareTexture=null,this._maxLodLevel=null,this._references=1,this._gammaSpace=null,this._premulAlpha=!1,this._dynamicTextureSource=null,this._autoMSAAManagement=!1,this._engine=e,this._source=t,this._uniqueId=ws._Counter++,i||(this._hardwareTexture=e._createHardwareTexture())}incrementReferences(){this._references++}updateSize(e,t,i=1){this._engine.updateTextureDimensions(this,e,t,i),this.width=e,this.height=t,this.depth=i,this.baseWidth=e,this.baseHeight=t,this.baseDepth=i,this._size=e*t*i}_rebuild(){if(this.isReady=!1,this._cachedCoordinatesMode=null,this._cachedWrapU=null,this._cachedWrapV=null,this._cachedWrapR=null,this._cachedAnisotropicFilteringLevel=null,this.onRebuildCallback){const t=this.onRebuildCallback(this),i=s=>{s._swapAndDie(this,!1),this.isReady=t.isReady};t.isAsync?t.proxy.then(i):i(t.proxy);return}let e;switch(this.source){case 2:break;case 1:e=this._engine.createTexture(this._originalUrl??this.url,!this.generateMipMaps,this.invertY,null,this.samplingMode,t=>{t._swapAndDie(this,!1),this.isReady=!0},null,this._buffer,void 0,this.format,this._extension,void 0,void 0,void 0,this._useSRGBBuffer);return;case 3:if(e=this._engine.createRawTexture(this._bufferView,this.baseWidth,this.baseHeight,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this._useSRGBBuffer,this.mipLevelCount),e._swapAndDie(this,!1),this._bufferViewArray)for(let t=0;t<this._bufferViewArray.length;t++){const i=this._bufferViewArray[t];i&&this._engine.updateRawTexture(this,i,this.format,this.invertY,this._compression,this.type,this._useSRGBBuffer,t)}this.isReady=!0;break;case 10:e=this._engine.createRawTexture3D(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type),e._swapAndDie(this,!1),this.isReady=!0;break;case 11:if(e=this._engine.createRawTexture2DArray(this._bufferView,this.baseWidth,this.baseHeight,this.baseDepth,this.format,this.generateMipMaps,this.invertY,this.samplingMode,this._compression,this.type,this._creationFlags,this.mipLevelCount),e._swapAndDie(this,!1),this._bufferViewArray)for(let t=0;t<this._bufferViewArray.length;t++){const i=this._bufferViewArray[t];i&&this._engine.updateRawTexture2DArray(this,i,this.format,this.invertY,this._compression,this.type,t)}this.isReady=!0;break;case 4:e=this._engine.createDynamicTexture(this.baseWidth,this.baseHeight,this.generateMipMaps,this.samplingMode),e._swapAndDie(this,!1),this._dynamicTextureSource&&this._engine.updateDynamicTexture(this,this._dynamicTextureSource,this.invertY,this._premulAlpha,this.format,!0);break;case 7:e=this._engine.createCubeTexture(this.url,null,this._files,!this.generateMipMaps,()=>{e._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension,!1,0,0,null,void 0,this._useSRGBBuffer,ArrayBuffer.isView(this._buffer)?this._buffer:null);return;case 8:e=this._engine.createRawCubeTexture(this._bufferViewArray,this.width,this._originalFormat??this.format,this.type,this.generateMipMaps,this.invertY,this.samplingMode,this._compression),e._swapAndDie(this,!1),this.isReady=!0;break;case 13:return;case 9:e=this._engine.createPrefilteredCubeTexture(this.url,null,this._lodGenerationScale,this._lodGenerationOffset,t=>{t&&t._swapAndDie(this,!1),this.isReady=!0},null,this.format,this._extension),e._sphericalPolynomial=this._sphericalPolynomial;return}}_swapAndDie(e,t=!0){this._hardwareTexture?.setUsage(e._source,this.generateMipMaps,this.is2DArray,this.isCube,this.is3D,this.width,this.height,this.depth),e._hardwareTexture=this._hardwareTexture,e._setUniqueId(ws._Counter++),t&&(e._isRGBD=this._isRGBD),this._lodTextureHigh&&(e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureHigh=this._lodTextureHigh),this._lodTextureMid&&(e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureMid=this._lodTextureMid),this._lodTextureLow&&(e._lodTextureLow&&e._lodTextureLow.dispose(),e._lodTextureLow=this._lodTextureLow),this._irradianceTexture&&(e._irradianceTexture&&e._irradianceTexture.dispose(),e._irradianceTexture=this._irradianceTexture);const i=this._engine.getLoadedTexturesCache();let s=i.indexOf(this);s!==-1&&i.splice(s,1),s=i.indexOf(e),s===-1&&i.push(e)}dispose(){this._references--,this._references===0&&(this.onLoadedObservable.clear(),this.onErrorObservable.clear(),this._engine._releaseTexture(this),this._hardwareTexture=null,this._dynamicTextureSource=null)}}ws._Counter=0;class vt{static get LastCreatedEngine(){return this.Instances.length===0?null:this.Instances[this.Instances.length-1]}static get LastCreatedScene(){return this._LastCreatedScene}}vt.Instances=[];vt.OnEnginesDisposedObservable=new Oe;vt._LastCreatedScene=null;vt.UseFallbackTexture=!0;vt.FallbackTexture="";class Ee{static _CheckLimit(e,t){let i=Ee._LogLimitOutputs[e];return i?i.current++:(i={limit:t,current:1},Ee._LogLimitOutputs[e]=i),i.current<=i.limit}static _GenerateLimitMessage(e,t=1){const i=Ee._LogLimitOutputs[e];if(!i||!Ee.MessageLimitReached)return;const s=this._Levels[t];i.current===i.limit&&Ee[s.name](Ee.MessageLimitReached.replace(/%LIMIT%/g,""+i.limit).replace(/%TYPE%/g,s.name??""))}static _AddLogEntry(e){Ee._LogCache=e+Ee._LogCache,Ee.OnNewCacheEntry&&Ee.OnNewCacheEntry(e)}static _FormatMessage(e){const t=s=>s<10?"0"+s:""+s,i=new Date;return"["+t(i.getHours())+":"+t(i.getMinutes())+":"+t(i.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,t,i){const s=Array.isArray(t)?t[0]:t;if(i!==void 0&&!Ee._CheckLimit(s,i))return;const n=Ee._FormatMessage(s),o=this._Levels[e],c=Array.isArray(t)?t.slice(1):[];o.logFunc&&o.logFunc("BJS - "+n,...c);const h=`<div style='color:${o.color}'>${n}</div><br>`;Ee._AddLogEntry(h),Ee._GenerateLimitMessage(s,e)}static get LogCache(){return Ee._LogCache}static ClearLogCache(){Ee._LogCache="",Ee._LogLimitOutputs={},Ee.errorsCount=0}static set LogLevels(e){Ee.Log=Ee._LogDisabled,Ee.Warn=Ee._LogDisabled,Ee.Error=Ee._LogDisabled;const t=[Ee.MessageLogLevel,Ee.WarningLogLevel,Ee.ErrorLogLevel];for(const i of t)if((e&i)===i){const s=this._Levels[i];Ee[s.name]=Ee._LogEnabled.bind(Ee,i)}}}Ee.NoneLogLevel=0;Ee.MessageLogLevel=1;Ee.WarningLogLevel=2;Ee.ErrorLogLevel=4;Ee.AllLogLevel=7;Ee.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.";Ee._LogCache="";Ee._LogLimitOutputs={};Ee._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}];Ee.errorsCount=0;Ee.Log=Ee._LogEnabled.bind(Ee,Ee.MessageLogLevel);Ee.Warn=Ee._LogEnabled.bind(Ee,Ee.WarningLogLevel);Ee.Error=Ee._LogEnabled.bind(Ee,Ee.ErrorLogLevel);class Pi{static GetShadersRepository(e=0){return e===0?Pi.ShadersRepository:Pi.ShadersRepositoryWGSL}static GetShadersStore(e=0){return e===0?Pi.ShadersStore:Pi.ShadersStoreWGSL}static GetIncludesShadersStore(e=0){return e===0?Pi.IncludesShadersStore:Pi.IncludesShadersStoreWGSL}}Pi.ShadersRepository="src/Shaders/";Pi.ShadersStore={};Pi.IncludesShadersStore={};Pi.ShadersRepositoryWGSL="src/ShadersWGSL/";Pi.ShadersStoreWGSL={};Pi.IncludesShadersStoreWGSL={};function is(){return typeof window<"u"}function _l(){return typeof navigator<"u"}function co(){return typeof document<"u"}function Lv(r){let e="",t=r.firstChild;for(;t;)t.nodeType===3&&(e+=t.textContent),t=t.nextSibling;return e}class ED{constructor(){this._valueCache={},this.vertexCompilationError=null,this.fragmentCompilationError=null,this.programLinkError=null,this.programValidationError=null,this._isDisposed=!1}get isAsync(){return this.isParallelCompiled}get isReady(){return this.program?this.isParallelCompiled?this.engine._isRenderingStateCompiled(this):!0:!1}_handlesSpectorRebuildCallback(e){e&&this.program&&e(this.program)}setEngine(e){this.engine=e}_fillEffectInformation(e,t,i,s,n,o,c,h){const f=this.engine;if(f.supportsUniformBuffers)for(const g in t)e.bindUniformBlock(g,t[g]);this.engine.getUniforms(this,i).forEach((g,p)=>{s[i[p]]=g}),this._uniforms=s;let d;for(d=0;d<n.length;d++)e.getUniform(n[d])==null&&(n.splice(d,1),d--);n.forEach((g,p)=>{o[g]=p});for(const g of f.getAttributes(this,c))h.push(g)}dispose(){this._uniforms={},this._isDisposed=!0}_cacheMatrix(e,t){const i=this._valueCache[e],s=t.updateFlag;return i!==void 0&&i===s?!1:(this._valueCache[e]=s,!0)}_cacheFloat2(e,t,i){let s=this._valueCache[e];if(!s||s.length!==2)return s=[t,i],this._valueCache[e]=s,!0;let n=!1;return s[0]!==t&&(s[0]=t,n=!0),s[1]!==i&&(s[1]=i,n=!0),n}_cacheFloat3(e,t,i,s){let n=this._valueCache[e];if(!n||n.length!==3)return n=[t,i,s],this._valueCache[e]=n,!0;let o=!1;return n[0]!==t&&(n[0]=t,o=!0),n[1]!==i&&(n[1]=i,o=!0),n[2]!==s&&(n[2]=s,o=!0),o}_cacheFloat4(e,t,i,s,n){let o=this._valueCache[e];if(!o||o.length!==4)return o=[t,i,s,n],this._valueCache[e]=o,!0;let c=!1;return o[0]!==t&&(o[0]=t,c=!0),o[1]!==i&&(o[1]=i,c=!0),o[2]!==s&&(o[2]=s,c=!0),o[3]!==n&&(o[3]=n,c=!0),c}setInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setInt4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setInt4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setIntArray(e,t){this._valueCache[e]=null,this.engine.setIntArray(this._uniforms[e],t)}setIntArray2(e,t){this._valueCache[e]=null,this.engine.setIntArray2(this._uniforms[e],t)}setIntArray3(e,t){this._valueCache[e]=null,this.engine.setIntArray3(this._uniforms[e],t)}setIntArray4(e,t){this._valueCache[e]=null,this.engine.setIntArray4(this._uniforms[e],t)}setUInt(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setUInt(this._uniforms[e],t)&&(this._valueCache[e]=t)}setUInt2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setUInt2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setUInt3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setUInt3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setUInt4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setUInt4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setUIntArray(e,t){this._valueCache[e]=null,this.engine.setUIntArray(this._uniforms[e],t)}setUIntArray2(e,t){this._valueCache[e]=null,this.engine.setUIntArray2(this._uniforms[e],t)}setUIntArray3(e,t){this._valueCache[e]=null,this.engine.setUIntArray3(this._uniforms[e],t)}setUIntArray4(e,t){this._valueCache[e]=null,this.engine.setUIntArray4(this._uniforms[e],t)}setArray(e,t){this._valueCache[e]=null,this.engine.setArray(this._uniforms[e],t)}setArray2(e,t){this._valueCache[e]=null,this.engine.setArray2(this._uniforms[e],t)}setArray3(e,t){this._valueCache[e]=null,this.engine.setArray3(this._uniforms[e],t)}setArray4(e,t){this._valueCache[e]=null,this.engine.setArray4(this._uniforms[e],t)}setMatrices(e,t){t&&(this._valueCache[e]=null,this.engine.setMatr
158ices(this._uniforms[e],t))}setMatrix(e,t){this._cacheMatrix(e,t)&&(this.engine.setMatrices(this._uniforms[e],t.asArray())||(this._valueCache[e]=null))}setMatrix3x3(e,t){this._valueCache[e]=null,this.engine.setMatrix3x3(this._uniforms[e],t)}setMatrix2x2(e,t){this._valueCache[e]=null,this.engine.setMatrix2x2(this._uniforms[e],t)}setFloat(e,t){const i=this._valueCache[e];i!==void 0&&i===t||this.engine.setFloat(this._uniforms[e],t)&&(this._valueCache[e]=t)}setVector2(e,t){this._cacheFloat2(e,t.x,t.y)&&(this.engine.setFloat2(this._uniforms[e],t.x,t.y)||(this._valueCache[e]=null))}setFloat2(e,t,i){this._cacheFloat2(e,t,i)&&(this.engine.setFloat2(this._uniforms[e],t,i)||(this._valueCache[e]=null))}setVector3(e,t){this._cacheFloat3(e,t.x,t.y,t.z)&&(this.engine.setFloat3(this._uniforms[e],t.x,t.y,t.z)||(this._valueCache[e]=null))}setFloat3(e,t,i,s){this._cacheFloat3(e,t,i,s)&&(this.engine.setFloat3(this._uniforms[e],t,i,s)||(this._valueCache[e]=null))}setVector4(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setQuaternion(e,t){this._cacheFloat4(e,t.x,t.y,t.z,t.w)&&(this.engine.setFloat4(this._uniforms[e],t.x,t.y,t.z,t.w)||(this._valueCache[e]=null))}setFloat4(e,t,i,s,n){this._cacheFloat4(e,t,i,s,n)&&(this.engine.setFloat4(this._uniforms[e],t,i,s,n)||(this._valueCache[e]=null))}setColor3(e,t){this._cacheFloat3(e,t.r,t.g,t.b)&&(this.engine.setFloat3(this._uniforms[e],t.r,t.g,t.b)||(this._valueCache[e]=null))}setColor4(e,t,i){this._cacheFloat4(e,t.r,t.g,t.b,i)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,i)||(this._valueCache[e]=null))}setDirectColor4(e,t){this._cacheFloat4(e,t.r,t.g,t.b,t.a)&&(this.engine.setFloat4(this._uniforms[e],t.r,t.g,t.b,t.a)||(this._valueCache[e]=null))}_getVertexShaderCode(){return this.vertexShader?this.engine._getShaderSource(this.vertexShader):null}_getFragmentShaderCode(){return this.fragmentShader?this.engine._getShaderSource(this.fragmentShader):null}}const hx={};function at(r,e=!1){if(!(e&&hx[r]))return hx[r]=!0,`${r} needs to be imported before as it contains a side-effect required by your code.`}const ux={};let vD=!1,AD=0;function Ze(r,e,t=!1){const i=function(){if((t||vD)&&AD===0){const s=`${r}.${e}`;ux[s]||(ux[s]=!0,console.warn(`[Babylon.js] ${s}() requires a side-effect import. See: https://doc.babylonjs.com/setup/treeshaking`))}};return i.__isSideEffectStub=!0,i}function lg(r){return r?!r.__isSideEffectStub:!1}function At(r,e){return{get(){},set(t){Object.defineProperty(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0}}const ao={};function Bv(r,e,t=""){return t+(e?e+`
159`:"")+r}function Nv(r,e,t,i,s,n,o){const c=o||ao.loadFile;if(!c)throw at("FileTools");return c(r,e,t,i,s,n)}function Uv(r,e,t,i){if(r){e?r.IS_NDC_HALF_ZRANGE="":delete r.IS_NDC_HALF_ZRANGE,t?r.USE_REVERSE_DEPTHBUFFER="":delete r.USE_REVERSE_DEPTHBUFFER,i?r.USE_EXACT_SRGB_CONVERSIONS="":delete r.USE_EXACT_SRGB_CONVERSIONS;return}else{let s="";return e&&(s+="#define IS_NDC_HALF_ZRANGE"),t&&(s&&(s+=`
160`),s+="#define USE_REVERSE_DEPTHBUFFER"),i&&(s&&(s+=`
161`),s+="#define USE_EXACT_SRGB_CONVERSIONS"),s}}function RD(r,e,t=!1,i){switch(r){case 3:return new Int8Array(e);case 0:return new Uint8Array(e);case 4:return typeof e!="number"?new Int16Array(e):new Int16Array(t?e/2:e);case 5:case 8:case 9:case 10:case 2:return typeof e!="number"?new Uint16Array(e):new Uint16Array(t?e/2:e);case 6:return typeof e!="number"?new Int32Array(e):new Int32Array(t?e/4:e);case 7:case 11:case 12:case 13:case 14:case 15:return typeof e!="number"?new Uint32Array(e):new Uint32Array(t?e/4:e);case 1:return typeof e!="number"?new Float32Array(e):new Float32Array(t?e/4:e)}return new Uint8Array(e)}const Lm=new WeakMap,SD={_webGLVersion:2,cachedPipelines:{}};function Vs(r){let e=Lm.get(r);if(!e){if(!r)return SD;e={_webGLVersion:r.TEXTURE_BINDING_3D?2:1,_context:r,parallelShaderCompile:r.getExtension("KHR_parallel_shader_compile")||void 0,cachedPipelines:{}},Lm.set(r,e)}return e}function um(r){Lm.delete(r)}function kv(r,e,t,i,s,n){const o=Vs(i);n||(n=o._createShaderProgramInjection??cg);const c=Bm(e,"vertex",i,o._contextWasLost),h=Bm(t,"fragment",i,o._contextWasLost);return n(r,c,h,i,s,o.validateShaderPrograms)}function zv(r,e,t,i,s,n=null,o){const c=Vs(s);o||(o=c._createShaderProgramInjection??cg);const h=c._webGLVersion>1?`#version 300 es
162#define WEBGL2 
163`:"",f=fx(e,"vertex",i,h,s,c._contextWasLost),_=fx(t,"fragment",i,h,s,c._contextWasLost);return o(r,f,_,s,n,c.validateShaderPrograms)}function MD(r,e){const t=new ED,i=Vs(r);return i.parallelShaderCompile&&!i.disableParallelShaderCompile&&(t.isParallelCompiled=!0),t.context=i._context,t}function cg(r,e,t,i,s=null,n){const o=i.createProgram();if(r.program=o,!o)throw new Error("Unable to create program");return i.attachShader(o,e),i.attachShader(o,t),i.linkProgram(o),r.context=i,r.vertexShader=e,r.fragmentShader=t,r.isParallelCompiled||hg(r,i,n),o}function CD(r,e,t){const i=r;if(i._isDisposed)return!1;const s=Vs(e);return s&&s.parallelShaderCompile&&s.parallelShaderCompile.COMPLETION_STATUS_KHR&&i.program&&e.getProgramParameter(i.program,s.parallelShaderCompile.COMPLETION_STATUS_KHR
vendor: 39,471 bytes, lines 163-175
163)?(hg(i,e,t),!0):!1}function hg(r,e,t){const i=r.context,s=r.vertexShader,n=r.fragmentShader,o=r.program;if(!i.getProgramParameter(o,i.LINK_STATUS)){if(!e.getShaderParameter(s,e.COMPILE_STATUS)){const f=e.getShaderInfoLog(s);if(f)throw r.vertexCompilationError=f,new Error("VERTEX SHADER "+f)}if(!e.getShaderParameter(n,e.COMPILE_STATUS)){const f=e.getShaderInfoLog(n);if(f)throw r.fragmentCompilationError=f,new Error("FRAGMENT SHADER "+f)}const h=i.getProgramInfoLog(o);if(h)throw r.programLinkError=h,new Error(h)}if(t&&(i.validateProgram(o),!i.getProgramParameter(o,i.VALIDATE_STATUS))){const f=i.getProgramInfoLog(o);if(f)throw r.programValidationError=f,new Error(f)}i.deleteShader(s),i.deleteShader(n),r.vertexShader=void 0,r.fragmentShader=void 0,r.onCompiled&&(r.onCompiled(),r.onCompiled=void 0)}function ID(r,e,t,i,s,n,o,c,h,f="",_,d,g){const p=Vs(r.context);d||(d=p.createRawShaderProgramInjection??kv),g||(g=p.createShaderProgramInjection??zv);const b=r;i?b.program=d(b,e,t,b.context,h):b.program=g(b,e,t,c,b.context,h),b.program.__SPECTOR_rebuildProgram=o,_()}function fx(r,e,t,i,s,n){return Bm(Bv(r,t,i),e,s,n)}function Bm(r,e,t,i){const s=t.createShader(e==="vertex"?t.VERTEX_SHADER:t.FRAGMENT_SHADER);if(!s){let n=t.NO_ERROR,o;for(;(o=t.getError())!==t.NO_ERROR;)n=o;throw new Error(`Something went wrong while creating a gl ${e} shader object. gl error=${n}, gl isContextLost=${t.isContextLost()}, _contextWasLost=${i}`)}return t.shaderSource(s,r),t.compileShader(s),s}function DD(r,e){e.useProgram(r)}function PD(r,e){const t=r;if(!t.isParallelCompiled){e(r);return}const i=t.onCompiled;t.onCompiled=()=>{i?.(),e(r)}}const OD="attribute",wD="varying";class bh{constructor(){this.children=[]}isValid(e){return!0}process(e,t,i){let s="";if(this.line){let n=this.line;const o=t.processor;if(o){o.lineProcessor&&(n=o.lineProcessor(n,t.isFragment,t.processingContext));const c=t.processor?.attributeKeywordName??OD,h=t.isFragment&&t.processor?.varyingFragmentKeywordName?t.processor?.varyingFragmentKeywordName:!t.isFragment&&t.processor?.varyingVertexKeywordName?t.processor?.varyingVertexKeywordName:wD;!t.isFragment&&o.attributeProcessor&&this.line.startsWith(c)?n=o.attributeProcessor(this.line,e,t.processingContext):o.varyingProcessor&&(o.varyingCheck?.(this.line,t.isFragment)||!o.varyingCheck&&this.line.startsWith(h))?n=o.varyingProcessor(this.line,t.isFragment,e,t.processingContext):o.uniformProcessor&&o.uniformRegexp&&o.uniformRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(n=o.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):o.uniformBufferProcessor&&o.uniformBufferRegexp&&o.uniformBufferRegexp.test(this.line)?t.lookForClosingBracketForUniformBuffer||(n=o.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0):o.textureProcessor&&o.textureRegexp&&o.textureRegexp.test(this.line)?n=o.textureProcessor(this.line,t.isFragment,e,t.processingContext):(o.uniformProcessor||o.uniformBufferProcessor)&&this.line.startsWith("uniform")&&!t.lookForClosingBracketForUniformBuffer&&(/uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/.test(this.line)?o.uniformProcessor&&(n=o.uniformProcessor(this.line,t.isFragment,e,t.processingContext)):o.uniformBufferProcessor&&(n=o.uniformBufferProcessor(this.line,t.isFragment,t.processingContext),t.lookForClosingBracketForUniformBuffer=!0)),t.lookForClosingBracketForUniformBuffer&&this.line.indexOf("}")!==-1&&(t.lookForClosingBracketForUniformBuffer=!1,o.endOfUniformBufferProcessor&&(n=o.endOfUniformBufferProcessor(this.line,t.isFragment,t.processingContext)))}s+=n+`
164`}for(const n of this.children)s+=n.process(e,t,i);return this.additionalDefineKey&&(e[this.additionalDefineKey]=this.additionalDefineValue||"true",i[this.additionalDefineKey]=e[this.additionalDefineKey]),s}}class FD{constructor(){this._lines=[]}get currentLine(){return this._lines[this.lineIndex]}get canRead(){return this.lineIndex<this._lines.length-1}set lines(e){this._lines.length=0;for(const t of e){if(!t||t==="\r")continue;if(t[0]==="#"){this._lines.push(t);continue}const i=t.trim();if(!i)continue;if(i.startsWith("//")){this._lines.push(t);continue}const s=i.indexOf(";");if(s===-1)this._lines.push(i);else if(s===i.length-1)i.length>1&&this._lines.push(i);else{const n=t.split(";");for(let o=0;o<n.length;o++){let c=n[o];c&&(c=c.trim(),c&&this._lines.push(c+(o!==n.length-1?";":"")))}}}}}class fm extends bh{process(e,t,i){for(let s=0;s<this.children.length;s++){const n=this.children[s];if(n.isValid(e))return n.process(e,t,i)}return""}}class LD extends bh{isValid(e){return this.testExpression.isTrue(e)}}class vi{isTrue(e){return!0}static postfixToInfix(e){const t=[];for(const i of e)if(vi._OperatorPriority[i]===void 0)t.push(i);else{const s=t[t.length-1],n=t[t.length-2];t.length-=2,t.push(`(${n}${i}${s})`)}return t[t.length-1]}static infixToPostfix(e){const t=vi._InfixToPostfixCache.get(e);if(t)return t.accessTime=Date.now(),t.result;if(!e.includes("&&")&&!e.includes("||")&&!e.includes(")")&&!e.includes("("))return[e];const i=[];let s=-1;const n=()=>{_=_.trim(),_!==""&&(i.push(_),_="")},o=d=>{s<vi._Stack.length-1&&(vi._Stack[++s]=d)},c=()=>vi._Stack[s],h=()=>s===-1?"!!INVALID EXPRESSION!!":vi._Stack[s--];let f=0,_="";for(;f<e.length;){const d=e.charAt(f),g=f<e.length-1?e.substring(f,2+f):"";if(d==="(")_="",o(d);else if(d===")"){for(n();s!==-1&&c()!=="(";)i.push(h());h()}else if(vi._OperatorPriority[g]>1){for(n();s!==-1&&vi._OperatorPriority[c()]>=vi._OperatorPriority[g];)i.push(h());o(g),f++}else _+=d;f++}for(n();s!==-1;)c()==="("?h():i.push(h());return vi._InfixToPostfixCache.size>=vi.InfixToPostfixCacheLimitSize&&vi.ClearCache(),vi._InfixToPostfixCache.set(e,{result:i,accessTime:Date.now()}),i}static ClearCache(){const e=Array.from(vi._InfixToPostfixCache.entries()).sort((t,i)=>t[1].accessTime-i[1].accessTime);for(let t=0;t<vi.InfixToPostfixCacheCleanupSize;t++)vi._InfixToPostfixCache.delete(e[t][0])}}vi.InfixToPostfixCacheLimitSize=5e4;vi.InfixToPostfixCacheCleanupSize=25e3;vi._InfixToPostfixCache=new Map;vi._OperatorPriority={")":0,"(":1,"||":2,"&&":3};vi._Stack=["","","","","","","","","","","","","","","","","","","",""];class Nf extends vi{constructor(e,t=!1){super(),this.define=e,this.not=t}isTrue(e){let t=e[this.define]!==void 0;return this.not&&(t=!t),t}}class BD extends vi{isTrue(e){return this.leftOperand.isTrue(e)||this.rightOperand.isTrue(e)}}class ND extends vi{isTrue(e){return this.leftOperand.isTrue(e)&&this.rightOperand.isTrue(e)}}class UD extends vi{constructor(e,t,i){super(),this.define=e,this.operand=t,this.testValue=i}toString(){return`${this.define} ${this.operand} ${this.testValue}`}isTrue(e){let t=!1;const i=parseInt(e[this.define]!=null?e[this.define]:this.define),s=parseInt(e[this.testValue]!=null?e[this.testValue]:this.testValue);if(isNaN(i)||isNaN(s))return!1;switch(this.operand){case">":t=i>s;break;case"<":t=i<s;break;case"<=":t=i<=s;break;case">=":t=i>=s;break;case"==":t=i===s;break;case"!=":t=i!==s;break}return t}}const kD=/defined\s*?\((.+?)\)/g,dm=/defined\s*?\[(.+?)\]/g,zD=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g,VD=/__decl__/,dx=/light\{X\}.(\w*)/g,_x=/\{X\}/g,Ef=[],GD=/(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/;function HD(r){r.processor&&r.processor.initializeShaders&&r.processor.initializeShaders(r.processingContext)}function mx(r,e,t,i){e.processor?.preProcessShaderCode&&(r=e.processor.preProcessShaderCode(r,e.isFragment)),Uf(r,e,s=>{e.processCodeAfterIncludes&&(s=e.processCodeAfterIncludes(e.isFragment?"fragment":"vertex",s,e.defines));const n=KD(s,e,i);t(n,s)})}function WD(r,e,t){return!t.processor||!t.processor.finalizeShaders?{vertexCode:r,fragmentCode:e}:t.processor.finalizeShaders(r,e,t.processingContext)}function XD(r,e){if(e.processor?.noPrecision)return r;const t=e.shouldUseHighPrecisionShader;return r.indexOf("precision highp float")===-1?t?r=`precision highp float;
165`+r:r=`precision mediump float;
166`+r:t||(r=r.replace("precision highp float","precision mediump float")),r}function _m(r){const t=/defined\((.+)\)/.exec(r);if(t&&t.length)return new Nf(t[1].trim(),r[0]==="!");const i=["==","!=",">=","<=","<",">"];let s="",n=0;for(s of i)if(n=r.indexOf(s),n>-1)break;if(n===-1)return new Nf(r);const o=r.substring(0,n).trim(),c=r.substring(n+s.length).trim();return new UD(o,s,c)}function YD(r){r=r.replace(kD,"defined[$1]");const e=vi.infixToPostfix(r),t=[];for(const s of e)if(s!=="||"&&s!=="&&")t.push(s);else if(t.length>=2){let n=t[t.length-1],o=t[t.length-2];t.length-=2;const c=s=="&&"?new ND:new BD;typeof n=="string"&&(n=n.replace(dm,"defined($1)")),typeof o=="string"&&(o=o.replace(dm,"defined($1)")),c.leftOperand=typeof o=="string"?_m(o):o,c.rightOperand=typeof n=="string"?_m(n):n,t.push(c)}let i=t[t.length-1];return typeof i=="string"&&(i=i.replace(dm,"defined($1)")),typeof i=="string"?_m(i):i}function Df(r,e){const t=new LD,i=r.substring(0,e);let s=r.substring(e);return s=s.substring(0,(s.indexOf("//")+1||s.length+1)-1).trim(),i==="#ifdef"?t.testExpression=new Nf(s):i==="#ifndef"?t.testExpression=new Nf(s,!0):t.testExpression=YD(s),t}function mm(r,e,t,i){let s;for(;Nm(r,t);){s=r.currentLine;const n=s.substring(0,5).toLowerCase();if(n==="#else"){const o=new bh;e.children.push(o),Nm(r,o);return}else if(n==="#elif"){const o=Df(s,5);e.children.push(o),t=o}}}function Nm(r,e,t){for(;r.canRead;){r.lineIndex++;const i=r.currentLine;if(i.indexOf("#")>=0){const n=GD.exec(i);if(n&&n.length){switch(n[0]){case"#ifdef":{const c=new fm;e.children.push(c);const h=Df(i,6);c.children.push(h),mm(r,c,h);break}case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":{const c=new fm;e.children.push(c);const h=Df(i,7);c.children.push(h),mm(r,c,h);break}case"#if":{const c=new fm,h=Df(i,3);e.children.push(c),c.children.push(h),mm(r,c,h);break}}continue}}const s=new bh;if(s.line=i,e.children.push(s),i[0]==="#"&&i[1]==="d"){const n=i.replace(";","").split(" ");s.additionalDefineKey=n[1],n.length===3&&(s.additionalDefineValue=n[2])}}return!1}function jD(r,e,t,i){const s=new bh,n=new FD;return n.lineIndex=-1,n.lines=r.split(`
167`),Nm(n,s),s.process(e,t,i)}function qD(r,e){const t=r.defines,i={};for(const s of t){const o=s.replace("#define","").replace(";","").trim().split(" ");i[o[0]]=o.length>1?o[1]:""}return r.processor?.shaderLanguage===0&&(i.GL_ES="true"),i.__VERSION__=r.version,i[r.platformName]="true",Uv(i,e?.isNDCHalfZRange,e?.useReverseDepthBuffer,e?.useExactSrgbConversions),i}function KD(r,e,t){let i=XD(r,e);if(!e.processor||e.processor.shaderLanguage===0&&i.indexOf("#version 3")!==-1&&(i=i.replace("#version 300 es",""),!e.processor.parseGLES3))return i;const s=e.defines,n=qD(e,t);e.processor.preProcessor&&(i=e.processor.preProcessor(i,s,n,e.isFragment,e.processingContext));const o={};return i=jD(i,n,e,o),e.processor.postProcessor&&(i=e.processor.postProcessor(i,s,e.isFragment,e.processingContext,t?{drawBuffersExtensionDisabled:!t.getCaps().drawBuffersExtension}:{},n,o)),t?._features.needShaderCodeInlining&&(i=t.inlineShaderCode(i)),i}function Uf(r,e,t){Ef.length=0;let i;for(;(i=zD.exec(r))!==null;)Ef.push(i);let s=[r],n=!1;for(const c of Ef){let h=c[1];if(h.indexOf("__decl__")!==-1&&(h=h.replace(VD,""),e.supportsUniformBuffers&&(h=h.replace("Vertex","Ubo").replace("Fragment","Ubo")),h=h+"Declaration"),e.includesShadersStore[h]){let f=e.includesShadersStore[h];if(c[2]){const d=c[3].split(",");for(let g=0;g<d.length;g+=2){const p=new RegExp(d[g],"g"),b=d[g+1];f=f.replace(p,b)}}if(c[4]){const d=c[5];if(d.indexOf("..")!==-1){const g=d.split(".."),p=parseInt(g[0]);let b=parseInt(g[1]),x=f.slice(0);f="",isNaN(b)&&(b=e.indexParameters[g[1]]);for(let E=p;E<b;E++)e.supportsUniformBuffers||(x=x.replace(dx,(v,S)=>S+"{X}")),f+=x.replace(_x,E.toString())+`
168`}else e.supportsUniformBuffers||(f=f.replace(dx,(g,p)=>p+"{X}")),f=f.replace(_x,d)}const _=[];for(const d of s){const g=d.split(c[0]);for(let p=0;p<g.length-1;p++)_.push(g[p]),_.push(f);_.push(g[g.length-1])}s=_,n=n||f.indexOf("#include<")>=0||f.indexOf("#include <")>=0}else{const f=e.shadersRepository+"ShadersInclude/"+h+".fx";Vv.loadFile(f,_=>{e.includesShadersStore[h]=_,Uf(s.join(""),e,t)});return}}Ef.length=0;const o=s.join("");n?Uf(o.toString(),e,t):t(o)}const Vv={loadFile:(r,e,t,i,s,n)=>{throw at("FileTools")}};function ZD(r,e){return Vs(e).cachedPipelines[r]}function Gv(r){const e=r._name,t=r.context;if(e&&t){const i=Vs(t);i.cachedPipelines[e]?.dispose(),delete i.cachedPipelines[e]}}function QD(r,e,t,i,s,n,o){let c,h;const f=is()?n?.getHostDocument():null;typeof e=="string"?c=e:typeof e.vertexSource=="string"?c="source:"+e.vertexSource:typeof e.vertexElement=="string"?c=f?.getElementById(e.vertexElement)||e.vertexElement:c=e.vertex||e,typeof e=="string"?h=e:typeof e.fragmentSource=="string"?h="source:"+e.fragmentSource:typeof e.fragmentElement=="string"?h=f?.getElementById(e.fragmentElement)||e.fragmentElement:h=e.fragment||e;const _=[void 0,void 0],d=()=>{if(_[0]&&_[1]){const[g,p]=_;HD(r),mx(g,r,(b,x)=>{o&&(o._vertexSourceCodeBeforeMigration=x),t&&(b=t("vertex",b)),r.isFragment=!0,mx(p,r,(E,v)=>{o&&(o._fragmentSourceCodeBeforeMigration=v),t&&(E=t("fragment",E));const S=WD(b,E,r);r=null;const R=$D(S.vertexCode,S.fragmentCode,e,s);i?.(R.vertexSourceCode,R.fragmentSourceCode)},n)},n)}};gx(c,"Vertex","",g=>{o&&(o._rawVertexSourceCode=g),_[0]=g,d()},s),gx(h,"Fragment","Pixel",g=>{o&&(o._rawFragmentSourceCode=g),_[1]=g,d()},s)}function gx(r,e,t,i,s,n){if(typeof HTMLElement<"u"&&r instanceof HTMLElement){const h=Lv(r);i(h);return}if(r.substring(0,7)==="source:"){i(r.substring(7));return}if(r.substring(0,7)==="base64:"){const h=window.atob(r.substring(7));i(h);return}const o=Pi.GetShadersStore(s);if(o[r+e+"Shader"]){i(o[r+e+"Shader"]);return}if(t&&o[r+t+"Shader"]){i(o[r+t+"Shader"]);return}let c;if(r[0]==="."||r[0]==="/"||r.indexOf("http")>-1?c=r:c=Pi.GetShadersRepository(s)+r,n=n||Nv,!n)throw new Error("loadFileInjection is not defined");n(c+"."+e.toLowerCase()+".fx",i)}function $D(r,e,t,i){if(t){const s=t.vertexElement||t.vertex||t.spectorName||t,n=t.fragmentElement||t.fragment||t.spectorName||t;return{vertexSourceCode:(i===1?"//":"")+"#define SHADER_NAME vertex:"+s+`
169`+r,fragmentSourceCode:(i===1?"//":"")+"#define SHADER_NAME fragment:"+n+`
170`+e}}else return{vertexSourceCode:r,fragmentSourceCode:e}}const JD=(r,e,t,i)=>{try{const s=r.context?Vs(r.context):null;s&&(s.disableParallelShaderCompile=r.disableParallelCompilation);const n=r.existingPipelineContext||e(r.shaderProcessingContext);return n._name=r.name,r.name&&s&&(s.cachedPipelines[r.name]=n),t(n,r.vertex,r.fragment,!!r.createAsRaw,"","",r.rebuildRebind,r.defines,r.transformFeedbackVaryings,"",()=>{i(n,()=>{r.onRenderingStateCompiled?.(n)})}),n}catch(s){throw Ee.Error("Error compiling effect"),s}};let vf=[];class Ts{static SetImmediate(e){vf.length===0&&setTimeout(()=>{const t=vf;vf=[];for(const i of t)i()},1),vf.push(e)}}function px(r,e,t){try{if(r())return e(),!0}catch(i){return t?.(i),!0}return!1}const ug=(r,e,t,i=16,s=3e4,n=!0,o)=>{if(n&&px(r,e,t))return null;const c=setInterval(()=>{px(r,e,t)?clearInterval(c):(s-=i,s<0&&(clearInterval(c),t?.(new Error("Operation timed out after maximum retries. "+(o||"")),!0)))},i);return()=>clearInterval(c)};class Li{static get ShadersRepository(){return Pi.ShadersRepository}static set ShadersRepository(e){Pi.ShadersRepository=e}get isDisposed(){return this._isDisposed}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new Oe),this._onBindObservable}get shaderLanguage(){return this._shaderLanguage}constructor(e,t,i,s=null,n,o=null,c=null,h=null,f=null,_,d="",g=0,p){this.defines="",this.onCompiled=null,this.onError=null,this.onBind=null,this.uniqueId=0,this.onCompileObservable=new Oe,this.onErrorObservable=new Oe,this._onBindObservable=null,this._isDisposed=!1,this._refCount=1,this._bonesComputationForcedToCPU=!1,this._uniformBuffersNames={},this._multiTarget=!1,this._samplers={},this._isReady=!1,this._compilationError="",this._allFallbacksProcessed=!1,this._uniforms={},this._key="",this._fallbacks=null,this._vertexSourceCodeOverride="",this._fragmentSourceCodeOverride="",this._transformFeedbackVaryings=null,this._disableParallelShaderCompilation=!1,this._pipelineContext=null,this._vertexSourceCode="",this._fragmentSourceCode="",this._vertexSourceCodeBeforeMigration="",this._fragmentSourceCodeBeforeMigration="",this._rawVertexSourceCode="",this._rawFragmentSourceCode="",this._processCodeAfterIncludes=void 0,this._processFinalCode=null,this._onReleaseEffectsObserver=null,this.name=e,this._key=d;const b=this._key.replace(/\r/g,"").replace(/\n/g,"|");let x;if(t.attributes){const E=t;if(this._engine=i,this._attributesNames=E.attributes,this._uniformsNames=E.uniformsNames.concat(E.samplers),this._samplerList=E.samplers.slice(),this.defines=E.defines,this.onError=E.onError,this.onCompiled=E.onCompiled,this._fallbacks=E.fallbacks,this._indexParameters=E.indexParameters,this._transformFeedbackVaryings=E.transformFeedbackVaryings||null,this._multiTarget=!!E.multiTarget,this._shaderLanguage=E.shaderLanguage??0,this._disableParallelShaderCompilation=!!E.disableParallelShaderCompilation,E.uniformBuffersNames){this._uniformBuffersNamesList=E.uniformBuffersNames.slice();for(let v=0;v<E.uniformBuffersNames.length;v++)this._uniformBuffersNames[E.uniformBuffersNames[v]]=v}this._processFinalCode=E.processFinalCode??null,this._processCodeAfterIncludes=E.processCodeAfterIncludes??void 0,p=E.extraInitializationsAsync,x=E.existingPipelineContext}else this._engine=n,this.defines=o??"",this._uniformsNames=i.concat(s),this._samplerList=s?s.slice():[],this._attributesNames=t,this._uniformBuffersNamesList=[],this._shaderLanguage=g,this.onError=f,this.onCompiled=h,this._indexParameters=_,this._fallbacks=c;this._engine.shaderPlatformName==="WEBGL2"&&(x=ZD(b,this._engine._gl)??x),this._attributeLocationByName={},this.uniqueId=Li._UniqueIdSeed++,x?(this._pipelineContext=x,this._pipelineContext.setEngine(this._engine),this._onRenderingStateCompiled(this._pipelineContext),this._pipelineContext.program&&(this._pipelineContext.program.__SPECTOR_rebuildProgram=this._rebuildProgram.bind(this))):this._processShaderCodeAsync(null,!1,null,p).catch(E=>{const v=E?.message??String(E),S=new Error(`Effect async shader preparation failed for "${String(this.name)}": ${v}`);E&&typeof E.stack=="string"&&(S.stack=`${S.message}
171Caused by: ${E.stack}`),this._processCompilationErrors(S)}),this._onReleaseEffectsObserver=this._engine.onReleaseEffectsObservable.addOnce(()=>{this._onReleaseEffectsObserver=null,!this.isDisposed&&this.dispose(!0)})}async _processShaderCodeAsync(e=null,t=!1,i=null,s){s&&await s(),this._processingContext=i||this._engine._getShaderProcessingContext(this._shaderLanguage,!1);const n={defines:this.defines.split(`
172`),indexParameters:this._indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:e??this._engine._getShaderProcessor(this._shaderLanguage),supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:Pi.GetShadersRepository(this._shaderLanguage),includesShadersStore:Pi.GetIncludesShadersStore(this._shaderLanguage),version:(this._engine.version*100).toString(),platformName:this._engine.shaderPlatformName,processingContext:this._processingContext,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:this._processCodeAfterIncludes};QD(n,this.name,this._processFinalCode,(o,c)=>{this._vertexSourceCode=o,this._fragmentSourceCode=c,this._prepareEffect(t)},this._shaderLanguage,this._engine,this)}get key(){return this._key}isReady(){try{return this._isReadyInternal()}catch{return!1}}_isReadyInternal(){return this._engine.isDisposed||this._isReady?!0:this._pipelineContext?this._pipelineContext.isReady:!1}getEngine(){return this._engine}getPipelineContext(){return this._pipelineContext}getAttributesNames(){return this._attributesNames}getAttributeLocation(e){return this._attributes[e]}getAttributeLocationByName(e){return this._attributeLocationByName[e]}getAttributesCount(){return this._attributes.length}getUniformIndex(e){return this._uniformsNames.indexOf(e)}getUniform(e){return this._uniforms[e]}getSamplers(){return this._samplerList}getUniformNames(){return this._uniformsNames}getUniformBuffersNames(){return this._uniformBuffersNamesList}getIndexParameters(){return this._indexParameters}getCompilationError(){return this._compilationError}allFallbacksProcessed(){return this._allFallbacksProcessed}async whenCompiledAsync(){return await new Promise(e=>{this.executeWhenCompiled(e)})}executeWhenCompiled(e){if(this.isReady()){e(this);return}this.onCompileObservable.add(t=>{e(t)}),(!this._pipelineContext||this._pipelineContext.isAsync)&&this._checkIsReady(null)}_checkIsReady(e){ug(()=>this._isReadyInternal()||this._isDisposed,()=>{},t=>{this._processCompilationErrors(t,e)},16,12e4,!0,` - Effect: ${typeof this.name=="string"?this.name:this.key}`)}get vertexSourceCode(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:this._pipelineContext?._getVertexShaderCode()??this._vertexSourceCode}get fragmentSourceCode(){return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:this._pipelineContext?._getFragmentShaderCode()??this._fragmentSourceCode}get vertexSourceCodeBeforeMigration(){return this._vertexSourceCodeBeforeMigration}get fragmentSourceCodeBeforeMigration(){return this._fragmentSourceCodeBeforeMigration}get rawVertexSourceCode(){return this._rawVertexSourceCode}get rawFragmentSourceCode(){return this._rawFragmentSourceCode}getPipelineGenerationOptions(){return{platformName:this._engine.shaderPlatformName,shaderLanguage:this._shaderLanguage,shaderNameOrContent:this.name,key:this._key,defines:this.defines.split(`
173`),addGlobalDefines:!1,extendedProcessingOptions:{indexParameters:this._indexParameters,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,supportsUniformBuffers:this._engine.supportsUniformBuffers},extendedCreatePipelineOptions:{transformFeedbackVaryings:this._transformFeedbackVaryings,createAsRaw:!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride)}}}_rebuildProgram(e,t,i,s){this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=(n,o)=>{s&&s(o)},this.onCompiled=()=>{const n=this.getEngine().scenes;if(n)for(let o=0;o<n.length;o++)n[o].markAllMaterialsAsDirty(127);this._pipelineContext._handlesSpectorRebuildCallback?.(i)},this._fallbacks=null,this._prepareEffect()}_onRenderingStateCompiled(e){if(this._pipelineContext=e,this._pipelineContext.setEngine(this._engine),this._attributes=[],this._pipelineContext._fillEffectInformation(this,this._uniformBuffersNames,this._uniformsNames,this._uniforms,this._samplerList,this._samplers,this._attributesNames,this._attributes),this._attributesNames)for(let t=0;t<this._attributesNames.length;t++){const i=this._attributesNames[t];this._attributeLocationByName[i]=this._attributes[t]}this._engine.bindSamplers(this),this._compilationError="",this._isReady=!0,this.onCompiled&&this.onCompiled(this),this.onCompileObservable.notifyObservers(this),this.onCompileObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh(),Li.AutomaticallyClearCodeCache&&this.clearCodeCache()}_prepareEffect(e=!1){const t=this._pipelineContext;this._isReady=!1;try{const i=!!(this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride),s=i?null:this.defines,n=i?this._vertexSourceCodeOverride:this._vertexSourceCode,o=i?this._fragmentSourceCodeOverride:this._fragmentSourceCode,c=this._engine;this._pipelineContext=JD({existingPipelineContext:e?t:null,vertex:n,fragment:o,context:c.shaderPlatformName==="WEBGL2"||c.shaderPlatformName==="WEBGL1"?c._gl:void 0,rebuildRebind:(h,f,_,d)=>this._rebuildProgram(h,f,_,d),defines:s,transformFeedbackVaryings:this._transformFeedbackVaryings,name:this._key.replace(/\r/g,"").replace(/\n/g,"|"),createAsRaw:i,disableParallelCompilation:this._disableParallelShaderCompilation,shaderProcessingContext:this._processingContext,onRenderingStateCompiled:h=>{t&&!e&&this._engine._deletePipelineContext(t),h&&this._onRenderingStateCompiled(h)}},this._engine.createPipelineContext.bind(this._engine),this._engine._preparePipelineContextAsync.bind(this._engine),this._engine._executeWhenRenderingStateIsCompiled.bind(this._engine)),this._pipelineContext.isAsync&&this._checkIsReady(t)}catch(i){this._processCompilationErrors(i,t)}}_getShaderCodeAndErrorLine(e,t,i){const s=i?/FRAGMENT SHADER ERROR: 0:(\d+?):/:/VERTEX SHADER ERROR: 0:(\d+?):/;let n=null;if(t&&e){const o=t.match(s);if(o&&o.length===2){const c=parseInt(o[1]),h=e.split(`
174`,-1);h.length>=c&&(n=`Offending line [${c}] in ${i?"fragment":"vertex"} code: ${h[c-1]}`)}}return[e,n]}_processCompilationErrors(e,t=null){this._compilationError=typeof e?.stack=="string"?e.stack:e?.message??String(e);const i=this._attributesNames,s=this._fallbacks;if(Ee.Error("Unable to compile effect:"),Ee.Error(`Uniforms: ${this._uniformsNames.join(" ")}`),Ee.Error(`Attributes: ${i.join(" ")}`),Ee.Error(`Defines:
175`+this.defines),Li.LogShaderCodeOnCompilationError){let o=null,c=null,h;this._pipelineContext?._getVertexShaderCode()&&([h,o]=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1),h&&(Ee.Error("Vertex code:"),Ee.Error(h))),this._pipelineContext?._getFragmentShaderCode()&&([h,c]=this._getShaderCodeAndErrorLine(this._pipelineContext?._getFragmentShaderCode(),this._compilationError,!0),h&&(Ee.Error("Fragment code:"),Ee.Error(h))),o&&Ee.Error(o),c&&Ee.Error(c)}Ee.Error("Error: "+this._compilationError);const n=()=>{this.onError&&this.onError(this,this._compilationError),this.onErrorObservable.notifyObservers(this),this._engine.onEffectErrorObservable.notifyObservers({effect:this,errors:this._compilationError})};t&&(this._pipelineContext=t,this._isReady=!0,n()),s?(this._pipelineContext=null,s.hasMoreFallbacks?(this._allFallbacksProcessed=!1,Ee.Error("Trying next fallback."),this.defines=s.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,n(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,t||n())}get isSupported(){return this._compilationError===""}_bindTexture(e,t){this._engine._bindTexture(this._samplers[e],t,e)}setTexture(e,t){this._engine.setTexture(this._samplers[e],this._uniforms[e],t,e)}setTextureArray(e,t){const i=e+"Ex";if(this._samplerList.indexOf(i+"0")===-1){const s=this._samplerList.indexOf(e);for(let o=1;o<t.length;o++){const c=i+(o-1).toString();this._samplerList.splice(s+o,0,c)}let n=0;for(const o of this._samplerList)this._samplers[o]=n,n+=1}this._engine.setTextureArray(this._samplers[e],this._uniforms[e],t,e)}bindUniformBuffer(e,t){const i=this._uniformBuffersNames[t];i===void 0||Li._BaseCache[i]===e&&this._engine._features.useUBOBindingCache||(Li._BaseCache[i]=e,this._engine.bindUniformBufferBase(e,i,t))}bindUniformBlock(e,t){this._engine.bindUniformBlock(this._pipelineContext,e,t)}setInt(e,t){return this._pipelineContext.setInt(e,t),this}setInt2(e,t,i){return this._pipelineContext.setInt2(e,t,i),this}setInt3(e,t,i,s){return this._pipelineContext.setInt3(e,t,i,s),this}setInt4(e,t,i,s,n){return this._pipelineContext.setInt4(e,t,i,s,n),this}setIntArray(e,t){return this._pipelineContext.setIntArray(e,t),this}setIntArray2(e,t){return this._pipelineContext.setIntArray2(e,t),this}setIntArray3(e,t){return this._pipelineContext.setIntArray3(e,t),this}setIntArray4(e,t){return this._pipelineContext.setIntArray4(e,t),this}setUInt(e,t){return this._pipelineContext.setUInt(e,t),this}setUInt2(e,t,i){return this._pipelineContext.setUInt2(e,t,i),this}setUInt3(e,t,i,s){return this._pipelineContext.setUInt3(e,t,i,s),this}setUInt4(e,t,i,s,n){return this._pipelineContext.setUInt4(e,t,i,s,n),this}setUIntArray(e,t){return this._pipelineContext.setUIntArray(e,t),this}setUIntArray2(e,t){return this._pipelineContext.setUIntArray2(e,t),this}setUIntArray3(e,t){return this._pipelineContext.setUIntArray3(e,t),this}setUIntArray4(e,t){return this._pipelineContext.setUIntArray4(e,t),this}setFloatArray(e,t){return this._pipelineContext.setArray(e,t),this}setFloatArray2(e,t){return this._pipelineContext.setArray2(e,t),this}setFloatArray3(e,t){return this._pipelineContext.setArray3(e,t),this}setFloatArray4(e,t){return this._pipelineContext.setArray4(e,t),this}setArray(e,t){return this._pipelineContext.setArray(e,t),this}setArray2(e,t){return this._pipelineContext.setArray2(e,t),this}setArray3(e,t){return this._pipelineContext.setArray3(e,t),this}setArray4(e,t){return this._pipelineContext.setArray4(e,t),this}setMatrices(e,t){return this._pipelineContext.setMatrices(e,t),this}setMatrix(e,t){return this._pipelineContext.setMatrix(e,t),this}setMatrix3x3(e,t){return this._pipelineContext.setMatrix3x3(e,t),this}setMatrix2x2(e,t){return this._pipelineContext.setMatrix2x2(e,t),this}setFloat(e,t){return this._pipelineContext.setFloat(e,t),this}setBool(e,t){return this._pipelineContext.setInt(e,t?1:0),this}setVector2(e,t){return this._pipelineContext.setVector2(e,t),this}setFloat2(e,t,i){return this._pipelineContext.setFloat2(e,t,i),this}setVector3(e,t){return this._pipelineContext.setVector3(e,t),this}setFloat3(e,t,i,s){return this._pipelineContext.setFloat3(e,t,i,s),this}setVector4(e,t){return this._pipelineContext.setVector4(e,t),this}setQuaternion(e,t){return this._pipelineContext.setQuaternion(e,t),this}setFloat4(e,t,i,s,n){return this._pipelineContext.setFloat4(e,t,i,s,n),this}setColor3(e,t){return this._pipelineContext.setColor3(e,t),this}setColor4(e,t,i){return this._pipelineContext.setColor4(e,t,i),this}setDirectColor4(e,t){return this._pipelineContext.setDirectColor4(e,t),this}clearCodeCache(){this._vertexSourceCode="",this._fragmentSourceCode="",this._fragmentSourceCodeBeforeMigration="",this._vertexSourceCodeBeforeMigration=""}dispose(e=!1){if(e)this._refCount=0;else{if(Li.PersistentMode)return;this._refCount--}this._refCount>0||this._isDisposed||(this._onReleaseEffectsObserver&&(this._engine.onReleaseEffectsObservable.remove(this._onReleaseEffectsObserver),this._onReleaseEffectsObserver=null),this._pipelineContext&&Gv(this._pipelineContext),this._engine._releaseEffect(this),this.clearCodeCache(),this._isDisposed=!0)}static RegisterShader(e,t,i,s=0){t&&(Pi.GetShadersStore(s)[`${e}PixelShader`]=t),i&&(Pi.GetShadersStore(s)[`${e}VertexShader`]=i)}static ResetCache(){Li._BaseCache={}}}Li.LogShaderCodeOnCompilationError=!0;Li.PersistentMode=!1;Li.AutomaticallyClearCodeCache=!1;Li._UniqueIdSeed=0;Li._BaseCache={};Li.ShadersStore=Pi.ShadersStore;Li.IncludesShadersStore=Pi.IncludesShadersStore;class Wi{static SetMatrixPrecision(e){if(Wi.MatrixTrackPrecisionChange=!1,e&&!Wi.MatrixUse64Bits&&Wi.MatrixTrackedMatrices)for(let t=0;t<Wi.MatrixTrackedMatrices.length;++t){const i=Wi.MatrixTrackedMatrices[t],s=i._m;i._m=new Array(16);for(let n=0;n<16;++n)i._m[n]=s[n]}Wi.MatrixUse64Bits=e,Wi.MatrixCurrentType=Wi.MatrixUse64Bits?Array:Float32Array,Wi.MatrixTrackedMatrices=null}}Wi.MatrixUse64Bits=!1;Wi.MatrixTrackPrecisionChange=!0;Wi.MatrixCurrentType=Float32Array;Wi.MatrixTrackedMatrices=[];class Gs{static get Now(){return is()&&window.performance&&window.performance.now?window.performance.now():Date.now()}}class eP{constructor(e=!0){this._isDepthTestDirty=!1,this._isDepthMaskDirty=!1,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!1,this._isFrontFaceDirty=!1,e&&this.reset()}get isDirty(){return this._isDepthFuncDirty||this._isDepthTestDirty||this._isDepthMaskDirty||this._isCullFaceDirty||this._isCullDirty||this._isZOffsetDirty||this._isFrontFaceDirty}get zOffset(){return this._zOffset}set zOffset(e){this._zOffset!==e&&(this._zOffset=e,this._isZOffsetDirty=!0)}get zOffsetUnits(){return this._zOffsetUnits}set zOffsetUnits(e){this._zOffsetUnits!==e&&(this._zOffsetUnits=e,this._isZOffsetDirty=!0)}get cullFace(){return this._cullFace}set cullFace(e){this._cullFace!==e&&(this._cullFace=e,this._isCullFaceDirty=!0)}get cull(){return this._cull}set cull(e){this._cull!==e&&(this._cull=e,this._isCullDirty=!0)}get depthFunc(){return this._depthFunc}set depthFunc(e){this._depthFunc!==e&&(this._depthFunc=e,this._isDepthFuncDirty=!0)}get depthMask(){return this._depthMask}set depthMask(e){this._depthMask!==e&&(this._depthMask=e,this._isDepthMaskDirty=!0)}get depthTest(){return this._depthTest}set depthTest(e){this._depthTest!==e&&(this._depthTest=e,this._isDepthTestDirty=!0)}get frontFace(){return this._frontFace}set frontFace(e){this._frontFace!==e&&(this._frontFace=e,this._isFrontFaceDirty=!0)}reset(){this._depthMask=!0,this._depthTest=!0,this._depthFunc=null,this._cullFace=null,this._cull=null,this._zOffset=0,this._zOffsetUnits=0,this._frontFace=null,this._isDepthTestDirty=!0,this._isDepthMaskDirty=!0,this._isDepthFuncDirty=!1,this._isCullFaceDirty=!1,this._isCullDirty=!1,this._isZOffsetDirty=!0,this._isFrontFaceDirty=!1}apply(e){this.isDirty&&(this._isCullDirty&&(this.cull?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this._isCullDirty=!1),this._isCullFaceDirty&&(e.cullFace(this.cullFace),this._isCullFaceDirty=!1),this._isDepthMaskDirty&&(e.depthMask(this.depthMask),this._isDepthMaskDirty=!1),this._isDepthTestDirty&&(this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this._isDepthTestDirty=!1),this._isDepthFuncDirty&&(e.depthFunc(this.depthFunc),this._isDepthFuncDirty=!1),this._isZOffsetDirty&&(this.zOffset||this.zOffsetUnits?(e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(this.zOffset,this.zOffsetUnits)):e.disable(e.POLYGON_OFFSET_FILL),this._isZOffsetDirty=!1),this._isFrontFaceDirty&&(e.frontFace(this.frontFace),this._isFrontFaceDirty=!1))}}class tP{get isDirty(){return this._isStencilTestDirty||this._isStencilMaskDirty||this._isStencilFuncDirty||this._isStencilOpDirty}get func(){return this._func}set func(e){this._func!==e&&(this._func=e,this._isStencilFuncDirty=!0)}get backFunc(){return this._func}set backFunc(e){this._backFunc!==e&&(this._backFunc=e,this._isStencilFuncDirty=!0)}get funcRef(){return this._funcRef}set funcRef(e){this._funcRef!==e&&(this._funcRef=e,this._isStencilFuncDirty=!0)}get funcMask(){return this._funcMask}set funcMask(e){this._funcMask!==e&&(this._funcMask=e,this._isStencilFuncDirty=!0)}get opStencilFail(){return this._opStencilFail}set opStencilFail(e){this._opStencilFail!==e&&(this._opStencilFail=e,this._isStencilOpDirty=!0)}get opDepthFail(){return this._opDepthFail}set opDepthFail(e){this._opDepthFail!==e&&(this._opDepthFail=e,this._isStencilOpDirty=!0)}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(e){this._opStencilDepthPass!==e&&(this._opStencilDepthPass=e,this._isStencilOpDirty=!0)}get backOpStencilFail(){return this._backOpStencilFail}set backOpStencilFail(e){this._backOpStencilFail!==e&&(this._backOpStencilFail=e,this._isStencilOpDirty=!0)}get backOpDepthFail(){return this._backOpDepthFail}set backOpDepthFail(e){this._backOpDepthFail!==e&&(this._backOpDepthFail=e,this._isStencilOpDirty=!0)}get backOpStencilDepthPass(){return this._backOpStencilDepthPass}set backOpStencilDepthPass(e){this._backOpStencilDepthPass!==e&&(this._backOpStencilDepthPass=e,this._isStencilOpDirty=!0)}get mask(){return this._mask}set mask(e){this._mask!==e&&(this._mask=e,this._isStencilMaskDirty=!0)}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._isStencilTestDirty=!0)}constructor(e=!0){this._isStencilTestDirty=!1,this._isStencilMaskDirty=!1,this._isStencilFuncDirty=!1,this._isStencilOpDirty=!1,this.useStencilGlobalOnly=!1,e&&this.reset()}reset(){this.stencilMaterial=void 0,this.stencilGlobal?.reset(),this._isStencilTestDirty=!0,this._isStencilMaskDirty=!0,this._isStencilFuncDirty=!0,this._isStencilOpDirty=!0}apply(e){if(!e)return;const t=!this.useStencilGlobalOnly&&!!this.stencilMaterial?.enabled;this.enabled=t?this.stencilMaterial.enabled:this.stencilGlobal.enabled,this.func=t?this.stencilMaterial.func:this.stencilGlobal.func,this.backFunc=t?this.stencilMaterial.backFunc:this.stencilGlobal.backFunc,this.funcRef=t?this.stencilMaterial.funcRef:this.stencilGlobal.funcRef,this.funcMask=t?this.stencilMaterial.funcMask:this.stencilGlobal.funcMask,this.opStencilFail=t?this.stencilMaterial.opStencilFail:this.stencilGlobal.opStencilFail,this.opDepthFail=t?this.stencilMaterial.opDepthFail:this.stencilGlobal.opDepthFail,this.opStencilDepthPass=t?this.stencilMaterial.opStencilDepthPass:this.stencilGlobal.opStencilDepthPass,this.backOpStencilFail=t?this.stencilMaterial.backOpStencilFail:this.stencilGlobal.backOpStencilFail,this.backOpDepthFail=t?this.stencilMaterial.backOpDepthFail:this.stencilGlobal.backOpDepthFail,this.backOpStencilDepthPass=t?this.stencilMaterial.backOpStencilDepthPass:this.stencilGlobal.backOpStencilDepthPass,this.mask=t?this.stencilMaterial.mask:this.stencilGlobal.mask,this.isDirty&&(this._isStencilTestDirty&&(this.enabled?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this._isStencilTestDirty=!1),this._isStencilMaskDirty&&(e.stencilMask(this.mask),this._isStencilMaskDirty=!1),this._isStencilFuncDirty&&(e.stencilFuncSeparate(e.FRONT,this.func,this.funcRef,this.funcMask),e.stencilFuncSeparate(e.BACK,this.backFunc,this.funcRef,this.funcMask),this._isStencilFuncDirty=!1),this._isStencilOpDirty&&(e.stencilOpSeparate(e.FRONT,this.opStencilFail,this.opDepthFail,this.opStencilDepthPass),e.stencilOpSeparate(e.BACK,this.backOpStencilFail,this.backOpDepthFail,this.backOpStencilDepthPass),this._isStencilOpDirty=!1))}}class Zs{constructor(){this.reset()}reset(){this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=Zs.ALWAYS,this.opStencilFail=Zs.KEEP,this.opDepthFail=Zs.KEEP,this.opStencilDepthPass=Zs.REPLACE,this.backFunc=Zs.ALWAYS,this.backOpStencilFail=Zs.KEEP,this.backOpDepthFail=Zs.KEEP,this.backOpStencilDepthPass=Zs.REPLACE}get stencilFunc(){return this.func}set stencilFunc(e){this.func=e}get stencilBackFunc(){return this.backFunc}set stencilBackFunc(e){this.backFunc=e}get stencilFuncRef(){return this.funcRef}set stencilFuncRef(e){this.funcRef=e}get stencilFuncMask(){return this.funcMask}set stencilFuncMask(e){this.funcMask=e}get stencilOpStencilFail(){return this.opStencilFail}set stencilOpStencilFail(e){this.opStencilFail=e}get stencilOpDepthFail(){return this.opDepthFail}set stencilOpDepthFail(e){this.opDepthFail=e}get stencilOpStencilDepthPass(){return this.opStencilDepthPass}set stencilOpStencilDepthPass(e){this.opStencilDepthPass=e}get stencilBackOpStencilFail(){return this.backOpStencilFail}set stencilBackOpStencilFail(e){this.backOpStencilFail=e}get stencilBackOpDepthFail(){return this.backOpDepthFail}set stencilBackOpDepthFail(e){this.backOpDepthFail=e}get stencilBackOpStencilDepthPass(){return this.backOpStencilDepthPass}set stencilBackOpStencilDepthPass(e){this.backOpStencilDepthPass=e}get stencilMask(){return this.mask}set stencilMask(e){this.mask=e}get stencilTest(){return this.enabled}set stencilTest(e){this.enabled=e}}Zs.ALWAYS=519;Zs.KEEP=7680;Zs.REPLACE=7681;class Hv{constructor(e){this._supportBlendParametersPerTarget=e,this._blendFunctionParameters=new Array(32),this._blendEquationParameters=new Array(16),this._blendConstants=new Array(4),this._isBlendConstantsDirt
175y=!1,this._alphaBlend=Array(8).fill(!1),this._numTargetEnabled=0,this._isAlphaBlendDirty=!1,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this.reset()}get isDirty(){return this._isAlphaBlendDirty||this._isBlendFunctionParametersDirty||this._isBlendEquationParametersDirty}get alphaBlend(){return this._numTargetEnabled>0}set alphaBlend(e){this.setAlphaBlend(e)}setAlphaBlend(e,t=0){this._alphaBlend[t]!==e&&(e?this._numTargetEnabled++:this._numTargetEnabled--,this._alphaBlend[t]=e,this._isAlphaBlendDirty=!0)}setAlphaBlendConstants(e,t,i,s){this._blendConstants[0]===e&&this._blendConstants[1]===t&&this._blendConstants[2]===i&&this._blendConstants[3]===s||(this._blendConstants[0]=e,this._blendConstants[1]=t,this._blendConstants[2]=i,this._blendConstants[3]=s,this._isBlendConstantsDirty=!0)}setAlphaBlendFunctionParameters(e,t,i,s,n=0){const o=n*4;this._blendFunctionParameters[o+0]===e&&this._blendFunctionParameters[o+1]===t&&this._blendFunctionParameters[o+2]===i&&this._blendFunctionParameters[o+3]===s||(this._blendFunctionParameters[o+0]=e,this._blendFunctionParameters[o+1]=t,this._blendFunctionParameters[o+2]=i,this._blendFunctionParameters[o+3]=s,this._isBlendFunctionParametersDirty=!0)}setAlphaEquationParameters(e,t,i=0){const s=i*2;this._blendEquationParameters[s+0]===e&&this._blendEquationParameters[s+1]===t||(this._blendEquationParameters[s+0]=e,this._blendEquationParameters[s+1]=t,this._isBlendEquationParametersDirty=!0)}reset(){this._alphaBlend.fill(!1),this._numTargetEnabled=0,this._blendFunctionParameters.fill(null),this._blendEquationParameters.fill(null),this._blendConstants[0]=null,this._blendConstants[1]=null,this._blendConstants[2]=null,this._blendConstants[3]=null,this._isAlphaBlendDirty=!0,this._isBlendFunctionParametersDirty=!1,this._isBlendEquationParametersDirty=!1,this._isBlendConstantsDirty=!1}apply(e,t=1){if(!this.isDirty)return;if(this._isBlendConstantsDirty&&(e.blendColor(this._blendConstants[0],this._blendConstants[1],this._blendConstants[2],this._blendConstants[3]),this._isBlendConstantsDirty=!1),t===1||!this._supportBlendParametersPerTarget){this._isAlphaBlendDirty&&(this._alphaBlend[0]?e.enable(e.BLEND):e.disable(e.BLEND),this._isAlphaBlendDirty=!1),this._isBlendFunctionParametersDirty&&(e.blendFuncSeparate(this._blendFunctionParameters[0],this._blendFunctionParameters[1],this._blendFunctionParameters[2],this._blendFunctionParameters[3]),this._isBlendFunctionParametersDirty=!1),this._isBlendEquationParametersDirty&&(e.blendEquationSeparate(this._blendEquationParameters[0],this._blendEquationParameters[1]),this._isBlendEquationParametersDirty=!1);return}const i=e;if(this._isAlphaBlendDirty){for(let s=0;s<t;s++){const n=s<this._numTargetEnabled?s:0;this._alphaBlend[n]?i.enableIndexed(e.BLEND,s):i.disableIndexed(e.BLEND,s)}this._isAlphaBlendDirty=!1}if(this._isBlendFunctionParametersDirty){for(let s=0;s<t;s++){const n=s<this._numTargetEnabled?s*4:0;i.blendFuncSeparateIndexed(s,this._blendFunctionParameters[n+0],this._blendFunctionParameters[n+1],this._blendFunctionParameters[n+2],this._blendFunctionParameters[n+3])}this._isBlendFunctionParametersDirty=!1}if(this._isBlendEquationParametersDirty){for(let s=0;s<t;s++){const n=s<this._numTargetEnabled?s*2:0;i.blendEquationSeparateIndexed(s,this._blendEquationParameters[n+0],this._blendEquationParameters[n+1])}this._isBlendEquationParametersDirty=!1}}setAlphaMode(e,t){let i=32774;switch(e){case 0:break;case 7:this.setAlphaBlendFunctionParameters(1,771,1,1,t);break;case 8:this.setAlphaBlendFunctionParameters(1,771,1,771,t);break;case 2:this.setAlphaBlendFunctionParameters(770,771,1,1,t);break;case 6:this.setAlphaBlendFunctionParameters(1,1,0,1,t);break;case 1:this.setAlphaBlendFunctionParameters(770,1,0,1,t);break;case 3:this.setAlphaBlendFunctionParameters(0,769,1,1,t);break;case 4:this.setAlphaBlendFunctionParameters(774,0,1,1,t);break;case 5:this.setAlphaBlendFunctionParameters(770,769,1,1,t);break;case 9:this.setAlphaBlendFunctionParameters(32769,32770,32771,32772,t);break;case 10:this.setAlphaBlendFunctionParameters(1,769,1,771,t);break;case 11:this.setAlphaBlendFunctionParameters(1,1,1,1,t);break;case 12:this.setAlphaBlendFunctionParameters(772,1,0,0,t);break;case 13:this.setAlphaBlendFunctionParameters(775,769,773,771,t);break;case 14:this.setAlphaBlendFunctionParameters(1,771,1,771,t);break;case 15:this.setAlphaBlendFunctionParameters(1,1,1,0,t);break;case 16:this.setAlphaBlendFunctionParameters(775,769,0,1,t);break;case 17:this.setAlphaBlendFunctionParameters(770,771,1,771,t);break;case 18:this.setAlphaBlendFunctionParameters(1,1,1,1,t),i=32775;break;case 19:this.setAlphaBlendFunctionParameters(1,1,1,1,t),i=32776;break;case 20:this.setAlphaBlendFunctionParameters(1,35065,0,1,t);break;case 21:this.setAlphaBlendFunctionParameters(1,0,1,771,t);break}this.setAlphaEquationParameters(i,i,t)}}function Wv(r,e){if(e){const{requestAnimationFrame:t}=e;if(typeof t=="function")return t(r)}if(is()){const{requestAnimationFrame:t}=e||window;if(typeof t=="function")return t(r)}else if(typeof requestAnimationFrame=="function")return requestAnimationFrame(r);return setTimeout(r,16)}class Be{get frameId(){return this._frameId}get isWebGPU(){return this._isWebGPU}_getShaderProcessor(e){return this._shaderProcessor}_resetAlphaMode(){this._alphaMode.fill(-1),this._alphaEquation.fill(-1)}get shaderPlatformName(){return this._shaderPlatformName}_clearEmptyResources(){this._emptyTexture=null,this._emptyCubeTexture=null,this._emptyTexture3D=null,this._emptyTexture2DArray=null}get useReverseDepthBuffer(){return this._useReverseDepthBuffer}set useReverseDepthBuffer(e){e!==this._useReverseDepthBuffer&&(this._useReverseDepthBuffer=e,e?this._depthCullingState.depthFunc=518:this._depthCullingState.depthFunc=515)}setColorWrite(e){e!==this._colorWrite&&(this._colorWriteChanged=!0,this._colorWrite=e)}
175getColorWrite(){return this._colorWrite}get depthCullingState(){return this._depthCullingState}get alphaState(){return this._alphaState}get stencilState(){return this._stencilState}get stencilStateComposer(){return this._stencilStateComposer}_getGlobalDefines(e){if(e){this.isNDCHalfZRange?e.IS_NDC_HALF_ZRANGE="":delete e.IS_NDC_HALF_ZRANGE,this.useReverseDepthBuffer?e.USE_REVERSE_DEPTHBUFFER="":delete e.USE_REVERSE_DEPTHBUFFER,this.useExactSrgbConversions?e.USE_EXACT_SRGB_CONVERSIONS="":delete e.USE_EXACT_SRGB_CONVERSIONS;return}else{let t="";return this.isNDCHalfZRange&&(t+="#define IS_NDC_HALF_ZRANGE"),this.useReverseDepthBuffer&&(t&&(t+=`
176`),t+="#define USE_REVERSE_DEPTHBUFFER"),this.useExactSrgbConversions&&(t&&(t+=`
177`),t+="#define USE_EXACT_SRGB_CONVERSIONS"),t}}_rebuildInternalTextures(){const e=this._internalTexturesCache.slice();for(const t of e)t._rebuild()}_rebuildRenderTargetWrappers(){const e=this._renderTargetWrapperCache.slice();for(const t of e)t.textures?.some(i=>i.source===15)||t._rebuild()}_rebuildEffects(){for(const e in this._compiledEffects){const t=this._compiledEffects[e];t._pipelineContext=null,t._prepareEffect()}Li.ResetCache()}_rebuildGraphicsResources(){this.wipeCaches(!0),this._rebuildEffects(),this._rebuildComputeEffects?.(),this._rebuildBuffers(),this._rebuildInternalTextures(),this._rebuildTextures(),this._rebuildRenderTargetWrappers(),this.wipeCaches(!0)}_flagContextRestored(){Ee.Warn(this.name+" context successfully restored."),this.onContextRestoredObservable.notifyObservers(this),this._contextWasLost=!1}_restoreEngineAfterContextLost(e){setTimeout(()=>{this._clearEmptyResources();const t=this._depthCullingState.depthTest,i=this._depthCullingState.depthFunc,s=this._depthCullingState.depthMask,n=this._stencilState.stencilTest;e(),this._rebuildGraphicsResources(),this._depthCullingState.depthTest=t,this._depthCullingState.depthFunc=i,this._depthCullingState.depthMask=s,this._stencilState.stencilTest=n,this._flagContextRestored()},0)}get isDisposed(){return this._isDisposed}get snapshotRendering(){return!1}set snapshotRendering(e){}get snapshotRenderingMode(){return 0}set snapshotRenderingMode(e){}getClassName(){return"AbstractEngine"}get emptyTexture(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,5,!1,!1,1)),this._emptyTexture}get emptyTexture3D(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture3D}get emptyTexture2DArray(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,5,!1,!1,1)),this._emptyTexture2DArray}get emptyCubeTexture(){if(!this._emptyCubeTexture){const e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,5,0,!1,!1,1)}return this._emptyCubeTexture}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}get activeRenderLoops(){return this._activeRenderLoops}stopRenderLoop(e){if(!e){this._activeRenderLoops.length=0,this._cancelFrame();return}const t=this._activeRenderLoops.indexOf(e);t>=0&&(this._activeRenderLoops.splice(t,1),this._activeRenderLoops.length==0&&this._cancelFrame())}_cancelFrame(){if(this.customAnimationFrameRequester){if(this._frameHandler!==0){this._frameHandler=0;const{cancelAnimationFrame:e}=this.customAnimationFrameRequester;e&&e(this.customAnimationFrameRequester.requestID),delete this.customAnimationFrameRequester.requestID}return}if(this._frameHandler!==0){const e=this._frameHandler;if(this._frameHandler=0,is()){const{cancelAnimationFrame:t}=this.getHostWindow()||window;if(typeof t=="function")return t(e)}else if(typeof cancelAnimationFrame=="function")return cancelAnimationFrame(e);return clearTimeout(e)}}beginFrame(){this.onBeginFrameObservable.notifyObservers(this)}endFrame(){this._frameId++,this.onEndFrameObservable.notifyObservers(this)}get maxFPS(){return this._maxFPS}set maxFPS(e){if(this._maxFPS=e,e!==void 0){if(e<=0){this._minFrameTime=Number.MAX_VALUE;return}this._minFrameTime=1e3/e}}_isOverFrameTime(e){if(!e||this._maxFPS===void 0)return!1;const t=e-this._lastFrameTime;return this._lastFrameTime=e,this._renderAccumulator+=t,this._renderAccumulator<this._minFrameTime?!0:(this._renderAccumulator-=this._minFrameTime,this._renderAccumulator>this._minFrameTime&&(this._renderAccumulator=this._minFrameTime),!1)}
vendor: 11,963 bytes, line 177
177_processFrame(e){if(this._frameHandler=0,!this._contextWasLost&&!this._isOverFrameTime(e)){let t=!0;(this.isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(t=!1),t&&(this.beginFrame(),!this.skipFrameRender&&!this._renderViews()&&this._renderFrame(),this.endFrame())}}_renderLoop(e){this._processFrame(e),this._activeRenderLoops.length>0&&this._frameHandler===0&&this._queueNewFrameForRenderLoop()}_renderFrame(){for(let e=0;e<this._activeRenderLoops.length;e++){const t=this._activeRenderLoops[e];t()}}_renderViews(){return!1}_queueNewFrame(e,t){return Wv(e,t)}_queueNewFrameForRenderLoop(){this.customAnimationFrameRequester?(this.customAnimationFrameRequester.requestID=this._queueNewFrame(this.customAnimationFrameRequester.renderFunction||this._boundRenderFunction,this.customAnimationFrameRequester),this._frameHandler=this.customAnimationFrameRequester.requestID):this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())}runRenderLoop(e){this._activeRenderLoops.indexOf(e)===-1&&(this._activeRenderLoops.push(e),this._activeRenderLoops.length===1&&this._frameHandler===0&&this._queueNewFrameForRenderLoop())}getDepthBuffer(){return this._depthCullingState.depthTest}setDepthBuffer(e){this._depthCullingState.depthTest=e}setZOffset(e){this._depthCullingState.zOffset=this.useReverseDepthBuffer?-e:e}getZOffset(){const e=this._depthCullingState.zOffset;return this.useReverseDepthBuffer?-e:e}setZOffsetUnits(e){this._depthCullingState.zOffsetUnits=this.useReverseDepthBuffer?-e:e}getZOffsetUnits(){const e=this._depthCullingState.zOffsetUnits;return this.useReverseDepthBuffer?-e:e}getHostWindow(){return is()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null}get compatibilityMode(){return this._compatibilityMode}set compatibilityMode(e){this._compatibilityMode=!0}_rebuildTextures(){for(const e of this.scenes)e._rebuildTextures();for(const e of this._virtualScenes)e._rebuildTextures()}_releaseRenderTargetWrapper(e){const t=this._renderTargetWrapperCache.indexOf(e);t!==-1&&this._renderTargetWrapperCache.splice(t,1)}get currentViewport(){return this._cachedViewport}setViewport(e,t,i){const s=t||this.getRenderWidth(),n=i||this.getRenderHeight(),o=e.x||0,c=e.y||0;this._cachedViewport=e,this._viewport(o*s,c*n,s*e.width,n*e.height)}createCanvasImage(){return document.createElement("img")}createCanvasPath2D(e){return new Path2D(e)}get description(){let e=this.name+this.version;return this._caps.parallelShaderCompile&&(e+=" - Parallel shader compilation"),e}_createTextureBase(e,t,i,s,n=3,o=null,c=null,h,f,_=null,d=null,g=null,p=null,b,x,E){e=e||"";const v=e.substring(0,5)==="data:",S=e.substring(0,5)==="blob:",R=v&&e.indexOf(";base64,")!==-1,P=d||new ws(this,1);P!==d&&(P.label=e.substring(0,60));const M=e;this._transformTextureUrl&&!R&&!d&&!_&&(e=this._transformTextureUrl(e)),M!==e&&(P._originalUrl=M);const O=e.lastIndexOf(".");let D=p||(O>-1?e.substring(O).toLowerCase():"");D.indexOf("?")>-1&&(D=D.split("?")[0]);const G=Be.GetCompatibleTextureLoader(D,b);s&&s.addPendingData(P),P.url=e,P.generateMipMaps=!t,P.samplingMode=n,P.invertY=i,P._useSRGBBuffer=this._getUseSRGBBuffer(!!E,t),this._doNotHandleContextLost||(P._buffer=_);let H=null;o&&!d&&(H=P.onLoadedObservable.add(o)),d||this._internalTexturesCache.push(P);const ie=(ne,ce)=>{s&&s.removePendingData(P),e===M?(H&&P.onLoadedObservable.remove(H),vt.UseFallbackTexture&&e!==vt.FallbackTexture&&this._createTextureBase(vt.FallbackTexture,t,P.invertY,s,n,null,c,h,f,_,P),ne=(ne||"Unknown error")+(vt.UseFallbackTexture?" - Fallback texture was used":""),P.onErrorObservable.notifyObservers({message:ne,exception:ce}),c&&c(ne,ce)):(Ee.Warn(`Failed to load ${e}, falling back to ${M}`),this._createTextureBase(M,t,P.invertY,s,n,o,c,h,f,_,P,g,p,b,x,E))};if(G){const ne=async ce=>{(await G).loadData(ce,P,(te,X,q,W,K,Z)=>{Z?ie("TextureLoader failed to load data"):h(P,D,s,{width:te,height:X},P.invertY,!q,W,()=>(K(),!1),n)},x)};if(!_)this._loadFile(e,async ce=>{try{await ne(new Uint8Array(ce))}catch(k){ie("Failed to parse texture data",k)}},void 0,s?s.offlineProvider:void 0,!0,(ce,k)=>{ie("Unable to load "+(ce&&ce.responseURL,k))});else{const ce=async k=>{try{await ne(k)}catch(te){ie("Failed to parse texture data",te)}};_ instanceof ArrayBuffer?ce(new Uint8Array(_)):ArrayBuffer.isView(_)?ce(_):c&&c("Unable to load: only ArrayBuffer or ArrayBufferView is supported",null)}}else{const ne=ce=>{S&&!this._doNotHandleContextLost&&(P._buffer=ce),h(P,D,s,ce,P.invertY,t,!1,f,n)};!v||R?_&&(typeof _.decoding=="string"||_.close)?ne(_):Be._FileToolsLoadImage(e||"",ne,ie,s?s.offlineProvider:null,b,P.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):typeof _=="string"||_ instanceof ArrayBuffer||ArrayBuffer.isView(_)||_ instanceof Blob?Be._FileToolsLoadImage(_,ne,ie,s?s.offlineProvider:null,b,P.invertY&&this._features.needsInvertingBitmap?{imageOrientation:"flipY"}:void 0,this):_&&ne(_)}return P}_rebuildBuffers(){for(const e of this._uniformBuffers)e._rebuildAfterContextLost()}get _shouldUseHighPrecisionShader(){return!!(this._caps.highPrecisionShaderSupported&&this._highPrecisionShadersAllowed)}getHostDocument(){return this._renderingCanvas&&this._renderingCanvas.ownerDocument?this._renderingCanvas.ownerDocument:co()?document:null}getLoadedTexturesCache(){return this._internalTexturesCache}clearInternalTexturesCache(){this._internalTexturesCache.length=0}getCaps(){return this._caps}resetTextureCache(){for(const e in this._boundTexturesCache)Object.prototype.hasOwnProperty.call(this._boundTexturesCache,e)&&(this._boundTexturesCache[e]=null);this._currentTextureChannel=-1}get name(){return this._name}set name(e){this._name=e}static get NpmPackage(){return"[email protected]"}static get Version(){return"9.21.0"}getRenderingCanvas(){return this._renderingCanvas}getAudioContext(){return this._audioContext}getAudioDestination(){return this._audioDestination}setHardwareScalingLevel(e){this._hardwareScalingLevel=e,this.resize()}getHardwareScalingLevel(){return this._hardwareScalingLevel}get doNotHandleContextLost(){return this._doNotHandleContextLost}set doNotHandleContextLost(e){this._doNotHandleContextLost=e}get isStencilEnable(){return this._isStencilEnable}getCreationOptions(){return this._creationOptions}constructor(e,t,i){this._colorWrite=!0,this._colorWriteChanged=!0,this._depthCullingState=new eP,this._stencilStateComposer=new tP,this._stencilState=new Zs,this._alphaState=new Hv(!1),this._alphaMode=Array(8).fill(-1),this._alphaEquation=Array(8).fill(-1),this._activeRequests=[],this._badOS=!1,this._badDesktopOS=!1,this._compatibilityMode=!0,this._internalTexturesCache=new Array,this._currentRenderTarget=null,this._boundTexturesCache={},this._activeChannel=0,this._currentTextureChannel=-1,this._viewportCached={x:0,y:0,z:0,w:0},this._isWebGPU=!1,this._enableGPUDebugMarkers=!1,this.onCanvasBlurObservable=new Oe,this.onCanvasFocusObservable=new Oe,this.onNewSceneAddedObservable=new Oe,this.onResizeObservable=new Oe,this.onCanvasPointerOutObservable=new Oe,this.onEffectErrorObservable=new Oe,this.disablePerformanceMonitorInBackground=!1,this.disableVertexArrayObjects=!1,this._frameId=0,this.hostInformation={isMobile:!1},this.isFullscreen=!1,this.enableOfflineSupport=!1,this.disableManifestCheck=!1,this.disableContextMenu=!0,this.currentRenderPassId=0,this.isPointerLock=!1,this.postProcesses=[],this.canvasTabIndex=1,this._contextWasLost=!1,this._useReverseDepthBuffer=!1,this.isNDCHalfZRange=!1,this.hasOriginBottomLeft=!0,this._renderTargetWrapperCache=new Array,this._compiledEffects={},this._isDisposed=!1,this.scenes=[],this._virtualScenes=new Array,this.onBeforeTextureInitObservable=new Oe,this.renderEvenInBackground=!0,this.preventCacheWipeBetweenFrames=!1,this._frameHandler=0,this._activeRenderLoops=new Array,this.customAnimationFrameRequester=null,this._windowIsBackground=!1,this._boundRenderFunction=o=>this._renderLoop(o),this._lastFrameTime=0,this._renderAccumulator=0,this.skipFrameRender=!1,this.onBeforeShaderCompilationObservable=new Oe,this.onAfterShaderCompilationObservable=new Oe,this.onBeginFrameObservable=new Oe,this.onEndFrameObservable=new Oe,this._transformTextureUrl=null,this._uniformBuffers=new Array,this._storageBuffers=new Array,this._highPrecisionShadersAllowed=!0,this.onContextLostObservable=new Oe,this.onContextRestoredObservable=new Oe,this._name="",this.premultipliedAlpha=!0,this.adaptToDeviceRatio=!1,this._lastDevicePixelRatio=1,this._doNotHandleContextLost=!1,this.cullBackFaces=null,this._renderPassNames=["main"],this._fps=60,this._deltaTime=0,this._deterministicLockstep=!1,this._lockstepMaxSteps=4,this._timeStep=1/60,this.onDisposeObservable=new Oe,this.onReleaseEffectsObservable=new Oe,vt.Instances.push(this),this.startTime=Gs.Now,this._stencilStateComposer.stencilGlobal=this._stencilState,Wi.SetMatrixPrecision(!!t.useLargeWorldRendering||!!t.useHighPrecisionMatrix),_l()&&navigator.userAgent&&(this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent),this._badDesktopOS=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),t.antialias=e??t.antialias,t.deterministicLockstep=t.deterministicLockstep??!1,t.lockstepMaxSteps=t.lockstepMaxSteps??4,t.timeStep=t.timeStep??1/60,t.stencil=t.stencil??!0,this._audioContext=t.audioEngineOptions?.audioContext??null,this._audioDestination=t.audioEngineOptions?.audioDestination??null,this.premultipliedAlpha=t.premultipliedAlpha??!0,this._doNotHandleContextLost=!!t.doNotHandleContextLost,this._isStencilEnable=!!t.stencil,this.useExactSrgbConversions=t.useExactSrgbConversions??!1,this.canvasTabIndex=t.canvasTabIndex??this.canvasTabIndex;const s=is()&&window.devicePixelRatio||1,n=t.limitDeviceRatio||s;i=i||t.adaptToDeviceRatio||!1,this.adaptToDeviceRatio=i,this._hardwareScalingLevel=i?1/Math.min(n,s):1,this._lastDevicePixelRatio=s,this._creationOptions=t}resize(e=!1){let t,i;if(this.adaptToDeviceRatio){const s=is()&&window.devicePixelRatio||1,n=this._lastDevicePixelRatio/s;this._lastDevicePixelRatio=s,this._hardwareScalingLevel*=n}if(is()&&co())if(this._renderingCanvas){const s=this._renderingCanvas.getBoundingClientRect?.();t=this._renderingCanvas.clientWidth||s?.width||this._renderingCanvas.width*this._hardwareScalingLevel||100,i=this._renderingCanvas.clientHeight||s?.height||this._renderingCanvas.height*this._hardwareScalingLevel||100}else t=window.innerWidth,i=window.innerHeight;else t=this._renderingCanvas?this._renderingCanvas.width:100,i=this._renderingCanvas?this._renderingCanvas.height:100;this.setSize(t/this._hardwareScalingLevel,i/this._hardwareScalingLevel,e)}setSize(e,t,i=!1){if(!this._renderingCanvas||(e=e|0,t=t|0,!i&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t))return!1;if(this._renderingCanvas.width=e,this._renderingCanvas.height=t,this.scenes){for(let s=0;s<this.scenes.length;s++){const n=this.scenes[s];for(let o=0;o<n.cameras.length;o++){const c=n.cameras[o];c._currentRenderId=0}}this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this)}return!0}createRawTexture(e,t,i,s,n,o,c,h,f,_,d,g){throw at("engine.rawTexture")}createRawCubeTexture(e,t,i,s,n,o,c,h){throw at("engine.rawTexture")}createRawTexture3D(e,t,i,s,n,o,c,h,f,_,d){throw at("engine.rawTexture")}createRawTexture2DArray(e,t,i,s,n,o,c,h,f,_,d,g){throw at("engine.rawTexture")}_sharedInit(e){this._renderingCanvas=e}_setupMobileChecks(){navigator&&navigator.userAgent&&(this._checkForMobile=()=>{const e=navigator.userAgent;this.hostInformation.isMobile=e.indexOf("Mobile")!==-1||e.indexOf("Mac")!==-1&&co()&&"ontouchend"in document},this._checkForMobile(),is()&&window.addEventListener("resize",this._checkForMobile))}createVideoElement(e){return document.createElement("video")}_reportDrawCall(e=1){this._drawCalls?.addCount(e,!1)}getFps(){return this._fps}
177getDeltaTime(){return this._deltaTime}isDeterministicLockStep(){return this._deterministicLockstep}getLockstepMaxSteps(){return this._lockstepMaxSteps}getTimeStep(){return this._timeStep*1e3}_createImageBitmapFromSource(e,t){throw new Error("createImageBitmapFromSource is not implemented")}createImageBitmap(e,t){return createImageBitmap(e,t)}resizeImageBitmap(e,t,i){throw new Error("resizeImageBitmap is not implemented")}getFontOffset(e){throw new Error("getFontOffset is not implemented")}static _CreateCanvas(e,t){if(typeof document>"u")return new OffscreenCanvas(e,t);const i=document.createElement("canvas");return i.width=e,i.height=t,i}createCanvas(e,t){return Be._CreateCanvas(e,t)}static _FileToolsLoadImage(e,t,i,s,n,o,c){if(!ao.loadImage)throw at("FileTools");return ao.loadImage(e,t,i,s,n,o,c)}_loadFile(e,t,i,s,n,o){const c=Nv(e,t,i,s,n,o);return this._activeRequests.push(c),c.onCompleteObservable.add(()=>{const h=this._activeRequests.indexOf(c);h!==-1&&this._activeRequests.splice(h,1)}),c}static _FileToolsLoadFile(e,t,i,s,n,o){if(ao.loadFile)return ao.loadFile(e,t,i,s,n,o);throw at("FileTools")}dispose(){for(this.releaseEffects(),this._isDisposed=!0,this.stopRenderLoop(),this._emptyTexture&&(this._releaseTexture(this._emptyTexture),this._emptyTexture=null),this._emptyCubeTexture&&(this._releaseTexture(this._emptyCubeTexture),this._emptyCubeTexture=null),this._renderingCanvas=null,this.onBeforeTextureInitObservable&&this.onBeforeTextureInitObservable.clear();this.postProcesses.length;)this.postProcesses[0].dispose();for(;this.scenes.length;)this.scenes[0].dispose();for(;this._virtualScenes.length;)this._virtualScenes[0].dispose();this.releaseComputeEffects?.(),Li.ResetCache();for(const t of this._activeRequests)t.abort();this._boundRenderFunction=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onResizeObservable.clear(),this.onCanvasBlurObservable.clear(),this.onCanvasFocusObservable.clear(),this.onCanvasPointerOutObservable.clear(),this.onNewSceneAddedObservable.clear(),this.onEffectErrorObservable.clear(),is()&&window.removeEventListener("resize",this._checkForMobile);const e=vt.Instances.indexOf(this);e>=0&&vt.Instances.splice(e,1),vt.Instances.length||(vt.OnEnginesDisposedObservable.notifyObservers(this),vt.OnEnginesDisposedObservable.clear()),this.onBeginFrameObservable.clear(),this.onEndFrameObservable.clear()}static DefaultLoadingScreenFactory(e){throw at("LoadingScreen")}static MarkAllMaterialsAsDirty(e,t){for(let i=0;i<vt.Instances.length;i++){const s=vt.Instances[i];for(let n=0;n<s.scenes.length;n++)s.scenes[n].markAllMaterialsAsDirty(e,t)}}static GetCompatibleTextureLoader(e,t){return null}}Be._RenderPassIdCounter=0;Be._RescalePostProcessFactory=null;Be.CollisionsEpsilon=.001;Be.QueueNewFrame=Wv;function Xv(r){return r.getPipelineContext===void 0}class iP{constructor(){this.shaderLanguage=0}postProcessor(e,t,i,s,n){if(n.drawBuffersExtensionDisabled){const o=/#extension.+GL_EXT_draw_buffers.+(enable|require)/g;e=e.replace(o,"")}return e}}const sP=/(flat\s)?\s*varying\s*.*/;class nP{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,t){return sP.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,i){const s=e.search(/#extension.+GL_EXT_draw_buffers.+require/)!==-1,n=/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g;if(e=e.replace(n,""),e=e.replace(/texture2D\s*\(/g,"texture("),i){const o=e.search(/layout *\(location *= *0\) *out/g)!==-1,c=t.indexOf("#define DUAL_SOURCE_BLENDING")!==-1,h=c?`layout(location = 0, index = 0) out vec4 glFragColor;
178layout(location = 0, index = 1) out vec4 glFragColor2;
179`:`layout(location = 0) out vec4 glFragColor;
180`;c&&(e=`#extension GL_EXT_blend_func_extended : require
181`+e),e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCubeLodEXT\s*\(/g,"textureLod("),e=e.replace(/textureCube\s*\(/g,"texture("),e=e.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),e=e.replace(/gl_FragColor/g,"glFragColor"),e=e.replace(/gl_FragData/g,"glFragData"),e=e.replace(/void\s+?main\s*\(/g,(s||o?"":h)+"void main(")}else if(t.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0&&(e=`invariant gl_Position;
182`+e),t.indexOf("#define MULTIVIEW")!==-1)return`#extension GL_OVR_multiview2 : require
183layout (num_views = 2) in;
184`+e;return e}}class xh{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=xh._Counter++}}xh._Counter=0;class ah extends xh{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}function Af(r){let e=1;do e*=2;while(e<r);return e===r}function yx(r,e,t){return r*(1-t)+e*t}function rP(r){const e=Yv(r),t=jv(r);return e-r>r-t?t:e}function Yv(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}function jv(r){return r=r|r>>1,r=r|r>>2,r=r|r>>4,r=r|r>>8,r=r|r>>16,r-(r>>1)}function Um(r,e,t=2){let i;switch(t){case 1:i=jv(r);break;case 2:i=rP(r);break;case 3:default:i=Yv(r);break}return Math.min(i,e)}class km{get underlyingResource(){return this._webGLTexture}constructor(e=null,t){if(this._MSAARenderBuffers=null,this._context=t,!e&&(e=t.createTexture(),!e))throw new Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){this._webGLTexture=e}reset(){this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){if(this._MSAARenderBuffers){for(const e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){return this._MSAARenderBuffers?.[e]??null}release(){this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}function bx(r){return r===13||r===14||r===15||r===16||r===17||r===18||r===19}function oh(r){return r===13||r===17||r===18||r===19}class aP{}class _t extends Be{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return Li.ShadersRepository}static set ShadersRepository(e){Li.ShadersRepository=e}get supportsUniformBuffers(){return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,i,s){if(i=i||{},super(t??i.antialias,i,s),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=new Array,this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=new Array,this._currentInstanceLocations=new Array,this._currentInstanceBuffers=new Array,this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=new Array,this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;let n;if(e.getContext){if(n=e,i.preserveDrawingBuffer===void 0&&(i.preserveDrawingBuffer=!1),i.xrCompatible===void 0&&(i.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const h=navigator.userAgent;for(const f of _t.ExceptionList){const _=f.key,d=f.targets;if(new RegExp(_).test(h)){if(f.capture&&f.captureConstraint){const p=f.capture,b=f.captureConstraint,E=new RegExp(p).exec(h);if(E&&E.length>0&&parseInt(E[E.length-1])>=b)continue}for(const p of d)switch(p){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":i.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1;break}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{um(this._gl)}:(this._onContextLost=h=>{h.preventDefault(),this._contextWasLost=!0,um(this._gl),Ee.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},n.addEventListener("webglcontextrestored",this._onContextRestored,!1),i.powerPreference=i.powerPreference||"high-performance"),n.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(i.xrCompatible=!1),!i.disableWebGL2Support)try{this._gl=n.getContext("webgl2",i)||n.getContext("experimental-webgl2",i),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch{}if(!this._gl){if(!n)throw new Error("The provided canvas is null or undefined.");try{this._gl=n.getContext("webgl",i)||n.getContext("experimental-webgl",i)}catch(h){throw new Error("WebGL not supported",{cause:h})}}if(!this._gl)throw new Error("WebGL not supported")}else{this._gl=e,n=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const h=this._gl.getContextAttributes();h&&(i.stencil=h.stencil)}this._sharedInit(n),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),i.useHighPrecisionFloats!==void 0&&(this._highPrecisionShadersAllowed=i.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let h=0;h<this._caps.maxVertexAttribs;h++)this._currentBufferPointers[h]=new aP;this._shaderProcessor=this.webGLVersion>1?new nP:new iP;const o=`Babylon.js v${_t.Version}`;Ee.Log(o+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",o);const c=Vs(this._gl);c.validateShaderPrograms=this.validateShaderPrograms,c.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}
vendor: 8,888 bytes, line 184
184areAllEffectsReady(){for(const e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),shaderFloatPrecision:0,parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||this._gl.getExtension("OES_standard_derivatives")!==null,maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||this._gl.getExtension("OES_element_index_uint")!==null,fragmentDepthSupported:this._webGLVersion>1||this._gl.getExtension("EXT_frag_depth")!==null,highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),blendFloat:this._gl.getExtension("EXT_float_blend")!==null,supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:this._webGLVersion!==1,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16"),blendParametersPerTarget:!1,dualSourceBlending:!1,supportReadWriteStorageTextures:!1},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);const e=this._gl.getExtension("WEBGL_debug_renderer_info");e!=null&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),this._gl.HALF_FLOAT_OES!==36193&&(this._gl.HALF_FLOAT_OES=36193),this._gl.RGBA16F!==34842&&(this._gl.RGBA16F=34842),this._gl.RGBA32F!==34836&&(this._gl.RGBA32F=34836),this._gl.DEPTH24_STENCIL8!==35056&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(this._webGLVersion===1&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)??0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763);const t=this._gl.getExtension("OES_draw_buffers_indexed");if(this._caps.blendParametersPerTarget=!!t,this._alphaState=new Hv(this._caps.blendParametersPerTarget),t&&(this._gl.blendEquationSeparateIndexed=t.blendEquationSeparateiOES.bind(t),this._gl.blendEquationIndexed=t.blendEquationiOES.bind(t),this._gl.blendFuncSeparateIndexed=t.blendFuncSeparateiOES.bind(t),this._gl.blendFuncIndexed=t.blendFunciOES.bind(t),this._gl.colorMaskIndexed=t.colorMaskiOES.bind(t),this._gl.disableIndexed=t.disableiOES.bind(t),this._gl.enableIndexed=t.enableiOES.bind(t)),this._caps.dualSourceBlending=!!this._gl.getExtension("WEBGL_blend_func_extended"),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&this._gl.HALF_FLOAT_OES!==5131&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRen
184der=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=this._maxMSAASamplesOverride!==null?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{const i=this._gl.getExtension("WEBGL_draw_buffers");if(i!==null){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=i.drawBuffersWEBGL.bind(i),this._caps.maxDrawBuffers=this._gl.getParameter(i.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let s=0;s<16;s++)this._gl["COLOR_ATTACHMENT"+s+"_WEBGL"]=i["COLOR_ATTACHMENT"+s+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{const i=this._gl.getExtension("WEBGL_depth_texture");i!=null&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=i.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{const i=this._gl.getExtension("OES_vertex_array_object");i!=null&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=i.createVertexArrayOES.bind(i),this._gl.bindVertexArray=i.bindVertexArrayOES.bind(i),this._gl.deleteVertexArray=i.deleteVertexArrayOES.bind(i))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{const i=this._gl.getExtension("ANGLE_instanced_arrays");i!=null?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=i.drawArraysInstancedANGLE.bind(i),this._gl.drawElementsInstanced=i.drawElementsInstancedANGLE.bind(i),this._gl.vertexAttribDivisor=i.vertexAttribDivisorANGLE.bind(i)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){const i=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),s=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);if(i&&s&&(this._caps.highPrecisionShaderSupported=i.precision!==0&&s.precision!==0,this._caps.shaderFloatPrecision=Math.min(i.precision,s.precision)),!this._shouldUseHighPrecisionShader){const n=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.MEDIUM_FLOAT),o=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.MEDIUM_FLOAT);n&&o&&(this._caps.shaderFloatPrecision=Math.min(n.precision,o.precision))}this._caps.shaderFloatPrecision<10&&(this._caps.shaderFloatPrecision=10)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{const i=this._gl.getExtension("EXT_blend_minmax");i!=null&&(this._caps.blendMinMax=!0,this._gl.MAX=i.MAX_EXT,this._gl.MIN=i.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{const i=this._gl.getExtension("EXT_sRGB");i!=null&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:i.SRGB_EXT,SRGB8:i.SRGB_ALPHA_EXT,SRGB8_ALPHA8:i.SRGB_ALPHA_EXT})}if(this._creationOptions){const i=this._creationOptions.forceSRGBBufferSupportState;i!==void 0&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&i)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let i=0;i<this._maxSimultaneousTextures;i++)this._nextFreeTextureSlots.push(i);this._glRenderer==="Mali-G72"&&(this._caps.disableMorphTargetTexture=!0)}_initFeatures(){this._features={forceBitmapOverHTMLImageElement:typeof HTMLImageElement>"u",supportRenderAndCopyToLodForFloatTextures:this._webGLVersion!==1,supportDepthStencilTexture:this._webGLVersion!==1,supportShadowSamplers:this._webGLVersion!==1,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:this._webGLVersion!==1,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:this._webGLVersion!==1,basisNeedsPOT:this._webGLVersion===1,support3DTextures:this._webGLVersion!==1,needTypeSuffixInShaderConstants:this._webGLVersion!==1,supportMSAA:this._webGLVersion!==1,supportSSAO2:this._webGLVersion!==1,supportIBLShadows:this._webGLVersion!==1,supportExtendedTextureFormats:this._webGLVersion!==1,supportSwitchCaseInSha
vendor: 49,055 bytes, line 184
184der:this._webGLVersion!==1,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);const e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){const e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,i,s=!1,n=0){const o=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=o;let c=0;if(t&&e){let h=!0;if(this._currentRenderTarget){const f=this._currentRenderTarget.texture?.format;if(f===8||f===9||f===10||f===11){const _=this._currentRenderTarget.texture?.type;_===7||_===5?(_t._TempClearColorUint32[0]=e.r*255,_t._TempClearColorUint32[1]=e.g*255,_t._TempClearColorUint32[2]=e.b*255,_t._TempClearColorUint32[3]=e.a*255,this._gl.clearBufferuiv(this._gl.COLOR,0,_t._TempClearColorUint32),h=!1):(_t._TempClearColorInt32[0]=e.r*255,_t._TempClearColorInt32[1]=e.g*255,_t._TempClearColorInt32[2]=e.b*255,_t._TempClearColorInt32[3]=e.a*255,this._gl.clearBufferiv(this._gl.COLOR,0,_t._TempClearColorInt32),h=!1)}}h&&(this._gl.clearColor(e.r,e.g,e.b,e.a!==void 0?e.a:1),c|=this._gl.COLOR_BUFFER_BIT)}i&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),c|=this._gl.DEPTH_BUFFER_BIT),s&&(this._gl.clearStencil(n),c|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(c)}_viewport(e,t,i,s){(e!==this._viewportCached.x||t!==this._viewportCached.y||i!==this._viewportCached.z||s!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=s,this._gl.viewport(e,t,i,s))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw new Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,i,s,n,o=0,c=0){const h=e;this._currentRenderTarget&&this._resolveAndGenerateMipMapsFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(h._framebuffer);const f=this._gl;e.isMulti||(e.is2DArray||e.is3D?(f.framebufferTextureLayer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,e.texture._hardwareTexture?.underlyingResource,o,c),h._currentLOD=o):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,o):h._currentLOD!==o&&(f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,o),h._currentLOD=o));const _=e._depthStencilTexture;if(_){e.is3D&&(e.texture.width!==_.width||e.texture.height!==_.height||e.texture.depth!==_.depth)&&Ee.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");const d=e._depthStencilTextureWithStencil?f.DEPTH_STENCIL_ATTACHMENT:f.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?f.framebufferTextureLayer(f.FRAMEBUFFER,d,_._hardwareTexture?.underlyingResource,o,c):e.isCube?f.framebufferTexture2D(f.FRAMEBUFFER,d,f.TEXTURE_CUBE_MAP_POSITIVE_X+t,_._hardwareTexture?.underlyingResource,o):f.framebufferTexture2D(f.FRAMEBUFFER,d,f.TEXTURE_2D,_._hardwareTexture?.underlyingResource,o)}h._MSAAFramebuffer&&this._bindUnboundFramebuffer(h._MSAAFramebuffer),this._cachedViewport&&!n?this.setViewport(this._cachedViewport,i,s):(i||(i=e.width,o&&(i=i/Math.pow(2,o))),s||(s=e.height,o&&(s=s/Math.pow(2,o))),this._viewport(0,0,i,s)),this.wipeCaches()}setStateCullFaceType(e,t){const i=this.cullBackFaces??e??!0?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==i||t)&&(this._depthCullingState.cullFace=i)}setState(e,t=0,i,s=!1,n,o,c=0){(this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(n,i),this.setZOffset(t),this.setZOffsetUnits(c);const h=s?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==h||i)&&(this._depthCullingState.frontFace=h),this._stencilStateComposer.stencilMaterial=o}_resolveAndGenerateMipMapsFramebuffer(e,t=!1){e.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e))}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return this._currentFramebuffer===null}generateMipmaps(e){const t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t,i){const s=e;this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),i&&(s._MSAAFramebuffer&&this._bindUnboundFramebuffer(s._framebuffer),i()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){!e.isMulti&&e.texture?.generateMipMaps&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){const t=e,i=this._gl;if(!t._MSAAFramebuffer||t.isMulti)return;let s=t.resolveMSAAColors?i.COLOR_BUFFER_BIT:0;s|=t._generateDepthBuffer&&t.resolveMSAADepth?i.DEPTH_BUFFER_BIT:0,s|=t._generateStencilBuffer&&t.resolveMSAAStencil?i.STENCIL_BUFFER_BIT:0,i.bindFramebuffer(i.READ_FRAMEBUFFER,t._MSAAFramebuffer),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,t._framebuffer),i.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,s,i.NEAREST)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,i){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){const i=this._gl.createBuffer();if(!i)throw new Error("Unable to create vertex buffer");const s=new ah(i);return this.bindArrayBuffer(s),typeof e!="number"?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),s.capacity=e.length*4):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),s.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),s.capacity=e),this._resetVertexBufferBinding(),s.references=1,s}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,i){const s=this._gl.createBuffer(),n=new ah(s);if(!s)throw new Error("Unable to create index buffer");this.bindIndexBuffer(n);const o=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,o,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),n.references=1,n.is32Bits=o.BYTES_PER_ELEMENT===4,n}_normalizeIndexData(e){if(e.BYTES_PER_ELEMENT===2)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(let i=0;i<e.length;i++)if(e[i]>=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,i){const s=e.program,n=this._gl.getUniformBlockIndex(s,t);this._gl.uniformBlockBinding(s,n,i)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,i,s,n,o,c){const h=this._currentBufferPointers[t];if(!h)return;let f=!1;h.active?(h.buffer!==e&&(h.buffer=e,f=!0),h.size!==i&&(h.size=i,f=!0),h.type!==s&&(h.type=s,f=!0),h.normalized!==n&&(h.normalized=n,f=!0),h.stride!==o&&(h.stride=o,f=!0),h.offset!==c&&(h.offset=c,f=!0)):(f=!0,h.active=!0,h.index=t,h.size=i,h.type=s,h.normalized=n,h.stride=o,h.offset=c,h.buffer=e),(f||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),s===this._gl.UNSIGNED_INT||s===this._gl.INT?this._gl.vertexAttribIPointer(t,i,s,o,c):this._gl.vertexAttribPointer(t,i,s,n,o,c))}_bindIndexBufferWithCache(e){e!=null&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,i){const s=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let n=0;n<s.length;n++){const o=t.getAttributeLocation(n);if(o>=0){const c=s[n];let h=null;if(i&&(h=i[c]),h||(h=e[c]),!h)continue;this._gl.enableVertexAttribArray(o),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[o]=!0);const f=h.getBuffer();f&&(this._vertexAttribPointer(f,o,h.getSize(),h.type,h.normalized,h.byteStride,h.byteOffset),h.getIsInstanced()&&(this._gl.vertexAttribDivisor(o,h.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(o),this._currentInstanceBuffers.push(f))))}}}recordVertexArrayObject(e,t,i,s){const n=this._gl.createVertexArray();if(!n)throw new Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(n),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i,s),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),n}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=t!=null&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,i,s,n){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==n){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=n;const o=n.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let c=0;for(let h=0;h<o;h++)if(h<i.length){const f=n.getAttributeLocation(h);f>=0&&(this._gl.enableVertexAttribArray(f),this._vertexAttribArraysEnabled[f]=!0,this._vertexAttribPointer(e,f,i[h],this._gl.FLOAT,!1,s,c)),c+=i[h]*4}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,i,s){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==i)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i,s)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,i=this._currentInstanceLocations.length;t<i;t++){const s=this._currentInstanceBuffers[t];e!=s&&s.references&&(e=s,this.bindArrayBuffer(s));const n=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(n,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0}releaseVertexArrayObject(e){this._gl.deleteVertexArray(e)}_releaseBuffer(e){return e.references--,e.references===0?(this._deleteBuffer(e),!0):!1}_deleteBuffer(e){this._gl.deleteBuffer(e.underlyingResource)}updateAndBindInstancesBuffer(e,t,i){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),i[0].index!==void 0)this.bindInstancesBuffer(e,i,!0);else for(let s=0;s<4;s++){const n=i[s];this._vertexAttribArraysEnabled[n]||(this._gl.enableVertexAttribArray(n),this._vertexAttribArraysEnabled[n]=!0),this._vertexAttribPointer(e,n,4,this._gl.FLOAT,!1,64,s*16),this._gl.vertexAttribDivisor(n,1),this._currentInstanceLocations.push(n),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,i=!0){this.bindArrayBuffer(e);let s=0;if(i)for(let n=0;n<t.length;n++){const o=t[n];s+=o.attributeSize*4}for(let n=0;n<t.length;n++){const o=t[n];o.index===void 0&&(o.index=this._currentEffect.getAttributeLocationByName(o.attributeName)),!(o.index<0)&&(this._vertexAttribArraysEnabled[o.index]||(this._gl.enableVertexAttribArray(o.index),this._vertexAttribArraysEnabled[o.index]=!0),this._vertexAttribPointer(e,o.index,o.attributeSize,o.attributeType||this._gl.FLOAT,o.normalized||!1,s,o.offset),this._gl.vertexAttribDivisor(o.index,o.divisor===void 0?1:o.divisor),this._currentInstanceLocations.push(o.index),this._currentInstanceBuffers.push(e))}}disableInstanceAttributeByName(e){if(!this._currentEffect)return;const t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}disableInstanceAttribute(e){let t=!1,i;for(;(i=this._currentInstanceLocations.indexOf(e))!==-1;)this._currentInstanceLocations.splice(i,1),this._currentInstanceBuffers.splice(i,1),t=!0;t&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))}disableAttributeByIndex(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}draw(e,t,i,s){this.drawElementsType(e?0:1,t,i,s)}drawPointClouds(e,t,i){this.drawArraysType(2,e,t,i)}drawUnIndexed(e,t,i,s){this.drawArraysType(e?0:1,t,i,s)}drawElementsType(e,t,i,s){this.applyStates(),this._reportDrawCall();const n=this._drawMode(e),o=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,c=this._uintIndicesCurrentlySet?4:2;s?this._gl.drawElementsInstanced(n,i,o,t*c,s):this._gl.drawElements(n,i,o,t*c)}drawArraysType(e,t,i,s){this.applyStates(),this._reportDrawCall();const n=this._drawMode(e);s?this._gl.drawArraysInstanced(n,t,i,s):this._gl.drawArrays(n,t,i)}_drawMode(e){switch(e){case 0:return this._gl.TRIANGLES;case 2:return this._gl.POINTS;case 1:return this._gl.LINES;case 3:return this._gl.POINTS;case 4:return this._gl.LINES;case 5:return this._gl.LINE_LOOP;case 6:return this._gl.LINE_STRIP;case 7:return this._gl.TRIANGLE_STRIP;case 8:return this._gl.TRIANGLE_FAN;default:return this._gl.TRIANGLES}}_releaseEffect(e){this._compiledEffects[e._key]&&delete this._compiledEffects[e._key];const t=e.getPipelineContext();t&&this._deletePipelineContext(t)}_deletePipelineContext(e){const t=e;t&&t.program&&(t.program.__SPECTOR_rebuildProgram=null,Gv(t),this._gl&&(this._currentProgram===t.program&&this._setProgram(null),this._gl.deleteProgram(t.program)))}_getGlobalDefines(e){return Uv(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,i,s,n,o,c,h,f,_=0,d){const g=typeof e=="string"?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,p=typeof e=="string"?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,b=this._getGlobalDefines(),x=t.attributes!==void 0;let E=n??t.defines??"";b&&(E+=b);const v=g+"+"+p+"@"+E;if(this._compiledEffects[v]){const R=this._compiledEffects[v];return c&&R.isReady()&&c(R),R._refCount++,R}this._gl&&Vs(this._gl);const S=new Li(e,t,x?this:i,s,this,n,o,c,h,f,v,t.shaderLanguage??_,t.extraInitializationsAsync??d);return this._compiledEffects[v]=S,S}_getShaderSource(e){return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,i,s,n=null){const o=Vs(this._gl);return o._contextWasLost=this._contextWasLost,o.validateShaderPrograms=this.validateShaderPrograms,kv(e,t,i,s||this._gl,n)}createShaderProgram(e,t,i,s,n,o=null){const c=Vs(this._gl);return c._contextWasLost=this._contextWasLost,c.validateShaderPrograms=this.validateShaderPrograms,zv(e,t,i,s,n||this._gl,o)}inlineShaderCode(e){return e}createPipelineContext(e){if(this._gl){const i=Vs(this._gl);i.parallelShaderCompile=this._caps.parallelShaderCompile}const t=MD(this._gl);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){return hg(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,i,s,n,o,c,h,f,_,d){const g=Vs(this._gl);return g._contextWasLost=this._contextWasLost,g.validateShaderPrograms=this.validateShaderPrograms,g._createShaderProgramInjection=this._createShaderProgram.bind(this),g.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),g.createShaderProgramInjection=this.createShaderProgram.bind(this),g.loadFileInjection=this._loadFile.bind(this),ID(e,t,i,s,n,o,c,h,f,_,d)}_createShaderProgram(e,t,i,s,n=null){return cg(e,t,i,s,n)}_isRenderingStateCompiled(e){return this._isDisposed?!1:CD(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){PD(e,t)}getUniforms(e,t){const i=new Array,s=e;for(let n=0;n<t.length;n++)i.push(this._gl.getUniformLocation(s.program,t[n]));return i}getAttributes(e,t){const i=[],s=e;for(let n=0;n<t.length;n++)try{i.push(this._gl.getAttribLocation(s.program,t[n]))}catch{i.push(-1)}return i}enableEffect(e){e=e!==null&&Xv(e)?e.effect:e,!(!e||e===this._currentEffect)&&(this._stencilStateComposer.stencilMaterial=void 0,this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setInt(e,t){return e?(this._gl.uniform1i(e,t),!0):!1}setInt2(e,t,i){return e?(this._gl.uniform2i(e,t,i),!0):!1}setInt3(e,t,i,s){return e?(this._gl.uniform3i(e,t,i,s),!0):!1}setInt4(e,t,i,s,n){return e?(this._gl.uniform4i(e,t,i,s,n),!0):!1}setIntArray(e,t){return e?(this._gl.uniform1iv(e,t),!0):!1}setIntArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2iv(e,t),!0)}setIntArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3iv(e,t),!0)}setIntArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4iv(e,t),!0)}setUInt(e,t){return e?(this._gl.uniform1ui(e,t),!0):!1}setUInt2(e,t,i){return e?(this._gl.uniform2ui(e,t,i),!0):!1}setUInt3(e,t,i,s){return e?(this._gl.uniform3ui(e,t,i,s),!0):!1}setUInt4(e,t,i,s,n){return e?(this._gl.uniform4ui(e,t,i,s,n),!0):!1}setUIntArray(e,t){return e?(this._gl.uniform1uiv(e,t),!0):!1}setUIntArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2uiv(e,t),!0)}setUIntArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3uiv(e,t),!0)}setUIntArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4uiv(e,t),!0)}setArray(e,t){return!e||t.length<1?!1:(this._gl.uniform1fv(e,t),!0)}setArray2(e,t){return!e||t.length%2!==0?!1:(this._gl.uniform2fv(e,t),!0)}setArray3(e,t){return!e||t.length%3!==0?!1:(this._gl.uniform3fv(e,t),!0)}setArray4(e,t){return!e||t.length%4!==0?!1:(this._gl.uniform4fv(e,t),!0)}setMatrices(e,t){return e?(this._gl.uniformMatrix4fv(e,!1,t),!0):!1}setMatrix3x3(e,t){return e?(this._gl.uniformMatrix3fv(e,!1,t),!0):!1}setMatrix2x2(e,t){return e?(this._gl.uniformMatrix2fv(e,!1,t),!0):!1}setFloat(e,t){return e?(this._gl.uniform1f(e,t),!0):!1}setFloat2(e,t,i){return e?(this._gl.uniform2f(e,t,i),!0):!1}setFloat3(e,t,i,s){return e?(this._gl.uniform3f(e,t,i,s),!0):!1}setFloat4(e,t,i,s,n){return e?(this._gl.uniform4f(e,t,i,s,n),!0):!1}applyStates(){if(this._depthCullingState.apply(this._gl),this._stencilStateComposer.apply(this._gl),this._alphaState.apply(this._gl,this._currentRenderTarget&&this._currentRenderTarget.textures?this._currentRenderTarget.textures.length:1),this._colorWriteChanged){this._colorWriteChanged=!1;const e=this._colorWrite;this._gl.colorMask(e,e,e,e)}}wipeCaches(e){this.preventCacheWipeBetweenFrames&&!e||(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._resetAlphaMode(),this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))}_getSamplingParameters(e,t){const i=this._gl;let s=i.NEAREST,n=i.NEAREST,o=!1;switch(e){case 11:s=i.LINEAR,t?n=i.LINEAR_MIPMAP_NEAREST:n=i.LINEAR;break;case 3:s=i.LINEAR,o=!0,t?n=i.LINEAR_MIPMAP_LINEAR:n=i.LINEAR;break;case 8:o=!0,s=i.NEAREST,t?n=i.NEAREST_MIPMAP_LINEAR:n=i.NEAREST;break;case 4:s=i.NEAREST,t?n=i.NEAREST_MIPMAP_NEAREST:n=i.NEAREST;break;case 5:s=i.NEAREST,t?n=i.LINEAR_MIPMAP_NEAREST:n=i.LINEAR;break;case 6:o=!0,s=i.NEAREST,t?n=i.LINEAR_MIPMAP_LINEAR:n=i.LINEAR;break;case 7:s=i.NEAREST,n=i.LINEAR;break;case 1:s=i.NEAREST,n=i.NEAREST;break;case 9:s=i.LINEAR,t?n=i.NEAREST_MIPMAP_NEAREST:n=i.NEAREST;break;case 10:o=!0,s=i.LINEAR,t?n=i.NEAREST_MIPMAP_LINEAR:n=i.NEAREST;break;case 2:s=i.LINEAR,n=i.LINEAR;break;case 12:s=i.LINEAR,n=i.NEAREST;break}return{min:n,mag:s,hasMipMaps:o}}_createTexture(){const e=this._gl.createTexture();if(!e)throw new Error("Unable to create texture");return e}_createHardwareTexture(){return new km(this._createTexture(),this._gl)}_createInternalTexture(e,t,i=!0,s=0){let n,o=!1,c=0,h=3,f=5,_=!1,d=1,g,p=!1,b=0,x=!1;t!==void 0&&typeof t=="object"?(n=!!t.generateMipMaps,o=!!t.createMipMaps,c=t.type===void 0?0:t.type,h=t.samplingMode===void 0?3:t.samplingMode,f=t.format===void 0?5:t.format,_=t.useSRGBBuffer===void 0?!1:t.useSRGBBuffer,d=t.samples??1,g=t.label,p=!!t.createMSAATexture,b=t.comparisonFunction||0,x=!!t.isCube):n=!!t,_&&(_=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(c===1&&!this._caps.textureFloatLinearFiltering||c===2&&!this._caps.textureHalfFloatLinearFiltering)&&(h=1),c===1&&!this._caps.textureFloat&&(c=0,Ee.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));const E=bx(f),v=oh(f),S=this._gl,R=new ws(this,s),P=e.width||e,M=e.height||e,O=e.depth||0,D=e.layers||0,w=this._getSamplingParameters(h,(n||o)&&!E),G=D!==0?S.TEXTURE_2D_ARRAY:O!==0?S.TEXTURE_3D:x?S.TEXTURE_CUBE_MAP:S.TEXTURE_2D,H=E?this._getInternalFormatFromDepthTextureFormat(f,!0,v):this._getRGBABufferInternalSizedFormat(c,f,_),ie=E?v?S.DEPTH_STENCIL:S.DEPTH_COMPONENT:this._getInternalFormat(f),ne=E?this._getWebGLTextureTypeFromDepthTextureFormat(f):this._getWebGLTextureType(c);if(this._bindTextureDirectly(G,R),D!==0)R.is2DArray=!0,S.texImage3D(G,0,H,P,M,D,0,ie,ne,null);else if(O!==0)R.is3D=!0,S.texImage3D(G,0,H,P,M,O,0,ie,ne,null);else if(x){R.isCube=!0;for(let ce=0;ce<6;ce++)S.texImage2D(S.TEXTURE_CUBE_MAP_POSITIVE_X+ce,0,H,P,M,0,ie,ne,null)}else S.texImage2D(G,0,H,P,M,0,ie,ne,null);if(S.texParameteri(G,S.TEXTURE_MAG_FILTER,w.mag),S.texParameteri(G,S.TEXTURE_MIN_FILTER,w.min),S.texParameteri(G,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(G,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),E&&this.webGLVersion>1&&(b===0?(S.texParameteri(G,S.TEXTURE_COMPARE_FUNC,515),S.texParameteri(G,S.TEXTURE_COMPARE_MODE,S.NONE)):(S.texParameteri(G,S.TEXTURE_COMPARE_FUNC,b),S.texParameteri(G,S.TEXTURE_COMPARE_MODE,S.COMPARE_REF_TO_TEXTURE))),(n||o)&&this._gl.generateMipmap(G),this._bindTextureDirectly(G,null),R._useSRGBBuffer=_,R.baseWidth=P,R.baseHeight=M,R.width=P,R.height=M,R.depth=D||O,R.isReady=!0,R.samples=d,R.generateMipMaps=n,R.samplingMode=h,R.type=c,R.format=f,R.label=g,R.comparisonFunction=b,this._internalTexturesCache.push(R),p){let ce;if(bx(R.format)?ce=this._setupFramebufferDepthAttachments(oh(R.format),R.format!==19,R.width,R.height,d,R.format,!0):ce=this._createRenderBuffer(R.width,R.height,d,-1,this._getRGBABufferInternalSizedFormat(R.type,R.format,R._useSRGBBuffer),-1),!ce)throw new Error("Unable to create render buffer");R._autoMSAAManagement=!0;let k=R._hardwareTexture;k||(k=R._hardwareTexture=this._createHardwareTexture()),k.addMSAARenderBuffer(ce)}return R}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,i,s,n=3,o=null,c=null,h=null,f=null,_=null,d=null,g,p,b,x){return this._createTextureBase(e,t,i,s,n,o,c,(...E)=>this._prepareWebGLTexture(...E,_),(E,v,S,R,P,M)=>{const O=this._gl,D=S.width===E&&S.height===v;P._creationFlags=b??0;const w=this._getTexImageParametersForCreateTexture(P.format,P._useSRGBBuffer);if(D)return O.texImage2D(O.TEXTURE_2D,0,w.internalFormat,w.format,w.type,S),!1;const G=this._caps.maxTextureSize;if(S.width>G||S.height>G||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext||(this._workingCanvas.width=E,this._workingCanvas.height=v,this._workingContext.drawImage(S,0,0,S.width,S.height,0,0,E,v),O.texImage2D(O.TEXTURE_2D,0,w.internalFormat,w.format,w.type,this._workingCanvas),P.width=E,P.height=v),!1;{const H=new ws(this,2);this._bindTextureDirectly(O.TEXTURE_2D,H,!0),O.texImage2D(O.TEXTURE_2D,0,w.internalFormat,w.format,w.type,S),this._rescaleTexture(H,P,s,w.format,()=>{this._releaseTexture(H),this._bindTextureDirectly(O.TEXTURE_2D,P,!0),M()})}return!0},h,f,_,d,g,p,x)}_getTexImageParametersForCreateTexture(e,t){let i,s;return this.webGLVersion===1?(i=this._getInternalFormat(e,t),s=i):(i=this._getInternalFormat(e,!1),s=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:s,format:i,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,i,s,n){}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,i=!1){const s=this._getTextureTarget(t),n=this._getSamplingParameters(e,t.useMipMaps||i);this._setTextureParameterInteger(s,this._gl.TEXTURE_MAG_FILTER,n.mag,t),this._setTextureParameterInteger(s,this._gl.TEXTURE_MIN_FILTER,n.min),i&&n.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(s)),this._bindTextureDirectly(s,null),t.samplingMode=e}updateTextureDimensions(e,t,i,s=1){}updateTextureWrappingMode(e,t,i=null,s=null){const n=this._getTextureTarget(e);t!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),i!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i),e),e._cachedWrapV=i),(e.is2DArray||e.is3D)&&s!==null&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(s),e),e._cachedWrapR=s),this._bindTextureDirectly(n,null)}_uploadCompressedDataToTextureDirectly(e,t,i,s,n,o=0,c=0){const h=this._gl;let f=h.TEXTURE_2D;if(e.isCube&&(f=h.TEXTURE_CUBE_MAP_POSITIVE_X+o),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=h.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=h.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=h.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 37809:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;break;case 37810:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;break;case 37811:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;break;case 37812:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;break;case 37813:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;break;case 37814:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;break;case 37815:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;break;case 37816:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;break;case 37817:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;break;case 37818:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;break;case 37819:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;break;case 37820:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;break;case 37821:t=h.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;break;case 33776:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=h.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1;break}if(e.generateMipMaps){const _=e._hardwareTexture;_.memoryAllocated||(h.texStorage2D(e.isCube?h.TEXTURE_CUBE_MAP:h.TEXTURE_2D,Math.floor(Math.log2(Math.max(i,s)))+1,t,e.width,e.height),_.memoryAllocated=!0),this._gl.compressedTexSubImage2D(f,c,0,0,i,s,t,n)}else this._gl.compressedTexImage2D(f,c,t,i,s,0,n)}_uploadDataToTextureDirectly(e,t,i=0,s=0,n,o=!1){const c=this._gl,h=this._getWebGLTextureType(e.type),f=this._getInternalFormat(e.format),_=n===void 0?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(n,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let d=c.TEXTURE_2D;e.isCube&&(d=c.TEXTURE_CUBE_MAP_POSITIVE_X+i);const g=Math.round(Math.log(e.width)*Math.LOG2E),p=Math.round(Math.log(e.height)*Math.LOG2E),b=o?e.width:Math.pow(2,Math.max(g-s,0)),x=o?e.height:Math.pow(2,Math.max(p-s,0));c.texImage2D(d,s,_,b,x,0,f,h,t)}updateTextureData(e,t,i,s,n,o,c=0,h=0,f=!1){const _=this._gl,d=this._getWebGLTextureType(e.type),g=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let p=_.TEXTURE_2D,b=_.TEXTURE_2D;e.isCube&&(b=_.TEXTURE_CUBE_MAP_POSITIVE_X+c,p=_.TEXTURE_CUBE_MAP),this._bindTextureDirectly(p,e,!0),_.texSubImage2D(b,h,i,s,n,o,g,d,t),f&&this._gl.generateMipmap(b),this._bindTextureDirectly(p,null)}_uploadArrayBufferViewToTexture(e,t,i=0,s=0){const n=this._gl,o=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,i,s),this._bindTextureDirectly(o,null,!0)}_prepareWebGLTextureContinuation(e,t,i,s,n){const o=this._gl;if(!o)return;const c=this._getSamplingParameters(n,!i);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,c.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,c.min),!i&&!s&&o.generateMipmap(o.TEXTURE_2D),this._bindTextureDirectly(o.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,i,s,n,o,c,h,f,_){const d=this.getCaps().maxTextureSize,g=Math.min(d,this.needPOTTextures?Um(s.width,d):s.width),p=Math.min(d,this.needPOTTextures?Um(s.height,d):s.height),b=this._gl;if(b){if(!e._hardwareTexture){i&&i.removePendingData(e);return}this._bindTextureDirectly(b.TEXTURE_2D,e,!0),this._unpackFlipY(n===void 0?!0:!!n),e.baseWidth=s.width,e.baseHeight=s.height,e.width=g,e.height=p,e.isReady=!0,e.type=e.type!==-1?e.type:0,e.format=e.format!==-1?e.format:_??(t===".jpg"&&!e._useSRGBBuffer?4:5),!h(g,p,s,t,e,()=>{this._prepareWebGLTextureContinuation(e,i,o,c,f)})&&this._prepareWebGLTextureContinuation(e,i,o,c,f)}}_getInternalFormatFromDepthTextureFormat(e,t,i){const s=this._gl;if(!t)return s.STENCIL_INDEX8;let o=i?s.DEPTH_STENCIL:s.DEPTH_COMPONENT;return this.webGLVersion>1?e===15?o=s.DEPTH_COMPONENT16:e===16?o=s.DEPTH_COMPONENT24:e===17||e===13?o=i?s.DEPTH24_STENCIL8:s.DEPTH_COMPONENT24:e===14?o=s.DEPTH_COMPONENT32F:e===18&&(o=i?s.DEPTH32F_STENCIL8:s.DEPTH_COMPONENT32F):o=s.DEPTH_COMPONENT16,o}_getWebGLTextureTypeFromDepthTextureFormat(e){const t=this._gl;let i=t.UNSIGNED_INT;return e===15?i=t.UNSIGNED_SHORT:e===17||e===13?i=t.UNSIGNED_INT_24_8:e===14?i=t.FLOAT:e===18?i=t.FLOAT_32_UNSIGNED_INT_24_8_REV:e===19&&(i=t.UNSIGNED_BYTE),i}_setupFramebufferDepthAttachments(e,t,i,s,n=1,o,c=!1){const h=this._gl;o=o??(e?13:14);const f=this._getInternalFormatFromDepthTextureFormat(o,t,e);return e&&t?this._createRenderBuffer(i,s,n,h.DEPTH_STENCIL,f,c?-1:h.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(i,s,n,f,f,c?-1:h.DEPTH_ATTACHMENT):e?this._createRenderBuffer(i,s,n,f,f,c?-1:h.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,i,s,n,o,c=!0){const f=this._gl.createRenderbuffer();return this._updateRenderBuffer(f,e,t,i,s,n,o,c)}_updateRenderBuffer(e,t,i,s,n,o,c,h=!0){const f=this._gl;return f.bindRenderbuffer(f.RENDERBUFFER,e),s>1&&f.renderbufferStorageMultisample?f.renderbufferStorageMultisample(f.RENDERBUFFER,s,o,t,i):f.renderbufferStorage(f.RENDERBUFFER,n,t,i),c!==-1&&f.framebufferRenderbuffer(f.FRAMEBUFFER,c,f.RENDERBUFFER,e),h&&f.bindRenderbuffer(f.RENDERBUFFER,null),e}_releaseTexture(e){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();const t=this._internalTexturesCache.indexOf(e);t!==-1&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e?.release()}_setProgram(e){this._currentProgram!==e&&(DD(e,this._gl),this._currentProgram=e)}bindSamplers(e){const t=e.getPipelineContext();this._setProgram(t.program);const i=e.getSamplers();for(let s=0;s<i.length;s++){const n=e.getUniform(i[s]);n&&(this._boundUniforms[s]=n)}this._currentEffect=null}_activateCurrentTexture(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,i=!1,s=!1){let n=!1;const o=t&&t._associatedChannel>-1;if(i&&o&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||s){if(this._activateCurrentTexture(),t&&t.isMultiview)throw Ee.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,t?._hardwareTexture?.underlyingResource??null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else i&&(n=!0,this._activateCurrentTexture());return o&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),n}_bindTexture(e,t,i){if(e===void 0)return;t&&(t._associatedChannel=e),this._activeChannel=e;const s=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(s,t)}unbindAllTextures(){for(let e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,i,s){e!==void 0&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))}_bindSamplerUniformToChannel(e,t){const i=this._boundUniforms[e];!i||i._currentState===t||(this._gl.uniform1i(i,t),i._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:return this._gl.REPEAT;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,i=!1,s=!1,n=""){if(!t)return this._boundTexturesCache[e]!=null&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;const f=t.getInternalTexture();f&&(f._associatedChannel=e),t.update()}else if(t.delayLoadState===4)return t.delayLoad(),!1;let o;s?o=t.depthStencilTexture:t.isReady()?o=t.getInternalTexture():t.isCube?o=this.emptyCubeTexture:t.is3D?o=this.emptyTexture3D:t.is2DArray?o=this.emptyTexture2DArray:o=this.emptyTexture,!i&&o&&(o._associatedChannel=e);let c=!0;this._boundTexturesCache[e]===o&&(i||this._bindSamplerUniformToChannel(o._associatedChannel,e),c=!1),this._activeChannel=e;const h=this._getTextureTarget(o);if(c&&this._bindTextureDirectly(h,o,i),o&&!o.isMultiview){if(o.isCube&&o._cachedCoordinatesMode!==t.coordinatesMode){o._cachedCoordinatesMode=t.coordinatesMode;const f=t.coordinatesMode!==3&&t.coordinatesMode!==5?1:0;t.wrapU=f,t.wrapV=f}o._cachedWrapU!==t.wrapU&&(o._cachedWrapU=t.wrapU,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),o)),o._cachedWrapV!==t.wrapV&&(o._cachedWrapV=t.wrapV,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),o)),o.is3D&&o._cachedWrapR!==t.wrapR&&(o._cachedWrapR=t.wrapR,this._setTextureParameterInteger(h,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),o)),this._setAnisotropicLevel(h,o,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,i,s){if(!(e===void 0||!t)){(!this._textureUnits||this._textureUnits.length!==i.length)&&(this._textureUnits=new Int32Array(i.length));for(let n=0;n<i.length;n++){const o=i[n].getInternalTexture();o?(this._textureUnits[n]=e+n,o._associatedChannel=e+n):this._textureUnits[n]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let n=0;n<i.length;n++)this._setTexture(this._textureUnits[n],i[n],!0)}}_setAnisotropicLevel(e,t,i){const s=this._caps.textureAnisotropicFilterExtension;t.samplingMode!==11&&t.samplingMode!==3&&t.samplingMode!==2&&(i=1),s&&t._cachedAnisotropicFilteringLevel!==i&&(this._setTextureParameterFloat(e,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(i,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=i)}_setTextureParameterFloat(e,t,i,s){this._bindTextureDirectly(e,s,!0,!0),this._gl.texParameterf(e,t,i)}_setTextureParameterInteger(e,t,i,s){s&&this._bindTextureDirectly(e,s,!0,!0),this._gl.texParameteri(e,t,i)}unbindAllAttributes(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(let e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e);return}for(let e=0,t=this._vertexAttribArraysEnabled.length;e<t;e++)e>=this._caps.maxVertexAttribs||!this._vertexAttribArraysEnabled[e]||this.disableAttributeByIndex(e)}releaseEffects(){this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}dispose(){is()&&this._renderingCanvas&&(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&this._gl.getExtension("WEBGL_lose_context")?.loseContext(),um(this._gl)}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){const t=this._gl;for(;t.getError()!==t.NO_ERROR;);let i=!0;const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);const n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0);const o=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i=i&&o===t.FRAMEBUFFER_COMPLETE,i=i&&t.getError()===t.NO_ERROR,i&&(t.clear(t.COLOR_BUFFER_BIT),i=i&&t.getError()===t.NO_ERROR),i){t.bindFramebuffer(t.FRAMEBUFFER,null);const c=t.RGBA,h=t.UNSIGNED_BYTE,f=new Uint8Array(4);t.readPixels(0,0,1,1,c,h,f),i=i&&t.getError()===t.NO_ERROR}for(t.deleteTexture(s),t.deleteFramebuffer(n),t.bindFramebuffer(t.FRAMEBUFFER,null);!i&&t.getError()!==t.NO_ERROR;);return i}_getWebGLTextureType(e){if(this._webGLVersion===1){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:return this._gl.UNSIGNED_BYTE;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:return this._gl.UNSIGNED_BYTE;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:i=this._gl.ALPHA;break;case 1:i=this._gl.LUMINANCE;break;case 2:i=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:i=this._gl.RED;break;case 7:case 33324:case 36761:i=this._gl.RG;break;case 4:case 32852:case 36762:i=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:i=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;break}if(this._webGLVersion>1)switch(e){case 8:i=this._gl.RED_INTEGER;break;case 9:i=this._gl.RG_INTEGER;break;case 10:i=this._gl.RGB_INTEGER;break;case 11:i=this._gl.RGBA_INTEGER;break}return i}_getRGBABufferInternalSizedFormat(e,t,i=!1){if(this._webGLVersion===1){if(t!==void 0)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return i?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return i?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;case 11:return this._gl.RGBA16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;case 11:return this._gl.RGBA16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;case 11:return this._gl.RGBA32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;case 11:return this._gl.RGBA32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;case 5:return this._gl.RGBA32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;case 5:return this._gl.RGBA16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI;default:return this._gl.RGB10_A2}}return i?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,i,s,n=!0,o=!0,c=null){const h=n?4:3,f=n?this._gl.RGBA:this._gl.RGB,_=i*s*h;if(!c)c=new Uint8Array(_);else if(c.length<_)return Ee.Error(`Data buffer is too small to store the read pixels (${c.length} should be more than ${_})`),Promise.resolve(c);return o&&this.flushFramebuffer(),this._gl.readPixels(e,t,i,s,f,this._gl.UNSIGNED_BYTE,c),Promise.resolve(c)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(this._HasMajorPerformanceCaveat!==null)return!this._HasMajorPerformanceCaveat;if(this._IsSupported===null)try{const e=Be._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=t!=null&&!!globalThis.WebGLRenderingContext}catch{this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(this._HasMajorPerformanceCaveat===null)try{const e=Be._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch{this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}_t._TempClearColorUint32=new Uint32Array(4);_t._TempClearColorInt32=new Int32Array(4);_t.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}];_t._ConcatenateShader=Bv;_t._IsSupported=null;_t._HasMajorPerformanceCaveat=null;class oP{constructor(e=30){this._enabled=!0,this._rollingFrameTime=new lP(e)}sampleFrame(e=Gs.Now){if(this._enabled){if(this._lastFrameTimeMs!=null){const t=e-this._lastFrameTimeMs;this._rollingFrameTime.add(t)}this._lastFrameTimeMs=e}}get averageFrameTime(){return this._rollingFrameTime.average}get averageFrameTimeVariance(){return this._rollingFrameTime.variance}get instantaneousFrameTime(){return this._rollingFrameTime.history(0)}get averageFPS(){return 1e3/this._rollingFrameTime.average}get instantaneousFPS(){const e=this._rollingFrameTime.history(0);return e===0?0:1e3/e}get isSaturated(){return this._rollingFrameTime.isSaturated()}enable(){this._enabled=!0}disable(){this._enabled=!1,this._lastFrameTimeMs=null}get isEnabled(){return this._enabled}reset(){this._lastFrameTimeMs=null,this._rollingFrameTime.reset()}}class lP{constructor(e){this._samples=new Array(e),this.reset()}add(e){let t;if(this.isSaturated()){const i=this._samples[this._pos];t=i-this.average,this.average-=t/(this._sampleCount-1),this._m2-=t*(i-this.average)}else this._sampleCount++;t=e-this.average,this.average+=t/this._sampleCount,this._m2+=t*(e-this.average),this.variance=this._m2/(this._sampleCount-1),this._samples[this._pos]=e,this._pos++,this._pos%=this._samples.length}history(e){if(e>=this._sampleCount||e>=this._samples.length)return 0;const t=this._wrapPosition(this._pos-1);return this._samples[this._wrapPosition(t-e)]}isSaturated(){return this._sampleCount>=this._samples.length}reset(){this.average=0,this.variance=0,this._sampleCount=0,this._pos=0,this._m2=0}_wrapPosition(e){const t=this._samples.length;return(e%t+t)%t}}function cP(r){!r||!r.setAttribute||(r.setAttribute("touch-action","none"),r.style.touchAction="none",r.style.webkitTapHighlightColor="transparent")}function hP(r,e,t){r._onCanvasFocus=()=>{r.onCanvasFocusObservable.notifyObservers(r)},r._onCanvasBlur=()=>{r.onCanvasBlurObservable.notifyObservers(r)},r._onCanvasContextMenu=s=>{r.disableContextMenu&&s.preventDefault()}
184,e.addEventListener("focus",r._onCanvasFocus),e.addEventListener("blur",r._onCanvasBlur),e.addEventListener("contextmenu",r._onCanvasContextMenu),r._onBlur=()=>{r.disablePerformanceMonitorInBackground&&r.performanceMonitor.disable(),r._windowIsBackground=!0},r._onFocus=()=>{r.disablePerformanceMonitorInBackground&&r.performanceMonitor.enable(),r._windowIsBackground=!1},r._onCanvasPointerOut=s=>{document.elementFromPoint(s.clientX,s.clientY)!==e&&r.onCanvasPointerOutObservable.notifyObservers(s)};const i=r.getHostWindow();i&&typeof i.addEventListener=="function"&&(i.addEventListener("blur",r._onBlur),i.addEventListener("focus",r._onFocus)),e.addEventListener("pointerout",r._onCanvasPointerOut),t.doNotHandleTouchAction||cP(e),!Be.audioEngine&&t.audioEngine&&Be.AudioEngineFactory&&(Be.audioEngine=Be.AudioEngineFactory(r.getRenderingCanvas(),r.getAudioContext(),r.getAudioDestination())),co()&&(r._onFullscreenChange=()=>{r.isFullscreen=!!document.fullscreenElement,r.isFullscreen&&r._pointerLockRequested&&e&&Kv(e)},document.addEventListener("fullscreenchange",r._onFullscreenChange,!1),document.addEventListener("webkitfullscreenchange",r._onFullscreenChange,!1),r._onPointerLockChange=()=>{r.isPointerLock=document.pointerLockElement===e},document.addEventListener("pointerlockchange",r._onPointerLockChange,!1),document.addEventListener("webkitpointerlockchange",r._onPointerLockChange,!1)),r.enableOfflineSupport=Be.OfflineProviderFactory!==void 0,r._deterministicLockstep=!!t.deterministicLockstep,r._lockstepMaxSteps=t.lockstepMaxSteps||0,r._timeStep=t.timeStep||1/60}function uP(r,e){vt.Instances.length===1&&Be.audioEngine&&(Be.audioEngine.dispose(),Be.audioEngine=null);const t=r.getHostWindow();t&&typeof t.removeEventListener=="function"&&(t.removeEventListener("blur",r._onBlur),t.removeEventListener("focus",r._onFocus)),e&&(e.removeEventListener("focus",r._onCanvasFocus),e.removeEventListener("blur",r._onCanvasBlur),e.removeEventListener("pointerout",r._onCanvasPointerOut),e.removeEventListener("contextmenu",r._onCanvasContextMenu)),co()&&(document.removeEventListener("fullscreenchange",r._onFullscreenChange),document.removeEventListener("mozfullscreenchange",r._onFullscreenChange),document.removeEventListener("webkitfullscreenchange",r._onFullscreenChange),document.removeEventListener("msfullscreenchange",r._onFullscreenChange),document.removeEventListener("pointerlockchange",r._onPointerLockChange),document.removeEventListener("mspointerlockchange",r._onPointerLockChange),document.removeEventListener("mozpointerlockchange",r._onPointerLockChange),document.removeEventListener("webkitpointerlockchange",r._onPointerLockChange))}function fP(r){const e=dP(r);if(e)return e;const t=_P(r);return t||mP(r)}function dP(r){if(!co()||!document.body)return null;const e=document.createElement("span");e.textContent="Hg",e.style.font=r;const t=document.createElement("div");t.style.display="inline-block",t.style.width="1px",t.style.height="0px",t.style.verticalAlign="bottom";const i=document.createElement("div");i.style.whiteSpace="nowrap",i.appendChild(e),i.appendChild(t),document.body.appendChild(i);let s,n;try{n=t.getBoundingClientRect().top-e.getBoundingClientRect().top,t.style.verticalAlign="baseline",s=t.getBoundingClientRect().top-e.getBoundingClientRect().top}finally{document.body.removeChild(i)}const o={ascent:s,height:n,descent:n-s};return qv(o)?o:null}function _P(r){let e=null;try{typeof OffscreenCanvas<"u"?e=new OffscreenCanvas(64,64):co()&&typeof document.createElement=="function"&&(e=document.createElement("canvas"),e.width=64,e.height=64);const t=e?.getContext("2d");if(!t)return null;t.font=r;const i=t.measureText("Hg"),s=Number(i.actualBoundingBoxAscent??i.fontBoundingBoxAscent),n=Number(i.actualBoundingBoxDescent??i.fontBoundingBoxDescent),o={ascent:s,height:s+n,descent:n};return qv(o)?o:null}catch{return null}finally{const t=e;typeof t?.dispose=="function"&&t.dispose()}}function mP(r){const e=Math.max(1,gP(r)),t=e*.8,i=e*.2;return{ascent:t,height:t+i,descent:i}}function gP(r){const e=/(?:^|\s)([0-9]+(?:\.[0-9]+)?)px(?:\/|\s|$)/.exec(String(r||""));return e?Number(e[1]):16}function qv(r){return Number.isFinite(r.ascent)&&Number.isFinite(r.height)&&Number.isFinite(r.descent)&&r.height>0}async function pP(r,e,t){return await new Promise((i,s)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{r.createImageBitmap(n,t).then(o=>{i(o)})})},n.onerror=()=>{s(`Error loading image ${n.src}`)},n.src=e})}function yP(r,e,t,i){const n=r.createCanvas(t,i).getContext("2d");if(!n)throw new Error("Unable to get 2d context for resizeImageBitmap");return n.drawImage(e,0,0),n.getImageData(0,0,t,i).data}function bP(r){const e=r.requestFullscreen||r.webkitRequestFullscreen;e&&e.call(r)}function xP(){const r=document;document.exitFullscreen?document.exitFullscreen():r.webkitCancelFullScreen&&r.webkitCancelFullScreen()}function Kv(r){if(r.requestPointerLock){const e=r.requestPointerLock();e instanceof Promise?e.then(()=>{r.focus()}).catch(()=>{}):r.focus()}}function TP(){document.exitPointerLock&&document.exitPointerLock()}class Cn{get min(){return this._min}get max(){return this._max}get average(){return this._average}get lastSecAverage(){return this._lastSecAverage}get current(){return this._current}get total(){return this._totalAccumulated}get count(){return this._totalValueCount}constructor(){this._startMonitoringTime=0,this._min=0,this._max=0,this._hasResult=!1,this._hasCurrentValue=!1,this._average=0,this._lastSecAverage=0,this._current=0,this._totalValueCount=0,this._totalAccumulated=0,this._lastSecAccumulated=0,this._lastSecTime=0,this._lastSecValueCount=0}fetchNewFrame(){this._totalValueCount++,this._current=0,this._hasCurrentValue=Cn.Enabled,this._lastSecValueCount++}
184addCount(e,t){Cn.Enabled&&(this._current+=e,this._hasCurrentValue=!0,t&&this._fetchResult())}beginMonitoring(){Cn.Enabled&&(this._startMonitoringTime=Gs.Now)}endMonitoring(e=!0){if(!Cn.Enabled)return;e&&this.fetchNewFrame();const t=Gs.Now;this._current=t-this._startMonitoringTime,this._hasCurrentValue=!0,e&&this._fetchResult()}endFrame(){this._fetchResult()}_fetchResult(){if(!this._hasCurrentValue)return;this._totalAccumulated+=this._current,this._lastSecAccumulated+=this._current,this._hasResult?(this._min=Math.min(this._min,this._current),this._max=Math.max(this._max,this._current)):(this._min=this._current,this._max=this._current,this._hasResult=!0),this._average=this._totalAccumulated/this._totalValueCount;const e=Gs.Now;e-this._lastSecTime>1e3&&(this._lastSecAverage=this._lastSecAccumulated/this._lastSecValueCount,this._lastSecTime=e,this._lastSecAccumulated=0,this._lastSecValueCount=0)}}Cn.Enabled=!0;let xx=!1;function Zv(){xx||(xx=!0,Be.prototype.getInputElement=function(){return this._renderingCanvas},Be.prototype.getRenderingCanvasClientRect=function(){return this._renderingCanvas?this._renderingCanvas.getBoundingClientRect():null},Be.prototype.getInputElementClientRect=function(){return this._renderingCanvas?this.getInputElement().getBoundingClientRect():null},Be.prototype.getAspectRatio=function(r,e=!1){const t=r.viewport;return this.getRenderWidth(e)*t.width/(this.getRenderHeight(e)*t.height)},Be.prototype.getScreenAspectRatio=function(){return this.getRenderWidth(!0)/this.getRenderHeight(!0)},Be.prototype._verifyPointerLock=function(){this._onPointerLockChange?.()})}let Tx=!1;function fg(){Tx||(Tx=!0,Be.prototype.getRenderPassNames=function(){return this._renderPassNames},Be.prototype.getCurrentRenderPassName=function(){return this._renderPassNames[this.currentRenderPassId]},Be.prototype.createRenderPassId=function(r){const e=++Be._RenderPassIdCounter;return this._renderPassNames[e]=r??"NONAME",e},Be.prototype.releaseRenderPassId=function(r){this._renderPassNames[r]=void 0;for(let e=0;e<this.scenes.length;++e){const t=this.scenes[e];for(let i=0;i<t.meshes.length;++i){const s=t.meshes[i];if(s._releaseRenderPassId(r),s.subMeshes)for(let n=0;n<s.subMeshes.length;++n)s.subMeshes[n]._removeDrawWrapper(r)}}})}class ke extends _t{static get NpmPackage(){return Be.NpmPackage}static get Version(){return Be.Version}static get Instances(){return vt.Instances}static get LastCreatedEngine(){return vt.LastCreatedEngine}static get LastCreatedScene(){return vt.LastCreatedScene}static DefaultLoadingScreenFactory(e){return Be.DefaultLoadingScreenFactory(e)}get _supportsHardwareTextureRescaling(){return!!ke._RescalePostProcessFactory}_measureFps(){this._performanceMonitor.sampleFrame(),this._fps=this._performanceMonitor.averageFPS,this._deltaTime=this._performanceMonitor.instantaneousFrameTime||0}get performanceMonitor(){return this._performanceMonitor}constructor(e,t,i,s=!1){Zv(),fg(),super(e,t,i,s),this._performanceMonitor=new oP,this._drawCalls=new Cn,e&&(this._features.supportRenderPasses=!0)}_initGLContext(){super._initGLContext(),this._rescalePostProcess=null}_sharedInit(e){super._sharedInit(e),hP(this,e,this._creationOptions)}resizeImageBitmap(e,t,i){return yP(this,e,t,i)}async _createImageBitmapFromSource(e,t){return await pP(this,e,t)}switchFullscreen(e){this.isFullscreen?this.exitFullscreen():this.enterFullscreen(e)}enterFullscreen(e){this.isFullscreen||(this._pointerLockRequested=e,this._renderingCanvas&&bP(this._renderingCanvas))}exitFullscreen(){this.isFullscreen&&xP()}setDitheringState(e){e?this._gl.enable(this._gl.DITHER):this._gl.disable(this._gl.DITHER)}setRasterizerState(e){e?this._gl.disable(this._gl.RASTERIZER_DISCARD):this._gl.enable(this._gl.RASTERIZER_DISCARD)}setDirectViewport(e,t,i,s){const n=this._cachedViewport;return this._cachedViewport=null,this._viewport(e,t,i,s),n}scissorClear(e,t,i,s,n){this.enableScissor(e,t,i,s),this.clear(n,!0,!0,!0),this.disableScissor()}getVertexShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[0]):null}getFragmentShaderSource(e){const t=this._gl.getAttachedShaders(e);return t?this._gl.getShaderSource(t[1]):null}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e,this._framebufferDimensionsObject&&this.onResizeObservable.notifyObservers(this)}_rebuildBuffers(){for(const e of this.scenes)e.resetCachedMaterial(),e._rebuildGeometries();for(const e of this._virtualScenes)e.resetCachedMaterial(),e._rebuildGeometries();super._rebuildBuffers()}getFontOffset(e){return fP(e)}enterPointerlock(){this._renderingCanvas&&Kv(this._renderingCanvas)}exitPointerlock(){TP()}beginFrame(){this._measureFps(),super.beginFrame()}_deletePipelineContext(e){const t=e;t&&t.program&&t.transformFeedback&&(this.deleteTransformFeedback(t.transformFeedback),t.transformFeedback=null),super._deletePipelineContext(e)}createShaderProgram(e,t,i,s,n,o=null){n=n||this._gl,this.onBeforeShaderCompilationObservable.notifyObservers(this);const c=super.createShaderProgram(e,t,i,s,n,o);return this.onAfterShaderCompilationObservable.notifyObservers(this),c}_createShaderProgram(e,t,i,s,n=null){const o=s.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");if(s.attachShader(o,t),s.attachShader(o,i),this.webGLVersion>1&&n){const c=this.createTransformFeedback();this.bindTransformFeedback(c),this.setTranformFeedbackVaryings(o,n),e.transformFeedback=c}return s.linkProgram(o),this.webGLVersion>1&&n&&this.bindTransformFeedback(null),e.context=s,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),o}_releaseTexture(e){super._releaseTexture(e)}_releaseRenderTargetWrapper(e){super._releaseRenderTargetWrapper(e);for(const t of this.scenes){for(const i of t.postProcesses)i._outputTexture===e&&(i._outputTexture=null);for(const i of t.cameras)for(const s of i._postProcesses)s&&s._outputTexture===e&&(s._outputTexture=null)}}_rescaleTexture(e,t,i,s,n){this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE);const o=this.createRenderTargetTexture({width:t.width,height:t.height},{generateMipMaps:!1,type:0,samplingMode:2,generateDepthBuffer:!1,generateStencilBuffer:!1});if(!this._rescalePostProcess&&ke._RescalePostProcessFactory&&(this._rescalePostProcess=ke._RescalePostProcessFactory(this)),this._rescalePostProcess){this._rescalePostProcess.externalTextureSamplerBinding=!0;const c=()=>{this._rescalePostProcess.onApply=function(_){_._bindTexture("textureSampler",e)};let f=i;f||(f=this.scenes[this.scenes.length-1]),f.postProcessManager.directRender([this._rescalePostProcess],o,!0),this._bindTextureDirectly(this._gl.TEXTURE_2D,t,!0),this._gl.copyTexImage2D(this._gl.TEXTURE_2D,0,s,0,0,t.width,t.height,0),this.unBindFramebuffer(o
vendor: 6,475 bytes, line 184
184),o.dispose(),n&&n()},h=this._rescalePostProcess.getEffect();h?h.executeWhenCompiled(c):this._rescalePostProcess.onEffectCreatedObservable.addOnce(f=>{f.executeWhenCompiled(c)})}}wrapWebGLTexture(e,t=!1,i=3,s=0,n=0){const o=new km(e,this._gl),c=new ws(this,15,!0);return c._hardwareTexture=o,c.baseWidth=s,c.baseHeight=n,c.width=s,c.height=n,c.isReady=!0,c.useMipMaps=t,this.updateTextureSamplingMode(i,c),c}updateWrappedWebGLTexture(e,t){if(e.source!==15)throw new Error("updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.");for(const s of this._renderTargetWrapperCache)if(s.textures?.includes(e)){if(s.isMulti)throw new Error("updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.");if(s._depthStencilTexture)throw new Error("updateWrappedWebGLTexture: wrapped texture's render-target wrapper has a depth/stencil texture; not supported. Dispose and re-wrap.")}e._hardwareTexture=new km(t,this._gl),e.isReady=!0,e._cachedCoordinatesMode=null,e._cachedWrapU=null,e._cachedWrapV=null,e._cachedWrapR=null,e._cachedAnisotropicFilteringLevel=null;for(const s in this._boundTexturesCache)this._boundTexturesCache[s]===e&&(this._boundTexturesCache[s]=null);this.updateTextureSamplingMode(e.samplingMode,e);const i=this._gl;for(const s of this._renderTargetWrapperCache){if(s.texture!==e)continue;const n=s,o=s.samples,c=o>1;n._framebuffer&&i.deleteFramebuffer(n._framebuffer),!c&&n._depthStencilBuffer&&(i.deleteRenderbuffer(n._depthStencilBuffer),n._depthStencilBuffer=null);const h=this._currentFramebuffer,f=i.createFramebuffer();this._bindUnboundFramebuffer(f),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0),c||(n._depthStencilBuffer=this._setupFramebufferDepthAttachments(s._generateStencilBuffer,s._generateDepthBuffer,s.width,s.height)),this._bindUnboundFramebuffer(h),n._framebuffer=f,c&&(s._samples=1,this.updateRenderTargetTextureSampleCount(n,o))}}_uploadImageToTexture(e,t,i=0,s=0){const n=this._gl,o=this._getWebGLTextureType(e.type),c=this._getInternalFormat(e.format),h=this._getRGBABufferInternalSizedFormat(e.type,c),f=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(f,e,!0),this._unpackFlipY(e.invertY);let _=n.TEXTURE_2D;e.isCube&&(_=n.TEXTURE_CUBE_MAP_POSITIVE_X+i),n.texImage2D(_,s,h,c,o,t),this._bindTextureDirectly(f,null,!0)}updateTextureComparisonFunction(e,t){if(this.webGLVersion===1){Ee.Error("WebGL 1 does not support texture comparison.");return}const i=this._gl;e.isCube?(this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,e,!0),t===0?(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)):(this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),t===0?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,515),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.NONE)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_FUNC,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE)),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)),e._comparisonFunction=t}createInstancesBuffer(e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create instance buffer");const i=new ah(t);return i.capacity=e,this.bindArrayBuffer(i),this._gl.bufferData(this._gl.ARRAY_BUFFER,e,this._gl.DYNAMIC_DRAW),i.references=1,i}deleteInstancesBuffer(e){this._gl.deleteBuffer(e)}async _clientWaitAsync(e,t=0,i=10){const s=this._gl;return await new Promise((n,o)=>{ug(()=>{const c=s.clientWaitSync(e,t,0);if(c==s.WAIT_FAILED)throw new Error("clientWaitSync failed");return c!=s.TIMEOUT_EXPIRED},n,o,i)})}_readPixelsAsync(e,t,i,s,n,o,c){if(this._webGLVersion<2)throw new Error("_readPixelsAsync only work on WebGL2+");const h=this._gl,f=h.createBuffer();h.bindBuffer(h.PIXEL_PACK_BUFFER,f),h.bufferData(h.PIXEL_PACK_BUFFER,c.byteLength,h.STREAM_READ),h.readPixels(e,t,i,s,n,o,0),h.bindBuffer(h.PIXEL_PACK_BUFFER,null);const _=h.fenceSync(h.SYNC_GPU_COMMANDS_COMPLETE,0);return _?(h.flush(),this._clientWaitAsync(_,0,10).then(()=>(h.deleteSync(_),h.bindBuffer(h.PIXEL_PACK_BUFFER,f),h.getBufferSubData(h.PIXEL_PACK_BUFFER,0,c),h.bindBuffer(h.PIXEL_PACK_BUFFER,null),h.deleteBuffer(f),c))):null}dispose(){this.hideLoadingUI?.(),this._rescalePostProcess&&this._rescalePostProcess.dispose(),uP(this,this._renderingCanvas),super.dispose()}}ke.ALPHA_DISABLE=0;ke.ALPHA_ADD=1;ke.ALPHA_COMBINE=2;ke.ALPHA_SUBTRACT=3;ke.ALPHA_MULTIPLY=4;ke.ALPHA_MAXIMIZED=5;ke.ALPHA_ONEONE=6;ke.ALPHA_PREMULTIPLIED=7;ke.ALPHA_PREMULTIPLIED_PORTERDUFF=8;ke.ALPHA_INTERPOLATE=9;ke.ALPHA_SCREENMODE=10;ke.DELAYLOADSTATE_NONE=0;ke.DELAYLOADSTATE_LOADED=1;ke.DELAYLOADSTATE_LOADING=2;ke.DELAYLOADSTATE_NOTLOADED=4;ke.NEVER=512;ke.ALWAYS=519;ke.LESS=513;ke.EQUAL=514;ke.LEQUAL=515;ke.GREATER=516;ke.GEQUAL=518;ke.NOTEQUAL=517;ke.KEEP=7680;ke.REPLACE=7681;ke.INCR=7682;ke.DECR=7683;ke.INVERT=5386;ke.INCR_WRAP=34055;ke.DECR_WRAP=34056;ke.TEXTURE_CLAMP_ADDRESSMODE=0;ke.TEXTURE_WRAP_ADDRESSMODE=1;ke.TEXTURE_MIRROR_ADDRESSMODE=2;ke.TEXTUREFORMAT_ALPHA=0;ke.TEXTUREFORMAT_LUMINANCE=1;ke.TEXTUREFORMAT_LUMINANCE_ALPHA=2;ke.TEXTUREFORMAT_RGB=4;ke.TEXTUREFORMAT_RGBA=5;ke.TEXTUREFORMAT_RED=6;ke.TEXTUREFORMAT_R=6;ke.TEXTUREFORMAT_R16_UNORM=33322;ke.TEXTUREFORMAT_RG16_UNORM=33324;ke.TEXTUREFORMAT_RGB16_UNORM=32852;ke.TEXTUREFORMAT_RGBA16_UNORM=32859;ke.TEXTUREFORMAT_R16_SNORM=36760;ke.TEXTUREFORMAT_RG16_SNORM=36761;ke.TEXTUREFORMAT_RGB16_SNORM=36762;ke.TEXTUREFORMAT_RGBA16_SNORM=36763;ke.TEXTUREFORMAT_RG=7;ke.TEXTUREFORMAT_RED_INTEGER=8;ke.TEXTUREFORMAT_R_INTEGER=8;ke.TEXTUREFORMAT_RG_INTEGER=9;ke.TEXTUREFORMAT_RGB_INTEGER=10;ke.TEXTUREFORMAT_RGBA_INTEGER=11;ke.TEXTURETYPE_UNSIGNED_BYTE=0;ke.TEXTURETYPE_UNSIGNED_INT=0;ke.TEXTURETYPE_FLOAT=1;ke.TEXTURETYPE_HALF_FLOAT=2;ke.TEXTURETYPE_BYTE=3;ke.TEXTURETYPE_SHORT=4;ke.TEXTURETYPE_UNSIGNED_SHORT=5;ke.TEXTURETYPE_INT=6;ke.TEXTURETYPE_UNSIGNED_INTEGER=7;ke.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8;ke.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9;ke.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10;ke.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11;ke.TEXTURETYPE_UNSIGNED_INT_24_8=12;ke.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13;ke.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14;ke.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15;
184ke.TEXTURE_NEAREST_SAMPLINGMODE=1;ke.TEXTURE_BILINEAR_SAMPLINGMODE=2;ke.TEXTURE_TRILINEAR_SAMPLINGMODE=3;ke.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8;ke.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11;ke.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3;ke.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4;ke.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5;ke.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6;ke.TEXTURE_NEAREST_LINEAR=7;ke.TEXTURE_NEAREST_NEAREST=1;ke.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9;ke.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10;ke.TEXTURE_LINEAR_LINEAR=2;ke.TEXTURE_LINEAR_NEAREST=12;ke.TEXTURE_EXPLICIT_MODE=0;ke.TEXTURE_SPHERICAL_MODE=1;ke.TEXTURE_PLANAR_MODE=2;ke.TEXTURE_CUBIC_MODE=3;ke.TEXTURE_PROJECTION_MODE=4;ke.TEXTURE_SKYBOX_MODE=5;ke.TEXTURE_INVCUBIC_MODE=6;ke.TEXTURE_EQUIRECTANGULAR_MODE=7;ke.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8;ke.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9;ke.SCALEMODE_FLOOR=1;ke.SCALEMODE_NEAREST=2;ke.SCALEMODE_CEILING=3;let Ex=!1;function EP(){Ex||(Ex=!0,_t.prototype.setAlphaMode=function(r,e=!1,t=0){if(this._alphaMode[t]===r){if(!e){const s=r===0;this.depthCullingState.depthMask!==s&&(this.depthCullingState.depthMask=s)}return}const i=r===0;this._alphaState.setAlphaBlend(!i,t),this._alphaState.setAlphaMode(r,t),e||(this.depthCullingState.depthMask=i),this._alphaMode[t]=r})}EP();let vx=!1;function vP(){if(vx)return;vx=!0;const r=new WeakMap,e=new WeakMap,t=new WeakMap,i=new WeakMap;_t.prototype.getAlphaToCoverage=function(){return r.get(this)??!1},_t.prototype.setAlphaToCoverage=function(s){r.get(this)===s&&(!this._gl||e.get(this)===this._gl)||(r.set(this,s),this._gl&&(s?this._gl.enable(this._gl.SAMPLE_ALPHA_TO_COVERAGE):this._gl.disable(this._gl.SAMPLE_ALPHA_TO_COVERAGE),e.set(this,this._gl)))},Object.defineProperty(_t.prototype,"currentSampleCount",{get:function(){return this._currentRenderTarget?this._currentRenderTarget.samples:this._gl?(i.get(this)!==this._gl&&(t.set(this,this._gl.getContextAttributes()?.antialias?Math.max(1,this._gl.getParameter(this._gl.SAMPLES)):1),i.set(this,this._gl)),t.get(this)):1},enumerable:!1,configurable:!0})}vP();let Ax=!1;function AP(){if(Ax)return;Ax=!0;function r(i,s,n,o){let c,h=1;o===1?c=new Float32Array(s*n*4):o===2?(c=new Uint16Array(s*n*4),h=15360):o===7?c=new Uint32Array(s*n*4):c=new Uint8Array(s*n*4);for(let f=0;f<s;f++)for(let _=0;_<n;_++){const d=(_*s+f)*3,g=(_*s+f)*4;c[g+0]=i[d+0],c[g+1]=i[d+1],c[g+2]=i[d+2],c[g+3]=h}return c}function e(i){return function(s,n,o,c,h,f,_,d,g=null,p=0){const b=i?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,x=i?10:11,E=new ws(this,x);E.baseWidth=n,E.baseHeight=o,E.baseDepth=c,E.width=n,E.height=o,E.depth=c,E.format=h,E.type=p,E.generateMipMaps=f,E.samplingMode=d,i?E.is3D=!0:E.is2DArray=!0,this._doNotHandleContextLost||(E._bufferView=s),i?this.updateRawTexture3D(E,s,h,_,g,p):this.updateRawTexture2DArray(E,s,h,_,g,p),this._bindTextureDirectly(b,E,!0);const v=this._getSamplingParameters(d,f);return this._gl.texParameteri(b,this._gl.TEXTURE_MAG_FILTER,v.mag),this._gl.texParameteri(b,this._gl.TEXTURE_MIN_FILTER,v.min),f&&this._gl.generateMipmap(b),this._bindTextureDirectly(b,null),this._internalTexturesCache.push(E),E}}function t(i){return function(s,n,o,c,h=null,f=0){const _=i?this._gl.TEXTURE_3D:this._gl.TEXTURE_2D_ARRAY,d=this._getWebGLTextureType(f),g=this._getInternalFormat(o),p=this._getRGBABufferInternalSizedFormat(f,o);this._bindTextureDirectly(_,s,!0),this._unpackFlipY(c===void 0?!0:!!c),this._doNotHandleContextLost||(s._bufferView=n,s.format=o,s.invertY=c,s._compression=h),s.width%4!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),h&&n?this._gl.compressedTexImage3D(_,0,this.getCaps().s3tc[h],s.width,s.height,s.depth,0,n):this._gl.texImage3D(_,0,p,s.width,s.height,s.depth,0,g,d,n),s.generateMipMaps&&this._gl.generateMipmap(_),this._bindTextureDirectly(_,null),s.isReady=!0}}_t.prototype.updateRawTexture=function(i,s,n,o,c=null,h=0,f=!1){if(!i)return;const _=this._getRGBABufferInternalSizedFormat(h,n,f),d=this._getInternalFormat(n),g=this._getWebGLTextureType(h);this._bindTextureDirectly(this._gl.TEXTURE_2D,i,!0),this._unpackFlipY(o===void 0?!0:!!o),this._doNotHandleContextLost||(i._bufferView=s,i.format=n,i.type=h,i.invertY=o,i._compression=c),i.width%4
vendor: 26,844 bytes, line 184
184!==0&&this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT,1),c&&s?this._gl.compressedTexImage2D(this._gl.TEXTURE_2D,0,this.getCaps().s3tc[c],i.width,i.height,0,s):this._gl.texImage2D(this._gl.TEXTURE_2D,0,_,i.width,i.height,0,d,g,s),i.generateMipMaps&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),i.isReady=!0},_t.prototype.createRawTexture=function(i,s,n,o,c,h,f,_=null,d=0,g=0,p=!1){const b=new ws(this,3);b.baseWidth=s,b.baseHeight=n,b.width=s,b.height=n,b.format=o,b.generateMipMaps=c,b.samplingMode=f,b.invertY=h,b._compression=_,b.type=d,b._useSRGBBuffer=this._getUseSRGBBuffer(p,!c),this._doNotHandleContextLost||(b._bufferView=i),this.updateRawTexture(b,i,o,h,_,d,b._useSRGBBuffer),this._bindTextureDirectly(this._gl.TEXTURE_2D,b,!0);const x=this._getSamplingParameters(f,c);return this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MAG_FILTER,x.mag),this._gl.texParameteri(this._gl.TEXTURE_2D,this._gl.TEXTURE_MIN_FILTER,x.min),c&&this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._internalTexturesCache.push(b),b},_t.prototype.createRawCubeTexture=function(i,s,n,o,c,h,f,_=null){const d=this._gl,g=new ws(this,8);g.isCube=!0,g.format=n,g.type=o,this._doNotHandleContextLost||(g._bufferViewArray=i);const p=this._getWebGLTextureType(o);let b=this._getInternalFormat(n);b===d.RGB&&(b=d.RGBA),p===d.FLOAT&&!this._caps.textureFloatLinearFiltering?(c=!1,f=1,Ee.Warn("Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):p===this._gl.HALF_FLOAT_OES&&!this._caps.textureHalfFloatLinearFiltering?(c=!1,f=1,Ee.Warn("Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.")):p===d.FLOAT&&!this._caps.textureFloatRender?(c=!1,Ee.Warn("Render to float textures is not supported. Mipmap generation forced to false.")):p===d.HALF_FLOAT&&!this._caps.colorBufferFloat&&(c=!1,Ee.Warn("Render to half float textures is not supported. Mipmap generation forced to false."));const x=s,E=x;if(g.width=x,g.height=E,g.invertY=h,g._compression=_,!this.needPOTTextures||Af(g.width)&&Af(g.height)||(c=!1),i)this.updateRawCubeTexture(g,i,n,o,h,_);else{const R=this._getRGBABufferInternalSizedFormat(o),P=0;this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,g,!0);for(let M=0;M<6;M++)_?d.compressedTexImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+M,P,this.getCaps().s3tc[_],g.width,g.height,0,void 0):d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X+M,P,R,g.width,g.height,0,b,p,null);this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null)}this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,g,!0),i&&c&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);const S=this._getSamplingParameters(f,c);return d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_MAG_FILTER,S.mag),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_MIN_FILTER,S.min),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_CUBE_MAP,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),this._bindTextureDirectly(d.TEXTURE_CUBE_MAP,null),g.generateMipMaps=c,g.samplingMode=f,g.isReady=!0,g},_t.prototype.updateRawCubeTexture=function(i,s,n,o,c,h=null,f=0){i._bufferViewArray=s,i.format=n,i.type=o,i.invertY=c,i._compression=h;const _=this._gl,d=this._getWebGLTextureType(o);let g=this._getInternalFormat(n);const p=this._getRGBABufferInternalSizedFormat(o);let b=!1;g===_.RGB&&(g=_.RGBA,b=!0),this._bindTextureDirectly(_.TEXTURE_CUBE_MAP,i,!0),this._unpackFlipY(c===void 0?!0:!!c),i.width%4!==0&&_.pixelStorei(_.UNPACK_ALIGNMENT,1);for(let E=0;E<6;E++){let v=s[E];h?_.compressedTexImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+E,f,this.getCaps().s3tc[h],i.width,i.height,0,v):(b&&(v=r(v,i.width,i.height,o)),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+E,f,p,i.width,i.height,0,g,d,v))}(!this.needPOTTextures||Af(i.width)&&Af(i.height))&&i.generateMipMaps&&f===0&&this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),i.isReady=!0},_t.prototype.createRawCubeTextureFromUrl=function(i,s,n,o,c,h,f,_,d=null,g=null,p=3,b=!1){const x=this._gl,E=this.createRawCubeTexture(null,n,o,c,!h,b,p,null);s?.addPendingData(E),E.url=i,E.isReady=!1,this._internalTexturesCache.push(E);const v=(R,P)=>{s?.removePendingData(E),g&&g(R?R.status+" "+R.statusText:"Failed to parse texture data",P)},S=async R=>{if(!E._hardwareTexture)return;const P=f(R);if(!P)return;const M=P instanceof Promise?await P:P,O=E.width;if(_){const D=this._getWebGLTextureType(c);let w=this._getInternalFormat(o);const G=this._getRGBABufferInternalSizedFormat(c);let H=!1;w===x.RGB&&(w=x.RGBA,H=!0),this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,E,!0),this._unpackFlipY(!1);const ie=_(M);for(let ne=0;ne<ie.length;ne++){const ce=O>>ne;for(let k=0;k<6;k++){let te=ie[ne][k];H&&(te=r(te,ce,ce,c)),x.texImage2D(k,ne,G,ce,ce,0,w,D,te)}}this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,null)}else this.updateRawCubeTexture(E,M,o,c,b);E.isReady=!0,s?.removePendingData(E),E.onLoadedObservable.notifyObservers(E),E.onLoadedObservable.clear(),d&&d()};return this._loadFile(i,R=>{S(R).catch(P=>{v(void 0,P)})},void 0,s?.offlineProvider,!0,v),E},_t.prototype.createRawTexture2DArray=e(!1),_t.prototype.createRawTexture3D=e(!0),_t.prototype.updateRawTexture2DArray=t(!1),_t.prototype.updateRawTexture3D=t(!0)}AP();let Rx=!1;function RP(){Rx||(Rx=!0,_t.prototype._readTexturePixelsSync=function(r,e,t,i=-1,s=0,n=null,o=!0,c=!1,h=0,f=0){const _=this._gl;if(!_)throw new Error("Engine does not have gl rendering context.");if(!this._dummyFramebuffer){const g=_.createFramebuffer();if(!g)throw new Error("Unable to create dummy framebuffer");this._dummyFramebuffer=g}_.bindFramebuffer(_.FRAMEBUFFER,this._dummyFramebuffer),i>-1&&(r.is2DArray||r.is3D)?_.framebufferTextureLayer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,r._hardwareTexture?.underlyingResource,s,i):i>-1?_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+i,r._hardwareTexture?.underlyingResource,s):_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,r._hardwareTexture?.underlyingResource,s);let d=r.type!==void 0?this._getWebGLTextureType(r.type):_.UNSIGNED_BYTE;if(c)n||(n=RD(r.type,4*e*t));else switch(d){case _.UNSIGNED_BYTE:n||(n=new Uint8Array(4*e*t)),d=_.UNSIGNED_BYTE;break;default:n||(n=new Float32Array(4*e*t)),d=_.FLOAT;break}return o&&this.flushFramebuffer(),_.readPixels(h,f,e,t,_.RGBA,d,n),_.bindFramebuffer(_.FRAMEBUFFER,this._currentFramebuffer),n},_t.prototype._readTexturePixels=function(r,e,t,i=-1,s=0,n=null,o=!0,c=!1,h=0,f=0){return Promise.resolve(this._readTexturePixelsSync(r,e,t,i,s,n,o,c,h,f))})}RP();let Sx=!1;function Qv(){Sx||(Sx=!0,_t.prototype.updateDynamicIndexBuffer=function(r,e,t=0){this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(r);let i;r.is32Bits?i=e instanceof Uint32Array?e:new Uint32Array(e):i=e instanceof Uint16Array?e:new Uint16Array(e),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},_t.prototype.updateDynamicVertexBuffer=function(r,e,t,i){this.bindArrayBuffer(r),t===void 0&&(t=0);const s=e.byteLength||e.length;i===void 0||i>=s&&t===0?e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,new Float32Array(e)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e):e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,new Float32Array(e).subarray(0,i/4)):(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,i):e=new Uint8Array(e,0,i),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,t,e)),this._resetVertexBufferBinding()})}Qv();let Mx=!1;function SP(){Mx||(Mx=!0,_t.prototype._createDepthStencilCubeTexture=function(r,e){const t=new ws(this,12);if(t.isCube=!0,this.webGLVersion===1)return Ee.Error("Depth cube texture is not supported by WebGL 1."),t;const i={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e},s=this._gl;this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,t,!0),this._setupDepthStencilTexture(t,r,i.bilinearFiltering,i.comparisonFunction);for(let n=0;n<6;n++)i.generateStencil?s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,s.DEPTH24_STENCIL8,r,r,0,s.DEPTH_STENCIL,s.UNSIGNED_INT_24_8,null):s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,s.DEPTH_COMPONENT24,r,r,0,s.DEPTH_COMPONENT,s.UNSIGNED_INT,null);return this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._internalTexturesCache.push(t),t},_t.prototype._setCubeMapTextureParams=function(r,e,t){const i=this._gl;i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,e?i.LINEAR_MIPMAP_LINEAR:i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),r.samplingMode=e?3:2,e&&this.getCaps().textureMaxLevel&&t!==void 0&&t>0&&(i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_LEVEL,t),r._maxLodLevel=t),this._bindTextureDirectly(i.TEXTURE_CUBE_MAP,null)},_t.prototype.createCubeTexture=function(r,e,t,i,s=null,n=null,o,c=null,h=!1,f=0,_=0,d=null,g,p=!1,b=null){const x=this._gl;return this.createCubeTextureBase(r,e,t,!!i,s,n,o,c,h,f,_,d,E=>this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,E,!0),(E,v)=>{const S=this.needPOTTextures?Um(v[0].width,this._caps.maxCubemapTextureSize):v[0].width,R=S,P=[x.TEXTURE_CUBE_MAP_POSITIVE_X,x.TEXTURE_CUBE_MAP_POSITIVE_Y,x.TEXTURE_CUBE_MAP_POSITIVE_Z,x.TEXTURE_CUBE_MAP_NEGATIVE_X,x.TEXTURE_CUBE_MAP_NEGATIVE_Y,x.TEXTURE_CUBE_MAP_NEGATIVE_Z];this._bindTextureDirectly(x.TEXTURE_CUBE_MAP,E,!0),this._unpackFlipY(!1);const M=o?this._getInternalFormat(o,E._useSRGBBuffer):E._useSRGBBuffer?this._glSRGBExtensionValues.SRGB8_ALPHA8:x.RGBA;let O=o?this._getInternalFormat(o):x.RGBA;E._useSRGBBuffer&&this.webGLVersion===1&&(O=M);for(let D=0;D<P.length;D++)if(v[D].width!==S||v[D].height!==R){if(this._prepareWorkingCanvas(),!this._workingCanvas||!this._workingContext){Ee.Warn("Cannot create canvas to resize texture.");return}this._workingCanvas.width=S,this._workingCanvas.height=R,this._workingContext.drawImage(v[D],0,0,v[D].width,v[D].height,0,0,S,R),x.texImage2D(P[D],0,M,O,x.UNSIGNED_BYTE,this._workingCanvas)}else x.texImage2D(P[D],0,M,O,x.UNSIGNED_BYTE,v[D]);i||x.generateMipmap(x.TEXTURE_CUBE_MAP),this._setCubeMapTextureParams(E,!i),E.width=S,E.height=R,E.isReady=!0,o&&(E.format=o),E.onLoadedObservable.notifyObservers(E),E.onLoadedObservable.clear(),s&&s()},!!p,b)},_t.prototype.generateMipMapsForCubemap=function(r,e=!0){if(r.generateMipMaps){const t=this._gl;this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,r,!0),t.generateMipmap(t.TEXTURE_CUBE_MAP),e&&this._bindTextureDirectly(t.TEXTURE_CUBE_MAP,null)}})}SP();class MP{get depthStencilTexture(){return this._depthStencilTexture}setDepthStencilTexture(e,t=!0){t&&this._depthStencilTexture&&this._depthStencilTexture.dispose(),this._depthStencilTexture=e,this._generateDepthBuffer=this._generateStencilBuffer=this._depthStencilTextureWithStencil=!1,e&&(this._generateDepthBuffer=!0,this._generateStencilBuffer=this._depthStencilTextureWithStencil=oh(e.format))}get depthStencilTextureWithStencil(){return this._depthStencilTextureWithStencil}get isCube(){return this._isCube}get isMulti(){return this._isMulti}get is2DArray(){return this.layers>0}get is3D(){return this.depth>0}get size(){return this.width}get width(){return this._size.width??this._size}get height(){return this._size.height??this._size}get layers(){return this._size.layers||0}get depth(){return this._size.depth||0}get texture(){return this._textures?.[0]??null}get textures(){return this._textures}get faceIndices(){return this._faceIndices}get layerIndices(){return this._layerIndices}getBaseArrayLayer(e){if(!this._textures)return-1;const t=this._textures[e],i=this._layerIndices?.[e]??0,s=this._faceIndices?.[e]??0;return t.isCube?i*6+s:t.is3D?0:i}get samples(){return this._samples}setSamples(e,t=!0,i=!1){if(this.samples===e&&!i)return e;const s=this._isMulti?this._engine.updateMultipleRenderTargetTextureSampleCount(this,e,t):this._engine.updateRenderTargetTextureSampleCount(this,e);return this._samples=e,s}resolveMSAATextures(){this.isMulti?this._engine.resolveMultiFramebuffer(this):this._engine.resolveFramebuffer(this)}generateMipMaps(){this._engine._currentRenderTarget===this&&(this.isMulti?this._engine.unBindMultiColorAttachmentFramebuffer(this,!0):this._engine.unBindFramebuffer(this,!0)),this.isMulti?this._engine.generateMipMapsMultiFramebuffer(this):this._engine.generateMipMapsFramebuffer(this)}constructor(e,t,i,s,n){this._textures=null,this._faceIndices=null,this._layerIndices=null,this._samples=1,this._attachments=null,this._generateStencilBuffer=!1,this._generateDepthBuffer=!1,this._depthStencilTextureWithStencil=!1,this.disableAutomaticMSAAResolve=!1,this.resolveMSAAColors=!0,this.resolveMSAADepth=!1,this.resolveMSAAStencil=!1,this.depthReadOnly=!1,this.stencilReadOnly=!1,this._isMulti=e,this._isCube=t,this._size=i,this._engine=s,this._depthStencilTexture=null,this.label=n}setTextures(e){Array.isArray(e)?this._textures=e:e?this._textures=[e]:this._textures=null}setTexture(e,t=0,i=!0){this._textures||(this._textures=[]),this._textures[t]!==e&&(this._textures[t]&&i&&this._textures[t].dispose(),this._textures[t]=e)}setLayerAndFaceIndices(e,t){this._layerIndices=e,this._faceIndices=t}setLayerAndFaceIndex(e=0,t,i){this._layerIndices||(this._layerIndices=[]),this._faceIndices||(this._faceIndices=[]),t!==void 0&&t>=0&&(this._layerIndices[e]=t),i!==void 0&&i>=0&&(this._faceIndices[e]=i)}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14,o){return this._depthStencilTexture?.dispose(),this._depthStencilTextureWithStencil=i,this._depthStencilTextureLabel=o,this._depthStencilTexture=this._engine.createDepthStencilTexture(this._size,{bilinearFiltering:t,comparisonFunction:e,generateStencil:i,isCube:this._isCube,samples:s,depthTextureFormat:n,label:o},this),this._depthStencilTexture}_shareDepth(e){this.shareDepth(e)}shareDepth(e){this._depthStencilTexture&&(e._depthStencilTexture&&e._depthStencilTexture.dispose(),e._depthStencilTexture=this._depthStencilTexture,e._depthStencilTextureWithStencil=this._depthStencilTextureWithStencil,this._depthStencilTexture.incrementReferences())}_swapAndDie(e){this.texture&&this.texture._swapAndDie(e),this._textures=null,this.dispose(!0)}_cloneRenderTargetWrapper(){let e=null;if(this._isMulti){const t=this.textures;if(t&&t.length>0){let i=!1,s=t.length,n=-1;const o=t[t.length-1]._source;(o===14||o===12)&&(i=!0,n=t[t.length-1].format,s--);const c=[],h=[],f=[],_=[],d=[],g=[],p=[],b={};for(let v=0;v<s;++v){const S=t[v];c.push(S.samplingMode),h.push(S.type),f.push(S.format),b[S.uniqueId]!==void 0?(_.push(-1),p.push(0)):(b[S.uniqueId]=v,S.is2DArray?(_.push(35866),p.push(S.depth)):S.isCube?(_.push(34067),p.push(0)):S.is3D?(_.push(32879),p.push(S.depth)):(_.push(3553),p.push(0))),this._faceIndices&&d.push(this._faceIndices[v]??0),this._layerIndices&&g.push(this._layerIndices[v]??0)}const x={samplingModes:c,generateMipMaps:t[0].generateMipMaps,generateDepthBuffer:this._generateDepthBuffer,generateStencilBuffer:this._generateStencilBuffer,generateDepthTexture:i,depthTextureFormat:n,types:h,formats:f,textureCount:s,targetTypes:_,faceIndex:d,layerIndex:g,layerCounts:p,label:this.label},E={width:this.width,height:this.height,depth:this.depth};e=this._engine.createMultipleRenderTarget(E,x);for(let v=0;v<s;++v){if(_[v]!==-1)continue;const S=b[t[v].uniqueId];e.setTexture(e.textures[S],v)}}}else{const t={};if(t.generateDepthBuffer=this._generateDepthBuffer,t.generateMipMaps=this.texture?.generateMipMaps??!1,t.generateStencilBuffer=this._generateStencilBuffer,t.samplingMode=this.texture?.samplingMode,t.type=this.texture?.type,t.format=this.texture?.format,t.noColorAttachment=!this._textures,t.label=this.label,this.isCube)e=this._engine.createRenderTargetCubeTexture(this.width,t);else{const i={width:this.width,height:this.height,layers:this.is2DArray||this.is3D?this.texture?.depth:void 0};e=this._engine.createRenderTargetTexture(i,t)}e.texture&&(e.texture.isReady=!0)}return e}_swapRenderTargetWrapper(e){if(this._textures&&e._textures)for(let t=0;t<this._textures.length;++t)this._textures[t]._swapAndDie(e._textures[t],!1),e._textures[t].isReady=!0;this._depthStencilTexture&&e._depthStencilTexture&&(this._depthStencilTexture._swapAndDie(e._depthStencilTexture),e._depthStencilTexture.isReady=!0),this._textures=null,this._depthStencilTexture=null}_rebuild(){const e=this._cloneRenderTargetWrapper();if(e){if(this._depthStencilTexture){const t=this._depthStencilTexture.samplingMode,i=this._depthStencilTexture.format,s=t===2||t===3||t===11;e.createDepthStencilTexture(this._depthStencilTexture._comparisonFunction,s,this._depthStencilTextureWithStencil,this._depthStencilTexture.samples,i,this._depthStencilTextureLabel)}this.samples>1&&e.setSamples(this.samples),e._swapRenderTargetWrapper(this),e.dispose()}}releaseTextures(){if(this._textures)for(let e=0;e<this._textures.length;++e)this._textures[e].dispose();this._textures=null}dispose(e=!1){e||(this._depthStencilTexture?.dispose(),this._depthStencilTexture=null,this.releaseTextures()),this._engine._releaseRenderTargetWrapper(this)}}class CP extends MP{setDepthStencilTexture(e,t=!0){if(super.setDepthStencilTexture(e,t),!e)return;const i=this._engine,s=this._context,n=e._hardwareTexture;if(n&&e._autoMSAAManagement&&this._MSAAFramebuffer){const o=i._currentFramebuffer;i._bindUnboundFramebuffer(this._MSAAFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,oh(e.format)?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n.getMSAARenderBuffer()),i._bindUnboundFramebuffer(o)}}constructor(e,t,i,s,n){super(e,t,i,s),this._framebuffer=null,this._depthStencilBuffer=null,this._MSAAFramebuffer=null,this._colorTextureArray=null,this._depthStencilTextureArray=null,this._disposeOnlyFramebuffers=!1,this._currentLOD=0,this._context=n}_cloneRenderTargetWrapper(){let e;return this._colorTextureArray&&this._depthStencilTextureArray?(e=this._engine.createMultiviewRenderTargetTexture(this.width,this.height),e.texture.isReady=!0):e=super._cloneRenderTargetWrapper(),e}_swapRenderTargetWrapper(e){super._swapRenderTargetWrapper(e),e._framebuffer=this._framebuffer,e._depthStencilBuffer=this._depthStencilBuffer,e._MSAAFramebuffer=this._MSAAFramebuffer,e._colorTextureArray=this._colorTextureArray,e._depthStencilTextureArray=this._depthStencilTextureArray,this._framebuffer=this._depthStencilBuffer=this._MSAAFramebuffer=this._colorTextureArray=this._depthStencilTextureArray=null}createDepthStencilTexture(e=0,t=!0,i=!1,s=1,n=14,o){if(this._depthStencilBuffer){const c=this._engine,h=c._currentFramebuffer,f=this._context;c._bindUnboundFramebuffer(this._framebuffer),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,null),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,null),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.STENCIL_ATTACHMENT,f.RENDERBUFFER,null),c._bindUnboundFramebuffer(h),f.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null}return super.createDepthStencilTexture(e,t,i,s,n,o)}shareDepth(e){super.shareDepth(e);const t=this._context,i=this._depthStencilBuffer,s=e._MSAAFramebuffer||e._framebuffer,n=this._engine;e._depthStencilBuffer&&e._depthStencilBuffer!==i&&t.deleteRenderbuffer(e._depthStencilBuffer),e._depthStencilBuffer=i;const o=e._generateStencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;n._bindUnboundFramebuffer(s),t.framebufferRenderbuffer(t.FRAMEBUFFER,o,t.RENDERBUFFER,i),n._bindUnboundFramebuffer(null)}_bindTextureRenderTarget(e,t=0,i,s=0){const n=e._hardwareTexture;if(!n)return;const o=this._framebuffer,c=this._engine,h=c._currentFramebuffer;c._bindUnboundFramebuffer(o);let f;if(c.webGLVersion>1){const _=this._context;f=_["COLOR_ATTACHMENT"+t],e.is2DArray||e.is3D?(i=i??this.layerIndices?.[t]??0,_.framebufferTextureLayer(_.FRAMEBUFFER,f,n.underlyingResource,s,i)):e.isCube?(i=i??this.faceIndices?.[t]??0,_.framebufferTexture2D(_.FRAMEBUFFER,f,_.TEXTURE_CUBE_MAP_POSITIVE_X+i,n.underlyingResource,s)):_.framebufferTexture2D(_.FRAMEBUFFER,f,_.TEXTURE_2D,n.underlyingResource,s)}else{const _=this._context;f=_["COLOR_ATTACHMENT"+t+"_WEBGL"];const d=i!==void 0?_.TEXTURE_CUBE_MAP_POSITIVE_X+i:_.TEXTURE_2D;_.framebufferTexture2D(_.FRAMEBUFFER,f,d,n.underlyingResource,s)}if(e._autoMSAAManagement&&this._MSAAFramebuffer){const _=this._context;c._bindUnboundFramebuffer(this._MSAAFramebuffer),_.framebufferRenderbuffer(_.FRAMEBUFFER,f,_.RENDERBUFFER,n.getMSAARenderBuffer())}c._bindUnboundFramebuffer(h)}setTexture(e,t=0,i=!0){super.setTexture(e,t,i),this._bindTextureRenderTarget(e,t)}setLayerAndFaceIndices(e,t){if(super.setLayerAndFaceIndices(e,t),!this.textures||!this.layerIndices||!this.faceIndices)return;const i=this._attachments?.length??this.textures.length;for(let s=0;s<i;s++){const n=this.textures[s];n&&(n.is2DArray||n.is3D?this._bindTextureRenderTarget(n,s,this.layerIndices[s]):n.isCube?this._bindTextureRenderTarget(n,s,this.faceIndices[s]):this._bindTextureRenderTarget(n,s))}}setLayerAndFaceIndex(e=0,t,i){if(super.setLayerAndFaceIndex(e,t,i),!this.textures||!this.layerIndices||!this.faceIndices)return;const s=this.textures[e];s.is2DArray||s.is3D?this._bindTextureRenderTarget(this.textures[e],e,this.layerIndices[e]):s.isCube&&this._bindTextureRenderTarget(this.textures[e],e,this.faceIndices[e])}resolveMSAATextures(){const e=this._engine,t=e._currentFramebuffer;e._bindUnboundFramebuffer(this._MSAAFramebuffer),super.resolveMSAATextures(),e._bindUnboundFramebuffer(t)}dispose(e=this._disposeOnlyFramebuffers){const t=this._context;e||(this._colorTextureArray&&(this._context.deleteTexture(this._colorTextureArray),this._colorTextureArray=null),this._depthStencilTextureArray&&(this._context.deleteTexture(this._depthStencilTextureArray),this._depthStencilTextureArray=null)),this._framebuffer&&(t.deleteFramebuffer(this._framebuffer),this._framebuffer=null),this._depthStencilBuffer&&(t.deleteRenderbuffer(this._depthStencilBuffer),this._depthStencilBuffer=null),this._MSAAFramebuffer&&(t.deleteFramebuffer(this._MSAAFramebuffer),this._MSAAFramebuffer=null),super.dispose(e)}}let Cx=!1;function IP(){Cx||(Cx=!0,_t.prototype._createHardwareRenderTargetWrapper=function(r,e,t){const i=new CP(r,e,t,this,this._gl);return this._renderTargetWrapperCache.push(i),i},_t.prototype.createRenderTargetTexture=function(r,e){const t=this._createHardwareRenderTargetWrapper(!1,!1,r);let i=!0,s=!1,n=!1,o,c=1,h;e!==void 0&&typeof e=="object"&&(i=e.generateDepthBuffer??!0,s=!!e.generateStencilBuffer,n=!!e.noColorAttachment,o=e.colorAttachment,c=e.samples??1,h=e.label);const f=o||(n?null:this._createInternalTexture(r,e,!0,5)),_=r.width||r,d=r.height||r,g=this._currentFramebuffer,p=this._gl,b=p.createFramebuffer();if(this._bindUnboundFramebuffer(b),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(s,i,_,d),f&&!f.is2DArray&&!f.is3D&&p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_2D,f._hardwareTexture.underlyingResource,0),this._bindUnboundFramebuffer(g),t.label=h??"RenderTargetWrapper",t._framebuffer=b,t._generateDepthBuffer=i,t._generateStencilBuffer=s,t.setTextures(f),!o)this.updateRenderTargetTextureSampleCount(t,c);else if(t._samples=o.samples,o.samples>1){const x=o._hardwareTexture.getMSAARenderBuffer(0);t._MSAAFramebuffer=p.createFramebuffer(),this._bindUnboundFramebuffer(t._MSAAFramebuffer),p.framebufferRenderbuffer(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.RENDERBUFFER,x),this._bindUnboundFramebuffer(null)}return t},_t.prototype._createDepthStencilTexture=function(r,e,t){const i=this._gl,s=r.layers||0,n=r.depth||0;let o=i.TEXTURE_2D;s!==0?o=i.TEXTURE_2D_ARRAY:n!==0&&(o=i.TEXTURE_3D);const c=new ws(this,12);if(c.label=e.label,!this._caps.depthTextureExtension)return Ee.Error("Depth texture is not supported by your browser or hardware."),c;const h={bilinearFiltering:!1,comparisonFunction:0,generateStencil:!1,...e};if(this._bindTextureDirectly(o,c,!0),this._setupDepthStencilTexture(c,r,h.comparisonFunction===0?!1:h.bilinearFiltering,h.comparisonFunction,h.samples),h.depthTextureFormat!==void 0){if(h.depthTextureFormat!==15&&h.depthTextureFormat!==16&&h.depthTextureFormat!==17&&h.depthTextureFormat!==13&&h.depthTextureFormat!==14&&h.depthTextureFormat!==18)return Ee.Error(`Depth texture ${h.depthTextureFormat} format is not supported.`),c;c.format=h.depthTextureFormat}else c.format=h.generateStencil?13:16;const f=oh(c.format),_=this._getWebGLTextureTypeFromDepthTextureFormat(c.format),d=f?i.DEPTH_STENCIL:i.DEPTH_COMPONENT,g=this._getInternalFormatFromDepthTextureFormat(c.format,!0,f);return c.is2DArray?i.texImage3D(o,0,g,c.width,c.height,s,0,d,_,null):c.is3D?i.texImage3D(o,0,g,c.width,c.height,n,0,d,_,null):i.texImage2D(o,0,g,c.width,c.height,0,d,_,null),this._bindTextureDirectly(o,null),this._internalTexturesCache.push(c),t._depthStencilBuffer&&(i.deleteRenderbuffer(t._depthStencilBuffer),t._depthStencilBuffer=null),this._bindUnboundFramebuffer(t._MSAAFramebuffer??t._framebuffer),t._generateStencilBuffer=f,t._depthStencilTextureWithStencil=f,t._depthStencilBuffer=this._setupFramebufferDepthAttachments(t._generateStencilBuffer,t._generateDepthBuffer,t.width,t.height,t.samples,c.format),this._bindUnboundFramebuffer(null),c},_t.prototype.updateRenderTargetTextureSampleCount=function(r,e){if(this.webGLVersion<2||!r)return 1;if(r.samples===e)return e;const t=this._gl;e=Math.min(e,this.getCaps().maxMSAASamples),r._depthStencilBuffer&&(t.deleteRenderbuffer(r._depthStencilBuffer),r._depthStencilBuffer=null),r._MSAAFramebuffer&&(t.deleteFramebuffer(r._MSAAFramebuffer),r._MSAAFramebuffer=null);const i=r.texture?._hardwareTexture;if(i?.releaseMSAARenderBuffers(),r.texture&&e>1&&typeof t.renderbufferStorageMultisample=="function"){const n=t.createFramebuffer();if(!n)throw new Error("Unable to create multi sampled framebuffer");r._MSAAFramebuffer=n,this._bindUnboundFramebuffer(r._MSAAFramebuffer);const o=this._createRenderBuffer(r.texture.width,r.texture.height,e,-1,this._getRGBABufferInternalSizedFormat(r.texture.type,r.texture.format,r.texture._useSRGBBuffer),t.COLOR_ATTACHMENT0,!1);if(!o)throw new Error("Unable to create multi sampled framebuffer");i?.addMSAARenderBuffer(o)}this._bindUnboundFramebuffer(r._MSAAFramebuffer??r._framebuffer),r.texture&&(r.texture.samples=e),r._samples=e;const s=r._depthStencilTexture?r._depthStencilTexture.format:void 0;return r._depthStencilBuffer=this._setupFramebufferDepthAttachments(r._generateStencilBuffer,r._generateDepthBuffer,r.width,r.height,e,s),this._bindUnboundFramebuffer(null),e},_t.prototype._setupDepthStencilTexture=function(r,e,t,i,s=1){const n=e.width??e,o=e.height??e,c=e.layers||0,h=e.depth||0;
184r.baseWidth=n,r.baseHeight=o,r.width=n,r.height=o,r.is2DArray=c>0,r.depth=c||h,r.isReady=!0,r.samples=s,r.generateMipMaps=!1,r.samplingMode=t?2:1,r.type=0,r._comparisonFunction=i;const f=this._gl,_=this._getTextureTarget(r),d=this._getSamplingParameters(r.samplingMode,!1);f.texParameteri(_,f.TEXTURE_MAG_FILTER,d.mag),f.texParameteri(_,f.TEXTURE_MIN_FILTER,d.min),f.texParameteri(_,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(_,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),this.webGLVersion>1&&(i===0?(f.texParameteri(_,f.TEXTURE_COMPARE_FUNC,515),f.texParameteri(_,f.TEXTURE_COMPARE_MODE,f.NONE)):(f.texParameteri(_,f.TEXTURE_COMPARE_FUNC,i),f.texParameteri(_,f.TEXTURE_COMPARE_MODE,f.COMPARE_REF_TO_TEXTURE)))})}IP();let Ix=!1;function DP(){Ix||(Ix=!0,_t.prototype.setDepthStencilTexture=function(r,e,t,i){r!==void 0&&(e&&(this._boundUniforms[r]=e),!t||!t.depthStencilTexture?this._setTexture(r,null,void 0,void 0,i):this._setTexture(r,t,!1,!0,i))})}DP();let Dx=!1;function PP(){Dx||(Dx=!0,_t.prototype.createRenderTargetCubeTexture=function(r,e){const t=this._createHardwareRenderTargetWrapper(!1,!0,r),i={generateMipMaps:!0,generateDepthBuffer:!0,generateStencilBuffer:!1,type:0,samplingMode:3,format:5,...e};i.generateStencilBuffer=i.generateDepthBuffer&&i.generateStencilBuffer,(i.type===1&&!this._caps.textureFloatLinearFiltering||i.type===2&&!this._caps.textureHalfFloatLinearFiltering)&&(i.samplingMode=1);const s=this._gl,n=new ws(this,5);this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,n,!0);const o=this._getSamplingParameters(i.samplingMode,i.generateMipMaps);i.type===1&&!this._caps.textureFloat&&(i.type=0,Ee.Warn("Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type")),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,o.mag),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,o.min),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE);for(let h=0;h<6;h++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,this._getRGBABufferInternalSizedFormat(i.type,i.format),r,r,0,this._getInternalFormat(i.format),this._getWebGLTextureType(i.type),null);const c=s.createFramebuffer();return this._bindUnboundFramebuffer(c),t._depthStencilBuffer=this._setupFramebufferDepthAttachments(i.generateStencilBuffer,i.generateDepthBuffer,r,r),i.generateMipMaps&&s.generateMipmap(s.TEXTURE_CUBE_MAP),this._bindTextureDirectly(s.TEXTURE_CUBE_MAP,null),this._bindUnboundFramebuffer(null),t._framebuffer=c,t._generateDepthBuffer=i.generateDepthBuffer,t._generateStencilBuffer=i.generateStencilBuffer,n.width=r,n.height=r,n.isReady=!0,n.isCube=!0,n.samples=1,n.generateMipMaps=i.generateMipMaps,n.samplingMode=i.samplingMode,n.type=i.type,n.format=i.format,this._internalTexturesCache.push(n),t.setTextures(n),t})}PP();const OP="modulepreload",wP=function(r){return"/"+r},Px={},ts=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let h=function(f){return Promise.all(f.map(_=>Promise.resolve(_).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");s=h(t.map(f=>{if(f=wP(f),f in Px)return;Px[f]=!0;const _=f.endsWith(".css"),d=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${d}`))return;const g=document.createElement("link");if(g.rel=_?"stylesheet":OP,_||(g.as="script"),g.crossOrigin="",g.href=f,c&&g.setAttribute("nonce",c),document.head.appendChild(g),_)return new Promise((p,b)=>{g.addEventListener("load",p),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function n(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return s.then(o=>{for(const c of o||[])c.status==="rejected"&&n(c.reason);return e().catch(n)})},FP=1/2.2,LP=2.2,Fi=(1+Math.sqrt(5))/2;let It=.001;function Nr(r,e){const t=[];for(let i=0;i<r;++i)t.push(e());return t}function wa(r,e){return Nr(r,e)}function BP(r,e,t){const i=r[e];if(typeof i!="function")return null;const s=function(){const n=r.length,o=s.previous.apply(r,arguments);return t(e,n),o};return i.next=s,s.previous=i,r[e]=s,()=>{const n=s.previous;if(!n)return;const o=s.next;o?(n.next=o,o.previous=n):(n.next=void 0,r[e]=n),s.next=void 0,s.previous=void 0}}const NP=["push","splice","pop","shift","unshift"];function UP(r,e){const t=NP.map(i=>BP(r,i,e));return()=>{for(const i of t)i?.()}}function ei(r,e,t=1401298e-51){return Math.abs(r-e)<=t}function Ci(r,e){return r===e?r:Math.random()*(e-r)+r}function kf(r,e,t){return r+(e-r)*t}function kP(r,e,t,i,s){const n=s*s,o=s*n,c=2*o-3*n+1,h=-2*o+3*n,f=o-2*n+s,_=o-n;return r*c+t*h+e*f+i*_}function yi(r,e=0,t=1){return Math.min(t,Math.max(e,r))}function zP(r){return r-=Math.PI*2*Math.floor((r+Math.PI)/(Math.PI*2)),r}function Xn(r){const e=r.toString(16);return r<=15?("0"+e).toUpperCase():e.toUpperCase()}function ML(r){if(Math.log2)return Math.floor(Math.log2(r));if(r<0)return NaN;if(r===0)return-1/0;let e=0;if(r<1){for(;r<1;)e++,r=r*2;e=-e}else if(r>1)for(;r>1;)e++,r=Math.floor(r/2);return e}function zm(r,e){const t=r%e;return t===0?e:zm(e,t)}class dg{}dg._UpdateFlagSeed=0;function $v(r){r.updateFlag=dg._UpdateFlagSeed++}function Jv(r,e,t,i=0){const s=r.asArray(),n=e.asArray(),o=s[0],c=s[1],h=s[2],f=s[3],_=s[4],d=s[5],g=s[6],p=s[7],b=s[8],x=s[9],E=s[10],v=s[11],S=s[12],R=s[13],P=s[14],M=s[15],O=n[0],D=n[1],w=n[2],G=n[3],H=n[4],ie=n[5],ne=n[6],ce=n[7],k=n[8],te=n[9],X=n[10],q=n[11],W=n[12],K=n[13],Z=n[14],F=n[15];t[i]=o*O+c*H+h*k+f*W,t[i+1]=o*D+c*ie+h*te+f*K,t[i+2]=o*w+c*ne+h*X+f*Z,t[i+3]=o*G+c*ce+h*q+f*F,t[i+4]=_*O+d*H+g*k+p*W,t[i+5]=_*D+d*ie+g*te+p*K,t[i+6]=_*w+d*ne+g*X+p*Z,t[i+7]=_*G+d*ce+g*q+p*F,t[i+8]=b*O+x*H+E*k+v*W,t[i+9]=b*D+x*ie+E*te+v*K,t[i+10]=b*w+x*ne+E*X+v*Z,t[i+11]=b*G+x*ce+E*q+v*F,t[i+12]=S*O+R*H+P*k+M*W,t[i+13]=S*D+R*ie+P*te+M*K,t[i+14]=S*w+R*ne+P*X+M*Z,t[i+15]=S*G+R*ce+P*q+M*F}function lh(r,e,t,i=0){Jv(r,e,t.asArray(),i),$v(t)}function VP(r,e,t=0){const i=r.asArray();e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15]}function zf(r,e){const t=eA(r,e.asArray());return t&&$v(e),t}function eA(r,e){const t=r.asArray(),i=t[0],s=t[1],n=t[2],o=t[3],c=t[4],h=t[5],f=t[6],_=t[7],d=t[8],g=t[9],p=t[10],b=t[11],x=t[12],E=t[13],v=t[14],S=t[15],R=p*S-v*b,P=g*S-E*b,M=g*v-E*p,O=d*S-x*b,D=d*v-p*x,w=d*E-x*g,G=+(h*R-f*P+_*M),H=-(c*R-f*O+_*D),ie=+(c*P-h*O+_*w),ne=-(c*M-h*D+f*w),ce=i*G+s*H+n*ie+o*ne;if(ce===0)return!1;const k=1/ce,te=f*S-v*_,X=h*S-E*_,q=h*v-E*f,W=c*S-x*_,K=c*v-x*f,Z=c*E-x*h,F=f*b-p*_,A=h*b-g*_,N=h*p-g*f,Y=c*b-d*_,se=c*p-d*f,ue=c*g-d*h,pe=-(s*R-n*P+o*M),Ie=+(i*R-n*O+o*D),Le=-(i*P-s*O+o*w),J=+(i*M-s*D+n*w),_e=+(s*te-n*X+o*q),ye=-(i*te-n*W+o*K),Ne=+(i*X-s*W+o*Z),Je=-(i*q-s*K+n*Z),je=-(s*F-n*A+o*N),yt=+(i*F-n*Y+o*se),Yt=-(i*A-s*Y+o*ue),kt=+(i*N-s*se+n*ue);return e[0]=G*k,e[1]=pe*k,e[2]=_e*k,e[3]=je*k,e[4]=H*k,e[5]=Ie*k,e[6]=ye*k,e[7]=yt*k,e[8]=ie*k,e[9]=Le*k,e[10]=Ne*k,e[11]=Yt*k,e[12]=ne*k,e[13]=J*k,e[14]=Je*k,e[15]=kt*k,!0}const tA={};function In(r,e){tA[r]=e}function Vf(r){return tA[r]}const Os=r=>parseInt(r.toString().replace(/\W/g,""));class He{constructor(e=0,t=0){this.x=e,this.y=t}toString(){return`{X: ${this.x} Y: ${this.y}}`}getClassName(){return"Vector2"}getHashCode(){const e=Os(this.x),t=Os(this.y);let i=e;return i=i*397^t,i}toArray(e,t=0){return e[t]=this.x,e[t+1]=this.y,this}fromArray(e,t=0){return He.FromArrayToRef(e,t,this),this}asArray(){return[this.x,this.y]}copyFrom(e){return this.x=e.x,this.y=e.y,this}copyFromFloats(e,t){return this.x=e,this.y=t,this}set(e,t){return this.copyFromFloats(e,t)}setAll(e){return this.copyFromFloats(e,e)}add(e){return new He(this.x+e.x,this.y+e.y)}addToRef(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addInPlaceFromFloats(e,t){return this.x+=e,this.y+=t,this}addVector3(e){return new He(this.x+e.x,this.y+e.y)}subtract(e){return new He(this.x-e.x,this.y-e.y)}subtractToRef(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t}
vendor: 77,880 bytes, lines 184-187
184subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this}multiply(e){return new He(this.x*e.x,this.y*e.y)}multiplyToRef(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t}multiplyByFloats(e,t){return new He(this.x*e,this.y*t)}divide(e){return new He(this.x/e.x,this.y/e.y)}divideToRef(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t}divideInPlace(e){return this.x=this.x/e.x,this.y=this.y/e.y,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.x,e.y)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.x,e.y)}minimizeInPlaceFromFloats(e,t){return this.x=Math.min(e,this.x),this.y=Math.min(t,this.y),this}maximizeInPlaceFromFloats(e,t){return this.x=Math.max(e,this.x),this.y=Math.max(t,this.y),this}subtractFromFloats(e,t){return new He(this.x-e,this.y-t)}subtractFromFloatsToRef(e,t,i){return i.x=this.x-e,i.y=this.y-t,i}negate(){return new He(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(e){return e.x=-this.x,e.y=-this.y,e}scaleInPlace(e){return this.x*=e,this.y*=e,this}scale(e){return new He(this.x*e,this.y*e)}scaleToRef(e,t){return t.x=this.x*e,t.y=this.y*e,t}scaleAndAddToRef(e,t){return t.x+=this.x*e,t.y+=this.y*e,t}equals(e){return e&&this.x===e.x&&this.y===e.y}equalsWithEpsilon(e,t=It){return e&&ei(this.x,e.x,t)&&ei(this.y,e.y,t)}equalsToFloats(e,t){return this.x===e&&this.y===t}floor(){return new He(Math.floor(this.x),Math.floor(this.y))}floorToRef(e){return e.x=Math.floor(this.x),e.y=Math.floor(this.y),e}fract(){return new He(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(e){return e.x=this.x-Math.floor(this.x),e.y=this.y-Math.floor(this.y),e}rotate(e){return this.rotateToRef(e,new He)}rotateToRef(e,t){const i=Math.cos(e),s=Math.sin(e);return t.x=i*this.x-s*this.y,t.y=s*this.x+i*this.y,t}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new He;return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0&&(e.x=this.x,e.y=this.y),this.scaleToRef(1/t,e)}clone(){return new He(this.x,this.y)}dot(e){return this.x*e.x+this.y*e.y}static Zero(){return new He(0,0)}static One(){return new He(1,1)}static Random(e=0,t=1){return new He(Ci(e,t),Ci(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(Ci(e,t),Ci(e,t))}static get ZeroReadOnly(){return He._ZeroReadOnly}static FromArray(e,t=0){return new He(e[t],e[t+1])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i}static FromFloatsToRef(e,t,i){return i.copyFromFloats(e,t),i}static CatmullRom(e,t,i,s,n){const o=n*n,c=n*o,h=.5*(2*t.x+(-e.x+i.x)*n+(2*e.x-5*t.x+4*i.x-s.x)*o+(-e.x+3*t.x-3*i.x+s.x)*c),f=.5*(2*t.y+(-e.y+i.y)*n+(2*e.y-5*t.y+4*i.y-s.y)*o+(-e.y+3*t.y-3*i.y+s.y)*c);return new He(h,f)}static ClampToRef(e,t,i,s){return s.x=yi(e.x,t.x,i.x),s.y=yi(e.y,t.y,i.y),s}static Clamp(e,t,i){const s=yi(e.x,t.x,i.x),n=yi(e.y,t.y,i.y);return new He(s,n)}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,d=c-o,g=e.x*h+i.x*f+t.x*_+s.x*d,p=e.y*h+i.y*f+t.y*_+s.y*d;return new He(g,p)}static Hermite1stDerivative(e,t,i,s,n){return this.Hermite1stDerivativeToRef(e,t,i,s,n,new He)}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;return o.x=(c-n)*6*e.x+(3*c-4*n+1)*t.x+(-c+n)*6*i.x+(3*c-2*n)*s.x,o.y=(c-n)*6*e.y+(3*c-4*n+1)*t.y+(-c+n)*6*i.y+(3*c-2*n)*s.y,o}static Lerp(e,t,i){return He.LerpToRef(e,t,i,new He)}static LerpToRef(e,t,i,s){return s.x=e.x+(t.x-e.x)*i,s.y=e.y+(t.y-e.y)*i,s}static Dot(e,t){return e.x*t.x+e.y*t.y}static Normalize(e){return He.NormalizeToRef(e,new He)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=e.x<t.x?e.x:t.x,s=e.y<t.y?e.y:t.y;return new He(i,s)}static Maximize(e,t){const i=e.x>t.x?e.x:t.x,s=e.y>t.y?e.y:t.y;return new He(i,s)}static Transform(e,t){return He.TransformToRef(e,t,new He)}static TransformToRef(e,t,i){const s=t.m,n=e.x*s[0]+e.y*s[4]+s[12],o=e.x*s[1]+e.y*s[5]+s[13];return i.x=n,i.y=o,i}static PointInTriangle(e,t,i,s){const n=.5*(-i.y*s.x+t.y*(-i.x+s.x)+t.x*(i.y-s.y)+i.x*s.y),o=n<0?-1:1,c=(t.y*s.x-t.x*s.y+(s.y-t.y)*e.x+(t.x-s.x)*e.y)*o,h=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*o;return c>0&&h>0&&c+h<2*n*o}static Distance(e,t){return Math.sqrt(He.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y;return i*i+s*s}static Center(e,t){return He.CenterToRef(e,t,new He)}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2)}static DistanceOfPointFromSegment(e,t,i){const s=He.DistanceSquared(t,i);if(s===0)return He.Distance(e,t);const n=i.subtract(t),o=Math.max(0,Math.min(1,He.Dot(e.subtract(t),n)/s)),c=t.add(n.multiplyByFloats(o,o));return He.Distance(e,c)}}He._V8PerformanceHack=new He(.5,.5);He._ZeroReadOnly=He.Zero();class I{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}constructor(e=0,t=0,i=0){this._isDirty=!0,this._x=e,this._y=t,this._z=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){const e=Os(this._x),t=Os(this._y),i=Os(this._z);let s=e;return s=s*397^t,s=s*397^i,s}asArray(){return[this._x,this._y,this._z]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this}fromArray(e,t=0){return I.FromArrayToRef(e,t,this),this}toQuaternion(){return Ue.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._isDirty=!0,this}addInPlaceFromFloats(e,t,i){return this._x+=e,this._y+=t,this._z+=i,this._isDirty=!0,this}add(e){return new I(this._x+e._x,this._y+e._y,this._z+e._z)}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._isDirty=!0,t}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this}subtract(e){return new I(this._x-e._x,this._y-e._y,this._z-e._z)}subtractToRef(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)}subtractFromFloats(e,t,i){return new I(this._x-e,this._y-t,this._z-i)}subtractFromFloatsToRef(e,t,i,s){return s._x=this._x-e,s._y=this._y-t,s._z=this._z-i,s._isDirty=!0,s}negate(){return new I(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(e){return e._x=this._x*-1,e._y=this._y*-1,e._z=this._z*-1,e._isDirty=!0,e}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this}scale(e){return new I(this._x*e,this._y*e,this._z*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._isDirty=!0,t}getNormalToRef(e){const t=this.length();let i=Math.acos(this._y/t);const s=Math.atan2(this._z,this._x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;const n=t*Math.sin(i)*Math.cos(s),o=t*Math.cos(i),c=t*Math.sin(i)*Math.sin(s);return e.set(n,o,c),e}applyRotationQuaternionToRef(e,t){const i=this._x,s=this._y,n=this._z,o=e._x,c=e._y,h=e._z,f=e._w,_=2*(c*n-h*s),d=2*(h*i-o*n),g=2*(o*s-c*i);return t._x=i+f*_+c*g-h*d,t._y=s+f*d+h*_-o*g,t._z=n+f*g+o*d-c*_,t._isDirty=!0,t}applyRotationQuaternionInPlace(e){return this.applyRotationQuaternionToRef(e,this)}applyRotationQuaternion(e){return this.applyRotationQuaternionToRef(e,new I)}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._isDirty=!0,t}projectOnPlane(e,t){return this.projectOnPlaneToRef(e,t,new I)}projectOnPlaneToRef(e,t,i){const s=e.normal,n=e.d,o=Ge.Vector3[0];this.subtractToRef(t,o),o.normalize();const c=I.Dot(o,s);if(Math.abs(c)<1e-10)i.setAll(1/0);else{const h=-(I.Dot(t,s)+n)/c,f=o.scaleInPlace(h);t.addToRef(f,i)}return i}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z}equalsWithEpsilon(e,t=It){return e&&ei(this._x,e._x,t)&&ei(this._y,e._y,t)&&ei(this._z,e._z,t)}equalsToFloats(e,t,i){return this._x===e&&this._y===t&&this._z===i}multiplyInPlace(e){return this._x*=e._x,this._y*=e._y,this._z*=e._z,this._isDirty=!0,this}multiply(e){return this.multiplyByFloats(e._x,e._y,e._z)}multiplyToRef(e,t){return t._x=this._x*e._x,t._y=this._y*e._y,t._z=this._z*e._z,t._isDirty=!0,t}multiplyByFloats(e,t,i){return new I(this._x*e,this._y*t,this._z*i)}divide(e){return new I(this._x/e._x,this._y/e._y,this._z/e._z)}divideToRef(e,t){return t._x=this._x/e._x,t._y=this._y/e._y,t._z=this._z/e._z,t._isDirty=!0,t}divideInPlace(e){return this._x=this._x/e._x,this._y=this._y/e._y,this._z=this._z/e._z,this._isDirty=!0,this}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e._x,e._y,e._z)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e._x,e._y,e._z)}minimizeInPlaceFromFloats(e,t,i){return e<this._x&&(this.x=e),t<this._y&&(this.y=t),i<this._z&&(this.z=i),this}maximizeInPlaceFromFloats(e,t,i){return e>this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this}isNonUniformWithinEpsilon(e){const t=Math.abs(this._x),i=Math.abs(this._y);if(!ei(t,i,e))return!0;const s=Math.abs(this._z);return!ei(t,s,e)||!ei(i,s,e)}get isNonUniform(){const e=Math.abs(this._x),t=Math.abs(this._y);if(e!==t)return!0;const i=Math.abs(this._z);return e!==i}floorToRef(e){return e._x=Math.floor(this._x),e._y=Math.floor(this._y),e._z=Math.floor(this._z),e._isDirty=!0,e}floor(){return new I(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fractToRef(e){return e._x=this._x-Math.floor(this._x),e._y=this._y-Math.floor(this._y),e._z=this._z-Math.floor(this._z),e._isDirty=!0,e}fract(){return new I(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z===0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(e){if(e=e.toLowerCase(),e==="xyz")return this;const t=Ge.Vector3[0].copyFrom(this);return this.x=t[e[0]],this.y=t[e[1]],this.z=t[e[2]],this}rotateByQuaternionToRef(e,t){return e.toRotationMatrix(Ge.Matrix[0]),I.TransformCoordinatesToRef(this,Ge.Matrix[0],t),t}rotateByQuaternionAroundPointToRef(e,t,i){return this.subtractToRef(t,Ge.Vector3[0]),Ge.Vector3[0].rotateByQuaternionToRef(e,Ge.Vector3[0]),t.addToRef(Ge.Vector3[0],i),i}cross(e){return I.CrossToRef(this,e,new I)}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new I)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e._x=this._x,e._y=this._y,e._z=this._z,e._isDirty=!0,e):this.scaleToRef(1/t,e)}clone(){return new I(this._x,this._y,this._z)}copyFrom(e){return this.copyFromFloats(e._x,e._y,e._z)}copyFromFloats(e,t,i){return this._x=e,this._y=t,this._z=i,this._isDirty=!0,this}set(e,t,i){return this.copyFromFloats(e,t,i)}setAll(e){return this._x=this._y=this._z=e,this._isDirty=!0,this}static GetClipFactor(e,t,i,s){const n=I.Dot(e,i),o=I.Dot(t,i);return(n-s)/(n-o)}static GetAngleBetweenVectors(e,t,i){const s=e.normalizeToRef(Ge.Vector3[1]),n=t.normalizeToRef(Ge.Vector3[2]);let o=I.Dot(s,n);o=yi(o,-1,1);const c=Math.acos(o),h=Ge.Vector3[3];return I.CrossToRef(s,n,h),I.Dot(h,i)>0?isNaN(c)?0:c:isNaN(c)?-Math.PI:-Math.acos(o)}static GetAngleBetweenVectorsOnPlane(e,t,i){Ge.Vector3[0].copyFrom(e);const s=Ge.Vector3[0];Ge.Vector3[1].copyFrom(t);const n=Ge.Vector3[1];Ge.Vector3[2].copyFrom(i);const o=Ge.Vector3[2],c=Ge.Vector3[3],h=Ge.Vector3[4];s.normalize(),n.normalize(),o.normalize(),I.CrossToRef(o,s,c),I.CrossToRef(c,o,h);const f=Math.atan2(I.Dot(n,c),I.Dot(n,h));return zP(f)}static PitchYawRollToMoveBetweenPointsToRef(e,t,i){const s=ge.Vector3[0];return t.subtractToRef(e,s),i._y=Math.atan2(s.x,s.z)||0,i._x=Math.atan2(Math.sqrt(s.x**2+s.z**2),s.y)||0,i._z=0,i._isDirty=!0,i}static PitchYawRollToMoveBetweenPoints(e,t){const i=I.Zero();return I.PitchYawRollToMoveBetweenPointsToRef(e,t,i)}static SlerpToRef(e,t,i,s){i=yi(i,0,1);const n=Ge.Vector3[0],o=Ge.Vector3[1];n.copyFrom(e);const c=n.length();n.normalizeFromLength(c),o.copyFrom(t);const h=o.length();o.normalizeFromLength(h);const f=I.Dot(n,o);let _,d;if(f<1-It){const g=Math.acos(f),p=1/Math.sin(g);_=Math.sin((1-i)*g)*p,d=Math.sin(i*g)*p}else _=1-i,d=i;return n.scaleInPlace(_),o.scaleInPlace(d),s.copyFrom(n).addInPlace(o),s.scaleInPlace(kf(c,h,i)),s}static SmoothToRef(e,t,i,s,n){return I.SlerpToRef(e,t,s===0?1:i/s,n),n}static FromArray(e,t=0){return new I(e[t],e[t+1],e[t+2])}static FromFloatArray(e,t){return I.FromArray(e,t)}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._isDirty=!0,i}static FromFloatArrayToRef(e,t,i){return I.FromArrayToRef(e,t,i)}static FromFloatsToRef(e,t,i,s){return s.copyFromFloats(e,t,i),s}static Zero(){return new I(0,0,0)}static One(){return new I(1,1,1)}static Up(){return new I(0,1,0)}static get UpReadOnly(){return I._UpReadOnly}static get DownReadOnly(){return I._DownReadOnly}static get RightReadOnly(){return I._RightReadOnly}static get LeftReadOnly(){return I._LeftReadOnly}static get LeftHandedForwardReadOnly(){return I._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return I._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return I._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return I._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return I._ZeroReadOnly}static get OneReadOnly(){return I._OneReadOnly}static Down(){return new I(0,-1,0)}static Forward(e=!1){return new I(0,0,e?-1:1)}static Backward(e=!1){return new I(0,0,e?1:-1)}static Right(){return new I(1,0,0)}static Left(){return new I(-1,0,0)}static Random(e=0,t=1){return new I(Ci(e,t),Ci(e,t),Ci(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(Ci(e,t),Ci(e,t),Ci(e,t))}static TransformCoordinates(e,t){const i=I.Zero();return I.TransformCoordinatesToRef(e,t,i),i}static TransformCoordinatesToRef(e,t,i){return I.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,n){const o=s.m,c=e*o[0]+t*o[4]+i*o[8]+o[12],h=e*o[1]+t*o[5]+i*o[9]+o[13],f=e*o[2]+t*o[6]+i*o[10]+o[14],_=1/(e*o[3]+t*o[7]+i*o[11]+o[15]);return n._x=c*_,n._y=h*_,n._z=f*_,n._isDirty=!0,n}static TransformNormal(e,t){const i=I.Zero();return I.TransformNormalToRef(e,t,i),i}static TransformNormalToRef(e,t,i){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformNormalFromFloatsToRef(e,t,i,s,n){const o=s.m;return n._x=e*o[0]+t*o[4]+i*o[8],n._y=e*o[1]+t*o[5]+i*o[9],n._z=e*o[2]+t*o[6]+i*o[10],n._isDirty=!0,n}static CatmullRom(e,t,i,s,n){const o=n*n,c=n*o,h=.5*(2*t._x+(-e._x+i._x)*n+(2*e._x-5*t._x+4*i._x-s._x)*o+(-e._x+3*t._x-3*i._x+s._x)*c),f=.5*(2*t._y+(-e._y+i._y)*n+(2*e._y-5*t._y+4*i._y-s._y)*o+(-e._y+3*t._y-3*i._y+s._y)*c),_=.5*(2*t._z+(-e._z+i._z)*n+(2*e._z-5*t._z+4*i._z-s._z)*o+(-e._z+3*t._z-3*i._z+s._z)*c);return new I(h,f,_)}static Clamp(e,t,i){const s=new I;return I.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){let n=e._x;n=n>i._x?i._x:n,n=n<t._x?t._x:n;let o=e._y;o=o>i._y?i._y:o,o=o<t._y?t._y:o;let c=e._z;return c=c>i._z?i._z:c,c=c<t._z?t._z:c,s.copyFromFloats(n,o,c),s}static CheckExtends(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,d=c-o,g=e._x*h+i._x*f+t._x*_+s._x*d,p=e._y*h+i._y*f+t._y*_+s._y*d,b=e._z*h+i._z*f+t._z*_+s._z*d;return new I(g,p,b)}static Hermite1stDerivative(e,t,i,s,n){const o=new I;return this.Hermite1stDerivativeToRef(e,t,i,s,n,o),o}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;return o._x=(c-n)*6*e._x+(3*c-4*n+1)*t._x+(-c+n)*6*i._x+(3*c-2*n)*s._x,o._y=(c-n)*6*e._y+(3*c-4*n+1)*t._y+(-c+n)*6*i._y+(3*c-2*n)*s._y,o._z=(c-n)*6*e._z+(3*c-4*n+1)*t._z+(-c+n)*6*i._z+(3*c-2*n)*s._z,o._isDirty=!0,o}static Lerp(e,t,i){const s=new I(0,0,0);return I.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){return s._x=e._x+(t._x-e._x)*i,s._y=e._y+(t._y-e._y)*i,s._z=e._z+(t._z-e._z)*i,s._isDirty=!0,s}static Dot(e,t){return e._x*t._x+e._y*t._y+e._z*t._z}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z}static Cross(e,t){const i=new I;return I.CrossToRef(e,t,i),i}static CrossToRef(e,t,i){const s=e._y*t._z-e._z*t._y,n=e._z*t._x-e._x*t._z,o=e._x*t._y-e._y*t._x;return i.copyFromFloats(s,n,o),i}static Normalize(e){const t=I.Zero();return I.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Project(e,t,i,s){const n=new I;return I.ProjectToRef(e,t,i,s,n),n}static ProjectToRef(e,t,i,s,n){const o=s.width,c=s.height,h=s.x,f=s.y,_=Ge.Matrix[1],d=vt.LastCreatedEngine?.isNDCHalfZRange,g=d?1:.5,p=d?0:.5;ae.FromValuesToRef(o/2,0,0,0,0,-c/2,0,0,0,0,g,0,h+o/2,c/2+f,p,1,_);const b=Ge.Matrix[0];return t.multiplyToRef(i,b),b.multiplyToRef(_,b),I.TransformCoordinatesToRef(e,b,n),n}static Reflect(e,t){return this.ReflectToRef(e,t,new I)}static ReflectToRef(e,t,i){const s=ge.Vector3[0];return s.copyFrom(t).scaleInPlace(2*I.Dot(e,t)),i.copyFrom(e).subtractInPlace(s)}static UnprojectFromTransform(e,t,i,s,n){return this.Unproject(e,t,i,s,n,ae.IdentityReadOnly)}static Unproject(e,t,i,s,n,o){const c=new I;return I.UnprojectToRef(e,t,i,s,n,o,c),c}static UnprojectToRef(e,t,i,s,n,o,c){return I.UnprojectFloatsToRef(e._x,e._y,e._z,t,i,s,n,o,c),c}static UnprojectFloatsToRef(e,t,i,s,n,o,c,h,f){const _=Ge.Matrix[0];o.multiplyToRef(c,_),_.multiplyToRef(h,_),_.invert();const d=Ge.Vector3[0];return d.x=e/s*2-1,d.y=-(t/n*2-1),vt.LastCreatedEngine?.isNDCHalfZRange?d.z=i:d.z=2*i-1,I.TransformCoordinatesToRef(d,_,f),f}static Minimize(e,t){const i=new I;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new I;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(I.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e._x-t._x,s=e._y-t._y,n=e._z-t._z;return i*i+s*s+n*n}static ProjectOnTriangleToRef(e,t,i,s,n){const o=Ge.Vector3[0],c=Ge.Vector3[1],h=Ge.Vector3[2],f=Ge.Vector3[3],_=Ge.Vector3[4];i.subtractToRef(t,o),s.subtractToRef(t,c),s.subtractToRef(i,h);const d=o.length(),g=c.length(),p=h.length();if(d<It||g<It||p<It)return n.copyFrom(t),I.Distance(e,t);e.subtractToRef(t,_),I.CrossToRef(o,c,f);const b=f.length();if(b<It)return n.copyFrom(t),I.Distance(e,t);f.normalizeFromLength(b);let x=_.length();if(x<It)return n.copyFrom(t),0;_.normalizeFromLength(x);const E=I.Dot(f,_),v=Ge.Vector3[5],S=Ge.Vector3[6];v.copyFrom(f).scaleInPlace(-x*E),S.copyFrom(e).addInPlace(v);const R=Ge.Vector3[4],P=Ge.Vector3[5],M=Ge.Vector3[7],O=Ge.Vector3[8];R.copyFrom(o).scaleInPlace(1/d),O.copyFrom(c).scaleInPlace(1/g),R.addInPlace(O).scaleInPlace(-1),P.copyFrom(o).scaleInPlace(-1/d),O.copyFrom(h).scaleInPlace(1/p),P.addInPlace(O).scaleInPlace(-1),M.copyFrom(h).scaleInPlace(-1/p),O.copyFrom(c).scaleInPlace(-1/g),M.addInPlace(O).scaleInPlace(-1);const D=Ge.Vector3[9];let w;D.copyFrom(S).subtractInPlace(t),I.CrossToRef(R,D,O),w=I.Dot(O,f);const G=w;D.copyFrom(S).subtractInPlace(i),I.CrossToRef(P,D,O),w=I.Dot(O,f);const H=w;D.copyFrom(S).subtractInPlace(s),I.CrossToRef(M,D,O),w=I.Dot(O,f);const ie=w,ne=Ge.Vector3[10];let ce,k;G>0&&H<0?(ne.copyFrom(o),ce=t,k=i):H>0&&ie<0?(ne.copyFrom(h),ce=i,k=s):(ne.copyFrom(c).scaleInPlace(-1),ce=s,k=t);const te=Ge.Vector3[9],X=Ge.Vector3[4];if(ce.subtractToRef(S,O),k.subtractToRef(S,te),I.CrossToRef(O,te,X),!(I.Dot(X,f)<0))return n.copyFrom(S),Math.abs(x*E);const W=Ge.Vector3[5];I.CrossToRef(ne,X,W),W.normalize();const K=Ge.Vector3[9];K.copyFrom(ce).subtractInPlace(S);const Z=K.length();if(Z<It)return n.copyFrom(ce),I.Distance(e,ce);K.normalizeFromLength(Z);const F=I.Dot(W,K),A=Ge.Vector3[7];A.copyFrom(S).addInPlace(W.scaleInPlace(Z*F)),O.copyFrom(A).subtractInPlace(ce),x=ne.length(),ne.normalizeFromLength(x);let N=I.Dot(O,ne)/Math.max(x,It);return N=yi(N,0,1),A.copyFrom(ce).addInPlace(ne.scaleInPlace(N*x)),n.copyFrom(A),I.Distance(e,A)}static Center(e,t){return I.CenterToRef(e,t,I.Zero())}static CenterToRef(e,t,i){return i.copyFromFloats((e._x+t._x)/2,(e._y+t._y)/2,(e._z+t._z)/2)}static RotationFromAxis(e,t,i){const s=new I;return I.RotationFromAxisToRef(e,t,i,s),s}static RotationFromAxisToRef(e,t,i,s){const n=Ge.Quaternion[0];return Ue.RotationQuaternionFromAxisToRef(e,t,i,n),n.toEulerAnglesToRef(s),s}}I._V8PerformanceHack=new I(.5,.5,.5);I._UpReadOnly=I.Up();I._DownReadOnly=I.Down();I._LeftHandedForwardReadOnly=I.Forward(!1);I._RightHandedForwardReadOnly=I.Forward(!0);I._LeftHandedBackwardReadOnly=I.Backward(!1);I._RightHandedBackwardReadOnly=I.Backward(!0);I._RightReadOnly=I.Right();I._LeftReadOnly=I.Left();I._ZeroReadOnly=I.Zero();I._OneReadOnly=I.One();class dt{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,t=0,i=0,s=0){this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=s}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Vector4"}getHashCode(){const e=Os(this._x),t=Os(this._y),i=Os(this._z),s=Os(this._w);let n=e;return n=n*397^t,n=n*397^i,n=n*397^s,n}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,t){return t===void 0&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){return dt.FromArrayToRef(e,t,this),this}addInPlace(e){return this.x+=e._x,this.y+=e._y,this.z+=e._z,this.w+=e._w,this}addInPlaceFromFloats(e,t,i,s){return this.x+=e,this.y+=t,this.z+=i,this.w+=s,this}add(e){return new dt(this._x+e.x,this._y+e.y,this._z+e.z,this._w+e.w)}addToRef(e,t){return t.x=this._x+e.x,t.y=this._y+e.y,t.z=this._z+e.z,t.w=this._w+e.w,t}subtractInPlace(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subtract(e){return new dt(this._x-e.x,this._y-e.y,this._z-e.z,this._w-e.w)}subtractToRef(e,t){return t.x=this._x-e.x,t.y=this._y-e.y,t.z=this._z-e.z,t.w=this._w-e.w,t}subtractFromFloats(e,t,i,s){return new dt(this._x-e,this._y-t,this._z-i,this._w-s)}subtractFromFloatsToRef(e,t,i,s,n){return n.x=this._x-e,n.y=this._y-t,n.z=this._z-i,n.w=this._w-s,n}negate(){return new dt(-this._x,-this._y,-this._z,-this._w)}negateInPlace(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(e){return e.x=-this._x,e.y=-this._y,e.z=-this._z,e.w=-this._w,e}scaleInPlace(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}scale(e){return new dt(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){return t.x=this._x*e,t.y=this._y*e,t.z=this._z*e,t.w=this._w*e,t}scaleAndAddToRef(e,t){return t.x+=this._x*e,t.y+=this._y*e,t.z+=this._z*e,t.w+=this._w*e,t}equals(e){return e&&this._x===e.x&&this._y===e.y&&this._z===e.z&&this._w===e.w}equalsWithEpsilon(e,t=It){return e&&ei(this._x,e.x,t)&&ei(this._y,e.y,t)&&ei(this._z,e.z,t)&&ei(this._w,e.w,t)}equalsToFloats(e,t,i,s){return this._x===e&&this._y===t&&this._z===i&&this._w===s}multiplyInPlace(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiply(e){return new dt(this._x*e.x,this._y*e.y,this._z*e.z,this._w*e.w)}multiplyToRef(e,t){return t.x=this._x*e.x,t.y=this._y*e.y,t.z=this._z*e.z,t.w=this._w*e.w,t}multiplyByFloats(e,t,i,s){return new dt(this._x*e,this._y*t,this._z*i,this._w*s)}divide(e){return new dt(this._x/e.x,this._y/e.y,this._z/e.z,this._w/e.w)}divideToRef(e,t){return t.x=this._x/e.x,t.y=this._y/e.y,t.z=this._z/e.z,t.w=this._w/e.w,t}divideInPlace(e){return this.divideToRef(e,this)}minimizeInPlace(e){return e.x<this._x&&(this.x=e.x),e.y<this._y&&(this.y=e.y),e.z<this._z&&(this.z=e.z),e.w<this._w&&(this.w=e.w),this}maximizeInPlace(e){return e.x>this._x&&(this.x=e.x),e.y>this._y&&(this.y=e.y),e.z>this._z&&(this.z=e.z),e.w>this._w&&(this.w=e.w),this}minimizeInPlaceFromFloats(e,t,i,s){return this.x=Math.min(e,this._x),this.y=Math.min(t,this._y),this.z=Math.min(i,this._z),this.w=Math.min(s,this._w),this}maximizeInPlaceFromFloats(e,t,i,s){return this.x=Math.max(e,this._x),this.y=Math.max(t,this._y),this.z=Math.max(i,this._z),this.w=Math.max(s,this._w),this}floorToRef(e){return e.x=Math.floor(this._x),e.y=Math.floor(this._y),e.z=Math.floor(this._z),e.w=Math.floor(this._w),e}floor(){return new dt(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z),Math.floor(this._w))}fractToRef(e){return e.x=this._x-Math.floor(this._x),e.y=this._y-Math.floor(this._y),e.z=this._z-Math.floor(this._z),e.w=this._w-Math.floor(this._w),e}fract(){return new dt(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z),this._w-Math.floor(this._w))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){return this.normalizeToRef(new dt)}normalizeToRef(e){const t=this.length();return t===0||t===1?(e.x=this._x,e.y=this._y,e.z=this._z,e.w=this._w,e):this.scaleToRef(1/t,e)}toVector3(){return new I(this._x,this._y,this._z)}clone(){return new dt(this._x,this._y,this._z,this._w)}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}copyFromFloats(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.x=this.y=this.z=this.w=e,this}dot(e){return this._x*e.x+this._y*e.y+this._z*e.z+this._w*e.w}static FromArray(e,t){return t||(t=0),new dt(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i}static FromFloatArrayToRef(e,t,i){return dt.FromArrayToRef(e,t,i),i}static FromFloatsToRef(e,t,i,s,n){return n.x=e,n.y=t,n.z=i,n.w=s,n}static Zero(){return new dt(0,0,0,0)}static One(){return new dt(1,1,1,1)}static Random(e=0,t=1){return new dt(Ci(e,t),Ci(e,t),Ci(e,t),Ci(e,t))}static RandomToRef(e=0,t=1,i){return i.x=Ci(e,t),i.y=Ci(e,t),i.z=Ci(e,t),i.w=Ci(e,t),i}static Clamp(e,t,i){return dt.ClampToRef(e,t,i,new dt)}static ClampToRef(e,t,i,s){return s.x=yi(e.x,t.x,i.x),s.y=yi(e.y,t.y,i.y),s.z=yi(e.z,t.z,i.z),s.w=yi(e.w,t.w,i.w),s}static CheckExtends(e,t,i){t.minimizeInPlace(e),i.maximizeInPlace(e)}static get ZeroReadOnly(){return dt._ZeroReadOnly}static Normalize(e){return dt.NormalizeToRef(e,new dt)}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Minimize(e,t){const i=new dt;return i.copyFrom(e),i.minimizeInPlace(t),i}static Maximize(e,t){const i=new dt;return i.copyFrom(e),i.maximizeInPlace(t),i}static Distance(e,t){return Math.sqrt(dt.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,n=e.z-t.z,o=e.w-t.w;return i*i+s*s+n*n+o*o}static Center(e,t){return dt.CenterToRef(e,t,new dt)}static CenterToRef(e,t,i){return i.x=(e.x+t.x)/2,i.y=(e.y+t.y)/2,i.z=(e.z+t.z)/2,i.w=(e.w+t.w)/2,i}static TransformCoordinates(e,t){return dt.TransformCoordinatesToRef(e,t,new dt)}static TransformCoordinatesToRef(e,t,i){return dt.TransformCoordinatesFromFloatsToRef(e._x,e._y,e._z,t,i),i}static TransformCoordinatesFromFloatsToRef(e,t,i,s,n){const o=s.m,c=e*o[0]+t*o[4]+i*o[8]+o[12],h=e*o[1]+t*o[5]+i*o[9]+o[13],f=e*o[2]+t*o[6]+i*o[10]+o[14],_=e*o[3]+t*o[7]+i*o[11]+o[15];return n.x=c,n.y=h,n.z=f,n.w=_,n}static TransformNormal(e,t){return dt.TransformNormalToRef(e,t,new dt)}static TransformNormalToRef(e,t,i){const s=t.m,n=e.x*s[0]+e.y*s[4]+e.z*s[8],o=e.x*s[1]+e.y*s[5]+e.z*s[9],c=e.x*s[2]+e.y*s[6]+e.z*s[10];return i.x=n,i.y=o,i.z=c,i.w=e.w,i}static TransformNormalFromFloatsToRef(e,t,i,s,n,o){const c=n.m;return o.x=e*c[0]+t*c[4]+i*c[8],o.y=e*c[1]+t*c[5]+i*c[9],o.z=e*c[2]+t*c[6]+i*c[10],o.w=s,o}static FromVector3(e,t=0){return new dt(e._x,e._y,e._z,t)}static Dot(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}}dt._V8PerformanceHack=new dt(.5,.5,.5,.5);dt._ZeroReadOnly=dt.Zero();class Ue{get x(){return this._x}set x(e){this._x=e,this._isDirty=!0}get y(){return this._y}set y(e){this._y=e,this._isDirty=!0}get z(){return this._z}set z(e){this._z=e,this._isDirty=!0}get w(){return this._w}set w(e){this._w=e,this._isDirty=!0}constructor(e=0,t=0,i=0,s=1){this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=s}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){const e=Os(this._x),t=Os(this._y),i=Os(this._z),s=Os(this._w);let n=e;return n=n*397^t,n=n*397^i,n=n*397^s,n}asArray(){return[this._x,this._y,this._z,this._w]}toArray(e,t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this}fromArray(e,t=0){return Ue.FromArrayToRef(e,t,this)}equals(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w}equalsWithEpsilon(e,t=It){return e&&ei(this._x,e._x,t)&&ei(this._y,e._y,t)&&ei(this._z,e._z,t)&&ei(this._w,e._w,t)}isApprox(e,t=It){return e&&(ei(this._x,e._x,t)&&ei(this._y,e._y,t)&&ei(this._z,e._z,t)&&ei(this._w,e._w,t)||ei(this._x,-e._x,t)&&ei(this._y,-e._y,t)&&ei(this._z,-e._z,t)&&ei(this._w,-e._w,t))}clone(){return new Ue(this._x,this._y,this._z,this._w)}copyFrom(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this}copyFromFloats(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._isDirty=!0,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.copyFromFloats(e,e,e,e)}add(e){return new Ue(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)}addInPlace(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this}addToRef(e,t){return t._x=this._x+e._x,t._y=this._y+e._y,t._z=this._z+e._z,t._w=this._w+e._w,t._isDirty=!0,t}addInPlaceFromFloats(e,t,i,s){return this._x+=e,this._y+=t,this._z+=i,this._w+=s,this._isDirty=!0,this}subtractToRef(e,t){return t._x=this._x-e._x,t._y=this._y-e._y,t._z=this._z-e._z,t._w=this._w-e._w,t._isDirty=!0,t}subtractFromFloats(e,t,i,s){return this.subtractFromFloatsToRef(e,t,i,s,new Ue)}subtractFromFloatsToRef(e,t,i,s,n){return n._x=this._x-e,n._y=this._y-t,n._z=this._z-i,n._w=this._w-s,n._isDirty=!0,n}subtract(e){return new Ue(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)}subtractInPlace(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this}scale(e){return new Ue(this._x*e,this._y*e,this._z*e,this._w*e)}scaleToRef(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._w=this._w*e,t._isDirty=!0,t}scaleInPlace(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this}scaleAndAddToRef(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._w+=this._w*e,t._isDirty=!0,t}multiply(e){const t=new Ue(0,0,0,1);return this.multiplyToRef(e,t),t}multiplyToRef(e,t){const i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,s=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,n=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,o=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,s,n,o),t}multiplyInPlace(e){return this.multiplyToRef(e,this)}multiplyByFloats(e,t,i,s){return this._x*=e,this._y*=t,this._z*=i,this._w*=s,this._isDirty=!0,this}divide(e){throw new ReferenceError("Can not divide a quaternion")}divideToRef(e,t){throw new ReferenceError("Can not divide a quaternion")}divideInPlace(e){throw new ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw new ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw new ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw new ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw new ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new Ue)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(e){return e._x=-this._x,e._y=-this._y,e._z=-this._z,e._w=-this._w,e._isDirty=!0,e}equalsToFloats(e,t,i,s){return this._x===e&&this._y===t&&this._z===i&&this._w===s}floorToRef(e){throw new ReferenceError("Can not floor a quaternion")}floor(){throw new ReferenceError("Can not floor a quaternion")}fractToRef(e){throw new ReferenceError("Can not fract a quaternion")}fract(){throw new ReferenceError("Can not fract a quaternion")}conjugateToRef(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new Ue(-this._x,-this._y,-this._z,this._w)}invert(){const e=this.conjugate(),t=this.lengthSquared();return t==0||t==1||e.scaleInPlace(1/t),e}invertInPlace(){this.conjugateInPlace();const e=this.lengthSquared();return e==0||e==1?this:(this.scaleInPlace(1/e),this)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(e){return e===0||e===1?this:this.scaleInPlace(1/e)}normalizeToNew(){const e=new Ue(0,0,0,1);return this.normalizeToRef(e),e}normalizeToRef(e){const t=this.length();return t===0||t===1?e.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/t,e)}toEulerAngles(){const e=I.Zero();return this.toEulerAnglesToRef(e),e}toEulerAnglesToRef(e){const t=this._z,i=this._x,s=this._y,n=this._w,o=s*t-i*n,c=.4999999;if(o<-c)e._y=2*Math.atan2(s,n),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(o>c)e._y=2*Math.atan2(s,n),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{const h=n*n,f=t*t,_=i*i,d=s*s;e._z=Math.atan2(2*(i*s+t*n),-f-_+d+h),e._x=Math.asin(-2*o),e._y=Math.atan2(2*(t*i+s*n),f-_-d+h),e._isDirty=!0}return e}toAlphaBetaGammaToRef(e){const t=this._z,i=this._x,s=this._y,n=this._w,o=Math.sqrt(i*i+s*s),c=Math.sqrt(t*t+n*n),h=2*Math.atan2(o,c),f=2*Math.atan2(t,n),_=2*Math.atan2(s,i),d=(f+_)/2,g=(f-_)/2;return e.set(g,h,d),e}toRotationMatrix(e){return ae.FromQuaternionToRef(this,e),e}fromRotationMatrix(e){return Ue.FromRotationMatrixToRef(e,this),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}toAxisAngle(){const e=I.Zero(),t=this.toAxisAngleToRef(e);return{axis:e,angle:t}}toAxisAngleToRef(e){let t;const i=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),s=this._w;return i>0?(t=2*Math.atan2(i,s),e.set(this._x/i,this._y/i,this._z/i)):(t=0,e.set(1,0,0)),t}static FromRotationMatrix(e){const t=new Ue;return Ue.FromRotationMatrixToRef(e,t),t}static FromRotationMatrixToRef(e,t){const i=e.m,s=i[0],n=i[4],o=i[8],c=i[1],h=i[5],f=i[9],_=i[2],d=i[6],g=i[10],p=s+h+g;let b;return p>0?(b=.5/Math.sqrt(p+1),t._w=.25/b,t._x=(d-f)*b,t._y=(o-_)*b,t._z=(c-n)*b,t._isDirty=!0):s>h&&s>g?(b=2*Math.sqrt(1+s-h-g),t._w=(d-f)/b,t._x=.25*b,t._y=(n+c)/b,t._z=(o+_)/b,t._isDirty=!0):h>g?(b=2*Math.sqrt(1+h-s-g),t._w=(o-_)/b,t._x=(n+c)/b,t._y=.25*b,t._z=(f+d)/b,t._isDirty=!0):(b=2*Math.sqrt(1+g-s-h),t._w=(c-n)/b,t._x=(o+_)/b,t._y=(f+d)/b,t._z=.25*b,t._isDirty=!0),t}static Dot(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w}static AreClose(e,t,i=.1){const s=Ue.Dot(e,t);return 1-s*s<=i}static SmoothToRef(e,t,i,s,n){let o=s===0?1:i/s;return o=yi(o,0,1),Ue.SlerpToRef(e,t,o,n),n}static Zero(){return new Ue(0,0,0,0)}static Inverse(e){return new Ue(-e._x,-e._y,-e._z,e._w)}static InverseToRef(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t}static Identity(){return new Ue(0,0,0,1)}static IsIdentity(e){return e&&e._x===0&&e._y===0&&e._z===0&&e._w===1}static RotationAxis(e,t){return Ue.RotationAxisToRef(e,t,new Ue)}static RotationAxisToRef(e,t,i){i._w=Math.cos(t/2);const s=Math.sin(t/2)/e.length();return i._x=e._x*s,i._y=e._y*s,i._z=e._z*s,i._isDirty=!0,i}static FromArray(e,t){return t||(t=0),new Ue(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._w=e[t+3],i._isDirty=!0,i}static FromFloatsToRef(e,t,i,s,n){return n.copyFromFloats(e,t,i,s),n}static FromEulerAngles(e,t,i){const s=new Ue;return Ue.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerAnglesToRef(e,t,i,s){return Ue.RotationYawPitchRollToRef(t,e,i,s),s}static FromEulerVector(e){const t=new Ue;return Ue.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromEulerVectorToRef(e,t){return Ue.RotationYawPitchRollToRef(e._y,e._x,e._z,t),t}static FromUnitVectorsToRef(e,t,i,s=It){const n=I.Dot(e,t)+1;return n<s?Math.abs(e.x)>Math.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(I.CrossToRef(e,t,ge.Vector3[0]),i.set(ge.Vector3[0].x,ge.Vector3[0].y,ge.Vector3[0].z,n)),i.normalize()}static RotationYawPitchRoll(e,t,i){const s=new Ue;return Ue.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){const n=i*.5,o=t*.5,c=e*.5,h=Math.sin(n),f=Math.cos(n),_=Math.sin(o),d=Math.cos(o),g=Math.sin(c),p=Math.cos(c);return s._x=p*_*f+g*d*h,s._y=g*d*f-p*_*h,s._z=p*d*h-g*_*f,s._w=p*d*f+g*_*h,s._isDirty=!0,s}static RotationAlphaBetaGamma(e,t,i){const s=new Ue;return Ue.RotationAlphaBetaGammaToRef(e,t,i,s),s}static RotationAlphaBetaGammaToRef(e,t,i,s){const n=(i+e)*.5,o=(i-e)*.5,c=t*.5;return s._x=Math.cos(o)*Math.sin(c),s._y=Math.sin(o)*Math.sin(c),s._z=Math.sin(n)*Math.cos(c),s._w=Math.cos(n)*Math.cos(c),s._isDirty=!0,s}static RotationQuaternionFromAxis(e,t,i){const s=new Ue(0,0,0,0);return Ue.RotationQuaternionFromAxisToRef(e,t,i,s),s}static RotationQuaternionFromAxisToRef(e,t,i,s){const n=Ge.Matrix[0];return e=e.normalizeToRef(Ge.Vector3[0]),t=t.normalizeToRef(Ge.Vector3[1]),i=i.normalizeToRef(Ge.Vector3[2]),ae.FromXYZAxesToRef(e,t,i,n),Ue.FromRotationMatrixToRef(n,s),s}static FromLookDirectionLH(e,t){const i=new Ue;return Ue.FromLookDirectionLHToRef(e,t,i),i}static FromLookDirectionLHToRef(e,t,i){const s=Ge.Matrix[0];return ae.LookDirectionLHToRef(e,t,s),Ue.FromRotationMatrixToRef(s,i),i}static FromLookDirectionRH(e,t){const i=new Ue;return Ue.FromLookDirectionRHToRef(e,t,i),i}static FromLookDirectionRHToRef(e,t,i){const s=Ge.Matrix[0];return ae.LookDirectionRHToRef(e,t,s),Ue.FromRotationMatrixToRef(s,i)}static Slerp(e,t,i){const s=Ue.Identity();return Ue.SlerpToRef(e,t,i,s),s}static SlerpToRef(e,t,i,s){let n,o,c=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,h=!1;if(c<0&&(h=!0,c=-c),c>.999999)o=1-i,n=h?-i:i;else{const f=Math.acos(c),_=1/Math.sin(f);o=Math.sin((1-i)*f)*_,n=h?-Math.sin(i*f)*_:Math.sin(i*f)*_}return s._x=o*e._x+n*t._x,s._y=o*e._y+n*t._y,s._z=o*e._z+n*t._z,s._w=o*e._w+n*t._w,s._isDirty=!0,s}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,d=c-o,g=e._x*h+i._x*f+t._x*_+s._x*d,p=e._y*h+i._y*f+t._y*_+s._y*d,b=e._z*h+i._z*f+t._z*_+s._z*d,x=e._w*h+i._w*f+t._w*_+s._w*d;return new Ue(g,p,b,x)}static Hermite1stDerivative(e,t,i,s,n){const o=new Ue;return this.Hermite1stDerivativeToRef(e,t,i,s,n,o),o}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;return o._x=(c-n)*6*e._x+(3*c-4*n+1)*t._x+(-c+n)*6*i._x+(3*c-2*n)*s._x,o._y=(c-n)*6*e._y+(3*c-4*n+1)*t._y+(-c+n)*6*i._y+(3*c-2*n)*s._y,o._z=(c-n)*6*e._z+(3*c-4*n+1)*t._z+(-c+n)*6*i._z+(3*c-2*n)*s._z,o._w=(c-n)*6*e._w+(3*c-4*n+1)*t._w+(-c+n)*6*i._w+(3*c-2*n)*s._w,o._isDirty=!0,o}static Normalize(e){const t=Ue.Zero();return Ue.NormalizeToRef(e,t),t}static NormalizeToRef(e,t){return e.normalizeToRef(t),t}static Clamp(e,t,i){const s=new Ue;return Ue.ClampToRef(e,t,i,s),s}static ClampToRef(e,t,i,s){return s.copyFromFloats(yi(e.x,t.x,i.x),yi(e.y,t.y,i.y),yi(e.z,t.z,i.z),yi(e.w,t.w,i.w))}static Random(e=0,t=1){return new Ue(Ci(e,t),Ci(e,t),Ci(e,t),Ci(e,t))}static RandomToRef(e=0,t=1,i){return i.copyFromFloats(Ci(e,t),Ci(e,t),Ci(e,t),Ci(e,t))}static Minimize(){throw new ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw new ReferenceError("Quaternion.Maximize does not make sense")}static Distance(e,t){return Math.sqrt(Ue.DistanceSquared(e,t))}static DistanceSquared(e,t){const i=e.x-t.x,s=e.y-t.y,n=e.z-t.z,o=e.w-t.w;return i*i+s*s+n*n+o*o}static Center(e,t){return Ue.CenterToRef(e,t,Ue.Zero())}static CenterToRef(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2,(e.w+t.w)/2)}}Ue._V8PerformanceHack=new Ue(.5,.5,.5,.5);class ae{static get Use64Bits(){return Wi.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=dg._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(e,t=!1,i=!1,s=!0){this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=this._isIdentity?!1:t,this._isIdentity3x2Dirty=this._isIdentity3x2?!1:s}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,Wi.MatrixTrackPrecisionChange&&Wi.MatrixTrackedMatrices.push(this),this._m=new Wi.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;const e=this._m;this._isIdentity=e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,this._m[0]!==1||this._m[5]!==1||this._m[15]!==1?this._isIdentity3x2=!1:this._m[1]!==0||this._m[2]!==0||this._m[3]!==0||this._m[4]!==0||this._m[6]!==0||this._m[7]!==0||this._m[8]!==0||this._m[9]!==0||this._m[10]!==0||this._m[11]!==0||this._m[12]!==0||this._m[13]!==0||this._m[14]!==0?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(this._isIdentity===!0)return 1;const e=this._m,t=e[0],i=e[1],s=e[2],n=e[3],o=e[4],c=e[5],h=e[6],f=e[7],_=e[8],d=e[9],g=e[10],p=e[11],b=e[12],x=e[13],E=e[14],v=e[15],S=g*v-E*p,R=d*v-x*p,P=d*E-x*g,M=_*v-b*p,O=_*E-g*b,D=_*x-b*d,w=+(c*S-h*R+f*P),G=-(o*S-h*M+f*O),H=+(o*R-c*M+f*D),ie=-(o*P-c*O+h*D);return t*w+i*G+s*H+n*ie}toString(){return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
185${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}
186${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}
187${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`}toArray(e=null,t=0){if(!e)return this._m;const i=this._m;for(let s=0;s<16;s++)e[t+s]=i[s];return this}asArray(){return this._m}fromArray(e,t=0){return ae.FromArrayToRef(e,t,this)}copyFromFloats(...e){return ae.FromArrayToRef(e,0,this)}set(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=e[i];return this.markAsUpdated(),this}setAll(e){const t=this._m;for(let i=0;i<16;i++)t[i]=e;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return ae.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(e){const t=new ae;return this.addToRef(e,t),t}addToRef(e,t){const i=this._m,s=t._m,n=e.m;for(let o=0;o<16;o++)s[o]=i[o]+n[o];return t.markAsUpdated(),t}addToSelf(e){const t=this._m,i=e.m;return t[0]+=i[0],t[1]+=i[1],t[2]+=i[2],t[3]+=i[3],t[4]+=i[4],t[5]+=i[5],t[6]+=i[6],t[7]+=i[7],t[8]+=i[8],t[9]+=i[9],t[10]+=i[10],t[11]+=i[11],t[12]+=i[12],t[13]+=i[13],t[14]+=i[14],t[15]+=i[15],this.markAsUpdated(),this}addInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]+=i[s];return this.markAsUpdated(),this}addInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]+=e[i];return this.markAsUpdated(),this}subtract(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractToRef(e,t){const i=this._m,s=e.m,n=t._m;for(let o=0;o<16;o++)n[o]=i[o]-s[o];return t.markAsUpdated(),t}subtractInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]-=i[s];return this.markAsUpdated(),this}subtractFromFloats(...e){return this.subtractFromFloatsToRef(...e,new ae)}subtractFromFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,n=e;for(let o=0;o<16;o++)s[o]=i[o]-n[o];return t.markAsUpdated(),t}invertToRef(e){return this._isIdentity===!0?(ae.IdentityToRef(e),e):(eA(this,e.asArray())?e.markAsUpdated():e.copyFrom(this),e)}addAtIndex(e,t){return this._m[e]+=t,this.markAsUpdated(),this}multiplyAtIndex(e,t){return this._m[e]*=t,this.markAsUpdated(),this}setTranslationFromFloats(e,t,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this.markAsUpdated(),this}addTranslationFromFloats(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this.markAsUpdated(),this}setTranslation(e){return this.setTranslationFromFloats(e._x,e._y,e._z)}getTranslation(){return new I(this._m[12],this._m[13],this._m[14])}getTranslationToRef(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],e}removeRotationAndScaling(){const e=this.m;return ae.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e[12],e[13],e[14],e[15],this),this._updateIdentityStatus(e[12]===0&&e[13]===0&&e[14]===0&&e[15]===1),this}copyFrom(e){e.copyToArray(this._m);const t=e;return this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(e,t=0){return VP(this,e,t),this}multiply(e){const t=new ae;return this.multiplyToRef(e,t),t}multiplyInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]*=i[s];return this.markAsUpdated(),this}multiplyByFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e[i];return this.markAsUpdated(),this}multiplyByFloatsToRef(...e){const t=e.pop(),i=this._m,s=t._m,n=e;for(let o=0;o<16;o++)s[o]=i[o]*n[o];return t.markAsUpdated(),t}multiplyToRef(e,t){return this._isIdentity?(t.copyFrom(e),t):e._isIdentity?(t.copyFrom(this),t):(this.multiplyToArray(e,t._m,0),t.markAsUpdated(),t)}multiplyToArray(e,t,i){return Jv(this,e,t,i),this}divide(e){return this.divideToRef(e,new ae)}divideToRef(e,t){const i=this._m,s=e.m,n=t._m;for(let o=0;o<16;o++)n[o]=i[o]/s[o];return t.markAsUpdated(),t}divideInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]/=i[s];return this.markAsUpdated(),this}minimizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}maximizeInPlace(e){const t=this._m,i=e.m;for(let s=0;s<16;s++)t[s]=Math.min(t[s],i[s]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...e){const t=this._m;for(let i=0;i<16;i++)t[i]=Math.min(t[i],e[i]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new ae)}negateInPlace(){const e=this._m;for(let t=0;t<16;t++)e[t]=-e[t];return this.markAsUpdated(),this}negateToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=-t[s];return e.markAsUpdated(),e}equals(e){const t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;const i=this.m,s=t.m;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]}equalsWithEpsilon(e,t=0){const i=this._m,s=e.m;for(let n=0;n<16;n++)if(!ei(i[n],s[n],t))return!1;return!0}equalsToFloats(...e){const t=this._m;for(let i=0;i<16;i++)if(t[i]!=e[i])return!1;return!0}floor(){return this.floorToRef(new ae)}floorToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=Math.floor(t[s]);return e.markAsUpdated(),e}fract(){return this.fractToRef(new ae)}fractToRef(e){const t=this._m,i=e._m;for(let s=0;s<16;s++)i[s]=t[s]-Math.floor(t[s]);return e.markAsUpdated(),e}clone(){const e=new ae;return e.copyFrom(this),e}getClassName(){return"Matrix"}getHashCode(){let e=Os(this._m[0]);for(let t=1;t<16;t++)e=e*397^Os(this._m[t]);return e}decomposeToTransformNode(e){return e.rotationQuaternion=e.rotationQuaternion||new Ue,this.decompose(e.scaling,e.rotationQuaternion,e.position)}decompose(e,t,i,s,n=!0){if(this._isIdentity)return i&&i.setAll(0),e&&e.setAll(1),t&&t.copyFromFloats(0,0,0,1),!0;const o=this._m;if(i&&i.copyFromFloats(o[12],o[13],o[14]),e=e||Ge.Vector3[0],e.x=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]),e.y=Math.sqrt(o[4]*o[4]+o[5]*o[5]+o[6]*o[6]),e.z=Math.sqrt(o[8]*o[8]+o[9]*o[9]+o[10]*o[10]),s){const c=(n?s.absoluteScaling.x:s.scaling.x)<0?-1:1,h=(n?s.absoluteScaling.y:s.scaling.y)<0?-1:1,f=(n?s.absoluteScaling.z:s.scaling.z)<0?-1:1;e.x*=c,e.y*=h,e.z*=f}else this.determinant()<=0&&(e.y*=-1);if(e._x===0||e._y===0||e._z===0)return t&&t.copyFromFloats(0,0,0,1),!1;if(t){const c=1/e._x,h=1/e._y,f=1/e._z;ae.FromValuesToRef(o[0]*c,o[1]*c,o[2]*c,0,o[4]*h,o[5]*h,o[6]*h,0,o[8]*f,o[9]*f,o[10]*f,0,0,0,0,1,Ge.Matrix[0]),Ue.FromRotationMatrixToRef(Ge.Matrix[0],t)}return!0}getRow(e){if(e<0||e>3)return null;const t=e*4;return new dt(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])}getRowToRef(e,t){if(e>=0&&e<=3){const i=e*4;t.x=this._m[i+0],t.y=this._m[i+1],t.z=this._m[i+2],t.w=this._m[i+3]}return t}setRow(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)}transpose(){const e=new ae;return ae.TransposeToRef(this,e),e}transposeToRef(e){return ae.TransposeToRef(this,e),e}setRowFromFloats(e,t,i,s,n){if(e<0||e>3)return this;const o=e*4;return this._m[o+0]=t,this._m[o+1]=i,this._m[o+2]=s,this._m[o+3]=n,this.markAsUpdated(),this}scale(e){const t=new ae;return this.scaleToRef(e,t),t}scaleToRef(e,t){for(let i=0;i<16;i++)t._m[i]=this._m[i]*e;return t.markAsUpdated(),t}scaleAndAddToRef(e,t){for(let i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t.markAsUpdated(),t}scaleInPlace(e){const t=this._m;for(let i=0;i<16;i++)t[i]*=e;return this.markAsUpdated(),this}toNormalMatrix(e){const t=Ge.Matrix[0];this.invertToRef(t),t.transposeToRef(e);const i=e._m;return ae.FromValuesToRef(i[0],i[1],i[2],0,i[4],i[5],i[6],0,i[8],i[9],i[10],0,0,0,0,1,e),e}getRotationMatrix(){const e=new ae;return this.getRotationMatrixToRef(e),e}getRotationMatrixToRef(e){const t=Ge.Vector3[0];if(!this.decompose(t))return ae.IdentityToRef(e),e;const i=this._m,s=1/t._x,n=1/t._y,o=1/t._z;return ae.FromValuesToRef(i[0]*s,i[1]*s,i[2]*s,0,i[4]*n,i[5]*n,i[6]*n,0,i[8]*o,i[9]*o,i[10]*o,0,0,0,0,1,e),e}toggleModelMatrixHandInPlace(){const e=this._m;return e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){const e=this._m;return e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this.markAsUpdated(),this}_convertProjectionToHalfZRangeInPlace(){return this.multiplyToRef(Ta,this),this}static FromArray(e,t=0){const i=new ae;return ae.FromArrayToRef(e,t,i),i}static FromArrayToRef(e,t,i){for(let s=0;s<16;s++)i._m[s]=e[s+t];return i.markAsUpdated(),i}static FromFloat32ArrayToRefScaled(e,t,i,s){return s._m[0]=e[0+t]*i,s._m[1]=e[1+t]*i,s._m[2]=e[2+t]*i,s._m[3]=e[3+t]*i,s._m[4]=e[4+t]*i,s._m[5]=e[5+t]*i,s._m[6]=e[6+t]*i,s._m[7]=e[7+t]*i,s._m[8]=e[8+t]*i,s._m[9]=e[9+t]*i,s._m[10]=e[10+t]*i,s._m[11]=e[11+t]*i,s._m[12]=e[12+t]*i,s._m[13]=e[13+t]*i,s._m[14]=e[14+t]*i,s._m[15]=e[15+t]*i,s.markAsUpdated(),s}static get IdentityReadOnly(){return ae._IdentityReadOnly}static FromValuesToRef(e,t,i,s,n,o,c,h,f,_,d,g,p,b,x,E,v){const S=v._m;S[0]=e,S[1]=t,S[2]=i,S[3]=s,S[4]=n,S[5]=o,S[6]=c,S[7]=h,S[8]=f,S[9]=_,S[10]=d,S[11]=g,S[12]=p,S[13]=b,S[14]=x,S[15]=E,v.markAsUpdated()}static FromValues(e,t,i,s,n,o,c,h,f,_,d,g,p,b,x,E){const v=new ae,S=v._m;return S[0]=e,S[1]=t,S[2]=i,S[3]=s,S[4]=n,S[5]=o,S[6]=c,S[7]=h,S[8]=f,S[9]=_,S[10]=d,S[11]=g,S[12]=p,S[13]=b,S[14]=x,S[15]=E,v.markAsUpdated(),v}static Compose(e,t,i){const s=new ae;return ae.ComposeToRef(e,t,i,s),s}static ComposeToRef(e,t,i,s){const n=s._m,o=t._x,c=t._y,h=t._z,f=t._w,_=o+o,d=c+c,g=h+h,p=o*_,b=o*d,x=o*g,E=c*d,v=c*g,S=h*g,R=f*_,P=f*d,M=f*g,O=e._x,D=e._y,w=e._z;return n[0]=(1-(E+S))*O,n[1]=(b+M)*O,n[2]=(x-P)*O,n[3]=0,n[4]=(b-M)*D,n[5]=(1-(p+S))*D,n[6]=(v+R)*D,n[7]=0,n[8]=(x+P)*w,n[9]=(v-R)*w,n[10]=(1-(p+E))*w,n[11]=0,n[12]=i._x,n[13]=i._y,n[14]=i._z,n[15]=1,s.markAsUpdated(),s}static Identity(){const e=ae.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e}static IdentityToRef(e){return ae.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0),e}static Zero(){const e=ae.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e}static RotationX(e){const t=new ae;return ae.RotationXToRef(e,t),t}static Invert(e){const t=new ae;return e.invertToRef(t),t}static RotationXToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return ae.FromValuesToRef(1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationY(e){const t=new ae;return ae.RotationYToRef(e,t),t}static RotationYToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return ae.FromValuesToRef(s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationZ(e){const t=new ae;return ae.RotationZToRef(e,t),t}static RotationZToRef(e,t){const i=Math.sin(e),s=Math.cos(e);return ae.FromValuesToRef(s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(s===1&&i===0),t}static RotationAxis(e,t){const i=new ae;return ae.RotationAxisToRef(e,t,i),i}static RotationAxisToRef(e,t,i){const s=Math.sin(-t),n=Math.cos(-t),o=1-n;e=e.normalizeToRef(Ge.Vector3[0]);const c=i._m;return c[0]=e._x*e._x*o+n,c[1]=e._x*e._y*o-e._z*s,c[2]=e._x*e._z*o+e._y*s,c[3]=0,c[4]=e._y*e._x*o+e._z*s,c[5]=e._y*e._y*o+n,c[6]=e._y*e._z*o-e._x*s,c[7]=0,c[8]=e._z*e._x*o-e._y*s,c[9]=e._z*e._y*o+e._x*s,c[10]=e._z*e._z*o+n,c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,i.markAsUpdated(),i}static RotationAlignToRef(e,t,i,s=!1){const n=I.Dot(t,e),o=i._m;if(n<-1+It)o[0]=-1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s?1:-1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s?-1:1,o[11]=0;else{const c=I.Cross(t,e),h=1/(1+n);o[0]=c._x*c._x*h+n,o[1]=c._y*c._x*h-c._z,o[2]=c._z*c._x*h+c._y,o[3]=0,o[4]=c._x*c._y*h+c._z,o[5]=c._y*c._y*h+n,o[6]=c._z*c._y*h-c._x,o[7]=0,o[8]=c._x*c._z*h-c._y,o[9]=c._y*c._z*h+c._x,o[10]=c._z*c._z*h+n,o[11]=0}return o[12]=0,o[13]=0,o[14]=0,o[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(e,t,i){const s=new ae;return ae.RotationYawPitchRollToRef(e,t,i,s),s}static RotationYawPitchRollToRef(e,t,i,s){return Ue.RotationYawPitchRollToRef(e,t,i,Ge.Quaternion[0]),Ge.Quaternion[0].toRotationMatrix(s),s}static Scaling(e,t,i){const s=new ae;return ae.ScalingToRef(e,t,i,s),s}static ScalingToRef(e,t,i,s){return ae.FromValuesToRef(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1,s),s._updateIdentityStatus(e===1&&t===1&&i===1),s}static Translation(e,t,i){const s=new ae;return ae.TranslationToRef(e,t,i,s),s}static TranslationToRef(e,t,i,s){return ae.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,t,i,1,s),s._updateIdentityStatus(e===0&&t===0&&i===0),s}static Lerp(e,t,i){const s=new ae;return ae.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){const n=s._m,o=e.m,c=t.m;for(let h=0;h<16;h++)n[h]=o[h]*(1-i)+c[h]*i;return s.markAsUpdated(),s}static DecomposeLerp(e,t,i){const s=new ae;return ae.DecomposeLerpToRef(e,t,i,s),s}static DecomposeLerpToRef(e,t,i,s){const n=Ge.Vector3[0],o=Ge.Quaternion[0],c=Ge.Vector3[1];e.decompose(n,o,c);const h=Ge.Vector3[2],f=Ge.Quaternion[1],_=Ge.Vector3[3];t.decompose(h,f,_);const d=Ge.Vector3[4];I.LerpToRef(n,h,i,d);const g=Ge.Quaternion[2];Ue.SlerpToRef(o,f,i,g);const p=Ge.Vector3[5];return I.LerpToRef(c,_,i,p),ae.ComposeToRef(d,g,p,s),s}static LookAtLH(e,t,i){const s=new ae;return ae.LookAtLHToRef(e,t,i,s),s}static LookAtLHToRef(e,t,i,s){const n=Ge.Vector3[0],o=Ge.Vector3[1],c=Ge.Vector3[2];t.subtractToRef(e,c),c.normalize(),I.CrossToRef(i,c,n);const h=n.lengthSquared();h===0?n.x=1:n.normalizeFromLength(Math.sqrt(h)),I.CrossToRef(c,n,o),o.normalize();const f=-I.Dot(n,e),_=-I.Dot(o,e),d=-I.Dot(c,e);return ae.FromValuesToRef(n._x,o._x,c._x,0,n._y,o._y,c._y,0,n._z,o._z,c._z,0,f,_,d,1,s),s}static LookAtRH(e,t,i){const s=new ae;return ae.LookAtRHToRef(e,t,i,s),s}static LookAtRHToRef(e,t,i,s){const n=Ge.Vector3[0],o=Ge.Vector3[1],c=Ge.Vector3[2];e.subtractToRef(t,c),c.normalize(),I.CrossToRef(i,c,n);const h=n.lengthSquared();h===0?n.x=1:n.normalizeFromLength(Math.sqrt(h)),I.CrossToRef(c,n,o),o.normalize();const f=-I.Dot(n,e),_=-I.Dot(o,e),d=-I.Dot(c,e);return ae.FromValuesToRef(n._x,o._x,c._x,0,n._y,o._y,c._y,0,n._z,o._z,c._z,0,f,_,d,1,s),s}static LookDirectionLH(e,t){const i=new ae;return ae.LookDirectionLHToRef(e,t,i),i}static LookDirectionLHToRef(e,t,i){const s=Ge.Vector3[0];s.copyFrom(e),s.scaleInPlace(-1);const n=Ge.Vector3[1];return I.CrossToRef(t,s,n),ae.FromValuesToRef(n._x,n._y,n._z,0,t._x,t._y,t._z,0,s._x,s._y,s._z,0,0,0,0,1,i),i}static LookDirectionRH(e,t){const i=new ae;return ae.LookDirectionRHToRef(e,t,i),i}static LookDirectionRHToRef(e,t,i){const s=Ge.Vector3[2];return I.CrossToRef(t,e,s),ae.FromValuesToRef(s._x,s._y,s._z,0,t._x,t._y,t._z,0,e._x,e._y,e._z,0,0,0,0,1,i),i}static OrthoLH(e,t,i,s,n){const o=new ae;return ae.OrthoLHToRef(e,t,i,s,o,n),o}static OrthoLHToRef(e,t,i,s,n,o){const c=i,h=s,f=2/e,_=2/t,d=2/(h-c),g=-(h+c)/(h-c);return ae.FromValuesToRef(f,0,0,0,0,_,0,0,0,0,d,0,0,0,g,1,n),o&&n.multiplyToRef(Ta,n),n._updateIdentityStatus(f===1&&_===1&&d===1&&g===0),n}static OrthoOffCenterLH(e,t,i,s,n,o,c){const h=new ae;return ae.OrthoOffCenterLHToRef(e,t,i,s,n,o,h,c),h}static OrthoOffCenterLHToRef(e,t,i,s,n,o,c,h){const f=n,_=o,d=2/(t-e),g=2/(s-i),p=2/(_-f),b=-(_+f)/(_-f),x=(e+t)/(e-t),E=(s+i)/(i-s);return ae.FromValuesToRef(d,0,0,0,0,g,0,0,0,0,p,0,x,E,b,1,c),h&&c.multiplyToRef(Ta,c),c.markAsUpdated(),c}static ObliqueOffCenterLHToRef(e,t,i,s,n,o,c,h,f,_,d){const g=-c*Math.cos(h),p=-c*Math.sin(h);return ae.TranslationToRef(0,0,-f,Ge.Matrix[1]),ae.FromValuesToRef(1,0,0,0,0,1,0,0,g,p,1,0,0,0,0,1,Ge.Matrix[0]),Ge.Matrix[1].multiplyToRef(Ge.Matrix[0],Ge.Matrix[0]),ae.TranslationToRef(0,0,f,Ge.Matrix[1]),Ge.Matrix[0].multiplyToRef(Ge.Matrix[1],Ge.Matrix[0]),ae.OrthoOffCenterLHToRef(e,t,i,s,n,o,_,d),Ge.Matrix[0].multiplyToRef(_,_),_}static OrthoOffCenterRH(e,t,i,s,n,o,c){const h=new ae;return ae.OrthoOffCenterRHToRef(e,t,i,s,n,o,h,c),h}static OrthoOffCenterRHToRef(e,t,i,s,n,o,c,h){return ae.OrthoOffCenterLHToRef(e,t,i,s,n,o,c,h),c._m[10]*=-1,c}static ObliqueOffCenterRHToRef(e,t,i,s,n,o,c,h,f,_,d){const g=c*Math.cos(h),p=c*Math.sin(h);return ae.TranslationToRef(0,0,f,Ge.Matrix[1]),ae.FromValuesToRef(1,0,0,0,0,1,0,0,g,p,1,0,0,0,0,1,Ge.Matrix[0]),Ge.Matrix[1].multiplyToRef(Ge.Matrix[0],Ge.Matrix[0]),ae.TranslationToRef(0,0,-f,Ge.Matrix[1]),Ge.Matrix[0].multiplyToRef(Ge.Matrix[1],Ge.Matrix[0]),ae.OrthoOffCenterRHToRef(e,t,i,s,n,o,_,d),Ge.Matrix[0].multiplyToRef(_,_),_}static PerspectiveLH(e,t,i,s,n,o=0){const c=new ae,h=i,f=s,_=2*h/e,d=2*h/t,g=(f+h)/(f-h),p=-2*f*h/(f-h),b=Math.tan(o);return ae.FromValuesToRef(_,0,0,0,0,d,0,b,0,0,g,1,0,0,p,0,c),n&&c.multiplyToRef(Ta,c),c._updateIdentityStatus(!1),c}static PerspectiveFovLH(e,t,i,s,n,o=0,c=!1){const h=new ae;return ae.PerspectiveFovLHToRef(e,t,i,s,h,!0,n,o,c),h}static PerspectiveFovLHToRef(e,t,i,s,n,o=!0,c,h=0,f=!1){const _=i,d=s,g=1/Math.tan(e*.5),p=o?g/t:g,b=o?g:g*t,x=f&&_===0?-1:d!==0?(d+_)/(d-_):1,E=f&&_===0?2*d:d!==0?-2*d*_/(d-_):-2*_,v=Math.tan(h);return ae.FromValuesToRef(p,0,0,0,0,b,0,v,0,0,x,1,0,0,E,0,n),c&&n.multiplyToRef(Ta,n),n._updateIdentityStatus(!1),n}static PerspectiveFovReverseLHToRef(e,t,i,s,n,o=!0,c,h=0){const f=1/Math.tan(e*.5),_=o?f/t:f,d=o?f:f*t,g=Math.tan(h);return ae.FromValuesToRef(_,0,0,0,0,d,0,g,0,0,-i,1,0,0,1,0,n),c&&n.multiplyToRef(Ta,n),n._updateIdentityStatus(!1),n}static PerspectiveFovRH(e,t,i,s,n,o=0,c=!1){const h=new ae;return ae.PerspectiveFovRHToRef(e,t,i,s,h,!0,n,o,c),h}static PerspectiveFovRHToRef(e,t,i,s,n,o=!0,c,h=0,f=!1){const _=i,d=s,g=1/Math.tan(e*.5),p=o?g/t:g,b=o?g:g*t,x=f&&_===0?1:d!==0?-(d+_)/(d-_):-1,E=f&&_===0?2*d:d!==0?-2*d*_/(d-_):-2*_,v=Math.tan(h);return ae.FromValuesToRef(p,0,0,0,0,b,0,v,0,0,x,-1,0,0,E,0,n),c&&n.multiplyToRef(Ta,n),n._updateIdentityStatus(!1),n}static PerspectiveFovReverseRHToRef(e,t,i,s,n,o=!0,c,h=0){const f=1/Math.tan(e*.5),_=o?f/t:f,d=o?f:f*t,g=Math.tan(h);return ae.FromValuesToRef(_,0,0,0,0,d,0,g,0,0,-i,-1,0,0,-1,0,n),c&&n.multiplyToRef(Ta,n),n._updateIdentityStatus(!1),n}static GetFinalMatrix(e,t,i,s,n,o){const c=e.width,h=e.height,f=e.x,_=e.y,d=ae.FromValues(c/2,0,0,0,0,-h/2,0,0,0,0,o-n,0,f+c/2,h/2+_,n,1),g=new ae;return t.multiplyToRef(i,g),g.multiplyToRef(s,g),g.multiplyToRef(d,g)}static GetAsMatrix2x2(e){const t=e.m,i=[t[0],t[1],t[4],t[5]];return Wi.MatrixUse64Bits?i:new Float32Array(i)}static GetAsMatrix3x3(e){const t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return Wi.MatrixUse64Bits?i:new Float32Array(i)}static Transpose(e){const t=new ae;return ae.TransposeToRef(e,t),t}static TransposeToRef(e,t){const i=e.m,s=i[0],n=i[4],o=i[8],c=i[12],h=i[1],f=i[5],_=i[9],d=i[13],g=i[2],p=i[6],b=i[10],x=i[14],E=i[3],v=i[7],S=i[11],R=i[15],P=t._m;return P[0]=s,P[1]=n,P[2]=o,P[3]=c,P[4]=h,P[5]=f,P[6]=_,P[7]=d,P[8]=g,P[9]=p,P[10]=b,P[11]=x,P[12]=E,P[13]=v,P[14]=S,P[15]=R,t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t}static Reflection(e){const t=new ae;return ae.ReflectionToRef(e,t),t}static ReflectionToRef(e,t){e.normalize();const i=e.normal.x,s=e.normal.y,n=e.normal.z,o=-2*i,c=-2*s,h=-2*n;return ae.FromValuesToRef(o*i+1,c*i,h*i,0,o*s,c*s+1,h*s,0,o*n,c*n,h*n+1,0,o*e.d,c*e.d,h*e.d,1,t),t}static FromXYZAxesToRef(e,t,i,s){return ae.FromValuesToRef(e._x,e._y,e._z,0,t._x,t._y,t._z,0,i._x,i._y,i._z,0,0,0,0,1,s),s}static FromQuaternionToRef(e,t){const i=e._x*e._x,s=e._y*e._y,n=e._z*e._z,o=e._x*e._y,c=e._z*e._w,h=e._z*e._x,f=e._y*e._w,_=e._y*e._z,d=e._x*e._w;return t._m[0]=1-2*(s+n),t._m[1]=2*(o+c),t._m[2]=2*(h-f),t._m[3]=0,t._m[4]=2*(o-c),t._m[5]=1-2*(n+i),t._m[6]=2*(_+d),t._m[7]=0,t._m[8]=2*(h+f),t._m[9]=2*(_-d),t._m[10]=1-2*(s+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t.markAsUpdated(),t}}ae._IdentityReadOnly=ae.Identity();class Ge{}Ge.Vector3=wa(11,I.Zero);Ge.Matrix=wa(2,ae.Identity);Ge.Quaternion=wa(3,Ue.Zero);class ge{}ge.Vector2=wa(3,He.Zero);ge.Vector3=wa(13,I.Zero);ge.Vector4=wa(3,dt.Zero);ge.Quaternion=wa(3,Ue.Zero);ge.Matrix=wa(8,ae.Identity);const Ta=ae.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1);let Ox=!1;function GP(){Ox||(Ox=!0,Object.defineProperties(He.prototype,{dimension:{value:[2]},rank:{value:1}}),Object.defineProperties(I.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(dt.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(Ue.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(ae.prototype,{dimension:{value:[4,4]},rank:{value:2}}),In("BABYLON.Vector2",He),In("BABYLON.Vector3",I),In("BABYLON.Vector4",dt),In("BABYLON.Matrix",ae))}var wx;(function(r){r[r.LOCAL=0]="LOCAL",r[r.WORLD=1]="WORLD",r[r.BONE=2]="BONE"})(wx||(wx={}));class _o{}_o.X=new I(1,0,0);_o.Y=new I(0,1,0);_o.Z=new I(0,0,1);var Fx;(function(r){r[r.X=0]="X",r[r.Y=1]="Y",r[r.Z=2]="Z"})(Fx||(Fx={}));function pl(r){return Math.pow(r,LP)}function yl(r){return r<=.04045?.0773993808*r:Math.pow(.947867299*(r+.055),2.4)}function bl(r){return Math.pow(r,FP)}function xl(r){return r<=.0031308?12.92*r:1.055*Math.pow(r,.41666)-.055}class tt{constructor(e=0,t=0,i=0){this.r=e,this.g=t,this.b=i}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"}getClassName(){return"Color3"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this}fromArray(e,t=0){return tt.FromArrayToRef(e,t,this),this}toColor4(e=1){return new xt(this.r,this.g,this.b,e)}asArray(){return[this.r,this.g,this.b]}toLuminance(){return this.r*.3+this.g*.59+this.b*.11}multiply(e){return new tt(this.r*e.r,this.g*e.g,this.b*e.b)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyByFloats(e,t,i){return new tt(this.r*e,this.g*t,this.b*i)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.minimizeInPlaceFromFloats(e.r,e.g,e.b)}maximizeInPlace(e){return this.maximizeInPlaceFromFloats(e.r,e.g,e.b)}minimizeInPlaceFromFloats(e,t,i){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this}maximizeInPlaceFromFloats(e,t,i){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b}equalsFloats(e,t,i){return this.equalsToFloats(e,t,i)}equalsToFloats(e,t,i){return this.r===e&&this.g===t&&this.b===i}equalsWithEpsilon(e,t=It){return ei(this.r,e.r,t)&&ei(this.g,e.g,t)&&ei(this.b,e.b,t)}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}scale(e){return new tt(this.r*e,this.g*e,this.b*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t}clampToRef(e=0,t=1,i){return i.r=yi(this.r,e,t),i.g=yi(this.g,e,t),i.b=yi(this.b,e,t),i}add(e){return new tt(this.r+e.r,this.g+e.g,this.b+e.b)}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addInPlaceFromFloats(e,t,i){return this.r+=e,this.g+=t,this.b+=i,this}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t}subtract(e){return new tt(this.r-e.r,this.g-e.g,this.b-e.b)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this}subtractFromFloats(e,t,i){return new tt(this.r-e,this.g-t,this.b-i)}subtractFromFloatsToRef(e,t,i,s){return s.r=this.r-e,s.g=this.g-t,s.b=this.b-i,s}clone(){return new tt(this.r,this.g,this.b)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyFromFloats(e,t,i){return this.r=e,this.g=t,this.b=i,this}set(e,t,i){return this.copyFromFloats(e,t,i)}setAll(e){return this.r=this.g=this.b=e,this}toHexString(){const e=Math.round(this.r*255),t=Math.round(this.g*255),i=Math.round(this.b*255);return"#"+Xn(e)+Xn(t)+Xn(i)}fromHexString(e){return e.substring(0,1)!=="#"||e.length!==7?this:(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,this)}toHSV(){return this.toHSVToRef(new tt)}toHSVToRef(e){const t=this.r,i=this.g,s=this.b,n=Math.max(t,i,s),o=Math.min(t,i,s);let c=0,h=0;const f=n,_=n-o;return n!==0&&(h=_/n),n!=o&&(n==t?(c=(i-s)/_,i<s&&(c+=6)):n==i?c=(s-t)/_+2:n==s&&(c=(t-i)/_+4),c*=60),e.r=c,e.g=h,e.b=f,e}toLinearSpace(e=!1){const t=new tt;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=yl(this.r),e.g=yl(this.g),e.b=yl(this.b)):(e.r=pl(this.r),e.g=pl(this.g),e.b=pl(this.b)),this}toGammaSpace(e=!1){const t=new tt;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=xl(this.r),e.g=xl(this.g),e.b=xl(this.b)):(e.r=bl(this.r),e.g=bl(this.g),e.b=bl(this.b)),this}static HSVtoRGBToRef(e,t,i,s){const n=i*t,o=e/60,c=n*(1-Math.abs(o%2-1));let h=0,f=0,_=0;o>=0&&o<=1?(h=n,f=c):o>=1&&o<=2?(h=c,f=n):o>=2&&o<=3?(f=n,_=c):o>=3&&o<=4?(f=c,_=n):o>=4&&o<=5?(h=c,_=n):o>=5&&o<=6&&(h=n,_=c);const d=i-n;return s.r=h+d,s.g=f+d,s.b=_+d,s}static FromHSV(e,t,i){const s=new tt(0,0,0);return tt.HSVtoRGBToRef(e,t,i,s),s}static FromHexString(e){return new tt(0,0,0).fromHexString(e)}static FromArray(e,t=0){return new tt(e[t],e[t+1],e[t+2])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2]}static FromInts(e,t,i){return new tt(e/255,t/255,i/255)}static Lerp(e,t,i){const s=new tt(0,0,0);return tt.LerpToRef(e,t,i,s),s}static LerpToRef(e,t,i,s){s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,d=c-o,g=e.r*h+i.r*f+t.r*_+s.r*d,p=e.g*h+i.g*f+t.g*_+s.g*d,b=e.b*h+i.b*f+t.b*_+s.b*d;return new tt(g,p,b)}static Hermite1stDerivative(e,t,i,s,n){const o=tt.Black();return this.Hermite1stDerivativeToRef(e,t,i,s,n,o),o}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;o.r=(c-n)*6*e.r+(3*c-4*n+1)*t.r+(-c+n)*6*i.r+(3*c-2*n)*s.r,o.g=(c-n)*6*e.g+(3*c-4*n+1)*t.g+(-c+n)*6*i.g+(3*c-2*n)*s.g,o.b=(c-n)*6*e.b+(3*c-4*n+1)*t.b+(-c+n)*6*i.b+(3*c-2*n)*s.b}static Red(){return new tt(1,0,0)}static Green(){return new tt(0,1,0)}static Blue(){return new tt(0,0,1)}static Black(){return new tt(0,0,0)}static get BlackReadOnly(){return tt._BlackReadOnly}static White(){return new tt(1,1,1)}static Purple(){return new tt(.5,0,.5)}static Magenta(){return new tt(1,0,1)}static Yellow(){return new tt(1,1,0)}static Gray(){return new tt(.5,.5,.5)}static Teal(){return new tt(0,1,1)}static Random(){return new tt(Math.random(),Math.random(),Math.random())}}tt._V8PerformanceHack=new tt(.5,.5,.5);tt._BlackReadOnly=tt.Black();class xt{constructor(e=0,t=0,i=0,s=1){this.r=e,this.g=t,this.b=i,this.a=s}asArray(){return[this.r,this.g,this.b,this.a]}toArray(e,t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}equals(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}add(e){return new xt(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)}addToRef(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,t.a=this.a+e.a,t}addInPlace(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this}addInPlaceFromFloats(e,t,i,s){return this.r+=e,this.g+=t,this.b+=i,this.a+=s,this}subtract(e){return new xt(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)}subtractToRef(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,t}subtractInPlace(e){return this.r-=e.r,this.g-=e.g,this.b-=e.b,this.a-=e.a,this}subtractFromFloats(e,t,i,s){return new xt(this.r-e,this.g-t,this.b-i,this.a-s)}subtractFromFloatsToRef(e,t,i,s,n){return n.r=this.r-e,n.g=this.g-t,n.b=this.b-i,n.a=this.a-s,n}scale(e){return new xt(this.r*e,this.g*e,this.b*e,this.a*e)}scaleInPlace(e){return this.r*=e,this.g*=e,this.b*=e,this.a*=e,this}scaleToRef(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,t}scaleAndAddToRef(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,t}clampToRef(e=0,t=1,i){return i.r=yi(this.r,e,t),i.g=yi(this.g,e,t),i.b=yi(this.b,e,t),i.a=yi(this.a,e,t),i}multiply(e){return new xt(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)}multiplyToRef(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t}multiplyInPlace(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this.a*=e.a,this}multiplyByFloats(e,t,i,s){return new xt(this.r*e,this.g*t,this.b*i,this.a*s)}divide(e){throw new ReferenceError("Can not divide a color")}divideToRef(e,t){throw new ReferenceError("Can not divide a color")}divideInPlace(e){throw new ReferenceError("Can not divide a color")}minimizeInPlace(e){return this.r=Math.min(this.r,e.r),this.g=Math.min(this.g,e.g),this.b=Math.min(this.b,e.b),this.a=Math.min(this.a,e.a),this}maximizeInPlace(e){return this.r=Math.max(this.r,e.r),this.g=Math.max(this.g,e.g),this.b=Math.max(this.b,e.b),this.a=Math.max(this.a,e.a),this}minimizeInPlaceFromFloats(e,t,i,s){return this.r=Math.min(e,this.r),this.g=Math.min(t,this.g),this.b=Math.min(i,this.b),this.a=Math.min(s,this.a),this}maximizeInPlaceFromFloats(e,t,i,s){return this.r=Math.max(e,this.r),this.g=Math.max(t,this.g),this.b=Math.max(i,this.b),this.a=Math.max(s,this.a),this}floorToRef(e){throw new ReferenceError("Can not floor a color")}floor(){throw new ReferenceError("Can not floor a color")}fractToRef(e){throw new ReferenceError("Can not fract a color")}fract(){throw new ReferenceError("Can not fract a color")}negate(){throw new ReferenceError("Can not negate a color")}negateInPlace(){throw new ReferenceError("Can not negate a color")}negateToRef(e){throw new ReferenceError("Can not negate a color")}equalsWithEpsilon(e,t=It){return ei(this.r,e.r,t)&&ei(this.g,e.g,t)&&ei(this.b,e.b,t)&&ei(this.a,e.a,t)}equalsToFloats(e,t,i,s){return this.r===e&&this.g===t&&this.b===i&&this.a===s}toString(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"}getClassName(){return"Color4"}getHashCode(){let e=this.r*255|0;return e=e*397^(this.g*255|0),e=e*397^(this.b*255|0),e=e*397^(this.a*255|0),e}clone(){return new xt().copyFrom(this)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}copyFromFloats(e,t,i,s){return this.r=e,this.g=t,this.b=i,this.a=s,this}set(e,t,i,s){return this.copyFromFloats(e,t,i,s)}setAll(e){return this.r=this.g=this.b=this.a=e,this}toHexString(e=!1){const t=Math.round(this.r*255),i=Math.round(this.g*255),s=Math.round(this.b*255);if(e)return"#"+Xn(t)+Xn(i)+Xn(s);const n=Math.round(this.a*255);return"#"+Xn(t)+Xn(i)+Xn(s)+Xn(n)}fromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?this:(this.r=parseInt(e.substring(1,3),16)/255,this.g=parseInt(e.substring(3,5),16)/255,this.b=parseInt(e.substring(5,7),16)/255,e.length===9&&(this.a=parseInt(e.substring(7,9),16)/255),this)}toLinearSpace(e=!1){const t=new xt;return this.toLinearSpaceToRef(t,e),t}toLinearSpaceToRef(e,t=!1){return t?(e.r=yl(this.r),e.g=yl(this.g),e.b=yl(this.b)):(e.r=pl(this.r),e.g=pl(this.g),e.b=pl(this.b)),e.a=this.a,this}toGammaSpace(e=!1){const t=new xt;return this.toGammaSpaceToRef(t,e),t}toGammaSpaceToRef(e,t=!1){return t?(e.r=xl(this.r),e.g=xl(this.g),e.b=xl(this.b)):(e.r=bl(this.r),e.g=bl(this.g),e.b=bl(this.b)),e.a=this.a,this}static FromHexString(e){return e.substring(0,1)!=="#"||e.length!==9&&e.length!==7?new xt(0,0,0,0):new xt(0,0,0,1).fromHexString(e)}static Lerp(e,t,i){return xt.LerpToRef(e,t,i,new xt)}static LerpToRef(e,t,i,s){return s.r=e.r+(t.r-e.r)*i,s.g=e.g+(t.g-e.g)*i,s.b=e.b+(t.b-e.b)*i,s.a=e.a+(t.a-e.a)*i,s}static Hermite(e,t,i,s,n){const o=n*n,c=n*o,h=2*c-3*o+1,f=-2*c+3*o,_=c-2*o+n,d=c-o,g=e.r*h+i.r*f+t.r*_+s.r*d,p=e.g*h+i.g*f+t.g*_+s.g*d,b=e.b*h+i.b*f+t.b*_+s.b*d,x=e.a*h+i.a*f+t.a*_+s.a*d;return new xt(g,p,b,x)}static Hermite1stDerivative(e,t,i,s,n){const o=new xt;return this.Hermite1stDerivativeToRef(e,t,i,s,n,o),o}static Hermite1stDerivativeToRef(e,t,i,s,n,o){const c=n*n;o.r=(c-n)*6*e.r+(3*c-4*n+1)*t.r+(-c+n)*6*i.r+(3*c-2*n)*s.r,o.g=(c-n)*6*e.g+(3*c-4*n+1)*t.g+(-c+n)*6*i.g+(3*c-2*n)*s.g,o.b=(c-n)*6*e.b+(3*c-4*n+1)*t.b+(-c+n)*6*i.b+(3*c-2*n)*s.b,o.a=(c-n)*6*e.a+(3*c-4*n+1)*t.a+(-c+n)*6*i.a+(3*c-2*n)*s.a}static FromColor3(e,t=1){return new xt(e.r,e.g,e.b,t)}static FromArray(e,t=0){return new xt(e[t],e[t+1],e[t+2],e[t+3])}static FromArrayToRef(e,t=0,i){i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]}static FromInts(e,t,i,s){return new xt(e/255,t/255,i/255,s/255)}static CheckColors4(e,t){if(e.length===t*3){const i=[];for(let s=0;s<e.length;s+=3){const n=s/3*4;i[n]=e[s],i[n+1]=e[s+1],i[n+2]=e[s+2],i[n+3]=1}return i}return e}}xt._V8PerformanceHack=new xt(.5,.5,.5,.5);class oo{}oo.Color3=Nr(3,tt.Black);oo.Color4=Nr(3,()=>new xt(0,0,0,0));let Lx=!1;function HP(){Lx||(Lx=!0,Object.defineProperties(tt.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(xt.prototype,{dimension:{value:[4]},rank:{value:1}}),In("BABYLON.Color3",tt),In("BABYLON.Color4",xt))}class Mn{constructor(e,t,i,s){this.normal=new I(e,t,i),this.d=s}asArray(){return[this.normal.x,this.normal.y,this.normal.z,this.d]}clone(){return new Mn(this.normal.x,this.normal.y,this.normal.z,this.d)}getClassName(){return"Plane"}getHashCode(){let e=this.normal.getHashCode();return e=e*397^(this.d|0),e}normalize(){const e=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z);let t=0;return e!==0&&(t=1/e),this.normal.x*=t,this.normal.y*=t,this.normal.z*=t,this.d*=t,this}transform(e){const t=Mn._TmpMatrix;e.invertToRef(t);const i=t.m,s=this.normal.x,n=this.normal.y,o=this.normal.z,c=this.d,h=s*i[0]+n*i[1]+o*i[2]+c*i[3],f=s*i[4]+n*i[5]+o*i[6]+c*i[7],_=s*i[8]+n*i[9]+o*i[10]+c*i[11],d=s*i[12]+n*i[13]+o*i[14]+c*i[15];return new Mn(h,f,_,d)}dotCoordinate(e){return this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z+this.d}copyFromPoints(e,t,i){const s=t.x-e.x,n=t.y-e.y,o=t.z-e.z,c=i.x-e.x,h=i.y-e.y,f=i.z-e.z,_=n*f-o*h,d=o*c-s*f,g=s*h-n*c,p=Math.sqrt(_*_+d*d+g*g);let b;return p!==0?b=1/p:b=0,this.normal.x=_*b,this.normal.y=d*b,this.normal.z=g*b,this.d=-(this.normal.x*e.x+this.normal.y*e.y+this.normal.z*e.z),this}isFrontFacingTo(e,t){return I.Dot(this.normal,e)<=t}signedDistanceTo(e){return I.Dot(e,this.normal)+this.d}static FromArray(e){return new Mn(e[0],e[1],e[2],e[3])}static FromPoints(e,t,i){const s=new Mn(0,0,0,0);return s.copyFromPoints(e,t,i),s}static FromPositionAndNormal(e,t){const i=new Mn(0,0,0,0);return this.FromPositionAndNormalToRef(e,t,i)}static FromPositionAndNormalToRef(e,t,i){return i.normal.copyFrom(t),i.normal.normalize(),i.d=-e.dot(i.normal),i}static SignedDistanceToPlaneFromPositionAndNormal(e,t,i){const s=-(t.x*e.x+t.y*e.y+t.z*e.z);return I.Dot(i,t)+s}}Mn._TmpMatrix=ae.Identity();class bn{static GetPlanes(e){const t=[];for(let i=0;i<6;i++)t.push(new Mn(0,0,0,0));return bn.GetPlanesToRef(e,t),t}static GetNearPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[2],t.normal.y=i[7]+i[6],t.normal.z=i[11]+i[10],t.d=i[15]+i[14],t.normalize()}static GetFarPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[2],t.normal.y=i[7]-i[6],t.normal.z=i[11]-i[10],t.d=i[15]-i[14],t.normalize()}static GetLeftPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[0],t.normal.y=i[7]+i[4],t.normal.z=i[11]+i[8],t.d=i[15]+i[12],t.normalize()}static GetRightPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[0],t.normal.y=i[7]-i[4],t.normal.z=i[11]-i[8],t.d=i[15]-i[12],t.normalize()}static GetTopPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]-i[1],t.normal.y=i[7]-i[5],t.normal.z=i[11]-i[9],t.d=i[15]-i[13],t.normalize()}static GetBottomPlaneToRef(e,t){const i=e.m;t.normal.x=i[3]+i[1],t.normal.y=i[7]+i[5],t.normal.z=i[11]+i[9],t.d=i[15]+i[13],t.normalize()}static GetPlanesToRef(e,t){bn.GetNearPlaneToRef(e,t[0]),bn.GetFarPlaneToRef(e,t[1]),bn.GetLeftPlaneToRef(e,t[2]),bn.GetRightPlaneToRef(e,t[3]),bn.GetTopPlaneToRef(e,t[4]),bn.GetBottomPlaneToRef(e,t[5])}static IsPointInFrustum(e,t){for(let i=0;i<6;i++)if(t[i].dotCoordinate(e)<0)return!1;return!0}}var Bx;
187(function(r){r[r.CW=0]="CW",r[r.CCW=1]="CCW"})(Bx||(Bx={}));class Yn{constructor(e){this._radians=e,this._radians<0&&(this._radians+=2*Math.PI)}degrees(){return this._radians*180/Math.PI}radians(){return this._radians}static BetweenTwoPoints(e,t){const i=t.subtract(e),s=Math.atan2(i.y,i.x);return new Yn(s)}static BetweenTwoVectors(e,t){let i=e.lengthSquared()*t.lengthSquared();if(i===0)return new Yn(Math.PI/2);i=Math.sqrt(i);let s=e.dot(t)/i;s=yi(s,-1,1);const n=Math.acos(s);return new Yn(n)}static FromRadians(e){return new Yn(e)}static FromDegrees(e){return new Yn(e*Math.PI/180)}}class WP{constructor(e,t,i){this.startPoint=e,this.midPoint=t,this.endPoint=i;const s=Math.pow(t.x,2)+Math.pow(t.y,2),n=(Math.pow(e.x,2)+Math.pow(e.y,2)-s)/2,o=(s-Math.pow(i.x,2)-Math.pow(i.y,2))/2,c=(e.x-t.x)*(t.y-i.y)-(t.x-i.x)*(e.y-t.y);this.centerPoint=new He((n*(t.y-i.y)-o*(e.y-t.y))/c,((e.x-t.x)*o-(t.x-i.x)*n)/c),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=Yn.BetweenTwoPoints(this.centerPoint,this.startPoint);const h=this.startAngle.degrees();let f=Yn.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),_=Yn.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();f-h>180&&(f-=360),f-h<-180&&(f+=360),_-f>180&&(_-=360),_-f<-180&&(_+=360),this.orientation=f-h<0?0:1,this.angle=Yn.FromDegrees(this.orientation===0?h-_:_-h)}}class ud{constructor(e,t){this._points=new Array,this._length=0,this.closed=!1,this._points.push(new He(e,t))}addLineTo(e,t){if(this.closed)return this;const i=new He(e,t),s=this._points[this._points.length-1];return this._points.push(i),this._length+=i.subtract(s).length(),this}addArcTo(e,t,i,s,n=36){if(this.closed)return this;const o=this._points[this._points.length-1],c=new He(e,t),h=new He(i,s),f=new WP(o,c,h);let _=f.angle.radians()/n;f.orientation===0&&(_*=-1);let d=f.startAngle.radians()+_;for(let g=0;g<n;g++){const p=Math.cos(d)*f.radius+f.centerPoint.x,b=Math.sin(d)*f.radius+f.centerPoint.y;this.addLineTo(p,b),d+=_}return this}addQuadraticCurveTo(e,t,i,s,n=36){if(this.closed)return this;const o=(h,f,_,d)=>(1-h)*(1-h)*f+2*h*(1-h)*_+h*h*d,c=this._points[this._points.length-1];for(let h=0;h<=n;h++){const f=h/n,_=o(f,c.x,e,i),d=o(f,c.y,t,s);this.addLineTo(_,d)}return this}addBezierCurveTo(e,t,i,s,n,o,c=36){if(this.closed)return this;const h=(_,d,g,p,b)=>(1-_)*(1-_)*(1-_)*d+3*_*(1-_)*(1-_)*g+3*_*_*(1-_)*p+_*_*_*b,f=this._points[this._points.length-1];for(let _=0;_<=c;_++){const d=_/c,g=h(d,f.x,e,i,n),p=h(d,f.y,t,s,o);this.addLineTo(g,p)}return this}isPointInside(e){let t=!1;const i=this._points.length;for(let s=i-1,n=0;n<i;s=n++){let o=this._points[s],c=this._points[n],h=c.x-o.x,f=c.y-o.y;if(Math.abs(f)>Number.EPSILON){if(f<0&&(o=this._points[n],h=-h,c=this._points[s],f=-f),e.y<o.y||e.y>c.y)continue;if(e.y===o.y&&e.x===o.x)return!0;{const _=f*(e.x-o.x)-h*(e.y-o.y);if(_===0)return!0;if(_<0)continue;t=!t}}else{if(e.y!==o.y)continue;if(c.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=c.x)return!0}}return t}close(){return this.closed=!0,this}length(){let e=this._length;if(this.closed){const t=this._points[this._points.length-1],i=this._points[0];e+=i.subtract(t).length()}return e}area(){const e=this._points.length;let t=0;for(let i=e-1,s=0;s<e;i=s++)t+=this._points[i].x*this._points[s].y-this._points[s].x*this._points[i].y;return t*.5}getPoints(){return this._points}getPointAtLengthPosition(e){if(e<0||e>1)return He.Zero();const t=e*this.length();let i=0;for(let s=0;s<this._points.length;s++){const n=(s+1)%this._points.length,o=this._points[s],h=this._points[n].subtract(o),f=h.length()+i;if(t>=i&&t<=f){const _=h.normalize(),d=t-i;return new He(o.x+_.x*d,o.y+_.y*d)}i=f}return He.Zero()}static StartingAt(e,t){return new ud(e,t)}}class ch{constructor(e,t=null,i,s=!1){this.path=e,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array,this._pointAtData={id:0,point:I.Zero(),previousPointArrayIndex:0,position:0,subPosition:0,interpolateReady:!1,interpolationMatrix:ae.Identity()};for(let n=0;n<e.length;n++)this._curve[n]=e[n].clone();this._raw=i||!1,this._alignTangentsWithPath=s,this._compute(t,s)}
187getCurve(){return this._curve}getPoints(){return this._curve}length(){return this._distances[this._distances.length-1]}getTangents(){return this._tangents}getNormals(){return this._normals}getBinormals(){return this._binormals}getDistances(){return this._distances}getPointAt(e){return this._updatePointAtData(e).point}getTangentAt(e,t=!1){return this._updatePointAtData(e,t),t?I.TransformCoordinates(I.Forward(),this._pointAtData.interpolationMatrix):this._tangents[this._pointAtData.previousPointArrayIndex]}getNormalAt(e,t=!1){return this._updatePointAtData(e,t),t?I.TransformCoordinates(I.Right(),this._pointAtData.interpolationMatrix):this._normals[this._pointAtData.previousPointArrayIndex]}getBinormalAt(e,t=!1){return this._updatePointAtData(e,t),t?I.TransformCoordinates(I.UpReadOnly,this._pointAtData.interpolationMatrix):this._binormals[this._pointAtData.previousPointArrayIndex]}getDistanceAt(e){return this.length()*e}getPreviousPointIndexAt(e){return this._updatePointAtData(e),this._pointAtData.previousPointArrayIndex}getSubPositionAt(e){return this._updatePointAtData(e),this._pointAtData.subPosition}getClosestPositionTo(e){let t=Number.MAX_VALUE,i=0;for(let s=0;s<this._curve.length-1;s++){const n=this._curve[s+0],o=this._curve[s+1].subtract(n).normalize(),c=this._distances[s+1]-this._distances[s+0],h=Math.min(Math.max(I.Dot(o,e.subtract(n).normalize()),0)*I.Distance(n,e)/c,1),f=I.Distance(n.add(o.scale(h*c)),e);f<t&&(t=f,i=(this._distances[s+0]+c*h)/this.length())}return i}slice(e=0,t=1){if(e<0&&(e=1-e*-1%1),t<0&&(t=1-t*-1%1),e>t){const f=e;e=t,t=f}const i=this.getCurve(),s=this.getPointAt(e);let n=this.getPreviousPointIndexAt(e);const o=this.getPointAt(t),c=this.getPreviousPointIndexAt(t)+1,h=[];return e!==0&&(n++,h.push(s)),h.push(...i.slice(n,c)),(t!==1||e===1)&&h.push(o),new ch(h,this.getNormalAt(e),this._raw,this._alignTangentsWithPath)}update(e,t=null,i=!1){for(let s=0;s<e.length;s++)this._curve[s].x=e[s].x,this._curve[s].y=e[s].y,this._curve[s].z=e[s].z;return this._compute(t,i),this}_compute(e,t=!1){const i=this._curve.length;if(i<2)return;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[i-1]=this._curve[i-1].subtract(this._curve[i-2]),this._raw||this._tangents[i-1].normalize();const s=this._tangents[0],n=this._normalVector(s,e);this._normals[0]=n,this._raw||this._normals[0].normalize(),this._binormals[0]=I.Cross(s,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;let o,c,h,f,_;for(let d=1;d<i;d++)o=this._getLastNonNullVector(d),d<i-1&&(c=this._getFirstNonNullVector(d),this._tangents[d]=t?c:o.add(c),this._tangents[d].normalize()),this._distances[d]=this._distances[d-1]+this._curve[d].subtract(this._curve[d-1]).length(),h=this._tangents[d],_=this._binormals[d-1],this._normals[d]=I.Cross(_,h),this._raw||(this._normals[d].length()===0?(f=this._normals[d-1],this._normals[d]=f.clone()):this._normals[d].normalize()),this._binormals[d]=I.Cross(h,this._normals[d]),this._raw||this._binormals[d].normalize();this._pointAtData.id=NaN}_getFirstNonNullVector(e){let t=1,i=this._curve[e+t].subtract(this._curve[e]);for(;i.length()===0&&e+t+1<this._curve.length;)t++,i=this._curve[e+t].subtract(this._curve[e]);return i}_getLastNonNullVector(e){let t=1,i=this._curve[e].subtract(this._curve[e-t]);for(;i.length()===0&&e>t+1;)t++,i=this._curve[e].subtract(this._curve[e-t]);return i}_normalVector(e,t){let i,s=e.length();if(s===0&&(s=1),t==null){let n;ei(Math.abs(e.y)/s,1,It)?ei(Math.abs(e.x)/s,1,It)?ei(Math.abs(e.z)/s,1,It)?n=I.Zero():n=new I(0,0,1):n=new I(1,0,0):n=new I(0,-1,0),i=I.Cross(e,n)}else i=I.Cross(e,t),I.CrossToRef(i,e,i);return i.normalize(),i}_updatePointAtData(e,t=!1){if(this._pointAtData.id===e)return this._pointAtData.interpolateReady||this._updateInterpolationMatrix(),this._pointAtData;this._pointAtData.id=e;const i=this.getPoints();if(e<=0)return this._setPointAtData(0,0,i[0],0,t);if(e>=1)return this._setPointAtData(1,1,i[i.length-1],i.length-1,t);let s=i[0],n,o=0;const c=e*this.length();for(let h=1;h<i.length;h++){n=i[h];const f=I.Distance(s,n);if(o+=f,o===c)return this._setPointAtData(e,1,n,h,t);if(o>c){const d=(o-c)/f,g=s.subtract(n),p=n.add(g.scaleInPlace(d));return this._setPointAtData(e,1-d,p,h-1,t)}s=n}return this._pointAtData}_setPointAtData(e,t,i,s,n){return this._pointAtData.point=i,this._pointAtData.position=e,this._pointAtData.subPosition=t,this._pointAtData.previousPointArrayIndex=s,this._pointAtData.interpolateReady=n,n&&this._updateInterpolationMatrix(),this._pointAtData}_updateInterpolationMatrix(){this._pointAtData.interpolationMatrix=ae.Identity();const e=this._pointAtData.previousPointArrayIndex;if(e!==this._tangents.length-1){const t=e+1,i=this._tangents[e].clone(),s=this._normals[e].clone(),n=this._binormals[e].clone(),o=this._tangents[t].clone(),c=this._normals[t].clone(),h=this._binormals[t].clone(),f=Ue.RotationQuaternionFromAxis(s,n,i),_=Ue.RotationQuaternionFromAxis(c,h,o);Ue.Slerp(f,_,this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix)}}}class Qs{constructor(e,t){this.width=e,this.height=t}toString(){return`{W: ${this.width}, H: ${this.height}}`}getClassName(){return"Size"}getHashCode(){let e=this.width|0;return e=e*397^(this.height|0),e}
vendor: 7,238 bytes, line 187
187copyFrom(e){this.width=e.width,this.height=e.height}copyFromFloats(e,t){return this.width=e,this.height=t,this}set(e,t){return this.copyFromFloats(e,t)}multiplyByFloats(e,t){return new Qs(this.width*e,this.height*t)}clone(){return new Qs(this.width,this.height)}equals(e){return e?this.width===e.width&&this.height===e.height:!1}get surface(){return this.width*this.height}static Zero(){return new Qs(0,0)}add(e){return new Qs(this.width+e.width,this.height+e.height)}subtract(e){return new Qs(this.width-e.width,this.height-e.height)}scale(e){return new Qs(this.width*e,this.height*e)}static Lerp(e,t,i){const s=e.width+(t.width-e.width)*i,n=e.height+(t.height-e.height)*i;return new Qs(s,n)}}class Gf{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s}toGlobal(e,t){return new Gf(this.x*e,this.y*t,this.width*e,this.height*t)}toGlobalToRef(e,t,i){return i.x=this.x*e,i.y=this.y*t,i.width=this.width*e,i.height=this.height*t,this}clone(){return new Gf(this.x,this.y,this.width,this.height)}}const Wn=[Math.sqrt(1/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(3/(4*Math.PI)),-Math.sqrt(3/(4*Math.PI)),Math.sqrt(15/(4*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(5/(16*Math.PI)),-Math.sqrt(15/(4*Math.PI)),Math.sqrt(15/(16*Math.PI))],XP=[()=>1,r=>r.y,r=>r.z,r=>r.x,r=>r.x*r.y,r=>r.y*r.z,r=>3*r.z*r.z-1,r=>r.x*r.z,r=>r.x*r.x-r.y*r.y],Ir=(r,e)=>Wn[r]*XP[r](e),Dr=[Math.PI,2*Math.PI/3,2*Math.PI/3,2*Math.PI/3,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4,Math.PI/4];class Hf{constructor(){this.preScaled=!1,this.l00=I.Zero(),this.l1_1=I.Zero(),this.l10=I.Zero(),this.l11=I.Zero(),this.l2_2=I.Zero(),this.l2_1=I.Zero(),this.l20=I.Zero(),this.l21=I.Zero(),this.l22=I.Zero()}addLight(e,t,i){ge.Vector3[0].set(t.r,t.g,t.b);const s=ge.Vector3[0],n=ge.Vector3[1];s.scaleToRef(i,n),n.scaleToRef(Ir(0,e),ge.Vector3[2]),this.l00.addInPlace(ge.Vector3[2]),n.scaleToRef(Ir(1,e),ge.Vector3[2]),this.l1_1.addInPlace(ge.Vector3[2]),n.scaleToRef(Ir(2,e),ge.Vector3[2]),this.l10.addInPlace(ge.Vector3[2]),n.scaleToRef(Ir(3,e),ge.Vector3[2]),this.l11.addInPlace(ge.Vector3[2]),n.scaleToRef(Ir(4,e),ge.Vector3[2]),this.l2_2.addInPlace(ge.Vector3[2]),n.scaleToRef(Ir(5,e),ge.Vector3[2]),this.l2_1.addInPlace(ge.Vector3[2]),n.scaleToRef(Ir(6,e),ge.Vector3[2]),this.l20.addInPlace(ge.Vector3[2]),n.scaleToRef(Ir(7,e),ge.Vector3[2]),this.l21.addInPlace(ge.Vector3[2]),n.scaleToRef(Ir(8,e),ge.Vector3[2]),this.l22.addInPlace(ge.Vector3[2])}scaleInPlace(e){this.l00.scaleInPlace(e),this.l1_1.scaleInPlace(e),this.l10.scaleInPlace(e),this.l11.scaleInPlace(e),this.l2_2.scaleInPlace(e),this.l2_1.scaleInPlace(e),this.l20.scaleInPlace(e),this.l21.scaleInPlace(e),this.l22.scaleInPlace(e)}convertIncidentRadianceToIrradiance(){this.l00.scaleInPlace(Dr[0]),this.l1_1.scaleInPlace(Dr[1]),this.l10.scaleInPlace(Dr[2]),this.l11.scaleInPlace(Dr[3]),this.l2_2.scaleInPlace(Dr[4]),this.l2_1.scaleInPlace(Dr[5]),this.l20.scaleInPlace(Dr[6]),this.l21.scaleInPlace(Dr[7]),this.l22.scaleInPlace(Dr[8])}convertIrradianceToLambertianRadiance(){this.scaleInPlace(1/Math.PI)}preScaleForRendering(){this.preScaled=!0,this.l00.scaleInPlace(Wn[0]),this.l1_1.scaleInPlace(Wn[1]),this.l10.scaleInPlace(Wn[2]),this.l11.scaleInPlace(Wn[3]),this.l2_2.scaleInPlace(Wn[4]),this.l2_1.scaleInPlace(Wn[5]),this.l20.scaleInPlace(Wn[6]),this.l21.scaleInPlace(Wn[7]),this.l22.scaleInPlace(Wn[8])}updateFromArray(e){return I.FromArrayToRef(e[0],0,this.l00),I.FromArrayToRef(e[1],0,this.l1_1),I.FromArrayToRef(e[2],0,this.l10),I.FromArrayToRef(e[3],0,this.l11),I.FromArrayToRef(e[4],0,this.l2_2),I.FromArrayToRef(e[5],0,this.l2_1),I.FromArrayToRef(e[6],0,this.l20),I.FromArrayToRef(e[7],0,this.l21),I.FromArrayToRef(e[8],0,this.l22),this}updateFromFloatsArray(e){return I.FromFloatsToRef(e[0],e[1],e[2],this.l00),I.FromFloatsToRef(e[3],e[4],e[5],this.l1_1),I.FromFloatsToRef(e[6],e[7],e[8],this.l10),I.FromFloatsToRef(e[9],e[10],e[11],this.l11),I.FromFloatsToRef(e[12],e[13],e[14],this.l2_2),I.FromFloatsToRef(e[15],e[16],e[17],this.l2_1),I.FromFloatsToRef(e[18],e[19],e[20],this.l20),I.FromFloatsToRef(e[21],e[22],e[23],this.l21),I.FromFloatsToRef(e[24],e[25],e[26],this.l22),this}static FromArray(e){return new Hf().updateFromArray(e)}static FromPolynomial(e){const t=new Hf;return t.l00=e.xx.scale(.376127).add(e.yy.scale(.376127)).add(e.zz.scale(.376126)),t.l1_1=e.y.scale(.977204),t.l10=e.z.scale(.977204),t.l11=e.x.scale(.977204),t.l2_2=e.xy.scale(1.16538),t.l2_1=e.yz.scale(1.16538),t.l20=e.zz.scale(1.34567).subtract(e.xx.scale(.672834)).subtract(e.yy.scale(.672834)),t.l21=e.zx.scale(1.16538),t.l22=e.xx.scale(1.16538).subtract(e.yy.scale(1.16538)),t.l1_1.scaleInPlace(-1),t.l11.scaleInPlace(-1),t.l2_1.scaleInPlace(-1),t.l21.scaleInPlace(-1),t.scaleInPlace(Math.PI),t}}class Wf{constructor(){this.x=I.Zero(),this.y=I.Zero(),this.z=I.Zero(),this.xx=I.Zero(),this.yy=I.Zero(),this.zz=I.Zero(),this.xy=I.Zero(),this.yz=I.Zero(),this.zx=I.Zero()}get preScaledHarmonics(){return this._harmonics||(this._harmonics=Hf.FromPolynomial(this)),this._harmonics.preScaled||this._harmonics.preScaleForRendering(),this._harmonics}addAmbient(e){ge.Vector3[0].copyFromFloats(e.r,e.g,e.b);const t=ge.Vector3[0];this.xx.addInPlace(t),this.yy.addInPlace(t),this.zz.addInPlace(t)}scaleInPlace(e){this.x.scaleInPlace(e),this.y.scaleInPlace(e),this.z.scaleInPlace(e),this.xx.scaleInPlace(e),this.yy.scaleInPlace(e),this.zz.scaleInPlace(e),this.yz.scaleInPlace(e),this.zx.scaleInPlace(e),this.xy.scaleInPlace(e)}updateFromHarmonics(e){return this._harmonics=e,this.x.copyFrom(e.l11),this.x.scaleInPlace(1.02333).scaleInPlace(-1),this.y.copyFrom(e.l1_1),this.y.scaleInPlace(1.02333).scaleInPlace(-1),this.z.copyFrom(e.l10),this.z.scaleInPlace(1.02333),this.xx.copyFrom(e.l00),ge.Vector3[0].copyFrom(e.l20).scaleInPlace(.247708),ge.Vector3[1].copyFrom(e.l22).scaleInPlace(.429043),this.xx.scaleInPlace(.886277).subtractInPlace(ge.Vector3[0]).addInPlace(ge.Vector3[1]),this.yy.copyFrom(e.l00),this.yy.scaleInPlace(.886277).subtractInPlace(ge.Vector3[0]).subtractInPlace(ge.Vector3[1]),this.zz.copyFrom(e.l00),ge.Vector3[0].copyFrom(e.l20).scaleInPlace(.495417),this.zz.scaleInPlace(.886277).addInPlace(ge.Vector3[0]),this.yz.copyFrom(e.l2_1),this.yz.scaleInPlace(.858086).scaleInPlace(-1),this.zx.copyFrom(e.l21),this.zx.scaleInPlace(.858086).scaleInPlace(-1),this.xy.copyFrom(e.l2_2),this.xy.scaleInPlace(.858086),this.scaleInPlace(1/Math.PI),this}static FromHarmonics(e){return new Wf().updateFromHarmonics(e)}static FromArray(e){const t=new Wf;return I.FromArrayToRef(e[0],0,t.x),I.FromArrayToRef(e[1],0,t.y),I.FromArrayToRef(e[2],0,t.z),I.FromArrayToRef(e[3],0,t.xx),I.FromArrayToRef(e[4],0,t.yy),I.FromArrayToRef(e[5],0,t.zz),I.FromArrayToRef(e[6],0,t.yz),I.FromArrayToRef(e[7],0,t.zx),I.FromArrayToRef(e[8],0,t.xy),t}}function $(r,e,t,i,s,n){function o(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var c=i.kind,h=c==="getter"?"get":c==="setter"?"set":"value",f=!e&&r?i.static?r:r.prototype:null,_=e||(f?Object.getOwnPropertyDescriptor(f,i.name):{}),d,g=!1,p=t.length-1;p>=0;p--){var b={};for(var x in i)b[x]=x==="access"?{}:i[x];for(var x in i.access)b.access[x]=i.access[x];b.addInitializer=function(v){if(g)throw new TypeError("Cannot add initializer
187s after decoration has completed");n.push(o(v||null))};var E=(0,t[p])(c==="accessor"?{get:_.get,set:_.set}:_[h],b);if(c==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(d=o(E.get))&&(_.get=d),(d=o(E.set))&&(_.set=d),(d=o(E.init))&&s.unshift(d)}else(d=o(E))&&(c==="field"?s.unshift(d):_[h]=d)}f&&Object.defineProperty(f,i.name,_),g=!0}function L(r,e,t){for(var i=arguments.length>2,s=0;s<e.length;s++)t=i?e[s].call(r,t):e[s].call(r);return i?t:void 0}function Kt(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}function Zt(r,e,t,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t}const Jc="__bjs_serializable__",Nx=new WeakMap;function iA(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function YP(){let r=Symbol.metadata;return r||(r=Symbol("Symbol.metadata"),Object.defineProperty(Symbol,"metadata",{configurable:!0,writable:!0,value:r})),r}const sA=YP();function jP(r){return typeof r=="function"?r:r?.constructor}function nA(r){if(!r)throw new Error(`Decorator metadata is unavailable; the Symbol.metadata (${String(sA)}) polyfill must run before decorated classes are evaluated.`);return iA(r,Jc)||(r[Jc]={}),r[Jc]}function Vm(r){const e=jP(r),t=e?e[sA]:void 0;if(!t)return{};const i=Nx.get(t);if(i)return i;const s={},n=[];let o=t;for(;o;)n.push(o),o=Object.getPrototypeOf(o);for(const c of n)if(iA(c,Jc)){const h=c[Jc];for(const f in h)s[f]=h[f]}return Nx.set(t,s),s}function er(r,e){return(t,i)=>{if(!i.metadata)return;const s=String(i.name),n=nA(i.metadata);n[s]||(n[s]={type:r,sourceName:e})}}function qP(r,e=null){return(t,i)=>{const s=e||"_"+String(i.name);return{init(n){return(n!==void 0||!(s in this))&&(this[s]=n),n},get(){return this[s]},set(n){typeof this[s]?.equals=="function"&&this[s].equals(n)||this[s]!==n&&(this[s]=n,this[r]())}}}}function Qt(r,e=null){return qP(r,e)}function he(r){return er(0,r)}function yn(r){return er(1,r)}function lo(r){return er(2,r)}function Qc(r){return er(3,r)}function KP(r){return er(4,r)}function Ur(r){return er(5,r)}function rA(r){return er(6,r)}function ZP(r){return er(7,r)}function QP(r){return er(8,r)}function $P(r){return er(10,r)}function aA(r,e,t){const i=String(e.name);let s=null;const n=function(...o){if(s===null){s=r,typeof _native<"u"&&_native[i]&&(s=t(_native[i],r));const c=this&&(e.static?this:Object.getPrototypeOf(this));c?.[i]===n&&(c[i]=s)}return s.apply(this,o)};return n}function Ra(r,e){return aA(r,e,t=>t)}Ra.filter=function(r){return(e,t)=>aA(e,t,(i,s)=>function(...n){return r(...n)?i(...n):s.apply(this,n)})};function oA(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}class _g{get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get coordinatesMode(){return 0}get isCube(){return this._texture?this._texture.isCube:!1}set isCube(e){this._texture&&(this._texture.isCube=e)}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}getClassName(){return"ThinTexture"}static _IsRenderTargetWrapper(e){return e?.shareDepth!==void 0}constructor(e){this._wrapU=1,this._wrapV=1,this.wrapR=1,this.anisotropicFilteringLevel=4,this.delayLoadState=0,this._texture=null,this._engine=null,this._cachedSize=Qs.Zero(),this._cachedBaseSize=Qs.Zero(),this._initialSamplingMode=2,this._texture=_g._IsRenderTargetWrapper(e)?e.texture:e,this._texture&&(this._engine=this._texture.getEngine(),this.wrapU=this._texture._cachedWrapU??this.wrapU,this.wrapV=this._texture._cachedWrapV??this.wrapV,this.wrapR=this._texture._cachedWrapR??this.wrapR)}isReady(){return this.delayLoadState===4?(this.delayLoad(),!1):this._texture?this._texture.isReady:!1}delayLoad(){}getInternalTexture(){return this._texture}getSize(){if(this._texture){if(this._texture.width)return this._cachedSize.
vendor: 15,868 bytes, line 187
187width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;if(this._texture._size)return this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size,this._cachedSize}return this._cachedSize}getBaseSize(){return!this.isReady()||!this._texture?(this._cachedBaseSize.width=0,this._cachedBaseSize.height=0,this._cachedBaseSize):this._texture._size?(this._cachedBaseSize.width=this._texture._size,this._cachedBaseSize.height=this._texture._size,this._cachedBaseSize):(this._cachedBaseSize.width=this._texture.baseWidth,this._cachedBaseSize.height=this._texture.baseHeight,this._cachedBaseSize)}get samplingMode(){return this._texture?this._texture.samplingMode:this._initialSamplingMode}updateSamplingMode(e,t=!1){this._texture&&this._engine&&this._engine.updateTextureSamplingMode(e,this._texture,this._texture.generateMipMaps&&t)}releaseInternalTexture(){this._texture&&(this._texture.dispose(),this._texture=null)}dispose(){this._texture&&(this.releaseInternalTexture(),this._engine=null)}}class ro{static Eval(e,t){return e.match(/\([^()]*\)/g)?e=e.replace(/\([^()]*\)/g,i=>(i=i.slice(1,i.length-1),ro._HandleParenthesisContent(i,t))):e=ro._HandleParenthesisContent(e,t),e==="true"?!0:e==="false"?!1:ro.Eval(e,t)}static _HandleParenthesisContent(e,t){t=t||(n=>n==="true");let i;const s=e.split("||");for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)){let o=ro._SimplifyNegation(s[n].trim());const c=o.split("&&");if(c.length>1)for(let h=0;h<c.length;++h){const f=ro._SimplifyNegation(c[h].trim());if(f!=="true"&&f!=="false"?f[0]==="!"?i=!t(f.substring(1)):i=t(f):i=f==="true",!i){o="false";break}}if(i||o==="true"){i=!0;break}o!=="true"&&o!=="false"?o[0]==="!"?i=!t(o.substring(1)):i=t(o):i=o==="true"}return i?"true":"false"}static _SimplifyNegation(e){return e=e.replace(/^[\s!]+/,t=>(t=t.replace(/[\s]/g,()=>""),t.length%2?"!":"")),e=e.trim(),e==="!true"?e="false":e==="!false"&&(e="true"),e}}class Ut{static EnableFor(e){e._tags=e._tags||{},e.hasTags=()=>Ut.HasTags(e),e.addTags=t=>Ut.AddTagsTo(e,t),e.removeTags=t=>Ut.RemoveTagsFrom(e,t),e.matchesTagsQuery=t=>Ut.MatchesQuery(e,t)}static DisableFor(e){delete e._tags,delete e.hasTags,delete e.addTags,delete e.removeTags,delete e.matchesTagsQuery}static HasTags(e){if(!e._tags)return!1;const t=e._tags;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i))return!0;return!1}static GetTags(e,t=!0){if(!e._tags)return null;if(t){const i=[];for(const s in e._tags)Object.prototype.hasOwnProperty.call(e._tags,s)&&e._tags[s]===!0&&i.push(s);return i.join(" ")}else return e._tags}static AddTagsTo(e,t){if(!t||typeof t!="string")return;const i=t.split(" ");for(const s of i)Ut._AddTagTo(e,s)}static _AddTagTo(e,t){t=t.trim(),!(t===""||t==="true"||t==="false")&&(t.match(/[\s]/)||t.match(/^([!]|([|]|[&]){2})/)||(Ut.EnableFor(e),e._tags[t]=!0))}static RemoveTagsFrom(e,t){if(!Ut.HasTags(e))return;const i=t.split(" ");for(const s in i)Ut._RemoveTagFrom(e,i[s])}static _RemoveTagFrom(e,t){delete e._tags[t]}static MatchesQuery(e,t){return t===void 0?!0:t===""?Ut.HasTags(e):ro.Eval(t,i=>Ut.HasTags(e)&&e._tags[i])}}const Ux=function(r,e,t,i={}){const s=r();Ut&&Ut.HasTags(e)&&Ut.AddTagsTo(s,Ut.GetTags(e,!0));const n=Vm(s),o={};for(const c in n){const h=n[c],f=e[c],_=h.type;if(f!=null&&(c!=="uniqueId"||Tt.AllowLoadingUniqueId))switch(_){case 0:case 6:case 9:case 11:typeof f.slice=="function"?s[c]=f.slice():s[c]=f;break;case 1:i.cloneTexturesOnlyOnce&&o[f.uniqueId]?s[c]=o[f.uniqueId]:(s[c]=t||f.isRenderTarget?f:f.clone(),o[f.uniqueId]=s[c]);break;case 2:case 3:case 4:case 5:case 7:case 8:case 10:case 12:case 13:s[c]=t?f:f.clone();break}}return s};class Tt{static AppendSerializedAnimations(e,t){if(e.animations){t.animations=[];for(let i=0;i<e.animations.length;i++){const s=e.animations[i];t.animations.push(s.serialize())}}}static Serialize(e,t){t||(t={}),Ut&&(t.tags=Ut.GetTags(e));const i=Vm(e);for(const s in i){const n=i[s],o=n.sourceName||s,c=n.type,h=e[s];if(h!=null&&(s!=="uniqueId"||Tt.AllowLoadingUniqueId))switch(c){case 0:Array.isArray(h)?t[o]=h.slice():t[o]=h;break;case 1:t[o]=h.serialize();break;case 2:t[o]=h.asArray();break;case 3:t[o]=h.serialize();break;case 4:t[o]=h.asArray();break;case 5:t[o]=h.asArray();break;case 6:t[o]=h.id;break;case 7:t[o]=h.serialize();break;case 8:t[o]=h.asArray();break;case 9:t[o]=h.serialize();break;case 10:t[o]=h.asArray();break;case 11:t[o]=h.id;break;case 12:t[o]=h.asArray();break;case 13:t[o]=h.asArray();break}}return t}static ParseProperties(e,t,i,s){s||(s="");const n=Vm(t);for(const o in n){const c=n[o],h=e[c.sourceName||o],f=c.type;if(h!=null&&(o!=="uniqueId"||Tt.AllowLoadingUniqueId)){const _=t;switch(f){case 0:_[o]=h;break;case 1:i&&(_[o]=Tt._TextureParser(h,i,s));break;case 2:_[o]=tt.FromArray(h);break;case 3:_[o]=Tt._FresnelParametersParser(h);break;case 4:_[o]=He.FromArray(h);break;case 5:_[o]=I.FromArray(h);break;case 6:i&&(_[o]=i.getLastMeshById(h));break;case 7:_[o]=Tt._ColorCurvesParser(h);break;case 8:_[o]=xt.FromArray(h);break;case 9:_[o]=Tt._ImageProcessingConfigurationParser(h);break;case 10:_[o]=Ue.FromArray(h);break;case 11:i&&(_[o]=i.getCameraById(h));break;case 12:_[o]=ae.FromArray(h);break;case 13:_[o]=dt.FromArray(h);break}}}}static Parse(e,t,i,s=null){const n=e();return Ut&&Ut.AddTagsTo(n,t.tags),Tt.ParseProperties(t,n,i,s),n}static Clone(e,t,i={}){return Ux(e,t,!1,i)}static Instanciate(e,t){return Ux(e,t,!0)}}Tt.AllowLoadingUniqueId=!1;Tt._ImageProcessingConfigurationParser=r=>{throw at("ImageProcessingConfiguration")};Tt._FresnelParametersParser=r=>{throw at("FresnelParameters")};Tt._ColorCurvesParser=r=>{throw at("ColorCurves")};Tt._TextureParser=(r,e,t)=>{throw at("Texture")};var kx;let Xf=(()=>{var r;let e=_g,t=[],i,s=[],n=[],o,c=[],h=[],f,_=[],d=[],g,p=[],b=[],x,E=[],v=[],S,R=[],P=[],M,O=[],D=[],w,G=[],H=[],ie,ne=[],ce=[],k,te=[],X=[],q,W,K,Z=[],F=[],A,N=[],Y=[],se,ue,pe,Ie,Le,J=[],_e=[],ye,Ne=[],Je=[],je,yt,Yt,kt,Et,Gt=[],zt=[];return r=class extends e{set hasAlpha(oe){this._hasAlpha!==oe&&(this._hasAlpha=oe,this._scene&&this._scene.markAllMaterialsAsDirty(1,ze=>ze.hasTexture(this)))}get hasAlpha(){return this._hasAlpha}set getAlphaFromRGB(oe){this._getAlphaFromRGB!==oe&&(this._getAlphaFromRGB=oe,this._scene&&this._scene.markAllMaterialsAsDirty(1,ze=>ze.hasTexture(this)))}get getAlphaFromRGB(){return this._getAlphaFromRGB}set coordinatesIndex(oe){this._coordinatesIndex!==oe&&(this._coordinatesIndex=oe,this._scene&&this._scene.markAllMaterialsAsDirty(1,ze=>ze.hasTexture(this)))}get coordinatesIndex(){return this._coordinatesIndex}set coordinatesMode(oe){this._coordinatesMode!==oe&&(this._coordinatesMode=oe,this._scene&&this._scene.markAllMaterialsAsDirty(1,ze=>ze.hasTexture(this)))}get coordinatesMode(){return this._coordinatesMode}get wrapU(){return this._wrapU}set wrapU(oe){this._wrapU=oe}get wrapV(){return this._wrapV}set wrapV(oe){this._wrapV=oe}get isCube(){return this._texture?this._texture.isCube:this._isCube}set isCube(oe){this._texture?this._texture.isCube=oe:this._isCube=oe}get is3D(){return this._texture?this._texture.is3D:!1}set is3D(oe){this._texture&&(this._texture.is3D=oe)}get is2DArray(){return this._texture?this._texture.is2DArray:!1}set is2DArray(oe){this._texture&&(this._texture.is2DArray=oe)}get gammaSpace(){if(this._texture)this._texture._gammaSpace===null&&(this._texture._gammaSpace=this._gammaSpace);else return this._gammaSpace;return this._texture._gammaSpace&&!this._texture._useSRGBBuffer}set gammaSpace(oe){if(this._texture){if(this._texture._gammaSpace===oe)return;this._texture._gammaSpace=oe}else{if(this._gammaSpace===oe)return;this._gammaSpace=oe}this.getScene()?.markAllMaterialsAsDirty(1,ze=>ze.hasTexture(this))}get isRGBD(){return this._texture!=null&&this._texture._isRGBD}set isRGBD(oe){oe!==this.isRGBD&&(this._texture&&(this._texture._isRGBD=oe),this.getScene()?.markAllMaterialsAsDirty(1,ze=>ze.hasTexture(this)))}get noMipmap(){return!1}get lodGenerationOffset(){return this._texture?this._texture._lodGenerationOffset:0}set lodGenerationOffset(oe){this._texture&&(this._texture._lodGenerationOffset=oe)}get lodGenerationScale(){return this._texture?this._texture._lodGenerationScale:0}set lodGenerationScale(oe){this._texture&&(this._texture._lodGenerationScale=oe)}get linearSpecularLOD(){return this._texture?this._texture._linearSpecularLOD:!1}set linearSpecularLOD(oe){this._texture&&(this._texture._linearSpecularLOD=oe)}get irradianceTexture(){return this._texture?this._texture._irradianceTexture:null}set irradianceTexture(oe){this._texture&&(this._texture._irradianceTexture=oe)}get uid(){return this._uid||(this._uid=oA()),this._uid}toString(){return this.name}getClassName(){return"BaseTexture"}set onDispose(oe){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(oe)}get isBlocking(){return!0}get loadingError(){return this._loadingError}get errorObject(){return this._errorObject}constructor(oe,ze=null){super(null),this.uniqueId=(L(this,t),L(this,s,void 0)),this.name=(L(this,n),L(this,c,void 0)),this.displayName=(L(this,h),L(this,_,void 0)),this.metadata=(L(this,d),L(this,p,null)),this._internalMetadata=L(this,b),this.reservedDataStore=null,this._hasAlpha=L(this,E,!1),this._getAlphaFromRGB=(L(this,v),L(this,R,!1)),this.level=(L(this,P),L(this,O,1)),this._coordinatesIndex=(L(this,D),L(this,G,0)),this.optimizeUVAllocation=(L(this,H),L(this,ne,!0)),this._coordinatesMode=(L(this,ce),L(this,te,0)),this.wrapR=(L(this,X),L(this,Z,1)),this.anisotropicFilteringLevel=(L(this,F),L(this,N,r.DEFAULT_ANISOTROPIC_FILTERING_LEVEL)),this._isCube=(L(this,Y),!1),this._gammaSpace=!0,this.invertZ=L(this,J,!1),this.lodLevelInAlpha=(L(this,_e),L(this,Ne,!1)),this._dominantDirection=(L(this,Je),null),this.isRenderTarget=L(this,Gt,!1),this._prefiltered=(L(this,zt),!1),this._forceSerialize=!1,this.animations=[],this.onDisposeObservable=new Oe,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,oe?r._IsScene(oe)?this._scene=oe:this._engine=oe:this._scene=vt.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this),this._engine=this._scene.getEngine()),this._texture=ze,this._uid=null}getScene(){return this._scene}_getEngine(){return this._engine}getTextureMatrix(){return ae.IdentityReadOnly}getReflectionTextureMatrix(){return ae.IdentityReadOnly}getRefractionTextureMatrix(){return this.getReflectionTextureMatrix()}isReadyOrNotBlocking(){return!this.isBlocking||this.isReady()||this.loadingError}scale(oe){}get canRescale(){return!1}_getFromCache(oe,ze,si,$t,oi,ti){const ii=this._getEngine();if(!ii)return null;const Ct=ii._getUseSRGBBuffer(!!oi,ze),ni=ii.getLoadedTexturesCache();for(let Pt=0;Pt<ni.length;Pt++){const Ht=ni[Pt];if((oi===void 0||Ct===Ht._useSRGBBuffer)&&($t===void 0||$t===Ht.invertY)&&Ht.url===oe&&Ht.generateMipMaps===!ze&&(!si||si===Ht.samplingMode)&&(ti===void 0||ti===Ht.isCube))return Ht.incrementReferences(),Ht}return null}_rebuild(oe=!1){}clone(){return null}get textureType(){return this._texture&&this._texture.type!==void 0?this._texture.type:0}get textureFormat(){return this._texture&&this._texture.format!==void 0?this._texture.format:5}_markAllSubMeshesAsTexturesDirty(){const oe=this.getScene();oe&&oe.markAllMaterialsAsDirty(1)}readPixels(oe=0,ze=0,si=null,$t=!0,oi=!1,ti=0,ii=0,Ct=Number.MAX_VALUE,ni=Number.MAX_VALUE){if(!this._texture)return null;const Pt=this._getEngine();if(!Pt)return null;const Ht=this.getSize();let ri=Ht.width,di=Ht.height;ze!==0&&(ri=ri/Math.pow(2,ze),di=di/Math.pow(2,ze),ri=Math.round(ri),di=Math.round(di)),Ct=Math.min(ri,Ct),ni=Math.min(di,ni);try{return this._texture.isCube||this._texture.is2DArray?Pt._readTexturePixels(this._texture,Ct,ni,oe,ze,si,$t,oi,ti,ii):Pt._readTexturePixels(this._texture,Ct,ni,-1,ze,si,$t,oi,ti,ii)}catch{return null}}_readPixelsSync(oe=0,ze=0,si=null,$t=!0,oi=!1){if(!this._texture)return null;const ti=this.getSize();let ii=ti.width,Ct=ti.height;const ni=this._getEngine();if(!ni)return null;ze!=0&&(ii=ii/Math.pow(2,ze),Ct=Ct/Math.pow(2,ze),ii=Math.round(ii),Ct=Math.round(Ct));try{return this._texture.isCube?ni._readTexturePixelsSync(this._texture,ii,Ct,oe,ze,si,$t,oi):ni._readTexturePixelsSync(this._texture,ii,Ct,-1,ze,si,$t,oi)}catch{return null}}get _lodTextureHigh(){return this._texture?this._texture._lodTextureHigh:null}get _lodTextureMid(){return this._texture?this._texture._lodTextureMid:null}get _lodTextureLow(){return this._texture?this._texture._lodTextureLow:null}dispose(){if(this._scene){this._scene.stopAnimation&&this._scene.stopAnimation(this),this._scene.removePendingData(this);const oe=this._scene.textures.indexOf(this);if(oe>=0&&this._scene.textures.splice(oe,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null,this._parentContainer){const ze=this._parentContainer.textures.indexOf(this);ze>-1&&this._parentContainer.textures.splice(ze,1),this._parentContainer=null}}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.metadata=null,super.dispose()}serialize(oe=!1){if(!this.name&&!oe)return null;const ze=Tt.Serialize(this);return Tt.AppendSerializedAnimations(this,ze),ze}static WhenAllReady(oe,ze){let si=oe.length;if(si===0){ze();return}for(let $t=0;$t<oe.length;$t++){const oi=oe[$t];if(oi.isReady())--si===0&&ze();else{const ti=oi.onLoadObservable;ti?ti.addOnce(()=>{--si===0&&ze()}):--si===0&&ze()}}}static _IsScene(oe){return oe.getClassName()==="Scene"}},(()=>{const nt=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[he()],o=[he()],f=[he()],g=[he()],x=[he("hasAlpha")],S=[he("getAlphaFromRGB")],M=[he()],w=[he("coordinatesIndex")],ie=[he()],k=[he("coordinatesMode")],q=[he()],W=[he()],K=[he()],A=[he()],se=[he()],ue=[he()],pe=[he()],Ie=[he()],Le=[he()],ye=[he()],je=[he()],yt=[he()],Yt=[he()],kt=[yn()],Et=[he()],$(r,null,q,{kind:"getter",name:"wrapU",static:!1,private:!1,access:{has:oe=>"wrapU"in oe,get:oe=>oe.wrapU},metadata:nt},null,t),$(r,null,W,{kind:"getter",name:"wrapV",static:!1,private:!1,access:{has:oe=>"wrapV"in oe,get:oe=>oe.wrapV},metadata:nt},null,t),$(r,null,se,{kind:"getter",name:"isCube",static:!1,private:!1,access:{has:oe=>"isCube"in oe,get:oe=>oe.isCube},metadata:nt},null,t),$(r,null,ue,{kind:"getter",name:"is3D",static:!1,private:!1,access:{has:oe=>"is3D"in oe,get:oe=>oe.is3D},metadata:nt},null,t),$(r,null,pe,{kind:"getter",name:"is2DArray",static:!1,private:!1,access:{has:oe=>"is2DArray"in oe,get:oe=>oe.is2DArray},metadata:nt},null,t),$(r,null,Ie,{kind:"getter",name:"gammaSpace",static:!1,private:!1,access:{has:oe=>"gammaSpace"in oe,get:oe=>oe.gammaSpace},metadata:nt},null,t),$(r,null,je,{kind:"getter",name:"lodGenerationOffset",static:!1,private:!1,access:{has:oe=>"lodGenerationOffset"in oe,get:oe=>oe.lodGenerationOffset},metadata:nt},null,t),$(r,null,yt,{kind:"getter",name:"lodGenerationScale",static:!1,private:!1,access:{has:oe=>"lodGenerationScale"in oe,get:oe=>oe.lodGenerationScale},metadata:nt},null,t),$(r,null,Yt,{kind:"getter",name:"linearSpecularLOD",static:!1,private:!1,access:{has:oe=>"linearSpecularLOD"in oe,get:oe=>oe.linearSpecularLOD},metadata:nt},null,t),$(r,null,kt,{kind:"getter",name:"irradianceTexture",static:!1,private:!1,access:{has:oe=>"irradianceTexture"in oe,get:oe=>oe.irradianceTexture},metadata:nt},null,t),$(null,null,i,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:oe=>"uniqueId"in oe,get:oe=>oe.uniqueId,set:(oe,ze)=>{oe.uniqueId=ze}},metadata:nt},s,n),$(null,null,o,{kind:"field",name:"name",static:!1,private:!1,access:{has:oe=>"name"in oe,get:oe=>oe.name,set:(oe,ze)=>{oe.name=ze}},metadata:nt},c,h),$(null,null,f,{kind:"field",name:"displayName",static:!1,private:!1,access:{has:oe=>"displayName"in oe,get:oe=>
187oe.displayName,set:(oe,ze)=>{oe.displayName=ze}},metadata:nt},_,d),$(null,null,g,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:oe=>"metadata"in oe,get:oe=>oe.metadata,set:(oe,ze)=>{oe.metadata=ze}},metadata:nt},p,b),$(null,null,x,{kind:"field",name:"_hasAlpha",static:!1,private:!1,access:{has:oe=>"_hasAlpha"in oe,get:oe=>oe._hasAlpha,set:(oe,ze)=>{oe._hasAlpha=ze}},metadata:nt},E,v),$(null,null,S,{kind:"field",name:"_getAlphaFromRGB",static:!1,private:!1,access:{has:oe=>"_getAlphaFromRGB"in oe,get:oe=>oe._getAlphaFromRGB,set:(oe,ze)=>{oe._getAlphaFromRGB=ze}},metadata:nt},R,P),$(null,null,M,{kind:"field",name:"level",static:!1,private:!1,access:{has:oe=>"level"in oe,get:oe=>oe.level,set:(oe,ze)=>{oe.level=ze}},metadata:nt},O,D),$(null,null,w,{kind:"field",name:"_coordinatesIndex",static:!1,private:!1,access:{has:oe=>"_coordinatesIndex"in oe,get:oe=>oe._coordinatesIndex,set:(oe,ze)=>{oe._coordinatesIndex=ze}},metadata:nt},G,H),$(null,null,ie,{kind:"field",name:"optimizeUVAllocation",static:!1,private:!1,access:{has:oe=>"optimizeUVAllocation"in oe,get:oe=>oe.optimizeUVAllocation,set:(oe,ze)=>{oe.optimizeUVAllocation=ze}},metadata:nt},ne,ce),$(null,null,k,{kind:"field",name:"_coordinatesMode",static:!1,private:!1,access:{has:oe=>"_coordinatesMode"in oe,get:oe=>oe._coordinatesMode,set:(oe,ze)=>{oe._coordinatesMode=ze}},metadata:nt},te,X),$(null,null,K,{kind:"field",name:"wrapR",static:!1,private:!1,access:{has:oe=>"wrapR"in oe,get:oe=>oe.wrapR,set:(oe,ze)=>{oe.wrapR=ze}},metadata:nt},Z,F),$(null,null,A,{kind:"field",name:"anisotropicFilteringLevel",static:!1,private:!1,access:{has:oe=>"anisotropicFilteringLevel"in oe,get:oe=>oe.anisotropicFilteringLevel,set:(oe,ze)=>{oe.anisotropicFilteringLevel=ze}},metadata:nt},N,Y),$(null,null,Le,{kind:"field",name:"invertZ",static:!1,private:!1,access:{has:oe=>"invertZ"in oe,get:oe=>oe.invertZ,set:(oe,ze)=>{oe.invertZ=ze}},metadata:nt},J,_e),$(null,null,ye,{kind:"field",name:"lodLevelInAlpha",static:!1,private:!1,access:{has:oe=>"lodLevelInAlpha"in oe,get:oe=>oe.lodLevelInAlpha,set:(oe,ze)=>{oe.lodLevelInAlpha=ze}},metadata:nt},Ne,Je),$(null,null,Et,{kind:"field",name:"isRenderTarget",static:!1,private:!1,access:{has:oe=>"isRenderTarget"in oe,get:oe=>oe.isRenderTarget,set:(oe,ze)=>{oe.isRenderTarget=ze}},metadata:nt},Gt,zt),nt&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:nt})})(),r.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,r})();(kx=Xf.prototype).forceSphericalPolynomialsRecompute??(kx.forceSphericalPolynomialsRecompute=Ze("BaseTexture","forceSphericalPolynomialsRecompute"));Object.getOwnPropertyDescriptor(Xf.prototype,"sphericalPolynomial")||Object.defineProperty(Xf.prototype,"sphericalPolynomial",At("BaseTexture","sphericalPolynomial"));let zx=!1;function JP(){zx||(zx=!0,_t.prototype.createPrefilteredCubeTexture=function(r,e,t,i,s=null,n=null,o,c=null,h=!0){const f=async _=>{if(!_){s&&s(null);return}const d=_.texture;if(h?_.info.sphericalPolynomial&&(d._sphericalPolynomial=_.info.sphericalPolynomial):d._sphericalPolynomial=d._sphericalPolynomial??new Wf,d._source=9,this.getCaps().textureLOD){s&&s(d);return}const g=3,p=this._gl,b=_.width;if(!b)return;const{DDSTools:x}=await ts(async()=>{const{DDSTools:v}=await import("./dds-Babr594Z.js");return{DDSTools:v}},__vite__mapDeps([0,1,2])),E=[];for(let v=0;v<g;v++){const R=1-v/(g-1),P=i,M=Math.log2(b)*t+i,O=P+(M-P)*R,D=Math.round(Math.min(Math.max(O,0),M)),w=new ws(this,2);if(w.type=d.type,w.format=d.format,w.width=Math.pow(2,Math.max(Math.log2(b)-D,0)),w.height=w.width,w.isCube=!0,w._cachedWrapU=0,w._cachedWrapV=0,this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,w,!0),w.samplingMode=2,p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_MAG_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_MIN_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_CUBE_MAP,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),_.isDDS){const H=_.info,ie=_.data;this._unpackFlipY(H.isCompressed),x.UploadDDSLevels(this,w,ie,H,!0,6,D)}else Ee.Warn("DDS is the only prefiltered cube map supported so far.");this._bindTextureDirectly(p.TEXTURE_CUBE_MAP,null);const G=new Xf(e);G._isCube=!0,G._texture=w,w.isReady=!0,E.push(G)}d._lodTextureHigh=E[2],d._lodTextureMid=E[1],d._lodTextureLow=E[0],s&&s(d)};return this.createCubeTexture(r,e,null,!1,f,n,o,c,h,t,i)})}JP();let Vx=!1;function eO(){Vx||(Vx=!0,_t.prototype.createUniformBuffer=function(r,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create uniform buffer");const i=new ah(t);return this.bindUniformBuffer(i),r instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,r,this._gl.STATIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(r),this._gl.STATIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},_t.prototype.createDynamicUniformBuffer=function(r,e){const t=this._gl.createBuffer();if(!t)throw new Error("Unable to create dynamic uniform buffer");const i=new ah(t);return this.bindUniformBuffer(i),r instanceof Float32Array?this._gl.bufferData(this._gl.UNIFORM_BUFFER,r,this._gl.DYNAMIC_DRAW):this._gl.bufferData(this._gl.UNIFORM_BUFFER,new Float32Array(r),this._gl.DYNAMIC_DRAW),this.bindUniformBuffer(null),i.references=1,i},_t.prototype.updateUniformBuffer=function(r,e,t,i){this.bindUniformBuffer(r),t===void 0&&(t=0),i===void 0?e instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,t,e):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,t,new Float32Array(e)):e instanceof Float32Array?this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,e.subarray(t,t+i)):this._gl.bufferSubData(this._gl.UNIFORM_BUFFER,0,new Float32Array(e).subarray(t,t+i)),this.bindUniformBuffer(null)},_t.prototype.bindUniformBuffer=function(r){this._gl.bindBuffer(this._gl.UNIFORM_BUFFER,r?r.underlyingResource:null)},_t.prototype.bindUniformBufferBase=function(r,e,t){this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER,e,r?r.underlyingResource:null)},_t.prototype.bindUniformBlock=function(r,e,t){const i=r.program,s=this._gl.getUniformBlockIndex(i,e);s!==4294967295&&this._gl.uniformBlockBinding(i,s,t)})}eO();let Gx=!1;function tO(){Gx||(Gx=!0,Be.prototype.displayLoadingUI=function(){if(!is())return;const r=this.loadingScreen;r&&r.displayLoadingUI()},Be.prototype.hideLoadingUI=function(){if(!is())return;const r=this._loadingScreen;r&&r.hideLoadingUI()},Object.defineProperty(Be.prototype,"loadingScreen",{get:function(){return!this._loadingScreen&&this._renderingCanvas&&(this._loadingScreen=Be.DefaultLoadingScreenFactory(this._renderingCanvas)),this._loadingScreen},set:function(r){this._loadingScreen=r},enumerable:!0,configurable:!0}),Object.defineProperty(Be.prototype,"loadingUIText",{set:function(r){this.loadingScreen.loadingUIText=r},enumerable:!0,configurable:!0}
187),Object.defineProperty(Be.prototype,"loadingUIBackgroundColor",{set:function(r){this.loadingScreen.loadingUIBackgroundColor=r},enumerable:!0,configurable:!0}))}tO();Zv();let Hx=!1;function iO(){Hx||(Hx=!0,Be.prototype.getInputElement=function(){return this._renderingCanvas},Be.prototype.getDepthFunction=function(){return this._depthCullingState.depthFunc},Be.prototype.setDepthFunction=function(r){this._depthCullingState.depthFunc=r},Be.prototype.setDepthFunctionToGreater=function(){this.setDepthFunction(516)},Be.prototype.setDepthFunctionToGreaterOrEqual=function(){this.setDepthFunction(518)},Be.prototype.setDepthFunctionToLess=function(){this.setDepthFunction(513)},Be.prototype.setDepthFunctionToLessOrEqual=function(){this.setDepthFunction(515)},Be.prototype.getDepthWrite=function(){return this._depthCullingState.depthMask},Be.prototype.setDepthWrite=function(r){this._depthCullingState.depthMask=r},Be.prototype.setAlphaConstants=function(r,e,t,i){this._alphaState.setAlphaBlendConstants(r,e,t,i)},Be.prototype.getAlphaMode=function(r=0){return this._alphaMode[r]},Be.prototype.getAlphaEquation=function(r=0){return this._alphaEquation[r]})}iO();let Wx=!1;function sO(){Wx||(Wx=!0,Be.prototype.getStencilBuffer=function(){return this._stencilState.stencilTest},Be.prototype.setStencilBuffer=function(r){this._stencilState.stencilTest=r},Be.prototype.getStencilMask=function(){return this._stencilState.stencilMask},Be.prototype.setStencilMask=function(r){this._stencilState.stencilMask=r},Be.prototype.getStencilFunction=function(){return this._stencilState.stencilFunc},Be.prototype.getStencilBackFunction=function(){return this._stencilState.stencilBackFunc},Be.prototype.getStencilFunctionReference=function(){return this._stencilState.stencilFuncRef},Be.prototype.getStencilFunctionMask=function(){return this._stencilState.stencilFuncMask},Be.prototype.setStencilFunction=function(r){this._stencilState.stencilFunc=r},Be.prototype.setStencilBackFunction=function(r){this._stencilState.stencilBackFunc=r},Be.prototype.setStencilFunctionReference=function(r){this._stencilState.stencilFuncRef=r},Be.prototype.setStencilFunctionMask=function(r){this._stencilState.stencilFuncMask=r},Be.prototype.getStencilOperationFail=function(){return this._stencilState.stencilOpStencilFail},Be.prototype.getStencilBackOperationFail=function(){return this._stencilState.stencilBackOpStencilFail},Be.prototype.getStencilOperationDepthFail=function(){return this._stencilState.stencilOpDepthFail},Be.prototype.getStencilBackOperationDepthFail=function(){return this._stencilState.stencilBackOpDepthFail},Be.prototype.getStencilOperationPass=function(){return this._stencilState.stencilOpStencilDepthPass},Be.prototype.getStencilBackOperationPass=function(){return this._stencilState.stencilBackOpStencilDepthPass},Be.prototype.setStencilOperationFail=function(r){this._stencilState.stencilOpStencilFail=r},Be.prototype.setStencilBackOperationFail=function(r){this._stencilState.stencilBackOpStencilFail=r},Be.prototype.setStencilOperationDepthFail=function(r){this._stencilState.stencilOpDepthFail=r},Be.prototype.setStencilBackOperationDepthFail=function(r){this._stencilState.stencilBackOpDepthFail=r},Be.prototype.setStencilOperationPass=function(r){this._stencilState.stencilOpStencilDepthPass=r},Be.prototype.setStencilBackOperationPass=function(r){this._stencilState.stencilBackOpStencilDepthPass=r},Be.prototype.cacheStencilState=function(){this._cachedStencilBuffer=this.getStencilBuffer(),this._cachedStencilFunction=this.getStencilFunction(),this._cachedStencilMask=this.getStencilMask(),this._cachedStencilOperationPass=this.getStencilOperationPass(),this._cachedStencilOperationFail=this.getStencilOperationFail(),this._cachedStencilOperationDepthFail=this.getStencilOperationDepthFail(),this._cachedStencilReference=this.getStencilFunctionReference()},Be.prototype.restoreStencilState=function(){this.setStencilFunction(this._cachedStencilFunction),this.setStencilMask(this._cachedStencilMask),this.setStencilBuffer(this._cachedStencilBuffer),this.setStencilOperationPass(this._cachedStencilOperationPass),this.setStencilOperationFail(this._cachedStencilOperationFail),this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail),this.setStencilFunctionReference(this._cachedStencilReference)})}sO();fg();let Xx=!1;function nO(){Xx||(Xx=!0,Be.prototype.createDepthStencilTexture=function(r,e,t){if(e.isCube){const i=r.width||r;return this._createDepthStencilCubeTexture(i,e)}else return this._createDepthStencilTexture(r,e,t)})}nO();function rO(){return typeof _native<"u"&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest}class zi{constructor(){this._xhr=rO(),this._requestURL=""}static get IsCustomRequestAvailable(){return Object.keys(zi.CustomRequestHeaders).length>0||zi.CustomRequestModifiers.length>0}static _CleanUrl(e){return e=e.replace("file:http:","http:"),e=e.replace("file:https:","https:"),e}static _ShouldSkipRequestModifications(e){return zi.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}static _CollectCustomizations(e,t={}){const i={...t};if(zi._ShouldSkipRequestModifications(e))return{url:e,headers:i};for(const n in zi.CustomRequestHeaders){const o=zi.CustomRequestHeaders[n];o&&(i[n]=o)}const s={setRequestHeader:(n,o)=>{i[n]=o}};for(const n of zi.CustomRequestModifiers){if(zi._ShouldSkipRequestModifications(e))break;const o=n(s,e);
187typeof o=="string"&&(e=o)}return{url:e,headers:i}}static async FetchAsync(e,t={}){const i=t.method??"GET";if(typeof fetch<"u"){const{url:s,headers:n}=zi._CollectCustomizations(zi._CleanUrl(e),t.headers??{});return await fetch(s,{method:i,headers:n,body:t.body??void 0})}return await new Promise((s,n)=>{const o=new zi;o.responseType="arraybuffer",o.addEventListener("readystatechange",()=>{if(o.readyState===4)if(o.status>=200&&o.status<300){const c=typeof Headers<"u"?new Headers:void 0,h=o.getResponseHeader("Content-Type");h&&c&&c.set("Content-Type",h),s(typeof Response<"u"?new Response(o.response,{status:o.status,statusText:o.statusText,headers:c}):{ok:!0,status:o.status,statusText:o.statusText,headers:{get:f=>o.getResponseHeader(f)},arrayBuffer:async()=>await Promise.resolve(o.response)})}else n(new Error(`HTTP ${o.status} loading '${o.requestURL}': ${o.statusText}`))}),o.open(i,e,t.headers),o.send(t.body??null)})}get requestURL(){return this._requestURL}get onprogress(){return this._xhr.onprogress}set onprogress(e){this._xhr.onprogress=e}get readyState(){return this._xhr.readyState}get status(){return this._xhr.status}get statusText(){return this._xhr.statusText}get response(){return this._xhr.response}get responseURL(){return this._xhr.responseURL}get responseText(){return this._xhr.responseText}get responseType(){return this._xhr.responseType}set responseType(e){this._xhr.responseType=e}get timeout(){return this._xhr.timeout}set timeout(e){this._xhr.timeout=e}addEventListener(e,t,i){this._xhr.addEventListener(e,t,i)}removeEventListener(e,t,i){this._xhr.removeEventListener(e,t,i)}abort(){this._xhr.abort()}send(e){this._xhr.send(e)}open(e,t,i){const{url:s,headers:n}=zi._CollectCustomizations(t,i);this._requestURL=zi._CleanUrl(s),this._xhr.open(e,this._requestURL,!0);for(const o in n)this._xhr.setRequestHeader(o,n[o])}setRequestHeader(e,t){this._xhr.setRequestHeader(e,t)}getResponseHeader(e){return this._xhr.getResponseHeader(e)}}zi.CustomRequestHeaders={};zi.CustomRequestModifiers=new Array;zi.SkipRequestModificationForBabylonCDN=!0;class eh{}eh.FilesToLoad={};class aO{static ExponentialBackoff(e=3,t=500){return(i,s,n)=>s.status!==0||n>=e||i.indexOf("file:")!==-1?-1:Math.pow(2,n)*t}}class vl extends Error{}vl._setPrototypeOf=Object.setPrototypeOf||((r,e)=>(r.__proto__=e,r));const fd={MeshInvalidPositionsError:0,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002};class Cl extends vl{constructor(e,t,i){super(e),this.errorCode=t,this.innerError=i,this.name="RuntimeError",vl._setPrototypeOf(this,Cl.prototype)}}function oO(r){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",i,s,n,o,c,h,f,_=0;for(;_<r.length;)i=r[_++],s=_<r.length?r[_++]:Number.NaN,n=_<r.length?r[_++]:Number.NaN,o=i>>2,c=(i&3)<<4|s>>4,h=(s&15)<<2|n>>6,f=n&63,isNaN(s)?h=f=64:isNaN(n)&&(f=64),t+=e.charAt(o)+e.charAt(c)+e.charAt(h)+e.charAt(f);return t}function lO(r){const e=lA(r),t=e.length,i=new Uint8Array(new ArrayBuffer(t));for(let s=0;s<t;s++)i[s]=e.charCodeAt(s);return i.buffer}const cO=r=>{const e=ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r);return typeof e.toBase64=="function"?e.toBase64():oO(e)},lA=r=>atob(r),hO=r=>typeof Uint8Array.fromBase64=="function"?Uint8Array.fromBase64(r).buffer:lO(r);let Rf=null;function cA(){if(Rf)return Rf;const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),i=new Uint32Array(512),s=new Uint32Array(512);for(let h=0;h<256;++h){const f=h-127;f<-24?(i[h]=0,i[h|256]=32768,s[h]=24,s[h|256]=24):f<-14?(i[h]=1024>>-f-14,i[h|256]=1024>>-f-14|32768,s[h]=-f-1,s[h|256]=-f-1):f<=15?(i[h]=f+15<<10,i[h|256]=f+15<<10|32768,s[h]=13,s[h|256]=13):f<128?(i[h]=31744,i[h|256]=64512,s[h]=24,s[h|256]=24):(i[h]=31744,i[h|256]=64512,s[h]=13,s[h|256]=13)}const n=new Uint32Array(2048),o=new Uint32Array(64),c=new Uint32Array(64);for(let h=1;h<1024;++h){let f=h<<13,_=0;for(;(f&8388608)===0;)f<<=1,_-=8388608;f&=-8388609,_+=947912704,n[h]=f|_}for(let h=1024;h<2048;++h)n[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(c[h]=1024);return Rf={floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:n,exponentTable:o,offsetTable:c},Rf}const IL=65504;function uO(r){const e=cA();e.floatView[0]=r;const t=e.uint32View[0],i=t>>23&511;return e.baseTable[i]+((t&8388607)>>e.shiftTable[i])}function ds(r){const e=cA();return e.uint32View[0]=e.mantissaTable[e.offsetTable[r>>10]+(r&1023)]+e.exponentTable[r>>10],e.floatView[0]}function fO(r,e,t,i){switch(e){case 5120:{let s=r.getInt8(t);return i&&(s=Math.max(s/127,-1)),s}case 5121:{let s=r.getUint8(t);return i&&(s=s/255),s}case 5122:{let s=r.getInt16(t,!0);return i&&(s=Math.max(s/32767,-1)),s}case 5123:{let s=r.getUint16(t,!0);return i&&(s=s/65535),s}case 5131:return ds(r.getUint16(t,!0));case 5124:return r.getInt32(t,!0);case 5125:return r.getUint32(t,!0);case 5126:return r.getFloat32(t,!0);default:throw new Error(`Invalid component type ${e}`)}}function dO(r,e,t,i,s){switch(e){case 5120:{i&&(s=Math.round(s*127)),r.setInt8(t,s);break}case 5121:{i&&(s=Math.round(s*255)),r.setUint8(t,s);break}case 5122:{i&&(s=Math.round(s*32767)),r.setInt16(t,s,!0);break}case 5123:{i&&(s=Math.round(s*65535)),r.setUint16(t,s,!0);break}case 5131:{r.setUint16(t,uO(s),!0);break}case 5124:{r.setInt32(t,s,!0);break}case 5125:{r.setUint32(t,s,!0);break}case 5126:{r.setFloat32(t,s,!0);break}default:throw new Error(`Invalid component type ${e}`)}}function Sa(r){switch(r){case 5120:case 5121:return 1;case 5122:case 5123:case 5131:return 2;case 5124:case 5125:case 5126:return 4;default:throw new Error(`Invalid type '${r}'`)}}function _O(r){switch(r){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:return Uint16Array;case 5131:return Uint16Array;case 5124:return Int32Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw new Error(`Invalid component type '${r}'`)}}function dd(r,e,t,i,s,n,o,c){const h=new Array(i),f=new Array(i);if(r instanceof Array){let _=e/4;const d=t/4;for(let g=0;g<n;g+=i){for(let p=0;p<i;p++)h[p]=f[p]=r[_+p];c(f,g);for(let p=0;p<i;p++)h[p]!==f[p]&&(r[_+p]=f[p]);_+=d}}else{const _=ArrayBuffer.isView(r)?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r),d=Sa(s);for(let g=0;g<n;g+=i){for(let p=0,b=e;p<i;p++,b+=d)h[p]=f[p]=fO(_,s,b,o);c(f,g);for(let p=0,b=e;p<i;p++,b+=d)h[p]!==f[p]&&dO(_,s,b,o,f[p]);e+=t}}}function mO(r,e,t,i,s,n,o,c){const h=e*Sa(t),f=o*e;if(t!==5126||s!==h){const _=new Float32Array(f);return dd(r,i,s,e,t,f,n,(d,g)=>{for(let p=0;p<e;p++)_[g+p]=d[p]}),_}if(!(r instanceof Array||r instanceof Float32Array)||i!==0||r.length!==f)if(r instanceof Array){const _=i/4;return r.slice(_,_+f)}else if(ArrayBuffer.isView(r)){const _=r.byteOffset+i;return(_&3)!==0&&(Ee.Warn("Float array must be aligned to 4-bytes border"),c=!0),c?new Float32Array(r.buffer.slice(_,_+f*Float32Array.BYTES_PER_ELEMENT)):new Float32Array(r.buffer,_,f)}else return new Float32Array(r,i,f);return c?r.slice():r}function gO(r,e,t,i,s,n,o){const c=Sa(t),h=_O(t),f=n*e;if(Array.isArray(r)){if((i&3)!==0||(s&3)!==0)throw new Error("byteOffset and byteStride must be a multiple of 4 for number[] data.");const b=i/4,x=s/4;if(b+(n-1)*x+e>r.length)throw new Error("Last accessed index is out of bounds.");
187if(x<e)throw new Error("Data stride cannot be smaller than the component size.");if(x!==e){const v=new h(f);return dd(r,i,s,e,t,f,!1,(S,R)=>{for(let P=0;P<e;P++)v[R+P]=S[P]}),v}return new h(r.slice(b,b+f))}let _,d=i;if(ArrayBuffer.isView(r)?(_=r.buffer,d+=r.byteOffset):_=r,d+(n-1)*s+e*c>_.byteLength)throw new Error("Last accessed byte is out of bounds.");const p=e*c;if(s<p)throw new Error("Byte stride cannot be smaller than the component's byte size.");if(s!==p){const b=new h(f),x=new Uint8Array(_,d),E=new Uint8Array(b.buffer),v=e*c;for(let S=0,R=0,P=0;S<n;S++,R+=s,P+=v)E.set(x.subarray(R,R+v),P);return b}return c!==1&&(d&c-1)!==0&&(Ee.Warn("Array must be aligned to border of element size. Data will be copied."),o=!0),o?new h(_.slice(d,d+f*c)):new h(_,d,f)}function pO(r,e,t,i,s,n,o,c){const h=e*Sa(t),f=o*e;if(c.length!==f)throw new Error("Output length is not valid");if(t!==5126||s!==h){dd(r,i,s,e,t,f,n,(_,d)=>{for(let g=0;g<e;g++)c[d+g]=_[g]});return}if(r instanceof Array){const _=i/4;c.set(r,_)}else if(ArrayBuffer.isView(r)){const _=r.byteOffset+i;if((_&3)!==0){Ee.Warn("Float array must be aligned to 4-bytes border"),c.set(new Float32Array(r.buffer.slice(_,_+f*Float32Array.BYTES_PER_ELEMENT)));return}const d=new Float32Array(r.buffer,_,f);c.set(d)}else{const _=new Float32Array(r,i,f);c.set(_)}}function yO(r){const e=r.buffer;if(e instanceof ArrayBuffer)return r;const t=new ArrayBuffer(r.byteLength);return new Uint8Array(t).set(new Uint8Array(e,r.byteOffset,r.byteLength)),t}const hA=new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);class Yf extends Cl{constructor(e,t){super(e,fd.LoadFileError),this.name="LoadFileError",vl._setPrototypeOf(this,Yf.prototype),t instanceof zi?this.request=t:this.file=t}}class jf extends Cl{constructor(e,t){super(e,fd.RequestFileError),this.request=t,this.name="RequestFileError",vl._setPrototypeOf(this,jf.prototype)}}class mg extends Cl{constructor(e,t){super(e,fd.ReadFileError),this.file=t,this.name="ReadFileError",vl._setPrototypeOf(this,mg.prototype)}}const bO=r=>(r=r.replace(/#/gm,"%23"),r),Ai={DefaultRetryStrategy:aO.ExponentialBackoff(),BaseUrl:"",CorsBehavior:"anonymous",PreprocessUrl:r=>r,ScriptBaseUrl:"",ScriptPreprocessUrl:r=>r,CleanUrl:bO},gg=(r,e)=>{if(!(r&&r.indexOf("data:")===0)&&Ai.CorsBehavior)if(typeof Ai.CorsBehavior=="string"||Ai.CorsBehavior instanceof String)e.crossOrigin=Ai.CorsBehavior;else{const t=Ai.CorsBehavior(r);t&&(e.crossOrigin=t)}},qf=(r,e,t,i,s="",n,o=vt.LastCreatedEngine)=>{if(typeof HTMLImageElement>"u"&&!o?._features.forceBitmapOverHTMLImageElement)return t("LoadImage is only supported in web or BabylonNative environments."),null;let c,h=!1;if(r instanceof ArrayBuffer||ArrayBuffer.isView(r))if(typeof Blob<"u"&&typeof URL<"u"){let M;r instanceof ArrayBuffer?M=r:M=yO(r),c=URL.createObjectURL(new Blob([M],{type:s})),h=!0}else c=`data:${s};base64,`+cO(r);else r instanceof Blob?(c=URL.createObjectURL(r),h=!0):(c=Ai.CleanUrl(r),c=Ai.PreprocessUrl(c));const f=M=>{if(t){const O=c||r.toString();t(`Error while trying to load image: ${O.indexOf("http")===0||O.length<=128?O:O.slice(0,128)+"..."}`,M)}};if(o?._features.forceBitmapOverHTMLImageElement)return Ia(c,M=>{o.createImageBitmap(new Blob([M],{type:s}),{premultiplyAlpha:"none",colorSpaceConversion:"none",...n}).then(O=>{e(O),h&&URL.revokeObjectURL(c)}).catch(O=>{t&&t("Error while trying to load image: "+r,O)})},void 0,i||void 0,!0,(M,O)=>{f(O)}),null;const _=new Image;gg(c,_);const d=[],g=()=>{for(const M of d)M.target.addEventListener(M.name,M.handler)},p=()=>{for(const M of d)M.target.removeEventListener(M.name,M.handler);d.length=0},b=()=>{p(),e(_),h&&_.src&&URL.revokeObjectURL(_.src)},x=M=>{p(),f(M),h&&_.src&&URL.revokeObjectURL(_.src)},E=M=>{if(M.blockedURI!==_.src||M.disposition==="report")return;p();const O=new Error(`CSP violation of policy ${M.effectiveDirective} ${M.blockedURI}. Current policy is ${M.originalPolicy}`);vt.UseFallbackTexture=!1,f(O),h&&_.src&&URL.revokeObjectURL(_.src),_.src=""};d.push({target:_,name:"load",handler:b}),d.push({target:_,name:"error",handler:x}),d.push({target:document,name:"securitypolicyviolation",handler:E}),g();const v=c.substring(0,5)==="blob:",S=c.substring(0,5)==="data:",R=()=>{v||S||!zi.IsCustomRequestAvailable?_.src=c:Ia(c,(M,O,D)=>{const w=!s&&D?D:s,G=new Blob([M],{type:w}),H=URL.createObjectURL(G);h=!0,_.src=H},void 0,i||void 0,!0,(M,O)=>{f(O)})},P=()=>{i&&i.loadImage(c,_)};if(!v&&!S&&i&&i.enableTexturesOffline)i.open(P,R);else{if(c.indexOf("file:")!==-1){const M=decodeURIComponent(c.substring(5).toLowerCase());if(eh.FilesToLoad[M]&&typeof URL<"u"){try{let O;try{O=URL.createObjectURL(eh.FilesToLoad[M])}catch{O=URL.createObjectURL(eh.FilesToLoad[M])}_.src=O,h=!0}catch{_.src=""}return _}}R()}return _},hh=(r,e,t,i,s)=>{const n=new FileReader,o={onCompleteObservable:new Oe,abort:()=>n.abort()};return n.onloadend=()=>o.onCompleteObservable.notifyObservers(o),s&&(n.onerror=()=>{s(new mg(`Unable to read ${r.name}`,r))}),n.onload=c=>{e(c.target.result)},t&&(n.onprogress=t),i?n.readAsArrayBuffer(r):n.readAsText(r),o},Ia=(r,e,t,i,s,n,o)=>
vendor: 4,575 bytes, line 187
187{if(r.name)return hh(r,e,t,s,n?_=>{n(void 0,_)}:void 0);const c=r;if(c.indexOf("file:")!==-1){let _=decodeURIComponent(c.substring(5).toLowerCase());_.indexOf("./")===0&&(_=_.substring(2));const d=eh.FilesToLoad[_];if(d)return hh(d,e,t,s,n?g=>n(void 0,new Yf(g.message,g.file)):void 0)}const{match:h,type:f}=xO(c);if(h){const _={onCompleteObservable:new Oe,abort:()=>()=>{}};try{const d=s?yg(c):dA(c);e(d,void 0,f)}catch(d){n?n(void 0,d):Ee.Error(d.message||"Failed to parse the Data URL")}return Ts.SetImmediate(()=>{_.onCompleteObservable.notifyObservers(_)}),_}return pg(c,(_,d)=>{e(_,d?.responseURL,d?.getResponseHeader("content-type"))},t,i,s,n?_=>{n(_.request,new Yf(_.message,_.request))}:void 0,o)},pg=(r,e,t,i,s,n,o)=>{i!==null&&(i??(i=vt.LastCreatedScene?.offlineProvider)),r=Ai.CleanUrl(r),r=Ai.PreprocessUrl(r);const c=Ai.BaseUrl+r;let h=!1;const f={onCompleteObservable:new Oe,abort:()=>h=!0},_=()=>{let d=new zi,g=null,p;const b=()=>{d&&(t&&d.removeEventListener("progress",t),p&&d.removeEventListener("readystatechange",p),d.removeEventListener("loadend",x))};let x=()=>{b(),f.onCompleteObservable.notifyObservers(f),f.onCompleteObservable.clear(),t=void 0,p=null,x=null,n=void 0,o=void 0,e=void 0};f.abort=()=>{h=!0,x&&x(),d&&d.readyState!==(XMLHttpRequest.DONE||4)&&d.abort(),g!==null&&(clearTimeout(g),g=null),d=null};const E=S=>{const R=S.message||"Unknown error";n&&d?n(new jf(R,d)):Ee.Error(R)},v=S=>{if(d){if(d.open("GET",c),o)try{o(d)}catch(R){E(R);return}s&&(d.responseType="arraybuffer"),t&&d.addEventListener("progress",t),x&&d.addEventListener("loadend",x),p=()=>{if(!(h||!d)&&d.readyState===(XMLHttpRequest.DONE||4)){if(p&&d.removeEventListener("readystatechange",p),d.status>=200&&d.status<300||d.status===0&&(!is()||uA())){const M=s?d.response:d.responseText;if(M!==null){try{e&&e(M,d)}catch(O){E(O)}return}}const R=Ai.DefaultRetryStrategy;if(R){const M=R(c,d,S);if(M!==-1){b(),d=new zi,g=setTimeout(()=>v(S+1),M);return}}const P=new jf("Error status: "+d.status+" "+d.statusText+" - Unable to load "+c,d);n&&n(P)}},d.addEventListener("readystatechange",p),d.send()}};v(0)};if(i&&i.enableSceneOffline&&!r.startsWith("blob:")){const d=p=>{p&&p.status>400?n&&n(p):_()},g=()=>{i&&i.loadFile(Ai.BaseUrl+r,p=>{!h&&e&&e(p),f.onCompleteObservable.notifyObservers(f)},t?p=>{!h&&t&&t(p)}:void 0,d,s)};i.open(g,d)}else _();return f},uA=()=>typeof location<"u"&&location.protocol==="file:",fA=r=>hA.test(r),xO=r=>{const e=hA.exec(r);return e===null||e.length===0?{match:!1,type:""}:{match:!0,type:e[0].replace("data:","").replace(";base64,","")}};function yg(r){return hO(r.split(",")[1])}const dA=r=>lA(r.split(",")[1]);let $c;const TO=(r,e,t,i,s,n,o,c,h,f)=>{$c={DecodeBase64UrlToBinary:r,DecodeBase64UrlToString:e,DefaultRetryStrategy:t.DefaultRetryStrategy,BaseUrl:t.BaseUrl,CorsBehavior:t.CorsBehavior,PreprocessUrl:t.PreprocessUrl,IsBase64DataUrl:i,IsFileURL:s,LoadFile:n,LoadImage:o,ReadFile:c,RequestFile:h,SetCorsBehavior:f},Object.defineProperty($c,"DefaultRetryStrategy",{get:function(){return t.DefaultRetryStrategy},set:function(_){t.DefaultRetryStrategy=_}}),Object.defineProperty($c,"BaseUrl",{get:function(){return t.BaseUrl},set:function(_){t.BaseUrl=_}}),Object.defineProperty($c,"PreprocessUrl",{get:function(){return t.PreprocessUrl},set:function(_){t.PreprocessUrl=_}}),Object.defineProperty($c,"CorsBehavior",{get:function(){return t.CorsBehavior},set:function(_){t.CorsBehavior=_}})};let Yx=!1;function EO(){Yx||(Yx=!0,TO(yg,dA,Ai,fA,uA,Ia,qf,hh,pg,gg),ao.loadFile=Ia,ao.loadImage=qf,Vv.loadFile=Ia)}let jx=!1;function vO(){jx||(jx=!0,EO(),Be.prototype._loadFileAsync=async function(r,e,t){return await new Promise((i,s)=>{this._loadFile(r,n=>{i(n)},void 0,e,t,(n,o)=>{s(o)})})})}vO();const Kf=new Map;function Pr(r,e){AO(r)&&Ee.Warn(`Extension with the name '${r}' already exists`),Kf.set(r,e)}function AO(r){return Kf.delete(r)}function RO(r,e){(e==="image/ktx"||e==="image/ktx2")&&(r=".ktx"),Kf.has(r)||(r.endsWith(".ies")&&Pr(".ies",async()=>await ts(()=>import("./iesTextureLoader-8W1noeMs.js"),[]).then(i=>new i._IESTextureLoader)),r.endsWith(".dds")&&Pr(".dds",async()=>await ts(()=>import("./ddsTextureLoader--NpaO-lG.js"),__vite__mapDeps([3,1,2])).then(i=>new i._DDSTextureLoader)),r.endsWith(".basis")&&Pr(".basis",async()=>await ts(()=>import("./basisTextureLoader-C_D3HSKq.js"),[]).then(i=>new i._BasisTextureLoader)),r.endsWith(".env")&&Pr(".env",async()=>await ts(()=>import("./envTextureLoader-C5cghqNR.js"),__vite__mapDeps([4,2])).then(i=>new i._ENVTextureLoader)),r.endsWith(".hdr")&&Pr(".hdr",async()=>await ts(()=>
187import("./hdrTextureLoader-BGQvgh0h.js"),[]).then(i=>new i._HDRTextureLoader)),(r.endsWith(".ktx")||r.endsWith(".ktx2"))&&(Pr(".ktx",async()=>await ts(()=>import("./ktxTextureLoader-BNQhT2Hy.js"),[]).then(i=>new i._KTXTextureLoader)),Pr(".ktx2",async()=>await ts(()=>import("./ktxTextureLoader-BNQhT2Hy.js"),[]).then(i=>new i._KTXTextureLoader))),r.endsWith(".tga")&&Pr(".tga",async()=>await ts(()=>import("./tgaTextureLoader-CcBue8tj.js"),[]).then(i=>new i._TGATextureLoader)),r.endsWith(".exr")&&Pr(".exr",async()=>await ts(()=>import("./exrTextureLoader-D-8Wz9Bn.js"),[]).then(i=>new i._ExrTextureLoader)));const t=Kf.get(r);return t?Promise.resolve(t(e)):null}Be.GetCompatibleTextureLoader=RO;let qx=!1;function SO(){qx||(qx=!0,_t.prototype.enableScissor=function(r,e,t,i){const s=this._gl;s.enable(s.SCISSOR_TEST),s.scissor(r,e,t,i)},_t.prototype.disableScissor=function(){const r=this._gl;r.disable(r.SCISSOR_TEST)})}SO();HP();GP();class MO{constructor(){this._doNotSerialize=!1,this._isDisposed=!1,this._sceneRootNodesIndex=-1,this._isEnabled=!0,this._isParentEnabled=!0,this._isReady=!0,this._onEnabledStateChangedObservable=new Oe,this._onEffectiveEnabledStateChangedObservable=null,this._onClonedObservable=new Oe,this._inheritVisibility=!1,this._isVisible=!0}}let Qn=(()=>{var r;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,d=[],g=[],p,b=[],x=[];return r=class{static AddNodeConstructor(v,S){this._NodeConstructors[v]=S}static Construct(v,S,R,P){const M=this._NodeConstructors[v];return M?M(S,R,P):null}set accessibilityTag(v){this._accessibilityTag=v,this.onAccessibilityTagChangedObservable.notifyObservers(v)}get accessibilityTag(){return this._accessibilityTag}get doNotSerialize(){return this._nodeDataStorage._doNotSerialize?!0:this._parentNode?this._parentNode.doNotSerialize:!1}set doNotSerialize(v){this._nodeDataStorage._doNotSerialize=v}isDisposed(){return this._nodeDataStorage._isDisposed}set parent(v){if(this._parentNode===v)return;const S=this._parentNode;if(this._parentNode&&this._parentNode._children!==void 0&&this._parentNode._children!==null){const R=this._parentNode._children.indexOf(this);R!==-1&&this._parentNode._children.splice(R,1),!v&&!this._nodeDataStorage._isDisposed&&this._addToSceneRootNodes()}this._parentNode=v,this._isDirty=!0,this._parentNode&&((this._parentNode._children===void 0||this._parentNode._children===null)&&(this._parentNode._children=new Array),this._parentNode._children.push(this),S||this._removeFromSceneRootNodes()),this._syncParentEnabledState()}get parent(){return this._parentNode}get inheritVisibility(){return this._nodeDataStorage._inheritVisibility}set inheritVisibility(v){this._nodeDataStorage._inheritVisibility=v}get isVisible(){return this.inheritVisibility&&this._parentNode&&!this._parentNode.isVisible?!1:this._nodeDataStorage._isVisible}set isVisible(v){this._nodeDataStorage._isVisible=v}_serializeAsParent(v){v.parentId=this.uniqueId}_addToSceneRootNodes(){this._nodeDataStorage._sceneRootNodesIndex===-1&&(this._nodeDataStorage._sceneRootNodesIndex=this._scene.rootNodes.length,this._scene.rootNodes.push(this))}_removeFromSceneRootNodes(){if(this._nodeDataStorage._sceneRootNodesIndex!==-1){const v=this._scene.rootNodes,S=v.length-1;v[this._nodeDataStorage._sceneRootNodesIndex]=v[S],v[this._nodeDataStorage._sceneRootNodesIndex]._nodeDataStorage._sceneRootNodesIndex=this._nodeDataStorage._sceneRootNodesIndex,this._scene.rootNodes.pop(),this._nodeDataStorage._sceneRootNodesIndex=-1}}get animationPropertiesOverride(){return this._animationPropertiesOverride?this._animationPropertiesOverride:this._scene.animationPropertiesOverride}set animationPropertiesOverride(v){this._animationPropertiesOverride=v}getClassName(){return"Node"}set onDispose(v){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(v)}get onEnabledStateChangedObservable(){return this._nodeDataStorage._onEnabledStateChangedObservable}get onEffectiveEnabledStateChangedObservable(){var v;return(v=this._nodeDataStorage)._onEffectiveEnabledStateChangedObservable??(v._onEffectiveEnabledStateChangedObservable=new Oe)}get onClonedObservable(){return this._nodeDataStorage._onClonedObservable}constructor(v,S=null,R=!0){this._isDirty=!1,this._nodeDataStorage=new MO,this.name=L(this,t,void 0),this.id=(L(this,i),L(this,n,void 0)),this.uniqueId=(L(this,o),L(this,h,void 0)),this.state=(L(this,f),L(this,d,"")),this.metadata=(L(this,g),L(this,b,null)),this._internalMetadata=L(this,x),this.reservedDataStore=null,this._accessibilityTag=null,this.onAccessibilityTagChangedObservable=new Oe,this._parentContainer=null,this.animations=[],this._ranges={},this.onReady=null,this._currentRenderId=-1,this._parentUpdateId=-1,this._childUpdateId=-1,this._waitingParentId=null,this._waitingParentInstanceIndex=null,this._waitingParsedUniqueId=null,this._cache={},this._parentNode=null,this._children=null,this._worldMatrix=ae.Identity(),this._worldMatrixDeterminant=0,this._worldMatrixDeterminantIsDirty=!0,this._animationPropertiesOverride=null,this._isNode=!0,this.onDisposeObservable=new Oe,this._onDisposeObserver=null,this._behaviors=new Array,this.name=v,this.id=v,this._scene=S||vt.LastCreatedScene,this.uniqueId=this._scene.getUniqueId(),this._initCache(),R&&this._addToSceneRootNodes()}getScene(){return this._scene}getEngine(){return this._scene.getEngine()}addBehavior(v,S=!1){return this._behaviors.indexOf(v)!==-1?this:(v.init(),this._scene.isLoading&&!S?this._scene.onDataLoadedObservable.addOnce(()=>{this._behaviors.includes(v)&&v.attach(this)}):v.attach(this),this._behaviors.push(v),this)}removeBehavior(v){const S=this._behaviors.indexOf(v);return S===-1?this:(this._behaviors.splice(S,1),v.detach(),this)}get behaviors(){return this._behaviors}getBehaviorByName(v){for(const S of this._behaviors)if(S.name===v)return S;return null}getWorldMatrix(){return this._currentRenderId!==this._scene.getRenderId()&&this.computeWorldMatrix(),this._worldMatrix}_getWorldMatrixDeterminant(){return this._worldMatrixDeterminantIsDirty&&(this._worldMatrixDeterminantIsDirty=!1,this._worldMatrixDeterminant=this._worldMatrix.determinant()),this._worldMatrixDeterminant}get worldMatrixFromCache(){return this._worldMatrix}_initCache(){this._cache={}}updateCache(v){!v&&this.isSynchronized()||this._updateCache()}_getActionManagerForTrigger(v,S=!0){return this.parent?this.parent._getActionManagerForTrigger(v,!1):null}_updateCache(v){}_isSynchronized(){return!0}_markSyncedWithParent(){this._parentNode&&(this._parentUpdateId=this._parentNode._childUpdateId)}isSynchronizedWithParent(){return this._parentNode?this._parentNode._isDirty||this._parentUpdateId!==this._parentNode._childUpdateId?!1:this._parentNode.isSynchronized():!0}isSynchronized(){return this._parentNode&&!this.isSynchronizedWithParent()?!1:this._isSynchronized()}isReady(v=!1){return this._nodeDataStorage._isReady}markAsDirty(v){return this._currentRenderId=Number.MAX_VALUE,this._isDirty=!0,this}isEnabled(v=!0){return v===!1?this._nodeDataStorage._isEnabled:this._nodeDataStorage._isEnabled?this._nodeDataStorage._isParentEnabled:!1}_hasEffectiveEnabledStateObservers(){const v=this._nodeDataStorage._onEffectiveEnabledStateChangedObservable;return!!v&&v.hasObservers()}_syncParentEnabledState(){const v=this._hasEffectiveEnabledStateObservers(),S=v?this.isEnabled():null;if(this._nodeDataStorage._isParentEnabled=this._parentNode?this._parentNode.isEnabled():!0,this._children)for(const R of this._children)R._syncParentEnabledState();if(v){const R=this.isEnabled();R!==S&&this._nodeDataStorage._onEffectiveEnabledStateChangedObservable.notifyObservers(R)}}setEnabled(v){if(this._nodeDataStorage._isEnabled===v)return;const S=this._hasEffectiveEnabledStateObservers(),R=S?this.isEnabled():null;if(this._nodeDataStorage._isEnabled=v,this._syncParentEnabledState(),this._nodeDataStorage._onEnabledStateChangedObservable.notifyObservers(v),S){const P=this.isEnabled();P!==R&&this._nodeDataStorage._onEffectiveEnabledStateChangedObservable.notifyObservers(P)}}isDescendantOf(v){return this.parent?this.parent===v?!0:this.parent.isDescendantOf(v):!1}_getDescendants(v,S=!1,R){if(this._children)for(let P=0;P<this._children.length;P++){const M=this._children[P];(!R||R(M))&&v.push(M),S||M._getDescendants(v,!1,R)}}getDescendants(v,S){const R=[];return this._getDescendants(R,v,S),R}getChildMeshes(v,S){const R=[];return this._getDescendants(R,v,P=>(!S||S(P))&&P.cullingStrategy!==void 0),R}getChildren(v,S=!0){return this.getDescendants(S,v)}_setReady(v){if(v!==this._nodeDataStorage._isReady){if(!v){this._nodeDataStorage._isReady=!1;return}this.onReady&&this.onReady(this),this._nodeDataStorage._isReady=!0}}getAnimationByName(v){for(let S=0;S<this.animations.length;S++){const R=this.animations[S];if(R.name===v)return R}return null}createAnimationRange(v,S,R){if(!this._ranges[v]){this._ranges[v]=r._AnimationRangeFactory(v,S,R);for(let P=0,M=this.animations.length;P<M;P++)this.animations[P]&&this.animations[P].createRange(v,S,R)}}deleteAnimationRange(v,S=!0){for(let R=0,P=this.animations.length;R<P;R++)this.animations[R]&&this.animations[R].deleteRange(v,S);this._ranges[v]=null}getAnimationRange(v){return this._ranges[v]||null}clone(v,S,R){const P=Tt.Clone(()=>
vendor: 5,242 bytes, line 187
187new r(v,this.getScene()),this);if(S&&(P.parent=S),!R){const M=this.getDescendants(!0);for(let O=0;O<M.length;O++){const D=M[O];D.clone(v+"."+D.name,P)}}return P}getAnimationRanges(){const v=[];let S;for(S in this._ranges)v.push(this._ranges[S]);return v}beginAnimation(v,S,R,P){const M=this.getAnimationRange(v);return M?this._scene.beginAnimation(this,M.from,M.to,S,R,P):null}serializeAnimationRanges(){const v=[];for(const S in this._ranges){const R=this._ranges[S];if(!R)continue;const P={};P.name=S,P.from=R.from,P.to=R.to,v.push(P)}return v}computeWorldMatrix(v){return this._worldMatrix||(this._worldMatrix=ae.Identity()),this._worldMatrix}dispose(v,S=!1){if(this._nodeDataStorage._isDisposed=!0,!v){const R=this.getDescendants(!0);for(const P of R)P.dispose(v,S)}this.parent?this.parent=null:this._removeFromSceneRootNodes(),this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.onEnabledStateChangedObservable.clear(),this._nodeDataStorage._onEffectiveEnabledStateChangedObservable?.clear(),this.onClonedObservable.clear();for(const R of this._behaviors)R.detach();this._behaviors.length=0,this.metadata=null}static ParseAnimationRanges(v,S,R){if(S.ranges)for(let P=0;P<S.ranges.length;P++){const M=S.ranges[P];v.createAnimationRange(M.name,M.from,M.to)}}getHierarchyBoundingVectors(v=!0,S=null){this.getScene().incrementRenderId(),this.computeWorldMatrix(!0);let R,P;const M=this;if(M.getBoundingInfo&&M.subMeshes){const O=M.getBoundingInfo();R=O.boundingBox.minimumWorld.clone(),P=O.boundingBox.maximumWorld.clone()}else R=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),P=new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);if(v){const O=this.getDescendants(!1);for(const D of O){const w=D;if(w.computeWorldMatrix(!0),S&&!S(w)||!w.getBoundingInfo||w.getTotalVertices()===0)continue;const H=w.getBoundingInfo().boundingBox,ie=H.minimumWorld,ne=H.maximumWorld;I.CheckExtends(ie,R,P),I.CheckExtends(ne,R,P)}}return{min:R,max:P}}},(()=>{const E=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[he()],s=[he()],c=[he()],_=[he()],p=[he()],$(null,null,e,{kind:"field",name:"name",static:!1,private:!1,access:{has:v=>"name"in v,get:v=>v.name,set:(v,S)=>{v.name=S}},metadata:E},t,i),$(null,null,s,{kind:"field",name:"id",static:!1,private:!1,access:{has:v=>"id"in v,get:v=>v.id,set:(v,S)=>{v.id=S}},metadata:E},n,o),$(null,null,c,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:v=>"uniqueId"in v,get:v=>v.uniqueId,set:(v,S)=>{v.uniqueId=S}},metadata:E},h,f),$(null,null,_,{kind:"field",name:"state",static:!1,private:!1,access:{has:v=>"state"in v,get:v=>v.state,set:(v,S)=>{v.state=S}},metadata:E},d,g),$(null,null,p,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:v=>"metadata"in v,get:v=>v.metadata,set:(v,S)=>{v.metadata=S}},metadata:E},b,x),E&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:E})})(),r._AnimationRangeFactory=(E,v,S)=>{throw at("AnimationRange")},r._NodeConstructors={},r})();const Kx=(r,e,t)=>!r||r.getClassName&&r.getClassName()==="Mesh"?null:r.getClassName&&(r.getClassName()==="SubMesh"||r.getClassName()==="PhysicsBody")?r.clone(e):r.clone?r.clone():Array.isArray(r)?r.slice():t&&typeof r=="object"?{...r}:null;function CO(r){const e=[];do{const t=Object.getOwnPropertyNames(r);for(const i of t)e.indexOf(i)===-1&&e.push(i)}while(r=Object.getPrototypeOf(r));return e}class bg{static DeepCopy(e,t,i,s,n=!1){const o=CO(e);for(const c of o){if(c[0]==="_"&&(!s||s.indexOf(c)===-1)||c.endsWith("Observable")||i&&i.indexOf(c)!==-1)continue;const h=e[c],f=typeof h;if(f!=="function")try{if(f==="object")if(h instanceof Uint8Array)t[c]=Uint8Array.from(h);else if(h instanceof Array){if(t[c]=[],h.length>0)if(typeof h[0]=="object")for(let _=0;_<h.length;_++){const d=Kx(h[_],t,n);t[c].indexOf(d)===-1&&t[c].push(d)}else t[c]=h.slice(0)}else t[c]=Kx(h,t,n);else t[c]=h}catch(_){Ee.Warn(_.message)}}}}class Pf{static Instantiate(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];const t=Vf(e);if(t)return t;Ee.Warn(e+" not found, you may have missed an import.");const i=e.split(".");let s=typeof window<"u"?window:typeof globalThis<"u"?globalThis:this;for(let n=0,o=i.length;n<o;n++)s=s[i[n]];return typeof s!="function"?null:s}}Pf.RegisteredExternalClasses={};var et;class Rt{static get BaseUrl(){return Ai.BaseUrl}static set BaseUrl(e){Ai.BaseUrl=e}static get CleanUrl(){return Ai.CleanUrl}static set CleanUrl(e){Ai.CleanUrl=e}static IsAbsoluteUrl(e){return e.indexOf("//")===0?!0:e.indexOf("://")===-1||e.indexOf(".")===-1||e.indexOf("/")===-1||e.indexOf(":")>e.indexOf("/")?!1:e.indexOf("://")<e.indexOf(".")||e.indexOf("data:")===0||e.indexOf("blob:")===0}static set ScriptBaseUrl(e){Ai.ScriptBaseUrl=e}static get ScriptBaseUrl(){return Ai.ScriptBaseUrl}static set CDNBaseUrl(e){et.ScriptBaseUrl=e,et.AssetBaseUrl=e}static set ScriptPreprocessUrl(e){Ai.ScriptPreprocessUrl=e}static get ScriptPreprocessUrl(){return Ai.ScriptPreprocessUrl}static get DefaultRetryStrategy(){return Ai.DefaultRetryStrategy}static set DefaultRetryStrategy(e){Ai.DefaultRetryStrategy=e}static get CorsBehavior(){return Ai.CorsBehavior}
187static set CorsBehavior(e){Ai.CorsBehavior=e}static get UseFallbackTexture(){return vt.UseFallbackTexture}static set UseFallbackTexture(e){vt.UseFallbackTexture=e}static get RegisteredExternalClasses(){return Pf.RegisteredExternalClasses}static set RegisteredExternalClasses(e){Pf.RegisteredExternalClasses=e}static get fallbackTexture(){return vt.FallbackTexture}static set fallbackTexture(e){vt.FallbackTexture=e}static FetchToRef(e,t,i,s,n,o){const c=Math.abs(e)*i%i|0,h=Math.abs(t)*s%s|0,f=(c+h*i)*4;o.r=n[f]/255,o.g=n[f+1]/255,o.b=n[f+2]/255,o.a=n[f+3]/255}static Mix(e,t,i){return 0}static Instantiate(e){return Pf.Instantiate(e)}static SetImmediate(e){Ts.SetImmediate(e)}static IsExponentOfTwo(e){return!0}static FloatRound(e){return Math.fround(e)}static GetFilename(e){const t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)}static GetFolderPath(e,t=!1){const i=e.lastIndexOf("/");return i<0?t?e:"":e.substring(0,i+1)}static ToDegrees(e){return e*180/Math.PI}static ToRadians(e){return e*Math.PI/180}static SmoothAngleChange(e,t,i=.9){const s=this.ToRadians(e),n=this.ToRadians(t);return this.ToDegrees(Math.atan2((1-i)*Math.sin(n)+i*Math.sin(s),(1-i)*Math.cos(n)+i*Math.cos(s)))}static MakeArray(e,t){return t!==!0&&(e===void 0||e==null)?null:Array.isArray(e)?e:[e]}static GetPointerPrefix(e){return is()&&!window.PointerEvent?"mouse":"pointer"}static SetCorsBehavior(e,t){gg(e,t)}static SetReferrerPolicyBehavior(e,t){t.referrerPolicy=e}static get PreprocessUrl(){return Ai.PreprocessUrl}static set PreprocessUrl(e){Ai.PreprocessUrl=e}static LoadImage(e,t,i,s,n,o){return qf(e,t,i,s,n,o)}static LoadFile(e,t,i,s,n,o){return Ia(e,t,i,s,n,o)}static async LoadFileAsync(e,t=!0){return await new Promise((i,s)=>{Ia(e,n=>{i(n)},void 0,void 0,t,(n,o)=>{s(o)})})}static GetAssetUrl(e){if(!e)return"";if(et.AssetBaseUrl&&e.startsWith(et._DefaultAssetsUrl)){const t=et.AssetBaseUrl.endsWith("/")?et.AssetBaseUrl.slice(0,-1):et.AssetBaseUrl;return e.replace(et._DefaultAssetsUrl,t)}return e}static GetBabylonScriptURL(e,t){if(!e)return"";if(e.startsWith(et._DefaultCdnUrl)){if(et.ScriptBaseUrl){const i=et.ScriptBaseUrl.endsWith("/")?et.ScriptBaseUrl.slice(0,-1):et.ScriptBaseUrl;e=e.replace(et._DefaultCdnUrl,i)}else if(et._CdnVersion){const i=`${et._DefaultCdnUrl}/v${et._CdnVersion}`;e.startsWith(i)||(e=e.replace(et._DefaultCdnUrl,i))}}return e=et.ScriptPreprocessUrl(e),t&&!et.IsAbsoluteUrl(e)&&(e=et.GetAbsoluteUrl(e)),e}static LoadBabylonScript(e,t,i,s){e=et.GetBabylonScriptURL(e),et.LoadScript(e,t,i)}static async LoadBabylonScriptAsync(e){return e=et.GetBabylonScriptURL(e),await et.LoadScriptAsync(e)}static _LoadScriptNative(e,t,i,s,n=!1){if(_native){if(n){const o="Loading a script as an ES module is not supported in Babylon Native";i?.(o,new Error(o));return}et.LoadFile(e,o=>{try{Function(o).apply(null),t&&t()}catch(c){i&&i("LoadScript Error",c)}},void 0,void 0,!1,(o,c)=>{i&&i("LoadScript Error",c)})}}static _LoadScriptWeb(e,t,i,s,n=!1){if(typeof importScripts=="function"){try{importScripts(e),t&&t()}catch(h){i?.(`Unable to load script '${e}' in worker`,h)}return}else if(!is()){i?.(`Cannot load script '${e}' outside of a window or a worker`);return}const o=document.getElementsByTagName("head")[0],c=document.createElement("script");n?(c.setAttribute("type","module"),c.innerText=e):(c.setAttribute("type","text/javascript"),c.setAttribute("src",e)),s&&(c.id=s),c.onload=()=>{t&&t()},c.onerror=h=>{i&&i(`Unable to load script '${e}'`,h)},o.appendChild(c)}static async LoadScriptAsync(e,t){return await new Promise((i,s)=>{this.LoadScript(e,()=>{i()},(n,o)=>{s(o||new Error(n))},t)})}static ReadFileAsDataURL(e,t,i){const s=new FileReader,n={onCompleteObservable:new Oe,abort:()=>s.abort()};return s.onloadend=()=>{n.onCompleteObservable.notifyObservers(n)},s.onload=o=>{t(o.target.result)},s.onprogress=i,s.readAsDataURL(e),n}static ReadFile(e,t,i,s,n){return hh(e,t,i,s,n)}static FileAsURL(e){const t=new Blob([e]);return window.URL.createObjectURL(t)}static Format(e,t=2){return e.toFixed(t)}static DeepCopy(e,t,i,s){bg.DeepCopy(e,t,i,s)}static IsEmpty(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}static RegisterTopRootEvents(e,t){for(let i=0;i<t.length;i++){const s=t[i];e.addEventListener(s.name,s.handler,!1);try{window.parent&&window.parent.addEventListener(s.name,s.handler,!1)}catch{}}}static UnregisterTopRootEvents(e,t){for(let i=0;i<t.length;i++){const s=t[i];e.removeEventListener(s.name,s.handler);try{e.parent&&e.parent.removeEventListener(s.name,s.handler)}catch{}}}static async DumpFramebuffer(e,t,i,s,n="image/png",o,c){throw at("DumpTools")}static DumpData(e,t,i,s,n="image/png",o,c=!1,h=!1,f){throw at("DumpTools")}static async DumpDataAsync(e,t,i,s="image/png",n,o=!1,c=!1,h){throw at("DumpTools")}static _IsOffScreenCanvas(e){return e.convertToBlob!==void 0}static ToBlob(e,t,i="image/png",s){!et._IsOffScreenCanvas(e)&&!e.toBlob&&(e.toBlob=function(n,o,c){setTimeout(()=>{const h=atob(this.toDataURL(o,c).split(",")[1]),f=h.length,_=new Uint8Array(f);for(let d=0;d<f;
vendor: 4,580 bytes, line 187
187d++)_[d]=h.charCodeAt(d);n(new Blob([_]))})}),et._IsOffScreenCanvas(e)?e.convertToBlob({type:i,quality:s}).then(n=>t(n)):e.toBlob(function(n){t(n)},i,s)}static DownloadBlob(e,t){if("download"in document.createElement("a")){if(!t){const i=new Date;t="screenshot_"+((i.getFullYear()+"-"+(i.getMonth()+1)).slice(2)+"-"+i.getDate()+"_"+i.getHours()+"-"+("0"+i.getMinutes()).slice(-2))+".png"}et.Download(e,t)}else if(e&&typeof URL<"u"){const i=URL.createObjectURL(e),s=window.open("");if(!s)return;const n=s.document.createElement("img");n.onload=function(){URL.revokeObjectURL(i)},n.src=i,s.document.body.appendChild(n)}}static EncodeScreenshotCanvasData(e,t,i="image/png",s,n){if(typeof s=="string"||!t)this.ToBlob(e,function(o){o&&et.DownloadBlob(o,s),t&&t("")},i,n);else if(t){if(et._IsOffScreenCanvas(e)){e.convertToBlob({type:i,quality:n}).then(c=>{const h=new FileReader;h.readAsDataURL(c),h.onloadend=()=>{const f=h.result;t(f)}});return}const o=e.toDataURL(i,n);t(o)}}static Download(e,t){if(typeof URL>"u")return;const i=window.URL.createObjectURL(e),s=document.createElement("a");document.body.appendChild(s),s.style.display="none",s.href=i,s.download=t,s.addEventListener("click",()=>{s.parentElement&&s.parentElement.removeChild(s)}),s.click(),window.URL.revokeObjectURL(i)}static BackCompatCameraNoPreventDefault(e){return typeof e[0]=="boolean"?e[0]:typeof e[1]=="boolean"?e[1]:!1}static CreateScreenshot(e,t,i,s,n="image/png",o=!1,c){throw at("ScreenshotTools")}static async CreateScreenshotAsync(e,t,i,s="image/png",n){throw at("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,i,s,n="image/png",o=1,c=!1,h,f=!1,_=!1,d=!0,g,p){throw at("ScreenshotTools")}static async CreateScreenshotUsingRenderTargetAsync(e,t,i,s="image/png",n=1,o=!1,c,h=!1,f=!1,_=!0,d,g){throw at("ScreenshotTools")}static RandomId(){return oA()}static IsBase64(e){return fA(e)}static DecodeBase64(e){return yg(e)}static get errorsCount(){return Ee.errorsCount}static Log(e){Ee.Log(e)}static Warn(e){Ee.Warn(e)}static Error(e){Ee.Error(e)}static get LogCache(){return Ee.LogCache}static ClearLogCache(){Ee.ClearLogCache()}static set LogLevels(e){Ee.LogLevels=e}static set PerformanceLogLevel(e){if((e&et.PerformanceUserMarkLogLevel)===et.PerformanceUserMarkLogLevel){_native?.enablePerformanceLogging?(_native.enablePerformanceLogging(1),et.StartPerformanceCounter=et._StartMarkNative,et.EndPerformanceCounter=et._EndMarkNative):(et.StartPerformanceCounter=et._StartUserMark,et.EndPerformanceCounter=et._EndUserMark);return}if((e&et.PerformanceConsoleLogLevel)===et.PerformanceConsoleLogLevel){_native?.enablePerformanceLogging?(_native.enablePerformanceLogging(2),et.StartPerformanceCounter=et._StartMarkNative,et.EndPerformanceCounter=et._EndMarkNative):(et.StartPerformanceCounter=et._StartPerformanceConsole,et.EndPerformanceCounter=et._EndPerformanceConsole);return}et.StartPerformanceCounter=et._StartPerformanceCounterDisabled,et.EndPerformanceCounter=et._EndPerformanceCounterDisabled,_native?.disablePerformanceLogging?.()}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,t=!0){if(!et._Performance){if(!is())return;et._Performance=window.performance}!t||!et._Performance.mark||et._Performance.mark(e+"-Begin")}static _EndUserMark(e,t=!0){!t||!et._Performance.mark||(et._Performance.mark(e+"-End"),et._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,t=!0){t&&(et._StartUserMark(e,t),console.time&&console.time(e))}static _EndPerformanceConsole(e,t=!0){t&&(et._EndUserMark(e,t),console.timeEnd(e))}static _StartMarkNative(e,t=!0){if(t&&_native?.startPerformanceCounter)if(et._NativePerformanceCounterHandles.has(e))et.Warn(`Performance counter with name ${e} is already started.`);else{const i=_native.startPerformanceCounter(e);et._NativePerformanceCounterHandles.set(e,i)}}static _EndMarkNative(e,t=!0){if(t&&_native?.endPerformanceCounter){const i=et._NativePerformanceCounterHandles.get(e);i?(_native.endPerformanceCounter(i),et._NativePerformanceCounterHandles.delete(e)):et.Warn(`Performance counter with name ${e} was not started.`)}}static get Now(){return Gs.Now}static GetClassName(e,t=!1){let i=null;return!t&&e.getClassName?i=e.getClassName():(e instanceof Object&&(i=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),i||(i=typeof e)),i}static First(e,t){for(const i of e)if(t(i))return i;return null}static getFullClassName(e,t=!1){let i=null,s=null;if(!t&&e.getClassName)i=e.getClassName();else{if(e instanceof Object){const n=t?e:Object.getPrototypeOf(e);
187i=n.constructor.__bjsclassName__,s=n.constructor.__bjsmoduleName__}i||(i=typeof e)}return i?(s!=null?s+".":"")+i:null}static async DelayAsync(e){await new Promise(t=>{setTimeout(()=>{t()},e)})}static IsSafari(){return _l()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}}et=Rt;Rt.AssetBaseUrl="";Rt.UseCustomRequestHeaders=!1;Rt.CustomRequestHeaders=zi.CustomRequestHeaders;Rt.GetDOMTextContent=Lv;Rt._DefaultCdnUrl="https://cdn.babylonjs.com";Rt._CdnVersion="9.21.0";Rt._DefaultAssetsUrl="https://assets.babylonjs.com/core";Rt.LoadScript=typeof _native>"u"?et._LoadScriptWeb:et._LoadScriptNative;Rt.GetAbsoluteUrl=typeof document=="object"?r=>{const e=document.createElement("a");return e.href=r,e.href}:typeof URL=="function"&&typeof location=="object"?r=>new URL(r,location.origin).href:()=>{throw new Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.")};Rt.NoneLogLevel=Ee.NoneLogLevel;Rt.MessageLogLevel=Ee.MessageLogLevel;Rt.WarningLogLevel=Ee.WarningLogLevel;Rt.ErrorLogLevel=Ee.ErrorLogLevel;Rt.AllLogLevel=Ee.AllLogLevel;Rt.IsWindowObjectExist=is;Rt.PerformanceNoneLogLevel=0;Rt.PerformanceUserMarkLogLevel=1;Rt.PerformanceConsoleLogLevel=2;Rt._NativePerformanceCounterHandles=new Map;Rt.StartPerformanceCounter=et._StartPerformanceCounterDisabled;Rt.EndPerformanceCounter=et._EndPerformanceCounterDisabled;class Zf{constructor(e,t,i,s=0){this.iterations=e,this.index=s-1,this._done=!1,this._fn=t,this._successCallback=i}executeNext(){this._done||(this.index+1<this.iterations?(++this.index,this._fn(this)):this.breakLoop())}breakLoop(){this._done=!0,this._successCallback()}static Run(e,t,i,s=0){const n=new Zf(e,t,i,s);return n.executeNext(),n}static SyncAsyncForLoop(e,t,i,s,n,o=0){return Zf.Run(Math.ceil(e/t),c=>{n&&n()?c.breakLoop():setTimeout(()=>{for(let h=0;h<t;++h){const f=c.index*t+h;if(f>=e)break;if(i(f),n&&n()){c.breakLoop();break}}c.executeNext()},o)},s)}}function Gm(r,e,t){try{const i=r.next();i.done?e(i):i.value?i.value.then(()=>{i.value=void 0,e(i)},t):e(i)}catch(i){t(i)}}function IO(r=25){let e;return(t,i,s)=>{const n=performance.now();e===void 0||n-e>r?(e=n,setTimeout(()=>{Gm(t,i,s)},0)):Gm(t,i,s)}}function _A(r,e,t,i,s){const n=()=>{let o;const c=h=>{h.done?t(h.value):o===void 0?o=!0:n()};do o=void 0,e(r,c,i),o===void 0&&(o=!1);while(o)};n()}function xg(r,e){let t;return _A(r,Gm,i=>t=i,i=>{throw i}),t}async function DO(r,e,t){return await new Promise((i,s)=>{_A(r,e,i,s)})}function PO(r,e){return(...t)=>xg(r(...t))}class Ps{constructor(e){this.length=0,this.data=new Array(e),this._id=Ps._GlobalId++}push(e){this.data[this.length++]=e,this.length>this.data.length&&(this.data.length*=2)}forEach(e){for(let t=0;t<this.length;t++)e(this.data[t])}sort(e){this.data.sort(e)}reset(){this.length=0}dispose(){this.reset(),this.data&&(this.data.length=0)}concat(e){if(e.length!==0){this.length+e.length>this.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;t<e.length;t++)this.data[this.length++]=(e.data||e)[t]}}indexOf(e){const t=this.data.indexOf(e);return t>=this.length?-1:t}contains(e){return this.indexOf(e)!==-1}}Ps._GlobalId=0;class so extends Ps{constructor(){super(...arguments),this._duplicateId=0}push(e){super.push(e),e.__smartArrayFlags||(e.__smartArrayFlags={}),e.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(e){return e.__smartArrayFlags&&e.__smartArrayFlags[this._id]===this._duplicateId?!1:(this.push(e),!0)}reset(){super.reset(),this._duplicateId++}concatWithNoDuplicate(e){if(e.length!==0){this.length+e.length>this.data.length&&(this.data.length=(this.length+e.length)*2);for(let t=0;t<e.length;t++){const i=(e.data||e)[t];this.pushNoDuplicate(i)}}}}let Si=(()=>{var r;let e=Qn,t=[],i,s=[],n=[],o,c=[],h=[],f,_,d,g,p,b=[],x=[],E,v=[],S=[],R,P=[],M=[],O,D=[],w=[],G,H,ie,ne=[],ce=[],k,te=[],X=[],q,W=[],K=[],Z,F=[],A=[],N,Y=[],se=[],ue,pe=[],Ie=[];return r=class extends e{get position(){return this._position}set position(J){this._position=J}set upVector(J){this._upVector=J}get upVector(){return this._upVector}get screenArea(){let J,_e;if(this.mode===r.PERSPECTIVE_CAMERA)this.fovMode===r.FOVMODE_VERTICAL_FIXED?(_e=this.minZ*2*Math.tan(this.fov/2),J=this.getEngine().getAspectRatio(this)*_e):(J=this.minZ*2*Math.tan(this.fov/2),_e=J/this.getEngine().getAspectRatio(this));else{const ye=this.getEngine().getRenderWidth()/2,Ne=this.getEngine().getRenderHeight()/2;J=(this.orthoRight??ye)-(this.orthoLeft??-ye),_e=(this.orthoTop??Ne)-(this.orthoBottom??-Ne)}return J*_e}set orthoLeft(J){this._orthoLeft=J;for(const _e of this._rigCameras)_e.orthoLeft=J}get orthoLeft(){return this._orthoLeft}set orthoRight(J){this._orthoRight=J;for(const _e of this._rigCameras)_e.orthoRight=J}get orthoRight(){return this._orthoRight}set orthoBottom(J){this._orthoBottom=J;for(const _e of this._rigCameras)_e.orthoBottom=J}get orthoBottom(){return this._orthoBottom}set orthoTop(J){this._orthoTop=J;for(const _e of this._rigCameras)_e.orthoTop=J}get orthoTop(){return this._orthoTop}setFocalLength(J,_e=36){this.fov=2*Math.atan(_e/(2*J))}get inertia(){return this._baseInertia}set inertia(J){this._baseInertia=J}set mode(J){this._mode=J;for(const _e of this._rigCameras)_e.mode=J}get mode(){return this._mode}get hasMoved(){return this._hasMoved}constructor(J,_e,ye,Ne=!0){fg(),super(J,ye,!1),this.inputs=L(this,t),this._position=L(this,s,I.Zero()),this._upVector=(L(this,n),L(this,c,I.Up())),this.oblique=(L(this,h),null),this._orthoLeft=null,this._orthoRight=null,this._orthoBottom=null,this._orthoTop=null,this.fov=L(this,b,.8),this.projectionPlaneTilt=(L(this,x),L(this,v,0)),this.minZ=(L(this,S),L(this,P,1)),this.maxZ=(L(this,M),L(this,D,1e4)),this._baseInertia=(L(this,w),.9),this._mode=r.PERSPECTIVE_CAMERA,this.isIntermediate=!1,this.viewport=new Gf(0,0,1,1),this.layerMask=L(this,ne,268435455),this.fovMode=(L(this,ce),L(this,te,r.FOVMODE_VERTICAL_FIXED)),this.cameraRigMode=(L(this,X),L(this,W,r.RIG_MODE_NONE)),this.interaxialDistance=(L(this,K),L(this,F,void 0)),this.isStereoscopicSideBySide=(L(this,A),L(this,Y,void 0)),this.ignoreCameraMaxZ=(L(this,se),L(this,pe,!1)),this.customRenderTargets=(L(this,Ie),[]),this.outputRenderTarget=null,this.onViewMatrixChangedObservable=new Oe,this.onProjectionMatrixChangedObservable=new Oe,this.onAfterCheckInputsObservable=new Oe,this.onRestoreStateObservable=new Oe,this.isRigCamera=!1,this._hasMoved=!1,this._rigCameras=new Array,this._skipRendering=!1,this._projectionMatrix=new ae,this._postProcesses=new Array,this._activeMeshes=new Ps(256),this._globalPosition=I.Zero(),this._computedViewMatrix=ae.Identity(),this._doNotComputeProjectionMatrix=!1,this._transformMatrix=ae.Zero(),this._refreshFrustumPlanes=!0,this._absoluteRotation=Ue.Identity(),this._isCamera=!0,this._isLeftCamera=!1,this._isRightCamera=!1,this.layerMask=this.getScene().defaultCameraLayerMask,this.get
vendor: 9,215 bytes, line 187
187Scene().addCamera(this),Ne&&!this.getScene().activeCamera&&(this.getScene().activeCamera=this),this.position=_e,this.renderPassId=this.getScene().getEngine().createRenderPassId(`Camera ${J}`)}storeState(){return this._stateStored=!0,this._storedFov=this.fov,this}hasStateStored(){return!!this._stateStored}_restoreStateValues(){return this._stateStored?(this.fov=this._storedFov,!0):!1}restoreState(){return this._restoreStateValues()?(this.onRestoreStateObservable.notifyObservers(this),!0):!1}getClassName(){return"Camera"}toString(J){let _e="Name: "+this.name;if(_e+=", type: "+this.getClassName(),this.animations)for(let ye=0;ye<this.animations.length;ye++)_e+=", animation[0]: "+this.animations[ye].toString(J);return _e}applyVerticalCorrection(){const J=this.absoluteRotation.toEulerAngles();this.projectionPlaneTilt=this._scene.useRightHandedSystem?-J.x:J.x}get globalPosition(){return this._globalPosition}getActiveMeshes(){return this._activeMeshes}isActiveMesh(J){return this._activeMeshes.indexOf(J)!==-1}isReady(J=!1){if(J){for(const _e of this._postProcesses)if(_e&&!_e.isReady())return!1}return super.isReady(J)}_initCache(){super._initCache(),this._cache.position=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.upVector=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.mode=void 0,this._cache.minZ=void 0,this._cache.maxZ=void 0,this._cache.fov=void 0,this._cache.fovMode=void 0,this._cache.aspectRatio=void 0,this._cache.orthoLeft=void 0,this._cache.orthoRight=void 0,this._cache.orthoBottom=void 0,this._cache.orthoTop=void 0,this._cache.obliqueAngle=void 0,this._cache.obliqueLength=void 0,this._cache.obliqueOffset=void 0,this._cache.renderWidth=void 0,this._cache.renderHeight=void 0}_updateCache(J){J||super._updateCache(),this._cache.position.copyFrom(this.position),this._cache.upVector.copyFrom(this.upVector)}_isSynchronized(){return this._isSynchronizedViewMatrix()&&this._isSynchronizedProjectionMatrix()}_isSynchronizedViewMatrix(){return super._isSynchronized()?this._cache.position.equals(this.position)&&this._cache.upVector.equals(this.upVector)&&this.isSynchronizedWithParent():!1}_isSynchronizedProjectionMatrix(){const J=this.ignoreCameraMaxZ?0:this.maxZ;let _e=this._cache.mode===this.mode&&this._cache.minZ===this.minZ&&this._cache.maxZ===J;if(!_e)return!1;const ye=this.getEngine();return this.mode===r.PERSPECTIVE_CAMERA?_e=this._cache.fov===this.fov&&this._cache.fovMode===this.fovMode&&this._cache.aspectRatio===ye.getAspectRatio(this)&&this._cache.projectionPlaneTilt===this.projectionPlaneTilt:(_e=this._cache.orthoLeft===this.orthoLeft&&this._cache.orthoRight===this.orthoRight&&this._cache.orthoBottom===this.orthoBottom&&this._cache.orthoTop===this.orthoTop&&this._cache.renderWidth===ye.getRenderWidth()&&this._cache.renderHeight===ye.getRenderHeight(),this.oblique&&(_e=_e&&this._cache.obliqueAngle===this.oblique.angle&&this._cache.obliqueLength===this.oblique.length&&this._cache.obliqueOffset===this.oblique.offset)),_e}attachControl(J,_e){}detachControl(J){}update(){this._hasMoved=!1,this._checkInputs(),this.cameraRigMode!==r.RIG_MODE_NONE&&this._updateRigCameras(),this.getViewMatrix(),this.getProjectionMatrix()}_checkInputs(){this.onAfterCheckInputsObservable.notifyObservers(this)}get rigCameras(){return this._rigCameras}get rigPostProcess(){return this._rigPostProcess}_getFirstPostProcess(){for(let J=0;J<this._postProcesses.length;J++)if(this._postProcesses[J]!==null)return this._postProcesses[J];return null}_cascadePostProcessesToRigCams(){const J=this._getFirstPostProcess();J&&J.markTextureDirty();for(let _e=0,ye=this._rigCameras.length;_e<ye;_e++){const Ne=this._rigCameras[_e],Je=Ne._rigPostProcess;Je?(Je.getEffectName()==="pass"&&(Ne.isIntermediate=this._postProcesses.length===0),Ne._postProcesses=this._postProcesses.slice(0).concat(Je),Je.markTextureDirty()):Ne._postProcesses=this._postProcesses.slice(0)}}attachPostProcess(J,_e=null){return!J.isReusable()&&this._postProcesses.indexOf(J)>-1?(Ee.Error("You're trying to reuse a post process not defined as reusable."),0):(_e==null||_e<0?this._postProcesses.push(J):this._postProcesses[_e]===null?this._postProcesses[_e]=J:this._postProcesses.splice(_e,0,J),this._cascadePostProcessesToRigCams(),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._postProcesses.indexOf(J))}detachPostProcess(J){const _e=this._postProcesses.indexOf(J);_e!==-1&&(this._postProcesses[_e]=null),this._scene.prePassRenderer&&this._scene.prePassRenderer.markAsDirty(),this._cascadePostProcessesToRigCams()}getWorldMatrix(){return this._isSynchronizedViewMatrix()?this._worldMatrix:(this.getViewMatrix(),this._worldMatrix)}_getViewMatrix(){return ae.Identity()}getViewMatrix(J){return!J&&this._isSynchronizedViewMatrix()?this._computedViewMatrix:(this._hasMoved=!0,this.updateCache(),this._computedViewMatrix=this._getViewMatrix(),this._currentRenderId=this.getScene().getRenderId(),this._childUpdateId++,this._refreshFrustumPlanes=!0,this._cameraRigParams&&this._cameraRigParams.vrPreViewMatrix&&this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix,this._computedViewMatrix),this.parent&&this.parent.onViewMatrixChangedObservable&&this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent),this.onViewMatrixChangedObservable.notifyObservers(this),this._computedViewMatrix.invertToRef(this._worldMatrix),this._worldMatrix.getTranslationToRef(this._globalPosition),this._computedViewMatrix)}freezeProjectionMatrix(J){this._doNotComputeProjectionMatrix=!0,J!==void 0&&(this._projectionMatrix=J)}unfreezeProjectionMatrix(){this._doNotComputeProjectionMatrix=!1}getProjectionMatrix(J){if(this._doNotComputeProjectionMatrix||!J&&this._isSynchronizedProjectionMatrix())return this._projectionMatrix;const _e=this.ignoreCameraMaxZ?0:this.maxZ;this._cache.mode=this.mode,this._cache.minZ=this.minZ,this._cache.maxZ=_e,this._refreshFrustumPlanes=!0;const ye=this.getEngine(),Ne=this.getScene(),Je=ye.useReverseDepthBuffer;if(this.mode===r.PERSPECTIVE_CAMERA){this._cache.fov=this.fov,this._cache.fovMode=this.fovMode,this._cache.aspectRatio=ye.getAspectRatio(this),this._cache.projectionPlaneTilt=this.projectionPlaneTilt,this.minZ<=0&&(this.minZ=.1);let je;Ne.useRightHandedSystem?je=ae.PerspectiveFovRHToRef:je=ae.PerspectiveFovLHToRef,je(this.fov,ye.getAspectRatio(this),Je?_e:this.minZ,Je?this.minZ:_e,this._projectionMatrix,this.fovMode===r.FOVMODE_VERTICAL_FIXED,ye.isNDCHalfZRange,this.projectionPlaneTilt,Je)}else{const je=ye.getRenderWidth()/2,yt=ye.getRenderHeight()/2;Ne.useRightHandedSystem?this.oblique?ae.ObliqueOffCenterRHToRef(this.orthoLeft??-je,this.orthoRight??je,this.orthoBottom??-yt,this.orthoTop??yt,Je?_e:this.minZ,Je?this.minZ:_e,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,ye.isNDCHalfZRange):ae.OrthoOffCenterRHToRef(this.orthoLeft??-je,this.orthoRight??je,this.orthoBottom??-yt,this.orthoTop??yt,Je?_e:this.minZ,Je?this.minZ:_e,this._projectionMatrix,ye.isNDCHalfZRange):this.oblique?ae.ObliqueOffCenterLHToRef(this.orthoLeft??-je,this.orthoRight??je,this.orthoBottom??-yt,this.orthoTop??yt,Je?_e:this.minZ,Je?this.minZ:_e,this.oblique.length,this.oblique.angle,this._computeObliqueDistance(this.oblique.offset),this._projectionMatrix,ye.isNDCHalfZRange):ae.OrthoOffCenterLHToRef(this.orthoLeft??-je,this.orthoRight??je,this.orthoBottom??-yt,this.orthoTop??yt,Je?_e:this.minZ,Je?this.minZ:_e,this._projectionMatrix,ye.isNDCHalfZRange),this._cache.orthoLeft=this.orthoLeft,this._cache.orthoRight=this.orthoRight,this._cache.orthoBottom=this.orthoBottom,this._cache.orthoTop=this.orthoTop,this._cache.obliqueAngle=this.oblique?.angle,this._cache.obliqueLength=this.oblique?.length,this._cache.obliqueOffset=this.oblique?.offset,this._cache.renderWidth=ye.getRenderWidth(),this._cache.renderHeight=ye.getRenderHeight()}return this.onProjectionMatrixChangedObservable.notifyObservers(this),this._projectionMatrix}getTransformationMatrix(){return this._computedViewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._transformMatrix}_computeObliqueDistance(J){const _e=this,ye=this;return(_e.radius||(ye.target?I.Distance(this.position,ye.target):this.position.length()))+J}_updateFrustumPlanes(){this._refreshFrustumPlanes&&(this.getTransformationMatrix(),this._frustumPlanes?bn.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=bn.GetPlanes(this._transformMatrix),this._refreshFrustumPlanes=!1)}isInFrustum(J,_e=!1){if(this._updateFrustumPlanes(),_e&&this.rigCameras.length>0){let ye=!1;for(const Ne of this.rigCameras)Ne._updateFrustumPlanes(),ye=ye||J.isInFrustum(Ne._frustumPlanes);return ye}else return J.isInFrustum(this._frustumPlanes)}isCompletelyInFrustum(J){return this._updateFrustumPlanes(),J.isCompletelyInFrustum(this._frustumPlanes)}getForwardRay(J=100,_e,ye){throw at("Ray")}getForwardRayToRef(J,_e=100,ye,Ne){throw at("Ray")}dispose(J,_e=!1){for(this.onViewMatrixChangedObservable.clear(),this.onProjectionMatrixChangedObservable.clear(),this.onAfterCheckInputsObservable.clear(),this.onRestoreStateObservable.clear(),this.inputs&&this.inputs.clear(),this.get
vendor: 8,073 bytes, line 187
187Scene().stopAnimation(this),this.getScene().removeCamera(this);this._rigCameras.length>0;){const Ne=this._rigCameras.pop();Ne&&Ne.dispose()}if(this._parentContainer){const Ne=this._parentContainer.cameras.indexOf(this);Ne>-1&&this._parentContainer.cameras.splice(Ne,1),this._parentContainer=null}if(this._rigPostProcess)this._rigPostProcess.dispose(this),this._rigPostProcess=null,this._postProcesses.length=0;else if(this.cameraRigMode!==r.RIG_MODE_NONE)this._rigPostProcess=null,this._postProcesses.length=0;else{let Ne=this._postProcesses.length;for(;--Ne>=0;){const Je=this._postProcesses[Ne];Je&&Je.dispose(this)}}let ye=this.customRenderTargets.length;for(;--ye>=0;)this.customRenderTargets[ye].dispose();this.customRenderTargets.length=0,this._activeMeshes.dispose(),this.getScene().getEngine().releaseRenderPassId(this.renderPassId),super.dispose(J,_e)}get isLeftCamera(){return this._isLeftCamera}get isRightCamera(){return this._isRightCamera}get leftCamera(){return this._rigCameras.length<1?null:this._rigCameras[0]}get rightCamera(){return this._rigCameras.length<2?null:this._rigCameras[1]}getLeftTarget(){return this._rigCameras.length<1?null:this._rigCameras[0].getTarget()}getRightTarget(){return this._rigCameras.length<2?null:this._rigCameras[1].getTarget()}setCameraRigMode(J,_e){if(this.cameraRigMode!==J){for(;this._rigCameras.length>0;){const ye=this._rigCameras.pop();ye&&ye.dispose()}if(this.cameraRigMode=J,this._cameraRigParams={},this._cameraRigParams.interaxialDistance=_e.interaxialDistance||.0637,this._cameraRigParams.stereoHalfAngle=this._cameraRigParams.interaxialDistance/.0637*(Math.PI/180),this.cameraRigMode!==r.RIG_MODE_NONE){const ye=this.createRigCamera(this.name+"_L",0);ye&&(ye._isLeftCamera=!0);const Ne=this.createRigCamera(this.name+"_R",1);Ne&&(Ne._isRightCamera=!0),ye&&Ne&&(this._rigCameras.push(ye),this._rigCameras.push(Ne))}this._setRigMode(_e),this._cascadePostProcessesToRigCams(),this.update()}}_setRigMode(J){}_getVRProjectionMatrix(){return ae.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov,this._cameraRigParams.vrMetrics.aspectRatio,this.minZ,this.ignoreCameraMaxZ?0:this.maxZ,this._cameraRigParams.vrWorkMatrix,!0,this.getEngine().isNDCHalfZRange),this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix,this._projectionMatrix),this._projectionMatrix}setCameraRigParameter(J,_e){this._cameraRigParams||(this._cameraRigParams={}),this._cameraRigParams[J]=_e,J==="interaxialDistance"&&(this._cameraRigParams.stereoHalfAngle=_e/.0637*(Math.PI/180))}createRigCamera(J,_e){return null}_updateRigCameras(){for(let J=0;J<this._rigCameras.length;J++)this._rigCameras[J].minZ=this.minZ,this._rigCameras[J].maxZ=this.ignoreCameraMaxZ?0:this.maxZ,this._rigCameras[J].fov=this.fov,this._rigCameras[J].upVector.copyFrom(this.upVector);this.cameraRigMode===r.RIG_MODE_STEREOSCOPIC_ANAGLYPH&&(this._rigCameras[0].viewport=this._rigCameras[1].viewport=this.viewport)}_setupInputs(){}serialize(){const J=Tt.Serialize(this);return J.uniqueId=this.uniqueId,J.type=this.getClassName(),this.parent&&this.parent._serializeAsParent(J),this.inputs&&this.inputs.serialize(J),Tt.AppendSerializedAnimations(this,J),J.ranges=this.serializeAnimationRanges(),J.isEnabled=this.isEnabled(),J}clone(J,_e=null){const ye=Tt.Clone(r.GetConstructorFromName(this.getClassName(),J,this.getScene(),this.interaxialDistance,this.isStereoscopicSideBySide),this);return ye.name=J,ye.parent=_e,this.onClonedObservable.notifyObservers(ye),ye}getDirection(J){const _e=I.Zero();return this.getDirectionToRef(J,_e),_e}get absoluteRotation(){return this.getWorldMatrix().decompose(void 0,this._absoluteRotation),this._absoluteRotation}getDirectionToRef(J,_e){I.TransformNormalToRef(J,this.getWorldMatrix(),_e)}static GetConstructorFromName(J,_e,ye,Ne=0,Je=!0){const je=Qn.Construct(J,_e,ye,{interaxial_distance:Ne,isStereoscopicSideBySide:Je});return je||(()=>r._CreateDefaultParsedCamera(_e,ye))}computeWorldMatrix(){return this.getWorldMatrix()}_calculateHandednessMultiplier(){let J=this.getScene().useRightHandedSystem?-1:1;return this.parent&&this.parent._getWorldMatrixDeterminant()<0&&(J*=-1),J}},(()=>{const Le=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[Ur("position")],o=[Ur("upVector")],f=[he()],_=[he()],d=[he()],g=[he()],p=[he()],E=[he()],R=[he()],O=[he()],G=[he()],H=[he()],ie=[he()],k=[he()],q=[he()],Z=[he()],N=[he()],ue=[he()],$(r,null,f,{kind:"getter",name:"orthoLeft",static:!1,private:!1,access:{has:J=>"orthoLeft"in J,get:J=>J.orthoLeft},metadata:Le},null,t),$(r,null,_,{kind:"getter",name:"orthoRight",static:!1,private:!1,access:{has:J=>"orthoRight"in J,get:J=>J.orthoRight},metadata:Le},null,t),$(r,null,d,{kind:"getter",name:"orthoBottom",static:!1,private:!1,access:{has:J=>"orthoBottom"in J,get:J=>J.orthoBottom},metadata:Le},null,t),$(r,null,g,{kind:"getter",name:"orthoTop",static:!1,private:!1,access:{has:J=>"orthoTop"in J,get:J=>J.orthoTop},metadata:Le},null,t),$(r,null,G,{kind:"getter",name:"inertia",static:!1,private:!1,access:{has:J=>"inertia"in J,get:J=>J.inertia},metadata:Le},null,t),$(r,null,H,{kind:"getter",name:"mode",static:!1,private:!1,access:{has:J=>"mode"in J,get:J=>J.mode},metadata:Le},null,t),$(null,null,i,{kind:"field",name:"_position",static:!1,private:!1,access:{has:J=>"_position"in J,get:J=>J._position,set:(J,_e)=>{J._position=_e}},metadata:Le},s,n),$(null,null,o,{kind:"field",name:"_upVector",static:!1,private:!1,access:{has:J=>"_upVector"in J,get:J=>J._upVector,set:(J,_e)=>{J._upVector=_e}},metadata:Le},c,h),$(null,null,p,{kind:"field",name:"fov",static:!1,private:!1,access:{has:J=>"fov"in J,get:J=>J.fov,set:(J,_e)=>{J.fov=_e}},metadata:Le},b,x),$(null,null,E,{kind:"field",name:"projectionPlaneTilt",static:!1,private:!1,access:{has:J=>"projectionPlaneTilt"in J,get:J=>J.projectionPlaneTilt,set:(J,_e)=>{J.projectionPlaneTilt=_e}},metadata:Le},v,S),$(null,null,R,{kind:"field",name:"minZ",static:!1,private:!1,access:{has:J=>"minZ"in J,get:J=>J.minZ,set:(J,_e)=>{J.minZ=_e}},metadata:Le},P,M),$(null,null,O,{kind:"field",name:"maxZ",static:!1,private:!1,access:{has:J=>"maxZ"in J,get:J=>J.maxZ,set:(J,_e)=>{J.maxZ=_e}},metadata:Le},D,w),$(null,null,ie,{kind:"field",name:"layerMask",static:!1,private:!1,access:{has:J=>"layerMask"in J,get:J=>J.layerMask,set:(J,_e)=>{J.layerMask=_e}},metadata:Le},ne,ce),$(null,null,k,{kind:"field",name:"fovMode",static:!1,private:!1,access:{has:J=>"fovMode"in J,get:J=>J.fovMode,set:(J,_e)=>{J.fovMode=_e}},metadata:Le},te,X),$(null,null,q,{kind:"field",name:"cameraRigMode",static:!1,private:!1,access:{has:J=>"cameraRigMode"in J,get:J=>J.cameraRigMode,set:(J,_e)=>{J.cameraRigMode=_e}},metadata:Le},W,K),$(null,null,Z,{kind:"field",name:"interaxialDistance",static:!1,private:!1,access:{has:J=>"interaxialDistance"in J,get:J=>J.interaxialDistance,set:(J,_e)=>{J.interaxialDistance=_e}},metadata:Le},F,A),$(null,null,N,{kind:"field",name:"isStereoscopicSideBySide",static:!1,private:!1,access:{has:J=>"isStereoscopicSideBySide"in J,get:J=>J.isStereoscopicSideBySide,set:(J,_e)=>{J.isStereoscopicSideBySide=_e}},metadata:Le},Y,se),$(null,null,ue,{kind:"field",name:"ignoreCameraMaxZ",static:!1,private:!1,access:{has:J=>"ignoreCameraMaxZ"in J,get:J=>J.ignoreCameraMaxZ,set:(J,_e)=>{J.ignoreCameraMaxZ=_e}},metadata:Le},pe,Ie),Le&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Le})})(),r._CreateDefaultParsedCamera=(Le,J)=>{throw at("UniversalCamera")},r.PERSPECTIVE_CAMERA=0,r.ORTHOGRAPHIC_CAMERA=1,r.FOVMODE_VERTICAL_FIXED=0,r.FOVMODE_HORIZONTAL_FIXED=1,r.RIG_MODE_NONE=0,r.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,r.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,r.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,r.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,r.RIG_MODE_STEREOSCOPIC_INTERLACED=14,r.RIG_MODE_VR=20,r.RIG_MODE_CUSTOM=22,r.ForceAttachControlToAlwaysPreventDefault=!1,r})();class Qf{get isDisposed(){return this._isDisposed}constructor(e,t,i,s=0,n=!1,o=!1,c=!1,h,f){this._isAlreadyOwned=!1,this._isDisposed=!1,Qv(),e&&e.getSce
vendor: 12,426 bytes, line 187
187ne?this._engine=e.getScene().getEngine():this._engine=e,this._updatable=i,this._instanced=o,this._divisor=h||1,this._label=f,t instanceof xh?(this._data=null,this._buffer=t):(this._data=t,this._buffer=null),this.byteStride=c?s:s*Float32Array.BYTES_PER_ELEMENT,n||this.create()}createVertexBuffer(e,t,i,s,n,o=!1,c){const h=o?t:t*Float32Array.BYTES_PER_ELEMENT,f=s?o?s:s*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new U(this._engine,this,e,this._updatable,!0,f,n===void 0?this._instanced:n,h,i,void 0,void 0,!0,this._divisor||c)}isUpdatable(){return this._updatable}getData(){return this._data}getBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT}create(e=null){!e&&this._buffer||(e=e||this._data,e&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e),this._data=e):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(e,this._label),this._data=e):this._buffer=this._engine.createVertexBuffer(e,void 0,this._label)))}_rebuild(){if(this._data)this._buffer=null,this.create(this._data);else{if(!this._buffer)return;if(this._buffer.capacity>0){this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label);return}Ee.Warn(`Missing data for buffer "${this._label}" ${this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":""}. Buffer reconstruction failed.`),this._buffer=null}}update(e){this.create(e)}updateDirectly(e,t,i,s=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,e,s?t:t*Float32Array.BYTES_PER_ELEMENT,i?i*this.byteStride:void 0),t===0&&i===void 0?this._data=e:this._data=null)}_increaseReferences(){if(this._buffer){if(!this._isAlreadyOwned){this._isAlreadyOwned=!0;return}this._buffer.references++}}dispose(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._isDisposed=!0,this._data=null,this._buffer=null)}}class U{get isDisposed(){return this._isDisposed}get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(e){const t=e!=0;this._instanceDivisor=e,t!==this._instanced&&(this._instanced=t,this._computeHashCode())}get _maxVerticesCount(){const e=this.getData();return e?Array.isArray(e)?e.length/(this.byteStride/4)-this.byteOffset/4:(e.byteLength-this.byteOffset)/this.byteStride:0}constructor(e,t,i,s,n,o,c,h,f,_,d=!1,g=!1,p=1,b=!1){this._isDisposed=!1;let x;if(this.engine=e,typeof s=="object"&&s!==null?(x=s.updatable??!1,n=s.postponeInternalCreation,o=s.stride,c=s.instanced,h=s.offset,f=s.size,_=s.type,d=s.normalized??!1,g=s.useBytes??!1,p=s.divisor??1,b=s.takeBufferOwnership??!1,this._label=s.label):x=!!s,t instanceof Qf?(this._buffer=t,this._ownsBuffer=b):(this._buffer=new Qf(e,t,x,o,n,c,g,p,this._label),this._ownsBuffer=!0),this.uniqueId=U._Counter++,this._kind=i,_===void 0){const v=this.getData();this.type=v?OO(v):U.FLOAT}else this.type=_;const E=Sa(this.type);g?(this._size=f||(o?o/E:Hm(i)),this.byteStride=o||this._buffer.byteStride||this._size*E,this.byteOffset=h||0):(this._size=f||o||Hm(i),this.byteStride=o?o*E:this._buffer.byteStride||this._size*E,this.byteOffset=(h||0)*E),this.normalized=d,this._instanced=c!==void 0?c:!1,this._instanceDivisor=c?p:0,this._alignBuffer(),this._computeHashCode()}static _GetTypeHashIndex(e){switch(e){case U.BYTE:return 0;case U.UNSIGNED_BYTE:return 1;case U.SHORT:return 2;case U.UNSIGNED_SHORT:return 3;case U.INT:return 4;case U.UNSIGNED_INT:return 5;case U.FLOAT:return 6;case U.HALF_FLOAT:return 7;default:throw new Error(`Invalid vertex buffer type '${e}'`)}}_computeHashCode(){this.hashCode=(U._GetTypeHashIndex(this.type)<<0)+((this.normalized?1:0)<<3)+(this._size-1<<4)+((this._instanced?1:0)<<6)+(this.byteStride<<12)}_rebuild(){this._buffer?._rebuild()}getKind(){return this._kind}isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(e,t){const i=this.getData();return i?mO(i,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,e,t):null}getBuffer(){return this._buffer.getBuffer()}getWrapperBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Sa(this.type)}getOffset(){return this.byteOffset/Sa(this.type)}getSize(e=!1){return e?this._size*Sa(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(e){this._buffer.create(e),this._alignBuffer()}update(e){this._buffer.update(e),this._alignBuffer()}updateDirectly(e,t,i=!1){this._buffer.updateDirectly(e,t,void 0,i),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(e,t){dd(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,e,this.normalized,(i,s)=>{for(let n=0;n<this._size;n++)t(i[n],s+n)})}_alignBuffer(){}}U._Counter=0;U.BYTE=5120;U.UNSIGNED_BYTE=5121;U.SHORT=5122;U.UNSIGNED_SHORT=5123;U.INT=5124;U.UNSIGNED_INT=5125;U.FLOAT=5126;U.HALF_FLOAT=5131;U.PositionKind="position";U.NormalKind="normal";U.TangentKind="tangent";U.UVKind="uv";U.UV2Kind="uv2";U.UV3Kind="uv3";U.UV4Kind="uv4";U.UV5Kind="uv5";U.UV6Kind="uv6";U.ColorKind="color";U.ColorInstanceKind="instanceColor";U.MatricesIndicesKind="matricesIndices";U.MatricesWeightsKind="matricesWeights";U.MatricesIndicesExtraKind="matricesIndicesExtra";U.MatricesWeightsExtraKind="matricesWeightsExtra";function Hm(r){switch(r){case U.UVKind:case U.UV2Kind:case U.UV3Kind:case U.UV4Kind:case U.UV5Kind:case U.UV6Kind:return 2;case U.NormalKind:case U.PositionKind:return 3;case U.ColorKind:case U.ColorInstanceKind:case U.MatricesIndicesKind:case U.MatricesIndicesExtraKind:case U.MatricesWeightsKind:case U.MatricesWeightsExtraKind:case U.TangentKind:return 4;default:throw new Error("Invalid kind '"+r+"'")}}function OO(r){return r instanceof Int8Array?U.BYTE:r instanceof Uint8Array?U.UNSIGNED_BYTE:r instanceof Int16Array?U.SHORT:r instanceof Uint16Array?U.UNSIGNED_SHORT:r instanceof Int32Array?U.INT:r instanceof Uint32Array?U.UNSIGNED_INT:U.FLOAT}class Zx{constructor(e,t,i){this.bu=e,this.bv=t,this.distance=i,this.faceId=0,this.subMeshId=0,this._internalSubMeshId=0}}class Lr{constructor(e,t,i){this.vectors=Nr(8,I.Zero),this.center=I.Zero(),this.centerWorld=I.Zero(),this.extendSize=I.Zero(),this.extendSizeWorld=I.Zero(),this.directions=Nr(3,I.Zero),this.vectorsWorld=Nr(8,I.Zero),this.minimumWorld=I.Zero(),this.maximumWorld=I.Zero(),this.minimum=I.Zero(),this.maximum=I.Zero(),this._drawWrapperFront=null,this._drawWrapperBack=null,this.reConstruct(e,t,i)}reConstruct(e,t,i){const s=e.x,n=e.y,o=e.z,c=t.x,h=t.y,f=t.z,_=this.vectors;this.minimum.copyFromFloats(s,n,o),this.maximum.copyFromFloats(c,h,f),_[0].copyFromFloats(s,n,o),_[1].copyFromFloats(c,h,f),_[2].copyFromFloats(c,n,o),_[3].copyFromFloats(s,h,o),_[4].copyFromFloats(s,n,f),_[5].copyFromFloats(c,h,o),_[6].copyFromFloats(s,h,f),_[7].copyFromFloats(c,n,f),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=i||ae.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){const t=Lr._TmpVector3,i=this.maximum.subtractToRef(this.minimum,t[0]),s=i.length();i.normalizeFromLength(s);const n=s*e,o=i.scaleInPlace(n*.5),c=this.center.subtractToRef(o,t[1]),h=this.center.addToRef(o,t[2]);return this.reConstruct(c,h,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){const t=this.minimumWorld,i=this.maximumWorld,s=this.directions,n=this.vectorsWorld,o=this.vectors;if(e.isIdentity()){t.copyFrom(this.minimum),i.copyFrom(this.maximum);for(let c=0;c<8;++c)n[c].copyFrom(o[c]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),i.setAll(-Number.MAX_VALUE);for(let c=0;c<8;++c){const h=n[c];I.TransformCoordinatesToRef(o[c],e,h),t.minimizeInPlace(h),i.maximizeInPlace(h)}i.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),i.addToRef(t,this.centerWorld).scaleInPlace(.5)}I.FromArrayToRef(e.m,0,s[0]),I.FromArrayToRef(e.m,4,s[1]),I.FromArrayToRef(e.m,8,s[2]),this._worldMatrix=e}isInFrustum(e){return Lr.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){return Lr.IsCompletelyInFrustum(this.vectorsWorld,e)}intersectsPoint(e){const t=this.minimumWorld,i=this.maximumWorld,s=t.x,n=t.y,o=t.z,c=i.x,h=i.y,f=i.z,_=e.x,d=e.y,g=e.z,p=-It;return!(c-_<p||p>_-s||h-d<p||p>d-n||f-g<p||p>g-o)}intersectsSphere(e){return Lr.IntersectsSphere(this.minimumWorld,this.maximumWorld,e.centerWorld,e.radiusWorld)}intersectsMinMax(e,t){const i=this.minimumWorld,s=this.maximumWorld,n=i.x,o=i.y,c=i.z,h=s.x,f=s.y,_=s.z,d=e.x,g=e.y,p=e.z,b=t.x,x=t.y,E=t.z;return!(h<d||n>b||f<g||o>x||_<p||c>E)}dispose(){this._drawWrapperFront?.dispose(),this._drawWrapperBack?.dispose()}static Intersects(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,i,s){const n=Lr._TmpVector3[0];return I.ClampToRef(i,e,t,n),I.DistanceSquared(i,n)<=s*s}static IsCompletelyInFrustum(e,t){for(let i=0;i<6;++i){const s=t[i];for(let n=0;n<8;++n)if(s.dotCoordinate(e[n])<0)return!1}return!0}static IsInFrustum(e,t){for(let i=0;i<6;++i){let s=!0;const n=t[i];for(let o=0;o<8;++o)if(n.dotCoordinate(e[o])>=0){s=!1;break}if(s)return!1}return!0}}Lr._TmpVector3=Nr(3,I.Zero);class ho{constructor(e,t,i){this.center=I.Zero(),this.centerWorld=I.Zero(),this.minimum=I.Zero(),this.maximum=I.Zero(),this.reConstruct(e,t,i)}reConstruct(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);const s=I.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=s*.5,this._update(i||ae.IdentityReadOnly)}scale(e){const t=this.radius*e,i=ho._TmpVector3,s=i[0].setAll(t),n=this.center.subtractToRef(s,i[1]),o=this.center.addToRef(s,i[2]);return this.reConstruct(n,o,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){if(e.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{I.TransformCoordinatesToRef(this.center,e,this.centerWorld);const t=ho._TmpVector3[0];I.TransformNormalFromFloatsToRef(1,1,1,e,t),this.radiusWorld=Math.max(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))*this.radius}}isInFrustum(e){const t=this.centerWorld,i=this.radiusWorld;for(let s=0;s<6;s++)if(e[s].dotCoordinate(t)<=-i)return!1;return!0}isCenterInFrustum(e){const t=this.centerWorld;for(let i=0;i<6;i++)if(e[i].dotCoordinate(t)<0)return!1;return!0}intersectsPoint(e){const t=I.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld<t)}static Intersects(e,t){const i=I.DistanceSquared(e.centerWorld,t.centerWorld),s=e.radiusWorld+t.radiusWorld;return!(s*s<i)}static CreateFromCenterAndRadius(e,t,i){this._TmpVector3[0].copyFrom(e),this._TmpVector3[1].copyFromFloats(0,0,t),this._TmpVector3[2].copyFrom(e),this._TmpVector3[0].addInPlace(this._TmpVector3[1]),this._TmpVector3[2].subtractInPlace(this._TmpVector3[1]);const s=new ho(this._TmpVector3[0],this._TmpVector3[2]);return i?s._worldMatrix=i:s._worldMatrix=ae.Identity(),s}}ho._TmpVector3=Nr(3,I.Zero);const gm={min:0,max:0},pm={min:0,max:0},Qx=(r,e,t)=>{const i=I.Dot(e.centerWorld,r),s=Math.abs(I.Dot(e.directions[0],r))*e.extendSize.x,n=Math.abs(I.Dot(e.directions[1],r))*e.extendSize.y,o=Math.abs(I.Dot(e.directions[2],r))*e.extendSize.z,c=s+n+o;t.min=i-c,t.max=i+c},Cs=(r,e,t)=>(Qx(r,e,gm),Qx(r,t,pm),!(gm.min>pm.max||pm.min>gm.max));class en{constructor(e,t,i){this._isLocked=!1,this.boundingBox=new Lr(e,t,i),this.boundingSphere=new ho(e,t,i)}reConstruct(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)}get minimum(){return this.boundingBox.minimum}get maximum(){return this.boundingBox.maximum}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e}update(e){this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))}centerOn(e,t){const i=en._TmpVector3[0].copyFrom(e).subtractInPlace(t),s=en._TmpVector3[1].copyFrom(e).addInPlace(t);return this.boundingBox.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(i,s,this.boundingBox.getWorldMatrix()),this}encapsulate(e){const t=I.Minimize(this.minimum,e),i=I.Maximize(this.maximum,e);return this.reConstruct(t,i,this.boundingBox.getWorldMatrix()),this}encapsulateBoundingInfo(e){const t=ge.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);const i=ge.Vector3[0];return I.TransformCoordinatesToRef(e.boundingBox.minimumWorld,t,i
187),this.encapsulate(i),I.TransformCoordinatesToRef(e.boundingBox.maximumWorld,t,i),this.encapsulate(i),this}scale(e){return this.boundingBox.scale(e),this.boundingSphere.scale(e),this}isInFrustum(e,t=0){return(t===2||t===3)&&this.boundingSphere.isCenterInFrustum(e)?!0:this.boundingSphere.isInFrustum(e)?t===1||t===3?!0:this.boundingBox.isInFrustum(e):!1}get diagonalLength(){const e=this.boundingBox;return e.maximumWorld.subtractToRef(e.minimumWorld,en._TmpVector3[0]).length()}isCompletelyInFrustum(e){return this.boundingBox.isCompletelyInFrustum(e)}_checkCollision(e){return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)}intersectsPoint(e){return!(!this.boundingSphere.centerWorld||!this.boundingSphere.intersectsPoint(e)||!this.boundingBox.intersectsPoint(e))}intersects(e,t){if(!ho.Intersects(this.boundingSphere,e.boundingSphere)||!Lr.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;const i=this.boundingBox,s=e.boundingBox;return!(!Cs(i.directions[0],i,s)||!Cs(i.directions[1],i,s)||!Cs(i.directions[2],i,s)||!Cs(s.directions[0],i,s)||!Cs(s.directions[1],i,s)||!Cs(s.directions[2],i,s)||!Cs(I.Cross(i.directions[0],s.directions[0]),i,s)||!Cs(I.Cross(i.directions[0],s.directions[1]),i,s)||!Cs(I.Cross(i.directions[0],s.directions[2]),i,s)||!Cs(I.Cross(i.directions[1],s.directions[0]),i,s)||!Cs(I.Cross(i.directions[1],s.directions[1]),i,s)||!Cs(I.Cross(i.directions[1],s.directions[2]),i,s)||!Cs(I.Cross(i.directions[2],s.directions[0]),i,s)||!Cs(I.Cross(i.directions[2],s.directions[1]),i,s)||!Cs(I.Cross(i.directions[2],s.directions[2]),i,s))}}en._TmpVector3=Nr(2,I.Zero);let mA=(()=>{var r;let e=[],t,i;return r=class{static extractMinAndMaxIndexed(n,o,c,h,f,_){for(let d=c;d<c+h;d++){const g=o[d]*3,p=n[g],b=n[g+1],x=n[g+2];f.minimizeInPlaceFromFloats(p,b,x),_.maximizeInPlaceFromFloats(p,b,x)}}static extractMinAndMax(n,o,c,h,f,_){for(let d=o,g=o*h;d<o+c;d++,g+=h){const p=n[g],b=n[g+1],x=n[g+2];f.minimizeInPlaceFromFloats(p,b,x),_.maximizeInPlaceFromFloats(p,b,x)}}},(()=>{const s=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[Ra.filter((...n)=>!Array.isArray(n[0])&&!Array.isArray(n[1]))],i=[Ra.filter((...n)=>!Array.isArray(n[0]))],$(r,null,t,{kind:"method",name:"extractMinAndMaxIndexed",static:!0,private:!1,access:{has:n=>"extractMinAndMaxIndexed"in n,get:n=>n.extractMinAndMaxIndexed},metadata:s},null,e),$(r,null,i,{kind:"method",name:"extractMinAndMax",static:!0,private:!1,access:{has:n=>"extractMinAndMax"in n,get:n=>n.extractMinAndMax},metadata:s},null,e),s&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),L(r,e)})(),r})();function wO(r,e,t,i,s=null){const n=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o=new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return mA.extractMinAndMaxIndexed(r,e,t,i,n,o),s&&(n.x-=n.x*s.x+s.y,n.y-=n.y*s.x+s.y,n.z-=n.z*s.x+s.y,o.x+=o.x*s.x+s.y,o.y+=o.y*s.x+s.y,o.z+=o.z*s.x+s.y),{minimum:n,maximum:o}}
vendor: 47,503 bytes, line 187
187function gA(r,e,t,i=null,s){const n=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),o=new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return s||(s=3),mA.extractMinAndMax(r,e,t,s,n,o),i&&(n.x-=n.x*i.x+i.y,n.y-=n.y*i.x+i.y,n.z-=n.z*i.x+i.y,o.x+=o.x*i.x+i.y,o.y+=o.y*i.x+i.y,o.z+=o.z*i.x+i.y),{minimum:n,maximum:o}}class pA{static GetEffect(e){return e.getPipelineContext===void 0?e.effect:e}constructor(e,t=!0){this._wasPreviouslyReady=!1,this._forceRebindOnNextCall=!0,this._wasPreviouslyUsingInstances=null,this.effect=null,this.defines=null,this.drawContext=e.createDrawContext(),t&&(this.materialContext=e.createMaterialContext())}setEffect(e,t,i=!0){this.effect=e,t!==void 0&&(this.defines=t),i&&this.drawContext?.reset()}dispose(e=!1){if(this.effect){const t=this.effect;e?t.dispose():Ts.SetImmediate(()=>{t.getEngine().onEndFrameObservable.addOnce(()=>{t.dispose()})}),this.effect=null}this.drawContext?.dispose()}}var $x;class tn{get materialDefines(){const e=this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.defines:this._getDrawWrapper()?.defines;return typeof e=="string"?null:e}set materialDefines(e){const t=this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0);t.defines=e}_getDrawWrapper(e,t=!1){e=e??this._engine.currentRenderPassId;let i=this._drawWrappers[e];return!i&&t&&(this._drawWrappers[e]=i=new pA(this._mesh.getScene().getEngine())),i}_removeDrawWrapper(e,t=!0,i=!1){t&&this._drawWrappers[e]?.dispose(i),this._drawWrappers[e]=void 0}get effect(){return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.effect:this._getDrawWrapper()?.effect??null}get _drawWrapper(){return this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0)}get _drawWrapperOverride(){return this._mainDrawWrapperOverride}_setMainDrawWrapperOverride(e){this._mainDrawWrapperOverride=e}setEffect(e,t=null,i,s=!0){const n=this._drawWrapper;n.setEffect(e,t,s),i!==void 0&&(n.materialContext=i),e||(n.defines=null,n.materialContext=void 0)}resetDrawCache(e,t=!1){if(this._drawWrappers)if(e!==void 0){this._removeDrawWrapper(e,!0,t);return}else for(const i of this._drawWrappers)i?.dispose(t);this._drawWrappers=[]}static AddToMesh(e,t,i,s,n,o,c,h=!0){return new tn(e,t,i,s,n,o,c,h)}constructor(e,t,i,s,n,o,c,h=!0,f=!0){this.materialIndex=e,this.verticesStart=t,this.verticesCount=i,this.indexStart=s,this.indexCount=n,this._mainDrawWrapperOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._wasDispatched=!1,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=o,this._renderingMesh=c||o,f&&o.subMeshes.push(this),this._engine=this._mesh.getScene().getEngine(),this.resetDrawCache(),this._trianglePlanes=[],this._id=o.subMeshes.length-1,h&&(this.refreshBoundingInfo(),o.computeWorldMatrix(!0))}get IsGlobal(){return this.verticesStart===0&&this.verticesCount===this._mesh.getTotalVertices()&&this.indexStart===0&&this.indexCount===this._mesh.getTotalIndices()}getBoundingInfo(){return this.IsGlobal||this._mesh.hasThinInstances?this._mesh.getBoundingInfo():this._boundingInfo}setBoundingInfo(e){return this._boundingInfo=e,this}getMesh(){return this._mesh}getRenderingMesh(){return this._renderingMesh}getReplacementMesh(){return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null}getEffectiveMesh(){const e=this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null;return e||this._renderingMesh}getMaterial(e=!0){const t=this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId)??this._renderingMesh.material;if(t){if(this._isMultiMaterial(t)){const i=t.getSubMaterial(this.materialIndex);return this._currentMaterial!==i&&(this._currentMaterial=i,this.resetDrawCache()),i}}else return e&&this._mesh.getScene()._hasDefaultMaterial?this._mesh.getScene().defaultMaterial:null;return t}_isMultiMaterial(e){return e.getSubMaterial!==void 0}refreshBoundingInfo(e=null){if(this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(U.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;const t=this._renderingMesh.getIndices();let i;if(this.indexStart===0&&this.indexCount===t.length){const s=this._renderingMesh.getBoundingInfo();i={minimum:s.minimum.clone(),maximum:s.maximum.clone()}}else i=wO(e,t,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(i.minimum,i.maximum):this._boundingInfo=new en(i.minimum,i.maximum),this}_checkCollision(e){return this.getBoundingInfo()._checkCollision(e)}updateBoundingInfo(e){let t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this}isInFrustum(e){const t=this.getBoundingInfo();return t?t.isInFrustum(e,this._mesh.cullingStrategy):!1}isCompletelyInFrustum(e){const t=this.getBoundingInfo();return t?t.isCompletelyInFrustum(e):!1}render(e){return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this}_getLinesIndexBuffer(e,t){if(!this._linesIndexBuffer){const i=Math.floor(this.indexCount/3)*6,n=this.verticesStart+this.verticesCount>65535?new Uint32Array(i):new Uint16Array(i);let o=0;if(e.length===0)for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=3)n[o++]=c,n[o++]=c+1,n[o++]=c+1,n[o++]=c+2,n[o++]=c+2,n[o++]=c;else for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=3)n[o++]=e[c],n[o++]=e[c+1],n[o++]=e[c+1],n[o++]=e[c+2],n[o++]=e[c+2],n[o++]=e[c];this._linesIndexBuffer=t.createIndexBuffer(n),this._linesIndexCount=n.length}return this._linesIndexBuffer}canIntersects(e){const t=this.getBoundingInfo();return t?e.intersectsBox(t.boundingBox):!1}intersects(e,t,i,s,n){const o=this.getMaterial();if(!o)return null;let c=3,h=!1;switch(o.fillMode){case 3:case 5:case 6:case 8:return null;case 7:c=1,h=!0;break}return o.fillMode===4?i.length?this._intersectLines(e,t,i,this._mesh.intersectionThreshold,s):this._intersectUnIndexedLines(e,t,i,this._mesh.intersectionThreshold,s):!i.length&&this._mesh._unIndexed?this._intersectUnIndexedTriangles(e,t,i,s,n):this._intersectTriangles(e,t,i,c,h,s,n)}_intersectLines(e,t,i,s,n){let o=null;for(let c=this.indexStart;c<this.indexStart+this.indexCount;c+=2){const h=t[i[c]],f=t[i[c+1]],_=e.intersectionSegment(h,f,s);if(!(_<0)&&(n||!o||_<o.distance)&&(o=new Zx(null,null,_),o.faceId=c/2,n))break}return o}_intersectUnIndexedLines(e,t,i,s,n){let o=null;for(let c=this.verticesStart;c<this.verticesStart+this.verticesCount;c+=2){const h=t[c],f=t[c+1],_=e.intersectionSegment(h,f,s);if(!(_<0)&&(n||!o||_<o.distance)&&(o=new Zx(null,null,_),o.faceId=c/2,n))break}return o}_intersectTriangles(e,t,i,s,n,o,c){let h=null,f=-1;for(let _=this.indexStart;_<this.indexStart+this.indexCount-(3-s);_+=s){f++;const d=i[_],g=i[_+1],p=i[_+2];if(n&&p===4294967295){_+=2;continue}const b=t[d],x=t[g],E=t[p];if(!b||!x||!E||c&&!c(b,x,E,e,d,g,p))continue;const v=e.intersectsTriangle(b,x,E);if(v){if(v.distance<0)continue;if((o||!h||v.distance<h.distance)&&(h=v,h.faceId=f,o))break}}return h}_intersectUnIndexedTriangles(e,t,i,s,n){let o=null;for(let c=this.verticesStart;c<this.verticesStart+this.verticesCount;c+=3){const h=t[c],f=t[c+1],_=t[c+2];if(n&&!n(h,f,_,e,-1,-1,-1))continue;const d=e.intersectsTriangle(h,f,_);if(d){if(d.distance<0)continue;if((s||!o||d.distance<o.distance)&&(o=d,o.faceId=c/3,s))break}}return o}_rebuild(){this._linesIndexBuffer&&(this._linesIndexBuffer=null)}clone(e,t){const i=new tn(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,e,t,!1);if(!this.IsGlobal){const s=this.getBoundingInfo();if(!s)return i;i._boundingInfo=new en(s.minimum,s.maximum)}return i}dispose(e=!1){this._linesIndexBuffer&&(this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer),this._linesIndexBuffer=null);const t=this._mesh.subMeshes.indexOf(this);this._mesh.subMeshes.splice(t,1),this.resetDrawCache(void 0,e)}getClassName(){return"SubMesh"}static CreateFromIndices(e,t,i,s,n,o=!0){let c=Number.MAX_VALUE,h=-Number.MAX_VALUE;const _=(n||s).getIndices();for(let d=t;d<t+i;d++){const g=_[d];g<c&&(c=g),g>h&&(h=g)}return new tn(e,c,h-c+1,t,i,s,n,o)}}($x=tn.prototype).projectToRef??($x.projectToRef=Ze("SubMesh","projectToRef"));class ym{}let Ye=(()=>{var r;let e=[],t,i,s,n;return r=class{constructor(){this.uniqueId=0,this.metadata={},this._applyTo=PO(this._applyToCoroutine.bind(this)),this.uniqueId=r._UniqueIdGenerator,r._UniqueIdGenerator++}set(c,h){switch(c.length||Ee.Warn(`Setting vertex data kind '${h}' with an empty array`),h){case U.PositionKind:this.positions=c;break;case U.NormalKind:this.normals=c;break;case U.TangentKind:this.tangents=c;break;case U.UVKind:this.uvs=c;break;case U.UV2Kind:this.uvs2=c;break;case U.UV3Kind:this.uvs3=c;break;case U.UV4Kind:this.uvs4=c;break;case U.UV5Kind:this.uvs5=c;break;case U.UV6Kind:this.uvs6=c;break;case U.ColorKind:this.colors=c;break;case U.MatricesIndicesKind:this.matricesIndices=c;break;case U.MatricesWeightsKind:this.matricesWeights=c;break;case U.MatricesIndicesExtraKind:this.matricesIndicesExtra=c;break;case U.MatricesWeightsExtraKind:this.matricesWeightsExtra=c;break}}applyToMesh(c,h){return this._applyTo(c,h,!1),this}applyToGeometry(c,h){return this._applyTo(c,h,!1),this}updateMesh(c){return this._update(c),this}updateGeometry(c){return this._update(c),this}*_applyToCoroutine(c,h=!1,f){if(this.positions&&(c.setVerticesData(U.PositionKind,this.positions,h),f&&(yield)),this.normals&&(c.setVerticesData(U.NormalKind,this.normals,h),f&&(yield)),this.tangents&&(c.setVerticesData(U.TangentKind,this.tangents,h),f&&(yield)),this.uvs&&(c.setVerticesData(U.UVKind,this.uvs,h),f&&(yield)),this.uvs2&&(c.setVerticesData(U.UV2Kind,this.uvs2,h),f&&(yield)),this.uvs3&&(c.setVerticesData(U.UV3Kind,this.uvs3,h),f&&(yield)),this.uvs4&&(c.setVerticesData(U.UV4Kind,this.uvs4,h),f&&(yield)),this.uvs5&&(c.setVerticesData(U.UV5Kind,this.uvs5,h),f&&(yield)),this.uvs6&&(c.setVerticesData(U.UV6Kind,this.uvs6,h),f&&(yield)),this.colors){const _=this.positions&&this.colors.length===this.positions.length?3:4;c.setVerticesData(U.ColorKind,this.colors,h,_),this.hasVertexAlpha&&c.hasVertexAlpha!==void 0&&(c.hasVertexAlpha=!0),f&&(yield)}if(this.matricesIndices&&(c.setVerticesData(U.MatricesIndicesKind,this.matricesIndices,h),f&&(yield)),this.matricesWeights&&(c.setVerticesData(U.MatricesWeightsKind,this.matricesWeights,h),f&&(yield)),this.matricesIndicesExtra&&(c.setVerticesData(U.MatricesIndicesExtraKind,this.matricesIndicesExtra,h),f&&(yield)),this.matricesWeightsExtra&&(c.setVerticesData(U.MatricesWeightsExtraKind,this.matricesWeightsExtra,h),f&&(yield)),this.indices?(c.setIndices(this.indices,null,h),f&&(yield)):c.setIndices([],null),c.subMeshes&&this.materialInfos&&this.materialInfos.length>1){const _=c;_.subMeshes=[];for(const d of this.materialInfos)new tn(d.materialIndex,d.verticesStart,d.verticesCount,d.indexStart,d.indexCount,_)}return this}_update(c,h,f){return this.positions&&c.updateVerticesData(U.PositionKind,this.positions,h,f),this.normals&&c.updateVerticesData(U.NormalKind,this.normals,h,f),this.tangents&&c.updateVerticesData(U.TangentKind,this.tangents,h,f),this.uvs&&c.updateVerticesData(U.UVKind,this.uvs,h,f),this.uvs2&&c.updateVerticesData(U.UV2Kind,this.uvs2,h,f),this.uvs3&&c.updateVerticesData(U.UV3Kind,this.uvs3,h,f),this.uvs4&&c.updateVerticesData(U.UV4Kind,this.uvs4,h,f),this.uvs5&&c.updateVerticesData(U.UV5Kind,this.uvs5,h,f),this.uvs6&&c.updateVerticesData(U.UV6Kind,this.uvs6,h,f),this.colors&&c.updateVerticesData(U.ColorKind,this.colors,h,f),this.matricesIndices&&c.updateVerticesData(U.MatricesIndicesKind,this.matricesIndices,h,f),this.matricesWeights&&c.updateVerticesData(U.MatricesWeightsKind,this.matricesWeights,h,f),this.matricesIndicesExtra&&c.updateVerticesData(U.MatricesIndicesExtraKind,this.matricesIndicesExtra,h,f),this.matricesWeightsExtra&&c.updateVerticesData(U.MatricesWeightsExtraKind,this.matricesWeightsExtra,h,f),this.indices&&c.setIndices(this.indices,null),this}static _TransformVector3Coordinates(c,h,f=0,_=c.length){const d=ge.Vector3[0],g=ge.Vector3[1];for(let p=f;p<f+_;p+=3)I.FromArrayToRef(c,p,d),I.TransformCoordinatesToRef(d,h,g),c[p]=g.x,c[p+1]=g.y,c[p+2]=g.z}static _TransformVector3Normals(c,h,f=0,_=c.length){const d=ge.Vector3[0],g=ge.Vector3[1];for(let p=f;p<f+_;p+=3)I.FromArrayToRef(c,p,d),I.TransformNormalToRef(d,h,g),c[p]=g.x,c[p+1]=g.y,c[p+2]=g.z}static _TransformVector4Normals(c,h,f=0,_=c.length){const d=ge.Vector4[0],g=ge.Vector4[1];for(let p=f;p<f+_;p+=4)dt.FromArrayToRef(c,p,d),dt.TransformNormalToRef(d,h,g),c[p]=g.x,c[p+1]=g.y,c[p+2]=g.z,c[p+3]=g.w}static _FlipFaces(c,h=0,f=c.length){for(let _=h;_<h+f;_+=3){const d=c[_+1];c[_+1]=c[_+2],c[_+2]=d}}transform(c){const h=c.determinant()<0;return this.positions&&r._TransformVector3Coordinates(this.positions,c),this.normals&&r._TransformVector3Normals(this.normals,c),this.tangents&&r._TransformVector4Normals(this.tangents,c),h&&this.indices&&r._FlipFaces(this.indices),this}splitBasedOnMaterialID(){if(!this.materialInfos||this.materialInfos.length<2)return[this];const c=[];for(const h of this.materialInfos){const f=new r;if(this.positions&&(f.positions=this.positions.slice(h.verticesStart*3,(h.verticesCount+h.verticesStart)*3)),this.normals&&(f.normals=this.normals.slice(h.verticesStart*3,(h.verticesCount+h.verticesStart)*3)),this.tangents&&(f.tangents=this.tangents.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.colors&&(f.colors=this.colors.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.uvs&&(f.uvs=this.uvs.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs2&&(f.uvs2=this.uvs2.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs3&&(f.uvs3=this.uvs3.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs4&&(f.uvs4=this.uvs4.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs5&&(f.uvs5=this.uvs5.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.uvs6&&(f.uvs6=this.uvs6.slice(h.verticesStart*2,(h.verticesCount+h.verticesStart)*2)),this.matricesIndices&&(f.matricesIndices=this.matricesIndices.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesIndicesExtra&&(f.matricesIndicesExtra=this.matricesIndicesExtra.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesWeights&&(f.matricesWeights=this.matricesWeights.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.matricesWeightsExtra&&(f.matricesWeightsExtra=this.matricesWeightsExtra.slice(h.verticesStart*4,(h.verticesCount+h.verticesStart)*4)),this.indices){f.indices=[];for(let d=h.indexStart;d<h.indexStart+h.indexCount;d++)f.indices.push(this.indices[d]-h.verticesStart)}const _=new ym;_.indexStart=0,_.indexCount=f.indices?f.indices.length:0,_.materialIndex=h.materialIndex,_.verticesStart=0,_.verticesCount=(f.positions?f.positions.length:0)/3,f.materialInfos=[_],c.push(f)}return c}merge(c,h=!1,f=!1,_=!1,d=!1){const g=Array.isArray(c)?c.map(p=>({vertexData:p})):[{vertexData:c}];return xg(this._mergeCoroutine(void 0,g,h,!1,f,_,d))}*_mergeCoroutine(c,h,f=!1,_,d,g=!1,p=!1){this._validate();let b=h.map(R=>R.vertexData),x=this;if(p)for(const R of b)R&&(R._validate(),!this.normals&&R.normals&&(this.normals=new Float32Array(this.positions.length)),!this.tangents&&R.tangents&&(this.tangents=new Float32Array(this.positions.length/3*4)),!this.uvs&&R.uvs&&(this.uvs=new Float32Array(this.positions.length/3*2)),!this.uvs2&&R.uvs2&&(this.uvs2=new Float32Array(this.positions.length/3*2)),!this.uvs3&&R.uvs3&&(this.uvs3=new Float32Array(this.positions.length/3*2)),!this.uvs4&&R.uvs4&&(this.uvs4=new Float32Array(this.positions.length/3*2)),!this.uvs5&&R.uvs5&&(this.uvs5=new Float32Array(this.positions.length/3*2)),!this.uvs6&&R.uvs6&&(this.uvs6=new Float32Array(this.positions.length/3*2)),!this.colors&&R.colors&&(this.colors=new Float32Array(this.positions.length/3*4),this.colors.fill(1)),!this.matricesIndices&&R.matricesIndices&&(this.matricesIndices=new Float32Array(this.positions.length/3*4)),!this.matricesWeights&&R.matricesWeights&&(this.matricesWeights=new Float32Array(this.positions.length/3*4)),!this.matricesIndicesExtra&&R.matricesIndicesExtra&&(this.matricesIndicesExtra=new Float32Array(this.positions.length/3*4)),!this.matricesWeightsExtra&&R.matricesWeightsExtra&&(this.matricesWeightsExtra=new Float32Array(this.positions.length/3*4)));for(const R of b)if(R){if(p)this.normals&&!R.normals&&(R.normals=new Float32Array(R.positions.length)),this.tangents&&!R.tangents&&(R.tangents=new Float32Array(R.positions.length/3*4)),this.uvs&&!R.uvs&&(R.uvs=new Float32Array(R.positions.length/3*2)),this.uvs2&&!R.uvs2&&(R.uvs2=new Float32Array(R.positions.length/3*2)),this.uvs3&&!R.uvs3&&(R.uvs3=new Float32Array(R.positions.length/3*2)),this.uvs4&&!R.uvs4&&(R.uvs4=new Float32Array(R.positions.length/3*2)),this.uvs5&&!R.uvs5&&(R.uvs5=new Float32Array(R.positions.length/3*2)),this.uvs6&&!R.uvs6&&(R.uvs6=new Float32Array(R.positions.length/3*2)),this.colors&&!R.colors&&(R.colors=new Float32Array(R.positions.length/3*4),R.colors.fill(1)),this.matricesIndices&&!R.matricesIndices&&(R.matricesIndices=new Float32Array(R.positions.length/3*4)),this.matricesWeights&&!R.matricesWeights&&(R.matricesWeights=new Float32Array(R.positions.length/3*4)),this.matricesIndicesExtra&&!R.matricesIndicesExtra&&(R.matricesIndicesExtra=new Float32Array(R.positions.length/3*4)),this.matricesWeightsExtra&&!R.matricesWeightsExtra&&(R.matricesWeightsExtra=new Float32Array(R.positions.length/3*4));else if(R._validate(),!this.normals!=!R.normals||!this.tangents!=!R.tangents||!this.uvs!=!R.uvs||!this.uvs2!=!R.uvs2||!this.uvs3!=!R.uvs3||!this.uvs4!=!R.uvs4||!this.uvs5!=!R.uvs5||!this.uvs6!=!R.uvs6||!this.colors!=!R.colors||!this.matricesIndices!=!R.matricesIndices||!this.matricesWeights!=!R.matricesWeights||!this.matricesIndicesExtra!=!R.matricesIndicesExtra||!this.matricesWeightsExtra!=!R.matricesWeightsExtra)throw new Error("Cannot merge vertex data that do not have the same set of attributes")}if(g){let R,P=0,M=0;const O=[];let D=null;const w=[];for(const H of this.splitBasedOnMaterialID())w.push({vertexData:H,transform:c});for(const H of h)if(H.vertexData)for(const ie of H.vertexData.splitBasedOnMaterialID())w.push({vertexData:ie,transform:H.transform});w.sort((H,ie)=>{const ne=H.vertexData.materialInfos?H.vertexData.materialInfos[0].materialIndex:0,ce=ie.vertexData.materialInfos?ie.vertexData.materialInfos[0].materialIndex:0;return ne>ce?1:ne===ce?0:-1});for(const H of w){const ie=H.vertexData;if(ie.materialInfos?R=ie.materialInfos[0].materialIndex:R=0,D&&D.materialIndex===R)D.indexCount+=ie.indices.length,D.verticesCount+=ie.positions.length/3;else{const ne=new ym;ne.materialIndex=R,ne.indexStart=P,ne.indexCount=ie.indices.length,ne.verticesStart=M,ne.verticesCount=ie.positions.length/3,O.push(ne),D=ne}P+=ie.indices.length,M+=ie.positions.length/3}const G=w.splice(0,1)[0];x=G.vertexData,c=G.transform,b=w.map(H=>H.vertexData),h=w,this.materialInfos=O}const E=b.reduce((R,P)=>R+(P.indices?.length??0),x.indices?.length??0);let S=d||b.some(R=>R.indices===x.indices)?x.indices?.slice():x.indices;if(E>0){let R=S?.length??0;if(S||(S=new Array(E)),S.length!==E){if(Array.isArray(S))S.length=E;else{const M=f||S instanceof Uint32Array?new Uint32Array(E):new Uint16Array(E);M.set(S),S=M}c&&c.determinant()<0&&r._FlipFaces(S,0,R)}let P=x.positions?x.positions.length/3:0;for(const{vertexData:M,transform:O}of h)if(M.indices){for(let D=0;D<M.indices.length;D++)S[R+D]=M.indices[D]+P;O&&O.determinant()<0&&r._FlipFaces(S,R,M.indices.length),P+=M.positions.length/3,R+=M.indices.length,_&&(yield)}}return this.indices=S,this.positions=r._MergeElement(U.PositionKind,x.positions,c,h.map(R=>[R.vertexData.positions,R.transform])),_&&(yield),x.normals&&(this.normals=r._MergeElement(U.NormalKind,x.normals,c,h.map(R=>[R.vertexData.normals,R.transform])),_&&(yield)),x.tangents&&(this.tangents=r._MergeElement(U.TangentKind,x.tangents,c,h.map(R=>[R.vertexData.tangents,R.transform])),_&&(yield)),x.uvs&&(this.uvs=r._MergeElement(U.UVKind,x.uvs,c,h.map(R=>[R.vertexData.uvs,R.transform])),_&&(yield)),x.uvs2&&(this.uvs2=r._MergeElement(U.UV2Kind,x.uvs2,c,h.map(R=>[R.vertexData.uvs2,R.transform])),_&&(yield)),x.uvs3&&(this.uvs3=r._MergeElement(U.UV3Kind,x.uvs3,c,h.map(R=>[R.vertexData.uvs3,R.transform])),_&&(yield)),x.uvs4&&(this.uvs4=r._MergeElement(U.UV4Kind,x.uvs4,c,h.map(R=>[R.vertexData.uvs4,R.transform])),_&&(yield)),x.uvs5&&(this.uvs5=r._MergeElement(U.UV5Kind,x.uvs5,c,h.map(R=>[R.vertexData.uvs5,R.transform])),_&&(yield)),x.uvs6&&(this.uvs6=r._MergeElement(U.UV6Kind,x.uvs6,c,h.map(R=>[R.vertexData.uvs6,R.transform])),_&&(yield)),x.colors&&(this.colors=r._MergeElement(U.ColorKind,x.colors,c,h.map(R=>[R.vertexData.colors,R.transform])),(x.hasVertexAlpha!==void 0||h.some(R=>R.vertexData.hasVertexAlpha!==void 0))&&(this.hasVertexAlpha=x.hasVertexAlpha||h.some(R=>R.vertexData.hasVertexAlpha)),_&&(yield)),x.matricesIndices&&(this.matricesIndices=r._MergeElement(U.MatricesIndicesKind,x.matricesIndices,c,h.map(R=>[R.vertexData.matricesIndices,R.transform])),_&&(yield)),x.matricesWeights&&(this.matricesWeights=r._MergeElement(U.MatricesWeightsKind,x.matricesWeights,c,h.map(R=>[R.vertexData.matricesWeights,R.transform])),_&&(yield)),x.matricesIndicesExtra&&(this.matricesIndicesExtra=r._MergeElement(U.MatricesIndicesExtraKind,x.matricesIndicesExtra,c,h.map(R=>[R.vertexData.matricesIndicesExtra,R.transform])),_&&(yield)),x.matricesWeightsExtra&&(this.matricesWeightsExtra=r._MergeElement(U.MatricesWeightsExtraKind,x.matricesWeightsExtra,c,h.map(R=>[R.vertexData.matricesWeightsExtra,R.transform]))),this}static _MergeElement(c,h,f,_){const d=_.filter(b=>b[0]!==null&&b[0]!==void 0);if(!h&&d.length==0)return h;if(!h)return this._MergeElement(c,d[0][0],d[0][1],d.slice(1));const g=d.reduce((b,x)=>b+x[0].length,h.length),p=c===U.PositionKind?r._TransformVector3Coordinates:c===U.NormalKind?r._TransformVector3Normals:c===U.TangentKind?r._TransformVector4Normals:()=>{};if(h instanceof Float32Array){const b=new Float32Array(g);b.set(h),f&&p(b,f,0,h.length);let x=h.length;for(const[E,v]of d)b.set(E,x),v&&p(b,v,x,E.length),x+=E.length;return b}else{const b=new Array(g);for(let E=0;E<h.length;E++)b[E]=h[E];f&&p(b,f,0,h.length);let x=h.length;for(const[E,v]of d){for(let S=0;S<E.length;S++)b[x+S]=E[S];v&&p(b,v,x,E.length),x+=E.length}return b}}_validate(){if(!this.positions)throw new Cl("Positions are required",fd.MeshInvalidPositionsError);const c=(_,d)=>{const g=Hm(_);if(d.length%g!==0)throw new Error("The "+_+"s array count must be a multiple of "+g);return d.length/g},h=c(U.PositionKind,this.positions),f=(_,d)=>{const g=c(_,d);if(g!==h)throw new Error("The "+_+"s element count ("+g+") does not match the positions count ("+h+")")};this.normals&&f(U.NormalKind,this.normals),this.tangents&&f(U.TangentKind,this.tangents),this.uvs&&f(U.UVKind,this.uvs),this.uvs2&&f(U.UV2Kind,this.uvs2),this.uvs3&&f(U.UV3Kind,this.uvs3),this.uvs4&&f(U.UV4Kind,this.uvs4),this.uvs5&&f(U.UV5Kind,this.uvs5),this.uvs6&&f(U.UV6Kind,this.uvs6),this.colors&&f(U.ColorKind,this.colors),this.matricesIndices&&f(U.MatricesIndicesKind,this.matricesIndices),this.matricesWeights&&f(U.MatricesWeightsKind,this.matricesWeights),this.matricesIndicesExtra&&f(U.MatricesIndicesExtraKind,this.matricesIndicesExtra),this.matricesWeightsExtra&&f(U.MatricesWeightsExtraKind,this.matricesWeightsExtra)}clone(){const c=this.serialize();return r.Parse(c)}serialize(){const c={};if(this.positions&&(c.positions=Array.from(this.positions)),this.normals&&(c.normals=Array.from(this.normals)),this.tangents&&(c.tangents=Array.from(this.tangents)),this.uvs&&(c.uvs=Array.from(this.uvs)),this.uvs2&&(c.uvs2=Array.from(this.uvs2)),this.uvs3&&(c.uvs3=Array.from(this.uvs3)),this.uvs4&&(c.uvs4=Array.from(this.uvs4)),this.uvs5&&(c.uvs5=Array.from(this.uvs5)),this.uvs6&&(c.uvs6=Array.from(this.uvs6)),this.colors&&(c.colors=Array.from(this.colors),c.hasVertexAlpha=this.hasVertexAlpha),this.matricesIndices&&(c.matricesIndices=Array.from(this.matricesIndices),c.matricesIndicesExpanded=!0),this.matricesWeights&&(c.matricesWeights=Array.from(this.matricesWeights)),this.matricesIndicesExtra&&(c.matricesIndicesExtra=Array.from(this.matricesIndicesExtra),c.matricesIndicesExtraExpanded=!0),this.matricesWeightsExtra&&(c.matricesWeightsExtra=Array.from(this.matricesWeightsExtra)),c.indices=this.indices?Array.from(this.indices):[],this.materialInfos){c.materialInfos=[];for(const h of this.materialInfos){const f={indexStart:h.indexStart,indexCount:h.indexCount,materialIndex:h.materialIndex,verticesStart:h.verticesStart,verticesCount:h.verticesCount};c.materialInfos.push(f)}}return c}static ExtractFromMesh(c,h,f){return r._ExtractFrom(c,h,f)}static ExtractFromGeometry(c,h,f){return r._ExtractFrom(c,h,f)}static _ExtractFrom(c,h,f){const _=new r;if(c.isVerticesDataPresent(U.PositionKind)&&(_.positions=c.getVerticesData(U.PositionKind,h,f)),c.isVerticesDataPresent(U.NormalKind)&&(_.normals=c.getVerticesData(U.NormalKind,h,f)),c.isVerticesDataPresent(U.TangentKind)&&(_.tangents=c.getVerticesData(U.TangentKind,h,f)),c.isVerticesDataPresent(U.UVKind)&&(_.uvs=c.getVerticesData(U.UVKind,h,f)),c.isVerticesDataPresent(U.UV2Kind)&&(_.uvs2=c.getVerticesData(U.UV2Kind,h,f)),c.isVerticesDataPresent(U.UV3Kind)&&(_.uvs3=c.getVerticesData(U.UV3Kind,h,f)),c.isVerticesDataPresent(U.UV4Kind)&&(_.uvs4=c.getVerticesData(U.UV4Kind,h,f)),c.isVerticesDataPresent(U.UV5Kind)&&(_.uvs5=c.getVerticesData(U.UV5Kind,h,f)),c.isVerticesDataPresent(U.UV6Kind)&&(_.uvs6=c.getVerticesData(U.UV6Kind,h,f)),c.isVerticesDataPresent(U.ColorKind)){const d=c.geometry||c,g=d.getVertexBuffer(U.ColorKind),p=d.getVerticesData(U.ColorKind,h,f);if(g.getSize()===3){const b=new Float32Array(p.length*4/3);for(let x=0,E=0;x<p.length;x+=3,E+=4)b[E]=p[x],b[E+1]=p[x+1],b[E+2]=p[x+2],b[E+3]=1;_.colors=b}else if(g.getSize()===4)_.colors=p;else throw new Error(`Unexpected number of color components: ${g.getSize()}`)}return c.isVerticesDataPresent(U.MatricesIndicesKind)&&(_.matricesIndices=c.getVerticesData(U.MatricesIndicesKind,h,f)),c.isVerticesDataPresent(U.MatricesWeightsKind)&&(_.matricesWeights=c.getVerticesData(U.MatricesWeightsKind,h,f)),c.isVerticesDataPresent(U.MatricesIndicesExtraKind)&&(_.matricesIndicesExtra=c.getVerticesData(U.MatricesIndicesExtraKind,h,f)),c.isVerticesDataPresent(U.MatricesWeightsExtraKind)&&(_.matricesWeightsExtra=c.getVerticesData(U.MatricesWeightsExtraKind,h,f)),_.indices=c.getIndices(h,f),_}static CreateRibbon(c){throw at("ribbonBuilder")}static CreateBox(c){throw at("boxBuilder")}static CreateTiledBox(c){throw at("tiledBoxBuilder")}static CreateTiledPlane(c){throw at("tiledPlaneBuilder")}static CreateSphere(c){throw at("sphereBuilder")}static CreateCylinder(c){throw at("cylinderBuilder")}static CreateTorus(c){throw at("torusBuilder")}static CreateLineSystem(c){throw at("linesBuilder")}static CreateDashedLines(c){throw at("linesBuilder")}static CreateGround(c){throw at("groundBuilder")}static CreateTiledGround(c){throw at("groundBuilder")}static CreateGroundFromHeightMap(c){throw at("groundBuilder")}static CreatePlane(c){throw at("planeBuilder")}static CreateDisc(c){throw at("discBuilder")}static CreatePolygon(c,h,f,_,d,g,p){throw at("polygonBuilder")}static CreateIcoSphere(c){throw at("icoSphereBuilder")}static CreatePolyhedron(c){throw at("polyhedronBuilder")}static CreateCapsule(c={orientation:I.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){throw at("capsuleBuilder")}static CreateTorusKnot(c){throw at("torusKnotBuilder")}static ComputeNormals(c,h,f,_){let d,g,p,b,x,E,v,S,R,P,M,O,D,w,G,H,ie,ne,ce,k,te=!1,X=!1,q=!1,W=!1,K=1,Z=0,F=null;_&&(te=!!_.facetNormals,X=!!_.facetPositions,q=!!_.facetPartitioning,K=_.useRightHandedSystem===!0?-1:1,Z=_.ratio||0,W=!!_.depthSort,F=_.distanceTo,W&&F===void 0&&(F=I.Zero()));let A=0,N=0,Y=0,se=0;for(q&&_&&_.bbSize&&(A=_.subDiv.X*Z/_.bbSize.x,N=_.subDiv.Y*Z/_.bbSize.y,Y=_.subDiv.Z*Z/_.bbSize.z,se=_.subDiv.max*_.subDiv.max,_.facetPartitioning.length=0),d=0;d<c.length;d++)f[d]=0;const ue=h.length/3|0;for(d=0;d<ue;d++){if(O=h[d*3]*3,D=O+1,w=O+2,G=h[d*3+1]*3,H=G+1,ie=G+2,ne=h[d*3+2]*3,ce=ne+1,k=ne+2,g=c[O]-c[G],p=c[D]-c[H],b=c[w]-c[ie],x=c[ne]-c[G],E=c[ce]-c[H],v=c[k]-c[ie],S=K*(p*v-b*E),R=K*(b*x-g*v),P=K*(g*E-p*x),M=Math.sqrt(S*S+R*R+P*P),M=M===0?1:M,S/=M,R/=M,P/=M,te&&_&&(_.facetNormals[d].x=S,_.facetNormals[d].y=R,_.facetNormals[d].z=P),X&&_&&(_.facetPositions[d].x=(c[O]+c[G]+c[ne])/3,_.facetPositions[d].y=(c[D]+c[H]+c[ce])/3,_.facetPositions[d].z=(c[w]+c[ie]+c[k])/3),q&&_){const pe=Math.floor((_.facetPositions[d].x-_.bInfo.minimum.x*Z)*A),Ie=Math.floor((_.facetPositions[d].y-_.bInfo.minimum.y*Z)*N),Le=Math.floor((_.facetPositions[d].z-_.bInfo.minimum.z*Z)*Y),J=Math.floor((c[O]-_.bInfo.minimum.x*Z)*A),_e=Math.floor((c[D]-_.bInfo.minimum.y*Z)*N),ye=Math.floor((c[w]-_.bInfo.minimum.z*Z)*Y),Ne=Math.floor((c[G]-_.bInfo.minimum.x*Z)*A),Je=Math.floor((c[H]-_.bInfo.minimum.y*Z)*N),je=Math.floor((c[ie]-_.bInfo.minimum.z*Z)*Y),yt=Math.floor((c[ne]-_.bInfo.minimum.x*Z)*A),Yt=Math.floor((c[ce]-_.bInfo.minimum.y*Z)*N),kt=Math.floor((c[k]-_.bInfo.minimum.z*Z)*Y),Et=J+_.subDiv.max*_e+se*ye,Gt=Ne+_.subDiv.max*Je+se*je,zt=yt+_.subDiv.max*Yt+se*kt,nt=pe+_.subDiv.max*Ie+se*Le;_.facetPartitioning[nt]=_.facetPartitioning[nt]?_.facetPartitioning[nt]:[],_.facetPartitioning[Et]=_.facetPartitioning[Et]?_.facetPartitioning[Et]:[],_.facetPartitioning[Gt]=_.facetPartitioning[Gt]?_.facetPartitioning[Gt]:[],_.facetPartitioning[zt]=_.facetPartitioning[zt]?_.facetPartitioning[zt]:[],_.facetPartitioning[Et].push(d),Gt!=Et&&_.facetPartitioning[Gt].push(d),zt==Gt||zt==Et||_.facetPartitioning[zt].push(d),nt==Et||nt==Gt||nt==zt||_.facetPartitioning[nt].push(d)}if(W&&_&&_.facetPositions){const pe=_.depthSortedFacets[d];pe.ind=d*3,pe.sqDistance=I.DistanceSquared(_.facetPositions[d],F)}f[O]+=S,f[D]+=R,f[w]+=P,f[G]+=S,f[H]+=R,f[ie]+=P,f[ne]+=S,f[ce]+=R,f[k]+=P}for(d=0;d<f.length/3;d++)S=f[d*3],R=f[d*3+1],P=f[d*3+2],M=Math.sqrt(S*S+R*R+P*P),M=M===0?1:M,S/=M,R/=M,P/=M,f[d*3]=S,f[d*3+1]=R,f[d*3+2]=P}static _ComputeSides(c,h,f,_,d,g,p){const b=f.length,x=_.length;let E,v;switch(c=c||r.DEFAULTSIDE,c){case r.FRONTSIDE:break;case r.BACKSIDE:for(E=0;E<b;E+=3){const S=f[E];f[E]=f[E+2],f[E+2]=S}for(v=0;v<x;v++)_[v]=-_[v];break;case r.DOUBLESIDE:{const S=h.length,R=S/3;for(let O=0;O<S;O++)h[S+O]=h[O];for(E=0;E<b;E+=3)f[E+b]=f[E+2]+R,f[E+1+b]=f[E+1]+R,f[E+2+b]=f[E]+R;for(v=0;v<x;v++)_[x+v]=-_[v];const P=d.length;let M;for(M=0;M<P;M++)d[M+P]=d[M];for(g=g||new dt(0,0,1,1),p=p||new dt(0,0,1,1),M=0,E=0;E<P/2;E++)d[M]=g.x+(g.z-g.x)*d[M],d[M+1]=g.y+(g.w-g.y)*d[M+1],d[M+P]=p.x+(p.z-p.x)*d[M+P],d[M+P+1]=p.y+(p.w-p.y)*d[M+P+1],M+=2;break}}}static Parse(c){const h=new r,f=c.positions;f&&h.set(f,U.PositionKind);const _=c.normals;_&&h.set(_,U.NormalKind);const d=c.tangents;d&&h.set(d,U.TangentKind);const g=c.uvs;g&&h.set(g,U.UVKind);const p=c.uvs2;p&&h.set(p,U.UV2Kind);const b=c.uvs3;b&&h.set(b,U.UV3Kind);const x=c.uvs4;x&&h.set(x,U.UV4Kind);const E=c.uvs5;E&&h.set(E,U.UV5Kind);const v=c.uvs6;v&&h.set(v,U.UV6Kind);const S=c.colors;S&&(h.set(xt.CheckColors4(S,f.length/3),U.ColorKind),c.hasVertexAlpha!==void 0&&(h.hasVertexAlpha=c.hasVertexAlpha));const R=c.matricesIndices;R&&h.set(R,U.MatricesIndicesKind);const P=c.matricesWeights;P&&h.set(P,U.MatricesWeightsKind);const M=c.indices;M&&(h.indices=M);const O=c.materialInfos;if(O){h.materialInfos=[];for(const D of O){const w=new ym;w.indexCount=D.indexCount,w.indexStart=D.indexStart,w.verticesCount=D.verticesCount,w.verticesStart=D.verticesStart,w.materialIndex=D.materialIndex,h.materialInfos.push(w)}}return h}static ImportVertexData(c,h){const f=r.Parse(c);h.setAllVerticesData(f,c.updatable)}},(()=>{const o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[Ra.filter((...c)=>!Array.isArray(c[0]))],i=[Ra.filter((...c)=>!Array.isArray(c[0]))],s=[Ra.filter((...c)=>!Array.isArray(c[0]))],n=[Ra.filter((...c)=>!Array.isArray(c[0]))],$(r,null,t,{kind:"method",name:"_TransformVector3Coordinates",static:!0,private:!1,access:{has:c=>"_TransformVector3Coordinates"in c,get:c=>c._TransformVector3Coordinates},metadata:o},null,e),$(r,null,i,{kind:"method",name:"_TransformVector3Normals",static:!0,private:!1,access:{has:c=>"_TransformVector3Normals"in c,get:c=>c._TransformVector3Normals},metadata:o},null,e),$(r,null,s,{kind:"method",name:"_TransformVector4Normals",static:!0,private:!1,access:{has:c=>"_TransformVector4Normals"in c,get:c=>c._TransformVector4Normals},metadata:o},null,e),$(r,null,n,{kind:"method",name:"_FlipFaces",static:!0,private:!1,access:{has:c=>"_FlipFaces"in c,get:c=>c._FlipFaces},metadata:o},null,e),o&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),r.FRONTSIDE=(L(r,e),0),r.BACKSIDE=1,r.DOUBLESIDE=2,r.DEFAULTSIDE=0,r._UniqueIdGenerator=0,r})();class Ds{static get ForceFullSceneLoadingForIncremental(){return Ds._ForceFullSceneLoadingForIncremental}static set ForceFullSceneLoadingForIncremental(e){Ds._ForceFullSceneLoadingForIncremental=e}static get ShowLoadingScreen(){return Ds._ShowLoadingScreen}static set ShowLoadingScreen(e){Ds._ShowLoadingScreen=e}static get loggingLevel(){return Ds._LoggingLevel}static set loggingLevel(e){Ds._LoggingLevel=e}static get CleanBoneMatrixWeights(){return Ds._CleanBoneMatrixWeights}static set CleanBoneMatrixWeights(e){Ds._CleanBoneMatrixWeights=e}}Ds._ForceFullSceneLoadingForIncremental=!1;Ds._ShowLoadingScreen=!0;Ds._CleanBoneMatrixWeights=!1;Ds._LoggingLevel=0;class Es{get boundingBias(){return this._boundingBias}set boundingBias(e){this._boundingBias?this._boundingBias.copyFrom(e):this._boundingBias=e.clone(),this._updateBoundingInfo(!0,null)}static CreateGeometryForMesh(e){const t=new Es(Es.RandomId(),e.getScene());return t.applyToMesh(e),t}get meshes(){return this._meshes}constructor(e,t,i,s=!1,n=null,o=null){this.delayLoadState=0,this._totalVertices=0,this._isDisposed=!1,this._extend={minimum:new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),maximum:new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},this._indexBufferIsUpdatable=!1,this._positionsCache=[],this._parentContainer=null,this.useBoundingInfoFromGeometry=!1,this._scene=t||vt.LastCreatedScene,this._scene&&(this.id=e,this.uniqueId=this._scene.getUniqueId(),this._engine=this._scene.getEngine(),this._meshes=[],this._vertexBuffers={},this._indices=[],this._updatable=s,o!==null&&(this._totalVertices=o),i?this.setAllVerticesData(i,s):o===null&&(this._totalVertices=0),this._engine.getCaps().vertexArrayObject&&(this._vertexArrayObjects={}),n&&(this.applyToMesh(n),n.computeWorldMatrix(!0)))}get extend(){return this._extend}getScene(){return this._scene}getEngine(){return this._engine}isReady(){return this.delayLoadState===1||this.delayLoadState===0}get doNotSerialize(){for(let e=0;e<this._meshes.length;e++)if(!this._meshes[e].doNotSerialize)return!1;return!0}_rebuild(){this._vertexArrayObjects&&(this._vertexArrayObjects={}),this._meshes.length!==0&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer"));const e=new Set;for(const t in this._vertexBuffers)e.add(this._vertexBuffers[t].getWrapperBuffer());e.forEach(t=>{t._rebuild()})}setAllVerticesData(e,t){e.applyToGeometry(this,t),this._notifyUpdate()}setVerticesData(e,t,i=!1,s){i&&Array.isArray(t)&&(t=new Float32Array(t));const n=new U(this._engine,t,e,{updatable:i,postponeInternalCreation:this._meshes.length===0,stride:s,label:"Geometry_"+this.id+"_"+e});this.setVerticesBuffer(n)}removeVerticesData(e){this._vertexBuffers[e]&&(this._vertexBuffers[e].dispose(),delete this._vertexBuffers[e]),this._vertexArrayObjects&&this._disposeVertexArrayObjects()}setVerticesBuffer(e,t=null,i=!0){const s=e.getKind();this._vertexBuffers[s]&&i&&this._vertexBuffers[s].dispose(),e._buffer&&e._ownsBuffer&&e._buffer._increaseReferences(),this._vertexBuffers[s]=e;const n=this._meshes,o=n.length;if(s===U.PositionKind){this._totalVertices=t??e._maxVerticesCount,this._updateExtend(this.useBoundingInfoFromGeometry&&this._boundingInfo?null:e.getFloatData(this._totalVertices)),this._resetPointsArrayCache();const c=this._extend&&this._extend.minimum||new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=this._extend&&this._extend.maximum||new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let f=0;f<o;f++){const _=n[f];_.buildBoundingInfo(c,h),_._createGlobalSubMesh(_.isUnIndexed),_.computeWorldMatrix(!0),_.synchronizeInstances()}}this._notifyUpdate(s)}updateVerticesDataDirectly(e,t,i,s=!1){const n=this.getVertexBuffer(e);n&&(n.updateDirectly(t,i,s),this._notifyUpdate(e))}updateVerticesData(e,t,i=!1){const s=this.getVertexBuffer(e);s&&(s.update(t),e===U.PositionKind&&this._updateBoundingInfo(i,t),this._notifyUpdate(e))}_updateBoundingInfo(e,t){if(e&&this._updateExtend(t),this._resetPointsArrayCache(),e){const i=this._meshes;for(const s of i){s.hasBoundingInfo?s.getBoundingInfo().reConstruct(this._extend.minimum,this._extend.maximum):s.buildBoundingInfo(this._extend.minimum,this._extend.maximum);const n=s.subMeshes;for(const o of n)o.refreshBoundingInfo()}}}_bind(e,t,i,s){if(!e)return;t===void 0&&(t=this._indexBuffer);const n=this.getVertexBuffers();if(!n)return;if(t!=this._indexBuffer||!this._vertexArrayObjects&&!s){this._engine.bindBuffers(n,t,e,i);return}const o=s||this._vertexArrayObjects,c=this._engine;o[e.key]||(o[e.key]=c.recordVertexArrayObject(n,t,e,i)),c.bindVertexArrayObject(o[e.key],t)}getTotalVertices(){return this.isReady()?this._totalVertices:0}getVerticesData(e,t,i){const s=this.getVertexBuffer(e);return s?s.getFloatData(this._totalVertices,i||t&&this._meshes.length!==1):null}copyVerticesData(e,t){const i=this.getVertexBuffer(e);if(!i)return;t[e]||(t[e]=new Float32Array(this._totalVertices*i.getSize()));const s=i.getData();s&&pO(s,i.getSize(),i.type,i.byteOffset,i.byteStride,i.normalized,this._totalVertices,t[e])}isVertexBufferUpdatable(e){const t=this._vertexBuffers[e];return t?t.isUpdatable():!1}getVertexBuffer(e){return this.isReady()?this._vertexBuffers[e]:null}getVertexBuffers(){return this.isReady()?this._vertexBuffers:null}isVerticesDataPresent(e){return this._vertexBuffers?this._vertexBuffers[e]!==void 0:this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1}getVerticesDataKinds(){const e=[];let t;if(!this._vertexBuffers&&this._delayInfo)for(t in this._delayInfo)e.push(t);else for(t in this._vertexBuffers)e.push(t);return e}updateIndices(e,t,i=!1){if(this._indexBuffer)if(!this._indexBufferIsUpdatable)this.setIndices(e,null,!0);else{const s=e.length!==this._indices.length;if(i||(this._indices=e.slice()),this._engine.updateDynamicIndexBuffer(this._indexBuffer,e,t),s)for(const n of this._meshes)n._createGlobalSubMesh(!0)}}setIndexBuffer(e,t,i,s=null){this._indices=[],this._indexBufferIsUpdatable=!1,this._indexBuffer=e,this._totalVertices=t,this._totalIndices=i,s===null?e.is32Bits=t>65535:e.is32Bits=s;for(const n of this._meshes)n._createGlobalSubMesh(!0),n.synchronizeInstances();this._notifyUpdate()}setIndices(e,t=null,i=!1,s=!1){this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indices=e,this._indexBufferIsUpdatable=i,this._meshes.length!==0&&this._indices&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,i,"Geometry_"+this.id+"_IndexBuffer")),t!=null&&(this._totalVertices=t);for(const n of this._meshes)n._createGlobalSubMesh(!s),n.synchronizeInstances();this._notifyUpdate()}getTotalIndices(){return this.isReady()?this._totalIndices!==void 0?this._totalIndices:this._indices.length:0}getIndices(e,t){if(!this.isReady())return null;const i=this._indices;return!t&&(!e||this._meshes.length===1)?i:i.slice()}getIndexBuffer(){return this.isReady()?this._indexBuffer:null}_releaseVertexArrayObject(e=null){!e||!this._vertexArrayObjects||this._vertexArrayObjects[e.key]&&(this._engine.releaseVertexArrayObject(this._vertexArrayObjects[e.key]),delete this._vertexArrayObjects[e.key])}releaseForMesh(e,t){const i=this._meshes,s=i.indexOf(e);s!==-1&&(i.splice(s,1),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject(),e._geometry=null,i.length===0&&t&&this.dispose())}applyToMesh(e){if(e._geometry===this)return;const t=e._geometry;t&&t.releaseForMesh(e),this._vertexArrayObjects&&e._invalidateInstanceVertexArrayObject();const i=this._meshes;e._geometry=this,e._internalAbstractMeshDataInfo._positions=null,this._scene.pushGeometry(this),i.push(e),this.isReady()?this._applyToMesh(e):this._boundingInfo&&e.setBoundingInfo(this._boundingInfo)}_updateExtend(e=null){if(this.useBoundingInfoFromGeometry&&this._boundingInfo)this._extend={minimum:this._boundingInfo.minimum.clone(),maximum:this._boundingInfo.maximum.clone()};else{if(!e&&(e=this.getVerticesData(U.PositionKind),!e))return;this._extend=gA(e,0,this._totalVertices,this.boundingBias,3)}}_applyToMesh(e){for(const t in this._vertexBuffers){const i=this._vertexBuffers[t];i._buffer.getBuffer()||i.create(),t===U.PositionKind&&(this._extend||this._updateExtend(),e.buildBoundingInfo(this._extend.minimum,this._extend.maximum),e._createGlobalSubMesh(e.isUnIndexed),e._updateBoundingInfo())}!this._indexBuffer&&this._indices&&this._indices.length>0&&(this._indexBuffer=this._engine.createIndexBuffer(this._indices,this._updatable,"Geometry_"+this.id+"_IndexBuffer")),e._syncGeometryWithMorphTargetManager(),e.synchronizeInstances()}_notifyUpdate(e){this.onGeometryUpdated&&this.onGeometryUpdated(this,e),this._vertexArrayObjects&&this._disposeVertexArrayObjects();for(const t of this._meshes)t._markSubMeshesAsAttributesDirty()}load(e,t){if(this.delayLoadState!==2){if(this.isReady()){t&&t();return}this.delayLoadState=2,this._queueLoad(e,t)}}_queueLoad(e,t){this.delayLoadingFile&&(e.addPendingData(this),(async()=>{try{const i=await e._loadDelayedFileAsync(this.delayLoadingFile,!1,!0);if(!this._delayLoadingFunction){e.removePendingData(this);return}this._delayLoadingFunction(JSON.parse(i),this),this.delayLoadState=1,this._delayInfo=[],e.removePendingData(this);const s=this._meshes,n=s.length;for(let o=0;o<n;o++)this._applyToMesh(s[o]);t&&t()}catch(i){e.removePendingData(this),e.isDisposed||Ee.Error(`Unable to delay load geometry "${this.id}" from "${this.delayLoadingFile}": ${i}`)}})())}toLeftHanded(){const e=this.getIndices(!1);if(e!=null&&e.length>0){for(let s=0;s<e.length;s+=3){const n=e[s+0];e[s+0]=e[s+2],e[s+2]=n}this.setIndices(e)}const t=this.getVerticesData(U.PositionKind,!1);if(t!=null&&t.length>0){for(let s=0;s<t.length;s+=3)t[s+2]=-t[s+2];this.setVerticesData(U.PositionKind,t,!1)}const i=this.getVerticesData(U.NormalKind,!1);if(i!=null&&i.length>0){for(let s=0;s<i.length;s+=3)i[s+2]=-i[s+2];this.setVerticesData(U.NormalKind,i,!1)}}_resetPointsArrayCache(){this._positions=null}_generatePointsArray(){if(this._positions)return!0;const e=this.getVerticesData(U.PositionKind);if(!e||e.length===0)return!1;for(let t=this._positionsCache.length*3,i=this._positionsCache.length;t<e.length;t+=3,++i)this._positionsCache[i]=I.FromArray(e,t);for(let t=0,i=0;t<e.length;t+=3,++i)this._positionsCache[i].set(e[0+t],e[1+t],e[2+t]);return this._positionsCache.length=e.length/3,this._positions=this._positionsCache,!0}isDisposed(){return this._isDisposed}_disposeVertexArrayObjects(){if(this._vertexArrayObjects){for(const i in this._vertexArrayObjects)this._engine.releaseVertexArrayObject(this._vertexArrayObjects[i]);this._vertexArrayObjects={};const e=this._meshes,t=e.length;for(let i=0;i<t;i++)e[i]._invalidateInstanceVertexArrayObject()}}dispose(){const e=this._meshes,t=e.length;let i;for(i=0;i<t;i++)this.releaseForMesh(e[i]);this._meshes.length=0,this._disposeVertexArrayObjects();for(const s in this._vertexBuffers)this._vertexBuffers[s].dispose();if(this._vertexBuffers={},this._totalVertices=0,this._indexBuffer&&this._engine._releaseBuffer(this._indexBuffer),this._indexBuffer=null,this._indices=[],this.delayLoadState=0,this.delayLoadingFile=null,this._delayLoadingFunction=null,this._delayInfo=[],this._boundingInfo=null,this._scene.removeGeometry(this),this._parentContainer){const s=this._parentContainer.geometries.indexOf(this);s>-1&&this._parentContainer.geometries.splice(s,1),this._parentContainer=null}this._isDisposed=!0}copy(e){const t=new Es(e,this._scene),i=this.getIndices(void 0,!0);i&&t.setIndices(i);let s=!1,n;for(n in this._vertexBuffers){const o=this.getVertexBuffer(n),c=o.getData();if(!c)continue;const h=o.isUpdatable(),f=o.getSize(),{type:_,byteOffset:d,byteStride:g,normalized:p}=o;s=s||h;let b=this._totalVertices;if(o.getIsInstanced()){let v;c instanceof Array?v=c.length*4:v=c.byteLength,b=v/g}const x=gO(c,f,_,d,g,b,!0),E=new U(this._engine,x,n,{updatable:h,useBytes:!1,stride:f,size:f,offset:0,type:_,normalized:p,takeBufferOwnership:!0,instanced:o.getIsInstanced()});t.setVerticesBuffer(E,b)}t._updatable=s,t.delayLoadState=this.delayLoadState,t.delayLoadingFile=this.delayLoadingFile,t._delayLoadingFunction=this._delayLoadingFunction;for(n in this._delayInfo)t._delayInfo=t._delayInfo||[],t._delayInfo.push(n);return t._boundingInfo=new en(this._extend.minimum,this._extend.maximum),t}serialize(){const e={};return e.id=this.id,e.uniqueId=this.uniqueId,e.updatable=this._updatable,Ut&&Ut.HasTags(this)&&(e.tags=Ut.GetTags(this)),e}_toNumberArray(e){return Array.isArray(e)?e:Array.prototype.slice.call(e)}clearCachedData(){this._totalIndices=this._indices.length,this._indices=[],this._resetPointsArrayCache();for(const e in this._vertexBuffers)Object.prototype.hasOwnProperty.call(this._vertexBuffers,e)&&(this._vertexBuffers[e]._buffer._data=null)}serializeVerticeData(){const e=this.serialize();return this.isVerticesDataPresent(U.PositionKind)&&(e.positions=this._toNumberArray(this.getVerticesData(U.PositionKind)),this.isVertexBufferUpdatable(U.PositionKind)&&(e.positionsUpdatable=!0)),this.isVerticesDataPresent(U.NormalKind)&&(e.normals=this._toNumberArray(this.getVerticesData(U.NormalKind)),this.isVertexBufferUpdatable(U.NormalKind)&&(e.normalsUpdatable=!0)),this.isVerticesDataPresent(U.TangentKind)&&(e.tangents=this._toNumberArray(this.getVerticesData(U.TangentKind)),this.isVertexBufferUpdatable(U.TangentKind)&&(e.tangentsUpdatable=!0)),this.isVerticesDataPresent(U.UVKind)&&(e.uvs=this._toNumberArray(this.getVerticesData(U.UVKind)),this.isVertexBufferUpdatable(U.UVKind)&&(e.uvsUpdatable=!0)),this.isVerticesDataPresent(U.UV2Kind)&&(e.uvs2=this._toNumberArray(this.getVerticesData(U.UV2Kind)),this.isVertexBufferUpdatable(U.UV2Kind)&&(e.uvs2Updatable=!0)),this.isVerticesDataPresent(U.UV3Kind)&&(e.uvs3=this._toNumberArray(this.getVerticesData(U.UV3Kind)),this.isVertexBufferUpdatable(U.UV3Kind)&&(e.uvs3Updatable=!0)),this.isVerticesDataPresent(U.UV4Kind)&&(e.uvs4=this._toNumberArray(this.getVerticesData(U.UV4Kind)),this.isVertexBufferUpdatable(U.UV4Kind)&&(e.uvs4Updatable=!0)),this.isVerticesDataPresent(U.UV5Kind)&&(e.uvs5=this._toNumberArray(this.getVerticesData(U.UV5Kind)),this.isVertexBufferUpdatable(U.UV5Kind)&&(e.uvs5Updatable=!0)),this.isVerticesDataPresent(U.UV6Kind)&&(e.uvs6=this._toNumberArray(this.getVerticesData(U.UV6Kind)),this.isVertexBufferUpdatable(U.UV6Kind)&&(e.uvs6Up
187datable=!0)),this.isVerticesDataPresent(U.ColorKind)&&(e.colors=this._toNumberArray(this.getVerticesData(U.ColorKind)),this.isVertexBufferUpdatable(U.ColorKind)&&(e.colorsUpdatable=!0)),this.isVerticesDataPresent(U.MatricesIndicesKind)&&(e.matricesIndices=this._toNumberArray(this.getVerticesData(U.MatricesIndicesKind)),e.matricesIndicesExpanded=!0,this.isVertexBufferUpdatable(U.MatricesIndicesKind)&&(e.matricesIndicesUpdatable=!0)),this.isVerticesDataPresent(U.MatricesWeightsKind)&&(e.matricesWeights=this._toNumberArray(this.getVerticesData(U.MatricesWeightsKind)),this.isVertexBufferUpdatable(U.MatricesWeightsKind)&&(e.matricesWeightsUpdatable=!0)),e.indices=this._toNumberArray(this.getIndices()),e}static ExtractFromMesh(e,t){const i=e._geometry;return i?i.copy(t):null}static RandomId(){return Rt.RandomId()}static _GetGeometryByLoadedUniqueId(e,t){for(let i=0;i<t.geometries.length;i++)if(t.geometries[i]._loadedUniqueId===e)return t.geometries[i];return null}static _ImportGeometry(e,t){const i=t.getScene(),s=e.geometryUniqueId,n=e.geometryId;if(s||n){const o=s?this._GetGeometryByLoadedUniqueId(s,i):i.getGeometryById(n);o&&o.applyToMesh(t)}else if(e instanceof ArrayBuffer){const o=t._binaryInfo;if(o.positionsAttrDesc&&o.positionsAttrDesc.count>0){const c=new Float32Array(e,o.positionsAttrDesc.offset,o.positionsAttrDesc.count);t.setVerticesData(U.PositionKind,c,!1)}if(o.normalsAttrDesc&&o.normalsAttrDesc.count>0){const c=new Float32Array(e,o.normalsAttrDesc.offset,o.normalsAttrDesc.count);t.setVerticesData(U.NormalKind,c,!1)}if(o.tangetsAttrDesc&&o.tangetsAttrDesc.count>0){const c=new Float32Array(e,o.tangetsAttrDesc.offset,o.tangetsAttrDesc.count);t.setVerticesData(U.TangentKind,c,!1)}if(o.uvsAttrDesc&&o.uvsAttrDesc.count>0){const c=new Float32Array(e,o.uvsAttrDesc.offset,o.uvsAttrDesc.count);t.setVerticesData(U.UVKind,c,!1)}if(o.uvs2AttrDesc&&o.uvs2AttrDesc.count>0){const c=new Float32Array(e,o.uvs2AttrDesc.offset,o.uvs2AttrDesc.count);t.setVerticesData(U.UV2Kind,c,!1)}if(o.uvs3AttrDesc&&o.uvs3AttrDesc.count>0){const c=new Float32Array(e,o.uvs3AttrDesc.offset,o.uvs3AttrDesc.count);t.setVerticesData(U.UV3Kind,c,!1)}if(o.uvs4AttrDesc&&o.uvs4AttrDesc.count>0){const c=new Float32Array(e,o.uvs4AttrDesc.offset,o.uvs4AttrDesc.count);t.setVerticesData(U.UV4Kind,c,!1)}if(o.uvs5AttrDesc&&o.uvs5AttrDesc.count>0){const c=new Float32Array(e,o.uvs5AttrDesc.offset,o.uvs5AttrDesc.count);t.setVerticesData(U.UV5Kind,c,!1)}if(o.uvs6AttrDesc&&o.uvs6AttrDesc.count>0){const c=new Float32Array(e,o.uvs6AttrDesc.offset,o.uvs6AttrDesc.count);t.setVerticesData(U.UV6Kind,c,!1)}if(o.colorsAttrDesc&&o.colorsAttrDesc.count>0){const c=new Float32Array(e,o.colorsAttrDesc.offset,o.colorsAttrDesc.count);t.setVerticesData(U.ColorKind,c,!1,o.colorsAttrDesc.stride)}if(o.matricesIndicesAttrDesc&&o.matricesIndicesAttrDesc.count>0){const c=new Int32Array(e,o.matricesIndicesAttrDesc.offset,o.matricesIndicesAttrDesc.count),h=[];for(let f=0;f<c.length;f++){const _=c[f];h.push(_&255),h.push((_&65280)>>8),h.push((_&16711680)>>16),h.push(_>>24&255)}t.setVerticesData(U.MatricesIndicesKind,h,!1)}if(o.matricesIndicesExtraAttrDesc&&o.matricesIndicesExtraAttrDesc.count>0){const c=new Int32Array(e,o.matricesIndicesExtraAttrDesc.offset,o.matricesIndicesExtraAttrDesc.count),h=[];for(let f=0;f<c.length;f++){const _=c[f];h.push(_&255),h.push((_&65280)>>8),h.push((_&16711680)>>16),h.push(_>>24&255)}t.setVerticesData(U.MatricesIndicesExtraKind,h,!1)}if(o.matricesWeightsAttrDesc&&o.matricesWeightsAttrDesc.count>0){const c=new Float32Array(e,o.matricesWeightsAttrDesc.offset,o.matricesWeightsAttrDesc.count);t.setVerticesData(U.MatricesWeightsKind,c,!1)}if(o.indicesAttrDesc&&o.indicesAttrDesc.count>0){const c=new Int32Array(e,o.indicesAttrDesc.offset,o.indicesAttrDesc.count);t.setIndices(c,null)}if(o.subMeshesAttrDesc&&o.subMeshesAttrDesc.count>0){const c=new Int32Array(e,o.subMeshesAttrDesc.offset,o.subMeshesAttrDesc.count*5);t.subMeshes=[];for(let h=0;h<o.subMeshesAttrDesc.count;h++){const f=c[h*5+0],_=c[h*5+1],d=c[h*5+2],g=c[h*5+3],p=c[h*5+4];tn.AddToMesh(f,_,d,g,p,t)}}}else if(e.positions&&e.normals&&e.indices){if(t.setVerticesData(U.PositionKind,e.positions,e.positions._updatable||e.positionsUpdatable),t.setVerticesData(U.NormalKind,e.normals,e.normals._updatable||e.normalsUpdatable),e.tangents&&t.setVerticesData(U.TangentKind,e.tangents,e.tangents._updatable||e.tangentsUpdatable),e.uvs&&t.setVerticesData(U.UVKind,e.uvs,e.uvs._updatable||e.uvsUpdatable),e.uvs2&&t.setVerticesData(U.UV2Kind,e.uvs2,e.uvs2._updatable||e.uvs2Updatable),e.uvs3&&t.setVerticesData(U.UV3Kind,e.uvs3,e.uvs3._updatable||e.uvs3Updatable),e.uvs4&&t.setVerticesData(U.UV4Kind,e.uvs4,e.uvs4._updatable||e.uvs4Updatable),e.uvs5&&t.setVerticesData(U.UV5Kind,e.uvs5,e.uvs5._updatable||e.uvs5Updatable),e.uvs6&&t.setVerticesData(U.UV6Kind,e.uvs6,e.uvs6._updatable||e.uvs6Updatable),e.colors&&t.setVerticesData(U.ColorKind,xt.CheckColors4(e.colors,e.positions.length/3),e.colors._updatable),e.matricesIndices)if(!e.matricesIndices._isExpanded&&!e.matricesIndicesExpanded){const o=[];for(let c=0;c<e.matricesIndices.length;c++){const h=e.matricesIndices[c];o.push(h&255),o.push((h&65280)>>8),o.push((h&16711680)>>16),o.push(h>>24&255)}t.setVerticesData(U.MatricesIndicesKind,o,e.matricesIndices._updatable||e.matricesIndicesUpdatable)}else delete e.matricesIndices._isExpanded,delete e.matricesIndicesExpanded,t.setVerticesData(U.MatricesIndicesKind,e.matricesIndices,e.matricesIndices._updatable||e.matricesIndicesUpdatable);if(e.matricesIndicesExtra)if(e.matricesIndicesExtraExpanded||e.matricesIndicesExtra._isExpanded)delete e.matricesIndices._isExpanded,delete e.matricesIndicesExtraExpanded,t.setVerticesData(U.MatricesIndicesExtraKind,e.matricesIndicesExtra,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable);else{const o=[];for(let c=0;c<e.matricesIndicesExtra.length;c++){const h=e.matricesIndicesExtra[c];o.push(h&255),o.push((h&65280)>>8),o.push((h&16711680)>>16),o.push(h>>24&255)}t.setVerticesData(U.MatricesIndicesExtraKind,o,e.matricesIndicesExtra._updatable||e.matricesIndicesExtraUpdatable)}
187e.matricesWeights&&(Es._CleanMatricesWeights(e,t),t.setVerticesData(U.MatricesWeightsKind,e.matricesWeights,e.matricesWeights._updatable)),e.matricesWeightsExtra&&t.setVerticesData(U.MatricesWeightsExtraKind,e.matricesWeightsExtra,e.matricesWeights._updatable),t.setIndices(e.indices,null)}if(e.subMeshes){t.subMeshes=[];for(let o=0;o<e.subMeshes.length;o++){const c=e.subMeshes[o];tn.AddToMesh(c.materialIndex,c.verticesStart,c.verticesCount,c.indexStart,c.indexCount,t)}}t._shouldGenerateFlatShading&&(t.convertToFlatShadedMesh(),t._shouldGenerateFlatShading=!1),t.computeWorldMatrix(!0),i.onMeshImportedObservable.notifyObservers(t)}static _CleanMatricesWeights(e,t){if(!Ds.CleanBoneMatrixWeights)return;let s;if(e.skeletonId>-1){const d=t.getScene().getLastSkeletonById(e.skeletonId);if(!d)return;s=d.bones.length}else return;const n=t.getVerticesData(U.MatricesIndicesKind),o=t.getVerticesData(U.MatricesIndicesExtraKind),c=e.matricesWeights,h=e.matricesWeightsExtra,f=e.numBoneInfluencer,_=c.length;for(let d=0;d<_;d+=4){let g=0,p=-1;for(let b=0;b<4;b++){const x=c[d+b];g+=x,x<.001&&p<0&&(p=b)}if(h)for(let b=0;b<4;b++){const x=h[d+b];g+=x,x<.001&&p<0&&(p=b+4)}if((p<0||p>f-1)&&(p=f-1),g>.001){const b=1/g;for(let x=0;x<4;x++)c[d+x]*=b;if(h)for(let x=0;x<4;x++)h[d+x]*=b}else p>=4?(h[d+p-4]=1-g,o[d+p-4]=s):(c[d+p]=1-g,n[d+p]=s)}t.setVerticesData(U.MatricesIndicesKind,n),e.matricesWeightsExtra&&t.setVerticesData(U.MatricesIndicesExtraKind,o)}static Parse(e,t,i){const s=new Es(e.id,t,void 0,e.updatable);return s._loadedUniqueId=e.uniqueId,Ut&&Ut.AddTagsTo(s,e.tags),e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s._boundingInfo=new en(I.FromArray(e.boundingBoxMinimum),I.FromArray(e.boundingBoxMaximum)),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(U.UVKind),e.hasUVs2&&s._delayInfo.push(U.UV2Kind),e.hasUVs3&&s._delayInfo.push(U.UV3Kind),e.hasUVs4&&s._delayInfo.push(U.UV4Kind),e.hasUVs5&&s._delayInfo.push(U.UV5Kind),e.hasUVs6&&s._delayInfo.push(U.UV6Kind),e.hasColors&&s._delayInfo.push(U.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(U.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(U.MatricesWeightsKind),s._delayLoadingFunction=Ye.ImportVertexData):Ye.ImportVertexData(e,s),t.pushGeometry(s,!0),s}}var Jx,e0,t0,i0;let ms=(()=>{var r;let e=Qn,t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],d,g=[],p=[],b,x=[],E=[],v,S=[],R=[],P,M=[],O=[],D,w=[],G=[],H,ie=[],ne=[];return r=class extends e{get billboardMode(){return this._billboardMode}set billboardMode(k){this._billboardMode!==k&&(this._billboardMode=k,this._cache.useBillboardPosition=(this._billboardMode&r.BILLBOARDMODE_USE_POSITION)!==0)}get infiniteDistance(){return this._infiniteDistance}set infiniteDistance(k){this._infiniteDistance!==k&&(this._infiniteDistance=k)}constructor(k,te=null,X=!0){super(k,te,!1),this._forward=new I(0,0,1),this._up=new I(0,1,0),this._right=new I(1,0,0),this._position=L(this,i,I.Zero()),this._rotation=(L(this,s),L(this,o,I.Zero())),this._rotationQuaternion=(L(this,c),L(this,f,null)),this._scaling=(L(this,_),L(this,g,I.One())),this._transformToBoneReferal=(L(this,p),null),this._isAbsoluteSynced=!1,this._billboardMode=L(this,x,r.BILLBOARDMODE_NONE),this.scalingDeterminant=(L(this,E),L(this,S,1)),this._infiniteDistance=(L(this,R),L(this,M,!1)),this.ignoreNonUniformScaling=(L(this,O),L(this,w,!1)),this.reIntegrateRotationIntoRotationQuaternion=(L(this,G),L(this,ie,!1)),this._poseMatrix=(L(this,ne),null),this._localMatrix=ae.Zero(),this._usePivotMatrix=!1,this._absolutePosition=I.Zero(),this._absoluteScaling=I.Zero(),this._absoluteRotationQuaternion=Ue.Identity(),this._pivotMatrix=ae.Identity(),this._postMultiplyPivotMatrix=!1,this._isWorldMatrixFrozen=!1,this._indexInSceneTransformNodesArray=-1,this.onAfterWorldMatrixUpdateObservable=new Oe,this._nonUniformScaling=!1,X&&this.getScene().addTransformNode(this)}getClassName(){return"TransformNode"}get position(){return this._position}set position(k){this._position=k,this._markAsDirtyInternal()}isUsingPivotMatrix(){return this._usePivotMatrix}isUsingPostMultiplyPivotMatrix(){return this._postMultiplyPivotMatrix}get rotation(){return this._rotation}set rotation(k){this._rotation=k,this._rotationQuaternion=null,this._markAsDirtyInternal()}get scaling(){return this._scaling}set scaling(k){this._scaling=k,this._markAsDirtyInternal()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(k){this._rotationQuaternion=k,k&&this._rotation.setAll(0),this._markAsDirtyInternal()}_markAsDirtyInternal(){this._isDirty||(this._isDirty=!0,this.customMarkAsDirty&&this.customMarkAsDirty())}get forward(){return I.TransformNormalFromFloatsToRef(0,0,this.get
vendor: 9,131 bytes, line 187
187Scene().useRightHandedSystem?-1:1,this.getWorldMatrix(),this._forward),this._forward.normalize()}get up(){return I.TransformNormalFromFloatsToRef(0,1,0,this.getWorldMatrix(),this._up),this._up.normalize()}get right(){return I.TransformNormalFromFloatsToRef(this.getScene().useRightHandedSystem?-1:1,0,0,this.getWorldMatrix(),this._right),this._right.normalize()}updatePoseMatrix(k){return this._poseMatrix?(this._poseMatrix.copyFrom(k),this):(this._poseMatrix=k.clone(),this)}getPoseMatrix(){return this._poseMatrix||(this._poseMatrix=ae.Identity()),this._poseMatrix}_isSynchronized(){const k=this._cache;return!(this._billboardMode!==k.billboardMode||this._billboardMode!==r.BILLBOARDMODE_NONE||k.pivotMatrixUpdated||this._infiniteDistance||this._position._isDirty||this._scaling._isDirty||this._rotationQuaternion&&this._rotationQuaternion._isDirty||this._rotation._isDirty)}_initCache(){super._initCache();const k=this._cache;k.localMatrixUpdated=!1,k.billboardMode=-1,k.infiniteDistance=!1,k.useBillboardPosition=!1}get absolutePosition(){return this.getAbsolutePosition()}get absoluteScaling(){return this._syncAbsoluteScalingAndRotation(),this._absoluteScaling}get absoluteRotationQuaternion(){return this._syncAbsoluteScalingAndRotation(),this._absoluteRotationQuaternion}setPreTransformMatrix(k){return this.setPivotMatrix(k,!1)}setPivotMatrix(k,te=!0){return this._pivotMatrix.copyFrom(k),this._usePivotMatrix=!this._pivotMatrix.isIdentity(),this._cache.pivotMatrixUpdated=!0,this._postMultiplyPivotMatrix=te,this._postMultiplyPivotMatrix&&(this._pivotMatrixInverse?this._pivotMatrix.invertToRef(this._pivotMatrixInverse):this._pivotMatrixInverse=ae.Invert(this._pivotMatrix)),this}getPivotMatrix(){return this._pivotMatrix}instantiateHierarchy(k=null,te,X){const q=this.clone("Clone of "+(this.name||this.id),k||this.parent,!0);q&&X&&X(this,q);for(const W of this.getChildTransformNodes(!0))W.instantiateHierarchy(q,te,X);return q}freezeWorldMatrix(k=null,te=!1){return k?te?(this._rotation.setAll(0),this._rotationQuaternion=this._rotationQuaternion||Ue.Identity(),k.decompose(this._scaling,this._rotationQuaternion,this._position),this.computeWorldMatrix(!0)):(this._worldMatrix=k,this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._afterComputeWorldMatrix()):(this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0)),this._isDirty=!1,this._isWorldMatrixFrozen=!0,this}unfreezeWorldMatrix(){return this._isWorldMatrixFrozen=!1,this.computeWorldMatrix(!0),this}get isWorldMatrixFrozen(){return this._isWorldMatrixFrozen}getAbsolutePosition(){return this.computeWorldMatrix(),this._absolutePosition}setAbsolutePosition(k){if(!k)return this;let te,X,q;if(k.x===void 0){if(arguments.length<3)return this;te=arguments[0],X=arguments[1],q=arguments[2]}else te=k.x,X=k.y,q=k.z;if(this.parent){const W=ge.Matrix[0];this.parent.getWorldMatrix().invertToRef(W),I.TransformCoordinatesFromFloatsToRef(te,X,q,W,this.position)}else this.position.x=te,this.position.y=X,this.position.z=q;return this._absolutePosition.copyFrom(k),this}setPositionWithLocalVector(k){return this.computeWorldMatrix(),this.position=I.TransformNormal(k,this._localMatrix),this}getPositionExpressedInLocalSpace(){this.computeWorldMatrix();const k=ge.Matrix[0];return this._localMatrix.invertToRef(k),I.TransformNormal(this.position,k)}locallyTranslate(k){return this.computeWorldMatrix(!0),this.position=I.TransformCoordinates(k,this._localMatrix),this}lookAt(k,te=0,X=0,q=0,W=0){const K=r._LookAtVectorCache,Z=W===0?this.position:this.getAbsolutePosition();if(k.subtractToRef(Z,K),this.setDirection(K,te,X,q),W===1&&this.parent)if(this.rotationQuaternion){const F=ge.Matrix[0];this.rotationQuaternion.toRotationMatrix(F);const A=ge.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(A),A.invert(),F.multiplyToRef(A,F),this.rotationQuaternion.fromRotationMatrix(F)}else{const F=ge.Quaternion[0];Ue.FromEulerVectorToRef(this.rotation,F);const A=ge.Matrix[0];F.toRotationMatrix(A);const N=ge.Matrix[1];this.parent.getWorldMatrix().getRotationMatrixToRef(N),N.invert(),A.multiplyToRef(N,A),F.fromRotationMatrix(A),F.toEulerAnglesToRef(this.rotation)}return this}getDirection(k){const te=I.Zero();return this.getDirectionToRef(k,te),te}getDirectionToRef(k,te){return I.TransformNormalToRef(k,this.getWorldMatrix(),te),this}setDirection(k,te=0,X=0,q=0){const W=-Math.atan2(k.z,k.x)+Math.PI/2,K=Math.sqrt(k.x*k.x+k.z*k.z),Z=-Math.atan2(k.y,K);return this.rotationQuaternion?Ue.RotationYawPitchRollToRef(W+te,Z+X,q,this.rotationQuaternion):(this.rotation.x=Z+X,this.rotation.y=W+te,this.rotation.z=q),this}setPivotPoint(k,te=0){this.getScene().getRenderId()==0&&this.computeWorldMatrix(!0);const X=this.getWorldMatrix();if(te==1){const q=ge.Matrix[0];X.invertToRef(q),k=I.TransformCoordinates(k,q)}return this.setPivotMatrix(ae.Translation(-k.x,-k.y,-k.z),!0)}getPivotPoint(){const k=I.Zero();return this.getPivotPointToRef(k),k}getPivotPointToRef(k){return k.x=-this._pivotMatrix.m[12],k.y=-this._pivotMatrix.m[13],k.z=-this._pivotMatrix.m[14],this}getAbsolutePivotPoint(){const k=I.Zero();return this.getAbsolutePivotPointToRef(k),k}getAbsolutePivotPointToRef(k){return this.getPivotPointToRef(k),I.TransformCoordinatesToRef(k,this.getWorldMatrix(),k),this}markAsDirty(k){if(this._isDirty)return this;if(this._children)for(const te of this._children)te.markAsDirty(k);return super.markAsDirty(k)}setParent(k,te=!1,X=!1){if(!k&&!this.parent)return this;const q=ge.Quaternion[0],W=ge.Vector3[0],K=ge.Vector3[1],Z=ge.Matrix[1];ae.IdentityToRef(Z);const F=ge.Matrix[0];this.computeWorldMatrix(!0);let A=this.rotationQuaternion;return A||(A=r._TmpRotation,Ue.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,A)),ae.ComposeToRef(this.scaling,A,this.position,F),this.parent&&F.multiplyToRef(this.parent.computeWorldMatrix(!0),F),k&&(k.computeWorldMatrix(!0).invertToRef(Z),F.multiplyToRef(Z,F)),F.decompose(K,q,W,te?this:void 0),this.rotationQuaternion?this.rotationQuaternion.copyFrom(q):q.toEulerAnglesToRef(this.rotation),this.scaling.copyFrom(K),this.position.copyFrom(W),this.parent=k,X&&this.setPivotMatrix(ae.Identity()),this}addChild(k,te=!1){return k.setParent(this,te),this}removeChild(k,te=!1){return k.parent!==this?this:(k.setParent(null,te),this)}get nonUniformScaling(){return this._nonUniformScaling}_updateNonUniformScalingState(k){return this._nonUniformScaling===k?!1:(this._nonUniformScaling=k,!0)}attachToBone(k,te){return this._currentParentWhenAttachingToBone=this.parent,this._transformToBoneReferal=te,this.parent=k,k.getSkeleton().prepare(!0),k.getFinalMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this}detachFromBone(k=!1){return this.parent?(this.parent.getWorldMatrix().determinant()<0&&(this.scalingDeterminant*=-1),this._transformToBoneReferal=null,k?this.parent=this._currentParentWhenAttachingToBone:this.parent=null,this):(k&&(this.parent=this._currentParentWhenAttachingToBone),this)}rotate(k,te,X){k.normalize(),this.rotationQuaternion||(this.rotationQuaternion=this.rotation.toQuaternion(),this.rotation.setAll(0));let q;if(!X||X===0)q=Ue.RotationAxisToRef(k,te,r._RotationAxisCache),this.rotationQuaternion.multiplyToRef(q,this.rotationQuaternion);else{if(this.parent){const W=this.parent.getWorldMatrix(),K=ge.Matrix[0];W.invertToRef(K),k=I.TransformNormal(k,K),W.determinant()<0&&(te*=-1)}q=Ue.RotationAxisToRef(k,te,r._RotationAxisCache),q.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion)}return this}rotateAround(k,te,X){te.normalize(),this.rotationQuaternion||(this.rotationQuaternion=Ue.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z),this.rotation.setAll(0));const q=ge.Vector3[0],W=ge.Vector3[1],K=ge.Vector3[2],Z=ge.Quaternion[0],F=ge.Matrix[0],A=ge.Matrix[1],N=ge.Matrix[2],Y=ge.Matrix[3];return k.subtractToRef(this.position,q),ae.TranslationToRef(q.x,q.y,q.z,F),ae.TranslationToRef(-q.x,-q.y,-q.z,A),ae.RotationAxisToRef(te,X,N),A.multiplyToRef(N,Y),Y.multiplyToRef(F,Y),Y.decompose(W,Z,K),this.position.addInPlace(K),Z.multiplyToRef(this.rotationQuaternion,this.rotationQuaternion),this}translate(k,te,X){const q=k.scale(te);if(!X||X===0){const W=this.getPositionExpressedInLocalSpace().add(q);this.setPositionWithLocalVector(W)}else this.setAbsolutePosition(this.getAbsolutePosition().add(q));return this}addRotation(k,te,X){let q;this.rotationQuaternion?q=this.rotationQuaternion:(q=ge.Quaternion[1],Ue.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,q));const W=ge.Quaternion[0];return Ue.RotationYawPitchRollToRef(te,k,X,W),q.multiplyInPlace(W),this.rotationQuaternion||q.toEulerAnglesToRef(this.rotation),this}_getEffectiveParent(){return this.parent}isWorldMatrixCameraDependent(){return this._infiniteDistance&&!this.parent||this._billboardMode!==r.BILLBOARDMODE_NONE}computeWorldMatrix(k=!1,te=null){if(this._isWorldMatrixFrozen&&!this._isDirty)return this._worldMatrix;const X=this.getScene().getRenderId();if(!this._isDirty&&!k&&(this._currentRenderId===X||this.isSynchronized()))return this._currentRenderId=X,this._worldMatrix;
vendor: 10,814 bytes, line 187
187te=te||this.getScene().activeCamera,this._updateCache();const q=this._cache;q.pivotMatrixUpdated=!1,q.billboardMode=this.billboardMode,q.infiniteDistance=this.infiniteDistance,q.parent=this._parentNode,this._currentRenderId=X,this._childUpdateId+=1,this._isDirty=!1,this._position._isDirty=!1,this._rotation._isDirty=!1,this._scaling._isDirty=!1;const W=this._getEffectiveParent(),K=r._TmpScaling;let Z=this._position;if(this._infiniteDistance&&!this.parent&&te){const N=te.getWorldMatrix().m;Z=r._TmpTranslation,Z.copyFromFloats(this._position.x+N[12],this._position.y+N[13],this._position.z+N[14])}K.copyFromFloats(this._scaling.x*this.scalingDeterminant,this._scaling.y*this.scalingDeterminant,this._scaling.z*this.scalingDeterminant);let F;if(this._rotationQuaternion?(this._rotationQuaternion._isDirty=!1,F=this._rotationQuaternion,this.reIntegrateRotationIntoRotationQuaternion&&this.rotation.lengthSquared()&&(this._rotationQuaternion.multiplyInPlace(Ue.RotationYawPitchRoll(this._rotation.y,this._rotation.x,this._rotation.z)),this._rotation.copyFromFloats(0,0,0))):(F=r._TmpRotation,Ue.RotationYawPitchRollToRef(this._rotation.y,this._rotation.x,this._rotation.z,F)),this._usePivotMatrix){const A=ge.Matrix[1];ae.ScalingToRef(K.x,K.y,K.z,A);const N=ge.Matrix[0];F.toRotationMatrix(N),this._pivotMatrix.multiplyToRef(A,ge.Matrix[4]),ge.Matrix[4].multiplyToRef(N,this._localMatrix),this._postMultiplyPivotMatrix&&this._localMatrix.multiplyToRef(this._pivotMatrixInverse,this._localMatrix),this._localMatrix.addTranslationFromFloats(Z.x,Z.y,Z.z)}else ae.ComposeToRef(K,F,Z,this._localMatrix);if(W&&W.getWorldMatrix){if(k&&W.computeWorldMatrix(k),this.billboardMode){if(this._transformToBoneReferal){const se=this.parent;se.getSkeleton().prepare(),se.getFinalMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),ge.Matrix[7])}else ge.Matrix[7].copyFrom(W.getWorldMatrix());const A=ge.Vector3[5],N=ge.Vector3[6],Y=ge.Quaternion[0];ge.Matrix[7].decompose(N,Y,A),ae.ScalingToRef(N.x,N.y,N.z,ge.Matrix[7]),ge.Matrix[7].setTranslation(A),r.BillboardUseParentOrientation&&(this._position.applyRotationQuaternionToRef(Y,A),this._localMatrix.setTranslation(A)),this._localMatrix.multiplyToRef(ge.Matrix[7],this._worldMatrix)}else if(this._transformToBoneReferal){const A=this.parent;A.getSkeleton().prepare(),this._localMatrix.multiplyToRef(A.getFinalMatrix(),ge.Matrix[6]),ge.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(),this._worldMatrix)}else this._localMatrix.multiplyToRef(W.getWorldMatrix(),this._worldMatrix);this._markSyncedWithParent()}else this._worldMatrix.copyFrom(this._localMatrix);if(te&&this.billboardMode)if(q.useBillboardPosition){const A=ge.Vector3[0];this._worldMatrix.getTranslationToRef(A);const N=te.globalPosition;this._worldMatrix.invertToRef(ge.Matrix[1]);const Y=ge.Vector3[1];I.TransformCoordinatesToRef(N,ge.Matrix[1],Y),Y.normalize();const se=-Math.atan2(Y.z,Y.x)+Math.PI/2,ue=Math.sqrt(Y.x*Y.x+Y.z*Y.z),pe=-Math.atan2(Y.y,ue);if(Ue.RotationYawPitchRollToRef(se,pe,0,ge.Quaternion[0]),(this.billboardMode&r.BILLBOARDMODE_ALL)!==r.BILLBOARDMODE_ALL){const Ie=ge.Vector3[1];ge.Quaternion[0].toEulerAnglesToRef(Ie),(this.billboardMode&r.BILLBOARDMODE_X)!==r.BILLBOARDMODE_X&&(Ie.x=0),(this.billboardMode&r.BILLBOARDMODE_Y)!==r.BILLBOARDMODE_Y&&(Ie.y=0),(this.billboardMode&r.BILLBOARDMODE_Z)!==r.BILLBOARDMODE_Z&&(Ie.z=0),ae.RotationYawPitchRollToRef(Ie.y,Ie.x,Ie.z,ge.Matrix[0])}else ae.FromQuaternionToRef(ge.Quaternion[0],ge.Matrix[0]);this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(ge.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(ge.Vector3[0])}else{const A=ge.Vector3[0];this._worldMatrix.getTranslationToRef(A),ge.Matrix[1].copyFrom(te.getViewMatrix());const N=this.getScene().useRightHandedSystem;if(N&&ge.Matrix[1].multiplyToRef(r._TmpRHRestore,ge.Matrix[1]),ge.Matrix[1].setTranslationFromFloats(0,0,0),ge.Matrix[1].invertToRef(ge.Matrix[0]),(this.billboardMode&r.BILLBOARDMODE_ALL)!==r.BILLBOARDMODE_ALL){ge.Matrix[0].decompose(void 0,ge.Quaternion[0],void 0);const Y=ge.Vector3[1];ge.Quaternion[0].toEulerAnglesToRef(Y),(this.billboardMode&r.BILLBOARDMODE_X)!==r.BILLBOARDMODE_X&&(Y.x=0),(this.billboardMode&r.BILLBOARDMODE_Y)!==r.BILLBOARDMODE_Y&&(Y.y=0),(this.billboardMode&r.BILLBOARDMODE_Z)!==r.BILLBOARDMODE_Z&&(Y.z=0),N&&(Y.y+=Math.PI),ae.RotationYawPitchRollToRef(Y.y,Y.x,Y.z,ge.Matrix[0])}this._worldMatrix.setTranslationFromFloats(0,0,0),this._worldMatrix.multiplyToRef(ge.Matrix[0],this._worldMatrix),this._worldMatrix.setTranslation(ge.Vector3[0])}return this.ignoreNonUniformScaling?this._updateNonUniformScalingState(!1):this._scaling.isNonUniformWithinEpsilon(1e-6)?this._updateNonUniformScalingState(!0):W&&W._nonUniformScaling?this._updateNonUniformScalingState(W._nonUniformScaling):this._updateNonUniformScalingState(!1),this._afterComputeWorldMatrix(),this._absolutePosition.copyFromFloats(this._worldMatrix.m[12],this._worldMatrix.m[13],this._worldMatrix.m[14]),this._isAbsoluteSynced=!1,this.onAfterWorldMatrixUpdateObservable.notifyObservers(this),this._poseMatrix||(this._poseMatrix=ae.Invert(this._worldMatrix)),this._worldMatrixDeterminantIsDirty=!0,this._worldMatrix}resetLocalMatrix(k=!0){if(this.computeWorldMatrix(),k){const te=this.getChildren();for(let X=0;X<te.length;++X){const q=te[X];if(q){q.computeWorldMatrix();const W=ge.Matrix[0];q._localMatrix.multiplyToRef(this._localMatrix,W);const K=ge.Quaternion[0];W.decompose(q.scaling,K,q.position),q.rotationQuaternion?q.rotationQuaternion.copyFrom(K):K.toEulerAnglesToRef(q.rotation)}}}this.scaling.copyFromFloats(1,1,1),this.position.copyFromFloats(0,0,0),this.rotation.copyFromFloats(0,0,0),this.rotationQuaternion&&(this.rotationQuaternion=Ue.Identity()),this._worldMatrix=ae.Identity()}_afterComputeWorldMatrix(){}registerAfterWorldMatrixUpdate(k){return this.onAfterWorldMatrixUpdateObservable.add(k),this}unregisterAfterWorldMatrixUpdate(k){return this.onAfterWorldMatrixUpdateObservable.removeCallback(k),this}getPositionInCameraSpace(k=null){return k||(k=this.getScene().activeCamera),I.TransformCoordinates(this.getAbsolutePosition(),k.getViewMatrix())}getDistanceToCamera(k=null){return k||(k=this.getScene().activeCamera),this.getAbsolutePosition().subtract(k.globalPosition).length()}clone(k,te,X){const q=Tt.Clone(()=>new r(k,this.getScene()),this);if(q.name=k,q.id=k,te&&(q.parent=te),!X){const W=this.getDescendants(!0);for(let K=0;K<W.length;K++){const Z=W[K];Z.clone&&Z.clone(k+"."+Z.name,q)}}return q}serialize(k){const te=Tt.Serialize(this,k);return te.type=this.getClassName(),te.uniqueId=this.uniqueId,this.parent&&this.parent._serializeAsParent(te),te.localMatrix=this.getPivotMatrix().asArray(),te.isEnabled=this.isEnabled(),this._isWorldMatrixFrozen&&(te.freezeWorldMatrix=!0),Tt.AppendSerializedAnimations(this,te),te.ranges=this.serializeAnimationRanges(),te}getChildTransformNodes(k,te){const X=[];return this._getDescendants(X,k,q=>(!te||te(q))&&q instanceof r),X}dispose(k,te=!1){if(this.getScene().stopAnimation(this),this.getScene().removeTransformNode(this),this._parentContainer){const X=this._parentContainer.transformNodes.indexOf(this);X>-1&&this._parentContainer.transformNodes.splice(X,1),this._parentContainer=null}if(this.onAfterWorldMatrixUpdateObservable.clear(),k){const X=this.getChildTransformNodes(!0);for(const q of X)q.parent=null,q.computeWorldMatrix(!0)}super.dispose(k,te)}normalizeToUnitCube(k=!0,te=!1,X){let q=null,W=null;te&&(this.rotationQuaternion?(W=this.rotationQuaternion.clone(),this.rotationQuaternion.copyFromFloats(0,0,0,1)):this.rotation&&(q=this.rotation.clone(),this.rotation.copyFromFloats(0,0,0)));const K=this.getHierarchyBoundingVectors(k,X),Z=K.max.subtract(K.min),F=Math.max(Z.x,Z.y,Z.z);if(F===0)return this;const A=1/F;return this.scaling.scaleInPlace(A),te&&(this.rotationQuaternion&&W?this.rotationQuaternion.copyFrom(W):this.rotation&&q&&this.rotation.copyFrom(q)),this}_syncAbsoluteScalingAndRotation(){this._isAbsoluteSynced||(this._worldMatrix.decompose(this._absoluteScaling,this._absoluteRotationQuaternion),this._isAbsoluteSynced=!0)}},(()=>{const ce=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[Ur("position")],n=[Ur("rotation")],h=[$P("rotationQuaternion")],d=[Ur("scaling")],b=[he("billboardMode")],v=[he()],P=[he("infiniteDistance")],D=[he()],H=[he()],$(null,null,t,{kind:"field",name:"_position",static:!1,private:!1,access:{has:k=>"_position"in k,get:k=>k._position,set:(k,te)=>{k._position=te}},metadata:ce},i,s),$(null,null,n,{kind:"field",name:"_rotation",static:!1,private:!1,access:{has:k=>"_rotation"in k,get:k=>k._rotation,set:(k,te)=>{k._rotation=te}},metadata:ce},o,c),$(null,null,h,{kind:"field",name:"_rotationQuaternion",static:!1,private:!1,access:{has:k=>"_rotationQuaternion"in k,get:k=>k._rotationQuaternion,set:(k,te)=>{k._rotationQuaternion=te}},metadata:ce},f,_),$(null,null,d,{kind:"field",name:"_scaling",static:!1,private:!1,access:{has:k=>"_scaling"in k,get:k=>k._scaling,set:(k,te)=>{k._scaling=te}},metadata:ce},g,p),$(null,null,b,{kind:"field",name:"_billboardMode",static:!1,private:!1,access:{has:k=>"_billboardMode"in k,get:k=>k._billboardMode,set:(k,te)=>{k._billboardMode=te}},metadata:ce},x,E),$(null,null,v,{kind:"field",name:"scalingDeterminant",static:!1,private:!1,access:{has:k=>"scalingDeterminant"in k,get:k=>k.scalingDeterminant,set:(k,te)=>{k.scalingDeterminant=te}},metadata:ce},S,R),$(null,null,P,{kind:"field",name:"_infiniteDistance",static:!1,private:!1,access:{has:k=>"_infiniteDistance"in k,get:k=>k._infiniteDistance,set:(k,te)=>{k._infiniteDistance=te}},metadata:ce},M,O),$(null,null,D,{kind:"field",name:"ignoreNonUniformScaling",static:!1,private:!1,access:{has:k=>"ignoreNonUniformScaling"in k,get:k=>k.ignoreNonUniformScaling,set:(k,te)=>{k.ignoreNonUniformScaling=te}},metadata:ce},w,G),$(null,null,H,{kind:"field",name:"reIntegrateRotationIntoRotationQuaternion",static:!1,private:!1,access:{has:k=>"reIntegrateRotationIntoRotationQuaternion"in k,get:k=>k.reIntegrateRotationIntoRotationQuaternion,set:(k,te)=>{k.reIntegrateRotationIntoRotationQuaternion=te}},metadata:ce},ie,ne),ce&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ce})})(),r.BILLBOARDMODE_NONE=0,r.BILLBOARDMODE_X=1,r.BILLBOARDMODE_Y=2,r.BILLBOARDMODE_Z=4,r.BILLBOARDMODE_ALL=7,r.BILLBOARDMODE_USE_POSITION=128,r.BillboardUseParentOrientation=!1,r._TmpRotation=Ue.Zero(),r._TmpScaling=I.Zero(),r._TmpTranslation=I.Zero(),r._TmpRHRestore=ae.Scaling(1,1,-1),r._LookAtVectorCache=new I(0,0,0),r._RotationAxisCache=new Ue,r})();(Jx=ms.prototype).getPhysicsBody??(Jx.getPhysicsBody=Ze("TransformNode","getPhysicsBody"));(e0=ms.prototype).applyImpulse??(e0.applyImpulse=Ze("TransformNode","applyImpulse"));
187(t0=ms.prototype).applyAngularImpulse??(t0.applyAngularImpulse=Ze("TransformNode","applyAngularImpulse"));(i0=ms.prototype).applyTorque??(i0.applyTorque=Ze("TransformNode","applyTorque"));Object.getOwnPropertyDescriptor(ms.prototype,"physicsBody")||Object.defineProperty(ms.prototype,"physicsBody",At("TransformNode","physicsBody"));class uh{constructor(){this.hit=!1,this.distance=0,this.pickedPoint=null,this.pickedMesh=null,this.bu=0,this.bv=0,this.faceId=-1,this.subMeshFaceId=-1,this.subMeshId=0,this.pickedSprite=null,this.thinInstanceIndex=-1,this.ray=null,this.originMesh=null,this.aimTransform=null,this.gripTransform=null}getNormal(e=!1,t=!0){if(!this.pickedMesh||t&&!this.pickedMesh.isVerticesDataPresent(U.NormalKind))return null;let i=this.pickedMesh.getIndices();i?.length===0&&(i=null);let s;const n=ge.Vector3[0],o=ge.Vector3[1],c=ge.Vector3[2];if(t){const f=this.pickedMesh.getVerticesData(U.NormalKind);let _=i?I.FromArrayToRef(f,i[this.faceId*3]*3,n):n.copyFromFloats(f[this.faceId*3*3],f[this.faceId*3*3+1],f[this.faceId*3*3+2]),d=i?I.FromArrayToRef(f,i[this.faceId*3+1]*3,o):o.copyFromFloats(f[(this.faceId*3+1)*3],f[(this.faceId*3+1)*3+1],f[(this.faceId*3+1)*3+2]),g=i?I.FromArrayToRef(f,i[this.faceId*3+2]*3,c):c.copyFromFloats(f[(this.faceId*3+2)*3],f[(this.faceId*3+2)*3+1],f[(this.faceId*3+2)*3+2]);_=_.scale(this.bu),d=d.scale(this.bv),g=g.scale(1-this.bu-this.bv),s=new I(_.x+d.x+g.x,_.y+d.y+g.y,_.z+d.z+g.z)}else{const f=this.pickedMesh.getVerticesData(U.PositionKind),_=i?I.FromArrayToRef(f,i[this.faceId*3]*3,n):n.copyFromFloats(f[this.faceId*3*3],f[this.faceId*3*3+1],f[this.faceId*3*3+2]),d=i?I.FromArrayToRef(f,i[this.faceId*3+1]*3,o):o.copyFromFloats(f[(this.faceId*3+1)*3],f[(this.faceId*3+1)*3+1],f[(this.faceId*3+1)*3+2]),g=i?I.FromArrayToRef(f,i[this.faceId*3+2]*3,c):c.copyFromFloats(f[(this.faceId*3+2)*3],f[(this.faceId*3+2)*3+1],f[(this.faceId*3+2)*3+2]),p=_.subtract(d),b=g.subtract(d);s=I.Cross(p,b)}const h=(f,_)=>{if(this.thinInstanceIndex!==-1){const g=f._thinInstanceDataStorage.matrixData,p=this.thinInstanceIndex<<4;if(g&&g.length>p){const b=ge.Matrix[0];ae.FromArrayToRef(g,p,b),I.TransformNormalToRef(_,b,_)}}let d=f.getWorldMatrix();f.nonUniformScaling&&(ge.Matrix[0].copyFrom(d),d=ge.Matrix[0],d.setTranslationFromFloats(0,0,0),d.invert(),d.transposeToRef(ge.Matrix[1]),d=ge.Matrix[1]),I.TransformNormalToRef(_,d,_)};if(e&&h(this.pickedMesh,s),this.ray){const f=ge.Vector3[0].copyFrom(s);e||h(this.pickedMesh,f),I.Dot(f,this.ray.direction)>0&&s.negateInPlace()}return s.normalize(),s}getTextureCoordinates(e=U.UVKind){if(!this.pickedMesh||!this.pickedMesh.isVerticesDataPresent(e))return null;const t=this.pickedMesh.getIndices();if(!t)return null;const i=this.pickedMesh.getVerticesData(e);if(!i)return null;let s=He.FromArray(i,t[this.faceId*3]*2),n=He.FromArray(i,t[this.faceId*3+1]*2),o=He.FromArray(i,t[this.faceId*3+2]*2);return s=s.scale(this.bu),n=n.scale(this.bv),o=o.scale(1-this.bu-this.bv),new He(s.x+n.x+o.x,s.y+n.y+o.y)}}class Xe{constructor(e,t,i=!1,s,n=!1,o){this._uniformNames=[],this._valueCache={},this._engine=e,this._noUBO=!e.supportsUniformBuffers||n,this._dynamic=i,this._name=s??"no-name",this._data=t||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(o===void 0&&this._engine._features.trackUbosInFrame||o===!0)&&(this._buffers=[],this._bufferIndex=-1,this._bufferUpdatedLastFrame=!1,this._createBufferOnWrite=!1,this._currentFrameId=0,this._trackUBOsInFrame=!0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffe
187ct,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic}getData(){return this._bufferData}getBuffer(){return this._buffer}getUniformNames(){return this._uniformNames}_fillAlignment(e){let t;if(e<=2?t=e:t=4,this._uniformLocationPointer%t!==0){const i=this._uniformLocationPointer;this._uniformLocationPointer+=t-this._uniformLocationPointer%t;const s=this._uniformLocationPointer-i;for(let n=0;n<s;n++)this._data.push(0)}}addUniform(e,t,i=0){if(i>0&&typeof t=="number"&&(this._uniformArraySizes[e]={strideSize:t,arraySize:i}),this._uniformLocations[e]!==void 0||(this._uniformNames.push(e),this._noUBO))return;let s;if(i>0){if(t instanceof Array)throw"addUniform should not be use with Array in UBO: "+e;if(this._fillAlignment(4),t==16)t=t*i;else{const o=(4-t)*i;t=t*i+o}s=[];for(let n=0;n<t;n++)s.push(0)}else{if(t instanceof Array)s=t,t=s.length;else{s=[];for(let n=0;n<t;n++)s.push(0)}this._fillAlignment(t)}this._uniformSizes[e]=t,this._uniformLocations[e]=this._uniformLocationPointer,this._uniformLocationPointer+=t;for(let n=0;n<t;n++)this._data.push(s[n]);this._needSync=!0}addMatrix(e,t){this.addUniform(e,Array.prototype.slice.call(t.asArray()))}addFloat2(e,t,i){const s=[t,i];this.addUniform(e,s)}addFloat3(e,t,i,s){const n=[t,i,s];this.addUniform(e,n)}addColor3(e,t){const i=[t.r,t.g,t.b];this.addUniform(e,i)}addColor4(e,t,i){const s=[t.r,t.g,t.b,i];this.addUniform(e,s)}addVector3(e,t){const i=[t.x,t.y,t.z];this.addUniform(e,i)}addMatrix3x3(e){this.addUniform(e,12)}addMatrix2x2(e){this.addUniform(e,8)}create(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNamesDebug(){const e=[];let t=0;for(const i in this._uniformLocations)if(e.push(i),++t===10)break;return e.join(",")}_rebuild(){this._noUBO||!this._bufferData||(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()):this._buffer=this._engine.createUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()),this._trackUBOsInFrame&&(this._buffers.push([this._buffer,this._engine._features.checkUbosContentBeforeUpload?this._bufferData.slice():void 0]),this._bufferIndex=this._buffers.length-1,this._createBufferOnWrite=!1))}_rebuildAfterContextLost(){this._trackUBOsInFrame&&(this._buffers=[],this._currentFrameId=0),this._rebuild()}get _numBuffers(){return this._buffers.length}get _indexBuffer(){return this._bufferIndex}get name(){return this._name}set name(e){this._name=e}get currentEffect(){return this._currentEffect}_buffersEqual(e,t){for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}_copyBuffer(e,t){for(let i=0;i<e.length;++i)t[i]=e[i]}update(){if(!this._noUBO){if(this.bindUniformBuffer(),!this._buffer){this.create();return}if(!this._dynamic&&!this._needSync){this._createBufferOnWrite=this._trackUBOsInFrame;return}if(this._buffers&&this._buffers.length>1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._bufferUpdatedLastFrame=!0,this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame}}_createNewBuffer(){this._bufferIndex+1<this._buffers.length?(this._bufferIndex++,this._buffer=this._buffers[this._bufferIndex][
vendor: 4,061 bytes, line 187
1870],this._createBufferOnWrite=!1,this._needSync=!0):this._rebuild()}_checkNewFrame(){this._trackUBOsInFrame&&this._currentFrameId!==this._engine.frameId&&(this._currentFrameId=this._engine.frameId,this._createBufferOnWrite=!1,this._buffers&&this._buffers.length>0?(this._buffers.length===1?this._needSync=!this._bufferUpdatedLastFrame:this._needSync=this._bufferIndex!==0,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(e,t,i){this._checkNewFrame();let s=this._uniformLocations[e];if(s===void 0){if(this._buffer){Ee.Error("Cannot add an uniform after UBO has been created. uniformName="+e);return}this.addUniform(e,i),s=this._uniformLocations[e]}if(this._buffer||this.create(),this._dynamic)for(let n=0;n<i;n++)this._bufferData[s+n]=t[n];else{let n=!1;for(let o=0;o<i;o++)(i===16&&!this._engine._features.uniformBufferHardCheckMatrix||this._bufferData[s+o]!==Math.fround(t[o]))&&(n=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+o]=t[o]);this._needSync=this._needSync||n}}updateUniformArray(e,t,i){this._checkNewFrame();const s=this._uniformLocations[e];if(s===void 0){Ee.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");return}this._buffer||this.create();const n=this._uniformArraySizes[e];if(this._dynamic)for(let o=0;o<i;o++)this._bufferData[s+o]=t[o];else{let o=!1,c=0,h=0;for(let f=0;f<i;f++)if(this._bufferData[s+h*4+c]!==Rt.FloatRound(t[f])&&(o=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+h*4+c]=t[f]),c++,c===n.strideSize){for(;c<4;c++)this._bufferData[s+h*4+c]=0;c=0,h++}this._needSync=this._needSync||o}}_cacheMatrix(e,t){this._checkNewFrame();const i=this._valueCache[e],s=t.updateFlag;return i!==void 0&&i===s?!1:(this._valueCache[e]=s,!0)}_updateMatrix3x3ForUniform(e,t){for(let i=0;i<3;i++)Xe._TempBuffer[i*4]=t[i*3],Xe._TempBuffer[i*4+1]=t[i*3+1],Xe._TempBuffer[i*4+2]=t[i*3+2],Xe._TempBuffer[i*4+3]=0;this.updateUniform(e,Xe._TempBuffer,12)}_updateMatrix3x3ForEffect(e,t){this._currentEffect.setMatrix3x3(e,t)}_updateMatrix2x2ForEffect(e,t){this._currentEffect.setMatrix2x2(e,t)}_updateMatrix2x2ForUniform(e,t){for(let i=0;i<2;i++)Xe._TempBuffer[i*4]=t[i*2],Xe._TempBuffer[i*4+1]=t[i*2+1],Xe._TempBuffer[i*4+2]=0,Xe._TempBuffer[i*4+3]=0;this.updateUniform(e,Xe._TempBuffer,8)}_updateFloatForEffect(e,t,i=""){this._currentEffect.setFloat(e+i,t)}_updateFloatForUniform(e,t){Xe._TempBuffer[0]=t,this.updateUniform(e,Xe._TempBuffer,1)}_updateFloat2ForEffect(e,t,i,s=""){this._currentEffect.setFloat2(e+s,t,i)}_updateFloat2ForUniform(e,t,i){Xe._TempBuffer[0]=t,Xe._TempBuffer[1]=i,this.updateUniform(e,Xe._TempBuffer,2)}_updateFloat3ForEffect(e,t,i,s,n=""){this._currentEffect.setFloat3(e+n,t,i,s)}_updateFloat3ForUniform(e,t,i,s){Xe._TempBuffer[0]=t,Xe._TempBuffer[1]=i,Xe._TempBuffer[2]=s,this.updateUniform(e,Xe._TempBuffer,3)}_updateFloat4ForEffect(e,t,i,s,n,o=""){this._currentEffect.setFloat4(e+o,t,i,s,n)}_updateFloat4ForUniform(e,t,i,s,n){Xe._TempBuffer[0]=t,Xe._TempBuffer[1]=i,Xe._TempBuffer[2]=s,Xe._TempBuffer[3]=n,this.updateUniform(e,Xe._TempBuffer,4)}_updateFloatArrayForEffect(e,t,i=""){switch(this._uniformArraySizes[e]?.strideSize){case 2:this._currentEffect.setFloatArray2(e+i,t);break;case 3:this._currentEffect.setFloatArray3(e+i,t);break;case 4:this._currentEffect.setFloatArray4(e+i,t);break;default:this._currentEffect.setFloatArray(e+i,t);break}}_updateFloatArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateArrayForEffect(e,t){this._currentEffect.setArray(e,t)}_updateArrayForUniform(e,t){this.updateUniformArray(e,t,t.length)}_updateIntArrayForEffect(e,t){this._currentEffect.setIntArray(e,t)}_updateIntArrayForUniform(e,t){Xe._TempBufferInt32View.set(t),this.updateUniformArray(e,Xe._TempBuffer,t.length)}_updateUIntArrayForEffect(e,t){this._currentEffect.setUIntArray(e,t)}_updateUIntArrayForUniform(e,t){Xe._TempBufferUInt32View.set(t),this.updateUniformArray(e,Xe._TempBuffer,t.length)}
187_updateMatrixForEffect(e,t){this._currentEffect.setMatrix(e,t)}_updateMatrixForUniform(e,t){this._cacheMatrix(e,t)&&this.updateUniform(e,t.asArray(),16)}_updateMatricesForEffect(e,t){this._currentEffect.setMatrices(e,t)}_updateMatricesForUniform(e,t){this.updateUniform(e,t,t.length)}_updateVector3ForEffect(e,t){this._currentEffect.setVector3(e,t)}_updateVector3ForUniform(e,t){Xe._TempBuffer[0]=t.x,Xe._TempBuffer[1]=t.y,Xe._TempBuffer[2]=t.z,this.updateUniform(e,Xe._TempBuffer,3)}_updateVector4ForEffect(e,t){this._currentEffect.setVector4(e,t)}_updateVector4ForUniform(e,t){Xe._TempBuffer[0]=t.x,Xe._TempBuffer[1]=t.y,Xe._TempBuffer[2]=t.z,Xe._TempBuffer[3]=t.w,this.updateUniform(e,Xe._TempBuffer,4)}_updateColor3ForEffect(e,t,i=""){this._currentEffect.setColor3(e+i,t)}_updateColor3ForUniform(e,t){Xe._TempBuffer[0]=t.r,Xe._TempBuffer[1]=t.g,Xe._TempBuffer[2]=t.b,this.updateUniform(e,Xe._TempBuffer,3)}_updateColor4ForEffect(e,t,i,s=""){this._currentEffect.setColor4(e+s,t,i)}_updateDirectColor4ForEffect(e,t,i=""){this._currentEffect.setDirectColor4(e+i,t)}_updateColor4ForUniform(e,t,i){Xe._TempBuffer[0]=t.r,Xe._TempBuffer[1]=t.g,Xe._TempBuffer[2]=t.b,Xe._TempBuffer[3]=i,this.updateUniform(e,Xe._TempBuffer,4)}_updateDirectColor4ForUniform(e,t){Xe._TempBuffer[0]=t.r,Xe._TempBuffer[1]=t.g,Xe._TempBuffer[2]=t.b,Xe._TempBuffer[3]=t.a,this.updateUniform(e,Xe._TempBuffer,4)}_updateIntForEffect(e,t,i=""){this._currentEffect.setInt(e+i,t)}_updateIntForUniform(e,t){Xe._TempBufferInt32View[0]=t,this.updateUniform(e,Xe._TempBuffer,1)}_updateInt2ForEffect(e,t,i,s=""){this._currentEffect.setInt2(e+s,t,i)}_updateInt2ForUniform(e,t,i){Xe._TempBufferInt32View[0]=t,Xe._TempBufferInt32View[1]=i,this.updateUniform(e,Xe._TempBuffer,2)}_updateInt3ForEffect(e,t,i,s,n=""){this._currentEffect.setInt3(e+n,t,i,s)}_updateInt3ForUniform(e,t,i,s){Xe._TempBufferInt32View[0]=t,Xe._TempBufferInt32View[1]=i,Xe._TempBufferInt32View[2]=s,this.updateUniform(e,Xe._TempBuffer,3)}_updateInt4ForEffect(e,t,i,s,n,o=""){this._currentEffect.setInt4(e+o,t,i,s,n)}_updateInt4ForUniform(e,t,i,s,n){Xe._TempBufferInt32View[0]=t,Xe._TempBufferInt32View[1]=i,Xe._TempBufferInt32View[2]=s,Xe._TempBufferInt32View[3]=n,this.updateUniform(e,Xe._TempBuffer,4)}_updateUIntForEffect(e,t,i=""){this._currentEffect.setUInt(e+i,t)}_updateUIntForUniform(e,t){Xe._TempBufferUInt32View[0]=t,this.updateUniform(e,Xe._TempBuffer,1)}_updateUInt2ForEffect(e,t,i,s=""){this._currentEffect.setUInt2(e+s,t,i)}_updateUInt2ForUniform(e,t,i){Xe._TempBufferUInt32View[0]=t,Xe._TempBufferUInt32View[1]=i,this.updateUniform(e,Xe._TempBuffer,2)}_updateUInt3ForEffect(e,t,i,s,n=""){this._currentEffect.setUInt3(e+n,t,i,s)}_updateUInt3ForUniform(e,t,i,s){Xe._TempBufferUInt32View[0]=t,Xe._TempBufferUInt32View[1]=i,Xe._TempBufferUInt32View[2]=s,this.updateUniform(e,Xe._TempBuffer,3)}_updateUInt4ForEffect(e,t,i,s,n,o=""){this._currentEffect.setUInt4(e+o,t,i,s,n)}_updateUInt4ForUniform(e,t,i,s,n){Xe._TempBufferUInt32View[0]=t,Xe._TempBufferUInt32View[1]=i,Xe._TempBufferUInt32View[2]=s,Xe._TempBufferUInt32View[3]=n,this.updateUniform(e,Xe._TempBuffer,4)}setTexture(e,t){this._currentEffect.setTexture(e,t)}setTextureArray(e,t){this._currentEffect.setTextureArray(e,t)}bindTexture(e,t){this._currentEffect._bindTexture(e,t)}updateUniformDirectly(e,t){this.updateUniform(e,t,t.length),this.update()}bindToEffect(e,t){this._currentEffect=e,this._currentEffectName=t}bindUniformBuffer(){!this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(e){if(!this._buffers)return this._buffer===e;for(let t=0;t<this._buffers.length;++t)if(this._buffers[t][0]===e)return this._bufferIndex=t,this._buffer=e,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[t][1]&&this._bufferData.set(this._buffers[t][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0;return!1}has(e){return this._uniformLocations[e]!==void 0}dispose(){if(this._noUBO)return;const e=this._engine._uniformBuffers,t=e.indexOf(this);if(t!==-1&&(e[t]=e[e.length-1],e.pop()),this._trackUBOsInFrame&&this._buffers)for(let i=0;i<this._buffers.length;++i){const s=this._buffers[i][0];this._engine._releaseBuffer(s)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}Xe._MAX_UNIFORM_SIZE=256;Xe._TempBuffer=new Float32Array(Xe._MAX_UNIFORM_SIZE);Xe._TempBufferInt32View=new Int32Array(Xe._TempBuffer.buffer);Xe._TempBufferUInt32View=new Uint32Array(Xe._TempBuffer.buffer);class FO{constructor(){this._checkCollisions=!1,this._collisionMask=-1,this._collisionGroup=-1,this._surroundingMeshes=null,this._collider=null,this._oldPositionForCollisions=new I(0,0,0),this._diffPositionForCollisions=new I(0,0,0),this._collisionResponse=!0}}var s0,n0,r0;function LO(r,e,t){let i;switch(e){case U.PositionKind:i=s=>s.getPositions();break;case U.NormalKind:i=s=>s.getNormals();break;case U.TangentKind:i=s=>s.getTangents();break;case U.UVKind:i=s=>s.getUVs();break;case U.UV2Kind:i=s=>s.getUV2s();break;case U.ColorKind:i=s=>s.getColors();break;default:return}for(let s=0;s<r.length;s++){let n=r[s];for(let o=0;o<t.numTargets;o++){const c=t.getTarget(o),h=c.influence;if(h!==0){const f=i(c);f&&(n+=(f[s]-r[s])*h)}}r[s]=n}}function BO(r,e,t,i,s,n,o){const c=ge.Vector3[0],h=ge.Matrix[0],f=ge.Matrix[1],_=e===U.NormalKind?I.TransformNormalFromFloatsToRef:I.TransformCoordinatesFromFloatsToRef;for(let d=0,g=0;d<r.length;d+=3,g+=4){h.reset();let p,b;for(p=0;p<4;p++)b=s[g+p],b>0&&(ae.FromFloat32ArrayToRefScaled(t,Math.floor(i[g+p]*16),b,f),h.addToSelf(f));if(n&&o)for(p=0;p<4;p++)b=o[g+p],b>0&&(ae.FromFloat32ArrayToRefScaled(t,Math.floor(n[g+p]*16),b,f),h.addToSelf(f));_(r[d],r[d+1],r[d+2],h,c),c.toArray(r,d)}}function a0(r,e){return r-Math.floor(r/e)*e}function NO(r,e){const t=r.y-r.x+1,i=e*r.w/t,s=i<1?0:1,n=t-s;let o=a0(i-Math.floor(i),1)*n;return o=a0(o+r.z,n),Math.floor(o)+r.x+s}function o0(r,e,t){if(r instanceof Float32Array){ae.FromArrayToRef(r,e,t);return}t.copyFromFloats(ds(r[e]),ds(r[e+1]),ds(r[e+2]),ds(r[e+3]),ds(r[e+4]),ds(r[e+5]),ds(r[e+6]),ds(r[e+7]),ds(r[e+8]),ds(r[e+9]),ds(r[e+10]),ds(r[e+11]
187),ds(r[e+12]),ds(r[e+13]),ds(r[e+14]),ds(r[e+15]))}function UO(r,e,t,i,s,n,o,c,h){const f=t.texture,d=f?.getInternalTexture()?._bufferView;if(!(d instanceof Float32Array)&&!(d instanceof Uint16Array))return Ee.Warn("Baked vertex animation bounding info requires CPU-readable Float32Array or Uint16Array texture data.",1),!1;const g=f.getSize(),p=NO(i,t.time);if(!isFinite(p)||p<0||p>=g.height)return Ee.Warn("Baked vertex animation bounding info could not be refreshed because the computed frame is outside the texture.",1),!1;const b=ge.Vector3[0],x=ge.Matrix[0],E=ge.Matrix[1],v=p*g.width*4,S=e===U.NormalKind?I.TransformNormalFromFloatsToRef:I.TransformCoordinatesFromFloatsToRef;for(let R=0,P=0;R<r.length;R+=3,P+=4){x.reset();let M,O;for(M=0;M<4&&M<h;M++)O=n[P+M],O>0&&(o0(d,v+Math.floor(s[P+M])*16,E),E.scaleAndAddToRef(O,x));if(o&&c)for(M=0;M<4&&M+4<h;M++)O=c[P+M],O>0&&(o0(d,v+Math.floor(o[P+M])*16,E),E.scaleAndAddToRef(O,x));S(r[R],r[R+1],r[R+2],x,b),b.toArray(r,R)}return!0}class kO{constructor(){this.facetNb=0,this.partitioningSubdivisions=10,this.partitioningBBoxRatio=1.01,this.facetDataEnabled=!1,this.facetParameters={},this.bbSize=I.Zero(),this.subDiv={max:1,X:1,Y:1,Z:1},this.facetDepthSort=!1,this.facetDepthSortEnabled=!1}}class zO{constructor(){this._hasVertexAlpha=!1,this._useVertexColors=!0,this._numBoneInfluencers=4,this._applyFog=!0,this._receiveShadows=!1,this._facetData=new kO,this._visibility=1,this._skeleton=null,this._layerMask=268435455,this._computeBonesUsingShaders=!0,this._isActive=!1,this._onlyForInstances=!1,this._isActiveIntermediate=!1,this._onlyForInstancesIntermediate=!1,this._actAsRegularMesh=!1,this._currentLOD=new Map,this._collisionRetryCount=3,this._morphTargetManager=null,this._renderingGroupId=0,this._bakedVertexAnimationManager=null,this._material=null,this._positions=null,this._pointerOverDisableMeshTesting=!1,this._meshCollisionData=new FO,this._enableDistantPicking=!1,this._rawBoundingInfo=null,this._sideOrientationHint=!1,this._wasActiveLastFrame=!1}}let ai=(()=>{var r;let e=ms,t=[],i;return r=class extends e{static get BILLBOARDMODE_NONE(){return ms.BILLBOARDMODE_NONE}static get BILLBOARDMODE_X(){return ms.BILLBOARDMODE_X}static get BILLBOARDMODE_Y(){return ms.BILLBOARDMODE_Y}static get BILLBOARDMODE_Z(){return ms.BILLBOARDMODE_Z}static get BILLBOARDMODE_ALL(){return ms.BILLBOARDMODE_ALL}static get BILLBOARDMODE_USE_POSITION(){return ms.BILLBOARDMODE_USE_POSITION}get facetNb(){return this._internalAbstractMeshDataInfo._facetData.facetNb}get partitioningSubdivisions(){return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions}set partitioningSubdivisions(n){this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions=n}get partitioningBBoxRatio(){return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio}set partitioningBBoxRatio(n){this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio=n}get mustDepthSortFacets(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSort}set mustDepthSortFacets(n){this._internalAbstractMeshDataInfo._facetData.facetDepthSort=n}get facetDepthSortFrom(){return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom}set facetDepthSortFrom(n){this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom=n}get collisionRetryCount(){return this._internalAbstractMeshDataInfo._collisionRetryCount}set collisionRetryCount(n){this._internalAbstractMeshDataInfo._collisionRetryCount=n}get isFacetDataEnabled(){return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled}get morphTargetManager(){return this._internalAbstractMeshDataInfo._morphTargetManager}set morphTargetManager(n){this._internalAbstractMeshDataInfo._morphTargetManager!==n&&(this._internalAbstractMeshDataInfo._morphTargetManager=n,this._syncGeometryWithMorphTargetManager())}get bakedVertexAnimationManager(){return this._internalAbstractMeshDataInfo._bakedVertexAnimationManager}set bakedVertexAnimationManager(n){this._internalAbstractMeshDataInfo._bakedVertexAnimationManager!==n&&(this._internalAbstractMeshDataInfo._bakedVertexAnimationManager=n,this._markSubMeshesAsAttributesDirty())}_syncGeometryWithMorphTargetManager(){}_updateNonUniformScalingState(n){return super._updateNonUniformScalingState(n)?(this._markSubMeshesAsMiscDirty(),!0):!1}get rawBoundingInfo(){return this._internalAbstractMeshDataInfo._rawBoundingInfo}set rawBoundingInfo(n){this._internalAbstractMeshDataInfo._rawBoundingInfo=n}set onCollide(n){this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver&&this.onCollideObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollideObserver=this.onCollideObservable.add(n)}set onCollisionPositionChange(n){this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver&&this.onCollisionPositionChangeObservable.remove(this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver),this._internalAbstractMeshDataInfo._meshCollisionData._onCollisionPositionChangeObserver=this.onCollisionPositionChangeObservable.add(n)}get visibility(){return this._internalAbstractMeshDataInfo._visibility}set visibility(n){if(this._internalAbstractMeshDataInfo._visibility===n)return;const o=this._internalAbstractMeshDataInfo._visibility;this._internalAbstractMeshDataInfo._visibility=n,(o===1&&n!==1||o!==1&&n===1)&&this._markSubMeshesAsDirty(c=>{c.markAsMiscDirty(),c.markAsPrePassDirty()})}get pointerOverDisableMeshTesting(){return this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting}set pointerOverDisableMeshTesting(n){this._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting=n}get renderingGroupId(){return this._internalAbstractMeshDataInfo._renderingGroupId}set renderingGroupId(n){this._internalAbstractMeshDataInfo._renderingGroupId=n}get material(){return this._internalAbstractMeshDataInfo._material}set material(n){this._setMaterial(n)}_setMaterial(n){this._internalAbstractMeshDataInfo._material!==n&&(this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._material=n,n&&n.meshMap&&(n.meshMap[this.uniqueId]=this),this.onMaterialChangedObservable.hasObservers()&&this.onMaterialChangedObservable.notifyObservers(this),this.subMeshes&&(this.resetDrawCache(void 0,n==null),this._unBindEffect()))}getMaterialForRenderPass(n){return this._internalAbstractMeshDataInfo._materialForRenderPass?.[n]}setMaterialForRenderPass(n,o){this.resetDrawCache(n),this._internalAbstractMeshDataInfo._materialForRenderPass||(this._internalAbstractMeshDataInfo._materialForRenderPass=[]);const c=this._internalAbstractMeshDataInfo._materialForRenderPass[n];c?.meshMap?.[this.uniqueId]&&(c.meshMap[this.uniqueId]=void 0),this._internalAbstractMeshDataInfo._materialForRenderPass[n]=o,o&&o.meshMap&&(o.meshMap[this.uniqueId]=this)}get receiveShadows(){return this._internalAbstractMeshDataInfo._receiveShadows}set receiveShadows(n){this._internalAbstractMeshDataInfo._receiveShadows!==n&&(this._internalAbstractMeshDataInfo._receiveShadows=n,this._markSubMeshesAsLightDirty())}get hasVertexAlpha(){return this._internalAbstractMeshDataInfo._hasVertexAlpha}set hasVertexAlpha(n){this._internalAbstractMeshDataInfo._hasVertexAlpha!==n&&(this._internalAbstractMeshDataInfo._hasVertexAlpha=n,this._markSubMeshesAsAttributesDirty(),this._markSubMeshesAsMiscDirty())}get useVertexColors(){return this._internalAbstractMeshDataInfo._useVertexColors}set useVertexColors(n){this._internalAbstractMeshDataInfo._useVertexColors!==n&&(this._internalAbstractMeshDataInfo._useVertexColors=n,this._markSubMeshesAsAttributesDirty())}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(n){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==n&&(this._internalAbstractMeshDataInfo._computeBonesUsingShaders=n,this._markSubMeshesAsAttributesDirty())}get numBoneInfluencers(){return this._internalAbstractMeshDataInfo._numBoneInfluencers}set numBoneInfluencers(n){this._internalAbstractMeshDataInfo._numBoneInfluencers!==n&&(this._internalAbstractMeshDataInfo._numBoneInfluencers=n,this._markSubMeshesAsAttributesDirty())}get applyFog(){return this._internalAbstractMeshDataInfo._applyFog}set applyFog(n){this._internalAbstractMeshDataInfo._applyFog!==n&&(this._internalAbstractMeshDataInfo._applyFog=n,this._markSubMeshesAsMiscDirty())}get enableDistantPicking(){return this._internalAbstractMeshDataInfo._enableDistantPicking}set enableDistantPicking(n){this._internalAbstractMeshDataInfo._enableDistantPicking=n}get layerMask(){return this._internalAbstractMeshDataInfo._layerMask}set layerMask(n){n!==this._internalAbstractMeshDataInfo._layerMask&&(this._internalAbstractMeshDataInfo._layerMask=n,this._resyncLightSources())}get collisionMask(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask}set collisionMask(n){this._internalAbstractMeshDataInfo._meshCollisionData._collisionMask=isNaN(n)?-1:n}get collisionResponse(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse}set collisionResponse(n){this._internalAbstractMeshDataInfo._meshCollisionData._collisionResponse=n}get collisionGroup(){return this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup}set collisionGroup(n){this._internalAbstractMeshDataInfo._meshCollisionData._collisionGroup=isNaN(n)?-1:n}get surroundingMeshes(){return this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes}set surroundingMeshes(n){this._internalAbstractMeshDataInfo._meshCollisionData._surroundingMeshes=n}get lightSources(){return this._lightSources}set skeleton(n){const o=this._internalAbstractMeshDataInfo._skeleton;
vendor: 16,007 bytes, line 187
187o&&o.needInitialSkinMatrix&&o._unregisterMeshWithPoseMatrix(this),n&&n.needInitialSkinMatrix&&n._registerMeshWithPoseMatrix(this),this._internalAbstractMeshDataInfo._skeleton=n,this._internalAbstractMeshDataInfo._skeleton||(this._bonesTransformMatrices=null),this._markSubMeshesAsAttributesDirty()}get skeleton(){return this._internalAbstractMeshDataInfo._skeleton}constructor(n,o=null){switch(super(n,o,!1),this._internalAbstractMeshDataInfo=new zO,this._waitingMaterialId=null,this._waitingMorphTargetManagerId=null,this._waitingSkeletonId=null,this._waitingSkeletonUniqueId=null,this.cullingStrategy=r.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY,this.onCollideObservable=new Oe,this.onCollisionPositionChangeObservable=new Oe,this.onMaterialChangedObservable=new Oe,this.definedFacingForward=!0,this._occlusionQuery=null,this._renderingGroup=null,this.alphaIndex=Number.MAX_VALUE,this.isPickable=r.DefaultIsPickable,this.isNearPickable=!1,this.isNearGrabbable=!1,this.showSubMeshesBoundingBox=!1,this.isBlocker=!1,this.enablePointerMoveEvents=!1,this.outlineColor=tt.Red(),this.outlineWidth=.02,this.overlayColor=tt.Red(),this.overlayAlpha=.5,this.useOctreeForRenderingSelection=!0,this.useOctreeForPicking=!0,this.useOctreeForCollisions=!0,this.alwaysSelectAsActiveMesh=!1,this.doNotSyncBoundingInfo=!1,this.actionManager=null,this.ellipsoid=new I(.5,1,.5),this.ellipsoidOffset=new I(0,0,0),this.edgesWidth=1,this.edgesColor=new xt(1,0,0,1),this._edgesRenderer=null,this._masterMesh=null,this._boundingInfo=null,this._boundingInfoIsDirty=!0,this._renderId=0,this._intersectionsInProgress=new Array,this._unIndexed=!1,this._lightSources=new Array,this._waitingData={lods:null,actions:null,freezeWorldMatrix:null},this._bonesTransformMatrices=null,this._transformMatrixTexture=null,this.onRebuildObservable=new Oe,this._onCollisionPositionChange=(c,h,f=null)=>{h.subtractToRef(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions.length()>Be.CollisionsEpsilon&&this.position.addInPlace(this._internalAbstractMeshDataInfo._meshCollisionData._diffPositionForCollisions),f&&this.onCollideObservable.notifyObservers(f),this.onCollisionPositionChangeObservable.notifyObservers(this.position)},o=this.getScene(),this.layerMask=o.defaultRenderableLayerMask,o.addMesh(this),this._resyncLightSources(),this._uniformBuffer=new Xe(this.getScene().getEngine(),void 0,void 0,n,!this.getScene().getEngine().isWebGPU),this._buildUniformLayout(),o.performancePriority){case 2:this.doNotSyncBoundingInfo=!0;case 1:this.alwaysSelectAsActiveMesh=!0,this.isPickable=!1;break}}_buildUniformLayout(){this._uniformBuffer.addUniform("world",16),this._uniformBuffer.addUniform("visibility",1),this._uniformBuffer.create()}transferToEffect(n){const o=this._uniformBuffer;o.updateMatrix("world",n),o.updateFloat("visibility",this._internalAbstractMeshDataInfo._visibility),o.update()}getMeshUniformBuffer(){return this._uniformBuffer}getClassName(){return"AbstractMesh"}toString(n){let o="Name: "+this.name+", isInstance: "+(this.getClassName()==="InstancedMesh"?"YES":"NO");o+=", # of submeshes: "+(this.subMeshes?this.subMeshes.length:0);const c=this._internalAbstractMeshDataInfo._skeleton;return c&&(o+=", skeleton: "+c.name),n&&(o+=", billboard mode: "+["NONE","X","Y",null,"Z",null,null,"ALL"][this.billboardMode],o+=", freeze wrld mat: "+(this._isWorldMatrixFrozen||this._waitingData.freezeWorldMatrix?"YES":"NO")),o}_getEffectiveParent(){return this._masterMesh&&this.billboardMode!==ms.BILLBOARDMODE_NONE?this._masterMesh:super._getEffectiveParent()}_getActionManagerForTrigger(n,o=!0){if(this.actionManager&&(o||this.actionManager.isRecursive))if(n){if(this.actionManager.hasSpecificTrigger(n))return this.actionManager}else return this.actionManager;return this.parent?this.parent._getActionManagerForTrigger(n,!1):null}_releaseRenderPassId(n){}_rebuild(n=!1){if(this.onRebuildObservable.notifyObservers(this),this._occlusionQuery!==null&&(this._occlusionQuery=null),!!this.subMeshes){for(const o of this.subMeshes)o._rebuild();this.resetDrawCache()}}_resyncLightSources(){this._lightSources.length=0;for(const n of this.getScene().lights)n.isEnabled()&&n.canAffectMesh(this)&&this._lightSources.push(n);this._markSubMeshesAsLightDirty()}_resyncLightSource(n){const o=n.isEnabled()&&n.canAffectMesh(this),c=this._lightSources.indexOf(n);let h=!1;if(c===-1){if(!o)return;this._lightSources.push(n)}else{if(o)return;h=!0,this._lightSources.splice(c,1)}this._markSubMeshesAsLightDirty(h)}_unBindEffect(){for(const n of this.subMeshes)n.setEffect(null)}_removeLightSource(n,o){const c=this._lightSources.indexOf(n);c!==-1&&(this._lightSources.splice(c,1),this._markSubMeshesAsLightDirty(o))}_markSubMeshesAsDirty(n){if(this.subMeshes)for(const o of this.subMeshes)for(let c=0;c<o._drawWrappers.length;++c){const h=o._drawWrappers[c];!h||!h.defines||!h.defines.markAllAsDirty||n(h.defines)}}_markSubMeshesAsLightDirty(n=!1){this._markSubMeshesAsDirty(o=>o.markAsLightDirty(n))}_markSubMeshesAsAttributesDirty(){this._markSubMeshesAsDirty(n=>n.markAsAttributesDirty())}_markSubMeshesAsMiscDirty(){this._markSubMeshesAsDirty(n=>n.markAsMiscDirty())}markAsDirty(n){return this._currentRenderId=Number.MAX_VALUE,super.markAsDirty(n),this._isDirty=!0,this}resetDrawCache(n,o=!1){if(this.subMeshes)for(const c of this.subMeshes)c.resetDrawCache(n,o)}get isBlocked(){return!1}getLOD(n){return this}getTotalVertices(){return 0}getTotalIndices(){return 0}getIndices(){return null}getVerticesData(n){return null}setVerticesData(n,o,c,h){return this}updateVerticesData(n,o,c,h){return this}setIndices(n,o){return this}isVerticesDataPresent(n){return!1}getBoundingInfo(){return this._masterMesh?this._masterMesh.getBoundingInfo():(this._boundingInfoIsDirty&&(this._boundingInfoIsDirty=!1,this._updateBoundingInfo()),this._boundingInfo)}getRawBoundingInfo(){return this.rawBoundingInfo??this.getBoundingInfo()}setBoundingInfo(n){return this._boundingInfo=n,this}get hasBoundingInfo(){return this._boundingInfo!==null}buildBoundingInfo(n,o,c){return this._boundingInfo=new en(n,o,c),this._boundingInfo}normalizeToUnitCube(n=!0,o=!1,c){return super.normalizeToUnitCube(n,o,c)}get useBones(){return this.skeleton&&this.getScene().skeletonsEnabled&&this.isVerticesDataPresent(U.MatricesIndicesKind)&&this.isVerticesDataPresent(U.MatricesWeightsKind)}_preActivate(){}_preActivateForIntermediateRendering(n){}_activate(n,o){return this._renderId=n,!0}_postActivate(){}_freeze(){}_unFreeze(){}getWorldMatrix(){return this._masterMesh&&this.billboardMode===ms.BILLBOARDMODE_NONE?this._masterMesh.getWorldMatrix():super.getWorldMatrix()}_getWorldMatrixDeterminant(){return this._masterMesh?this._masterMesh._getWorldMatrixDeterminant():super._getWorldMatrixDeterminant()}get isAnInstance(){return!1}get hasInstances(){return!1}get hasThinInstances(){return!1}movePOV(n,o,c){return this.position.addInPlace(this.calcMovePOV(n,o,c)),this}calcMovePOV(n,o,c){const h=new ae;(this.rotationQuaternion?this.rotationQuaternion:Ue.RotationYawPitchRoll(this.rotation.y,this.rotation.x,this.rotation.z)).toRotationMatrix(h);const _=I.Zero(),d=this.definedFacingForward?-1:1;return I.TransformCoordinatesFromFloatsToRef(n*d,o,c*d,h,_),_}rotatePOV(n,o,c){return this.rotation.addInPlace(this.calcRotatePOV(n,o,c)),this}calcRotatePOV(n,o,c){const h=this.definedFacingForward?1:-1;return new I(n*h,o,c*h)}_refreshBoundingInfo(n,o){if(n){const c=gA(n,0,this.getTotalVertices(),o);this._boundingInfo?this._boundingInfo.reConstruct(c.minimum,c.maximum):this._boundingInfo=new en(c.minimum,c.maximum)}if(this.subMeshes)for(let c=0;c<this.subMeshes.length;c++)this.subMeshes[c].refreshBoundingInfo(n);this._updateBoundingInfo()}_refreshBoundingInfoDirect(n){if(this._boundingInfo?this._boundingInfo.reConstruct(n.minimum,n.maximum):this._boundingInfo=new en(n.minimum,n.maximum),this.subMeshes)for(let o=0;o<this.subMeshes.length;o++)this.subMeshes[o].refreshBoundingInfo(null);this._updateBoundingInfo()}static _ApplySkeleton(n,o,c,h,f,_,d){BO(n,o,c,h,f,_,d)}_getData(n,o,c=U.PositionKind){const h=n.cache,f=g=>{if(h){const p=h._vertexData||(h._vertexData={});return p[g]||this.copyVerticesData(g,p),p[g]}return this.getVerticesData(g)};if(o||(o=f(c)),!o)return null;h?(h._outputData?h._outputData.set(o):h._outputData=new Float32Array(o),o=h._outputData):(n.applyMorph&&this.morphTargetManager||n.applySkeleton&&this.skeleton||n.applyBakedVertexAnimation&&this.bakedVertexAnimationManager?.isEnabled)&&(o=o.slice()),n.applyMorph&&this.morphTargetManager&&LO(o,c,this.morphTargetManager);const _=this.bakedVertexAnimationManager;let d=!1;if(n.applyBakedVertexAnimation&&_?.isEnabled){const g=f(U.MatricesIndicesKind),p=f(U.MatricesWeightsKind);if(p&&g){const b=this.numBoneInfluencers>4,x=b?f(U.MatricesIndicesExtraKind):null,E=b?f(U.MatricesWeightsExtraKind):null;d=UO(o,c,_,n.bakedVertexAnimationSettings??_.animationParameters,g,p,x,E,this.numBoneInfluencers)}}if(!d&&n.applySkeleton&&this.skeleton){const g=f(U.MatricesIndicesKind),p=f(U.MatricesWeightsKind);if(p&&g){const b=this.numBoneInfluencers>4,x=b?f(U.MatricesIndicesExtraKind):null,E=b?f(U.MatricesWeightsExtraKind):null,v=this.skeleton.getTransformMatrices(this);r._ApplySkeleton(o,c,v,g,p,x,E)}}if(n.updatePositionsArray!==!1&&c===U.PositionKind){const g=this._internalAbstractMeshDataInfo._positions||[],p=g.length;if(g.length=o.length/3,p<g.length)for(let b=p;b<g.length;b++)g[b]=new I;for(let b=0,x=0;b<g.length;b++,x+=3)g[b].copyFromFloats(o[x],o[x+1],o[x+2]);this._internalAbstractMeshDataInfo._positions=g}return o}getNormalsData(n=!1,o=!1){return this._getData({applySkeleton:n,applyMorph:o,updatePositionsArray:!1},null,U.NormalKind)}getPositionData(n=!1,o=!1,c=null){return this._getData({applySkeleton:n,applyMorph:o,updatePositionsArray:!1},c,U.PositionKind)}_updateBoundingInfo(){return this._boundingInfo?this._boundingInfo.update(this.worldMatrixFromCache):this._boundingInfo=new en(I.Zero(),I.Zero(),this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}_updateSubMeshesBoundingInfo(n){if(!this.subMeshes)return this;const o=this.subMeshes.length;for(let c=0;c<o;c++){const h=this.subMeshes[c];(o>1||!h.IsGlobal)&&h.updateBoundingInfo(n)}return this}_afterComputeWorldMatrix(){this.doNotSyncBoundingInfo||(this._boundingInfoIsDirty=!0)}isInFrustum(n){return this.getBoundingInfo().isInFrustum(n,this.cullingStrategy)}isCompletelyInFrustum(n){return this.getBoundingInfo().isCompletelyInFrustum(n)}intersectsMesh(n,o=!1,c){const h=this.getBoundingInfo(),f=n.getBoundingInfo();if(h.intersects(f,o))return!0;if(c){for(const _ of this.getChildMeshes())if(_.intersectsMesh(n,o,!0))return!0}return!1}intersectsPoint(n){return this.getBoundingInfo().intersectsPoint(n)}get checkCollisions(){return this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions}set checkCollisions(n){this._internalAbstractMeshDataInfo._meshCollisionData._checkCollisions=n}get collider(){return this._internalAbstractMeshDataInfo._meshCollisionData._collider}moveWithCollisions(n,o=!0){this.getAbsolutePosition().addToRef(this.ellipsoidOffset,this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions);const h=this.getScene().collisionCoordinator;return this._internalAbstractMeshDataInfo._meshCollisionData._collider||(this._internalAbstractMeshDataInfo._meshCollisionData._collider=h.createCollider()),this._internalAbstractMeshDataInfo._meshCollisionData._collider._radius=this.ellipsoid,h.getNewPosition(this._internalAbstractMeshDataInfo._meshCollisionData._oldPositionForCollisions,n,this._internalAbstractMeshDataInfo._meshCollisionData._collider,this.collisionRetryCount,this,this._onCollisionPositionChange,this.uniqueId,o),this}_collideForSubMesh(n,o,c){if(this._generatePointsArray(),!this._positions)return this;if(!n._lastColliderWorldVertices||!n._lastColliderTransformMatrix.equals(o)){n._lastColliderTransformMatrix=o.clone(),n._lastColliderWorldVertices=[],n._trianglePlanes=[];const h=n.verticesStart,f=n.verticesStart+n.verticesCount;for(let _=h;_<f;_++)n._lastColliderWorldVertices.push(I.TransformCoordinates(this._positions[_],o))}return c._collide(n._trianglePlanes,n._lastColliderWorldVertices,this.getIndices(),n.indexStart,n.indexStart+n.indexCount,n.verticesStart,!!n.getMaterial(),this,this._shouldConvertRHS(),n.getMaterial()?.fillMode===7),this}_processCollisionsForSubMeshes(n,o){const c=this._scene.getCollidingSubMeshCandidates(this,n),h=c.length;for(let f=0;f<h;f++){const _=c.data[f];h>1&&!_._checkCollision(n)||this._collideForSubMesh(_,o,n)}return this}_shouldConvertRHS(){return!1}_checkCollision(n){if(!this.getBoundingInfo()._checkCollision(n))return this;const o=ge.Matrix[0],c=ge.Matrix[1];return ae.ScalingToRef(1/n._radius.x,1/n._radius.y,1/n._radius.z,o),this.worldMatrixFromCache.multiplyToRef(o,c),this._processCollisionsForSubMeshes(n,c),this}_generatePointsArray(){return!1}intersects(n,o,c,h=!1,f,_=!1){const d=new uh,g=this.getClassName(),p=g==="InstancedLinesMesh"||g==="LinesMesh"||g==="GreasedLineMesh"?this.intersectionThreshold:0,b=this.getBoundingInfo();if(!this.subMeshes||!_&&(!n.intersectsSphere(b.boundingSphere,p)||!n.intersectsBox(b.boundingBox,p)))return d;if(h)return d.hit=!_,d.pickedMesh=_?null:this,d.distance=_?0:I.Distance(n.origin,b.boundingSphere.center),d.subMeshId=0,d;if(!this._generatePointsArray())return d;let x=null;const E=this._scene.getIntersectingSubMeshCandidates(this,n),v=E.length;let S=!1;for(let R=0;R<v;R++){const M=E.data[R].getMaterial();if(M&&(M.fillMode==7||M.fillMode==0||M.fillMode==1||M.fillMode==2||M.fillMode==4)){S=!0;break}}if(!S)return d.hit=!0,d.pickedMesh=this,d.distance=I.Distance(n.origin,b.boundingSphere.center),d.subMeshId=-1,d;for(let R=0;R<v;R++){const P=E.data[R];if(v>1&&!_&&!P.canIntersects(n))continue;const M=P.intersects(n,this._positions,this.getIndices(),o,c);if(M&&(o||!x||M.distance<x.distance)&&(x=M,x.subMeshId=P._id,x._internalSubMeshId=R,o))break}if(x){const R=f??this.getWorldMatrix(),P=ge.Vector3[0],M=ge.Vector3[1];I.TransformCoordinatesToRef(n.origin,R,P),n.direction.scaleToRef(x.distance,M);const D=I.TransformNormal(M,R).addInPlace(P);return d.hit=!0,d.distance=I.Distance(P,D),d.pickedPoint=D,d.pickedMesh=this,d.bu=x.bu||0,d.bv=x.bv||0,d.subMeshFaceId=x.faceId,d.faceId=x.faceId+E.data[x._internalSubMeshId].indexStart/(this.getClassName().indexOf("LinesMesh")!==-1?2:3),d.subMeshId=x.subMeshId,d}return d}clone(n,o,c){return null}releaseSubMeshes(n=!1){if(this.subMeshes)for(;this.subMeshes.length;)this.subMeshes[0].dispose(n);else this.subMeshes=[];return this}dispose(n,o=!1){let c;const h=this.getScene();for(this._scene.useMaterialMeshMap&&this._internalAbstractMeshDataInfo._material&&this._internalAbstractMeshDataInfo._material.meshMap&&(this._internalAbstractMeshDataInfo._material.meshMap[this.uniqueId]=void 0),h.freeActiveMeshes(),h.freeRenderingGroups(),h.renderingManager.maintainStateBetweenFrames&&h.renderingManager.restoreDispachedFlags(),this.actionManager!==void 0&&this.actionManager!==null&&(this.actionManager.disposeWhenUnowned&&!this._scene.meshes.some(d=>d!==this&&d.actionManager===this.actionManager)&&this.actionManager.dispose(),this.actionManager=null),this._internalAbstractMeshDataInfo._skeleton=null,this._transformMatrixTexture&&(this._transformMatrixTexture.dispose(),this._transformMatrixTexture=null),c=0;c<this._intersectionsInProgress.length;c++){const d=this._intersectionsInProgress[c],g=d._intersectionsInProgress.indexOf(this);d._intersectionsInProgress.splice(g,1)}this._intersectionsInProgress.length=0;const f=h.lights;for(const d of f){let g=d.includedOnlyMeshes.indexOf(this);g!==-1&&d.includedOnlyMeshes.splice(g,1),g=d.excludedMeshes.indexOf(this),g!==-1&&d.excludedMeshes.splice(g,1);const p=d.getShadowGenerators();if(p){const b=p.values();for(let x=b.next();x.done!==!0;
vendor: 17,227 bytes, line 187
187x=b.next()){const v=x.value.getShadowMap();v&&v.renderList&&(g=v.renderList.indexOf(this),g!==-1&&v.renderList.splice(g,1))}}}this.releaseSubMeshes(h._isDisposing);const _=h.getEngine();if(this._occlusionQuery!==null&&(this.isOcclusionQueryInProgress=!1,_.deleteQuery(this._occlusionQuery),this._occlusionQuery=null),_.wipeCaches(),h.removeMesh(this),this._parentContainer){const d=this._parentContainer.meshes.indexOf(this);d>-1&&this._parentContainer.meshes.splice(d,1),this._parentContainer=null}if(o&&this.material&&(this.material.getClassName()==="MultiMaterial"?this.material.dispose(!1,!0,!0):this.material.dispose(!1,!0)),!n)for(c=0;c<h.particleSystems.length;c++)h.particleSystems[c].emitter===this&&(h.particleSystems[c].dispose(),c--);this._internalAbstractMeshDataInfo._facetData.facetDataEnabled&&this.disableFacetData(),this._uniformBuffer.dispose(),this.onAfterWorldMatrixUpdateObservable.clear(),this.onCollideObservable.clear(),this.onCollisionPositionChangeObservable.clear(),this.onRebuildObservable.clear(),super.dispose(n,o)}_initFacetData(){const n=this._internalAbstractMeshDataInfo._facetData;n.facetNormals||(n.facetNormals=[]),n.facetPositions||(n.facetPositions=[]),n.facetPartitioning||(n.facetPartitioning=new Array),n.facetNb=this.getIndices().length/3|0,n.partitioningSubdivisions=n.partitioningSubdivisions?n.partitioningSubdivisions:10,n.partitioningBBoxRatio=n.partitioningBBoxRatio?n.partitioningBBoxRatio:1.01;for(let o=0;o<n.facetNb;o++)n.facetNormals[o]=I.Zero(),n.facetPositions[o]=I.Zero();return n.facetDataEnabled=!0,this}updateFacetData(){const n=this._internalAbstractMeshDataInfo._facetData;n.facetDataEnabled||this._initFacetData();const o=this.getVerticesData(U.PositionKind),c=this.getIndices(),h=this.getVerticesData(U.NormalKind)?.slice(),f=this.getBoundingInfo();if(n.facetDepthSort&&!n.facetDepthSortEnabled){if(n.facetDepthSortEnabled=!0,c instanceof Uint16Array)n.depthSortedIndices=new Uint16Array(c);else if(c instanceof Uint32Array)n.depthSortedIndices=new Uint32Array(c);else{let d=!1;for(let g=0;g<c.length;g++)if(c[g]>65535){d=!0;break}d?n.depthSortedIndices=new Uint32Array(c):n.depthSortedIndices=new Uint16Array(c)}if(n.facetDepthSortFunction=function(d,g){return g.sqDistance-d.sqDistance},!n.facetDepthSortFrom){const d=this.getScene().activeCamera;n.facetDepthSortFrom=d?d.position:I.Zero()}n.depthSortedFacets=[];for(let d=0;d<n.facetNb;d++){const g={ind:d*3,sqDistance:0};n.depthSortedFacets.push(g)}n.invertedMatrix=ae.Identity(),n.facetDepthSortOrigin=I.Zero()}n.bbSize.x=f.maximum.x-f.minimum.x>It?f.maximum.x-f.minimum.x:It,n.bbSize.y=f.maximum.y-f.minimum.y>It?f.maximum.y-f.minimum.y:It,n.bbSize.z=f.maximum.z-f.minimum.z>It?f.maximum.z-f.minimum.z:It;let _=n.bbSize.x>n.bbSize.y?n.bbSize.x:n.bbSize.y;if(_=_>n.bbSize.z?_:n.bbSize.z,n.subDiv.max=n.partitioningSubdivisions,n.subDiv.X=Math.floor(n.subDiv.max*n.bbSize.x/_),n.subDiv.Y=Math.floor(n.subDiv.max*n.bbSize.y/_),n.subDiv.Z=Math.floor(n.subDiv.max*n.bbSize.z/_),n.subDiv.X=n.subDiv.X<1?1:n.subDiv.X,n.subDiv.Y=n.subDiv.Y<1?1:n.subDiv.Y,n.subDiv.Z=n.subDiv.Z<1?1:n.subDiv.Z,n.facetParameters.facetNormals=this.getFacetLocalNormals(),n.facetParameters.facetPositions=this.getFacetLocalPositions(),n.facetParameters.facetPartitioning=this.getFacetLocalPartitioning(),n.facetParameters.bInfo=f,n.facetParameters.bbSize=n.bbSize,n.facetParameters.subDiv=n.subDiv,n.facetParameters.ratio=this.partitioningBBoxRatio,n.facetParameters.depthSort=n.facetDepthSort,n.facetDepthSort&&n.facetDepthSortEnabled&&(this.computeWorldMatrix(!0),this._worldMatrix.invertToRef(n.invertedMatrix),I.TransformCoordinatesToRef(n.facetDepthSortFrom,n.invertedMatrix,n.facetDepthSortOrigin),n.facetParameters.distanceTo=n.facetDepthSortOrigin),n.facetParameters.depthSortedFacets=n.depthSortedFacets,h&&Ye.ComputeNormals(o,c,h,n.facetParameters),n.facetDepthSort&&n.facetDepthSortEnabled){n.depthSortedFacets.sort(n.facetDepthSortFunction);const d=n.depthSortedIndices.length/3|0;for(let g=0;g<d;g++){const p=n.depthSortedFacets[g].ind;n.depthSortedIndices[g*3]=c[p],n.depthSortedIndices[g*3+1]=c[p+1],n.depthSortedIndices[g*3+2]=c[p+2]}this.updateIndices(n.depthSortedIndices,void 0,!0)}return this}getFacetLocalNormals(){const n=this._internalAbstractMeshDataInfo._facetData;return n.facetNormals||this.updateFacetData(),n.facetNormals}getFacetLocalPositions(){const n=this._internalAbstractMeshDataInfo._facetData;return n.facetPositions||this.updateFacetData(),n.facetPositions}getFacetLocalPartitioning(){const n=this._internalAbstractMeshDataInfo._facetData;return n.facetPartitioning||this.updateFacetData(),n.facetPartitioning}getFacetPosition(n){const o=I.Zero();return this.getFacetPositionToRef(n,o),o}getFacetPositionToRef(n,o){const c=this.getFacetLocalPositions()[n],h=this.getWorldMatrix();return I.TransformCoordinatesToRef(c,h,o),this}getFacetNormal(n){const o=I.Zero();return this.getFacetNormalToRef(n,o),o}getFacetNormalToRef(n,o){const c=this.getFacetLocalNormals()[n];return I.TransformNormalToRef(c,this.getWorldMatrix(),o),this}getFacetsAtLocalCoordinates(n,o,c){const h=this.getBoundingInfo(),f=this._internalAbstractMeshDataInfo._facetData,_=Math.floor((n-h.minimum.x*f.partitioningBBoxRatio)*f.subDiv.X*f.partitioningBBoxRatio/f.bbSize.x),d=Math.floor((o-h.minimum.y*f.partitioningBBoxRatio)*f.subDiv.Y*f.partitioningBBoxRatio/f.bbSize.y),g=Math.floor((c-h.minimum.z*f.partitioningBBoxRatio)*f.subDiv.Z*f.partitioningBBoxRatio/f.bbSize.z);return _<0||_>f.subDiv.max||d<0||d>f.subDiv.max||g<0||g>f.subDiv.max?null:f.facetPartitioning[_+f.subDiv.max*d+f.subDiv.max*f.subDiv.max*g]}getClosestFacetAtCoordinates(n,o,c,h,f=!1,_=!0){const d=this.getWorldMatrix(),g=ge.Matrix[5];d.invertToRef(g);const p=ge.Vector3[8];I.TransformCoordinatesFromFloatsToRef(n,o,c,g,p);const b=this.getClosestFacetAtLocalCoordinates(p.x,p.y,p.z,h,f,_);return h&&I.TransformCoordinatesFromFloatsToRef(h.x,h.y,h.z,d,h),b}getClosestFacetAtLocalCoordinates(n,o,c,h,f=!1,_=!0){let d=null,g,p,b,x,E,v,S,R;const P=this.getFacetLocalPositions(),M=this.getFacetLocalNormals(),O=this.getFacetsAtLocalCoordinates(n,o,c);if(!O)return null;let D=Number.MAX_VALUE,w,G,H,ie;for(let ne=0;ne<O.length;ne++)G=O[ne],H=M[G],ie=P[G],x=(n-ie.x)*H.x+(o-ie.y)*H.y+(c-ie.z)*H.z,(!f||f&&_&&x>=0||f&&!_&&x<=0)&&(x=H.x*ie.x+H.y*ie.y+H.z*ie.z,E=-(H.x*n+H.y*o+H.z*c-x)/(H.x*H.x+H.y*H.y+H.z*H.z),v=n+H.x*E,S=o+H.y*E,R=c+H.z*E,g=v-n,p=S-o,b=R-c,w=g*g+p*p+b*b,w<D&&(D=w,d=G,h&&(h.x=v,h.y=S,h.z=R)));return d}getFacetDataParameters(){return this._internalAbstractMeshDataInfo._facetData.facetParameters}disableFacetData(){const n=this._internalAbstractMeshDataInfo._facetData;return n.facetDataEnabled&&(n.facetDataEnabled=!1,n.facetPositions=[],n.facetNormals=[],n.facetPartitioning=new Array,n.facetParameters={},n.depthSortedIndices=new Uint32Array(0)),this}updateIndices(n,o,c=!1){return this}createNormals(n){const o=this.getVerticesData(U.PositionKind),c=this.getIndices();let h;return this.isVerticesDataPresent(U.NormalKind)?h=this.getVerticesData(U.NormalKind):h=[],Ye.ComputeNormals(o,c,h,{useRightHandedSystem:this.getScene().useRightHandedSystem}),this.setVerticesData(U.NormalKind,h,n),this}async optimizeIndicesAsync(){const n=this.getIndices();if(!n)return this;const{OptimizeIndices:o}=await ts(async()=>{const{OptimizeIndices:c}=await import("./mesh.vertexData.functions-ayNlGC5K.js");return{OptimizeIndices:c}},[]);return o(n),this.setIndices(n,this.getTotalVertices()),this}alignWithNormal(n,o){o||(o=_o.Y);const c=ge.Vector3[0],h=ge.Vector3[1];return I.CrossToRef(o,n,h),I.CrossToRef(n,h,c),this.rotationQuaternion?Ue.RotationQuaternionFromAxisToRef(c,n,h,this.rotationQuaternion):I.RotationFromAxisToRef(c,n,h,this.rotation),this}_checkOcclusionQuery(n=!1){return!1}disableEdgesRendering(){throw at("EdgesRenderer")}enableEdgesRendering(n,o,c){throw at("EdgesRenderer")}getConnectedParticleSystems(){return this._scene.particleSystems.filter(n=>n.emitter===this)}},(()=>{const s=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[Ra.filter((...n)=>!Array.isArray(n[0])&&!Array.isArray(n[3])&&!Array.isArray(n[4])&&!Array.isArray(n[5])&&!Array.isArray(n[6]))],$(r,null,i,{kind:"method",name:"_ApplySkeleton",static:!0,private:!1,access:{has:n=>"_ApplySkeleton"in n,get:n=>n._ApplySkeleton},metadata:s},null,t),s&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),r.OCCLUSION_TYPE_NONE=(L(r,t),0),r.OCCLUSION_TYPE_OPTIMISTIC=1,r.OCCLUSION_TYPE_STRICT=2,r.OCCLUSION_ALGORITHM_TYPE_ACCURATE=0,r.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE=1,r.CULLINGSTRATEGY_STANDARD=0,r.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,r.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,r.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,r.DefaultIsPickable=!0,r})();(s0=ai.prototype).createOrUpdateSubmeshesOctree??(s0.createOrUpdateSubmeshesOctree=Ze("AbstractMesh","createOrUpdateSubmeshesOctree"));(n0=ai.prototype).getPhysicsImpostor??(n0.getPhysicsImpostor=Ze("AbstractMesh","getPhysicsImpostor"));(r0=ai.prototype).setPhysicsLinkWith??(r0.setPhysicsLinkWith=Ze("AbstractMesh","setPhysicsLinkWith"));Object.getOwnPropertyDescriptor(ai.prototype,"occlusionRetryCount")||Object.defineProperty(ai.prototype,"occlusionRetryCount",At("AbstractMesh","occlusionRetryCount"));Object.getOwnPropertyDescriptor(ai.prototype,"occlusionType")||Object.defineProperty(ai.prototype,"occlusionType",At("AbstractMesh","occlusionType"));Object.getOwnPropertyDescriptor(ai.prototype,"occlusionQueryAlgorithmType")||Object.defineProperty(ai.prototype,"occlusionQueryAlgorithmType",At("AbstractMesh","occlusionQueryAlgorithmType"));Object.getOwnPropertyDescriptor(ai.prototype,"isOccluded")||Object.defineProperty(ai.prototype,"isOccluded",At("AbstractMesh","isOccluded"));Object.getOwnPropertyDescriptor(ai.prototype,"isOcclusionQueryInProgress")||Object.defineProperty(ai.prototype,"isOcclusionQueryInProgress",At("AbstractMesh","isOcclusionQueryInProgress"));Object.getOwnPropertyDescriptor(ai.prototype,"forceRenderingWhenOccluded")||Object.defineProperty(ai.prototype,"forceRenderingWhenOccluded",At("AbstractMesh","forceRenderingWhenOccluded"));Object.getOwnPropertyDescriptor(ai.prototype,"occlusionForRenderPassId")||Object.defineProperty(ai.prototype,"occlusionForRenderPassId",At("AbstractMesh","occlusionForRenderPassId"));Object.getOwnPropertyDescriptor(ai.prototype,"decalMap")||Object.defineProperty(ai.prototype,"decalMap",At("AbstractMesh","decalMap"));Object.getOwnPropertyDescriptor(ai.prototype,"instancedBuffers")||Object.defineProperty(ai.prototype,"instancedBuffers",At("AbstractMesh","instancedBuffers"));Object.getOwnPropertyDescriptor(ai.prototype,"physicsImpostor")||Object.defineProperty(ai.prototype,"physicsImpostor",At("AbstractMesh","physicsImpostor"));Object.getOwnPropertyDescriptor(ai.prototype,"showBoundingBox")||Object.defineProperty(ai.prototype,"showBoundingBox",At("AbstractMesh","showBoundingBox"));Object.getOwnPropertyDescriptor(ai.prototype,"edgesRenderer")||Object.defineProperty(ai.prototype,"edgesRenderer",At("AbstractMesh","edgesRenderer"));Object.getOwnPropertyDescriptor(ai.prototype,"renderOutline")||Object.defineProperty(ai.prototype,"renderOutline",At("AbstractMesh","renderOutline"));Object.getOwnPropertyDescriptor(ai.prototype,"renderOverlay")||Object.defineProperty(ai.prototype,"renderOverlay",At("AbstractMesh","renderOverlay"));let VO=(()=>{var r;let e=[],t,i,s,n,o,c,h,f,_,d,g,p;return r=class{constructor(){this._func=L(this,e),this.reset()}reset(){this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=519,this.opStencilFail=7680,this.opDepthFail=7680,this.opStencilDepthPass=7681,this.backFunc=519,this.backOpStencilFail=7680,this.backOpDepthFail=7680,this.backOpStencilDepthPass=7681}get func(){return this._func}set func(x){this._func=x}get backFunc(){return this._backFunc}set backFunc(x){this._backFunc=x}get funcRef(){return this._funcRef}set funcRef(x){this._funcRef=x}get funcMask(){return this._funcMask}set funcMask(x){this._funcMask=x}get opStencilFail(){return this._opStencilFail}set opStencilFail(x){this._opStencilFail=x}get opDepthFail(){return this._opDepthFail}set opDepthFail(x){this._opDepthFail=x}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(x){this._opStencilDepthPass=x}get backOpStencilFail(){return this._backOpStencilFail}set backOpStencilFail(x){this._backOpStencilFail=x}get backOpDepthFail(){return this._backOpDepthFail}set backOpDepthFail(x){this._backOpDepthFail=x}get backOpStencilDepthPass(){return this._backOpStencilDepthPass}set backOpStencilDepthPass(x){this._backOpStencilDepthPass=x}get mask(){return this._mask}set mask(x){this._mask=x}get enabled(){return this._enabled}set enabled(x){this._enabled=x}getClassName(){return"MaterialStencilState"}copyTo(x){Tt.Clone(()=>x,this)}serialize(){return Tt.Serialize(this)}parse(x,E,v){Tt.Parse(()=>this,x,E,v)}},(()=>{const b=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[he()],i=[he()],s=[he()],n=[he()],o=[he()],c=[he()],h=[he()],f=[he()],_=[he()],d=[he()],g=[he()],p=[he()],$(r,null,t,{kind:"getter",name:"func",static:!1,private:!1,access:{has:x=>"func"in x,get:x=>x.func},metadata:b},null,e),$(r,null,i,{kind:"getter",name:"backFunc",static:!1,private:!1,access:{has:x=>"backFunc"in x,get:x=>x.backFunc},metadata:b},null,e),$(r,null,s,{kind:"getter",name:"funcRef",static:!1,private:!1,access:{has:x=>"funcRef"in x,get:x=>x.funcRef},metadata:b},null,e),$(r,null,n,{kind:"getter",name:"funcMask",static:!1,private:!1,access:{has:x=>"funcMask"in x,get:x=>x.funcMask},metadata:b},null,e),$(r,null,o,{kind:"getter",name:"opStencilFail",static:!1,private:!1,access:{has:x=>"opStencilFail"in x,get:x=>x.opStencilFail},metadata:b},null,e),$(r,null,c,{kind:"getter",name:"opDepthFail",static:!1,private:!1,access:{has:x=>"opDepthFail"in x,get:x=>x.opDepthFail},metadata:b},null,e),$(r,null,h,{kind:"getter",name:"opStencilDepthPass",static:!1,private:!1,access:{has:x=>"opStencilDepthPass"in x,get:x=>x.opStencilDepthPass},metadata:b},null,e),$(r,null,f,{kind:"getter",name:"backOpStencilFail",static:!1,private:!1,access:{has:x=>"backOpStencilFail"in x,get:x=>x.backOpStencilFail},metadata:b},null,e),$(r,null,_,{kind:"getter",name:"backOpDepthFail",static:!1,private:!1,access:{has:x=>"backOpDepthFail"in x,get:x=>x.backOpDepthFail},metadata:b},null,e),$(r,null,d,{kind:"getter",name:"backOpStencilDepthPass",static:!1,private:!1,access:{has:x=>"backOpStencilDepthPass"in x,get:x=>x.backOpStencilDepthPass},metadata:b},null,e),$(r,null,g,{kind:"getter",name:"mask",static:!1,private:!1,access:{has:x=>"mask"in x,get:x=>x.mask},metadata:b},null,e),$(r,null,p,{kind:"getter",name:"enabled",static:!1,private:!1,access:{has:x=>"enabled"in x,get:x=>x.enabled},metadata:b},null,e),b&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b})})(),r})();class Lt{static CompareLightsPriority(e,t){return e.shadowEnabled!==t.shadowEnabled?(t.shadowEnabled?1:0)-(e.shadowEnabled?1:0):t.renderPriority-e.renderPriority}}Lt.FALLOFF_DEFAULT=0;Lt.FALLOFF_PHYSICAL=1;Lt.FALLOFF_GLTF=2;Lt.FALLOFF_STANDARD=3;Lt.LIGHTMAP_DEFAULT=0;Lt.LIGHTMAP_SPECULAR=1;Lt.LIGHTMAP_SHADOWSONLY=2;Lt.INTENSITYMODE_AUTOMATIC=0;Lt.INTENSITYMODE_LUMINOUSPOWER=1;Lt.INTENSITYMODE_LUMINOUSINTENSITY=2;Lt.INTENSITYMODE_ILLUMINANCE=3;Lt.INTENSITYMODE_LUMINANCE=4;Lt.LIGHTTYPEID_POINTLIGHT=0;Lt.LIGHTTYPEID_DIRECTIONALLIGHT=1;Lt.LIGHTTYPEID_SPOTLIGHT=2;Lt.LIGHTTYPEID_HEMISPHERICLIGHT=3;Lt.LIGHTTYPEID_RECT_AREALIGHT=4;Lt.LIGHTTYPEID_CLUSTERED_CONTAINER=5;const pn=new ae,qn=new ae,Kn=new ae,fh={getScene:()=>{},eyeAtCamera:!0};function dh(r,e,t){const i=t.asArray(),s=e.asArray();for(let n=0;n<16;n++)i[n]=s[n];return i[12]-=r.x,i[13]-=r.y,i[14]-=r.z,t.markAsUpdated(),t}function GO(r,e,t){return zf(e,qn),dh(r,qn,Kn),zf(Kn,t),t}function $f(r,e,t){if(!fh.eyeAtCamera)return GO(r,e,t);const i=t.asArray(),s=e.asArray();for(let n=0;n<16;n++)i[n]=s[n];return i[12]=0,i[13]=0,i[14]=0,t.markAsUpdated(),t}function Wm(r,e,t,i){return lh($f(r,e,i),t,i),i}function l0(r,e,t,i){return zf(t,qn),lh(e,qn,Kn),dh(r,Kn,qn),$f(r,t,Kn),lh(qn,Kn,i),i}function c0(r,e,t,i,s,n){return zf(t,qn),lh(e,qn,Kn),dh(r,Kn,qn),Wm(r,i,s,Kn),lh(qn,Kn,n),n}function h0(r,e){const t=fh.getScene();if(!t||pn===e)return e;pn.updateFlag=e.updateFlag;const i=t.floatingOriginOffset;switch(r){case"world":return dh(i,e,pn);case"view":return $f(i,e,pn);case"worldView":return l0(i,e,t.getViewMatrix(),pn);case"viewProjection":return Wm(i,t.getViewMatrix(),t.getProjectionMatrix(),pn);case"worldViewProjection":return c0(i,e,t.getTransformMatrix(),t.getViewMatrix(),t.getProjectionMatrix(),pn);default:if(r.startsWith("u_")){const s=r.toLowerCase();if(s.startsWith("u_worldviewprojection"))return c0(i,e,t.getTransformMatrix(),t.getViewMatrix(),t.getProjectionMatrix(),pn);if(s.startsWith("u_viewprojection"))return Wm(i,t.getViewMatrix(),t.getProjectionMatrix(),pn);if(s.startsWith("u_worldview"))return l0(i,e,t.getViewMatrix(),pn);if(s.startsWith("u_world"))return dh(i,e,pn);if(s.startsWith("u_view"))return $f(i,e,pn)}return e}}const _h=Xe,Xm=Li,yA=_h.prototype._updateMatrixForUniform,bA=Li.prototype.setMatr
187ix;function HO(){Li.prototype.setMatrix=bA,Xm._setMatrixOverride=void 0,_h.prototype._updateMatrixForUniform=yA,_h.prototype._updateMatrixForUniformOverride=void 0}function WO(){Xm.prototype._setMatrixOverride=bA,Xm.prototype.setMatrix=function(r,e){return this._setMatrixOverride(r,h0(r,e)),this},_h.prototype._updateMatrixForUniformOverride=yA,_h.prototype._updateMatrixForUniform=function(r,e){this._updateMatrixForUniformOverride(r,h0(r,e))}}function xA(r){r.indexOf("vClipPlane")===-1&&r.push("vClipPlane"),r.indexOf("vClipPlane2")===-1&&r.push("vClipPlane2"),r.indexOf("vClipPlane3")===-1&&r.push("vClipPlane3"),r.indexOf("vClipPlane4")===-1&&r.push("vClipPlane4"),r.indexOf("vClipPlane5")===-1&&r.push("vClipPlane5"),r.indexOf("vClipPlane6")===-1&&r.push("vClipPlane6")}function XO(r,e,t){const i=!!(r.clipPlane??e.clipPlane),s=!!(r.clipPlane2??e.clipPlane2),n=!!(r.clipPlane3??e.clipPlane3),o=!!(r.clipPlane4??e.clipPlane4),c=!!(r.clipPlane5??e.clipPlane5),h=!!(r.clipPlane6??e.clipPlane6);i&&t.push("#define CLIPPLANE"),s&&t.push("#define CLIPPLANE2"),n&&t.push("#define CLIPPLANE3"),o&&t.push("#define CLIPPLANE4"),c&&t.pu
vendor: 8,567 bytes, line 187
187sh("#define CLIPPLANE5"),h&&t.push("#define CLIPPLANE6")}function YO(r,e,t){let i=!1;const s=!!(r.clipPlane??e.clipPlane),n=!!(r.clipPlane2??e.clipPlane2),o=!!(r.clipPlane3??e.clipPlane3),c=!!(r.clipPlane4??e.clipPlane4),h=!!(r.clipPlane5??e.clipPlane5),f=!!(r.clipPlane6??e.clipPlane6);return t.CLIPPLANE!==s&&(t.CLIPPLANE=s,i=!0),t.CLIPPLANE2!==n&&(t.CLIPPLANE2=n,i=!0),t.CLIPPLANE3!==o&&(t.CLIPPLANE3=o,i=!0),t.CLIPPLANE4!==c&&(t.CLIPPLANE4=c,i=!0),t.CLIPPLANE5!==h&&(t.CLIPPLANE5=h,i=!0),t.CLIPPLANE6!==f&&(t.CLIPPLANE6=f,i=!0),i}function TA(r,e,t){let i=e.clipPlane??t.clipPlane;dl(r,"vClipPlane",i),i=e.clipPlane2??t.clipPlane2,dl(r,"vClipPlane2",i),i=e.clipPlane3??t.clipPlane3,dl(r,"vClipPlane3",i),i=e.clipPlane4??t.clipPlane4,dl(r,"vClipPlane4",i),i=e.clipPlane5??t.clipPlane5,dl(r,"vClipPlane5",i),i=e.clipPlane6??t.clipPlane6,dl(r,"vClipPlane6",i)}function dl(r,e,t){if(t){const i=fh.getScene()?.floatingOriginOffset||I.ZeroReadOnly;r.setFloat4(e,t.normal.x,t.normal.y,t.normal.z,t.d+I.Dot(t.normal,i))}}class pt{static get DiffuseTextureEnabled(){return this._DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){this._DiffuseTextureEnabled!==e&&(this._DiffuseTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get BaseWeightTextureEnabled(){return this._BaseWeightTextureEnabled}static set BaseWeightTextureEnabled(e){this._BaseWeightTextureEnabled!==e&&(this._BaseWeightTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get BaseDiffuseRoughnessTextureEnabled(){return this._BaseDiffuseRoughnessTextureEnabled}static set BaseDiffuseRoughnessTextureEnabled(e){this._BaseDiffuseRoughnessTextureEnabled!==e&&(this._BaseDiffuseRoughnessTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get DetailTextureEnabled(){return this._DetailTextureEnabled}static set DetailTextureEnabled(e){this._DetailTextureEnabled!==e&&(this._DetailTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get DecalMapEnabled(){return this._DecalMapEnabled}static set DecalMapEnabled(e){this._DecalMapEnabled!==e&&(this._DecalMapEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get AmbientTextureEnabled(){return this._AmbientTextureEnabled}static set AmbientTextureEnabled(e){this._AmbientTextureEnabled!==e&&(this._AmbientTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get OpacityTextureEnabled(){return this._OpacityTextureEnabled}static set OpacityTextureEnabled(e){this._OpacityTextureEnabled!==e&&(this._OpacityTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get ReflectionTextureEnabled(){return this._ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){this._ReflectionTextureEnabled!==e&&(this._ReflectionTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get EmissiveTextureEnabled(){return this._EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){this._EmissiveTextureEnabled!==e&&(this._EmissiveTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get SpecularTextureEnabled(){return this._SpecularTextureEnabled}static set SpecularTextureEnabled(e){this._SpecularTextureEnabled!==e&&(this._SpecularTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get BumpTextureEnabled(){return this._BumpTextureEnabled}static set BumpTextureEnabled(e){this._BumpTextureEnabled!==e&&(this._BumpTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get LightmapTextureEnabled(){return this._LightmapTextureEnabled}static set LightmapTextureEnabled(e){this._LightmapTextureEnabled!==e&&(this._LightmapTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get RefractionTextureEnabled(){return this._RefractionTextureEnabled}static set RefractionTextureEnabled(e){this._RefractionTextureEnabled!==e&&(this._RefractionTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get ColorGradingTextureEnabled(){return this._ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){this._ColorGradingTextureEnabled!==e&&(this._ColorGradingTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get FresnelEnabled(){return this._FresnelEnabled}static set FresnelEnabled(e){this._FresnelEnabled!==e&&(this._FresnelEnabled=e,Be.MarkAllMaterialsAsDirty(4))}static get ClearCoatTextureEnabled(){return this._ClearCoatTextureEnabled}static set ClearCoatTextureEnabled(e){this._ClearCoatTextureEnabled!==e&&(this._ClearCoatTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get ClearCoatBumpTextureEnabled(){return this._ClearCoatBumpTextureEnabled}static set ClearCoatBumpTextureEnabled(e){this._ClearCoatBumpTextureEnabled!==e&&(this._ClearCoatBumpTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get ClearCoatTintTextureEnabled(){return this._ClearCoatTintTextureEnabled}static set ClearCoatTintTextureEnabled(e){this._ClearCoatTintTextureEnabled!==e&&(this._ClearCoatTintTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get SheenTextureEnabled(){return this._SheenTextureEnabled}static set SheenTextureEnabled(e){this._SheenTextureEnabled!==e&&(this._SheenTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get AnisotropicTextureEnabled(){return this._AnisotropicTextureEnabled}static set AnisotropicTextureEnabled(e){this._AnisotropicTextureEnabled!==e&&(this._AnisotropicTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get ThicknessTextureEnabled(){return this._ThicknessTextureEnabled}static set ThicknessTextureEnabled(e){this._ThicknessTextureEnabled!==e&&(this._ThicknessTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get RefractionIntensityTextureEnabled(){return this._ThicknessTextureEnabled}static set RefractionIntensityTextureEnabled(e){this._RefractionIntensityTextureEnabled!==e&&(this._RefractionIntensityTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get TranslucencyIntensityTextureEnabled(){return this._TranslucencyIntensityTextureEnabled}static set TranslucencyIntensityTextureEnabled(e){this._TranslucencyIntensityTextureEnabled!==e&&(this._TranslucencyIntensityTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get TranslucencyColorTextureEnabled(){return this._TranslucencyColorTextureEnabled}static set TranslucencyColorTextureEnabled(e){this._TranslucencyColorTextureEnabled!==e&&(this._TranslucencyColorTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}static get IridescenceTextureEnabled(){return this._IridescenceTextureEnabled}static set IridescenceTextureEnabled(e){this._IridescenceTextureEnabled!==e&&(this._IridescenceTextureEnabled=e,Be.MarkAllMaterialsAsDirty(1))}}pt._DiffuseTextureEnabled=!0;pt._BaseWeightTextureEnabled=!0;pt._BaseDiffuseRoughnessTextureEnabled=!0;pt._DetailTextureEnabled=!0;pt._DecalMapEnabled=!0;pt._AmbientTextureEnabled=!0;pt._OpacityTextureEnabled=!0;pt._ReflectionTextureEnabled=!0;pt._EmissiveTextureEnabled=!0;pt._SpecularTextureEnabled=!0;pt._BumpTextureEnabled=!0;pt._LightmapTextureEnabled=!0;pt._RefractionTextureEnabled=!0;pt._ColorGradingTextureEnabled=!0;pt._FresnelEnabled=!0;pt._ClearCoatTextureEnabled=!0;pt._ClearCoatBumpTextureEnabled=!0;pt._ClearCoatTintTextureEnabled=!0;pt._SheenTextureEnabled=!0;pt._AnisotropicTextureEnabled=!0;pt._ThicknessTextureEnabled=!0;pt._RefractionIntensityTextureEnabled=!0;pt._TranslucencyIntensityTextureEnabled=!0;pt._TranslucencyColorTextureEnabled=!0;pt._IridescenceTextureEnabled=!0;function EA(r,e,t){if(!r||r.LOGARITHMICDEPTH||r.indexOf&&r.indexOf("LOGARITHMICDEPTH")>=0){const i=t.activeCamera;i.mode===1&&Ee.Error("Logarithmic depth is not compatible with orthographic cameras!",20),e.setFloat("logarithmicDepthConstant",2/(Math.log(i.maxZ+1)/Math.LN2))}}const u0={r:0,g:0,b:0},io={NUM_MORPH_INFLUENCERS:0,NORMAL:!1,TANGENT:!1,UV:!1,UV2:!1,COLOR:!1};function vA(r,e,t,i=!1){t&&r.fogEnabled&&(!e||e.applyFog)&&r.fogMode!==0&&(t.setFloat4("vFogInfos",r.fogMode,r.fogStart,r.fogEnd,r.fogDensity),i?(r.fogColor.toLinearSpaceToRef(u0,r.getEngine().useExactSrgbConversions),t.setColor3("vFogColor",u0)):t.setColor3("vFogColor",r.fogColor))}function jO(r,e,t,i,s,n,o,c,h,f){const _=r.numMaxInfluencers||r.numInfluencers;return _<=0?0:(e.push("#define MORPHTARGETS"),r.hasPositions&&e.push("#define MORPHTARGETTEXTURE_HASPOSITIONS"),r.hasNormals&&e.push("#define MORPHTARGETTEXTURE_HASNORMALS"),r.hasTangents&&e.push("#define MORPHTARGETTEXTURE_HASTANGENTS"),r.hasUVs&&e.push("#define MORPHTARGETTEXTURE_HASUVS"),r.hasUV2s&&e.push("#define MORPHTARGETTEXTURE_HASUV2S"),r.hasColors&&e.push("#define MORPHTARGETTEXTURE_HASCOLORS"),r.supportsPositions&&s&&e.push("#define MORPHTARGETS_POSITION"),r.supportsNormals&&n&&e.push("#define MORPHTARGETS_NORMAL"),r.supportsTangents&&o&&e.push("#define MORPHTARGETS_TANGENT"),r.supportsUVs&&c&&e.push("#define MORPHTARGETS_
187UV"),r.supportsUV2s&&h&&e.push("#define MORPHTARGETS_UV2"),r.supportsColors&&f&&e.push("#define MORPHTARGETS_COLOR"),e.push("#define NUM_MORPH_INFLUENCERS "+_),r.isUsingTextureForTargets&&e.push("#define MORPHTARGETS_TEXTURE"),io.NUM_MORPH_INFLUENCERS=_,io.NORMAL=n,io.TANGENT=o,io.UV=c,io.UV2=h,io.COLOR=f,AA(t,i,io,s),_)}function AA(r,e,t,i=!0){const s=t.NUM_MORPH_INFLUENCERS;if(s>0&&vt.LastCreatedEngine){const n=vt.LastCreatedEngine.getCaps().maxVertexAttribs,o=e.morphTargetManager;if(o?.isUsingTextureForTargets)return;const c=o&&o.supportsPositions&&i,h=o&&o.supportsNormals&&t.NORMAL,f=o&&o.supportsTangents&&t.TANGENT,_=o&&o.supportsUVs&&t.UV1,d=o&&o.supportsUV2s&&t.UV2,g=o&&o.supportsColors&&t.VERTEXCOLOR;for(let p=0;p<s;p++)c&&r.push("position"+p),h&&r.push("normal"+p),f&&r.push("tangent"+p),_&&r.push("uv_"+p),d&&r.push("uv2_"+p),g&&r.push("color"+p),r.length>n&&Ee.Error("Cannot add more vertex attributes for mesh "+e.name)}}function RA(r,e=!1){r.push("world0"),r.push("world1"),r.push("world2"),r.push("world3"),e&&(r.push("previousWorld0"),r.push("previousWorld1"),r.push("previousWorld2"),r.push("previousWorld3"))}function SA(r,e){const t=r.morphTargetManager;!r||!t||e.setFloatArray("morphTargetInfluences",t.influences)}function MA(r,e){e.bindToEffect(r,"Scene")}function qO(r,e,t,i,s=null,n=!1,o=!1,c=!1,h=!1,f=!1,_=!1,d=0){if(r.texturesEnabled&&s&&pt.ReflectionTextureEnabled){if(t.updateMatrix("reflectionMatrix",s.getReflectionTextureMatrix()),t.updateFloat2("vReflectionInfos",s.level*r.iblIntensity,d),c&&s.boundingBoxSize){const g=s;t.updateVector3("vReflectionPosition",g.boundingBoxPosition),t.updateVector3("vReflectionSize",g.boundingBoxSize)}if(n){const g=s.getSize().width;t.updateFloat2("vReflectionFilteringInfo",g,Math.log2(g))}if(f&&!e.USEIRRADIANCEMAP){const g=s.sphericalPolynomial;if(e.USESPHERICALFROMREFLECTIONMAP&&g)if(e.SPHERICAL_HARMONICS){const p=g.preScaledHarmonics;t.updateVector3("vSphericalL00",p.l00),t.updateVector3("vSphericalL1_1",p.l1_1),t.updateVector3("vSphericalL10",p.l10),t.updateVector3("vSphericalL11",p.l11),t.updateVector3("vSphericalL2_2",p.l2_2),t.updateVector3("vSphericalL2_1",p.l2_1),t.updateVector3("vSphericalL20",p.l20),t.updateVector3("vSphericalL21",p.l21),t.updateVector3("vSphericalL22",p.l22)}else t.updateFloat3("vSphericalX",g.x.x,g.x.y,g.x.z),t.updateFloat3("vSphericalY",g.y.x,g.y.y,g.y.z),t.updateFloat3("vSphericalZ",g.z.x,g.z.y,g.z.z),t.updateFloat3("vSphericalXX_ZZ",g.xx.x-g.zz.x,g.xx.y-g.zz.y,g.xx.z-g.zz.z),t.updateFloat3("vSphericalYY_ZZ",g.yy.x-g.zz.x,g.yy.y-g.zz.y,g.yy.z-g.zz.z),t.updateFloat3("vSphericalZZ",g.zz.x,g.zz.y,g.zz.z),t.updateFloat3("vSphericalXY",g.xy.x,g.xy.y,g.xy.z),t.updateFloat3("vSphericalYZ",g.yz.x,g.yz.y,g.yz.z),t.updateFloat3("vSphericalZX",g.zx.x,g.zx.y,g.zx.z)}else h&&e.USEIRRADIANCEMAP&&e.USE_IRRADIANCE_DOMINANT_DIRECTION&&s.irradianceTexture&&t.updateVector3("vReflectionDominantDirection",s.irradianceTexture._dominantDirection);o&&t.updateFloat3("vReflectionMicrosurfaceInfos",s.getSize().width,s.lodGenerationScale,s.lodGenerationOffset)}_&&t.updateColor3("vReflectionColor",i)}function va(r,e,t){e._needUVs=!0,e[t]=!0,r.optimizeUVAllocation&&r.getTextureMatrix().isIdentityAs3x2()?(e[t+"DIRECTUV"]=r.coordinatesIndex+1,e["MAINUV"+(r.coordinatesIndex+1)]=!0):e[t+"DIRECTUV"]=0}function Aa(r,e,t){const i=r.getTextureMatrix();e.updateMatrix(t+"Matrix",i)}function KO(r,e,t){t.BAKED_VERTEX_ANIMATION_TEXTURE&&t.INSTANCES&&r.push("bakedVertexAnimationSettingsInstanced")}function CA(r,e,t){if(!(!e||!r)&&(r.computeBonesUsingShaders&&e._bonesComputationForcedToCPU&&(r.computeBonesUsingShaders=!1),r.useBones&&r.computeBonesUsingShaders&&r.skeleton)){const i=r.skeleton;if(i.isUsingTextureForMatrices&&e.getUniformIndex("boneTextureInfo")>-1){const s=i.getTransformMatrixTexture(r);
187e.setTexture("boneSampler",s),e.setFloat2("boneTextureInfo",i._textureWidth,i._textureHeight)}else{const s=i.getTransformMatrices(r);s&&e.setMatrices("mBones",s)}}}function ZO(r,e,t,i,s,n=!0){r._bindLight(e,t,i,s,n)}function QO(r,e,t,i,s=4){const n=Math.min(e.lightSources.length,s);for(let o=0;o<n;o++){const c=e.lightSources[o];ZO(c,o,r,t,typeof i=="boolean"?i:i.SPECULARTERM,e.receiveShadows)}}function $O(r,e,t,i){t.NUM_BONE_INFLUENCERS>0&&(i.addCPUSkinningFallback(0,e),r.push("matricesIndices"),r.push("matricesWeights"),t.NUM_BONE_INFLUENCERS>4&&(r.push("matricesIndicesExtra"),r.push("matricesWeightsExtra")))}function JO(r,e){(e.INSTANCES||e.THIN_INSTANCES)&&RA(r,!!e.PREPASS_VELOCITY),e.INSTANCESCOLOR&&r.push("instanceColor")}function ew(r,e,t=4,i=0){let s=0;for(let n=0;n<t&&r["LIGHT"+n];n++)n>0&&(s=i+n,e.addFallback(s,"LIGHT"+n)),r.SHADOWS||(r["SHADOW"+n]&&e.addFallback(i,"SHADOW"+n),r["SHADOWPCF"+n]&&e.addFallback(i,"SHADOWPCF"+n),r["SHADOWPCSS"+n]&&e.addFallback(i,"SHADOWPCSS"+n),r["SHADOWPOISSON"+n]&&e.addFallback(i,"SHADOWPOISSON"+n),r["SHADOWESM"+n]&&e.addFallback(i,"SHADOWESM"+n),r["SHADOWCLOSEESM"+n]&&e.addFallback(i,"SHADOWCLOSEESM"+n));return s}function tw(r,e){return e.fogEnabled&&r.applyFog&&e.fogMode!==0}function iw(r,e,t,i,s,n,o,c=!1,h=!1,f,_){if(o._areMiscDirty){o.LOGARITHMICDEPTH=t,o.POINTSIZE=i,o.FOG=s&&tw(r,e),o.NONUNIFORMSCALING=r.nonUniformScaling,o.ALPHATEST=n,o.DECAL_AFTER_DETAIL=c,o.USE_VERTEX_PULLING=h,o.RIGHT_HANDED=e.useRightHandedSystem;const d=f?.geometry?.getIndexBuffer(),g=f?f.isUnIndexed:!1;o.VERTEX_PULLING_USE_INDEX_BUFFER=!!d&&!g,o.VERTEX_PULLING_INDEX_BUFFER_32BITS=d&&!g?d.is32Bits:!1,o.VERTEXOUTPUT_INVARIANT=!!_}}function sw(r,e,t,i=!1){if(!r.lightsEnabled||i)return!0;const s=e.lightSources,n=Math.min(s.length,t);for(let o=0;o<n;o++)if(!s[o].areLightTexturesReady())return!1;return!0}function nw(r,e,t,i,s=4,n=!1){if(!t._areLightsDirty)return t._needNormals;let o=0;const c={needNormals:t._needNormals,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(r.lightsEnabled&&!n){for(const _ of e.lightSources)if(aw(r,e,_,o,t,i,c),o++,o===s)break}t.SPECULARTERM=c.specularEnabled,t.SHADOWS=c.shadowEnabled;const h=Math.max(s,t.MAXLIGHTCOUNT||0);for(let _=o;_<h;_++)t["LIGHT"+_]!==void 0&&(t["LIGHT"+_]=!1,t["HEMILIGHT"+_]=!1,t["POINTLIGHT"+_]=!1,t["DIRLIGHT"+_]=!1,t["SPOTLIGHT"+_]=!1,t["AREALIGHT"+_]=!1,t["CLUSTLIGHT"+_]=!1,t["SHADOW"+_]=!1,t["SHADOWCSM"+_]=!1,t["SHADOWCSMDEBUG"+_]=!1,t["SHADOWCSMNUM_CASCADES"+_]=!1,t["SHADOWCSMUSESHADOWMAXZ"+_]=!1,t["SHADOWCSMNOBLEND"+_]=!1,t["SHADOWCSM_RIGHTHANDED"+_]=!1,t["SHADOWPCF"+_]=!1,t["SHADOWPCSS"+_]=!1,t["SHADOWPOISSON"+_]=!1,t["SHADOWESM"+_]=!1,t["SHADOWCLOSEESM"+_]=!1,t["SHADOWCUBE"+_]=!1,t["SHADOWLOWQUALITY"+_]=!1,t["SHADOWMEDIUMQUALITY"+_]=!1);t.LIGHTCOUNT=o,t.MAXLIGHTCOUNT=s;const f=r.getEngine().getCaps();return t.SHADOWFLOAT===void 0&&(c.needRebuild=!0),t.SHADOWFLOAT=c.shadowEnabled&&(f.textureFloatRender&&f.textureFloatLinearFiltering||f.textureHalfFloatRender&&f.textureHalfFloatLinearFiltering),t.LIGHTMAPEXCLUDED=c.lightmapMode,c.needRebuild&&t.rebuild(),c.needNormals}function rw(r,e,t,i=!1,s=8,n=!1){if(e&&pt.ReflectionTextureEnabled){if(!e.isReadyOrNotBlocking())return!1;t._needNormals=!0,t.REFLECTION=!0,t.GAMMAREFLECTION=e.gammaSpace,t.RGBDREFLECTION=e.isRGBD,t.LODINREFLECTIONALPHA=e.lodLevelInAlpha,t.LINEARSPECULARREFLECTION=e.linearSpecularLOD,t.USEIRRADIANCEMAP=!1,t.LODBASEDMICROSFURACE=r.getEngine().getCaps().textureLOD;const o=r.getEngine();switch(i&&s>0?(t.NUM_SAMPLES=""+s,o._features.needTypeSuffixInShaderConstants&&(t.NUM_SAMPLES=t.NUM_SAMPLES+"u"),t.REALTIME_FILTERING=!0,r.iblCdfGenerator&&(t.IBL_CDF_FILTERING=!0)):t.REALTIME_FILTERING=!1,t.INVERTCUBICMAP=e.coordinatesMode===6,t.REFLECTIONMAP_3D=e.isCube,t.REFLECTIONMAP_OPPOSITEZ=t.REFLECTIONMAP_3D&&r.useRightHandedSystem?!e.invertZ:e.invertZ,t.REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,e.coordinatesMode){case 0:t.REFLECTIONMAP_EXPLICIT=!0;break;case 2:t.REFLECTIONMAP_PLANAR=!0;break;case 4:t.REFLECTIONMAP_PROJECTION=!0;break;case 5:t.REFLECTIONMAP_SKYBOX=!0;break;case 1:t.REFLECTIONMAP_SPHERICAL=!0;break;case 7:t.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case 8:t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case 9:t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;case 3:case 6:default:t.REFLECTIONMAP_CUBIC=!0,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!!e.boundingBoxSize;break}e.coordinatesMode!==5&&(e.irradianceTexture?(t.USEIRRADIANCEMAP=!0,t.USESPHERICALFROMREFLECTIONMAP=!1,t.USESPHERICALINVERTEX=!1,e.irradianceTexture._dominantDirection?t.USE_IRRADIANCE_DOMINANT_DIRECTION=!0:t.USE_IRRADIANCE_DOMINANT_DIRECTION=!1):e.isCube&&(t.USESPHERICALFROMREFLECTIONMAP=!0,t.USEIRRADIANCEMAP=!1,t.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,t.USESPHERICALINVERTEX=n))}else t.REFLECTION=!1,t.REFLECTIONMAP_3D=!1,t.REFLECTIONMAP_SPHERICAL=!1,t.REFLECTIONMAP_PLANAR=!1,t.REFLECTIONMAP_CUBIC=!1,t.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,t.REFLECTIONMAP_PROJECTION=!1,t.REFLECTIONMAP_SKYBOX=!1,t.REFLECTIONMAP_EXPLICIT=!1,t.REFLECTIONMAP_EQUIRECTANGULAR=!1,t.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,t.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.INVERTCUBICMAP=!1,t.USESPHERICALFROMREFLECTIONMAP=!1,t.USEIRRADIANCEMAP=!1,t.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,t.USESPHERICALINVERTEX=!1,t.REFLECTIONMAP_OPPOSITEZ=!1,t.LODINREFLECTIONALPHA=!1,t.GAMMAREFLECTION=!1,t.RGBDRE
187FLECTION=!1,t.LINEARSPECULARREFLECTION=!1;return!0}function aw(r,e,t,i,s,n,o){switch(o.needNormals=!0,s["LIGHT"+i]===void 0&&(o.needRebuild=!0),s["LIGHT"+i]=!0,s["SPOTLIGHT"+i]=!1,s["HEMILIGHT"+i]=!1,s["POINTLIGHT"+i]=!1,s["DIRLIGHT"+i]=!1,s["AREALIGHT"+i]=!1,s["CLUSTLIGHT"+i]=!1,t.prepareLightSpecificDefines(s,i),s["LIGHT_FALLOFF_PHYSICAL"+i]=!1,s["LIGHT_FALLOFF_GLTF"+i]=!1,s["LIGHT_FALLOFF_STANDARD"+i]=!1,t.falloffType){case Lt.FALLOFF_GLTF:s["LIGHT_FALLOFF_GLTF"+i]=!0;break;case Lt.FALLOFF_PHYSICAL:s["LIGHT_FALLOFF_PHYSICAL"+i]=!0;break;case Lt.FALLOFF_STANDARD:s["LIGHT_FALLOFF_STANDARD"+i]=!0;break}if(t.specular.equalsFloats(0,0,0)||(o.specularEnabled=!0),s["SHADOW"+i]=!1,s["SHADOWCSM"+i]=!1,s["SHADOWCSMDEBUG"+i]=!1,s["SHADOWCSMNUM_CASCADES"+i]=!1,s["SHADOWCSMUSESHADOWMAXZ"+i]=!1,s["SHADOWCSMNOBLEND"+i]=!1,s["SHADOWCSM_RIGHTHANDED"+i]=!1,s["SHADOWPCF"+i]=!1,s["SHADOWPCSS"+i]=!1,s["SHADOWPOISSON"+i]=!1,s["SHADOWESM"+i]=!1,s["SHADOWCLOSEESM"+i]=!1,s["SHADOWCUBE"+i]=!1,s["SHADOWLOWQUALITY"+i]=!1,s["SHADOWMEDIUMQUALITY"+i]=!1,e&&e.receiveShadows&&r.shadowsEnabled&&t.shadowEnabled){const c=t.getShadowGenerator(r.activeCamera)??t.getShadowGenerator();if(c){const h=c.getShadowMap();h&&h.renderList&&h.renderList.length>0&&(o.shadowEnabled=!0,c.prepareDefines(s,i))}}t.lightmapMode!=Lt.LIGHTMAP_DEFAULT?(o.lightmapMode=!0,s["LIGHTMAPEXCLUDED"+i]=!0,s["LIGHTMAPNOSPECULAR"+i]=t.lightmapMode==Lt.LIGHTMAP_SHADOWSONLY):(s["LIGHTMAPEXCLUDED"+i]=!1,s["LIGHTMAPNOSPECULAR"+i]=!1)}function ow(r,e,t,i,s,n=null,o=!1){let c=pw(r,i);n!==!1&&(c=YO(t,r,i)),i.DEPTHPREPASS!==!e.getColorWrite()&&(i.DEPTHPREPASS=!i.DEPTHPREPASS,c=!0),i.INSTANCES!==s&&(i.INSTANCES=s,c=!0),i.THIN_INSTANCES!==o&&(i.THIN_INSTANCES=o,c=!0),c&&i.markAsUnprocessed()}const lw=40,cw=64,f0=new WeakMap,d0=new WeakSet;function hw(r,e){if(r.useBones&&r.computeBonesUsingShaders&&r.skeleton){e.NUM_BONE_INFLUENCERS=r.numBoneInfluencers;const t=e.BONETEXTURE!==void 0;if(r.skeleton.isUsingTextureForMatrices&&t)e.BONETEXTURE=!0;else{e.BonesPerMesh=r.skeleton.bones.length+1,e.BONETEXTURE=t?!1:void 0;const i=r.getScene(),s=i.prePassRenderer;if(s&&s.enabled){const c=s.excludedSkinnedMesh.indexOf(r)===-1;e.BONES_VELOCITY_ENABLED=c}const n=e.MULTIVIEW===!0,o=e.BonesPerMesh*2+(n?1:0);if(f0.get(r.skeleton)!==o){f0.set(r.skeleton,o);const c=i.getEngine().getCaps().maxVertexUniformVectors;if(c&&!d0.has(r.skeleton)){const h=e.BonesPerMesh*4,_=Math.max(c-(n?cw:lw),0);(h>_||n&&h*3>c)&&(d0.add(r.skeleton),Ee.Warn(`Skeleton "${r.skeleton.name}": ${r.skeleton.bones.length} bones stored as vertex uniforms use ${h} of ~${_} usable uniform vectors${n?" (multiview)":""} on a device reporting ${c}. This can exceed the GPU vertex-uniform limit and make the mesh silently fail to render. Set skeleton.useTextureToStoreBoneMatrices = true to store bone matrices in a texture.`))}}}}else e.NUM_BONE_INFLUENCERS=0,e.BonesPerMesh=0,e.BONETEXTURE!==void 0&&(e.BONETEXTURE=!1)}function uw(r,e){const t=r.morphTargetManager;t?(e.MORPHTARGETS_UV=t.supportsUVs&&e.UV1,e.MORPHTARGETS_UV2=t.supportsUV2s&&e.UV2,e.MORPHTARGETS_TANGENT=t.supportsTangents&&e.TANGENT,e.MORPHTARGETS_NORMAL=t.supportsNormals&&e.NORMAL,e.MORPHTARGETS_POSITION=t.supportsPositions,e.MORPHTARGETS_COLOR=t.supportsColors,e.MORPHTARGETTEXTURE_HASUVS=t.hasUVs,e.MORPHTARGETTEXTURE_HASUV2S=t.hasUV2s,e.MORPHTARGETTEXTURE_HASTANGENTS=t.hasTangents,e.MORPHTARGETTEXTURE_HASNORMALS=t.hasNormals,e.MORPHTARGETTEXTURE_HASPOSITIONS=t.hasPositions,e.MORPHTARGETTEXTURE_HASCOLORS=t.hasColors,e.NUM_MORPH_INFLUENCERS=t.numMaxInfluencers||t.numInfluencers,e.MORPHTARGETS=e.NUM_MORPH_INFLUENCERS>0,e.MORPHTARGETS_TEXTURE=t.isUsingTextureForTargets):(e.MORPHTARGETS_UV=!1,e.MORPHTARGETS_UV2=!1,e.MORPHTARGETS_TANGENT=!1,e.MORPHTARGETS_NORMAL=!1,e.MORPHTARGETS_POSITION=!1,e.MORPHTARGETS_COLOR=!1,e.MORPHTARGETTEXTURE_HASUVS=!1,e.MORPHTARGETTEXTURE_HASUV2S=!1,e.MORPHTARGETTEXTURE_HASTANGENTS=!1,e.MORPHTARGETTEXTURE_HASNORMALS=!1,e.MORPHTARGETTEXTURE_HASPOSITIONS=!1,e.MORPHTARGETTEXTURE_HAS_COLORS=!1,e.MORPHTARGETS=!1,e.NUM_MORPH_INFLUENCERS=0)}function fw(r,e){const t=r.bakedVertexAnimationManager;e.BAKED_VERTEX_ANIMATION_TEXTURE=!!(t&&t.isEnabled)}function dw(r,e,t,i,s=!1,n=!0,o=!0){if(!e._areAttributesDirty&&e._needNormals===e._normals&&e._needUVs===e._uvs)return!1;e._normals=e._needNormals,e._uvs=e._needUVs,e.NORMAL=e._needNormals&&r.isVerticesDataPresent("normal"),e._needNormals&&r.isVerticesDataPresent("tangent")&&(e.TANGENT=!0);for(let c=1;c<=6;++c)e["UV"+c]=e._needUVs?r.isVerticesDataPresent(`uv${c===1?"":c}`):!1;{const c=r.useVertexColors&&r.isVerticesDataPresent("color");e.VERTEXCOLOR=c,e.VERTEXALPHA=r.hasVertexAlpha&&c&&n}return r.isVerticesDataPresent("instanceColor")&&(r.hasInstances||r.hasThinInstances)&&(e.INSTANCESCOLOR=!0),hw(r,e),s&&uw(r,e),o&&fw(r,e),!0}function _w(r,e){if(r.activeCamera){const t=e.MULTIVIEW;e.MULTIVIEW=r.activeCamera.outputRenderTarget!==null&&r.activeCamera.outputRenderTarget.getViewCount()>1,e.MULTIVIEW!=t&&e.markAsUnprocessed()}}function mw(r,e,t){const i=e.ORDER_INDEPENDENT_TRANSPARENCY,s=e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;
187e.ORDER_INDEPENDENT_TRANSPARENCY=r.useOrderIndependentTransparency&&t,e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!r.getEngine().getCaps().textureFloatLinearFiltering,(i!==e.ORDER_INDEPENDENT_TRANSPARENCY||s!==e.ORDER_INDEPENDENT_TRANSPARENCY_16BITS)&&e.markAsUnprocessed()}function gw(r,e,t){const i=e.PREPASS;if(!e._arePrePassDirty)return;const s=[{type:1,define:"PREPASS_POSITION",index:"PREPASS_POSITION_INDEX"},{type:9,define:"PREPASS_LOCAL_POSITION",index:"PREPASS_LOCAL_POSITION_INDEX"},{type:2,define:"PREPASS_VELOCITY",index:"PREPASS_VELOCITY_INDEX"},{type:11,define:"PREPASS_VELOCITY_LINEAR",index:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:3,define:"PREPASS_REFLECTIVITY",index:"PREPASS_REFLECTIVITY_INDEX"},{type:0,define:"PREPASS_IRRADIANCE_LEGACY",index:"PREPASS_IRRADIANCE_LEGACY_INDEX"},{type:7,define:"PREPASS_ALBEDO_SQRT",index:"PREPASS_ALBEDO_SQRT_INDEX"},{type:5,define:"PREPASS_DEPTH",index:"PREPASS_DEPTH_INDEX"},{type:10,define:"PREPASS_SCREENSPACE_DEPTH",index:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:6,define:"PREPASS_NORMAL",index:"PREPASS_NORMAL_INDEX"},{type:8,define:"PREPASS_WORLD_NORMAL",index:"PREPASS_WORLD_NORMAL_INDEX"},{type:14,define:"PREPASS_IRRADIANCE",index:"PREPASS_IRRADIANCE_INDEX"}];if(r.prePassRenderer&&r.prePassRenderer.enabled&&t){e.PREPASS=!0,e.SCENE_MRT_COUNT=r.prePassRenderer.mrtCount,e.PREPASS_NORMAL_WORLDSPACE=r.prePassRenderer.generateNormalsInWorldSpace,e.PREPASS_COLOR=!0,e.PREPASS_COLOR_INDEX=0;for(let n=0;n<s.length;n++){const o=r.prePassRenderer.getIndex(s[n].type);o!==-1?(e[s[n].define]=!0,e[s[n].index]=o):e[s[n].define]=!1}}else{e.PREPASS=!1;for(let n=0;n<s.length;n++)e[s[n].define]=!1}e.PREPASS!=i&&(e.markAsUnprocessed(),e.markAsImageProcessingDirty())}function pw(r,e){let t=!1;if(r.activeCamera){const i=e.CAMERA_ORTHOGRAPHIC?1:0,s=e.CAMERA_PERSPECTIVE?1:0,n=r.activeCamera.mode===1?1:0,o=r.activeCamera.mode===0?1:0;(i^n||s^o)&&(e.CAMERA_ORTHOGRAPHIC=n===1,e.CAMERA_PERSPECTIVE=o===1,t=!0)}return t}function yw(r,e,t,i,s=null,n=!1,o=!1,c=!1,h=!1,f=!1){s&&s.push("Light"+r),!n&&(e.push("vLightData"+r,"vLightDiffuse"+r,"vLightSpecular"+r,"vLightDirection"+r,"vLightWidth"+r,"vLightHeight"+r,"vLightFalloff"+r,"vLightGround"+r,"vSliceData"+r,"vSliceRanges"+r,"lightMatrix"+r,"shadowsInfo"+r,"depthValues"+r),t.push("shadowTexture"+r),t.push("depthTexture"+r),e.push("viewFrustumZ"+r,"cascadeBlendFactor"+r,"lightSizeUVCorrection"+r,"depthCorrection"+r,"penumbraDarkness"+r,"frustumLengths"+r),i&&(t.push("projectionLightTexture"+r),e.push("textureProjectionMatrix"+r)),o&&t.push("iesLightTexture"+r),h&&t.push("rectAreaLightEmissionTexture"+r),c&&(t.push("lightDataTexture"+r),f||t.push("tileMaskTexture"+r)))}function bw(r,e,t){const i=["vReflectionMicrosurfaceInfos","vReflectionDominantDirection","reflectionMatrix","vReflectionInfos","vReflectionPosition","vReflectionSize","vReflectionColor","vReflectionFilteringInfo"];r.push(...i);const s=["reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","irradianceSampler","icdfSampler"];e.push(...s)}function xw(r,e,t,i=4){let s,n,o=null;if(r.uniformsNames){const c=r;s=c.uniformsNames,n=c.uniformBuffersNames,e=c.samplers,t=c.defines,i=c.maxSimultaneousLights||0,o=c.shaderLanguage??null}else s=r,e||(e=[]);for(let c=0;c<i&&t["LIGHT"+c];c++)yw(c,s,e,t["PROJECTEDLIGHTTEXTURE"+c],n,!1,t["IESLIGHTTEXTURE"+c],t["CLUSTLIGHT"+c],t["RECTAREALIGHTEMISSIONTEXTURE"+c],o===1);t.NUM_MORPH_INFLUENCERS&&(s.push("morphTargetInfluences"),s.push("morphTargetCount")),t.BAKED_VERTEX_ANIMATION_TEXTURE&&(s.push("bakedVertexAnimationSettings"),s.push("bakedVertexAnimationTextureSizeInverted"),s.push("bakedVertexAnimationTime"),e.push("bakedVertexAnimationTexture"))}function Tw(r,e=!1,t=!1,i=!1,s=!1,n=!1){r.addUniform("vReflectionInfos",2),r.addUniform("reflectionMatrix",16),e&&r.addUniform("vReflectionMicrosurfaceInfos",3),t&&(r.addUniform("vReflectionPosition",3),r.addUniform("vReflectionSize",3)),i&&(r.addUniform("vReflectionFilteringInfo",2),r.addUniform("vReflectionDominantDirection",3)),n&&r.addUniform("vReflectionColor",3),s&&(r.addUniform("vSphericalL00",3),r.addUniform("vSphericalL1_1",3),r.addUniform("vSphericalL10",3),r.addUniform("vSphericalL11",3),r.addUniform("vSphericalL2_2",3),r.addUniform("vSphericalL2_1",3),r.addUniform("vSphericalL20",3),r.addUniform("vSphericalL21",3),r.addUniform("vSphericalL22",3),r.addUniform("vSphericalX",3),r.addUniform("vSphericalY",3),r.addUniform("vSphericalZ",3),r.addUniform("vSphericalXX_ZZ",3),r.addUniform("vSphericalYY_ZZ",3),r.addUniform("vSphericalZZ",3),r.addUniform("vSphericalXY",3),r.addUniform("vSphericalYZ",3),r.addUniform("vSphericalZX",3))}let wi=(()=>{var r;let e=[],t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],d,g=[],p=[],b,x=[],E=[],v,S=[],R=[],P,M=[],O=[],D,w=[],G=[],H,ie=[],ne=[],ce,k=[],te=[],X,q=[],W=[],K,Z=[],F=[],A,N=[],Y=[],se,ue=[],pe=[],Ie,Le=[],J=[],_e,ye=[],Ne=[],Je,je=[],yt=[],Yt,kt=[],Et=[],Gt,zt=[],nt=[],oe,ze=[],si=[],$t,oi=[],ti=[],ii,Ct=[],ni=[],Pt,Ht=[],ri=[],di,_i=[],As=[],rs,Bi,St,Q,V=[],Te=[],We;return r=class{get useVertexPulling(){return this._useVertexPulling}set useVertexPulling(z){this._useVertexPulling!==z&&(this._useVertexPulling=z,this.markAsDirty(r.MiscDirtyFlag))}get _supportGlowLayer(){return!1}set _glowModeEnabled(z){}get shaderLanguage(){return this._shaderLanguage}get canRenderToMRT(){return!1}set alpha(z){if(this._alpha===z)return;const be=this._alpha;this._alpha=z,(be===1||z===1)&&this.markAsDirty(r.MiscDirtyFlag+r.PrePassDirtyFlag)}get alpha(){return this._alpha}set backFaceCulling(z){this._backFaceCulling!==z&&(this._backFaceCulling=z,this.markAsDirty(r.TextureDirtyFlag))}
vendor: 5,859 bytes, line 187
187get backFaceCulling(){return this._backFaceCulling}set textureRepetitionMode(z){const be=Math.max(0,Math.min(z|0,4));this._textureRepetitionMode!==be&&(this._textureRepetitionMode=be,this.markAsDirty(r.TextureDirtyFlag))}get textureRepetitionMode(){return this._textureRepetitionMode}set cullBackFaces(z){this._cullBackFaces!==z&&(this._cullBackFaces=z,this.markAsDirty(r.TextureDirtyFlag))}get cullBackFaces(){return this._cullBackFaces}get blockDirtyMechanism(){return this._blockDirtyMechanism}set blockDirtyMechanism(z){this._blockDirtyMechanism!==z&&(this._blockDirtyMechanism=z,z||this.markDirty())}atomicMaterialsUpdate(z){this.blockDirtyMechanism=!0;try{z(this)}finally{this.blockDirtyMechanism=!1}}get hasRenderTargetTextures(){return this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._eventInfo.hasRenderTargetTextures}set onDispose(z){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(z)}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new Oe),this._onBindObservable}set onBind(z){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(z)}get onUnBindObservable(){return this._onUnBindObservable||(this._onUnBindObservable=new Oe),this._onUnBindObservable}get onEffectCreatedObservable(){return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new Oe),this._onEffectCreatedObservable}set alphaMode(z){this._alphaMode[0]!==z&&(this._alphaMode[0]=z,this.markAsDirty(r.TextureDirtyFlag))}get alphaMode(){return this._alphaMode[0]}get alphaModes(){return this._alphaMode}setAlphaMode(z,be=0){this._alphaMode[be]!==z&&(this._alphaMode[be]=z,this.markAsDirty(r.TextureDirtyFlag))}set needDepthPrePass(z){this._needDepthPrePass!==z&&(this._needDepthPrePass=z,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))}get needDepthPrePass(){return this._needDepthPrePass}get isPrePassCapable(){return!1}set fogEnabled(z){this._fogEnabled!==z&&(this._fogEnabled=z,this.markAsDirty(r.MiscDirtyFlag))}get fogEnabled(){return this._fogEnabled}get wireframe(){switch(this._fillMode){case r.WireFrameFillMode:case r.LineListDrawMode:case r.LineLoopDrawMode:case r.LineStripDrawMode:return!0}return this._scene.forceWireframe}set wireframe(z){this.fillMode=z?r.WireFrameFillMode:r.TriangleFillMode}get pointsCloud(){switch(this._fillMode){case r.PointFillMode:case r.PointListDrawMode:return!0}return this._scene.forcePointsCloud}set pointsCloud(z){this.fillMode=z?r.PointFillMode:r.TriangleFillMode}get fillMode(){return this._fillMode}set fillMode(z){this._fillMode!==z&&(this._fillMode=z,this.markAsDirty(r.MiscDirtyFlag))}get useLogarithmicDepth(){return this._useLogarithmicDepth}set useLogarithmicDepth(z){const be=this.getScene().getEngine().getCaps().fragmentDepthSupported;z&&!be&&Ee.Warn("Logarithmic depth has been requested for a material on a device that doesn't support it."),this._useLogarithmicDepth=z&&be,this._markAllSubMeshesAsMiscDirty()}get isVertexOutputInvariant(){return this._isVertexOutputInvariant}set isVertexOutputInvariant(z){this._isVertexOutputInvariant!==z&&(this._isVertexOutputInvariant=z,this._markAllSubMeshesAsMiscDirty())}_getDrawWrapper(){return this._drawWrapper}_setDrawWrapper(z){this._drawWrapper=z}constructor(z,be,ut,Qe=!1){this.customShaderNameResolve=L(this,e),this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this._shaderLanguage=0,this._forceGLSL=!1,this._useVertexPulling=!1,this.id=L(this,i,void 0),this.uniqueId=(L(this,s),L(this,o,void 0)),this._loadedUniqueId=L(this,c),this.name=L(this,f,void 0),this.metadata=(L(this,_),L(this,g,null)),this._internalMetadata=L(this,p),this.reservedDataStore=null,this.checkReadyOnEveryCall=L(this,x,!1),this.checkReadyOnlyOnce=(L(this,E),L(this,S,!1)),this.state=(L(this,R),L(this,M,"")),this._alpha=(L(this,O),L(this,w,1)),this.inspectableCustomProperties=L(this,G),this._backFaceCulling=L(this,ie,!0),this._textureRepetitionMode=(L(this,ne),L(this,k,0)),this.textureRepetitionHexTilingParams=(L(this,te),L(this,q,[1,.6,7,.5])),this._cullBackFaces=(L(this,W),L(this,Z,!0)),this._blockDirtyMechanism=(L(this,F),!1),this.sideOrientation=L(this,N,null),this.onCompiled=(L(this,Y),null),this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new Oe,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=L(this,ue,[2]),this._needDepthPrePass=(L(this,pe),L(this,Le,!1)),this.disableDepthWrite=(L(this,J),L(this,ye,!1)),this.disableColorWrite=(L(this,Ne),L(this,je,!1)),this.forceDepthWrite=(L(this,yt),L(this,kt,!1)),this.depthFunction=(L(this,Et),L(this,zt,0)),this.separateCullingPass=(L(this,nt),L(this,ze,!1)),this._fogEnabled=(L(this,si),L(this,oi,!0)),this.pointSize=(L(this,ti),L(this,Ct,1)),this.zOffset=(L(this,ni),L(this,Ht,0)),this.zOffsetUnits=(L(this,ri),L(this,_i,0)),this.clipPlane=L(this,As),this.stencil=new VO,this._isVertexOutputInvariant=L(this,V,r.ForceVertexOutputInvariant),this._materialContext=L(this,Te),this._useUBO=!1,this._fillMode=r.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedColorWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this._parentContainer=null,this._uniformBufferLayoutBuilt=!1,this._eventInfo={},this._callbackPluginEventGeneric=()=>{},this._callbackPluginEventIsReadyForSubMesh=()=>{},this._callbackPluginEventPrepareDefines=()=>{},this._callbackPluginEventPrepareDefinesBeforeAttributes=()=>{},this._callbackPluginEventHardBindForSubMesh=()=>{},this._callbackPluginEventBindForSubMesh=()=>{},this._callbackPluginEventHasRenderTargetTextures=()=>{}
vendor: 8,777 bytes, line 187
187,this._callbackPluginEventFillRenderTargetTextures=()=>{},this._transparencyMode=null,this.name=z;const it=be||vt.LastCreatedScene;it&&(this._scene=it,this._dirtyCallbacks={},this._forceGLSL=Qe,this._dirtyCallbacks[1]=this._markAllSubMeshesAsTexturesDirty.bind(this),this._dirtyCallbacks[2]=this._markAllSubMeshesAsLightsDirty.bind(this),this._dirtyCallbacks[4]=this._markAllSubMeshesAsFresnelDirty.bind(this),this._dirtyCallbacks[8]=this._markAllSubMeshesAsAttributesDirty.bind(this),this._dirtyCallbacks[16]=this._markAllSubMeshesAsMiscDirty.bind(this),this._dirtyCallbacks[32]=this._markAllSubMeshesAsPrePassDirty.bind(this),this._dirtyCallbacks[127]=this._markAllSubMeshesAsAllDirty.bind(this),this.id=z||Rt.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new pA(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._uniformBuffer=new Xe(this._scene.getEngine(),void 0,void 0,z),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,this._createUniformBuffer(),ut||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),r.OnEventObservable.notifyObservers(this,1))}_createUniformBuffer(){const z=this.getScene().getEngine();this._uniformBuffer?.dispose(),z.isWebGPU&&!this._forceGLSL?(this._uniformBuffer=new Xe(z,void 0,void 0,this.name,!0),this._shaderLanguage=1):this._uniformBuffer=new Xe(this._scene.getEngine(),void 0,void 0,this.name),this._uniformBufferLayoutBuilt=!1}toString(z){return"Name: "+this.name}getClassName(){return"Material"}get _isMaterial(){return!0}get isFrozen(){return this.checkReadyOnlyOnce}freeze(){this.markDirty(),this.checkReadyOnlyOnce=!0}unfreeze(){this.markDirty(),this.checkReadyOnlyOnce=!1}isReady(z,be){return!0}isReadyForSubMesh(z,be,ut){const Qe=be.materialDefines;return Qe?(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=Qe,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),this._eventInfo.isReadyForSubMesh):!1}getEffect(){return this._drawWrapper.effect}getScene(){return this._scene}_getEffectiveOrientation(z){return this.sideOrientation!==null?this.sideOrientation:z.sideOrientation}get transparencyMode(){return this._transparencyMode}set transparencyMode(z){this._transparencyMode!==z&&(this._transparencyMode=z,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _hasTransparencyMode(){return this._transparencyMode!=null}get _transparencyModeIsBlend(){return this._transparencyMode===r.MATERIAL_ALPHABLEND||this._transparencyMode===r.MATERIAL_ALPHATESTANDBLEND}get _transparencyModeIsTest(){return this._transparencyMode===r.MATERIAL_ALPHATEST||this._transparencyMode===r.MATERIAL_ALPHATESTANDBLEND}get _disableAlphaBlending(){return this._transparencyMode===r.MATERIAL_OPAQUE||this._transparencyMode===r.MATERIAL_ALPHATEST}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:this._disableAlphaBlending?!1:this.alpha<1}needAlphaBlendingForMesh(z){return this._hasTransparencyMode?this._transparencyModeIsBlend:z.visibility<1?!0:this._disableAlphaBlending?!1:z.hasVertexAlpha||this.needAlphaBlending()}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:!1}needAlphaTestingForMesh(z){return this._hasTransparencyMode?this._transparencyModeIsTest:!this.needAlphaBlendingForMesh(z)&&this.needAlphaTesting()}getAlphaTestTexture(){return null}markDirty(z=!1){const be=this.getScene().meshes;for(const ut of be)if(ut.subMeshes){for(const Qe of ut.subMeshes)if(Qe.getMaterial()===this)for(const it of Qe._drawWrappers)it&&this._materialContext===it.materialContext&&(it._wasPreviouslyReady=!1,it._wasPreviouslyUsingInstances=null,it._forceRebindOnNextCall=z)}z&&this.markAsDirty(r.AllDirtyFlag)}_preBind(z,be=null){const ut=this._scene.getEngine(),it=(be??this.sideOrientation)===r.ClockWiseSideOrientation,Ot=z||this._getDrawWrapper();return Xv(Ot)&&Ot.materialContext&&(Ot.materialContext.useVertexPulling=this.useVertexPulling),ut.enableEffect(Ot),ut.setState(this.backFaceCulling,this.zOffset,!1,it,this._scene._mirroredCameraPosition?!this.cullBackFaces:this.cullBackFaces,this.stencil,this.zOffsetUnits),it}bind(z,be){}buildUniformLayout(){const z=this._uniformBuffer;this._eventInfo.ubo=z,this._callbackPluginEventGeneric(8,this._eventInfo),z.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(z,be,ut){const Qe=ut._drawWrapper;this._eventInfo.subMesh=ut,this._callbackPluginEventBindForSubMesh(this._eventInfo),Qe._forceRebindOnNextCall=!1}bindOnlyWorldMatrix(z){}bindView(z){this._useUBO?this._needToBindSceneUbo=!0:z.setMatrix("view",this.getScene().getViewMatrix())}bindViewProjection(z){this._useUBO?this._needToBindSceneUbo=!0:(z.setMatrix("viewProjection",this.getScene().getTransformMatrix()),z.setMatrix("projection",this.getScene().getProjectionMatrix()),z.setMatrix("inverseProjection",this.getScene().getInverseProjectionMatrix()))}bindEyePosition(z,be){this._useUBO?this._needToBindSceneUbo=!0:this._scene.bindEyePosition(z,be)}_afterBind(z,be=null,ut){if(this._scene._cachedMaterial=this,this._needToBindSceneUbo&&be&&(this._needToBindSceneUbo=!1,MA(be,this.getScene().getSceneUniformBuffer()),this._scene.finalizeSceneUbo()),z?this._scene._cachedVisibility=z.visibility:this._scene._cachedVisibility=1,this._onBindObservable&&z&&this._onBindObservable.notifyObservers(z),this.disableDepthWrite){const Qe=this._scene.getEngine();this._cachedDepthWriteState=Qe.getDepthWrite(),Qe.setDepthWrite(!1)}if(this.disableColorWrite){const Qe=this._scene.getEngine();this._cachedColorWriteState=Qe.getColorWrite(),Qe.setColorWrite(!1)}if(this.depthFunction!==0){const Qe=this._scene.getEngine();this._cachedDepthFunctionState=Qe.getDepthFunction()||0,Qe.setDepthFunction(this.depthFunction)}}unbind(){this._scene.getSceneUniformBuffer().unbindEffect(),this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),this.depthFunction!==0&&this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState),this.disableDepthWrite&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState),this.disableColorWrite&&this._scene.getEngine().setColorWrite(this._cachedColorWriteState)}getAnimatables(){return this._eventInfo.animatables=[],this._callbackPluginEventGeneric(256,this._eventInfo),this._eventInfo.animatables}getActiveTextures(){return this._eventInfo.activeTextures=[],this._callbackPluginEventGeneric(512,this._eventInfo),this._eventInfo.activeTextures}hasTexture(z){return this._eventInfo.hasTexture=!1,this._eventInfo.texture=z,this._callbackPluginEventGeneric(1024,this._eventInfo),this._eventInfo.hasTexture}clone(z){return null}_clonePlugins(z,be){const ut={};if(this._serializePlugins(ut),r._ParsePlugins(ut,z,this._scene,be),this.pluginManager)for(const Qe of this.pluginManager._plugins){const it=z.pluginManager.getPlugin(Qe.name);it&&Qe.copyTo(it)}}getBindedMeshes(){if(this.meshMap){const z=[];for(const be in this.meshMap){const ut=this.meshMap[be];ut&&z.push(ut)}return z}else return this._scene.meshes.filter(be=>be.material===this)}forceCompilation(z,be,ut,Qe){const it={clipPlane:!1,useInstances:!1,...ut},Ot=this.getScene(),wt=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;const li=()=>{if(!this._scene||!this._scene.getEngine())return;const gs=Ot.clipPlane;if(it.clipPlane&&(Ot.clipPlane=new Mn(0,0,0,1)),this._storeEffectOnSubMeshes){let Ni=!0,Hs=null;if(z.subMeshes){const $i=new tn(0,0,0,0,0,z,void 0,!1,!1);$i.materialDefines&&($i.materialDefines._renderId=-1),this.isReadyForSubMesh(z,$i,it.useInstances)||($i.effect&&$i.effect.getCompilationError()&&$i.effect.allFallbacksProcessed()?Hs=$i.effect.getCompilationError():(Ni=!1,setTimeout(li,16)))}Ni&&(this.allowShaderHotSwapping=wt,Hs&&Qe&&Qe(Hs),be&&be(this))}else this.isReady()?(this.allowShaderHotSwapping=wt,be&&be(this)):setTimeout(li,16);it.clipPlane&&(Ot.clipPlane=gs)};li()}async forceCompilationAsync(z,be){return await new Promise((ut,Qe)=>{this.forceCompilation(z,()=>{ut()},be,it=>{Qe(it)})})}markAsDirty(z){this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism||(r._DirtyCallbackArray.length=0,z&r.ImageProcessingDirtyFlag&&r._DirtyCallbackArray.push(r._ImageProcessingDirtyCallBack),z&r.TextureDirtyFlag&&r._DirtyCallbackArray.push(r._TextureDirtyCallBack),z&r.LightDirtyFlag&&r._DirtyCallbackArray.push(r._LightsDirtyCallBack),z&r.FresnelDirtyFlag&&r._DirtyCallbackArray.push(r._FresnelDirtyCallBack),z&r.AttributesDirtyFlag&&r._DirtyCallbackArray.push(r._AttributeDirtyCallBack),z&r.MiscDirtyFlag&&r._DirtyCallbackArray.push(r._MiscDirtyCallBack),z&r.PrePassDirtyFlag&&r._DirtyCallbackArray.push(r._PrePassDirtyCallBack),r._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(r._RunDirtyCallBacks),this.get
vendor: 15,789 bytes, line 187
187Scene().resetCachedMaterial())}resetDrawCache(){const z=this.getScene().meshes;for(const be of z)if(be.subMeshes)for(const ut of be.subMeshes)ut.getMaterial()===this&&ut.resetDrawCache()}_markAllSubMeshesAsDirty(z){const be=this.getScene();if(be.blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const ut=be.meshes;for(const Qe of ut)if(Qe.subMeshes){for(const it of Qe.subMeshes)if((it.getMaterial()||(be._hasDefaultMaterial?be.defaultMaterial:null))===this)for(const wt of it._drawWrappers)!wt||!wt.defines||!wt.defines.markAllAsDirty||this._materialContext===wt.materialContext&&z(wt.defines)}}_markScenePrePassDirty(){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;const z=this.getScene().enablePrePassRenderer();z&&z.markAsDirty()}_markAllSubMeshesAsAllDirty(){this._markAllSubMeshesAsDirty(r._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){this._markAllSubMeshesAsDirty(r._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){this._markAllSubMeshesAsDirty(r._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){this._markAllSubMeshesAsDirty(r._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){this._markAllSubMeshesAsDirty(r._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){this._markAllSubMeshesAsDirty(r._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){this._markAllSubMeshesAsDirty(r._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){this._markAllSubMeshesAsDirty(r._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){this._markAllSubMeshesAsDirty(r._PrePassDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){this._markAllSubMeshesAsDirty(r._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){if(this._scene.performancePriority!==0){this.checkReadyOnlyOnce=!0;const z=this._scene.onScenePerformancePriorityChangedObservable.addOnce(()=>{this.checkReadyOnlyOnce=!1});this.onDisposeObservable.add(()=>{this._scene.onScenePerformancePriorityChangedObservable.remove(z)})}}setPrePassRenderer(z){return!1}dispose(z,be,ut){const Qe=this.getScene();if(Qe.stopAnimation(this),Qe.freeProcessedMaterials(),Qe.removeMaterial(this),this._eventInfo.forceDisposeTextures=be,this._callbackPluginEventGeneric(2,this._eventInfo),this._parentContainer){const it=this._parentContainer.materials.indexOf(this);it>-1&&this._parentContainer.materials.splice(it,1),this._parentContainer=null}if(ut!==!0)if(this.meshMap)for(const it in this.meshMap){const Ot=this.meshMap[it];this._disposeMeshResources(Ot)}else{const it=Qe.meshes;for(const Ot of it)this._disposeMeshResources(Ot)}this._uniformBuffer.dispose(),this._drawWrapper.effect&&(this._storeEffectOnSubMeshes||this._drawWrapper.effect.dispose(),this._drawWrapper.effect=null),this.metadata=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear(),this._eventInfo&&(this._eventInfo={})}_disposeMeshResources(z){if(!z)return;const be=z.geometry,ut=z._internalAbstractMeshDataInfo._materialForRenderPass;if(this._storeEffectOnSubMeshes){if(z.subMeshes&&ut)for(const Qe of z.subMeshes){const it=Qe._drawWrappers;for(let Ot=0;Ot<it.length;Ot++){const wt=it[Ot]?.effect;if(!wt)continue;ut[Ot]===this&&(be?._releaseVertexArrayObject(wt),Qe._removeDrawWrapper(Ot,!0,!0))}}}else be?._releaseVertexArrayObject(this._drawWrapper.effect);z.material===this&&!z.sourceMesh&&(z.material=null)}serialize(){const z=Tt.Serialize(this);return z.stencil=this.stencil.serialize(),z.uniqueId=this.uniqueId,this._serializePlugins(z),z}_serializePlugins(z){if(z.plugins={},this.pluginManager)for(const be of this.pluginManager._plugins)be.doNotSerialize||(z.plugins[be.getClassName()]=be.serialize())}static ParseAlphaMode(z,be){z._alphaMode!==void 0?be._alphaMode=Array.isArray(z._alphaMode)?z._alphaMode:[z._alphaMode]:z.alphaMode!==void 0?be._alphaMode=Array.isArray(z.alphaMode)?z.alphaMode:[z.alphaMode]:be._alphaMode=[2]}static Parse(z,be,ut){if(!z.customType)z.customType="BABYLON.StandardMaterial";else if(z.customType==="BABYLON.PBRMaterial"&&z.overloadedAlbedo&&(z.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return Ee.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null;const it=Rt.Instantiate(z.customType).Parse(z,be,ut);return it._loadedUniqueId=z.uniqueId,r.ParseAlphaMode(z,it),it}static _ParsePlugins(z,be,ut,Qe){if(z.plugins)for(const it in z.plugins){const Ot=z.plugins[it];let wt=be.pluginManager?.getPlugin(Ot.name);if(!wt){const li=Rt.Instantiate("BABYLON."+it);li&&(wt=new li(be))}wt?.parse(Ot,ut,Qe)}}},(()=>{const Me=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[he()],n=[he()],h=[he()],d=[he()],b=[he()],v=[he()],P=[he()],D=[he("alpha")],H=[he("backFaceCulling")],ce=[he("textureRepetitionMode")],X=[he("textureRepetitionHexTilingParams")],K=[he("cullBackFaces")],A=[he()],se=[he()],Ie=[he()],_e=[he()],Je=[he()],Yt=[he()],Gt=[he()],oe=[he()],$t=[he("fogEnabled")],ii=[he()],Pt=[he()],di=[he()],rs=[he()],Bi=[he()],St=[he()],Q=[he()],We=[he()],$(r,null,rs,{kind:"getter",name:"pointsCloud",static:!1,private:!1,access:{has:z=>"pointsCloud"in z,get:z=>z.pointsCloud},metadata:Me},null,e),$(r,null,Bi,{kind:"getter",name:"fillMode",static:!1,private:!1,access:{has:z=>"fillMode"in z,get:z=>z.fillMode},metadata:Me},null,e),$(r,null,St,{kind:"getter",name:"useLogarithmicDepth",static:!1,private:!1,access:{has:z=>"useLogarithmicDepth"in z,get:z=>z.useLogarithmicDepth},metadata:Me},null,e),$(r,null,We,{kind:"getter",name:"transparencyMode",static:!1,private:!1,access:{has:z=>"transparencyMode"in z,get:z=>z.transparencyMode},metadata:Me},null,e),$(null,null,t,{kind:"field",name:"id",static:!1,private:!1,access:{has:z=>"id"in z,get:z=>z.id,set:(z,be)=>{z.id=be}},metadata:Me},i,s),$(null,null,n,{kind:"field",name:"uniqueId",static:!1,private:!1,access:{has:z=>"uniqueId"in z,get:z=>z.uniqueId,set:(z,be)=>{z.uniqueId=be}},metadata:Me},o,c),$(null,null,h,{kind:"field",name:"name",static:!1,private:!1,access:{has:z=>"name"in z,get:z=>z.name,set:(z,be)=>{z.name=be}},metadata:Me},f,_),$(null,null,d,{kind:"field",name:"metadata",static:!1,private:!1,access:{has:z=>"metadata"in z,get:z=>z.metadata,set:(z,be)=>{z.metadata=be}},metadata:Me},g,p),$(null,null,b,{kind:"field",name:"checkReadyOnEveryCall",static:!1,private:!1,access:{has:z=>"checkReadyOnEveryCall"in z,get:z=>z.checkReadyOnEveryCall,set:(z,be)=>{z.checkReadyOnEveryCall=be}},metadata:Me},x,E),$(null,null,v,{kind:"field",name:"checkReadyOnlyOnce",static:!1,private:!1,access:{has:z=>"checkReadyOnlyOnce"in z,get:z=>z.checkReadyOnlyOnce,set:(z,be)=>{z.checkReadyOnlyOnce=be}},metadata:Me},S,R),$(null,null,P,{kind:"field",name:"state",static:!1,private:!1,access:{has:z=>"state"in z,get:z=>z.state,set:(z,be)=>{z.state=be}},metadata:Me},M,O),$(null,null,D,{kind:"field",name:"_alpha",static:!1,private:!1,access:{has:z=>"_alpha"in z,get:z=>z._alpha,set:(z,be)=>{z._alpha=be}},metadata:Me},w,G),$(null,null,H,{kind:"field",name:"_backFaceCulling",static:!1,private:!1,access:{has:z=>"_backFaceCulling"in z,get:z=>z._backFaceCulling,set:(z,be)=>{z._backFaceCulling=be}},metadata:Me},ie,ne),$(null,null,ce,{kind:"field",name:"_textureRepetitionMode",static:!1,private:!1,access:{has:z=>"_textureRepetitionMode"in z,get:z=>z._textureRepetitionMode,set:(z,be)=>{z._textureRepetitionMode=be}},metadata:Me},k,te),$(null,null,X,{kind:"field",name:"textureRepetitionHexTilingParams",static:!1,private:!1,access:{has:z=>"textureRepetitionHexTilingParams"in z,get:z=>z.textureRepetitionHexTilingParams,set:(z,be)=>{z.textureRepetitionHexTilingParams=be}},metadata:Me},q,W),$(null,null,K,{kind:"field",name:"_cullBackFaces",static:!1,private:!1,access:{has:z=>"_cullBackFaces"in z,get:z=>z._cullBackFaces,set:(z,be)=>{z._cullBackFaces=be}},metadata:Me},Z,F),$(null,null,A,{kind:"field",name:"sideOrientation",static:!1,private:!1,access:{has:z=>"sideOrientation"in z,get:z=>z.sideOrientation,set:(z,be)=>{z.sideOrientation=be}},metadata:Me},N,Y),$(null,null,se,{kind:"field",name:"_alphaMode",static:!1,private:!1,access:{has:z=>"_alphaMode"in z,get:z=>z._alphaMode,set:(z,be)=>{z._alphaMode=be}},metadata:Me},ue,pe),$(null,null,Ie,{kind:"field",name:"_needDepthPrePass",static:!1,private:!1,access:{has:z=>"_needDepthPrePass"in z,get:z=>z._needDepthPrePass,set:(z,be)=>{z._needDepthPrePass=be}},metadata:Me},Le,J),$(null,null,_e,{kind:"field",name:"disableDepthWrite",static:!1,private:!1,access:{has:z=>"disableDepthWrite"in z,get:z=>z.disableDepthWrite,set:(z,be)=>{z.disableDepthWrite=be}},metadata:Me},ye,Ne),$(null,null,Je,{kind:"field",name:"disableColorWrite",static:!1,private:!1,access:{has:z=>"disableColorWrite"in z,get:z=>z.disableColorWrite,set:(z,be)=>{z.disableColorWrite=be}},metadata:Me},je,yt),$(null,null,Yt,{kind:"field",name:"forceDepthWrite",static:!1,private:!1,access:{has:z=>"forceDepthWrite"in z,get:z=>z.forceDepthWrite,set:(z,be)=>{z.forceDepthWrite=be}},metadata:Me},kt,Et),$(null,null,Gt,{kind:"field",name:"depthFunction",static:!1,private:!1,access:{has:z=>"depthFunction"in z,get:z=>z.depthFunction,set:(z,be)=>{z.depthFunction=be}},metadata:Me},zt,nt),$(null,null,oe,{kind:"field",name:"separateCullingPass",static:!1,private:!1,access:{has:z=>"separateCullingPass"in z,get:z=>z.separateCullingPass,set:(z,be)=>{z.separateCullingPass=be}},metadata:Me},ze,si),$(null,null,$t,{kind:"field",name:"_fogEnabled",static:!1,private:!1,access:{has:z=>"_fogEnabled"in z,get:z=>z._fogEnabled,set:(z,be)=>{z._fogEnabled=be}},metadata:Me},oi,ti),$(null,null,ii,{kind:"field",name:"pointSize",static:!1,private:!1,access:{has:z=>"pointSize"in z,get:z=>z.pointSize,set:(z,be)=>{z.pointSize=be}},metadata:Me},Ct,ni),$(null,null,Pt,{kind:"field",name:"zOffset",static:!1,private:!1,access:{has:z=>"zOffset"in z,get:z=>z.zOffset,set:(z,be)=>{z.zOffset=be}},metadata:Me},Ht,ri),$(null,null,di,{kind:"field",name:"zOffsetUnits",static:!1,private:!1,access:{has:z=>"zOffsetUnits"in z,get:z=>z.zOffsetUnits,set:(z,be)=>{z.zOffsetUnits=be}},metadata:Me},_i,As),$(null,null,Q,{kind:"field",name:"_isVertexOutputInvariant",static:!1,private:!1,access:{has:z=>"_isVertexOutputInvariant"in z,get:z=>z._isVertexOutputInvariant,set:(z,be)=>{z._isVertexOutputInvariant=be}},metadata:Me},V,Te),Me&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Me})})(),r.TriangleFillMode=0,r.WireFrameFillMode=1,r.PointFillMode=2,r.PointListDrawMode=3,r.LineListDrawMode=4,r.LineLoopDrawMode=5,r.LineStripDrawMode=6,r.TriangleStripDrawMode=7,r.TriangleFanDrawMode=8,r.ClockWiseSideOrientation=0,r.CounterClockWiseSideOrientation=1,r.ImageProcessingDirtyFlag=64,r.TextureDirtyFlag=1,r.LightDirtyFlag=2,r.FresnelDirtyFlag=4,r.AttributesDirtyFlag=8,r.MiscDirtyFlag=16,r.PrePassDirtyFlag=32,r.AllDirtyFlag=127,r.MATERIAL_OPAQUE=0,r.MATERIAL_ALPHATEST=1,r.MATERIAL_ALPHABLEND=2,r.MATERIAL_ALPHATESTANDBLEND=3,r.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0,r.MATERIAL_NORMALBLENDMETHOD_RNM=1,r.LIGHTFALLOFF_PHYSICAL=0,r.LIGHTFALLOFF_GLTF=1,r.LIGHTFALLOFF_STANDARD=2,r.OnEventObservable=new Oe,r.ForceVertexOutputInvariant=!1,r._AllDirtyCallBack=Me=>Me.markAllAsDirty(),r._ImageProcessingDirtyCallBack=Me=>Me.markAsImageProcessingDirty(),r._TextureDirtyCallBack=Me=>Me.markAsTexturesDirty(),r._FresnelDirtyCallBack=Me=>Me.markAsFresnelDirty(),r._MiscDirtyCallBack=Me=>Me.markAsMiscDirty(),r._PrePassDirtyCallBack=Me=>Me.markAsPrePassDirty(),r._LightsDirtyCallBack=Me=>Me.markAsLightDirty(),r._AttributeDirtyCallBack=Me=>Me.markAsAttributesDirty(),r._FresnelAndMiscDirtyCallBack=Me=>{r._FresnelDirtyCallBack(Me),r._MiscDirtyCallBack(Me)},r._TextureAndMiscDirtyCallBack=Me=>{r._TextureDirtyCallBack(Me),r._MiscDirtyCallBack(Me)},r._DirtyCallbackArray=[],r._RunDirtyCallBacks=Me=>{for(const z of r._DirtyCallbackArray)z(Me)},r})();Object.getOwnPropertyDescriptor(wi.prototype,"pluginManager")||Object.defineProperty(wi.prototype,"pluginManager",At("Material","pluginManager"));class Jf extends wi{get subMaterials(){return this._subMaterials}set subMaterials(e){this._subMaterials=e,this._hookArray(e)}getChildren(){return this.subMaterials}constructor(e,t){super(e,t,!0),this._waitingSubMaterialsUniqueIds=[],this.getScene().addMultiMaterial(this),this.subMaterials=[],this._storeEffectOnSubMeshes=!0}_hookArray(e){const t=e.push;e.push=(...s)=>{const n=t.apply(e,s);return this._markAllSubMeshesAsTexturesDirty(),n};const i=e.splice;e.splice=(s,n)=>{const o=i.call(e,s,n??e.length);return this._markAllSubMeshesAsTexturesDirty(),o}}getSubMaterial(e){return e<0||e>=this.subMaterials.length?this.getScene().defaultMaterial:this.subMaterials[e]}getActiveTextures(){return super.getActiveTextures().concat(...this.subMaterials.map(e=>e?e.getActiveTextures():[]))}hasTexture(e){if(super.hasTexture(e))return!0;for(let t=0;t<this.subMaterials.length;t++)if(this.subMaterials[t]?.hasTexture(e))return!0;return!1}getClassName(){return"MultiMaterial"}isReadyForSubMesh(e,t,i){for(let s=0;s<this.subMaterials.length;s++){const n=this.subMaterials[s];if(n){if(n._storeEffectOnSubMeshes){if(!n.isReadyForSubMesh(e,t,i))return!1;continue}if(!n.isReady(e))return!1}}return!0}clone(e,t){const i=new Jf(e,this.getScene());for(let s=0;s<this.subMaterials.length;s++){let n;const o=this.subMaterials[s];t&&o?n=o.clone(e+"-"+o.name):n=this.subMaterials[s],i.subMaterials.push(n)}return i}serialize(){const e={};e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,Ut&&(e.tags=Ut.GetTags(this)),e.materialsUniqueIds=[],e.materials=[];for(let t=0;t<this.subMaterials.length;t++){const i=this.subMaterials[t];i?(e.materialsUniqueIds.push(i.uniqueId),e.materials.push(i.id)):(e.materialsUniqueIds.push(null),e.materials.push(null))}return e}dispose(e,t,i){const s=this.getScene();if(!s)return;if(i)for(let o=0;o<this.subMaterials.length;o++){const c=this.subMaterials[o];c&&c.dispose(e,t)}const n=s.multiMaterials.indexOf(this);n>=0&&s.multiMaterials.splice(n,1),super.dispose(e,t)}}class ot{}ot.NAME_EFFECTLAYER="EffectLayer";ot.NAME_LAYER="Layer";ot.NAME_LENSFLARESYSTEM="LensFlareSystem";ot.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer";ot.NAME_PARTICLESYSTEM="ParticleSystem";ot.NAME_GAMEPAD="Gamepad";ot.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue";ot.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer";ot.NAME_PREPASSRENDERER="PrePassRenderer";ot.NAME_DEPTHRENDERER="DepthRenderer";ot.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer";ot.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager";ot.NAME_SPRITE="Sprite";ot.NAME_SUBSURFACE="SubSurface";ot.NAME_OUTLINERENDERER="Outline";ot.NAME_PROCEDURALTEXTURE="ProceduralTexture";ot.NAME_SHADOWGENERATOR="ShadowGenerator";ot.NAME_OCTREE="Octree";ot.NAME_PHYSICSENGINE="PhysicsEngine";ot.NAME_AUDIO="Audio";ot.NAME_FLUIDRENDERER="FluidRenderer";ot.NAME_IBLCDFGENERATOR="iblCDFGenerator";ot.NAME_CLUSTEREDLIGHTING="ClusteredLighting";ot.STEP_ISREADYFORMESH_EFFECTLAYER=0;ot.STEP_ISREADYFORMESH_DEPTHRENDERER=1;ot.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0;ot.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0;ot.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0;ot.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1;ot.STEP_BEFORECAMERADRAW_PREPASS=0;ot.STEP_BEFORECAMERADRAW_EFFECTLAYER=1;ot.STEP_BEFORECAMERADRAW_LAYER=2;ot.STEP_BEFORERENDERTARGETDRAW_PREPASS=0;ot.STEP_BEFORERENDERTARGETDRAW_LAYER=1;ot.STEP_BEFORERENDERINGMESH_PREPASS=0;ot.STEP_BEFORERENDERINGMESH_OUTLINE=1;ot.STEP_AFTERRENDERINGMESH_PREPASS=0;ot.STEP_AFTERRENDERINGMESH_OUTLINE=1;ot.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0;ot.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1;
187ot.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0;ot.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0;ot.STEP_BEFORECLEAR_PREPASS=1;ot.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0;ot.STEP_AFTERRENDERTARGETDRAW_PREPASS=0;ot.STEP_AFTERRENDERTARGETDRAW_LAYER=1;ot.STEP_AFTERCAMERADRAW_PREPASS=0;ot.STEP_AFTERCAMERADRAW_EFFECTLAYER=1;ot.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2;ot.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3;ot.STEP_AFTERCAMERADRAW_LAYER=4;ot.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5;ot.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0;ot.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0;ot.STEP_AFTERRENDER_AUDIO=0;ot.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0;ot.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1;ot.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2;ot.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3;ot.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0;ot.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1;ot.STEP_GATHERACTIVECAMERARENDERTARGETS_CLUSTEREDLIGHTING=2;ot.STEP_POINTERMOVE_SPRITE=0;ot.STEP_POINTERDOWN_SPRITE=0;ot.STEP_POINTERUP_SPRITE=0;class Ri extends Array{constructor(e){super(...e)}static Create(){return Object.create(Ri.prototype)}registerStep(e,t,i){let s=0,n;for(;s<this.length&&(n=this[s].index,!(e<n));s++);this.splice(s,0,{index:e,component:t,action:i.bind(t)})}clear(){this.length=0}}class Ew{constructor(e,t){this.distanceOrScreenCoverage=e,this.mesh=t}}var _0,m0,g0,p0,y0,b0,x0,T0,E0,v0,A0,R0,S0,M0;class IA{}class C0{constructor(){this.batchCache=new I0(this),this.batchCacheReplacementModeInFrozenMode=new I0(this),this.instancesBufferSize=512*4}}class vw{constructor(){this.renderPasses={}}}class I0{constructor(e){this.parent=e,this.mustReturn=!1,this.visibleInstances=new Array,this.renderSelf=[],this.hardwareInstancedRendering=[]}}class Aw{constructor(){this.instancesCount=0,this.matrixBuffer=null,this.previousMatrixBuffer=null,this.matrixBufferSize=512,this.matrixData=null,this.boundingVectors=[],this.worldMatrices=null}}class Rw{constructor(){this._areNormalsFrozen=!1,this._source=null,this.meshMap=null,this._preActivateId=-1,this._LODLevels=new Array,this._useLODScreenCoverage=!1,this._effectiveMaterial=null,this._forcedInstanceCount=0,this._overrideRenderingFillMode=null}}const Hn={source:null,parent:null,doNotCloneChildren:!1,clonePhysicsImpostor:!0,cloneThinInstances:!1};class ee extends ai{static _GetDefaultSideOrientation(e){return e||ee.FRONTSIDE}get useLODScreenCoverage(){return this._internalMeshDataInfo._useLODScreenCoverage}set useLODScreenCoverage(e){this._internalMeshDataInfo._useLODScreenCoverage=e,this._sortLODLevels()}get computeBonesUsingShaders(){return this._internalAbstractMeshDataInfo._computeBonesUsingShaders}set computeBonesUsingShaders(e){this._internalAbstractMeshDataInfo._computeBonesUsingShaders!==e&&(e&&this._internalMeshDataInfo._sourcePositions&&(this.setVerticesData(U.PositionKind,this._internalMeshDataInfo._sourcePositions,!0),this._internalMeshDataInfo._sourceNormals&&this.setVerticesData(U.NormalKind,this._internalMeshDataInfo._sourceNormals,!0),this._internalMeshDataInfo._sourcePositions=null,this._internalMeshDataInfo._sourceNormals=null),this._internalAbstractMeshDataInfo._computeBonesUsingShaders=e,this._markSubMeshesAsAttributesDirty())}get onBeforeRenderObservable(){return this._internalMeshDataInfo._onBeforeRenderObservable||(this._internalMeshDataInfo._onBeforeRenderObservable=new Oe),this._internalMeshDataInfo._onBeforeRenderObservable}get onBeforeBindObservable(){return this._internalMeshDataInfo._onBeforeBindObservable||(this._internalMeshDataInfo._onBeforeBindObservable=new Oe),this._internalMeshDataInfo._onBeforeBindObservable}get onAfterRenderObservable(){return this._internalMeshDataInfo._onAfterRenderObservable||(this._internalMeshDataInfo._onAfterRenderObservable=new Oe),this._internalMeshDataInfo._onAfterRenderObservable}get onBetweenPassObservable(){return this._internalMeshDataInfo._onBetweenPassObservable||(this._internalMeshDataInfo._onBetweenPassObservable=new Oe),this._internalMeshDataInfo._onBetweenPassObservable}get onBeforeDrawObservable(){return this._internalMeshDataInfo._onBeforeDrawObservable||(this._internalMeshDataInfo._onBeforeDrawObservable=new Oe),this._internalMeshDataInfo._onBeforeDrawObservable}set onBeforeDraw(e){this._onBeforeDrawObserver&&this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver),this._onBeforeDrawObserver=this.onBeforeDrawObservable.add(e)}get hasInstances(){return this.instances.length>0}get hasThinInstances(){return(this.forcedInstanceCount||this._thinInstanceDataStorage.
vendor: 15,230 bytes, line 187
187instancesCount||0)>0}get forcedInstanceCount(){return this._internalMeshDataInfo._forcedInstanceCount}set forcedInstanceCount(e){this._internalMeshDataInfo._forcedInstanceCount=e}get sideOrientation(){return this._internalMeshDataInfo._sideOrientation}set sideOrientation(e){this._internalMeshDataInfo._sideOrientation=e,this._internalAbstractMeshDataInfo._sideOrientationHint=this._scene.useRightHandedSystem&&e===1||!this._scene.useRightHandedSystem&&e===0}get _effectiveSideOrientation(){return this._internalMeshDataInfo._effectiveSideOrientation}get overrideMaterialSideOrientation(){return this.sideOrientation}set overrideMaterialSideOrientation(e){this.sideOrientation=e,this.material&&(this.material.sideOrientation=null)}get overrideRenderingFillMode(){return this._internalMeshDataInfo._overrideRenderingFillMode}set overrideRenderingFillMode(e){this._internalMeshDataInfo._overrideRenderingFillMode=e}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){e&&(this.material&&this.material.sideOrientation===null||this._internalAbstractMeshDataInfo._sideOrientationHint)&&(e.sideOrientation=null),this._setMaterial(e)}get source(){return this._internalMeshDataInfo._source}get cloneMeshMap(){return this._internalMeshDataInfo.meshMap}get isUnIndexed(){return this._unIndexed}set isUnIndexed(e){this._unIndexed!==e&&(this._unIndexed=e,this._markSubMeshesAsAttributesDirty())}get worldMatrixInstancedBuffer(){const e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesData:void 0}get previousWorldMatrixInstancedBuffer(){const e=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._instanceDataStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];return e?e.instancesPreviousData:void 0}get manualUpdateOfWorldMatrixInstancedBuffer(){return this._instanceDataStorage.manualUpdate}set manualUpdateOfWorldMatrixInstancedBuffer(e){this._instanceDataStorage.manualUpdate=e}get manualUpdateOfPreviousWorldMatrixInstancedBuffer(){return this._instanceDataStorage.previousManualUpdate}set manualUpdateOfPreviousWorldMatrixInstancedBuffer(e){this._instanceDataStorage.previousManualUpdate=e}get forceWorldMatrixInstancedBufferUpdate(){return this._instanceDataStorage.forceMatrixUpdates}set forceWorldMatrixInstancedBufferUpdate(e){this._instanceDataStorage.forceMatrixUpdates=e}_copySource(e,t,i=!0,s=!1){const n=this.getScene();if(e._geometry&&e._geometry.applyToMesh(this),bg.DeepCopy(e,this,["name","material","skeleton","instances","parent","uniqueId","source","metadata","morphTargetManager","hasInstances","worldMatrixInstancedBuffer","previousWorldMatrixInstancedBuffer","hasLODLevels","geometry","isBlocked","areNormalsFrozen","facetNb","isFacetDataEnabled","lightSources","useBones","isAnInstance","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","cloneMeshMap","hasBoundingInfo","physicsBody","physicsImpostor"],["_poseMatrix"]),this._internalMeshDataInfo._source=e,n.useClonedMeshMap&&(e._internalMeshDataInfo.meshMap||(e._internalMeshDataInfo.meshMap={}),e._internalMeshDataInfo.meshMap[this.uniqueId]=this),this._originalBuilderSideOrientation=e._originalBuilderSideOrientation,this._creationDataStorage=e._creationDataStorage,e._ranges){const o=e._ranges;for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&this.createAnimationRange(c,o[c].from,o[c].to)}if(e.metadata&&e.metadata.clone?this.metadata=e.metadata.clone():this.metadata=e.metadata,this._internalMetadata=e._internalMetadata,Ut&&Ut.HasTags(e)&&Ut.AddTagsTo(this,Ut.GetTags(e,!0)),this.setEnabled(e.isEnabled(!1)),this.parent=e.parent,this.setPivotMatrix(e.getPivotMatrix(),this._postMultiplyPivotMatrix),this.id=this.name+"."+e.id,this.material=e.material,!t){const o=e.getDescendants(!0);for(let c=0;c<o.length;c++){const h=o[c];h._isMesh?(Hn.parent=this,Hn.doNotCloneChildren=t,Hn.clonePhysicsImpostor=i,Hn.cloneThinInstances=s,h.clone(this.name+"."+h.name,Hn)):h.clone&&h.clone(this.name+"."+h.name,this)}}if(e.morphTargetManager&&(this.morphTargetManager=e.morphTargetManager),lg(n.getPhysicsEngine)){const o=n.getPhysicsEngine();if(i&&o)if(o.getPluginVersion()===1){const c=o.getImpostorForPhysicsObject(e);c&&(this.physicsImpostor=c.clone(this))}else o.getPluginVersion()===2&&e.physicsBody&&e.physicsBody.clone(this)}for(let o=0;o<n.particleSystems.length;o++){const c=n.particleSystems[o];c.emitter===e&&c.clone(c.name,this)}if(this.skeleton=e.skeleton,s&&(e._thinInstanceDataStorage.matrixData?(this.thinInstanceSetBuffer("matrix",new Float32Array(e._thinInstanceDataStorage.matrixData),16,!e._thinInstanceDataStorage.matrixBuffer.isUpdatable()),this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,this._thinInstanceDataStorage.instancesCount=e._thinInstanceDataStorage.instancesCount):this._thinInstanceDataStorage.matrixBufferSize=e._thinInstanceDataStorage.matrixBufferSize,e._userThinInstanceBuffersStorage)){const o=e._userThinInstanceBuffersStorage;for(const c in o.data)this.thinInstanceSetBuffer(c,new Float32Array(o.data[c]),o.strides[c],!o.vertexBuffers?.[c]?.isUpdatable()),this._userThinInstanceBuffersStorage.sizes[c]=o.sizes[c]}this.refreshBoundingInfo(!0,!0),this.computeWorldMatrix(!0)}constructor(e,t=null,i=null,s=null,n,o=!0){super(e,t),this._internalMeshDataInfo=new Rw,this.delayLoadState=0,this.instances=[],this._creationDataStorage=null,this._geometry=null,this._thinInstanceDataStorage=new Aw,this._shouldGenerateFlatShading=!1,this._originalBuilderSideOrientation=ee.DEFAULTSIDE,this.ignoreCameraMaxZ=!1,t=this.getScene(),this._instanceDataStorage=new vw,this._instanceDataStorage.engine=t.getEngine(),this._instanceDataStorage.useMonoDataStorageRenderPass=!this._instanceDataStorage.engine.isWebGPU,this._instanceDataStorage.useMonoDataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass=new C0),this._scene.useRightHandedSystem?this.sideOrientation=0:this.sideOrientation=1,this._onBeforeDraw=(f,_,d)=>{f&&d&&(this._uniformBuffer?this.transferToEffect(_):d.bindOnlyWorldMatrix(_))};let c,h=!1;if(i&&i._addToSceneRootNodes===void 0){const f=i;c=f.parent??null,s=f.source??null,n=f.doNotCloneChildren??!1,o=f.clonePhysicsImpostor??!0,h=f.cloneThinInstances??!1}else c=i;s&&this._copySource(s,n,o,h),c!==null&&(this.parent=c),this._instanceDataStorage.hardwareInstancedRendering=this.getEngine().getCaps().instancedArrays,this._internalMeshDataInfo._onMeshReadyObserverAdded=f=>{f.unregisterOnNextCall=!0,this.isReady(!0)?this.onMeshReadyObservable.notifyObservers(this):this._internalMeshDataInfo._checkReadinessObserver||(this._internalMeshDataInfo._checkReadinessObserver=this._scene.onBeforeRenderObservable.add(()=>{this.isReady(!0)&&(this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),this._internalMeshDataInfo._checkReadinessObserver=null,this.onMeshReadyObservable.notifyObservers(this))}))},this.onMeshReadyObservable=new Oe(this._internalMeshDataInfo._onMeshReadyObserverAdded),s&&s.onClonedObservable.notifyObservers(this)}instantiateHierarchy(e=null,t,i){const s=this.getTotalVertices()===0||t&&t.doNotInstantiate&&(t.doNotInstantiate===!0||t.doNotInstantiate(this))?this.clone("Clone of "+(this.name||this.id),e||this.parent,!0):this.createInstance("instance of "+(this.name||this.id));s.parent=e||this.parent,s.position=this.position.clone(),s.scaling=this.scaling.clone(),this.rotationQuaternion?s.rotationQuaternion=this.rotationQuaternion.clone():s.rotation=this.rotation.clone(),i&&i(this,s);for(const n of this.getChildTransformNodes(!0))n.getClassName()==="InstancedMesh"&&s.getClassName()==="Mesh"&&n.sourceMesh===this?n.instantiateHierarchy(s,{doNotInstantiate:t&&t.doNotInstantiate||!1,newSourcedMesh:s},i):n.instantiateHierarchy(s,t,i);return s}getClassName(){return"Mesh"}get _isMesh(){return!0}toString(e){let t=super.toString(e);if(t+=", n vertices: "+this.getTotalVertices(),t+=", parent: "+(this._waitingParentId?this._waitingParentId:this.parent?this.parent.name:"NONE"),this.animations)for(let i=0;i<this.animations.length;i++)t+=", animation[0]: "+this.animations[i].toString(e);if(e)if(this._geometry){const i=this.getIndices(),s=this.getVerticesData(U.PositionKind);s&&i&&(t+=", flat shading: "+(s.length/3===i.length?"YES":"NO"))}else t+=", flat shading: UNKNOWN";return t}_unBindEffect(){super._unBindEffect();for(const e of this.instances)e._unBindEffect()}get hasLODLevels(){return this._internalMeshDataInfo._LODLevels.length>0}getLODLevels(){return this._internalMeshDataInfo._LODLevels}_sortLODLevels(){const e=this._internalMeshDataInfo._useLODScreenCoverage?-1:1;this._internalMeshDataInfo._LODLevels.sort((t,i)=>t.distanceOrScreenCoverage<i.distanceOrScreenCoverage?e:t.distanceOrScreenCoverage>i.distanceOrScreenCoverage?-e:0)}addLODLevel(e,t){if(t&&t._masterMesh)return Ee.Warn("You cannot use a mesh as LOD level twice"),this;const i=new Ew(e,t);return this._internalMeshDataInfo._LODLevels.push(i),t&&(t._masterMesh=this),this._sortLODLevels(),this}getLODLevelAtDistance(e){const t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++){const s=t._LODLevels[i];if(s.distanceOrScreenCoverage===e)return s.mesh}return null}removeLODLevel(e){const t=this._internalMeshDataInfo;for(let i=0;i<t._LODLevels.length;i++)t._LODLevels[i].mesh===e&&(t._LODLevels.splice(i,1),e&&(e._masterMesh=null));return this._sortLODLevels(),this}getLOD(e,t){const i=this._internalMeshDataInfo;if(!i._LODLevels||i._LODLevels.length===0)return this;const s=t||this.getBoundingInfo().boundingSphere,n=e.mode===Si.ORTHOGRAPHIC_CAMERA?e.minZ:s.centerWorld.subtract(e.globalPosition).length();let o=n,c=1;if(i._useLODScreenCoverage){const h=e.screenArea;let f=s.radiusWorld*e.minZ/n;f=f*f*Math.PI,o=f/h,c=-1}if(c*i._LODLevels[i._LODLevels.length-1].distanceOrScreenCoverage>c*o)return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,this),this;for(let h=0;h<i._LODLevels.length;h++){const f=i._LODLevels[h];if(c*f.distanceOrScreenCoverage<c*o){if(f.mesh){if(f.mesh.delayLoadState===4)return f.mesh._checkDelayState(),this;if(f.mesh.delayLoadState===2)return this;f.mesh._preActivate(),f.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache)}return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,f.mesh),f.mesh}}return this.onLODLevelSelection&&this.onLODLevelSelection(o,this,this),this}get geometry(){return this._geometry}getTotalVertices(){return this._geometry===null||this._geometry===void 0?0:this._geometry.getTotalVertices()}getVerticesData(e,t,i,s){if(!this._geometry)return null;let n=s?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e]?.getFloatData(this.instances.length+1,i||t&&this._geometry.meshes.length!==1);return n||(n=this._geometry.getVerticesData(e,t,i)),n}copyVerticesData(e,t){this._geometry&&this._geometry.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._geometry?(t?void 0:this._userInstancedBuffersStorage?.vertexBuffers[e])??this._geometry.getVertexBuffer(e):null}isVerticesDataPresent(e,t){return this._geometry?!t&&this._userInstancedBuffersStorage?.vertexBuffers[e]!==void 0||this._geometry.isVerticesDataPresent(e):this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1}isVertexBufferUpdatable(e,t){if(!this._geometry)return this._delayInfo?this._delayInfo.indexOf(e)!==-1:!1;if(!t){const i=this._userInstancedBuffersStorage?.vertexBuffers[e];if(i)return i.isUpdatable()}return this._geometry.isVertexBufferUpdatable(e)}getVerticesDataKinds(e){if(!this._geometry){const i=[];if(this._delayInfo)for(const s of this._delayInfo)i.push(s);return i}const t=this._geometry.getVerticesDataKinds();if(!e&&this._userInstancedBuffersStorage)for(const i in this._userInstancedBuffersStorage.vertexBuffers)t.indexOf(i)===-1&&t.push(i);return t}getTotalIndices(){return this._geometry?this._geometry.getTotalIndices():0}getIndices(e,t){return this._geometry?this._geometry.getIndices(e,t):[]}get isBlocked(){return this._masterMesh!==null&&this._masterMesh!==void 0}isReady(e=!1,t=!1){if(this.delayLoadState===2||!super.isReady(e))return!1;if(!this.subMeshes||this.subMeshes.length===0||!e)return!0;const i=this.getEngine(),s=this.getScene(),n=t||i.getCaps().instancedArrays&&(this.instances.length>0||this.hasThinInstances);this.computeWorldMatrix();const o=this.material||s.defaultMaterial;if(o){if(o._storeEffectOnSubMeshes)for(const h of this.subMeshes){const f=h.getMaterial();if(f){if(f._storeEffectOnSubMeshes){if(!f.isReadyForSubMesh(this,h,n))return!1}else if(!f.isReady(this,n))return!1}}else if(!o.isReady(this,n))return!1}const c=i.currentRenderPassId;for(const h of this.lightSources){const f=h.getShadowGenerators();if(!f)continue;const _=f.values();for(let d=_.next();d.done!==!0;d=_.next()){const g=d.value;if(g&&(!g.getShadowMap()?.renderList||g.getShadowMap()?.renderList&&g.getShadowMap()?.renderList?.indexOf(this)!==-1)){const b=g.getShadowMap().renderPassIds??[i.currentRenderPassId];for(let x=0;x<b.length;++x){i.currentRenderPassId=b[x];for(const E of this.subMeshes)if(!g.isReady(E,n,E.getMaterial()?.needAlphaBlendingForMesh(this)??!1))return i.currentRenderPassId=c,!1}i.currentRenderPassId=c}}}for(const h of this._internalMeshDataInfo._LODLevels)if(h.mesh&&!h.mesh.isReady(n))return!1;return!0}get areNormalsFrozen(){return this._internalMeshDataInfo._areNormalsFrozen}freezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!0,this}unfreezeNormals(){return this._internalMeshDataInfo._areNormalsFrozen=!1,this}set overridenInstanceCount(e){this._instanceDataStorage.overridenInstanceCount=e}_getInstanceDataStorage(){if(this._instanceDataStorage.useMonoDataStorageRenderPass)return this._instanceDataStorage.dataStorageRenderPass;const e=this._instanceDataStorage.engine.currentRenderPassId;let t=this._instanceDataStorage.renderPasses[e];return t||(t=new C0,this._instanceDataStorage.renderPasses[e]=t),t}_preActivate(){const e=this._internalMeshDataInfo,t=this.getScene().getRenderId();return e._preActivateId===t?this:(e._preActivateId=t,this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass.visibleInstances=null:this._getInstanceDataStorage().visibleInstances=null,this)}_preActivateForIntermediateRendering(e){const t=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return t.visibleInstances&&(t.visibleInstances.intermediateDefaultRenderId=e),this}_registerInstanceForRenderId(e,t){const i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();return i.visibleInstances||(i.visibleInstances={defaultRenderId:t,selfDefaultRenderId:this._renderId,intermediateDefaultRenderId:-1}),i.visibleInstances[t]||(i.previousRenderId!==void 0&&(!this._instanceDataStorage.useMonoDataStorageRenderPass||this._instanceDataStorage.
vendor: 5,868 bytes, line 187
187isFrozen)&&delete i.visibleInstances[i.previousRenderId],i.previousRenderId=t,i.visibleInstances[t]=new Array),i.visibleInstances[t].push(e),this}_afterComputeWorldMatrix(){super._afterComputeWorldMatrix(),this.hasThinInstances&&(this.doNotSyncBoundingInfo||this.thinInstanceRefreshBoundingInfo(!1))}_postActivate(){this.edgesShareWithInstances&&this.edgesRenderer&&this.edgesRenderer.isEnabled&&this._renderingGroup&&(this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer),this.edgesRenderer.customInstances.push(this.getWorldMatrix()))}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;typeof e=="object"?i=e:i={applySkeleton:e,applyMorph:t};const s=this.geometry?this.geometry.boundingBias:null;return this._refreshBoundingInfo(this._getData(i,null,U.PositionKind),s),this}_createGlobalSubMesh(e){const t=this.getTotalVertices();if(!t||!this.getIndices())return null;if(this.subMeshes&&this.subMeshes.length>0){const i=this.getIndices();if(!i)return null;const s=i.length;let n=!1;if(e)n=!0;else for(const o of this.subMeshes){if(o.indexStart+o.indexCount>s){n=!0;break}if(o.verticesStart+o.verticesCount>t){n=!0;break}}if(!n)return this.subMeshes[0]}return this.releaseSubMeshes(),new tn(0,0,t,0,this.getTotalIndices()||(this.isUnIndexed?t:0),this)}subdivide(e){if(e<1)return;const t=this.getTotalIndices();let i=t/e|0,s=0;for(;i%3!==0;)i++;this.releaseSubMeshes();for(let n=0;n<e&&!(s>=t);n++)tn.CreateFromIndices(0,s,s+i>=t?t-s:i,this,void 0,!1),s+=i;this.refreshBoundingInfo(),this.synchronizeInstances()}setVerticesData(e,t,i=!1,s){if(this._geometry)this._geometry.setVerticesData(e,t,i,s);else{const n=new Ye;n.set(t,e);const o=this.getScene();new Es(Es.RandomId(),o,n,i,this)}return this}removeVerticesData(e){this._geometry&&this._geometry.removeVerticesData(e)}markVerticesDataAsUpdatable(e,t=!0){const i=this.getVertexBuffer(e);!i||i.isUpdatable()===t||this.setVerticesData(e,this.getVerticesData(e),t)}setVerticesBuffer(e,t=!0,i=null){return this._geometry||(this._geometry=Es.CreateGeometryForMesh(this)),this._geometry.setVerticesBuffer(e,i,t),this}updateVerticesData(e,t,i,s){return this._geometry?(s?(this.makeGeometryUnique(),this.updateVerticesData(e,t,i,!1)):this._geometry.updateVerticesData(e,t,i),this):this}updateMeshPositions(e,t=!0){const i=this.getVerticesData(U.PositionKind);if(!i)return this;if(e(i),this.updateVerticesData(U.PositionKind,i,!1,!1),t){const s=this.getIndices(),n=this.getVerticesData(U.NormalKind);if(!n)return this;Ye.ComputeNormals(i,s,n),this.updateVerticesData(U.NormalKind,n,!1,!1)}return this}makeGeometryUnique(){if(!this._geometry)return this;if(this._geometry.meshes.length===1)return this;const e=this._geometry,t=this._geometry.copy(Es.RandomId());return e.releaseForMesh(this,!0),t.applyToMesh(this),this}setIndexBuffer(e,t,i,s=null){let n=this._geometry;n||(n=new Es(Es.RandomId(),this.getScene(),void 0,void 0,this)),n.setIndexBuffer(e,t,i,s)}setIndices(e,t=null,i=!1,s=!1){if(this._geometry)this._geometry.setIndices(e,t,i,s);else{const n=new Ye;n.indices=e;const o=this.getScene();new Es(Es.RandomId(),o,n,i,this,t)}return this}updateIndices(e,t,i=!1){return this._geometry?(this._geometry.updateIndices(e,t,i),this):this}toLeftHanded(){return this._geometry?(this._geometry.toLeftHanded(),this):this}_bind(e,t,i,s=!0){if(!this._geometry)return this;const n=this.getScene().getEngine();let o;if(this._unIndexed)switch(this._getRenderingFillMode(i)){case wi.WireFrameFillMode:o=e._getLinesIndexBuffer(this.getIndices(),n);break;default:o=null;break}else switch(this._getRenderingFillMode(i)){case wi.PointFillMode:o=null;break;case wi.WireFrameFillMode:o=e._getLinesIndexBuffer(this.getIndices(),n);break;default:case wi.TriangleFillMode:o=this._geometry.getIndexBuffer();break}return this._bindDirect(t,o,s)}_bindDirect(e,t,i=!0){if(!this._geometry)return this;if(this.morphTargetManager&&this.morphTargetManager.isUsingTextureForTargets&&this.morphTargetManager._bind(e),!i||!this._userInstancedBuffersStorage||this.hasThinInstances)this._geometry._bind(e,t);else{if(!this._instanceDataStorage.useMonoDataStorageRenderPass&&this._userInstancedBuffersStorage.renderPasses&&this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId]){const s=this._userInstancedBuffersStorage.renderPasses[this._instanceDataStorage.engine.currentRenderPassId];for(const n in s)this._userInstancedBuffersStorage.vertexBuffers[n]=s[n]}this._geometry._bind(e,t,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects)}return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;this._internalMeshDataInfo._onBeforeDrawObservable&&this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);const n=this.getScene().getEngine(),o=n._currentMaterialContext,c=o&&o.useVertexPulling;return this._unIndexed&&t!==wi.WireFrameFillMode||t==wi.PointFillMode?n.drawArraysType(t,e.verticesStart,e.verticesCount,this.forcedInstanceCount||i):t==wi.WireFrameFillMode?n.drawElementsType(t,0,e._linesIndexCount,this.forcedInstanceCount||i):c?n.drawArraysType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i):n.drawElementsType(t,e.indexStart,e.indexCount,this.forcedInstanceCount||i),this}registerBeforeRender(e){return this.onBeforeRenderObservable.add(e),this}unregisterBeforeRender(e){return this.onBeforeRenderObservable.removeCallback(e),this}registerAfterRender(e){return this.onAfterRenderObservable.add(e),this}unregisterAfterRender(e){return this.onAfterRenderObservable.removeCallback(e),this}_getInstancesRenderList(e,t=!1){const i=this._instanceDataStorage.useMonoDataStorageRenderPass?this._instanceDataStorage.dataStorageRenderPass:this._getInstanceDataStorage();
187if(this._instanceDataStorage.isFrozen){if(t)return i.batchCacheReplacementModeInFrozenMode.hardwareInstancedRendering[e]=!1,i.batchCacheReplacementModeInFrozenMode.renderSelf[e]=!0,i.batchCacheReplacementModeInFrozenMode;if(i.previousBatch)return i.previousBatch}const s=this.getScene(),n=s._isInIntermediateRendering(),o=n?this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate:this._internalAbstractMeshDataInfo._onlyForInstances,c=i.batchCache;if(c.mustReturn=!1,c.renderSelf[e]=t||!o&&this.isEnabled()&&this.isVisible,c.visibleInstances[e]=null,i.visibleInstances&&!t){const h=i.visibleInstances,f=s.getRenderId(),_=n?h.intermediateDefaultRenderId:h.defaultRenderId;c.visibleInstances[e]=h[f],!c.visibleInstances[e]&&_&&(c.visibleInstances[e]=h[_])}return c.hardwareInstancedRendering[e]=!t&&this._instanceDataStorage.hardwareInstancedRendering&&c.visibleInstances[e]!==null&&c.visibleInstances[e]!==void 0,i.previousBatch=c,c}_updateInstancedBuffers(e,t,i,s,n,o){const c=t.visibleInstances[e._id],h=c?c.length:0,f=t.parent,_=this._instanceDataStorage;let d=f.instancesBuffer,g=f.instancesPreviousBuffer,p=0,b=0;
187const x=t.renderSelf[e._id],E=this._scene.floatingOriginOffset,v=!d||i!==f.instancesBufferSize||this._scene.needsPreviousWorldMatrices&&!f.instancesPreviousBuffer;if(!this._instanceDataStorage.manualUpdate&&(!_.isFrozen||v)){const S=this.getWorldMatrix();if(x){this._scene.needsPreviousWorldMatrices&&(_.masterMeshPreviousWorldMatrix?(_.masterMeshPreviousWorldMatrix.copyToArray(f.instancesPreviousData,p),_.masterMeshPreviousWorldMatrix.copyFrom(S)):(_.masterMeshPreviousWorldMatrix=S.clone(),_.masterMeshPreviousWorldMatrix.copyToArray(f.instancesPreviousData,p))),S.copyToArray(f.instancesData,p);const R=S.asArray();f.instancesData[p+12]=R[12]-E.x,f.instancesData[p+13]=R[13]-E.y,f.instancesData[p+14]=R[14]-E.z,p+=16,b++}if(c){if(ee.INSTANCEDMESH_SORT_TRANSPARENT&&this._scene.activeCamera&&e.getMaterial()?.needAlphaBlendingForMesh(e.getRenderingMesh())){const R=this._scene.activeCamera.globalPosition;for(let P=0;P<c.length;P++){const M=c[P];M._distanceToCamera=I.Distance(M.getBoundingInfo().boundingSphere.centerWorld,R)}c.sort((P,M)=>P._distanceToCamera>M._distanceToCamera?-1:P._distanceToCamera<M._distanceToCamera?1:0)}for(let R=0;R<c.length;R++){const P=c[R],M=P.getWorldMatrix();M.copyToArray(f.instancesData,p),this._scene.needsPreviousWorldMatrices&&(P._previousWorldMatrix?(P._previousWorldMatrix.copyToArray(f.instancesPreviousData,p),P._previousWorldMatrix.copyFrom(M)):(P._previousWorldMatrix=M.clone(),P._previousWorldMatrix.copyToArray(f.instancesPreviousData,p)));const O=M.asArray();f.instancesData[p+12]=O[12]-E.x,f.instancesData[p+13]=O[13]-E.y,f.instancesData[p+14]=O[14]-E.z,p+=16,b++}}}else b=(x?1:0)+h;if(v){d&&d.dispose(),g&&g.dispose(),d=new Qf(s,f.instancesData,!0,16,!1,!0),f.instancesBuffer=d,this._userInstancedBuffersStorage||(this._userInstancedBuffersStorage={data:{},vertexBuffers:{},strides:{},sizes:{},vertexArrayObjects:this.getEngine().getCaps().vertexArrayObject?{}:void 0});let S;if(this._instanceDataStorage.useMonoDataStorageRenderPass)S=this._userInstancedBuffersStorage.vertexBuffers;else{this._userInstancedBuffersStorage.renderPasses||(this._userInstancedBuffersStorage.renderPasses={});const R=this._instanceDataStorage.engine.currentRenderPassId;S=this._userInstancedBuffersStorage.renderPasses[R],S||(this._userInstancedBuffersStorage.renderPasses[R]=S={})}S.world0=d.createVertexBuffer("world0",0,4),S.world1=d.createVertexBuffer("world1",4,4),S.world2=d.createVertexBuffer("world2",8,4),S.world3=d.createVertexBuffer("world3",12,4),this._scene.needsPreviousWorldMatrices&&(g=new Qf(s,f.instancesPreviousData,!0,16,!1,!0),f.instancesPreviousBuffer=g,S.previousWorld0=g.createVertexBuffer("previousWorld0",0,4),S.previousWorld1=g.createVertexBuffer("previousWorld1",4,4),S.previousWorld2=g.createVertexBuffer("previousWorld2",8,4),S.previousWorld3=g.createVertexBuffer("previousWorld3",12,4)),this._invalidateInstanceVertexArrayObject()}else(!this._instanceDataStorage.isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&(d.updateDirectly(f.instancesData,0,b),this._scene.needsPreviousWorldMatrices&&(!this._instanceDataStorage.manualUpdate||this._instanceDataStorage.previousManualUpdate)&&g.updateDirectly(f.instancesPreviousData,0,b));this._processInstancedBuffers(c,x),o&&n!==void 0&&(this.getScene()._activeIndices.addCount(e.indexCount*b,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,o,n),this._draw(e,n,b)),this._scene.needsPreviousWorldMatrices&&!v&&this._instanceDataStorage.manualUpdate&&(!this._instanceDataStorage.isFrozen||this._instanceDataStorage.forceMatrixUpdates)&&!this._instanceDataStorage.previousManualUpdate&&g.updateDirectly(f.instancesData,0,b)}_renderWithInstances(e,t,i,s,n){const o=i.visibleInstances[e._id],c=o?o.length:0,h=i.parent,f=h.instancesBufferSize,d=(c+1)*16*4;for(;h.instancesBufferSize<d;)h.instancesBufferSize*=2;return(!h.instancesData||f!=h.instancesBufferSize)&&(h.instancesData=new Float32Array(h.instancesBufferSize/4)),(this._scene.needsPreviousWorldMatrices&&!h.instancesPreviousData||f!=h.instancesBufferSize)&&(h.instancesPreviousData=new Float32Array(h.instancesBufferSize/4)),this._updateInstancedBuffers(e,i,f,n,t,s),n.unbindInstanceAttributes(),this}_renderWithThinInstances(e,t,i,s){const n=this._thinInstanceDataStorage?.instancesCount??0;
vendor: 3,483 bytes, line 187
187this.getScene()._activeIndices.addCount(e.indexCount*n,!1),s._currentDrawContext&&(s._currentDrawContext.useInstancing=!0),this._bind(e,i,t),this._draw(e,t,n),this._scene.needsPreviousWorldMatrices&&!this._thinInstanceDataStorage.previousMatrixData&&this._thinInstanceDataStorage.matrixData&&(this._thinInstanceDataStorage.previousMatrixBuffer?this._thinInstanceDataStorage.previousMatrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData,0,n):this._thinInstanceDataStorage.previousMatrixBuffer=this._thinInstanceCreateMatrixBuffer("previousWorld",this._thinInstanceDataStorage.matrixData,!1)),s.unbindInstanceAttributes()}_processInstancedBuffers(e,t){}_processRendering(e,t,i,s,n,o,c,h){const f=this.getScene(),_=f.getEngine();if(s=this._getRenderingFillMode(s),o&&t.getRenderingMesh().hasThinInstances)return this._renderWithThinInstances(t,s,i,_),this;if(o)this._renderWithInstances(t,s,n,i,_);else{_._currentDrawContext&&(_._currentDrawContext.useInstancing=!1);let d=0;n.renderSelf[t._id]&&(c&&c(!1,e.getWorldMatrix(),h),d++,this._draw(t,s,this._instanceDataStorage.overridenInstanceCount));const g=n.visibleInstances[t._id];if(g){const p=g.length;d+=p;for(let b=0;b<p;b++){const E=g[b].getWorldMatrix();c&&c(!0,E,h),this._draw(t,s)}}f._activeIndices.addCount(t.indexCount*d,!1)}return this}_disposeInstanceDataStorageRenderPass(e,t=!1){e?.instancesBuffer&&(t&&e.instancesBuffer.dispose(),e.instancesBuffer=null),e?.instancesPreviousBuffer&&(t&&e.instancesPreviousBuffer.dispose(),e.instancesPreviousBuffer=null)}_rebuild(e=!1){for(const t in this._instanceDataStorage.renderPasses){const i=this._instanceDataStorage.renderPasses[t];this._disposeInstanceDataStorageRenderPass(i,e)}if(this._disposeInstanceDataStorageRenderPass(this._instanceDataStorage.dataStorageRenderPass,e),this._userInstancedBuffersStorage){for(const t in this._userInstancedBuffersStorage.vertexBuffers){const i=this._userInstancedBuffersStorage.vertexBuffers[t];i&&(e&&i.dispose(),this._userInstancedBuffersStorage.vertexBuffers[t]=null)}this._userInstancedBuffersStorage.vertexArrayObjects&&(this._userInstancedBuffersStorage.vertexArrayObjects={})}this._internalMeshDataInfo._effectiveMaterial=null,super._rebuild(e)}_releaseRenderPassId(e){const t=this._instanceDataStorage.renderPasses[e];if(t&&(this._disposeInstanceDataStorageRenderPass(t,!0),delete this._instanceDataStorage.renderPasses[e]),this._userInstancedBuffersStorage?.renderPasses){const i=this._userInstancedBuffersStorage.renderPasses[e];if(i)for(const s in i)i[s]?.dispose();delete this._userInstancedBuffersStorage.renderPasses[e]}}_freeze(){if(this.subMeshes){for(let e=0;e<this.subMeshes.length;e++)this._getInstancesRenderList(e);this._internalMeshDataInfo._effectiveMaterial=null,this._instanceDataStorage.isFrozen=!0}}_unFreeze(){this._instanceDataStorage.isFrozen=!1;for(const e in this._instanceDataStorage.renderPasses){const t=this._instanceDataStorage.renderPasses[e];t.previousBatch=null}this._instanceDataStorage.dataStorageRenderPass&&(this._instanceDataStorage.dataStorageRenderPass.previousBatch=null)}renderWithRenderPassId(e,t,i,s,n=!0){const o=this._scene.getEngine(),c=o.currentRenderPassId;if(e!==void 0&&(o.currentRenderPassId=e),s)(!n||n&&s.isInFrustum(this._scene._frustumPlanes))&&this.render(s,!!t,i);else for(let h=0;h<this.subMeshes.length;h++){const f=this.subMeshes[h];(!n||n&&f.isInFrustum(this._scene._frustumPlanes))&&this.render(f,!!t,i)}return e!==void 0&&(o.currentRenderPassId=c),this}
vendor: 30,464 bytes, lines 187-194
187directRender(){if(!this.subMeshes)return this;for(const e of this.subMeshes)this.render(e,!1);return this}render(e,t,i){const s=this.getScene(),n=s.getEngine();this._internalAbstractMeshDataInfo._isActiveIntermediate?this._internalAbstractMeshDataInfo._isActiveIntermediate=!1:this._internalAbstractMeshDataInfo._isActive=!1;const o=s.activeCameras?.length??0,c=o>1&&s.activeCamera===s.activeCameras[0]||o<=1,h=this._occlusionDataStorage&&this._occlusionDataStorage.occlusionForRenderPassId!==-1&&this._occlusionDataStorage.occlusionForRenderPassId!==n.currentRenderPassId;if(c&&this._checkOcclusionQuery(h)&&!this._occlusionDataStorage.forceRenderingWhenOccluded)return this;const f=this._getInstancesRenderList(e._id,!!i);if(f.mustReturn)return this;if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;let _=0,d=null;this.ignoreCameraMaxZ&&s.activeCamera&&!s._isInIntermediateRendering()&&(_=s.activeCamera.maxZ,d=s.activeCamera,s.activeCamera.maxZ=0,s.updateTransformMatrix(!0)),this._internalMeshDataInfo._onBeforeRenderObservable&&this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);const g=e.getRenderingMesh(),p=f.hardwareInstancedRendering[e._id]||g.hasThinInstances||!!this._userInstancedBuffersStorage&&!e.getMesh()._internalAbstractMeshDataInfo._actAsRegularMesh,b=this._instanceDataStorage,x=e.getMaterial();if(!x)return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this;if(!b.isFrozen||!this._internalMeshDataInfo._effectiveMaterial||this._internalMeshDataInfo._effectiveMaterial!==x){if(x._storeEffectOnSubMeshes){if(!x.isReadyForSubMesh(this,e,p))return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this}else if(!x.isReady(this,p))return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this;this._internalMeshDataInfo._effectiveMaterial=x}else if(x._storeEffectOnSubMeshes&&!e._drawWrapper?._wasPreviouslyReady||!x._storeEffectOnSubMeshes&&!x._getDrawWrapper()._wasPreviouslyReady)return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this;if(t){const w=this._internalMeshDataInfo._effectiveMaterial;if(w.alphaModes.length===1)n.setAlphaMode(w.alphaMode);else for(let G=0;G<w.alphaModes.length;G++){const H=w.alphaModes[G];n.setAlphaMode(H!==void 0?H:2,!1,G)}}let E;this._internalMeshDataInfo._effectiveMaterial._storeEffectOnSubMeshes?E=e._drawWrapper:E=this._internalMeshDataInfo._effectiveMaterial._getDrawWrapper();const v=E?.effect??null;for(const w of s._beforeRenderingMeshStage)w.action(this,e,f,v);if(!E||!v)return d&&(d.maxZ=_,s.updateTransformMatrix(!0)),this;const S=i||this;let R;if(!b.isFrozen&&(this._internalMeshDataInfo._effectiveMaterial.backFaceCulling||this._internalMeshDataInfo._effectiveMaterial.sideOrientation!==null||this._internalMeshDataInfo._effectiveMaterial._twoSidedLighting)){const w=S._getWorldMatrixDeterminant();R=this._internalMeshDataInfo._effectiveMaterial._getEffectiveOrientation(this),w<0&&(R=R===wi.ClockWiseSideOrientation?wi.CounterClockWiseSideOrientation:wi.ClockWiseSideOrientation),this._internalMeshDataInfo._effectiveSideOrientation=R}const P=this._internalMeshDataInfo._effectiveMaterial._preBind(E,this._internalMeshDataInfo._effectiveSideOrientation);this._internalMeshDataInfo._effectiveMaterial.forceDepthWrite&&n.setDepthWrite(!0);const M=this._internalMeshDataInfo._effectiveMaterial,O=M.fillMode;this._internalMeshDataInfo._onBeforeBindObservable&&this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this),p||this._bind(e,v,O,!1);const D=S.getWorldMatrix();M._storeEffectOnSubMeshes?M.bindForSubMesh(D,this,e):M.bind(D,this),!M.backFaceCulling&&M.separateCullingPass&&(n.setState(!0,M.zOffset,!1,!P,M.cullBackFaces,M.stencil,M.zOffsetUnits),this._processRendering(this,e,v,O,f,p,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),n.setState(!0,M.zOffset,!1,P,M.cullBackFaces,M.stencil,M.zOffsetUnits),this._internalMeshDataInfo._onBetweenPassObservable&&this._internalMeshDataInfo._onBetweenPassObservable.notifyObservers(e)),this._processRendering(this,e,v,O,f,p,this._onBeforeDraw,this._internalMeshDataInfo._effectiveMaterial),this._internalMeshDataInfo._effectiveMaterial.unbind();for(const w of s._afterRenderingMeshStage)w.action(this,e,f,v);return this._internalMeshDataInfo._onAfterRenderObservable&&this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this),d&&(d.maxZ=_,s.updateTransformMatrix(!0)),s.performancePriority===2&&!b.isFrozen&&this._freeze(),this}cleanMatrixWeights(){this.isVerticesDataPresent(U.MatricesWeightsKind)&&(this.isVerticesDataPresent(U.MatricesWeightsExtraKind)?this._normalizeSkinWeightsAndExtra():this._normalizeSkinFourWeights())}_normalizeSkinFourWeights(){const e=this.getVerticesData(U.MatricesWeightsKind),t=e.length;for(let i=0;i<t;i+=4){const s=e[i]+e[i+1]+e[i+2]+e[i+3];if(s===0)e[i]=1;else{const n=1/s;e[i]*=n,e[i+1]*=n,e[i+2]*=n,e[i+3]*=n}}this.setVerticesData(U.MatricesWeightsKind,e)}_normalizeSkinWeightsAndExtra(){const e=this.getVerticesData(U.MatricesWeightsExtraKind),t=this.getVerticesData(U.MatricesWeightsKind),i=t.length;for(let s=0;s<i;s+=4){let n=t[s]+t[s+1]+t[s+2]+t[s+3];if(n+=e[s]+e[s+1]+e[s+2]+e[s+3],n===0)t[s]=1;else{const o=1/n;t[s]*=o,t[s+1]*=o,t[s+2]*=o,t[s+3]*=o,e[s]*=o,e[s+1]*=o,e[s+2]*=o,e[s+3]*=o}}this.setVerticesData(U.MatricesWeightsKind,t),this.setVerticesData(U.MatricesWeightsKind,e)}validateSkinning(){const e=this.getVerticesData(U.MatricesWeightsExtraKind),t=this.getVerticesData(U.MatricesWeightsKind);if(t===null||this.skeleton==null)return{skinned:!1,valid:!0,report:"not skinned"};const i=t.length;let s=0,n=0,o=0,c=0;const h=e===null?4:8,f=[];for(let E=0;E<=h;E++)f[E]=0;const _=.001;for(let E=0;E<i;E+=4){let v=t[E],S=v,R=S===0?0:1;for(let P=1;P<h;P++){const M=P<4?t[E+P]:e[E+P-4];M>v&&s++,M!==0&&R++,S+=M,v=M}if(f[R]++,R>o&&(o=R),S===0)n++;else{const P=1/S;let M=0;for(let O=0;O<h;O++)O<4?M+=Math.abs(t[E+O]-t[E+O]*P):M+=Math.abs(e[E+O-4]-e[E+O-4]*P);M>_&&c++}}const d=this.skeleton.bones.length,g=this.getVerticesData(U.MatricesIndicesKind),p=this.getVerticesData(U.MatricesIndicesExtraKind);let b=0;for(let E=0;E<i;E+=4)for(let v=0;v<h;v++){const S=v<4?g[E+v]:p[E+v-4];(S>=d||S<0)&&b++}const x="Number of Weights = "+i/4+`
188Maximum influences = `+o+`
189Missing Weights = `+n+`
190Not Sorted = `+s+`
191Not Normalized = `+c+`
192WeightCounts = [`+f+`]
193Number of bones = `+d+`
194Bad Bone Indices = `+b;return{skinned:!0,valid:n===0&&c===0&&b===0,report:x}}_checkDelayState(){const e=this.getScene();return this._geometry?this._geometry.load(e):this.delayLoadState===4&&(this.delayLoadState=2,this._queueLoad(e)),this}_queueLoad(e){e.addPendingData(this);const t=this.delayLoadingFile.indexOf(".babylonbinarymeshdata")!==-1;return(async()=>{try{const i=await e._loadDelayedFileAsync(this.delayLoadingFile,t,!0);i instanceof ArrayBuffer?this._delayLoadingFunction(i,this):this._delayLoadingFunction(JSON.parse(i),this);for(const s of this.instances)s.refreshBoundingInfo(),s._syncSubMeshes();this.delayLoadState=1,e.removePendingData(this)}catch(i){e.removePendingData(this),e.isDisposed||Ee.Error(`Unable to delay load geometry data for mesh "${this.name}" from "${this.delayLoadingFile}": ${i}`)}})(),this}isInFrustum(e){return this.delayLoadState===2||!super.isInFrustum(e)?!1:(this._checkDelayState(),!0)}setMaterialById(e){const t=this.getScene().materials;let i;for(i=t.length-1;i>-1;i--)if(t[i].id===e)return this.material=t[i],this;const s=this.getScene().multiMaterials;for(i=s.length-1;i>-1;i--)if(s[i].id===e)return this.material=s[i],this;return this}getAnimatables(){const e=[];return this.material&&e.push(this.material),this.skeleton&&e.push(this.skeleton),e}bakeTransformIntoVertices(e){if(!this.isVerticesDataPresent(U.PositionKind))return this;const t=this.subMeshes.splice(0);this._resetPointsArrayCache();let i=this.getVerticesData(U.PositionKind);const s=I.Zero();let n;for(n=0;n<i.length;n+=3)I.TransformCoordinatesFromFloatsToRef(i[n],i[n+1],i[n+2],e,s).toArray(i,n);if(this.setVerticesData(U.PositionKind,i,this.getVertexBuffer(U.PositionKind).isUpdatable()),this.isVerticesDataPresent(U.NormalKind)){for(i=this.getVerticesData(U.NormalKind),n=0;n<i.length;n+=3)I.TransformNormalFromFloatsToRef(i[n],i[n+1],i[n+2],e,s).normalize().toArray(i,n);this.setVerticesData(U.NormalKind,i,this.getVertexBuffer(U.NormalKind).isUpdatable())}if(this.isVerticesDataPresent(U.TangentKind)){for(i=this.getVerticesData(U.TangentKind),n=0;n<i.length;n+=4)I.TransformNormalFromFloatsToRef(i[n],i[n+1],i[n+2],e,s).normalize().toArray(i,n);this.setVerticesData(U.TangentKind,i,this.getVertexBuffer(U.TangentKind).isUpdatable())}return e.determinant()<0&&this.flipFaces(),this.releaseSubMeshes(),this.subMeshes=t,this}bakeCurrentTransformIntoVertices(e=!0,t=!1){return t&&this.makeGeometryUnique(),this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)),this.resetLocalMatrix(e),this}get _positions(){return this._internalAbstractMeshDataInfo._positions||this._geometry&&this._geometry._positions||null}_resetPointsArrayCache(){return this._geometry&&this._geometry._resetPointsArrayCache(),this}_generatePointsArray(){return this._geometry?this._geometry._generatePointsArray():!1}clone(e="",t=null,i,s=!0){if(t&&t._addToSceneRootNodes===void 0){const n=t;return Hn.source=this,Hn.doNotCloneChildren=n.doNotCloneChildren,Hn.clonePhysicsImpostor=n.clonePhysicsImpostor,Hn.cloneThinInstances=n.cloneThinInstances,new ee(e,this.getScene(),Hn)}return new ee(e,this.getScene(),t,this,i,s)}dispose(e,t=!1){this.morphTargetManager=null,this._geometry&&this._geometry.releaseForMesh(this,!0);const i=this._internalMeshDataInfo;if(i._onBeforeDrawObservable&&i._onBeforeDrawObservable.clear(),i._onBeforeBindObservable&&i._onBeforeBindObservable.clear(),i._onBeforeRenderObservable&&i._onBeforeRenderObservable.clear(),i._onAfterRenderObservable&&i._onAfterRenderObservable.clear(),i._onBetweenPassObservable&&i._onBetweenPassObservable.clear(),this._scene.useClonedMeshMap){if(i.meshMap)for(const s in i.meshMap){const n=i.meshMap[s];n&&(n._internalMeshDataInfo._source=null,i.meshMap[s]=void 0)}i._source&&i._source._internalMeshDataInfo.meshMap&&(i._source._internalMeshDataInfo.meshMap[this.uniqueId]=void 0)}else{const s=this.getScene().meshes;for(const n of s){const o=n;o._internalMeshDataInfo&&o._internalMeshDataInfo._source&&o._internalMeshDataInfo._source===this&&(o._internalMeshDataInfo._source=null)}}i._source=null,this._disposeInstanceSpecificData(),this._disposeThinInstanceSpecificData(),this._internalMeshDataInfo._checkReadinessObserver&&this._scene.onBeforeRenderObservable.remove(this._internalMeshDataInfo._checkReadinessObserver),super.dispose(e,t)}_disposeInstanceSpecificData(){}_disposeThinInstanceSpecificData(){}_invalidateInstanceVertexArrayObject(){}applyDisplacementMap(e,t,i,s,n,o,c=!1,h){const f=this.getScene();return qf(e,d=>{const g=d.width,p=d.height,x=this.getEngine().createCanvas(g,p).getContext("2d");x.drawImage(d,0,0);const E=x.getImageData(0,0,g,p).data;this.applyDisplacementMapFromBuffer(E,g,p,t,i,n,o,c),s&&s(this)},h||(()=>{}),f.offlineProvider),this}applyDisplacementMapFromBuffer(e,t,i,s,n,o,c,h=!1){if(!this.isVerticesDataPresent(U.PositionKind)||!this.isVerticesDataPresent(U.NormalKind)||!this.isVerticesDataPresent(U.UVKind))return Ee.Warn("Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing"),this;const f=this.getVerticesData(U.PositionKind,!0,!0),_=this.getVerticesData(U.NormalKind),d=this.getVerticesData(U.UVKind);let g=I.Zero();const p=I.Zero(),b=He.Zero();o=o||He.Zero(),c=c||new He(1,1);for(let x=0;x<f.length;x+=3){I.FromArrayToRef(f,x,g),I.FromArrayToRef(_,x,p),He.FromArrayToRef(d,x/3*2,b);const E=Math.abs(b.x*c.x+o.x%1)*(t-1)%t|0,v=Math.abs(b.y*c.y+o.y%1)*(i-1)%i|0,S=(E+v*t)*4,R=e[S]/255,P=e[S+1]/255,M=e[S+2]/255,O=R*.3+P*.59+M*.11;p.normalize(),p.scaleInPlace(s+(n-s)*O),g=g.add(p),g.toArray(f,x)}return Ye.ComputeNormals(f,this.getIndices(),_),h?(this.setVerticesData(U.PositionKind,f),this.setVerticesData(U.NormalKind,_),this.setVerticesData(U.UVKind,d)):(this.updateVerticesData(U.PositionKind,f),this.updateVerticesData(U.NormalKind,_)),this}_getFlattenedNormals(e,t){const i=new Float32Array(e.length*3);let s=0;const n=this.sideOrientation===(this._scene.useRightHandedSystem?1:0);for(let o=0;o<e.length;o+=3){const c=I.FromArray(t,e[o]*3),h=I.FromArray(t,e[o+1]*3),f=I.FromArray(t,e[o+2]*3),_=c.subtract(h),d=f.subtract(h),g=I.Normalize(I.Cross(_,d));n&&g.scaleInPlace(-1);for(let p=0;p<3;p++)i[s++]=g.x,i[s++]=g.y,i[s++]=g.z}return i}_convertToUnIndexedMesh(e=!1){const t=this.getVerticesDataKinds().filter(h=>!this.getVertexBuffer(h)?.getIsInstanced()),i=this.getIndices(!1,!0),s={},n=(h,f)=>{const _=new Float32Array(i.length*f);let d=0;for(let g=0;g<i.length;g++)for(let p=0;p<f;p++)_[d++]=h[i[g]*f+p];return _},o=this.getBoundingInfo(),c=this.geometry?this.subMeshes.slice(0):[];for(const h of t)s[h]=this.getVerticesData(h);for(const h of t){const f=this.getVertexBuffer(h),_=f.getSize();if(e&&h===U.NormalKind){const d=this._getFlattenedNormals(i,s[U.PositionKind]);this.setVerticesData(U.NormalKind,d,f.isUpdatable(),_)}else this.setVerticesData(h,n(s[h],_),f.isUpdatable(),_)}if(this.morphTargetManager){for(let h=0;h<this.morphTargetManager.numTargets;h++){const f=this.morphTargetManager.getTarget(h),_=f.getPositions();f.setPositions(n(_,3));const d=f.getNormals();d&&f.setNormals(e?this._getFlattenedNormals(i,_):n(d,3));const g=f.getTangents();g&&f.setTangents(n(g,3));const p=f.getUVs();p&&f.setUVs(n(p,2));const b=f.getColors();b&&f.setColors(n(b,4))}this.morphTargetManager.synchronize()}for(let h=0;h<i.length;h++)i[h]=h;this.setIndices(i),this._unIndexed=!0,this.releaseSubMeshes();for(const h of c){const f=h.getBoundingInfo();tn.AddToMesh(h.materialIndex,h.indexStart,h.indexCount,h.indexStart,h.indexCount,this).setBoundingInfo(f)}return this.setBoundingInfo(o),this.synchronizeInstances(),this}convertToFlatShadedMesh(){return this._convertToUnIndexedMesh(!0)}convertToUnIndexedMesh(){return this._convertToUnIndexedMesh()}flipFaces(e=!1){const t=Ye.ExtractFromMesh(this);let i;if(e&&this.isVerticesDataPresent(U.NormalKind)&&t.normals){for(i=0;i<t.normals.length;i++)t.normals[i]*=-1;this.setVerticesData(U.NormalKind,t.normals,this.isVertexBufferUpdatable(U.NormalKind))}if(t.indices){let s;for(i=0;i<t.indices.length;i+=3)s=t.indices[i+1],t.indices[i+1]=t.indices[i+2],t.indices[i+2]=s;this.setIndices(t.indices,null,this.isVertexBufferUpdatable(U.PositionKind),!0)}return this}increaseVertices(e=1){const t=Ye.ExtractFromMesh(this),i=t.indices&&!Array.isArray(t.indices)&&Array.from?Array.from(t.indices):t.indices,s=t.positions&&!Array.isArray(t.positions)&&Array.from?Array.from(t.positions):t.positions,n=t.uvs&&!Array.isArray(t.uvs)&&Array.from?Array.from(t.uvs):t.uvs,o=t.normals&&!Array.isArray(t.normals)&&Array.from?Array.from(t.normals):t.normals;if(!i||!s)Ee.Warn("Couldn't increase number of vertices : VertexData must contain at least indices and positions");else{t.indices=i,t.positions=s,n&&(t.uvs=n),o&&(t.normals=o);const c=e+1,h=[];for(let M=0;M<c+1;M++)h[M]=[];let f,_;const d=new I(0,0,0),g=new I(0,0,0),p=new He(0,0),b=[],x=[],E=[];let v,S=s.length,R;n&&(R=n.length);let P;o&&(P=o.length);for(let M=0;M<i.length;M+=3){x[0]=i[M],x[1]=i[M+1],x[2]=i[M+2];for(let O=0;O<3;O++)if(f=x[O],_=x[(O+1)%3],E[f]===void 0&&E[_]===void 0?(E[f]=[],E[_]=[]):(E[f]===void 0&&(E[f]=[]),E[_]===void 0&&(E[_]=[])),E[f][_]===void 0&&E[_][f]===void 0){E[f][_]=[],d.x=(s[3*_]-s[3*f])/c,d.y=(s[3*_+1]-s[3*f+1])/c,d.z=(s[3*_+2]-s[3*f+2])/c,o&&(g.x=(o[3*_]-o[3*f])/c,g.y=(o[3*_+1]-o[3*f+1])/c,g.z=(o[3*_+2]-o[3*f+2])/c),n&&(p.x=(n[2*_]-n[2*f])/c,p.y=(n[2*_+1]-n[2*f+1])/c),E[f][_].push(f);for(let D=1;D<c;D++)E[f][_].push(s.length/3),s[S++]=s[3*f]+D*d.x,s[S++]=s[3*f+1]+D*d.y,s[S++]=s[3*f+2]+D*d.z,o&&(o[P++]=o[3*f]+D*g.x,o[P++]=o[3*f+1]+D*g.y,o[P++]=o[3*f+2]+D*g.z),n&&(n[R++]=n[2*f]+D*p.x,n[R++]=n[2*f+1]+D*p.y);E[f][_].push(_),E[_][f]=[],v=E[f][_].length;for(let D=0;D<v;D++)E[_][f][D]=E[f][_][v-1-D]}h[0][0]=i[M],h[1][0]=E[i[M]][i[M+1]][1],h[1][1]=E[i[M]][i[M+2]][1];for(let O=2;O<c;O++){h[O][0]=E[i[M]][i[M+1]][O],h[O][O]=E[i[M]][i[M+2]][O],d.x=(s[3*h[O][O]]-s[3*h[O][0]])/O,d.y=(s[3*h[O][O]+1]-s[3*h[O][0]+1])/O,d.z=(s[3*h[O][O]+2]-s[3*h[O][0]+2])/O,o&&(g.x=(o[3*h[O][O]]-o[3*h[O][0]])/O,g.y=(o[3*h[O][O]+1]-o[3*h[O][0]+1])/O,g.z=(o[3*h[O][O]+2]-o[3*h[O][0]+2])/O),n&&(p.x=(n[2*h[O][O]]-n[2*h[O][0]])/O,p.y=(n[2*h[O][O]+1]-n[2*h[O][0]+1])/O);for(let D=1;D<O;D++)h[O][D]=s.length/3,s[S++]=s[3*h[O][0]]+D*d.x,s[S++]=s[3*h[O][0]+1]+D*d.y,s[S++]=s[3*h[O][0]+2]+D*d.z,o&&(o[P++]=o[3*h[O][0]]+D*g.x,o[P++]=o[3*h[O][0]+1]+D*g.y,o[P++]=o[3*h[O][0]+2]+D*g.z),n&&(n[R++]=n[2*h[O][0]]+D*p.x,n[R++]=n[2*h[O][0]+1]+D*p.y)}h[c]=E[i[M+1]][i[M+2]],b.push(h[0][0],h[1][0],h[1][1]);for(let O=1;O<c;O++){let D;for(D=0;D<O;D++)b.push(h[O][D],h[O+1][D],h[O+1][D+1]),b.push(h[O][D],h[O+1][D+1],h[O][D+1]);b.push(h[O][D],h[O+1][D],h[O+1][D+1])}}t.indices=b,t.applyToMesh(this,this.isVertexBufferUpdatable(U.PositionKind))}}forceSharedVertices(){const e=Ye.ExtractFromMesh(this),t=e.uvs,i=e.indices,s=e.positions,n=e.colors,o=e.matricesIndices,c=e.matricesWeights,h=e.matricesIndicesExtra,f=e.matricesWeightsExtra;if(i===void 0||s===void 0||i===null||s===null)Ee.Warn("VertexData contains empty entries");else{const _=[],d=[],g=[],p=[],b=[],x=[],E=[],v=[];let S,R=0;const P={};let M,O;for(let w=0;w<i.length;w+=3){O=[i[w],i[w+1],i[w+2]],S=[];for(let G=0;G<3;G++){S[G]="";for(let H=0;H<3;H++)Math.abs(s[3*O[G]+H])<1e-8&&(s[3*O[G]+H]=0),S[G]+=s[3*O[G]+H]+"|"}if(!(S[0]==S[1]||S[0]==S[2]||S[1]==S[2]))for(let G=0;G<3;G++){if(M=P[S[G]],M===void 0){P[S[G]]=R,M=R++;for(let H=0;H<3;H++)_.push(s[3*O[G]+H]);if(n!=null)for(let H=0;H<4;H++)p.push(n[4*O[G]+H]);if(t!=null)for(let H=0;H<2;H++)g.push(t[2*O[G]+H]);if(o!=null)for(let H=0;H<4;H++)b.push(o[4*O[G]+H]);if(c!=null)for(let H=0;H<4;H++)x.push(c[4*O[G]+H]);if(h!=null)for(let H=0;H<4;H++)E.push(h[4*O[G]+H]);if(f!=null)for(let H=0;H<4;H++)v.push(f[4*O[G]+H])}d.push(M)}}const D=[];Ye.ComputeNormals(_,d,D),e.positions=_,e.indices=d,e.normals=D,t!=null&&(e.uvs=g),n!=null&&(e.colors=p),o!=null&&(e.matricesIndices=b),c!=null&&(e.matricesWeights=x),h!=null&&(e.matricesIndicesExtra=E),c!=null&&(e.matricesWeightsExtra=v),e.applyToMesh(this,this.isVertexBufferUpdatable(U.PositionKind))}}static _instancedMeshFactory(e,t){throw at("InstancedMesh")}static _PhysicsImpostorParser(e,t,i){throw at("PhysicsImpostor")}createInstance(e){const t=ee._instancedMeshFactory(e,this);return t.parent=this.parent,t}synchronizeInstances(){for(let e=0;e<this.instances.length;e++)this.instances[e]._syncSubMeshes();return this}optimizeIndices(e){const t=this.getIndices(),i=this.getVerticesData(U.PositionKind);if(!i||!t)return this;const s=[];for(let o=0;o<i.length;o=o+3)s.push(I.FromArray(i,o));const n=[];return Zf.SyncAsyncForLoop(s.length,40,o=>{const c=s.length-1-o,h=s[c];for(let f=0;f<c;++f){const _=s[f];if(h.equals(_)){n[c]=f;break}}},()=>{for(let c=0;c<t.length;++c)t[c]=n[t[c]]||t[c];const o=this.subMeshes.slice(0);this.setIndices(t),this.subMeshes=o,e&&e(this)}),this}serialize(e={}){e.name=this.name,e.id=this.id,e.uniqueId=this.uniqueId,e.type=this.getClassName(),Ut&&Ut.HasTags(this)&&(e.tags=Ut.GetTags(this)),e.position=this.position.asArray(),this.rotationQuaternion?e.rotationQuaternion=this.rotationQuaternion.asArray():this.rotation&&(e.rotation=this.rotation.asArray()),e.scaling=this.scaling.asArray(),this._postMultiplyPivotMatrix?e.pivotMatrix=this.getPivotMatrix().asArray():e.localMatrix=this.getPivotMatrix().asArray(),e.isEnabled=this.isEnabled(!1),e.isVisible=this.isVisible,e.infiniteDistance=this.infiniteDistance,e.pickable=this.isPickable,e.receiveShadows=this.receiveShadows,e.billboardMode=this.billboardMode,e.visibility=this.visibility,e.alwaysSelectAsActiveMesh=this.alwaysSelectAsActiveMesh,e.checkCollisions=this.checkCollisions,e.ellipsoid=this.ellipsoid.asArray(),e.ellipsoidOffset=this.ellipsoidOffset.asArray(),e.doNotSyncBoundingInfo=this.doNotSyncBoundingInfo,e.isBlocker=this.isBlocker,e.sideOrientation=this.sideOrientation,this._isWorldMatrixFrozen&&(e.freezeWorldMatrix=!0),this.parent&&this.parent._serializeAsParent(e),e.isUnIndexed=this.isUnIndexed;const t=this._geometry;if(t&&this.subMeshes){e.geometryUniqueId=t.uniqueId,e.geometryId=t.id,e.subMeshes=[];for(let i=0;i<this.subMeshes.length;i++){const s=this.subMeshes[i];e.subMeshes.push({materialIndex:s.materialIndex,verticesStart:s.verticesStart,verticesCount:s.verticesCount,indexStart:s.indexStart,indexCount:s.indexCount})}}if(this.material?this.material.doNotSerialize||(e.materialUniqueId=this.material.uniqueId,e.materialId=this.material.id):(this.material=null,e.materialUniqueId=this._scene.defaultMaterial.uniqueId,e.materialId=this._scene.defaultMaterial.id),this.morphTargetManager&&(e.morphTargetManagerId=this.morphTargetManager.uniqueId),this.skeleton&&(e.skeletonId=this.skeleton.id,e.skeletonUniqueId=this.skeleton.uniqueId,e.numBoneInfluencers=this.numBoneInfluencers),this.getScene()._getComponent(ot.NAME_PHYSICSENGINE)){const i=this.getPhysicsImpostor?.();i&&(e.physicsMass=i.getParam("mass"),e.physicsFriction=i.getParam("friction"),e.physicsRestitution=i.getParam("mass"),e.physicsImpostor=i.type)}this.metadata&&(e.metadata=this.metadata),e.instances=[];for(let i=0;i<this.instances.length;i++){const s=this.instances[i];if(s.doNotSerialize)continue;const n={name:s.name,id:s.id,isEnabled:s.isEnabled(!1),isVisible:s.isVisible,isPickable:s.isPickable,checkCollisions:s.checkCollisions,position:s.position.asArray(),scaling:s.scaling.asArray()};if(s.parent&&s.parent._serializeAsParent(n),s.rotationQuaternion?n.rotationQuaternion=s.rotationQuaternion.asArray():s.rotation&&(n.rotation=s.rotation.asArray()),this.getScene()._getComponent(ot.NAME_PHYSICSENGINE)){const o=s.getPhysicsImpostor?.();o&&(n.physicsMass=o.getParam("mass"),n.physicsFriction=o.getParam("friction"),n.physicsRestitution=o.getParam("mass"),n.physicsImpostor=o.type)}s.metadata&&(n.metadata=s.metadata),s.actionManager&&(n.actions=s.actionManager.serialize(s.name)),e.instances.push(n),Tt.AppendSerializedAnimations(s,n),n.ranges=s.serializeAnimationRanges()}if(this._thinInstanceDataStorage.instancesCount&&this._thinInstanceDataStorage.matrixData&&(e.thinInstances={instancesCount:this._thinInstanceDataStorage.instancesCount,matrixData:Array.from(this._thinInstanceDataStorage.matrixData),matrixBufferSize:this._thinInstanceDataStorage.matrixBufferSize,enablePicking:this.thinInstanceEnablePicking},this._userThinInstanceBuffersStorage)){const i={data:{},sizes:{},strides:{}};for(const s in this._userThinInstanceBuffersStorage.data)i.data[s]=Array.from(this._userThinInstanceBuffersStorage.data[s]),i.sizes[s]=this._userThinInstanceBuffersStorage.sizes[s],i.strides[s]=this._userThinInstanceBuffersStorage.strides[s];e.thinInstances.userThinInstance=i}return Tt.AppendSerializedAnimations(this,e),e.ranges=this.serializeAnimationRanges(),e.layerMask=this.layerMask,e.alphaIndex=this.alphaIndex,e.hasVertexAlpha=this.hasVertexAlpha,e.overlayAlpha=this.overlayAlpha,e.overlayColor=this.overlayColor.asArray(),e.renderOverlay=this.renderOverlay,e.applyFog=this.applyFog,this.actionManager&&(e.actions=this.actionManager.serialize(this.name)),e}_syncGeometryWithMorphTargetManager(){if(!this.geometry)return;this._markSubMeshesAsAttributesDirty();const e=this._internalAbstractMeshDataInfo._morphTargetManager;if(e&&e.vertexCount){if(e.vertexCount!==this.getTotalVertices()){Ee.Error("Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count."),this.morphTargetManager=null;return}if(e.isUsingTextureForTargets)return;for(let t=0;t<e.numInfluencers;t++){const i=e.getActiveTarget(t),s=i.getPositions();if(!s){Ee.Error("Invalid morph target. Target must have positions.");return}this.geometry.setVerticesData(U.PositionKind+t,s,!1,3);const n=i.getNormals();n&&this.geometry.setVerticesData(U.NormalKind+t,n,!1,3);const o=i.getTangents();o&&this.geometry.setVerticesData(U.TangentKind+t,o,!1,3);const c=i.getUVs();c&&this.geometry.setVerticesData(U.UVKind+"_"+t,c,!1,2);const h=i.getUV2s();h&&this.geometry.setVerticesData(U.UV2Kind+"_"+t,h,!1,2);const f=i.getColors();f&&this.geometry.setVerticesData(U.ColorKind+t,f,!1,4)}}else{let t=0;for(;this.geometry.isVerticesDataPresent(U.PositionKind+t);)this.geometry.removeVerticesData(U.PositionKind+t),this.geometry.isVerticesDataPresent(U.NormalKind+t)&&this.geometry.removeVerticesData(U.NormalKind+t),this.geometry.isVerticesDataPresent(U.TangentKind+t)&&this.geometry.removeVerticesData(U.TangentKind+t),this.geometry.isVerticesDataPresent(U.UVKind+t)&&this.geometry.removeVerticesData(U.UVKind+"_"+t),this.geometry.isVerticesDataPresent(U.UV2Kind+t)&&this.geometry.removeVerticesData(U.UV2Kind+"_"+t),this.geometry.isVerticesDataPresent(U.ColorKind+t)&&this.geometry.removeVerticesData(U.ColorKind+t),t++}}static Parse(e,t,i){let s,n=!1;if(e.type&&e.type==="LinesMesh"?s=ee._LinesMeshParser(e,t):e.type&&e.type==="GroundMesh"?s=ee._GroundMeshParser(e,t):e.type&&e.type==="GoldbergMesh"?s=ee._GoldbergMeshParser(e,t):e.type&&e.type==="GreasedLineMesh"?s=ee._GreasedLineMeshParser(e,t):e.type&&e.type==="TrailMesh"?s=ee._TrailMeshParser(e,t):e.type&&e.type==="GaussianSplattingMesh"?(e._isCompound?s=ee._GaussianSplattingCompoundMeshParser(e,t):s=ee._GaussianSplattingMeshParser(e,t),n=!0):e.type&&e.type==="GaussianSplattingPartProxyMesh"?(s=ee._GaussianSplattingPartProxyMeshParser(e,t),n=!0):s=new ee(e.name,t),s.id=e.id,s._waitingParsedUniqueId=e.uniqueId,Ut&&Ut.AddTagsTo(s,e.tags),s.position=I.FromArray(e.position),e.metadata!==void 0&&(s.metadata=e.metadata),e.rotationQuaternion?s.rotationQuaternion=Ue.FromArray(e.rotationQuaternion):e.rotation&&(s.rotation=I.FromArray(e.rotation)),s.scaling=I.FromArray(e.scaling),e.localMatrix?s.setPreTransformMatrix(ae.FromArray(e.localMatrix)):e.pivotMatrix&&s.setPivotMatrix(ae.FromArray(e.pivotMatrix)),s.setEnabled(e.isEnabled),s.isVisible=e.isVisible,s.infiniteDistance=e.infiniteDistance,s.alwaysSelectAsActiveMesh=!!e.alwaysSelectAsActiveMesh,s.showBoundingBox=e.showBoundingBox,s.showSubMeshesBoundingBox=e.showSubMeshesBoundingBox,e.applyFog!==void 0&&(s.applyFog=e.applyFog),e.pickable!==void 0&&(s.isPickable=e.pickable),e.alphaIndex!==void 0&&(s.alphaIndex=e.alphaIndex),s.receiveShadows=e.receiveShadows,e.billboardMode!==void 0&&(s.billboardMode=e.billboardMode),e.visibility!==void 0&&(s.visibility=e.visibility),s.checkCollisions=e.checkCollisions,s.doNotSyncBoundingInfo=!!e.doNotSyncBoundingInfo,e.ellipsoid&&(s.ellipsoid=I.FromArray(e.ellipsoid)),e.ellipsoidOffset&&(s.ellipsoidOffset=I.FromArray(e.ellipsoidOffset)),e.overrideMaterialSideOrientation!=null&&(s.sideOrientation=e.overrideMaterialSideOrientation),e.sideOrientation!==void 0&&(s.sideOrientation=e.sideOrientation),e.isBlocker!==void 0&&(s.isBlocker=e.isBlocker),s._shouldGenerateFlatShading=e.useFlatShading,e.freezeWorldMatrix&&(s._waitingData.freezeWorldMatrix=e.freezeWorldMatrix),e.parentId!==void 0&&(s._waitingParentId=e.parentId),e.parentInstanceIndex!==void 0&&(s._waitingParentInstanceIndex=e.parentInstanceIndex),e.actions!==void 0&&(s._waitingData.actions=e.actions),e.overlayAlpha!==void 0&&(s.overlayAlpha=e.overlayAlpha),e.overlayColor!==void 0&&(s.overlayColor=tt.FromArray(e.overlayColor)),e.renderOverlay!==void 0&&(s.renderOverlay=e.renderOverlay),s.isUnIndexed=!!e.isUnIndexed,s.hasVertexAlpha=e.hasVertexAlpha,e.delayLoadingFile?(s.delayLoadState=4,s.delayLoadingFile=i+e.delayLoadingFile,s.buildBoundingInfo(I.FromArray(e.boundingBoxMinimum),I.FromArray(e.boundingBoxMaximum)),e._binaryInfo&&(s._binaryInfo=e._binaryInfo),s._delayInfo=[],e.hasUVs&&s._delayInfo.push(U.UVKind),e.hasUVs2&&s._delayInfo.push(U.UV2Kind),e.hasUVs3&&s._delayInfo.push(U.UV3Kind),e.hasUVs4&&s._delayInfo.push(U.UV4Kind),e.hasUVs5&&s._delayInfo.push(U.UV5Kind),e.hasUVs6&&s._delayInfo.push(U.UV6Kind),e.hasColors&&s._delayInfo.push(U.ColorKind),e.hasMatricesIndices&&s._delayInfo.push(U.MatricesIndicesKind),e.hasMatricesWeights&&s._delayInfo.push(U.MatricesWeightsKind),s._delayLoadingFunction=Es._ImportGeometry,Ds.ForceFullSceneLoadingForIncremental&&s._checkDelayState()):n||Es._ImportGeometry(e,s),e.materialUniqueId?s._waitingMaterialId=e.materialUniqueId:e.materialId&&(s._waitingMaterialId=e.materialId),e.morphTargetManagerId>-1&&(s._waitingMorphTargetManagerId=e.morphTargetManagerId),e.skeletonId!==void 0&&e.skeletonId!==null&&(s.skeleton=t.getLastSkeletonById(e.skeletonId),s._waitingSkeletonId=e.skeletonId,e.numBoneInfluencers&&(s.numBoneInfluencers=e.numBoneInfluencers)),e.skeletonUniqueId!==void 0&&e.skeletonUniqueId!==null&&(s._waitingSkeletonUniqueId=e.skeletonUniqueId),e.animations){for(let o=0;o<e.animations.length;o++){const c=e.animations[o],h=Vf("BABYLON.Animation");h&&s.animations.push(h.Parse(c))}Qn.ParseAnimationRanges(s,e,t)}if(e.autoAnimate&&t.beginAnimation(s,e.autoAnimateFrom,e.autoAnimateTo,e.autoAnimateLoop,e.autoAnimateSpeed||1),e.layerMask&&!isNaN(e.layerMask)?s.layerMask=Math.abs(parseInt(e.layerMask)):s.layerMask=268435455,e.physicsImpostor&&(s.physicsImpostor=ee._PhysicsImpostorParser(t,s,e)),e.lodMeshIds&&(s._waitingData.lods={ids:e.lodMeshIds,distances:e.lodDistances?e.lodDistances:null,coverages:e.lodCoverages?e.lodCoverages:null}),e.instances)for(let o=0;o<e.instances.length;o++){const c=e.instances[o],h=s.createInstance(c.name);if(c.id&&(h.id=c.id),Ut&&(c.tags?Ut.AddTagsTo(h,c.tags):Ut.AddTagsTo(h,e.tags)),h.position=I.FromArray(c.position),c.metadata!==void 0&&(h.metadata=c.metadata),c.parentId!==void 0&&(h._waitingParentId=c.parentId),c.parentInstanceIndex!==void 0&&(h._waitingParentInstanceIndex=c.parentInstanceIndex),c.isEnabled!==void 0&&c.isEnabled!==null&&h.setEnabled(c.isEnabled),c.isVisible!==void 0&&c.isVisible!==null&&(h.isVisible=c.isVisible),c.isPickable!==void 0&&c.isPickable!==null&&(h.isPickable=c.isPickable),c.rotationQuaternion?h.rotationQuaternion=Ue.FromArray(c.rotationQuaternion):c.rotation&&(h.rotation=I.FromArray(c.rotation)),h.scaling=I.FromArray(c.scaling),c.checkCollisions!=null&&c.checkCollisions!=null&&(h.checkCollisions=c.checkCollisions),c.pickable!=null&&c.pickable!=null&&(h.isPickable=c.pickable),c.showBoundingBox!=null&&c.showBoundingBox!=null&&(h.showBoundingBox=c.showBoundingBox),c.showSubMeshesBoundingBox!=null&&c.showSubMeshesBoundingBox!=null&&(h.showSubMeshesBoundingBox=c.showSubMeshesBoundingBox),c.alph
vendor: 6,669 bytes, line 194
194aIndex!=null&&c.showSubMeshesBoundingBox!=null&&(h.alphaIndex=c.alphaIndex),c.physicsImpostor&&(h.physicsImpostor=ee._PhysicsImpostorParser(t,h,c)),c.actions!==void 0&&(h._waitingData.actions=c.actions),c.animations){for(let f=0;f<c.animations.length;f++){const _=c.animations[f],d=Vf("BABYLON.Animation");d&&h.animations.push(d.Parse(_))}Qn.ParseAnimationRanges(h,c,t),c.autoAnimate&&t.beginAnimation(h,c.autoAnimateFrom,c.autoAnimateTo,c.autoAnimateLoop,c.autoAnimateSpeed||1)}}if(e.thinInstances){const o=e.thinInstances;if(s.thinInstanceEnablePicking=!!o.enablePicking,o.matrixData?(s.thinInstanceSetBuffer("matrix",new Float32Array(o.matrixData),16,!1),s._thinInstanceDataStorage.matrixBufferSize=o.matrixBufferSize,s._thinInstanceDataStorage.instancesCount=o.instancesCount):s._thinInstanceDataStorage.matrixBufferSize=o.matrixBufferSize,e.thinInstances.userThinInstance){const c=e.thinInstances.userThinInstance;for(const h in c.data)s.thinInstanceSetBuffer(h,new Float32Array(c.data[h]),c.strides[h],!1),s._userThinInstanceBuffersStorage.sizes[h]=c.sizes[h]}}return s}setPositionsForCPUSkinning(){const e=this._internalMeshDataInfo;if(!e._sourcePositions){const t=this.getVerticesData(U.PositionKind);if(!t)return e._sourcePositions;e._sourcePositions=new Float32Array(t),this.isVertexBufferUpdatable(U.PositionKind)||this.setVerticesData(U.PositionKind,t,!0)}return e._sourcePositions}setNormalsForCPUSkinning(){const e=this._internalMeshDataInfo;if(!e._sourceNormals){const t=this.getVerticesData(U.NormalKind);if(!t)return e._sourceNormals;e._sourceNormals=new Float32Array(t),this.isVertexBufferUpdatable(U.NormalKind)||this.setVerticesData(U.NormalKind,t,!0)}return e._sourceNormals}applySkeleton(e){if(!this.geometry)return this;if(this.geometry._softwareSkinningFrameId==this.getScene().getFrameId())return this;if(this.geometry._softwareSkinningFrameId=this.getScene().getFrameId(),!this.isVerticesDataPresent(U.PositionKind))return this;if(!this.isVerticesDataPresent(U.MatricesIndicesKind))return this;if(!this.isVerticesDataPresent(U.MatricesWeightsKind))return this;const t=this.isVerticesDataPresent(U.NormalKind),i=this._internalMeshDataInfo;if(!i._sourcePositions){const v=this.subMeshes.slice();this.setPositionsForCPUSkinning(),this.subMeshes=v}t&&!i._sourceNormals&&this.setNormalsForCPUSkinning();let s=this.getVerticesData(U.PositionKind);if(!s)return this;s instanceof Float32Array||(s=new Float32Array(s));let n=this.getVerticesData(U.NormalKind);if(t){if(!n)return this;n instanceof Float32Array||(n=new Float32Array(n))}const o=this.getVerticesData(U.MatricesIndicesKind),c=this.getVerticesData(U.MatricesWeightsKind);if(!c||!o)return this;const h=this.numBoneInfluencers>4,f=h?this.getVerticesData(U.MatricesIndicesExtraKind):null,_=h?this.getVerticesData(U.MatricesWeightsExtraKind):null,d=e.getTransformMatrices(this),g=I.Zero(),p=new ae,b=new ae;let x=0,E;for(let v=0;v<s.length;v+=3,x+=4){let S;for(E=0;E<4;E++)S=c[x+E],S>0&&(ae.FromFloat32ArrayToRefScaled(d,Math.floor(o[x+E]*16),S,b),p.addToSelf(b));if(h)for(E=0;E<4;E++)S=_[x+E],S>0&&(ae.FromFloat32ArrayToRefScaled(d,Math.floor(f[x+E]*16),S,b),p.addToSelf(b));I.TransformCoordinatesFromFloatsToRef(i._sourcePositions[v],i._sourcePositions[v+1],i._sourcePositions[v+2],p,g),g.toArray(s,v),t&&(I.TransformNormalFromFloatsToRef(i._sourceNormals[v],i._sourceNormals[v+1],i._sourceNormals[v+2],p,g),g.toArray(n,v)),p.reset()}return this.updateVerticesData(U.PositionKind,s),t&&this.updateVerticesData(U.NormalKind,n),this}static MinMax(e){let t=null,i=null;for(const s of e){const o=s.getBoundingInfo().boundingBox;!t||!i?(t=o.minimumWorld.clone(),i=o.maximumWorld.clone()):(t.minimizeInPlace(o.minimumWorld),i.maximizeInPlace(o.maximumWorld))}return!t||!i?{min:I.Zero(),max:I.Zero()}:{min:t,max:i}}static Center(e){const t=e instanceof Array?ee.MinMax(e):e;return I.Center(t.min,t.max)}static MergeMeshes(e,t=!0,i,s,n,o){return xg(ee._MergeMeshesCoroutine(e,t,i,s,n,o,!1))}static async MergeMeshesAsync(e,t=!0,i,s,n,o){return await DO(ee._MergeMeshesCoroutine(e,t,i,s,n,o,!0),IO())}static*_MergeMeshesCoroutine(e,t=!0,i,s,n,o,c){if(e=e.filter(Boolean),e.length===0)return null;let h;if(!i){let D=0;for(h=0;h<e.length;h++)if(D+=e[h].getTotalVertices(),D>=65536)return Ee.Warn("Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices"),null}const f=e[0];o&&(n=!1,e.sort((D,w)=>(D.material?.uniqueId??-1)-(w.material?.uniqueId??-1)));const _=new Array,d=new Array,g=new Array,p=e[0].sideOrientation;for(h=0;h<e.length;h++){const D=e[h];if(D.isAnInstance)return Ee.Warn("Cannot merge instance meshes."),null;if(p!==D.sideOrientation)return Ee.Warn("Cannot merge meshes with different sideOrientation values."),null;if(n||o){const w=g.reduce((G,H)=>Math.max(G,H.start+H.count),0);if(o)if(D.material){const G=D.material;if(G instanceof Jf){for(let H=0;H<G.subMaterials.length;H++)_.indexOf(G.subMaterials[H])<0&&_.push(G.subMaterials[H]);for(let H=0;H<D.subMeshes.length;H++)d.push(_.indexOf(G.subMaterials[D.subMeshes[H].materialIndex])),g.push({start:w+D.subMeshes[H].indexStart,count:D.subMeshes[H].indexCount})}else{_.indexOf(G)<0&&_.push(G);for(let H=0;H<D.subMeshes.length;H++)d.push(_.indexOf(G)),g.push({start:w+D.subMeshes[H].indexStart,count:D.subMeshes[H].indexCount})}}else for(let G=0;G<D.subMeshes.length;G++)d.push(0),g.push({start:w+D.subMeshes[G].indexStart,count:D.subMeshes[G].indexCount});else g.push({start:w,count:D.getTotalIndices()})}}if(o&&g.length>1){let D=0;for(let w=1;w<g.length;w++){const G=g[D],H=g[w];d[w]===d[D]&&G.start+G.count===H.start?G.count+=H.count:(D++,g[D]=H,d[D]=d[w])}g.length=D+1,d.length=D+1}const b=D=>{const w=D.computeWorldMatrix(!0);return{vertexData:Ye.ExtractFromMesh(D,!1,!1),transform:w}},{vertexData:x,transform:E}=b(e[0]);c&&(yield);const v=new Array(e.length-1);for(let D=1;D<e.length;D++)v[D-1]=b(e[D]),c&&(yield);const S=x._mergeCoroutine(E,v,i,c,!t);let R=S.next();for(;!R.done;)c&&(yield),R=S.next();const P=R.value;s||(s=new ee(f.name+"_merged",f.getScene()));const M=P._applyToCoroutine(s,void 0,c);let O=M.next();for(;!O.done;)c&&(yield),O=M.next();if(s.checkCollisions=f.checkCollisions,s.sideOrientation=f.sideOrientation,t)for(h=0;h<e.length;h++)e[h].dispose();if(n||o){for(s.releaseSubMeshes(),h=0;h<g.length;)tn.CreateFromIndices(0,g[h].start,g[h].count,s,void 0,!1),h++;for(const D of s.subMeshes)D.refreshBoundingInfo();s.computeWorldMatrix(!0)}if(o){const D=new Jf(f.name+"_merged",f.getScene());D.subMaterials=_;for(let w=0;w<s.subMeshes.length;w++)s.subMeshes[w].materialIndex=d[w];s.material=D}else s.material=f.material;return s}
vendor: 27,361 bytes, line 194
194addInstance(e){e._indexInSourceMeshInstanceArray=this.instances.length,this.instances.push(e)}removeInstance(e){const t=e._indexInSourceMeshInstanceArray;if(t!=-1){if(t!==this.instances.length-1){const i=this.instances[this.instances.length-1];this.instances[t]=i,i._indexInSourceMeshInstanceArray=t}e._indexInSourceMeshInstanceArray=-1,this.instances.pop()}}_shouldConvertRHS(){return this._scene.useRightHandedSystem&&this.sideOrientation===wi.CounterClockWiseSideOrientation}_getRenderingFillMode(e){const t=this.getScene();return t.forcePointsCloud?wi.PointFillMode:t.forceWireframe?wi.WireFrameFillMode:this.overrideRenderingFillMode??e}setMaterialByID(e){return this.setMaterialById(e)}static CreateRibbon(e,t,i,s,n,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateDisc(e,t,i,s,n,o){throw new Error("Import MeshBuilder to populate this function")}static CreateBox(e,t,i,s,n){throw new Error("Import MeshBuilder to populate this function")}static CreateSphere(e,t,i,s,n,o){throw new Error("Import MeshBuilder to populate this function")}static CreateHemisphere(e,t,i,s){throw new Error("Import MeshBuilder to populate this function")}static CreateCylinder(e,t,i,s,n,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateTorus(e,t,i,s,n,o,c){throw new Error("Import MeshBuilder to populate this function")}static CreateTorusKnot(e,t,i,s,n,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static CreateLines(e,t,i,s,n){throw new Error("Import MeshBuilder to populate this function")}static CreateDashedLines(e,t,i,s,n,o,c,h){throw new Error("Import MeshBuilder to populate this function")}static CreatePolygon(e,t,i,s,n,o,c){throw new Error("Import MeshBuilder to populate this function")}static ExtrudePolygon(e,t,i,s,n,o,c,h){throw new Error("Import MeshBuilder to populate this function")}static ExtrudeShape(e,t,i,s,n,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static ExtrudeShapeCustom(e,t,i,s,n,o,c,h,f,_,d,g){throw new Error("Import MeshBuilder to populate this function")}static CreateLathe(e,t,i,s,n,o,c){throw new Error("Import MeshBuilder to populate this function")}static CreatePlane(e,t,i,s,n){throw new Error("Import MeshBuilder to populate this function")}static CreateGround(e,t,i,s,n,o){throw new Error("Import MeshBuilder to populate this function")}static CreateTiledGround(e,t,i,s,n,o,c,h,f){throw new Error("Import MeshBuilder to populate this function")}static CreateGroundFromHeightMap(e,t,i,s,n,o,c,h,f,_,d){throw new Error("Import MeshBuilder to populate this function")}static CreateTube(e,t,i,s,n,o,c,h,f,_){throw new Error("Import MeshBuilder to populate this function")}static CreatePolyhedron(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static CreateIcoSphere(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static CreateDecal(e,t,i,s,n,o){throw new Error("Import MeshBuilder to populate this function")}static CreateCapsule(e,t,i){throw new Error("Import MeshBuilder to populate this function")}static ExtendToGoldberg(e){throw new Error("Import MeshBuilder to populate this function")}}ee.FRONTSIDE=Ye.FRONTSIDE;ee.BACKSIDE=Ye.BACKSIDE;ee.DOUBLESIDE=Ye.DOUBLESIDE;ee.DEFAULTSIDE=Ye.DEFAULTSIDE;ee.NO_CAP=0;ee.CAP_START=1;ee.CAP_END=2;ee.CAP_ALL=3;ee.NO_FLIP=0;ee.FLIP_TILE=1;ee.ROTATE_TILE=2;ee.FLIP_ROW=3;ee.ROTATE_ROW=4;ee.FLIP_N_ROTATE_TILE=5;ee.FLIP_N_ROTATE_ROW=6;ee.CENTER=0;ee.LEFT=1;ee.RIGHT=2;ee.TOP=3;ee.BOTTOM=4;ee.INSTANCEDMESH_SORT_TRANSPARENT=!1;ee._GroundMeshParser=(r,e)=>{throw at("GroundMesh")};ee._GoldbergMeshParser=(r,e)=>{throw at("GoldbergMesh")};ee._LinesMeshParser=(r,e)=>{throw at("LinesMesh")};ee._GreasedLineMeshParser=(r,e)=>{throw at("GreasedLineMesh")};ee._GreasedLineRibbonMeshParser=(r,e)=>{throw at("GreasedLineRibbonMesh")};ee._TrailMeshParser=(r,e)=>{throw at("TrailMesh")};ee._GaussianSplattingMeshParser=(r,e)=>{throw at("GaussianSplattingMesh")};ee._GaussianSplattingPartProxyMeshParser=(r,e)=>{throw at("GaussianSplattingPartProxyMesh")};ee._GaussianSplattingCompoundMeshParser=(r,e)=>{throw at("GaussianSplattingCompoundMesh")};(_0=ee.prototype).registerInstancedBuffer??(_0.registerInstancedBuffer=Ze("Mesh","registerInstancedBuffer"));(m0=ee.prototype).simplify??(m0.simplify=Ze("Mesh","simplify"));(g0=ee.prototype).thinInstanceAdd??(g0.thinInstanceAdd=Ze("Mesh","thinInstanceAdd"));(p0=ee.prototype).thinInstanceAddSelf??(p0.thinInstanceAddSelf=Ze("Mesh","thinInstanceAddSelf"));(y0=ee.prototype).thinInstanceRegisterAttribute??(y0.thinInstanceRegisterAttribute=Ze("Mesh","thinInstanceRegisterAttribute"));(b0=ee.prototype).thinInstanceSetMatrixAt??(b0.thinInstanceSetMatrixAt=Ze("Mesh","thinInstanceSetMatrixAt"));(x0=ee.prototype).thinInstanceSetAttributeAt??(x0.thinInstanceSetAttributeAt=Ze("Mesh","thinInstanceSetAttributeAt"));(T0=ee.prototype).thinInstanceSetBuffer??(T0.thinInstanceSetBuffer=Ze("Mesh","thinInstanceSetBuffer"));(E0=ee.prototype).thinInstanceGetWorldMatrices??(E0.thinInstanceGetWorldMatrices=Ze("Mesh","thinInstanceGetWorldMatrices"));(v0=ee.prototype).thinInstanceBufferUpdated??(v0.thinInstanceBufferUpdated=Ze("Mesh","thinInstanceBufferUpdated"));(A0=ee.prototype).thinInstancePartialBufferUpdate??(A0.thinInstancePartialBufferUpdate=Ze("Mesh","thinInstancePartialBufferUpdate"));(R0=ee.prototype).thinInstanceRefreshBoundingInfo??(R0.thinInstanceRefreshBoundingInfo=Ze("Mesh","thinInstanceRefreshBoundingInfo"));(S0=ee.prototype).getEmittedParticleSystems??(S0.getEmittedParticleSystems=Ze("Mesh","getEmittedParticleSystems"));(M0=ee.prototype).getHierarchyEmittedParticleSystems??(M0.getHierarchyEmittedParticleSystems=Ze("Mesh","getHierarchyEmittedParticleSystems"));Object.getOwnPropertyDescriptor(ee.prototype,"edgesShareWithInstances")||Object.defineProperty(ee.prototype,"edgesShareWithInstances",At("Mesh","edgesShareWithInstances"));Object.getOwnPropertyDescriptor(ee.prototype,"thinInstanceEnablePicking")||Object.defineProperty(ee.prototype,"thinInstanceEnablePicking",At("Mesh","thinInstanceEnablePicking"));Object.getOwnPropertyDescriptor(ee.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation")||Object.defineProperty(ee.prototype,"thinInstanceAllowAutomaticStaticBufferRecreation",At("Mesh","thinInstanceAllowAutomaticStaticBufferRecreation"));Object.getOwnPropertyDescriptor(ee.prototype,"thinInstanceCount")||Object.defineProperty(ee.prototype,"thinInstanceCount",At("Mesh","thinInstanceCount"));class mt{}mt.POINTERDOWN=1;mt.POINTERUP=2;mt.POINTERMOVE=4;mt.POINTERWHEEL=8;mt.POINTERPICK=16;mt.POINTERTAP=32;mt.POINTERDOUBLETAP=64;class DA{constructor(e,t){this.type=e,this.event=t}}class Sw extends DA{constructor(e,t,i,s){super(e,t),this.ray=null,this.originalPickingInfo=null,this.skipOnPointerObservable=!1,this.localPosition=new He(i,s)}}class Or extends DA{get pickInfo(){return this._pickInfo||this._generatePickInfo(),this._pickInfo}constructor(e,t,i,s=null){super(e,t),this._pickInfo=i,this._inputManager=s}_generatePickInfo(){this._inputManager&&(this._pickInfo=this._inputManager._pickMove(this.event),this._inputManager._setRayOnPointerInfo(this._pickInfo,this.event),this._inputManager=null)}}class Mw{constructor(){this._zoomStopsAnimation=!1,this._idleRotationSpeed=.05,this._idleRotationWaitTime=2e3,this._idleRotationSpinupTime=2e3,this.targetAlpha=null,this._attachedCamera=null,this._isPointerDown=!1,this._lastFrameTime=null,this._lastInteractionTime=-1/0,this._cameraRotationSpeed=0,this._lastFrameRadius=0}get name(){return"AutoRotation"}set zoomStopsAnimation(e){this._zoomStopsAnimation=e}get zoomStopsAnimation(){return this._zoomStopsAnimation}set idleRotationSpeed(e){this._idleRotationSpeed=e}get idleRotationSpeed(){return this._idleRotationSpeed}set idleRotationWaitTime(e){this._idleRotationWaitTime=e}get idleRotationWaitTime(){return this._idleRotationWaitTime}set idleRotationSpinupTime(e){this._idleRotationSpinupTime=e}get idleRotationSpinupTime(){return this._idleRotationSpinupTime}get rotationInProgress(){return Math.abs(this._cameraRotationSpeed)>0}get attachedNode(){return this._attachedCamera}init(){}attach(e){this._attachedCamera=e;const t=this._attachedCamera.getScene();this._onPrePointerObservableObserver=t.onPrePointerObservable.add(i=>{if(i.type===mt.POINTERDOWN){this._isPointerDown=!0;return}i.type===mt.POINTERUP&&(this._isPointerDown=!1)}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{if(this._reachTargetAlpha())return;const i=Gs.Now;let s=0;this._lastFrameTime!=null&&(s=i-this._lastFrameTime),this._lastFrameTime=i,this._applyUserInteraction();const n=i-this._lastInteractionTime-this._idleRotationWaitTime,o=Math.max(Math.min(n/this._idleRotationSpinupTime,1),0);this._cameraRotationSpeed=this._idleRotationSpeed*o,this._attachedCamera&&(this._attachedCamera.alpha-=this._cameraRotationSpeed*(s/1e3))})}detach(){if(!this._attachedCamera)return;const e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._attachedCamera=null,this._lastFrameTime=null}resetLastInteractionTime(e){this._lastInteractionTime=e??Gs.Now}_reachTargetAlpha(){return this._attachedCamera&&this.targetAlpha?Math.abs(this._attachedCamera.alpha-this.targetAlpha)<It:!1}_userIsZooming(){return this._attachedCamera?this._attachedCamera.inertialRadiusOffset!==0:!1}_shouldAnimationStopForInteraction(){if(!this._attachedCamera)return!1;let e=!1;return this._lastFrameRadius===this._attachedCamera.radius&&this._attachedCamera.inertialRadiusOffset!==0&&(e=!0),this._lastFrameRadius=this._attachedCamera.radius,this._zoomStopsAnimation?e:this._userIsZooming()}_applyUserInteraction(){this._userIsMoving()&&!this._shouldAnimationStopForInteraction()&&(this._lastInteractionTime=Gs.Now)}_userIsMoving(){return this._attachedCamera?this._attachedCamera.inertialAlphaOffset!==0||this._attachedCamera.inertialBetaOffset!==0||this._attachedCamera.inertialRadiusOffset!==0||this._attachedCamera.inertialPanningX!==0||this._attachedCamera.inertialPanningY!==0||this._isPointerDown:!1}}class Dn{constructor(){this._easingMode=Dn.EASINGMODE_EASEIN}setEasingMode(e){const t=Math.min(Math.max(e,0),2);this._easingMode=t}getEasingMode(){return this._easingMode}easeInCore(e){throw new Error("You must implement this method")}ease(e){switch(this._easingMode){case Dn.EASINGMODE_EASEIN:return this.easeInCore(e);case Dn.EASINGMODE_EASEOUT:return 1-this.easeInCore(1-e)}return e>=.5?(1-this.easeInCore((1-e)*2))*.5+.5:this.easeInCore(e*2)*.5}}Dn.EASINGMODE_EASEIN=0;Dn.EASINGMODE_EASEOUT=1;Dn.EASINGMODE_EASEINOUT=2;class Cw extends Dn{constructor(e=1){super(),this.amplitude=e}easeInCore(e){const t=Math.max(0,this.amplitude);return Math.pow(e,3)-e*t*Math.sin(3.141592653589793*e)}}class Iw extends Dn{constructor(e=2){super(),this.exponent=e}easeInCore(e){return this.exponent<=0?e:(Math.exp(this.exponent*e)-1)/(Math.exp(this.exponent)-1)}}class Tg{constructor(e,t,i){this.name=e,this.from=t,this.to=i}clone(){return new Tg(this.name,this.from,this.to)}}const Dw=Object.freeze(new Ue(0,0,0,0)),Pw=Object.freeze(I.Zero()),Ow=Object.freeze(He.Zero()),ww=Object.freeze(Qs.Zero()),Fw=Object.freeze(tt.Black()),Lw=Object.freeze(new xt(0,0,0,0)),wr={key:0,repeatCount:0,loopMode:2};class Ve{static _PrepareAnimation(e,t,i,s,n,o,c,h){let f;if(!isNaN(parseFloat(n))&&isFinite(n)?f=Ve.ANIMATIONTYPE_FLOAT:n instanceof Ue?f=Ve.ANIMATIONTYPE_QUATERNION:n instanceof I?f=Ve.ANIMATIONTYPE_VECTOR3:n instanceof He?f=Ve.ANIMATIONTYPE_VECTOR2:n instanceof tt?f=Ve.ANIMATIONTYPE_COLOR3:n instanceof xt?f=Ve.ANIMATIONTYPE_COLOR4:n instanceof Qs&&(f=Ve.ANIMATIONTYPE_SIZE),f==null)return null;const _=new Ve(e,t,i,f,c),d=[{frame:0,value:n},{frame:s,value:o}];return _.setKeys(d),h!==void 0&&_.setEasingFunction(h),_}get runtimeAnimations(){return this._runtimeAnimations}get hasRunningRuntimeAnimations(){for(const e of this._runtimeAnimations)if(!e.isStopped())return!0;return!1}constructor(e,t,i,s,n,o){this.name=e,this.targetProperty=t,this.framePerSecond=i,this.dataType=s,this.loopMode=n,this.enableBlending=o,this._easingFunction=null,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this._coreAnimation=null,this.targetPropertyPath=t.split("."),this.dataType=s,this.loopMode=n===void 0?Ve.ANIMATIONLOOPMODE_CYCLE:n,this.uniqueId=Ve._UniqueIdGenerator++}toString(e){let t="Name: "+this.name+", property: "+this.targetProperty;if(t+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],t+=", nKeys: "+(this._keys?this._keys.length:"none"),t+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),e){t+=", Ranges: {";let i=!0;for(const s in this._ranges)i||(t+=", "),i=!1,t+=s;t+="}"}return t}addEvent(e){this._events.push(e),this._events.sort((t,i)=>t.frame-i.frame)}removeEvents(e){for(let t=0;t<this._events.length;t++)this._events[t].frame===e&&(this._events.splice(t,1),t--)}getEvents(){return this._events}createRange(e,t,i){this._ranges[e]||(this._ranges[e]=new Tg(e,t,i))}deleteRange(e,t=!0){const i=this._ranges[e];if(i){if(t){const s=i.from,n=i.to;for(let o=this._keys.length-1;o>=0;o--)this._keys[o].frame>=s&&this._keys[o].frame<=n&&this._keys.splice(o,1)}this._ranges[e]=null}}getRange(e){return this._ranges[e]}getKeys(){return this._keys}getHighestFrame(){let e=0;for(let t=0,i=this._keys.length;t<i;t++)e<this._keys[t].frame&&(e=this._keys[t].frame);return e}getEasingFunction(){return this._easingFunction}setEasingFunction(e){this._easingFunction=e}floatInterpolateFunction(e,t,i){return kf(e,t,i)}floatInterpolateFunctionWithTangents(e,t,i,s,n){return kP(e,t,i,s,n)}quaternionInterpolateFunction(e,t,i){return Ue.Slerp(e,t,i)}quaternionInterpolateFunctionWithTangents(e,t,i,s,n){return Ue.Hermite(e,t,i,s,n).normalize()}vector3InterpolateFunction(e,t,i){return I.Lerp(e,t,i)}vector3InterpolateFunctionWithTangents(e,t,i,s,n){return I.Hermite(e,t,i,s,n)}vector2InterpolateFunction(e,t,i){return He.Lerp(e,t,i)}vector2InterpolateFunctionWithTangents(e,t,i,s,n){return He.Hermite(e,t,i,s,n)}sizeInterpolateFunction(e,t,i){return Qs.Lerp(e,t,i)}color3InterpolateFunction(e,t,i){return tt.Lerp(e,t,i)}color3InterpolateFunctionWithTangents(e,t,i,s,n){return tt.Hermite(e,t,i,s,n)}color4InterpolateFunction(e,t,i){return xt.Lerp(e,t,i)}color4InterpolateFunctionWithTangents(e,t,i,s,n){return xt.Hermite(e,t,i,s,n)}_getKeyValue(e){return typeof e=="function"?e():e}evaluate(e){return wr.key=0,this._interpolate(e,wr)}_interpolate(e,t,i=!1){if(t.loopMode===Ve.ANIMATIONLOOPMODE_CONSTANT&&t.repeatCount>0)return t.highLimitValue.clone?t.highLimitValue.clone():t.highLimitValue;const s=this._keys;let n;if(this._coreAnimation)n=this._coreAnimation._key;else{const b=s.length;for(n=t.key;n>=0&&e<s[n].frame;)--n;for(;n+1<=b-1&&e>=s[n+1].frame;)++n;if(t.key=n,n<0)return i?void 0:this._getKeyValue(s[0].value);if(n+1>b-1)return i?void 0:this._getKeyValue(s[b-1].value);this._key=n}const o=s[n],c=s[n+1];if(i&&(e===o.frame||e===c.frame))return;const h=this._getKeyValue(o.value),f=this._getKeyValue(c.value);if(o.interpolation===1)return c.frame>e?h:f;const _=o.outTangent!==void 0&&c.inTangent!==void 0,d=c.frame-o.frame;let g=(e-o.frame)/d;const p=o.easingFunction||this.getEasingFunction();switch(p&&(g=p.ease(g)),this.dataType){case Ve.ANIMATIONTYPE_FLOAT:{const b=_?this.floatInterpolateFunctionWithTangents(h,o.outTangent*d,f,c.inTangent*d,g):this.floatInterpolateFunction(h,f,g);switch(t.loopMode){case Ve.ANIMATIONLOOPMODE_CYCLE:case Ve.ANIMATIONLOOPMODE_CONSTANT:case Ve.ANIMATIONLOOPMODE_YOYO:return b;case Ve.ANIMATIONLOOPMODE_RELATIVE:case Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return(t.offsetValue??0)*t.repeatCount+b}break}case Ve.ANIMATIONTYPE_QUATERNION:{const b=_?this.quaternionInterpolateFunctionWithTangents(h,o.outTangent.scale(d),f,c.inTangent.scale(d),g):this.quaternionInterpolateFunction(h,f,g);switch(t.loopMode){case Ve.ANIMATIONLOOPMODE_CYCLE:case Ve.ANIMATIONLOOPMODE_CONSTANT:case Ve.ANIMATIONLOOPMODE_YOYO:return b;case Ve.ANIMATIONLOOPMODE_RELATIVE:case Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return b.addInPlace((t.offsetValue||Dw).scale(t.repeatCount))}return b}case Ve.ANIMATIONTYPE_VECTOR3:{const b=_?this.vector3InterpolateFunctionWithTangents(h,o.outTangent.scale(d),f,c.inTangent.scale(d),g):this.vector3InterpolateFunction(h,f,g);switch(t.loopMode){case Ve.ANIMATIONLOOPMODE_CYCLE:case Ve.ANIMATIONLOOPMODE_CONSTANT:case Ve.ANIMATIONLOOPMODE_YOYO:return b;case Ve.ANIMATIONLOOPMODE_RELATIVE:case Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return b.add((t.offsetValue||Pw).scale(t.repeatCount))}break}case Ve.ANIMATIONTYPE_VECTOR2:{const b=_?this.vector2InterpolateFunctionWithTangents(h,o.outTangent.scale(d),f,c.inTangent.scale(d),g):this.vector2InterpolateFunction(h,f,g);switch(t.loopMode){case Ve.ANIMATIONLOOPMODE_CYCLE:case Ve.ANIMATIONLOOPMODE_CONSTANT:case Ve.ANIMATIONLOOPMODE_YOYO:return b;case Ve.ANIMATIONLOOPMODE_RELATIVE:case Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return b.add((t.offsetValue||Ow).scale(t.repeatCount))}break}case Ve.ANIMATIONTYPE_SIZE:{switch(t.loopMode){case Ve.ANIMATIONLOOPMODE_CYCLE:case Ve.ANIMATIONLOOPMODE_CONSTANT:case Ve.ANIMATIONLOOPMODE_YOYO:return this.sizeInterpolateFunction(h,f,g);case Ve.ANIMATIONLOOPMODE_RELATIVE:case Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return this.sizeInterpolateFunction(h,f,g).add((t.offsetValue||ww).scale(t.repeatCount))}break}case Ve.ANIMATIONTYPE_COLOR3:{const b=_?this.color3InterpolateFunctionWithTangents(h,o.outTangent.scale(d),f,c.inTangent.scale(d),g):this.color3InterpolateFunction(h,f,g);switch(t.loopMode){case Ve.ANIMATIONLOOPMODE_CYCLE:case Ve.ANIMATIONLOOPMODE_CONSTANT:case Ve.ANIMATIONLOOPMODE_YOYO:return b;case Ve.ANIMATIONLOOPMODE_RELATIVE:case Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return b.add((t.offsetValue||Fw).scale(t.repeatCount))}break}case Ve.ANIMATIONTYPE_COLOR4:{const b=_?this.color4InterpolateFunctionWithTangents(h,o.outTangent.scale(d),f,c.inTangent.scale(d),g):this.color4InterpolateFunction(h,f,g);switch(t.loopMode){case Ve.ANIMATIONLOOPMODE_CYCLE:case Ve.ANIMATIONLOOPMODE_CONSTANT:case Ve.ANIMATIONLOOPMODE_YOYO:return b;case Ve.ANIMATIONLOOPMODE_RELATIVE:case Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return b.add((t.offsetValue||Lw).scale(t.repeatCount))}break}case Ve.ANIMATIONTYPE_MATRIX:{switch(t.loopMode){case Ve.ANIMATIONLOOPMODE_CYCLE:case Ve.ANIMATIONLOOPMODE_CONSTANT:case Ve.ANIMATIONLOOPMODE_YOYO:return Ve.AllowMatricesInterpolation?this.matrixInterpolateFunction(h,f,g,t.workValue):h;case Ve.ANIMATIONLOOPMODE_RELATIVE:case Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return h}break}}return 0}matrixInterpolateFunction(e,t,i,s){return Ve.AllowMatrixDecomposeForInterpolation?s?(ae.DecomposeLerpToRef(e,t,i,s),s):ae.DecomposeLerp(e,t,i):s?(ae.LerpToRef(e,t,i,s),s):ae.Lerp(e,t,i)}clone(e=!1){const t=new Ve(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,this._keys&&t.setKeys(this._keys,!1,e),this._ranges){t._ranges={};for(const i in this._ranges){const s=this._ranges[i];s&&(t._ranges[i]=s.clone())}}return t}setKeys(e,t=!1,i=!1){if(t)this._keys=e;else if(this._keys=e.slice(0),i)for(let s=0;s<this._keys.length;s++){const n=this._keys[s];this._keys[s]={frame:n.frame,value:n.value.clone?n.value.clone():n.value,inTangent:n.inTangent&&n.inTangent.clone?n.inTangent.clone():n.inTangent,outTangent:n.outTangent&&n.outTangent.clone?n.outTangent.clone():n.outTangent,interpolation:n.interpolation,lockedTangent:n.lockedTangent,easingFunction:n.easingFunction}}}createKeyForFrame(e){wr.key=0;const t=this._interpolate(e,wr,!0);if(!t)return this._keys[wr.key].frame===e?wr.key:wr.key+1;const i={frame:e,value:t.clone?t.clone():t};return this._keys.splice(wr.key+1,0,i),wr.key+1}serialize(){const e={};e.name=this.name,e.property=this.targetProperty,e.framePerSecond=this.framePerSecond,e.dataType=this.dataType,e.loopBehavior=this.loopMode,e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed;const t=this.dataType;e.keys=[];const i=this.getKeys();for(let s=0;s<i.length;s++){const n=i[s],o={};switch(o.frame=n.frame,t){case Ve.ANIMATIONTYPE_FLOAT:o.values=[n.value],n.inTangent!==void 0&&o.values.push(n.inTangent),n.outTangent!==void 0&&(n.inTangent===void 0&&o.values.push(void 0),o.values.push(n.outTangent)),n.interpolation!==void 0&&(n.inTangent===void 0&&o.values.push(void 0),n.outTangent===void 0&&o.values.push(void 0),o.values.push(n.interpolation));break;case Ve.ANIMATIONTYPE_QUATERNION:case Ve.ANIMATIONTYPE_MATRIX:case Ve.ANIMATIONTYPE_VECTOR3:case Ve.ANIMATIONTYPE_COLOR3:case Ve.ANIMATIONTYPE_COLOR4:o.values=n.value.asArray(),n.inTangent!=null&&o.values.push(n.inTangent.asArray()),n.outTangent!=null&&(n.inTangent===void 0&&o.values.push(void 0),o.values.push(n.outTangent.asArray())),n.interpolation!==void 0&&(n.inTangent===void 0&&o.values.push(void 0),n.outTangent===void 0&&o.values.push(void 0),o.values.push(n.interpolation));break}e.keys.push(o)}e.ranges=[];for(const s in this._ranges){const n=this._ranges[s];if(!n)continue;const o={};o.name=s,o.from=n.from,o.to=n.to,e.ranges.push(o)}return e}static _UniversalLerp(e,t,i){const s=e.constructor;return s.Lerp?s.Lerp(e,t,i):s.Slerp?s.Slerp(e,t,i):e.toFixed?e*(1-i)+i*t:t}}Ve._UniqueIdGenerator=0;Ve.AllowMatricesInterpolation=!1;Ve.AllowMatrixDecomposeForInterpolation=!0;Ve.InheritOriginalValueFromActiveAnimations=!1;Ve.SnippetUrl="https://snippet.babylonjs.com";Ve.ANIMATIONTYPE_FLOAT=0;Ve.ANIMATIONTYPE_VECTOR3=1;Ve.ANIMATIONTYPE_QUATERNION=2;Ve.ANIMATIONTYPE_MATRIX=3;Ve.ANIMATIONTYPE_COLOR3=4;Ve.ANIMATIONTYPE_COLOR4=7;Ve.ANIMATIONTYPE_VECTOR2=5;Ve.ANIMATIONTYPE_SIZE=6;Ve.ANIMATIONLOOPMODE_RELATIVE=0;Ve.ANIMATIONLOOPMODE_CYCLE=1;Ve.ANIMATIONLOOPMODE_CONSTANT=2;Ve.ANIMATIONLOOPMODE_YOYO=4;Ve.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT=5;class uo{constructor(){this.transitionDuration=450,this.lowerRadiusTransitionRange=2,this.upperRadiusTransitionRange=-2,this._autoTransitionRange=!1,this._attachedCamera=null,this._radiusIsAnimating=!1,this._radiusBounceTransition=null,this._animatables=new Array}get name(){return"Bouncing"}get autoTransitionRange(){return this._autoTransitionRange}set autoTransitionRange(e){if(this._autoTransitionRange===e)return;this._autoTransitionRange=e;const t=this._attachedCamera;t&&(e?this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(i=>{if(i&&(i.computeWorldMatrix(!0),i.getBoundingInfo)){const s=i.getBoundingInfo().diagonalLength;this.lowerRadiusTransitionRange=s*.05,this.upperRadiusTransitionRange=s*.05}}):this._onMeshTargetChangedObserver&&t.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))}get attachedNode(){return this._attachedCamera}init(){}attach(e){this._attachedCamera=e,this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{this._attachedCamera&&(this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit)&&this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange),this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit)&&this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange))})}detach(){this._attachedCamera&&(this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null)}_isRadiusAtLimit(e){return this._attachedCamera?this._attachedCamera.radius===e&&!this._radiusIsAnimating:!1}_applyBoundRadiusAnimation(e){if(!this._attachedCamera)return;this._radiusBounceTransition||(uo.EasingFunction.setEasingMode(uo.EasingMode),this._radiusBounceTransition=Ve.CreateAnimation("radius",Ve.ANIMATIONTYPE_FLOAT,60,uo.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;const t=Ve.TransitionTo("radius",this._attachedCamera.radius+e,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,()=>this._clearAnimationLocks());t&&this._animatables.push(t)}_clearAnimationLocks(){this._radiusIsAnimating=!1,this._attachedCamera&&(this._attachedCamera.wheelPrecision=this._cachedWheelPrecision)}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()}}uo.EasingFunction=new Cw(.3);uo.EasingMode=Dn.EASINGMODE_EASEOUT;class Is{constructor(){this.onTargetFramingAnimationEndObservable=new Oe,this._mode=Is.FitFrustumSidesMode,this._radiusScale=1,this._positionScale=.5,this._defaultElevation=.3,this._elevationReturnTime=1500,this._elevationReturnWaitTime=1e3,this._zoomStopsAnimation=!1,this._framingTime=1500,this.autoCorrectCameraLimitsAndSensibility=!0,this._attachedCamera=null,this._isPointerDown=!1,this._lastInteractionTime=-1/0,this._animatables=new Array,this._betaIsAnimating=!1}get name(){return"Framing"}set mode(e){this._mode=e}get mode(){return this._mode}set radiusScale(e){this._radiusScale=e}get radiusScale(){return this._radiusScale}set positionScale(e){this._positionScale=e}get positionScale(){return this._positionScale}set defaultElevation(e){this._defaultElevation=e}get defaultElevation(){return this._defaultElevation}set elevationReturnTime(e){this._elevationReturnTime=e}get elevationReturnTime(){return this._elevationReturnTime}set elevationReturnWaitTime(e){this._elevationReturnWaitTime=e}get elevationReturnWaitTime(){return this._elevationReturnWaitTime}set zoomStopsAnimation(e){this._zoomStopsAnimation=e}get zoomStopsAnimation(){return this._zoomStopsAnimation}set framingTime(e){this._framingTime=e}get framingTime(){return this._framingTime}get attachedNode(){return this._attachedCamera}init(){}attach(e){this._attachedCamera=e;const t=this._attachedCamera.getScene();Is.EasingFunction.setEasingMode(Is.EasingMode),this._onPrePointerObservableObserver=t.onPrePointerObservable.add(i=>{if(i.type===mt.POINTERDOWN){this._isPointerDown=!0;return}i.type===mt.POINTERUP&&(this._isPointerDown=!1)}),this._onMeshTargetChangedObserver=e.onMeshTargetChangedObservable.add(i=>{i&&i.getBoundingInfo&&this.zoomOnMesh(i,void 0,()=>{this.onTargetFramingAnimationEndObservable.notifyObservers()})}),this._onAfterCheckInputsObserver=e.onAfterCheckInputsObservable.add(()=>{this._applyUserInteraction(),this._maintainCameraAboveGround()})}detach(){if(!this._attachedCamera)return;const e=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&e.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null}zoomOnMesh(e,t=!1,i=null){e.computeWorldMatrix(!0);const s=e.getBoundingInfo().boundingBox;
194this.zoomOnBoundingInfo(s.minimumWorld,s.maximumWorld,t,i)}zoomOnMeshHierarchy(e,t=!1,i=null){e.computeWorldMatrix(!0);const s=e.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(s.min,s.max,t,i)}zoomOnMeshesHierarchy(e,t=!1,i=null){const s=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let o=0;o<e.length;o++){const c=e[o].getHierarchyBoundingVectors(!0);I.CheckExtends(c.min,s,n),I.CheckExtends(c.max,s,n)}this.zoomOnBoundingInfo(s,n,t,i)}zoomOnBoundingInfo(e,t,i=!1,s=null){let n;if(!this._attachedCamera)return!1;const o=e.y,c=t.y,h=o+(c-o)*this._positionScale,f=t.subtract(e).scale(.5);if(!isFinite(h))return!1;if(i)n=new I(0,h,0);else{const g=e.add(f);n=new I(g.x,h,g.z)}this._vectorTransition||(this._vectorTransition=Ve.CreateAnimation("target",Ve.ANIMATIONTYPE_VECTOR3,60,Is.EasingFunction)),this._betaIsAnimating=!0;let _=Ve.TransitionTo("target",n,this._attachedCamera,this._attachedCamera.getScene(),60,this._vectorTransition,this._framingTime);_&&this._animatables.push(_);let d=0;if(this._mode===Is.FitFrustumSidesMode){const g=this._calculateLowerRadiusFromModelBoundingSphere(e,t);this.autoCorrectCameraLimitsAndSensibility&&(this._attachedCamera.lowerRadiusLimit=f.length()+this._attachedCamera.minZ),d=g}else this._mode===Is.IgnoreBoundsSizeMode&&(d=this._calculateLowerRadiusFromModelBoundingSphere(e,t),this.autoCorrectCameraLimitsAndSensibility&&this._attachedCamera.lowerRadiusLimit===null&&(this._attachedCamera.lowerRadiusLimit=this._attachedCamera.minZ));if(this.autoCorrectCameraLimitsAndSensibility){const g=t.subtract(e).length();this._attachedCamera.panningSensibility=5e3/g,this._attachedCamera.wheelPrecision=100/d}return this._radiusTransition||(this._radiusTransition=Ve.CreateAnimation("radius",Ve.ANIMATIONTYPE_FLOAT,60,Is.EasingFunction)),_=Ve.TransitionTo("radius",d,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusTransition,this._framingTime,()=>{this.stopAllAnimations(),s&&s(),this._attachedCamera&&this._attachedCamera.useInputToRestoreState&&this._attachedCamera.storeState()}),_&&this._animatables.push(_),!0}_calculateLowerRadiusFromModelBoundingSphere(e,t){const i=this._attachedCamera;if(!i)return 0;let s=i._calculateLowerRadiusFromModelBoundingSphere(e,t,this._radiusScale);return i.lowerRadiusLimit&&this._mode===Is.IgnoreBoundsSizeMode&&(s=s<i.lowerRadiusLimit?i.lowerRadiusLimit:s),i.upperRadiusLimit&&(s=s>i.upperRadiusLimit?i.upperRadiusLimit:s),s}_maintainCameraAboveGround(){if(this._elevationReturnTime<0)return;const e=Gs.Now-this._lastInteractionTime,t=Math.PI*.5-this._defaultElevation,i=Math.PI*.5;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>i&&e>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=Ve.CreateAnimation("beta",Ve.ANIMATIONTYPE_FLOAT,60,Is.EasingFunction));const s=Ve.TransitionTo("beta",t,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,()=>{this._clearAnimationLocks(),this.stopAllAnimations()});s&&this._animatables.push(s)}}_clearAnimationLocks(){this._betaIsAnimating=!1}_applyUserInteraction(){this.isUserIsMoving&&(this._lastInteractionTime=Gs.Now,this.stopAllAnimations(),this._clearAnimationLocks())}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()}get isUserIsMoving(){return this._attachedCamera?this._attachedCamera.inertialAlphaOffset!==0||this._attachedCamera.inertialBetaOffset!==0||this._attachedCamera.inertialRadiusOffset!==0||this._attachedCamera.inertialPanningX!==0||this._attachedCamera.inertialPanningY!==0||this._isPointerDown:!1}}Is.EasingFunction=new Iw;Is.EasingMode=Dn.EASINGMODE_EASEINOUT;Is.IgnoreBoundsSizeMode=0;Is.FitFrustumSidesMode=1;const Bw=60;class PA{constructor(e,t,i){this._cameraPosition=t,this._behavior=i,this.activeInput=!1,this.speed=1,this.zoomSpeed=1,this.panSpeed=1,this.rotationXSpeed=1,this.rotationYSpeed=1,this._zoomSpeedMultiplier=1,this._panSpeedMultiplier=1,this.zoomInertia=.9,this.panInertia=.9,this.rotationInertia=.9,this.zoomAccumulatedPixels=0,this.panAccumulatedPixels=new I,this.rotationAccumulatedPixels=new I,this.zoomDeltaCurrentFrame=0,this.panDeltaCurrentFrame=I.Zero(),this.rotationDeltaCurrentFrame=I.Zero(),this._zoomVelocity=0,this._panVelocity=new I,this.referenceFrameRate=Bw,this._rotationVelocity=new I,this._prevFrameTimeMs=0,this._scene=e}computeCurrentFrameDeltas(){const e=this._scene.getEngine().getDeltaTime(),t=this._getEffectiveDeltaMs(e);if(this._zoomVelocity===0&&this.zoomAccumulatedPixels===0&&this._panVelocity.x===0&&this._panVelocity.y===0&&this._panVelocity.z===0&&this.panAccumulatedPixels.x===0&&this.panAccumulatedPixels.y===0&&this.panAccumulatedPixels.z===0&&this._rotationVelocity.x===0&&this._rotationVelocity.y===0&&this._rotationVelocity.z===0&&this.rotationAccumulatedPixels.x===0&&this.rotationAccumulatedPixels.y===0&&this.rotationAccumulatedPixels.z===0&&!this.activeInput){this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,e>0&&(this._prevFrameTimeMs=e);return}this.panDeltaCurrentFrame.setAll(0),this.rotationDeltaCurrentFrame.setAll(0),this.zoomDeltaCurrentFrame=0,(this.panAccumulatedPixels.lengthSquared()>0||this.rotationAccumulatedPixels.lengthSquared()>0||this.zoomAccumulatedPixels!==0)&&this._behavior?.isInterpolating&&this._behavior.stopAllAnimations(),this._panVelocity.copyFromFloats(this._calculateCurrentVelocity(this._panVelocity.x,this.panAccumulatedPixels.x,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.y,this.panAccumulatedPixels.y,this.panInertia),this._calculateCurrentVelocity(this._panVelocity.z,this.panAccumulatedPixels.z,this.panInertia)),this._panVelocity.scaleToRef(this.speed*this.panSpeed*this._panSpeedMultiplier*t,this.panDeltaCurrentFrame),this._rotationVelocity.copyFromFloats(this._calculateCurrentVelocity(this._rotationVelocity.x,this.rotationAccumulatedPixels.x,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.y,this.rotationAccumulatedPixels.y,this.rotationInertia),this._calculateCurrentVelocity(this._rotationVelocity.z,this.rotationAccumulatedPixels.z,this.rotationInertia)),this.rotationDeltaCurrentFrame.copyFromFloats(this._rotationVelocity.x*this.speed*this.rotationXSpeed*t,this._rotationVelocity.y*this.speed*this.rotationYSpeed*t,0),this._zoomVelocity=this._calculateCurrentVelocity(this._zoomVelocity,this.zoomAccumulatedPixels,this.zoomInertia),this.zoomDeltaCurrentFrame=this._zoomVelocity*(this.speed*this.zoomSpeed*this._zoomSpeedMultiplier)*t,e>0&&(this._prevFrameTimeMs=e),this.zoomAccumulatedPixels=0,this.panAccumulatedPixels.setAll(0),this.rotationAccumulatedPixels.setAll(0),this.activeInput=!1}resetRotationVelocity(){this._rotationVelocity.setAll(0),this.rotationAccumulatedPixels.setAll(0)}resetPanVelocity(){this._panVelocity.setAll(0),this.panAccumulatedPixels.setAll(0)}resetZoomVelocity(){this._zoomVelocity=0,this.zoomAccumulatedPixels=0}
194get isInterpolating(){return!!this._behavior?.isInterpolating}getFrameIndependentDecay(e){const t=this._scene.getEngine().getDeltaTime(),i=this._getEffectiveDeltaMs(t),s=1e3/this.referenceFrameRate;return Math.pow(e,i/s)}getFrameIndependentInputScale(e){const t=1-e;return t<=0?1:(1-this.getFrameIndependentDecay(e))/t}_getEffectiveDeltaMs(e){return e>0?e:this._prevFrameTimeMs>0?this._prevFrameTimeMs:1e3/this.referenceFrameRate}_calculateCurrentVelocity(e,t,i){let s=e;const n=this._scene.getEngine().getDeltaTime(),o=this._getEffectiveDeltaMs(n);if(o===0)return s;const c=this.getFrameIndependentDecay(i);if(s*=c,t!==0||this.activeInput){const h=1-i,f=h>0?(1-c)/h:1;s+=t/o*f}else Math.abs(s)<1e-6&&(s=0);return s}}class OA{constructor(e,t){this.inputMap=[],this.handlers=e,this._createDefaultEntries=t,this.resetInputMap()}resolveInteraction(e,t){for(const i of this.inputMap)if(i.source===e&&this._entryMatches(i,t))return i;return null}resetInputMap(){this.inputMap=this._createDefaultEntries?.()??[]}getEntry(e,t,i){const s=this.inputMap;for(let n=0;n<s.length;n++){const o=s[n];if(o.source===e&&o.interaction===t&&this._entryConditionsMatch(o,i))return o}}getEntries(e,t,i){const s=[],n=this.inputMap;for(let o=0;o<n.length;o++){const c=n[o];c.source===e&&c.interaction===t&&this._entryConditionsMatch(c,i)&&s.push(c)}return s}addEntry(e){const t=this._entrySpecificity(e);let i=this.inputMap.length;for(let s=0;s<this.inputMap.length;s++)if(this._entrySpecificity(this.inputMap[s])<t){i=s;break}this.inputMap.splice(i,0,e)}setInteraction(e,t,i){const s=this.resolveInteraction(e,t);return s&&this._entryCoversAllConditionsOf(s,t)?(s.interaction=i,!0):(this.addEntry({source:e,...t??{},interaction:i}),!0)}_entryCoversAllConditionsOf(e,t){if(!t)return!0;const i=e;for(const s of Object.keys(t)){const n=t[s];if(n!==void 0){if(s==="modifiers"){const o=i.modifiers??{};for(const c of Object.keys(n))if(n[c]!==void 0&&o[c]===void 0)return!1}else if(i[s]===void 0)return!1}}return!0}setInteractions(e,t,i){let s=0;const n=this.inputMap;for(let o=0;o<n.length;o++){const c=n[o];c.source===e&&this._entryMatches(c,t)&&(c.interaction=i,s++)}return s}_entryMatches(e,t){switch(e.source){case"pointer":return e.button!==void 0&&e.button!==t?.button?!1:this._matchModifiers(e.modifiers,t?.modifiers);case"wheel":return this._matchModifiers(e.modifiers,t?.modifiers);case"touch":return!(e.touchCount!==void 0&&e.touchCount!==t?.touchCount);case"keyboard":return e.key!==void 0&&(Array.isArray(e.key)?e.key.indexOf(t?.key??-1)===-1:e.key!==t?.key)?!1:this._matchModifiers(e.modifiers,t?.modifiers)}}_entryConditionsMatch(e,t){if(!t)return!0;switch(e.source){case"pointer":return"button"in t&&e.button!==t.button?!1:!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers);case"wheel":return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers);case"touch":return!("touchCount"in t)||e.touchCount===t.touchCount;case"keyboard":if("key"in t){if(e.key===void 0)return t.key===void 0;if(t.key===void 0||(Array.isArray(e.key)?e.key.indexOf(t.key)===-1:e.key!==t.key))return!1}return!("modifiers"in t)||this._entryModifiersMatch(e.modifiers,t.modifiers)}}_entrySpecificity(e){let t=0;return"button"in e&&e.button!==void 0&&t++,"key"in e&&e.key!==void 0&&t++,"touchCount"in e&&e.touchCount!==void 0&&t++,"modifiers"in e&&e.modifiers&&t++,t}_matchModifiers(e,t){return e?!(e.ctrl!==void 0&&e.ctrl!==(t?.ctrl??!1)||e.shift!==void 0&&e.shift!==(t?.shift??!1)||e.alt!==void 0&&e.alt!==(t?.alt??!1)):!0}_entryModifiersMatch(e,t){return t?t.ctrl!==void 0||t.shift!==void 0||t.alt!==void 0?!(t.ctrl!==void 0&&e?.ctrl!==t.ctrl||t.shift!==void 0&&e?.shift!==t.shift||t.alt!==void 0&&e?.alt!==t.alt):!e||e.ctrl===void 0&&e.shift===void 0&&e.alt===void 0:!e}}class Nw extends PA{constructor(e,t,i){super(e,t,i),this.input=new OA({translate:(s,n,o)=>{this.panAccumulatedPixels.x+=s,this.panAccumulatedPixels.y+=n,this.panAccumulatedPixels.z+=o},rotate:(s,n)=>{this.rotationAccumulatedPixels.x+=s,this.rotationAccumulatedPixels.y+=n}},()=>this._createDefaultInputMap())}_createDefaultInputMap(){return[{source:"pointer",interaction:"rotate"},{source:"keyboard",interaction:"translate"},{source:"keyboard",interaction:"rotate"},{source:"touch",interaction:"rotate"},{source:"touch",interaction:"translate"}]}}const Sf=ae.Zero(),bm=Ue.Identity();let Uw=(()=>{var r;let e=Si,t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],d,g=[],p=[];return r=class extends e{get inertia(){return this._targetInertia}set inertia(x){this._targetInertia=x,this.movement&&(this.movement.panInertia=x,this.movement.rotationInertia=x)}constructor(x,E,v,S=!0){super(x,E,v,S),this.cameraDirection=new I(0,0,0),this.cameraRotation=new He(0,0),this._targetInertia=.9,this.updateUpVectorFromRotation=L(this,i,!1),this.rotation=(L(this,s),L(this,o,void 0)),this.rotationQuaternion=L(this,c),this.speed=L(this,f,2),this.noRotationConstraint=(L(this,_),!1),this.invertRotation=!1,this.inverseRotationSpeed=.2,this._panningEpsilon=It,this._rotationEpsilon=It,this.lockedTarget=L(this,g,null),this._currentTarget=(L(this,p),I.Zero()),this._initialFocalDistance=1,this._viewMatrix=ae.Zero(),this._cameraTransformMatrix=ae.Zero(),this._cameraRotationMatrix=ae.Zero(),this._transformedReferencePoint=I.Zero(),this._deferredPositionUpdate=new I,this._deferredRotationQuaternionUpdate=new Ue,this._deferredRotationUpdate=new I,this._deferredUpdated=!1,this._deferOnly=!1,this._cachedRotationZ=0,this._cachedQuaternionRotationZ=0,this._referencePoint=I.Forward(this.getScene().useRightHandedSystem),this.rotation=new I(0,this.get
vendor: 21,443 bytes, line 194
194Scene().useRightHandedSystem?Math.PI:0,0),this.movement=new Nw(this.getScene(),this.position),this.movement.panInertia=this.inertia,this.movement.rotationInertia=this.inertia}getFrontPosition(x){this.getWorldMatrix();const E=ge.Vector3[0],v=ge.Vector3[1];return v.set(0,0,this._scene.useRightHandedSystem?-1:1),this.getDirectionToRef(v,E),E.scaleInPlace(x),this.globalPosition.add(E)}_getLockedTargetPosition(){if(!this.lockedTarget)return null;if(this.lockedTarget.absolutePosition){const x=this.lockedTarget;x.computeWorldMatrix().getTranslationToRef(x.absolutePosition)}return this.lockedTarget.absolutePosition||this.lockedTarget}storeState(){return this._storedPosition=this.position.clone(),this._storedRotation=this.rotation.clone(),this.rotationQuaternion&&(this._storedRotationQuaternion=this.rotationQuaternion.clone()),super.storeState()}_restoreStateValues(){return super._restoreStateValues()?(this.position=this._storedPosition.clone(),this.rotation=this._storedRotation.clone(),this.rotationQuaternion&&this._storedRotationQuaternion&&(this.rotationQuaternion=this._storedRotationQuaternion.clone()),this.cameraDirection.copyFromFloats(0,0,0),this.cameraRotation.copyFromFloats(0,0),!0):!1}_initCache(){super._initCache(),this._cache.lockedTarget=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotation=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.rotationQuaternion=new Ue(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}_updateCache(x){x||super._updateCache();const E=this._getLockedTargetPosition();E?this._cache.lockedTarget?this._cache.lockedTarget.copyFrom(E):this._cache.lockedTarget=E.clone():this._cache.lockedTarget=null,this._cache.rotation.copyFrom(this.rotation),this.rotationQuaternion&&this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion)}_isSynchronizedViewMatrix(){if(!super._isSynchronizedViewMatrix())return!1;const x=this._getLockedTargetPosition();return(this._cache.lockedTarget?this._cache.lockedTarget.equals(x):!x)&&(this.rotationQuaternion?this.rotationQuaternion.equals(this._cache.rotationQuaternion):this._cache.rotation.equals(this.rotation))}_computeLocalCameraSpeed(){const x=this.getEngine();return this.speed*Math.sqrt(x.getDeltaTime()/(x.getFps()*100))}setTarget(x){this.upVector.normalize(),this._initialFocalDistance=x.subtract(this.position).length(),this.position.z===x.z&&(this.position.z+=It),this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance),this.getScene().useRightHandedSystem?ae.LookAtRHToRef(this.position,x,I.UpReadOnly,Sf):ae.LookAtLHToRef(this.position,x,I.UpReadOnly,Sf),Sf.invert();const E=this.rotationQuaternion||bm;Ue.FromRotationMatrixToRef(Sf,E),E.toEulerAnglesToRef(this.rotation),this.rotation.z=0}get target(){return this.getTarget()}set target(x){this.setTarget(x)}getTarget(){return this._currentTarget}_decideIfNeedsToMove(){return Math.abs(this.cameraDirection.x)>0||Math.abs(this.cameraDirection.y)>0||Math.abs(this.cameraDirection.z)>0}_updatePosition(){if(this.parent){this.parent.getWorldMatrix().invertToRef(ge.Matrix[0]),I.TransformNormalToRef(this.cameraDirection,ge.Matrix[0],ge.Vector3[0]),this._deferredPositionUpdate.addInPlace(ge.Vector3[0]),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate);return}this._deferredPositionUpdate.addInPlace(this.cameraDirection),this._deferOnly?this._deferredUpdated=!0:this.position.copyFrom(this._deferredPositionUpdate)}_checkInputs(){const x=this.movement,E=this.cameraDirection.x!==0||this.cameraDirection.y!==0||this.cameraDirection.z!==0;x.panAccumulatedPixels.addInPlace(this.cameraDirection),x.rotationAccumulatedPixels.x+=this.cameraRotation.x,x.rotationAccumulatedPixels.y+=this.cameraRotation.y,x.computeCurrentFrameDeltas(),this.cameraDirection.copyFrom(x.panDeltaCurrentFrame),this.cameraRotation.set(x.rotationDeltaCurrentFrame.x,x.rotationDeltaCurrentFrame.y);const v=this.speed*this._panningEpsilon;!E&&Math.abs(this.cameraDirection.x)<v&&Math.abs(this.cameraDirection.y)<v&&Math.abs(this.cameraDirection.z)<v&&(this.cameraDirection.setAll(0),x.resetPanVelocity());const S=this.invertRotation?-this.inverseRotationSpeed:1,R=this._decideIfNeedsToMove(),P=!!(this.cameraRotation.x||this.cameraRotation.y);this._deferredUpdated=!1,this._deferredRotationUpdate.copyFrom(this.rotation),this._deferredPositionUpdate.copyFrom(this.position),this.rotationQuaternion&&this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion),R&&this._updatePosition(),P&&(this.rotationQuaternion&&this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate),this._deferredRotationUpdate.x+=this.cameraRotation.x*S,this._deferredRotationUpdate.y+=this.cameraRotation.y*S,this.noRotationConstraint||(this._deferredRotationUpdate.x>1.570796&&(this._deferredRotationUpdate.x=1.570796),this._deferredRotationUpdate.x<-1.570796&&(this._deferredRotationUpdate.x=-1.570796)),this._deferOnly?this._deferredUpdated=!0:this.rotation.copyFrom(this._deferredRotationUpdate),this.rotationQuaternion&&this._deferredRotationUpdate.lengthSquared()&&(Ue.RotationYawPitchRollToRef(this._deferredRotationUpdate.y,this._deferredRotationUpdate.x,this._deferredRotationUpdate.z,this._deferredRotationQuaternionUpdate),this._deferOnly?this._deferredUpdated=!0:this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate))),this.cameraDirection.setAll(0),this.cameraRotation.set(0,0),super._checkInputs()}_updateCameraRotationMatrix(){this.rotationQuaternion?this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix):ae.RotationYawPitchRollToRef(this.rotation.y,this.rotation.x,this.rotation.z,this._cameraRotationMatrix)}_rotateUpVectorWithCameraRotationMatrix(){return I.TransformNormalToRef(I.UpReadOnly,this._cameraRotationMatrix,this.upVector),this}_getViewMatrix(){return this.lockedTarget&&this.setTarget(this._getLockedTargetPosition()),this._updateCameraRotationMatrix(),this.rotationQuaternion&&this._cachedQuaternionRotationZ!=this.rotationQuaternion.z?(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedQuaternionRotationZ=this.rotationQuaternion.z):this._cachedRotationZ!==this.rotation.z&&(this._rotateUpVectorWithCameraRotationMatrix(),this._cachedRotationZ=this.rotation.z),I.TransformCoordinatesToRef(this._referencePoint,this._cameraRotationMatrix,this._transformedReferencePoint),this.position.addToRef(this._transformedReferencePoint,this._currentTarget),this.updateUpVectorFromRotation&&(this.rotationQuaternion?_o.Y.rotateByQuaternionToRef(this.rotationQuaternion,this.upVector):(Ue.FromEulerVectorToRef(this.rotation,bm),_o.Y.rotateByQuaternionToRef(bm,this.upVector))),this._computeViewMatrix(this.position,this._currentTarget,this.upVector),this._viewMatrix}_computeViewMatrix(x,E,v){if(this.getScene().useRightHandedSystem?ae.LookAtRHToRef(x,E,v,this._viewMatrix):ae.LookAtLHToRef(x,E,v,this._viewMatrix),this.parent){const S=this.parent.getWorldMatrix();this._viewMatrix.invert(),this._viewMatrix.multiplyToRef(S,this._viewMatrix),this._viewMatrix.invert(),this._markSyncedWithParent()}}createRigCamera(x,E){if(this.cameraRigMode!==Si.RIG_MODE_NONE){const v=new r(x,this.position.clone(),this.getScene());return v.isRigCamera=!0,v.rigParent=this,this.cameraRigMode===Si.RIG_MODE_VR&&(this.rotationQuaternion||(this.rotationQuaternion=new Ue),v._cameraRigParams={},v.rotationQuaternion=new Ue),v.mode=this.mode,v.orthoLeft=this.orthoLeft,v.orthoRight=this.orthoRight,v.orthoTop=this.orthoTop,v.orthoBottom=this.orthoBottom,v}return null}_updateRigCameras(){const x=this._rigCameras[0],E=this._rigCameras[1];switch(this.computeWorldMatrix(),this.cameraRigMode){case Si.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Si.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Si.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:case Si.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Si.RIG_MODE_STEREOSCOPIC_INTERLACED:{const v=this.cameraRigMode===Si.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?1:-1,S=this.cameraRigMode===Si.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED?-1:1;this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*v,x),this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle*S,E);break}case Si.RIG_MODE_VR:x.rotationQuaternion&&E.rotationQuaternion&&this.rotationQuaternion?(x.rotationQuaternion.copyFrom(this.rotationQuaternion),E.rotationQuaternion.copyFrom(this.rotationQuaternion)):(x.rotation.copyFrom(this.rotation),E.rotation.copyFrom(this.rotation)),x.position.copyFrom(this.position),E.position.copyFrom(this.position);break}super._updateRigCameras()}_getRigCamPositionAndTarget(x,E){this.getTarget().subtractToRef(this.position,r._TargetFocalPoint),r._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);const S=r._TargetFocalPoint.addInPlace(this.position);ae.TranslationToRef(-S.x,-S.y,-S.z,r._TargetTransformMatrix),r._TargetTransformMatrix.multiplyToRef(ae.RotationAxis(E.upVector,x),r._RigCamTransformMatrix),ae.TranslationToRef(S.x,S.y,S.z,r._TargetTransformMatrix),r._RigCamTransformMatrix.multiplyToRef(r._TargetTransformMatrix,r._RigCamTransformMatrix),I.TransformCoordinatesToRef(this.position,r._RigCamTransformMatrix,E.position),E.setTarget(S)}getClassName(){return"TargetCamera"}},(()=>{const b=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[he()],n=[Ur()],h=[he()],d=[rA("lockedTargetId")],$(null,null,t,{kind:"field",name:"updateUpVectorFromRotation",static:!1,private:!1,access:{has:x=>"updateUpVectorFromRotation"in x,get:x=>x.updateUpVectorFromRotation,set:(x,E)=>{x.updateUpVectorFromRotation=E}},metadata:b},i,s),$(null,null,n,{kind:"field",name:"rotation",static:!1,private:!1,access:{has:x=>"rotation"in x,get:x=>x.rotation,set:(x,E)=>{x.rotation=E}},metadata:b},o,c),$(null,null,h,{kind:"field",name:"speed",static:!1,private:!1,access:{has:x=>"speed"in x,get:x=>x.speed,set:(x,E)=>{x.speed=E}},metadata:b},f,_),$(null,null,d,{kind:"field",name:"lockedTarget",static:!1,private:!1,access:{has:x=>"lockedTarget"in x,get:x=>x.lockedTarget,set:(x,E)=>{x.lockedTarget=E}},metadata:b},g,p),b&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b})})(),r._RigCamTransformMatrix=new ae,r._TargetTransformMatrix=new ae,r._TargetFocalPoint=new I,r})();var mh={};class kw{constructor(e){this.attachedToElement=!1,this.attached={},this.camera=e,this.checkInputs=()=>{}}add(e){const t=e.getSimpleName();if(this.attached[t]){Ee.Warn("camera input of type "+t+" already exists on camera");return}this.attached[t]=e,e.camera=this.camera,e.checkInputs&&(this.checkInputs=this._addCheckInputs(e.checkInputs.bind(e))),this.attachedToElement&&e.attachControl(this.noPreventDefault)}remove(e){for(const t in this.attached){const i=this.attached[t];if(i===e){i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck();return}}}removeByType(e){for(const t in this.attached){const i=this.attached[t];i.getClassName()===e&&(i.detachControl(),i.camera=null,delete this.attached[t],this.rebuildInputCheck())}}_addCheckInputs(e){const t=this.checkInputs;return()=>{t(),e()}}attachInput(e){this.attachedToElement&&e.attachControl(this.noPreventDefault)}attachElement(e=!1){if(!this.attachedToElement){e=Si.ForceAttachControlToAlwaysPreventDefault?!1:e,this.attachedToElement=!0,this.noPreventDefault=e;for(const t in this.attached)this.attached[t].attachControl(e)}}detachElement(e=!1){for(const t in this.attached)this.attached[t].detachControl(),e&&(this.attached[t].camera=null);this.attachedToElement=!1}rebuildInputCheck(){this.checkInputs=()=>{};for(const e in this.attached){const t=this.attached[e];t.checkInputs&&(this.checkInputs=this._addCheckInputs(t.checkInputs.bind(t)))}}clear(){this.attachedToElement&&this.detachElement(!0),this.attached={},this.attachedToElement=!1,this.checkInputs=()=>{}}serialize(e){const t={};for(const i in this.attached){const s=this.attached[i],n=Tt.Serialize(s);t[s.getClassName()]=n}e.inputsmgr=t}parse(e){const t=e.inputsmgr;if(t){this.clear();for(const i in t){const s=mh[i];if(s){const n=t[i],o=Tt.Parse(()=>new s,n,null);this.add(o)}}}else for(const i in this.attached){const s=mh[this.attached[i].getClassName()];if(s){const n=Tt.Parse(()=>new s,e,null);this.remove(this.attached[i]),this.add(n)}}}}let zw=(()=>{var r;let e,t=[],i=[];return r=class{constructor(){this._currentMousePointerIdDown=-1,this.buttons=L(this,t,[0,1,2]),this._pointerInput=L(this,i)}attachControl(n){n=Rt.BackCompatCameraNoPreventDefault(arguments);const o=this.camera.getEngine(),c=o.getInputElement();let h=0,f=null;this._pointA=null,this._pointB=null,this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._pointerInput=d=>{const g=d.event,p=g.pointerType==="touch";if(d.type!==mt.POINTERMOVE&&this.buttons.indexOf(g.button)===-1)return;const b=g.target;if(this._altKey=g.altKey,this._ctrlKey=g.ctrlKey,this._metaKey=g.metaKey,this._shiftKey=g.shiftKey,this._buttonsPressed=g.buttons,o.isPointerLock){const x=g.movementX,E=g.movementY;this.onTouch(null,x,E),this._pointA=null,this._pointB=null}else{if(d.type!==mt.POINTERDOWN&&d.type!==mt.POINTERDOUBLETAP&&p&&this._pointA?.pointerId!==g.pointerId&&this._pointB?.pointerId!==g.pointerId)return;if(d.type===mt.POINTERDOWN&&(this._currentMousePointerIdDown===-1||p)){try{b?.setPointerCapture(g.pointerId)}catch{}if(this._pointA===null)this._pointA={x:g.clientX,y:g.clientY,pointerId:g.pointerId,type:g.pointerType,button:g.button};else if(this._pointB===null)this._pointB={x:g.clientX,y:g.clientY,pointerId:g.pointerId,type:g.pointerType,button:g.button};else return;this._currentMousePointerIdDown===-1&&!p&&(this._currentMousePointerIdDown=g.pointerId),this.onButtonDown(g),n||(g.preventDefault(),c&&c.focus())}else if(d.type===mt.POINTERDOUBLETAP)this.onDoubleTap(g.pointerType,g);else if(d.type===mt.POINTERUP&&(this._currentMousePointerIdDown===g.pointerId||p)){try{b?.releasePointerCapture(g.pointerId)}catch{}p||(this._pointB=null),o._badOS?this._pointA=this._pointB=null:this._pointB&&this._pointA&&this._pointA.pointerId==g.pointerId?(this._pointA=this._pointB,this._pointB=null):this._pointA&&this._pointB&&this._pointB.pointerId==g.pointerId?this._pointB=null:this._pointA=this._pointB=null,(h!==0||f)&&(this.onMultiTouch(this._pointA,this._pointB,h,0,f,null),h=0,f=null),this._currentMousePointerIdDown=-1,this.onButtonUp(g),n||g.preventDefault()}else if(d.type===mt.POINTERMOVE){if(n||g.preventDefault(),this._pointA&&this._pointB===null){const x=g.clientX-this._pointA.x,E=g.clientY-this._pointA.y;this._pointA.x=g.clientX,this._pointA.y=g.clientY,this.onTouch(this._pointA,x,E)}else if(this._pointA&&this._pointB){const x=this._pointA.pointerId===g.pointerId?this._pointA:this._pointB;x.x=g.clientX,x.y=g.clientY;const E=this._pointA.x-this._pointB.x,v=this._pointA.y-this._pointB.y,S=E*E+v*v,R={x:(this._pointA.x+this._pointB.x)/2,y:(this._pointA.y+this._pointB.y)/2,pointerId:g.pointerId,type:d.type};this.onMultiTouch(this._pointA,this._pointB,h,S,f,R),f=R,h=S}}}},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,mt.POINTERDOWN|mt.POINTERUP|mt.POINTERMOVE|mt.POINTERDOUBLETAP),this._onLostFocus=()=>{this._pointA=this._pointB=null,h=0,f=null,this.onLostFocus()},this._contextMenuBind=d=>this.onContextMenu(d),c&&c.addEventListener("contextmenu",this._contextMenuBind,!1);const _=this.camera.getScene().getEngine().getHostWindow();_&&Rt.RegisterTopRootEvents(_,[{name:"blur",handler:this._onLostFocus}])}detachControl(){if(this._onLostFocus){const n=this.camera.getScene().getEngine().getHostWindow();n&&Rt.UnregisterTopRootEvents(n,[{name:"blur",handler:this._onLostFocus}])}if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._contextMenuBind){const n=this.camera.getScene().getEngine().getInputElement();n&&n.removeEventListener("contextmenu",this._contextMenuBind)}this._onLostFocus=null}this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._currentMousePointerIdDown=-1}getClassName(){return"BaseCameraPointersInput"}getSimpleName(){return"pointers"}onDoubleTap(n,o){}onTouch(n,o,c){}onMultiTouch(n,o,c,h,f,_){}onContextMenu(n){n.preventDefault()}onButtonDown(n){}onButtonUp(n){}onLostFocus(){}},(()=>{const s=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[he()],$(null,null,e,{kind:"field",name:"buttons",static:!1,private:!1,access:{has:n=>"buttons"in n,get:n=>n.buttons,set:(n,o)=>{n.buttons=o}},metadata:s},t,i),s&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})})(),r})(),Vw=(()=>{var r;let e=zw,t,i=[],s=[],n,o=[],c=[],h,f=[],_=[];return r=class extends e{constructor(){super(...arguments),this.pinchZoom=L(this,i,!0),this.multiTouchPanning=(L(this,s),L(this,o,!0)),this.multiTouchPanAndZoom=(L(this,c),L(this,f,!0)),this._isPinching=(L(this,_),!1),this._twoFingerActivityCount=0,this._shouldStartPinchZoom=!1}_computePinchZoom(g,p){}_computeMultiTouchPanning(g,p){}onMultiTouch(g,p,b,x,E,v){b===0&&E===null||x===0&&v===null||(this.multiTouchPanAndZoom?(this._computePinchZoom(b,x),this._computeMultiTouchPanning(E,v)):this.multiTouchPanning&&this.pinchZoom?(this._twoFingerActivityCount++,this._isPinching||this._shouldStartPinchZoom?(this._computePinchZoom(b,x),this._isPinching=!0):this._computeMultiTouchPanning(E,v)):this.multiTouchPanning?this._computeMultiTouchPanning(E,v):this.pinchZoom&&this._computePinchZoom(b,x))}onButtonUp(g){this._twoFingerActivityCount=0,this._isPinching=!1}onLostFocus(){this._twoFingerActivityCount=0,this._isPinching=!1}},(()=>{const d=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[he()],n=[he()],h=[he()],$(null,null,t,{kind:"field",name:"pinchZoom",static:!1,private:!1,access:{has:g=>"pinchZoom"in g,get:g=>g.pinchZoom,set:(g,p)=>{g.pinchZoom=p}},metadata:d},i,s),$(null,null,n,{kind:"field",name:"multiTouchPanning",static:!1,private:!1,access:{has:g=>"multiTouchPanning"in g,get:g=>g.multiTouchPanning,set:(g,p)=>{g.multiTouchPanning=p}},metadata:d},o,c),$(null,null,h,{kind:"field",name:"multiTouchPanAndZoom",static:!1,private:!1,access:{has:g=>"multiTouchPanAndZoom"in g,get:g=>g.multiTouchPanAndZoom,set:(g,p)=>{g.multiTouchPanAndZoom=p}},metadata:d},f,_),d&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:d})})(),r})(),wA=(()=>{var r;let e=Vw,t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],d,g=[],p=[],b,x=[],E=[],v,S=[],R=[],P,M=[],O=[];return r=class extends e{constructor(){super(...arguments),this.buttons=L(this,i,[0,1,2]),this.angularSensibilityX=(L(this,s),L(this,o,1e3)),this.angularSensibilityY=(L(this,c),L(this,f,1e3)),this.pinchPrecision=(L(this,_),L(this,g,12)),this.pinchDeltaPercentage=(L(this,p),L(this,x,0)),this.useNaturalPinchZoom=(L(this,E),L(this,S,!1)),this.panningSensibility=(L(this,R),L(this,M,1e3)),this.pinchInwards=(L(this,O),!0),this._activeEntry=null,this._pointerLockConditions={button:0,modifiers:{}},this._pointerModifiers={ctrl:!1,alt:!1,shift:!1},this._pointerConditions={modifiers:this._pointerModifiers}}getClassName(){return"ArcRotateCameraPointersInput"}_computeMultiTouchPanning(w,G){if(w&&G){const H=G.x-w.x,ie=G.y-w.y,ce=this.camera.movement.input.getEntry("pointer","pan")?.sensitivity??(this.panningSensibility!==0?1/this.panningSensibility:0);ce!==0&&(this.camera.movement.activeInput=!0,this.camera.movement.panAccumulatedPixels.x+=-H*ce,this.camera.movement.panAccumulatedPixels.y+=ie*ce)}}_computePinchZoom(w,G){const H=this.camera.radius||r.MinimumRadiusForPinch;if(this.useNaturalPinchZoom)this.camera.radius=H*Math.sqrt(w)/Math.sqrt(G);else if(this.pinchDeltaPercentage){const ie=(G-w)*.001*H*this.pinchDeltaPercentage;this.camera.movement.activeInput=!0,this.camera.movement.zoomAccumulatedPixels+=ie}else{const ie=(G-w)/(this.pinchPrecision*(this.pinchInwards?1:-1)*(this.angularSensibilityX+this.angularSensibilityY)/2);this.camera.movement.activeInput=!0,this.camera.movement.zoomAccumulatedPixels+=ie}}onTouch(w,G,H){const ie=this._activeEntry??(this.camera.getEngine().isPointerLock?this.camera.movement.input.resolveInteraction("pointer",this._pointerLockConditions):null);if(ie){if(ie.interaction==="pan"){const ne=ie.sensitivity??(this.panningSensibility!==0?1/this.panningSensibility:0);ne!==0&&(this.camera.movement.activeInput=!0,this.camera.movement.panAccumulatedPixels.x+=-G*ne,this.camera.movement.panAccumulatedPixels.y+=H*ne)}else if(ie.interaction==="rotate"){const ne=ie.sensitivityX??ie.sensitivity??1/this.angularSensibilityX,ce=ie.sensitivityY??ie.sensitivity??1/this.angularSensibilityY;this.camera.movement.activeInput=!0,this.camera.movement.rotationAccumulatedPixels.x+=-G*ne,this.camera.movement.rotationAccumulatedPixels.y+=-H*ce}}}onDoubleTap(){this.camera.useInputToRestoreState&&this.camera.restoreState()}onMultiTouch(w,G,H,ie,ne,ce){this._shouldStartPinchZoom=this._twoFingerActivityCount<20&&Math.abs(Math.sqrt(ie)-Math.sqrt(H))>this.camera.pinchToPanMaxDistance,super.onMultiTouch(w,G,H,ie,ne,ce)}onButtonDown(w){this._pointerConditions.button=w.button,this._pointerModifiers.ctrl=w.ctrlKey,this._pointerModifiers.alt=w.altKey,this._pointerModifiers.shift=w.shiftKey,this._activeEntry=this.camera.movement.input.resolveInteraction("pointer",this._pointerConditions),super.onButtonDown(w)}
194onButtonUp(w){this._activeEntry=null,super.onButtonUp(w)}onLostFocus(){this._activeEntry=null,super.onLostFocus()}},(()=>{const D=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[he()],n=[he()],h=[he()],d=[he()],b=[he()],v=[he()],P=[he()],$(null,null,t,{kind:"field",name:"buttons",static:!1,private:!1,access:{has:w=>"buttons"in w,get:w=>w.buttons,set:(w,G)=>{w.buttons=G}},metadata:D},i,s),$(null,null,n,{kind:"field",name:"angularSensibilityX",static:!1,private:!1,access:{has:w=>"angularSensibilityX"in w,get:w=>w.angularSensibilityX,set:(w,G)=>{w.angularSensibilityX=G}},metadata:D},o,c),$(null,null,h,{kind:"field",name:"angularSensibilityY",static:!1,private:!1,access:{has:w=>"angularSensibilityY"in w,get:w=>w.angularSensibilityY,set:(w,G)=>{w.angularSensibilityY=G}},metadata:D},f,_),$(null,null,d,{kind:"field",name:"pinchPrecision",static:!1,private:!1,access:{has:w=>"pinchPrecision"in w,get:w=>w.pinchPrecision,set:(w,G)=>{w.pinchPrecision=G}},metadata:D},g,p),$(null,null,b,{kind:"field",name:"pinchDeltaPercentage",static:!1,private:!1,access:{has:w=>"pinchDeltaPercentage"in w,get:w=>w.pinchDeltaPercentage,set:(w,G)=>{w.pinchDeltaPercentage=G}},metadata:D},x,E),$(null,null,v,{kind:"field",name:"useNaturalPinchZoom",static:!1,private:!1,access:{has:w=>"useNaturalPinchZoom"in w,get:w=>w.useNaturalPinchZoom,set:(w,G)=>{w.useNaturalPinchZoom=G}},metadata:D},S,R),$(null,null,P,{kind:"field",name:"panningSensibility",static:!1,private:!1,access:{has:w=>"panningSensibility"in w,get:w=>w.panningSensibility,set:(w,G)=>{w.panningSensibility=G}},metadata:D},M,O),D&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:D})})(),r.MinimumRadiusForPinch=.001,r})();mh.ArcRotateCameraPointersInput=wA;class gh{}gh.KEYDOWN=1;gh.KEYUP=2;class Ym{constructor(e,t){this.type=e,this.event=t}}class D0 extends Ym{get skipOnPointerObservable(){return this.skipOnKeyboardObservable}set skipOnPointerObservable(e){this.skipOnKeyboardObservable=e}constructor(e,t){super(e,t),this.type=e,this.event=t,this.skipOnKeyboardObservable=!1}}let FA=(()=>{var r;let e=[],t,i=[],s=[],n,o=[],c=[],h,f=[],_=[],d,g=[],p=[],b,x=[],E=[],v,S=[],R=[],P,M=[],O=[],D,w=[],G=[],H,ie=[],ne=[],ce,k=[],te=[],X;return r=class{constructor(){this.camera=L(this,e),this.keysUp=L(this,i,[38]),this.keysDown=(L(this,s),L(this,o,[40])),this.keysLeft=(L(this,c),L(this,f,[37])),this.keysRight=(L(this,_),L(this,g,[39])),this.keysReset=(L(this,p),L(this,x,[220])),this.keysZoomIn=(L(this,E),L(this,S,[187,107])),this.keysZoomOut=(L(this,R),L(this,M,[189,109])),this.panningSensibility=(L(this,O),L(this,w,50)),this.zoomingSensibility=(L(this,G),L(this,ie,25)),this.angularSpeed=(L(this,ne),L(this,k,.01)),this._useAltToZoom=(L(this,te),!0),this._keys=new Array,this._keyboardModifiers={ctrl:!1,alt:!1},this._keyboardConditions={modifiers:this._keyboardModifiers},this._rotateDirection=new He,this._panDirection=new He}get useAltToZoom(){return this._useAltToZoom}set useAltToZoom(W){this._useAltToZoom=W,this._applyUseAltToZoomToInputMap()}_applyUseAltToZoomToInputMap(){if(!this.camera?.movement)return;const W=this.camera.movement.input,K=W.getEntry("keyboard","zoom",{modifiers:{alt:!0}});!this._useAltToZoom&&K?W.inputMap.splice(W.inputMap.indexOf(K),1):this._useAltToZoom&&!K&&W.addEntry({source:"keyboard",modifiers:{alt:!0},interaction:"zoom"})}attachControl(W){W=Rt.BackCompatCameraNoPreventDefault(arguments),!this._onCanvasBlurObserver&&(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._applyUseAltToZoomToInputMap(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(K=>{const Z=K.event;if(!Z.metaKey){if(K.type===gh.KEYDOWN)this._ctrlPressed=Z.ctrlKey,this._altPressed=Z.altKey,(this.keysUp.indexOf(Z.keyCode)!==-1||this.keysDown.indexOf(Z.keyCode)!==-1||this.keysLeft.indexOf(Z.keyCode)!==-1||this.keysRight.indexOf(Z.keyCode)!==-1||this.keysReset.indexOf(Z.keyCode)!==-1||this.keysZoomIn.indexOf(Z.keyCode)!==-1||this.keysZoomOut.indexOf(Z.keyCode)!==-1)&&(this._keys.indexOf(Z.keyCode)===-1&&this._keys.push(Z.keyCode),Z.preventDefault&&(W||Z.preventDefault()));else if(this.keysUp.indexOf(Z.keyCode)!==-1||this.keysDown.indexOf(Z.keyCode)!==-1||this.keysLeft.indexOf(Z.keyCode)!==-1||this.keysRight.indexOf(Z.keyCode)!==-1||this.keysReset.indexOf(Z.keyCode)!==-1||this.keysZoomIn.indexOf(Z.keyCode)!==-1||this.keysZoomOut.indexOf(Z.keyCode)!==-1){const F=this._keys.indexOf(Z.keyCode);F>=0&&this._keys.splice(F,1),Z.preventDefault&&(W||Z.preventDefault())}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}
194checkInputs(){if(this._onKeyboardObserver){const W=this.camera,K=W.movement.input;this._keyboardModifiers.ctrl=this._ctrlPressed,this._keyboardModifiers.alt=this._altPressed;const Z=this._rotateDirection.set(0,0),F=this._panDirection.set(0,0);let A=0,N=0;for(let Y=0;Y<this._keys.length;Y++){const se=this._keys[Y];if(this._keyboardConditions.key=se,this.keysReset.indexOf(se)===-1){const ue=K.resolveInteraction("keyboard",this._keyboardConditions);if(ue)if(ue.interaction==="pan")N=Math.max(N,ue.sensitivity??1/this.panningSensibility),this.keysLeft.indexOf(se)!==-1?F.x-=1:this.keysRight.indexOf(se)!==-1?F.x+=1:this.keysUp.indexOf(se)!==-1?F.y+=1:this.keysDown.indexOf(se)!==-1&&(F.y-=1);else if(ue.interaction==="zoom"){const pe=ue.sensitivity??1/this.zoomingSensibility;this.keysUp.indexOf(se)!==-1||this.keysZoomIn.indexOf(se)!==-1?K.handlers.zoom(pe):(this.keysDown.indexOf(se)!==-1||this.keysZoomOut.indexOf(se)!==-1)&&K.handlers.zoom(-pe)}else ue.interaction==="rotate"&&(A=Math.max(A,ue.sensitivity??this.angularSpeed),this.keysLeft.indexOf(se)!==-1?Z.x-=1:this.keysRight.indexOf(se)!==-1?Z.x+=1:this.keysUp.indexOf(se)!==-1?Z.y-=1:this.keysDown.indexOf(se)!==-1&&(Z.y+=1))}this.keysReset.indexOf(se)!==-1&&W.useInputToRestoreState&&W.restoreState()}(Z.x!==0||Z.y!==0)&&(Z.normalize().scaleInPlace(A),K.handlers.rotate(Z.x,Z.y)),(F.x!==0||F.y!==0)&&(F.normalize().scaleInPlace(N),K.handlers.pan(F.x,F.y))}}getClassName(){return"ArcRotateCameraKeyboardMoveInput"}getSimpleName(){return"keyboard"}},(()=>{const q=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[he()],n=[he()],h=[he()],d=[he()],b=[he()],v=[he()],P=[he()],D=[he()],H=[he()],ce=[he()],X=[he()],$(r,null,X,{kind:"getter",name:"useAltToZoom",static:!1,private:!1,access:{has:W=>"useAltToZoom"in W,get:W=>W.useAltToZoom},metadata:q},null,e),$(null,null,t,{kind:"field",name:"keysUp",static:!1,private:!1,access:{has:W=>"keysUp"in W,get:W=>W.keysUp,set:(W,K)=>{W.keysUp=K}},metadata:q},i,s),$(null,null,n,{kind:"field",name:"keysDown",static:!1,private:!1,access:{has:W=>"keysDown"in W,get:W=>W.keysDown,set:(W,K)=>{W.keysDown=K}},metadata:q},o,c),$(null,null,h,{kind:"field",name:"keysLeft",static:!1,private:!1,access:{has:W=>"keysLeft"in W,get:W=>W.keysLeft,set:(W,K)=>{W.keysLeft=K}},metadata:q},f,_),$(null,null,d,{kind:"field",name:"keysRight",static:!1,private:!1,access:{has:W=>"keysRight"in W,get:W=>W.keysRight,set:(W,K)=>{W.keysRight=K}},metadata:q},g,p),$(null,null,b,{kind:"field",name:"keysReset",static:!1,private:!1,access:{has:W=>"keysReset"in W,get:W=>W.keysReset,set:(W,K)=>{W.keysReset=K}},metadata:q},x,E),$(null,null,v,{kind:"field",name:"keysZoomIn",static:!1,private:!1,access:{has:W=>"keysZoomIn"in W,get:W=>W.keysZoomIn,set:(W,K)=>{W.keysZoomIn=K}},metadata:q},S,R),$(null,null,P,{kind:"field",name:"keysZoomOut",static:!1,private:!1,access:{has:W=>"keysZoomOut"in W,get:W=>W.keysZoomOut,set:(W,K)=>{W.keysZoomOut=K}},metadata:q},M,O),$(null,null,D,{kind:"field",name:"panningSensibility",static:!1,private:!1,access:{has:W=>"panningSensibility"in W,get:W=>W.panningSensibility,set:(W,K)=>{W.panningSensibility=K}},metadata:q},w,G),$(null,null,H,{kind:"field",name:"zoomingSensibility",static:!1,private:!1,access:{has:W=>"zoomingSensibility"in W,get:W=>W.zoomingSensibility,set:(W,K)=>{W.zoomingSensibility=K}},metadata:q},ie,ne),$(null,null,ce,{kind:"field",name:"angularSpeed",static:!1,private:!1,access:{has:W=>"angularSpeed"in W,get:W=>W.angularSpeed,set:(W,K)=>{W.angularSpeed=K}},metadata:q},k,te),q&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q})})(),r})();mh.ArcRotateCameraKeyboardMoveInput=FA;var P0;(function(r){r[r.PointerMove=0]="PointerMove",r[r.PointerDown=1]="PointerDown",r[r.PointerUp=2]="PointerUp"})(P0||(P0={}));class Th{}Th.DOM_DELTA_PIXEL=0;Th.DOM_DELTA_LINE=1;Th.DOM_DELTA_PAGE=2;const Gw=40;let LA=(()=>{var r;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[];return r=class{constructor(){this.wheelPrecision=L(this,t,3),this.zoomToMouseLocation=(L(this,i),L(this,n,!1)),this.wheelDeltaPercentage=(L(this,o),L(this,h,0)),this.customComputeDeltaFromMouseWheel=(L(this,f),null),this._viewOffset=new I(0,0,0),this._globalOffset=new I(0,0,0),this._inertialPanning=I.Zero(),this._zoomToMouseRadiusOffset=0}_computeDeltaFromMouseWheelLegacyEvent(d,g){let p;const b=d*.01*this.wheelDeltaPercentage*g;return d>0?p=b/(1+this.wheelDeltaPercentage):p=b*(1+this.wheelDeltaPercentage),p}attachControl(d){d=Rt.BackCompatCameraNoPreventDefault(arguments),this._wheel=g=>
vendor: 15,440 bytes, line 194
194{if(g.type!==mt.POINTERWHEEL)return;const p=g.event;let b;const x=p.deltaMode===Th.DOM_DELTA_LINE?Gw:1,E=-(p.deltaY*x);if(this.customComputeDeltaFromMouseWheel)b=this.customComputeDeltaFromMouseWheel(E,this,p);else if(this.wheelDeltaPercentage){if(b=this._computeDeltaFromMouseWheelLegacyEvent(E,this.camera.radius),b>0){const v=this.zoomToMouseLocation?this._zoomToMouseRadiusOffset:this.camera.inertialRadiusOffset;let S=this.camera.radius,R=v+b;for(let P=0;P<20&&!(S<=R||Math.abs(R*this.camera.inertia)<.001);P++)S-=R,R*=this.camera.inertia;S=yi(S,0,Number.MAX_VALUE),b=this._computeDeltaFromMouseWheelLegacyEvent(E,S)}}else{const S=this.camera.movement.input.getEntry("wheel","zoom")?.sensitivity??1/(this.wheelPrecision*40);b=E*S}b&&(this.zoomToMouseLocation?(this._hitPlane||this._updateHitPlane(),this._zoomToMouse(b)):this.camera.movement.zoomAccumulatedPixels+=b),p.preventDefault&&(d||p.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,mt.POINTERWHEEL),this.zoomToMouseLocation&&this._inertialPanning.setAll(0)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null)}checkInputs(){if(!this.zoomToMouseLocation)return;const d=this.camera;if(Math.abs(this._zoomToMouseRadiusOffset)+this._inertialPanning.lengthSquared()+Math.abs(d.inertialAlphaOffset)+Math.abs(d.inertialBetaOffset)+Math.abs(d.inertialRadiusOffset)){this._updateHitPlane(),d.target.addInPlace(this._inertialPanning),d.radius-=this._zoomToMouseRadiusOffset;const p=d.movement.getFrameIndependentDecay(d.inertia);this._inertialPanning.scaleInPlace(p),this._zoomToMouseRadiusOffset*=p,this._zeroIfClose(this._inertialPanning),Math.abs(this._zoomToMouseRadiusOffset)<It&&(this._zoomToMouseRadiusOffset=0)}}getClassName(){return"ArcRotateCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}_updateHitPlane(){const d=this.camera,g=d.target.subtract(d.position);this._hitPlane=Mn.FromPositionAndNormal(d.target,g)}_getPosition(){const d=this.camera,g=d.getScene(),p=g.createPickingRay(g.pointerX,g.pointerY,ae.Identity(),d,!1);(d.targetScreenOffset.x!==0||d.targetScreenOffset.y!==0)&&(this._viewOffset.set(d.targetScreenOffset.x,d.targetScreenOffset.y,0),d.getViewMatrix().invertToRef(d._cameraTransformMatrix),this._globalOffset=I.TransformNormal(this._viewOffset,d._cameraTransformMatrix),p.origin.addInPlace(this._globalOffset));let b=0;return this._hitPlane&&(b=p.intersectsPlane(this._hitPlane)??0),p.origin.addInPlace(p.direction.scaleInPlace(b))}_zoomToMouse(d){const g=this.camera,p=1-g.inertia,b=g.movement.getFrameIndependentInputScale(g.inertia);if(g.lowerRadiusLimit){const R=g.lowerRadiusLimit??0;g.radius-(this._zoomToMouseRadiusOffset+d*b)/p<R&&(d=((g.radius-R)*p-this._zoomToMouseRadiusOffset)/b)}if(g.upperRadiusLimit){const R=g.upperRadiusLimit??0;g.radius-(this._zoomToMouseRadiusOffset+d*b)/p>R&&(d=((g.radius-R)*p-this._zoomToMouseRadiusOffset)/b)}const E=d/p/g.radius,v=this._getPosition(),S=ge.Vector3[6];v.subtractToRef(g.target,S),S.scaleInPlace(E),S.scaleInPlace(p),S.scaleInPlace(b),this._inertialPanning.addInPlace(S),this._zoomToMouseRadiusOffset+=d*b}_zeroIfClose(d){Math.abs(d.x)<It&&(d.x=0),Math.abs(d.y)<It&&(d.y=0),Math.abs(d.z)<It&&(d.z=0)}},(()=>{const _=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[he()],s=[he()],c=[he()],$(null,null,e,{kind:"field",name:"wheelPrecision",static:!1,private:!1,access:{has:d=>"wheelPrecision"in d,get:d=>d.wheelPrecision,set:(d,g)=>{d.wheelPrecision=g}},metadata:_},t,i),$(null,null,s,{kind:"field",name:"zoomToMouseLocation",static:!1,private:!1,access:{has:d=>"zoomToMouseLocation"in d,get:d=>d.zoomToMouseLocation,set:(d,g)=>{d.zoomToMouseLocation=g}},metadata:_},n,o),$(null,null,c,{kind:"field",name:"wheelDeltaPercentage",static:!1,private:!1,access:{has:d=>"wheelDeltaPercentage"in d,get:d=>d.wheelDeltaPercentage,set:(d,g)=>{d.wheelDeltaPercentage=g}},metadata:_},h,f),_&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_})})(),r})();mh.ArcRotateCameraMouseWheelInput=LA;var O0,w0;class Eg extends kw{constructor(e){super(e)}addMouseWheel(){return this.add(new LA),this}addPointers(){return this.add(new wA),this}addKeyboard(){return this.add(new FA),this}}(O0=Eg.prototype).addVRDeviceOrientation??(O0.addVRDeviceOrientation=Ze("ArcRotateCameraInputsManager","addVRDeviceOrientation"));(w0=Eg.prototype).addGamepad??(w0.addGamepad=Ze("ArcRotateCameraInputsManager","addGamepad"));class Hw extends PA{constructor(e,t,i){super(e,t,i),this.input=new OA({pan:(s,n)=>{this.panAccumulatedPixels.x+=s,this.panAccumulatedPixels.y+=n},rotate:(s,n)=>{this.rotationAccumulatedPixels.x+=s,this.rotationAccumulatedPixels.y+=n},zoom:s=>{this.zoomAccumulatedPixels+=s}},()=>this._createDefaultInputMap())}_createDefaultInputMap(){return[{source:"pointer",button:0,modifiers:{ctrl:!0},interaction:"pan"},{source:"pointer",button:0,interaction:"rotate"},{source:"pointer",button:2,interaction:"pan"},{source:"wheel",interaction:"zoom"},{source:"keyboard",key:[187,107,189,109],interaction:"zoom"},{source:"keyboard",modifiers:{ctrl:!0},interaction:"pan"},{source:"keyboard",modifiers:{alt:!0},interaction:"zoom"},{source:"keyboard",interaction:"rotate"}]}}function Ww(r){let e=Math.PI/2;return r.x===0&&r.z===0||(e=Math.acos(r.x/Math.sqrt(Math.pow(r.x,2)+Math.pow(r.z,2)))),r.z<0&&(e=2*Math.PI-e),e}function Xw(r,e){return Math.acos(r/e)}function xs(r,e){return isNaN(r)?e:r}let jm=(()=>{var r;let e=Uw,t=[],i,s=[],n=[],o,c=[],h=[],f,_=[],d=[],g,p=[],b=[],x,E=[],v=[],S,R=[],P=[],M,O,D,w,G=[],H=[],ie,ne=[],ce=[],k,te=[],X=[],q,W=[],K=[],Z,F=[],A=[],N,Y=[],se=[],ue,pe=[],Ie=[],Le,J=[],_e=[],ye,Ne=[],Je=[],je,yt=[],Yt=[],kt,Et=[],Gt=[],zt,nt=[],oe=[],ze,si,$t,oi=[],ti=[],ii,Ct=[],ni=[],Pt,Ht=[],ri=[],di,_i=[],As=[],rs,Bi=[],St=[];return r=class extends e{get target(){return this._target}set target(V){this.setTarget(V)}get targetHost(){return this._targetHost}set targetHost(V){V&&this.setTarget(V)}getTarget(){return this.target}get position(){return this._position}set position(V){this.setPosition(V)}set upVector(V){this._upToYMatrix||(this._yToUpMatrix=new ae,this._upToYMatrix=new ae,this._upVector=I.Zero()),V.normalize(),this._upVector.copyFrom(V),this.setMatUp()}get upVector(){return this._upVector}setMatUp(){ae.RotationAlignToRef(I.UpReadOnly,this._upVector,this._yToUpMatrix),ae.RotationAlignToRef(this._upVector,I.UpReadOnly,this._upToYMatrix)}get inertialAlphaOffset(){if(this._inertialAlphaOffset!==0)return this._inertialAlphaOffset;if(this.movement.rotationAccumulatedPixels.x!==0)return this.movement.rotationAccumulatedPixels.x;const V=this.movement.rotationDeltaCurrentFrame.x;return Math.abs(V)<this._rotationEpsilon?0:V}set inertialAlphaOffset(V){this._inertialAlphaOffset=V,V===0&&this.movement.resetRotationVelocity()}get inertialBetaOffset(){if(this._inertialBetaOffset!==0)return this._inertialBetaOffset;if(this.movement.rotationAccumulatedPixels.y!==0)return this.movement.rotationAccumulatedPixels.y;const V=this.movement.rotationDeltaCurrentFrame.y;return Math.abs(V)<this._rotationEpsilon?0:V}set inertialBetaOffset(V){this._inertialBetaOffset=V,V===0&&this.movement.resetRotationVelocity()}get inertialRadiusOffset(){if(this._inertialRadiusOffset!==0)return this._inertialRadiusOffset;if(this.movement.zoomAccumulatedPixels!==0)return this.movement.zoomAccumulatedPixels;const V=this.movement.zoomDeltaCurrentFrame;return Math.abs(V)<this._rotationEpsilon?0:V}set inertialRadiusOffset(V){this._inertialRadiusOffset=V,V===0&&this.movement.resetZoomVelocity()}get panningInertia(){return this._panningInertia}set panningInertia(V){this._panningInertia=V,this.movement&&(this.movement.panInertia=V)}get inertia(){return this._inertia}set inertia(V){this._inertia=V,this.movement&&(this.movement.rotationInertia=V,this.movement.zoomInertia=V)}get angularSensibilityX(){const V=this.inputs.attached.pointers;return V?V.angularSensibilityX:0}set angularSensibilityX(V){const Te=this.inputs.attached.pointers;Te&&(Te.angularSensibilityX=V)}get angularSensibilityY(){const V=this.inputs.attached.pointers;return V?V.angularSensibilityY:0}set angularSensibilityY(V){const Te=this.inputs.attached.pointers;Te&&(Te.angularSensibilityY=V)}get pinchPrecision(){const V=this.inputs.attached.pointers;return V?V.pinchPrecision:0}set pinchPrecision(V){const Te=this.inputs.attached.pointers;Te&&(Te.pinchPrecision=V)}get pinchDeltaPercentage(){const V=this.inputs.attached.pointers;return V?V.pinchDeltaPercentage:0}set pinchDeltaPercentage(V){const Te=this.inputs.attached.pointers;Te&&(Te.pinchDeltaPercentage=V)}get useNaturalPinchZoom(){const V=this.inputs.attached.pointers;return V?V.useNaturalPinchZoom:!1}set useNaturalPinchZoom(V){const Te=this.inputs.attached.pointers;Te&&(Te.useNaturalPinchZoom=V)}get panningSensibility(){const V=this.inputs.attached.pointers;return V?V.panningSensibility:0}set panningSensibility(V){const Te=this.inputs.attached.pointers;Te&&(Te.panningSensibility=V)}get keysUp(){const V=this.inputs.attached.keyboard;return V?V.keysUp:[]}set keysUp(V){const Te=this.inputs.attached.keyboard;Te&&(Te.keysUp=V)}get keysDown(){const V=this.inputs.attached.keyboard;return V?V.keysDown:[]}set keysDown(V){const Te=this.inputs.attached.keyboard;Te&&(Te.keysDown=V)}get keysLeft(){const V=this.inputs.attached.keyboard;return V?V.keysLeft:[]}set keysLeft(V){const Te=this.inputs.attached.keyboard;Te&&(Te.keysLeft=V)}get keysRight(){const V=this.inputs.attached.keyboard;return V?V.keysRight:[]}set keysRight(V){const Te=this.inputs.attached.keyboard;Te&&(Te.keysRight=V)}get wheelPrecision(){const V=this.inputs.attached.mousewheel;return V?V.wheelPrecision:0}set wheelPrecision(V){const Te=this.inputs.attached.mousewheel;Te&&(Te.wheelPrecision=V)}get zoomToMouseLocation(){const V=this.inputs.attached.mousewheel;return V?V.zoomToMouseLocation:!1}set zoomToMouseLocation(V){const Te=this.inputs.attached.mousewheel;Te&&(Te.zoomToMouseLocation=V)}get wheelDeltaPercentage(){const V=this.inputs.attached.mousewheel;return V?V.wheelDeltaPercentage:0}set wheelDeltaPercentage(V){const Te=this.inputs.attached.mousewheel;Te&&(Te.wheelDeltaPercentage=V)}get _useCtrlForPanning(){return this._useCtrlForPanningInternal}set _useCtrlForPanning(V){this._useCtrlForPanningInternal=V;const Te=this.movement.input,We=Te.getEntry("keyboard","pan",{modifiers:{ctrl:!0}});!V&&We?Te.inputMap.splice(Te.inputMap.indexOf(We),1):V&&!We&&Te.addEntry({source:"keyboard",modifiers:{ctrl:!0},interaction:"pan"});const Me=Te.getEntry("pointer","pan",{modifiers:{ctrl:!0}});!V&&Me?Te.inputMap.splice(Te.inputMap.indexOf(Me),1):V&&!Me&&Te.addEntry({source:"pointer",button:0,modifiers:{ctrl:!0},interaction:"pan"})}get _panningMouseButton(){return this._panningMouseButtonInternal}set _panningMouseButton(V){this._panningMouseButtonInternal=V;const Te=this.movement.input.getEntry("pointer","pan",{modifiers:{}});Te&&(Te.button=V)}get isInterpolating(){return this._isInterpolating}get bouncingBehavior(){return this._bouncingBehavior}get useBouncingBehavior(){return this._bouncingBehavior!=null}set useBouncingBehavior(V){V!==this.useBouncingBehavior&&(V?(this._bouncingBehavior=new uo,this.addBehavior(this._bouncingBehavior)):this._bouncingBehavior&&(this.removeBehavior(this._bouncingBehavior),this._bouncingBehavior=null))}get framingBehavior(){return this._framingBehavior}get useFramingBehavior(){return this._framingBehavior!=null}set useFramingBehavior(V){V!==this.useFramingBehavior&&(V?(this._framingBehavior=new Is,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))}get autoRotationBehavior(){return this._autoRotationBehavior}get useAutoRotationBehavior(){return this._autoRotationBehavior!=null}set useAutoRotationBehavior(V){V!==this.useAutoRotationBehavior&&(V?(this._autoRotationBehavior=new Mw,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))}constructor(V,Te,We,Me,z,be,ut=!0){super(V,I.Zero(),be,ut),this.alpha=(L(this,t),L(this,s,void 0)),this.beta=(L(this,n),L(this,c,void 0)),this.radius=(L(this,h),L(this,_,void 0)),this.overrideCloneAlphaBetaRadius=(L(this,d),L(this,p,void 0)),this._target=(L(this,b),L(this,E,void 0)),this._targetHost=(L(this,v),L(this,R,void 0)),this._upToYMatrix=L(this,P),this._inertialAlphaOffset=0,this._inertialBetaOffset=0,this._inertialRadiusOffset=0,this.lowerAlphaLimit=L(this,G,null),this.upperAlphaLimit=(L(this,H),L(this,ne,null)),this.lowerBetaLimit=(L(this,ce),L(this,te,.01)),this.upperBetaLimit=(L(this,X),L(this,W,Math.PI-.01)),this.lowerRadiusLimit=(L(this,K),L(this,F,null)),this.upperRadiusLimit=(L(this,A),L(this,Y,null)),this.lowerTargetYLimit=(L(this,se),L(this,pe,-1/0)),this.inertialPanningX=(L(this,Ie),L(this,J,0)),this.inertialPanningY=(L(this,_e),L(this,Ne,0)),this.pinchToPanMaxDistance=(L(this,Je),L(this,yt,20)),this.panningDistanceLimit=(L(this,Yt),L(this,Et,null)),this.panningOriginTarget=(L(this,Gt),L(this,nt,I.Zero())),this._panningInertia=(L(this,oe),.9),this._inertia=.9,this.zoomOnFactor=L(this,oi,1),this.targetScreenOffset=(L(this,ti),L(this,Ct,He.Zero())),this.allowUpsideDown=(L(this,ni),L(this,Ht,!0)),this.useInputToRestoreState=(L(this,ri),L(this,_i,!0)),this.restoreStateInterpolationFactor=(L(this,As),L(this,Bi,0)),this._currentInterpolationFactor=(L(this,St),0),this._viewMatrix=new ae,this._useCtrlForPanningInternal=!0,this._panningMouseButtonInternal=2,this.panningAxis=new I(1,1,0),this._transformedDirection=new I,this.mapPanning=!1,this._isInterpolating=!1,this.onMeshTargetChangedObservable=new Oe,this.checkCollisions=!1,this.collisionRadius=new I(.5,.5,.5),this._previousPosition=I.Zero(),this._collisionVelocity=I.Zero(),this._newPosition=I.Zero(),this._computationVector=I.Zero(),this._goalAlpha=NaN,this._goalBeta=NaN,this._goalRadius=NaN,this._goalTarget=new I(NaN,NaN,NaN),this._goalTargetScreenOffset=new He(NaN,NaN),this._onCollisionPositionChange=(Qe,it,Ot=null)=>{Ot?(this.setPosition(it),this.onCollide&&this.onCollide(Ot)):this._previousPosition.copyFrom(this._position);const wt=Math.cos(this.alpha),li=Math.sin(this.alpha),gs=Math.cos(this.beta);let Ni=Math.sin(this.beta);Ni===0&&(Ni=1e-4);const Hs=this._getTargetPosition();this._computationVector.copyFromFloats(this.radius*wt*Ni,this.radius*gs,this.radius*li*Ni),Hs.addToRef(this._computationVector,this._newPosition),this._position.copyFrom(this._newPosition);let $i=this.upVector;this.allowUpsideDown&&this.beta<0&&($i=$i.clone(),$i=$i.negate()),this._computeViewMatrix(this._position,Hs,$i),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y),this._collisionTriggered=!1},this._target=I.Zero(),z&&this.setTarget(z),this.alpha=Te,this.beta=We,this.radius=Me,this.getViewMatrix(),this.inputs=new Eg(this),this.inputs.addKeyboard().addMouseWheel().addPointers(),this.movement=new Hw(this.getScene(),this._position),this.movement.rotationInertia=this._inertia,this.movement.zoomInertia=this._inertia,this.movement.panInertia=this._panningInertia}_initCache(){super._initCache(),this._cache._target=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.alpha=void 0,this._cache.beta=void 0,this._cache.radiu
vendor: 10,661 bytes, line 194
194s=void 0,this._cache.targetScreenOffset=He.Zero()}_updateCache(V){V||super._updateCache(),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)}_getTargetPosition(){if(this._targetHost&&this._targetHost.getAbsolutePosition){const Te=this._targetHost.getAbsolutePosition();this._targetBoundingCenter?Te.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(Te)}const V=this._getLockedTargetPosition();return V||this._target}storeState(){return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),this._storedTargetScreenOffset=this.targetScreenOffset.clone(),super.storeState()}_restoreStateValues(){return this.hasStateStored()&&this.restoreStateInterpolationFactor>It&&this.restoreStateInterpolationFactor<1?(this.interpolateTo(this._storedAlpha,this._storedBeta,this._storedRadius,this._storedTarget,this._storedTargetScreenOffset,this.restoreStateInterpolationFactor),!0):super._restoreStateValues()?(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0):!1}stopInterpolation(){this._goalAlpha=NaN,this._goalBeta=NaN,this._goalRadius=NaN,this._goalTarget.set(NaN,NaN,NaN),this._goalTargetScreenOffset.set(NaN,NaN)}interpolateTo(V=this.alpha,Te=this.beta,We=this.radius,Me=this.target,z=this.targetScreenOffset,be){this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,be!=null?this._currentInterpolationFactor=be:this.restoreStateInterpolationFactor!==0?this._currentInterpolationFactor=this.restoreStateInterpolationFactor:this._currentInterpolationFactor=.1,this._goalAlpha=xs(V,this._goalAlpha),this._goalBeta=xs(Te,this._goalBeta),this._goalRadius=xs(We,this._goalRadius),this._goalTarget.set(xs(Me.x,this._goalTarget.x),xs(Me.y,this._goalTarget.y),xs(Me.z,this._goalTarget.z)),this._goalTargetScreenOffset.set(xs(z.x,this._goalTargetScreenOffset.x),xs(z.y,this._goalTargetScreenOffset.y)),this._goalAlpha=yi(this._goalAlpha,this.lowerAlphaLimit??-1/0,this.upperAlphaLimit??1/0),this._goalBeta=yi(this._goalBeta,this.lowerBetaLimit??-1/0,this.upperBetaLimit??1/0),this._goalRadius=yi(this._goalRadius,this.lowerRadiusLimit??-1/0,this.upperRadiusLimit??1/0),this._goalTarget.y=yi(this._goalTarget.y,this.lowerTargetYLimit??-1/0,1/0),this._isInterpolating=!0}_isSynchronizedViewMatrix(){return super._isSynchronizedViewMatrix()?this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset):!1}attachControl(V,Te,We=!0,Me=2){const z=arguments;Te=Rt.BackCompatCameraNoPreventDefault(z),this._useCtrlForPanning=We,this._panningMouseButton=Me,typeof z[0]=="boolean"&&(z.length>1&&(this._useCtrlForPanning=z[1]),z.length>2&&(this._panningMouseButton=z[2])),this.inputs.attachElement(Te),this._reset=()=>{this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0}}detachControl(){this.inputs.detachElement(),this._reset&&this._reset()}_applyRotationAndZoomDelta(V,Te,We){const Me=this.invertRotation?-1:1,z=this._calculateHandednessMultiplier();let be=V*z;this.beta<0&&(be*=-1),this.alpha+=be*Me,this.beta+=Te*Me,this.radius-=We}_applyPanDelta(V,Te){const We=ge.Vector3[0].copyFromFloats(V,Te,Te);if(this._viewMatrix.invertToRef(this._cameraTransformMatrix),We.multiplyInPlace(this.panningAxis),I.TransformNormalToRef(We,this._cameraTransformMatrix,this._transformedDirection),this.mapPanning){const Me=this.upVector,z=I.CrossToRef(this._transformedDirection,Me,this._transformedDirection);I.CrossToRef(Me,z,this._transformedDirection)}else this.panningAxis.y||(this._transformedDirection.y=0);if(!this._targetHost)if(this.panningDistanceLimit)this._transformedDirection.addInPlace(this._target),I.DistanceSquared(this._transformedDirection,this.panningOriginTarget)<=this.panningDistanceLimit*this.panningDistanceLimit&&this._target.copyFrom(this._transformedDirection);else{if(this.parent){const Me=ge.Matrix[0];this.parent.getWorldMatrix().getRotationMatrixToRef(Me),Me.transposeToRef(Me),I.TransformCoordinatesToRef(this._transformedDirection,Me,this._transformedDirection)}this._target.addInPlace(this._transformedDirection)}}_checkInputs(){if(this._collisionTriggered)return;this.inputs.checkInputs();let V=!1;this.movement.computeCurrentFrameDeltas();const Te=this.movement.rotationDeltaCurrentFrame,We=this.movement.zoomDeltaCurrentFrame,Me=this.movement.panDeltaCurrentFrame;if((Te.x!==0||Te.y!==0||We!==0||Me.x!==0||Me.y!==0)&&(V=!0,(Te.x!==0||Te.y!==0||We!==0)&&this._applyRotationAndZoomDelta(Te.x,Te.y,We),(Me.x!==0||Me.y!==0)&&this._applyPanDelta(Me.x,Me.y)),(this._inertialAlphaOffset!==0||this._inertialBetaOffset!==0||this._inertialRadiusOffset!==0)&&(this._applyRotationAndZoomDelta(this._inertialAlphaOffset,this._inertialBetaOffset,this._inertialRadiusOffset),this._inertialAlphaOffset*=this.inertia,this._inertialBetaOffset*=this.inertia,this._inertialRadiusOffset*=this.inertia,Math.abs(this._inertialAlphaOffset)<this._rotationEpsilon&&(this._inertialAlphaOffset=0),Math.abs(this._inertialBetaOffset)<this._rotationEpsilon&&(this._inertialBetaOffset=0),Math.abs(this._inertialRadiusOffset)<this._rotationEpsilon&&(this._inertialRadiusOffset=0),V=!0),this.inertialPanningX!==0||this.inertialPanningY!==0){this._applyPanDelta(this.inertialPanningX,this.inertialPanningY),this.inertialPanningX*=this.panningInertia,this.inertialPanningY*=this.panningInertia;const z=this._panningEpsilon;Math.abs(this.inertialPanningX)<z&&(this.inertialPanningX=0),Math.abs(this.inertialPanningY)<z&&(this.inertialPanningY=0),V=!0}if(V)this.stopInterpolation();else if(this._isInterpolating){let z=!1;const be=this._scene.getEngine().getDeltaTime()/1e3,ut=1-Math.pow(2,-be/this._currentInterpolationFactor),Qe=xs(this._goalRadius,this.radius);if(!isNaN(this._goalTarget.x)||!isNaN(this._goalTarget.y)||!isNaN(this._goalTarget.z)){const it=ge.Vector3[0].set(xs(this._goalTarget.x,this._target.x),xs(this._goalTarget.y,this._target.y),xs(this._goalTarget.z,this._target.z));I.LerpToRef(this.target,it,ut,this._target),I.Distance(this.target,it)*10/Qe<It?(this._goalTarget.set(NaN,NaN,NaN),this.target.copyFrom(it),this.setTarget(this.target,!1,!0,!0)):z=!0}if(!isNaN(this._goalAlpha)||!isNaN(this._goalBeta)){const it=Ue.RotationAlphaBetaGammaToRef(xs(this._goalAlpha,this.alpha),xs(this._goalBeta,this.beta),0,ge.Quaternion[0]),Ot=Ue.RotationAlphaBetaGammaToRef(this.alpha,this.beta,0,ge.Quaternion[1]),wt=Ue.SlerpToRef(Ot,it,ut,ge.Quaternion[2]);wt.normalize();const li=wt.toAlphaBetaGammaToRef(ge.Vector3[0]);if(this.alpha=li.x,this.beta=li.y,wt.isApprox(it,It/5)){this._goalAlpha=NaN,this._goalBeta=NaN;const gs=it.toAlphaBetaGammaToRef(ge.Vector3[0]);this.alpha=gs.x,this.beta=gs.y}else z=!0}if(isNaN(this._goalRadius)||(this.radius+=(Qe-this.radius)*ut,Math.abs(Qe/this.radius-1)<It?(this._goalRadius=NaN,this.radius=Qe):z=!0),!isNaN(this._goalTargetScreenOffset.x)||!isNaN(this._goalTargetScreenOffset.y)){const it=ge.Vector2[0].set(xs(this._goalTargetScreenOffset.x,this.targetScreenOffset.x),xs(this._goalTargetScreenOffset.y,this.targetScreenOffset.y));He.LerpToRef(this.targetScreenOffset,it,ut,this.targetScreenOffset),He.Distance(this.targetScreenOffset,it)<It?(this._goalTargetScreenOffset.set(NaN,NaN),this.targetScreenOffset.copyFrom(it)):z=!0}this._isInterpolating=z}this._checkLimits(),super._checkInputs()}_checkLimits(){this.lowerBetaLimit===null||this.lowerBetaLimit===void 0?this.allowUpsideDown&&this.beta>Math.PI&&(this.beta=this.beta-2*Math.PI):this.beta<this.lowerBetaLimit&&(this.beta=this.lowerBetaLimit),this.upperBetaLimit===null||this.upperBetaLimit===void 0?this.allowUpsideDown&&this.beta<-Math.PI&&(this.beta=this.beta+2*Math.PI):this.beta>this.upperBetaLimit&&(this.beta=this.upperBetaLimit),this.lowerAlphaLimit!==null&&this.alpha<this.lowerAlphaLimit&&(this.alpha=this.lowerAlphaLimit),this.upperAlphaLimit!==null&&this.alpha>this.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),this.lowerRadiusLimit!==null&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit,this.inertialRadiusOffset=0),this.upperRadiusLimit!==null&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0),this.target.y=Math.max(this.target.y,this.lowerTargetYLimit)}rebuildAnglesAndRadius(){this._position.subtractToRef(this._getTargetPosition(),this._computationVector),(this._upVector.x!==0||this._upVector.y!==1||this._upVector.z!==0)&&I.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),this.radius===0&&(this.radius=1e-4);const V=this.alpha;this.alpha=Ww(this._computationVector),this.beta=Xw(this._computationVector.y,this.radius);const Te=Math.round((V-this.alpha)/(2*Math.PI));this.alpha+=Te*2*Math.PI,this._checkLimits()}setPosition(V){this._position.equals(V)||(this._position.copyFrom(V),this.rebuildAnglesAndRadius())}setTarget(V,Te=!1,We=!1,Me=!1){if(Me=this.overrideCloneAlphaBetaRadius??Me,V.computeWorldMatrix)Te&&V.getBoundingInfo?this._targetBoundingCenter=V.getBoundingInfo().boundingBox.centerWorld.clone():this._targetBoundingCenter=null,V.computeWorldMatrix(),this._targetHost=V,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{const z=V,be=this._getTargetPosition();if(be&&!We&&be.equals(z))return;this._targetHost=null,this._target=z,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}Me||this.rebuildAnglesAndRadius()}_getViewMatrix(){const V=Math.cos(this.alpha),Te=Math.sin(this.alpha),We=Math.cos(this.beta);let Me=Math.sin(this.beta);Me===0&&(Me=1e-4),this.radius===0&&(this.radius=1e-4);const z=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*V*Me,this.radius*We,this.radius*Te*Me),(this._upVector.x!==0||this._upVector.y!==1||this._upVector.z!==0)&&I.TransformCoordinatesToRef(this._computationVector,this._yToUpMatrix,this._computationVector),z.addToRef(this._computationVector,this._newPosition),this.get
vendor: 16,409 bytes, line 194
194Scene().collisionsEnabled&&this.checkCollisions){const be=this.getScene().collisionCoordinator;this._collider||(this._collider=be.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,be.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);let be=this.upVector;this.allowUpsideDown&&Me<0&&(be=be.negate()),this._computeViewMatrix(this._position,z,be),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget.copyFrom(z),this._viewMatrix}zoomOn(V,Te=!1){V=V||this.getScene().meshes;const We=ee.MinMax(V);let Me=this._calculateLowerRadiusFromModelBoundingSphere(We.min,We.max);if(Me=Math.max(Math.min(Me,this.upperRadiusLimit||Number.MAX_VALUE),this.lowerRadiusLimit||0),this.radius=Me*this.zoomOnFactor,this.mode===Si.ORTHOGRAPHIC_CAMERA){const z=this.getScene().getEngine().getAspectRatio(this),be=Me*this.zoomOnFactor/2;this.orthoLeft=-be*z,this.orthoRight=be*z,this.orthoBottom=-be,this.orthoTop=be}this.focusOn({min:We.min,max:We.max,distance:Me},Te)}focusOn(V,Te=!1){let We,Me;if(V.min===void 0){const z=V||this.getScene().meshes;We=ee.MinMax(z),Me=I.Distance(We.min,We.max)}else{const z=V;We=z,Me=z.distance}this._target=ee.Center(We),Te||(this.maxZ=Me*2)}createRigCamera(V,Te){let We=0;switch(this.cameraRigMode){case Si.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Si.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Si.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Si.RIG_MODE_STEREOSCOPIC_INTERLACED:case Si.RIG_MODE_VR:We=this._cameraRigParams.stereoHalfAngle*(Te===0?1:-1);break;case Si.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:We=this._cameraRigParams.stereoHalfAngle*(Te===0?-1:1);break}const Me=new r(V,this.alpha+We,this.beta,this.radius,this._target,this.getScene());return Me._cameraRigParams={},Me.isRigCamera=!0,Me.rigParent=this,Me.upVector=this.upVector,Me.mode=this.mode,Me.orthoLeft=this.orthoLeft,Me.orthoRight=this.orthoRight,Me.orthoBottom=this.orthoBottom,Me.orthoTop=this.orthoTop,Me}_updateRigCameras(){const V=this._rigCameras[0],Te=this._rigCameras[1];switch(V.beta=Te.beta=this.beta,this.cameraRigMode){case Si.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case Si.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case Si.RIG_MODE_STEREOSCOPIC_OVERUNDER:case Si.RIG_MODE_STEREOSCOPIC_INTERLACED:case Si.RIG_MODE_VR:V.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,Te.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case Si.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:V.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,Te.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle;break}super._updateRigCameras()}_calculateLowerRadiusFromModelBoundingSphere(V,Te,We=1){const Me=I.Distance(V,Te),be=this.getScene().getEngine().getAspectRatio(this),ut=Math.tan(this.fov/2),Qe=ut*be,Ot=Me*.5*We,wt=Ot*Math.sqrt(1+1/(Qe*Qe)),li=Ot*Math.sqrt(1+1/(ut*ut));return Math.max(wt,li)}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"ArcRotateCamera"}},(()=>{const Q=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;i=[he()],o=[he()],f=[he()],g=[he()],x=[Ur("target")],S=[rA("targetHost")],M=[he()],O=[he()],D=[he()],w=[he()],ie=[he()],k=[he()],q=[he()],Z=[he()],N=[he()],ue=[he()],Le=[he()],ye=[he()],je=[he()],kt=[he()],zt=[Ur()],ze=[he()],si=[he()],$t=[he()],ii=[KP()],Pt=[he()],di=[he()],rs=[he()],$(r,null,M,{kind:"getter",name:"inertialAlphaOffset",static:!1,private:!1,access:{has:V=>"inertialAlphaOffset"in V,get:V=>V.inertialAlphaOffset},metadata:Q},null,t),$(r,null,O,{kind:"getter",name:"inertialBetaOffset",static:!1,private:!1,access:{has:V=>"inertialBetaOffset"in V,get:V=>V.inertialBetaOffset},metadata:Q},null,t),$(r,null,D,{kind:"getter",name:"inertialRadiusOffset",static:!1,private:!1,access:{has:V=>"inertialRadiusOffset"in V,get:V=>V.inertialRadiusOffset},metadata:Q},null,t),$(r,null,ze,{kind:"getter",name:"panningInertia",static:!1,private:!1,access:{has:V=>"panningInertia"in V,get:V=>V.panningInertia},metadata:Q},null,t),$(r,null,si,{kind:"getter",name:"zoomToMouseLocation",static:!1,private:!1,access:{has:V=>"zoomToMouseLocation"in V,get:V=>V.zoomToMouseLocation},metadata:Q},null,t),$(null,null,i,{kind:"field",name:"alpha",static:!1,private:!1,access:{has:V=>"alpha"in V,get:V=>V.alpha,set:(V,Te)=>{V.alpha=Te}},metadata:Q},s,n),$(null,null,o,{kind:"field",name:"beta",static:!1,private:!1,access:{has:V=>"beta"in V,get:V=>V.beta,set:(V,Te)=>{V.beta=Te}},metadata:Q},c,h),$(null,null,f,{kind:"field",name:"radius",static:!1,private:!1,access:{has:V=>"radius"in V,get:V=>V.radius,set:(V,Te)=>{V.radius=Te}},metadata:Q},_,d),$(null,null,g,{kind:"field",name:"overrideCloneAlphaBetaRadius",static:!1,private:!1,access:{has:V=>"overrideCloneAlphaBetaRadius"in V,get:V=>V.overrideCloneAlphaBetaRadius,set:(V,Te)=>{V.overrideCloneAlphaBetaRadius=Te}},metadata:Q},p,b),$(null,null,x,{kind:"field",name:"_target",static:!1,private:!1,access:{has:V=>"_target"in V,get:V=>V._target,set:(V,Te)=>{V._target=Te}},metadata:Q},E,v),$(null,null,S,{kind:"field",name:"_targetHost",static:!1,private:!1,access:{has:V=>"_targetHost"in V,get:V=>V._targetHost,set:(V,Te)=>{V._targetHost=Te}},metadata:Q},R,P),$(null,null,w,{kind:"field",name:"lowerAlphaLimit",static:!1,private:!1,access:{has:V=>"lowerAlphaLimit"in V,get:V=>V.lowerAlphaLimit,set:(V,Te)=>{V.lowerAlphaLimit=Te}},metadata:Q},G,H),$(null,null,ie,{kind:"field",name:"upperAlphaLimit",static:!1,private:!1,access:{has:V=>"upperAlphaLimit"in V,get:V=>V.upperAlphaLimit,set:(V,Te)=>{V.upperAlphaLimit=Te}},metadata:Q},ne,ce),$(null,null,k,{kind:"field",name:"lowerBetaLimit",static:!1,private:!1,access:{has:V=>"lowerBetaLimit"in V,get:V=>V.lowerBetaLimit,set:(V,Te)=>{V.lowerBetaLimit=Te}},metadata:Q},te,X),$(null,null,q,{kind:"field",name:"upperBetaLimit",static:!1,private:!1,access:{has:V=>"upperBetaLimit"in V,get:V=>V.upperBetaLimit,set:(V,Te)=>{V.upperBetaLimit=Te}},metadata:Q},W,K),$(null,null,Z,{kind:"field",name:"lowerRadiusLimit",static:!1,private:!1,access:{has:V=>"lowerRadiusLimit"in V,get:V=>V.lowerRadiusLimit,set:(V,Te)=>{V.lowerRadiusLimit=Te}},metadata:Q},F,A),$(null,null,N,{kind:"field",name:"upperRadiusLimit",static:!1,private:!1,access:{has:V=>"upperRadiusLimit"in V,get:V=>V.upperRadiusLimit,set:(V,Te)=>{V.upperRadiusLimit=Te}},metadata:Q},Y,se),$(null,null,ue,{kind:"field",name:"lowerTargetYLimit",static:!1,private:!1,access:{has:V=>"lowerTargetYLimit"in V,get:V=>V.lowerTargetYLimit,set:(V,Te)=>{V.lowerTargetYLimit=Te}},metadata:Q},pe,Ie),$(null,null,Le,{kind:"field",name:"inertialPanningX",static:!1,private:!1,access:{has:V=>"inertialPanningX"in V,get:V=>V.inertialPanningX,set:(V,Te)=>{V.inertialPanningX=Te}},metadata:Q},J,_e),$(null,null,ye,{kind:"field",name:"inertialPanningY",static:!1,private:!1,access:{has:V=>"inertialPanningY"in V,get:V=>V.inertialPanningY,set:(V,Te)=>{V.inertialPanningY=Te}},metadata:Q},Ne,Je),$(null,null,je,{kind:"field",name:"pinchToPanMaxDistance",static:!1,private:!1,access:{has:V=>"pinchToPanMaxDistance"in V,get:V=>V.pinchToPanMaxDistance,set:(V,Te)=>{V.pinchToPanMaxDistance=Te}},metadata:Q},yt,Yt),$(null,null,kt,{kind:"field",name:"panningDistanceLimit",static:!1,private:!1,access:{has:V=>"panningDistanceLimit"in V,get:V=>V.panningDistanceLimit,set:(V,Te)=>{V.panningDistanceLimit=Te}},metadata:Q},Et,Gt),$(null,null,zt,{kind:"field",name:"panningOriginTarget",static:!1,private:!1,access:{has:V=>"panningOriginTarget"in V,get:V=>V.panningOriginTarget,set:(V,Te)=>{V.panningOriginTarget=Te}},metadata:Q},nt,oe),$(null,null,$t,{kind:"field",name:"zoomOnFactor",static:!1,private:!1,access:{has:V=>"zoomOnFactor"in V,get:V=>V.zoomOnFactor,set:(V,Te)=>{V.zoomOnFactor=Te}},metadata:Q},oi,ti),$(null,null,ii,{kind:"field",name:"targetScreenOffset",static:!1,private:!1,access:{has:V=>"targetScreenOffset"in V,get:V=>V.targetScreenOffset,set:(V,Te)=>{V.targetScreenOffset=Te}},metadata:Q},Ct,ni),$(null,null,Pt,{kind:"field",name:"allowUpsideDown",static:!1,private:!1,access:{has:V=>"allowUpsideDown"in V,get:V=>V.allowUpsideDown,set:(V,Te)=>{V.allowUpsideDown=Te}},metadata:Q},Ht,ri),$(null,null,di,{kind:"field",name:"useInputToRestoreState",static:!1,private:!1,access:{has:V=>"useInputToRestoreState"in V,get:V=>V.useInputToRestoreState,set:(V,Te)=>{V.useInputToRestoreState=Te}},metadata:Q},_i,As),$(null,null,rs,{kind:"field",name:"restoreStateInterpolationFactor",static:!1,private:!1,access:{has:V=>"restoreStateInterpolationFactor"in V,get:V=>V.restoreStateInterpolationFactor,set:(V,Te)=>{V.restoreStateInterpolationFactor=Te}},metadata:Q},Bi,St),Q&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Q})})(),r})(),F0=!1;function Yw(){F0||(F0=!0,Qn.AddNodeConstructor("ArcRotateCamera",(r,e)=>()=>new jm(r,0,0,1,I.Zero(),e)),In("BABYLON.ArcRotateCamera",jm))}Yw();let L0=(()=>{var r,e;let t=Qn,i=[],s,n=[],o=[],c,h=[],f=[],_,d=[],g=[],p,b=[],x=[],E,v,S,R,P=[],M=[],O,D=[],w=[],G,H=[],ie=[],ne,ce=[],k=[],te,X=[],q=[],W,K=[],Z=[];return r=class extends t{get range(){return this._range}set range(A){this._range=A,this._inverseSquaredRange=1/(this.range*this.range)}get intensityMode(){return this._intensityMode}set intensityMode(A){this._intensityMode=A,this._computePhotometricScale()}get radius(){return this._radius}set radius(A){this._radius=A,this._computePhotometricScale()}get renderPriority(){return Kt(this,e,"f")}set renderPriority(A){Zt(this,e,A,"f")}get shadowEnabled(){return this._shadowEnabled}set shadowEnabled(A){this._shadowEnabled!==A&&(this._shadowEnabled=A,this._markMeshesAsLightDirty())}get includedOnlyMeshes(){return this._includedOnlyMeshes}set includedOnlyMeshes(A){this._includedOnlyMeshes=A,this._hookArrayForIncludedOnly(A)}get excludedMeshes(){return this._excludedMeshes}set excludedMeshes(A){this._excludedMeshes=A,this._hookArrayForExcluded(A)}get excludeWithLayerMask(){return this._excludeWithLayerMask}set excludeWithLayerMask(A){this._excludeWithLayerMask=A,this._resyncMeshes()}get includeOnlyWithLayerMask(){return this._includeOnlyWithLayerMask}set includeOnlyWithLayerMask(A){this._includeOnlyWithLayerMask=A,this._resyncMeshes()}get lightmapMode(){return this._lightmapMode}set lightmapMode(A){this._lightmapMode!==A&&(this._lightmapMode=A,this._markMeshesAsLightDirty())}getViewMatrix(A){return null}getProjectionMatrix(A,N){return null}constructor(A,N,Y){super(A,N,!1),this.diffuse=(L(this,i),L(this,n,new tt(1,1,1))),this.specular=(L(this,o),L(this,h,new tt(1,1,1))),this.falloffType=(L(this,f),L(this,d,r.FALLOFF_DEFAULT)),this.intensity=(L(this,g),L(this,b,1)),this._range=(L(this,x),Number.MAX_VALUE),this._inverseSquaredRange=0,this._photometricScale=1,this._intensityMode=r.INTENSITYMODE_AUTOMATIC,this._radius=1e-5,this._renderPriority=L(this,P,void 0),e.set(this,(L(this,M),L(this,D,0))),this._shadowEnabled=(L(this,w),L(this,H,!0)),this._includedOnlyMeshes=L(this,ie),this._excludeWithLayerMask=L(this,ce,0),this._includeOnlyWithLayerMask=(L(this,k),L(this,X,0)),this._lightmapMode=(L(this,q),L(this,K,0)),this._shadowGenerators=(L(this,Z),null),this._excludedMeshesIds=new Array,this._includedOnlyMeshesIds=new Array,this._currentViewDepth=0,this._clusteredContainer=null,this._isLight=!0,Y||this.getScene().addLight(this),this._uniformBuffer=new Xe(this.getScene().getEngine(),void 0,void 0,A),this._buildUniformLayout(),this.includedOnlyMeshes=[],this.excludedMeshes=[],Y||this._resyncMeshes()}transferTexturesToEffect(A,N){return this}_bindLight(A,N,Y,se,ue=!0){const pe=A.toString();let Ie=!1;if(this._uniformBuffer.bindToEffect(Y,"Light"+pe),this._renderId!==N.getRenderId()||this._lastUseSpecular!==se||!this._uniformBuffer.useUbo){this._renderId=N.getRenderId(),this._lastUseSpecular=se;const Le=this.getScaledIntensity();this.transferToEffect(Y,pe),this.diffuse.scaleToRef(Le,oo.Color3[0]),this._uniformBuffer.updateColor4("vLightDiffuse",oo.Color3[0],this.range,pe),se&&(this.specular.scaleToRef(Le,oo.Color3[1]),this._uniformBuffer.updateColor4("vLightSpecular",oo.Color3[1],this.radius,pe)),Ie=!0}if(this.transferTexturesToEffect(Y,pe),N.shadowsEnabled&&this.shadowEnabled&&ue){const Le=this.getShadowGenerator(N.activeCamera)??this.getShadowGenerator();Le&&(Le.bindShadowLight(pe,Y),Ie=!0)}Ie?this._uniformBuffer.update():this._uniformBuffer.bindUniformBuffer()}getClassName(){return"Light"}toString(A){let N="Name: "+this.name;if(N+=", type: "+["Point","Directional","Spot","Hemispheric","Clustered"][this.getTypeID()],this.animations)for(let Y=0;Y<this.animations.length;Y++)N+=", animation[0]: "+this.animations[Y].toString(A);return N}_syncParentEnabledState(){super._syncParentEnabledState(),this.isDisposed()||this._resyncMeshes()}setEnabled(A){super.setEnabled(A),this._resyncMeshes()}getShadowGenerator(A=null){return this._shadowGenerators===null?null:this._shadowGenerators.get(A)??null}getShadowGenerators(){return this._shadowGenerators}getAbsolutePosition(){return I.Zero()}canAffectMesh(A){return A?!(this.includedOnlyMeshes&&this.includedOnlyMeshes.length>0&&this.includedOnlyMeshes.indexOf(A)===-1||this.excludedMeshes&&this.excludedMeshes.length>0&&this.excludedMeshes.indexOf(A)!==-1||this.includeOnlyWithLayerMask!==0&&(this.includeOnlyWithLayerMask&A.layerMask)===0||this.excludeWithLayerMask!==0&&this.excludeWithLayerMask&A.layerMask):!0}dispose(A,N=!1){if(this._shadowGenerators){const Y=this._shadowGenerators.values();for(let se=Y.next();se.done!==!0;se=Y.next())se.value.dispose();this._shadowGenerators=null}if(this.getScene().stopAnimation(this),this._parentContainer){const Y=this._parentContainer.lights.indexOf(this);Y>-1&&this._parentContainer.lights.splice(Y,1),this._parentContainer=null}for(const Y of this.getScene().meshes)Y._removeLightSource(this,!0);this._uniformBuffer.dispose(),this.getScene().removeLight(this),super.dispose(A,N)}getTypeID(){return 0}getScaledIntensity(){return this._photometricScale*this.intensity}clone(A,N=null){const Y=r.GetConstructorFromName(this.getTypeID(),A,this.getScene());if(!Y)return null;const se=Tt.Clone(Y,this);return A&&(se.name=A),N&&(se.parent=N),se.setEnabled(this.isEnabled()),this.onClonedObservable.notifyObservers(se),se}serialize(){const A=Tt.Serialize(this);if(A.uniqueId=this.uniqueId,A.type=this.getTypeID(),this.parent&&this.parent._serializeAsParent(A),this.excludedMeshes.length>0){A.excludedMeshesIds=[];for(const N of this.excludedMeshes)A.excludedMeshesIds.push(N.id)}if(this.includedOnlyMeshes.length>0){A.includedOnlyMeshesIds=[];for(const N of this.includedOnlyMeshes)A.includedOnlyMeshesIds.push(N.id)}return Tt.AppendSerializedAnimations(this,A),A.ranges=this.serializeAnimationRanges(),A.isEnabled=this.isEnabled(),A}static GetConstructorFromName(A,N,Y){const se=Qn.Construct("Light_Type_"+A,N,Y);return se||null}static Parse(A,N,Y=""){const se=r.GetConstructorFromName(A.type,A.name,N);if(!se)return null;const ue=Tt.Parse(se,A,N,Y);if(A.excludedMeshesIds&&(ue._excludedMeshesIds=A.excludedMeshesIds),A.includedOnlyMeshesIds&&(ue._includedOnlyMeshesIds=A.includedOnlyMeshesIds),A.parentId!==void 0&&(ue._waitingParentId=A.parentId),A.parentInstanceIndex!==void 0&&(ue._waitingParentInstanceIndex=A.parentInstanceIndex),A.falloffType!==void 0&&(ue.falloffType=A.falloffType),A.lightmapMode!==void 0&&(ue.lightmapMode=A.lightmapMode),A.animations){for(let pe=0;pe<A.animations.length;pe++){const Ie=A.animations[pe],Le=Vf("BABYLON.Animation");Le&&ue.animations.push(Le.Parse(Ie))}Qn.ParseAnimationRanges(ue,A,N)}return A.autoAnimate&&N.beginAnimation(ue,A.autoAnimateFrom,A.autoAnimateTo,A.autoAnimateLoop,A.autoAnimateSpeed||1),A.isEnabled!==void 0&&ue.setEnabled(A.isEnabled),ue._onParsed(A,N,Y),ue}_onParsed(A,N,Y=""){}_hookArrayForExcluded(A){const N=A.push;A.push=(...se)=>{const ue=N.apply(A,se);if(this._clusteredContainer)return ue;for(const pe of se)pe._resyncLightSource(this);return ue};const Y=A.splice;if(A.splice=(se,ue)=>{const pe=Y.call(A,se,ue??A.length);if(this._clusteredContainer)return pe;for(const Ie of pe)Ie._resyncLightSource(this);return pe},!this._clusteredContainer)for(const se of A)se._resyncLightSource(this)}_hookArrayForIncludedOnly(A){const N=A.push;A.push=(...se)=>{const ue=N.apply(A,se);return this._resyncMeshes(),ue};const Y=A.splice;
vendor: 1,282 bytes, line 194
194A.splice=(se,ue)=>{const pe=Y.call(A,se,ue??A.length);return this._resyncMeshes(),pe},this._resyncMeshes()}_resyncMeshes(){if(!this._clusteredContainer)for(const A of this.getScene().meshes)A._resyncLightSource(this)}_markMeshesAsLightDirty(){for(const A of this.getScene().meshes)A.lightSources.indexOf(this)!==-1&&A._markSubMeshesAsLightDirty()}_computePhotometricScale(){this._photometricScale=this._getPhotometricScale(),this.getScene().resetCachedMaterial()}_getPhotometricScale(){let A=0;const N=this.getTypeID();let Y=this.intensityMode;switch(Y===r.INTENSITYMODE_AUTOMATIC&&(N===r.LIGHTTYPEID_DIRECTIONALLIGHT?Y=r.INTENSITYMODE_ILLUMINANCE:Y=r.INTENSITYMODE_LUMINOUSINTENSITY),N){case r.LIGHTTYPEID_POINTLIGHT:case r.LIGHTTYPEID_SPOTLIGHT:switch(Y){case r.INTENSITYMODE_LUMINOUSPOWER:A=1/(4*Math.PI);break;case r.INTENSITYMODE_LUMINOUSINTENSITY:A=1;break;case r.INTENSITYMODE_LUMINANCE:A=this.radius*this.radius;break}break;case r.LIGHTTYPEID_DIRECTIONALLIGHT:switch(Y){case r.INTENSITYMODE_ILLUMINANCE:A=1;break;case r.INTENSITYMODE_LUMINANCE:{let se=this.radius;se=Math.max(se,.001),A=2*Math.PI*(1-Math.cos(se));break}}break;case r.LIGHTTYPEID_HEMISPHERICLIGHT:A=1;break;case r.LIGHTTYPEID_RECT_AREALIGHT:A=1;break}return A}_reorderLightsInScene(){const A=this.getScene();
vendor: 5,977 bytes, line 194
194this._renderPriority!=0&&(A.requireLightSorting=!0),this.getScene().sortLightsByPriority()}areLightTexturesReady(){return!0}_isReady(){return!0}},e=new WeakMap,(()=>{const F=typeof Symbol=="function"&&Symbol.metadata?Object.create(t[Symbol.metadata]??null):void 0;s=[lo()],c=[lo()],_=[he()],p=[he()],E=[he()],v=[he()],S=[he()],R=[he()],O=[Qt("_reorderLightsInScene")],G=[he("shadowEnabled")],ne=[he("excludeWithLayerMask")],te=[he("includeOnlyWithLayerMask")],W=[he("lightmapMode")],$(r,null,E,{kind:"getter",name:"range",static:!1,private:!1,access:{has:A=>"range"in A,get:A=>A.range},metadata:F},null,i),$(r,null,v,{kind:"getter",name:"intensityMode",static:!1,private:!1,access:{has:A=>"intensityMode"in A,get:A=>A.intensityMode},metadata:F},null,i),$(r,null,S,{kind:"getter",name:"radius",static:!1,private:!1,access:{has:A=>"radius"in A,get:A=>A.radius},metadata:F},null,i),$(r,null,O,{kind:"accessor",name:"renderPriority",static:!1,private:!1,access:{has:A=>"renderPriority"in A,get:A=>A.renderPriority,set:(A,N)=>{A.renderPriority=N}},metadata:F},D,w),$(null,null,s,{kind:"field",name:"diffuse",static:!1,private:!1,access:{has:A=>"diffuse"in A,get:A=>A.diffuse,set:(A,N)=>{A.diffuse=N}},metadata:F},n,o),$(null,null,c,{kind:"field",name:"specular",static:!1,private:!1,access:{has:A=>"specular"in A,get:A=>A.specular,set:(A,N)=>{A.specular=N}},metadata:F},h,f),$(null,null,_,{kind:"field",name:"falloffType",static:!1,private:!1,access:{has:A=>"falloffType"in A,get:A=>A.falloffType,set:(A,N)=>{A.falloffType=N}},metadata:F},d,g),$(null,null,p,{kind:"field",name:"intensity",static:!1,private:!1,access:{has:A=>"intensity"in A,get:A=>A.intensity,set:(A,N)=>{A.intensity=N}},metadata:F},b,x),$(null,null,R,{kind:"field",name:"_renderPriority",static:!1,private:!1,access:{has:A=>"_renderPriority"in A,get:A=>A._renderPriority,set:(A,N)=>{A._renderPriority=N}},metadata:F},P,M),$(null,null,G,{kind:"field",name:"_shadowEnabled",static:!1,private:!1,access:{has:A=>"_shadowEnabled"in A,get:A=>A._shadowEnabled,set:(A,N)=>{A._shadowEnabled=N}},metadata:F},H,ie),$(null,null,ne,{kind:"field",name:"_excludeWithLayerMask",static:!1,private:!1,access:{has:A=>"_excludeWithLayerMask"in A,get:A=>A._excludeWithLayerMask,set:(A,N)=>{A._excludeWithLayerMask=N}},metadata:F},ce,k),$(null,null,te,{kind:"field",name:"_includeOnlyWithLayerMask",static:!1,private:!1,access:{has:A=>"_includeOnlyWithLayerMask"in A,get:A=>A._includeOnlyWithLayerMask,set:(A,N)=>{A._includeOnlyWithLayerMask=N}},metadata:F},X,q),$(null,null,W,{kind:"field",name:"_lightmapMode",static:!1,private:!1,access:{has:A=>"_lightmapMode"in A,get:A=>A._lightmapMode,set:(A,N)=>{A._lightmapMode=N}},metadata:F},K,Z),F&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:F})})(),r.FALLOFF_DEFAULT=Lt.FALLOFF_DEFAULT,r.FALLOFF_PHYSICAL=Lt.FALLOFF_PHYSICAL,r.FALLOFF_GLTF=Lt.FALLOFF_GLTF,r.FALLOFF_STANDARD=Lt.FALLOFF_STANDARD,r.LIGHTMAP_DEFAULT=Lt.LIGHTMAP_DEFAULT,r.LIGHTMAP_SPECULAR=Lt.LIGHTMAP_SPECULAR,r.LIGHTMAP_SHADOWSONLY=Lt.LIGHTMAP_SHADOWSONLY,r.INTENSITYMODE_AUTOMATIC=Lt.INTENSITYMODE_AUTOMATIC,r.INTENSITYMODE_LUMINOUSPOWER=Lt.INTENSITYMODE_LUMINOUSPOWER,r.INTENSITYMODE_LUMINOUSINTENSITY=Lt.INTENSITYMODE_LUMINOUSINTENSITY,r.INTENSITYMODE_ILLUMINANCE=Lt.INTENSITYMODE_ILLUMINANCE,r.INTENSITYMODE_LUMINANCE=Lt.INTENSITYMODE_LUMINANCE,r.LIGHTTYPEID_POINTLIGHT=Lt.LIGHTTYPEID_POINTLIGHT,r.LIGHTTYPEID_DIRECTIONALLIGHT=Lt.LIGHTTYPEID_DIRECTIONALLIGHT,r.LIGHTTYPEID_SPOTLIGHT=Lt.LIGHTTYPEID_SPOTLIGHT,r.LIGHTTYPEID_HEMISPHERICLIGHT=Lt.LIGHTTYPEID_HEMISPHERICLIGHT,r.LIGHTTYPEID_RECT_AREALIGHT=Lt.LIGHTTYPEID_RECT_AREALIGHT,r})(),qm=(()=>{var r;let e=L0,t,i=[],s=[],n,o=[],c=[];return r=class extends e{constructor(f,_,d,g){super(f,d,g),this.groundColor=L(this,i,new tt(0,0,0)),this.direction=(L(this,s),L(this,o,void 0)),L(this,c),this.direction=_||I.Up()}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightGround",3),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}getClassName(){return"HemisphericLight"}setDirectionToTarget(f){return this.direction=I.Normalize(f.subtract(I.Zero())),this.direction}getShadowGenerator(){return null}transferToEffect(f,_){const d=I.Normalize(this.direction);return this._uniformBuffer.updateFloat4("vLightData",d.x,d.y,d.z,0,_),this._uniformBuffer.updateColor3("vLightGround",this.groundColor.scale(this.intensity),_),this}transferToNodeMaterialEffect(f,_){const d=I.Normalize(this.direction);return f.setFloat3(_,d.x,d.y,d.z),this}computeWorldMatrix(){return this._worldMatrix||(this._worldMatrix=ae.Identity()),this._worldMatrix}getTypeID(){return L0.LIGHTTYPEID_HEMISPHERICLIGHT}prepareLightSpecificDefines(f,_){f["HEMILIGHT"+_]=!0}},(()=>{const h=typeof Symbol=="function"&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[lo()],n=[Ur()],$(null,null,t,{kind:"field",name:"groundColor",static:!1,private:!1,access:{has:f=>"groundColor"in f,get:f=>f.groundColor,set:(f,_)=>{f.groundColor=_}},metadata:h},i,s),$(null,null,n,{kind:"field",name:"direction",static:!1,private:!1,access:{has:f=>"direction"in f,get:f=>f.direction,set:(f,_)=>{f.direction=_}},metadata:h},o,c),h&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:h})})(),r})(),B0=!1;function jw(){B0||(B0=!0,Qn.AddNodeConstructor("Light_Type_3",(r,e)=>()=>new qm(r,I.Zero(),e)),In("BABYLON.HemisphericLight",qm))}jw();class N0{constructor(){this._count=0,this._data={}}copyFrom(e){this.clear(),e.forEach((t,i)=>this.add(t,i))}get(e){const t=this._data[e];if(t!==void 0)return t}getOrAddWithFactory(e,t){let i=this.get(e);return i!==void 0||(i=t(e),i&&this.add(e,i)),i}getOrAdd(e,t){const i=this.get(e);return i!==void 0?i:(this.add(e,t),t)}contains(e){return this._data[e]!==void 0}
vendor: 5,357 bytes, line 194
194add(e,t){return this._data[e]!==void 0?!1:(this._data[e]=t,++this._count,!0)}set(e,t){return this._data[e]===void 0?!1:(this._data[e]=t,!0)}getAndRemove(e){const t=this.get(e);return t!==void 0?(delete this._data[e],--this._count,t):null}remove(e){return this.contains(e)?(delete this._data[e],--this._count,!0):!1}clear(){this._data={},this._count=0}get count(){return this._count}forEach(e){for(const t in this._data){const i=this._data[t];e(t,i)}}first(e){for(const t in this._data){const i=this._data[t],s=e(t,i);if(s)return s}return null}}function BA(r){r.push("vCameraColorCurveNeutral","vCameraColorCurvePositive","vCameraColorCurveNegative")}let qw=(()=>{var r;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,d=[],g=[],p,b=[],x=[],E,v=[],S=[],R,P=[],M=[],O,D=[],w=[],G,H=[],ie=[],ne,ce=[],k=[],te,X=[],q=[],W,K=[],Z=[];return r=class{constructor(){this._dirty=!0,this._tempColor=new xt(0,0,0,0),this._globalCurve=new xt(0,0,0,0),this._highlightsCurve=new xt(0,0,0,0),this._midtonesCurve=new xt(0,0,0,0),this._shadowsCurve=new xt(0,0,0,0),this._positiveCurve=new xt(0,0,0,0),this._negativeCurve=new xt(0,0,0,0),this._globalHue=L(this,t,30),this._globalDensity=(L(this,i),L(this,n,0)),this._globalSaturation=(L(this,o),L(this,h,0)),this._globalExposure=(L(this,f),L(this,d,0)),this._highlightsHue=(L(this,g),L(this,b,30)),this._highlightsDensity=(L(this,x),L(this,v,0)),this._highlightsSaturation=(L(this,S),L(this,P,0)),this._highlightsExposure=(L(this,M),L(this,D,0)),this._midtonesHue=(L(this,w),L(this,H,30)),this._midtonesDensity=(L(this,ie),L(this,ce,0)),this._midtonesSaturation=(L(this,k),L(this,X,0)),this._midtonesExposure=(L(this,q),L(this,K,0)),this._shadowsHue=(L(this,Z),30),this._shadowsDensity=0,this._shadowsSaturation=0,this._shadowsExposure=0}get globalHue(){return this._globalHue}set globalHue(A){this._globalHue=A,this._dirty=!0}get globalDensity(){return this._globalDensity}set globalDensity(A){this._globalDensity=A,this._dirty=!0}get globalSaturation(){return this._globalSaturation}set globalSaturation(A){this._globalSaturation=A,this._dirty=!0}get globalExposure(){return this._globalExposure}set globalExposure(A){this._globalExposure=A,this._dirty=!0}get highlightsHue(){return this._highlightsHue}set highlightsHue(A){this._highlightsHue=A,this._dirty=!0}get highlightsDensity(){return this._highlightsDensity}set highlightsDensity(A){this._highlightsDensity=A,this._dirty=!0}get highlightsSaturation(){return this._highlightsSaturation}set highlightsSaturation(A){this._highlightsSaturation=A,this._dirty=!0}get highlightsExposure(){return this._highlightsExposure}set highlightsExposure(A){this._highlightsExposure=A,this._dirty=!0}get midtonesHue(){return this._midtonesHue}set midtonesHue(A){this._midtonesHue=A,this._dirty=!0}get midtonesDensity(){return this._midtonesDensity}set midtonesDensity(A){this._midtonesDensity=A,this._dirty=!0}get midtonesSaturation(){return this._midtonesSaturation}set midtonesSaturation(A){this._midtonesSaturation=A,this._dirty=!0}get midtonesExposure(){return this._midtonesExposure}set midtonesExposure(A){this._midtonesExposure=A,this._dirty=!0}get shadowsHue(){return this._shadowsHue}set shadowsHue(A){this._shadowsHue=A,this._dirty=!0}get shadowsDensity(){return this._shadowsDensity}set shadowsDensity(A){this._shadowsDensity=A,this._dirty=!0}get shadowsSaturation(){return this._shadowsSaturation}set shadowsSaturation(A){this._shadowsSaturation=A,this._dirty=!0}get shadowsExposure(){return this._shadowsExposure}set shadowsExposure(A){this._shadowsExposure=A,this._dirty=!0}getClassName(){return"ColorCurves"}_getColorGradingDataToRef(A,N,Y,se,ue){A!=null&&(A=r._Clamp(A,0,360),N=r._Clamp(N,-100,100),Y=r._Clamp(Y,-100,100),se=r._Clamp(se,-100,100),N=r._ApplyColorGradingSliderNonlinear(N),N*=.5,se=r._ApplyColorGradingSliderNonlinear(se),N<0&&(N*=-1,A=(A+180)%360),r._FromHSBToRef(A,N,50+.25*se,ue),ue.scaleToRef(2,ue),ue.a=1+.01*Y)}static _ApplyColorGradingSliderNonlinear(A){A/=100;let N=Math.abs(A);return N=Math.pow(N,2),A<0&&(N*=-1),N*=100,N}static _FromHSBToRef(A,N,Y,se){let ue=r._Clamp(A,0,360);const pe=r._Clamp(N/100,0,1),Ie=r._Clamp(Y/100,0,1);if(pe===0)se.r=Ie,se.g=Ie,se.b=Ie;else{ue/=60;const Le=Math.floor(ue),J=ue-Le,_e=Ie*(1-pe),ye=Ie*(1-pe*J),Ne=Ie*(1-pe*(1-J));switch(Le){case 0:se.r=Ie,se.g=Ne,se.b=_e;break;case 1:se.r=ye,se.g=Ie,se.b=_e;break;case 2:se.r=_e,se.g=Ie,se.b=Ne;break;case 3:se.r=_e,se.g=ye,se.b=Ie;break;case 4:se.r=Ne,se.g=_e,se.b=Ie;break;default:se.r=Ie,se.g=_e,se.b=ye;break}}se.a=1}static _Clamp(A,N,Y){return Math.min(Math.max(A,N),Y)}clone(){return Tt.Clone(()=>new r,this)}serialize(){return Tt.Serialize(this)}_bind(A,N="vCameraColorCurvePositive",Y="vCameraColorCurveNeutral",se="vCameraColorCurveNegative"){this._dirty&&(this._dirty=!1,this._getColorGradingDataToRef(this._globalHue,this._globalDensity,this._globalSaturation,this._globalExposure,this._globalCurve),this._getColorGradingDataToRef(this._highlightsHue,this._highlightsDensity,this._highlightsSaturation,this._highlightsExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._highlightsCurve),this._getColorGradingDataToRef(this._midtonesHue,this._midtonesDensity,this._midtonesSaturation,this._midtonesExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._midtonesCurve),this._getColorGradingDataToRef(this._shadows
vendor: 17,920 bytes, line 194
194Hue,this._shadowsDensity,this._shadowsSaturation,this._shadowsExposure,this._tempColor),this._tempColor.multiplyToRef(this._globalCurve,this._shadowsCurve),this._highlightsCurve.subtractToRef(this._midtonesCurve,this._positiveCurve),this._midtonesCurve.subtractToRef(this._shadowsCurve,this._negativeCurve)),A&&(A.setFloat4(N,this._positiveCurve.r,this._positiveCurve.g,this._positiveCurve.b,this._positiveCurve.a),A.setFloat4(Y,this._midtonesCurve.r,this._midtonesCurve.g,this._midtonesCurve.b,this._midtonesCurve.a),A.setFloat4(se,this._negativeCurve.r,this._negativeCurve.g,this._negativeCurve.b,this._negativeCurve.a))}},(()=>{const F=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[he()],s=[he()],c=[he()],_=[he()],p=[he()],E=[he()],R=[he()],O=[he()],G=[he()],ne=[he()],te=[he()],W=[he()],$(null,null,e,{kind:"field",name:"_globalHue",static:!1,private:!1,access:{has:A=>"_globalHue"in A,get:A=>A._globalHue,set:(A,N)=>{A._globalHue=N}},metadata:F},t,i),$(null,null,s,{kind:"field",name:"_globalDensity",static:!1,private:!1,access:{has:A=>"_globalDensity"in A,get:A=>A._globalDensity,set:(A,N)=>{A._globalDensity=N}},metadata:F},n,o),$(null,null,c,{kind:"field",name:"_globalSaturation",static:!1,private:!1,access:{has:A=>"_globalSaturation"in A,get:A=>A._globalSaturation,set:(A,N)=>{A._globalSaturation=N}},metadata:F},h,f),$(null,null,_,{kind:"field",name:"_globalExposure",static:!1,private:!1,access:{has:A=>"_globalExposure"in A,get:A=>A._globalExposure,set:(A,N)=>{A._globalExposure=N}},metadata:F},d,g),$(null,null,p,{kind:"field",name:"_highlightsHue",static:!1,private:!1,access:{has:A=>"_highlightsHue"in A,get:A=>A._highlightsHue,set:(A,N)=>{A._highlightsHue=N}},metadata:F},b,x),$(null,null,E,{kind:"field",name:"_highlightsDensity",static:!1,private:!1,access:{has:A=>"_highlightsDensity"in A,get:A=>A._highlightsDensity,set:(A,N)=>{A._highlightsDensity=N}},metadata:F},v,S),$(null,null,R,{kind:"field",name:"_highlightsSaturation",static:!1,private:!1,access:{has:A=>"_highlightsSaturation"in A,get:A=>A._highlightsSaturation,set:(A,N)=>{A._highlightsSaturation=N}},metadata:F},P,M),$(null,null,O,{kind:"field",name:"_highlightsExposure",static:!1,private:!1,access:{has:A=>"_highlightsExposure"in A,get:A=>A._highlightsExposure,set:(A,N)=>{A._highlightsExposure=N}},metadata:F},D,w),$(null,null,G,{kind:"field",name:"_midtonesHue",static:!1,private:!1,access:{has:A=>"_midtonesHue"in A,get:A=>A._midtonesHue,set:(A,N)=>{A._midtonesHue=N}},metadata:F},H,ie),$(null,null,ne,{kind:"field",name:"_midtonesDensity",static:!1,private:!1,access:{has:A=>"_midtonesDensity"in A,get:A=>A._midtonesDensity,set:(A,N)=>{A._midtonesDensity=N}},metadata:F},ce,k),$(null,null,te,{kind:"field",name:"_midtonesSaturation",static:!1,private:!1,access:{has:A=>"_midtonesSaturation"in A,get:A=>A._midtonesSaturation,set:(A,N)=>{A._midtonesSaturation=N}},metadata:F},X,q),$(null,null,W,{kind:"field",name:"_midtonesExposure",static:!1,private:!1,access:{has:A=>"_midtonesExposure"in A,get:A=>A._midtonesExposure,set:(A,N)=>{A._midtonesExposure=N}},metadata:F},K,Z),F&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:F})})(),r.PrepareUniforms=BA,r})();function Kw(r,e,t="vCameraColorCurvePositive",i="vCameraColorCurveNeutral",s="vCameraColorCurveNegative"){r._bind(e,t,i,s)}function Zw(r,e){e.EXPOSURE&&r.push("exposureLinear"),e.CONTRAST&&r.push("contrast"),e.COLORGRADING&&r.push("colorTransformSettings"),(e.VIGNETTE||e.DITHER)&&r.push("vInverseScreenSize"),e.VIGNETTE&&(r.push("vignetteSettings1"),r.push("vignetteSettings2")),e.COLORCURVES&&BA(r),e.DITHER&&r.push("ditherIntensity")}function Qw(r,e){e.COLORGRADING&&r.push("txColorTransform")}let Da=(()=>{var r;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,d=[],g=[],p,b=[],x=[],E,v=[],S=[],R,P=[],M=[],O,D=[],w=[],G,H=[],ie=[],ne,ce=[],k=[],te,X=[],q=[],W,K=[],Z=[],F,A=[],N=[],Y,se=[],ue=[],pe,Ie=[],Le=[],J,_e=[],ye=[],Ne,Je=[],je=[],yt,Yt=[],kt=[],Et,Gt=[],zt=[],nt,oe=[],ze=[],si,$t=[],oi=[],ti,ii=[],Ct=[],ni,Pt=[],Ht=[],ri,di=[],_i=[],As,rs=[],Bi=[];return r=class{constructor(){this.colorCurves=L(this,t,new qw),this._colorCurvesEnabled=(L(this,i),L(this,n,!1)),this._colorGradingTexture=(L(this,o),L(this,h,void 0)),this._colorGradingEnabled=(L(this,f),L(this,d,!1)),this._colorGradingWithGreenDepth=(L(this,g),L(this,b,!0)),this._colorGradingBGR=(L(this,x),L(this,v,!0)),this._exposure=(L(this,S),L(this,P,1)),this._toneMappingEnabled=(L(this,M),L(this,D,!1)),this._toneMappingType=(L(this,w),L(this,H,r.TONEMAPPING_STANDARD)),this._contrast=(L(this,ie),L(this,ce,1)),this.vignetteStretch=(L(this,k),L(this,X,0)),this.vignetteCenterX=(L(this,q),L(this,K,0)),this.vignetteCenterY=(L(this,Z),L(this,A,0)),this.vignetteWeight=(L(this,N),L(this,se,1.5)),this.vignetteColor=(L(this,ue),L(this,Ie,new xt(0,0,0,0))),this.vignetteCameraFov=(L(this,Le),L(this,_e,.5)),this._vignetteBlendMode=(L(this,ye),L(this,Je,r.VIGNETTEMODE_MULTIPLY)),this._vignetteEnabled=(L(this,je),L(this,Yt,!1)),this._ditheringEnabled=(L(this,kt),L(this,Gt,!1)),this._ditheringIntensity=(L(this,zt),L(this,oe,1/255)),this._skipFinalColorClamp=(L(this,ze),L(this,$t,!1)),this._applyByPostProcess=(L(this,oi),L(this,ii,!1)),this._isEnabled=(L(this,Ct),L(this,Pt,!0)),this.outputTextureWidth=(L(this,Ht),L(this,di,0)),this.outputTextureHeight=(L(this,_i),L(this,rs,0)),this.onUpdateParameters=(L(this,Bi),new Oe)}get colorCurvesEnabled(){return this._colorCurvesEnabled}set colorCurvesEnabled(Q){this._colorCurvesEnabled!==Q&&(this._colorCurvesEnabled=Q,this._updateParameters())}get colorGradingTexture(){return this._colorGradingTexture}set colorGradingTexture(Q){this._colorGradingTexture!==Q&&(this._colorGradingTexture=Q,this._updateParameters())}get colorGradingEnabled(){return this._colorGradingEnabled}set colorGradingEnabled(Q){this._colorGradingEnabled!==Q&&(this._colorGradingEnabled=Q,this._updateParameters())}get colorGradingWithGreenDepth(){return this._colorGradingWithGreenDepth}set colorGradingWithGreenDepth(Q){this._colorGradingWithGreenDepth!==Q&&(this._colorGradingWithGreenDepth=Q,this._updateParameters())}get colorGradingBGR(){return this._colorGradingBGR}set colorGradingBGR(Q){this._colorGradingBGR!==Q&&(this._colorGradingBGR=Q,this._updateParameters())}get exposure(){return this._exposure}set exposure(Q){this._exposure!==Q&&(this._exposure=Q,this._updateParameters())}get toneMappingEnabled(){return this._toneMappingEnabled}set toneMappingEnabled(Q){this._toneMappingEnabled!==Q&&(this._toneMappingEnabled=Q,this._updateParameters())}get toneMappingType(){return this._toneMappingType}set toneMappingType(Q){this._toneMappingType!==Q&&(this._toneMappingType=Q,this._updateParameters())}get contrast(){return this._contrast}set contrast(Q){this._contrast!==Q&&(this._contrast=Q,this._updateParameters())}get vignetteCentreY(){return this.vignetteCenterY}set vignetteCentreY(Q){this.vignetteCenterY=Q}get vignetteCentreX(){return this.vignetteCenterX}set vignetteCentreX(Q){this.vignetteCenterX=Q}get vignetteBlendMode(){return this._vignetteBlendMode}set vignetteBlendMode(Q){this._vignetteBlendMode!==Q&&(this._vignetteBlendMode=Q,this._updateParameters())}get vignetteEnabled(){return this._vignetteEnabled}set vignetteEnabled(Q){this._vignetteEnabled!==Q&&(this._vignetteEnabled=Q,this._updateParameters())}get ditheringEnabled(){return this._ditheringEnabled}set ditheringEnabled(Q){this._ditheringEnabled!==Q&&(this._ditheringEnabled=Q,this._updateParameters())}get ditheringIntensity(){return this._ditheringIntensity}set ditheringIntensity(Q){this._ditheringIntensity!==Q&&(this._ditheringIntensity=Q,this._updateParameters())}get skipFinalColorClamp(){return this._skipFinalColorClamp}set skipFinalColorClamp(Q){this._skipFinalColorClamp!==Q&&(this._skipFinalColorClamp=Q,this._updateParameters())}get applyByPostProcess(){return this._applyByPostProcess}set applyByPostProcess(Q){this._applyByPostProcess!==Q&&(this._applyByPostProcess=Q,this._updateParameters())}get isEnabled(){return this._isEnabled}set isEnabled(Q){this._isEnabled!==Q&&(this._isEnabled=Q,this._updateParameters())}_updateParameters(){this.onUpdateParameters.notifyObservers(this)}getClassName(){return"ImageProcessingConfiguration"}prepareDefines(Q,V=!1){if(V!==this.applyByPostProcess||!this._isEnabled){Q.VIGNETTE=!1,Q.TONEMAPPING=0,Q.CONTRAST=!1,Q.EXPOSURE=!1,Q.COLORCURVES=!1,Q.COLORGRADING=!1,Q.COLORGRADING3D=!1,Q.DITHER=!1,Q.IMAGEPROCESSING=!1,Q.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,Q.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess&&this._isEnabled;return}if(Q.VIGNETTE=this.vignetteEnabled,Q.VIGNETTEBLENDMODEMULTIPLY=this.vignetteBlendMode===r._VIGNETTEMODE_MULTIPLY,Q.VIGNETTEBLENDMODEOPAQUE=!Q.VIGNETTEBLENDMODEMULTIPLY,!this._toneMappingEnabled)Q.TONEMAPPING=0;else switch(this._toneMappingType){case r.TONEMAPPING_KHR_PBR_NEUTRAL:Q.TONEMAPPING=3;break;case r.TONEMAPPING_ACES:Q.TONEMAPPING=2;break;default:Q.TONEMAPPING=1;break}Q.CONTRAST=this.contrast!==1,Q.EXPOSURE=this.exposure!==1,Q.COLORCURVES=this.colorCurvesEnabled&&!!this.colorCurves,Q.COLORGRADING=this.colorGradingEnabled&&!!this.colorGradingTexture,Q.COLORGRADING?Q.COLORGRADING3D=this.colorGradingTexture.is3D:Q.COLORGRADING3D=!1,Q.SAMPLER3DGREENDEPTH=this.colorGradingWithGreenDepth,Q.SAMPLER3DBGRMAP=this.colorGradingBGR,Q.DITHER=this._ditheringEnabled,Q.IMAGEPROCESSINGPOSTPROCESS=this.applyByPostProcess,Q.SKIPFINALCOLORCLAMP=this.skipFinalColorClamp,Q.IMAGEPROCESSING=Q.VIGNETTE||!!Q.TONEMAPPING||Q.CONTRAST||Q.EXPOSURE||Q.COLORCURVES||Q.COLORGRADING||Q.DITHER}isReady(){return!this.colorGradingEnabled||!this.colorGradingTexture||this.colorGradingTexture.isReady()}bind(Q,V){if(this._colorCurvesEnabled&&this.colorCurves&&Kw(this.colorCurves,Q),this._vignetteEnabled||this._ditheringEnabled){const Te=1/(this.outputTextureWidth||Q.getEngine().getRenderWidth()),We=1/(this.outputTextureHeight||Q.getEngine().getRenderHeight());if(Q.setFloat2("vInverseScreenSize",Te,We),this._ditheringEnabled&&Q.setFloat("ditherIntensity",.5*this._ditheringIntensity),this._vignetteEnabled){const Me=V??We/Te;let z=Math.tan(this.vignetteCameraFov*.5),be=z*Me;const ut=Math.sqrt(be*z);be=yx(be,ut,this.vignetteStretch),z=yx(z,ut,this.vignetteStretch),Q.setFloat4("vignetteSettings1",be,z,-be*this.vignetteCenterX,-z*this.vignetteCenterY);const Qe=-2*this.vignetteWeight;Q.setFloat4("vignetteSettings2",this.vignetteColor.r,this.vignetteColor.g,this.vignetteColor.b,Qe)}}if(Q.setFloat("exposureLinear",this.exposure),Q.setFloat("contrast",this.contrast),this.colorGradingTexture){Q.setTexture("txColorTransform",this.colorGradingTexture);const Te=this.colorGradingTexture.getSize().height;Q.setFloat4("colorTransformSettings",(Te-1)/Te,.5/Te,Te,this.colorGradingTexture.level)}}clone(){return Tt.Clone(()=>new r,this)}serialize(){return Tt.Serialize(this)}static get VIGNETTEMODE_MULTIPLY(){return this._VIGNETTEMODE_MULTIPLY}static get VIGNETTEMODE_OPAQUE(){return this._VIGNETTEMODE_OPAQUE}},(()=>{const St=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[ZP()],s=[he()],c=[yn("colorGradingTexture")],_=[he()],p=[he()],E=[he()],R=[he()],O=[he()],G=[he()],ne=[he()],te=[he()],W=[he()],F=[he()],Y=[he()],pe=[QP()],J=[he()],Ne=[he()],yt=[he()],Et=[he()],nt=[he()],si=[he()],ti=[he()],ni=[he()],ri=[he()],As=[he()],$(null,null,e,{kind:"field",name:"colorCurves",static:!1,private:!1,access:{has:Q=>"colorCurves"in Q,get:Q=>Q.colorCurves,set:(Q,V)=>{Q.colorCurves=V}},metadata:St},t,i),$(null,null,s,{kind:"field",name:"_colorCurvesEnabled",static:!1,private:!1,access:{has:Q=>"_colorCurvesEnabled"in Q,get:Q=>Q._colorCurvesEnabled,set:(Q,V)=>{Q._colorCurvesEnabled=V}},metadata:St},n,o),$(null,null,c,{kind:"field",name:"_colorGradingTexture",static:!1,private:!1,access:{has:Q=>"_colorGradingTexture"in Q,get:Q=>Q._colorGradingTexture,set:(Q,V)=>{Q._colorGradingTexture=V}},metadata:St},h,f),$(null,null,_,{kind:"field",name:"_colorGradingEnabled",static:!1,private:!1,access:{has:Q=>"_colorGradingEnabled"in Q,get:Q=>Q._colorGradingEnabled,set:(Q,V)=>{Q._colorGradingEnabled=V}},metadata:St},d,g),$(null,null,p,{kind:"field",name:"_colorGradingWithGreenDepth",static:!1,private:!1,access:{has:Q=>"_colorGradingWithGreenDepth"in Q,get:Q=>Q._colorGradingWithGreenDepth,set:(Q,V)=>{Q._colorGradingWithGreenDepth=V}},metadata:St},b,x),$(null,null,E,{kind:"field",name:"_colorGradingBGR",static:!1,private:!1,access:{has:Q=>"_colorGradingBGR"in Q,get:Q=>Q._colorGradingBGR,set:(Q,V)=>{Q._colorGradingBGR=V}},metadata:St},v,S),$(null,null,R,{kind:"field",name:"_exposure",static:!1,private:!1,access:{has:Q=>"_exposure"in Q,get:Q=>Q._exposure,set:(Q,V)=>{Q._exposure=V}},metadata:St},P,M),$(null,null,O,{kind:"field",name:"_toneMappingEnabled",static:!1,private:!1,access:{has:Q=>"_toneMappingEnabled"in Q,get:Q=>Q._toneMappingEnabled,set:(Q,V)=>{Q._toneMappingEnabled=V}},metadata:St},D,w),$(null,null,G,{kind:"field",name:"_toneMappingType",static:!1,private:!1,access:{has:Q=>"_toneMappingType"in Q,get:Q=>Q._toneMappingType,set:(Q,V)=>{Q._toneMappingType=V}},metadata:St},H,ie),$(null,null,ne,{kind:"field",name:"_contrast",static:!1,private:!1,access:{has:Q=>"_contrast"in Q,get:Q=>Q._contrast,set:(Q,V)=>{Q._contrast=V}},metadata:St},ce,k),$(null,null,te,{kind:"field",name:"vignetteStretch",static:!1,private:!1,access:{has:Q=>"vignetteStretch"in Q,get:Q=>Q.vignetteStretch,set:(Q,V)=>{Q.vignetteStretch=V}},metadata:St},X,q),$(null,null,W,{kind:"field",name:"vignetteCenterX",static:!1,private:!1,access:{has:Q=>"vignetteCenterX"in Q,get:Q=>Q.vignetteCenterX,set:(Q,V)=>{Q.vignetteCenterX=V}},metadata:St},K,Z),$(null,null,F,{kind:"field",name:"vignetteCenterY",static:!1,private:!1,access:{has:Q=>"vignetteCenterY"in Q,get:Q=>Q.vignetteCenterY,set:(Q,V)=>{Q.vignetteCenterY=V}},metadata:St},A,N),$(null,null,Y,{kind:"field",name:"vignetteWeight",static:!1,private:!1,access:{has:Q=>"vignetteWeight"in Q,get:Q=>Q.vignetteWeight,set:(Q,V)=>{Q.vignetteWeight=V}},metadata:St},se,ue),$(null,null,pe,{kind:"field",name:"vignetteColor",static:!1,private:!1,access:{has:Q=>"vignetteColor"in Q,get:Q=>Q.vignetteColor,set:(Q,V)=>{Q.vignetteColor=V}},metadata:St},Ie,Le),$(null,null,J,{kind:"field",name:"vignetteCameraFov",static:!1,private:!1,access:{has:Q=>"vignetteCameraFov"in Q,get:Q=>Q.vignetteCameraFov,set:(Q,V)=>{Q.vignetteCameraFov=V}},metadata:St},_e,ye),$(null,null,Ne,{kind:"field",name:"_vignetteBlendMode",static:!1,private:!1,access:{has:Q=>"_vignetteBlendMode"in Q,get:Q=>Q._vignetteBlendMode,set:(Q,V)=>{Q._vignetteBlendMode=V}},metadata:St},Je,je),$(null,null,yt,{kind:"field",name:"_vignetteEnabled",static:!1,private:!1,access:{has:Q=>"_vignetteEnabled"in Q,get:Q=>Q._vignetteEnabled,set:(Q,V)=>{Q._vignetteEnabled=V}},metadata:St},Yt,kt),$(null,null,Et,{kind:"field",name:"_ditheringEnabled",static:!1,private:!1,access:{has:Q=>"_ditheringEnabled"in Q,get:Q=>Q._ditheringEnabled,set:(Q,V)=>{Q._ditheringEnabled=V}},metadata:St},Gt,zt),$(null,null,nt,{kind:"field",name:"_ditheringIntensity",static:!1,private:!1,access:{has:Q=>"_ditheringIntensity"in Q,get:Q=>Q._ditheringIntensity,set:(Q,V)=>{Q._ditheringIntensity=V}},metadata:St},oe,ze),$(null,null,si,{kind:"field",name:"_skipFinalColorClamp",static:!1,private:!1,access:{has:Q=>"_skipFinalColorClamp"in Q,get:Q=>Q._skipFinalColorClamp,set:(Q,V)=>{Q._skipFinalColorClamp=V}},metadata:St},$t,oi),$(null,null,ti,{kind:"field",name:"_applyByPostProcess",static:!1,private:!1,access:{has:Q=>"_applyByPostProcess"in Q,get:Q=>Q._applyByPostProcess,set:(Q,V)=>{Q._applyByPostProcess=V}},metadata:St},ii,Ct),$(null,null,ni,{kind:"field",name:"_isEnabled",static:!1,private:!1,access:{has:Q=>"_isEnabled"in Q,get:Q=>Q._isEnabled,set:(Q,V)=>{Q._isEnabled=V}},metadata:St},Pt,Ht),$(null,null,ri,{kind:"field",name:"outputTextureWidth",static:!1,private:!1,access:{has:Q=>"outputTextureWidth"in Q,get:Q=>Q.outputTextureWidth,set:(Q,V)=>{Q.outputTextureWidth=V}},metadata:St},di,_i),$(null,null,As,{kind:"field",name:"outputTextureHeight",static:!1,private:!1,access:{has:Q=>"outputTextureHeight"in Q,get:Q=>Q.outputTextureHeight,set:(Q,V)=>{Q.outputTextureHeight=V}},metadata:St},rs,Bi),St&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:St})})(),r.TONEMAPPING_STANDARD=0,r.TONEMAPPING_ACES=1,r.TONEMAPPING_KHR_PBR_NEUTRAL=2,r.PrepareUniforms=Zw,r.PrepareSamplers=Qw,r._VIGNETTEMODE_MULTIPLY=0,r._VIGNETTEMODE_OPAQUE=1,r})(),U0=!1;function k0(r){const e=Tt.Parse(()=>new Da,r,null,null);return r.vignetteCentreX!==void 0&&(e.vignetteCenterX=r.vignetteCentreX),r.vignetteCentreY!==void 0&&(e.vignetteCenterY=r.vignetteCentreY),e}function $w(){U0||(U0=!0,Da.Parse=k0,Tt._ImageProcessingConfigurationParser=k0,In("BABYLON.ImageProcessingConfiguration",Da))}class Qi{constructor(e,t,i,s,n,o){this.source=e,this.pointerX=t,this.pointerY=i,this.meshUnderPointer=s,this.sourceEvent=n,this.additionalData=o}static CreateNew(e,t,i){const s=e.getScene();return new Qi(e,s.pointerX,s.pointerY,s.meshUnderPointer||e,t,i)}static CreateNewFromSprite(e,t,i,s){return new Qi(e,t.pointerX,t.pointerY,t.meshUnderPointer,i,s)}static CreateNewFromScene(e,t){return new Qi(null,e.pointerX,e.pointerY,e.meshUnderPointer,t)}static CreateNewFromPrimitive(e,t,i,s){return new Qi(e,t.x,t.y,null,i,s)}}class z0{constructor(e){this._vertexBuffers={},this._activePostProcesses=[],this.onBeforeRenderObservable=new Oe,this._scene=e}_prepareBuffers(){if(this._vertexBuffers[U.PositionKind])return;const e=[];e.push(1,1),e.push(-1,1),e.push(-1,-1),e.push(1,-1),this._vertexBuffers[U.PositionKind]=new U(this._scene.getEngine(),e,U.PositionKind,!1,!1,2),this._buildIndexBuffer()}_buildIndexBuffer(){const e=[];e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),this._indexBuffer=this._scene.getEngine().createIndexBuffer(e)}_getActivePostProcesses(e){const t=this._activePostProcesses;t.length=0;for(let i=0;i<e.length;i++){const s=e[i];
194s&&t.push(s)}return t}_rebuild(){const e=this._vertexBuffers[U.PositionKind];e&&(e._rebuild(),this._buildIndexBuffer())}_prepareFrame(e=null,t=null){const i=this._scene.activeCamera;return!i||(t=t||this._getActivePostProcesses(i._postProcesses),!t||t.length===0||!this._scene.postProcessesEnabled)?!1:(t[0].activate(i,e,t!=null),!0)}directRender(e,t=null,i=!1,s=0,n=0,o=!1,c=e.length){const h=this._scene.getEngine();for(let f=0;f<c;f++){f<e.length-1?e[f+1].activate(this._scene.activeCamera||this._scene,t?.texture):(t?h.bindFramebuffer(t,s,void 0,void 0,i,n):o||h.restoreDefaultFramebuffer(),h._debugInsertMarker?.(`post process ${e[f].name} output`));const _=e[f],d=_.apply();d&&(_.onBeforeRenderObservable.notifyObservers(d),this._prepareBuffers(),h.bindBuffers(this._vertexBuffers,this._indexBuffer,d),h.drawElementsType(0,0,6),_.onAfterRenderObservable.notifyObservers(d))}h.setDepthBuffer(!0),h.setDepthWrite(!0)}_finalizeFrame(e,t,i,s,n=!1){const o=this._scene.activeCamera;if(!o||(this.onBeforeRenderObservable.notifyObservers(this),s=s||this._getActivePostProcesses(o._postProcesses),s.length===0||!this._scene.postProcessesEnabled))return;const c=this._scene.getEngine();for(let h=0,f=s.length;h<f;h++){const _=s[h];if(h<f-1?_._outputTexture=s[h+1].activate(o,t?.texture):(t?(c.bindFramebuffer(t,i,void 0,void 0,n),_._outputTexture=t):(c.restoreDefaultFramebuffer(),_._outputTexture=null),c._debugInsertMarker?.(`post process ${s[h].name} output`)),e)break;const d=_.apply();d&&(_.onBeforeRenderObservable.notifyObservers(d),this._prepareBuffers(),c.bindBuffers(this._vertexBuffers,this._indexBuffer,d),c.drawElementsType(0,0,6),_.onAfterRenderObservable.notifyObservers(d))}c.setDepthBuffer(!0),c.setDepthWrite(!0),c.setAlphaMode(0)}dispose(){const e=this._vertexBuffers[U.PositionKind];e&&(e.dispose(),this._vertexBuffers[U.PositionKind]=null),this._indexBuffer&&(this._scene.getEngine()._releaseBuffer(this._indexBuffer),this._indexBuffer=null)}}class Sn{set opaqueSortCompareFn(e){e?this._opaqueSortCompareFn=e:this._opaqueSortCompareFn=Sn.PainterSortCompare,this._renderOpaque=this._renderOpaqueSorted}set alphaTestSortCompareFn(e){e?this._alphaTestSortCompareFn=e:this._alphaTestSortCompareFn=Sn.PainterSortCompare,this._renderAlphaTest=this._renderAlphaTestSorted}set transparentSortCompareFn(e){e?this._transparentSortCompareFn=e:this._transparentSortCompareFn=Sn.defaultTransparentSortCompare,this._renderTransparent=this._renderTransparentSorted}constructor(e,t,i=null,s=null,n=null){this.index=e,this._opaqueSubMeshes=new Ps(256),this._transparentSubMeshes=new Ps(256),this._alphaTestSubMeshes=new Ps(256),this._depthOnlySubMeshes=new Ps(256),this._particleSystems=new Ps(256),this._spriteManagers=new Ps(256),this._empty=!0,this._edgesRenderers=new so(16),this.disableDepthPrePass=!1,this._scene=t,this.opaqueSortCompareFn=i,this.alphaTestSortCompareFn=s,this.transparentSortCompareFn=n}render(e,t,i,s,n=!0,o=!0,c=!0,h=!0,f){if(e){e(this._opaqueSubMeshes,this._alphaTestSubMeshes,this._transparentSubMeshes,this._depthOnlySubMeshes);return}const _=this._scene.getEngine();n&&this._depthOnlySubMeshes.length!==0&&(_.setColorWrite(!1),this._renderAlphaTest(this._depthOnlySubMeshes),_.setColorWrite(!0)),o&&this._opaqueSubMeshes.length!==0&&this._renderOpaque(this._opaqueSubMeshes),c&&this._alphaTestSubMeshes.length!==0&&this._renderAlphaTest(this._alphaTestSubMeshes);const d=_.getStencilBuffer();if(_.setStencilBuffer(!1),t&&this._renderSprites(),i&&this._renderParticles(s),this.onBeforeTransparentRendering&&this.onBeforeTransparentRendering(),h&&(f||this._transparentSubMeshes.length!==0||this._scene.useOrderIndependentTransparency)){if(_.setStencilBuffer(d),f)f(this._transparentSubMeshes,this);else if(this._scene.useOrderIndependentTransparency){const g=this._scene.depthPeelingRenderer.render(this._transparentSubMeshes);
vendor: 61,957 bytes, line 194
194g.length&&this._renderTransparent(g)}else this._renderTransparent(this._transparentSubMeshes);_.setAlphaMode(0)}if(_.setStencilBuffer(!1),o&&this._edgesRenderers.length){for(let g=0;g<this._edgesRenderers.length;g++)this._edgesRenderers.data[g].render();_.setAlphaMode(0)}_.setStencilBuffer(d)}_renderOpaqueSorted(e){Sn._RenderSorted(e,this._opaqueSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderAlphaTestSorted(e){Sn._RenderSorted(e,this._alphaTestSortCompareFn,this._scene.activeCamera,!1,this.disableDepthPrePass)}_renderTransparentSorted(e){Sn._RenderSorted(e,this._transparentSortCompareFn,this._scene.activeCamera,!0,this.disableDepthPrePass)}static _RenderSorted(e,t,i,s,n){let o=0,c;const h=i?i.globalPosition:Sn._ZeroVector;if(s)for(;o<e.length;o++)c=e.data[o],c._alphaIndex=c.getMesh().alphaIndex,c._distanceToCamera=I.Distance(c.getBoundingInfo().boundingSphere.centerWorld,h);const f=e.length===e.data.length?e.data:e.data.slice(0,e.length);t&&f.sort(t);const _=f[0].getMesh().getScene();for(o=0;o<f.length;o++)if(c=f[o],!(_._activeMeshesFrozenButKeepClipping&&!c.isInFrustum(_._frustumPlanes))){if(s){const d=c.getMaterial();if(d&&d.needDepthPrePass&&!n){const g=d.getScene().getEngine();g.setColorWrite(!1),g.setAlphaMode(0),c.render(!1),g.setColorWrite(!0)}}c.render(s)}}static defaultTransparentSortCompare(e,t){return e._alphaIndex>t._alphaIndex?1:e._alphaIndex<t._alphaIndex?-1:Sn.backToFrontSortCompare(e,t)}static backToFrontSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?1:e._distanceToCamera>t._distanceToCamera?-1:0}static frontToBackSortCompare(e,t){return e._distanceToCamera<t._distanceToCamera?-1:e._distanceToCamera>t._distanceToCamera?1:0}static PainterSortCompare(e,t){const i=e.getMesh(),s=t.getMesh();return i.material&&s.material?i.material.uniqueId-s.material.uniqueId:i.uniqueId-s.uniqueId}prepare(){this._opaqueSubMeshes.reset(),this._transparentSubMeshes.reset(),this._alphaTestSubMeshes.reset(),this._depthOnlySubMeshes.reset(),this._particleSystems.reset(),this.prepareSprites(),this._edgesRenderers.reset(),this._empty=!0}prepareSprites(){this._spriteManagers.reset()}dispose(){this._opaqueSubMeshes.dispose(),this._transparentSubMeshes.dispose(),this._alphaTestSubMeshes.dispose(),this._depthOnlySubMeshes.dispose(),this._particleSystems.dispose(),this._spriteManagers.dispose(),this._edgesRenderers.dispose()}dispatch(e,t,i){t===void 0&&(t=e.getMesh()),i===void 0&&(i=e.getMaterial()),i!=null&&(i.needAlphaBlendingForMesh(t)?this._transparentSubMeshes.push(e):i.needAlphaTestingForMesh(t)?(i.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._alphaTestSubMeshes.push(e)):(i.needDepthPrePass&&!this.disableDepthPrePass&&this._depthOnlySubMeshes.push(e),this._opaqueSubMeshes.push(e)),t._renderingGroup=this,t._edgesRenderer&&t.isEnabled()&&t.isVisible&&t._edgesRenderer.isEnabled&&this._edgesRenderers.pushNoDuplicate(t._edgesRenderer),this._empty=!1)}dispatchSprites(e){this._spriteManagers.push(e),this._empty=!1}dispatchParticles(e){this._particleSystems.push(e),this._empty=!1}_renderParticles(e){if(this._particleSystems.length===0)return;const t=this._scene.activeCamera;this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);for(let i=0;i<this._particleSystems.length;i++){const s=this._particleSystems.data[i];if((t&&t.layerMask&s.layerMask)===0)continue;const n=s.emitter;(!n.position||!e||e.indexOf(n)!==-1)&&this._scene._activeParticles.addCount(s.render(),!1)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}_renderSprites(){if(!this._scene.spritesEnabled||this._spriteManagers.length===0)return;const e=this._scene.activeCamera;this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);for(let t=0;t<this._spriteManagers.length;t++){const i=this._spriteManagers.data[t];(e&&e.layerMask&i.layerMask)!==0&&i.render()}this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene)}}Sn._ZeroVector=I.Zero();class Jw{}class _s{get disableDepthPrePass(){return this._disableDepthPrePass}set disableDepthPrePass(e){this._disableDepthPrePass=e;for(const t of this._renderingGroups)t.disableDepthPrePass=e}get maintainStateBetweenFrames(){return this._maintainStateBetweenFrames}set maintainStateBetweenFrames(e){e!==this._maintainStateBetweenFrames&&(this._maintainStateBetweenFrames=e,this._maintainStateBetweenFrames||this.restoreDispachedFlags())}restoreDispachedFlags(){for(const e of this._scene.meshes)if(e.subMeshes)for(const t of e.subMeshes)t._wasDispatched=!1;if(this._scene.spriteManagers)for(const e of this._scene.spriteManagers)e._wasDispatched=!1;for(const e of this._scene.particleSystems)e._wasDispatched=!1}constructor(e){this._useSceneAutoClearSetup=!1,this._disableDepthPrePass=!1,this._renderingGroups=new Array,this._autoClearDepthStencil={},this._customOpaqueSortCompareFn={},this._customAlphaTestSortCompareFn={},this._customTransparentSortCompareFn={},this._renderingGroupInfo=new Jw,this._maintainStateBetweenFrames=!1,this._scene=e;for(let t=_s.MIN_RENDERINGGROUPS;t<_s.MAX_RENDERINGGROUPS;t++)this._autoClearDepthStencil[t]={autoClear:!0,depth:!0,stencil:!0}}get renderingGroups(){return this._renderingGroups}getRenderingGroup(e){const t=e||0;return this._prepareRenderingGroup(t),this._renderingGroups[t]}_clearDepthStencilBuffer(e=!0,t=!0){this._depthStencilBufferAlreadyCleaned||(this._scene.getEngine().clear(null,!1,e,t),this._depthStencilBufferAlreadyCleaned=!0)}render(e,t,i,s,n=!0,o=!0,c=!0,h=!0,f){const _=this._renderingGroupInfo;if(_.scene=this._scene,_.camera=this._scene.activeCamera,_.renderingManager=this,this._scene.spriteManagers&&s)for(let d=0;d<this._scene.spriteManagers.length;d++){const g=this._scene.spriteManagers[d];this.dispatchSprites(g)}for(let d=_s.MIN_RENDERINGGROUPS;d<_s.MAX_RENDERINGGROUPS;d++){this._depthStencilBufferAlreadyCleaned=d===_s.MIN_RENDERINGGROUPS;const g=this._renderingGroups[d];if(!g||g._empty)continue;const p=1<<d;if(_.renderingGroupId=d,this._scene.onBeforeRenderingGroupObservable.notifyObservers(_,p),_s.AUTOCLEAR){const b=this._useSceneAutoClearSetup?this._scene.getAutoClearDepthStencilSetup(d):this._autoClearDepthStencil[d];b&&b.autoClear&&this._clearDepthStencilBuffer(b.depth,b.stencil)}for(const b of this._scene._beforeRenderingGroupDrawStage)b.action(d);g.render(e,s,i,t,n,o,c,h,f);for(const b of this._scene._afterRenderingGroupDrawStage)b.action(d);this._scene.onAfterRenderingGroupObservable.notifyObservers(_,p)}}reset(){if(!this.maintainStateBetweenFrames)for(let e=_s.MIN_RENDERINGGROUPS;e<_s.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepare()}}resetSprites(){if(!this.maintainStateBetweenFrames)for(let e=_s.MIN_RENDERINGGROUPS;e<_s.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.prepareSprites()}}dispose(){this.freeRenderingGroups(),this._renderingGroups.length=0,this._renderingGroupInfo=null}freeRenderingGroups(){for(let e=_s.MIN_RENDERINGGROUPS;e<_s.MAX_RENDERINGGROUPS;e++){const t=this._renderingGroups[e];t&&t.dispose()}}_prepareRenderingGroup(e){this._renderingGroups[e]===void 0&&(this._renderingGroups[e]=new Sn(e,this._scene,this._customOpaqueSortCompareFn[e],this._customAlphaTestSortCompareFn[e],this._customTransparentSortCompareFn[e]),this._renderingGroups[e].disableDepthPrePass=this._disableDepthPrePass)}dispatchSprites(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchSprites(e))}dispatchParticles(e){this.maintainStateBetweenFrames&&e._wasDispatched||(e._wasDispatched=!0,this.getRenderingGroup(e.renderingGroupId).dispatchParticles(e))}dispatch(e,t,i){t===void 0&&(t=e.getMesh()),!(this.maintainStateBetweenFrames&&e._wasDispatched)&&(e._wasDispatched=!0,this.getRenderingGroup(t.renderingGroupId).dispatch(e,t,i))}setRenderingOrder(e,t=null,i=null,s=null){if(this._customOpaqueSortCompareFn[e]=t,this._customAlphaTestSortCompareFn[e]=i,this._customTransparentSortCompareFn[e]=s,this._renderingGroups[e]){const n=this._renderingGroups[e];n.opaqueSortCompareFn=this._customOpaqueSortCompareFn[e],n.alphaTestSortCompareFn=this._customAlphaTestSortCompareFn[e],n.transparentSortCompareFn=this._customTransparentSortCompareFn[e]}}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._autoClearDepthStencil[e]={autoClear:t,depth:i,stencil:s}}getAutoClearDepthStencilSetup(e){return this._autoClearDepthStencil[e]}}_s.MAX_RENDERINGGROUPS=4;_s.MIN_RENDERINGGROUPS=0;_s.AUTOCLEAR=!0;class Js{constructor(){this.hoverCursor="",this.actions=[],this.isRecursive=!1,this.disposeWhenUnowned=!0}static get HasTriggers(){for(const e in Js.Triggers)if(Object.prototype.hasOwnProperty.call(Js.Triggers,e))return!0;return!1}static get HasPickTriggers(){for(const e in Js.Triggers)if(Object.prototype.hasOwnProperty.call(Js.Triggers,e)){const t=parseInt(e);if(t>=1&&t<=7)return!0}return!1}static HasSpecificTrigger(e){for(const t in Js.Triggers)if(Object.prototype.hasOwnProperty.call(Js.Triggers,t)&&parseInt(t)===e)return!0;return!1}}Js.Triggers={};var qe;(function(r){r[r.Generic=0]="Generic",r[r.Keyboard=1]="Keyboard",r[r.Mouse=2]="Mouse",r[r.Touch=3]="Touch",r[r.DualShock=4]="DualShock",r[r.Xbox=5]="Xbox",r[r.Switch=6]="Switch",r[r.DualSense=7]="DualSense"})(qe||(qe={}));var st;(function(r){r[r.Horizontal=0]="Horizontal",r[r.Vertical=1]="Vertical",r[r.LeftClick=2]="LeftClick",r[r.MiddleClick=3]="MiddleClick",r[r.RightClick=4]="RightClick",r[r.BrowserBack=5]="BrowserBack",r[r.BrowserForward=6]="BrowserForward",r[r.MouseWheelX=7]="MouseWheelX",r[r.MouseWheelY=8]="MouseWheelY",r[r.MouseWheelZ=9]="MouseWheelZ",r[r.Move=12]="Move"})(st||(st={}));var V0;(function(r){r[r.Horizontal=0]="Horizontal",r[r.Vertical=1]="Vertical",r[r.LeftClick=2]="LeftClick",r[r.MiddleClick=3]="MiddleClick",r[r.RightClick=4]="RightClick",r[r.BrowserBack=5]="BrowserBack",r[r.BrowserForward=6]="BrowserForward",r[r.MouseWheelX=7]="MouseWheelX",r[r.MouseWheelY=8]="MouseWheelY",r[r.MouseWheelZ=9]="MouseWheelZ",r[r.DeltaHorizontal=10]="DeltaHorizontal",r[r.DeltaVertical=11]="DeltaVertical"})(V0||(V0={}));var G0;(function(r){r[r.Cross=0]="Cross",r[r.Circle=1]="Circle",r[r.Square=2]="Square",r[r.Triangle=3]="Triangle",r[r.L1=4]="L1",r[r.R1=5]="R1",r[r.L2=6]="L2",r[r.R2=7]="R2",r[r.Share=8]="Share",r[r.Options=9]="Options",r[r.L3=10]="L3",r[r.R3=11]="R3",r[r.DPadUp=12]="DPadUp",r[r.DPadDown=13]="DPadDown",r[r.DPadLeft=14]="DPadLeft",r[r.DPadRight=15]="DPadRight",r[r.Home=16]="Home",r[r.TouchPad=17]="TouchPad",r[r.LStickXAxis=18]="LStickXAxis",r[r.LStickYAxis=19]="LStickYAxis",r[r.RStickXAxis=20]="RStickXAxis",r[r.RStickYAxis=21]="RStickYAxis"})(G0||(G0={}));var H0;(function(r){r[r.Cross=0]="Cross",r[r.Circle=1]="Circle",r[r.Square=2]="Square",r[r.Triangle=3]="Triangle",r[r.L1=4]="L1",r[r.R1=5]="R1",r[r.L2=6]="L2",r[r.R2=7]="R2",r[r.Create=8]="Create",r[r.Options=9]="Options",r[r.L3=10]="L3",r[r.R3=11]="R3",r[r.DPadUp=12]="DPadUp",r[r.DPadDown=13]="DPadDown",r[r.DPadLeft=14]="DPadLeft",r[r.DPadRight=15]="DPadRight",r[r.Home=16]="Home",r[r.TouchPad=17]="TouchPad",r[r.LStickXAxis=18]="LStickXAxis",r[r.LStickYAxis=19]="LStickYAxis",r[r.RStickXAxis=20]="RStickXAxis",r[r.RStickYAxis=21]="RStickYAxis"})(H0||(H0={}));var W0;(function(r){r[r.A=0]="A",r[r.B=1]="B",r[r.X=2]="X",r[r.Y=3]="Y",r[r.LB=4]="LB",r[r.RB=5]="RB",r[r.LT=6]="LT",r[r.RT=7]="RT",r[r.Back=8]="Back",r[r.Start=9]="Start",r[r.LS=10]="LS",r[r.RS=11]="RS",r[r.DPadUp=12]="DPadUp",r[r.DPadDown=13]="DPadDown",r[r.DPadLeft=14]="DPadLeft",r[r.DPadRight=15]="DPadRight",r[r.Home=16]="Home",r[r.LStickXAxis=17]="LStickXAxis",r[r.LStickYAxis=18]="LStickYAxis",r[r.RStickXAxis=19]="RStickXAxis",r[r.RStickYAxis=20]="RStickYAxis"})(W0||(W0={}));var X0;(function(r){r[r.B=0]="B",r[r.A=1]="A",r[r.Y=2]="Y",r[r.X=3]="X",r[r.L=4]="L",r[r.R=5]="R",r[r.ZL=6]="ZL",r[r.ZR=7]="ZR",r[r.Minus=8]="Minus",r[r.Plus=9]="Plus",r[r.LS=10]="LS",r[r.RS=11]="RS",r[r.DPadUp=12]="DPadUp",r[r.DPadDown=13]="DPadDown",r[r.DPadLeft=14]="DPadLeft",r[r.DPadRight=15]="DPadRight",r[r.Home=16]="Home",r[r.Capture=17]="Capture",r[r.LStickXAxis=18]="LStickXAxis",r[r.LStickYAxis=19]="LStickYAxis",r[r.RStickXAxis=20]="RStickXAxis",r[r.RStickYAxis=21]="RStickYAxis"})(X0||(X0={}));class no{static CreateDeviceEvent(e,t,i,s,n,o,c){switch(e){case qe.Keyboard:return this._CreateKeyboardEvent(i,s,n,o);case qe.Mouse:if(i===st.MouseWheelX||i===st.MouseWheelY||i===st.MouseWheelZ)return this._CreateWheelEvent(e,t,i,s,n,o);case qe.Touch:return this._CreatePointerEvent(e,t,i,s,n,o,c);default:throw`Unable to generate event for device ${qe[e]}`}}static _CreatePointerEvent(e,t,i,s,n,o,c){const h=this._CreateMouseEvent(e,t,i,s,n,o);e===qe.Mouse?(h.deviceType=qe.Mouse,h.pointerId=1,h.pointerType="mouse"):(h.deviceType=qe.Touch,h.pointerId=c??t,h.pointerType="touch");let f=0;return f+=n.pollInput(e,t,st.LeftClick),f+=n.pollInput(e,t,st.RightClick)*2,f+=n.pollInput(e,t,st.MiddleClick)*4,h.buttons=f,i===st.Move?h.type="pointermove":i>=st.LeftClick&&i<=st.RightClick&&(h.type=s===1?"pointerdown":"pointerup",h.button=i-2),h}static _CreateWheelEvent(e,t,i,s,n,o){const c=this._CreateMouseEvent(e,t,i,s,n,o);switch(c.pointerId=1,c.type="wheel",c.deltaMode=Th.DOM_DELTA_PIXEL,c.deltaX=0,c.deltaY=0,c.deltaZ=0,i){case st.MouseWheelX:c.deltaX=s;break;case st.MouseWheelY:c.deltaY=s;break;case st.MouseWheelZ:c.deltaZ=s;break}return c}static _CreateMouseEvent(e,t,i,s,n,o){const c=this._CreateEvent(o),h=n.pollInput(e,t,st.Horizontal),f=n.pollInput(e,t,st.Vertical);return o?(c.movementX=0,c.movementY=0,c.offsetX=c.movementX-o.getBoundingClientRect().x,c.offsetY=c.movementY-o.getBoundingClientRect().y):(c.movementX=n.pollInput(e,t,10),c.movementY=n.pollInput(e,t,11),c.offsetX=0,c.offsetY=0),this._CheckNonCharacterKeys(c,n),c.clientX=h,c.clientY=f,c.x=h,c.y=f,c.deviceType=e,c.deviceSlot=t,c.inputIndex=i,c}static _CreateKeyboardEvent(e,t,i,s){const n=this._CreateEvent(s);return this._CheckNonCharacterKeys(n,i),n.deviceType=qe.Keyboard,n.deviceSlot=0,n.inputIndex=e,n.type=t===1?"keydown":"keyup",n.key=String.fromCharCode(e),n.keyCode=e,n}static _CheckNonCharacterKeys(e,t){const i=t.isDeviceAvailable(qe.Keyboard),s=i&&t.pollInput(qe.Keyboard,0,18)===1,n=i&&t.pollInput(qe.Keyboard,0,17)===1,o=i&&(t.pollInput(qe.Keyboard,0,91)===1||t.pollInput(qe.Keyboard,0,92)===1||t.pollInput(qe.Keyboard,0,93)===1),c=i&&t.pollInput(qe.Keyboard,0,16)===1;e.altKey=s,e.ctrlKey=n,e.metaKey=o,e.shiftKey=c}static _CreateEvent(e){const t={};return t.preventDefault=()=>{},t.target=e,t}}class eF{constructor(e,t,i){this._nativeInput=_native.DeviceInputSystem?new _native.DeviceInputSystem(e,t,(s,n,o,c)=>{const h=no.CreateDeviceEvent(s,n,o,c,this);i(s,n,h)}):this._createDummyNativeInput()}pollInput(e,t,i){return this._nativeInput.pollInput(e,t,i)}isDeviceAvailable(e){return e===qe.Mouse||e===qe.Touch}dispose(){this._nativeInput.dispose()}_createDummyNativeInput(){return{pollInput:()=>0,isDeviceAvailable:()=>!1,dispose:()=>{}}}}const Y0=255,j0=Object.keys(st).length/2;class tF{constructor(e,t,i,s){this._inputs=[],this._keyboardActive=!1,this._pointerActive=!1,this._usingSafari=Rt.IsSafari(),this._usingMacOs=_l()&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),this._keyboardDownEvent=n=>{},this._keyboardUpEvent=n=>{},this._keyboardBlurEvent=n=>{},this._pointerMoveEvent=n=>{},this._pointerDownEvent=n=>{},this._pointerUpEvent=n=>{},this._pointerCancelEvent=n=>{},this._pointerCancelTouch=n=>{},this._pointerLeaveEvent=n=>{},this._pointerWheelEvent=n=>{},this._pointerBlurEvent=n=>{},this._pointerMacOsChromeOutEvent=n=>{},this._eventsAttached=!1,this._mouseId=-1,this._isUsingFirefox=_l()&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,this._isUsingChromium=_l()&&navigator.userAgent&&navigator.userAgent.indexOf("Chrome")!==-1,this._maxTouchPoints=0,this._pointerInputClearObserver=null,this._gamepadConnectedEvent=n=>{},this._gamepadDisconnectedEvent=n=>{},this._eventPrefix=Rt.GetPointerPrefix(e),this._engine=e,this._onDeviceConnected=t,this._onDeviceDisconnected=i,this._onInputChanged=s,this._mouseId=this._isUsingFirefox?0:1,this._enableEvents(),this._usingMacOs&&(this._metaKeys=[]),this._engine._onEngineViewChanged||(this._engine._onEngineViewChanged=()=>{this._enableEvents()})}pollInput(e,t,i){const s=this._inputs[e][t];if(!s)throw`Unable to find device ${qe[e]}`;e>=qe.DualShock&&e<=qe.DualSense&&this._updateDevice(e,t,i);const n=s[i];if(n===void 0)throw`Unable to find input ${i} for device ${qe[e]} in slot ${t}`;return i===st.Move&&Rt.Warn("Unable to provide information for PointerInput.Move.  Try using PointerInput.Horizontal or PointerInput.Vertical for move data."),n}isDeviceAvailable(e){return this._inputs[e]!==void 0}dispose(){this._onDeviceConnected=()=>{},this._onDeviceDisconnected=()=>{},this._onInputChanged=()=>{},delete this._engine._onEngineViewChanged,this._elementToAttachTo&&this._disableEvents()}_enableEvents(){const e=this?._engine.getInputElement();if(e&&(!this._eventsAttached||this._elementToAttachTo!==e)){if(this._disableEvents(),this._inputs){for(const t of this._inputs)if(t)for(const i in t){const s=+i,n=t[s];if(n)for(let o=0;o<n.length;o++)n[o]=0}}this._elementToAttachTo=e,this._elementToAttachTo.tabIndex=this._elementToAttachTo.tabIndex!==-1?this._elementToAttachTo.tabIndex:this._engine.canvasTabIndex,this._handleKeyActions(),this._handlePointerActions(),this._handleGamepadActions(),this._eventsAttached=!0,this._checkForConnectedDevices()}}_disableEvents(){this._elementToAttachTo&&(this._elementToAttachTo.removeEventListener("blur",this._keyboardBlurEvent),this._elementToAttachTo.removeEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.removeEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.removeEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.removeEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.removeEventListener(this._wheelEventName,this._pointerWheelEvent),this._usingMacOs&&this._isUsingChromium&&this._elementToAttachTo.removeEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent),window.removeEventListener("gamepadconnected",this._gamepadConnectedEvent),window.removeEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)),this._pointerInputClearObserver&&this._engine.onEndFrameObservable.remove(this._pointerInputClearObserver),this._eventsAttached=!1}_checkForConnectedDevices(){if(navigator.getGamepads){const e=navigator.getGamepads();for(const t of e)t&&this._addGamePad(t)}typeof matchMedia=="function"&&matchMedia("(pointer:fine)").matches&&this._addPointerDevice(qe.Mouse,0,0,0)}_addGamePad(e){const t=this._getGamepadDeviceType(e.id),i=e.index;this._gamepads=this._gamepads||new Array(e.index+1),this._registerDevice(t,i,e.buttons.length+e.axes.length),this._gamepads[i]=t}_addPointerDevice(e,t,i,s){this._pointerActive||(this._pointerActive=!0),this._registerDevice(e,t,j0);const n=this._inputs[e][t];n[0]=i,n[1]=s}_registerDevice(e,t,i){if(t===void 0)throw`Unable to register device ${qe[e]} to undefined slot.`;if(this._inputs[e]||(this._inputs[e]={}),!this._inputs[e][t]){const s=new Array(i);s.fill(0),this._inputs[e][t]=s,this._onDeviceConnected(e,t)}}_unregisterDevice(e,t){this._inputs[e][t]&&(delete this._inputs[e][t],this._onDeviceDisconnected(e,t))}_handleKeyActions(){this._keyboardDownEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(qe.Keyboard,0,Y0));const t=this._inputs[qe.Keyboard][0];if(t){t[e.keyCode]=1;const i=e;i.inputIndex=e.keyCode,this._usingMacOs&&e.metaKey&&e.key!=="Meta"&&(this._metaKeys.includes(e.keyCode)||this._metaKeys.push(e.keyCode)),this._onInputChanged(qe.Keyboard,0,i)}},this._keyboardUpEvent=e=>{this._keyboardActive||(this._keyboardActive=!0,this._registerDevice(qe.Keyboard,0,Y0));const t=this._inputs[qe.Keyboard][0];if(t){t[e.keyCode]=0;const i=e;if(i.inputIndex=e.keyCode,this._usingMacOs&&e.key==="Meta"&&this._metaKeys.length>0){for(const s of this._metaKeys){const n=no.CreateDeviceEvent(qe.Keyboard,0,s,0,this,this._elementToAttachTo);t[s]=0,this._onInputChanged(qe.Keyboard,0,n)}this._metaKeys.splice(0,this._metaKeys.length)}this._onInputChanged(qe.Keyboard,0,i)}},this._keyboardBlurEvent=()=>{if(this._keyboardActive){const e=this._inputs[qe.Keyboard][0];for(let t=0;t<e.length;t++)if(e[t]!==0){e[t]=0;const i=no.CreateDeviceEvent(qe.Keyboard,0,t,0,this,this._elementToAttachTo);this._onInputChanged(qe.Keyboard,0,i)}this._usingMacOs&&this._metaKeys.splice(0,this._metaKeys.length)}},this._elementToAttachTo.addEventListener("keydown",this._keyboardDownEvent),this._elementToAttachTo.addEventListener("keyup",this._keyboardUpEvent),this._elementToAttachTo.addEventListener("blur",this._keyboardBlurEvent)}_handlePointerActions(){this._maxTouchPoints=_l()&&navigator.maxTouchPoints||2,this._activeTouchIds||(this._activeTouchIds=new Array(this._maxTouchPoints));for(let i=0;i<this._maxTouchPoints;i++)this._activeTouchIds[i]=-1;this._pointerMoveEvent=i=>{const s=this._getPointerType(i);let n=s===qe.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===qe.Touch&&n===-1){if(i.buttons===0)return;const c=this._activeTouchIds.indexOf(-1);if(c>=0)n=c,this._activeTouchIds[c]=i.pointerId,this._onDeviceConnected(s,n);else{Rt.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][n]||this._addPointerDevice(s,n,i.clientX,i.clientY);const o=this._inputs[s][n];if(o){const c=i;c.inputIndex=st.Move,o[st.Horizontal]=i.clientX,o[st.Vertical]=i.clientY,s===qe.Touch&&o[st.LeftClick]===0&&(o[st.LeftClick]=1),i.pointerId===void 0&&(i.pointerId=this._mouseId),this._onInputChanged(s,n,c),!this._usingSafari&&i.button!==-1&&(c.inputIndex=i.button+2,o[i.button+2]=o[i.button+2]?0:1,this._onInputChanged(s,n,c))}},this._pointerDownEvent=i=>{const s=this._getPointerType(i);let n=s===qe.Mouse?0:i.pointerId;if(s===qe.Touch){let c=this._activeTouchIds.indexOf(i.pointerId);if(c===-1&&(c=this._activeTouchIds.indexOf(-1)),c>=0)n=c,this._activeTouchIds[c]=i.pointerId;else{Rt.Warn(`Max number of touches exceeded.  Ignoring touches in excess of ${this._maxTouchPoints}`);return}}this._inputs[s]||(this._inputs[s]={}),this._inputs[s][n]?s===qe.Touch&&this._onDeviceConnected(s,n):this._addPointerDevice(s,n,i.clientX,i.clientY);const o=this._inputs[s][n];if(o){const c=o[st.Horizontal],h=o[st.Vertical];if(s===qe.Mouse){if(i.pointerId===void 0&&(i.pointerId=this._mouseId),!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(this._mouseId)}catch{}}else if(i.pointerId&&!document.pointerLockElement)try{this._elementToAttachTo.setPointerCapture(i.pointerId)}catch{}o[st.Horizontal]=i.clientX,o[st.Vertical]=i.clientY,o[i.button+2]=1;const f=i;f.inputIndex=i.button+2,this._onInputChanged(s,n,f),(c!==i.clientX||h!==i.clientY)&&(f.inputIndex=st.Move,this._onInputChanged(s,n,f))}},this._pointerUpEvent=i=>{const s=this._getPointerType(i),n=s===qe.Mouse?0:this._activeTouchIds.indexOf(i.pointerId);if(s===qe.Touch){if(n===-1)return;this._activeTouchIds[n]=-1}const o=this._inputs[s]?.[n];let c=i.button,h=o&&o[c+2]!==0;if(!h&&this._isUsingFirefox&&this._usingMacOs&&o&&(c=c===2?0:2,h=o[c+2]!==0),h){const f=o[st.Horizontal],_=o[st.Vertical];o[st.Horizontal]=i.clientX,o[st.Vertical]=i.clientY,o[c+2]=0;const d=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),(f!==i.clientX||_!==i.clientY)&&(d.inputIndex=st.Move,this._onInputChanged(s,n,d)),d.inputIndex=c+2,s===qe.Mouse&&this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)?this._elementToAttachTo.releasePointerCapture(this._mouseId):i.pointerId&&this._elementToAttachTo.hasPointerCapture?.(i.pointerId)&&this._elementToAttachTo.releasePointerCapture(i.pointerId),this._onInputChanged(s,n,d),s===qe.Touch&&this._onDeviceDisconnected(s,n)}},this._pointerCancelTouch=i=>{const s=this._activeTouchIds.indexOf(i);if(s===-1)return;this._elementToAttachTo.hasPointerCapture?.(i)&&this._elementToAttachTo.releasePointerCapture(i),this._inputs[qe.Touch][s][st.LeftClick]=0;const n=no.CreateDeviceEvent(qe.Touch,s,st.LeftClick,0,this,this._elementToAttachTo,i);this._onInputChanged(qe.Touch,s,n),this._activeTouchIds[s]=-1,this._onDeviceDisconnected(qe.Touch,s)},this._pointerCancelEvent=i=>{if(i.pointerType==="mouse"){const s=this._inputs[qe.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let n=st.LeftClick;n<=st.BrowserForward;n++)if(s[n]===1){s[n]=0;const o=no.CreateDeviceEvent(qe.Mouse,0,n,0,this,this._elementToAttachTo);this._onInputChanged(qe.Mouse,0,o)}}else this._pointerCancelTouch(i.pointerId)},this._pointerLeaveEvent=i=>{i.pointerType==="pen"&&this._pointerCancelTouch(i.pointerId)},this._wheelEventName="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=!1;const t=function(){};try{const i=Object.defineProperty({},"passive",{get:function(){e=!0}});this._elementToAttachTo.addEventListener("test",t,i),this._elementToAttachTo.removeEventListener("test",t,i)}catch{}this._pointerBlurEvent=()=>{if(this.isDeviceAvailable(qe.Mouse)){const i=this._inputs[qe.Mouse][0];this._mouseId>=0&&this._elementToAttachTo.hasPointerCapture?.(this._mouseId)&&this._elementToAttachTo.releasePointerCapture(this._mouseId);for(let s=st.LeftClick;s<=st.BrowserForward;s++)if(i[s]===1){i[s]=0;const n=no.CreateDeviceEvent(qe.Mouse,0,s,0,this,this._elementToAttachTo);this._onInputChanged(qe.Mouse,0,n)}}if(this.isDeviceAvailable(qe.Touch)){const i=this._inputs[qe.Touch];for(let s=0;s<this._activeTouchIds.length;s++){const n=this._activeTouchIds[s];if(this._elementToAttachTo.hasPointerCapture?.(n)&&this._elementToAttachTo.releasePointerCapture(n),n!==-1&&i[s]?.[st.LeftClick]===1){i[s][st.LeftClick]=0;const o=no.CreateDeviceEvent(qe.Touch,s,st.LeftClick,0,this,this._elementToAttachTo,n);this._onInputChanged(qe.Touch,s,o),this._activeTouchIds[s]=-1,this._onDeviceDisconnected(qe.Touch,s)}}}},this._pointerWheelEvent=i=>{const s=qe.Mouse,n=0;this._inputs[s]||(this._inputs[s]=[]),this._inputs[s][n]||(this._pointerActive=!0,this._registerDevice(s,n,j0));const o=this._inputs[s][n];if(o){o[st.MouseWheelX]=i.deltaX||0,o[st.MouseWheelY]=i.deltaY||i.wheelDelta||0,o[st.MouseWheelZ]=i.deltaZ||0;const c=i;i.pointerId===void 0&&(i.pointerId=this._mouseId),o[st.MouseWheelX]!==0&&(c.inputIndex=st.MouseWheelX,this._onInputChanged(s,n,c)),o[st.MouseWheelY]!==0&&(c.inputIndex=st.MouseWheelY,this._onInputChanged(s,n,c)),o[st.MouseWheelZ]!==0&&(c.inputIndex=st.MouseWheelZ,this._onInputChanged(s,n,c))}},this._usingMacOs&&this._isUsingChromium&&(this._pointerMacOsChromeOutEvent=i=>{i.buttons>1&&this._pointerCancelEvent(i)},this._elementToAttachTo.addEventListener("lostpointercapture",this._pointerMacOsChromeOutEvent)),this._elementToAttachTo.addEventListener(this._eventPrefix+"move",this._pointerMoveEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"down",this._pointerDownEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"up",this._pointerUpEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"cancel",this._pointerCancelEvent),this._elementToAttachTo.addEventListener(this._eventPrefix+"leave",this._pointerLeaveEvent),this._elementToAttachTo.addEventListener("blur",this._pointerBlurEvent),this._elementToAttachTo.addEventListener(this._wheelEventName,this._pointerWheelEvent,e?{passive:!1}:!1),this._pointerInputClearObserver=this._engine.onEndFrameObservable.add(()=>{if(this.isDeviceAvailable(qe.Mouse)){const i=this._inputs[qe.Mouse][0];i[st.MouseWheelX]=0,i[st.MouseWheelY]=0,i[st.MouseWheelZ]=0}})}_handleGamepadActions(){this._gamepadConnectedEvent=e=>{this._addGamePad(e.gamepad)},this._gamepadDisconnectedEvent=e=>{if(this._gamepads){const t=this._getGamepadDeviceType(e.gamepad.id),i=e.gamepad.index;this._unregisterDevice(t,i),delete this._gamepads[i]}},window.addEventListener("gamepadconnected",this._gamepadConnectedEvent),window.addEventListener("gamepaddisconnected",this._gamepadDisconnectedEvent)}_updateDevice(e,t,i){const s=navigator.getGamepads()[t];if(s&&e===this._gamepads[t]){const n=this._inputs[e][t];i>=s.buttons.length?n[i]=s.axes[i-s.buttons.length].valueOf():n[i]=s.buttons[i].value}}_getGamepadDeviceType(e){return e.indexOf("054c")!==-1?e.indexOf("0ce6")!==-1?qe.DualSense:qe.DualShock:e.indexOf("Xbox One")!==-1||e.search("Xbox 360")!==-1||e.search("xinput")!==-1||e.indexOf("045e")!==-1&&e.indexOf("Surface Dock")===-1?qe.Xbox:e.indexOf("057e")!==-1?qe.Switch:qe.Generic}_getPointerType(e){let t=qe.Mouse;return(e.pointerType==="touch"||e.pointerType==="pen"||e.touches)&&(t=qe.Touch),t}}class q0{constructor(e,t,i=0){this.deviceType=t,this.deviceSlot=i,this.onInputChangedObservable=new Oe,this._deviceInputSystem=e}getInput(e){return this._deviceInputSystem.pollInput(this.deviceType,this.deviceSlot,e)}}class iF{constructor(e){this._registeredManagers=new Array,this._refCount=0,this.registerManager=o=>{for(let c=0;c<this._devices.length;c++){const h=this._devices[c];for(const f in h){const _=+f;o._addDevice(new q0(this._deviceInputSystem,c,_))}}this._registeredManagers.push(o)},this.unregisterManager=o=>{const c=this._registeredManagers.indexOf(o);c>-1&&this._registeredManagers.splice(c,1)};const t=Object.keys(qe).length/2;this._devices=new Array(t);const i=(o,c)=>{this._devices[o]||(this._devices[o]=new Array),this._devices[o][c]||(this._devices[o][c]=c);for(const h of this._registeredManagers){const f=new q0(this._deviceInputSystem,o,c);h._addDevice(f)}},s=(o,c)=>{this._devices[o]?.[c]&&delete this._devices[o][c];for(const h of this._registeredManagers)h._removeDevice(o,c)},n=(o,c,h)=>{if(h)for(const f of this._registeredManagers)f._onInputChanged(o,c,h)};typeof _native<"u"?this._deviceInputSystem=new eF(i,s,n):this._deviceInputSystem=new tF(e,i,s,n)}dispose(){this._deviceInputSystem.dispose()}}class sF{getDeviceSource(e,t){if(t===void 0){if(this._firstDevice[e]===void 0)return null;t=this._firstDevice[e]}return!this._devices[e]||this._devices[e][t]===void 0?null:this._devices[e][t]}getDeviceSources(e){return this._devices[e]?this._devices[e].filter(t=>!!t):[]}constructor(e){const t=Object.keys(qe).length/2;this._devices=new Array(t),this._firstDevice=new Array(t),this._engine=e,this._engine._deviceSourceManager||(this._engine._deviceSourceManager=new iF(e)),this._engine._deviceSourceManager._refCount++,this.onDeviceConnectedObservable=new Oe(i=>{for(const s of this._devices)if(s)for(const n of s)n&&this.onDeviceConnectedObservable.notifyObserver(i,n)}),this.onDeviceDisconnectedObservable=new Oe,this._engine._deviceSourceManager.registerManager(this),this._onDisposeObserver=e.onDisposeObservable.add(()=>{this.dispose()})}dispose(){this.onDeviceConnectedObservable.clear(),this.onDeviceDisconnectedObservable.clear(),this._engine._deviceSourceManager&&(this._engine._deviceSourceManager.unregisterManager(this),--this._engine._deviceSourceManager._refCount<1&&(this._engine._deviceSourceManager.dispose(),delete this._engine._deviceSourceManager)),this._engine.onDisposeObservable.remove(this._onDisposeObserver)}_addDevice(e){this._devices[e.deviceType]||(this._devices[e.deviceType]=[]),this._devices[e.deviceType][e.deviceSlot]||(this._devices[e.deviceType][e.deviceSlot]=e,this._updateFirstDevices(e.deviceType)),this.onDeviceConnectedObservable.notifyObservers(e)}_removeDevice(e,t){const i=this._devices[e]?.[t];this.onDeviceDisconnectedObservable.notifyObservers(i),this._devices[e]?.[t]&&delete this._devices[e][t],this._updateFirstDevices(e)}_onInputChanged(e,t,i){this._devices[e]?.[t]?.onInputChangedObservable.notifyObservers(i)}_updateFirstDevices(e){switch(e){case qe.Keyboard:case qe.Mouse:this._firstDevice[e]=0;break;case qe.Touch:case qe.DualSense:case qe.DualShock:case qe.Xbox:case qe.Switch:case qe.Generic:{delete this._firstDevice[e];const t=this._devices[e];if(t){for(let i=0;i<t.length;i++)if(t[i]){this._firstDevice[e]=i;break}}break}}}}class NA{}NA._IsPickingAvailable=!1;class K0{constructor(){this._singleClick=!1,this._doubleClick=!1,this._hasSwiped=!1,this._ignore=!1}get singleClick(){return this._singleClick}get doubleClick(){return this._doubleClick}get hasSwiped(){return this._hasSwiped}get ignore(){return this._ignore}set singleClick(e){this._singleClick=e}set doubleClick(e){this._doubleClick=e}set hasSwiped(e){this._hasSwiped=e}set ignore(e){this._ignore=e}}class Mi{constructor(e){this._alreadyAttached=!1,this._meshPickProceed=!1,this._currentPickResult=null,this._previousPickResult=null,this._activePointerIds=new Array,this._activePointerIdsCount=0,this._doubleClickOccured=!1,this._isSwiping=!1,this._swipeButtonPressed=-1,this._skipPointerTap=!1,this._isMultiTouchGesture=!1,this._pointerX=0,this._pointerY=0,this._startingPointerPosition=new He(0,0),this._previousStartingPointerPosition=new He(0,0),this._startingPointerTime=0,this._previousStartingPointerTime=0,this._pointerCaptures={},this._meshUnderPointerId={},this._movePointerInfo=null,this._cameraObserverCount=0,this._delayedClicks=[null,null,null,null,null],this._deviceSourceManager=null,this._scene=e||vt.LastCreatedScene,this._scene}get meshUnderPointer(){return this._movePointerInfo&&(this._movePointerInfo._generatePickInfo(),this._movePointerInfo=null),this._pointerOverMesh}getMeshUnderPointerByPointerId(e){return this._meshUnderPointerId[e]||null}get unTranslatedPointer(){return new He(this._unTranslatedPointerX,this._unTranslatedPointerY)}get pointerX(){return this._pointerX}set pointerX(e){this._pointerX=e}get pointerY(){return this._pointerY}set pointerY(e){this._pointerY=e}_updatePointerPosition(e){const t=this._scene.getEngine().getInputElementClientRect();t&&(this._pointerX=e.clientX-t.left,this._pointerY=e.clientY-t.top,this._unTranslatedPointerX=this._pointerX,this._unTranslatedPointerY=this._pointerY)}_processPointerMove(e,t){const i=this._scene,s=i.getEngine(),n=s.getInputElement();n&&(n.tabIndex=s.canvasTabIndex,i.doNotHandleCursors||(n.style.cursor=i.defaultCursor)),this._setCursorAndPointerOverMesh(e,t,i);for(const h of i._pointerMoveStage){e=e||this._pickMove(t);const f=!!e?.pickedMesh;e=h.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,f,n)}const o=t.inputIndex>=st.MouseWheelX&&t.inputIndex<=st.MouseWheelZ?mt.POINTERWHEEL:mt.POINTERMOVE;i.onPointerMove&&(e=e||this._pickMove(t),i.onPointerMove(t,e,o));let c;e?(c=new Or(o,t,e),this._setRayOnPointerInfo(e,t)):(c=new Or(o,t,null,this),this._movePointerInfo=c),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(c,o)}_setRayOnPointerInfo(e,t){const i=this._scene;e&&NA._IsPickingAvailable&&(e.ray||(e.ray=i.createPickingRay(t.offsetX,t.offsetY,ae.Identity(),i.activeCamera)))}_addCameraPointerObserver(e,t){return this._cameraObserverCount++,this._scene.onPointerObservable.add(e,t)}_removeCameraPointerObserver(e){return this._cameraObserverCount--,this._scene.onPointerObservable.remove(e)}_checkForPicking(){return!!(this._scene.onPointerObservable.observers.length>this._cameraObserverCount||this._scene.onPointerPick)}_checkPrePointerObservable(e,t,i){const s=this._scene,n=new Sw(i,t,this._unTranslatedPointerX,this._unTranslatedPointerY);return e&&(n.originalPickingInfo=e,n.ray=e.ray,t.pointerType==="xr-near"&&e.originMesh&&(n.nearInteractionPickingInfo=e)),s.onPrePointerObservable.notifyObservers(n,i),!!n.skipOnPointerObservable}_pickMove(e){const t=this._scene,i=t.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,t.pointerMovePredicate,t.pointerMoveFastCheck,t.cameraToUseForPointers,t.pointerMoveTrianglePredicate);return this._setCursorAndPointerOverMesh(i,e,t),i}_setCursorAndPointerOverMesh(e,t,i){const n=i.getEngine().getInputElement();if(e?.pickedMesh){if(this.setPointerOverMesh(e.pickedMesh,t.pointerId,e,t),!i.doNotHandleCursors&&n&&this._pointerOverMesh){const o=this._pointerOverMesh._getActionManagerForTrigger();o&&o.hasPointerTriggers&&(n.style.cursor=o.hoverCursor||i.hoverCursor)}}else this.setPointerOverMesh(null,t.pointerId,e,t)}simulatePointerMove(e,t){const i=new PointerEvent("pointermove",t);i.inputIndex=st.Move,!this._checkPrePointerObservable(e,i,mt.POINTERMOVE)&&this._processPointerMove(e,i)}simulatePointerDown(e,t){const i=new PointerEvent("pointerdown",t);i.inputIndex=i.button+2,!this._checkPrePointerObservable(e,i,mt.POINTERDOWN)&&this._processPointerDown(e,i)}_processPointerDown(e,t){const i=this._scene;if(e?.pickedMesh){this._pickedDownMesh=e.pickedMesh;const o=e.pickedMesh._getActionManagerForTrigger();if(o){if(o.hasPickTriggers)switch(o.processTrigger(5,new Qi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e)),t.button){case 0:o.processTrigger(2,new Qi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break;case 1:o.processTrigger(4,new Qi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break;case 2:o.processTrigger(3,new Qi(e.pickedMesh,i.pointerX,i.pointerY,e.pickedMesh,t,e));break}o.hasSpecificTrigger(8)&&window.setTimeout(()=>{const c=i.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,h=>h.isPickable&&h.isVisible&&h.isReady()&&h.actionManager&&h.actionManager.hasSpecificTrigger(8)&&h===this._pickedDownMesh,!1,i.cameraToUseForPointers);c?.pickedMesh&&o&&this._activePointerIdsCount!==0&&Date.now()-this._startingPointerTime>Mi.LongPressDelay&&!this._isPointerSwiping()&&(this._startingPointerTime=0,o.processTrigger(8,Qi.CreateNew(c.pickedMesh,t)))},Mi.LongPressDelay)}}else for(const o of i._pointerDownStage)e=o.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,!1);let s;const n=mt.POINTERDOWN;e?(i.onPointerDown&&i.onPointerDown(t,e,n),s=new Or(n,t,e),this._setRayOnPointerInfo(e,t)):s=new Or(n,t,null,this),i.onPointerObservable.hasObservers()&&i.onPointerObservable.notifyObservers(s,n)}_isPointerSwiping(){return this._isSwiping}simulatePointerUp(e,t,i){const s=new PointerEvent("pointerup",t);s.inputIndex=st.Move;const n=new K0;i?n.doubleClick=!0:n.singleClick=!0,!this._checkPrePointerObservable(e,s,mt.POINTERUP)&&this._processPointerUp(e,s,n)}_processPointerUp(e,t,i){const s=this._scene;if(e?.pickedMesh){if(this._pickedUpMesh=e.pickedMesh,this._pickedDownMesh===this._pickedUpMesh&&(s.onPointerPick&&s.onPointerPick(t,e),i.singleClick&&!i.ignore&&s.onPointerObservable.observers.length>this._cameraObserverCount)){const o=mt.POINTERPICK,c=new Or(o,t,e);this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(c,o)}const n=e.pickedMesh._getActionManagerForTrigger();if(n&&!i.ignore){n.processTrigger(7,Qi.CreateNew(e.pickedMesh,t,e)),!i.hasSwiped&&i.singleClick&&n.processTrigger(1,Qi.CreateNew(e.pickedMesh,t,e));const o=e.pickedMesh._getActionManagerForTrigger(6);i.doubleClick&&o&&o.processTrigger(6,Qi.CreateNew(e.pickedMesh,t,e))}}else if(!i.ignore)for(const n of s._pointerUpStage)e=n.action(this._unTranslatedPointerX,this._unTranslatedPointerY,e,t,i.doubleClick);if(this._pickedDownMesh&&this._pickedDownMesh!==this._pickedUpMesh){const n=this._pickedDownMesh._getActionManagerForTrigger(16);n&&n.processTrigger(16,Qi.CreateNew(this._pickedDownMesh,t))}if(!i.ignore){const n=new Or(mt.POINTERUP,t,e);if(this._setRayOnPointerInfo(e,t),s.onPointerObservable.notifyObservers(n,mt.POINTERUP),s.onPointerUp&&s.onPointerUp(t,e,mt.POINTERUP),!i.hasSwiped&&!this._skipPointerTap&&!this._isMultiTouchGesture){let o=0;if(i.singleClick?o=mt.POINTERTAP:i.doubleClick&&(o=mt.POINTERDOUBLETAP),o){const c=new Or(o,t,e);s.onPointerObservable.hasObservers()&&s.onPointerObservable.hasSpecificMask(o)&&s.onPointerObservable.notifyObservers(c,o)}}}}isPointerCaptured(e=0){return this._pointerCaptures[e]}attachControl(e=!0,t=!0,i=!0,s=null){const n=this._scene,o=n.getEngine();s||(s=o.getInputElement()),this._alreadyAttached&&this.detachControl(),s&&(this._alreadyAttachedTo=s),this._deviceSourceManager=new sF(o),this._initActionManager=c=>{if(!this._meshPickProceed){const h=n.skipPointerUpPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerUp?null:n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerUpPredicate,n.pointerUpFastCheck,n.cameraToUseForPointers,n.pointerUpTrianglePredicate);this._currentPickResult=h,h&&(c=h.hit&&h.pickedMesh?h.pickedMesh._getActionManagerForTrigger():null),this._meshPickProceed=!0}return c},this._delayedSimpleClick=(c,h,f)=>{if((Date.now()-this._previousStartingPointerTime>Mi.DoubleClickDelay&&!this._doubleClickOccured||c!==this._previousButtonPressed)&&(this._doubleClickOccured=!1,h.singleClick=!0,h.ignore=!1,this._delayedClicks[c])){const _=this._delayedClicks[c].evt,d=mt.POINTERTAP,g=new Or(d,_,this._currentPickResult);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(d)&&n.onPointerObservable.notifyObservers(g,d),this._delayedClicks[c]=null}},this._initClickEvent=(c,h,f,_)=>{const d=new K0;this._currentPickResult=null;let g=null,p=c.hasSpecificMask(mt.POINTERPICK)||h.hasSpecificMask(mt.POINTERPICK)||c.hasSpecificMask(mt.POINTERTAP)||h.hasSpecificMask(mt.POINTERTAP)||c.hasSpecificMask(mt.POINTERDOUBLETAP)||h.hasSpecificMask(mt.POINTERDOUBLETAP);!p&&Js&&(g=this._initActionManager(g,d),g&&(p=g.hasPickTriggers));let b=!1;if(p=p&&!this._isMultiTouchGesture,p){const x=f.button;if(d.hasSwiped=this._isPointerSwiping(),!d.hasSwiped){let E=!Mi.ExclusiveDoubleClickMode;if(E||(E=!c.hasSpecificMask(mt.POINTERDOUBLETAP)&&!h.hasSpecificMask(mt.POINTERDOUBLETAP),E&&!Js.HasSpecificTrigger(6)&&(g=this._initActionManager(g,d),g&&(E=!g.hasSpecificTrigger(6)))),E)(Date.now()-this._previousStartingPointerTime>Mi.DoubleClickDelay||x!==this._previousButtonPressed)&&(d.singleClick=!0,_(d,this._currentPickResult),b=!0);else{const S={evt:f,clickInfo:d,timeoutId:window.setTimeout(this._delayedSimpleClick.bind(this,x,d,_),Mi.DoubleClickDelay)};this._delayedClicks[x]=S}let v=c.hasSpecificMask(mt.POINTERDOUBLETAP)||h.hasSpecificMask(mt.POINTERDOUBLETAP);!v&&Js.HasSpecificTrigger(6)&&(g=this._initActionManager(g,d),g&&(v=g.hasSpecificTrigger(6))),v&&(x===this._previousButtonPressed&&Date.now()-this._previousStartingPointerTime<Mi.DoubleClickDelay&&!this._doubleClickOccured?(!d.hasSwiped&&!this._isPointerSwiping()?(this._previousStartingPointerTime=0,this._doubleClickOccured=!0,d.doubleClick=!0,d.ignore=!1,Mi.ExclusiveDoubleClickMode&&this._delayedClicks[x]&&(clearTimeout(this._delayedClicks[x]?.timeoutId),this._delayedClicks[x]=null),_(d,this._currentPickResult)):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=x,Mi.ExclusiveDoubleClickMode?(this._delayedClicks[x]&&(clearTimeout(this._delayedClicks[x]?.timeoutId),this._delayedClicks[x]=null),_(d,this._previousPickResult)):_(d,this._currentPickResult)),b=!0):(this._doubleClickOccured=!1,this._previousStartingPointerTime=this._startingPointerTime,this._previousStartingPointerPosition.x=this._startingPointerPosition.x,this._previousStartingPointerPosition.y=this._startingPointerPosition.y,this._previousButtonPressed=x))}}b||_(d,this._currentPickResult)},this._onPointerMove=c=>{if(this._updatePointerPosition(c),!this._isSwiping&&this._swipeButtonPressed!==-1&&(this._isSwiping=Math.abs(this._startingPointerPosition.x-this._pointerX)>Mi.DragMovementThreshold||Math.abs(this._startingPointerPosition.y-this._pointerY)>Mi.DragMovementThreshold),o.isPointerLock&&o._verifyPointerLock(),this._checkPrePointerObservable(null,c,c.inputIndex>=st.MouseWheelX&&c.inputIndex<=st.MouseWheelZ?mt.POINTERWHEEL:mt.POINTERMOVE)||!n.cameraToUseForPointers&&!n.activeCamera)return;if(n.skipPointerMovePicking){this._processPointerMove(new uh,c);return}n.pointerMovePredicate||(n.pointerMovePredicate=f=>f.isPickable&&f.isVisible&&f.isReady()&&f.isEnabled()&&(f.enablePointerMoveEvents||n.constantlyUpdateMeshUnderPointer||f._getActionManagerForTrigger()!==null)&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&f.layerMask)!==0));const h=n._registeredActions>0||n.constantlyUpdateMeshUnderPointer?this._pickMove(c):null;this._processPointerMove(h,c)},this._onPointerDown=c=>{const h=this._activePointerIds.indexOf(-1);if(h===-1?this._activePointerIds.push(c.pointerId):this._activePointerIds[h]=c.pointerId,this._activePointerIdsCount++,this._pickedDownMesh=null,this._meshPickProceed=!1,Mi.ExclusiveDoubleClickMode){for(let _=0;_<this._delayedClicks.length;_++)if(this._delayedClicks[_])if(c.button===_)clearTimeout(this._delayedClicks[_]?.timeoutId);else{const d=this._delayedClicks[_].clickInfo;this._doubleClickOccured=!1,d.singleClick=!0,d.ignore=!1;const g=this._delayedClicks[_].evt,p=mt.POINTERTAP,b=new Or(p,g,this._currentPickResult);n.onPointerObservable.hasObservers()&&n.onPointerObservable.hasSpecificMask(p)&&n.onPointerObservable.notifyObservers(b,p),this._delayedClicks[_]=null}}if(this._updatePointerPosition(c),this._swipeButtonPressed===-1&&(this._swipeButtonPressed=c.button),n.preventDefaultOnPointerDown&&s&&(c.preventDefault(),s.focus()),this._startingPointerPosition.x=this._pointerX,this._startingPointerPosition.y=this._pointerY,this._startingPointerTime=Date.now(),this._checkPrePointerObservable(null,c,mt.POINTERDOWN)||!n.cameraToUseForPointers&&!n.activeCamera)return;this._pointerCaptures[c.pointerId]=!0,n.pointerDownPredicate||(n.pointerDownPredicate=_=>_.isPickable&&_.isVisible&&_.isReady()&&_.isEnabled()&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&_.layerMask)!==0)),this._pickedDownMesh=null;let f;n.skipPointerDownPicking||n._registeredActions===0&&!this._checkForPicking()&&!n.onPointerDown?f=new uh:f=n.pick(this._unTranslatedPointerX,this._unTranslatedPointerY,n.pointerDownPredicate,n.pointerDownFastCheck,n.cameraToUseForPointers,n.pointerDownTrianglePredicate),this._processPointerDown(f,c)},this._onPointerUp=c=>{const h=this._activePointerIds.indexOf(c.pointerId);h!==-1&&(this._activePointerIds[h]=-1,this._activePointerIdsCount--,this._pickedUpMesh=null,this._meshPickProceed=!1,this._updatePointerPosition(c),n.preventDefaultOnPointerUp&&s&&(c.preventDefault(),s.focus()),this._initClickEvent(n.onPrePointerObservable,n.onPointerObservable,c,(f,_)=>{if(n.onPrePointerObservable.hasObservers()&&(this._skipPointerTap=!1,!f.ignore)){if(this._checkPrePointerObservable(null,c,mt.POINTERUP)){this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1),c.buttons===0&&(this._pointerCaptures[c.pointerId]=!1);return}f.hasSwiped||(f.singleClick&&n.onPrePointerObservable.hasSpecificMask(mt.POINTERTAP)&&this._checkPrePointerObservable(null,c,mt.POINTERTAP)&&(this._skipPointerTap=!0),f.doubleClick&&n.onPrePointerObservable.hasSpecificMask(mt.POINTERDOUBLETAP)&&this._checkPrePointerObservable(null,c,mt.POINTERDOUBLETAP)&&(this._skipPointerTap=!0))}if(!this._pointerCaptures[c.pointerId]){this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1);return}c.buttons===0&&(this._pointerCaptures[c.pointerId]=!1),!(!n.cameraToUseForPointers&&!n.activeCamera)&&(n.pointerUpPredicate||(n.pointerUpPredicate=d=>d.isPickable&&d.isVisible&&d.isReady()&&d.isEnabled()&&(!n.cameraToUseForPointers||(n.cameraToUseForPointers.layerMask&d.layerMask)!==0)),!this._meshPickProceed&&(Js&&Js.HasTriggers||this._checkForPicking()||n.onPointerUp)&&this._initActionManager(null,f),_||(_=this._currentPickResult),this._processPointerUp(_,c,f),this._previousPickResult=this._currentPickResult,this._swipeButtonPressed===c.button&&(this._isSwiping=!1,this._swipeButtonPressed=-1))}))},this._onKeyDown=c=>{const h=gh.KEYDOWN;if(n.onPreKeyboardObservable.hasObservers()){const f=new D0(h,c);if(n.onPreKeyboardObservable.notifyObservers(f,h),f.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const f=new Ym(h,c);n.onKeyboardObservable.notifyObservers(f,h)}n.actionManager&&n.actionManager.processTrigger(14,Qi.CreateNewFromScene(n,c))},this._onKeyUp=c=>{const h=gh.KEYUP;if(n.onPreKeyboardObservable.hasObservers()){const f=new D0(h,c);if(n.onPreKeyboardObservable.notifyObservers(f,h),f.skipOnKeyboardObservable)return}if(n.onKeyboardObservable.hasObservers()){const f=new Ym(h,c);n.onKeyboardObservable.notifyObservers(f,h)}n.actionManager&&n.actionManager.processTrigger(15,Qi.CreateNewFromScene(n,c))},this._deviceSourceManager.onDeviceConnectedObservable.add(c=>{c.deviceType===qe.Mouse?c.onInputChangedObservable.add(h=>{this._originMouseEvent=h,h.inputIndex===st.LeftClick||h.inputIndex===st.MiddleClick||h.inputIndex===st.RightClick||h.inputIndex===st.BrowserBack||h.inputIndex===st.BrowserForward?t&&c.getInput(h.inputIndex)===1?this._onPointerDown(h):e&&c.getInput(h.inputIndex)===0&&this._onPointerUp(h):i&&(h.inputIndex===st.Move?this._onPointerMove(h):(h.inputIndex===st.MouseWheelX||h.inputIndex===st.MouseWheelY||h.inputIndex===st.MouseWheelZ)&&this._onPointerMove(h))}):c.deviceType===qe.Touch?c.onInputChangedObservable.add(h=>{h.inputIndex===st.LeftClick&&(t&&c.getInput(h.inputIndex)===1?(this._onPointerDown(h),this._activePointerIdsCount>1&&(this._isMultiTouchGesture=!0)):e&&c.getInput(h.inputIndex)===0&&(this._onPointerUp(h),this._activePointerIdsCount===0&&(this._isMultiTouchGesture=!1))),i&&h.inputIndex===st.Move&&this._onPointerMove(h)}):c.deviceType===qe.Keyboard&&c.onInputChangedObservable.add(h=>{h.type==="keydown"?this._onKeyDown(h):h.type==="keyup"&&this._onKeyUp(h)})}),this._alreadyAttached=!0}detachControl(){this._alreadyAttached&&(this._deviceSourceManager.dispose(),this._deviceSourceManager=null,this._alreadyAttachedTo&&!this._scene.doNotHandleCursors&&(this._alreadyAttachedTo.style.cursor=this._scene.defaultCursor),this._alreadyAttached=!1,this._alreadyAttachedTo=null)}setPointerOverMesh(e,t=0,i,s){if(this._meshUnderPointerId[t]===e&&(!e||!e._internalAbstractMeshDataInfo._pointerOverDisableMeshTesting))return;const n=this._meshUnderPointerId[t];let o;n&&(o=n._getActionManagerForTrigger(10),o&&o.processTrigger(10,new Qi(n,this._pointerX,this._pointerY,e,s,{pointerId:t}))),e?(this._meshUnderPointerId[t]=e,this._pointerOverMesh=e,o=e._getActionManagerForTrigger(9),o&&o.processTrigger(9,new Qi(e,this._pointerX,this._pointerY,e,s,{pointerId:t,pickResult:i}))):(delete this._meshUnderPointerId[t],this._pointerOverMesh=null),this._scene.onMeshUnderPointerUpdatedObservable.hasObservers()&&this._scene.onMeshUnderPointerUpdatedObservable.notifyObservers({mesh:e,pointerId:t})}getPointerOverMesh(){return this.meshUnderPointer}_invalidateMesh(e){this._pointerOverMesh===e&&(this._pointerOverMesh=null),this._pickedDownMesh===e&&(this._pickedDownMesh=null),this._pickedUpMesh===e&&(this._pickedUpMesh=null);for(const t in this._meshUnderPointerId)this._meshUnderPointerId[t]===e&&delete this._meshUnderPointerId[t]}}Mi.DragMovementThreshold=10;Mi.LongPressDelay=500;Mi.DoubleClickDelay=300;Mi.ExclusiveDoubleClickMode=!1;class UA{static get UniqueId(){const e=this._UniqueIdCounter;return this._UniqueIdCounter++,e}}UA._UniqueIdCounter=1;class nF{constructor(){this.pointerDownFastCheck=!1,this.pointerUpFastCheck=!1,this.pointerMoveFastCheck=!1,this.skipPointerMovePicking=!1,this.skipPointerDownPicking=!1,this.skipPointerUpPicking=!1}}var Z0,Q0,$0,J0,eT,tT,iT,sT,nT,rT,aT,oT,lT,cT,hT,uT,fT,dT,_T,mT,gT,pT,yT,bT,xT,TT,ET,vT,AT,RT,ST,MT,CT,IT,DT,PT,OT,wT,FT,LT,BT,NT,UT,kT,zT,VT,GT,HT,WT,XT,YT,jT,qT;const rF=new dt,aF=new dt;var KT;(function(r){r[r.BackwardCompatible=0]="BackwardCompatible",r[r.Intermediate=1]="Intermediate",r[r.Aggressive=2]="Aggressive"})(KT||(KT={}));class De{static DefaultMaterialFactory(e){throw at("StandardMaterial")}static CollisionCoordinatorFactory(){throw at("DefaultCollisionCoordinator")}get clearColor(){return this._clearColor}set clearColor(e){e!==this._clearColor&&(this._clearColor=e,this.onClearColorChangedObservable.notifyObservers(this._clearColor))}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}get performancePriority(){return this._performancePriority}set performancePriority(e){if(e!==this._performancePriority){switch(this._performancePriority=e,e){case 0:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!1,this.autoClear=!0;break;case 1:this.skipFrustumClipping=!1,this._renderingManager.maintainStateBetweenFrames=!1,this.skipPointerMovePicking=!0,this.autoClear=!1;break;case 2:this.skipFrustumClipping=!0,this._renderingManager.maintainStateBetweenFrames=!0,this.skipPointerMovePicking=!0,this.autoClear=!1;break}this.onScenePerformancePriorityChangedObservable.notifyObservers(e)}}set forceWireframe(e){this._forceWireframe!==e&&(this._forceWireframe=e,this.markAllMaterialsAsDirty(16))}get forceWireframe(){return this._forceWireframe}set skipFrustumClipping(e){this._skipFrustumClipping!==e&&(this._skipFrustumClipping=e)}get skipFrustumClipping(){return this._skipFrustumClipping}set forcePointsCloud(e){this._forcePointsCloud!==e&&(this._forcePointsCloud=e,this.markAllMaterialsAsDirty(16))}get forcePointsCloud(){return this._forcePointsCloud}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture!==e&&(this._environmentTexture=e,this.onEnvironmentTextureChangedObservable.notifyObservers(e),this.markAllMaterialsAsDirty(1))}getNodes(){let e=[];e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes);for(const t of this.skeletons)e=e.concat(t.bones);return e}get animationPropertiesOverride(){return this._animationPropertiesOverride}set animationPropertiesOverride(e){this._animationPropertiesOverride=e}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}set beforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),e&&(this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e))}set afterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),e&&(this._onAfterRenderObserver=this.onAfterRenderObservable.add(e))}set beforeCameraRender(e){this._onBeforeCameraRenderObserver&&this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver),this._onBeforeCameraRenderObserver=this.onBeforeCameraRenderObservable.add(e)}set afterCameraRender(e){this._onAfterCameraRenderObserver&&this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver),this._onAfterCameraRenderObserver=this.onAfterCameraRenderObservable.add(e)}get pointerDownPredicate(){return this._pointerPickingConfiguration.pointerDownPredicate}set pointerDownPredicate(e){this._pointerPickingConfiguration.pointerDownPredicate=e}get pointerUpPredicate(){return this._pointerPickingConfiguration.pointerUpPredicate}set pointerUpPredicate(e){this._pointerPickingConfiguration.pointerUpPredicate=e}get pointerMovePredicate(){return this._pointerPickingConfiguration.pointerMovePredicate}set pointerMovePredicate(e){this._pointerPickingConfiguration.pointerMovePredicate=e}get pointerDownFastCheck(){return this._pointerPickingConfiguration.pointerDownFastCheck}set pointerDownFastCheck(e){this._pointerPickingConfiguration.pointerDownFastCheck=e}get pointerUpFastCheck(){return this._pointerPickingConfiguration.pointerUpFastCheck}set pointerUpFastCheck(e){this._pointerPickingConfiguration.pointerUpFastCheck=e}get pointerMoveFastCheck(){return this._pointerPickingConfiguration.pointerMoveFastCheck}set pointerMoveFastCheck(e){this._pointerPickingConfiguration.pointerMoveFastCheck=e}get skipPointerMovePicking(){return this._pointerPickingConfiguration.skipPointerMovePicking}set skipPointerMovePicking(e){this._pointerPickingConfiguration.skipPointerMovePicking=e}get skipPointerDownPicking(){return this._pointerPickingConfiguration.skipPointerDownPicking}set skipPointerDownPicking(e){this._pointerPickingConfiguration.skipPointerDownPicking=e}get skipPointerUpPicking(){return this._pointerPickingConfiguration.skipPointerUpPicking}set skipPointerUpPicking(e){this._pointerPickingConfiguration.skipPointerUpPicking=e}get unTranslatedPointer(){return this._inputManager.unTranslatedPointer}static get DragMovementThreshold(){return Mi.DragMovementThreshold}static set DragMovementThreshold(e){Mi.DragMovementThreshold=e}static get LongPressDelay(){return Mi.LongPressDelay}static set LongPressDelay(e){Mi.LongPressDelay=e}static get DoubleClickDelay(){return Mi.DoubleClickDelay}static set DoubleClickDelay(e){Mi.DoubleClickDelay=e}static get ExclusiveDoubleClickMode(){return Mi.ExclusiveDoubleClickMode}static set ExclusiveDoubleClickMode(e){Mi.ExclusiveDoubleClickMode=e}get _eyePosition(){return this._forcedViewPosition??this.activeCamera?.globalPosition??I.ZeroReadOnly}bindEyePosition(e,t="vEyePosition",i=!1){const s=this._eyePosition,n=this.useRightHandedSystem===(this._mirroredCameraPosition!=null),o=this.floatingOriginOffset,c=rF.set(s.x,s.y,s.z,n?-1:1),h=c.subtractFromFloatsToRef(o.x,o.y,o.z,0,aF);return e&&(i?e.setFloat3(t,h.x,h.y,h.z):e.setVector4(t,h)),c}finalizeSceneUbo(){const e=this.getSceneUniformBuffer(),t=this.bindEyePosition(null),i=this.floatingOriginOffset;return e.updateFloat4("vEyePosition",t.x-i.x,t.y-i.y,t.z-i.z,t.w),e.update(),e}set useRightHandedSystem(e){this._useRightHandedSystem!==e&&(this._useRightHandedSystem=e,this.markAllMaterialsAsDirty(16))}get useRightHandedSystem(){return this._useRightHandedSystem}setStepId(e){this._currentStepId=e}getStepId(){return this._currentStepId}getInternalStep(){return this._currentInternalStep}set fogEnabled(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAllMaterialsAsDirty(16))}get fogEnabled(){return this._fogEnabled}set fogMode(e){this._fogMode!==e&&(this._fogMode=e,this.markAllMaterialsAsDirty(16))}get fogMode(){return this._fogMode}get prePass(){return!!this.prePassRenderer&&this.prePassRenderer.defaultRT.enabled}set shadowsEnabled(e){this._shadowsEnabled!==e&&(this._shadowsEnabled=e,this.markAllMaterialsAsDirty(2))}get shadowsEnabled(){return this._shadowsEnabled}set lightsEnabled(e){this._lightsEnabled!==e&&(this._lightsEnabled=e,this.markAllMaterialsAsDirty(2))}get lightsEnabled(){return this._lightsEnabled}get activeCameras(){return this._activeCameras}set activeCameras(e){this._unObserveActiveCameras&&(this._unObserveActiveCameras(),this._unObserveActiveCameras=null),e&&(this._unObserveActiveCameras=UP(e,()=>{this.onActiveCamerasChanged.notifyObservers(this)})),this._activeCameras=e}get activeCamera(){return this._activeCamera}set activeCamera(e){e!==this._activeCamera&&(this._activeCamera=e,this.onActiveCameraChanged.notifyObservers(this))}get _hasDefaultMaterial(){return De.DefaultMaterialFactory!==De._OriginalDefaultMaterialFactory}get defaultMaterial(){return this._defaultMaterial||(this._defaultMaterial=De.DefaultMaterialFactory(this)),this._defaultMaterial}set defaultMaterial(e){this._defaultMaterial=e}set texturesEnabled(e){this._texturesEnabled!==e&&(this._texturesEnabled=e,this.markAllMaterialsAsDirty(1))}get texturesEnabled(){return this._texturesEnabled}get frameGraph(){return this._frameGraph}set frameGraph(e){if(this._frameGraph){this._frameGraph=e,e||(this.customRenderFunction=this._currentCustomRenderFunction);return}this._frameGraph=e,e&&(this._currentCustomRenderFunction=this.customRenderFunction,this.customRenderFunction=this._renderWithFrameGraph,this.activeCamera=null)}set skeletonsEnabled(e){this._skeletonsEnabled!==e&&(this._skeletonsEnabled=e,this.markAllMaterialsAsDirty(8))}get skeletonsEnabled(){return this._skeletonsEnabled}get collisionCoordinator(){return this._collisionCoordinator||(this._collisionCoordinator=De.CollisionCoordinatorFactory(),this._collisionCoordinator.init(this)),this._collisionCoordinator}get renderingManager(){return this._renderingManager}get frustumPlanes(){return this._frustumPlanes}_registerTransientComponents(){if(this._transientComponents.length>0){for(const e of this._transientComponents)e.register();this._transientComponents.length=0}}_addComponent(e){this._components.push(e),this._transientComponents.push(e);const t=e;t.addFromContainer&&t.serialize&&this._serializableComponents.push(t)}_getComponent(e){for(const t of this._components)if(t.name===e)return t;return null}get uniqueId(){return this._uniqueId}constructor(e,t){this._inputManager=new Mi(this),this.cameraToUseForPointers=null,this._isScene=!0,this._blockEntityCollection=!1,this.autoClear=!0,this.autoClearDepthAndStencil=!0,this._clearColor=new xt(.2,.2,.3,1),this.onClearColorChangedObservable=new Oe,this.ambientColor=new tt(0,0,0),this.environmentIntensity=1,this.iblIntensity=1,this._performancePriority=0,this.onScenePerformancePriorityChangedObservable=new Oe,this._forceWireframe=!1,this._skipFrustumClipping=!1,this._forcePointsCloud=!1,this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.objectRenderers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.effectLayers=[],this.sounds=null,this.layers=[],this.lensFlareSystems=[],this.proceduralTextures=[],this.animationsEnabled=!0,this._animationPropertiesOverride=null,this.useConstantAnimationDeltaTime=!1,this.constantlyUpdateMeshUnderPointer=!1,this.hoverCurs
vendor: 10,324 bytes, line 194
194or="pointer",this.defaultCursor="",this.doNotHandleCursors=!1,this.preventDefaultOnPointerDown=!0,this.preventDefaultOnPointerUp=!0,this.metadata=null,this.reservedDataStore=null,this.disableOfflineSupportExceptionRules=[],this.onDisposeObservable=new Oe,this._onDisposeObserver=null,this.onBeforeRenderObservable=new Oe,this._onBeforeRenderObserver=null,this.onAfterRenderObservable=new Oe,this.onAfterRenderCameraObservable=new Oe,this._onAfterRenderObserver=null,this.onBeforeAnimationsObservable=new Oe,this.onAfterAnimationsObservable=new Oe,this.onBeforeDrawPhaseObservable=new Oe,this.onAfterDrawPhaseObservable=new Oe,this.onReadyObservable=new Oe,this.onBeforeCameraRenderObservable=new Oe,this._onBeforeCameraRenderObserver=null,this.onAfterCameraRenderObservable=new Oe,this._onAfterCameraRenderObserver=null,this.onBeforeActiveMeshesEvaluationObservable=new Oe,this.onAfterActiveMeshesEvaluationObservable=new Oe,this.onBeforeParticlesRenderingObservable=new Oe,this.onAfterParticlesRenderingObservable=new Oe,this.onDataLoadedObservable=new Oe,this.onNewCameraAddedObservable=new Oe,this.onCameraRemovedObservable=new Oe,this.onNewLightAddedObservable=new Oe,this.onLightRemovedObservable=new Oe,this.onNewGeometryAddedObservable=new Oe,this.onGeometryRemovedObservable=new Oe,this.onNewTransformNodeAddedObservable=new Oe,this.onTransformNodeRemovedObservable=new Oe,this.onNewMeshAddedObservable=new Oe,this.onMeshRemovedObservable=new Oe,this.onNewSkeletonAddedObservable=new Oe,this.onSkeletonRemovedObservable=new Oe,this.onNewParticleSystemAddedObservable=new Oe,this.onParticleSystemRemovedObservable=new Oe,this.onNewAnimationGroupAddedObservable=new Oe,this.onAnimationGroupRemovedObservable=new Oe,this.onNewMaterialAddedObservable=new Oe,this.onNewMultiMaterialAddedObservable=new Oe,this.onMaterialRemovedObservable=new Oe,this.onMultiMaterialRemovedObservable=new Oe,this.onNewTextureAddedObservable=new Oe,this.onTextureRemovedObservable=new Oe,this.onNewFrameGraphAddedObservable=new Oe,this.onFrameGraphRemovedObservable=new Oe,this.onNewObjectRendererAddedObservable=new Oe,this.onObjectRendererRemovedObservable=new Oe,this.onNewPostProcessAddedObservable=new Oe,this.onPostProcessRemovedObservable=new Oe,this.onNewEffectLayerAddedObservable=new Oe,this.onEffectLayerRemovedObservable=new Oe,this.onBeforeRenderTargetsRenderObservable=new Oe,this.onAfterRenderTargetsRenderObservable=new Oe,this.onBeforeStepObservable=new Oe,this.onAfterStepObservable=new Oe,this.onActiveCameraChanged=new Oe,this.onActiveCamerasChanged=new Oe,this.onBeforeRenderingGroupObservable=new Oe,this.onAfterRenderingGroupObservable=new Oe,this.onMeshImportedObservable=new Oe,this.onAnimationFileImportedObservable=new Oe,this.onEnvironmentTextureChangedObservable=new Oe,this.onMeshUnderPointerUpdatedObservable=new Oe,this._registeredForLateAnimationBindings=new so(256),this._pointerPickingConfiguration=new nF,this.onPrePointerObservable=new Oe,this.onPointerObservable=new Oe,this.onPreKeyboardObservable=new Oe,this.onKeyboardObservable=new Oe,this._useRightHandedSystem=!1,this._timeAccumulator=0,this._currentStepId=0,this._currentInternalStep=0,this._fogEnabled=!0,this._fogMode=De.FOGMODE_NONE,this.fogColor=new tt(.2,.2,.3),this.fogDensity=.1,this.fogStart=0,this.fogEnd=1e3,this.needsPreviousWorldMatrices=!1,this._shadowsEnabled=!0,this._lightsEnabled=!0,this._unObserveActiveCameras=null,this._texturesEnabled=!0,this._frameGraph=null,this.frameGraphs=[],this.physicsEnabled=!0,this.particlesEnabled=!0,this.spritesEnabled=!0,this._skeletonsEnabled=!0,this.lensFlaresEnabled=!0,this.collisionsEnabled=!0,this.gravity=new I(0,-9.807,0),this.postProcessesEnabled=!0,this.renderTargetsEnabled=!0,this.dumpNextRenderTargets=!1,this.customRenderTargets=[],this.importedMeshesFiles=[],this.probesEnabled=!0,this._meshesForIntersections=new so(256),this.proceduralTexturesEnabled=!0,this._totalVertices=new Cn,this._activeIndices=new Cn,this._activeParticles=new Cn,this._activeBones=new Cn,this._animationTime=0,this.animationTimeScale=1,this._renderId=0,this._frameId=0,this._executeWhenReadyTimeoutId=null,this._intermediateRendering=!1,this._defaultFrameBufferCleared=!1,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1,this._toBeDisposed=new Array(256),this._activeRequests=new Array,this._delayedFileRequests=null,this._pendingData=[],this._isDisposed=!1,this._isDisposing=!1,this._isReadyChecks=[],this.dispatchAllSubMeshesOfActiveMeshes=!1,this._activeMeshes=new Ps(256),this._processedMaterials=new Ps(256),this._renderTargets=new so(256),this._materialsRenderTargets=new so(256),this._activeParticleSystems=new Ps(256),this._activeSkeletons=new so(32),this._softwareSkinnedMeshes=new so(32),this._activeAnimatables=new Array,this._transformMatrix=ae.Zero(),this.requireLightSorting=!1,this._components=[],this._serializableComponents=[],this._transientComponents=[],this._beforeCameraUpdateStage=Ri.Create(),this._beforeClearStage=Ri.Create(),this._beforeRenderTargetClearStage=Ri.Create(),this._gatherRenderTargetsStage=Ri.Create(),this._gatherActiveCameraRenderTargetsStage=Ri.Create(),this._isReadyForMeshStage=Ri.Create(),this._beforeEvaluateActiveMeshStage=Ri.Create(),this._evaluateSubMeshStage=Ri.Create(),this._preActiveMeshStage=Ri.Create(),this._cameraDrawRenderTargetStage=Ri.Create(),this._beforeCameraDrawStage=Ri.Create(),this._beforeRenderTargetDrawStage=Ri.Create(),this._beforeRenderingGroupDrawStage=Ri.Create(),this._beforeRenderingMeshStage=Ri.Create(),this._afterRenderingMeshStage=Ri.Create(),this._afterRenderingGroupDrawStage=Ri.Create(),this._afterCameraDrawStage=Ri.Create(),this._afterCameraPostProcessStage=Ri.Create(),this._afterRenderTargetDrawStage=Ri.Create(),this._afterRenderTargetPostProcessStage=Ri.Create(),this._afterRenderStage=Ri.Create(),this._pointerMoveStage=Ri.Create(),this._pointerDownStage=Ri.Create(),this._pointerUpStage=Ri.Create(),this._geometriesByUniqueId=null,this._uniqueId=0,this._defaultMeshCandidates={data:[],length:0},this._defaultSubMeshCandidates={data:[],length:0},this.onReadyTimeoutObservable=new Oe,this.onReadyTimeoutDuration=120*1e3,this._timeoutChecksStartTime=0,this._floatingOriginScene=void 0,this._preventFreeActiveMeshesAndRenderingGroups=!1,this._activeMeshesFrozen=!1,this._activeMeshesFrozenButKeepClipping=!1,this._skipEvaluateActiveMeshesCompletely=!1,this._freezeActiveMeshesCancel=null,this._useCurrentFrameBuffer=!1,this._allowPostProcessClearColor=!0,this.getDeterministicFrameTime=()=>this._engine.getTimeStep(),this._getFloatingOriginScene=()=>this._floatingOriginScene,this._registeredActions=0,this._blockMaterialDirtyMechanism=!1,this._perfCollector=null,this.activeCameras=[],this._uniqueId=this.getUniqueId();const i={useGeometryUniqueIdsMap:!0,useMaterialMeshMap:!0,useClonedMeshMap:!0,virtual:!1,defaultCameraLayerMask:268435455,defaultRenderableLayerMask:268435455,...t};this.defaultCameraLayerMask=i.defaultCameraLayerMask,this.defaultRenderableLayerMask=i.defaultRenderableLayerMask,e=this._engine=e||vt.LastCreatedEngine,i.virtual?e._virtualScenes.push(this):(vt._LastCreatedScene=this,e.scenes.push(this)),(e.getCreationOptions().useLargeWorldRendering||t?.useFloatingOrigin)&&(WO(),this._floatingOriginScene=this,fh.getScene=this._getFloatingOriginScene),this._uid=null,this._renderingManager=new _s(this),z0&&(this.postProcessManager=new z0(this)),is()&&this.attachControl(),this._createUbo(),Da&&(this._imageProcessingConfiguration=new Da),this.setDefaultCandidateProviders(),i.useGeometryUniqueIdsMap&&(this._geometriesByUniqueId={}),this.useMaterialMeshMap=i.useMaterialMeshMap,this.useClonedMeshMap=i.useClonedMeshMap,(!t||!t.virtual)&&e.onNewSceneAddedObservable.notifyObservers(this)}getClassName(){return"Scene"}_getDefaultMeshCandidates(){return this._defaultMeshCandidates.data=this.meshes,this._defaultMeshCandidates.length=this.meshes.length,this._defaultMeshCandidates}_getDefaultSubMeshCandidates(e){return this._defaultSubMeshCandidates.data=e.subMeshes,this._defaultSubMeshCandidates.length=e.subMeshes.length,this._defaultSubMeshCandidates}setDefaultCandidateProviders(){this.getActiveMeshCandidates=()=>this._getDefaultMeshCandidates(),this.getActiveSubMeshCandidates=e=>this._getDefaultSubMeshCandidates(e),this.getIntersectingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e),this.getCollidingSubMeshCandidates=(e,t)=>this._getDefaultSubMeshCandidates(e)}get meshUnderPointer(){return this._inputManager.meshUnderPointer}get pointerX(){return this._inputManager.pointerX}set pointerX(e){this._inputManager.pointerX=e}get pointerY(){return this._inputManager.pointerY}set pointerY(e){this._inputManager.pointerY=e}getCachedMaterial(){return this._cachedMaterial}getCachedEffect(){return this._cachedEffect}getCachedVisibility(){return this._cachedVisibility}isCachedMaterialInvalid(e,t,i=1){return this._cachedEffect!==t||this._cachedMaterial!==e||this._cachedVisibility!==i}getEngine(){return this._engine}getTotalVertices(){return this._totalVertices.current}get totalVerticesPerfCounter(){return this._totalVertices}getActiveIndices(){return this._activeIndices.current}get totalActiveIndicesPerfCounter(){return this._activeIndices}getActiveParticles(){return this._activeParticles.current}get activeParticlesPerfCounter(){return this._activeParticles}getActiveBones(){return this._activeBones.current}get activeBonesPerfCounter(){return this._activeBones}getActiveMeshes(){return this._activeMeshes}getAnimationRatio(){return this._animationRatio!==void 0?this._animationRatio:1}getRenderId(){return this._renderId}getFrameId(){return this._frameId}incrementRenderId(){this._renderId++}_createUbo(){this.setSceneUniformBuffer(this.createSceneUniformBuffer())}simulatePointerMove(e,t){return this._inputManager.simulatePointerMove(e,t),this}simulatePointerDown(e,t){return this._inputManager.simulatePointerDown(e,t),this}simulatePointerUp(e,t,i){return this._inputManager.simulatePointerUp(e,t,i),this}isPointerCaptured(e=0){return this._inputManager.isPointerCaptured(e)}attachControl(e=!0,t=!0,i=!0){this._inputManager.attachControl(e,t,i)}detachControl(){this._inputManager.detachControl()}isReady(e=!0){if(this._isDisposed)return!1;let t;const i=this.getEngine(),s=i.currentRenderPassId;i.currentRenderPassId=this.activeCamera?.renderPassId??s;let n=!0;
194for(this._pendingData.length>0&&(n=!1),this.prePassRenderer?.update(),this.useOrderIndependentTransparency&&this.depthPeelingRenderer&&n&&(n=this.depthPeelingRenderer.isReady()),e&&(this._processedMaterials.reset(),this._materialsRenderTargets.reset()),t=0;t<this.meshes.length;t++){const o=this.meshes[t];if(!o.subMeshes||o.subMeshes.length===0)continue;if(!o.isReady(!0)){n=!1;continue}const c=o.hasThinInstances||o.getClassName()==="InstancedMesh"||o.getClassName()==="InstancedLinesMesh"||i.getCaps().instancedArrays&&o.instances.length>0;for(const f of this._isReadyForMeshStage)f.action(o,c)||(n=!1);if(!e)continue;const h=o.material||this.defaultMaterial;if(h)if(h._storeEffectOnSubMeshes)for(const f of o.subMeshes){const _=f.getMaterial();_&&_.hasRenderTargetTextures&&_.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(_)===-1&&(this._processedMaterials.push(_),this._materialsRenderTargets.concatWithNoDuplicate(_.getRenderTargetTextures()))}else h.hasRenderTargetTextures&&h.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(h)===-1&&(this._processedMaterials.push(h),this._materialsRenderTargets.concatWithNoDuplicate(h.getRenderTargetTextures()))}if(e){for(t=0;t<this._materialsRenderTargets.length;++t)this._materialsRenderTargets.data[t].isReadyForRendering()||(n=!1);for(t=0;t<this.customRenderTargets.length;++t)this.customRenderTargets[t].isReadyForRendering()||(n=!1)}for(t=0;t<this.geometries.length;t++)this.geometries[t].delayLoadState===2&&(n=!1);if(this.activeCameras&&this.activeCameras.length>0)for(const o of this.activeCameras)o.isReady(!0)||(n=!1);else this.activeCamera&&(this.activeCamera.isReady(!0)||(n=!1));for(const o of this.particleSystems)o.isReady()||(n=!1);if(this.proceduralTexturesEnabled)for(const o of this.proceduralTextures)o.isReady()||(n=!1);if(this.layers)for(const o of this.layers)o.isReady()||(n=!1);if(this.effectLayers)for(const o of this.effectLayers)o.isLayerReady()||(n=!1);for(const o of this._isReadyChecks)o.isReady()||(n=!1);return i.areAllEffectsReady()||(n=!1),i.currentRenderPassId=s,n}resetCachedMaterial(){this._cachedMaterial=null,this._cachedEffect=null,this._cachedVisibility=null}registerBeforeRender(e){this.onBeforeRenderObservable.add(e)}unregisterBeforeRender(e){this.onBeforeRenderObservable.removeCallback(e)}registerAfterRender(e){this.onAfterRenderObservable.add(e)}unregisterAfterRender(e){this.onAfterRenderObservable.removeCallback(e)}_executeOnceBeforeRender(e){const t=()=>{e(),setTimeout(()=>{this.unregisterBeforeRender(t)})};this.registerBeforeRender(t)}executeOnceBeforeRender(e,t){t!==void 0?setTimeout(()=>{this._executeOnceBeforeRender(e)},t):this._executeOnceBeforeRender(e)}addPendingData(e){this._pendingData.push(e)}removePendingData(e){const t=this.isLoading,i=this._pendingData.indexOf(e);i!==-1&&this._pendingData.splice(i,1),t&&!this.isLoading&&this.onDataLoadedObservable.notifyObservers(this)}getWaitingItemsCount(){return this._pendingData.length}get isLoading(){return this._pendingData.length>0}addIsReadyCheck(e){this._isReadyChecks.indexOf(e)===-1&&this._isReadyChecks.push(e)}removeIsReadyCheck(e){const t=this._isReadyChecks.indexOf(e);t!==-1&&this._isReadyChecks.splice(t,1)}executeWhenReady(e,t=!1){this.onReadyObservable.addOnce(e),this._executeWhenReadyTimeoutId===null&&this._checkIsReady(t)}async whenReadyAsync(e=!1){return await new Promise(t=>{this.executeWhenReady(()=>{t()},e)})}_clearReadynessChecksData(){this._timeoutChecksStartTime=0,this.onReadyTimeoutObservable.clear(),this.onReadyObservable.clear(),this._executeWhenReadyTimeoutId=null}_checkIsReady(e=!1){if(this._registerTransientComponents(),this._timeoutChecksStartTime===0)this._timeoutChecksStartTime=Gs.Now;else if(this.onReadyTimeoutDuration>0&&Gs.Now-this._timeoutChecksStartTime>this.onReadyTimeoutDuration){this.onReadyTimeoutObservable.notifyObservers(this),this._clearReadynessChecksData();return}if(this.isReady(e)){this.onReadyObservable.notifyObservers(this),this._clearReadynessChecksData();return}if(this._isDisposed){this._clearReadynessChecksData();return}this._executeWhenReadyTimeoutId=setTimeout(()=>{this.incrementRenderId(),this._checkIsReady(e)},100)}get animatables(){return this._activeAnimatables}resetLastAnimationTimeFrame(){this._animationTimeLast=Gs.Now}getViewMatrix(){return this._viewMatrix}getProjectionMatrix(){return this._projectionMatrix}getInverseProjectionMatrix(){return this._inverseProjectionMatrix}getTransformMatrix(){return this._transformMatrix}setTransformMatrix(e,t,i,s){this._multiviewSceneUboIsActive=!!(i&&s&&this._multiviewSceneUbo),!(this._viewUpdateFlag===e.updateFlag&&this._projectionUpdateFlag===t.updateFlag)&&(this._viewUpdateFlag=e.updateFlag,this._projectionUpdateFlag=t.updateFlag,this._viewMatrix=e,this._projectionMatrix=t,this._inverseProjectionMatrix||(this._inverseProjectionMatrix=new ae),this._projectionMatrix.invertToRef(this._inverseProjectionMatrix),this._viewMatrix.multiplyToRef(this._projectionMatrix,this._transformMatrix),this._frustumPlanes?bn.GetPlanesToRef(this._transformMatrix,this._frustumPlanes):this._frustumPlanes=bn.GetPlanes(this._transformMatrix),this._multiviewSceneUboIsActive&&this._multiviewSceneUbo.useUbo?this._updateMultiviewUbo(i,s):this._sceneUbo.useUbo&&(this._sceneUbo.updateMatrix("viewProjection",this._transformMatrix),this._sceneUbo.updateMatrix("view",this._viewMatrix),this._sceneUbo.updateMatrix("projection",this._projectionMatrix),this._sceneUbo.updateMatrix("inverseProjection",this._inverseProjectionMatrix)))}getSceneUniformBuffer(){return this._multiviewSceneUboIsActive&&this._multiviewSceneUbo?this._multiviewSceneUbo:this._sceneUbo}createSceneUniformBuffer(e,t){const i=typeof t=="boolean"?t:t?.trackUBOsInFrame,s=new Xe(this._engine,void 0,!1,e??"scene",void 0,i);return s.addUniform("viewProjection",16),s.addUniform("view",16),s.addUniform("projection",16),s.addUniform("vEyePosition",4),s.addUniform("inverseProjection",16),s}setSceneUniformBuffer(e){this._sceneUbo=e,this._viewUpdateFlag=-1,this._projectionUpdateFlag=-1}get floatingOriginMode(){return this._floatingOriginScene!==void 0}get floatingOriginOffset(){return this.floatingOriginMode?this._eyePosition:I.ZeroReadOnly}getUniqueId(){return UA.UniqueId}
vendor: 12,399 bytes, line 194
194addMesh(e,t=!1){if(!this._blockEntityCollection&&(this.meshes.push(e),e._resyncLightSources(),e.parent||e._addToSceneRootNodes(),Ts.SetImmediate(()=>{this.onNewMeshAddedObservable.notifyObservers(e)}),t)){const i=e.getChildMeshes();for(const s of i)this.addMesh(s)}}removeMesh(e,t=!1){const i=this.meshes.indexOf(e);if(i!==-1&&(this.meshes.splice(i,1),e.parent||e._removeFromSceneRootNodes()),this._inputManager._invalidateMesh(e),this.onMeshRemovedObservable.notifyObservers(e),t){const s=e.getChildMeshes();for(const n of s)this.removeMesh(n)}return i}addTransformNode(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneTransformNodesArray!==-1||(e._indexInSceneTransformNodesArray=this.transformNodes.length,this.transformNodes.push(e),e.parent||e._addToSceneRootNodes(),this.onNewTransformNodeAddedObservable.notifyObservers(e))}removeTransformNode(e){const t=e._indexInSceneTransformNodesArray;if(t!==-1){if(t!==this.transformNodes.length-1){const i=this.transformNodes[this.transformNodes.length-1];this.transformNodes[t]=i,i._indexInSceneTransformNodesArray=t}e._indexInSceneTransformNodesArray=-1,this.transformNodes.pop(),e.parent||e._removeFromSceneRootNodes()}return this.onTransformNodeRemovedObservable.notifyObservers(e),t}removeSkeleton(e){const t=this.skeletons.indexOf(e);return t!==-1&&(this.skeletons.splice(t,1),this.onSkeletonRemovedObservable.notifyObservers(e),this._executeActiveContainerCleanup(this._activeSkeletons)),t}removeMorphTargetManager(e){const t=this.morphTargetManagers.indexOf(e);return t!==-1&&this.morphTargetManagers.splice(t,1),t}removeLight(e){const t=this.lights.indexOf(e);if(t!==-1){for(const i of this.meshes)i._removeLightSource(e,!1);this.lights.splice(t,1),this.sortLightsByPriority(),e.parent||e._removeFromSceneRootNodes(),this.onLightRemovedObservable.notifyObservers(e)}return t}removeCamera(e){const t=this.cameras.indexOf(e);if(t!==-1&&(this.cameras.splice(t,1),e.parent||e._removeFromSceneRootNodes()),this.activeCameras){const i=this.activeCameras.indexOf(e);i!==-1&&this.activeCameras.splice(i,1)}return this.activeCamera===e&&(this.cameras.length>0?this.activeCamera=this.cameras[0]:this.activeCamera=null),this.onCameraRemovedObservable.notifyObservers(e),t}removeParticleSystem(e){const t=this.particleSystems.indexOf(e);return t!==-1&&(this.particleSystems.splice(t,1),this._executeActiveContainerCleanup(this._activeParticleSystems)),this.onParticleSystemRemovedObservable.notifyObservers(e),t}removeAnimation(e){const t=this.animations.indexOf(e);return t!==-1&&this.animations.splice(t,1),t}stopAnimation(e,t,i){}removeAnimationGroup(e){const t=this.animationGroups.indexOf(e);return t!==-1&&this.animationGroups.splice(t,1),this.onAnimationGroupRemovedObservable.notifyObservers(e),t}removeMultiMaterial(e){const t=this.multiMaterials.indexOf(e);return t!==-1&&this.multiMaterials.splice(t,1),this.onMultiMaterialRemovedObservable.notifyObservers(e),t}removeMaterial(e){const t=e._indexInSceneMaterialArray;if(t!==-1&&t<this.materials.length){if(t!==this.materials.length-1){const i=this.materials[this.materials.length-1];this.materials[t]=i,i._indexInSceneMaterialArray=t}e._indexInSceneMaterialArray=-1,this.materials.pop()}return this.onMaterialRemovedObservable.notifyObservers(e),t}removeActionManager(e){const t=this.actionManagers.indexOf(e);return t!==-1&&this.actionManagers.splice(t,1),t}removeTexture(e){const t=this.textures.indexOf(e);return t!==-1&&this.textures.splice(t,1),this.onTextureRemovedObservable.notifyObservers(e),t}removeFrameGraph(e){const t=this.frameGraphs.indexOf(e);return t!==-1&&this.frameGraphs.splice(t,1),this.onFrameGraphRemovedObservable.notifyObservers(e),t}removeObjectRenderer(e){const t=this.objectRenderers.indexOf(e);return t!==-1&&this.objectRenderers.splice(t,1),this.onObjectRendererRemovedObservable.notifyObservers(e),t}removePostProcess(e){const t=this.postProcesses.indexOf(e);return t!==-1&&this.postProcesses.splice(t,1),this.onPostProcessRemovedObservable.notifyObservers(e),t}removeEffectLayer(e){const t=this.effectLayers.indexOf(e);return t!==-1&&this.effectLayers.splice(t,1),this.onEffectLayerRemovedObservable.notifyObservers(e),t}addLight(e){if(!this._blockEntityCollection){this.lights.push(e),this.sortLightsByPriority(),e.parent||e._addToSceneRootNodes();for(const t of this.meshes)t.lightSources.indexOf(e)===-1&&(t.lightSources.push(e),t._resyncLightSources());Ts.SetImmediate(()=>{this.onNewLightAddedObservable.notifyObservers(e)})}}sortLightsByPriority(){this.requireLightSorting&&this.lights.sort(Lt.CompareLightsPriority)}addCamera(e){this._blockEntityCollection||(this.cameras.push(e),Ts.SetImmediate(()=>{this.onNewCameraAddedObservable.notifyObservers(e)}),e.parent||e._addToSceneRootNodes())}addSkeleton(e){this._blockEntityCollection||(this.skeletons.push(e),Ts.SetImmediate(()=>{this.onNewSkeletonAddedObservable.notifyObservers(e)}))}addParticleSystem(e){this._blockEntityCollection||(this.particleSystems.push(e),Ts.SetImmediate(()=>{this.onNewParticleSystemAddedObservable.notifyObservers(e)}))}addAnimation(e){this._blockEntityCollection||this.animations.push(e)}addAnimationGroup(e){this._blockEntityCollection||(this.animationGroups.push(e),Ts.SetImmediate(()=>{this.onNewAnimationGroupAddedObservable.notifyObservers(e)}))}addMultiMaterial(e){this._blockEntityCollection||(this.multiMaterials.push(e),Ts.SetImmediate(()=>{this.onNewMultiMaterialAddedObservable.notifyObservers(e)}))}addMaterial(e){this._blockEntityCollection||e.getScene()===this&&e._indexInSceneMaterialArray!==-1||(e._indexInSceneMaterialArray=this.materials.length,this.materials.push(e),Ts.SetImmediate(()=>{this.onNewMaterialAddedObservable.notifyObservers(e)}))}addMorphTargetManager(e){this._blockEntityCollection||this.morphTargetManagers.push(e)}addGeometry(e){this._blockEntityCollection||(this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=this.geometries.length),this.geometries.push(e))}addActionManager(e){this.actionManagers.push(e)}addTexture(e){this._blockEntityCollection||(this.textures.push(e),this.onNewTextureAddedObservable.notifyObservers(e))}addFrameGraph(e){this.frameGraphs.push(e),Ts.SetImmediate(()=>{this.onNewFrameGraphAddedObservable.notifyObservers(e)})}addObjectRenderer(e){this.objectRenderers.push(e),Ts.SetImmediate(()=>{this.onNewObjectRendererAddedObservable.notifyObservers(e)})}addPostProcess(e){this._blockEntityCollection||(this.postProcesses.push(e),Ts.SetImmediate(()=>{this.onNewPostProcessAddedObservable.notifyObservers(e)}))}addEffectLayer(e){this._blockEntityCollection||(this.effectLayers.push(e),Ts.SetImmediate(()=>{this.onNewEffectLayerAddedObservable.notifyObservers(e)}))}switchActiveCamera(e,t=!0){this._engine.getInputElement()&&(this.activeCamera&&this.activeCamera.detachControl(),this.activeCamera=e,t&&e.attachControl())}setActiveCameraById(e){const t=this.getCameraById(e);return t?(this.activeCamera=t,t):null}setActiveCameraByName(e){const t=this.getCameraByName(e);return t?(this.activeCamera=t,t):null}getAnimationGroupByName(e){for(let t=0;t<this.animationGroups.length;t++)if(this.animationGroups[t].name===e)return this.animationGroups[t];return null}_getMaterial(e,t){for(let i=0;i<this.materials.length;i++){const s=this.materials[i];if(t(s))return s}if(e)for(let i=0;i<this.multiMaterials.length;i++){const s=this.multiMaterials[i];if(t(s))return s}return null}getMaterialByUniqueID(e,t=!1){return this.getMaterialByUniqueId(e,t)}getMaterialByUniqueId(e,t=!1){return this._getMaterial(t,i=>i.uniqueId===e)}getMaterialById(e,t=!1){return this._getMaterial(t,i=>i.id===e)}getMaterialByName(e,t=!1){return this._getMaterial(t,i=>i.name===e)}getLastMaterialById(e,t=!1){for(let i=this.materials.length-1;i>=0;i--)if(this.materials[i].id===e)return this.materials[i];if(t){for(let i=this.multiMaterials.length-1;i>=0;i--)if(this.multiMaterials[i].id===e)return this.multiMaterials[i]}return null}getTextureByUniqueId(e){for(let t=0;t<this.textures.length;t++)if(this.textures[t].uniqueId===e)return this.textures[t];return null}getTextureByName(e){for(let t=0;t<this.textures.length;t++)if(this.textures[t].name===e)return this.textures[t];return null}getCameraById(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].id===e)return this.cameras[t];return null}getCameraByUniqueId(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].uniqueId===e)return this.cameras[t];return null}getCameraByName(e){for(let t=0;t<this.cameras.length;t++)if(this.cameras[t].name===e)return this.cameras[t];return null}getBoneById(e){for(let t=0;t<this.skeletons.length;t++){const i=this.skeletons[t];for(let s=0;s<i.bones.length;s++)if(i.bones[s].id===e)return i.bones[s]}return null}getBoneByName(e){for(let t=0;t<this.skeletons.length;t++){const i=this.skeletons[t];for(let s=0;s<i.bones.length;s++)if(i.bones[s].name===e)return i.bones[s]}return null}getLightByName(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].name===e)return this.lights[t];return null}getLightById(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].id===e)return this.lights[t];return null}getLightByUniqueId(e){for(let t=0;t<this.lights.length;t++)if(this.lights[t].uniqueId===e)return this.lights[t];return null}getParticleSystemById(e){for(let t=0;t<this.particleSystems.length;t++)if(this.particleSystems[t].id===e)return this.particleSystems[t];return null}getGeometryById(e){for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].id===e)return this.geometries[t];return null}_getGeometryByUniqueId(e){if(this._geometriesByUniqueId){const t=this._geometriesByUniqueId[e];if(t!==void 0)return this.geometries[t]}else for(let t=0;t<this.geometries.length;t++)if(this.geometries[t].uniqueId===e)return this.geometries[t];return null}getFrameGraphByName(e){for(let t=0;t<this.frameGraphs.length;t++)if(this.frameGraphs[t].name===e)return this.frameGraphs[t];return null}pushGeometry(e,t){return!t&&this._getGeometryByUniqueId(e.uniqueId)?!1:(this.addGeometry(e),Ts.SetImmediate(()=>{this.onNewGeometryAddedObservable.notifyObservers(e)}),!0)}removeGeometry(e){let t;if(this._geometriesByUniqueId){if(t=this._geometriesByUniqueId[e.uniqueId],t===void 0)return!1}else if(t=this.geometries.indexOf(e),t<0)return!1;if(t!==this.geometries.length-1){const i=this.geometries[this.geometries.length-1];i&&(this.geometries[t]=i,this._geometriesByUniqueId&&(this._geometriesByUniqueId[i.uniqueId]=t))}return this._geometriesByUniqueId&&(this._geometriesByUniqueId[e.uniqueId]=void 0),this.geometries.pop(),this.onGeometryRemovedObservable.notifyObservers(e),!0}getGeometries(){return this.geometries}getMeshById(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].id===e)return this.meshes[t];return null}getMeshesById(e){return this.meshes.filter(function(t){return t.id===e})}getTransformNodeById(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getTransformNodeByUniqueId(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].uniqueId===e)return this.transformNodes[t];return null}getTransformNodesById(e){return this.transformNodes.filter(function(t){return t.id===e})}getMeshByUniqueId(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].uniqueId===e)return this.meshes[t];return null}getLastMeshById(e){for(let t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];return null}getLastTransformNodeById(e){for(let t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];return null}getLastEntryById(e){let t;for(t=this.meshes.length-1;t>=0;t--)if(this.meshes[t].id===e)return this.meshes[t];for(t=this.transformNodes.length-1;t>=0;t--)if(this.transformNodes[t].id===e)return this.transformNodes[t];for(t=this.cameras.length-1;t>=0;t--)if(this.cameras[t].id===e)return this.cameras[t];for(t=this.lights.length-1;t>=0;t--)if(this.lights[t].id===e)return this.lights[t];for(t=this.skeletons.length-1;t>=0;t--){const i=this.skeletons[t];for(let s=i.bones.length-1;s>=0;s--)if(i.bones[s].id===e)return i.bones[s]}return null}getNodeById(e){const t=this.getMeshById(e);if(t)return t;const i=this.getTransformNodeById(e);if(i)return i;const s=this.getLightById(e);if(s)return s;const n=this.getCameraById(e);if(n)return n;const o=this.getBoneById(e);return o||null}getNodeByName(e){const t=this.getMeshByName(e);
vendor: 4,685 bytes, line 194
194if(t)return t;const i=this.getTransformNodeByName(e);if(i)return i;const s=this.getLightByName(e);if(s)return s;const n=this.getCameraByName(e);if(n)return n;const o=this.getBoneByName(e);return o||null}getMeshByName(e){for(let t=0;t<this.meshes.length;t++)if(this.meshes[t].name===e)return this.meshes[t];return null}getTransformNodeByName(e){for(let t=0;t<this.transformNodes.length;t++)if(this.transformNodes[t].name===e)return this.transformNodes[t];return null}getLastSkeletonById(e){for(let t=this.skeletons.length-1;t>=0;t--)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByUniqueId(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].uniqueId===e)return this.skeletons[t];return null}getSkeletonById(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].id===e)return this.skeletons[t];return null}getSkeletonByName(e){for(let t=0;t<this.skeletons.length;t++)if(this.skeletons[t].name===e)return this.skeletons[t];return null}getMorphTargetManagerById(e){for(let t=0;t<this.morphTargetManagers.length;t++)if(this.morphTargetManagers[t].uniqueId===e)return this.morphTargetManagers[t];return null}getMorphTargetById(e){for(let t=0;t<this.morphTargetManagers.length;++t){const i=this.morphTargetManagers[t];for(let s=0;s<i.numTargets;++s){const n=i.getTarget(s);if(n.id===e)return n}}return null}getMorphTargetByName(e){for(let t=0;t<this.morphTargetManagers.length;++t){const i=this.morphTargetManagers[t];for(let s=0;s<i.numTargets;++s){const n=i.getTarget(s);if(n.name===e)return n}}return null}getPostProcessByName(e){for(let t=0;t<this.postProcesses.length;++t){const i=this.postProcesses[t];if(i.name===e)return i}return null}isActiveMesh(e){return this._activeMeshes.indexOf(e)!==-1}get uid(){return this._uid||(this._uid=Rt.RandomId()),this._uid}addExternalData(e,t){return this._externalData||(this._externalData=new N0),this._externalData.add(e,t)}getExternalData(e){return this._externalData?this._externalData.get(e):null}getOrAddExternalDataWithFactory(e,t){return this._externalData||(this._externalData=new N0),this._externalData.getOrAddWithFactory(e,t)}removeExternalData(e){return this._externalData.remove(e)}_evaluateSubMesh(e,t,i,s){if(s||e.isInFrustum(this._frustumPlanes)){for(const o of this._evaluateSubMeshStage)o.action(t,e);const n=e.getMaterial();n!=null&&(n.hasRenderTargetTextures&&n.getRenderTargetTextures!=null&&this._processedMaterials.indexOf(n)===-1&&(this._processedMaterials.push(n),this._materialsRenderTargets.concatWithNoDuplicate(n.getRenderTargetTextures())),this._renderingManager.dispatch(e,t,n))}}freeProcessedMaterials(){this._processedMaterials.dispose()}get blockfreeActiveMeshesAndRenderingGroups(){return this._preventFreeActiveMeshesAndRenderingGroups}set blockfreeActiveMeshesAndRenderingGroups(e){this._preventFreeActiveMeshesAndRenderingGroups!==e&&(e&&(this.freeActiveMeshes(),this.freeRenderingGroups()),this._preventFreeActiveMeshesAndRenderingGroups=e)}freeActiveMeshes(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._activeMeshes.dispose(),this.activeCamera&&this.activeCamera._activeMeshes&&this.activeCamera._activeMeshes.dispose(),this.activeCameras))for(let e=0;e<this.activeCameras.length;e++){const t=this.activeCameras[e];t&&t._activeMeshes&&t._activeMeshes.dispose()}}freeRenderingGroups(){if(!this.blockfreeActiveMeshesAndRenderingGroups&&(this._renderingManager&&this._renderingManager.freeRenderingGroups(),this.textures))for(let e=0;e<this.textures.length;e++){const t=this.textures[e];t&&t.renderList&&t.freeRenderingGroups()}}_isInIntermediateRendering(){return this._intermediateRendering}freezeActiveMeshes(e=!1,t,i,s=!0,n=!1){if(this.frameGraph){this._renderWithFrameGraph(!0,!1,!0);const o=this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]);for(const c of o)c.objectRenderer._freezeActiveMeshes(s);return this._freezeActiveMeshesCancel=ug(()=>{let c=!0,h=!0;for(const f of o)c&&(c=f.objectRenderer._isFrozen),h&&(h=f.objectRenderer._freezeActiveMeshesCancel!==null);if(c)return!0;if(!h)throw new Error("Freezing active meshes was cancelled");return!1},()=>{this._freezeActiveMeshesCancel=null,this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=n,this._skipEvaluateActiveMeshesCompletely=e,t?.()},(c,h)=>{if(this._freezeActiveMeshesCancel=null,this.unfreezeActiveMeshes(),h){const f="Scene: Timeout while waiting for meshes to be frozen.";i?i(f):(Ee.Error(f),c&&Ee.Error(c))}else{const f="Scene: An unexpected error occurred while trying to freeze active meshes.";i?i(f):(Ee.Error(f),c&&(Ee.Error(c),c.stack&&Ee.Error(c.stack)))}}),this}return this.executeWhenReady(()=>
vendor: 23,864 bytes, line 194
194{if(!this.activeCamera){i&&i("No active camera found");return}if(this._frustumPlanes||this.updateTransformMatrix(),this._evaluateActiveMeshes(),this._activeMeshesFrozen=!0,this._activeMeshesFrozenButKeepClipping=n,this._skipEvaluateActiveMeshesCompletely=e,s)for(let o=0;o<this._activeMeshes.length;o++)this._activeMeshes.data[o]._freeze();t&&t()}),this}unfreezeActiveMeshes(){for(let e=0;e<this.meshes.length;e++){const t=this.meshes[e];t._internalAbstractMeshDataInfo&&(t._internalAbstractMeshDataInfo._isActive=!1)}if(this._freezeActiveMeshesCancel?.(),this._freezeActiveMeshesCancel=null,this.frameGraph){const e=this.frameGraph.getTasksByClassName(["FrameGraphObjectRendererTask","FrameGraphGeometryRendererTask"]);for(const t of e)t.objectRenderer._unfreezeActiveMeshes()}else for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();return this._activeMeshesFrozen=!1,this}_executeActiveContainerCleanup(e){!(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1)&&this._activeMeshesFrozen&&this._activeMeshes.length||this.onBeforeRenderObservable.addOnce(()=>e.dispose())}_evaluateActiveMeshes(){if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1){this._activeMeshes.length>0&&(this.activeCamera?._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset());return}if(this._activeMeshesFrozen&&this._activeMeshes.length){if(!this._skipEvaluateActiveMeshesCompletely){const i=this._activeMeshes.length;for(let s=0;s<i;s++)this._activeMeshes.data[s].computeWorldMatrix()}if(this._activeParticleSystems){const i=this._activeParticleSystems.length;for(let s=0;s<i;s++)this._activeParticleSystems.data[s].animate()}this._renderingManager.resetSprites();return}if(!this.activeCamera)return;this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this),this.activeCamera._activeMeshes.reset(),this._activeMeshes.reset(),this._renderingManager.reset(),this._processedMaterials.reset(),this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset(),this._materialsRenderTargets.reset();for(const i of this._beforeEvaluateActiveMeshStage)i.action();const e=this.getActiveMeshCandidates(),t=e.length;for(let i=0;i<t;i++){const s=e.data[i];let n=s._internalAbstractMeshDataInfo._currentLOD.get(this.activeCamera);if(n?n[1]=-1:(n=[s,-1],s._internalAbstractMeshDataInfo._currentLOD.set(this.activeCamera,n)),s.isBlocked||(this._totalVertices.addCount(s.getTotalVertices(),!1),!s.isReady()||!s.isEnabled()||s.scaling.hasAZeroComponent))continue;s.computeWorldMatrix(),s.actionManager&&s.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(s);let o=this.customLODSelector?this.customLODSelector(s,this.activeCamera):s.getLOD(this.activeCamera);if(n[0]=o,n[1]=this._frameId,o!=null&&(o!==s&&o.billboardMode!==0&&o.computeWorldMatrix(),s._preActivate(),s.isVisible&&s.visibility>0&&(s.layerMask&this.activeCamera.layerMask)!==0&&(this._skipFrustumClipping||s.alwaysSelectAsActiveMesh||s.isInFrustum(this._frustumPlanes)))){this._activeMeshes.push(s),this.activeCamera._activeMeshes.push(s),o!==s&&o._activate(this._renderId,!1);for(const c of this._preActiveMeshStage)c.action(s);s._activate(this._renderId,!1)&&(s.isAnInstance?s._internalAbstractMeshDataInfo._actAsRegularMesh&&(o=s):o._internalAbstractMeshDataInfo._onlyForInstances=!1,o._internalAbstractMeshDataInfo._isActive=!0,this._activeMesh(s,o)),s._postActivate()}}if(this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this),this.particlesEnabled){this.onBeforeParticlesRenderingObservable.notifyObservers(this);for(let i=0;i<this.particleSystems.length;i++){const s=this.particleSystems[i];if(!s.isStarted()||!s.emitter)continue;const n=s.emitter;(!n.position||n.isEnabled())&&(this._activeParticleSystems.push(s),s.animate(),this._renderingManager.dispatchParticles(s))}this.onAfterParticlesRenderingObservable.notifyObservers(this)}}_prepareSkeleton(e){!this._skeletonsEnabled||!e.skeleton||(this._activeSkeletons.pushNoDuplicate(e.skeleton)&&(e.skeleton.prepare(),this._activeBones.addCount(e.skeleton.bones.length,!1)),e.computeBonesUsingShaders||this._softwareSkinnedMeshes.pushNoDuplicate(e)&&this.frameGraph&&e.applySkeleton(e.skeleton))}_activeMesh(e,t){this._prepareSkeleton(t);let i=e.hasInstances||e.isAnInstance||this.dispatchAllSubMeshesOfActiveMeshes||this._skipFrustumClipping||t.alwaysSelectAsActiveMesh;if(t&&t.subMeshes&&t.subMeshes.length>0){const s=this.getActiveSubMeshCandidates(t),n=s.length;i=i||n===1;for(let o=0;o<n;o++){const c=s.data[o];this._evaluateSubMesh(c,t,e,i)}}}updateTransformMatrix(e){const t=this.activeCamera;if(t)if(t._renderingMultiview){const i=t._rigCameras[0],s=t._rigCameras[1];this.setTransformMatrix(i.getViewMatrix(),i.getProjectionMatrix(e),s.getViewMatrix(),s.getProjectionMatrix(e))}else this.setTransformMatrix(t.getViewMatrix(),t.getProjectionMatrix(e))}_bindFrameBuffer(e,t=!0){this._useCurrentFrameBuffer||(e&&e._multiviewTexture?e._multiviewTexture._bindFrameBuffer():e&&e.outputRenderTarget?e.outputRenderTarget._bindFrameBuffer():this._engine._currentFrameBufferIsDefaultFrameBuffer()||this._engine.restoreDefaultFramebuffer()),t&&this._clearFrameBuffer(e)}_clearFrameBuffer(e){if(!(e&&e._multiviewTexture))if(e&&e.outputRenderTarget&&!e._renderingMultiview){const t=e.outputRenderTarget;t.onClearObservable.hasObservers()?t.onClearObservable.notifyObservers(this._engine):!t.skipInitialClear&&!e.isRightCamera&&(this.autoClear&&this._engine.clear(t.clearColor||this._clearColor,!t._cleared,!0,!0),t._cleared=!0)}else this._defaultFrameBufferCleared?this._engine.clear(null,!1,!0,!0):(this._defaultFrameBufferCleared=!0,this._clear())}_renderForCamera(e,t,i=!0){if(e&&e._skipRendering)return;const s=this._engine;if(this._activeCamera=e,!this.activeCamera)throw new Error("Active camera not set");if(s.setViewport(this.activeCamera.viewport),this.resetCachedMaterial(),this._renderId++,!this.prePass&&i){let c=!0;e._renderingMultiview&&e.outputRenderTarget&&(c=e.outputRenderTarget.skipInitialClear,this.autoClear&&(this._defaultFrameBufferCleared=!1,e.outputRenderTarget.skipInitialClear=!1)),this._bindFrameBuffer(this._activeCamera),e._renderingMultiview&&e.outputRenderTarget&&(e.outputRenderTarget.skipInitialClear=c)}this.updateTransformMatrix(),this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera),this._engine.currentRenderPassId=e.outputRenderTarget?.renderPassId??e.renderPassId??0,this._evaluateActiveMeshes();for(let c=0;c<this._softwareSkinnedMeshes.length;c++){const h=this._softwareSkinnedMeshes.data[c];h.applySkeleton(h.skeleton)}this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets),e.customRenderTargets&&e.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(e.customRenderTargets),t&&t.customRenderTargets&&t.customRenderTargets.length>0&&this._renderTargets.concatWithNoDuplicate(t.customRenderTargets),this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture);for(const c of this._gatherActiveCameraRenderTargetsStage)c.action(this._renderTargets);let n=!1;if(this.renderTargetsEnabled){this._intermediateRendering=!0;let c;if(this._renderTargets.length>0){Rt.StartPerformanceCounter("Render targets",this._renderTargets.length>0);const h=this.getBoundingBoxRenderer?.();for(let f=0;f<this._renderTargets.length;f++){const _=this._renderTargets.data[f];if(_._shouldRender()){this._renderId++;const d=_.activeCamera&&_.activeCamera!==this.activeCamera;h&&!c&&(c=h.renderList.length>0?h.renderList.data.slice():[],c.length=h.renderList.length),_.render(d,this.dumpNextRenderTargets),n=!0}}h&&c&&(h.renderList.data=c,h.renderList.length=c.length),Rt.EndPerformanceCounter("Render targets",this._renderTargets.length>0),this._renderId++}if(this._cameraDrawRenderTargetStage.length>0){const h=this.getBoundingBoxRenderer?.();h&&!c&&(c=h.renderList.length>0?h.renderList.data.slice():[],c.length=h.renderList.length);for(const f of this._cameraDrawRenderTargetStage)n=f.action(this.activeCamera)||n;h&&c&&(h.renderList.data=c,h.renderList.length=c.length)}this._intermediateRendering=!1}n&&!this.prePass&&(this._bindFrameBuffer(this._activeCamera,!1),this.updateTransformMatrix()),this.onAfterRenderTargetsRenderObservable.notifyObservers(this),this.postProcessManager&&!e._multiviewTexture&&!this.prePass&&this.postProcessManager._prepareFrame();for(const c of this._beforeCameraDrawStage)c.action(this.activeCamera);this.onBeforeDrawPhaseObservable.notifyObservers(this);const o=s.snapshotRendering&&s.snapshotRenderingMode===1;o&&this.finalizeSceneUbo(),this._renderingManager.render(null,null,!0,!o),this.onAfterDrawPhaseObservable.notifyObservers(this);for(const c of this._afterCameraDrawStage)c.action(this.activeCamera);if(this.postProcessManager&&!e._multiviewTexture){const c=e.outputRenderTarget?e.outputRenderTarget.renderTarget:void 0;this.postProcessManager._finalizeFrame(e.isIntermediate,c)}for(const c of this._afterCameraPostProcessStage)c.action(this.activeCamera);this._renderTargets.reset(),this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera)}_processSubCameras(e,t=!0){if(e.cameraRigMode===0||e._renderingMultiview){e._renderingMultiview&&!this._multiviewSceneUbo&&this._createMultiviewUbo(),this._renderForCamera(e,void 0,t),this.onAfterRenderCameraObservable.notifyObservers(e);return}if(e._useMultiviewToSingleView)this._renderMultiviewToSingleView(e);else{this.onBeforeCameraRenderObservable.notifyObservers(e);for(let i=0;i<e._rigCameras.length;i++)this._renderForCamera(e._rigCameras[i],e)}this._activeCamera=e,this.updateTransformMatrix(),this.onAfterRenderCameraObservable.notifyObservers(e)}_checkIntersections(){for(let e=0;e<this._meshesForIntersections.length;e++){const t=this._meshesForIntersections.data[e];if(t.actionManager)for(let i=0;t.actionManager&&i<t.actionManager.actions.length;i++){const s=t.actionManager.actions[i];if(s.trigger===12||s.trigger===13){const n=s.getTriggerParameter(),o=n.mesh?n.mesh:n,c=o.intersectsMesh(t,n.usePreciseIntersection),h=t._intersectionsInProgress.indexOf(o);c&&h===-1?s.trigger===12?(s._executeCurrent(Qi.CreateNew(t,void 0,o)),t._intersectionsInProgress.push(o)):s.trigger===13&&t._intersectionsInProgress.push(o):!c&&h>-1&&(s.trigger===13&&s._executeCurrent(Qi.CreateNew(t,void 0,o)),(!t.actionManager.hasSpecificTrigger(13,f=>{const _=f.mesh?f.mesh:f;return o===_})||s.trigger===13)&&t._intersectionsInProgress.splice(h,1))}}}}_advancePhysicsEngineStep(e){}_animate(e){}animate(){if(this._engine.isDeterministicLockStep()){let e=Math.max(De.MinDeltaTime,Math.min(this._engine.getDeltaTime(),De.MaxDeltaTime))+this._timeAccumulator;const t=this._engine.getTimeStep(),i=1e3/t/1e3;let s=0;const n=this._engine.getLockstepMaxSteps();let o=Math.floor(e/t);for(o=Math.min(o,n);e>0&&s<o;)this.onBeforeStepObservable.notifyObservers(this),this._animationRatio=t*i,this._animate(t),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(t),this.onAfterStepObservable.notifyObservers(this),this._currentStepId++,s++,e-=t;this._timeAccumulator=e<0?0:e}else{const e=this.useConstantAnimationDeltaTime?16:Math.max(De.MinDeltaTime,Math.min(this._engine.getDeltaTime(),De.MaxDeltaTime));this._animationRatio=e*(60/1e3),this._animate(),this.onAfterAnimationsObservable.notifyObservers(this),this.physicsEnabled&&this._advancePhysicsEngineStep(e)}}_clear(){(this.autoClearDepthAndStencil||this.autoClear)&&this._engine.clear(this._clearColor,this.autoClear||this.forceWireframe||this.forcePointsCloud,this.autoClearDepthAndStencil,this.autoClearDepthAndStencil)}_checkCameraRenderTarget(e){if(e?.outputRenderTarget&&!e?.isRigCamera&&(e.outputRenderTarget._cleared=!1),e?.rigCameras?.length)for(let t=0;t<e.rigCameras.length;++t){const i=e.rigCameras[t].outputRenderTarget;i&&(i._cleared=!1)}}resetDrawCache(e){if(this.meshes)for(const t of this.meshes)t.resetDrawCache(e)}_renderWithFrameGraph(e=!0,t=!1,i=!1){if(this.activeCamera=null,this.activeCameras=null,e){for(const n of this.cameras)if(n.update(),n.cameraRigMode!==0)for(let o=0;o<n._rigCameras.length;o++)n._rigCameras[o].update()}this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this),this._renderTargets.reset();const s=this._frameGraph?.findMainCamera()??null;if(this.renderTargetsEnabled){this.environmentTexture&&this.environmentTexture.isRenderTarget&&this._renderTargets.pushNoDuplicate(this.environmentTexture),this._renderTargets.concatWithNoDuplicate(this.customRenderTargets),Rt.StartPerformanceCounter("Custom render targets",this._renderTargets.length>0);for(let n=0;n<this._renderTargets.length;n++){const o=this._renderTargets.data[n],c=o.activeCamera||s;this._renderRenderTarget(o,c,!0,this.dumpNextRenderTargets)}Rt.EndPerformanceCounter("Custom render targets",this._renderTargets.length>0),this._renderId++}this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const n of this._beforeClearStage)n.action();if(this._engine.snapshotRendering&&this._engine.snapshotRenderingMode===1)this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();else{const n=this.getActiveMeshCandidates(),o=n.length;if(this._activeMeshesFrozen){if(!this._skipEvaluateActiveMeshesCompletely)for(let c=0;c<o;c++){const h=n.data[c];h._internalAbstractMeshDataInfo._wasActiveLastFrame&&h.computeWorldMatrix()}if(this.particlesEnabled){const c=this._activeParticleSystems.length;for(let h=0;h<c;h++)this._activeParticleSystems.data[h].animate()}}else{this._activeParticleSystems.reset(),this._activeSkeletons.reset(),this._softwareSkinnedMeshes.reset();for(let c=0;c<o;c++){const h=n.data[c];h._internalAbstractMeshDataInfo._wasActiveLastFrame=!1,!h.isBlocked&&(this._totalVertices.addCount(h.getTotalVertices(),!1),!(!h.isReady()||!h.isEnabled()||h.scaling.hasAZeroComponent)&&(h.computeWorldMatrix(i),h.actionManager&&h.actionManager.hasSpecificTriggers2(12,13)&&this._meshesForIntersections.pushNoDuplicate(h)))}if(this.particlesEnabled)for(let c=0;c<this.particleSystems.length;c++){const h=this.particleSystems[c];if(!h.isStarted()||!h.emitter)continue;const f=h.emitter;(!f.position||f.isEnabled())&&(this._activeParticleSystems.push(h),h.animate())}}}this.frameGraph?.execute()}_renderRenderTarget(e,t,i=!1,s=!1){if(this._intermediateRendering=!0,e._shouldRender()){if(this._renderId++,this.activeCamera=t,!this.activeCamera)throw new Error("Active camera not set");this._engine.setViewport(this.activeCamera.viewport),this.updateTransformMatrix(),e.render(i,s)}this._intermediateRendering=!1}render(e=!0,t=!1){if(!this.isDisposed){if(this.onReadyObservable.hasObservers()&&this._executeWhenReadyTimeoutId===null&&this._checkIsReady(),fh.getScene=this._getFloatingOriginScene,this._frameId++,this._defaultFrameBufferCleared=!1,this._checkCameraRenderTarget(this.activeCamera),this.activeCameras?.length)for(const i of this.activeCameras)this._checkCameraRenderTarget(i);this._registerTransientComponents(),this._activeParticles.fetchNewFrame(),this._totalVertices.fetchNewFrame(),this._activeIndices.fetchNewFrame(),this._activeBones.fetchNewFrame(),this._meshesForIntersections.reset(),this.resetCachedMaterial(),this.onBeforeAnimationsObservable.notifyObservers(this),this.actionManager&&this.actionManager.processTrigger(11),t||this.animate();for(const i of this._beforeCameraUpdateStage)i.action();if(e){if(this.activeCameras&&this.activeCameras.length>0)for(let i=0;i<this.activeCameras.length;i++){const s=this.activeCameras[i];if(s.update(),s.cameraRigMode!==0)for(let n=0;n<s._rigCameras.length;n++)s._rigCameras[n].update()}else if(this.activeCamera&&(this.activeCamera.update(),this.activeCamera.cameraRigMode!==0))for(let i=0;i<this.activeCamera._rigCameras.length;i++)this.activeCamera._rigCameras[i].update()}if(this.customRenderFunction)this._renderId++,this._engine.currentRenderPassId=0,this.customRenderFunction(e,t);else{this.onBeforeRenderObservable.notifyObservers(this),this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);const i=this.activeCameras?.length?this.activeCameras[0]:this.activeCamera;if(this.renderTargetsEnabled){Rt.StartPerformanceCounter("Custom render targets",this.customRenderTargets.length>0);for(let s=0;s<this.customRenderTargets.length;s++){const n=this.customRenderTargets[s],o=n.activeCamera||this.activeCamera;this._renderRenderTarget(n,o,i!==o,this.dumpNextRenderTargets)}Rt.EndPerformanceCounter("Custom render targets",this.customRenderTargets.length>0),this._renderId++}this._engine.currentRenderPassId=i?.renderPassId??0,this.activeCamera=i,this._activeCamera&&this._activeCamera.cameraRigMode!==22&&!this.prePass&&this._bindFrameBuffer(this._activeCamera,!1),this.onAfterRenderTargetsRenderObservable.notifyObservers(this);for(const s of this._beforeClearStage)s.action();this._clearFrameBuffer(this.activeCamera);for(const s of this._gatherRenderTargetsStage)s.action(this._renderTargets);if(this.activeCameras&&this.activeCameras.length>0)for(let s=0;s<this.activeCameras.length;s++)this._processSubCameras(this.activeCameras[s],s>0);else{if(!this.activeCamera)throw new Error("No camera defined");this._processSubCameras(this.activeCamera,!!this.activeCamera.outputRenderTarget)}}this._checkIntersections();for(const i of this._afterRenderStage)i.action();if(this.afterRender&&this.afterRender(),this.onAfterRenderObservable.notifyObservers(this),this._toBeDisposed.length){for(let i=0;i<this._toBeDisposed.length;i++){const s=this._toBeDisposed[i];s&&s.dispose()}this._toBeDisposed.length=0}this.dumpNextRenderTargets&&(this.dumpNextRenderTargets=!1),this._activeBones.addCount(0,!0),this._activeIndices.addCount(0,!0),this._activeParticles.addCount(0,!0),this._engine.restoreDefaultFramebuffer()}}freezeMaterials(){for(let e=0;e<this.materials.length;e++)this.materials[e].freeze()}unfreezeMaterials(){for(let e=0;e<this.materials.length;e++)this.materials[e].unfreeze()}dispose(){if(this.isDisposed)return;if(this._isDisposing=!0,this.beforeRender=null,this.afterRender=null,this.metadata=null,this.skeletons.length=0,this.morphTargetManagers.length=0,this._transientComponents.length=0,this._isReadyForMeshStage.clear(),this._beforeEvaluateActiveMeshStage.clear(),this._evaluateSubMeshStage.clear(),this._preActiveMeshStage.clear(),this._cameraDrawRenderTargetStage.clear(),this._beforeCameraDrawStage.clear(),this._beforeRenderTargetDrawStage.clear(),this._beforeRenderingGroupDrawStage.clear(),this._beforeRenderingMeshStage.clear(),this._afterRenderingMeshStage.clear(),this._afterRenderingGroupDrawStage.clear(),this._afterCameraDrawStage.clear(),this._afterRenderTargetDrawStage.clear(),this._afterRenderStage.clear(),this._beforeCameraUpdateStage.clear(),this._beforeClearStage.clear(),this._gatherRenderTargetsStage.clear(),this._gatherActiveCameraRenderTargetsStage.clear(),this._pointerMoveStage.clear(),this._pointerDownStage.clear(),this._pointerUpStage.clear(),this._isReadyChecks.length=0,this.importedMeshesFiles=[],this._activeAnimatables&&lg(this.stopAllAnimations)){for(const n of this._activeAnimatables)n.onAnimationEndObservable.clear(),n.onAnimationEnd=null;this.stopAllAnimations()}this.resetCachedMaterial(),this.activeCamera&&(this.activeCamera._activeMeshes.dispose(),this.activeCamera=null),this.activeCameras=null,this._activeMeshes.dispose(),this._renderingManager.dispose(),this._processedMaterials.dispose(),this._activeParticleSystems.dispose(),this._activeSkeletons.dispose(),this._softwareSkinnedMeshes.dispose(),this._renderTargets.dispose(),this._materialsRenderTargets.dispose(),this._registeredForLateAnimationBindings.dispose(),this._meshesForIntersections.dispose(),this._toBeDisposed.length=0;const e=this._activeRequests.slice();for(const n of e)n.abort();this._activeRequests.length=0;try{this.onDisposeObservable.notifyObservers(this)}catch(n){Ee.Error("An error occurred while calling onDisposeObservable!",n)}if(this.detachControl(),this._engine.getInputElement?.())for(let n=0;n<this.cameras.length;n++)this.cameras[n].detachControl();this._disposeList(this.animationGroups),this._disposeList(this.lights),this._defaultMaterial&&this._defaultMaterial.dispose(),this._disposeList(this.multiMaterials),this._disposeList(this.materials),this._disposeList(this.meshes,n=>n.dispose(!0)),this._disposeList(this.transformNodes,n=>n.dispose(!0));const i=this.cameras;this._disposeList(i),this._disposeList(this.particleSystems),this._disposeList(this.postProcesses),this._disposeList(this.textures),this._disposeList(this.morphTargetManagers),this._disposeList(this.frameGraphs),this._sceneUbo.dispose(),this._multiviewSceneUbo&&this._multiviewSceneUbo.dispose(),this.postProcessManager.dispose(),this._disposeList(this._components);let s=this._engine.scenes.indexOf(this);if(s>-1&&this._engine.scenes.splice(s,1),this._floatingOriginScene=void 0,this._engine.scenes.length===0&&HO(),vt._LastCreatedScene===this){vt._LastCreatedScene=null;let n=vt.Instances.length-1;for(;n>=0;){const o=vt.Instances[n];if(o.scenes.length>0){vt._LastCreatedScene=o.scenes[this._engine.scenes.length-1];break}n--}}s=this._engine._virtualScenes.indexOf(this),s>-1&&this._engine._virtualScenes.splice(s,1),this._engine.wipeCaches(!0),this.onDisposeObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderTargetsRenderObservable.clear(),this.onAfterRenderTargetsRenderObservable.clear(),this.onAfterStepObservable.clear(),this.onBeforeStepObservable.clear(),this.onBeforeActiveMeshesEvaluationObservable.clear(),this.onAfterActiveMeshesEvaluationObservable.clear(),this.onBeforeParticlesRenderingObservable.clear(),this.onAfterParticlesRenderingObservable.clear(),this.onBeforeDrawPhaseObservable.clear(),this.onAfterDrawPhaseObservable.clear(),this.onBeforeAnimationsObservable.clear(),this.onAfterAnimationsObservable.clear(),this.onDataLoadedObservable.clear(),this.onBeforeRenderingGroupObservable.clear(),this.onAfterRenderingGroupObservable.clear(),this.onMeshImportedObservable.clear(),this.onBeforeCameraRenderObservable.clear(),this.onAfterCameraRenderObservable.clear(),this.onAfterRenderCameraObservable.clear(),this.onReadyObservable.clear(),this.onNewCameraAddedObservable.clear(),this.onCameraRemovedObservable.clear(),this.onNewLightAddedObservable.clear(),this.onLightRemovedObservable.clear(),this.onNewGeometryAddedObservable.clear(),this.onGeometryRemovedObservable.clear(),this.onNewTransformNodeAddedObservable.clear(),this.onTransformNodeRemovedObservable.clear(),this.onNewMeshAddedObservable.clear(),this.onMeshRemovedObservable.clear(),this.onNewSkeletonAddedObservable.clear(),this.onSkeletonRemovedObservable.clear(),this.onNewMaterialAddedObservable.clear(),this.onNewMultiMaterialAddedObservable.clear(),this.onMaterialRemovedObservable.clear(),this.onMultiMaterialRemovedObservable.clear(),this.onNewTextureAddedObservable.clear(),this.onTextureRemovedObservable.clear(),this.onNewFrameGraphAddedObservable.clear(),this.onFrameGraphRemovedObservable.clear(),this.onNewObjectRendererAddedObservable.clear(),this.onObjectRendererRemovedObservable.clear(),this.onPrePointerObservable.clear(),this.onPointerObservable.clear(),this.onPreKeyboardObservable.clear(),this.onKeyboardObservable.clear(),this.onActiveCameraChanged.clear(),this.onScenePerformancePriorityChangedObservable.clear(),this.onClearColorChangedObservable.clear(),this.onEnvironmentTextureChangedObservable.clear(),this.onMeshUnderPointerUpdatedObservable.clear(),this._isDisposed=!0}
vendor: 6,903 bytes, line 194
194_disposeList(e,t){const i=e.slice(0);t=t??(s=>s.dispose());for(const s of i)t(s);e.length=0}get isDisposed(){return this._isDisposed}clearCachedVertexData(){for(let e=0;e<this.meshes.length;e++){const i=this.meshes[e].geometry;i&&i.clearCachedData()}}cleanCachedTextureBuffer(){for(const e of this.textures)e._buffer&&(e._buffer=null)}getWorldExtends(e){const t=new I(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),i=new I(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);e=e||(()=>!0);const s=this.meshes.filter(e);for(const n of s){if(n.computeWorldMatrix(!0),!n.subMeshes||n.subMeshes.length===0||n.infiniteDistance)continue;const o=n.getBoundingInfo(),c=o.boundingBox.minimumWorld,h=o.boundingBox.maximumWorld;I.CheckExtends(c,t,i),I.CheckExtends(h,t,i)}return t.x===Number.MAX_VALUE?{min:I.Zero(),max:I.Zero()}:{min:t,max:i}}createPickingRay(e,t,i,s,n=!1){throw at("Ray")}createPickingRayToRef(e,t,i,s,n,o=!1,c=!1){throw at("Ray")}createPickingRayInCameraSpace(e,t,i){throw at("Ray")}createPickingRayInCameraSpaceToRef(e,t,i,s){throw at("Ray")}pick(e,t,i,s,n,o){const c=at("Ray",!0);return c&&Ee.Warn(c),new uh}pickWithBoundingInfo(e,t,i,s,n){const o=at("Ray",!0);return o&&Ee.Warn(o),new uh}pickWithRay(e,t,i,s){throw at("Ray")}multiPick(e,t,i,s,n){throw at("Ray")}multiPickWithRay(e,t,i){throw at("Ray")}setPointerOverMesh(e,t,i){this._inputManager.setPointerOverMesh(e,t,i)}getPointerOverMesh(){return this._inputManager.getPointerOverMesh()}_rebuildGeometries(){for(const e of this.geometries)e._rebuild();for(const e of this.meshes)e._rebuild();this.postProcessManager&&this.postProcessManager._rebuild();for(const e of this._components)e.rebuild();for(const e of this.particleSystems)e.rebuild();if(this.spriteManagers)for(const e of this.spriteManagers)e.rebuild()}_rebuildTextures(){for(const e of this.textures)e._rebuild(!0);this.markAllMaterialsAsDirty(1)}_getByTags(e,t,i){if(t===void 0)return e;const s=[];for(const n in e){const o=e[n];Ut&&Ut.MatchesQuery(o,t)&&(!i||i(o))&&s.push(o)}return s}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}setRenderingOrder(e,t=null,i=null,s=null){this._renderingManager.setRenderingOrder(e,t,i,s)}setRenderingAutoClearDepthStencil(e,t,i=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,i,s)}getAutoClearDepthStencilSetup(e){return this._renderingManager.getAutoClearDepthStencilSetup(e)}_forceBlockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism=e}get blockMaterialDirtyMechanism(){return this._blockMaterialDirtyMechanism}set blockMaterialDirtyMechanism(e){this._blockMaterialDirtyMechanism!==e&&(this._blockMaterialDirtyMechanism=e,e||this.markAllMaterialsAsDirty(127))}markAllMaterialsAsDirty(e,t){if(!this._blockMaterialDirtyMechanism)for(const i of this.materials)t&&!t(i)||i.markAsDirty(e)}_loadFile(e,t,i,s,n,o,c){const h=Ia(e,t,i,s?this.offlineProvider:void 0,n,o,c);return this._activeRequests.push(h),h.onCompleteObservable.add(f=>{this._activeRequests.splice(this._activeRequests.indexOf(f),1)}),h}async _loadFileAsync(e,t,i,s,n){return await new Promise((o,c)=>{this._loadFile(e,h=>{o(h)},t,i,s,(h,f)=>{c(f)},n)})}async _loadDelayedFileAsync(e,t,i){this._delayedFileRequests||(this._delayedFileRequests=new Map);const s=`${e}|${t?"binary":"string"}`;let n=this._delayedFileRequests.get(s);if(!n){n=t?this._loadFileAsync(e,void 0,i,!0):this._loadFileAsync(e,void 0,i,!1);const o=n;(async()=>{try{await o}catch{}this._delayedFileRequests?.delete(s)})(),this._delayedFileRequests.set(s,n)}return await n}_requestFile(e,t,i,s,n,o,c){const h=pg(e,t,i,s?this.offlineProvider:void 0,n,o,c);return this._activeRequests.push(h),h.onCompleteObservable.add(f=>{this._activeRequests.splice(this._activeRequests.indexOf(f),1)}),h}async _requestFileAsync(e,t,i,s,n){return await new Promise((o,c)=>{this._requestFile(e,h=>{o(h)},t,i,s,h=>{c(h)},n)})}_readFile(e,t,i,s,n){const o=hh(e,t,i,s,n);return this._activeRequests.push(o),o.onCompleteObservable.add(c=>{this._activeRequests.splice(this._activeRequests.indexOf(c),1)}),o}async _readFileAsync(e,t,i){return await new Promise((s,n)=>{this._readFile(e,o=>{s(o)},t,i,o=>{n(o)})})}getPerfCollector(){throw at("performanceViewerSceneExtension")}setActiveCameraByID(e){return this.setActiveCameraById(e)}getMaterialByID(e){return this.getMaterialById(e)}getLastMaterialByID(e){return this.getLastMaterialById(e)}getTextureByUniqueID(e){return this.getTextureByUniqueId(e)}getCameraByID(e){return this.getCameraById(e)}getCameraByUniqueID(e){return this.getCameraByUniqueId(e)}getBoneByID(e){return this.getBoneById(e)}getLightByID(e){return this.getLightById(e)}getLightByUniqueID(e){return this.getLightByUniqueId(e)}getParticleSystemByID(e){return this.getParticleSystemById(e)}getGeometryByID(e){return this.getGeometryById(e)}getMeshByID(e){return this.getMeshById(e)}getMeshByUniqueID(e){return this.getMeshByUniqueId(e)}getLastMeshByID(e){return this.getLastMeshById(e)}getMeshesByID(e){return this.getMeshesById(e)}getTransformNodeByID(e){return this.getTransformNodeById(e)}getTransformNodeByUniqueID(e){return this.getTransformNodeByUniqueId(e)}getTransformNodesByID(e){return this.getTransformNodesById(e)}getNodeByID(e){return this.getNodeById(e)}getLastEntryByID(e){return this.getLastEntryById(e)}getLastSkeletonByID(e){return this.getLastSkeletonById(e)}}De.FOGMODE_NONE=0;De.FOGMODE_EXP=1;De.FOGMODE_EXP2=2;De.FOGMODE_LINEAR=3;De.MinDeltaTime=1;De.MaxDeltaTime=1e3;De._OriginalDefaultMaterialFactory=De.DefaultMaterialFactory;let ZT=!1;function oF(){ZT||(ZT=!0,In("BABYLON.Scene",De))}(Z0=De.prototype).sortActiveAnimatables??(Z0.sortActiveAnimatables=Ze("Scene","sortActiveAnimatables"));(Q0=De.prototype).beginWeightedAnimation??(Q0.beginWeightedAnimation=Ze("Scene","beginWeightedAnimation"));($0=De.prototype).beginAnimation??($0.beginAnimation=Ze("Scene","beginAnimation"));(J0=De.prototype).beginHierarchyAnimation??(J0.beginHierarchyAnimation=Ze("Scene","beginHierarchyAnimation"));(eT=De.prototype).beginDirectAnimation??(eT.beginDirectAnimation=Ze("Scene","beginDirectAnimation"));(tT=De.prototype).beginDirectHierarchyAnimation??(tT.beginDirectHierarchyAnimation=Ze("Scene","beginDirectHierarchyAnimation"));(iT=De.prototype).getAnimatableByTarget??(iT.getAnimatableByTarget=Ze("Scene","getAnimatableByTarget"));(sT=De.prototype).getAllAnimatablesByTarget??(sT.getAllAnimatablesByTarget=Ze("Scene","getAllAnimatablesByTarget"));(nT=De.prototype).stopAllAnimations??(nT.stopAllAnimations=Ze("Scene","stopAllAnimations"));(rT=De.prototype).getSoundByName??(rT.getSoundByName=Ze("Scene","getSoundByName"));
194(aT=De.prototype).createOrUpdateSelectionOctree??(aT.createOrUpdateSelectionOctree=Ze("Scene","createOrUpdateSelectionOctree"));(oT=De.prototype).createDefaultLight??(oT.createDefaultLight=Ze("Scene","createDefaultLight"));(lT=De.prototype).createDefaultCamera??(lT.createDefaultCamera=Ze("Scene","createDefaultCamera"));(cT=De.prototype).createDefaultCameraOrLight??(cT.createDefaultCameraOrLight=Ze("Scene","createDefaultCameraOrLight"));(hT=De.prototype).createDefaultSkybox??(hT.createDefaultSkybox=Ze("Scene","createDefaultSkybox"));(uT=De.prototype).createDefaultEnvironment??(uT.createDefaultEnvironment=Ze("Scene","createDefaultEnvironment"));(fT=De.prototype).createDefaultVRExperience??(fT.createDefaultVRExperience=Ze("Scene","createDefaultVRExperience"));(dT=De.prototype).createDefaultXRExperienceAsync??(dT.createDefaultXRExperienceAsync=Ze("Scene","createDefaultXRExperienceAsync"));(_T=De.prototype).getGlowLayerByName??(_T.getGlowLayerByName=Ze("Scene","getGlowLayerByName"));(mT=De.prototype).getHighlightLayerByName??(mT.getHighlightLayerByName=Ze("Scene","getHighlightLayerByName"));(gT=De.prototype).getSelectionOutlineLayerByName??(gT.getSelectionOutlineLayerByName=Ze("Scene","getSelectionOutlineLayerByName"));(pT=De.prototype).removeLensFlareSystem??(pT.removeLensFlareSystem=Ze("Scene","removeLensFlareSystem"));(yT=De.prototype).addLensFlareSystem??(yT.addLensFlareSystem=Ze("Scene","addLensFlareSystem"));(bT=De.prototype).getLensFlareSystemByName??(bT.getLensFlareSystemByName=Ze("Scene","getLensFlareSystemByName"));(xT=De.prototype).getLensFlareSystemByID??(xT.getLensFlareSystemByID=Ze("Scene","getLensFlareSystemByID"));(TT=De.prototype).getLensFlareSystemById??(TT.getLensFlareSystemById=Ze("Scene","getLensFlareSystemById"));(ET=De.prototype).getPhysicsEngine??(ET.getPhysicsEngine=Ze("Scene","getPhysicsEngine"));(vT=De.prototype).enablePhysics??(vT.enablePhysics=Ze("Scene","enablePhysics"));(AT=De.prototype).disablePhysicsEngine??(AT.disablePhysicsEngine=Ze("Scene","disablePhysicsEngine"));(RT=De.prototype).isPhysicsEnabled??(RT.isPhysicsEnabled=Ze("Scene","isPhysicsEnabled"));(ST=De.prototype).deleteCompoundImpostor??(ST.deleteCompoundImpostor=Ze("Scene","deleteCompoundImpostor"));(MT=De.prototype).removeReflectionProbe??(MT.removeReflectionProbe=Ze("Scene","removeReflectionProbe"));(CT=De.prototype).addReflectionProbe??(CT.addReflectionProbe=Ze("Scene","addReflectionProbe"));(IT=De.prototype).getBoundingBoxRenderer??(IT.getBoundingBoxRenderer=Ze("Scene","getBoundingBoxRenderer"));(DT=De.prototype).enableDepthRenderer??(DT.enableDepthRenderer=Ze("Scene","enableDepthRenderer"));(PT=De.prototype).disableDepthRenderer??(PT.disableDepthRenderer=Ze("Scene","disableDepthRenderer"));(OT=De.prototype).enableFluidRenderer??(OT.enableFluidRenderer=Ze("Scene","enableFluidRenderer"));(wT=De.prototype).disableFluidRenderer??(wT.disableFluidRenderer=Ze("Scene","disableFluidRenderer"));(FT=De.prototype).enableGeometryBufferRenderer??(FT.enableGeometryBufferRenderer=Ze("Scene","enableGeometryBufferRenderer"));(LT=De.prototype).disableGeometryBufferRenderer??(LT.disableGeometryBufferRenderer=Ze("Scene","disableGeometryBufferRenderer"));(BT=De.prototype).enableIblCdfGenerator??(BT.enableIblCdfGenerator=Ze("Scene","enableIblCdfGenerator"));(NT=De.prototype).disableIblCdfGenerator??(NT.disableIblCdfGenerator=Ze("Scene","disableIblCdfGenerator"));(UT=De.prototype).getOutlineRenderer??(UT.getOutlineRenderer=Ze("Scene","getOutlineRenderer"));(kT=De.prototype).enablePrePassRenderer??(kT.enablePrePassRenderer=Ze("Scene","enablePrePassRenderer"));(zT=De.prototype).disablePrePassRenderer??(zT.disablePrePassRenderer=Ze("Scene","disablePrePassRenderer"));
194(VT=De.prototype).enableSubSurfaceForPrePass??(VT.enableSubSurfaceForPrePass=Ze("Scene","enableSubSurfaceForPrePass"));(GT=De.prototype).disableSubSurfaceForPrePass??(GT.disableSubSurfaceForPrePass=Ze("Scene","disableSubSurfaceForPrePass"));(HT=De.prototype).pickSprite??(HT.pickSprite=Ze("Scene","pickSprite"));(WT=De.prototype).pickSpriteWithRay??(WT.pickSpriteWithRay=Ze("Scene","pickSpriteWithRay"));(XT=De.prototype).multiPickSprite??(XT.multiPickSprite=Ze("Scene","multiPickSprite"));(YT=De.prototype).multiPickSpriteWithRay??(YT.multiPickSpriteWithRay=Ze("Scene","multiPickSpriteWithRay"));(jT=De.prototype).setPointerOverSprite??(jT.setPointerOverSprite=Ze("Scene","setPointerOverSprite"));(qT=De.prototype).getPointerOverSprite??(qT.getPointerOverSprite=Ze("Scene","getPointerOverSprite"));Object.getOwnPropertyDescriptor(De.prototype,"mainSoundTrack")||Object.defineProperty(De.prototype,"mainSoundTrack",At("Scene","mainSoundTrack"));Object.getOwnPropertyDescriptor(De.prototype,"soundTracks")||Object.defineProperty(De.prototype,"soundTracks",At("Scene","soundTracks"));Object.getOwnPropertyDescriptor(De.prototype,"audioEnabled")||Object.defineProperty(De.prototype,"audioEnabled",At("Scene","audioEnabled"));Object.getOwnPropertyDescriptor(De.prototype,"headphone")||Object.defineProperty(De.prototype,"headphone",At("Scene","headphone"));Object.getOwnPropertyDescriptor(De.prototype,"audioListenerPositionProvider")||Object.defineProperty(De.prototype,"audioListenerPositionProvider",At("Scene","audioListenerPositionProvider"));Object.getOwnPropertyDescriptor(De.prototype,"audioListenerRotationProvider")||Object.defineProperty(De.prototype,"audioListenerRotationProvider",At("Scene","audioListenerRotationProvider"));Object.getOwnPropertyDescriptor(De.prototype,"audioPositioningRefreshRate")||Object.defineProperty(De.prototype,"audioPositioningRefreshRate",At("Scene","audioPositioningRefreshRate"));Object.getOwnPropertyDescriptor(De.prototype,"selectionOctree")||Object.defineProperty(De.prototype,"selectionOctree",At("Scene","selectionOctree"));Object.getOwnPropertyDescriptor(De.prototype,"debugLayer")||Object.defineProperty(De.prototype,"debugLayer",At("Scene","debugL
194ayer"));Object.getOwnPropertyDescriptor(De.prototype,"gamepadManager")||Object.defineProperty(De.prototype,"gamepadManager",At("Scene","gamepadManager"));Object.getOwnPropertyDescriptor(De.prototype,"simplificationQueue")||Object.defineProperty(De.prototype,"simplificationQueue",At("Scene","simplificationQueue"));Object.getOwnPropertyDescriptor(De.prototype,"onBeforePhysicsObservable")||Object.defineProperty(De.prototype,"onBeforePhysicsObservable",At("Scene","onBeforePhysicsObservable"));Object.getOwnPropertyDescriptor(De.prototype,"onAfterPhysicsObservable")||Object.defineProperty(De.prototype,"onAfterPhysicsObservable",At("Scene","onAfterPhysicsObservable"));Object.getOwnPropertyDescriptor(De.prototype,"reflectionProbes")||Object.defineProperty(De.prototype,"reflectionProbes",At("Scene","reflectionProbes"));Object.getOwnPropertyDescriptor(De.prototype,"forceShowBoundingBoxes")||Object.defineProperty(De.prototype,"forceShowBoundingBoxes",At("Scene","forceShowBoundingBoxes"));Object.getOwnPropertyDescriptor(De.prototype,"depthPeelingRenderer")||Object.defineProperty(De.prototype,"depthPeelingRenderer",At("Scene","depthPeelingRenderer"));Object.getOwnPropertyDescriptor(De.prototype,"useOrderIndependentTransparency")||Object.defineProperty(De.prototype,"useOrderIndependentTransparency",At("Scene","useOrderIndependentTransparency"));Object.getOwnPropertyDescriptor(De.prototype,"fluidRenderer")||Object.defineProperty(De.prototype,"fluidRenderer",At("Scene","fluidRenderer"));Object.getOwnPropertyDescriptor(De.prototype,"geometryBufferRenderer")||Object.defineProperty(De.prototype,"geometryBufferRenderer",At("Scene","geometryBufferRenderer"));Object.getOwnPropertyDescriptor(De.prototype,"iblCdfGenerator")||Object.defineProperty(De.prototype,"iblCdfGenerator",At("Scene","iblCdfGenerator"));Object.getOwnPropertyDescriptor(De.prototype,"prePassRenderer")||Object.defineProperty(De.prototype,"prePassRenderer",At("Scene","prePassRenderer"));Object.getOwnPropertyDescriptor(De.prototype,"subSurfaceConfiguration")||Object.defineProperty(De.prototype,"subSurfaceConfiguration",At("Scene","subSurfaceConfiguration"));Object.getOwnPropertyDescriptor(De.prototype,"spriteManagers")||Object.defineProperty(De.prototype,"spriteManagers",At("Scene","spriteManagers"));Object.getOwnPropertyDescriptor(De.prototype,"onBeforeSpritesRenderingObservable")||Object.defineProperty(De.prototype,"onBeforeSpritesRenderingObservable",At("Scene","onBeforeSpritesRenderingObservable"));Object.getOwnPropertyDescriptor(De.prototype,"onAfterSpritesRenderingObservable")||Object.defineProperty(De.prototype,"onAfterSpritesRenderingObservable",At("Scene","onAfterSpritesRenderingObservable"));class QT{constructor(){this.previousWorldMatrices={},this.previousBones={}}static AddUniforms(e){e.push("previousWorld","previousViewProjection","mPreviousBones")}static AddSamplers(e){}bindForSubMesh(e,t,i,s,n){if(t.prePassRenderer&&t.prePassRenderer.enabled&&t.prePassRenderer.currentRTisSceneRT&&(t.prePassRenderer.getIndex(2)!==-1||t.prePassRenderer.getIndex(11)!==-1)){this.previousWorldMatrices[i.uniqueId]||(this.previousWorldMatrices[i.uniqueId]=s.clone()),this.previousViewProjection||(this.previousViewProjection=t.getTransformMatrix().clone(),this.currentViewProjection=t.getTransformMatrix().clone());const o=t.getEngine();this.currentViewProjection.updateFlag!==t.getTransformMatrix().updateFlag?(this._lastUpdateFrameId=o.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection),this.currentViewProjection.copyFrom(t.getTransformMatrix())):this._lastUpdateFrameId!==o.frameId&&(this._lastUpdateFrameId=o.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection)),e.setMatrix("previousWorld",this.previousWorldMatrices[i.uniqueId]),e.setMatrix("previousViewProjection",this.previousViewProjection),this.previousWorldMatrices[i.uniqueId]=s.clone()}}}class kA{constructor(e){if(this.VERTEXOUTPUT_INVARIANT=!1,this._keys=[],this._isDirty=!0,this._areLightsDirty=!0,this._areLightsDisposed=!1,this._areAttributesDirty=!0,this._areTexturesDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._normals=!1,this._uvs=!1,this._needNormals=!1,this._needUVs=!1,this._externalProperties=e,e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this._setDefaultValue(t)}get isDirty(){return this._isDirty}markAsProcessed(){this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirt
vendor: 6,859 bytes, lines 194-196
194y=!1,this._areLightsDisposed=!1,this._areMiscDirty=!1,this._arePrePassDirty=!1,this._areImageProcessingDirty=!1}markAsUnprocessed(){this._isDirty=!0}markAllAsDirty(){this._areTexturesDirty=!0,this._areAttributesDirty=!0,this._areLightsDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._isDirty=!0}markAsImageProcessingDirty(){this._areImageProcessingDirty=!0,this._isDirty=!0}markAsLightDirty(e=!1){this._areLightsDirty=!0,this._areLightsDisposed=this._areLightsDisposed||e,this._isDirty=!0}markAsAttributesDirty(){this._areAttributesDirty=!0,this._isDirty=!0}markAsTexturesDirty(){this._areTexturesDirty=!0,this._isDirty=!0}markAsFresnelDirty(){this._areFresnelDirty=!0,this._isDirty=!0}markAsMiscDirty(){this._areMiscDirty=!0,this._isDirty=!0}markAsPrePassDirty(){this._arePrePassDirty=!0,this._isDirty=!0}rebuild(){this._keys.length=0;for(const e of Object.keys(this))e[0]!=="_"&&this._keys.push(e);if(this._externalProperties)for(const e in this._externalProperties)this._keys.indexOf(e)===-1&&this._keys.push(e)}isEqual(e){if(this._keys.length!==e._keys.length)return!1;for(let t=0;t<this._keys.length;t++){const i=this._keys[t];if(this[i]!==e[i])return!1}return!0}cloneTo(e){this._keys.length!==e._keys.length&&(e._keys=this._keys.slice(0));for(let t=0;t<this._keys.length;t++){const i=this._keys[t];e[i]=this[i]}}reset(){for(const e of this._keys)this._setDefaultValue(e)}_setDefaultValue(e){const t=this._externalProperties?.[e]?.type??typeof this[e],i=this._externalProperties?.[e]?.default;switch(t){case"number":this[e]=i??0;break;case"string":this[e]=i??"";break;default:this[e]=i??!1;break}}toString(){let e="";for(let t=0;t<this._keys.length;t++){const i=this._keys[t],s=this[i];switch(typeof s){case"number":case"string":e+="#define "+i+" "+s+`
195`;break;default:s&&(e+="#define "+i+`
196`);break}}return e}}function lF(r){return class extends r{constructor(){super(...arguments),this.IMAGEPROCESSING=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=0,this.CONTRAST=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.EXPOSURE=!1}}}class zA extends wi{constructor(e,t,i=!0,s=!1){super(e,t,void 0,s),this._normalMatrix=new ae,this._storeEffectOnSubMeshes=i}getEffect(){return this._storeEffectOnSubMeshes?this._activeEffect:super.getEffect()}isReady(e,t){return e?!this._storeEffectOnSubMeshes||!e.subMeshes||e.subMeshes.length===0?!0:this.isReadyForSubMesh(e,e.subMeshes[0],t):!1}_isReadyForSubMesh(e){const t=e.materialDefines;return!!(!this.checkReadyOnEveryCall&&e.effect&&t&&t._renderId===this.getScene().getRenderId())}bindOnlyWorldMatrix(e){this._activeEffect.setMatrix("world",e)}bindOnlyNormalMatrix(e){this._activeEffect.setMatrix("normalMatrix",e)}bind(e,t){t&&this.bindForSubMesh(e,t,t.subMeshes[0])}_afterBind(e,t=null,i){super._afterBind(e,t,i),this.getScene()._cachedEffect=t,i?i._drawWrapper._forceRebindOnNextCall=!1:this._drawWrapper._forceRebindOnNextCall=!1}_mustRebind(e,t,i,s=1){return i._drawWrapper._forceRebindOnNextCall||e.isCachedMaterialInvalid(this,t,s)}dispose(e,t,i){this._activeEffect=void 0,super.dispose(e,t,i)}}class VA{constructor(){this._defines={},this._currentRank=32,this._maxRank=-1,this._mesh=null}unBindMesh(){this._mesh=null}addFallback(e,t){this._defines[e]||(e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e),this._defines[e]=new Array),this._defines[e].push(t)}addCPUSkinningFallback(e,t){this._mesh=t,e<this._currentRank&&(this._currentRank=e),e>this._maxRank&&(this._maxRank=e)}get hasMoreFallbacks(){return this._currentRank<=this._maxRank}reduce(e,t){if(this._mesh&&this._mesh.computeBonesUsingShaders&&this._mesh.numBoneInfluencers>0){this._mesh.computeBonesUsingShaders=!1,e=e.replace("#define NUM_BONE_INFLUENCERS "+this._mesh.numBoneInfluencers,"#define NUM_BONE_INFLUENCERS 0"),t._bonesComputationForcedToCPU=!0;const i=this._mesh.getScene();for(let s=0;s<i.meshes.length;s++){const n=i.meshes[s];if(!n.material){!this._mesh.material&&n.computeBonesUsingShaders&&n.numBoneInfluencers>0&&(n.computeBonesUsingShaders=!1);continue}if(!(!n.computeBonesUsingShaders||n.numBoneInfluencers===0)){if(n.material.getEffect()===t)n.computeBonesUsingShaders=!1;else if(n.subMeshes){for(const o of n.subMeshes)if(o.effect===t){n.computeBonesUsingShaders=!1;break}}}}}else{const i=this._defines[this._currentRank];if(i)for(let s=0;s<i.length;s++)e=e.replace("#define "+i[s],"");this._currentRank++}return e}}const cF=new RegExp("^([gimus]+)!");class Ma{constructor(e){this._plugins=[],this._activePlugins=[],this._activePluginsForExtraEvents=[],this._material=e,this._scene=e.getScene(),this._engine=this._scene.getEngine()}_addPlugin(e){for(let s=0;s<this._plugins.length;++s)if(this._plugins[s].name===e.name)return!1;if(this._material._uniformBufferLayoutBuilt&&(this._material.resetDrawCache(),this._material._createUniformBuffer()),!e.isCompatible(this._material.shaderLanguage))throw`The plugin "${e.name}" can't be added to the material "${this._material.name}" because the plugin is not compatible with the shader language of the material.`;const t=e.getClassName();Ma._MaterialPluginClassToMainDefine[t]||(Ma._MaterialPluginClassToMainDefine[t]="MATERIALPLUGIN_"+ ++Ma._MaterialPluginCounter),this._material._callbackPluginEventGeneric=(s,n)=>this._handlePluginEvent(s,n),this._plugins.push(e),this._plugins.sort((s,n)=>s.priority-n.priority),this._codeInjectionPoints={};const i={};i[Ma._MaterialPluginClassToMainDefine[t]]={type:"boolean",default:!0};for(const s of this._plugins)s.collectDefines(i),this._collectPointNames("vertex",s.getCustomCode("vertex",this._material.shaderLanguage)),this._collectPointNames("fragment",s.getCustomCode("fragment",this._material.shaderLanguage));return this._defineNamesFromPlugins=i,!0}_activatePlugin(e){this._activePlugins.indexOf(e)===-1&&(this._activePlugins.push(e),this._activePlugins.sort((t,i)=>t.priority-i.priority),this._material._callbackPluginEventIsReadyForSubMesh=this._handlePluginEventIsReadyForSubMesh.bind(this),this._material._callbackPluginEventPrepareDefinesBeforeAttributes=this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this),this._material._callbackPluginEventPrepareDefines=this._handlePluginEventPrepareDefines.bind(this),this._material._callbackPluginEventBindForSubMesh=this._handlePluginEventBindForSubMesh.bind(this),e.registerForExtraEvents&&(this._activePluginsForExtraEvents.push(e),this._activePluginsForExtraEvents.sort((t,i)=>t.priority-i.priority),this._material._callbackPluginEventHasRenderTargetTextures=this._handlePluginEventHasRenderTargetTextures.bind(this),this._material._callbackPluginEventFillRen
vendor: 10,936 bytes, lines 196-204
196derTargetTextures=this._handlePluginEventFillRenderTargetTextures.bind(this),this._material._callbackPluginEventHardBindForSubMesh=this._handlePluginEventHardBindForSubMesh.bind(this)))}getPlugin(e){for(let t=0;t<this._plugins.length;++t)if(this._plugins[t].name===e)return this._plugins[t];return null}_handlePluginEventIsReadyForSubMesh(e){let t=!0;for(const i of this._activePlugins)t=t&&i.isReadyForSubMesh(e.defines,this._scene,this._engine,e.subMesh);e.isReadyForSubMesh=t}_handlePluginEventPrepareDefinesBeforeAttributes(e){for(const t of this._activePlugins)t.prepareDefinesBeforeAttributes(e.defines,this._scene,e.mesh)}_handlePluginEventPrepareDefines(e){for(const t of this._activePlugins)t.prepareDefines(e.defines,this._scene,e.mesh)}_handlePluginEventHardBindForSubMesh(e){for(const t of this._activePluginsForExtraEvents)t.hardBindForSubMesh(this._material._uniformBuffer,this._scene,this._engine,e.subMesh)}_handlePluginEventBindForSubMesh(e){for(const t of this._activePlugins)t.bindForSubMesh(this._material._uniformBuffer,this._scene,this._engine,e.subMesh)}_handlePluginEventHasRenderTargetTextures(e){let t=!1;for(const i of this._activePluginsForExtraEvents)if(t=i.hasRenderTargetTextures(),t)break;e.hasRenderTargetTextures=t}_handlePluginEventFillRenderTargetTextures(e){for(const t of this._activePluginsForExtraEvents)t.fillRenderTargetTextures(e.renderTargets)}_handlePluginEvent(e,t){switch(e){case 512:{const i=t;for(const s of this._activePlugins)s.getActiveTextures(i.activeTextures);break}case 256:{const i=t;for(const s of this._activePlugins)s.getAnimatables(i.animatables);break}case 1024:{const i=t;let s=!1;for(const n of this._activePlugins)if(s=n.hasTexture(i.texture),s)break;i.hasTexture=s;break}case 2:{const i=t;for(const s of this._plugins)s.dispose(i.forceDisposeTextures);break}case 4:{const i=t;i.defineNames=this._defineNamesFromPlugins;break}case 128:{const i=t;for(const s of this._activePlugins)i.fallbackRank=s.addFallbacks(i.defines,i.fallbacks,i.fallbackRank),s.getAttributes(i.attributes,this._scene,i.mesh);this._uniformList.length>0&&i.uniforms.push(...this._uniformList),this._samplerList.length>0&&i.samplers.push(...this._samplerList),this._uboList.length>0&&i.uniformBuffersNames.push(...this._uboList),i.customCode=this._injectCustomCode(i,i.customCode);break}case 8:{const i=t;this._uboDeclaration="",this._vertexDeclaration="",this._fragmentDeclaration="",this._uniformList=[],this._samplerList=[],this._uboList=[];const s=this._material.shaderLanguage===1;for(const n of this._plugins){const o=n.getUniforms(this._material.shaderLanguage);if(o){if(o.ubo)for(const c of o.ubo){if(c.size&&c.type){const h=c.arraySize??0;if(i.ubo.addUniform(c.name,c.size,h),s){let f;switch(c.type){case"mat4":f="mat4x4f";break;case"float":f="f32";break;default:f=`${c.type}f`;break}h>0?this._uboDeclaration+=`uniform ${c.name}: array<${f}, ${h}>;
197`:this._uboDeclaration+=`uniform ${c.name}: ${f};
198`}else this._uboDeclaration+=`${c.type} ${c.name}${h>0?`[${h}]`:""};
199`}this._uniformList.push(c.name)}o.vertex&&(this._vertexDeclaration+=o.vertex+`
200`),o.fragment&&(this._fragmentDeclaration+=o.fragment+`
201`),o.externalUniforms&&this._uniformList.push(...o.externalUniforms)}n.getSamplers(this._samplerList),n.getUniformBuffersNames(this._uboList)}break}}}_collectPointNames(e,t){if(t)for(const i in t)this._codeInjectionPoints[e]||(this._codeInjectionPoints[e]={}),this._codeInjectionPoints[e][i]=!0}_injectCustomCode(e,t){return(i,s)=>{t&&(s=t(i,s)),this._uboDeclaration&&(s=s.replace("#define ADDITIONAL_UBO_DECLARATION",this._uboDeclaration)),this._vertexDeclaration&&(s=s.replace("#define ADDITIONAL_VERTEX_DECLARATION",this._vertexDeclaration)),this._fragmentDeclaration&&(s=s.replace("#define ADDITIONAL_FRAGMENT_DECLARATION",this._fragmentDeclaration));const n=this._codeInjectionPoints?.[i];if(!n)return s;let o=null;for(let c in n){let h="";for(const f of this._activePlugins){const _=this._material.shaderLanguage;let d=f.getCustomCode(i,_)?.[c];d&&(f.resolveIncludes&&(o===null&&(o={defines:[],indexParameters:e.indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:void 0,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:Pi.GetShadersRepository(_),includesShadersStore:Pi.GetIncludesShadersStore(_),version:void 0,platformName:this._engine.shaderPlatformName,processingContext:void 0,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:void 0}),o.isFragment=i==="fragment",Uf(d,o,g=>d=g)),h+=d+`
202`)}if(h.length>0)if(c.charAt(0)==="!"){c=c.substring(1);let f="g";if(c.charAt(0)==="!")f="",c=c.substring(1);else{const g=cF.exec(c);g&&g.length>=2&&(f=g[1],c=c.substring(f.length+1))}f.indexOf("g")<0&&(f+="g");const _=new RegExp(c,f);let d=_.exec(s);for(;d!==null;){const{index:g}=d,p=hF(h,d);s=s.substring(0,g)+p+s.substring(g+d[0].length),_.lastIndex=g+p.length,d=_.exec(s)}}else{const f="#define "+c;s=s.replace(f,`
203`+h+`
204`+f)}}return s}}}Ma._MaterialPluginClassToMainDefine={};Ma._MaterialPluginCounter=0;function hF(r,e){return r.replace(/\$(\d+)/g,(t,i)=>{const s=Number(i);return s<e.length?e[s]:""})}let uF=(()=>{var r;let e,t=[],i=[],s,n=[],o=[],c,h=[],f=[],_,d=[],g=[];return r=class{isCompatible(b){switch(b){case 0:return!0;default:return!1}}_enable(b){b&&this._pluginManager._activatePlugin(this)}constructor(b,x,E,v,S=!0,R=!1,P=!1){this.name=L(this,t,void 0),this.priority=(L(this,i),L(this,n,500)),this.resolveIncludes=(L(this,o),L(this,h,!1)),this.registerForExtraEvents=(L(this,f),L(this,d,!1)),this.doNotSerialize=(L(this,g),!1),this._material=b,this.name=x,this.priority=E,this.resolveIncludes=P,b.pluginManager||(b.pluginManager=new Ma(b),b.onDisposeObservable.add(()=>{b.pluginManager=void 0})),this._pluginDefineNames=v,this._pluginManager=b.pluginManager,S&&this._pluginManager._addPlugin(this),R&&this._enable(!0),this.markAllDefinesAsDirty=b._dirtyCallbacks[127]}getClassName(){return"MaterialPluginBase"}isReadyForSubMesh(b,x,E,v){return!0}hardBindForSubMesh(b,x,E,v){}bindForSubMesh(b,x,E,v){}dispose(b){}getCustomCode(b,x=0){return null}collectDefines(b){if(this._pluginDefineNames)for(const x of Object.keys(this._pluginDefineNames)){if(x[0]==="_")continue;const E=typeof this._pluginDefineNames[x];b[x]={type:E==="number"?"number":E==="string"?"string":E==="boolean"?"boolean":"object",default:this._pluginDefineNames[x]}}}prepareDefinesBeforeAttributes(b,x,E){}prepareDefines(b,x,E){}hasTexture(b){return!1}hasRenderTargetTextures(){return!1}fillRenderTargetTextures(b){}getActiveTextures(b){}getAnimatables(b){}addFallbacks(b,x,E){return E}getSamplers(b){}getAttributes(b,x,E){}getUniformBuffersNames(b){}getUniforms(b=0){return{}}copyTo(b){Tt.Clone(()=>b,this)}serialize(){return Tt.Serialize(this)}parse(b,x,E){Tt.Parse(()=>this,b,x,E)}},(()=>{const p=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[he()],s=[he()],c=[he()],_=[he()],$(null,null,e,{kind:"field",name:"name",static:!1,private:!1,access:{has:b=>"name"in b,get:b=>b.name,set:(b,x)=>{b.name=x}},metadata:p},t,i),$(null,null,s,{kind:"field",name:"priority",static:!1,private:!1,access:{has:b=>"priority"in b,get:b=>b.priority,set:(b,x)=>{b.priority=x}},metadata:p},n,o),$(null,null,c,{kind:"field",name:"resolveIncludes",static:!1,private:!1,access:{has:b=>"resolveIncludes"in b,get:b=>b.resolveIncludes,set:(b,x)=>{b.resolveIncludes=x}},metadata:p},h,f),$(null,null,_,{kind:"field",name:"registerForExtraEvents",static:!1,private:!1,access:{has:b=>"registerForExtraEvents"in b,get:b=>b.registerForExtraEvents,set:(b,x)=>{b.registerForExtraEvents=x}},metadata:p},d,g),p&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:p})})(),r})();class fF extends kA{constructor(){super(...arguments),this.DETAIL=!1,this.DETAILDIRECTUV=0,this.DETAIL_NORMALBLENDMETHOD=0}}let dF=(()=>{var r,e,t,i;let s=uF,n,o=[],c=[],h,f=[],_=[],d,g=[],p=[],b,x=[],E=[],v,S=[],R=[],P,M=[],O=[];return r=class extends s{get texture(){return Kt(this,e,"f")}set texture(w){Zt(this,e,w,"f")}get normalBlendMethod(){return Kt(this,t,"f")}set normalBlendMethod(w){Zt(this,t,w,"f")}get isEnabled(){return Kt(this,i,"f")}set isEnabled(w){Zt(this,i,w,"f")}_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(w,G=!0){super(w,"DetailMap",140,new fF,G),this._texture=null,e.set(this,L(this,o,void 0)),this.diffuseBlendLevel=(L(this,c),L(this,f,1)),this.roughnessBlendLevel=(L(this,_),L(this,g,1)),this.bumpLevel=(L(this,p),L(this,x,1)),this._normalBlendMethod=(L(this,E),wi.MATERIAL_NORMALBLENDMETHOD_WHITEOUT),t.set(this,L(this,S,void 0)),this._isEnabled=(L(this,R),!1),i.set(this,L(this,M,!1)),this._internalMarkAllSubMeshesAsTexturesDirty=L(this,O),this._internalMarkAllSubMeshesAsTexturesDirty=w._dirtyCallbacks[1]}isReadyForSubMesh(w,G,H){return this._isEnabled?!(w._areTexturesDirty&&G.texturesEnabled&&H.getCaps().standardDerivatives&&this._texture&&pt.DetailTextureEnabled&&!this._texture.isReady()):!0}prepareDefines(w,G){if(this._isEnabled){w.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod;const H=G.getEngine();w._areTexturesDirty&&(H.getCaps().standardDerivatives&&this._texture&&pt.DetailTextureEnabled&&this._isEnabled?(va(this._texture,w,"DETAIL"),w.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod):w.DETAIL=!1)}else w.DETAIL=!1}bindForSubMesh(w,G){if(!this._isEnabled)return;const H=this._material.isFrozen;(!w.useUbo||!H||!w.isSync)&&this._texture&&pt.DetailTextureEnabled&&(w.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),Aa(this._texture,w,"detail")),G.texturesEnabled&&this._texture&&pt.DetailTextureEnabled&&w.setTexture("detailSampler",this._texture)}hasTexture(w){return this._texture===w}getActiveTextures(w){this._texture&&w.push(this._texture)}getAnimatables(w){this._texture&&this._texture.animations&&this._texture.animations.length>0&&w.push(this._texture)}dispose(w){w&&this._texture?.dispose()}getClassName(){return"DetailMapConfiguration"}getSamplers(w){w.push("detailSampler")}getUniforms(){return{ubo:[{name:"vDetailInfos",size:4,type:"vec4"},{name:"detailMatrix",size:16,type:"mat4"}]}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,(()=>{const D=typeof Symbol=="function"&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;n=[yn("detailTexture"),Qt("_markAllSubMeshesAsTexturesDirty")],h=[he()],d=[he()],b=[he()],v=[he(),Qt("_markAllSubMeshesAsTexturesDirty")],P=[he(),Qt("_markAllSubMeshesAsTexturesDirty")],$(r,null,n,{kind:"accessor",name:"texture",static:!1,private:!1,access:{has:w=>"texture"in w,get:w=>w.texture,set:(w,G)=>{w.texture=G}},metadata:D},o,c),$(r,null,v,{kind:"accessor",name:"normalBlendMethod",static:!1,private:!1,access:{has:w=>"normalBlendMethod"in w,get:w=>
204w.normalBlendMethod,set:(w,G)=>{w.normalBlendMethod=G}},metadata:D},S,R),$(r,null,P,{kind:"accessor",name:"isEnabled",static:!1,private:!1,access:{has:w=>"isEnabled"in w,get:w=>w.isEnabled,set:(w,G)=>{w.isEnabled=G}},metadata:D},M,O),$(null,null,h,{kind:"field",name:"diffuseBlendLevel",static:!1,private:!1,access:{has:w=>"diffuseBlendLevel"in w,get:w=>w.diffuseBlendLevel,set:(w,G)=>{w.diffuseBlendLevel=G}},metadata:D},f,_),$(null,null,d,{kind:"field",name:"roughnessBlendLevel",static:!1,private:!1,access:{has:w=>"roughnessBlendLevel"in w,get:w=>w.roughnessBlendLevel,set:(w,G)=>{w.roughnessBlendLevel=G}},metadata:D},g,p),$(null,null,b,{kind:"field",name:"bumpLevel",static:!1,private:!1,access:{has:w=>"bumpLevel"in w,get:w=>w.bumpLevel,set:(w,G)=>{w.bumpLevel=G}},metadata:D},x,E),D&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:D})})(),r})();const $T=new WeakMap;function GA(r){const e=r.getVertexBuffers();if(!e)return null;let t=$T.get(r);if(!t)t=new Map,$T.set(r,t);else{let i=!1;for(const s in e)if(!t.has(s)){i=!0;break}if(!i)return t}for(const i in e){const s=e[i];if(s){const n=s.byteOffset,o=s.byteStride,c=s.type,h=s.normalized;t.set(i,{offset:n,stride:o,type:c,normalized:h})}}return t}function HA(r,e){e.forEach((t,i)=>{const s=`vp_${i}_info`;r.setFloat4(s,t.offset,t.stride,t.type,t.normalized?1:0)})}var JT;(function(r){r[r.Zero=0]="Zero",r[r.One=1]="One",r[r.MaxViewZ=2]="MaxViewZ",r[r.NoClear=3]="NoClear"})(JT||(JT={}));class zs{static CreateConfiguration(e){return zs._Configurations[e]={defines:{},previousWorldMatrices:{},previousViewProjection:ae.Zero(),currentViewProjection:ae.Zero(),previousBones:{},lastUpdateFrameId:-1,excludedSkinnedMesh:[],reverseCulling:!1},zs._Configurations[e]}static DeleteConfiguration(e){delete zs._Configurations[e]}static GetConfiguration(e){return zs._Configurations[e]}static AddUniformsAndSamplers(e,t){e.push("previousWorld","previousViewProjection","mPreviousBones")}static MarkAsDirty(e,t){for(const i of t)if(i.subMeshes)for(const s of i.subMeshes)s._removeDrawWrapper(e)}static PrepareDefines(e,t,i){if(!i._arePrePassDirty)return;const s=zs._Configurations[e];if(!s)return;i.PREPASS=!0;let n=0;for(let o=0;o<zs.GeometryTextureDescriptions.length;o++){const c=zs.GeometryTextureDescriptions[o],h=c.define,f=c.defineIndex,_=s.defines[f];_!==void 0?(i[h]=!0,i[f]=_,n++):(i[h]=!1,delete i[f])}i.SCENE_MRT_COUNT=n,i.BONES_VELOCITY_ENABLED=t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&!t.skeleton.isUsingTextureForMatrices&&s.excludedSkinnedMesh.indexOf(t)===-1}static Bind(e,t,i,s,n){const o=zs._Configurations[e];if(!o)return;const c=i.getScene(),h=c.getEngine();if(o.reverseCulling&&h.setStateCullFaceType(c._mirroredCameraPosition?n.cullBackFaces:!n.cullBackFaces),(o.defines.PREPASS_VELOCITY_INDEX!==void 0||o.defines.PREPASS_VELOCITY_LINEAR_INDEX!==void 0)&&(o.previousWorldMatrices[i.uniqueId]||(o.previousWorldMatrices[i.uniqueId]=s.clone()),o.previousViewProjection||(o.previousViewProjection=c.getTransformMatrix().clone(),o.currentViewProjection=c.getTransformMatrix().clone()),o.currentViewProjection.updateFlag!==c.getTransformMatrix().updateFlag?(o.lastUpdateFrameId=h.frameId,o.previousViewProjection.copyFrom(o.currentViewProjection),o.currentViewProjection.copyFrom(c.getTransformMatrix())):o.lastUpdateFrameId!==h.frameId&&(o.lastUpdateFrameId=h.frameId,o.previousViewProjection.copyFrom(o.currentViewProjection)),t.setMatrix("previousWorld",o.previousWorldMatrices[i.uniqueId]),t.setMatrix("previousViewProjection",o.previousViewProjection),o.previousWorldMatrices[i.uniqueId]=s.clone(),i.useBones&&i.computeBonesUsingShaders&&i.skeleton)){const f=i.skeleton;if(!f.isUsingTextureForMatrices||t.getUniformIndex("boneTextureInfo")===-1){const _=f.getTransformMatrices(i);_&&(o.previousBones[i.uniqueId]||(o.previousBones[i.uniqueId]=_.slice()),t.setMatrices("mPreviousBones",o.previousBones[i.uniqueId]),o.previousBones[i.uniqueId].set(_))}}}}zs.GeometryTextureDescriptions=[{type:0,name:"IrradianceLegacy",clearType:0,define:"PREPASS_IRRADIANCE_LEGACY",defineIndex:"PREPASS_IRRADIANCE_LEGACY_INDEX"},{type:1,name:"WorldPosition",clearType:0,define:"PREPASS_POSITION",defineIndex:"PREPASS_POSITION_INDEX"},{type:2,name:"Velocity",clearType:0,define:"PREPASS_VELOCITY",defineIndex:"PREPASS_VELOCITY_INDEX"},{type:3,name:"Reflectivity",clearType:0,define:"PREPASS_REFLECTIVITY",defineIndex:"PREPASS_REFLECTIVITY_INDEX"},{type:5,name:"ViewDepth",clearType:2,define:"PREPASS_DEPTH",defineIndex:"PREPASS_DEPTH_INDEX"},{type:6,name:"ViewNormal",clearType:0,define:"PREPASS_NORMAL",defineIndex:"PREPASS_NORMAL_INDEX"},{type:7,name:"AlbedoSqrt",clearType:0,define:"PREPASS_ALBEDO_SQRT",defineIndex:"PREPASS_ALBEDO_SQRT_INDEX"},{type:8,name:"WorldNormal",clearType:0,define:"PREPASS_WORLD_NORMAL",defineIndex:"PREPASS_WORLD_NORMAL_INDEX"},{type:9,name:"LocalPosition",clearType:0,define:"PREPASS_LOCAL_POSITION",defineIndex:"PREPASS_LOCAL_POSITION_INDEX"},{type:10,name:"ScreenDepth",clearType:1,define:"PREPASS_SCREENSPACE_DEPTH",defineIndex:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:11,name:"LinearVelocity",clearType:0,define:"PREPASS_VELOCITY_LINEAR",defineIndex:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:12,name:"Albedo",clearType:0,define:"PREPASS_ALBEDO",defineIndex:"PREPASS_ALBEDO_INDEX"}
204,{type:13,name:"NormalizedViewDepth",clearType:1,define:"PREPASS_NORMALIZED_VIEW_DEPTH",defineIndex:"PREPASS_NORMALIZED_VIEW_DEPTH_INDEX"},{type:4,name:"Color",clearType:3,define:"PREPASS_COLOR",defineIndex:"PREPASS_COLOR_INDEX"},{type:14,name:"Irradiance",clearType:0,define:"PREPASS_IRRADIANCE",defineIndex:"PREPASS_IRRADIANCE_INDEX"}];zs._Configurations={};function _F(r){return class extends r{constructor(){super(...arguments),this.MAINUV1=!1,this.MAINUV2=!1,this.MAINUV3=!1,this.MAINUV4=!1,this.MAINUV5=!1,this.MAINUV6=!1,this.UV1=!1,this.UV2=!1,this.UV3=!1,this.UV4=!1,this.UV5=!1,this.UV6=!1}}}function mF(r){return class extends r{constructor(){super(...arguments),this.PREPASS=!1,this.PREPASS_COLOR=!1,this.PREPASS_COLOR_INDEX=-1,this.PREPASS_IRRADIANCE_LEGACY=!1,this.PREPASS_IRRADIANCE_LEGACY_INDEX=-1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO=!1,this.PREPASS_ALBEDO_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.PREPASS_NORMALIZED_VIEW_DEPTH=!1,this.PREPASS_NORMALIZED_VIEW_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_NORMAL_WORLDSPACE=!1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_VELOCITY_LINEAR=!1,this.PREPASS_VELOCITY_LINEAR_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0}}}function gF(r){return class extends r{constructor(...e){super(...e);const t=new.target;if(!t[Symbol.metadata]){const s=Object.getPrototypeOf(t)?.[Symbol.metadata];t[Symbol.metadata]=s?Object.create(s):{}}const i=nA(t[Symbol.metadata]);i._imageProcessingConfiguration||(i._imageProcessingConfiguration={type:9,sourceName:void 0})}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsImageProcessingDirty&&this._markAllSubMeshesAsImageProcessingDirty()}_attachImageProcessingConfiguration(e){e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),
204!e&&this.getScene?this._imageProcessingConfiguration=this.getScene().imageProcessingConfiguration:e&&(this._imageProcessingConfiguration=e),this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{this._markAllSubMeshesAsImageProcessingDirty&&this._markAllSubMeshesAsImageProcessingDirty()})))}get cameraColorCurvesEnabled(){return this.imageProcessingConfiguration.colorCurvesEnabled}set cameraColorCurvesEnabled(e){this.imageProcessingConfiguration.colorCurvesEnabled=e}get cameraColorGradingEnabled(){return this.imageProcessingConfiguration.colorGradingEnabled}set cameraColorGradingEnabled(e){this.imageProcessingConfiguration.colorGradingEnabled=e}get cameraToneMappingEnabled(){return this._imageProcessingConfiguration.toneMappingEnabled}set cameraToneMappingEnabled(e){this._imageProcessingConfiguration.toneMappingEnabled=e}get cameraExposure(){return this._imageProcessingConfiguration.exposure}set cameraExposure(e){this._imageProcessingConfiguration.exposure=e}get cameraContrast(){return this._imageProcessingConfiguration.contrast}set cameraContrast(e){this._imageProcessingConfiguration.contrast=e}get cameraColorGradingTexture(){return this._imageProcessingConfiguration.colorGradingTexture}set cameraColorGradingTexture(e){this._imageProcessingConfiguration.colorGradingTexture=e}get cameraColorCurves(){return this._imageProcessingConfiguration.colorCurves}set cameraColorCurves(e){this._imageProcessingConfiguration.colorCurves=e}}}const xm={effect:null,subMesh:null};class pF extends mF(_F(kA)){}class yF extends lF(pF){constructor(e){super(e),this.DIFFUSE=!1,this.DIFFUSEDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.OPACITY=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.REFLECTION=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.SPECULAR=!1,this.SPECULARDIRECTUV=0,this.BUMP=!1,this.BUMPDIRECTUV=0,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.SPECULAROVERALPHA=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHAFROMDIFFUSE=!1,this.POINTSIZE=!1,this.FOG=!1,this.SPECULARTERM=!1,this.DIFFUSEFRESNEL=!1,this.OPACITYFRESNEL=!1,this.REFLECTIONFRESNEL=!1,this.REFRACTIONFRESNEL=!1,this.EMISSIVEFRESNEL=!1,this.FRESNEL=!1,this.NORMAL=!1,this.TANGENT=!1,this.VERTEXCOLOR=!1,this.VERTEXALPHA=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.GLOSSINESS=!1,this.ROUGHNESS=!1,this.EMISSIVEASILLUMINATION=!1,this.LINKEMISSIVEWITHDIFFUSE=!1,this.REFLECTIONFRESNELFROMSPECULAR=!1,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.USELIGHTMAPASSHADOWMAP=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.INVERTCUBICMAP=!1,this.LOGARITHMICDEPTH=!1,this.REFRACTION=!1,this.REFRACTIONMAP_3D=!1,this.REFLECTIONOVERALPHA=!1,this.TWOSIDEDLIGHTING=!1,this.SHADOWFLOAT=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.NONUNIFORMSCALING=!1,this.PREMULTIPLYALPHA=!1,this.ALPHATEST_AFTERALLALPHACOMPUTATIONS=!1,this.ALPHABLEND=!0,this.RGBDLIGHTMAP=!1,this.RGBDREFLECTION=!1,this.RGBDREFRACTION=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.USE_VERTEX_PULLING=!1,this.VERTEX_PULLING_USE_INDEX_BUFFER=!1,this.VERTEX_PULLING_INDEX_BUFFER_32BITS=!1,this.RIGHT_HANDED=!1,this.CLUSTLIGHT_SLICES=0,this.CLUSTLIGHT_BATCH=0,this.IS_REFLECTION_LINEAR=!1,this.IS_REFRACTION_LINEAR=!1,this.DECAL_AFTER_DETAIL=!1,this.TEXTURE_REPETITION_MODE=0,this.rebuild()}}class bF extends gF(zA){}let Ca=(()=>{var r,e,t,i,s,n,o,c,h,f,_,d,g,p,b,x,E,v,S,R,P,M,O,D,w,G,H,ie,ne,ce,k,te,X;let q=bF,W,K=[],Z=[],F,A=[],N=[],Y,se=[],ue=[],pe,Ie=[],Le=[],J,_e=[],ye=[],Ne,Je=[],je=[],yt,Yt=[],kt=[],Et,Gt=[],zt=[],nt,oe=[],ze=[],si,$t=[],oi=[],ti,ii=[],Ct=[],ni,Pt=[],Ht=[],ri,di=[],_i=[],As,rs=[],Bi=[],St,Q=[],V=[],Te,We=[],Me=[],z,be=[],ut=[],Qe,it=[],Ot=[],wt,li=[],gs=[],Ni,Hs=[],$i=[],xn,Xi=[],as=[],tr,yo=[],Eh=[],vh,Il=[],Vr=[],bo,ir=[],sr=[],Gr,nr=[],Vi=[],Dl,Pl=[],wn=[],rr,Ah=[],Ol=[],wl,Rh=[],Fa=[],La,nn=[],Rs=[],Fl,Sh=[],xo=[],Ll,Ba=[],Mh=[],Ss,To=[],Bl=[],Eo,ar=[],Nl=[],Ul,or=[],Ch=[],kl,zl=[],vo=[],Ih,Dh=[],Na=[],rn,Ao=[],Ro=[],lr,cr=[],Vl=[],So,Gl=[],Hr=[],an,Mo=[],Wr=[],Tn,Co=[],Ua=[],Hl,ka=[],za=[],Wl,os=[],Fn=[],Va,Xr=[],Ph=[],Io,Do=[],Yr=[],Ga,Xl=[],Oh=[],wh,Fh=[],Po=[],Lh,Bh=[],Nh=[],Uh,kh=[],Yl=[],zh,Vh=[],Gh=[],Hh,Oo=[],Wh=[],Xh,Yh=[],jl=[],jh,qh=[],Kh=[],Zh,Qh=[],$h=[],Jh,eu=[],tu=[],wo,jr=[],iu=[],ql,Kl=[],Zl=[],Ql,$l=[],hr=[],su,nu=[],ru=[],Jl,ec=[],qr=[],Kr,au=[],Ha=[],tc,ic=[],Fo=[],Lo,sc=[],nc=[],rc,ou=[],lu=[],cu,hu=[],uu=[],ps,Zr=[],ac=[],oc,lc=[],cc=[],Bo,fu=[],ur=[],No,Qr=[],Uo=[],hc,Ln=[],fr=[],ko,uc=[],Bn=[],fc,dc=[],_c=[],du,_u=[],mu=[];return r=class extends q{get diffuseTexture(){return Kt(this,e,"f")}set diffuseTexture(C){Zt(this,e,C,"f")}get ambientTexture(){return Kt(this,t,"f")}set ambientTexture(C){Zt(this,t,C,"f")}get opacityTexture(){return Kt(this,i,"f")}set opacityTexture(C){Zt(this,i,C,"f")}get reflectionTexture(){return Kt(this,s,"f")}set reflectionTexture(C){Zt(this,s,C,"f")}get emissiveTexture(){return Kt(this,n,"f")}set emissiveTexture(C){Zt(this,n,C,"f")}get specularTexture(){return Kt(this,o,"f")}set specularTexture(C){Zt(this,o,C,"f")}get bumpTexture(){return Kt(this,c,"f")}set bumpTexture(C){Zt(this,c,C,"f")}get lightmapTexture(){return Kt(this,h,"f")}set lightmapTexture(C){Zt(this,h,C,"f")}get refractionTexture(){return Kt(this,f,"f")}set refractionTexture(C){Zt(this,f,C,"f")}get useAlphaFromDiffuseTexture(){return Kt(this,_,"f")}set useAlphaFromDiffuseTexture(C){Zt(this,_,C,"f")}get useEmissiveAsIllumination(){return Kt(this,d,"f")}set useEmissiveAsIllumination(C){Zt(this,d,C,"f")}get linkEmissiveWithDiffuse(){return Kt(this,g,"f")}set linkEmissiveWithDiffuse(C){Zt(this,g,C,"f")}get useSpecularOverAlpha(){return Kt(this,p,"f")}set useSpecularOverAlpha(C){Zt(this,p,C,"f")}get useReflectionOverAlpha(){return Kt(this,b,"f")}set useReflectionOverAlpha(C){Zt(this,b,C,"f")}get disableLighting(){return Kt(this,x,"f")}set disableLighting(C){Zt(this,x,C,"f")}get useObjectSpaceNormalMap(){return Kt(this,E,"f")}set useObjectSpaceNormalMap(C){Zt(this,E,C,"f")}get useParallax(){return Kt(this,v,"f")}set useParallax(C){Zt(this,v,C,"f")}get useParallaxOcclusion(){return Kt(this,S,"f")}set useParallaxOcclusion(C){Zt(this,S,C,"f")}get roughness(){return Kt(this,R,"f")}set roughness(C){Zt(this,R,C,"f")}get useLightmapAsShadowmap(){return Kt(this,P,"f")}set useLightmapAsShadowmap(C){Zt(this,P,C,"f")}get diffuseFresnelParameters(){return Kt(this,M,"f")}set diffuseFresnelParameters(C){Zt(this,M,C,"f")}get opacityFresnelParameters(){return Kt(this,O,"f")}set opacityFresnelParameters(C){Zt(this,O,C,"f")}get reflectionFresnelParameters(){return Kt(this,D,"f")}set reflectionFresnelParameters(C){Zt(this,D,C,"f")}get refractionFresnelParameters(){return Kt(this,w,"f")}set refractionFresnelParameters(C){Zt(this,w,C,"f")}get emissiveFresnelParameters(){return Kt(this,G,"f")}set emissiveFresnelParameters(C){Zt(this,G,C,"f")}get useReflectionFresnelFromSpecular(){return Kt(this,H,"f")}set useReflectionFresnelFromSpecular(C){Zt(this,H,C,"f")}get useGlossinessFromSpecularMapAlpha(){return Kt(this,ie,"f")}set useGlossinessFromSpecularMapAlpha(C){Zt(this,ie,C,"f")}get maxSimultaneousLights(){return Kt(this,ne,"f")}set maxSimultaneousLights(C){Zt(this,ne,C,"f")}get invertNormalMapX(){return Kt(this,ce,"f")}set invertNormalMapX(C){Zt(this,ce,C,"f")}get invertNormalMapY(){return Kt(this,k,"f")}set invertNormalMapY(C){Zt(this,k,C,"f")}get twoSidedLighting(){return Kt(this,te,"f")}set twoSidedLighting(C){Zt(this,te,C,"f")}get applyDecalMapAfterDetailMap(){return Kt(this,X,"f")}set applyDecalMapAfterDetailMap(C){Zt(this,X,C,"f")}get isPrePassCapable(){return!this.disableDepthWrite}get canRenderToMRT(){return!0}constructor(C,de,ui=!1){super(C,de,void 0,ui||r.ForceGLSL),this._diffuseTexture=L(this,K,null),e.set(this,(L(this,Z),L(this,A,void 0))),this._ambientTexture=(L(this,N),L(this,se,null)),t.set(this,(L(this,ue),L(this,Ie,void 0))),this._opacityTexture=(L(this,Le),L(this,_e,null)),i.set(this,(L(this,ye),L(this,Je,void 0))),this._reflectionTexture=(L(this,je),L(this,Yt,null)),s.set(this,(L(this,kt),L(this,Gt,void 0))),this._emissiveTexture=(L(this,zt),L(this,oe,null)),n.set(this,(L(this,ze),L(this,$t,void 0))),this._specularTexture=(L(this,oi),L(this,ii,null)),o.set(this,(L(this,Ct),L(this,Pt,void 0))),this._bumpTexture=(L(this,Ht),L(this,di,null)),c.set(this,(L(this,_i),L(this,rs,void 0))),this._lightmapTexture=(L(this,Bi),L(this,Q,null)),h.set(this,(L(this,V),L(this,We,void 0))),this._refractionTexture=(L(this,Me),L(this,be,null)),f.set(this,(L(this,ut),L(this,it,void 0))),this.ambientColor=(L(this,Ot),L(this,li,new tt(0,0,0))),this.diffuseColor=(L(this,gs),L(this,Hs,new tt(1,1,1))),this.specularColor=(L(this,$i),L(this,Xi,new tt(1,1,1))),this.emissiveColor=(L(this,as),L(this,yo,new tt(0,0,0))),this.specularPower=(L(this,Eh),L(this,Il,64)),this._useAlphaFromDiffuseTexture=(L(this,Vr),L(this,ir,!1)),_.set(this,(L(this,sr),L(this,nr,void 0))),this._useEmissiveAsIllumination=(L(this,Vi),L(this,Pl,!1)),d.set(this,(L(this,wn),L(this,Ah,void 0))),this._linkEmissiveWithDiffuse=(L(this,Ol),L(this,Rh,!1)),g.set(this,(L(this,Fa),L(this,nn,void 0))),this._useSpecularOverAlpha=(L(this,Rs),L(this,Sh,!1)),p.set(this,(L(this,xo),L(this,Ba,void 0))),this._useReflectionOverAlpha=(L(this,Mh),L(this,To,!1)),b.set(this,(L(this,Bl),L(this,ar,void 0))),this._disableLighting=(L(this,Nl),L(this,or,!1)),x.set(this,(L(this,Ch),L(this,zl,void 0))),this._useObjectSpaceNormalMap=(L(this,vo),L(this,Dh,!1)),E.set(this,(L(this,Na),L(this,Ao,void 0))),this._useParallax=(L(this,Ro),L(this,cr,!1)),v.set(this,(L(this,Vl),L(this,Gl,void 0))),this._useParallaxOcclusion=(L(this,Hr),L(this,Mo,!1)),S.set(this,(L(this,Wr),L(this,C
204o,void 0))),this.parallaxScaleBias=(L(this,Ua),L(this,ka,.05)),this._roughness=(L(this,za),L(this,os,0)),R.set(this,(L(this,Fn),L(this,Xr,void 0))),this.indexOfRefraction=(L(this,Ph),L(this,Do,.98)),this.invertRefractionY=(L(this,Yr),L(this,Xl,!0)),this.alphaCutOff=(L(this,Oh),L(this,Fh,.4)),this._useLightmapAsShadowmap=(L(this,Po),L(this,Bh,!1)),P.set(this,(L(this,Nh),L(this,kh,void 0))),this._diffuseFresnelParameters=(L(this,Yl),L(this,Vh,void 0)),M.set(this,(L(this,Gh),L(this,Oo,void 0))),this._opacityFresnelParameters=(L(this,Wh),L(this,Yh,void 0)),O.set(this,(L(this,jl),L(this,qh,void 0))),this._reflectionFresnelParameters=(L(this,Kh),L(this,Qh,void 0)),D.set(this,(L(this,$h),L(this,eu,void 0))),this._refractionFresnelParameters=(L(this,tu),L(this,jr,void 0)),w.set(this,(L(this,iu),L(this,Kl,void 0))),this._emissiveFresnelParameters=(L(this,Zl),L(this,$l,void 0)),G.set(this,(L(this,hr),L(this,nu,void 0))),this._useReflectionFresnelFromSpecular=(L(this,ru),L(this,ec,!1)),H.set(this,(L(this,qr),L(this,au,void 0))),this._useGlossinessFromSpecularMapAlpha=(L(this,Ha),L(this,ic,!1)),ie.set(this,(L(this,Fo),L(this,sc,void 0))),this._maxSimultaneousLights=(L(this,nc),L(this,ou,4)),ne.set(this,(L(this,lu),L(this,hu,void 0))),this._invertNormalMapX=(L(this,uu),L(this,Zr,!1)),ce.set(this,(L(this,ac),L(this,lc,void 0))),this._invertNormalMapY=(L(this,cc),L(this,fu,!1)),k.set(this,(L(this,ur),L(this,Qr,void 0))),this._twoSidedLighting=(L(this,Uo),L(this,Ln,!1)),te.set(this,(L(this,fr),L(this,uc,void 0))),this._applyDecalMapAfterDetailMap=(L(this,Bn),L(this,dc,!1)),X.set(this,(L(this,_c),L(this,_u,void 0))),this._shadersLoaded=(L(this,mu),!1),this._vertexPullingMetadata=null,this._renderTargets=new Ps(16),this._globalAmbientColor=new tt(0,0,0),this._cacheHasRenderTargetTextures=!1,this.detailMap=new dF(this),this._attachImageProcessingConfiguration(null),this.prePassConfiguration=new QT,this.getRenderTargetTextures=()=>(this._renderTargets.reset(),r.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),r.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._renderTargets.push(this._refractionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets)}get hasRenderTargetTextures(){return r.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget||r.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget?!0:this._cacheHasRenderTargetTextures}getClassName(){return"StandardMaterial"}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:this._disableAlphaBlending?!1:this.alpha<1||this._opacityTexture!=null||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:this._hasAlphaChannel()&&(this._transparencyMode==null||this._transparencyMode===wi.MATERIAL_ALPHATEST)}_shouldUseAlphaFromDiffuseTexture(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==wi.MATERIAL_OPAQUE}_hasAlphaChannel(){return this._diffuseTexture!=null&&this._diffuseTexture.hasAlpha||this._opacityTexture!=null}getAlphaTestTexture(){return this._diffuseTexture}isReadyForSubMesh(C,de,ui=!1){this._uniformBufferLayoutBuilt||this.buildUniformLayout();const Bt=de._drawWrapper;if(Bt.effect&&this.isFrozen&&Bt._wasPreviouslyReady&&Bt._wasPreviouslyUsingInstances===ui)return!0;de.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),de.materialDefines=new yF(this._eventInfo.defineNames));const Nt=this.getScene(),xe=de.materialDefines;if(this._isReadyForSubMesh(de))return!0;const Ws=Nt.getEngine();if(xe._needNormals=nw(Nt,C,xe,!0,this._maxSimultaneousLights,this._disableLighting),!sw(Nt,C,this._maxSimultaneousLights,this._disableLighting))return!1;_w(Nt,xe);
vendor: 9,133 bytes, line 204
204const on=this.needAlphaBlendingForMesh(C)&&this.getScene().useOrderIndependentTransparency;if(gw(Nt,xe,this.canRenderToMRT&&!on),mw(Nt,xe,on),zs.PrepareDefines(Ws.currentRenderPassId,C,xe),xe._areTexturesDirty){this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,xe._needUVs=!1;for(let ys=1;ys<=6;++ys)xe["MAINUV"+ys]=!1;if(Nt.texturesEnabled){if(xe.DIFFUSEDIRECTUV=0,xe.BUMPDIRECTUV=0,xe.AMBIENTDIRECTUV=0,xe.OPACITYDIRECTUV=0,xe.EMISSIVEDIRECTUV=0,xe.SPECULARDIRECTUV=0,xe.LIGHTMAPDIRECTUV=0,this._diffuseTexture&&r.DiffuseTextureEnabled)if(this._diffuseTexture.isReadyOrNotBlocking())va(this._diffuseTexture,xe,"DIFFUSE");else return!1;else xe.DIFFUSE=!1;if(this._ambientTexture&&r.AmbientTextureEnabled)if(this._ambientTexture.isReadyOrNotBlocking())va(this._ambientTexture,xe,"AMBIENT");else return!1;else xe.AMBIENT=!1;if(this._opacityTexture&&r.OpacityTextureEnabled)if(this._opacityTexture.isReadyOrNotBlocking())va(this._opacityTexture,xe,"OPACITY"),xe.OPACITYRGB=this._opacityTexture.getAlphaFromRGB;else return!1;else xe.OPACITY=!1;if(this._reflectionTexture&&r.ReflectionTextureEnabled?(xe.ROUGHNESS=this._roughness>0,xe.REFLECTIONOVERALPHA=this._useReflectionOverAlpha):(xe.ROUGHNESS=!1,xe.REFLECTIONOVERALPHA=!1),!rw(Nt,this._reflectionTexture,xe))return!1;if(this._emissiveTexture&&r.EmissiveTextureEnabled)if(this._emissiveTexture.isReadyOrNotBlocking())va(this._emissiveTexture,xe,"EMISSIVE");else return!1;else xe.EMISSIVE=!1;if(this._lightmapTexture&&r.LightmapTextureEnabled)if(this._lightmapTexture.isReadyOrNotBlocking())va(this._lightmapTexture,xe,"LIGHTMAP"),xe.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,xe.RGBDLIGHTMAP=this._lightmapTexture.isRGBD;else return!1;else xe.LIGHTMAP=!1;if(this._specularTexture&&r.SpecularTextureEnabled)if(this._specularTexture.isReadyOrNotBlocking())va(this._specularTexture,xe,"SPECULAR"),xe.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha;else return!1;else xe.SPECULAR=!1;if(Nt.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&r.BumpTextureEnabled){if(this._bumpTexture.isReady())va(this._bumpTexture,xe,"BUMP"),xe.PARALLAX=this._useParallax,xe.PARALLAX_RHS=Nt.useRightHandedSystem,xe.PARALLAXOCCLUSION=this._useParallaxOcclusion;else return!1;xe.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else xe.BUMP=!1,xe.PARALLAX=!1,xe.PARALLAX_RHS=!1,xe.PARALLAXOCCLUSION=!1;if(this._refractionTexture&&r.RefractionTextureEnabled)if(this._refractionTexture.isReadyOrNotBlocking())xe._needUVs=!0,xe.REFRACTION=!0,xe.REFRACTIONMAP_3D=this._refractionTexture.isCube,xe.RGBDREFRACTION=this._refractionTexture.isRGBD,xe.USE_LOCAL_REFRACTIONMAP_CUBIC=!!this._refractionTexture.boundingBoxSize;else return!1;else xe.REFRACTION=!1;xe.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else xe.DIFFUSE=!1,xe.AMBIENT=!1,xe.OPACITY=!1,xe.REFLECTION=!1,xe.EMISSIVE=!1,xe.LIGHTMAP=!1,xe.BUMP=!1,xe.REFRACTION=!1;xe.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),xe.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,xe.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,xe.SPECULAROVERALPHA=this._useSpecularOverAlpha,xe.PREMULTIPLYALPHA=this.alphaMode===7||this.alphaMode===8,xe.ALPHATEST_AFTERALLALPHACOMPUTATIONS=this.transparencyMode!==null,xe.ALPHABLEND=this.transparencyMode===null||this.needAlphaBlendingForMesh(C),xe.TEXTURE_REPETITION_MODE=Ws.version>1||Ws.isWebGPU?this.textureRepetitionMode:0}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=xe,this._eventInfo.subMesh=de,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(xe._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(xe),xe.IS_REFLECTION_LINEAR=this.reflectionTexture!=null&&!this.reflectionTexture.gammaSpace,xe.IS_REFRACTION_LINEAR=this.refractionTexture!=null&&!this.refractionTexture.gammaSpace}if(xe._areFresnelDirty&&(r.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(xe.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,xe.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,xe.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,xe.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,xe.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,xe.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,xe._needNormals=!0,xe.FRESNEL=!0):xe.FRESNEL=!1),xe.AREALIGHTUSED||xe.CLUSTLIGHT_BATCH){for(let ys=0;ys<C.lightSources.length;ys++)if(!C.lightSources[ys]._isReady())return!1}iw(C,Nt,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(C),xe,this._applyDecalMapAfterDetailMap,this._useVertexPulling,de.getRenderingMesh(),this._isVertexOutputInvariant),ow(Nt,Ws,this,xe,ui,null,de.getRenderingMesh().hasThinInstances),this._eventInfo.defines=xe,this._eventInfo.mesh=C,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),dw(C,xe,!0,!0,!0),this._callbackPluginEventPrepareDefines(this._eventInfo);let En=!1;if(xe.isDirty){const ys=xe._areLightsDisposed;xe.markAsProcessed();const rt=new VA;xe.REFLECTION&&rt.addFallback(0,"REFLECTION"),xe.SPECULAR&&rt.addFallback(0,"SPECULAR"),xe.BUMP&&rt.addFallback(0,"BUMP"),xe.PARALLAX&&rt.addFallback(1,"PARALLAX"),xe.PARALLAX_RHS&&rt.addFallback(1,"PARALLAX_RHS"),xe.PARALLAXOCCLUSION&&rt.addFallback(0,"PARALLAXOCCLUSION"),xe.SPECULAROVERALPHA&&rt.addFallback(0,"SPECULAROVERALPHA"),xe.FOG&&rt.addFallback(1,"FOG"),xe.POINTSIZE&&rt.addFallback(0,"POINTSIZE"),xe.LOGARITHMICDEPTH&&rt.addFallback(0,"LOGARITHMICDEPTH"),ew(xe,rt,this._maxSimultaneousLights),xe.SPECULARTERM&&rt.addFallback(0,"SPECULARTERM"),xe.DIFFUSEFRESNEL&&rt.addFallback(1,"DIFFUSEFRESNEL"),xe.OPACITYFRESNEL&&rt.addFallback(2,"OPACITYFRESNEL"),xe.REFLECTIONFRESNEL&&rt.addFallback(3,"REFLECTIONFRESNEL"),xe.EMISSIVEFRESNEL&&rt.addFallback(4,"EMISSIVEFRESNEL"),xe.FRESNEL&&rt.addFallback(4,"FRESNEL"),xe.MULTIVIEW&&rt.addFallback(0,"MULTIVIEW");const Yi=[U.PositionKind];xe.NORMAL&&Yi.push(U.NormalKind),xe.TANGENT&&Yi.push(U.TangentKind);for(let Nn=1;Nn<=6;++Nn)xe["UV"+Nn]&&Yi.push(`uv${Nn===1?"":Nn}`);xe.VERTEXCOLOR&&Yi.push(U.ColorKind),$O(Yi,C,xe,rt),JO(Yi,xe),AA(Yi,C,xe),KO(Yi,C,xe);let vn="default";const ls=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","diffuseMatrix","ambientMatrix","opacityMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vRefractionPosition","vRefractionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureInfo","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo","vTextureRepetitionHexTilingParams"],dr=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"];bw(ls,dr);const ss=["Material","Scene","Mesh"],zo={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:xe.NUM_MORPH_INFLUENCERS};if(this._eventInfo.fallbacks=rt,this._eventInfo.fallbackRank=0,this._eventInfo.defines=xe,this._eventInfo.uniforms=ls,this._eventInfo.attributes=Yi,this._eventInfo.samplers=dr,this._eventInfo.uniformBuffersNames=ss,this._eventInfo.customCode=void 0,this._eventInfo.mesh=C,this._eventInfo.indexParameters=zo,this._callbackPluginEventGeneric(128,this._eventInfo),zs.AddUniformsAndSamplers(ls,dr),QT.AddUniforms(ls),Da&&(Da.PrepareUniforms(ls,xe),Da.PrepareSamplers(dr,xe)),xw({uniformsNames:ls,uniformBuffersNames:ss,samplers:dr,defines:xe,maxSimultaneousLights:this._maxSimultaneousLights,shaderLanguage:this._shaderLanguage}),xA(ls),this._useVertexPulling){const mc=de.getRenderingMesh()?.geometry;mc&&(this._vertexPullingMetadata=GA(mc),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((pu,yu)=>{ls.push(`vp_${yu}_info`)}))}else this._vertexPullingMetadata=null;const ln={};this.customShaderNameResolve&&(vn=this.customShaderNameResolve(vn,ls,ss,dr,xe,Yi,ln));const gu=xe.toString(),Vo=de.effect,cn=Nt.getEngine().createEffe
vendor: 16,717 bytes, line 204
204ct(vn,{attributes:Yi,uniformsNames:ls,uniformBuffersNames:ss,samplers:dr,defines:gu,fallbacks:rt,onCompiled:this.onCompiled,onError:this.onError,indexParameters:zo,processFinalCode:ln.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:xe.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{this._shaderLanguage===1?await Promise.all([ts(()=>import("./default.vertex-DtXBXzGv.js"),__vite__mapDeps([5,6,7,8])),ts(()=>import("./default.fragment-_slWTR4t.js"),__vite__mapDeps([9,6,7,10]))]):await Promise.all([ts(()=>import("./default.vertex-YaDokP-M.js"),__vite__mapDeps([11,12,13,14])),ts(()=>import("./default.fragment-DhVffv6K.js"),__vite__mapDeps([15,12,13,16]))]),this._shadersLoaded=!0}},Ws);if(this._eventInfo.customCode=void 0,cn)if(this._onEffectCreatedObservable&&(xm.effect=cn,xm.subMesh=de,this._onEffectCreatedObservable.notifyObservers(xm)),this.allowShaderHotSwapping&&Vo&&!cn.isReady()){if(xe.markAsUnprocessed(),En=this.isFrozen,ys)return xe._areLightsDisposed=!0,!1}else Nt.resetCachedMaterial(),de.setEffect(cn,xe,this._materialContext)}return!de.effect||!de.effect.isReady()?!1:(xe._renderId=Nt.getRenderId(),Bt._wasPreviouslyReady=!En,Bt._wasPreviouslyUsingInstances=ui,this._checkScenePerformancePriority(),!0)}buildUniformLayout(){const C=this._uniformBuffer;C.addUniform("diffuseLeftColor",4),C.addUniform("diffuseRightColor",4),C.addUniform("opacityParts",4),C.addUniform("reflectionLeftColor",4),C.addUniform("reflectionRightColor",4),C.addUniform("refractionLeftColor",4),C.addUniform("refractionRightColor",4),C.addUniform("emissiveLeftColor",4),C.addUniform("emissiveRightColor",4),C.addUniform("vDiffuseInfos",2),C.addUniform("vAmbientInfos",2),C.addUniform("vOpacityInfos",2),C.addUniform("vEmissiveInfos",2),C.addUniform("vLightmapInfos",2),C.addUniform("vSpecularInfos",2),C.addUniform("vBumpInfos",3),C.addUniform("diffuseMatrix",16),C.addUniform("ambientMatrix",16),C.addUniform("opacityMatrix",16),C.addUniform("emissiveMatrix",16),C.addUniform("lightmapMatrix",16),C.addUniform("specularMatrix",16),C.addUniform("bumpMatrix",16),C.addUniform("vTangentSpaceParams",2),C.addUniform("pointSize",1),C.addUniform("alphaCutOff",1),C.addUniform("refractionMatrix",16),C.addUniform("vRefractionInfos",4),C.addUniform("vRefractionPosition",3),C.addUniform("vRefractionSize",3),C.addUniform("vSpecularColor",4),C.addUniform("vEmissiveColor",3),C.addUniform("vDiffuseColor",4),C.addUniform("vAmbientColor",3),C.addUniform("cameraInfo",4),C.addUniform("vTextureRepetitionHexTilingParams",4),Tw(C,!1,!0),super.buildUniformLayout()}bindForSubMesh(C,de,ui){const Bt=this.getScene(),Nt=ui.materialDefines;if(!Nt)return;const xe=ui.effect;if(!xe)return;this._activeEffect=xe,de.getMeshUniformBuffer().bindToEffect(xe,"Mesh"),de.transferToEffect(C),this._uniformBuffer.bindToEffect(xe,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,Bt,de,C,this.isFrozen),zs.Bind(Bt.getEngine().currentRenderPassId,this._activeEffect,de,C,this);const Ws=Bt.activeCamera;Ws?this._uniformBuffer.updateFloat4("cameraInfo",Ws.minZ,Ws.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0);const on=this.textureRepetitionHexTilingParams;this._uniformBuffer.updateFloat4("vTextureRepetitionHexTilingParams",on[0],on[1],on[2],on[3]),this._eventInfo.subMesh=ui,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),Nt.OBJECTSPACE_NORMALMAP&&(C.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));const En=this._mustRebind(Bt,xe,ui,de.visibility),ys=Bt.getEngine()._features.needToAlwaysBindUniformBuffers;CA(de,xe),this._vertexPullingMetadata&&HA(xe,this._vertexPullingMetadata);const rt=this._uniformBuffer;if(En){if(this.bindViewProjection(xe),!rt.useUbo||!this.isFrozen||!rt.isSync||ui._drawWrapper._forceRebindOnNextCall){if(r.FresnelEnabled&&Nt.FRESNEL){if(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(rt.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),rt.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled){const Yi=oo.Color3[0];Yi.set(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),rt.updateColor4("opacityParts",Yi,this.opacityFresnelParameters.power)}this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(rt.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),rt.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(rt.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),rt.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(rt.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),rt.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))}if(Bt.texturesEnabled&&(this._diffuseTexture&&r.DiffuseTextureEnabled&&(rt.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),Aa(this._diffuseTexture,rt,"diffuse")),this._ambientTexture&&r.AmbientTextureEnabled&&(rt.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),Aa(this._ambientTexture,rt,"ambient")),this._opacityTexture&&r.OpacityTextureEnabled&&(rt.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),Aa(this._opacityTexture,rt,"opacity")),this._hasAlphaChannel()&&rt.updateFloat("alphaCutOff",this.alphaCutOff),qO(Bt,Nt,rt,tt.White(),this._reflectionTexture,!1,!1,!0,!1,!1,!1,this.roughness),(!this._reflectionTexture||!r.ReflectionTextureEnabled)&&rt.updateFloat2("vReflectionInfos",0,this.roughness),this._emissiveTexture&&r.EmissiveTextureEnabled&&(rt.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),Aa(this._emissiveTexture,rt,"emissive")),this._lightmapTexture&&r.LightmapTextureEnabled&&(rt.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),Aa(this._lightmapTexture,rt,"lightmap")),this._specularTexture&&r.SpecularTextureEnabled&&(rt.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),Aa(this._specularTexture,rt,"specular")),this._bumpTexture&&Bt.getEngine().getCaps().standardDerivatives&&r.BumpTextureEnabled&&(rt.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),Aa(this._bumpTexture,rt,"bump"),Bt._mirroredCameraPosition?rt.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):rt.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&r.RefractionTextureEnabled)){let Yi=1;if(this._refractionTexture.isCube||(rt.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(Yi=this._refractionTexture.depth)),rt.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,Yi,this.invertRefractionY?-1:1),this._refractionTexture.boundingBoxSize){const vn=this._refractionTexture;rt.updateVector3("vRefractionPosition",vn.boundingBoxPosition),rt.updateVector3("vRefractionSize",vn.boundingBoxSize)}}this.pointsCloud&&rt.updateFloat("pointSize",this.pointSize),rt.updateColor4("vSpecularColor",this.specularColor,this.specularPower),rt.updateColor3("vEmissiveColor",r.EmissiveTextureEnabled?this.emissiveColor:tt.BlackReadOnly),rt.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha),Bt.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),rt.updateColor3("vAmbientColor",this._globalAmbientColor)}Bt.texturesEnabled&&(this._diffuseTexture&&r.DiffuseTextureEnabled&&xe.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&r.AmbientTextureEnabled&&xe.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&r.OpacityTextureEnabled&&xe.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&r.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?xe.setTexture("reflectionCubeSampler",this._reflectionTexture):xe.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&r.EmissiveTextureEnabled&&xe.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&r.LightmapTextureEnabled&&xe.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&r.SpecularTextureEnabled&&xe.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&Bt.getEngine().getCaps().standardDerivatives&&r.BumpTextureEnabled&&xe.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&r.RefractionTextureEnabled&&(this._refractionTexture.isCube?xe.setTexture("refractionCubeSampler",this._refractionTexture):xe.setTexture("refraction2DSampler",this._refractionTexture))),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(de)&&this.getScene().depthPeelingRenderer.bind(xe),this._eventInfo.subMesh=ui,this._callbackPluginEventBindForSubMesh(this._eventInfo),TA(xe,this,Bt),this.bindEyePosition(xe)}else ys&&(this._needToBindSceneUbo=!0);(En||!this.isFrozen||ys)&&Bt.lightsEnabled&&!this._disableLighting&&QO(Bt,de,xe,Nt,this._maxSimultaneousLights),(En||!this.isFrozen)&&((Bt.fogEnabled&&de.applyFog&&Bt.fogMode!==De.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture||de.receiveShadows||Nt.PREPASS||Nt.CLUSTLIGHT_BATCH)&&this.bindView(xe),vA(Bt,de,xe),Nt.NUM_MORPH_INFLUENCERS&&SA(de,xe),Nt.BAKED_VERTEX_ANIMATION_TEXTURE&&de.bakedVertexAnimationManager?.bind(xe,Nt.INSTANCES),this.useLogarithmicDepth&&EA(Nt,xe,Bt),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(de,this._activeEffect,ui),rt.update()}getAnimatables(){const C=super.getAnimatables();return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&C.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&C.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&C.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&C.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&C.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&C.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&C.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&C.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&C.push(this._refractionTexture),C}getActiveTextures(){const C=super.getActiveTextures();return this._diffuseTexture&&C.push(this._diffuseTexture),this._ambientTexture&&C.push(this._ambientTexture),this._opacityTexture&&C.push(this._opacityTexture),this._reflectionTexture&&C.push(this._reflectionTexture),this._emissiveTexture&&C.push(this._emissiveTexture),this._specularTexture&&C.push(this._specularTexture),this._bumpTexture&&C.push(this._bumpTexture),this._lightmapTexture&&C.push(this._lightmapTexture),this._refractionTexture&&C.push(this._refractionTexture),C}hasTexture(C){return!!(super.hasTexture(C)||this._diffuseTexture===C||this._ambientTexture===C||this._opacityTexture===C||this._reflectionTexture===C||this._emissiveTexture===C||this._specularTexture===C||this._bumpTexture===C||this._lightmapTexture===C||this._refractionTexture===C)}dispose(C,de){de&&(this._diffuseTexture?.dispose(),this._ambientTexture?.dispose(),this._opacityTexture?.dispose(),this._reflectionTexture?.dispose(),this._emissiveTexture?.dispose(),this._specularTexture?.dispose(),this._bumpTexture?.dispose(),this._lightmapTexture?.dispose(),this._refractionTexture?.dispose()),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(C,de)}clone(C,de=!0,ui=""){const Bt=Tt.Clone(()=>new r(C,this.getScene()),this,{cloneTexturesOnlyOnce:de});return Bt.name=C,Bt.id=C,this.stencil.copyTo(Bt.stencil),this._clonePlugins(Bt,ui),Bt}static Parse(C,de,ui){const Bt=Tt.Parse(()=>new r(C.name,de),C,de,ui);return C.stencil&&Bt.stencil.parse(C.stencil,de,ui),wi._ParsePlugins(C,Bt,de,ui),Bt}static get DiffuseTextureEnabled(){return pt.DiffuseTextureEnabled}static set DiffuseTextureEnabled(C){pt.DiffuseTextureEnabled=C}static get DetailTextureEnabled(){return pt.DetailTextureEnabled}static set DetailTextureEnabled(C){pt.DetailTextureEnabled=C}static get AmbientTextureEnabled(){return pt.AmbientTextureEnabled}static set AmbientTextureEnabled(C){pt.AmbientTextureEnabled=C}static get OpacityTextureEnabled(){return pt.OpacityTextureEnabled}static set OpacityTextureEnabled(C){pt.OpacityTextureEnabled=C}static get ReflectionTextureEnabled(){return pt.ReflectionTextureEnabled}static set ReflectionTextureEnabled(C){pt.ReflectionTextureEnabled=C}static get EmissiveTextureEnabled(){return pt.EmissiveTextureEnabled}static set EmissiveTextureEnabled(C){pt.EmissiveTextureEnabled=C}static get SpecularTextureEnabled(){return pt.SpecularTextureEnabled}static set SpecularTextureEnabled(C){pt.SpecularTextureEnabled=C}static get BumpTextureEnabled(){return pt.BumpTextureEnabled}static set BumpTextureEnabled(C){pt.BumpTextureEnabled=C}static get LightmapTextureEnabled(){return pt.LightmapTextureEnabled}static set LightmapTextureEnabled(C){pt.LightmapTextureEnabled=C}static get RefractionTextureEnabled(){return pt.RefractionTextureEnabled}static set RefractionTextureEnabled(C){pt.RefractionTextureEnabled=C}static get ColorGradingTextureEnabled(){return pt.ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(C){pt.ColorGradingTextureEnabled=C}static get FresnelEnabled(){return pt.FresnelEnabled}static set FresnelEnabled(C){pt.FresnelEnabled=C}},e=new WeakMap,t=new WeakMap,i=new WeakMap,s=new WeakMap,n=new WeakMap,o=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakMap,_=new WeakMap,d=new WeakMap,g=new WeakMap,p=new WeakMap,b=new WeakMap,x=new WeakMap,E=new WeakMap,v=new WeakMap,S=new WeakMap,R=new WeakMap,P=new WeakMap,M=new WeakMap,O=new WeakMap,D=new WeakMap,w=new WeakMap,G=new WeakMap,H=new WeakMap,ie=new WeakMap,ne=new WeakMap,ce=new WeakMap,k=new WeakMap,te=new WeakMap,X=new WeakMap,(()=>{const $e=typeof Symbol=="function"&&Symbol.metadata?Object.create(q[Symbol.metadata]??null):void 0;W=[yn("diffuseTexture")],F=[Qt("_markAllSubMeshesAsTexturesAndMiscDirty")],Y=[yn("ambientTexture")],pe=[Qt("_markAllSubMeshesAsTexturesDirty")],J=[yn("opacityTexture")],Ne=[Qt("_markAllSubMeshesAsTexturesAndMiscDirty")],yt=[yn("reflectionTexture")],Et=[Qt("_markAllSubMeshesAsTexturesDirty")],nt=[yn("emissiveTexture")],si=[Qt("_markAllSubMeshesAsTexturesDirty")],ti=[yn("specularTexture")],ni=[Qt("_markAllSubMeshesAsTexturesDirty")],ri=[yn("bumpTexture")],As=[Qt("_markAllSubMeshesAsTexturesDirty")],St=[yn("lightmapTexture")],Te=[Qt("_markAllSubMeshesAsTexturesDirty")],z=[yn("refractionTexture")],Qe=[Qt("_markAllSubMeshesAsTexturesDirty")],wt=[lo("ambient")],Ni=[lo("diffuse")],xn=[lo("specular")],tr=[lo("emissive")],vh=[he()],bo=[he("useAlphaFromDiffuseTexture")],Gr=[Qt("_markAllSubMeshesAsTexturesAndMiscDirty")],Dl=[he("useEmissiveAsIllumination")],rr=[Qt("_markAllSubMeshesAsTexturesDirty")],wl=[he("linkEmissiveWithDiffuse")],La=[Qt("_markAllSubMeshesAsTexturesDirty")],Fl=[he("useSpecularOverAlpha")],Ll=[Qt("_markAllSubMeshesAsTexturesDirty")],Ss=[he("useReflectionOverAlpha")],Eo=[Qt("_markAllSubMeshesAsTexturesDirty")],Ul=[he("disableLighting")],kl=[Qt("_markAllSubMeshesAsLightsDirt
204y")],Ih=[he("useObjectSpaceNormalMap")],rn=[Qt("_markAllSubMeshesAsTexturesDirty")],lr=[he("useParallax")],So=[Qt("_markAllSubMeshesAsTexturesDirty")],an=[he("useParallaxOcclusion")],Tn=[Qt("_markAllSubMeshesAsTexturesDirty")],Hl=[he()],Wl=[he("roughness")],Va=[Qt("_markAllSubMeshesAsTexturesDirty")],Io=[he()],Ga=[he()],wh=[he()],Lh=[he("useLightmapAsShadowmap")],Uh=[Qt("_markAllSubMeshesAsTexturesDirty")],zh=[Qc("diffuseFresnelParameters")],Hh=[Qt("_markAllSubMeshesAsFresnelDirty")],Xh=[Qc("opacityFresnelParameters")],jh=[Qt("_markAllSubMeshesAsFresnelAndMiscDirty")],Zh=[Qc("reflectionFresnelParameters")],Jh=[Qt("_markAllSubMeshesAsFresnelDirty")],wo=[Qc("refractionFresnelParameters")],ql=[Qt("_markAllSubMeshesAsFresnelDirty")],Ql=[Qc("emissiveFresnelParameters")],su=[Qt("_markAllSubMeshesAsFresnelDirty")],Jl=[he("useReflectionFresnelFromSpecular")],Kr=[Qt("_markAllSubMeshesAsFresnelDirty")],tc=[he("useGlossinessFromSpecularMapAlpha")],Lo=[Qt("_markAllSubMeshesAsTexturesDirty")],rc=[he("maxSimultaneousLights")],cu=[Qt("_markAllSubMeshesAsLightsDirty")],ps=[he("invertNormalMapX")],oc=[Qt("_markAllSubMeshesAsTexturesDirty")],Bo=[he("invertNormalMapY")],No=[Qt("_markAllSubMeshesAsTexturesDirty")],hc=[he("twoSidedLighting")],ko=[Qt("_markAllSubMeshesAsTexturesDirty")],fc=[he("applyDecalMapAfterDetailMap")],du=[Qt("_markAllSubMeshesAsMiscDirty")],$(r,null,F,{kind:"accessor",name:"diffuseTexture",static:!1,private:!1,access:{has:C=>"diffuseTexture"in C,get:C=>C.diffuseTexture,set:(C,de)=>{C.diffuseTexture=de}},metadata:$e},A,N),$(r,null,pe,{kind:"accessor",name:"ambientTexture",static:!1,private:!1,access:{has:C=>"ambientTexture"in C,get:C=>C.ambientTexture,set:(C,de)=>{C.ambientTexture=de}},metadata:$e},Ie,Le),$(r,null,Ne,{kind:"accessor",name:"opacityTexture",static:!1,private:!1,access:{has:C=>"opacityTexture"in C,get:C=>C.opacityTexture,set:(C,de)=>{C.opacityTexture=de}},metadata:$e},Je,je),$(r,null,Et,{kind:"accessor",name:"reflectionTexture",static:!1,private:!1,access:{has:C=>"reflectionTexture"in C,get:C=>C.reflectionTexture,set:(C,de)=>{C.reflectionTexture=de}},metadata:$e},Gt,zt),$(r,null,si,{kind:"accessor",name:"emissiveTexture",static:!1,private:!1,access:{has:C=>"emissiveTexture"in C,get:C=>C.emissiveTexture,set:(C,de)=>{C.emissiveTexture=de}},metadata:$e},$t,oi),$(r,null,ni,{kind:"accessor",name:"specularTexture",static:!1,private:!1,access:{has:C=>"specularTexture"in C,get:C=>C.specularTexture,set:(C,de)=>{C.specularTexture=de}},metadata:$e},Pt,Ht),$(r,null,As,{kind:"accessor",name:"bumpTexture",static:!1,private:!1,access:{has:C=>"bumpTexture"in C,get:C=>C.bumpTexture,set:(C,de)=>{C.bumpTexture=de}},metadata:$e},rs,Bi),$(r,null,Te,{kind:"accessor",name:"lightmapTexture",static:!1,private:!1,access:{has:C=>"lightmapTexture"in C,get:C=>C.lightmapTexture,set:(C,de)=>{C.lightmapTexture=de}},metadata:$e},We,Me),$(r,null,Qe,{kind:"accessor",name:"refractionTexture",static:!1,private:!1,access:{has:C=>"refractionTexture"in C,get:C=>C.refractionTexture,set:(C,de)=>{C.refractionTexture=de}},metadata:$e},it,Ot),$(r,null,Gr,{kind:"accessor",name:"useAlphaFromDiffuseTexture",static:!1,private:!1,access:{has:C=>"useAlphaFromDiffuseTexture"in C,get:C=>C.useAlphaFromDiffuseTexture,set:(C,de)=>{C.useAlphaFromDiffuseTexture=de}},metadata:$e},nr,Vi),$(r,null,rr,{kind:"accessor",name:"useEmissiveAsIllumination",static:!1,private:!1,access:{has:C=>"useEmissiveAsIllumination"in C,get:C=>C.useEmissiveAsIllumination,set:(C,de)=>{C.useEmissiveAsIllumination=de}},metadata:$e},Ah,Ol),$(r,null,La,{kind:"accessor",name:"linkEmissiveWithDiffuse",static:!1,private:!1,access:{has:C=>"linkEmissiveWithDiffuse"in C,get:C=>C.linkEmissiveWithDiffuse,set:(C,de)=>{C.linkEmissiveWithDiffuse=de}},metadata:$e},nn,Rs),$(r,null,Ll,{kind:"accessor",name:"useSpecularOverAlpha",static:!1,private:!1,access:{has:C=>"useSpecularOverAlpha"in C,get:C=>C.useSpecularOverAlpha,set:(C,de)=>{C.useSpecularOverAlpha=de}},metadata:$e},Ba,Mh),$(r,null,Eo,{kind:"accessor",name:"useReflectionOverAlpha",static:!1,private:!1,access:{has:C=>"useReflectionOverAlpha"in C,get:C=>C.useReflectionOverAlpha,set:(C,de)=>{C.useReflectionOverAlpha=de}},metadata:$e},ar,Nl),$(r,null,kl,{kind:"accessor",name:"disableLighting",static:!1,private:!1,access:{has:C=>"disableLighting"in C,get:C=>C.disableLighting,set:(C,de)=>{C.disableLighting=de}},metadata:$e},zl,vo),$(r,null,rn,{kind:"accessor",name:"useObjectSpaceNormalMap",static:!1,private:!1,access:{has:C=>"useObjectSpaceNormalMap"in C,get:C=>C.useObjectSpaceNormalMap,set:(C,de)=>{C.useObjectSpaceNormalMap=de}},metadata:$e},Ao,Ro),$(r,null,So,{kind:"accessor",name:"useParallax",static:!1,private:!1,access:{has:C=>"useParallax"in C,get:C=>C.useParallax,set:(C,de)=>{C.useParallax=de}},metadata:$e},Gl,Hr),$(r,null,Tn,{kind:"accessor",name:"useParallaxOcclusion",static:!1,private:!1,access:{has:C=>"useParallaxOcclusion"in C,get:C=>C.useParallaxOcclusion,set:(C,de)=>{C.useParallaxOcclusion=de}},metadata:$e},Co,Ua),$(r,null,Va,{kind:"accessor",name:"roughness",static:!1,private:!1,access:{has:C=>"roughness"in C,get:C=>C.roughness,set:(C,de)=>{C.roughness=de}},metadata:$e},Xr,Ph),$(r,null,Uh,{kind:"accessor",name:"useLightmapAsShadowmap",static:!1,private:!1,access:{has:C=>"useLightmapAsShadowmap"in C,get:C=>C.useLightmapAsShadowmap,set:(C,de)=>{C.useLightmapAsShadowmap=de}},metadata:$e},kh,Yl),$(r,null,Hh,{kind:"accessor",name:"diffuseFresnelParameters",static:!1,private:!1,access:{has:C=>"diffuseFresnelParameters"in C,get:C=>C.diffuseFresnelParameters,set:(C,de)=>{C.diffuseFresnelParameters=de}},metadata:$e},Oo,Wh),$(r,null,jh,{kind:"accessor",name:"opacityFresnelParameters",static:!1,private:!1,access:{has:C=>
204"opacityFresnelParameters"in C,get:C=>C.opacityFresnelParameters,set:(C,de)=>{C.opacityFresnelParameters=de}},metadata:$e},qh,Kh),$(r,null,Jh,{kind:"accessor",name:"reflectionFresnelParameters",static:!1,private:!1,access:{has:C=>"reflectionFresnelParameters"in C,get:C=>C.reflectionFresnelParameters,set:(C,de)=>{C.reflectionFresnelParameters=de}},metadata:$e},eu,tu),$(r,null,ql,{kind:"accessor",name:"refractionFresnelParameters",static:!1,private:!1,access:{has:C=>"refractionFresnelParameters"in C,get:C=>C.refractionFresnelParameters,set:(C,de)=>{C.refractionFresnelParameters=de}},metadata:$e},Kl,Zl),$(r,null,su,{kind:"accessor",name:"emissiveFresnelParameters",static:!1,private:!1,access:{has:C=>"emissiveFresnelParameters"in C,get:C=>C.emissiveFresnelParameters,set:(C,de)=>{C.emissiveFresnelParameters=de}},metadata:$e},nu,ru),$(r,null,Kr,{kind:"accessor",name:"useReflectionFresnelFromSpecular",static:!1,private:!1,access:{has:C=>"useReflectionFresnelFromSpecular"in C,get:C=>C.useReflectionFresnelFromSpecular,set:(C,de)=>{C.useReflectionFresnelFromSpecular=de}},metadata:$e},au,Ha),$(r,null,Lo,{kind:"accessor",name:"useGlossinessFromSpecularMapAlpha",static:!1,private:!1,access:{has:C=>"useGlossinessFromSpecularMapAlpha"in C,get:C=>C.useGlossinessFromSpecularMapAlpha,set:(C,de)=>{C.useGlossinessFromSpecularMapAlpha=de}},metadata:$e},sc,nc),$(r,null,cu,{kind:"accessor",name:"maxSimultaneousLights",static:!1,private:!1,access:{has:C=>"maxSimultaneousLights"in C,get:C=>C.maxSimultaneousLights,set:(C,de)=>{C.maxSimultaneousLights=de}},metadata:$e},hu,uu),$(r,null,oc,{kind:"accessor",name:"invertNormalMapX",static:!1,private:!1,access:{has:C=>"invertNormalMapX"in C,get:C=>C.invertNormalMapX,set:(C,de)=>{C.invertNormalMapX=de}},metadata:$e},lc,cc),$(r,null,No,{kind:"accessor",name:"invertNormalMapY",static:!1,private:!1,access:{has:C=>"invertNormalMapY"in C,get:C=>C.invertNormalMapY,set:(C,de)=>{C.invertNormalMapY=de}},metadata:$e},Qr,Uo),$(r,null,ko,{kind:"accessor",name:"twoSidedLighting",static:!1,private:!1,access:{has:C=>"twoSidedLighting"in C,get:C=>C.twoSidedLighting,set:(C,de)=>{C.twoSidedLighting=de}},metadata:$e},uc,Bn),$(r,null,du,{kind:"accessor",name:"applyDecalMapAfterDetailMap",static:!1,private:!1,access:{has:C=>"applyDecalMapAfterDetailMap"in C,get:C=>C.applyDecalMapAfterDetailMap,set:(C,de)=>{C.applyDecalMapAfterDetailMap=de}},metadata:$e},_u,mu),$(null,null,W,{kind:"field",name:"_diffuseTexture",static:!1,private:!1,access:{has:C=>"_diffuseTexture"in C,get:C=>C._diffuseTexture,set:(C,de)=>{C._diffuseTexture=de}},metadata:$e},K,Z),$(null,null,Y,{kind:"field",name:"_ambientTexture",static:!1,private:!1,access:{has:C=>"_ambientTexture"in C,get:C=>C._ambientTexture,set:(C,de)=>{C._ambientTexture=de}},metadata:$e},se,ue),$(null,null,J,{kind:"field",name:"_opacityTexture",static:!1,private:!1,access:{has:C=>"_opacityTexture"in C,get:C=>C._opacityTexture,set:(C,de)=>{C._opacityTexture=de}},metadata:$e},_e,ye),$(null,null,yt,{kind:"field",name:"_reflectionTexture",static:!1,private:!1,access:{has:C=>"_reflectionTexture"in C,get:C=>C._reflectionTexture,set:(C,de)=>{C._reflectionTexture=de}},metadata:$e},Yt,kt),$(null,null,nt,{kind:"field",name:"_emissiveTexture",static:!1,private:!1,access:{has:C=>"_emissiveTexture"in C,get:C=>C._emissiveTexture,set:(C,de)=>{C._emissiveTexture=de}},metadata:$e},oe,ze),$(null,null,ti,{kind:"field",name:"_specularTexture",static:!1,private:!1,access:{has:C=>"_specularTexture"in C,get:C=>C._specularTexture,set:(C,de)=>{C._specularTexture=de}},metadata:$e},ii,Ct),$(null,null,ri,{kind:"field",name:"_bumpTexture",static:!1,private:!1,access:{has:C=>"_bumpTexture"in C,get:C=>C._bumpTexture,set:(C,de)=>{C._bumpTexture=de}},metadata:$e},di,_i),$(null,null,St,{kind:"field",name:"_lightmapTexture",static:!1,private:!1,access:{has:C=>"_lightmapTexture"in C,get:C=>C._lightmapTexture,set:(C,de)=>{C._lightmapTexture=de}},metadata:$e},Q,V),$(null,null,z,{kind:"field",name:"_refractionTexture",static:!1,private:!1,access:{has:C=>"_refractionTexture"in C,get:C=>C._refractionTexture,set:(C,de)=>{C._refractionTexture=de}},metadata:$e},be,ut),$(null,null,wt,{kind:"field",name:"ambientColor",static:!1,private:!1,access:{has:C=>"ambientColor"in C,get:C=>C.ambientColor,set:(C,de)=>{C.ambientColor=de}},metadata:$e},li,gs),$(null,null,Ni,{kind:"field",name:"diffuseColor",static:!1,private:!1,access:{has:C=>"diffuseColor"in C,get:C=>C.diffuseColor,set:(C,de)=>{C.diffuseColor=de}},metadata:$e},Hs,$i),$(null,null,xn,{kind:"field",name:"specularColor",static:!1,private:!1,access:{has:C=>"specularColor"in C,get:C=>C.specularColor,set:(C,de)=>{C.specularColor=de}},metadata:$e},Xi,as),$(null,null,tr,{kind:"field",name:"emissiveColor",static:!1,private:!1,access:{has:C=>"emissiveColor"in C,get:C=>C.emissiveColor,set:(C,de)=>{C.emissiveColor=de}},metadata:$e},yo,Eh),$(null,null,vh,{kind:"field",name:"specularPower",static:!1,private:!1,access:{has:C=>"specularPower"in C,get:C=>C.specularPower,set:(C,de)=>{C.specularPower=de}},metadata:$e},Il,Vr),$(null,null,bo,{kind:"field",name:"_useAlphaFromDiffuseTexture",static:!1,private:!1,access:{has:C=>"_useAlphaFromDiffuseTexture"in C,get:C=>C._useAlphaFromDiffuseTexture,set:(C,de)=>{C._useAlphaFromDiffuseTexture=de}},metadata:$e},ir,sr),$(null,null,Dl,{kind:"field",name:"_useEmissiveAsIllumination",static:!1,private:!1,access:{has:C=>"_useEmissiveAsIllumination"in C,get:C=>C._useEmissiveAsIllumination,set:(C,de)=>{C._useEmissiveAsIllumination=de}},metadata:$e},Pl,wn),$(null,null,wl,{kind:"field",name:"_linkEmissiveWithDiffuse",static:!1,private:!1,access:{has:C=>"_linkEmissiveWithDiffuse"in C,get:C=>C._linkEmissiveWithDiffuse,set:(C,de)=>{C._linkEmissiveWithDiffuse=de}},metadata:$e},Rh,Fa),$(null,null,Fl,{kind:"field",name:"_useSpecularOverAlpha",static:!1,private:!1,access:{has:C=>
204"_useSpecularOverAlpha"in C,get:C=>C._useSpecularOverAlpha,set:(C,de)=>{C._useSpecularOverAlpha=de}},metadata:$e},Sh,xo),$(null,null,Ss,{kind:"field",name:"_useReflectionOverAlpha",static:!1,private:!1,access:{has:C=>"_useReflectionOverAlpha"in C,get:C=>C._useReflectionOverAlpha,set:(C,de)=>{C._useReflectionOverAlpha=de}},metadata:$e},To,Bl),$(null,null,Ul,{kind:"field",name:"_disableLighting",static:!1,private:!1,access:{has:C=>"_disableLighting"in C,get:C=>C._disableLighting,set:(C,de)=>{C._disableLighting=de}},metadata:$e},or,Ch),$(null,null,Ih,{kind:"field",name:"_useObjectSpaceNormalMap",static:!1,private:!1,access:{has:C=>"_useObjectSpaceNormalMap"in C,get:C=>C._useObjectSpaceNormalMap,set:(C,de)=>{C._useObjectSpaceNormalMap=de}},metadata:$e},Dh,Na),$(null,null,lr,{kind:"field",name:"_useParallax",static:!1,private:!1,access:{has:C=>"_useParallax"in C,get:C=>C._useParallax,set:(C,de)=>{C._useParallax=de}},metadata:$e},cr,Vl),$(null,null,an,{kind:"field",name:"_useParallaxOcclusion",static:!1,private:!1,access:{has:C=>"_useParallaxOcclusion"in C,get:C=>C._useParallaxOcclusion,set:(C,de)=>{C._useParallaxOcclusion=de}},metadata:$e},Mo,Wr),$(null,null,Hl,{kind:"field",name:"parallaxScaleBias",static:!1,private:!1,access:{has:C=>"parallaxScaleBias"in C,get:C=>C.parallaxScaleBias,set:(C,de)=>{C.parallaxScaleBias=de}},metadata:$e},ka,za),$(null,null,Wl,{kind:"field",name:"_roughness",static:!1,private:!1,access:{has:C=>"_roughness"in C,get:C=>C._roughness,set:(C,de)=>{C._roughness=de}},metadata:$e},os,Fn),$(null,null,Io,{kind:"field",name:"indexOfRefraction",static:!1,private:!1,access:{has:C=>"indexOfRefraction"in C,get:C=>C.indexOfRefraction,set:(C,de)=>{C.indexOfRefraction=de}},metadata:$e},Do,Yr),$(null,null,Ga,{kind:"field",name:"invertRefractionY",static:!1,private:!1,access:{has:C=>"invertRefractionY"in C,get:C=>C.invertRefractionY,set:(C,de)=>{C.invertRefractionY=de}},metadata:$e},Xl,Oh),$(null,null,wh,{kind:"field",name:"alphaCutOff",static:!1,private:!1,access:{has:C=>"alphaCutOff"in C,get:C=>C.alphaCutOff,set:(C,de)=>{C.alphaCutOff=de}},metadata:$e},Fh,Po),$(null,null,Lh,{kind:"field",name:"_useLightmapAsShadowmap",static:!1,private:!1,access:{has:C=>"_useLightmapAsShadowmap"in C,get:C=>C._useLightmapAsShadowmap,set:(C,de)=>{C._useLightmapAsShadowmap=de}},metadata:$e},Bh,Nh),$(null,null,zh,{kind:"field",name:"_diffuseFresnelParameters",static:!1,private:!1,access:{has:C=>"_diffuseFresnelParameters"in C,get:C=>C._diffuseFresnelParameters,set:(C,de)=>{C._diffuseFresnelParameters=de}},metadata:$e},Vh,Gh),$(null,null,Xh,{kind:"field",name:"_opacityFresnelParameters",static:!1,private:!1,access:{has:C=>"_opacityFresnelParameters"in C,get:C=>C._opacityFresnelParameters,set:(C,de)=>{C._opacityFresnelParameters=de}},metadata:$e},Yh,jl),$(null,null,Zh,{kind:"field",name:"_reflectionFresnelParameters",static:!1,private:!1,access:{has:C=>"_reflectionFresnelParameters"in C,get:C=>C._reflectionFresnelParameters,set:(C,de)=>{C._reflectionFresnelParameters=de}},metadata:$e},Qh,$h),$(null,null,wo,{kind:"field",name:"_refractionFresnelParameters",static:!1,private:!1,access:{has:C=>"_refractionFresnelParameters"in C,get:C=>C._refractionFresnelParameters,set:(C,de)=>{C._refractionFresnelParameters=de}},metadata:$e},jr,iu),$(null,null,Ql,{kind:"field",name:"_emissiveFresnelParameters",static:!1,private:!1,access:{has:C=>"_emissiveFresnelParameters"in C,get:C=>C._emissiveFresnelParameters,set:(C,de)=>{C._emissiveFresnelParameters=de}},metadata:$e},$l,hr),$(null,null,Jl,{kind:"field",name:"_useReflectionFresnelFromSpecular",static:!1,private:!1,access:{has:C=>"_useReflectionFresnelFromSpecular"in C,get:C=>C._useReflectionFresnelFromSpecular,set:(C,de)=>{C._useReflectionFresnelFromSpecular=de}},metadata:$e},ec,qr),$(null,null,tc,{kind:"field",name:"_useGlossinessFromSpecularMapAlpha",static:!1,private:!1,access:{has:C=>"_useGlossinessFromSpecularMapAlpha"in C,get:C=>C._useGlossinessFromSpecularMapAlpha,set:(C,de)=>{C._useGlossinessFromSpecularMapAlpha=de}},metadata:$e},ic,Fo),$(null,null,rc,{kind:"field",name:"_maxSimultaneousLights",static:!1,private:!1,access:{has:C=>"_maxSimultaneousLights"in C,get:C=>C._maxSimultaneousLights,set:(C,de)=>{C._maxSimultaneousLights=de}},metadata:$e},ou,lu),$(null,null,ps,{kind:"field",name:"_invertNormalMapX",static:!1,private:!1,access:{has:C=>"_invertNormalMapX"in C,get:C=>C._invertNormalMapX,set:(C,de)=>{C._invertNormalMapX=de}},metadata:$e},Zr,ac),$(null,null,Bo,{kind:"field",name:"_invertNormalMapY",static:!1,private:!1,access:{has:C=>"_invertNormalMapY"in C,get:C=>C._invertNormalMapY,set:(C,de)=>{C._invertNormalMapY=de}},metadata:$e},fu,ur),$(null,null,hc,{kind:"field",name:"_twoSidedLighting",static:!1,private:!1,access:{has:C=>"_twoSidedLighting"in C,get:C=>
204C._twoSidedLighting,set:(C,de)=>{C._twoSidedLighting=de}},metadata:$e},Ln,fr),$(null,null,fc,{kind:"field",name:"_applyDecalMapAfterDetailMap",static:!1,private:!1,access:{has:C=>"_applyDecalMapAfterDetailMap"in C,get:C=>C._applyDecalMapAfterDetailMap,set:(C,de)=>{C._applyDecalMapAfterDetailMap=de}},metadata:$e},dc,_c),$e&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$e})})(),r.ForceGLSL=!1,r})(),eE=!1;function xF(){eE||(eE=!0,$w(),In("BABYLON.StandardMaterial",Ca),De.DefaultMaterialFactory=r=>new Ca("default material",r))}Object.getOwnPropertyDescriptor(Ca.prototype,"decalMap")||Object.defineProperty(Ca.prototype,"decalMap",At("StandardMaterial","decalMap"));xF();function WA(r){let e=r.pathArray;const t=r.closeArray||!1,i=r.closePath||!1,s=r.invertUV||!1,n=Math.floor(e[0].length/2);let o=r.offset||n;o=o>n?n:Math.floor(o);const c=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,h=r.uvs,f=r.colors,_=[],d=[],g=[],p=[],b=[],x=[],E=[],v=[];let S;const R=[],P=[];let M,O,D;if(e.length<2){const ye=[],Ne=[];for(O=0;O<e[0].length-o;O++)ye.push(e[0][O]),Ne.push(e[0][O+o]);e=[ye,Ne]}let w=0;const G=i?1:0,H=t?1:0;let ie,ne;S=e[0].length;let ce,k;for(M=0;M<e.length+H;M++){for(E[M]=0,b[M]=[0],ie=M===e.length?e[0]:e[M],ne=ie.length,S=S<ne?S:ne,D=0;D<ne;)_.push(ie[D].x,ie[D].y,ie[D].z),D>0&&(ce=ie[D].subtract(ie[D-1]).length(),k=ce+E[M],b[M].push(k),E[M]=k),D++;i&&(D--,_.push(ie[0].x,ie[0].y,ie[0].z),ce=ie[D].subtract(ie[0]).length(),k=ce+E[M],b[M].push(k),E[M]=k),R[M]=ne+G,P[M]=w,w+=ne+G}let te,X,q,W;for(O=0;O<S+G;O++)for(v[O]=0,x[O]=[0],M=0;M<e.length-1+H;M++)te=e[M],X=M===e.length-1?e[0]:e[M+1],O===S?(q=te[0],W=X[0]):(q=te[O],W=X[O]),ce=W.subtract(q).length(),k=ce+v[O],x[O].push(k),v[O]=k;let K,Z;if(h)for(M=0;M<h.length;M++)p.push(h[M].x,h[M].y);else for(M=0;M<e.length+H;M++)for(O=0;O<S+G;O++)K=E[M]!=0?b[M][O]/E[M]:0,Z=v[O]!=0?x[O][M]/v[O]:0,s?p.push(Z,K):p.push(K,Z);M=0;let F=0,A=R[M]-1,N=R[M+1]-1,Y=A<N?A:N,se=P[1]-P[0];const ue=R.length-1;for(;F<=Y&&M<ue;)d.push(F,F+se,F+1),d.push(F+se+1,F+1,F+se),F+=1,F===Y&&(M++,se=P[M+1]-P[M],A=R[M]-1,N=R[M+1]-1,F=P[M],Y=A<N?A+F:N+F);if(Ye.ComputeNormals(_,d,g),i){let ye,Ne;for(M=0;M<e.length;M++){ye=P[M]*3,M+1<e.length?Ne=(P[M+1]-1)*3:Ne=g.length-3,g[ye]=(g[ye]+g[Ne])*.5,g[ye+1]=(g[ye+1]+g[Ne+1])*.5,g[ye+2]=(g[ye+2]+g[Ne+2])*.5;const Je=Math.sqrt(g[ye]*g[ye]+g[ye+1]*g[ye+1]+g[ye+2]*g[ye+2]);g[ye]/=Je,g[ye+1]/=Je,g[ye+2]/=Je,g[Ne]=g[ye],g[Ne+1]=g[ye+1],g[Ne+2]=g[ye+2]}}if(t){let ye=P[0]*3,Ne=P[e.length]*3;for(O=0;O<S+G;O++){g[ye]=(g[ye]+g[Ne])*.5,g[ye+1]=(g[ye+1]+g[Ne+1])*.5,g[ye+2]=(g[ye+2]+g[Ne+2])*.5;const Je=Math.sqrt(g[ye]*g[ye]+g[ye+1]*g[ye+1]+g[ye+2]*g[ye+2]);g[ye]/=Je,g[ye+1]/=Je,g[ye+2]/=Je,g[Ne]=g[ye],g[Ne+1]=g[ye+1],g[Ne+2]=g[ye+2],ye+=3,Ne+=3}}Ye._ComputeSides(c,_,d,g,p,r.frontUVs,r.backUVs);let pe=null;if(f){pe=new Float32Array(f.length*4);for(let ye=0;ye<f.length;ye++)pe[ye*4]=f[ye].r,pe[ye*4+1]=f[ye].g,pe[ye*4+2]=f[ye].b,pe[ye*4+3]=f[ye].a}const Ie=new Ye,Le=new Float32Array(_),J=new Float32Array(g),_e=new Float32Array(p);return Ie.indices=d,Ie.positions=Le,Ie.normals=J,Ie.uvs=_e,pe&&Ie.set(pe,U.ColorKind),i&&(Ie._idx=P),Ie}function mo(r,e,t=null){const i=e.pathArray,s=e.closeArray,n=e.closePath,o=ee._GetDefaultSideOrientation(e.sideOrientation),c=e.instance,h=e.updatable;if(c){const f=ge.Vector3[0].setAll(Number.MAX_VALUE),_=ge.Vector3[1].setAll(-Number.MAX_VALUE),d=p=>{let b=i[0].length;const x=c;let E=0;const v=x._originalBuilderSideOrientation===ee.DOUBLESIDE?2:1;for(let S=1;S<=v;++S)for(let R=0;R<i.length;++R){const P=i[R],M=P.length;b=b<M?b:M;for(let O=0;O<b;++O){const D=P[O];p[E]=D.x,p[E+1]=D.y,p[E+2]=D.z,f.minimizeInPlaceFromFloats(D.x,D.y,D.z),_.maximizeInPlaceFromFloats(D.x,D.y,D.z),E+=3}if(x._creationDataStorage&&x._creationDataStorage.closePath){const O=P[0];p[E]=O.x,p[E+1]=O.y,p[E+2]=O.z,E+=3}}},g=c.getVerticesData(U.PositionKind);if(d(g),c.hasBoundingInfo?c.getBoundingInfo().reConstruct(f,_,c._worldMatrix):c.buildBoundingInfo(f,_,c._worldMatrix),c.updateVerticesData(U.PositionKind,g,!1,!1),e.colors){const p=c.getVerticesData(U.ColorKind);for(let b=0,x=0;b<e.colors.length;b++,x+=4){const E=e.colors[b];p[x]=E.r,p[x+1]=E.g,p[x+2]=E.b,p[x+3]=E.a}
204c.updateVerticesData(U.ColorKind,p,!1,!1)}if(e.uvs){const p=c.getVerticesData(U.UVKind);for(let b=0;b<e.uvs.length;b++)p[b*2]=e.uvs[b].x,p[b*2+1]=e.uvs[b].y;c.updateVerticesData(U.UVKind,p,!1,!1)}if(!c.areNormalsFrozen||c.isFacetDataEnabled){const p=c.getIndices(),b=c.getVerticesData(U.NormalKind),x=c.isFacetDataEnabled?c.getFacetDataParameters():null;if(Ye.ComputeNormals(g,p,b,x),c._creationDataStorage&&c._creationDataStorage.closePath){let E,v;for(let S=0;S<i.length;S++)E=c._creationDataStorage.idx[S]*3,S+1<i.length?v=(c._creationDataStorage.idx[S+1]-1)*3:v=b.length-3,b[E]=(b[E]+b[v])*.5,b[E+1]=(b[E+1]+b[v+1])*.5,b[E+2]=(b[E+2]+b[v+2])*.5,b[v]=b[E],b[v+1]=b[E+1],b[v+2]=b[E+2]}c.areNormalsFrozen||c.updateVerticesData(U.NormalKind,b,!1,!1)}return c}else{const f=new ee(r,t);f._originalBuilderSideOrientation=o,f._creationDataStorage=new IA;const _=WA(e);return n&&(f._creationDataStorage.idx=_._idx),f._creationDataStorage.closePath=n,f._creationDataStorage.closeArray=s,_.applyToMesh(f,h),f}}let tE=!1;function TF(){tE||(tE=!0,Ye.CreateRibbon=WA,ee.CreateRibbon=(r,e,t=!1,i,s,n,o=!1,c,h)=>mo(r,{pathArray:e,closeArray:t,closePath:i,offset:s,updatable:o,sideOrientation:c,instance:h},n))}function XA(r){const e=[],t=[],i=[],s=[],n=r.radius||.5,o=r.tessellation||64,c=r.arc&&(r.arc<=0||r.arc>1)?1:r.arc||1,h=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE;e.push(0,0,0),s.push(.5,.5);const f=Math.PI*2*c,_=c===1?f/o:f/(o-1);let d=0;for(let b=0;b<o;b++){const x=Math.cos(d),E=Math.sin(d),v=(x+1)/2,S=(1-E)/2;e.push(n*x,n*E,0),s.push(v,S),d+=_}c===1&&(e.push(e[3],e[4],e[5]),s.push(s[2],s[3]));const g=e.length/3;for(let b=1;b<g-1;b++)t.push(b+1,0,b);Ye.ComputeNormals(e,t,i),Ye._ComputeSides(h,e,t,i,s,r.frontUVs,r.backUVs);const p=new Ye;return p.indices=t,p.positions=e,p.normals=i,p.uvs=s,p}function YA(r,e={},t=null){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,XA(e).applyToMesh(i,e.updatable),i}let iE=!1;function EF(){iE||(iE=!0,Ye.CreateDisc=XA,ee.CreateDisc=(r,e,t,i=null,
vendor: 5,896 bytes, line 204
204s,n)=>YA(r,{radius:e,tessellation:t,sideOrientation:n,updatable:s},i))}class _d extends ee{constructor(e,t){super(e,t),this.generateOctree=!1}getClassName(){return"GroundMesh"}get subdivisions(){return Math.min(this._subdivisionsX,this._subdivisionsY)}get subdivisionsX(){return this._subdivisionsX}get subdivisionsY(){return this._subdivisionsY}optimize(e,t=32){this._subdivisionsX=e,this._subdivisionsY=e,this.subdivide(e);const i=this;lg(i.createOrUpdateSubmeshesOctree)&&i.createOrUpdateSubmeshesOctree(t)}getHeightAtCoordinates(e,t){const i=this.getWorldMatrix(),s=ge.Matrix[5];i.invertToRef(s);const n=ge.Vector3[8];if(I.TransformCoordinatesFromFloatsToRef(e,0,t,s,n),e=n.x,t=n.z,e<this._minX||e>=this._maxX||t<=this._minZ||t>this._maxZ)return this.position.y;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const o=this._getFacetAt(e,t),c=-(o.x*e+o.z*t+o.w)/o.y;return I.TransformCoordinatesFromFloatsToRef(0,c,0,i,n),n.y}getNormalAtCoordinates(e,t){const i=new I(0,1,0);return this.getNormalAtCoordinatesToRef(e,t,i),i}getNormalAtCoordinatesToRef(e,t,i){const s=this.getWorldMatrix(),n=ge.Matrix[5];s.invertToRef(n);const o=ge.Vector3[8];if(I.TransformCoordinatesFromFloatsToRef(e,0,t,n,o),e=o.x,t=o.z,e<this._minX||e>this._maxX||t<this._minZ||t>this._maxZ)return this;(!this._heightQuads||this._heightQuads.length==0)&&(this._initHeightQuads(),this._computeHeightQuads());const c=this._getFacetAt(e,t);return I.TransformNormalFromFloatsToRef(c.x,c.y,c.z,s,i),this}updateCoordinateHeights(){return(!this._heightQuads||this._heightQuads.length==0)&&this._initHeightQuads(),this._computeHeightQuads(),this}_getFacetAt(e,t){const i=Math.floor((e+this._maxX)*this._subdivisionsX/this._width),s=Math.floor(-(t+this._maxZ)*this._subdivisionsY/this._height+this._subdivisionsY),n=this._heightQuads[s*this._subdivisionsX+i];let o;return t<n.slope.x*e+n.slope.y?o=n.facet1:o=n.facet2,o}_initHeightQuads(){const e=this._subdivisionsX,t=this._subdivisionsY;this._heightQuads=[];for(let i=0;i<t;i++)for(let s=0;s<e;s++){const n={slope:He.Zero(),facet1:new dt(0,0,0,0),facet2:new dt(0,0,0,0)};this._heightQuads[i*e+s]=n}return this}_computeHeightQuads(){const e=this.getVerticesData(U.PositionKind);if(!e)return this;const t=ge.Vector3[3],i=ge.Vector3[2],s=ge.Vector3[1],n=ge.Vector3[0],o=ge.Vector3[4],c=ge.Vector3[5],h=ge.Vector3[6],f=ge.Vector3[7],_=ge.Vector3[8];let d,g,p,b,x,E,v;const S=this._subdivisionsX,R=this._subdivisionsY;for(let P=0;P<R;P++)for(let M=0;M<S;M++){d=M*3,g=P*(S+1)*3,p=(P+1)*(S+1)*3,t.x=e[g+d],t.y=e[g+d+1],t.z=e[g+d+2],i.x=e[g+d+3],i.y=e[g+d+4],i.z=e[g+d+5],s.x=e[p+d],s.y=e[p+d+1],s.z=e[p+d+2],n.x=e[p+d+3],n.y=e[p+d+4],n.z=e[p+d+5],b=(n.z-t.z)/(n.x-t.x),x=t.z-b*t.x,i.subtractToRef(t,o),s.subtractToRef(t,c),n.subtractToRef(t,h),I.CrossToRef(h,c,f),I.CrossToRef(o,h,_),f.normalize(),_.normalize(),E=-(f.x*t.x+f.y*t.y+f.z*t.z),v=-(_.x*i.x+_.y*i.y+_.z*i.z);const O=this._heightQuads[P*S+M];O.slope.copyFromFloats(b,x),O.facet1.copyFromFloats(f.x,f.y,f.z,E),O.facet2.copyFromFloats(_.x,_.y,_.z,v)}return this}serialize(e){super.serialize(e),e.subdivisionsX=this._subdivisionsX,e.subdivisionsY=this._subdivisionsY,e.minX=this._minX,e.maxX=this._maxX,e.minZ=this._minZ,e.maxZ=this._maxZ,e.width=this._width,e.height=this._height}static Parse(e,t){const i=new _d(e.name,t);return i._subdivisionsX=e.subdivisionsX||1,i._subdivisionsY=e.subdivisionsY||1,i._minX=e.minX,i._maxX=e.maxX,i._minZ=e.minZ,i._maxZ=e.maxZ,i._width=e.width,i._height=e.height,i}}function jA(r){const e=[],t=[],i=[],s=[];let n,o;const c=r.width||r.size||1,h=r.height||r.size||1,f=(r.subdivisionsX||r.subdivisions||1)|0,_=(r.subdivisionsY||r.subdivisions||1)|0;for(n=0;n<=_;n++)for(o=0;o<=f;o++){const g=new I(o*c/f-c/2,0,(_-n)*h/_-h/2),p=new I(0,1,0);t.push(g.x,g.y,g.z),i.push(p.x,p.y,p.z),s.push(o/f,1-n/_)}for(n=0;n<_;n++)for(o=0;o<f;o++)e.push(o+1+(n+1)*(f+1)),e.push(o+1+n*(f+1)),e.push(o+n*(f+1)),e.push(o+(n+1)*(f+1)),e.push(o+1+(n+1)*(f+1)),e.push(o+n*(f+1));const d=new Ye;return d.indices=e,d.positions=t,d.normals=i,d.uvs=s,d}function qA(r){const e=r.xmin!==void 0&&r.xmin!==null?r.xmin:-1,t=r.zmin!==void 0&&r.zmin!==null?r.zmin:-1,i=r.xmax!==void 0&&r.xmax!==null?r.xmax:1,s=r.zmax!==void 0&&r.zmax!==null?r.zmax:1,n=r.subdivisions||{w:1,h:1},o=r.precision||{w:1,h:1},c=[],h=[],f=[],_=[];let d,g,p,b;n.h=n.h<1?1:n.h,n.w=n.w<1?1:n.w,o.w=o.w<1?1:o.w,o.h=o.h<1?1:o.h;const x={w:(i-e)/n.w,h:(s-t)/n.h};function E(S,R,P,M){const O=h.length/3,D=o.w+1;for(d=0;d<o.h;d++)for(g=0;g<o.w;g++){const H=[O+g+d*D,O+(g+1)+d*D,O+(g+1)+(d+1)*D,O+g+(d+1)*D];c.push(H[1]),c.push(H[2]),c.push(H[3]),c.push(H[0]),c.push(H[1]),c.push(H[3])}const w=I.Zero(),G=new I(0,1,0);for(d=0;d<=o.h;d++)for(w.z=d*(M-R)/o.h+R,g=0;g<=o.w;g++)w.x=g*(P-S)/o.w+S,w.y=0,h.push(w.x,w.y,w.z),f.push(G.x,G.y,G.z),_.push(g/o.w,d/o.h)}for(p=0;p<n.h;p++)for(b=0;b<n.w;b++)E(e+b*x.w,t+p*x.h,e+(b+1)*x.w,t+(p+1)*x.h);const v=new Ye;return v.indices=c,v.positions=h,v.normals=f,v.uvs=_,v}function KA(r){const e=[],t=[],i=[],s=[];let n,o;const c=r.colorFilter||new tt(.3,.59,.11),h=r.alphaFilter||0;let f=!1;if(r.minHeight>r.maxHeight){f=!0;const d=r.maxHeight;r.maxHeight=r.minHeight,r.minHeight=d}for(n=0;n<=r.subdivisions;n++)for(o=0;o<=r.subdivisions;o++){const d=new I(o*r.width/r.subdivisions-r.width/2,0,(r.subdivisions-n)*r.height/r.subdivisions-r.height/2),g=(d.x+r.width/2)/r.width*(r.bufferWidth-1)|0,p=(1-(d.z+r.height/2)/r.height)*(r.bufferHeight-1)|0,b=(g+p*r.bufferWidth)*4;let x=r.buffer[b]/255,E=r.buffer[b+1]/255,v=r.buffer[b+2]/255;const S=r.buffer[b+3]/255;f&&(x=1-x,E=1-E,v=1-v);const R=x*c.r+E*c.g+v*c.b;S>=h?d.y=r.minHeight+(r.maxHeight-r.minHeight)*R:d.y=r.minHeight-It,r.heightBuffer&&(r.heightBuffer[n*(r.subdivisions+1)+o]=d.y),t.push(d.x,d.y,d.z),i.push(0,0,0),s.push(o/r.subdivisions,1-n/r.subdivisions)}for(n=0;n<r.subdivisions;n++)for(o=0;o<r.subdivisions;
204o++){const d=o+1+(n+1)*(r.subdivisions+1),g=o+1+n*(r.subdivisions+1),p=o+n*(r.subdivisions+1),b=o+(n+1)*(r.subdivisions+1),x=t[d*3+1]>=r.minHeight,E=t[g*3+1]>=r.minHeight,v=t[p*3+1]>=r.minHeight;x&&E&&v&&(e.push(d),e.push(g),e.push(p)),t[b*3+1]>=r.minHeight&&x&&v&&(e.push(b),e.push(d),e.push(p))}Ye.ComputeNormals(t,e,i);const _=new Ye;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function ZA(r,e={},t){const i=new _d(r,t);return i._setReady(!1),i._subdivisionsX=e.subdivisionsX||e.subdivisions||1,i._subdivisionsY=e.subdivisionsY||e.subdivisions||1,i._width=e.width||1,i._height=e.height||1,i._maxX=i._width/2,i._maxZ=i._height/2,i._minX=-i._maxX,i._minZ=-i._maxZ,jA(e).applyToMesh(i,e.updatable),i._setReady(!0),i}function QA(r,e,t=null){const i=new ee(r,t);return qA(e).applyToMesh(i,e.updatable),i}function $A(r,e,t={},i=null){const s=t.width||10,n=t.height||10,o=t.subdivisions||1,c=t.minHeight||0,h=t.maxHeight||1,f=t.colorFilter||new tt(.3,.59,.11),_=t.alphaFilter||0,d=t.updatable,g=t.onReady;i=i||vt.LastCreatedScene;const p=new _d(r,i);p._subdivisionsX=o,p._subdivisionsY=o,p._width=s,p._height=n,p._maxX=p._width/2,p._maxZ=p._height/2,p._minX=-p._maxX,p._minZ=-p._maxZ,p._setReady(!1);let b;t.passHeightBufferInCallback&&(b=new Float32Array((o+1)*(o+1)));const x=(E,v,S)=>{KA({width:s,height:n,subdivisions:o,minHeight:c,maxHeight:h,colorFilter:f,buffer:E,bufferWidth:v,bufferHeight:S,alphaFilter:_,heightBuffer:b}).applyToMesh(p,d),g&&g(p,b),p._setReady(!0)};if(typeof e=="string"){i.addPendingData(p);const E=S=>{const R=S.width,P=S.height;if(i.isDisposed){i.removePendingData(p);return}const M=i?.getEngine().resizeImageBitmap(S,R,P);x(M,R,P),i.removePendingData(p)},v=(S,R)=>{i.removePendingData(p),t.onError&&t.onError(S,R)};Rt.LoadImage(e,E,v,i.offlineProvider)}else x(e.data,e.width,e.height);return p}let sE=!1;function vF(){sE||(sE=!0,Ye.CreateGround=jA,Ye.CreateTiledGround=qA,Ye.CreateGroundFromHeightMap=KA,ee.CreateGround=(r,e,t,i,s,n)=>ZA(r,{width:e,height:t,subdivisions:i,updatable:n},s),ee.CreateTiledGround=(r,e,t,i,s,n,o,c,h)=>QA(r,{xmin:e,zmin:t,xmax:i,zmax:s,subdivisions:n,precision:o,updatable:h},c),ee.CreateGroundFromHeightMap=(r,e,t,i,s,n,o,c,h,f,_)=>$A(r,e,{width:t,height:i,subdivisions:s,minHeight:n,maxHeight:o,updatable:h,onReady:f,alphaFilter:_},c))}function JA(r){let t=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23];const i=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0],s=[],n=r.width||r.size||1,o=r.height||r.size||1,c=r.depth||r.size||1,h=r.wrap||!1;let f=r.topBaseAt===void 0?1:r.topBaseAt,_=r.bottomBaseAt===void 0?0:r.bottomBaseAt;f=(f+4)%4,_=(_+4)%4;const d=[2,0,3,1],g=[2,0,1,3];let p=d[f],b=g[_],x=[1,-1,1,-1,-1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,-1,1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,1];if(h){t=[2,3,0,2,0,1,4,5,6,4,6,7,9,10,11,9,11,8,12,14,15,12,13,14],x=[-1,1,1,1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,1,1,1,1,1,-1,1,-1,-1,1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1];let D=[[1,1,1],[-1,1,1],[-1,1,-1],[1,1,-1]],w=[[-1,-1,1],[1,-1,1],[1,-1,-1],[-1,-1,-1]];const G=[17,18,19,16],H=[22,23,20,21];for(;p>0;)D.unshift(D.pop()),G.unshift(G.pop()),p--;for(;b>0;)w.unshift(w.pop()),H.unshift(H.pop()),b--;D=D.flat(),w=w.flat(),x=x.concat(D).concat(w),t.push(G[0],G[2],G[3],G[0],G[1],G[2]),t.push(H[0],H[2],H[3],H[0],H[1],H[2])}const E=[n/2,o/2,c/2],v=x.reduce((D,w,G)=>D.concat(w*E[G%3]),[]),S=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,R=r.faceUV||new Array(6),P=r.faceColors,M=[];for(let D=0;D<6;D++)R[D]===void 0&&(R[D]=new dt(0,0,1,1)),P&&P[D]===void 0&&(P[D]=new xt(1,1,1,1));for(let D=0;D<6;D++)if(s.push(R[D].z,R[D].w),s.push(R[D].x,R[D].w),s.push(R[D].x,R[D].y),s.push(R[D].z,R[D].y),P)for(let w=0;w<4;w++)M.push(P[D].r,P[D].g,P[D].b,P[D].a);Ye._ComputeSides(S,v,t,i,s,r.frontUVs,r.backUVs);const O=new Ye;if(O.indices=t,O.positions=v,O.normals=i,O.uvs=s,P){const D=S===Ye.DOUBLESIDE?M.concat(M):M;O.colors=D}return O}function eR(r,e={},t=null){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,JA(e).applyToMesh(i,e.updatable),i}let nE=!1;function AF(){nE||(nE=!0,Ye.CreateBox=JA,ee.CreateBox=(r,e,t=null,i,s)=>eR(r,{size:e,sideOrientation:s,updatable:i},t))}function th(r){const e=r.pattern||ee.NO_FLIP,t=r.tileWidth||r.tileSize||1,i=r.tileHeight||r.tileSize||1,s=r.alignHorizontal||0,n=r.alignVertical||0,o=r.width||r.size||1,c=Math.floor(o/t);let h=o-c*t;const f=r.height||r.size||1,_=Math.floor(f/i);let d=f-_*i;const g=t*c/2,p=i*_/2;let b=0,x=0,E=0,v=0,S=0,R=0;if(h>0||d>0){switch(E=-g,v=-p,S=g,R=p,s){case ee.CENTER:h/=2,E-=h,S+=h;break;case ee.LEFT:S+=h,b=-h/2;break;case ee.RIGHT:E-=h,b=h/2;break}switch(n){case ee.CENTER:d/=2,v-=d,R+=d;break;case ee.BOTTOM:R+=d,x=-d/2;break;case ee.TOP:v-=d,x=d/2;break}}const P=[],M=[],O=[];O[0]=[0,0,1,0,1,1,0,1],O[1]=[0,0,1,0,1,1,0,1],(e===ee.ROTATE_TILE||e===ee.ROTATE_ROW)&&(O[1]=[1,1,0,1,0,0,1,0]),(e===ee.FLIP_TILE||e===ee.FLIP_ROW)&&(O[1]=[1,0,0,0,0,1,1,1]),(e===ee.FLIP_N_ROTATE_TILE||e===ee.FLIP_N_ROTATE_ROW)&&(O[1]=[0,1,1,1,1,0,0,0]);let D=[];const w=[],G=[];let H=0;for(let k=0;k<_;k++)for(let te=0;te<c;te++)P.push(-g+te*t+b,-p+k*i+x,0),P.push(-g+(te+1)*t+b,-p+k*i+x,0),P.push(-g+(te+1)*t+b,-p+(k+1)
204*i+x,0),P.push(-g+te*t+b,-p+(k+1)*i+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),e===ee.FLIP_TILE||e===ee.ROTATE_TILE||e===ee.FLIP_N_ROTATE_TILE?D=D.concat(O[(te%2+k%2)%2]):e===ee.FLIP_ROW||e===ee.ROTATE_ROW||e===ee.FLIP_N_ROTATE_ROW?D=D.concat(O[k%2]):D=D.concat(O[0]),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1),H+=4;if(h>0||d>0){const k=d>0&&(n===ee.CENTER||n===ee.TOP),te=d>0&&(n===ee.CENTER||n===ee.BOTTOM),X=h>0&&(s===ee.CENTER||s===ee.RIGHT),q=h>0&&(s===ee.CENTER||s===ee.LEFT);let W,K,Z,F,A;if(k&&X&&(P.push(E+b,v+x,0),P.push(-g+b,v+x,0),P.push(-g+b,v+d+x,0),P.push(E+b,v+d+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),H+=4,K=1-h/t,Z=1-d/i,F=1,A=1,W=[K,Z,F,Z,F,A,K,A],e===ee.ROTATE_ROW&&(W=[1-K,1-Z,1-F,1-Z,1-F,1-A,1-K,1-A]),e===ee.FLIP_ROW&&(W=[1-K,Z,1-F,Z,1-F,A,1-K,A]),e===ee.FLIP_N_ROTATE_ROW&&(W=[K,1-Z,F,1-Z,F,1-A,K,1-A]),D=D.concat(W),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),k&&q&&(P.push(g+b,v+x,0),P.push(S+b,v+x,0),P.push(S+b,v+d+x,0),P.push(g+b,v+d+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),H+=4,K=0,Z=1-d/i,F=h/t,A=1,W=[K,Z,F,Z,F,A,K,A],(e===ee.ROTATE_ROW||e===ee.ROTATE_TILE&&c%2===0)&&(W=[1-K,1-Z,1-F,1-Z,1-F,1-A,1-K,1-A]),(e===ee.FLIP_ROW||e===ee.FLIP_TILE&&c%2===0)&&(W=[1-K,Z,1-F,Z,1-F,A,1-K,A]),(e===ee.FLIP_N_ROTATE_ROW||e===ee.FLIP_N_ROTATE_TILE&&c%2===0)&&(W=[K,1-Z,F,1-Z,F,1-A,K,1-A]),D=D.concat(W),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),te&&X&&(P.push(E+b,p+x,0),P.push(-g+b,p+x,0),P.push(-g+b,R+x,0),P.push(E+b,R+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),H+=4,K=1-h/t,Z=0,F=1,A=d/i,W=[K,Z,F,Z,F,A,K,A],(e===ee.ROTATE_ROW&&_%2===1||e===ee.ROTATE_TILE&&_%1===0)&&(W=[1-K,1-Z,1-F,1-Z,1-F,1-A,1-K,1-A]),(e===ee.FLIP_ROW&&_%2===1||e===ee.FLIP_TILE&&_%2===0)&&(W=[1-K,Z,1-F,Z,1-F,A,1-K,A]),(e===ee.FLIP_N_ROTATE_ROW&&_%2===1||e===ee.FLIP_N_ROTATE_TILE&&_%2===0)&&(W=[K,1-Z,F,1-Z,F,1-A,K,1-A]),D=D.concat(W),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),te&&q&&(P.push(g+b,p+x,0),P.push(S+b,p+x,0),P.push(S+b,R+x,0),P.push(g+b,R+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),H+=4,K=0,Z=0,F=h/t,A=d/i,W=[K,Z,F,Z,F,A,K,A],(e===ee.ROTATE_ROW&&_%2===1||e===ee.ROTATE_TILE&&(_+c)%2===1)&&(W=[1-K,1-Z,1-F,1-Z,1-F,1-A,1-K,1-A]),(e===ee.FLIP_ROW&&_%2===1||e===ee.FLIP_TILE&&(_+c)%2===1)&&(W=[1-K,Z,1-F,Z,1-F,A,1-K,A]),(e===ee.FLIP_N_ROTATE_ROW&&_%2===1||e===ee.FLIP_N_ROTATE_TILE&&(_+c)%2===1)&&(W=[K,1-Z,F,1-Z,F,1-A,K,1-A]),D=D.concat(W),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)),k){const N=[];K=0,Z=1-d/i,F=1,A=1,N[0]=[K,Z,F,Z,F,A,K,A],N[1]=[K,Z,F,Z,F,A,K,A],(e===ee.ROTATE_TILE||e===ee.ROTATE_ROW)&&(N[1]=[1-K,1-Z,1-F,1-Z,1-F,1-A,1-K,1-A]),(e===ee.FLIP_TILE||e===ee.FLIP_ROW)&&(N[1]=[1-K,Z,1-F,Z,1-F,A,1-K,A]),(e===ee.FLIP_N_ROTATE_TILE||e===ee.FLIP_N_ROTATE_ROW)&&(N[1]=[K,1-Z,F,1-Z,F,1-A,K,1-A]);for(let Y=0;Y<c;Y++)P.push(-g+Y*t+b,v+x,0),P.push(-g+(Y+1)*t+b,v+x,0),P.push(-g+(Y+1)*t+b,v+d+x,0),P.push(-g+Y*t+b,v+d+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),H+=4,e===ee.FLIP_TILE||e===ee.ROTATE_TILE||e===ee.FLIP_N_ROTATE_TILE?D=D.concat(N[(Y+1)%2]):e===ee.FLIP_ROW||e===ee.ROTATE_ROW||e===ee.FLIP_N_ROTATE_ROW?D=D.concat(N[1]):D=D.concat(N[0]),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(te){const N=[];K=0,Z=0,F=1,A=d/i,N[0]=[K,Z,F,Z,F,A,K,A],N[1]=[K,Z,F,Z,F,A,K,A],(e===ee.ROTATE_TILE||e===ee.ROTATE_ROW)&&(N[1]=[1-K,1-Z,1-F,1-Z,1-F,1-A,1-K,1-A]),(e===ee.FLIP_TILE||e===ee.FLIP_ROW)&&(N[1]=[1-K,Z,1-F,Z,1-F,A,1-K,A]),(e===ee.FLIP_N_ROTATE_TILE||e===ee.FLIP_N_ROTATE_ROW)&&(N[1]=[K,1-Z,F,1-Z,F,1-A,K,1-A]);for(let Y=0;Y<c;Y++)P.push(-g+Y*t+b,R-d+x,0),P.push(-g+(Y+1)*t+b,R-d+x,0),P.push(-g+(Y+1)*t+b,R+x,0),P.push(-g+Y*t+b,R+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),H+=4,e===ee.FLIP_TILE||e===ee.ROTATE_TILE||e===ee.FLIP_N_ROTATE_TILE?D=D.concat(N[(Y+_)%2]):e===ee.FLIP_ROW||e===ee.ROTATE_ROW||e===ee.FLIP_N_ROTATE_ROW?D=D.concat(N[_%2]):D=D.concat(N[0]),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(X){const N=[];K=1-h/t,Z=0,F=1,A=1,N[0]=[K,Z,F,Z,F,A,K,A],N[1]=[K,Z,F,Z,F,A,K,A],(e===ee.ROTATE_TILE||e===ee.ROTATE_ROW)&&(N[1]=[1-K,1-Z,1-F,1-Z,1-F,1-A,1-K,1-A]),(e===ee.FLIP_TILE||e===ee.FLIP_ROW)&&(N[1]=[1-K,Z,1-F,Z,1-F,A,1-K,A]),(e===ee.FLIP_N_ROTATE_TILE||e===ee.FLIP_N_ROTATE_ROW)&&(N[1]=[K,1-Z,F,1-Z,F,1-A,K,1-A]);for(let Y=0;Y<_;Y++)P.push(E+b,-p+Y*i+x,0),P.push(E+h+b,-p+Y*i+x,0),P.push(E+h+b,-p+(Y+1)*i+x,0),P.push(E+b,-p+(Y+1)*i+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),H+=4,e===ee.FLIP_TILE||e===ee.ROTATE_TILE||e===ee.FLIP_N_ROTATE_TILE?D=D.concat(N[(Y+1)%2]):e===ee.FLIP_ROW||e===ee.ROTATE_ROW||e===ee.FLIP_N_ROTATE_ROW?D=D.concat(N[Y%2]):D=D.concat(N[0]),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}if(q){const N=[];K=0,Z=0,F=h/i,A=1,N[0]=[K,Z,F,Z,F,A,K,A],N[1]=[K,Z,F,Z,F,A,K,A],(e===ee.ROTATE_TILE||e===ee.ROTATE_ROW)&&(N[1]=[1-K,1-Z,1-F,1-Z,1-F,1-A,1-K,1-A]),(e===ee.FLIP_TILE||e===ee.FLIP_ROW)&&(N[1]=[1-K,Z,1-F,Z,1-F,A,1-K,A]),(e===ee.FLIP_N_ROTATE_TILE||e===ee.FLIP_N_ROTATE_ROW)&&(N[1]=[K,1-Z,F,1-Z,F,1-A,K,1-A]);for(let Y=0;Y<_;Y++)P.push(S-h+b,-p+Y*i+x,0),P.push(S+b,-p+Y*i+x,0),P.push(S+b,-p+(Y+1)*i+x,0),P.push(S-h+b,-p+(Y+1)*i+x,0),G.push(H,H+1,H+3,H+1,H+2,H+3),H+=4,e===ee.FLIP_TILE||e===ee.ROTATE_TILE||e===ee.FLIP_N_ROTATE_TILE?D=D.concat(N[(Y+c)%2]):e===ee.FLIP_ROW||e===ee.ROTATE_ROW||e===ee.FLIP_N_ROTATE_ROW?D=D.concat(N[Y%2]):D=D.concat(N[0]),w.push(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),M.push(0,0,-1,0,0,-1,0,0,-1,0,0,-1)}}const ie=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE;
204Ye._ComputeSides(ie,P,G,M,D,r.frontUVs,r.backUVs);const ne=new Ye;ne.indices=G,ne.positions=P,ne.normals=M,ne.uvs=D;const ce=ie===Ye.DOUBLESIDE?w.concat(w):w;return ne.colors=ce,ne}function RF(r,e,t=null){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,th(e).applyToMesh(i,e.updatable),i}let rE=!1;function tR(){rE||(rE=!0,Ye.CreateTiledPlane=th)}const Mf=1,Tm=-1;function iR(r){const t=r.faceUV||new Array(6),i=r.faceColors,s=r.pattern||ee.NO_FLIP,n=r.width||r.size||1,o=r.height||r.size||1,c=r.depth||r.size||1,h=r.tileWidth||r.tileSize||1,f=r.tileHeight||r.tileSize||1,_=r.alignHorizontal||0,d=r.alignVertical||0,g=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE;for(let k=0;k<6;k++)t[k]===void 0&&(t[k]=new dt(0,0,1,1)),i&&i[k]===void 0&&(i[k]=new xt(1,1,1,1));const p=n/2,b=o/2,x=c/2,E=[];for(let k=0;k<2;k++)E[k]=th({pattern:s,tileWidth:h,tileHeight:f,width:n,height:o,alignVertical:d,alignHorizontal:_,sideOrientation:g});for(let k=2;k<4;k++)E[k]=th({pattern:s,tileWidth:h,tileHeight:f,width:c,height:o,alignVertical:d,alignHorizontal:_,sideOrientation:g});let v=d;d===ee.BOTTOM?v=ee.TOP:d===ee.TOP&&(v=ee.BOTTOM);for(let k=4;k<6;k++)E[k]=th({pattern:s,tileWidth:h,tileHeight:f,width:n,height:c,alignVertical:v,alignHorizontal:_,sideOrientation:g});const S=[],R=[];let P=[],M=[];const O=[],D=[],w=[],G=[];let H,ie=0;for(let k=0;k<6;k++){const te=E[k].positions.length;D[k]=[],w[k]=[];for(let X=0;X<te/3;X++)D[k].push(new I(E[k].positions[3*X],E[k].positions[3*X+1],E[k].positions[3*X+2])),w[k].push(new I(E[k].normals[3*X],E[k].normals[3*X+1],E[k].normals[3*X+2]));H=E[k].uvs.length,G[k]=[];for(let X=0;X<H;X+=2)G[k][X]=t[k].x+(t[k].z-t[k].x)*E[k].uvs[X],G[k][X+1]=t[k].y+(t[k].w-t[k].y)*E[k].uvs[X+1];if(P=P.concat(G[k]),M=M.concat(E[k].indices.map(X=>X+ie)),ie+=D[k].length,i){const X=i[k];for(let q=0;q<D[k].length;q++)O.push(X.r,X.g,X.b,X.a)}}const ne=[{m:ae.RotationY(Math.PI),t:new I(0,0,x),op:Mf},{m:ae.Identity(),t:new I(0,0,x),op:Tm},{m:ae.RotationY(-Math.PI/2),t:new I(p,0,0),op:Mf},{m:ae.RotationY(Math.PI/2),t:new I(p,0,0),op:Tm},{m:ae.RotationX(Math.PI/2),t:new I(0,b,0),op:Mf},{m:ae.RotationX(-Math.PI/2),t:new I(0,b,0),op:Tm}];for(let k=0;k<6;k++){const{m:te,t:X,op:q}=ne[k];for(const W of D[k]){const K=I.TransformCoordinates(W,te),Z=q===Mf?K.add(X):K.subtract(X);S.push(Z.x,Z.y,Z.z)}for(const W of w[k]){const K=I.TransformNormal(W,te);R.push(K.x,K.y,K.z)}}const ce=new Ye;if(ce.indices=M,ce.positions=S,ce.normals=R,ce.uvs=P,i){const k=g===Ye.DOUBLESIDE?O.concat(O):O;ce.colors=k}return ce}function SF(r,e,t=null){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,iR(e).applyToMesh(i,e.updatable),i}let aE=!1;function MF(){aE||(aE=!0,tR(),Ye.CreateTiledBox=iR)}function sR(r){const e=(r.segments||32)|0,t=r.diameterX||r.diameter||1,i=r.diameterY||r.diameter||1,s=r.diameterZ||r.diameter||1,n=r.arc&&(r.arc<=0||r.arc>1)?1:r.arc||1,o=r.slice&&r.slice<=0?1:r.slice||1,c=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,h=!!r.dedupTopBottomIndices,f=new I(t/2,i/2,s/2),_=2+e,d=2*_,g=[],p=[],b=[],x=[];for(let v=0;v<=_;v++){const S=v/_,R=S*Math.PI*o;for(let P=0;P<=d;P++){const M=P/d,O=M*Math.PI*2*n,D=ae.RotationZ(-R),w=ae.RotationY(O),G=I.TransformCoordinates(I.Up(),D),H=I.TransformCoordinates(G,w),ie=H.multiply(f),ne=H.divide(f).normalize();p.push(ie.x,ie.y,ie.z),b.push(ne.x,ne.y,ne.z),x.push(M,S)}if(v>0){const P=p.length/3;for(let M=P-2*(d+1);M+d+2<P;M++)h?(v>1&&(g.push(M),g.push(M+1),g.push(M+d+1)),(v<_||o<1)&&(g.push(M+d+1),g.push(M+1),g.push(M+d+2))):(g.push(M),g.push(M+1),g.push(M+d+1),g.push(M+d+1),g.push(M+1),g.push(M+d+2))}}Ye._ComputeSides(c,p,g,b,x,r.frontUVs,r.backUVs);const E=new Ye;return E.indices=g,E.positions=p,E.normals=b,E.uvs=x,E}function nR(r,e={},t=null){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,sR(e).applyToMesh(i,e.updatable),i}let oE=!1;function CF(){oE||(oE=!0,Ye.CreateSphere=sR,ee.CreateSphere=(r,e,t,i,s,n)=>nR(r,{segments:e,diameterX:t,diameterY:t,diameterZ:t,sideOrientation:n,updatable:s},i))}function rR(r){const e=r.height||2;let t=r.diameterTop===0?0:r.diameterTop||r.diameter||1,i=r.diameterBottom===0?0:r.diameterBottom||r.diameter||1;t=t||1e-5,i=i||1e-5;const s=(r.tessellation||24)|0,n=(r.subdivisions||1)|0,o=!!r.hasRings,c=!!r.enclose,h=r.cap===0?0:r.cap||ee.CAP_ALL,f=r.arc&&(r.arc<=0||r.arc>1)?1:r.arc||1,_=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,d=r.faceUV||new Array(3),g=r.faceColors,p=f!==1&&c?2:0,b=o?n:1,x=2+(1+p)*b;let E;for(E=0;E<x;E++)g&&g[E]===void 0&&(g[E]=new xt(1,1,1,1));for(E=0;E<x;E++)d&&d[E]===void 0&&(d[E]=new dt(0,0,1,1));const v=[],S=[],R=[],P=[],M=[],O=Math.PI*2*f/s;let D,w,G;const H=(i-t)/2/e,ie=I.Zero(),ne=I.Zero(),ce=I.Zero(),k=I.Zero(),te=I.Zero(),X=_o.Y;let q,W,K,Z,F=1,A=0,N;for(q=0;q<=n;
204q++)for(w=q/n,G=(w*(t-i)+i)/2,Z=o&&q!==0&&q!==n?2:1,K=0;K<Z;K++){for(o&&(F+=K),c&&(F+=2*K),W=0;W<=s;W++)D=W*O,ie.x=Math.cos(-D)*G,ie.y=-e/2+w*e,ie.z=Math.sin(-D)*G,t===0&&q===n?(ne.x=R[R.length-(s+1)*3],ne.y=R[R.length-(s+1)*3+1],ne.z=R[R.length-(s+1)*3+2]):(ne.x=ie.x,ne.z=ie.z,ne.y=Math.sqrt(ne.x*ne.x+ne.z*ne.z)*H,ne.normalize()),W===0&&(ce.copyFrom(ie),k.copyFrom(ne)),S.push(ie.x,ie.y,ie.z),R.push(ne.x,ne.y,ne.z),o?N=A!==F?d[F].y:d[F].w:N=d[F].y+(d[F].w-d[F].y)*w,P.push(d[F].x+(d[F].z-d[F].x)*W/s,N),g&&M.push(g[F].r,g[F].g,g[F].b,g[F].a);f!==1&&c&&(S.push(ie.x,ie.y,ie.z),S.push(0,ie.y,0),S.push(0,ie.y,0),S.push(ce.x,ce.y,ce.z),I.CrossToRef(X,ne,te),te.normalize(),R.push(te.x,te.y,te.z,te.x,te.y,te.z),I.CrossToRef(k,X,te),te.normalize(),R.push(te.x,te.y,te.z,te.x,te.y,te.z),o?N=A!==F?d[F+1].y:d[F+1].w:N=d[F+1].y+(d[F+1].w-d[F+1].y)*w,P.push(d[F+1].x,N),P.push(d[F+1].z,N),o?N=A!==F?d[F+2].y:d[F+2].w:N=d[F+2].y+(d[F+2].w-d[F+2].y)*w,P.push(d[F+2].x,N),P.push(d[F+2].z,N),g&&(M.push(g[F+1].r,g[F+1].g,g[F+1].b,g[F+1].a),M.push(g[F+1].r,g[F+1].g,g[F+1].b,g[F+1].a),M.push(g[F+2].r,g[F+2].g,g[F+2].b,g[F+2].a),M.push(g[F+2].r,g[F+2].g,g[F+2].b,g[F+2].a))),A!==F&&(A=F)}const Y=f!==1&&c?s+4:s;for(q=0,F=0;F<n;F++){let pe=0,Ie=0,Le=0,J=0;for(W=0;W<s;W++)pe=q*(Y+1)+W,Ie=(q+1)*(Y+1)+W,Le=q*(Y+1)+(W+1),J=(q+1)*(Y+1)+(W+1),v.push(pe,Ie,Le),v.push(J,Le,Ie);f!==1&&c&&(v.push(pe+2,Ie+2,Le+2),v.push(J+2,Le+2,Ie+2),v.push(pe+4,Ie+4,Le+4),v.push(J+4,Le+4,Ie+4)),q=o?q+2:q+1}const se=pe=>{const Ie=pe?t/2:i/2;if(Ie===0)return;let Le,J,_e;const ye=pe?d[x-1]:d[0];let Ne=null;g&&(Ne=pe?g[x-1]:g[0]);const Je=S.length/3,je=pe?e/2:-e/2,yt=new I(0,je,0);S.push(yt.x,yt.y,yt.z),R.push(0,pe?1:-1,0);const Yt=ye.y+(ye.w-ye.y)*.5;P.push(ye.x+(ye.z-ye.x)*.5,Yt),Ne&&M.push(Ne.r,Ne.g,Ne.b,Ne.a);const kt=new He(.5,.5);for(_e=0;_e<=s;_e++){Le=Math.PI*2*_e*f/s;const Et=Math.cos(-Le),Gt=Math.sin(-Le);J=new I(Et*Ie,je,Gt*Ie);const zt=new He(Et*kt.x+.5,Gt*kt.y+.5);S.push(J.x,J.y,J.z),R.push(0,pe?1:-1,0);const nt=ye.y+(ye.w-ye.y)*zt.y;P.push(ye.x+(ye.z-ye.x)*zt.x,nt),Ne&&M.push(Ne.r,Ne.g,Ne.b,Ne.a)}for(_e=0;_e<s;_e++)pe?(v.push(Je),v.push(Je+(_e+2)),v.push(Je+(_e+1))):(v.push(Je),v.push(Je+(_e+1)),v.push(Je+(_e+2)))};(h===ee.CAP_START||h===ee.CAP_ALL)&&se(!1),(h===ee.CAP_END||h===ee.CAP_ALL)&&se(!0),Ye._ComputeSides(_,S,v,R,P,r.frontUVs,r.backUVs);const ue=new Ye;return ue.indices=v,ue.positions=S,ue.normals=R,ue.uvs=P,g&&(ue.colors=M),ue}function aR(r,e={},t){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,rR(e).applyToMesh(i,e.updatable),i}let lE=!1;function IF(){lE||(lE=!0,Ye.CreateCylinder=rR,ee.CreateCylinder=(r,e,t,i,s,n,o,c,h)=>((o===void 0||!(o instanceof De))&&(o!==void 0&&(h=c||ee.DEFAULTSIDE,c=o),o=n,n=1),aR(r,{height:e,diameterTop:t,diameterBottom:i,tessellation:s,subdivisions:n,sideOrientation:h,updatable:c},o)))}function oR(r){const e=[],t=[],i=[],s=[],n=r.diameter||1,o=r.thickness||.5,c=(r.tessellation||16)|0,h=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,f=c+1;for(let d=0;d<=c;d++){const g=d/c,p=d*Math.PI*2/c-Math.PI/2,b=ae.Translation(n/2,0,0).multiply(ae.RotationY(p));for(let x=0;x<=c;x++){const E=1-x/c,v=x*Math.PI*2/c+Math.PI,S=Math.cos(v),R=Math.sin(v);let P=new I(S,R,0),M=P.scale(o/2);const O=new He(g,E);M=I.TransformCoordinates(M,b),P=I.TransformNormal(P,b),t.push(M.x,M.y,M.z),i.push(P.x,P.y,P.z),s.push(O.x,O.y);const D=(d+1)%f,w=(x+1)%f;e.push(d*f+x),e.push(d*f+w),e.push(D*f+x),e.push(d*f+w),e.push(D*f+w),e.push(D*f+x)}}Ye._ComputeSides(h,t,e,i,s,r.frontUVs,r.backUVs);const _=new Ye;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function lR(r,e={},t){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,oR(e).applyToMesh(i,e.updatable),i}let cE=!1;function DF(){cE||(cE=!0,Ye.CreateTorus=oR,ee.CreateTorus=(r,e,t,i,s,n,o)=>lR(r,{diameter:e,thickness:t,tessellation:i,sideOrientation:o,updatable:n},s))}function cR(r){const e=[],t=[],i=[],s=[],n=r.radius||2,o=r.tube||.5,c=r.radialSegments||32,h=r.tubularSegments||32,f=r.p||2,_=r.q||3,d=r.
204sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,g=E=>{const v=Math.cos(E),S=Math.sin(E),R=_/f*E,P=Math.cos(R),M=n*(2+P)*.5*v,O=n*(2+P)*S*.5,D=n*Math.sin(R)*.5;return new I(M,O,D)};let p,b;for(p=0;p<=c;p++){const v=p%c/c*2*f*Math.PI,S=g(v),R=g(v+.01),P=R.subtract(S);let M=R.add(S);const O=I.Cross(P,M);for(M=I.Cross(O,P),O.normalize(),M.normalize(),b=0;b<h;b++){const w=b%h/h*2*Math.PI,G=-o*Math.cos(w),H=o*Math.sin(w);t.push(S.x+G*M.x+H*O.x),t.push(S.y+G*M.y+H*O.y),t.push(S.z+G*M.z+H*O.z),s.push(p/c),s.push(b/h)}}for(p=0;p<c;p++)for(b=0;b<h;b++){const E=(b+1)%h,v=p*h+b,S=(p+1)*h+b,R=(p+1)*h+E,P=p*h+E;e.push(P),e.push(S),e.push(v),e.push(P),e.push(R),e.push(S)}Ye.ComputeNormals(t,e,i),Ye._ComputeSides(d,t,e,i,s,r.frontUVs,r.backUVs);const x=new Ye;return x.indices=e,x.positions=t,x.normals=i,x.uvs=s,x}function hR(r,e={},t){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,cR(e).applyToMesh(i,e.updatable),i}let hE=!1;function PF(){hE||(hE=!0,Ye.CreateTorusKnot=cR,ee.CreateTorusKnot=(r,e,t,i,s,n,o,c,h,f)=>hR(r,{radius:e,tube:t,radialSegments:i,tubularSegments:s,p:n,q:o,sideOrientation:f,updatable:h},c))}class OF extends ai{constructor(e,t){super(e,t.getScene()),this._indexInSourceMe
vendor: 6,918 bytes, line 204
204shInstanceArray=-1,this._distanceToCamera=0,t.addInstance(this),this._sourceMesh=t,this._unIndexed=t._unIndexed,this.position.copyFrom(t.position),this.rotation.copyFrom(t.rotation),this.scaling.copyFrom(t.scaling),t.rotationQuaternion&&(this.rotationQuaternion=t.rotationQuaternion.clone()),this.animations=t.animations.slice();for(const i of t.getAnimationRanges())i!=null&&this.createAnimationRange(i.name,i.from,i.to);if(this.infiniteDistance=t.infiniteDistance,this.setPivotMatrix(t.getPivotMatrix()),!t.skeleton&&!t.morphTargetManager&&t.hasBoundingInfo){const i=t.getBoundingInfo();this.buildBoundingInfo(i.minimum,i.maximum)}else this.refreshBoundingInfo(!0,!0);this._syncSubMeshes()}getClassName(){return"InstancedMesh"}get lightSources(){return this._sourceMesh._lightSources}_resyncLightSources(){}_resyncLightSource(){}_removeLightSource(){}get receiveShadows(){return this._sourceMesh.receiveShadows}set receiveShadows(e){this._sourceMesh?.receiveShadows!==e&&Ee.Warn("Setting receiveShadows on an instanced mesh has no effect")}get material(){return this._sourceMesh.material}set material(e){this._sourceMesh?.material!==e&&Ee.Warn("Setting material on an instanced mesh has no effect")}get visibility(){return this._sourceMesh.visibility}set visibility(e){this._sourceMesh?.visibility!==e&&Ee.Warn("Setting visibility on an instanced mesh has no effect")}get skeleton(){return this._sourceMesh.skeleton}set skeleton(e){this._sourceMesh?.skeleton!==e&&Ee.Warn("Setting skeleton on an instanced mesh has no effect")}get renderingGroupId(){return this._sourceMesh.renderingGroupId}set renderingGroupId(e){!this._sourceMesh||e===this._sourceMesh.renderingGroupId||Ee.Warn("Note - setting renderingGroupId of an instanced mesh has no effect on the scene")}getTotalVertices(){return this._sourceMesh?this._sourceMesh.getTotalVertices():0}getTotalIndices(){return this._sourceMesh.getTotalIndices()}get sourceMesh(){return this._sourceMesh}get geometry(){return this._sourceMesh._geometry}createInstance(e){return this._sourceMesh.createInstance(e)}isReady(e=!1){return this._sourceMesh.isReady(e,!0)}getVerticesData(e,t,i){return this._sourceMesh.getVerticesData(e,t,i)}copyVerticesData(e,t){this._sourceMesh.copyVerticesData(e,t)}getVertexBuffer(e,t){return this._sourceMesh.getVertexBuffer(e,t)}setVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.setVerticesData(e,t,i,s),this.sourceMesh}updateVerticesData(e,t,i,s){return this.sourceMesh&&this.sourceMesh.updateVerticesData(e,t,i,s),this.sourceMesh}setIndices(e,t=null){return this.sourceMesh&&this.sourceMesh.setIndices(e,t),this.sourceMesh}isVerticesDataPresent(e){return this._sourceMesh.isVerticesDataPresent(e)}getIndices(){return this._sourceMesh.getIndices()}get _positions(){return this._sourceMesh._positions}refreshBoundingInfo(e=!1,t=!1){if(this.hasBoundingInfo&&this.getBoundingInfo().isLocked)return this;let i;typeof e=="object"?i=e:i={applySkeleton:e,applyMorph:t};const s=this._sourceMesh.geometry?this._sourceMesh.geometry.boundingBias:null;return this._refreshBoundingInfo(this._sourceMesh._getData(i,null,U.PositionKind),s),this}_preActivate(){return this._currentLOD&&this._currentLOD._preActivate(),this}_activate(e,t){if(super._activate(e,t),this._sourceMesh.subMeshes||Ee.Warn("Instances should only be created for meshes with geometry."),this._currentLOD){if(this._currentLOD._getWorldMatrixDeterminant()>=0!=this._getWorldMatrixDeterminant()>=0)return this._internalAbstractMeshDataInfo._actAsRegularMesh=!0,!0;if(this._internalAbstractMeshDataInfo._actAsRegularMesh=!1,this._currentLOD._registerInstanceForRenderId(this,e),t){if(!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!0,!0}else if(!this._currentLOD._internalAbstractMeshDataInfo._isActive)return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances=!0,!0}return!1}_postActivate(){this._sourceMesh.edgesShareWithInstances&&this._sourceMesh._edgesRenderer&&this._sourceMesh._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup?(this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer),this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())):this._edgesRenderer&&this._edgesRenderer.isEnabled&&this._sourceMesh._renderingGroup&&this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer)}getWorldMatrix(){if(this._currentLOD&&this._currentLOD!==this._sourceMesh&&this._currentLOD.billboardMode!==ms.BILLBOARDMODE_NONE&&this._currentLOD._masterMesh!==this){this._billboardWorldMatrix||(this._billboardWorldMatrix=new ae);const e=this._currentLOD._masterMesh;return this._currentLOD._masterMesh=this,ge.Vector3[7].copyFrom(this._currentLOD.position),this._currentLOD.position.set(0,0,0),this._billboardWorldMatrix.copyFrom(this._currentLOD.computeWorldMatrix(!0)),this._currentLOD.position.copyFrom(ge.Vector3[7]),this._currentLOD._masterMesh=e,this._billboardWorldMatrix}return super.getWorldMatrix()}get isAnInstance(){return!0}getLOD(e){if(!e)return this;const t=this.sourceMesh.getLODLevels();if(!t||t.length===0)this._currentLOD=this.sourceMesh;else{const i=this.getBoundingInfo();this._currentLOD=this.sourceMesh.getLOD(e,i.boundingSphere)}return this._currentLOD}_preActivateForIntermediateRendering(e){return this.sourceMesh._preActivateForIntermediateRendering(e)}_syncSubMeshes(){if(this.releaseSubMeshes(),this._sourceMesh.subMeshes)for(let e=0;e<this._sourceMesh.subMeshes.length;e++)this._sourceMesh.subMeshes[e].clone(this,this._sourceMesh);return this}_generatePointsArray(){return this._sourceMesh._generatePointsArray()}_updateBoundingInfo(){return this.hasBoundingInfo?this.getBoundingInfo().update(this.worldMatrixFromCache):this.buildBoundingInfo(this.absolutePosition,this.absolutePosition,this.worldMatrixFromCache),this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache),this}clone(e,t=null,i,s){const n=(s||this._sourceMesh).createInstance(e);if(bg.DeepCopy(this,n,["name","subMeshes","uniqueId","parent","lightSources","receiveShadows","material","visibility","skeleton","sourceMesh","isAnInstance","facetNb","isFacetDataEnabled","isBlocked","useBones","hasInstances","collider","edgesRenderer","forward","up","right","absolutePosition","absoluteScaling","absoluteRotationQuaternion","isWorldMatrixFrozen","nonUniformScaling","behaviors","worldMatrixFromCache","hasThinInstances","hasBoundingInfo","geometry"],[]),t&&(n.parent=t),!i)for(let o=0;o<this.getScene().meshes.length;o++){const c=this.getScene().meshes[o];c.parent===this&&c.clone(c.name,n)}return n.computeWorldMatrix(!0),this.onClonedObservable.notifyObservers(n),n}dispose(e,t=!1){this._sourceMesh.removeInstance(this),super.dispose(e,t)}_serializeAsParent(e){super._serializeAsParent(e),e.parentId=this._sourceMesh.uniqueId,e.parentInstanceIndex=this._indexInSourceMe
204shInstanceArray}instantiateHierarchy(e=null,t,i){const s=this.clone("Clone of "+(this.name||this.id),e||this.parent,!0,t&&t.newSourcedMesh);s&&i&&i(this,s);for(const n of this.getChildTransformNodes(!0))n.instantiateHierarchy(s,t,i);return s}}const Em={effect:null,subMesh:null};class md extends zA{constructor(e,t,i,s={},n=!0){super(e,t,n),this._textures={},this._internalTextures={},this._textureArrays={},this._externalTextures={},this._floats={},this._ints={},this._uints={},this._floatsArrays={},this._colors3={},this._colors3Arrays={},this._colors4={},this._colors4Arrays={},this._vectors2={},this._vectors3={},this._vectors4={},this._quaternions={},this._quaternionsArrays={},this._matrices={},this._matrixArrays={},this._matrices3x3={},this._matrices2x2={},this._vectors2Arrays={},this._vectors3Arrays={},this._vectors4Arrays={},this._uniformBuffers={},this._textureSamplers={},this._storageBuffers={},this._cachedWorldViewMatrix=new ae,this._cachedWorldViewProjectionMatrix=new ae,this._multiview=!1,this._vertexPullingMetadata=null,this._materialHelperNeedsPreviousMatrices=!1,this._shaderPath=i,this._options={needAlphaBlending:!1,needAlphaTesting:!1,attributes:["position","normal","uv"],uniforms:["worldViewProjection"],uniformBuffers:[],samplers:[],externalTextures:[],samplerObjects:[],storageBuffers:[],defines:[],useClipPlane:!1,...s}}get shaderPath(){return this._shaderPath}set shaderPath(e){this._shaderPath=e}get options(){return this._options}get isMultiview(){return this._multiview}getClassName(){return"ShaderMaterial"}needAlphaBlending(){return this.alpha<1||this._options.needAlphaBlending}needAlphaTesting(){return this._options.needAlphaTesting}_checkUniform(e){this._options.uniforms.indexOf(e)===-1&&this._options.uniforms.push(e)}setTexture(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._textures[e]=t,this}setInternalTexture(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._internalTextures[e]=t,this}removeTexture(e){delete this._textures[e]}setTextureArray(e,t){return this._options.samplers.indexOf(e)===-1&&this._options.samplers.push(e),this._checkUniform(e),this._textureArrays[e]=t,this}setExternalTexture(e,t){return this._options.externalTextures.indexOf(e)===-1&&this._options.externalTextures.push(e),this._externalTextures[e]=t,this}setFloat(e,t){return this._checkUniform(e),this._floats[e]=t,this}setInt(e,t){return this._checkUniform(e),this._ints[e]=t,this}setUInt(e,t){return this._checkUniform(e),this._uints[e]=t,this}setFloats(e,t){return this._checkUniform(e),this._floatsArrays[e]=t,this}setColor3(e,t){return this._checkUniform(e),this._colors3[e]=t,this}setColor3Array(e,t){return this._checkUniform(e),this._colors3Arrays[e]=t.reduce((i,s)=>(i.push(s.r,s.g,s.b),i),[]),this}setColor4(e,t){return this._checkUniform(e),this._colors4[e]=t,this}setColor4Array(e,t){return this._checkUniform(e),this._colors4Arrays[e]=t.reduce((i,s)=>(i.push(s.r,s.g,s.b,s.a),i),[]),this}setVector2(e,t){return this._checkUniform(e),this._vectors2[e]=t,this}setVector3(e,t){return this._checkUniform(e),this._vectors3[e]=t,this}setVector4(e,t){return this._checkUniform(e),this._vectors4[e]=t,this}setQuaternion(e,t){return this._checkUniform(e),this._quaternions[e]=t,this}setQuaternionArray(e,t){return this._checkUniform(e),this._quaternionsArrays[e]=t.reduce((i,s)=>(s.toArray(i,i.length),i),[]),this}setMatrix(e,t){return this._checkUniform(e),this._matrices[e]=t,this}setMatrices(e,t){this._checkUniform(e);const i=new Float32Array(t.length*16);for(let s=0;s<t.length;s++)t[s].copyToArray(i,s*16);return this._matrixArrays[e]=i,this}setMatrix3x3(e,t){return this._checkUniform(e),this._matrices3x3[e]=t,this}setMatrix2x2(e,t){return this._checkUniform(e),this._matrices2x2[e]=t,this}setArray2(e,t){return this._checkUniform(e),this._vectors2Arrays[e]=t,this}setArray3(e,t){return this._checkUniform(e),this._vectors3Arrays[e]=t,this}setArray4(e,t){return this._checkUniform(e),this._vectors4Arrays[e]=t,this}setUniformBuffer(e,t){return this._options.uniformBuffers.indexOf(e)===-1&&this._options.uniformBuffers.push(e),this._uniformBuffers[e]=t,this}setTextureSampler(e,t){return this._options.samplerObjects.indexOf(e)===-1&&this._options.samplerObjects.push(e),this._textureSamplers[e]=t,this}setStorageBuffer(e,t){return this._options.storageBuffers.indexOf(e)===-1&&this._options.storageBuffers.push(e),this._storageBuffers[e]=t,this}setDefine(e,t){const i=e.trimEnd()+" ",s=this.options.defines.findIndex(n=>n===e||n.startsWith(i));return s>=0&&this.options.defines.splice(s,1),(typeof t!="boolean"||t)&&this.options.defines.push(i+t),this}isReadyForSubMesh(e,t,i){return this.isReady(e,i,t)}isReady(e,t,i){const s=i&&this._storeEffectOnSubMeshes;if(this.isFrozen){const O=s?i._drawWrapper:this._drawWrapper;if(O.effect&&O._wasPreviouslyReady&&O._wasPreviouslyUsingInstances===t)return!0}const n=this.getScene(),o=n.getEngine(),c=[],h=[];let f=null,_=this._shaderPath,d=this._options.uniforms,g=this._options.uniformBuffers,p=this._options.samplers;o.getCaps().multiview&&n.activeCamera&&n.activeCamera.outputRenderTarget&&n.activeCamera.outputRenderTarget.getViewCount()>1&&(this._multiview=!0,c.push("#define MULTIVIEW"),d.indexOf("viewProjection")!==-1&&d.indexOf("viewProjectionR")===-1&&d.push("viewProjectionR"));for(let O=0;O<this._options.defines.length;O++){const D=this._options.defines[O].indexOf("#define")===0?this._options.defines[O]:`#define ${this._options.defines[O]}`;c.push(D)}for(let O=0;O<this._options.attributes.length;O++)h.push(this._options.attributes[O]);if(e&&e.isVerticesDataPresent(U.ColorKind)&&(h.indexOf(U.ColorKind)===-1&&h.push(U.ColorKind),c.push("#define VERTEXCOLOR")),t&&(c.push("#define INSTANCES"),RA(h,this._materialHelperNeedsPreviousMatrices),e?.hasThinInstances&&(c.push("#define THIN_INSTANCES"),e&&e.isVerticesDataPresent(U.ColorInstanceKind)&&(h.push(U.ColorInstanceKind),c.push("#define INSTANCESCOLOR")))),e&&e.useBones&&e.computeBonesUsingShaders&&e.skeleton){h.push(U.MatricesIndicesKind),h.push(U.MatricesWeightsKind),e.numBoneInfluencers>4&&(h.push(U.MatricesIndicesExtraKind),h.push(U.MatricesWeightsExtraKind)
204);const O=e.skeleton;c.push("#define NUM_BONE_INFLUENCERS "+e.numBoneInfluencers),f=new VA,f.addCPUSkinningFallback(0,e),O.isUsingTextureForMatrices?(c.push("#define BONETEXTURE"),d.indexOf("boneTextureInfo")===-1&&d.push("boneTextureInfo"),this._options.samplers.indexOf("boneSampler")===-1&&this._options.samplers.push("boneSampler")):(c.push("#define BonesPerMesh "+(O.bones.length+1)),d.indexOf("mBones")===-1&&d.push("mBones"))}else c.push("#define NUM_BONE_INFLUENCERS 0");let b=0;const x=e?e.morphTargetManager:null;if(x){const O=c.indexOf("#define UV1")!==-1,D=c.indexOf("#define UV2")!==-1,w=c.indexOf("#define TANGENT")!==-1,G=c.indexOf("#define NORMAL")!==-1,H=c.indexOf("#define VERTEXCOLOR")!==-1;b=jO(x,c,h,e,!0,G,w,O,D,H),x.isUsingTextureForTargets&&(d.indexOf("morphTargetTextureIndices")===-1&&d.push("morphTargetTextureIndices"),this._options.samplers.indexOf("morphTargets")===-1&&this._options.samplers.push("morphTargets")),b>0&&(d=d.slice(),d.push("morphTargetInfluences"),d.push("morphTargetCount"),d.push("morphTargetTextureInfo"),d.push("morphTargetTextureIndices"))}else c.push("#define NUM_MORPH_INFLUENCERS 0");if(e){const O=e.bakedVertexAnimationManager;O&&O.isEnabled&&(c.push("#define BAKED_VERTEX_ANIMATION_TEXTURE"),d.indexOf("bakedVertexAnimationSettings")===-1&&d.push("bakedVertexAnimationSettings"),d.indexOf("bakedVertexAnimationTextureSizeInverted")===-1&&d.push("bakedVertexAnimationTextureSizeInverted"),d.indexOf("bakedVertexAnimationTime")===-1&&d.push("bakedVertexAnimationTime"),this._options.samplers.indexOf("bakedVertexAnimationTexture")===-1&&this._options.samplers.push("bakedVertexAnimationTexture"),t&&h.push("bakedVertexAnimationSettingsInstanced"))}for(const O in this._textures)if(!this._textures[O].isReady())return!1;for(const O in this._internalTextures)if(!this._internalTextures[O].isReady)return!1;e&&this.needAlphaTestingForMesh(e)&&c.push("#define ALPHATEST"),this._options.useClipPlane!==!1&&(xA(d),XO(this,n,c)),n.fogEnabled&&e?.applyFog&&n.fogMode!==De.FOGMODE_NONE&&(c.push("#define FOG"),d.indexOf("view")===-1&&d.push("view"),d.indexOf("vFogInfos")===-1&&d.push("vFogInfos"),d.indexOf("vFogColor")===-1&&d.push("vFogColor")),this._useLogarithmicDepth&&(c.push("#define LOGARITHMICDEPTH"),d.indexOf("logarithmicDepthConstant")===-1&&d.push("logarithmicDepthConstant"));const E=i?i.getRenderingMesh():e;if(E&&this.useVertexPulling){const O=E.geometry;O&&(this._vertexPullingMetadata=GA(O),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((w,G)=>{d.push(`vp_${G}_info`)})),c.push("#define USE_VERTEX_PULLING");const D=E.geometry?.getIndexBuffer();D&&!E.isUnIndexed&&(c.push("#define VERTEX_PULLING_USE_INDEX_BUFFER"),D.is32Bits&&c.push("#define VERTEX_PULLING_INDEX_BUFFER_32BITS"))}this.customShaderNameResolve&&(d=d.slice(),g=g.slice(),p=p.slice(),_=this.customShaderNameResolve(this.name,d,g,p,c,h));const v=s?i._getDrawWrapper(void 0,!0):this._drawWrapper,S=v?.effect??null,R=v?.defines??null,P=c.join(`
205`);let M=S;return R!==P&&(M=o.createEffect(_,{attributes:h,uniformsNames:d,uniformBuffersNames:g,samplers:p,defines:P,fallbacks:f,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousMorphTargets:b},shaderLanguage:this._options.shaderLanguage,extraInitializationsAsync:this._options.extraInitializationsAsync},o),s?i.setEffect(M,P,this._materialContext):v&&v.setEffect(M,P),this._onEffectCreatedObservable&&(Em.effect=M,Em.subMesh=i??e?.subMeshes[0]??null,this._onEffectCreatedObservable.notifyObservers(Em))),v._wasPreviouslyUsingInstances=!!t,M?.isReady()?(S!==M&&n.resetCachedMaterial(),v._wasPreviouslyReady=!0,!0):!1}bindOnlyWorldMatrix(e,t){const i=t??this.getEffect();if(!i)return;const s=this._options.uniforms;s.indexOf("world")!==-1&&i.setMatrix("world",e);const n=this.getScene();s.indexOf("worldView")!==-1&&(e.multiplyToRef(n.getViewMatrix(),this._cachedWorldViewMatrix),i.setMatrix("worldView",this._cachedWorldViewMatrix)),s.indexOf("worldViewProjection")!==-1&&(e.multiplyToRef(n.getTransformMatrix(),this._cachedWorldViewProjectionMatrix),i.setMatrix("worldViewProjection",this._cachedWorldViewProjectionMatrix)),s.indexOf("view")!==-1&&i.setMatrix("view",n.getViewMatrix())}bindForSubMesh(e,t,i){this.bind(e,t,i._drawWrapperOverride?.effect,i)}bind(e,t,i,s){const n=s&&this._storeEffectOnSubMeshes,o=i??(n?s.effect:this.getEffect());if(!o)return;const c=this.getScene();this._activeEffect=o,this.bindOnlyWorldMatrix(e,i);const h=this._options.uniformBuffers;let f=!1;if(o&&h&&h.length>0&&c.getEngine().supportsUniformBuffers)for(let d=0;d<h.length;++d)switch(h[d]){case"Mesh":t&&(t.getMeshUniformBuffer().bindToEffect(o,"Mesh"),t.transferToEffect(e));break;case"Scene":MA(o,c.getSceneUniformBuffer()),c.finalizeSceneUbo(),f=!0;break}const _=t&&n?this._mustRebind(c,o,s,t.visibility):c.getCachedMaterial()!==this;if(o&&_){!f&&this._options.uniforms.indexOf("view")!==-1&&o.setMatrix("view",c.getViewMatrix()),!f&&this._options.uniforms.indexOf("projection")!==-1&&o.setMatrix("projection",c.getProjectionMatrix()),!f&&this._options.uniforms.indexOf("viewProjection")!==-1&&(o.setMatrix("viewProjection",c.getTransformMatrix()),this._multiview&&o.setMatrix("viewProjectionR",c._transformMatrixR)),c.activeCamera&&this._options.uniforms.indexOf("cameraPosition")!==-1&&o.setVector3("cameraPosition",c.activeCamera.globalPosition),CA(t,o),TA(o,this,c),this._vertexPullingMetadata&&HA(o,this._vertexPullingMetadata),this._useLogarithmicDepth&&EA(n?s.materialDefines:o.defines,o,c),t&&vA(c,t,o);let d;for(d in this._textures)o.setTexture(d,this._textures[d]);for(d in this._internalTextures)o._bindTexture(d,this._internalTextures[d]);for(d in this._textureArrays)o.setTextureArray(d,this._textureArrays[d]);for(d in this._ints)o.setInt(d,this._ints[d]);for(d in this._uints)o.setUInt(d,this._uints[d]);for(d in this._floats)o.setFloat(d,this._floats[d]);for(d in this._floatsArrays)o.setArray(d,this._floatsArrays[d]);for(d in this._colors3)o.setColor3(d,this._colors3[d]);for(d in this._colors3Arrays)o.setArray3(d,this._colors3Arrays[d]);for(d in this._colors4){const E=this._colors4[d];o.setFloat4(d,E.r,E.g,E.b,E.a)}for(d in this._colors4Arrays)o.setArray4(d,this._colors4Arrays[d]);for(d in this._vectors2)o.setVector2(d,this._vectors2[d]);for(d in this._vectors3)o.setVector3(d,this._vectors3[d]);for(d in this._vectors4)o.setVector4(d,this._vectors4[d]);for(d in this._quaternions)o.setQuaternion(d,this._quaternions[d]);for(d in this._matrices)o.setMatrix(d,this._matrices[d]);for(d in this._matrixArrays)o.setMatrices(d,this._matrixArrays[d]);for(d in this._matrices3x3)o.setMatrix3x3(d,this._matrices3x3[d]);for(d in this._matrices2x2)o.setMatrix2x2(d,this._matrices2x2[d]);for(d in this._vectors2Arrays)o.setArray2(d,this._vectors2Arrays[d]);for(d in this._vectors3Arrays)o.setArray3(d,this._vectors3Arrays[d]);for(d in this._vectors4Arrays)o.setArray4(d,this._vectors4Arrays[d]);for(d in this._quaternionsArrays)o.setArray4(d,this._quaternionsArrays[d]);for(d in this._uniformBuffers){const E=this._uniformBuffers[d].getBuffer();E&&o.bindUniformBuffer(E,d)}const g=c.getEngine(),p=g.setExternalTexture;if(p)for(d in this._externalTextures)p.call(g,d,this._externalTextures[d]);
vendor: 3,880 bytes, line 205
205const b=g.setTextureSampler;if(b)for(d in this._textureSamplers)b.call(g,d,this._textureSamplers[d]);const x=g.setStorageBuffer;if(x)for(d in this._storageBuffers)x.call(g,d,this._storageBuffers[d])}if(o&&t&&(_||!this.isFrozen)){SA(t,o),t.morphTargetManager&&t.morphTargetManager.isUsingTextureForTargets&&t.morphTargetManager._bind(o);const d=t.bakedVertexAnimationManager;if(d&&d.isEnabled){const g=n?s._drawWrapper:this._drawWrapper;t.bakedVertexAnimationManager?.bind(o,!!g._wasPreviouslyUsingInstances)}}this._afterBind(t,o,s)}getActiveTextures(){const e=super.getActiveTextures();for(const t in this._textures)e.push(this._textures[t]);for(const t in this._textureArrays){const i=this._textureArrays[t];for(let s=0;s<i.length;s++)e.push(i[s])}return e}hasTexture(e){if(super.hasTexture(e))return!0;for(const i in this._textures)if(this._textures[i]===e)return!0;const t=e.getInternalTexture();for(const i in this._internalTextures)if(this._internalTextures[i]===t)return!0;for(const i in this._textureArrays){const s=this._textureArrays[i];for(let n=0;n<s.length;n++)if(s[n]===e)return!0}return!1}clone(e){const t=Tt.Clone(()=>new md(e,this.getScene(),this._shaderPath,this._options,this._storeEffectOnSubMeshes),this);t.name=e,t.id=e,typeof t._shaderPath=="object"&&(t._shaderPath={...t._shaderPath}),this._options={...this._options};const i=Object.keys(this._options);for(const s of i){const n=this._options[s];Array.isArray(n)&&(this._options[s]=n.slice(0))}this.stencil.copyTo(t.stencil);for(const s in this._textures)t.setTexture(s,this._textures[s]);for(const s in this._internalTextures)t.setInternalTexture(s,this._internalTextures[s]);for(const s in this._textureArrays)t.setTextureArray(s,this._textureArrays[s]);for(const s in this._externalTextures)t.setExternalTexture(s,this._externalTextures[s]);for(const s in this._ints)t.setInt(s,this._ints[s]);for(const s in this._uints)t.setUInt(s,this._uints[s]);for(const s in this._floats)t.setFloat(s,this._floats[s]);for(const s in this._floatsArrays)t.setFloats(s,this._floatsArrays[s]);for(const s in this._colors3)t.setColor3(s,this._colors3[s]);for(const s in this._colors3Arrays)t._colors3Arrays[s]=this._colors3Arrays[s];for(const s in this._colors4)t.setColor4(s,this._colors4[s]);for(const s in this._colors4Arrays)t._colors4Arrays[s]=this._colors4Arrays[s];for(const s in this._vectors2)t.setVector2(s,this._vectors2[s]);for(const s in this._vectors3)t.setVector3(s,this._vectors3[s]);for(const s in this._vectors4)t.setVector4(s,this._vectors4[s]);for(const s in this._quaternions)t.setQuaternion(s,this._quaternions[s]);for(const s in this._quaternionsArrays)t._quaternionsArrays[s]=this._quaternionsArrays[s];for(const s in this._matrices)t.setMatrix(s,this._matrices[s]);for(const s in this._matrixArrays)t._matrixArrays[s]=this._matrixArrays[s].slice();for(const s in this._matrices3x3)t.setMatrix3x3(s,this._matrices3x3[s]);for(const s in this._matrices2x2)t.setMatrix2x2(s,this._matrices2x2[s]);for(const s in this._vectors2Arrays)t.setArray2(s,this._vectors2Arrays[s]);for(const s in this._vectors3Arrays)t.setArray3(s,this._vectors3Arrays[s]);for(const s in this._vectors4Arrays)t.setArray4(s,this._vectors4Arrays[s]);for(const s in this._uniformBuffers)t.setUniformBuffer(s,this._uniformBuffers[s]);for(const s in this._textureSamplers)t.setTextureSampler(s,this._textureSamplers[s]);for(const s in this._storageBuffers)t.setStorageBuffer(s,this._storageBuffers[s]);return t}dispose(e,t,i){if(t){let s;for(s in this._textures)this._textures[s].dispose();for(s in this._internalTextures)this._internalTextures[s].dispose();for(s in this._textureArrays){const n=this._textureArrays[s];for(let o=0;o<n.length;o++)n[o].dispose()}}this._textures={},this._internalTextures={},super.dispose(e,t,i)}serialize(){const e=Tt.Serialize(this);e.customType="BABYLON.ShaderMaterial",e.uniqueId=this.uniqueId,e.o
205ptions=this._options,e.shaderPath=this._shaderPath,e.storeEffectOnSubMeshes=this._storeEffectOnSubMeshes;let t;e.stencil=this.stencil.serialize(),e.textures={};for(t in this._textures)e.textures[t]=this._textures[t].serialize();e.textureArrays={};for(t in this._textureArrays){e.textureArrays[t]=[];const i=this._textureArrays[t];for(let s=0;s<i.length;s++)e.textureArrays[t].push(i[s].serialize())}e.ints={};for(t in this._ints)e.ints[t]=this._ints[t];e.uints={};for(t in this._uints)e.uints[t]=this._uints[t];e.floats={};for(t in this._floats)e.floats[t]=this._floats[t];e.floatsArrays={};for(t in this._floatsArrays)e.floatsArrays[t]=this._floatsArrays[t];e.colors3={};for(t in this._colors3){const i=this._colors3[t];e.colors3[t]=[i.r,i.g,i.b]}e.colors3Arrays={};for(t in this._colors3Arrays)e.colors3Arrays[t]=this._colors3Arrays[t];e.colors4={};for(t in this._colors4){const i=this._colors4[t];e.colors4[t]=[i.r,i.g,i.b,i.a]}e.colors4Arrays={};for(t in this._colors4Arrays)e.colors4Arrays[t]=this._colors4Arrays[t];e.vectors2={};for(t in this._vectors2){const i=this._vectors2[t];e.vectors2[t]=[i.x,i.y]}e.vectors3={};for(t in this._vectors3){const i=this._vectors3[t];e.vectors3[t]=[i.x,i.y,i.z]}e.vectors4={};for(t in this._vectors4){const i=this._vectors4[t];e.vectors4[t]=[i.x,i.y,i.z,i.w]}e.quaternions={};for(t in this._quaternions)e.quaternions[t]=this._quaternions[t].asArray();e.matrices={};for(t in this._matrices)e.matrices[t]=this._matrices[t].asArray();e.matrixArray={};for(t in this._matrixArrays)e.matrixArray[t]=this._matrixArrays[t];e.matrices3x3={};for(t in this._matrices3x3)e.matrices3x3[t]=this._matrices3x3[t];e.matrices2x2={};for(t in this._matrices2x2)e.matrices2x2[t]=this._matrices2x2[t];e.vectors2Arrays={};for(t in this._vectors2Arrays)e.vectors2Arrays[t]=this._vectors2Arrays[t];e.vectors3Arrays={};for(t in this._vectors3Arrays)e.vectors3Arrays[t]=this._vectors3Arrays[t];e.vectors4Arrays={};for(t in this._vectors4Arrays)e.vectors4Arrays[t]=this._vectors4Arrays[t];e.quaternionsArrays={};for(t in this._quaternionsArrays)e.quaternionsArrays[t]=this._quaternionsArrays[t];return e}}md.SnippetUrl="https://snippet.babylonjs.com";var uE,fE;class Br extends ee{_isShaderMaterial(e){return e?e.getClassName()==="ShaderMaterial":!1}constructor(e,t=null,i=null,s=null,n,o,c,h){super(e,t,i,s,n),this.useVertexColor=o,this.useVertexAlpha=c,this.color=new tt(1,1,1),this.alpha=1,this._shaderLanguage=0,this._ownsMaterial=!1,s&&(this.color=s.color.clone(),this.alpha=s.alpha,this.useVertexColor=s.useVertexColor,this.useVertexAlpha=s.useVertexAlpha),this.intersectionThreshold=.1;const f=[],_={attributes:[U.PositionKind],uniforms:["world","viewProjection"],needAlphaBlending:!0,defines:f,useClipPlane:null,shaderLanguage:0};if(this.useVertexAlpha?_.defines.push("#define VERTEXALPHA"):_.needAlphaBlending=!1,this.useVertexColor?(_.defines.push("#define VERTEXCOLOR"),_.attributes.push(U.ColorKind)):(_.uniforms.push("color"),this._color4=new xt),h)this.material=h;else{this.getScene().getEngine().isWebGPU&&!Br.ForceGLSL&&(this._shaderLanguage=1),_.shaderLanguage=this._shaderLanguage,_.extraInitializationsAsync=async()=>{this._shaderLanguage===1?await Promise.all([ts(()=>import("./color.vertex-BXUTd24i.js"),__vite__mapDeps([17,8])),ts(()=>import("./color.fragment-DkQZMLai.js"),__vite__mapDeps([18,10]))]):await Promise.all([ts(()=>import("./color.vertex-iCxL1PG1.js"),__vite__mapDeps([19,14])),ts(()=>import("./color.fragment-ByVJmuN4.js"),__vite__mapDeps([20,16]))])};const g=new md("colorShader",this.getScene(),"color",_,!1);g.doNotSerialize=!0,this._ownsMaterial=!0,this._setInternalMaterial(g)}}getClassName(){return"LinesMesh"}get material(){return this._internalAbstractMeshDataInfo._material}set material(e){const t=this.material;if(t===e)return;const i=t&&this._ownsMaterial;this._ownsMaterial=!1,this._setInternalMaterial(e),i&&t?.dispose()}_setInternalMaterial(e){this._setMaterial(e),this.material&&(this.material.fillMode=wi.LineListDrawMode,this.material.disableLighting=!0)}get checkCollisions(){return!1}set checkCollisions(e){}_bind(e,t){if(!this._geometry)return this;const i=this.isUnIndexed?null:this._geometry.getIndexBuffer();if(!this._userInstancedBuffersStorage||this.hasThinInstances?this._geometry._bind(t,i):this._geometry._bind(t,i,this._userInstancedBuffersStorage.vertexBuffers,this._userInstancedBuffersStorage.vertexArrayObjects),!this.useVertexColor&&this._isShaderMaterial(this.material)){const{r:s,g:n,b:o}=this.color;this._color4.set(s,n,o,this.alpha),this.material.setColor4("color",this._color4)}return this}_draw(e,t,i){if(!this._geometry||!this._geometry.getVertexBuffers()||!this._unIndexed&&!this._geometry.getIndexBuffer())return this;const s=this.getScene().getEngine();
205return this._unIndexed?s.drawArraysType(wi.LineListDrawMode,e.verticesStart,e.verticesCount,i):s.drawElementsType(wi.LineListDrawMode,e.indexStart,e.indexCount,i),this}dispose(e,t=!1,i){i||(this._ownsMaterial?this.material?.dispose(!1,!1,!0):t&&this.material?.dispose(!1,!1,!0)),super.dispose(e)}clone(e,t=null,i){if(t&&t._addToSceneRootNodes===void 0){const s=t;return s.source=this,new Br(e,this.getScene(),s.parent,s.source,s.doNotCloneChildren)}return new Br(e,this.getScene(),t,this,i)}createInstance(e){const t=new uR(e,this);if(this.instancedBuffers){t.instancedBuffers={};for(const i in this.instancedBuffers)t.instancedBuffers[i]=this.instancedBuffers[i]}return t}serialize(e){super.serialize(e),e.color=this.color.asArray(),e.alpha=this.alpha}static Parse(e,t){const i=new Br(e.name,t);return i.color=tt.FromArray(e.color),i.alpha=e.alpha,i}}Br.ForceGLSL=!1;class uR extends OF{constructor(e,t){super(e,t),this.intersectionThreshold=t.intersectionThreshold}getClassName(){return"InstancedLinesMesh"}}(uE=Br.prototype).enableEdgesRendering??(uE.enableEdgesRendering=Ze("LinesMesh","enableEdgesRendering"));(fE=uR.prototype).enableEdgesRendering??(fE.enableEdgesRendering=Ze("InstancedLinesMesh","enableEdgesRendering"));function fR(r){const e=[],t=[],i=r.lines,s=r.colors,n=[];let o=0;for(let h=0;h<i.length;h++){const f=i[h];for(let _=0;_<f.length;_++){const{x:d,y:g,z:p}=f[_];if(t.push(d,g,p),s){const b=s[h],{r:x,g:E,b:v,a:S}=b[_];n.push(x,E,v,S)}_>0&&(e.push(o-1),e.push(o)),o++}}const c=new Ye;return c.indices=e,c.positions=t,s&&(c.colors=n),c}function dR(r){const e=r.dashSize||3,t=r.gapSize||1,i=r.dashNb||200,s=r.points,n=[],o=[],c=I.Zero();let h=0,f,_,d=0,g;for(g=0;g<s.length-1;g++)s[g+1].subtractToRef(s[g],c),h+=c.length();
205const p=h/i,b=e*p/(e+t);for(g=0;g<s.length-1;g++){s[g+1].subtractToRef(s[g],c),f=Math.floor(c.length()/p),c.normalize();for(let E=0;E<f;E++)_=p*E,n.push(s[g].x+_*c.x,s[g].y+_*c.y,s[g].z+_*c.z),n.push(s[g].x+(_+b)*c.x,s[g].y+(_+b)*c.y,s[g].z+(_+b)*c.z),o.push(d,d+1),d+=2}const x=new Ye;return x.positions=n,x.indices=o,x}function _R(r,e,t=null){const i=e.instance,s=e.lines,n=e.colors;if(i){const f=i.getVerticesData(U.PositionKind);let _,d;n&&(_=i.getVerticesData(U.ColorKind));let g=0,p=0;for(let b=0;b<s.length;b++){const x=s[b];for(let E=0;E<x.length;E++)f[g]=x[E].x,f[g+1]=x[E].y,f[g+2]=x[E].z,n&&_&&(d=n[b],_[p]=d[E].r,_[p+1]=d[E].g,_[p+2]=d[E].b,_[p+3]=d[E].a,p+=4),g+=3}return i.updateVerticesData(U.PositionKind,f,!1,!1),n&&_&&i.updateVerticesData(U.ColorKind,_,!1,!1),i.refreshBoundingInfo(),i}const o=!!n,c=new Br(r,t,null,void 0,void 0,o,e.useVertexAlpha,e.material);return fR(e).applyToMesh(c,e.updatable),c}function mR(r,e,t=null){const i=e.colors?[e.colors]:null;return _R(r,{lines:[e.points],updatable:e.updatable,instance:e.instance,colors:i,useVertexAlpha:e.useVertexAlpha,material:e.material},t)}function gR(r,e,t=null){const i=e.points,s=e.instance,n=e.gapSize||1,o=e.dashSize||3;if(s){const f=_=>{const d=I.Zero(),g=_.length/6;let p=0,b,x,E=0,v,S;for(v=0;v<i.length-1;v++)i[v+1].subtractToRef(i[v],d),p+=d.length();const R=p/g,P=s._creationDataStorage.dashSize,M=s._creationDataStorage.gapSize,O=P*R/(P+M);for(v=0;v<i.length-1;v++)for(i[v+1].subtractToRef(i[v],d),b=Math.floor(d.length()/R),d.normalize(),S=0;S<b&&E<_.length;)x=R*S,_[E]=i[v].x+x*d.x,_[E+1]=i[v].y+x*d.y,_[E+2]=i[v].z+x*d.z,_[E+3]=i[v].x+(x+O)*d.x,_[E+4]=i[v].y+(x+O)*d.y,_[E+5]=i[v].z+(x+O)*d.z,E+=6,S++;for(;E<_.length;)_[E]=i[v].x,_[E+1]=i[v].y,_[E+2]=i[v].z,E+=3};return(e.dashNb||e.dashSize||e.gapSize||e.useVertexAlpha||e.material)&&Ee.Warn("You have used an option other than points with the instance option. Please be aware that these other options will be ignored."),s.updateMeshPositions(f,!1),s}const c=new Br(r,t,null,void 0,void 0,void 0,e.useVertexAlpha,e.material);return dR(e).applyToMesh(c,e.updatable),c._creationDataStorage=new IA,c._creationDataStorage.dashSize=o,c._creationDataStorage.gapSize=n,c}let dE=!1;function wF(){dE||(dE=!0,Ye.CreateLineSystem=fR,Ye.CreateDashedLines=dR,ee.CreateLines=(r,e,t=null,i=!1,s=null)=>mR(r,{points:e,updatable:i,instance:s},t),ee.CreateDashedLines=(r,e,t,i,s,n=null,o,c)=>gR(r,{points:e,dashSize:t,gapSize:i,dashNb:s,updatable:o,instance:c},n))}class FF extends He{constructor(e,t){super(e.x,e.y),this.index=t}}class vm{constructor(){this.elements=[]}add(e){const t=[];for(const i of e){const s=new FF(i,this.elements.length);t.push(s),this.elements.push(s)}return t}computeBounds(){const e=new He(this.elements[0].x,this.elements[0].y),t=new He(this.elements[0].x,this.elements[0].y);for(const i of this.elements)i.x<e.x?e.x=i.x:i.x>t.x&&(t.x=i.x),i.y<e.y?e.y=i.y:i.y>t.y&&(t.y=i.y);return{min:e,max:t,width:t.x-e.x,height:t.y-e.y}}}class LF{_addToepoint(e){for(const t of e)this._epoints.push(t.x,t.y)}constructor(e,t,i,s=earcut){this._points=new vm,this._outlinepoints=new vm,this._holes=new Array,this._epoints=new Array,this._eholes=new Array,this.bjsEarcut=s,this._name=e,this._scene=i||vt.LastCreatedScene;let n;t instanceof ud?n=t.getPoints():n=t,this._addToepoint(n),this._points.add(n),this._outlinepoints.add(n),typeof this.bjsEarcut>"u"&&Ee.Warn("Earcut was not found, the polygon will not be built.")}addHole(e){this._points.add(e);const t=new vm;return t.add(e),this._holes.push(t),this._eholes.push(this._epoints.length/2),this._addToepoint(e),this}build(e=!1,t=0,i=2){const s=new ee(this._name,this._scene),n=this.buildVertexData(t,i);return s.setVerticesData(U.PositionKind,n.positions,e),s.setVerticesData(U.NormalKind,n.normals,e),s.setVerticesData(U.UVKind,n.uvs,e),s.setIndices(n.indices),s}buildVertexData(e=0,t=2){const i=new Ye,s=[],n=[],o=[],c=this._points.computeBounds();for(const _ of this._points.elements)s.push(0,1,0),n.push(_.x,0,_.y),o.push((_.x-c.min.x)/c.width,(_.y-c.min.y)/c.height);const h=[],f=this.bjsEarcut(this._epoints,this._eholes,2);for(let _=0;_<f.length;_++)h.push(f[_]);if(e>0){const _=n.length/3;for(const g of this._points.elements)s.push(0,-1,0),n.push(g.x,-e,g.y),o.push(1-(g.x-c.min.x)/c.width,1-(g.y-c.min.y)/c.height);const d=h.length;for(let g=0;g<d;g+=3){const p=h[g+0],b=h[g+1],x=h[g+2];h.push(x+_),h.push(b+_),h.push(p+_)}this._addSide(n,s,o,h,c,this._outlinepoints,e,!1,t);for(const g of this._holes)this._addSide(n,s,o,h,c,g,e,!0,t)}return i.indices=h,i.positions=n,i.normals=s,i.uvs=o,i}_addSide(e,t,i,s,n,o,c,h,f){let _=e.length/3,d=0;for(let g=0;g<o.elements.length;g++){const p=o.elements[g],b=o.elements[(g+1)%o.elements.length];e.push(p.x,0,p.y),e.push(p.x,-c,p.y),e.push(b.x,0,b.y),e.push(b.x,-c,b.y);const x=o.elements[(g+o.elements.length-1)%o.elements.length],E=o.elements[(g+2)%o.elements.length];let v=new I(-(b.y-p.y),0,b.x-p.x),S=new I(-(p.y-x.y),0,p.x-x.x),R=new I(-(E.y-b.y),0,E.x-b.x);h||(v=v.scale(-1),S=S.scale(-1),R=R.scale(-1));const P=v.normalizeToNew();let M=S.normalizeToNew(),O;const D=I.Dot(M,P);D>f?D<It-1?M=new I(p.x,0,p.y).subtract(new I(b.x,0,b.y)).normalize():M=S.add(v).normalize():M=P;const w=I.Dot(R,v);w>f?w<It-1?O=new I(b.x,0,b.y).subtract(new I(p.x,0,p.y)).normalize():O=R.add(v).normalize():O=P,i.push(d/n.width,0),i.push(d/n.width,1),d+=v.length(),i.push(d/n.width,0),i.push(d/n.width,1),t.push(M.x,M.y,M.z),t.pu
205sh(M.x,M.y,M.z),t.push(O.x,O.y,O.z),t.push(O.x,O.y,O.z),h?(s.push(_),s.push(_+2),s.push(_+1),s.push(_+1),s.push(_+2),s.push(_+3)):(s.push(_),s.push(_+1),s.push(_+2),s.push(_+1),s.push(_+3),s.push(_+2)),_+=4}}}function pR(r,e,t,i,s,n,o){const c=t||new Array(3),h=i,f=[],_=o||!1;for(let G=0;G<3;G++)c[G]===void 0&&(c[G]=new dt(0,0,1,1)),h&&h[G]===void 0&&(h[G]=new xt(1,1,1,1));const d=r.getVerticesData(U.PositionKind),g=r.getVerticesData(U.NormalKind),p=r.getVerticesData(U.UVKind),b=r.getIndices(),x=d.length/9;let E,v,S,R,P=0;const M=[0];if(_)for(let G=x;G<d.length/3;G+=4)v=d[3*(G+2)]-d[3*G],S=d[3*(G+2)+2]-d[3*G+2],R=Math.sqrt(v*v+S*S),P+=R,M.push(P);let O,D=0;for(let G=0;G<g.length;G+=3)Math.abs(g[G+1])<.001&&(D=1),Math.abs(g[G+1]-1)<.001&&(D=0),Math.abs(g[G+1]+1)<.001&&(D=2),O=G/3,D===1?(E=O-x,E%4<1.5?_?p[2*O]=c[D].x+(c[D].z-c[D].x)*M[Math.floor(E/4)]/P:p[2*O]=c[D].x:_?p[2*O]=c[D].x+(c[D].z-c[D].x)*M[Math.floor(E/4)+1]/P:p[2*O]=c[D].z,E%2===0?p[2*O+1]=c[D].w:p[2*O+1]=c[D].y):(p[2*O]=(1-p[2*O])*c[D].x+p[2*O]*c[D].z,p[2*O+1]=(1-p[2*O+1])*c[D].y+p[2*O+1]*c[D].w),h&&f.push(h[D].r,h[D].g,h[D].b,h[D].a);Ye._ComputeSides(e,d,b,g,p,s,n);const w=new Ye;if(w.indices=b,w.positions=d,w.normals=g,w.uvs=p,h){const G=e===Ye.DOUBLESIDE?f.concat(f):f;w.colors=G}return w}function vg(r,e,t=null,i=earcut){e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation);const s=e.shape,n=e.holes||[],o=e.depth||0,c=e.smoothingThreshold||2,h=[];let f;for(let b=0;b<s.length;b++)h[b]=new He(s[b].x,s[b].z);h[0].equalsWithEpsilon(h[h.length-1],1e-8)&&h.pop();const d=new LF(r,h,t||vt.LastCreatedScene,i);for(let b=0;b<n.length;b++){f=[];for(let x=0;x<n[b].length;x++)f.push(new He(n[b][x].x,n[b][x].z));d.addHole(f)}const g=d.build(!1,o,c);return g._originalBuilderSideOrientation=e.sideOrientation,pR(g,e.sideOrientation,e.faceUV,e.faceColors,e.frontUVs,e.backUVs,e.wrap).applyToMesh(g,e.updatable),g}function Ag(r,e,t=null,i=earcut){return vg(r,e,t,i)}let _E=!1;function BF(){_E||(_E=!0,Ye.CreatePolygon=pR,ee.CreatePolygon=(r,e,t,i,s,n,o=earcut)=>vg(r,{shape:e,holes:i,updatable:s,sideOrientation:n},t,o),ee.ExtrudePolygon=(r,e,t,i,s,n,o,c=earcut)=>Ag(r,{shape:e,holes:s,depth:t,updatable:n,sideOrientation:o},i,c))}function yR(r,e,t=null){const i=e.path,s=e.shape,n=e.scale||1,o=e.rotation||0,c=e.cap===0?0:e.cap||ee.NO_CAP,h=e.updatable,f=ee._GetDefaultSideOrientation(e.sideOrientation),_=e.instance||null,d=e.invertUV||!1,g=e.closeShape||!1,p=e.closePath||!1,b=e.capFunction||null;return xR(r,s,i,n,o,null,null,p,g,c,!1,t,!!h,f,_,d,e.frontUVs||null,e.backUVs||null,e.firstNormal||null,!!e.adjustFrame,b)}function bR(r,e,t=null){const i=e.path,s=e.shape,n=I.Zero(),o=(S,R)=>{const P=e.scaleFunction?.(S,R)??1;return n.copyFromFloats(P,P,P)},c=e.rotationFunction||(()=>0),h=e.closePath||e.ribbonCloseArray||!1,f=e.closeShape||e.ribbonClosePath||!1,_=e.cap===0?0:e.cap||ee.NO_CAP,d=e.updatable,g=e.firstNormal||null,p=e.adjustFrame||!1,b=ee._GetDefaultSideOrientation(e.sideOrientation),x=e.instance,E=e.invertUV||!1,v=e.capFunction||null;return xR(r,s,i,null,null,e.scaleVectorFunction??o,c,h,f,_,!0,t,!!d,b,x||null,E,e.frontUVs||null,e.backUVs||null,g,p,v||null)}function xR(r,e,t,i,s,n,o,c,h,f,_,d,g,p,b,x,E,v,S,R,P){const M=(ie,ne,ce,k,te,X,q,W,K,Z,F)=>{const A=ce.getTangents(),N=ce.getNormals(),Y=ce.getBinormals(),se=ce.getDistances();if(F){for(let je=0;je<A.length;je++)if(A[je].x==0&&A[je].y==0&&A[je].z==0&&A[je].copyFrom(A[je-1]),N[je].x==0&&N[je].y==0&&N[je].z==0&&N[je].copyFrom(N[je-1]),Y[je].x==0&&Y[je].y==0&&Y[je].z==0&&Y[je].copyFrom(Y[je-1]),je>0){let yt=A[je-1];I.Dot(yt,A[je])<0&&A[je].scaleInPlace(-1),yt=N[je-1],I.Dot(yt,N[je])<0&&N[je].scaleInPlace(-1),yt=Y[je-1],I.Dot(yt,Y[je])<0&&Y[je].scaleInPlace(-1)}}let ue=0;const pe=()=>te!==null?te:I.OneReadOnly,Le=Z&&W?W:()=>X!==null?X:0,J=Z&&q?q:pe;let _e=K===ee.NO_CAP||K===ee.CAP_END?0:2;const ye=ge.Matrix[0];for(let je=0;je<ne.length;je++){const yt=[],Yt=Le(je,se[je]),kt=J(je,se[je]);ae.RotationAxisToRef(A[je],ue,ye);for(let Et=0;Et<ie.length;Et++){const Gt=A[je].scale(ie[Et].z).add(N[je].scale(ie[Et].x)).add(Y[je].scale(ie[Et].y)),zt=I.Zero();I.TransformCoordinatesToRef(Gt,ye,zt),zt.multiplyInPlace(kt).addInPlace(ne[je]),yt[Et]=zt}k[_e]=yt,ue+=Yt,_e++}const Je=P||(je=>{const yt=Array(),Yt=I.Zero();let kt;for(kt=0;kt<je.length;kt++)Yt.addInPlace(je[kt]);for(Yt.scaleInPlace(1/je.length),kt=0;kt<je.length;kt++)yt.push(Yt);return yt});switch(K){case ee.NO_CAP:break;case ee.CAP_START:k[0]=Je(k[2]),k[1]=k[2];break;case ee.CAP_END:k[_e]=k[_e-1],k[_e+1]=Je(k[_e-1]);break;case ee.CAP_ALL:k[0]=Je(k[2]),k[1]=k[2],k[_e]=k[_e-1],k[_e+1]=Je(k[_e-1]);break}return k}
205,O=i!==null?new I(i,i,i):null;let D;if(b){const ie=b._creationDataStorage;return S?ie.path3D.update(t,S):ie.path3D.update(t),D=M(e,t,ie.path3D,ie.pathArray,O,s,n,o,ie.cap,_,R),b=mo("",{pathArray:D,closeArray:!1,closePath:!1,offset:0,updatable:!1,sideOrientation:0,instance:b},d||void 0),b}const w=S?new ch(t,S):new ch(t),G=new Array;f=f<0||f>3?0:f,D=M(e,t,w,G,O,s,n,o,f,_,R);const H=mo(r,{pathArray:D,closeArray:c,closePath:h,updatable:g,sideOrientation:p,invertUV:x,frontUVs:E||void 0,backUVs:v||void 0},d);return H._creationDataStorage.pathArray=D,H._creationDataStorage.path3D=w,H._creationDataStorage.cap=f,H}let mE=!1;function NF(){mE||(mE=!0,ee.ExtrudeShape=(r,e,t,i,s,n,o=null,c,h,f)=>{const _={shape:e,path:t,scale:i,rotation:s,cap:n===0?0:n||ee.NO_CAP,sideOrientation:h,instance:f,updatable:c};return yR(r,_,o)},ee.ExtrudeShapeCustom=(r,e,t,i,s,n,o,c,h,f,_,d)=>{const g={shape:e,path:t,scaleFunction:i,rotationFunction:s,ribbonCloseArray:n,ribbonClosePath:o,cap:c===0?0:c||ee.NO_CAP,sideOrientation:_,instance:d,updatable:f};return bR(r,g,h)})}function TR(r,e,t=null){const i=e.arc?e.arc<=0||e.arc>1?1:e.arc:1,s=e.closed===void 0?!0:e.closed,n=e.shape,o=e.radius||1,c=e.tessellation||64,h=e.clip||0,f=e.updatable,_=ee._GetDefaultSideOrientation(e.sideOrientation),d=e.cap||ee.NO_CAP,g=Math.PI*2,p=[],b=e.invertUV||!1;let x,E;const v=g/c*i;let S,R;for(x=0;x<=c-h;x++){for(R=[],(d==ee.CAP_START||d==ee.CAP_ALL)&&(R.push(new I(0,n[0].y,0)),R.push(new I(Math.cos(x*v)*n[0].x*o,n[0].y,Math.sin(x*v)*n[0].x*o))),E=0;E<n.length;E++)S=new I(Math.cos(x*v)*n[E].x*o,n[E].y,Math.sin(x*v)*n[E].x*o),R.push(S);(d==ee.CAP_END||d==ee.CAP_ALL)&&(R.push(new I(Math.cos(x*v)*n[n.length-1].x*o,n[n.length-1].y,Math.sin(x*v)*n[n.length-1].x*o)),R.push(new I(0,n[n.length-1].y,0))),p.push(R)}return mo(r,{pathArray:p,closeArray:s,sideOrientation:_,updatable:f,invertUV:b,frontUVs:e.frontUVs,backUVs:e.backUVs},t)}let gE=!1;function UF(){gE||(gE=!0,ee.CreateLathe=(r,e,t,i,s,n,o)=>TR(r,{shape:e,radius:t,tessellation:i,sideOrientation:o,updatable:n},s))}function ER(r){const e=[],t=[],i=[],s=[],n=r.width!==void 0?r.width:r.size!==void 0?r.size:1,o=r.height!==void 0?r.height:r.size!==void 0?r.size:1,c=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,h=n/2,f=o/2;t.push(-h,-f,0),i.push(0,0,-1),s.push(0,0),t.push(h,-f,0),i.push(0,0,-1),s.push(1,0),t.push(h,f,0),i.push(0,0,-1),s.push(1,1),t.push(-h,f,0),i.push(0,0,-1),s.push(0,1),e.push(0),e.push(1),e.push(2),e.push(0),e.push(2),e.push(3),Ye._ComputeSides(c,t,e,i,s,r.frontUVs,r.backUVs);const _=new Ye;return _.indices=e,_.positions=t,_.normals=i,_.uvs=s,_}function vR(r,e={},t=null){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,ER(e).applyToMesh(i,e.updatable),e.sourcePlane&&(i.translate(e.sourcePlane.normal,-e.sourcePlane.d),i.setDirection(e.sourcePlane.normal.scale(-1))),i}let pE=!1;function kF(){pE||(pE=!0,Ye.CreatePlane=ER,ee.CreatePlane=(r,e,t,i,s)=>vR(r,{size:e,width:e,height:e,sideOrientation:s,updatable:i},t))}function AR(r,e,t=null){const i=e.path;let s=e.instance,n=1;e.radius!==void 0?n=e.radius:s&&(n=s._creationDataStorage.radius);const o=e.tessellation||64,c=e.radiusFunction||null;let h=e.cap||ee.NO_CAP;const f=e.invertUV||!1,_=e.updatable,d=ee._GetDefaultSideOrientation(e.sideOrientation);e.arc=e.arc&&(e.arc<=0||e.arc>1)?1:e.arc||1;const g=(v,S,R,P,M,O,D,w)=>{const G=S.getTangents(),H=S.getNormals(),ie=S.getDistances(),ce=Math.PI*2/M*w,te=O||(()=>P);let X,q,W,K;const Z=ge.Matrix[0];let F=D===ee.NO_CAP||D===ee.CAP_END?0:2;for(let N=0;N<v.length;N++){q=te(N,ie[N]),X=Array(),W=H[N];for(let Y=0;Y<M;Y++)ae.RotationAxisToRef(G[N],ce*Y,Z),K=X[Y]?X[Y]:I.Zero(),I.TransformCoordinatesToRef(W,Z,K),K.scaleInPlace(q).addInPlace(v[N]),X[Y]=K;R[F]=X,F++}const A=(N,Y)=>{const se=Array();for(let ue=0;ue<N;ue++)se.push(v[Y]);return se};switch(D){case ee.NO_CAP:break;case ee.CAP_START:R[0]=A(M,0),R[1]=R[2].slice(0);break;case ee.CAP_END:R[F]=R[F-1].slice(0),R[F+1]=A(M,v.length-1);break;case ee.CAP_ALL:R[0]=A(M,0),R[1]=R[2].slice(0),R[F]=R[F-1].slice(0),R[F+1]=A(M,v.length-1);break}return R};let p,b;if(s){const v=s._creationDataStorage,S=e.arc||v.arc;return p=v.path3D.update(i),b=g(i,p,v.pathArray,n,v.tessellation,c,v.cap,S),s=mo("",{pathArray:b,instance:s}),v.path3D=p,v.pathArray=b,v.arc=S,v.radius=n,s}p=new ch(i);const x=new Array;h=h<0||h>3?0:h,b=g(i,p,x,n,o,c,h,e.arc);const E=mo(r,{pathArray:b,closePath:!0,closeArray:!1,updatable:_,sideOrientation:d,invertUV:f,frontUVs:e.frontUVs,backUVs:e.backUVs},t);return E._creationDataStorage.pathArray=b,E._creationDataStorage.path3D=p,E._creationDataStorage.tessellation=o,E._creationDataStorage.cap=h,E._creationDataStorage.arc=e.arc,E._creationDataStorage.radius=n,E}let yE=!1;function zF(){yE||(yE=!0,ee.CreateTube=(r,e,t,i,s,n,o,c,h,f)=>
205AR(r,{path:e,radius:t,tessellation:i,radiusFunction:s,arc:1,cap:n,updatable:c,sideOrientation:h,instance:f},o))}function RR(r){const e=[];e[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],[0,2,3],[0,3,1],[1,3,2]]},e[1]={vertex:[[0,0,1.414214],[1.414214,0,0],[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},e[2]={vertex:[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},e[3]={vertex:[[0,0,1.175571],[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},e[4]={vertex:[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],[16,19,23,22],[18,22,23,21]]},e[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},e[6]={vertex:[[0,0,1.159953],[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},e[7]={vertex:[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],[2,4,8,11,10,6]]},e[8]={vertex:[[-.729665,.670121,.319155],[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],[4,1,0,3]]},e[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],[0,3,5,4,1]]},e[10]={vertex:[[-.610389,.243975,.531213],[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],[2,4,1]]},e[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},e[12]={vertex:[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],[4,9,6,1]]},e[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],[2,4,1,0],[4,10,7,1]]},e[14]={vertex:[[-.93465,.300459,-.271185],[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],[-.503838,-.004675,-.9
20569981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],[22,17,11,5,4,8,14,19,23,24]]};const t=r.type&&(r.type<0||r.type>=e.length)?0:r.type||0,i=r.size,s=r.sizeX||i||1,n=r.sizeY||i||1,o=r.sizeZ||i||1,c=r.custom||e[t],h=c.face.length,f=r.faceUV||new Array(h),_=r.faceColors,d=r.flat===void 0?!0:r.flat,g=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,p=[],b=[],x=[],E=[],v=[];let S=0,R=0;const P=[];let M,O,D,w,G,H,ie,ne;if(d)for(O=0;O<h;O++)_&&_[O]===void 0&&(_[O]=new xt(1,1,1,1)),f&&f[O]===void 0&&(f[O]=new dt(0,0,1,1));if(d)for(O=0;O<h;O++){const k=c.face[O].length;for(G=2*Math.PI/k,H=.5*Math.tan(G/2),ie=.5,M=0;M<k;M++)p.push(c.vertex[c.face[O][M]][0]*s,c.vertex[c.face[O][M]][1]*n,c.vertex[c.face[O][M]][2]*o),P.push(S),S++,D=f[O].x+(f[O].z-f[O].x)*(.5+H),w=f[O].y+(f[O].w-f[O].y)*(ie-.5),E.push(D,w),ne=H*Math.cos(G)-ie*Math.sin(G),ie=H*Math.sin(G)+ie*Math.cos(G),H=ne,_&&v.push(_[O].r,_[O].g,_[O].b,_[O].a);for(M=0;M<k-2;M++)b.push(P[0+R],P[M+2+R],P[M+1+R]);R+=k}else{for(M=0;M<c.vertex.length;M++)p.push(c.vertex[M][0]*s,c.vertex[M][1]*n,c.vertex[M][2]*o),E.push(0,0);for(O=0;O<h;O++)for(M=0;M<c.face[O].length-2;M++)b.push(c.face[O][0],c.face[O][M+2],c.face[O][M+1])}Ye.ComputeNormals(p,b,x),Ye._ComputeSides(g,p,b,x,E,r.frontUVs,r.backUVs);const ce=new Ye;return ce.positions=p,ce.indices=b,ce.normals=x,ce.uvs=E,_&&d&&(ce.colors=v),ce}function Rg(r,e={},t=null){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,RR(e).applyToMesh(i,e.updatable),i}let bE=!1;function VF(){bE||(bE=!0,Ye.CreatePolyhedron=RR,ee.CreatePolyhedron=(r,e,t)=>Rg(r,e,t))}function SR(r){const e=r.sideOrientation||Ye.DEFAULTSIDE,t=r.radius||1,i=r.flat===void 0?!0:r.flat,s=(r.subdivisions||4)|0,n=r.radiusX||t,o=r.radiusY||t,c=r.radiusZ||t,h=(1+Math.sqrt(5))/2,f=[-1,h,-0,1,h,0,-1,-h,0,1,-h,0,0,-1,-h,0,1,-h,0,-1,h,0,1,h,h,0,1,h,0,-1,-h,0,1,-h,0,-1],_=[0,11,5,0,5,1,0,1,7,0,7,10,12,22,23,1,5,20,5,11,4,23,22,13,22,18,6,7,1,8,14,21,4,14,4,2,16,13,6,15,6,19,3,8,9,4,21,5,13,17,23,6,13,22,19,6,18,9,8,1],d=[0,1,2,3,4,5,6,7,8,9,10,11,0,2,3,3,3,4,7,8,9,9,10,11],g=[5,1,3,1,6,4,0,0,5,3,4,2,2,2,4,0,2,0,1,1,6,0,6,2,0,4,3,3,4,4,3,1,4,2,4,4,0,2,1,1,2,2,3,3,1,3,2,4],p=138/1024,b=239/1024,x=60/1024,E=26/1024,v=-40/1024,S=20/1024,R=[0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,1,1,0],P=[],M=[],O=[],D=[];let w=0;const G=new Array(3),H=new Array(3);let ie;for(ie=0;ie<3;ie++)G[ie]=I.Zero(),H[ie]=He.Zero();for(let ce=0;ce<20;ce++){for(ie=0;ie<3;ie++){const te=_[3*ce+ie];G[ie].copyFromFloats(f[3*d[te]],f[3*d[te]+1],f[3*d[te]+2]),G[ie].normalize(),H[ie].copyFromFloats(g[2*te]*p+x+R[ce]*v,g[2*te+1]*b+E+R[ce]*S)}const k=(te,X,q,W)=>{const K=I.Lerp(G[0],G[2],X/s),Z=I.Lerp(G[1],G[2],X/s),F=s===X?G[2]:I.Lerp(K,Z,te/(s-X));F.normalize();let A;if(i){const ue=I.Lerp(G[0],G[2],W/s),pe=I.Lerp(G[1],G[2],W/s);A=I.Lerp(ue,pe,q/(s-W))}else A=new I(F.x,F.y,F.z);A.x/=n,A.y/=o,A.z/=c,A.normalize();const N=He.Lerp(H[0],H[2],X/s),Y=He.Lerp(H[1],H[2],X/s),se=s===X?H[2]:He.Lerp(N,Y,te/(s-X));M.push(F.x*n,F.y*o,F.z*c),O.push(A.x,A.y,A.z),D.push(se.x,se.y),P.push(w),w++};for(let te=0;te<s;te++)for(let X=0;X+te<s;X++)k(X,te,X+1/3,te+1/3),k(X+1,te,X+1/3,te+1/3),k(X,te+1,X+1/3,te+1/3),X+te+1<s&&(k(X+1,te,X+2/3,te+2/3),k(X+1,te+1,X+2/3,te+2/3),k(X,te+1,X+2/3,te+2/3))}Ye._ComputeSides(e,M,P,O,D,r.frontUVs,r.backUVs);const ne=new Ye;return ne.indices=P,ne.positions=M,ne.normals=O,ne.uvs=D,ne}function MR(r,e={},t=null){const i=new ee(r,t);return e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),i._originalBuilderSideOrientation=e.sideOrientation,SR(e).applyToMesh(i,e.updatable),i}let xE=!1;function GF(){xE||(xE=!0,Ye.CreateIcoSphere=SR,ee.CreateIcoSphere=(r,e,t)=>MR(r,e,t))}const HF=new I(1,0,0),WF=new I(-1,0,0),XF=new I(0,1,0),YF=new I(0,-1,0),jF=new I(0,0,1),qF=new I(0,0,-1);class ed{constructor(e=I.Zero(),t=I.Up(),i=He.Zero(),s=0,n=0,o=null,c=null,h=null,f=null){this.position=e,this.normal=t,this.uv=i,this.vertexIdx=s,this.vertexIdxForBones=n,this.localPositionOverride=o,this.localNormalOverride=c,this.matrixIndicesOverride=h,this.matrixWeightsOverride=f}clone(){return new ed(this.position.clone(),this.normal.clone(),this.uv.clone(),this.vertexIdx,this.vertexIdxForBones,this.localPositionOverride?.slice(),this.localNormalOverride?.slice(),this.matrixIndicesOverride?.slice(),this.matrixWeightsOverride?.slice())}}function CR(r,e,t){const i=!!e.skeleton,s=!!e.morphTargetManager?.numTargets,n=t.localMode||i,o=e.getIndices(),c=i||s?e.getPositionData(!0,!0):e.getVerticesData(U.PositionKind),h=i||s?e.getNormalsData(!0,!0):e.getVerticesData(U.NormalKind),f=n?i?e.getVerticesData(U.PositionKind):c:null,_=n?i?e.getVerticesData(U.NormalKind):h:null,d=e.getVerticesData(U.UVKind),g=i?e.getVerticesData(U.MatricesIndicesKind):null,p=i?e.getVerticesData(U.MatricesWeightsKind):null,b=i?e.getVerticesData(U.MatricesIndicesExtraKind):null,x=i?e.getVerticesData(U.MatricesWeightsExtraKind):null,E=t.position||I.Zero();let v=t.normal||I.Up();const S=t.size||I.One(),R=t.angle||0;if(!v){const q=new I(0,0,1),W=e.getScene().activeCamera,K=I.TransformCoordinates(q,W.getWorldMatrix());v=W.globalPosition.subtract(K)}const P=-Math.atan2(v.z,v.x)-Math.PI/2,M=Math.sqrt(v.x*v.x+v.z*v.z),O=Math.atan2(v.y,M),D=new Ye;D.indices=[],D.positions=[],D.normals=[],D.uvs=[],D.matricesIndices=i?[]:null,D.matricesWeights=i?[]:null,D.matricesIndicesExtra=b?[]:null,D.matricesWeightsExtra=x?[]:null;let w=0;const G=(q,W)=>{const K=new ed;if(!o||!c||!h)return K;const Z=o[q];if(K.vertexIdx=Z*3,K.vertexIdxForBones=Z*4,K.position=new I(c[Z*3],c[Z*3+1],c[Z*3+2]),I.TransformCoordinatesToRef(K.position,W,K.position),K.normal=new I(h[Z*3],h[Z*3+1],h[Z*3+2]),I.TransformNormalToRef(K.normal,W,K.normal),t.captureUVS&&d){const F=d[Z*2+1];K.uv=new He(d[Z*2],F)}return K},H=[0,0,0,0],ie=(q,W)=>{if(q.length===0)return q;const K=.5*Math.abs(I.Dot(S,W)),Z=(N,Y,se,ue)=>{for(let pe=0;pe<ue;++pe)if(N[se+pe]===Y)return se+pe;return-1},F=(N,Y)=>{const se=I.GetClipFactor(N.position,Y.position,W,K);let ue=H,pe=H;if(g&&p){const ze=N.matrixIndicesOverride?0:N.vertexIdxForBones,si=N.matrixIndicesOverride??g,$t=N.matrixWeightsOverride??p,oi=Y.matrixIndicesOverride?0:Y.vertexIdxForBones,ti=Y.matrixIndicesOverride??g,ii=Y.matrixWeightsOverride??p;
205ue=[0,0,0,0],pe=[0,0,0,0];let Ct=0;for(let Pt=0;Pt<4;++Pt)if($t[ze+Pt]>0){const Ht=Z(ti,si[ze+Pt],oi,4);ue[Ct]=si[ze+Pt],pe[Ct]=kf($t[ze+Pt],Ht>=0?ii[Ht]:0,se),Ct++}for(let Pt=0;Pt<4&&Ct<4;++Pt){const Ht=ti[oi+Pt];Z(si,Ht,ze,4)===-1&&(ue[Ct]=Ht,pe[Ct]=kf(0,ii[oi+Pt],se),Ct++)}const ni=pe[0]+pe[1]+pe[2]+pe[3];pe[0]/=ni,pe[1]/=ni,pe[2]/=ni,pe[3]/=ni}const Ie=N.localPositionOverride?N.localPositionOverride[0]:f?.[N.vertexIdx]??0,Le=N.localPositionOverride?N.localPositionOverride[1]:f?.[N.vertexIdx+1]??0,J=N.localPositionOverride?N.localPositionOverride[2]:f?.[N.vertexIdx+2]??0,_e=Y.localPositionOverride?Y.localPositionOverride[0]:f?.[Y.vertexIdx]??0,ye=Y.localPositionOverride?Y.localPositionOverride[1]:f?.[Y.vertexIdx+1]??0,Ne=Y.localPositionOverride?Y.localPositionOverride[2]:f?.[Y.vertexIdx+2]??0,Je=N.localNormalOverride?N.localNormalOverride[0]:_?.[N.vertexIdx]??0,je=N.localNormalOverride?N.localNormalOverride[1]:_?.[N.vertexIdx+1]??0,yt=N.localNormalOverride?N.localNormalOverride[2]:_?.[N.vertexIdx+2]??0,Yt=Y.localNormalOverride?Y.localNormalOverride[0]:_?.[Y.vertexIdx]??0,kt=Y.localNormalOverride?Y.localNormalOverride[1]:_?.[Y.vertexIdx+1]??0,Et=Y.localNormalOverride?Y.localNormalOverride[2]:_?.[Y.vertexIdx+2]??0,Gt=Je+(Yt-Je)*se,zt=je+(kt-je)*se,nt=yt+(Et-yt)*se,oe=Math.sqrt(Gt*Gt+zt*zt+nt*nt);return new ed(I.Lerp(N.position,Y.position,se),I.Lerp(N.normal,Y.normal,se).normalize(),He.Lerp(N.uv,Y.uv,se),-1,-1,f?[Ie+(_e-Ie)*se,Le+(ye-Le)*se,J+(Ne-J)*se]:null,_?[Gt/oe,zt/oe,nt/oe]:null,ue,pe)};let A=null;q.length>3&&(A=[]);for(let N=0;N<q.length;N+=3){let Y=null,se=null,ue=null,pe=null;const Ie=I.Dot(q[N].position,W)-K,Le=I.Dot(q[N+1].position,W)-K,J=I.Dot(q[N+2].position,W)-K,_e=Ie>0,ye=Le>0,Ne=J>0;switch((_e?1:0)+(ye?1:0)+(Ne?1:0)){case 0:q.length>3?(A.push(q[N]),A.push(q[N+1]),A.push(q[N+2])):A=q;break;case 1:if(A=A??new Array,_e&&(Y=q[N+1],se=q[N+2],ue=F(q[N],Y),pe=F(q[N],se)),ye){Y=q[N],se=q[N+2],ue=F(q[N+1],Y),pe=F(q[N+1],se),A.push(ue),A.push(se.clone()),A.push(Y.clone()),A.push(se.clone()),A.push(ue.clone()),A.push(pe);break}Ne&&(Y=q[N],se=q[N+1],ue=F(q[N+2],Y),pe=F(q[N+2],se)),Y&&se&&ue&&pe&&(A.push(Y.clone()),A.push(se.clone()),A.push(ue),A.push(pe),A.push(ue.clone()),A.push(se.clone()));break;case 2:A=A??new Array,_e||(Y=q[N].clone(),se=F(Y,q[N+1]),ue=F(Y,q[N+2]),A.push(Y),A.push(se),A.push(ue)),ye||(Y=q[N+1].clone(),se=F(Y,q[N+2]),ue=F(Y,q[N]),A.push(Y),A.push(se),A.push(ue)),Ne||(Y=q[N+2].clone(),se=F(Y,q[N]),ue=F(Y,q[N+1]),A.push(Y),A.push(se),A.push(ue));break}}return A},ne=e instanceof ee?e:null,ce=ne?._thinInstanceDataStorage.matrixData,k=ne?.thinInstanceCount||1,te=ge.Matrix[0];te.copyFrom(ae.IdentityReadOnly);for(let q=0;q<k;++q){if(ne?.hasThinInstances&&ce){const N=q*16;te.setRowFromFloats(0,ce[N+0],ce[N+1],ce[N+2],ce[N+3]),te.setRowFromFloats(1,ce[N+4],ce[N+5],ce[N+6],ce[N+7]),te.setRowFromFloats(2,ce[N+8],ce[N+9],ce[N+10],ce[N+11]),te.setRowFromFloats(3,ce[N+12],ce[N+13],ce[N+14],ce[N+15])}const W=ae.RotationYawPitchRoll(P,O,R).multiply(ae.Translation(E.x,E.y,E.z)),K=ae.Invert(W),Z=e.getWorldMatrix(),F=te.multiply(Z).multiply(K),A=new Array(3);for(let N=0;N<o.length;N+=3){let Y=A;if(Y[0]=G(N,F),Y[1]=G(N+1,F),Y[2]=G(N+2,F),!(t.cullBackFaces&&-Y[0].normal.z<=0&&-Y[1].normal.z<=0&&-Y[2].normal.z<=0)&&(Y=ie(Y,HF),!!Y&&(Y=ie(Y,WF),!!Y&&(Y=ie(Y,XF),!!Y&&(Y=ie(Y,YF),!!Y&&(Y=ie(Y,jF),!!Y&&(Y=ie(Y,qF),!!Y)))))))for(let se=0;se<Y.length;se++){const ue=Y[se];if(D.indices.push(w),n?(ue.localPositionOverride?(D.positions[w*3]=ue.localPositionOverride[0],D.positions[w*3+1]=ue.localPositionOverride[1],D.positions[w*3+2]=ue.localPositionOverride[2]):f&&(D.positions[w*3]=f[ue.vertexIdx],D.positions[w*3+1]=f[ue.vertexIdx+1],D.positions[w*3+2]=f[ue.vertexIdx+2]),ue.localNormalOverride?(D.normals[w*3]=ue.localNormalOverride[0],D.normals[w*3+1]=ue.localNormalOverride[1],D.normals[w*3+2]=ue.localNormalOverride[2]):_&&(D.normals[w*3]=_[ue.vertexIdx],D.normals[w*3+1]=_[ue.vertexIdx+1],D.normals[w*3+2]=_[ue.vertexIdx+2])):(ue.position.toArray(D.positions,w*3),ue.normal.toArray(D.normals,w*3)),D.matricesIndices&&D.matricesWeights&&(ue.matrixIndicesOverride?(D.matricesIndices[w*4]=ue.matrixIndicesOverride[0],D.matricesIndices[w*4+1]=ue.matrixIndicesOverride[1],D.matricesIndices[w*4+2]=ue.matrixIndicesOverride[2],D.matricesIndices[w*4+3]=ue.matrixIndicesOverride[3]):(g&&(D.matricesIndices[w*4]=g[ue.vertexIdxForBones],D.matricesIndices[w*4+1]=g[ue.vertexIdxForBones+1],D.matricesIndices[w*4+2]=g[ue.vertexIdxForBones+2],D.matricesIndices[w*4+3]=g[ue.vertexIdxForBones+3]),b&&D.matricesIndicesExtra&&(D.matricesIndicesExtra[w*4]=b[ue.vertexIdxForBones],D.matricesIndicesExtra[w*4+1]=b[ue.vertexIdxForBones+1],D.matricesIndicesExtra[w*4+2]=b[ue.vertexIdxForBones+2],D.matricesIndicesExtra[w*4+3]=b[ue.vertexIdxForBones+3])),ue.matrixWeightsOverride?(D.matricesWeights[w*4]=ue.matrixWeightsOverride[0],D.matricesWeights[w*4+1]=ue.matrixWeightsOverride[1],D.matricesWeights[w*4+2]=ue.matrixWeightsOverride[2],D.matricesWeights[w*4+3]=ue.matrixWeightsOverride[3]):(p&&(D.matricesWeights[w*4]=p[ue.vertexIdxForBones],D.matricesWeights[w*4+1]=p[ue.vertexIdxForBones+1],D.matricesWeights[w*4+2]=p[ue.vertexIdxForBones+2],D.matricesWeights[w*4+3]=p[ue.vertexIdxForBones+3]),x&&D.matricesWeightsExtra&&(D.matricesWeightsExtra[w*4]=x[ue.vertexIdxForBones],D.matricesWeightsExtra[w*4+1]=x[ue.vertexIdxForBones+1],D.matricesWeightsExtra[w*4+2]=x[ue.vertexIdxForBones+2],D.matricesWeightsExtra[w*4+3]=x[ue.vertexIdxForBones+3]))),t.captureUVS)ue.uv.toArray(D.uvs,w*2);else{D.uvs.push(.5+ue.position.x/S.x);const pe=.5+ue.position.y/S.y;D.uvs.push(pe)}w++}}}D.indices.length===0&&(D.indices=null),D.positions.length===0&&(D.positions=null),D.normals.length===0&&(D.normals=null),D.uvs.length===0&&(D.uvs=null),D.matricesIndices?.length===0&&(D.matricesIndices=null),D.matricesWeights?.length===0&&(D.matricesWeights=null),D.matricesIndicesExtra?.length===0&&(D.matricesIndicesExtra=null),D.matricesWeightsExtra?.length===0&&(D.matricesWeightsExtra=null);
205const X=new ee(r,e.getScene());return D.applyToMesh(X),n?(X.skeleton=e.skeleton,X.parent=e):(X.position=E.clone(),X.rotation=new I(O,P,R)),X.computeWorldMatrix(!0),X.refreshBoundingInfo(!0,!0),X}let TE=!1;function KF(){TE||(TE=!0,ee.CreateDecal=(r,e,t,i,s,n)=>CR(r,e,{position:t,normal:i,size:s,angle:n}))}function IR(r={subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6}){const e=Math.max(r.subdivisions?r.subdivisions:2,1)|0,t=Math.max(r.tessellation?r.tessellation:16,3)|0,i=Math.max(r.height?r.height:1,0),s=Math.max(r.radius?r.radius:.25,0),n=Math.max(r.capSubdivisions?r.capSubdivisions:6,1)|0,o=t,c=e,h=Math.max(r.radiusTop?r.radiusTop:s,0),f=Math.max(r.radiusBottom?r.radiusBottom:s,0),_=i-(h+f),d=0,g=2*Math.PI,p=Math.max(r.topCapSubdivisions?r.topCapSubdivisions:n,1),b=Math.max(r.bottomCapSubdivisions?r.bottomCapSubdivisions:n,1),x=Math.acos((f-h)/i);let E=[];const v=[],S=[],R=[];let P=0;const M=[],O=_*.5,D=Math.PI*.5;let w,G;const H=I.Zero(),ie=I.Zero(),ne=Math.cos(x),ce=Math.sin(x),k=new He(h*ce,O+h*ne).subtract(new He(f*ce,-O+f*ne)).length(),te=h*x+k+f*(D-x);let X=0;for(G=0;G<=p;G++){const Z=[],F=D-x*(G/p);X+=h*x/p;const A=Math.cos(F),N=Math.sin(F),Y=A*h;for(w=0;w<=o;w++){const se=w/o,ue=se*g+d,pe=Math.sin(ue),Ie=Math.cos(ue);ie.x=Y*pe,ie.y=O+N*h,ie.z=Y*Ie,v.push(ie.x,ie.y,ie.z),H.set(A*pe,N,A*Ie),S.push(H.x,H.y,H.z),R.push(se,1-X/te),Z.push(P),P++}M.push(Z)}const q=i-h-f+ne*h-ne*f,W=ce*(f-h)/q;for(G=1;G<=c;G++){const Z=[];X+=k/c;const F=ce*(G*(f-h)/c+h);for(w=0;w<=o;w++){const A=w/o,N=A*g+d,Y=Math.sin(N),se=Math.cos(N);ie.x=F*Y,ie.y=O+ne*h-G*q/c,ie.z=F*se,v.push(ie.x,ie.y,ie.z),H.set(Y,W,se).normalize(),S.push(H.x,H.y,H.z),R.push(A,1-X/te),Z.push(P),P++}M.push(Z)}for(G=1;G<=b;G++){const Z=[],F=D-x-(Math.PI-x)*(G/b);X+=f*x/b;const A=Math.cos(F),N=Math.sin(F),Y=A*f;for(w=0;w<=o;w++){const se=w/o,ue=se*g+d,pe=Math.sin(ue),Ie=Math.cos(ue);ie.x=Y*pe,ie.y=-O+N*f,ie.z=Y*Ie,v.push(ie.x,ie.y,ie.z),H.set(A*pe,N,A*Ie),S.push(H.x,H.y,H.z),R.push(se,1-X/te),Z.push(P),P++}M.push(Z)}for(w=0;w<o;w++)for(G=0;G<p+c+b;G++){const Z=M[G][w],F=M[G+1][w],A=M[G+1][w+1],N=M[G][w+1];E.push(Z),E.push(F),E.push(N),E.push(F),E.push(A),E.push(N)}if(E=E.reverse(),r.orientation&&!r.orientation.equals(I.Up())){const Z=new ae;r.orientation.clone().scale(Math.PI*.5).cross(I.Up()).toQuaternion().toRotationMatrix(Z);const F=I.Zero();for(let A=0;A<v.length;A+=3)F.set(v[A],v[A+1],v[A+2]),I.TransformCoordinatesToRef(F.clone(),Z,F),v[A]=F.x,v[A+1]=F.y,v[A+2]=F.z}const K=new Ye;return K.positions=v,K.normals=S,K.uvs=R,K.indices=E,K}function DR(r,e={orientation:I.Up(),subdivisions:2,tessellation:16,height:1,radius:.25,capSubdivisions:6,updatable:!1},t=null){const i=new ee(r,t);return IR(e).applyToMesh(i,e.updatable),i}let EE=!1;function ZF(){EE||(EE=!0,ee.CreateCapsule=(r,e,t)=>DR(r,e,t),Ye.CreateCapsule=IR)}class pi{constructor(e=0,t=0){this.x=e,this.y=t,e!==Math.floor(e)&&(e=Math.floor(e),Ee.Warn("x is not an integer, floor(x) used")),t!==Math.floor(t)&&(t=Math.floor(t),Ee.Warn("y is not an integer, floor(y) used"))}clone(){return new pi(this.x,this.y)}rotate60About(e){const t=this.x;return this.x=e.x+e.y-this.y,this.y=t+this.y-e.x,this}rotateNeg60About(e){const t=this.x;return this.x=t+this.y-e.y,this.y=e.x+e.y-t,this}rotate120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),Ee.Warn("m not an integer only floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),Ee.Warn("n not an integer only floor(n) used"));const i=this.x;return this.x=e-i-this.y,this.y=t+i,this}rotateNeg120(e,t){e!==Math.floor(e)&&(e=Math.floor(e),Ee.Warn("m is not an integer, floor(m) used")),t!==Math.floor(t)&&(t=Math.floor(t),Ee.Warn("n is not an integer,   floor(n) used"));const i=this.x;return this.x=this.y-t,this.y=e+t-i-this.y,this}toCartesianOrigin(e,t){const i=I.Zero();return i.x=e.x+2*this.x*t+this.y*t,i.y=e.y+Math.sqrt(3)*this.y*t,i}static Zero(){return new pi(0,0)}}class PR{constructor(){this.cartesian=[],this.vertices=[],this.max=[],this.min=[],this.closestTo=[],this.innerFacets=[],this.isoVecsABOB=[],this.isoVecsOBOA=[],this.isoVecsBAOA=[],this.vertexTypes=[],this.IDATA=new Km("icosahedron","Regular",[[0,Fi,-1],[-Fi,1,0],[-1,0,-Fi],[1,0,-Fi],[Fi,1,0],[0,Fi,1],[-1,0,Fi],[-Fi,-1,0],[0,-Fi,-1],[Fi,-1,0],[1,0,Fi],[0,-Fi,1]],[[0,2,1],[0,3,2],[0,4,3],[0,5,4],[0,1,5],[7,6,1],[8,7,2],[9,8,3],[10,9,4],[6,10,5],[2,7,1],[3,8,2],[4,9,3],[5,10,4],[1,6,5],[11,6,7],[11,7,8],[11,8,9],[11,9,10],[11,10,
2056]])}setIndices(){let e=12;const t={},i=this.m,s=this.n;let n=i;s!==0&&(n=zm(i,s));const o=i/n,c=s/n;let h,f,_,d,g;const p=pi.Zero(),b=new pi(i,s),x=new pi(-s,i+s),E=pi.Zero(),v=pi.Zero(),S=pi.Zero();let R=[],P,M,O,D;const w=[],G=this.vertByDist,H=(ie,ne,ce,k)=>{P=ie+"|"+ce,M=ne+"|"+k,P in t||M in t?P in t&&!(M in t)?t[M]=t[P]:M in t&&!(P in t)&&(t[P]=t[M]):(t[P]=e,t[M]=e,e++),G[ce][0]>2?w[t[P]]=[-G[ce][0],G[ce][1],t[P]]:w[t[P]]=[R[G[ce][0]],G[ce][1],t[P]]};this.IDATA.edgematch=[[1,"B"],[2,"B"],[3,"B"],[4,"B"],[0,"B"],[10,"O",14,"A"],[11,"O",10,"A"],[12,"O",11,"A"],[13,"O",12,"A"],[14,"O",13,"A"],[0,"O"],[1,"O"],[2,"O"],[3,"O"],[4,"O"],[19,"B",5,"A"],[15,"B",6,"A"],[16,"B",7,"A"],[17,"B",8,"A"],[18,"B",9,"A"]];for(let ie=0;ie<20;ie++){if(R=this.IDATA.face[ie],_=R[2],d=R[1],g=R[0],O=p.x+"|"+p.y,P=ie+"|"+O,P in t||(t[P]=_,w[_]=[R[G[O][0]],G[O][1]]),O=b.x+"|"+b.y,P=ie+"|"+O,P in t||(t[P]=d,w[d]=[R[G[O][0]],G[O][1]]),O=x.x+"|"+x.y,P=ie+"|"+O,P in t||(t[P]=g,w[g]=[R[G[O][0]],G[O][1]]),h=this.IDATA.edgematch[ie][0],f=this.IDATA.edgematch[ie][1],f==="B")for(let ne=1;ne<n;ne++)v.x=i-ne*(o+c),v.y=s+ne*o,S.x=-ne*c,S.y=ne*(o+c),O=v.x+"|"+v.y,D=S.x+"|"+S.y,H(ie,h,O,D);if(f==="O")for(let ne=1;ne<n;ne++)S.x=-ne*c,S.y=ne*(o+c),E.x=ne*o,E.y=ne*c,O=S.x+"|"+S.y,D=E.x+"|"+E.y,H(ie,h,O,D);if(h=this.IDATA.edgematch[ie][2],f=this.IDATA.edgematch[ie][3],f&&f==="A")for(let ne=1;ne<n;ne++)E.x=ne*o,E.y=ne*c,v.x=i-(n-ne)*(o+c),v.y=s+(n-ne)*o,O=E.x+"|"+E.y,D=v.x+"|"+v.y,H(ie,h,O,D);for(let ne=0;ne<this.vertices.length;ne++)O=this.vertices[ne].x+"|"+this.vertices[ne].y,P=ie+"|"+O,P in t||(t[P]=e++,G[O][0]>2?w[t[P]]=[-G[O][0],G[O][1],t[P]]:w[t[P]]=[R[G[O][0]],G[O][1],t[P]])}this.closestTo=w,this.vecToidx=t}calcCoeffs(){const e=this.m,t=this.n,i=Math.sqrt(3)/3,s=e*e+t*t+e*t;this.coau=(e+t)/s,this.cobu=-t/s,this.coav=-i*(e-t)/s,this.cobv=i*(2*e+t)/s}createInnerFacets(){const e=this.m,t=this.n;for(let i=0;i<t+e+1;i++)for(let s=this.min[i];s<this.max[i]+1;s++)s<this.max[i]&&s<this.max[i+1]+1&&this.innerFacets.push(["|"+s+"|"+i,"|"+s+"|"+(i+1),"|"+(s+1)+"|"+i]),i>0&&s<this.max[i-1]&&s+1<this.max[i]+1&&this.innerFacets.push(["|"+s+"|"+i,"|"+(s+1)+"|"+i,"|"+(s+1)+"|"+(i-1)])}edgeVecsABOB(){const e=this.m,t=this.n,i=new pi(-t,e+t);for(let s=1;s<e+t;s++){const n=new pi(this.min[s],s),o=new pi(this.min[s-1],s-1),c=new pi(this.min[s+1],s+1),h=n.clone(),f=o.clone(),_=c.clone();h.rotate60About(i),f.rotate60About(i),_.rotate60About(i);const d=new pi(this.max[h.y],h.y),g=new pi(this.max[h.y-1],h.y-1),p=new pi(this.max[h.y-1]-1,h.y-1);(h.x!==d.x||h.y!==d.y)&&(h.x!==g.x?(this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([n,g,p]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([n,p,d])):h.y===_.y?(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([n,o,g]),this.vertexTypes.push([1,0,1]),this.isoVecsABOB.push([n,g,c])):(this.vertexTypes.push([1,1,0]),this.isoVecsABOB.push([n,o,g]),this.vertexTypes.push([1,0,0]),this.isoVecsABOB.push([n,g,d])))}}mapABOBtoOBOA(){const e=new pi(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){const i=[];for(let s=0;s<3;s++)e.x=this.isoVecsABOB[t][s].x,e.y=this.isoVecsABOB[t][s].y,this.vertexTypes[t][s]===0&&e.rotateNeg120(this.m,this.n),i.push(e.clone());this.isoVecsOBOA.push(i)}}mapABOBtoBAOA(){const e=new pi(0,0);for(let t=0;t<this.isoVecsABOB.length;t++){const i=[];for(let s=0;s<3;s++)e.x=this.isoVecsABOB[t][s].x,e.y=this.isoVecsABOB[t][s].y,this.vertexTypes[t][s]===1&&e.rotate120(this.m,this.n),i.push(e.clone());this.isoVecsBAOA.push(i)}}MapToFace(e,t){const i=this.IDATA.face[e],s=i[2],n=i[1],o=i[0],c=I.FromArray(this.IDATA.vertex[s]),h=I.FromArray(this.IDATA.vertex[n]),f=I.FromArray(this.IDATA.vertex[o]),_=h.subtract(c),d=f.subtract(c),g=_.scale(this.coau).add(d.scale(this.cobu)),p=_.scale(this.coav).add(d.scale(this.cobv));let b,x;for(let E=0;E<this.cartesian.length;E++)x=g.scale(this.cartesian[E].x).add(p.scale(this.cartesian[E].y)).add(c),x.x,x.y,x.z,b=e+"|"+this.vertices[E].x+"|"+this.vertices[E].y,t.vertex[this.vecToidx[b]]=[x.x,x.y,x.z]}build(e,t){const i=[],s=pi.Zero(),n=new pi(e,t),o=new pi(-t,e+t);i.push(s,n,o);for(let M=t;M<e+1;M++)for(let O=0;O<e+1-M;O++)i.push(new pi(O,M));if(t>0){const M=zm(e,t),O=e/M,D=t/M;for(let G=1;G<M;G++)i.push(new pi(G*O,G*D)),i.push(new pi(-G*D,G*(O+D))),i.push(new pi(e-G*(O+D),t+G*O));const w=e/t;for(let G=1;G<t;G++)for(let H=0;H<G*w;H++)i.push(new pi(H,G)),i.push(new pi(H,G).rotate120(e,t)),i.push(new pi(H,G).rotateNeg120(e,t))}i.sort((M,O)=>M.x-O.x),i.sort((M,O)=>M.y-O.y);const c=new Array(e+t+1),h=new Array(e+t+1);for(let M=0;M<c.length;M++)c[M]=1/0,h[M]=-1/0;let f,_;const d=i.length;for(let M=0;M<d;M++)_=i[M].x,f=i[M].y,c[f]=Math.min(_,c[f]),h[f]=Math.max(_,h[f]);const g=(M,O)=>{const D=M.clone();return O==="A"&&D.rotateNeg120(e,t),O==="B"&&D.rotate120(e,t),D.x<0?D.y:D.x+D.y},p=[],b=[],x=[],E=[],v={},S=[];let R=-1,P=-1;for(let M=0;M<d;M++)p[M]=i[M].toCartesianOrigin(new pi(0,0),.5),b[M]=g(i[M],"O"),x[M]=g(i[M],"A"),E[M]=g(i[M],"B"),b[M]===x[M]&&x[M]===E[M]?(R=3,P=b[M]):b[M]===x[M]?(R=4,P=b[M]):x[M]===E[M]?(R=5,P=x[M]):E[M]===b[M]&&
205(R=6,P=b[M]),b[M]<x[M]&&b[M]<E[M]&&(R=2,P=b[M]),x[M]<b[M]&&x[M]<E[M]&&(R=1,P=x[M]),E[M]<x[M]&&E[M]<b[M]&&(R=0,P=E[M]),S.push([R,P,i[M].x,i[M].y]);S.sort((M,O)=>M[2]-O[2]),S.sort((M,O)=>M[3]-O[3]),S.sort((M,O)=>M[1]-O[1]),S.sort((M,O)=>M[0]-O[0]);for(let M=0;M<S.length;M++)v[S[M][2]+"|"+S[M][3]]=[S[M][0],S[M][1],M];return this.m=e,this.n=t,this.vertices=i,this.vertByDist=v,this.cartesian=p,this.min=c,this.max=h,this}}class Km{constructor(e,t,i,s){this.name=e,this.category=t,this.vertex=i,this.face=s}}class gd extends Km{innerToData(e,t){for(let i=0;i<t.innerFacets.length;i++)this.face.push(t.innerFacets[i].map(s=>t.vecToidx[e+s]))}mapABOBtoDATA(e,t){const i=t.IDATA.edgematch[e][0];for(let s=0;s<t.isoVecsABOB.length;s++){const n=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===0?n.push(e+"|"+t.isoVecsABOB[s][o].x+"|"+t.isoVecsABOB[s][o].y):n.push(i+"|"+t.isoVecsABOB[s][o].x+"|"+t.isoVecsABOB[s][o].y);this.face.push([t.vecToidx[n[0]],t.vecToidx[n[1]],t.vecToidx[n[2]]])}}mapOBOAtoDATA(e,t){const i=t.IDATA.edgematch[e][0];for(let s=0;s<t.isoVecsOBOA.length;s++){const n=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===1?n.push(e+"|"+t.isoVecsOBOA[s][o].x+"|"+t.isoVecsOBOA[s][o].y):n.push(i+"|"+t.isoVecsOBOA[s][o].x+"|"+t.isoVecsOBOA[s][o].y);this.face.push([t.vecToidx[n[0]],t.vecToidx[n[1]],t.vecToidx[n[2]]])}}mapBAOAtoDATA(e,t){const i=t.IDATA.edgematch[e][2];for(let s=0;s<t.isoVecsBAOA.length;s++){const n=[];for(let o=0;o<3;o++)t.vertexTypes[s][o]===1?n.push(e+"|"+t.isoVecsBAOA[s][o].x+"|"+t.isoVecsBAOA[s][o].y):n.push(i+"|"+t.isoVecsBAOA[s][o].x+"|"+t.isoVecsBAOA[s][o].y);this.face.push([t.vecToidx[n[0]],t.vecToidx[n[1]],t.vecToidx[n[2]]])}}orderData(e){const t=[];for(let o=0;o<13;o++)t[o]=[];const i=e.closestTo;for(let o=0;o<i.length;o++)i[o][0]>-1?i[o][1]>0&&t[i[o][0]].push([o,i[o][1]]):t[12].push([o,i[o][0]]);const s=[];for(let o=0;o<12;o++)s[o]=o;let n=12;for(let o=0;o<12;o++){t[o].sort((c,h)=>c[1]-h[1]);for(let c=0;c<t[o].length;c++)s[t[o][c][0]]=n++}for(let o=0;o<t[12].length;o++)s[t[12][o][0]]=n++;for(let o=0;o<this.vertex.length;o++)this.vertex[o].push(s[o]);this.vertex.sort((o,c)=>o[3]-c[3]);for(let o=0;o<this.vertex.length;o++)this.vertex[o].pop();for(let o=0;o<this.face.length;o++)for(let c=0;c<this.face[o].length;c++)this.face[o][c]=s[this.face[o][c]];this.sharedNodes=t[12].length,this.poleNodes=this.vertex.length-this.sharedNodes}setOrder(e,t){const i=[],s=[];let n=t.pop();s.push(n);let o=this.face[n].indexOf(e);o=(o+2)%3;let c=this.face[n][o];i.push(c);let h=0;for(;t.length>0;)n=t[h],this.face[n].indexOf(c)>-1?(o=(this.face[n].indexOf(c)+1)%3,c=this.face[n][o],i.push(c),s.push(n),t.splice(h,1),h=0):h++;return this.adjacentFaces.push(i),s}toGoldbergPolyhedronData(){const e=new Km("GeoDual","Goldberg",[],[]);e.name="GD dual";const t=this.vertex.length,i=new Array(t);for(let f=0;f<t;f++)i[f]=[];for(let f=0;f<this.face.length;f++)for(let _=0;_<3;_++)i[this.face[f][_]].push(f);let s,n,o,c,h;this.adjacentFaces=[];for(let f=0;f<i.length;f++){e.face[f]=this.setOrder(f,i[f].concat([]));for(const _ of i[f]){s=0,n=0,o=0,c=this.face[_];for(let d=0;d<3;d++)h=this.vertex[c[d]],s+=h[0],n+=h[1],o+=h[2];e.vertex[_]=[s/3,n/3,o/3]}}return e}static BuildGeodesicData(e){const t=new gd("Geodesic-m-n","Geodesic",[[0,Fi,-1],[-Fi,1,0],[-1,0,-Fi],[1,0,-Fi],[Fi,1,0],[0,Fi,1],[-1,0,Fi],[-Fi,-1,0],[0,-Fi,-1],[Fi,-1,0],[1,0,Fi],[0,-Fi,1]],[]);e.setIndices(),e.calcCoeffs(),e.createInnerFacets(),e.edgeVecsABOB(),e.mapABOBtoOBOA(),e.mapABOBtoBAOA();for(let s=0;s<e.IDATA.face.length;s++)e.MapToFace(s,t),t.innerToData(s,e),e.IDATA.edgematch[s][1]==="B"&&t.mapABOBtoDATA(s,e),e.IDATA.edgematch[s][1]==="O"&&t.mapOBOAtoDATA(s,e),e.IDATA.edgematch[s][3]==="A"&&t.mapBAOAtoDATA(s,e);t.orderData(e);const i=1;return t.vertex=t.vertex.map(function(s){const n=s[0],o=s[1],c=s[2],h=Math.sqrt(n*n+o*o+c*c);return s[0]*=i/h,s[1]*=i/h,s[2]*=i/h,s}),t}}function QF(r,e,t=null){let i=e.m||1;i!==Math.floor(i)&&(i=Math.floor(i),Ee.Warn("m not an integer only floor(m) used"));let s=e.n||0;if(s!==Math.floor(s)&&(s=Math.floor(s),Ee.Warn("n not an integer only floor(n) used")),s>i){const f=s;s=i,i=f,Ee.Warn("n > m therefore m and n swapped")}const n=new PR;n.build(i,s);const c={custom:gd.BuildGeodesicData(n),size:e.size,sizeX:e.sizeX,sizeY:e.sizeY,sizeZ:e.sizeZ,faceUV:e.faceUV,faceColors:e.faceColors,flat:e.flat,updatable:e.updatable,sideOrientation:e.sideOrientation,frontUVs:e.frontUVs,backUVs:e.backUVs};return Rg(r,c,t)}class Sg extends ee{constructor(){super(...arguments),this.goldbergData={faceColors:[],faceCenters:[],faceZaxis:[],faceXaxis:[],faceYaxis:[],nbSharedFaces:0,nbUnsharedFaces:0,nbFaces:0,nbFacesAtPole:0,adjacentFaces:[]}}relatedGoldbergFace(e,t){return t===void 0?(e>this.goldbergData.nbUnsharedFaces-1&&(Ee.Warn("Maximum number of unshared faces used"),e=this.goldbergData.nbUnsharedFaces-1),this.goldbergData.nbUnsharedFaces+e):(e>11&&(Ee.Warn("Last pole used"),e=11),t>this.goldbergData.nbFacesAtPole-1&&(Ee.Warn("Maximum number of faces at a pole used"),t=this.goldbergData.nbFacesAtPole-1),12+e*this.goldbergData.nbFacesAtPole+t)}_changeGoldbergFaceColors(e){for(let i=0;i<e.length;i++){const s=e[i][0],n=e[i][1],o=e[i][2];for(let c=s;c<n+1;c++)this.goldbergData.faceColors[c]=o}const t=[];for(let i=0;i<12;i++)for(let s=0;s<5;s++)t.push(this.goldbergData.faceColors[i].r,this.goldbergData.faceColors[i].g,this.goldbergData.faceColors[i].b,this.goldbergData.faceColors[i].a);for(let i=12;i<this.goldbergData.faceColors.length;i++)for(let s=0;s<6;s++)t.push(this.goldbergData.faceColors[i].r,this.goldbergData.faceColors[i].g,this.goldbergData.faceColors[i].b,this.goldbergData.faceColors[i].a);return t}setGoldbergFaceColors(e){const t=this._changeGoldbergFaceColors(e);this.setVerticesData(U.ColorKind,t)}updateGoldbergFaceColors(e){const t=this._changeGoldbergFaceColors(e);this.updateVerticesData(U.ColorKind,t)}_changeGoldbergFaceUVs(e){const t=this.getVerticesData(U.UVKind);for(let i=0;i<e.length;i++){const s=e[i][0],n=e[i][1],o=e[i][2],c=e[i][3],h=e[i][4],f=[],_=[];let d,g;for(let p=0;p<5;p++)d=o.x+c*Math.cos(h+p*Math.PI/2.5),g=o.y+c*Math.sin(h+p*Math.PI/2.5),d<0&&(d=0),d>1&&(d=1),f.push(d,g);for(let p=0;p<6;p++)d=o.x+c*Math.cos(h+p*Math.PI/3),g=o.y+c*Math.sin(h+p*Math.PI/3),d<0&&(d=0),d>1&&(d=1),_.push(d,g);for(let p=s;p<Math.min(12,n+1);p++)for(let b=0;b<5;b++)t[10*p+2*b]=f[2*b],t[10*p+2*b+1]=f[2*b+1];for(let p=Math.max(12,s);p<n+1;p++)for(let b=0;b<6;b++)t[12*p-24+2*b]=_[2*b],t[12*p-23+2*b]=_[2*b+1]}return t}setGoldbergFaceUVs(e){const t=this._changeGoldbergFaceUVs(e);this.setVerticesData(U.UVKind,t)}updateGoldbergFaceUVs(e){const t=this._changeGoldbergFaceUVs(e);this.updateVerticesData(U.UVKind,t)}placeOnGoldbergFaceAt(e,t,i){const s=I.RotationFromAxis(this.goldbergData.faceXaxis[t],this.goldbergData.faceYaxis[t],this.goldbergData.faceZaxis[t]);e.rotation=s,e.position=this.goldbergData.faceCenters[t].add(this.goldbergData.faceXaxis[t].scale(i.x)).add(this.goldbergData.faceYaxis[t].scale(i.y)).add(this.goldbergData.faceZaxis[t].scale(i.z))}serialize(e){super.serialize(e),e.type="GoldbergMesh";const t={};if(t.adjacentFaces=this.goldbergData.adjacentFaces,t.nbSharedFaces=this.goldbergData.nbSharedFaces,t.nbUnsharedFaces=this.goldbergData.nbUnsharedFaces,t.nbFaces=this.goldbergData.nbFaces,t.nbFacesAtPole=this.goldbergData.nbFacesAtPole,this.goldbergData.faceColors){t.faceColors=[];for(const i of this.goldbergData.faceColors)t.faceColors.push(i.asArray())}if(this.goldbergData.faceCenters){t.faceCenters=[];for(const i of this.goldbergData.faceCenters)t.faceCenters.push(i.asArray())}if(this.goldbergData.faceZaxis){t.faceZaxis=[];for(const i of this.goldbergData.faceZaxis)t.faceZaxis.push(i.asArray())}if(this.goldbergData.faceYaxis){t.faceYaxis=[];for(const i of this.goldbergData.faceYaxis)t.faceYaxis.push(i.asArray())}if(this.goldbergData.faceXaxis){t.faceXaxis=[];for(const i of this.goldbergData.faceXaxis)t.faceXaxis.push(i.asArray())}e.goldbergData=t}static Parse(e,t){const i=e.goldbergData;i.faceColors=i.faceColors.map(n=>xt.FromArray(n)),i.faceCenters=i.faceCenters.map(n=>I.FromArray(n)),i.faceZaxis=i.faceZaxis.map(n=>I.FromArray(n)),i.faceXaxis=i.faceXaxis.map(n=>I.FromArray(n)),i.faceYaxis=i.faceYaxis.map(n=>I.FromArray(n));const s=new Sg(e.name,t);return s.goldbergData=i,s}}function $F(r,e){const t=r.size,i=r.sizeX||t||1,s=r.sizeY||t||1,n=r.sizeZ||t||1,o=r.sideOrientation===0?0:r.sideOrientation||Ye.DEFAULTSIDE,c=[],h=[],f=[],_=[];let d=1/0,g=-1/0,p=1/0,b=-1/0;for(let v=0;v<e.vertex.length;v++)d=Math.min(d,e.vertex[v][0]*i),g=Math.max(g,e.vertex[v][0]*i),p=Math.min(p,e.vertex[v][1]*s),b=Math.max(b,e.vertex[v][1]*s);let x=0;for(let v=0;v<e.face.length;v++){const S=e.face[v],R=I.FromArray(e.vertex[S[0]]),P=I.FromArray(e.vertex[S[2]]),M=I.FromArray(e.vertex[S[1]]),O=P.subtract(R),D=M.subtract(R),w=I.Cross(D,O).normalize();for(let G=0;G<S.length;G++){f.push(w.x,w.y,w.z);const H=e.vertex[S[G]];c.push(H[0]*i,H[1]*s,H[2]*n);const ie=(H[1]*s-p)/(b-p);_.push((H[0]*i-d)/(g-d),ie)}for(let G=0;G<S.length-2;G++)h.push(x,x+G+2,x+G+1);x+=S.length}Ye._ComputeSides(o,c,h,f,_);const E=new Ye;return E.positions=c,E.indices=h,E.normals=f,E.uvs=_,E}function JF(r,e,t=null){const i=e.size,s=e.sizeX||i||1,n=e.sizeY||i||1,o=e.sizeZ||i||1;let c=e.m||1;c!==Math.floor(c)&&(c=Math.floor(c),Ee.Warn("m not an integer only floor(m) used"));let h=e.n||0;if(h!==Math.floor(h)&&(h=Math.floor(h),Ee.Warn("n not an integer only floor(n) used")),h>c){const b=h;h=c,c=b,Ee.Warn("n > m therefore m and n swapped")}const f=new PR;f.build(c,h);const _=gd.BuildGeodesicData(f),d=_.toGoldbergPolyhedronData(),g=new Sg(r,t);e.sideOrientation=ee._GetDefaultSideOrientation(e.sideOrientation),g._originalBuilderSideOrientation=e.sideOrientation,$F(e,d).applyToMesh(g,e.updatable),g.goldbergData.nbSharedFaces=_.sharedNodes,g.goldbergData.nbUnsharedFaces=_.poleNodes,g.goldbergData.adjacentFaces=_.adjacentFaces,g.goldbergData.nbFaces=g.goldbergData.nbSharedFaces+g.goldbergData.nbUnsharedFaces,g.goldbergData.nbFacesAtPole=(g.goldbergData.nbUnsharedFaces-12)/12;for(let b=0;b<_.vertex.length;b++)g.goldbergData.faceCenters.push(I.FromArray(_.vertex[b])),g.goldbergData.faceCenters[b].x*=s,g.goldbergData.faceCenters[b].y*=n,g.goldbergData.faceCenters[b].z*=o,g.goldbergData.faceColors.push(new xt(1,1,1,1));for(let b=0;b<d.face.length;b++){const x=d.face[b],E=I.FromArray(d.vertex[x[0]]),v=I.FromArray(d.vertex[x[2]]),S=I.FromArray(d.vertex[x[1]]),R=v.subtract(E),P=S.subtract(E),M=I.Cross(P,R).normalize(),O=I.Cross(P,M).normalize();g.goldbergData.faceXaxis.push(P.normalize()),g.goldbergData.faceYaxis.push(M),g.goldbergData.faceZaxis.push(O)}return g}class eL{constructor(e){this._paths=[],this._tempPaths=[],this._holes=[],this._resolution=e}moveTo(e,t){this._currentPath=new ud(e,t),this._tempPaths.push(this._currentPath)}lineTo(e,t){this._currentPath.addLineTo(e,t)}quadraticCurveTo(e,t,i,s){this._currentPath.addQuadraticCurveTo(e,t,i,s,this._resolution)}bezierCurveTo(e,t,i,s,n,o){this._currentPath.addBezierCurveTo(e,t,i,s,n,o,this._resolution)}extractHoles(){for(const e of this._tempPaths)e.area()>0?this._holes.push(e):this._paths.push(e);if(!this._paths.length&&this._holes.length){const e=this._holes;this._holes=this._paths,this._paths=e}this._tempPaths.length=0}get paths(){return this._paths}get holes(){return this._holes}}function tL(r,e,t,i,s,n){const o=n.glyphs[r]||n.glyphs["?"];if(!o)return null;const c=new eL(s);if(o.o){const h=o.o.split(" ");for(let f=0,_=h.length;f<_;)switch(h[f++]){case"m":{const g=parseInt(h[f++])*e+t,p=parseInt(h[f++])*e+i;c.moveTo(g,p);break}case"l":{const g=parseInt(h[f++])*e+t,p=parseInt(h[f++])*e+i;c.lineTo(g,p);break}case"q":{const g=parseInt(h[f++])*e+t,p=parseInt(h[f++])*e+i,b=parseInt(h[f++])*e+t,x=parseInt(h[f++])*e+i;c.quadraticCurveTo(b,x,g,p);break}case"b":{const g=parseInt(h[f++])*e+t,p=parseInt(h[f++])*e+i,b=parseInt(h[f++])*e+t,x=parseInt(h[f++])*e+i,E=parseInt(h[f++])*e+t,v=parseInt(h[f++])*e+i;c.bezierCurveTo(b,x,E,v,g,p);break}}}return c.extractHoles(),{offsetX:o.ha*e,shapePath:c}}function iL(r,e,t,i){const s=Array.from(r),n=e/i.resolution,o=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*n,c=[];let h=0,f=0;for(let _=0;_<s.length;_++){const d=s[_];if(d===`
206`)h=0,f-=o;else{const g=tL(d,n,h,f,t,i);g&&(h+=g.offsetX,c.push(g.shapePath))}}return c}function sL(r,e,t,i={size:50,resolution:8,depth:1},s=null,n=earcut){const o=iL(e,i.size||50,i.resolution||8,t),c=[];let h=0;for(const _ of o){if(!_.paths.length)continue;const d=_.holes.slice();for(const g of _.paths){const p=[],b=[],x=g.getPoints();for(const S of x)b.push(new I(S.x,0,S.y));const E=d.slice();for(const S of E){const R=S.getPoints();let P=!1;for(const O of R)if(g.isPointInside(O)){P=!0;break}if(!P)continue;const M=[];for(const O of R)M.push(new I(O.x,0,O.y));p.push(M),d.splice(d.indexOf(S),1)}if(!p.length&&d.length)for(const S of d){const R=S.getPoints(),P=[];
206for(const M of R)P.push(new I(M.x,0,M.y));p.push(P)}const v=Ag(r,{shape:b,holes:p.length?p:void 0,depth:i.depth||1,faceUV:i.faceUV||i.perLetterFaceUV?.(h),faceColors:i.faceColors||i.perLetterFaceColors?.(h),sideOrientation:ee._GetDefaultSideOrientation(i.sideOrientation||ee.DOUBLESIDE)},s,n);c.push(v),h++}}const f=ee.MergeMeshes(c,!0,!0);if(f){const _=f.getBoundingInfo().boundingBox;f.position.x+=-(_.minimumWorld.x+_.maximumWorld.x)/2,f.position.y+=-(_.minimumWorld.y+_.maximumWorld.y)/2,f.position.z+=-(_.minimumWorld.z+_.maximumWorld.z)/2+_.extendSize.z,f.name=r;const d=new ms("pivot",s);d.rotation.x=-Math.PI/2,f.parent=d,f.bakeCurrentTransformIntoVertices(),f.parent=null,d.dispose()}return f}const Ea={CreateBox:eR,CreateTiledBox:SF,CreateSphere:nR,CreateDisc:YA,CreateIcoSphere:MR,CreateRibbon:mo,CreateCylinder:aR,CreateTorus:lR,CreateTorusKnot:hR,CreateLineSystem:_R,CreateLines:mR,CreateDashedLines:gR,ExtrudeShape:yR,ExtrudeShapeCustom:bR,CreateLathe:TR,CreateTiledPlane:RF,CreatePlane:vR,CreateGround:ZA,CreateTiledGround:QA,CreateGroundFromHeightMap:$A,CreatePolygon:vg,ExtrudePolygon:Ag,CreateTube:AR,CreatePolyhedron:Rg,CreateGeodesic:QF,CreateGoldberg:JF,CreateDecal:CR,CreateCapsule:DR,CreateText:sL};TF();EF();AF();MF();CF();IF();DF();PF();wF();BF();NF();UF();kF();tR();vF();zF();VF();GF();KF();ZF();oF();async function nL(r,e){const t=new De(r);t.clearColor=new xt(.968,.945,.9,1);const i=new jm("ledger-camera",-Math.PI/2,Math.PI/3.05,9.6,new I(-.6,1.15,0),t);i.inputs.clear(),i.fov=.72;const s=new qm("workbench-light",new I(-.3,1,-.5),t);s.intensity=.78,s.diffuse=new tt(1,.94,.83),s.groundColor=new tt(.16,.17,.16);const n=new Ca("ground-ink",t);n.diffuseColor=new tt(.12,.14,.14),n.specularColor=new tt(.06,.06,.05);const o=new Ca("copper",t);o.diffuseColor=new tt(.62,.29,.15),o.specularColor=new tt(.4,.22,.12);const c=new Ca("graphite",t);c.diffuseColor=new tt(.06,.08,.08),c.specularColor=new tt(.12,.14,.13);const h=new Ca("mint-status",t);h.diffuseColor=new tt(.35,.88,.64),h.emissiveColor=new tt(.16,.48,.32);const f=Ea.CreateGround("bench",{width:14,height:7},t);f.material=n,f.position.y=-.04;const _=Ea.CreateCylinder("mining-core",{diameter:2.6,height:.58,tessellation:8},t);_.rotation.x=Math.PI/2,_.position=new I(-1.55,1.2,.18),_.material=o;const d=Ea.CreateCylinder("core-face",{diameter:2.14,height:.1,tessellation:8},t);d.rotation.x=Math.PI/2,d.position=new I(-1.55,1.2,-.16),d.material=c;const g=Ea.CreateTorus("core-ring",{diameter:2.82,thickness:.07,tessellation:32},t);g.position=new I(-1.55,1.2,-.22),g.rotation.x=Math.PI/2,g.material=h;const p=Ea.CreateCylinder("core-pin",{diameter:.36,height:.08,tessellation:16},t);p.rotation.x=Math.PI/2,p.position=new I(-1.55,1.2,-.24),p.material=h;const b=Ea.CreateBox("gpu-shelf",{width:2.9,height:.25,depth:1.55},t);b.position=new I(-1.15,.48,.2),b.material=o;const x=Ea.CreateBox("gpu-shelf-top",{width:2.7,height:.18,depth:1.35},t);x.position=new I(-1.15,.8,.2),x.material=c;const E=Array.from({length:4},(S,R)=>{const P=Ea.CreateBox(`fin-${R}`,{width:.16,height:1.2,depth:.16},t);return P.position=new I(-3.08+R*.34,.92,-.28),P.material=o,P}),v=()=>{t.dispose()};return t.onBeforeRenderObservable.add(()=>{const S=r.getDeltaTime()/1e3;g.rotation.z+=S*.18,_.rotation.z-=S*.04,p.rotation.z+=S*.38,E.forEach((R,P)=>{R.position.y=.92+Math.sin(performance.now()/900+P)*.018})}),{scene:t,dispose:v}}function rL(){const r=Re.useRef(null),e=Re.useRef(!1);return Re.useEffect(()=>{const t=r.current;if(!t||e.current)return;e.current=!0;const i=new ke(t,!0,{preserveDrawingBuffer:!0,stencil:!0,adaptToDeviceRatio:!0});let s=null,n=!1;nL(i).then(c=>{if(n){c.dispose();return}s=c,i.runRenderLoop(()=>c.scene.render())});const o=()=>i.resize();return window.addEventListener("resize",o),()=>{n=!0,window.removeEventListener("resize",o),s?.dispose(),i.dispose(),e.current=!1}},[]),le.jsx("canvas",{"data-loc":"client/src/components/GameCanvas.tsx:40",ref:r,className:"fixed inset-0 h-full w-full outline-none",style:{touchAction:"none"},"aria-hidden":"true"})}const ml=[{id:"hash-core",name:"Hash Core",eyebrow:"COMPUTE / 01",description:"A denser silicon heart for cleaner click output.",icon:"⌁",baseCost:75,clickBonus:1,passiveBonus:.8,accent:"copper"},{id:"cooling-rack",name:"Cooling Rack",eyebrow:"THERMAL / 02",description:"Moves heat away so the rig can hold a higher cadence.",icon:"◒",baseCost:240,clickBonus:0,passiveBonus:3.2,accent:"mint",requires:"hash-core"},{id:"power-grid",name:"Power Grid",eyebrow:"ENERGY / 03",description:"A local feed that turns idle minutes into useful hash.",icon:"ϟ",baseCost:760,clickBonus:2,passiveBonus:11,accent:"blue",requires:"cooling-rack"},{id:"ledger-node",name:"Ledger Node",eyebrow:"NETWORK / 04",description:"A quiet peer node that c
206ompounds every other station.",icon:"✣",baseCost:2200,clickBonus:4,passiveBonus:34,accent:"ink",requires:"power-grid"}];function Am(r,e){return Math.floor(r.baseCost*Math.pow(1.55,e))}const vE="crypto-tycoon-copper-ledger-v1",aL=3600*4,AE=()=>({"hash-core":0,"cooling-rack":0,"power-grid":0,"ledger-node":0}),oL=()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),Cf=(r,e,t)=>({id:Date.now()+Math.floor(Math.random()*1e3),label:r,value:e,time:oL(),tone:t});class lL{constructor(){this.snapshot=this.load(),this.recalculate()}load(){const e={balance:0,totalMined:0,clickPower:1,ratePerSecond:.4,energy:78,efficiency:91,purchased:AE(),activity:[Cf("CORE ONLINE",0,"blue")],lastSaved:Date.now(),sessionSeconds:0};if(typeof window>"u")return e;try{const t=window.localStorage.getItem(vE);if(!t)return e;const i=JSON.parse(t),s={...AE(),...i.purchased??{}},n={...e,...i,purchased:s},o=Math.min(aL,Math.max(0,(Date.now()-(n.lastSaved??Date.now()))/1e3)),c=(n.ratePerSecond??e.ratePerSecond)*o;return c>0&&(n.balance+=c,n.totalMined+=c,n.activity=[Cf("OFFLINE HASH",c,"mint"),...n.activity??[]].slice(0,5)),n.lastSaved=Date.now(),n}catch{return e}}getSnapshot(){return this.snapshot}recalculate(){let e=1,t=.4,i=0;for(const s of ml){const n=this.snapshot.purchased[s.id]??0;i+=n,e+=n*s.clickBonus,t+=n*s.passiveBonus}this.snapshot.clickPower=e,this.snapshot.ratePerSecond=t,this.snapshot.energy=Math.max(34,Math.min(99,78+i*4-Math.floor(t/18))),this.snapshot.efficiency=Math.max(66,Math.min(99,91+i*2-Math.floor(t/22)))}mine(){const e=this.snapshot.clickPower;return this.snapshot.balance+=e,this.snapshot.totalMined+=e,this.snapshot.activity=[Cf("MANUAL HASH",e,"copper"),...this.snapshot.activity].slice(0,5),e}tick(e){const t=this.snapshot.ratePerSecond*Math.max(0,Math.min(e,2));return this.snapshot.balance+=t,this.snapshot.totalMined+=t,this.snapshot.sessionSeconds+=e,t}buy(e){const t=ml.find(o=>o.id===e);if(!t)return!1;const i=this.snapshot.purchased[e]??0,s=t.requires?this.snapshot.purchased[t.requires]??0:1,n=Am(t,i);return this.snapshot.balance<n||s<1?!1:(this.snapshot.balance-=n,this.snapshot.purchased[e]=i+1,this.recalculate(),this.snapshot.activity=[Cf(`${t.name.toUpperCase()} INSTALLED`,n,"mint"),...this.snapshot.activity].slice(0,5),this.save(),!0)}canBuy(e){const t=ml.find(n=>n.id===e);if(!t)return!1;const i=this.snapshot.purchased[e]??0;return(t.requires?(this.snapshot.purchased[t.requires]??0)>0:!0)&&this.snapshot.balance>=Am(t,i)}costFor(e){const t=ml.find(i=>i.id===e);return t?Am(t,this.snapshot.purchased[e]??0):0}save(){this.snapshot.lastSaved=Date.now(),typeof window<"u"&&window.localStorage.setItem(vE,JSON.stringify(this.snapshot))}}function cL(){const r=Re.useRef(null);r.current||(r.current=new lL);const[e,t]=Re.useState(()=>r.current.getSnapshot());Re.useEffect(()=>{const c=r.current;let h=performance.now(),f=0;const _=window.setInterval(()=>{const d=performance.now(),g=(d-h)/1e3;h=d,c.tick(g),f+=g,f>4&&(c.save(),f=0),t({...c.getSnapshot(),purchased:{...c.getSnapshot().purchased},activity:[...c.getSnapshot().activity]})},250);return()=>{window.clearInterval(_),c.save()}},[]);const i=Re.useCallback(()=>{const c=r.current.mine();return t({...r.current.getSnapshot(),purchased:{...r.current.getSnapshot().purchased},activity:[...r.current.getSnapshot().activity]}),c},[]),s=Re.useCallback(c=>{const h=r.current.buy(c);return h&&t({...r.current.getSnapshot(),purchased:{...r.current.getSnapshot().purchased},activity:[...r.current.getSnapshot().activity]}),h},[]),n=Re.useCallback(c=>r.current.canBuy(c),[]),o=Re.useCallback(c=>r.current.costFor(c),[]);return{snapshot:e,mine:i,buy:s,canBuy:n,costFor:o}}const hL="/manus-storage/ledger-mark_886dd67f.png",uL="/manus-storage/paper-grain_c0d8f984.png",fL="/manus-storage/miner-texture_ae7594b5.png",Of=(r,e=0)=>new Intl.NumberFormat("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}).format(r),ih=r=>r>=1e6?`${(r/1e6).toFixed(2)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:Of(r,r<10?1:0);function dL({event:r}){return le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:25",className:"activity-row",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:26",className:`activity-dot activity-dot-${r.tone}`}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:27",className:"activity-label",children:r.label}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:28",className:"activity-value",children:r.value>0?`+${ih(r.value)}`:"READY"}),le.jsx("time",{"data-loc":"client/src/pages/Home.tsx:29",children:r.time})]})}function _L({id:r,level:e,cost:t,canBuy:i,onBuy:s}){const n=ml.find(h=>h.id===r),o=n.requires&&e===0,c=i&&!o;return le.jsxs("article",{"data-loc":"client/src/pages/Home.tsx:39",className:`upgrade-card accent-${n.accent} ${o?"is-locked":""}`,children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:40",className:"upgrade-card-topline",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:41",className:"upgrade-icon",children:o?le.jsx(hD,{"data-loc":"client/src/pages/Home.tsx:41",size:15,strokeWidth:1.7}):n.icon}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:42",className:"upgrade-eyebrow",children:n.eyebrow}),le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:43",className:"upgrade-level",children:["LVL ",String(e).padStart(2,"0")]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:45",className:"upgrade-title-row",children:[le.jsx("h3",{"data-loc":"client/src/pages/Home.tsx:46",children:n.name}),le.jsx(tD,{"data-loc":"client/src/pages/Home.tsx:47",size:15,strokeWidth:1.8})]}),le.jsx("p",{"data-loc":"client/src/pages/Home.tsx:49",children:o?`Install ${n.requires?.replace("-"," ")} first to unlock this station.`:n.description}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:50",className:"upgrade-meter","aria-hidden":"true",children:le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:50",style:{width:`${Math.min(100,18+e*18)}%`}})}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:51",className:"upgrade-buy-row",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:52",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:53",className:"cost-label",children:"COST"}),le.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:54",children:o?"LOCKED":`${ih(t)} CR`})]}),le.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:56",className:`buy-button ${c?"is-ready":""}`,onClick:()=>s(r),disabled:!c,children:[o?"LOCKED":c?"INSTALL":"NEED MORE",!o&&le.jsx(sD,{"data-loc":"client/src/pages/Home.tsx:58",size:14})]})]})]})}function mL(){const{snapshot:r,mine:e,buy:t,canBuy:i,costFor:s}=cL(),[n,o]=Re.useState([]),[c,h]=Re.useState(!1),f=Re.useMemo(()=>new URLSearchParams(window.location.search).has("demo"),[]),_=Object.values(r.purchased).reduce((p,b)=>p+b,0),d=`${String(Math.floor(r.sessionSeconds/60)).padStart(2,"0")}
206:${String(Math.floor(r.sessionSeconds%60)).padStart(2,"0")}`,g=()=>{const p=e(),b=Date.now()+Math.random();o(x=>[...x.slice(-5),{id:b,amount:p,x:35+Math.random()*35,y:35+Math.random()*25}]),h(!0),window.setTimeout(()=>h(!1),170),window.setTimeout(()=>o(x=>x.filter(E=>E.id!==b)),850)};return Re.useEffect(()=>{if(!f)return;const p=window.setInterval(()=>g(),720);return()=>window.clearInterval(p)},[f]),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:89",className:"game-app",style:{"--paper-texture":`url(${uL})`,"--miner-texture":`url(${fL})`},children:[le.jsx(rL,{"data-loc":"client/src/pages/Home.tsx:90"}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:91",className:"desk-overlay"}),le.jsxs("main",{"data-loc":"client/src/pages/Home.tsx:92",className:"game-ui",children:[le.jsxs("header",{"data-loc":"client/src/pages/Home.tsx:93",className:"topbar",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:94",className:"brand-lockup",children:[le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:95",className:"brand-mark-wrap",children:le.jsx("img",{"data-loc":"client/src/pages/Home.tsx:95",src:hL,alt:"Copper Ledger mark"})}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:96",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:97",className:"wordmark",children:["CRYPTO ",le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:97",children:"TYCOON"})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:98",className:"brand-caption",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:98",className:"live-dot"})," LEDGER WORKBENCH / SESSION 04"]})]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:101",className:"topbar-meta",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:102",className:"topbar-meta-block",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:102",children:"NET POSITION"}),le.jsxs("strong",{"data-loc":"client/src/pages/Home.tsx:102",children:[ih(r.balance)," ",le.jsx("em",{"data-loc":"client/src/pages/Home.tsx:102",children:"CR"})]})]}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:103",className:"meta-rule"}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:104",className:"topbar-meta-block",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:104",children:"HASH / SEC"}),le.jsxs("strong",{"data-loc":"client/src/pages/Home.tsx:104",children:[Of(r.ratePerSecond,1)," ",le.jsx("em",{"data-loc":"client/src/pages/Home.tsx:104",children:"CR/s"})]})]}),le.jsx("button",{"data-loc":"client/src/pages/Home.tsx:105",className:"icon-button","aria-label":"About Crypto Tycoon",children:le.jsx(lD,{"data-loc":"client/src/pages/Home.tsx:105",size:16})})]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:109",className:"game-layout",children:[le.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:110",className:"core-column",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:111",className:"section-kicker",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:111",children:"PRIMARY MINING CORE"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:111",className:"kicker-line"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:111",children:"01 / 03"})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:112",className:"balance-line",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:113",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:113",className:"balance-label",children:"AVAILABLE COIN"}),le.jsxs("h1",{"data-loc":"client/src/pages/Home.tsx:113",children:[Of(r.balance,r.balance<100?1:0)," ",le.jsx("small",{"data-loc":"client/src/pages/Home.tsx:113",children:"CR"})]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:114",className:"core-status",children:[le.jsx(fD,{"data-loc":"client/src/pages/Home.tsx:114",size:14}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:114",children:"PROTOCOL STABLE"})]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:117",className:"core-stage",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:118",className:"stage-note note-left",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:118",children:"FREQUENCY"}),le.jsxs("strong",{"data-loc":"client/src/pages/Home.tsx:118",children:[Of(r.ratePerSecond,1)," CR/s"]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:119",className:"stage-note note-right",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:119",children:"CORE TEMP"}),le.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:119",children:"42.8° C"})]}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:120",className:"core-orbit orbit-one"}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:120",className:"core-orbit orbit-two"}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:121",className:`mine-core-shell ${c?"is-mining":""}`,children:le.jsxs("button",{"data-loc":"client/src/pages/Home.tsx:122",className:"mine-core-button",onClick:g,"aria-label":"Mine coins",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:123",className:"core-rivet rivet-one"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:123",className:"core-rivet rivet-two"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:123",className:"core-rivet rivet-three"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:123",className:"core-rivet rivet-four"}),le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:124",className:"core-face",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:124",className:"core-symbol",children:"₿"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:124",className:"core-signal"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:124",className:"core-pulse"})]}),le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:125",className:"mine-label",children:[le.jsx(uD,{"data-loc":"client/src/pages/Home.tsx:125",size:14})," TAP TO MINE"]})]})}),n.map(p=>le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:128",className:"floating-gain",style:{left:`${p.x}%`,top:`${p.y}%`},children:["+",ih(p.amount)," CR"]},p.id)),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:129",className:"hash-stream stream-one",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:129"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:129"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:129"})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:130",className:"hash-stream stream-two",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:130"}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:130"})]}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:131",className:"stage-scanline"})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:133",className:"core-footer",children:[le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:133",children:[le.jsx(rD,{"data-loc":"client/src/pages/Home.tsx:133",size:15})," CORE TUNED FOR MANUAL HASH"]}),le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:133",children:["LAST BLOCK ",le.jsx("strong",{"data-loc":"client/src/pages/Home.tsx:133",children:"000042"})]})]})]}),le.jsxs("aside",{"data-loc":"client/src/pages/Home.tsx:136",className:"upgrade-column",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:137",className:"panel-header",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:137",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:137",className:"section-label",children:"RIG INVENTORY"}),le.jsxs("h2",{"data-loc":"client/src/pages/Home.tsx:137",children:["Upgrade your ",le.jsx("i",{"data-loc":"client/src/pages/Home.tsx:137",children:"operation."})]})]}),le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:137",className:"panel-index",children:[String(_).padStart(2,"0")," INSTALLED"]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:138",className:"receipt-rule",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:138"})," ",le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:138"})," ",le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:138"})]}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:139",className:"upgrade-list",children:ml.map(p=>le.jsx(_L,{"data-loc":"client/src/pages/Home.tsx:140",id:p.id,level:r.purchased[p.id],cost:s(p.id),canBuy:i(p.id),onBuy:t},p.id))}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:142",className:"upgrade-footnote",children:[le.jsx(_D,{"data-loc":"client/src/pages/Home.tsx:142",size:14}),le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:142",children:"Every station compounds your local hash rate. No wallet connection required."})]})]})]}),le.jsxs("section",{"data-loc":"client/src/pages/Home.tsx:146",className:"operations-strip",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:147",className:"strip-heading",children:[le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:147",className:"section-label",children:"OPERATIONS LOG"}),le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:147",className:"session-clock",children:[le.jsx(eD,{"data-loc":"client/src/pages/Home.tsx:147",size:13})," SESSION ",d]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:148",className:"operation-grid",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:149",className:"metric-block",children:[le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:149",className:"metric-icon",children:le.jsx(iD,{"data-loc":"client/src/pages/Home.tsx:149",size:17})}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:149",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:149",children:"ENERGY BUFFER"}),le.jsxs("strong",{"data-loc":"client/src/pages/Home.tsx:149",children:[r.energy,"%"]})]}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:149",className:"metric-bar",children:le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:149",style:{width:`${r.energy}%`}})})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:150",className:"metric-block",children:[le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:150",className:"metric-icon mint-icon",children:le.jsx(aD,{"data-loc":"client/src/pages/Home.tsx:150",size:17})}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:150",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:150",children:"EFFICIENCY"}),le.jsxs("strong",{"data-loc":"client/src/pages/Home.tsx:150",children:[r.efficie
206ncy,"%"]})]}),le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:150",className:"metric-bar mint-bar",children:le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:150",style:{width:`${r.efficiency}%`}})})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:151",className:"metric-block chart-block",children:[le.jsx("div",{"data-loc":"client/src/pages/Home.tsx:151",className:"metric-icon blue-icon",children:le.jsx(cD,{"data-loc":"client/src/pages/Home.tsx:151",size:17})}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:151",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:151",children:"LIFETIME OUTPUT"}),le.jsxs("strong",{"data-loc":"client/src/pages/Home.tsx:151",children:[ih(r.totalMined)," CR"]})]}),le.jsxs("svg",{"data-loc":"client/src/pages/Home.tsx:151",className:"mini-chart",viewBox:"0 0 148 40",role:"img","aria-label":"Lifetime output trend",children:[le.jsx("path",{"data-loc":"client/src/pages/Home.tsx:151",d:"M0 33 C15 29 15 30 28 31 S49 23 60 26 S81 24 89 17 S106 20 116 10 S134 12 148 2"}),le.jsx("path",{"data-loc":"client/src/pages/Home.tsx:151",className:"chart-fill",d:"M0 33 C15 29 15 30 28 31 S49 23 60 26 S81 24 89 17 S106 20 116 10 S134 12 148 2 L148 40 L0 40Z"})]})]}),le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:152",className:"activity-feed",children:[le.jsxs("div",{"data-loc":"client/src/pages/Home.tsx:152",className:"feed-heading",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:152",children:"RECENT ACTIVITY"}),le.jsx(Fv,{"data-loc":"client/src/pages/Home.tsx:152",size:13})]}),r.activity.slice(0,3).map(p=>le.jsx(dL,{"data-loc":"client/src/pages/Home.tsx:152",event:p},p.id))]})]})]}),le.jsxs("footer",{"data-loc":"client/src/pages/Home.tsx:155",className:"bottom-note",children:[le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:155",children:"LOCAL SIMULATION / PROGRESS SAVES IN THIS BROWSER"}),le.jsxs("span",{"data-loc":"client/src/pages/Home.tsx:155",children:["BUILD 0.4.2 ",le.jsx("span",{"data-loc":"client/src/pages/Home.tsx:155",className:"footer-divider"})," COPPER LEDGER PROTOCOL"]})]})]})]})}const RE=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,SE=_v,gL=(r,e)=>t=>{var i;if(e?.variants==null)return SE(r,t?.class,t?.className);const{variants:s,defaultVariants:n}=e,o=Object.keys(s).map(f=>{const _=t?.[f],d=n?.[f];if(_===null)return null;const g=RE(_)||RE(d);return s[f][g]}),c=t&&Object.entries(t).reduce((f,_)=>{let[d,g]=_;return g===void 0||(f[d]=g),f},{}),h=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((f,_)=>{let{class:d,className:g,...p}=_;return Object.entries(p).every(b=>{let[x,E]=b;return Array.isArray(E)?E.includes({...n,...c}[x]):{...n,...c}[x]===E})?[...f,d,g]:f},[]);return SE(r,o,h,t?.class,t?.className)},pL=gL("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-transparent shadow-xs hover:bg-accent dark:bg-transparent dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function yL({className:r,variant:e,size:t,asChild:i=!1,...s}){const n=i?kM:"button";return le.jsx(n,{"data-loc":"client/src/components/ui/button.tsx:52","data-slot":"button",className:cd(pL({variant:e,size:t,className:r})),...s})}function bL({className:r,...e}){return le.jsx("div",{"data-loc":"client/src/components/ui/card.tsx:7","data-slot":"card",className:cd("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",r),...e})}function xL({className:r,...e}){return le.jsx("div",{"data-loc":"client/src/components/ui/card.tsx:66","data-slot":"card-content",className:cd("px-6",r),...e})}function ME(){const[,r]=jI(),e=()=>{r("/")};return le.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:14",className:"min-h-screen w-full flex items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100",children:le.jsx(bL,{"data-loc":"client/src/pages/NotFound.tsx:15",className:"w-full max-w-lg mx-4 shadow-lg border-0 bg-white/80 backdrop-blur-sm",children:le.jsxs(xL,{"data-loc":"client/src/pages/NotFound.tsx:16",className:"pt-8 pb-8 text-center",children:[le.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:17",className:"flex justify-center mb-6",children:le.jsxs("div",{"data-loc":"client/src/pages/NotFound.tsx:18",className:"relative",children:[le.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:19",className:"absolute inset-0 bg-red-100 rounded-full animate-pulse"}),le.jsx(nD,{"data-loc":"client/src/pages/NotFound.tsx:20",className:"relative h-16 w-16 text-red-500"})]})}),le.jsx("h1",{"data-loc":"client/src/pages/NotFound.tsx:24",className:"text-4xl font-bold text-slate-900 mb-2",children:"404"}),le.jsx("h2",{"data-loc":"client/src/pages/NotFound.tsx:26",className:"text-xl font-semibold text-slate-700 mb-4",children:"Page Not Found"}),le.jsxs("p",{"data-loc":"client/src/pages/NotFound.tsx:30",className:"text-slate-600 mb-8 leading-relaxed",children:["Sorry, the page you are looking for doesn't exist.",le.jsx("br",{"data-loc":"client/src/pages/NotFound.tsx:32"}),"It may have been moved or deleted."]}),le.jsx("div",{"data-loc":"client/src/pages/NotFound.tsx:36",className:"flex flex-col sm:flex-row gap-3 justify-center",children:le.jsxs(yL,{"data-loc":"client/src/pages/NotFound.tsx:37",onClick:e,className:"bg-blue-600 hover:bg-blue-700 text-white px-6 py-2.5 rounded-lg transition-all duration-200 shadow-md hover:shadow-lg",children:[le.jsx(oD,{"data-loc":"client/src/pages/NotFound.tsx:41",className:"w-4 h-4 mr-2"}),"Go Home"]})})]})})})}function TL(){return le.jsxs(ZI,{"data-loc":"client/src/App.tsx:12",children:[le.jsx(hm,{"data-loc":"client/src/App.tsx:12",path:"/",component:mL}),le.jsx(hm,{"data-loc":"client/src/App.tsx:12",path:"/404",component:ME}),le.jsx(hm,{"data-loc":"client/src/App.tsx:12",component:ME})]})}function EL(){return le.jsx(mD,{"data-loc":"client/src/App.tsx:16",children:le.jsx(pD,{"data-loc":"client/src/App.tsx:16",defaultTheme:"light",children:le.jsxs(SI,{"data-loc":"client/src/App.tsx:16",children:[le.jsx(NM,{"data-loc":"client/src/App.tsx:16"}),le.jsx(TL,{"data-loc":"client/src/App.tsx:16"})]})})})}document.title="Crypto Tycoon: Idle Crypto Mining Game";sM.createRoot(document.getElementById("root")).render(le.jsx(EL,{"data-loc":"client/src/main.tsx:9"}));
206export{Be as A,Xf as B,yi as C,pA as D,cO as E,ds as F,Vf as G,ws as I,qf as L,ae as M,Oe as O,Mn as P,oA as R,Wf as S,uO as T,I as V,RO as _,Ee as a,kf as b,at as c,L as d,Ts as e,ge as f,Tt as g,Pf as h,$ as i,Rt as j,ts as k,Li as l,Ps as m,He as n,Um as o,In as p,QP as q,Af as r,he as s,ML as t,yO as u,Hf as v,tt as w,LP as x,IL as y,Pi as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.