(function(cn){typeof define=="function"&&define.amd?define(cn):cn()})(function(){"use strict";var aj=Object.defineProperty,lj=Object.defineProperties;var uj=Object.getOwnPropertyDescriptors;var j0=Object.getOwnPropertySymbols;var XD=Object.prototype.hasOwnProperty,jD=Object.prototype.propertyIsEnumerable;var J0=Math.pow,b1=(cn,En,mn)=>En in cn?aj(cn,En,{enumerable:!0,configurable:!0,writable:!0,value:mn}):cn[En]=mn,_e=(cn,En)=>{for(var mn in En||(En={}))XD.call(En,mn)&&b1(cn,mn,En[mn]);if(j0)for(var mn of j0(En))jD.call(En,mn)&&b1(cn,mn,En[mn]);return cn},Ct=(cn,En)=>lj(cn,uj(En));var Wn=(cn,En)=>{var mn={};for(var nr in cn)XD.call(cn,nr)&&En.indexOf(nr)<0&&(mn[nr]=cn[nr]);if(cn!=null&&j0)for(var nr of j0(cn))En.indexOf(nr)<0&&jD.call(cn,nr)&&(mn[nr]=cn[nr]);return mn};var JD=(cn,En,mn)=>b1(cn,typeof En!="symbol"?En+"":En,mn);var fu=(cn,En,mn)=>new Promise((nr,Ut)=>{var Ja=Zs=>{try{ff(mn.next(Zs))}catch(df){Ut(df)}},K0=Zs=>{try{ff(mn.throw(Zs))}catch(df){Ut(df)}},ff=Zs=>Zs.done?nr(Zs.value):Promise.resolve(Zs.value).then(Ja,K0);ff((mn=mn.apply(cn,En)).next())});function cn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var En={exports:{}},mn={},nr={exports:{}},Ut={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ja=Symbol.for("react.element"),K0=Symbol.for("react.portal"),ff=Symbol.for("react.fragment"),Zs=Symbol.for("react.strict_mode"),df=Symbol.for("react.profiler"),KD=Symbol.for("react.provider"),YD=Symbol.for("react.context"),QD=Symbol.for("react.forward_ref"),qD=Symbol.for("react.suspense"),ZD=Symbol.for("react.memo"),$D=Symbol.for("react.lazy"),R1=Symbol.iterator;function eF(n){return n===null||typeof n!="object"?null:(n=R1&&n[R1]||n["@@iterator"],typeof n=="function"?n:null)}var P1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I1=Object.assign,B1={};function du(n,e,t){this.props=n,this.context=e,this.refs=B1,this.updater=t||P1}du.prototype.isReactComponent={},du.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")},du.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function L1(){}L1.prototype=du.prototype;function Y0(n,e,t){this.props=n,this.context=e,this.refs=B1,this.updater=t||P1}var Q0=Y0.prototype=new L1;Q0.constructor=Y0,I1(Q0,du.prototype),Q0.isPureReactComponent=!0;var D1=Array.isArray,F1=Object.prototype.hasOwnProperty,q0={current:null},N1={key:!0,ref:!0,__self:!0,__source:!0};function U1(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)F1.call(e,i)&&!N1.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,Ce=z[fe];if(0>>1;fer(Me,ie))Ier(Be,Me)?(z[fe]=Be,z[Ie]=ie,fe=Ie):(z[fe]=Me,z[re]=ie,fe=re);else if(Ier(Be,ie))z[fe]=Be,z[Ie]=ie,fe=Ie;else break e}}return te}function r(z,te){var ie=z.sortIndex-te.sortIndex;return ie!==0?ie:z.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,h=null,p=3,g=!1,v=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(z){for(var te=t(u);te!==null;){if(te.callback===null)i(u);else if(te.startTime<=z)i(u),te.sortIndex=te.expirationTime,e(l,te);else break;te=t(u)}}function w(z){if(S=!1,A(z),!v)if(t(l)!==null)v=!0,K(I);else{var te=t(u);te!==null&&ge(w,te.startTime-z)}}function I(z,te){v=!1,S&&(S=!1,m(N),N=-1),g=!0;var ie=p;try{for(A(te),h=t(l);h!==null&&(!(h.expirationTime>te)||z&&!F());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,p=h.priorityLevel;var Ce=fe(h.expirationTime<=te);te=n.unstable_now(),typeof Ce=="function"?h.callback=Ce:h===t(l)&&i(l),A(te)}else i(l);h=t(l)}if(h!==null)var ot=!0;else{var re=t(u);re!==null&&ge(w,re.startTime-te),ot=!1}return ot}finally{h=null,p=ie,g=!1}}var P=!1,D=null,N=-1,B=5,T=-1;function F(){return!(n.unstable_now()-Tz||125fe?(z.sortIndex=ie,e(u,z),t(l)===null&&z===t(u)&&(S?(m(N),N=-1):S=!0,ge(w,ie-fe))):(z.sortIndex=Ce,e(l,z),v||g||(v=!0,K(I))),z},n.unstable_shouldYield=F,n.unstable_wrapCallback=function(z){var te=p;return function(){var ie=p;p=te;try{return z.apply(this,arguments)}finally{p=ie}}}})(V1),G1.exports=V1;var dF=G1.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hF=pe,Ar=dF;function Re(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;te}return!1}function Gi(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var gi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){gi[n]=new Gi(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];gi[e]=new Gi(e,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){gi[n]=new Gi(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){gi[n]=new Gi(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){gi[n]=new Gi(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){gi[n]=new Gi(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){gi[n]=new Gi(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){gi[n]=new Gi(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){gi[n]=new Gi(n,5,!1,n.toLowerCase(),null,!1,!1)});var ny=/[\-:]([a-z])/g;function iy(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(ny,iy);gi[e]=new Gi(e,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(ny,iy);gi[e]=new Gi(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(ny,iy);gi[e]=new Gi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){gi[n]=new Gi(n,1,!1,n.toLowerCase(),null,!1,!1)}),gi.xlinkHref=new Gi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){gi[n]=new Gi(n,1,!1,n.toLowerCase(),null,!0,!0)});function ry(n,e,t,i){var r=gi.hasOwnProperty(e)?gi[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var l=` `+r[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{dy=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?mf(n):""}function yF(n){switch(n.tag){case 5:return mf(n.type);case 16:return mf("Lazy");case 13:return mf("Suspense");case 19:return mf("SuspenseList");case 0:case 2:case 15:return n=hy(n.type,!1),n;case 11:return n=hy(n.type.render,!1),n;case 1:return n=hy(n.type,!0),n;default:return""}}function py(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case mu:return"Fragment";case pu:return"Portal";case oy:return"Profiler";case sy:return"StrictMode";case ly:return"Suspense";case uy:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case K1:return(n.displayName||"Context")+".Consumer";case J1:return(n._context.displayName||"Context")+".Provider";case ay:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case cy:return e=n.displayName||null,e!==null?e:py(n.type)||"Memo";case Uo:e=n._payload,n=n._init;try{return py(n(e))}catch(t){}}return null}function xF(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return py(e);case 8:return e===sy?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Oo(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function q1(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _F(n){var e=q1(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function np(n){n._valueTracker||(n._valueTracker=_F(n))}function Z1(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=q1(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function ip(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch(e){return n.body}}function my(n,e){var t=e.checked;return Pn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:n._wrapperState.initialChecked})}function $1(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Oo(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ew(n,e){e=e.checked,e!=null&&ry(n,"checked",e,!1)}function gy(n,e){ew(n,e);var t=Oo(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?vy(n,e.type,t):e.hasOwnProperty("defaultValue")&&vy(n,e.type,Oo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function tw(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function vy(n,e,t){(e!=="number"||ip(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var gf=Array.isArray;function gu(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=rp.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function vf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var yf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},AF=["Webkit","ms","Moz","O"];Object.keys(yf).forEach(function(n){AF.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),yf[e]=yf[n]})});function aw(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||yf.hasOwnProperty(n)&&yf[n]?(""+e).trim():e+"px"}function lw(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=aw(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var SF=Pn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _y(n,e){if(e){if(SF[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Re(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Re(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Re(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Re(62))}}function Ay(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sy=null;function My(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var wy=null,vu=null,yu=null;function uw(n){if(n=zf(n)){if(typeof wy!="function")throw Error(Re(280));var e=n.stateNode;e&&(e=Tp(e),wy(n.stateNode,n.type,e))}}function cw(n){vu?yu?yu.push(n):yu=[n]:vu=n}function fw(){if(vu){var n=vu,e=yu;if(yu=vu=null,uw(n),e)for(n=0;n>>=0,n===0?32:31-(LF(n)/DF|0)|0}var up=64,cp=4194304;function Sf(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function fp(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=Sf(a):(s&=o,s!==0&&(i=Sf(s)))}else o=t&~r,o!==0?i=Sf(o):s!==0&&(i=Sf(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function Mf(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-os(e),n[e]=t}function OF(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=If),kw=" ",zw=!1;function Hw(n,e){switch(n){case"keyup":return dN.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gw(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Au=!1;function pN(n,e){switch(n){case"compositionend":return Gw(e);case"keypress":return e.which!==32?null:(zw=!0,kw);case"textInput":return n=e.data,n===kw&&zw?null:n;default:return null}}function mN(n,e){if(Au)return n==="compositionend"||!Gy&&Hw(n,e)?(n=Lw(),gp=Ny=Vo=null,Au=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Yw(t)}}function qw(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?qw(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function Zw(){for(var n=window,e=ip();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch(i){t=!1}if(t)n=e.contentWindow;else break;e=ip(n.document)}return e}function Xy(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function wN(n){var e=Zw(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&qw(t.ownerDocument.documentElement,t)){if(i!==null&&Xy(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=Qw(t,s);var o=Qw(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Su=null,jy=null,Ff=null,Jy=!1;function $w(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;Jy||Su==null||Su!==ip(i)||(i=Su,"selectionStart"in i&&Xy(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ff&&Df(Ff,i)||(Ff=i,i=wp(jy,"onSelect"),0Tu||(n.current=sx[Tu],sx[Tu]=null,Tu--)}function gn(n,e){Tu++,sx[Tu]=n.current,n.current=e}var Jo={},wi=jo(Jo),ir=jo(!1),qa=Jo;function bu(n,e){var t=n.type.contextTypes;if(!t)return Jo;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function rr(n){return n=n.childContextTypes,n!=null}function bp(){Sn(ir),Sn(wi)}function pE(n,e,t){if(wi.current!==Jo)throw Error(Re(168));gn(wi,e),gn(ir,t)}function mE(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Re(108,xF(n)||"Unknown",r));return Pn({},t,i)}function Rp(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Jo,qa=wi.current,gn(wi,n),gn(ir,ir.current),!0}function gE(n,e,t){var i=n.stateNode;if(!i)throw Error(Re(169));t?(n=mE(n,e,qa),i.__reactInternalMemoizedMergedChildContext=n,Sn(ir),Sn(wi),gn(wi,n)):Sn(ir),gn(ir,t)}var no=null,Pp=!1,ox=!1;function vE(n){no===null?no=[n]:no.push(n)}function NN(n){Pp=!0,vE(n)}function Ko(){if(!ox&&no!==null){ox=!0;var n=0,e=an;try{var t=no;for(an=1;n>=o,r-=o,io=1<<32-os(e)+r|t<N?(B=D,D=null):B=D.sibling;var T=p(m,D,A[N],w);if(T===null){D===null&&(D=B);break}n&&D&&T.alternate===null&&e(m,D),_=s(T,_,N),P===null?I=T:P.sibling=T,P=T,D=B}if(N===A.length)return t(m,D),Cn&&$a(m,N),I;if(D===null){for(;NN?(B=D,D=null):B=D.sibling;var F=p(m,D,T.value,w);if(F===null){D===null&&(D=B);break}n&&D&&F.alternate===null&&e(m,D),_=s(F,_,N),P===null?I=F:P.sibling=F,P=F,D=B}if(T.done)return t(m,D),Cn&&$a(m,N),I;if(D===null){for(;!T.done;N++,T=A.next())T=h(m,T.value,w),T!==null&&(_=s(T,_,N),P===null?I=T:P.sibling=T,P=T);return Cn&&$a(m,N),I}for(D=i(m,D);!T.done;N++,T=A.next())T=g(D,m,N,T.value,w),T!==null&&(n&&T.alternate!==null&&D.delete(T.key===null?N:T.key),_=s(T,_,N),P===null?I=T:P.sibling=T,P=T);return n&&D.forEach(function(X){return e(m,X)}),Cn&&$a(m,N),I}function x(m,_,A,w){if(typeof A=="object"&&A!==null&&A.type===mu&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case tp:e:{for(var I=A.key,P=_;P!==null;){if(P.key===I){if(I=A.type,I===mu){if(P.tag===7){t(m,P.sibling),_=r(P,A.props.children),_.return=m,m=_;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Uo&&ME(I)===P.type){t(m,P.sibling),_=r(P,A.props),_.ref=Hf(m,P,A),_.return=m,m=_;break e}t(m,P);break}else e(m,P);P=P.sibling}A.type===mu?(_=al(A.props.children,m.mode,w,A.key),_.return=m,m=_):(w=rm(A.type,A.key,A.props,null,m.mode,w),w.ref=Hf(m,_,A),w.return=m,m=w)}return o(m);case pu:e:{for(P=A.key;_!==null;){if(_.key===P)if(_.tag===4&&_.stateNode.containerInfo===A.containerInfo&&_.stateNode.implementation===A.implementation){t(m,_.sibling),_=r(_,A.children||[]),_.return=m,m=_;break e}else{t(m,_);break}else e(m,_);_=_.sibling}_=i_(A,m.mode,w),_.return=m,m=_}return o(m);case Uo:return P=A._init,x(m,_,P(A._payload),w)}if(gf(A))return v(m,_,A,w);if(pf(A))return S(m,_,A,w);Dp(m,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,_!==null&&_.tag===6?(t(m,_.sibling),_=r(_,A),_.return=m,m=_):(t(m,_),_=n_(A,m.mode,w),_.return=m,m=_),o(m)):t(m,_)}return x}var Bu=wE(!0),EE=wE(!1),Fp=jo(null),Np=null,Lu=null,dx=null;function hx(){dx=Lu=Np=null}function px(n){var e=Fp.current;Sn(Fp),n._currentValue=e}function mx(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function Du(n,e){Np=n,dx=Lu=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(sr=!0),n.firstContext=null)}function Hr(n){var e=n._currentValue;if(dx!==n)if(n={context:n,memoizedValue:e,next:null},Lu===null){if(Np===null)throw Error(Re(308));Lu=n,Np.dependencies={lanes:0,firstContext:n}}else Lu=Lu.next=n;return e}var el=null;function gx(n){el===null?el=[n]:el.push(n)}function CE(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,gx(e)):(t.next=r.next,r.next=t),e.interleaved=t,so(n,i)}function so(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Yo=!1;function vx(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function TE(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function oo(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Qo(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,Zt&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,so(n,t)}return r=i.interleaved,r===null?(e.next=e,gx(i)):(e.next=r.next,r.next=e),i.interleaved=e,so(n,t)}function Up(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Iy(n,t)}}function bE(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Op(n,e,t,i){var r=n.updateQueue;Yo=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(s!==null){var h=r.baseState;o=0,d=u=l=null,a=s;do{var p=a.lane,g=a.eventTime;if((i&p)===p){d!==null&&(d=d.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=n,S=a;switch(p=e,g=t,S.tag){case 1:if(v=S.payload,typeof v=="function"){h=v.call(g,h,p);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=S.payload,p=typeof v=="function"?v.call(g,h,p):v,p==null)break e;h=Pn({},h,p);break e;case 2:Yo=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=r.effects,p===null?r.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=g,l=h):d=d.next=g,o|=p;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;p=a,a=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);if(d===null&&(l=h),r.baseState=l,r.firstBaseUpdate=u,r.lastBaseUpdate=d,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);il|=o,n.lanes=o,n.memoizedState=h}}function RE(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=Sx.transition;Sx.transition={};try{n(!1),e()}finally{an=t,Sx.transition=i}}function KE(){return Gr().memoizedState}function zN(n,e,t){var i=ea(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},YE(n))QE(e,t);else if(t=CE(n,e,t,i),t!==null){var r=Wi();ds(t,n,i,r),qE(t,e,i)}}function HN(n,e,t){var i=ea(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(YE(n))QE(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,as(a,o)){var l=e.interleaved;l===null?(r.next=r,gx(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch(u){}finally{}t=CE(n,e,r,i),t!==null&&(r=Wi(),ds(t,n,i,r),qE(t,e,i))}}function YE(n){var e=n.alternate;return n===Bn||e!==null&&e===Bn}function QE(n,e){Xf=Hp=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function qE(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Iy(n,t)}}var Wp={readContext:Hr,useCallback:Ei,useContext:Ei,useEffect:Ei,useImperativeHandle:Ei,useInsertionEffect:Ei,useLayoutEffect:Ei,useMemo:Ei,useReducer:Ei,useRef:Ei,useState:Ei,useDebugValue:Ei,useDeferredValue:Ei,useTransition:Ei,useMutableSource:Ei,useSyncExternalStore:Ei,useId:Ei,unstable_isNewReconciler:!1},GN={readContext:Hr,useCallback:function(n,e){return Ds().memoizedState=[n,e===void 0?null:e],n},useContext:Hr,useEffect:zE,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Gp(4194308,4,VE.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Gp(4194308,4,n,e)},useInsertionEffect:function(n,e){return Gp(4,2,n,e)},useMemo:function(n,e){var t=Ds();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Ds();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=zN.bind(null,Bn,n),[i.memoizedState,n]},useRef:function(n){var e=Ds();return n={current:n},e.memoizedState=n},useState:OE,useDebugValue:Rx,useDeferredValue:function(n){return Ds().memoizedState=n},useTransition:function(){var n=OE(!1),e=n[0];return n=kN.bind(null,n[1]),Ds().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Bn,r=Ds();if(Cn){if(t===void 0)throw Error(Re(407));t=t()}else{if(t=e(),hi===null)throw Error(Re(349));nl&30||LE(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,zE(FE.bind(null,i,s,n),[n]),i.flags|=2048,Kf(9,DE.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=Ds(),e=hi.identifierPrefix;if(Cn){var t=ro,i=io;t=(i&~(1<<32-os(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=jf++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Bs]=e,n[kf]=i,vC(n,e,!1,!1),e.stateNode=n;e:{switch(o=Ay(t,i),t){case"dialog":An("cancel",n),An("close",n),r=i;break;case"iframe":case"object":case"embed":An("load",n),r=i;break;case"video":case"audio":for(r=0;rku&&(e.flags|=128,i=!0,Yf(s,!1),e.lanes=4194304)}else{if(!i)if(n=kp(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Yf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Cn)return Ci(e),null}else 2*Xn()-s.renderingStartTime>ku&&t!==1073741824&&(e.flags|=128,i=!0,Yf(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Xn(),e.sibling=null,t=In.current,gn(In,i?t&1|2:t&1),e):(Ci(e),null);case 22:case 23:return $x(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Er&1073741824&&(Ci(e),e.subtreeFlags&6&&(e.flags|=8192)):Ci(e),null;case 24:return null;case 25:return null}throw Error(Re(156,e.tag))}function QN(n,e){switch(lx(e),e.tag){case 1:return rr(e.type)&&bp(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Fu(),Sn(ir),Sn(wi),Ax(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return xx(e),null;case 13:if(Sn(In),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Re(340));Iu()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Sn(In),null;case 4:return Fu(),null;case 10:return px(e.type._context),null;case 22:case 23:return $x(),null;case 24:return null;default:return null}}var Kp=!1,Ti=!1,qN=typeof WeakSet=="function"?WeakSet:Set,tt=null;function Uu(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Un(n,e,i)}else t.current=null}function Hx(n,e,t){try{t()}catch(i){Un(n,e,i)}}var _C=!1;function ZN(n,e){if($y=pp,n=Zw(),Xy(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch(w){t=null;break e}var o=0,a=-1,l=-1,u=0,d=0,h=n,p=null;t:for(;;){for(var g;h!==t||r!==0&&h.nodeType!==3||(a=o+r),h!==s||i!==0&&h.nodeType!==3||(l=o+i),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===n)break t;if(p===t&&++u===r&&(a=o),p===s&&++d===i&&(l=o),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(ex={focusedElem:n,selectionRange:t},pp=!1,tt=e;tt!==null;)if(e=tt,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,tt=n;else for(;tt!==null;){e=tt;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var S=v.memoizedProps,x=v.memoizedState,m=e.stateNode,_=m.getSnapshotBeforeUpdate(e.elementType===e.type?S:us(e.type,S),x);m.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var A=e.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(w){Un(e,e.return,w)}if(n=e.sibling,n!==null){n.return=e.return,tt=n;break}tt=e.return}return v=_C,_C=!1,v}function Qf(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&Hx(e,t,s)}r=r.next}while(r!==i)}}function Yp(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function Gx(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function AC(n){var e=n.alternate;e!==null&&(n.alternate=null,AC(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Bs],delete e[kf],delete e[rx],delete e[DN],delete e[FN])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function SC(n){return n.tag===5||n.tag===3||n.tag===4}function MC(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||SC(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Vx(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Cp));else if(i!==4&&(n=n.child,n!==null))for(Vx(n,e,t),n=n.sibling;n!==null;)Vx(n,e,t),n=n.sibling}function Wx(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(Wx(n,e,t),n=n.sibling;n!==null;)Wx(n,e,t),n=n.sibling}var vi=null,cs=!1;function qo(n,e,t){for(t=t.child;t!==null;)wC(n,e,t),t=t.sibling}function wC(n,e,t){if(Is&&typeof Is.onCommitFiberUnmount=="function")try{Is.onCommitFiberUnmount(lp,t)}catch(a){}switch(t.tag){case 5:Ti||Uu(t,e);case 6:var i=vi,r=cs;vi=null,qo(n,e,t),vi=i,cs=r,vi!==null&&(cs?(n=vi,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):vi.removeChild(t.stateNode));break;case 18:vi!==null&&(cs?(n=vi,t=t.stateNode,n.nodeType===8?ix(n.parentNode,t):n.nodeType===1&&ix(n,t),bf(n)):ix(vi,t.stateNode));break;case 4:i=vi,r=cs,vi=t.stateNode.containerInfo,cs=!0,qo(n,e,t),vi=i,cs=r;break;case 0:case 11:case 14:case 15:if(!Ti&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Hx(t,e,o),r=r.next}while(r!==i)}qo(n,e,t);break;case 1:if(!Ti&&(Uu(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Un(t,e,a)}qo(n,e,t);break;case 21:qo(n,e,t);break;case 22:t.mode&1?(Ti=(i=Ti)||t.memoizedState!==null,qo(n,e,t),Ti=i):qo(n,e,t);break;default:qo(n,e,t)}}function EC(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new qN),e.forEach(function(i){var r=a3.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function fs(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=Xn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*e3(i/1960))-i,10n?16:n,$o===null)var i=!1;else{if(n=$o,$o=null,em=0,Zt&6)throw Error(Re(331));var r=Zt;for(Zt|=4,tt=n.current;tt!==null;){var s=tt,o=s.child;if(tt.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lXn()-Jx?sl(n,0):jx|=t),ar(n,e)}function OC(n,e){e===0&&(n.mode&1?(e=cp,cp<<=1,!(cp&130023424)&&(cp=4194304)):e=1);var t=Wi();n=so(n,e),n!==null&&(Mf(n,e,t),ar(n,t))}function o3(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),OC(n,t)}function a3(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Re(314))}i!==null&&i.delete(e),OC(n,t)}var kC;kC=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||ir.current)sr=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return sr=!1,KN(n,e,t);sr=!!(n.flags&131072)}else sr=!1,Cn&&e.flags&1048576&&yE(e,Bp,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Jp(n,e),n=e.pendingProps;var r=bu(e,wi.current);Du(e,t),r=wx(null,e,i,n,r,t);var s=Ex();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,rr(i)?(s=!0,Rp(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,vx(e),r.updater=Xp,e.stateNode=r,r._reactInternals=e,Ix(e,i,n,t),e=Fx(null,e,i,!0,s,t)):(e.tag=0,Cn&&s&&ax(e),Vi(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Jp(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=u3(i),n=us(i,n),r){case 0:e=Dx(null,e,i,n,t);break e;case 1:e=fC(null,e,i,n,t);break e;case 11:e=oC(null,e,i,n,t);break e;case 14:e=aC(null,e,i,us(i.type,n),t);break e}throw Error(Re(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:us(i,r),Dx(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:us(i,r),fC(n,e,i,r,t);case 3:e:{if(dC(e),n===null)throw Error(Re(387));i=e.pendingProps,s=e.memoizedState,r=s.element,TE(n,e),Op(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Nu(Error(Re(423)),e),e=hC(n,e,i,t,r);break e}else if(i!==r){r=Nu(Error(Re(424)),e),e=hC(n,e,i,t,r);break e}else for(wr=Xo(e.stateNode.containerInfo.firstChild),Mr=e,Cn=!0,ls=null,t=EE(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Iu(),i===r){e=ao(n,e,t);break e}Vi(n,e,i,t)}e=e.child}return e;case 5:return PE(e),n===null&&cx(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,tx(i,r)?o=null:s!==null&&tx(i,s)&&(e.flags|=32),cC(n,e),Vi(n,e,o,t),e.child;case 6:return n===null&&cx(e),null;case 13:return pC(n,e,t);case 4:return yx(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Bu(e,null,i,t):Vi(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:us(i,r),oC(n,e,i,r,t);case 7:return Vi(n,e,e.pendingProps,t),e.child;case 8:return Vi(n,e,e.pendingProps.children,t),e.child;case 12:return Vi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,gn(Fp,i._currentValue),i._currentValue=o,s!==null)if(as(s.value,o)){if(s.children===r.children&&!ir.current){e=ao(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=oo(-1,t&-t),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),mx(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Re(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),mx(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Vi(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Du(e,t),r=Hr(r),i=i(r),e.flags|=1,Vi(n,e,i,t),e.child;case 14:return i=e.type,r=us(i,e.pendingProps),r=us(i.type,r),aC(n,e,i,r,t);case 15:return lC(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:us(i,r),Jp(n,e),e.tag=1,rr(i)?(n=!0,Rp(e)):n=!1,Du(e,t),$E(e,i,r),Ix(e,i,r,t),Fx(null,e,i,!0,n,t);case 19:return gC(n,e,t);case 22:return uC(n,e,t)}throw Error(Re(156,e.tag))};function zC(n,e){return xw(n,e)}function l3(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wr(n,e,t,i){return new l3(n,e,t,i)}function t_(n){return n=n.prototype,!(!n||!n.isReactComponent)}function u3(n){if(typeof n=="function")return t_(n)?1:0;if(n!=null){if(n=n.$$typeof,n===ay)return 11;if(n===cy)return 14}return 2}function na(n,e){var t=n.alternate;return t===null?(t=Wr(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function rm(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")t_(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case mu:return al(t.children,r,s,e);case sy:o=8,r|=8;break;case oy:return n=Wr(12,t,e,r|2),n.elementType=oy,n.lanes=s,n;case ly:return n=Wr(13,t,e,r),n.elementType=ly,n.lanes=s,n;case uy:return n=Wr(19,t,e,r),n.elementType=uy,n.lanes=s,n;case Y1:return sm(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case J1:o=10;break e;case K1:o=9;break e;case ay:o=11;break e;case cy:o=14;break e;case Uo:o=16,i=null;break e}throw Error(Re(130,n==null?n:typeof n,""))}return e=Wr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function al(n,e,t,i){return n=Wr(7,n,i,e),n.lanes=t,n}function sm(n,e,t,i){return n=Wr(22,n,i,e),n.elementType=Y1,n.lanes=t,n.stateNode={isHidden:!1},n}function n_(n,e,t){return n=Wr(6,n,null,e),n.lanes=t,n}function i_(n,e,t){return e=Wr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function c3(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Py(0),this.expirationTimes=Py(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Py(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function r_(n,e,t,i,r,s,o,a,l){return n=new c3(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Wr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},vx(s),n}function f3(n,e,t){var i=3n(...i);return new Proxy(t,{get:(i,r)=>r==="create"?n:(e.has(r)||e.set(r,n(r)),e.get(r))})}function td(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const l_=n=>Array.isArray(n);function KC(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;i{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function u_(n,e,t,i){if(typeof e=="function"){const[r,s]=YC(i);e=e(t!==void 0?t:n.custom,r,s)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,s]=YC(i);e=e(t!==void 0?t:n.custom,r,s)}return e}function dm(n,e,t){const i=n.getProps();return u_(i,e,t!==void 0?t:i.custom,n)}const c_=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],f_=["initial",...c_],id=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ia=new Set(id),uo=n=>n*1e3,co=n=>n/1e3,y3={type:"spring",stiffness:500,damping:25,restSpeed:10},x3=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),_3={type:"keyframes",duration:.8},A3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},S3=(n,{keyframes:e})=>e.length>2?_3:ia.has(n)?n.startsWith("scale")?x3(e[1]):y3:A3;function M3(h){var p=h,{when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u}=p,d=Wn(p,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(d).length}function d_(n,e){return n[e]||n.default||n}const w3={skipAnimations:!1,useManualTiming:!1},E3=n=>n!==null;function hm(n,{repeat:e,repeatType:t="loop"},i){const r=n.filter(E3),s=e&&t!=="loop"&&e%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const xi=n=>n;function C3(n){let e=new Set,t=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){s.has(u)&&(l.schedule(u),n()),u(o)}const l={schedule:(u,d=!1,h=!1)=>{const g=h&&i?e:t;return d&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{t.delete(u),s.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[e,t]=[t,e],t.clear(),e.forEach(a),i=!1,r&&(r=!1,l.process(u))}};return l}const pm=["read","resolveKeyframes","update","preRender","render","postRender"],T3=40;function QC(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>t=!0,o=pm.reduce((m,_)=>(m[_]=C3(s),m),{}),{read:a,resolveKeyframes:l,update:u,preRender:d,render:h,postRender:p}=o,g=()=>{const m=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(m-r.timestamp,T3),1),r.timestamp=m,r.isProcessing=!0,a.process(r),l.process(r),u.process(r),d.process(r),h.process(r),p.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(g))},v=()=>{t=!0,i=!0,r.isProcessing||n(g)};return{schedule:pm.reduce((m,_)=>{const A=o[_];return m[_]=(w,I=!1,P=!1)=>(t||v(),A.schedule(w,I,P)),m},{}),cancel:m=>{for(let _=0;_/^0[^.\s]+$/u.test(n);function b3(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||qC(n):!0}let R3=xi,p_=xi;const ZC=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),$C=n=>e=>typeof e=="string"&&e.startsWith(n),eT=$C("--"),P3=$C("var(--"),m_=n=>P3(n)?I3.test(n.split("/*")[0].trim()):!1,I3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,B3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function L3(n){const e=B3.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t!=null?t:i}`,r]}function tT(n,e,t=1){const[i,r]=L3(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return ZC(o)?parseFloat(o):o}return m_(r)?tT(r,e,t+1):r}const ra=(n,e,t)=>t>e?e:ttypeof n=="number",parse:parseFloat,transform:n=>n},rd=Ct(_e({},Hu),{transform:n=>ra(0,1,n)}),mm=Ct(_e({},Hu),{default:1}),sd=n=>Math.round(n*1e5)/1e5,g_=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,D3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,F3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function od(n){return typeof n=="string"}function N3(n){return n==null}const ad=n=>({test:e=>od(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),sa=ad("deg"),Ns=ad("%"),St=ad("px"),U3=ad("vh"),O3=ad("vw"),nT=Ct(_e({},Ns),{parse:n=>Ns.parse(n)/100,transform:n=>Ns.transform(n*100)}),k3=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),iT=n=>n===Hu||n===St,rT=(n,e)=>parseFloat(n.split(", ")[e]),sT=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return rT(r[1],e);{const s=i.match(/^matrix\((.+)\)$/u);return s?rT(s[1],n):0}},z3=new Set(["x","y","z"]),H3=id.filter(n=>!z3.has(n));function G3(n){const e=[];return H3.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const Gu={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:sT(4,13),y:sT(5,14)};Gu.translateX=Gu.x,Gu.translateY=Gu.y;const oT=n=>e=>e.test(n),aT=[Hu,St,Ns,sa,O3,U3,{test:n=>n==="auto",parse:n=>n}],lT=n=>aT.find(oT(n)),ll=new Set;let v_=!1,y_=!1;function uT(){if(y_){const n=Array.from(ll).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=G3(i);r.length&&(t.set(i,r),i.render())}),n.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=t.get(i);r&&r.forEach(([s,o])=>{var a;(a=i.getValue(s))===null||a===void 0||a.set(o)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}y_=!1,v_=!1,ll.forEach(n=>n.complete()),ll.clear()}function cT(){ll.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(y_=!0)})}function V3(){cT(),uT()}class x_{constructor(e,t,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ll.add(this),v_||(v_=!0,Xt.read(cT),Xt.resolveKeyframes(uT))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;for(let s=0;st=>!!(od(t)&&F3.test(t)&&t.startsWith(n)||e&&!N3(t)&&Object.prototype.hasOwnProperty.call(t,e)),fT=(n,e,t)=>i=>{if(!od(i))return i;const[r,s,o,a]=i.match(g_);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},W3=n=>ra(0,255,n),A_=Ct(_e({},Hu),{transform:n=>Math.round(W3(n))}),ul={test:__("rgb","red"),parse:fT("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+A_.transform(n)+", "+A_.transform(e)+", "+A_.transform(t)+", "+sd(rd.transform(i))+")"};function X3(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const S_={test:__("#"),parse:X3,transform:ul.transform},Vu={test:__("hsl","hue"),parse:fT("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Ns.transform(sd(e))+", "+Ns.transform(sd(t))+", "+sd(rd.transform(i))+")"},bi={test:n=>ul.test(n)||S_.test(n)||Vu.test(n),parse:n=>ul.test(n)?ul.parse(n):Vu.test(n)?Vu.parse(n):S_.parse(n),transform:n=>od(n)?n:n.hasOwnProperty("red")?ul.transform(n):Vu.transform(n)};function j3(n){var e,t;return isNaN(n)&&od(n)&&(((e=n.match(g_))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(D3))===null||t===void 0?void 0:t.length)||0)>0}const dT="number",hT="color",J3="var",K3="var(",pT="${}",Y3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ld(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let s=0;const a=e.replace(Y3,l=>(bi.test(l)?(i.color.push(s),r.push(hT),t.push(bi.parse(l))):l.startsWith(K3)?(i.var.push(s),r.push(J3),t.push(l)):(i.number.push(s),r.push(dT),t.push(parseFloat(l))),++s,pT)).split(pT);return{values:t,split:a,indexes:i,types:r}}function mT(n){return ld(n).values}function gT(n){const{split:e,types:t}=ld(n),i=e.length;return r=>{let s="";for(let o=0;otypeof n=="number"?0:n;function q3(n){const e=mT(n);return gT(n)(e.map(Q3))}const oa={test:j3,parse:mT,createTransformer:gT,getAnimatableNone:q3},Z3=new Set(["brightness","contrast","saturate","opacity"]);function $3(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(g_)||[];if(!i)return n;const r=t.replace(i,"");let s=Z3.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const eU=/\b([a-z-]*)\(.*?\)/gu,M_=Ct(_e({},oa),{getAnimatableNone:n=>{const e=n.match(eU);return e?e.map($3).join(" "):n}}),vT=Ct(_e({},Hu),{transform:Math.round}),w_={borderWidth:St,borderTopWidth:St,borderRightWidth:St,borderBottomWidth:St,borderLeftWidth:St,borderRadius:St,radius:St,borderTopLeftRadius:St,borderTopRightRadius:St,borderBottomRightRadius:St,borderBottomLeftRadius:St,width:St,maxWidth:St,height:St,maxHeight:St,size:St,top:St,right:St,bottom:St,left:St,padding:St,paddingTop:St,paddingRight:St,paddingBottom:St,paddingLeft:St,margin:St,marginTop:St,marginRight:St,marginBottom:St,marginLeft:St,rotate:sa,rotateX:sa,rotateY:sa,rotateZ:sa,scale:mm,scaleX:mm,scaleY:mm,scaleZ:mm,skew:sa,skewX:sa,skewY:sa,distance:St,translateX:St,translateY:St,translateZ:St,x:St,y:St,z:St,perspective:St,transformPerspective:St,opacity:rd,originX:nT,originY:nT,originZ:St,zIndex:vT,backgroundPositionX:St,backgroundPositionY:St,fillOpacity:rd,strokeOpacity:rd,numOctaves:vT},tU=Ct(_e({},w_),{color:bi,backgroundColor:bi,outlineColor:bi,fill:bi,stroke:bi,borderColor:bi,borderTopColor:bi,borderRightColor:bi,borderBottomColor:bi,borderLeftColor:bi,filter:M_,WebkitFilter:M_}),E_=n=>tU[n];function yT(n,e){let t=E_(n);return t!==M_&&(t=oa),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const nU=new Set(["auto","none","0"]);function iU(n,e,t){let i=0,r;for(;i{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function _T(n){let e;return()=>(e===void 0&&(e=n()),e)}let gm;function rU(){gm=void 0}const fo={now:()=>(gm===void 0&&fo.set(si.isProcessing||w3.useManualTiming?si.timestamp:performance.now()),gm),set:n=>{gm=n,queueMicrotask(rU)}},AT=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(oa.test(n)||n==="0")&&!n.startsWith("url("));function sU(n){const e=n[0];if(n.length===1)return!0;for(let t=0;taU?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&V3(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=fo.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!oU(e,i,r,s))if(o)this.options.duration=0;else{l==null||l(hm(e,this.options,t)),a==null||a(),this.resolveFinishedPromise();return}const d=this.initPlayback(e,t);d!==!1&&(this._resolved=_e({keyframes:e,finalKeyframe:t},d),this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function C_(n,e){return e?n*(1e3/e):0}const lU=5;function MT(n,e,t){const i=Math.max(e-lU,0);return C_(t-n(i),e-i)}const T_=.001,uU=.01,cU=10,fU=.05,dU=1;function hU({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s,o=1-e;o=ra(fU,dU,o),n=ra(uU,cU,co(n)),o<1?(r=u=>{const d=u*o,h=d*n,p=d-t,g=b_(u,o),v=Math.exp(-h);return T_-p/g*v},s=u=>{const h=u*o*n,p=h*t+t,g=Math.pow(o,2)*Math.pow(u,2)*n,v=Math.exp(-h),S=b_(Math.pow(u,2),o);return(-r(u)+T_>0?-1:1)*((p-g)*v)/S}):(r=u=>{const d=Math.exp(-u*n),h=(u-t)*n+1;return-T_+d*h},s=u=>{const d=Math.exp(-u*n),h=(t-u)*(n*n);return d*h});const a=5/n,l=mU(r,s,a);if(n=uo(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const u=Math.pow(l,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:n}}}const pU=12;function mU(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function yU(n){let e=_e({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!wT(n,vU)&&wT(n,gU)){const t=hU(n);e=Ct(_e(_e({},e),t),{mass:1}),e.isResolvedFromDuration=!0}return e}function ET(r){var s=r,{keyframes:n,restDelta:e,restSpeed:t}=s,i=Wn(s,["keyframes","restDelta","restSpeed"]);const o=n[0],a=n[n.length-1],l={done:!1,value:o},{stiffness:u,damping:d,mass:h,duration:p,velocity:g,isResolvedFromDuration:v}=yU(Ct(_e({},i),{velocity:-co(i.velocity||0)})),S=g||0,x=d/(2*Math.sqrt(u*h)),m=a-o,_=co(Math.sqrt(u/h)),A=Math.abs(m)<5;t||(t=A?.01:2),e||(e=A?.005:.5);let w;if(x<1){const I=b_(_,x);w=P=>{const D=Math.exp(-x*_*P);return a-D*((S+x*_*m)/I*Math.sin(I*P)+m*Math.cos(I*P))}}else if(x===1)w=I=>a-Math.exp(-_*I)*(m+(S+_*m)*I);else{const I=_*Math.sqrt(x*x-1);w=P=>{const D=Math.exp(-x*_*P),N=Math.min(I*P,300);return a-D*((S+x*_*m)*Math.sinh(N)+I*m*Math.cosh(N))/I}}return{calculatedDuration:v&&p||null,next:I=>{const P=w(I);if(v)l.done=I>=p;else{let D=0;x<1&&(D=I===0?uo(S):MT(w,I,P));const N=Math.abs(D)<=t,B=Math.abs(a-P)<=e;l.done=N&&B}return l.value=l.done?a:P,l}}}function CT({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const h=n[0],p={done:!1,value:h},g=N=>a!==void 0&&Nl,v=N=>a===void 0?l:l===void 0||Math.abs(a-N)-S*Math.exp(-N/i),A=N=>m+_(N),w=N=>{const B=_(N),T=A(N);p.done=Math.abs(B)<=u,p.value=p.done?m:T};let I,P;const D=N=>{g(p.value)&&(I=N,P=ET({keyframes:[p.value,v(p.value)],velocity:MT(A,N,p.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return D(0),{calculatedDuration:null,next:N=>{let B=!1;return!P&&I===void 0&&(B=!0,w(N),D(N)),I!==void 0&&N>=I?P.next(N-I):(!B&&w(N),p)}}}const TT=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,xU=1e-7,_U=12;function AU(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=TT(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>xU&&++a<_U);return o}function ud(n,e,t,i){if(n===e&&t===i)return xi;const r=s=>AU(s,0,1,n,t);return s=>s===0||s===1?s:TT(r(s),e,i)}const SU=ud(.42,0,1,1),MU=ud(0,0,.58,1),bT=ud(.42,0,.58,1),wU=n=>Array.isArray(n)&&typeof n[0]!="number",RT=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,PT=n=>e=>1-n(1-e),R_=n=>1-Math.sin(Math.acos(n)),IT=PT(R_),EU=RT(R_),BT=ud(.33,1.53,.69,.99),P_=PT(BT),LT={linear:xi,easeIn:SU,easeInOut:bT,easeOut:MU,circIn:R_,circInOut:EU,circOut:IT,backIn:P_,backInOut:RT(P_),backOut:BT,anticipate:n=>(n*=2)<1?.5*P_(n):.5*(2-Math.pow(2,-10*(n-1)))},DT=n=>{if(Array.isArray(n)){p_(n.length===4);const[e,t,i,r]=n;return ud(e,t,i,r)}else if(typeof n=="string")return p_(LT[n]!==void 0),LT[n];return n},CU=(n,e)=>t=>e(n(t)),Us=(...n)=>n.reduce(CU),Wu=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},Ln=(n,e,t)=>n+(e-n)*t;function I_(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function TU({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=I_(l,a,n+1/3),s=I_(l,a,n),o=I_(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function vm(n,e){return t=>t>0?e:n}const B_=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},bU=[S_,ul,Vu],RU=n=>bU.find(e=>e.test(n));function FT(n){const e=RU(n);if(!e)return!1;let t=e.parse(n);return e===Vu&&(t=TU(t)),t}const NT=(n,e)=>{const t=FT(n),i=FT(e);if(!t||!i)return vm(n,e);const r=_e({},t);return s=>(r.red=B_(t.red,i.red,s),r.green=B_(t.green,i.green,s),r.blue=B_(t.blue,i.blue,s),r.alpha=Ln(t.alpha,i.alpha,s),ul.transform(r))},L_=new Set(["none","hidden"]);function PU(n,e){return L_.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function IU(n,e){return t=>Ln(n,e,t)}function D_(n){return typeof n=="number"?IU:typeof n=="string"?m_(n)?vm:bi.test(n)?NT:DU:Array.isArray(n)?UT:typeof n=="object"?bi.test(n)?NT:BU:vm}function UT(n,e){const t=[...n],i=t.length,r=n.map((s,o)=>D_(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in i)t[s]=i[s](r);return t}}function LU(n,e){var t;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const t=oa.createTransformer(e),i=ld(n),r=ld(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?L_.has(n)&&!r.values.length||L_.has(e)&&!i.values.length?PU(n,e):Us(UT(LU(i,r),r.values),t):vm(n,e)};function OT(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?Ln(n,e,t):D_(n)(n,e)}function FU(n,e,t){const i=[],r=t||OT,s=n.length-1;for(let o=0;oe[0];if(s===2&&n[0]===n[1])return()=>e[1];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=FU(e,i,r),a=o.length,l=u=>{let d=0;if(a>1)for(;dl(ra(n[0],n[s-1],u)):l}function NU(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=Wu(0,e,i);n.push(Ln(t,1,r))}}function kT(n){const e=[0];return NU(e,n.length-1),e}function UU(n,e){return n.map(t=>t*e)}function OU(n,e){return n.map(()=>e||bT).splice(0,n.length-1)}function ym({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=wU(i)?i.map(DT):DT(i),s={done:!1,value:e[0]},o=UU(t&&t.length===e.length?t:kT(e),n),a=F_(o,e,{ease:Array.isArray(r)?r:OU(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}const zT=2e4;function kU(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=zT?1/0:e}const zU=n=>{const e=({timestamp:t})=>n(t);return{start:()=>Xt.update(e,!0),stop:()=>hs(e),now:()=>si.isProcessing?si.timestamp:fo.now()}},HU={decay:CT,inertia:CT,tween:ym,keyframes:ym,spring:ET},GU=n=>n/100;class xm extends ST{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:t,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||x_,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(s,a,t,i,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,a=HU[t]||ym;let l,u;a!==ym&&typeof e[0]!="number"&&(l=Us(GU,OT(e[0],e[1])),e=[0,100]);const d=a(Ct(_e({},this.options),{keyframes:e}));s==="mirror"&&(u=a(Ct(_e({},this.options),{keyframes:[...e].reverse(),velocity:-o}))),d.calculatedDuration===null&&(d.calculatedDuration=kU(d));const{calculatedDuration:h}=d,p=h+r,g=p*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:p,totalDuration:g}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,t=!1){const{resolved:i}=this;if(!i){const{keyframes:N}=this.options;return{done:!0,value:N[N.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:h}=i;if(this.startTime===null)return s.next(0);const{delay:p,repeat:g,repeatType:v,repeatDelay:S,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-d/this.speed,this.startTime)),t?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const m=this.currentTime-p*(this.speed>=0?1:-1),_=this.speed>=0?m<0:m>d;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let A=this.currentTime,w=s;if(g){const N=Math.min(this.currentTime,d)/h;let B=Math.floor(N),T=N%1;!T&&N>=1&&(T=1),T===1&&B--,B=Math.min(B,g+1),!!(B%2)&&(v==="reverse"?(T=1-T,S&&(T-=S/h)):v==="mirror"&&(w=o)),A=ra(0,1,T)*h}const I=_?{done:!1,value:l[0]}:w.next(A);a&&(I.value=a(I.value));let{done:P}=I;!_&&u!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return D&&r!==void 0&&(I.value=hm(l,this.options,r)),x&&x(I.value),D&&this.finish(),I}get duration(){const{resolved:e}=this;return e?co(e.calculatedDuration):0}get time(){return co(this.currentTime)}set time(e){e=uo(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=co(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=zU,onPlay:t,startTime:i}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),t&&t();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i!=null?i:this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}function VU(n){return new xm(n)}const HT=new Set(["opacity","clipPath","filter","transform"]),GT=n=>Array.isArray(n)&&typeof n[0]=="number";function VT(n){return!!(!n||typeof n=="string"&&n in N_||GT(n)||Array.isArray(n)&&n.every(VT))}const cd=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,N_={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cd([0,.65,.55,1]),circOut:cd([.55,0,1,.45]),backIn:cd([.31,.01,.66,-.59]),backOut:cd([.33,1.53,.69,.99])};function WU(n){return WT(n)||N_.easeOut}function WT(n){if(n)return GT(n)?cd(n):Array.isArray(n)?n.map(WU):N_[n]}function XU(n,e,t,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:t};l&&(u.offset=l);const d=WT(a);return Array.isArray(d)&&(u.easing=d),n.animate(u,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const jU=_T(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),_m=10,JU=2e4;function KU(n){return n.type==="spring"||!VT(n.ease)}function YU(n,e){const t=new xm(Ct(_e({},e),{keyframes:n,repeat:0,delay:0,isGenerator:!0}));let i={done:!1,value:n[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,a),t,i,r),this.resolver.scheduleResolve()}initPlayback(e,t){var i;let{duration:r=300,times:s,ease:o,type:a,motionValue:l,name:u,startTime:d}=this.options;if(!(!((i=l.owner)===null||i===void 0)&&i.current))return!1;if(KU(this.options)){const p=this.options,{onComplete:g,onUpdate:v,motionValue:S,element:x}=p,m=Wn(p,["onComplete","onUpdate","motionValue","element"]),_=YU(e,m);e=_.keyframes,e.length===1&&(e[1]=e[0]),r=_.duration,s=_.times,o=_.ease,a="keyframes"}const h=XU(l.owner.current,u,e,Ct(_e({},this.options),{duration:r,times:s,ease:o}));return h.startTime=d!=null?d:this.calcStartTime(),this.pendingTimeline?(h.timeline=this.pendingTimeline,this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:g}=this.options;l.set(hm(e,this.options,t)),g&&g(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:r,times:s,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return co(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return co(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.currentTime=uo(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:t}=this;if(!t)return xi;const{animation:i}=t;i.timeline=e,i.onfinish=null}return xi}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.playState==="finished"&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:i,duration:r,type:s,ease:o,times:a}=e;if(t.playState==="idle"||t.playState==="finished")return;if(this.time){const u=this.options,{motionValue:d,onUpdate:h,onComplete:p,element:g}=u,v=Wn(u,["motionValue","onUpdate","onComplete","element"]),S=new xm(Ct(_e({},v),{keyframes:i,duration:r,type:s,ease:o,times:a,isGenerator:!0})),x=uo(this.time);d.setWithVelocity(S.sample(x-_m).value,S.sample(x).value,_m)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:i,repeatDelay:r,repeatType:s,damping:o,type:a}=e;return jU()&&i&&HT.has(i)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&s!=="mirror"&&o!==0&&a!=="inertia"}}function QU(n,e){let t;const i=()=>{const{currentTime:r}=e,o=(r===null?0:r.value)/100;t!==o&&n(o),t=o};return Xt.update(i,!0),()=>hs(i)}const qU=_T(()=>window.ScrollTimeline!==void 0);class ZU{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i{if(qU()&&i.attachTimeline)i.attachTimeline(e);else return i.pause(),QU(r=>{i.time=i.duration*r},e)});return()=>{t.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const U_=(n,e,t,i={},r,s,o)=>a=>{const l=d_(i,n)||{},u=l.delay||i.delay||0;let{elapsed:d=0}=i;d=d-uo(u);let h=Ct(_e({keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity()},l),{delay:-d,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),o&&o()},onStop:o,name:n,motionValue:e,element:s?void 0:r});M3(l)||(h=_e(_e({},h),S3(n,h))),h.duration&&(h.duration=uo(h.duration)),h.repeatDelay&&(h.repeatDelay=uo(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(p=!0)),p&&!s&&e.get()!==void 0){const g=hm(h.keyframes,l);if(g!==void 0)return Xt.update(()=>{h.onUpdate(g),h.onComplete()}),new ZU([])}return!s&&XT.supports(h)?new XT(h):new xm(h)},$U=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),eO=n=>l_(n)?n[n.length-1]||0:n;function Am(n,e){n.indexOf(e)===-1&&n.push(e)}function Sm(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class O_{constructor(){this.subscriptions=[]}add(e){return Am(this.subscriptions,e),()=>Sm(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s!isNaN(parseFloat(n)),fd={current:void 0};class JT{constructor(e,t={}){this.version="11.5.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=fo.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=fo.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=tO(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new O_);const i=this.events[e].add(t);return e==="change"?()=>{i(),Xt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return fd.current&&fd.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=fo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>jT)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,jT);return C_(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Os(n,e){return new JT(n,e)}function nO(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,Os(t))}function iO(n,e){let o=dm(n,e)||{},{transitionEnd:i={},transition:r={}}=o,s=Wn(o,["transitionEnd","transition"]);s=_e(_e({},s),i);for(const a in s){const l=eO(s[a]);nO(n,a,l)}}const Mm=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),KT="data-"+Mm("framerAppearId");function YT(n){return n.props[KT]}function QT(n){if(ia.has(n))return"transform";if(HT.has(n))return Mm(n)}class rO extends JT{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=QT(e);if(!t)return;const i=this.counts.get(t)||0;this.counts.set(t,i+1),i===0&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const s=this.counts.get(t)-1;this.counts.set(t,s),s===0&&(Sm(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Tn=n=>!!(n&&n.getVelocity);function sO(n){return!!(Tn(n)&&n.add)}function k_(n,e){var t;if(!n.applyWillChange)return;let i=n.getValue("willChange");if(!i&&!(!((t=n.props.style)===null||t===void 0)&&t.willChange)&&(i=new rO("auto"),n.addValue("willChange",i)),sO(i))return i.add(e)}function oO({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function qT(n,e,{delay:t=0,transitionOverride:i,type:r}={}){var s;let h=e,{transition:o=n.getDefaultTransition(),transitionEnd:a}=h,l=Wn(h,["transition","transitionEnd"]);i&&(o=i);const u=[],d=r&&n.animationState&&n.animationState.getState()[r];for(const p in l){const g=n.getValue(p,(s=n.latestValues[p])!==null&&s!==void 0?s:null),v=l[p];if(v===void 0||d&&oO(d,p))continue;const S=_e({delay:t},d_(o||{},p));let x=!1;if(window.MotionHandoffAnimation){const _=YT(n);if(_){const A=window.MotionHandoffAnimation(_,p,Xt);A!==null&&(S.startTime=A,x=!0)}}g.start(U_(p,g,v,n.shouldReduceMotion&&ia.has(p)?{type:!1}:S,n,x,k_(n,p)));const m=g.animation;m&&u.push(m)}return a&&Promise.all(u).then(()=>{Xt.update(()=>{a&&iO(n,a)})}),u}function z_(n,e,t={}){var i;const r=dm(n,e,t.type==="exit"?(i=n.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=n.getDefaultTransition()||{}}=r||{};t.transitionOverride&&(s=t.transitionOverride);const o=r?()=>Promise.all(qT(n,r,t)):()=>Promise.resolve(),a=n.variantChildren&&n.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:p}=s;return aO(n,e,d+u,h,p,t)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>d())}else return Promise.all([o(),a(t.delay)])}function aO(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(u=0)=>u*i:(u=0)=>a-u*i;return Array.from(n.variantChildren).sort(lO).forEach((u,d)=>{u.notify("AnimationStart",e),o.push(z_(u,e,Ct(_e({},s),{delay:t+l(d)})).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function lO(n,e){return n.sortNodePosition(e)}function uO(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>z_(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=z_(n,e,t);else{const r=typeof e=="function"?dm(n,e,t.custom):e;i=Promise.all(qT(n,r,t))}return i.then(()=>{n.notify("AnimationComplete",e)})}const cO=[...c_].reverse(),fO=c_.length;function dO(n){return e=>Promise.all(e.map(({animation:t,options:i})=>uO(n,t,i)))}function hO(n){let e=dO(n),t=ZT(),i=!0;const r=l=>(u,d)=>{var h;const p=dm(n,d,l==="exit"?(h=n.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(p){const g=p,{transition:v,transitionEnd:S}=g,x=Wn(g,["transition","transitionEnd"]);u=_e(_e(_e({},u),x),S)}return u};function s(l){e=l(n)}function o(l){const u=n.getProps(),d=n.getVariantContext(!0)||{},h=[],p=new Set;let g={},v=1/0;for(let x=0;xv&&w,B=!1;const T=Array.isArray(A)?A:[A];let F=T.reduce(r(m),{});I===!1&&(F={});const{prevResolvedValues:X={}}=_,J=_e(_e({},X),F),q=$=>{N=!0,p.has($)&&(B=!0,p.delete($)),_.needsAnimating[$]=!0;const K=n.getValue($);K&&(K.liveStyle=!1)};for(const $ in J){const K=F[$],ge=X[$];if(g.hasOwnProperty($))continue;let z=!1;l_(K)&&l_(ge)?z=!KC(K,ge):z=K!==ge,z?K!=null?q($):p.add($):K!==void 0&&p.has($)?q($):_.protectedKeys[$]=!0}_.prevProp=A,_.prevResolvedValues=F,_.isActive&&(g=_e(_e({},g),F)),i&&n.blockInitialAnimation&&(N=!1),N&&(!P||B)&&h.push(...T.map($=>({animation:$,options:{type:m}})))}if(p.size){const x={};p.forEach(m=>{const _=n.getBaseTarget(m),A=n.getValue(m);A&&(A.liveStyle=!0),x[m]=_!=null?_:null}),h.push({animation:x})}let S=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!n.manuallyAnimateOnMount&&(S=!1),i=!1,S?e(h):Promise.resolve()}function a(l,u){var d;if(t[l].isActive===u)return Promise.resolve();(d=n.variantChildren)===null||d===void 0||d.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(l,u)}),t[l].isActive=u;const h=o(l);for(const p in t)t[p].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t,reset:()=>{t=ZT(),i=!0}}}function pO(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!KC(e,n):!1}function cl(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ZT(){return{animate:cl(!0),whileInView:cl(),whileHover:cl(),whileTap:cl(),whileDrag:cl(),whileFocus:cl(),exit:cl()}}class aa{constructor(e){this.isMounted=!1,this.node=e}update(){}}class mO extends aa{constructor(e){super(e),e.animationState||(e.animationState=hO(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();td(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let gO=0;class vO extends aa{constructor(){super(...arguments),this.id=gO++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const $T={animation:{Feature:mO},exit:{Feature:vO}},eb=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function wm(n,e="page"){return{point:{x:n[`${e}X`],y:n[`${e}Y`]}}}const tb=n=>e=>eb(e)&&n(e,wm(e));function ho(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}function ps(n,e,t,i){return ho(n,e,tb(t),i)}const nb=(n,e)=>Math.abs(n-e);function yO(n,e){const t=nb(n.x,e.x),i=nb(n.y,e.y);return Math.sqrt(J0(t,2)+J0(i,2))}class ib{constructor(e,t,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=G_(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=yO(h.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:v}=h,{timestamp:S}=si;this.history.push(Ct(_e({},v),{timestamp:S}));const{onStart:x,onMove:m}=this.handlers;p||(x&&x(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=H_(p,this.transformPagePoint),Xt.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=G_(h.type==="pointercancel"?this.lastMoveEventInfo:H_(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,x),v&&v(h,x)},!eb(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const o=wm(e),a=H_(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=si;this.history=[Ct(_e({},l),{timestamp:u})];const{onSessionStart:d}=t;d&&d(e,G_(a,this.history)),this.removeListeners=Us(ps(this.contextWindow,"pointermove",this.handlePointerMove),ps(this.contextWindow,"pointerup",this.handlePointerUp),ps(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),hs(this.updatePoint)}}function H_(n,e){return e?{point:e(n.point)}:n}function rb(n,e){return{x:n.x-e.x,y:n.y-e.y}}function G_({point:n},e){return{point:n,delta:rb(n,sb(e)),offset:rb(n,xO(e)),velocity:_O(e,.1)}}function xO(n){return n[0]}function sb(n){return n[n.length-1]}function _O(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=sb(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>uo(e)));)t--;if(!i)return{x:0,y:0};const s=co(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ob(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const ab=ob("dragHorizontal"),lb=ob("dragVertical");function ub(n){let e=!1;if(n==="y")e=lb();else if(n==="x")e=ab();else{const t=ab(),i=lb();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function V_(){const n=ub(!0);return n?(n(),!1):!0}function Xu(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}const cb=1e-4,AO=1-cb,SO=1+cb,fb=.01,MO=0-fb,wO=0+fb;function Cr(n){return n.max-n.min}function EO(n,e,t){return Math.abs(n-e)<=t}function db(n,e,t,i=.5){n.origin=i,n.originPoint=Ln(e.min,e.max,n.origin),n.scale=Cr(t)/Cr(e),n.translate=Ln(t.min,t.max,n.origin)-n.originPoint,(n.scale>=AO&&n.scale<=SO||isNaN(n.scale))&&(n.scale=1),(n.translate>=MO&&n.translate<=wO||isNaN(n.translate))&&(n.translate=0)}function dd(n,e,t,i){db(n.x,e.x,t.x,i?i.originX:void 0),db(n.y,e.y,t.y,i?i.originY:void 0)}function hb(n,e,t){n.min=t.min+e.min,n.max=n.min+Cr(e)}function CO(n,e,t){hb(n.x,e.x,t.x),hb(n.y,e.y,t.y)}function pb(n,e,t){n.min=e.min-t.min,n.max=n.min+Cr(e)}function hd(n,e,t){pb(n.x,e.x,t.x),pb(n.y,e.y,t.y)}function TO(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?Ln(t,n,i.max):Math.min(n,t)),n}function mb(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function bO(n,{top:e,left:t,bottom:i,right:r}){return{x:mb(n.x,t,r),y:mb(n.y,e,i)}}function gb(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=Wu(e.min,e.max-i,n.min):i>r&&(t=Wu(n.min,n.max-r,e.min)),ra(0,1,t)}function IO(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const W_=.35;function BO(n=W_){return n===!1?n=0:n===!0&&(n=W_),{x:vb(n,"left","right"),y:vb(n,"top","bottom")}}function vb(n,e,t){return{min:yb(n,e),max:yb(n,t)}}function yb(n,e){return typeof n=="number"?n:n[e]||0}const xb=()=>({translate:0,scale:1,origin:0,originPoint:0}),ju=()=>({x:xb(),y:xb()}),_b=()=>({min:0,max:0}),On=()=>({x:_b(),y:_b()});function Xr(n){return[n("x"),n("y")]}function Ab({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function LO({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function DO(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function X_(n){return n===void 0||n===1}function j_({scale:n,scaleX:e,scaleY:t}){return!X_(n)||!X_(e)||!X_(t)}function fl(n){return j_(n)||Sb(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Sb(n){return Mb(n.x)||Mb(n.y)}function Mb(n){return n&&n!=="0%"}function Em(n,e,t){const i=n-t,r=e*i;return t+r}function wb(n,e,t,i,r){return r!==void 0&&(n=Em(n,r,i)),Em(n,t,i)+e}function J_(n,e=0,t=1,i,r){n.min=wb(n.min,e,t,i,r),n.max=wb(n.max,e,t,i,r)}function Eb(n,{x:e,y:t}){J_(n.x,e.translate,e.scale,e.originPoint),J_(n.y,t.translate,t.scale,t.originPoint)}const Cb=.999999999999,Tb=1.0000000000001;function FO(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;aCb&&(e.x=1),e.yCb&&(e.y=1)}function Ju(n,e){n.min=n.min+e,n.max=n.max+e}function bb(n,e,t,i,r=.5){const s=Ln(n.min,n.max,r);J_(n,e,t,s,i)}function Ku(n,e){bb(n.x,e.x,e.scaleX,e.scale,e.originX),bb(n.y,e.y,e.scaleY,e.scale,e.originY)}function Rb(n,e){return Ab(DO(n.getBoundingClientRect(),e))}function NO(n,e,t){const i=Rb(n,t),{scroll:r}=e;return r&&(Ju(i.x,r.offset.x),Ju(i.y,r.offset.y)),i}const Pb=({current:n})=>n?n.ownerDocument.defaultView:null,UO=new WeakMap;class OO{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=On(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(wm(d,"page").point)},s=(d,h)=>{var p;const{drag:g,dragPropagation:v,onDragStart:S}=this.getProps();if(g&&!v&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=ub(g),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xr(m=>{let _=this.getAxisMotionValue(m).get()||0;if(Ns.test(_)){const{projection:A}=this.visualElement;if(A&&A.layout){const w=A.layout.layoutBox[m];w&&(_=Cr(w)*(parseFloat(_)/100))}}this.originPoint[m]=_}),S&&Xt.postRender(()=>S(d,h)),(p=this.removeWillChange)===null||p===void 0||p.call(this),this.removeWillChange=k_(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(d,h)=>{const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:v,onDrag:S}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:x}=h;if(g&&this.currentDirection===null){this.currentDirection=kO(x),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),S&&S(d,h)},a=(d,h)=>this.stop(d,h),l=()=>Xr(d=>{var h;return this.getAnimationState(d)==="paused"&&((h=this.getAxisMotionValue(d).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new ib(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Pb(this.visualElement)})}stop(e,t){var i;(i=this.removeWillChange)===null||i===void 0||i.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=t;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&Xt.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!Cm(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=TO(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;t&&Xu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=bO(r.layoutBox,t):this.constraints=!1,this.elastic=BO(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Xr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=IO(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Xu(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=NO(i,r.root,this.visualElement.getTransformPagePoint());let o=RO(r.layout.layoutBox,s);if(t){const a=t(LO(o));this.hasMutatedConstraints=!!a,a&&(o=Ab(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Xr(d=>{if(!Cm(d,t,this.currentDirection))return;let h=l&&l[d]||{};o&&(h={min:0,max:0});const p=r?200:1e6,g=r?40:1e7,v=_e(_e({type:"inertia",velocity:i?e[d]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10},s),h);return this.startAxisValueAnimation(d,v)});return Promise.all(u).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(U_(e,i,0,t,this.visualElement,!1,k_(this.visualElement,e)))}stopAnimation(){Xr(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Xr(e=>{var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Xr(t=>{const{drag:i}=this.getProps();if(!Cm(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-Ln(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!Xu(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Xr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();r[o]=PO({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Xr(o=>{if(!Cm(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Ln(l,u,r[o]))})}addListeners(){if(!this.visualElement.current)return;UO.set(this.visualElement,this);const e=this.visualElement.current,t=ps(e,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Xu(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Xt.read(i);const o=ho(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xr(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=l[d].translate,h.set(h.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=W_,dragMomentum:a=!0}=e;return Ct(_e({},e),{drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a})}}function Cm(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function kO(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class zO extends aa{constructor(e){super(e),this.removeGroupControls=xi,this.removeListeners=xi,this.controls=new OO(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xi}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ib=n=>(e,t)=>{n&&Xt.postRender(()=>n(e,t))};class HO extends aa{constructor(){super(...arguments),this.removePointerDownListener=xi}onPointerDown(e){this.session=new ib(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Pb(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ib(e),onStart:Ib(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Xt.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=ps(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const K_=pe.createContext(null);function GO(){const n=pe.useContext(K_);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=pe.useId();pe.useEffect(()=>i(r),[]);const s=pe.useCallback(()=>t&&t(r),[r,t]);return!e&&t?[!1,s]:[!0]}const Bb=pe.createContext({}),Lb=pe.createContext({}),Tm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Db(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const pd={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(St.test(n))n=parseFloat(n);else return n;const t=Db(n,e.target.x),i=Db(n,e.target.y);return`${t}% ${i}%`}},VO={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=oa.parse(n);if(r.length>5)return i;const s=oa.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const u=Ln(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=u),typeof r[3+o]=="number"&&(r[3+o]/=u),s(r)}},bm={};function WO(n){Object.assign(bm,n)}const{schedule:Y_,cancel:pj}=QC(queueMicrotask,!1);class XO extends pe.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;WO(jO),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions(Ct(_e({},s.options),{onExitComplete:()=>this.safeToRemove()}))),Tm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Xt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Y_.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Fb(n){const[e,t]=GO(),i=pe.useContext(Bb);return me.jsx(XO,Ct(_e({},n),{layoutGroup:i,switchLayoutGroup:pe.useContext(Lb),isPresent:e,safeToRemove:t}))}const jO={borderRadius:Ct(_e({},pd),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:pd,borderTopRightRadius:pd,borderBottomLeftRadius:pd,borderBottomRightRadius:pd,boxShadow:VO},Nb=["TopLeft","TopRight","BottomLeft","BottomRight"],JO=Nb.length,Ub=n=>typeof n=="string"?parseFloat(n):n,Ob=n=>typeof n=="number"||St.test(n);function KO(n,e,t,i,r,s){r?(n.opacity=Ln(0,t.opacity!==void 0?t.opacity:1,YO(i)),n.opacityExit=Ln(e.opacity!==void 0?e.opacity:1,0,QO(i))):s&&(n.opacity=Ln(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;oie?1:t(Wu(n,e,i))}function Hb(n,e){n.min=e.min,n.max=e.max}function jr(n,e){Hb(n.x,e.x),Hb(n.y,e.y)}function Gb(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}function Vb(n,e,t,i,r){return n-=e,n=Em(n,1/t,i),r!==void 0&&(n=Em(n,1/r,i)),n}function qO(n,e=0,t=1,i=.5,r,s=n,o=n){if(Ns.test(e)&&(e=parseFloat(e),e=Ln(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Ln(s.min,s.max,i);n===s&&(a-=e),n.min=Vb(n.min,e,t,a,r),n.max=Vb(n.max,e,t,a,r)}function Wb(n,e,[t,i,r],s,o){qO(n,e[t],e[i],e[r],e.scale,s,o)}const ZO=["x","scaleX","originX"],$O=["y","scaleY","originY"];function Xb(n,e,t,i){Wb(n.x,e,ZO,t?t.x:void 0,i?i.x:void 0),Wb(n.y,e,$O,t?t.y:void 0,i?i.y:void 0)}function jb(n){return n.translate===0&&n.scale===1}function Jb(n){return jb(n.x)&&jb(n.y)}function Kb(n,e){return n.min===e.min&&n.max===e.max}function ek(n,e){return Kb(n.x,e.x)&&Kb(n.y,e.y)}function Yb(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function Qb(n,e){return Yb(n.x,e.x)&&Yb(n.y,e.y)}function qb(n){return Cr(n.x)/Cr(n.y)}function Zb(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}class tk{constructor(){this.members=[]}add(e){Am(this.members,e),e.scheduleRender()}remove(e){if(Sm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function nk(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y,o=(t==null?void 0:t.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:p,skewX:g,skewY:v}=t;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),h&&(i+=`rotateX(${h}deg) `),p&&(i+=`rotateY(${p}deg) `),g&&(i+=`skewX(${g}deg) `),v&&(i+=`skewY(${v}deg) `)}const a=n.x.scale*e.x,l=n.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const ik=(n,e)=>n.depth-e.depth;class rk{constructor(){this.children=[],this.isDirty=!1}add(e){Am(this.children,e),this.isDirty=!0}remove(e){Sm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ik),this.isDirty=!1,this.children.forEach(e)}}function md(n){const e=Tn(n)?n.get():n;return $U(e)?e.toValue():e}function sk(n,e){const t=fo.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(hs(i),n(s-e))};return Xt.read(i,!0),()=>hs(i)}function ok(n){return n instanceof SVGElement&&n.tagName!=="svg"}function ak(n,e,t){const i=Tn(n)?n:Os(n);return i.start(U_("",i,e,t)),i.animation}const dl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},gd=typeof window!="undefined"&&window.MotionDebug!==void 0,Q_=["","X","Y","Z"],lk={visibility:"hidden"},$b=1e3;let uk=0;function q_(n,e,t,i){const{latestValues:r}=e;r[n]&&(t[n]=r[n],e.setStaticValue(n,0),i&&(i[n]=0))}function eR(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=YT(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:s}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",Xt,!(r||s))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&eR(i)}function tR({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=uk++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gd&&(dl.totalNodes=dl.resolvedTargetDeltas=dl.recalculatedProjection=0),this.nodes.forEach(dk),this.nodes.forEach(vk),this.nodes.forEach(yk),this.nodes.forEach(hk),gd&&window.MotionDebug.record(dl)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=sk(p,250),Tm.hasAnimatedSinceResize&&(Tm.hasAnimatedSinceResize=!1,this.nodes.forEach(iR))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||d.getDefaultTransition()||Mk,{onLayoutAnimationStart:x,onLayoutAnimationComplete:m}=d.getProps(),_=!this.targetLayout||!Qb(this.targetLayout,v)||g,A=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||A||p&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,A);const w=Ct(_e({},d_(S,"layout")),{onPlay:x,onComplete:m});(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else p||iR(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,hs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(xk),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&eR(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const I=w/1e3;rR(h.x,o.x,I),rR(h.y,o.y,I),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hd(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ak(this.relativeTarget,this.relativeTargetOrigin,p,I),A&&ek(this.relativeTarget,A)&&(this.isProjectionDirty=!1),A||(A=On()),jr(A,this.relativeTarget)),S&&(this.animationValues=d,KO(d,u,this.latestValues,I,_,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(hs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xt.update(()=>{Tm.hasAnimatedSinceResize=!0,this.currentAnimation=ak(0,$b,Ct(_e({},o),{onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($b),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&uR(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||On();const h=Cr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const p=Cr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}jr(a,l),Ku(a,d),dd(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new tk),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&q_("z",o,u,this.animationValues);for(let d=0;d{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(nR),this.root.sharedNodes.clear()}}}function ck(n){n.updateLayout()}function fk(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?Xr(h=>{const p=o?t.measuredBox[h]:t.layoutBox[h],g=Cr(p);p.min=i[h].min,p.max=p.min+g}):uR(s,t.layoutBox,i)&&Xr(h=>{const p=o?t.measuredBox[h]:t.layoutBox[h],g=Cr(i[h]);p.max=p.min+g,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[h].max=n.relativeTarget[h].min+g)});const a=ju();dd(a,i,t.layoutBox);const l=ju();o?dd(l,n.applyTransform(r,!0),t.measuredBox):dd(l,i,t.layoutBox);const u=!Jb(a);let d=!1;if(!n.resumeFrom){const h=n.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:g}=h;if(p&&g){const v=On();hd(v,t.layoutBox,p.layoutBox);const S=On();hd(S,i,g.layoutBox),Qb(v,S)||(d=!0),h.options.layoutRoot&&(n.relativeTarget=S,n.relativeTargetOrigin=v,n.relativeParent=h)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function dk(n){gd&&dl.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function hk(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function pk(n){n.clearSnapshot()}function nR(n){n.clearMeasurements()}function mk(n){n.isLayoutDirty=!1}function gk(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function iR(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function vk(n){n.resolveTargetDelta()}function yk(n){n.calcProjection()}function xk(n){n.resetSkewAndRotation()}function _k(n){n.removeLeadSnapshot()}function rR(n,e,t){n.translate=Ln(e.translate,0,t),n.scale=Ln(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function sR(n,e,t,i){n.min=Ln(e.min,t.min,i),n.max=Ln(e.max,t.max,i)}function Ak(n,e,t,i){sR(n.x,e.x,t.x,i),sR(n.y,e.y,t.y,i)}function Sk(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Mk={duration:.45,ease:[.4,0,.1,1]},oR=n=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),aR=oR("applewebkit/")&&!oR("chrome/")?Math.round:xi;function lR(n){n.min=aR(n.min),n.max=aR(n.max)}function wk(n){lR(n.x),lR(n.y)}function uR(n,e,t){return n==="position"||n==="preserve-aspect"&&!EO(qb(e),qb(t),.2)}function Ek(n){var e;return n!==n.root&&((e=n.scroll)===null||e===void 0?void 0:e.wasRoot)}const Ck=tR({attachResizeListener:(n,e)=>ho(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Z_={current:void 0},cR=tR({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!Z_.current){const n=new Ck({});n.mount(window),n.setOptions({layoutScroll:!0}),Z_.current=n}return Z_.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),Tk={pan:{Feature:HO},drag:{Feature:zO,ProjectionNode:cR,MeasureLayout:Fb}};function fR(n,e){const t=e?"pointerenter":"pointerleave",i=e?"onHoverStart":"onHoverEnd",r=(s,o)=>{if(s.pointerType==="touch"||V_())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e);const l=a[i];l&&Xt.postRender(()=>l(s,o))};return ps(n.current,t,r,{passive:!n.getProps()[i]})}class bk extends aa{mount(){this.unmount=Us(fR(this.node,!0),fR(this.node,!1))}unmount(){}}class Rk extends aa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Us(ho(this.node.current,"focus",()=>this.onFocus()),ho(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dR=(n,e)=>e?n===e?!0:dR(n,e.parentElement):!1;function $_(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,wm(t))}class Pk extends aa{constructor(){super(...arguments),this.removeStartListeners=xi,this.removeEndListeners=xi,this.removeAccessibleListeners=xi,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),s=ps(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:d,globalTapTarget:h}=this.node.getProps(),p=!h&&!dR(this.node.current,a.target)?d:u;p&&Xt.update(()=>p(a,l))},{passive:!(i.onTap||i.onPointerUp)}),o=ps(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Us(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||$_("up",(l,u)=>{const{onTap:d}=this.node.getProps();d&&Xt.postRender(()=>d(l,u))})};this.removeEndListeners(),this.removeEndListeners=ho(this.node.current,"keyup",o),$_("down",(a,l)=>{this.startPress(a,l)})},t=ho(this.node.current,"keydown",e),i=()=>{this.isPressing&&$_("cancel",(s,o)=>this.cancelPress(s,o))},r=ho(this.node.current,"blur",i);this.removeAccessibleListeners=Us(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&Xt.postRender(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!V_()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&Xt.postRender(()=>i(e,t))}mount(){const e=this.node.getProps(),t=ps(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=ho(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Us(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const eA=new WeakMap,tA=new WeakMap,Ik=n=>{const e=eA.get(n.target);e&&e(n)},Bk=n=>{n.forEach(Ik)};function Lk(t){var i=t,{root:n}=i,e=Wn(i,["root"]);const r=n||document;tA.has(r)||tA.set(r,{});const s=tA.get(r),o=JSON.stringify(e);return s[o]||(s[o]=new IntersectionObserver(Bk,_e({root:n},e))),s[o]}function Dk(n,e,t){const i=Lk(e);return eA.set(n,t),i.observe(n),()=>{eA.delete(n),i.unobserve(n)}}const Fk={some:0,all:1};class Nk extends aa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Fk[r]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=u?d:h;p&&p(l)};return Dk(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(Uk(e,t))&&this.startObserver()}unmount(){}}function Uk({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const Ok={inView:{Feature:Nk},tap:{Feature:Pk},focus:{Feature:Rk},hover:{Feature:bk}},kk={layout:{ProjectionNode:cR,MeasureLayout:Fb}},Rm=pe.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),Pm=pe.createContext({}),nA=typeof window!="undefined",Im=nA?pe.useLayoutEffect:pe.useEffect,hR=pe.createContext({strict:!1});let pR=!1;function zk(n,e,t,i,r){var s;const{visualElement:o}=pe.useContext(Pm),a=pe.useContext(hR),l=pe.useContext(K_),u=pe.useContext(Rm).reducedMotion,d=pe.useRef();i=i||a.renderer,!d.current&&i&&(d.current=i(n,{visualState:e,parent:o,props:t,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u}));const h=d.current,p=pe.useContext(Lb);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&Gk(d.current,t,r,p),pe.useInsertionEffect(()=>{h&&h.update(t,l)});const g=t[KT],v=pe.useRef(!!g&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,g)));return Im(()=>{h&&(h.updateFeatures(),Y_.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),pe.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current=!1,pR||(pR=!0,queueMicrotask(Hk)))}),h}function Hk(){window.MotionHandoffIsComplete=!0}function Gk(n,e,t,i){const{layoutId:r,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:mR(n.parent)),n.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||a&&Xu(a),visualElement:n,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:u})}function mR(n){if(n)return n.options.allowProjection!==!1?n.projection:mR(n.parent)}function Vk(n,e,t){return pe.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):Xu(t)&&(t.current=i))},[e])}function Bm(n){return td(n.animate)||f_.some(e=>nd(n[e]))}function gR(n){return!!(Bm(n)||n.variants)}function Wk(n,e){if(Bm(n)){const{initial:t,animate:i}=n;return{initial:t===!1||nd(t)?t:void 0,animate:nd(i)?i:void 0}}return n.inherit!==!1?e:{}}function Xk(n){const{initial:e,animate:t}=Wk(n,pe.useContext(Pm));return pe.useMemo(()=>({initial:e,animate:t}),[vR(e),vR(t)])}function vR(n){return Array.isArray(n)?n.join(" "):n}const yR={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Yu={};for(const n in yR)Yu[n]={isEnabled:e=>yR[n].some(t=>!!e[t])};function jk(n){for(const e in n)Yu[e]=_e(_e({},Yu[e]),n[e])}const Jk=Symbol.for("motionComponentSymbol");function xR({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&jk(n);function s(a,l){let u;const d=Ct(_e(_e({},pe.useContext(Rm)),a),{layoutId:Kk(a)}),{isStatic:h}=d,p=Xk(a),g=i(a,h);if(!h&&nA){Yk();const v=Qk(d);u=v.MeasureLayout,p.visualElement=zk(r,g,d,e,v.ProjectionNode)}return me.jsxs(Pm.Provider,{value:p,children:[u&&p.visualElement?me.jsx(u,_e({visualElement:p.visualElement},d)):null,t(r,a,Vk(g,p.visualElement,l),g,h,p.visualElement)]})}const o=pe.forwardRef(s);return o[Jk]=r,o}function Kk({layoutId:n}){const e=pe.useContext(Bb).id;return e&&n!==void 0?e+"-"+n:n}function Yk(n,e){pe.useContext(hR).strict}function Qk(n){const{drag:e,layout:t}=Yu;if(!e&&!t)return{};const i=_e(_e({},e),t);return{MeasureLayout:e!=null&&e.isEnabled(n)||t!=null&&t.isEnabled(n)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const qk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function iA(n){return typeof n!="string"||n.includes("-")?!1:!!(qk.indexOf(n)>-1||/[A-Z]/u.test(n))}function _R(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const AR=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function SR(n,e,t,i){_R(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(AR.has(r)?r:Mm(r),e.attrs[r])}function MR(n,{layout:e,layoutId:t}){return ia.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!bm[n]||n==="opacity")}function rA(n,e,t){var i;const{style:r}=n,s={};for(const o in r)(Tn(r[o])||e.style&&Tn(e.style[o])||MR(o,n)||((i=t==null?void 0:t.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return t&&r&&typeof r.willChange=="string"&&(t.applyWillChange=!1),s}function wR(n,e,t){const i=rA(n,e,t);for(const r in n)if(Tn(n[r])||Tn(e[r])){const s=id.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=n[r]}return i}function Lm(n){const e=pe.useRef(null);return e.current===null&&(e.current=n()),e.current}function Zk({applyWillChange:n=!1,scrapeMotionValuesFromProps:e,createRenderState:t,onMount:i},r,s,o,a){const l={latestValues:ez(r,s,o,a?!1:n,e),renderState:t()};return i&&(l.mount=u=>i(r,u,l)),l}const sA=n=>(e,t)=>{const i=pe.useContext(Pm),r=pe.useContext(K_),s=()=>Zk(n,e,i,r,t);return t?s():Lm(s)};function $k(n,e){const t=QT(e);t&&Am(n,t)}function ER(n,e,t){const i=Array.isArray(e)?e:[e];for(let s=0;s{for(const _ in x){let A=x[_];if(Array.isArray(A)){const w=v?A.length-1:0;A=A[w]}A!==null&&(o[_]=A)}for(const _ in m)o[_]=m[_]}),l&&(h&&d!==!1&&!td(h)&&ER(n,h,x=>{for(const m in x)$k(a,m)}),a.length&&(o.willChange=a.join(","))),o}const oA=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),CR=()=>Ct(_e({},oA()),{attrs:{}}),TR=(n,e)=>e&&typeof n=="number"?e.transform(n):n,tz={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nz=id.length;function iz(n,e,t){let i="",r=!0;for(let s=0;stypeof n=="string"&&n.toLowerCase()==="svg",lz={useVisualState:sA({scrapeMotionValuesFromProps:wR,createRenderState:CR,onMount:(n,e,{renderState:t,latestValues:i})=>{Xt.read(()=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch(r){t.dimensions={x:0,y:0,width:0,height:0}}}),Xt.render(()=>{lA(t,i,uA(e.tagName),n.transformTemplate),SR(e,t)})}})},uz={useVisualState:sA({applyWillChange:!0,scrapeMotionValuesFromProps:rA,createRenderState:oA})};function RR(n,e,t){for(const i in e)!Tn(e[i])&&!MR(i,t)&&(n[i]=e[i])}function cz({transformTemplate:n},e){return pe.useMemo(()=>{const t=oA();return aA(t,e,n),Object.assign({},t.vars,t.style)},[e])}function fz(n,e){const t=n.style||{},i={};return RR(i,t,n),Object.assign(i,cz(n,e)),i}function dz(n,e){const t={},i=fz(n,e);return n.drag&&n.dragListener!==!1&&(t.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(t.tabIndex=0),t.style=i,t}const hz=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Dm(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||hz.has(n)}let PR=n=>!Dm(n);function pz(n){n&&(PR=e=>e.startsWith("on")?!Dm(e):n(e))}try{pz(require("@emotion/is-prop-valid").default)}catch(n){}function IR(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(PR(r)||t===!0&&Dm(r)||!e&&!Dm(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function mz(n,e,t,i){const r=pe.useMemo(()=>{const s=CR();return lA(s,e,uA(i),n.transformTemplate),Ct(_e({},s.attrs),{style:_e({},s.style)})},[e]);if(n.style){const s={};RR(s,n.style,n),r.style=_e(_e({},s),r.style)}return r}function gz(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(iA(t)?mz:dz)(i,s,o,t),u=IR(i,typeof t=="string",n),d=t!==pe.Fragment?Ct(_e(_e({},u),l),{ref:r}):{},{children:h}=i,p=pe.useMemo(()=>Tn(h)?h.get():h,[h]);return pe.createElement(t,Ct(_e({},d),{children:p}))}}function vz(n,e){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const s=iA(i)?lz:uz,o=Ct(_e({},s),{preloadedFeatures:n,useRender:gz(r),createVisualElement:e,Component:i});return xR(o)}}const cA={current:null},BR={current:!1};function yz(){if(BR.current=!0,!!nA)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>cA.current=n.matches;n.addListener(e),e()}else cA.current=!1}function xz(n,e,t){for(const i in e){const r=e[i],s=t[i];if(Tn(r))n.addValue(i,r);else if(Tn(s))n.addValue(i,Os(r,{owner:n}));else if(s!==r)if(n.hasValue(i)){const o=n.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=n.getStaticValue(i);n.addValue(i,Os(o!==void 0?o:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const LR=new WeakMap,_z=[...aT,bi,oa],Az=n=>_z.find(oT(n)),DR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Sz=f_.length;class FR{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=x_,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,Xt.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget=_e({},l),this.initialValues=t.initial?_e({},l):{},this.renderState=u,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Bm(t),this.isVariantNode=gR(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const p=this.scrapeMotionValuesFromProps(t,{},this),{willChange:d}=p,h=Wn(p,["willChange"]);for(const g in h){const v=h[g];l[g]!==void 0&&Tn(v)&&v.set(l[g],!1)}}mount(e){this.current=e,LR.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),BR.current||yz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:cA.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){LR.delete(this.current),this.projection&&this.projection.unmount(),hs(this.notifyUpdate),hs(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=ia.has(e),r=t.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Xt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),s(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Yu){const t=Yu[e];if(!t)continue;const{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):On()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;it.variantChildren.delete(e)}addValue(e,t){const i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=Os(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){var i;let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(i=this.getBaseTargetFromProps(this.props,e))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(ZC(r)||qC(r))?r=parseFloat(r):!Az(r)&&oa.test(t)&&(r=yT(e,t)),this.setBaseTarget(e,Tn(r)?r.get():r)),Tn(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=u_(this.props,i,(t=this.presenceContext)===null||t===void 0?void 0:t.custom);o&&(r=o[e])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Tn(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new O_),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class NR extends FR{constructor(){super(...arguments),this.KeyframeResolver=xT}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}}function Mz(n){return window.getComputedStyle(n)}class wz extends NR{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=_R}readValueFromInstance(e,t){if(ia.has(t)){const i=E_(t);return i&&i.default||0}else{const i=Mz(e),r=(eT(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Rb(e,t)}build(e,t,i){aA(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return rA(e,t,i)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Tn(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Ez extends NR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=On}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ia.has(t)){const i=E_(t);return i&&i.default||0}return t=AR.has(t)?t:Mm(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return wR(e,t,i)}build(e,t,i){lA(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,r){SR(e,t,i,r)}mount(e){this.isSVGTag=uA(e.tagName),super.mount(e)}}const Cz=(n,e)=>iA(n)?new Ez(e):new wz(e,{allowProjection:n!==pe.Fragment}),Tz=vz(_e(_e(_e(_e({},$T),Ok),Tk),kk),Cz),Xi=v3(Tz);function UR(n){const e=Lm(()=>Os(n)),{isStatic:t}=pe.useContext(Rm);if(t){const[,i]=pe.useState(n);pe.useEffect(()=>e.on("change",i),[])}return e}function OR(n,e){const t=UR(e()),i=()=>t.set(e());return i(),Im(()=>{const r=()=>Xt.preRender(i,!1,!0),s=n.map(o=>o.on("change",r));return()=>{s.forEach(o=>o()),hs(i)}}),t}const bz=n=>n&&typeof n=="object"&&n.mix,Rz=n=>bz(n)?n.mix:void 0;function Pz(...n){const e=!Array.isArray(n[0]),t=e?0:-1,i=n[0+t],r=n[1+t],s=n[2+t],o=n[3+t],a=F_(r,s,_e({mixer:Rz(s[0])},o));return e?a(i):a}function Iz(n){fd.current=[],n();const e=OR(fd.current,n);return fd.current=void 0,e}function lr(n,e,t,i){if(typeof n=="function")return Iz(n);const r=typeof e=="function"?e:Pz(e,t,i);return Array.isArray(n)?kR(n,r):kR([n],([s])=>r(s))}function kR(n,e){const t=Lm(()=>[]);return OR(n,()=>{t.length=0;const i=n.length;for(let r=0;r{}),a=()=>{const u=i.current;u&&u.time===0&&u.sample(si.delta),l(),i.current=VU(Ct(_e({keyframes:[r.get(),s.current],velocity:r.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01},e),{onUpdate:o.current}))},l=()=>{i.current&&i.current.stop()};return pe.useInsertionEffect(()=>r.attach((u,d)=>t?d(u):(s.current=u,o.current=d,Xt.update(a),r.get()),l),[JSON.stringify(e)]),Im(()=>{if(Tn(n))return n.on("change",u=>r.set(zR(u)))},[r]),r}function Bz(n,e,t){return typeof n=="string"?n=document.querySelectorAll(n):n instanceof Element&&(n=[n]),Array.from(n||[])}const Nm=new WeakMap;let la;function Lz(n,e){if(e){const{inlineSize:t,blockSize:i}=e[0];return{width:t,height:i}}else return n instanceof SVGElement&&"getBBox"in n?n.getBBox():{width:n.offsetWidth,height:n.offsetHeight}}function Dz({target:n,contentRect:e,borderBoxSize:t}){var i;(i=Nm.get(n))===null||i===void 0||i.forEach(r=>{r({target:n,contentSize:e,get size(){return Lz(n,t)}})})}function Fz(n){n.forEach(Dz)}function Nz(){typeof ResizeObserver!="undefined"&&(la=new ResizeObserver(Fz))}function Uz(n,e){la||Nz();const t=Bz(n);return t.forEach(i=>{let r=Nm.get(i);r||(r=new Set,Nm.set(i,r)),r.add(e),la==null||la.observe(i)}),()=>{t.forEach(i=>{const r=Nm.get(i);r==null||r.delete(e),r!=null&&r.size||la==null||la.unobserve(i)})}}const Um=new Set;let vd;function Oz(){vd=()=>{const n={width:window.innerWidth,height:window.innerHeight},e={target:window,size:n,contentSize:n};Um.forEach(t=>t(e))},window.addEventListener("resize",vd)}function kz(n){return Um.add(n),vd||Oz(),()=>{Um.delete(n),!Um.size&&vd&&(vd=void 0)}}function zz(n,e){return typeof n=="function"?kz(n):Uz(n,e)}const Hz=50,HR=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),Gz=()=>({time:0,x:HR(),y:HR()}),Vz={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function GR(n,e,t,i){const r=t[e],{length:s,position:o}=Vz[e],a=r.current,l=t.time;r.current=n[`scroll${o}`],r.scrollLength=n[`scroll${s}`]-n[`client${s}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=Wu(0,r.scrollLength,r.current);const u=i-l;r.velocity=u>Hz?0:C_(r.current-a,u)}function Wz(n,e,t){GR(n,"x",e,t),GR(n,"y",e,t),e.time=t}function Xz(n,e){const t={x:0,y:0};let i=n;for(;i&&i!==e;)if(i instanceof HTMLElement)t.x+=i.offsetLeft,t.y+=i.offsetTop,i=i.offsetParent;else if(i.tagName==="svg"){const r=i.getBoundingClientRect();i=i.parentElement;const s=i.getBoundingClientRect();t.x+=r.left-s.left,t.y+=r.top-s.top}else if(i instanceof SVGGraphicsElement){const{x:r,y:s}=i.getBBox();t.x+=r,t.y+=s;let o=null,a=i.parentNode;for(;!o;)a.tagName==="svg"&&(o=a),a=i.parentNode;i=o}else break;return t}const jz={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},fA={start:0,center:.5,end:1};function VR(n,e,t=0){let i=0;if(n in fA&&(n=fA[n]),typeof n=="string"){const r=parseFloat(n);n.endsWith("px")?i=r:n.endsWith("%")?n=r/100:n.endsWith("vw")?i=r/100*document.documentElement.clientWidth:n.endsWith("vh")?i=r/100*document.documentElement.clientHeight:n=r}return typeof n=="number"&&(i=e*n),t+i}const Jz=[0,0];function Kz(n,e,t,i){let r=Array.isArray(n)?n:Jz,s=0,o=0;return typeof n=="number"?r=[n,n]:typeof n=="string"&&(n=n.trim(),n.includes(" ")?r=n.split(" "):r=[n,fA[n]?n:"0"]),s=VR(r[0],t,i),o=VR(r[1],e),s-o}const Yz={x:0,y:0};function Qz(n){return"getBBox"in n&&n.tagName!=="svg"?n.getBBox():{width:n.clientWidth,height:n.clientHeight}}function qz(n,e,t){const{offset:i=jz.All}=t,{target:r=n,axis:s="y"}=t,o=s==="y"?"height":"width",a=r!==n?Xz(r,n):Yz,l=r===n?{width:n.scrollWidth,height:n.scrollHeight}:Qz(r),u={width:n.clientWidth,height:n.clientHeight};e[s].offset.length=0;let d=!e[s].interpolate;const h=i.length;for(let p=0;pZz(n,i.target,t),update:r=>{Wz(n,t,r),(i.offset||i.target)&&qz(n,t,i)},notify:()=>e(t)}}const yd=new WeakMap,WR=new WeakMap,dA=new WeakMap,XR=n=>n===document.documentElement?window:n;function eH(n,i={}){var r=i,{container:e=document.documentElement}=r,t=Wn(r,["container"]);let s=dA.get(e);s||(s=new Set,dA.set(e,s));const o=Gz(),a=$z(e,n,o,t);if(s.add(a),!yd.has(e)){const u=()=>{for(const v of s)v.measure()},d=()=>{for(const v of s)v.update(si.timestamp)},h=()=>{for(const v of s)v.notify()},p=()=>{Xt.read(u,!1,!0),Xt.read(d,!1,!0),Xt.update(h,!1,!0)};yd.set(e,p);const g=XR(e);window.addEventListener("resize",p,{passive:!0}),e!==document.documentElement&&WR.set(e,zz(e,p)),g.addEventListener("scroll",p,{passive:!0})}const l=yd.get(e);return Xt.read(l,!1,!0),()=>{var u;hs(l);const d=dA.get(e);if(!d||(d.delete(a),d.size))return;const h=yd.get(e);yd.delete(e),h&&(XR(e).removeEventListener("scroll",h),(u=WR.get(e))===null||u===void 0||u(),window.removeEventListener("resize",h))}}function jR(n,e){R3(!!(!e||e.current))}const tH=()=>({scrollX:Os(0),scrollY:Os(0),scrollXProgress:Os(0),scrollYProgress:Os(0)});function JR(r={}){var s=r,{container:n,target:e,layoutEffect:t=!0}=s,i=Wn(s,["container","target","layoutEffect"]);const o=Lm(tH);return(t?Im:pe.useEffect)(()=>(jR("target",e),jR("container",n),eH(({x:l,y:u})=>{o.scrollX.set(l.current),o.scrollXProgress.set(l.progress),o.scrollY.set(u.current),o.scrollYProgress.set(u.progress)},Ct(_e({},i),{container:(n==null?void 0:n.current)||void 0,target:(e==null?void 0:e.current)||void 0}))),[n,e,JSON.stringify(i.offset)]),o}let hA=class extends pe.Component{constructor(){super(...arguments);JD(this,"state",{hasError:!1})}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,i){console.error("Uncaught error:",t,i)}render(){return this.state.hasError?this.props.fallback:this.props.children}};const Jr=(n,e,t,i)=>{const r=n.target,s={event:"custEv_contentClick",blade:{id:e,name:"sf/open",source:"www",variant:"dc-overview-refresh",position:i||1,state:"rendered",module:{id:e,name:t,link:{url:r.getAttribute("href"),text:r.innerText,elementType:r.tagName}}}};console.log("-- CLICK TRACKING QA --"),console.log(s),window.dataLayer.push(_e({},s))},KR=({position:n,x:e})=>n==="right"?me.jsx(Xi.div,{initial:{opacity:0},animate:{opacity:1},style:{x:e},className:"data-dust absolute right-[8%] top-[-8%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:me.jsx("img",{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/3D-DataDust-1.png?w=100",alt:""})}):me.jsx(Xi.div,{initial:{opacity:0},animate:{opacity:1},style:{x:e},className:"data-dust absolute visible left-[2%] top-[22%] z-30 w-[60px] sm:w-[160px] max-sm:hidden",children:me.jsx("img",{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/3D-DataDust-1.png?w=100",alt:""})});var YR={exports:{}};(function(n,e){(function(i,r){n.exports=r()})(window,function(){return function(t){var i={};function r(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=i,r.d=function(s,o,a){r.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:a})},r.r=function(s){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,o){if(o&1&&(s=r(s)),o&8||o&4&&typeof s=="object"&&s&&s.__esModule)return s;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),o&2&&typeof s!="string")for(var l in s)r.d(a,l,function(u){return s[u]}.bind(null,l));return a},r.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(o,"a",o),o},r.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},r.p="",r(r.s=6)}([function(t,i){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(s){typeof window=="object"&&(r=window)}t.exports=r},function(t,i,r){function s(){return s=Object.assign||function(w){for(var I=1;I-1&&(x=x.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var m=x.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),_=this.extractLocation(m.pop()),A=m.join(" ")||void 0,w=["eval",""].indexOf(_[0])>-1?void 0:_[0];return new u({functionName:A,fileName:w,lineNumber:_[1],columnNumber:_[2],source:x})},this)},parseFFOrSafari:function(v){var S=v.stack.split(` `).filter(function(x){return!x.match(p)},this);return S.map(function(x){if(x.indexOf(" > eval")>-1&&(x=x.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),x.indexOf("@")===-1&&x.indexOf(":")===-1)return new u({functionName:x});var m=/((.*".+"[^@]*)?[^@]*)(?:@)/,_=x.match(m),A=_&&_[1]?_[1]:void 0,w=this.extractLocation(x.replace(m,""));return new u({functionName:A,fileName:w[0],lineNumber:w[1],columnNumber:w[2],source:x})},this)},parseOpera:function(v){return!v.stacktrace||v.message.indexOf(` `)>-1&&v.message.split(` `).length>v.stacktrace.split(` `).length?this.parseOpera9(v):v.stack?this.parseOpera11(v):this.parseOpera10(v)},parseOpera9:function(v){for(var S=/Line (\d+).*script (?:in )?(\S+)/i,x=v.message.split(` `),m=[],_=2,A=x.length;_/,"$2").replace(/\([^\)]*\)/g,"")||void 0,I;A.match(/\(([^\)]*)\)/)&&(I=A.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var P=I===void 0||I==="[arguments not available]"?void 0:I.split(",");return new u({functionName:w,args:P,fileName:_[0],lineNumber:_[1],columnNumber:_[2],source:x})},this)}}})},function(t,i,r){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function o(a){var l=a===void 0?{emit:!1,logger:console.log}:a,u=l.emit,d=l.logger;this.emit=u,this.externalLogger=d,this.buffer=[],this.customLevel={},this.error=this.setLevel(1),this.warn=this.setLevel(2),this.info=this.setLevel(3),this.log=this.setLevel(4)}return o.prototype.getLogs=function(a){return typeof a=="function"?this.buffer.filter(function(l){return l.level===a.level}):a?this.buffer.filter(function(l){return l.level===a}):this.buffer},o.prototype.setLevel=function(a){var l=this,u=function(){for(var d=[],h=0;h '+k+" ":k};return'
'+L('')+"
"},Ke=function(b){var C=document.createElement("script");return C.type="application/ld+json",C.text=JSON.stringify(b),C},kt=function(b){return new u(function(C,L){return Y({error:L,success:C,url:""+wt()+b+Me,uuid:"style_"+b})})},Et=function(b){return new u(function(C,L){return Y({error:L,success:C,url:""+wt()+b+fe,uuid:"integrations_"+b})})},et=function(b){return new u(function(C,L){return Y({error:L,success:C,url:""+wt()+b+re,uuid:"details_"+b})})},Tt=function(b,C){return new u(function(L,k){var j=encodeURIComponent(C),ue=""+wt()+b+"/contact/"+j+"/marketoContact.js";Y({error:k,success:L,url:ue,uuid:"marketoContact_"+b})})},Ft=function(b){var C=b.error,L=b.url,k=b.requestUuid,j=document.createElement("script");return j.type="application/javascript",j.onerror=C,j.src=L+"?callback=window.VidyardV4.jsonp."+k+".done",j.setAttribute("data-playbackurl",$e()),document.body.appendChild(j),j},sn={},Y=function(b){var C=b.url,L=b.uuid,k=b.success,j=b.error,ue=L.replace(/-/g,""),de=Ft({error:j,url:C,requestUuid:ue}),Fe=I(function(Je){k(Je),de.parentNode.removeChild(de)});sn[ue]=sn[ue]||[],sn[ue].push(Fe),window.VidyardV4.jsonp[ue]={done:function(Je){sn[ue].forEach(function(gt){return gt(Je)})}}},Le={errors:{placeholder:"Cannot render the player, check the placeholder Image"}},xe=function(b,C){var L={};for(var k in b)Object.prototype.hasOwnProperty.call(b,k)&&C.indexOf(k)<0&&(L[k]=b[k]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,k=Object.getOwnPropertySymbols(b);j=ot*2;z(L.container,"playlist-open",pt)}k("getStyle sent"),kt(L.uuid).then(function(pt){k("getStyle received: "+JSON.stringify(pt));var Nn=pt.pl===1&&C.playlist_always_open!=="0"||C.playlist_always_open==="1";Nn?(L.iframe.parentElement.setAttribute("data-pl","true"),d("resize","onresize",gt),gt()):L.iframe.parentElement.setAttribute("data-pl","false")}).catch(function(pt){k("getStyle failed, likely a network error")})},wn=Vt,Kn=function(b){b===void 0&&(b=document.body);for(var C=0,L=Array.from(b.children);C=0}).sort(ne)},Xe=["button:enabled:not([readonly])","select:enabled:not([readonly])","textarea:enabled:not([readonly])","input:enabled:not([readonly])","a[href]","area[href]","iframe","object","embed","[tabindex]","[contenteditable]","[autofocus]"],nt=Xe.join(","),Ze=function(C,L){return C.reduce(function(k,j){return k.concat(Gn(j.querySelectorAll(nt)),j.parentNode?Gn(j.parentNode.querySelectorAll(Xe.join(","))).filter(function(ue){return ue===j}):[])},[])},ht=function(C){var L=C.querySelectorAll("["+Ra+"]");return Gn(L).map(function(k){return Ze([k])}).reduce(function(k,j){return k.concat(j)},[])},yt=function(C){return!C||!C.getPropertyValue?!1:C.getPropertyValue("display")==="none"||C.getPropertyValue("visibility")==="hidden"},ft=function b(C){return!C||C===document||C.nodeType===Node.DOCUMENT_NODE||!yt(window.getComputedStyle(C,null))&&b(C.parentNode)},Yt=function(C){return!((C.tagName==="INPUT"||C.tagName==="BUTTON")&&(C.type==="hidden"||C.disabled))},ln=function b(C){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return L.push(C),C.parentNode&&b(C.parentNode,L),L},en=function(C,L){for(var k=ln(C),j=ln(L),ue=0;ue=0)return de}return!1},xn=function(C){return Gn(C).filter(function(L){return ft(L)}).filter(function(L){return Yt(L)})},st=function(C,L){return De(xn(Ze(C)),!0)},Ue=function(C){return De(xn(Ze(C)),!1)},fn=function(C){return xn(ht(C))},At=function(C){return C.tagName==="INPUT"&&C.type==="radio"},un=function(C,L){return L.filter(At).filter(function(k){return k.name===C.name}).filter(function(k){return k.checked})[0]||C},Ui=function(C){return C[0]&&C.length>1&&At(C[0])&&C[0].name?un(C[0],C):C[0]},Fn=function(C,L){return C.length>1&&At(C[L])&&C[L].name?C.indexOf(un(C[L],C)):L},Yn=Ui,hn=function(C){return function(L){return!!L.autofocus||L.dataset&&!!L.dataset.autofocus||C.indexOf(L)>=0}},dr=function(C){return C&&C.dataset&&C.dataset.focusGuard},Xs=function(C){return!dr(C)},ci=function(C,L,k,j,ue){var de=C.length,Fe=C[0],Je=C[de-1],gt=dr(k);if(!(C.indexOf(k)>=0)){var pt=L.indexOf(k),Nn=L.indexOf(j||pt),Vn=C.indexOf(j),qt=pt-Nn,Ps=L.indexOf(Fe),Ge=L.indexOf(Je),at=Fn(C,0),bt=Fn(C,de-1);if(pt===-1||Vn===-1)return C.indexOf(ue&&ue.length?Yn(ue):Yn(C));if(!qt&&Vn>=0)return Vn;if(pt<=Ps&>&&Math.abs(qt)>1)return bt;if(pt>=Ps&>&&Math.abs(qt)>1)return at;if(qt&&Math.abs(qt)>1)return Vn;if(pt<=Ps)return bt;if(pt>Ge)return at;if(qt)return Math.abs(qt)>1?Vn:(de+Vn+qt)%de}},Ia=function(C,L,k){var j=Dr(C),ue=Dr(L),de=j[0],Fe=null;return ue.filter(Boolean).forEach(function(Je){Fe=en(Fe||Je,Je)||Fe,k.filter(Boolean).forEach(function(gt){var pt=en(de,gt);pt&&(!Fe||pt.contains(Fe)?Fe=pt:Fe=en(pt,Fe))})}),Fe},qi=function(C){return C.reduce(function(L,k){return L.concat(fn(k))},[])},Yc=function(C,L){var k=new Map;return L.forEach(function(j){return k.set(j.node,j)}),C.map(function(j){return k.get(j)}).filter(Boolean)},NM=function(C,L){var k=document&&document.activeElement,j=Kc(C).filter(Xs),ue=Ia(k||C,C,j),de=st(j).filter(function(Nn){var Vn=Nn.node;return Xs(Vn)});if(!(!de[0]&&(de=Ue(j).filter(function(Nn){var Vn=Nn.node;return Xs(Vn)}),!de[0]))){var Fe=st([ue]).map(function(Nn){var Vn=Nn.node;return Vn}),Je=Yc(Fe,de),gt=Je.map(function(Nn){var Vn=Nn.node;return Vn}),pt=ci(gt,Fe,k,L,gt.filter(hn(qi(j))));return pt===void 0?pt:Je[pt]}},UM=NM,Qc=function(C){C.focus(),C.contentWindow&&C.contentWindow.focus()},Ba=0,Bo=!1,qc=function(b,C){var L=UM(b,C);if(!Bo&&L){if(Ba>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Bo=!0,setTimeout(function(){Bo=!1},1);return}Ba++,Qc(L.node),Ba--}},OM=qc,Mh=0,Zc=null,wh=function(){return document&&document.activeElement===document.body},$l=function(){return wh()||Pa()},kM=function(){var C=!1;if(Mh){var L=Mh;$l()||(L&&!le(L)&&(C=OM(L,Zc)),Zc=document.activeElement)}return C},Eh=function(C){return C.filter(function(L){return L}).slice(-1)[0]},Qt=function(C){Mh=C,C&&kM()},js=[],La=function(C){return Qt(Eh(js))?(C&&C.preventDefault(),!0):!1},n0=function(){document.addEventListener("focusin",La)},zM=function(){document.removeEventListener("focusin",La)},HM={on:function(C){js.length===0&&n0(),js.indexOf(C)<0&&(js.push(C),La())},off:function(C){js=js.filter(function(L){return L!==C}),La(),js.length===0&&zM()}},Qn=HM,Ch=r(1),i0=r.n(Ch);function Th(b,C,L){var k=WM(b),j=$r(L),ue=es(C),de=document.createElement("div");return de.id="vidyard-focusable-element",de.tabIndex=0,j.popbox.appendChild(k.backerElement),j.popbox.appendChild(k.containingDiv),j.popbox.appendChild(ue),Qi.ios()&&Kn(),document.body.appendChild(j.overlayWrapper),document.body.appendChild(de),j.closeContainer.focus(),Qn.on(j.overlayWrapper),i0.a.trap(j.overlayWrapper),setTimeout(function(){j.overlayWrapper.style.opacity="1",j.overlayWrapper.style.filter="alpha(opacity=100)"},0),{container:k,lightbox:j}}function GM(b){var C=document.getElementById("vidyard-content-fixed"),L=document.getElementById("vidyard-focusable-element"),k=document.getElementById("vidyard-overlay"),j=document.getElementById("vidyard-overlay-wrapper"),ue=document.getElementById("vidyard-popbox");if(!(!C||!k||!j||!ue)){L&&L.parentNode.removeChild(L),Qn.off(j),i0.a.untrap(j),j.style.opacity="0",j.style.filter="alpha(opacity=0)";var de=function(){j.parentNode.removeChild(j)};Qi.ios()&&Jt(),setTimeout(de,Ce*1e3)}}function $c(b){b.style.opacity="1"}function $r(b){var C=document.createElement("div"),L=document.createElement("div"),k=document.createElement("div"),j=document.createElement("div"),ue=VM().closeContainer;return C.id="vidyard-overlay",C.setAttribute("aria-hidden","true"),C.style.display="block",L.id="vidyard-content-fixed",L.setAttribute("aria-label","media player lightbox"),L.setAttribute("role","dialog"),L.style.display="block",k.id="vidyard-popbox",j.id="vidyard-overlay-wrapper",j.style.display="block",L.appendChild(k),j.appendChild(C),j.appendChild(ue),j.appendChild(L),b&&(C.style.zIndex=""+b,L.style.zIndex=""+(b+2),ue.style.zIndex=""+(b+1)),{closeContainer:ue,contentFixed:L,overlay:C,overlayWrapper:j,popbox:k}}function VM(){var b=document.createElement("div"),C=document.createElement("div");return b.className="vidyard-close-container",b.setAttribute("aria-label","Close Player"),b.setAttribute("role","button"),b.setAttribute("tabindex","0"),C.className="vidyard-close-x",document.documentMode<9&&(C.className+=" simple-close",C.innerHTML="×"),b.appendChild(C),{closeButton:C,closeContainer:b}}function WM(b){var C=document.createElement("div");C.className="vidyard-lightbox-content-backer";var L=document.createElement("div");L.innerHTML=b;var k=L.getElementsByTagName("div")[0];k.style.position="absolute",k.style.height="100%",k.style.width="100%",k.style.zIndex="2";var j=L.getElementsByTagName("iframe")[0],ue=j.parentNode;return ue.style.position="static",ue.style.paddingBottom="0",j.style.opacity="1",setTimeout(function(){C.style.opacity="1",C.style.filter="alpha(opacity=100)"},0),{backerElement:C,containerElement:L,containingDiv:k,iframe:j}}function es(b){var C=x("vidyard-lightbox-image","img",b)[0].cloneNode();return C.className="",C.id="vidyard-popbox-constraint",C.alt="",C.setAttribute("aria-hidden","true"),C}var Fr,hr={};function bh(b){var C=x("vidyard-lightbox-centering","div",b.container)[0];b.player.showLightbox=function(){ve.setLevel(b.player.uuid)("show lightbox"),r0({container:b.container,iframe:b.iframe,overlayZindex:b.overlayZindex,player:b.player})},b.player.hideLightbox=function(){return Ai(b.player)},d("click","onclick",b.player.showLightbox,C),d("keydown","onkeydown",P(function(L){L.preventDefault(),b.player.showLightbox(L)}),C)}function r0(b){if(!(!b.iframe||document.getElementById("vidyard-overlay"))){Fr=document.activeElement;var C=Th(b.iframe,b.container,b.overlayZindex);b.player.iframe=C.container.iframe,b.player.on("metadata",function de(Fe){var Je=Fe[0];b.player.iframe.title=Je.name,b.player.off("metadata",de)});var L=b.player.uuid,k=C.container.iframe,j=ef(k,L,b.player),ue=jM(k,L);hr.iframeLoaded=d("load","onload",j,C.container.iframe),hr.messageHandler=d("message","onmessage",H(function(de){j(),ue(),XM(de,b.player)}),window),hr.overlayClick=d("click","onclick",function(){return Ai(b.player)},C.lightbox.overlayWrapper),hr.fixedClick=d("click","onclick",function(){return Ai(b.player)},C.lightbox.contentFixed),hr.closeKeyPress=d("keydown","onkeydown",P(function(){return Ai(b.player)}),C.lightbox.closeContainer),hr.responsivePlayerSize=d("resize","onresize",s0,window)}}function s0(){var b=document.getElementById("vidyard-popbox-constraint"),C=parseFloat((window.innerHeight/window.innerWidth*100).toFixed(2)),L=parseFloat(m(b)),k=C
video thumbnail
'}var Ph=function(b){var C=b.dataParams,L=b.player,k=ve.setLevel(C.uuid);k("injecting lighbox embed"),L.placeholder.style.display="none";var j={ratio:m(L.placeholder)},ue=Pe(C,j),de={maxHeight:C.height?parseInt(C.height,10):null,maxWidth:C.width?parseInt(C.width,10):null,ratio:m(L.placeholder)};tf(L.container,C,de),bh({container:L.container,iframe:ue,overlayZindex:C.overlayZindex,player:L}),k("getStyle sent"),kt(L.uuid).then(function(Fe){k("getStyle received: "+JSON.stringify(Fe)),Da(Fe,L.container)}).catch(function(Fe){k("getStyle failed, likely a network error")})},o0=Ph,Ih=/(vidyard|vystaging|hubspot)\.com$/,Bh=function(b,C,L){if(L===void 0&&(L=!1),!(!L&&(!C||!C.hasBacklink||Ih.test(document.location.host)))){var k=document.createElement("a"),j=document.createElement("span"),ue=document.createElement("img");ue.src="https://cdn.vidyard.com/client-logos/vidyard.png",ue.id="backlink-icon",ue.alt="Vidyard Logo",j.id="backlink-text",j.textContent="Powered by Vidyard",k.id="backlink",k.appendChild(ue),k.appendChild(j),k.href=C.backlinkURL,k.rel="nofollow",k.target="_blank",k.setAttribute("aria-label","Link to Vidyard"),k.dataset.testid="backlink",d("click","onclick",function(){var de={data:{event:"Acquisition - Clicked the Backlink"},event:"sendMetricsEvent",uuid:b.uuid};Mt(de,"https://"+$e(),b.iframe)},k),b.container.appendChild(k)}},Fa=Bh;function pr(b){var C=window.VidyardV4.integrations,L=ve.setLevel(b.uuid),k=C.getCookie("marketo");k&&(L("getMarketoLead sent"),Tt(b.uuid,k).then(F).then(function(j){L("getMarketoLead received: "+j),b.on("ready",function(){C.addKnownVisitor("marketo",j,b.org)})}).catch(function(){ve.warn("Invalid Marketo cookie")})),L("getIntegrations"),Et(b.uuid).then(function(j){L("getIntegrations received: "+JSON.stringify(j)),b.on("ready",function(){b._tmpOrg=j,C.updatePlayer(b)})}).catch(function(j){L("getIntegrations failed, likely a network error")})}function ts(b){var C=ve.setLevel(b);return C("getSEO sent"),et(b).then(function(L){if(C("getSEO: "+JSON.stringify(L)),!g(L)){var k=Ke(L);document.getElementsByTagName("head")[0].appendChild(k)}return L}).catch(function(L){C("getSEO failed, likely a network error")})}var Js=function(b,C){var L=document.createElement("div");L.className="vidyard-player-container",L.setAttribute("uuid",b);var k=L.style;return k.margin="auto",k.width="100%",k.height="auto",k.overflow="hidden",k.display="block",C.type==="inline"&&(k.maxWidth=C.width?C.width+"px":"",k.maxHeight=C.height?C.height+"px":""),L},Lh=Js,a0=function(){function b(C){var L=this;this.disable_popouts=1;var k=ge(q(C));Object.keys(k).forEach(function(de){L[de]=k[de]}),this.type!=="inline"&&this.type!=="lightbox"&&(_("Invalid Vidyard player embed type, defaulting to inline.","warn"),this.type="inline"),this.v=te,this.disable_popouts=1,this.custom_id=this.custom_id||$("vycustom_id"),this.vyemail=this.vyemail||$("vyemail"),this.vysfid=this.vysfid||$("vysfid"),this.vyetoken=this.vyetoken||$("vyetoken");var j=$("vyac"),ue=$("vyplayer");j&&ue&&ue===this.uuid?this.access_code=j:j&&ue&&_("Invalid Vidyard player access code.","warn")}return b.prototype.toQueryString=function(){var C="?",L;for(L in this)this.hasOwnProperty(L)&&(L==="height"||L==="uuid"||L==="width"||this[L]!==void 0&&(C+=C!=="?"?"&":"",C+=encodeURIComponent(L)+"="+encodeURIComponent(this[L])));return C==="?"?"":C},b}(),ns=a0;function Ks(b){b===void 0&&(b=x("vidyard-player-embed","img"));for(var C=0,L=b;C-1&&this._callbackStore[C].splice(j,1)}else this._callbackStore[C]=[]},b.prototype.ready=function(){return this._ready},b.prototype.play=function(){this._message({event:"play"})},b.prototype.pause=function(){this._message({event:"pause"})},b.prototype.resume=function(){this._message({event:"resume"})},b.prototype.seek=function(C){this._message({event:"seek",position:C})},b.prototype.setVolume=function(C){this._message({event:"setVolume",newVolume:C})},b.prototype.setPlaybackSpeed=function(C){this._message({event:"setPlaybackSpeed",speed:C})},b.prototype.playChapter=function(C){_("playChapter() is deprecated. We recommend to use playVideoAtIndex() instead."),this.playVideoAtIndex(C)},b.prototype.playVideoAtIndex=function(C){this._message({chapter_index:C,event:"playChapter"})},b.prototype.setAudioTrack=function(C){this._message({audioTrackId:C,event:"setAudioTrack"})},b.prototype.enableCaption=function(C,L){this._message({event:"enableCaption",label:C,language:L})},b.prototype.disableCaption=function(C,L){this._message({event:"disableCaption",label:C,language:L})},b.prototype.consentToGDPR=function(C){this._message({consent:C,event:"consentToGDPR"})},b.prototype.createCta=function(C){this._message({attributes:S({display_once:!1,duration:10,fullscreen:!1,html:"",opacity:1,start:0,width:300},C),event:"createCta"})},b.prototype.updateCta=function(C,L){this._message({attributes:L,event:"updateCta",id:C})},b.prototype.createVideoSection=function(C,L){this._message({event:"createVideoSection",title:C,milliseconds:L})},b.prototype.updateVideoSection=function(C,L,k){this._message({event:"updateVideoSection",index:C,title:L,milliseconds:k})},b.prototype.deleteVideoSection=function(C){this._message({event:"deleteVideoSection",index:C})},b.prototype.addEvent=function(C){var L=C.start,k=L===void 0?0:L,j=C.duration,ue=j===void 0?1:j,de=C.videoIndex,Fe=C.chapterIndex,Je=C.eventId;if(!Je){_("Missing arguments. Need eventId");return}Fe>=0&&_("Parameter chapterIndex is deprecated. We recommend to use videoIndex instead.");var gt=0;gt=Fe||gt,gt=de||gt,this._message({chapterIndex:gt,duration:ue,event:"addEvent",id:Je,start:k})},b.prototype.getCurrentChapter=function(){return _("getCurrentChapter() is deprecated. We recommend to use getCurrentVideoIndex() instead."),this.getCurrentVideoIndex()},b.prototype.getCurrentVideoIndex=function(){return this.status===null?null:this.status.chapterIndex},b.prototype.currentTime=function(){return this.status===null?null:this.status.currentTime},b.prototype.scrubbing=function(){return this.status===null?null:this.status.scrubbing},b.prototype.toggleFullscreen=function(){var C=this,L=J();if(L){var k=this.iframe[L.requestFullscreen]();k?k.then(function(){C._message({event:"toggleFullscreen"})}):this._message({event:"toggleFullscreen"}),d(L.fullscreenchange,"MSFullscreenChange",function(){document[L.fullscreenElement]||C._message({event:"exitFullscreen"})}),d("message","onmessage",H(function(j){j.event==="fullScreenChange"&&j.params===!1&&document[L.fullscreenElement]&&document[L.exitFullscreen]()}))}else this._message({event:"toggleFullscreen"})},b.prototype.resetPlayer=function(){this._message({event:"resetPlayer"})},b.prototype._message=function(C){if(this.ready()!==!0){_("Player is not ready yet! No messages can be recieved.","error");return}Mt(l0({},C,{uuid:this.uuid}),"https://"+$e(),this.iframe)},b.prototype._updateStatus=function(C){if(typeof C.status=="object"&&(this.status=C.status),typeof C.metadata=="object"&&(this.metadata=C.metadata,this.trigger("metadata",C.metadata)),this.status){if(this.status.currentTime!==this._previousTime&&this._callbackStore.timeupdate)for(var L=0,k=this._callbackStore.timeupdate;Lk?1:0});for(var C=0;C1)){C>=1&&(k.partOfVideoWatched[Math.floor(C)]=1),k.timeWatched=Object.keys(k.partOfVideoWatched).length;for(var ue=k.player.metadata.chapters_attributes[L].video_attributes.length_in_milliseconds,de=Math.floor(ue/1e3),Fe=k.timeWatched/de*100;Fe>=k.thresholds[k.thresholds.length-1];)k.callback({chapter:L,event:k.thresholds.pop(),player:b,videoIndex:L})}}}function p0(b,C,L){mr(b,C,L);var k=function(j){return Do(b,j)};return b.on("timeupdate",k),{player:b,removeEventListeners:function(){b.off("timeupdate",k),Rs(b)}}}function Fh(b,C,L){var k;C===void 0&&(C=[1,25,50,75,90]);var j=[],ue=L?(k={},k[L.uuid]=L,k):Nh(),de=Ua(C),Fe=function(gt){if(ue.hasOwnProperty(gt)&>.length>0&&ue[gt]!==""){var pt=p0(ue[gt],b,de);j.push(pt)}else _(function(){return console.error("Could not attach Progress Events to player "+gt+", make sure to load the Vidyard Player API")})};for(var Je in ue)Fe(Je);return j.length===0&&_(function(){return console.warn("No Vidyard Players found. (include this script below player embed codes)")}),j}function Nh(){try{return window.Vidyard.players()}catch(b){return _(function(){return console.error("The Vidyard Player API must be loaded before this script can execute")}),{}}}function Zi(){for(var b=[],C=0;C=0&&p.splice(F,1)}function _(T){var F=document.createElement("style");return T.attrs.type===void 0&&(T.attrs.type="text/css"),w(F,T.attrs),x(T,F),F}function A(T){var F=document.createElement("link");return T.attrs.type===void 0&&(T.attrs.type="text/css"),T.attrs.rel="stylesheet",w(F,T.attrs),x(T,F),F}function w(T,F){Object.keys(F).forEach(function(X){T.setAttribute(X,F[X])})}function I(T,F){var X,J,q,$;if(F.transform&&T.css)if($=F.transform(T.css),$)T.css=$;else return function(){};if(F.singleton){var K=h++;X=d||(d=_(F)),J=D.bind(null,X,K,!1),q=D.bind(null,X,K,!0)}else T.sourceMap&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&typeof URL.revokeObjectURL=="function"&&typeof Blob=="function"&&typeof btoa=="function"?(X=A(F),J=B.bind(null,X,F),q=function(){m(X),X.href&&URL.revokeObjectURL(X.href)}):(X=_(F),J=N.bind(null,X),q=function(){m(X)});return J(T),function(z){if(z){if(z.css===T.css&&z.media===T.media&&z.sourceMap===T.sourceMap)return;J(T=z)}else q()}}var P=function(){var T=[];return function(F,X){return T[F]=X,T.filter(Boolean).join(` `)}}();function D(T,F,X,J){var q=X?"":J.css;if(T.styleSheet)T.styleSheet.cssText=P(F,q);else{var $=document.createTextNode(q),K=T.childNodes;K[F]&&T.removeChild(K[F]),K.length?T.insertBefore($,K[F]):T.appendChild($)}}function N(T,F){var X=F.css,J=F.media;if(J&&T.setAttribute("media",J),T.styleSheet)T.styleSheet.cssText=X;else{for(;T.firstChild;)T.removeChild(T.firstChild);T.appendChild(document.createTextNode(X))}}function B(T,F,X){var J=X.css,q=X.sourceMap,$=F.convertToAbsoluteUrls===void 0&&q;(F.convertToAbsoluteUrls||$)&&(J=g(J)),q&&(J+=` /*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(q))))+" */");var K=new Blob([J],{type:"text/css"}),ge=T.href;T.href=URL.createObjectURL(K),ge&&URL.revokeObjectURL(ge)}},function(t,i){t.exports=function(o){var a=[];return a.toString=function(){return this.map(function(u){var d=r(u,o);return u[2]?"@media "+u[2]+"{"+d+"}":d}).join("")},a.i=function(l,u){typeof l=="string"&&(l=[[null,l,""]]);for(var d={},h=0;h1&&arguments[1]!==void 0?arguments[1]:[],x=v.previousSibling;return x?(S.push(x),l(x,S)):S}function u(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=v.nextSibling;return x?(S.push(x),u(x,S)):S}function d(v){var S=l(v).concat(u(v));return S.filter(o)}function h(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=v.parentNode;return x?(S.push(x),h(x,S)):S}function p(v){return h(v).filter(s)}function g(v){return p(v).map(function(S){return d(S)}).reduce(a,[])}t.exports={getSiblings:d,getAncestors:p,getSiblingsOfAncestors:g}},function(t,i,r){(function(s){var o=s.CustomEvent;function a(){try{var l=new o("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch(u){}return!1}t.exports=a()?o:typeof document!="undefined"&&typeof document.createEvent=="function"?function(u,d){var h=document.createEvent("CustomEvent");return d?h.initCustomEvent(u,d.bubbles,d.cancelable,d.detail):h.initCustomEvent(u,!1,!1,void 0),h}:function(u,d){var h=document.createEventObject();return h.type=u,d?(h.bubbles=!!d.bubbles,h.cancelable=!!d.cancelable,h.detail=d.detail):(h.bubbles=!1,h.cancelable=!1,h.detail=void 0),h}}).call(this,r(0))},,function(t,i){var r=t.exports={},s,o;function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=a}catch(A){s=a}try{typeof clearTimeout=="function"?o=clearTimeout:o=l}catch(A){o=l}})();function u(A){if(s===setTimeout)return setTimeout(A,0);if((s===a||!s)&&setTimeout)return s=setTimeout,setTimeout(A,0);try{return s(A,0)}catch(w){try{return s.call(null,A,0)}catch(I){return s.call(this,A,0)}}}function d(A){if(o===clearTimeout)return clearTimeout(A);if((o===l||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(A);try{return o(A)}catch(w){try{return o.call(null,A)}catch(I){return o.call(this,A)}}}var h=[],p=!1,g,v=-1;function S(){!p||!g||(p=!1,g.length?h=g.concat(h):v=-1,h.length&&x())}function x(){if(!p){var A=u(S);p=!0;for(var w=h.length;w;){for(g=h,h=[];++v1)for(var I=1;I=0&&(u._idleTimeoutId=setTimeout(function(){u._onTimeout&&u._onTimeout()},d))},r(17),i.setImmediate=typeof self!="undefined"&&self.setImmediate||typeof s!="undefined"&&s.setImmediate||this&&this.setImmediate,i.clearImmediate=typeof self!="undefined"&&self.clearImmediate||typeof s!="undefined"&&s.clearImmediate||this&&this.clearImmediate}).call(this,r(0))}])})})(YR);var Om=YR.exports;const nH=({api:n,aspect:e,maxHeight:t,maxWidth:i,params:r,playbackUrl:s,type:o,uuid:a})=>{const[l,u]=pe.useState(!1),[d,h]=pe.useState(!0),p=pe.useRef(null),g=pe.useRef(void 0),v=pe.useRef(!1);return pe.useEffect(()=>{if(!(!p.current||v.current))return v.current=!0,s&&Om._debug.setPlaybackURL(s),Om.api.renderPlayer(_e({aspect:e,container:p.current,height:t,type:o,uuid:a,width:i},r)).then(S=>{g.current=S,h(!1),typeof n=="function"&&n(S,Om.api)}).catch(S=>{u(!0),console.warn(S.message)}),()=>{g.current&&(Om.api.destroyPlayer(g.current),g.current=void 0,v.current=!1)}},[n,e,t,i,r,s,o,a]),me.jsx(hA,{fallback:l,children:me.jsx("div",{className:"video-loaded aspect-video sm:max-w-[940px] m-auto bg-sfnavy overflow-hidden rounded-2xl z-10 mb-10 sm:mb-20",style:{margin:"auto",width:"100%",height:"auto",overflow:"hidden",zIndex:10,maxWidth:"940px",maxHeight:"506px"},ref:p,children:d?me.jsx("img",{rel:"preload",className:"object-cover aspect-video absolute top-0 w-full m-auto overflow-hidden h-auto sm:min-h-[506px] z-10 max-w-[940px] rounded-2xl",style:{margin:"auto",width:"100%",height:"auto",overflow:"hidden",maxWidth:"940px",maxHeight:"506px",zIndex:1},src:`https://play.vidyard.com/${a}.jpg`,width:"940",height:"506"}):null})})},iH=({attributes:n,blade_id:e,blade_position:t})=>{var N,B;const{headline:i="",description:r="",link_1:s,link_2:o,media:a}=n!=null?n:{},l=pe.useRef(null),{scrollYProgress:u}=JR({target:l,offset:["start start","end start"]}),d=Fm(u,{stiffness:140,damping:30,restDelta:.001}),h=Fm(u,{stiffness:220,damping:100,restDelta:.002}),p=Fm(u,{stiffness:200,damping:30}),g=lr(u,[0,1],["0%","300%"]),v=lr(u,[0,1],["0%","100%"]),S=lr(p,[0,1],["0%","350%"]),x=lr(p,[.18,.25],["100%","0%"]),m=lr(d,[0,.6],["0px","200px"]),_=lr(d,[0,.7],["0px","400px"]),A=lr(d,[0,.5],["0px","300px"]),w=lr(h,[0,.8],["0px","-200px"]),I=lr(h,[0,.7],["0px","-400px"]),P=lr(h,[0,.5],["0px","-300px"]),D=pe.lazy(()=>Promise.resolve().then(()=>RX));return me.jsxs("div",{ref:l,className:"relative grid min-h-screen w-screen place-items-center overflow-hidden mb-16",children:[me.jsx(Xi.div,{style:{backgroundImage:"url('https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/marquee-bg-back.png?w=500')",backgroundSize:"120%",backgroundPositionY:v,backgroundPosition:"bottom"},className:"bg-blur absolute inset-0 z-0 opacity-20"}),me.jsx(Xi.div,{style:{backgroundImage:"url('https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/marquee-bg-front.png?w=500')",backgroundSize:"120%",backgroundPositionY:g,backgroundPosition:"bottom"},className:"bg-blur visible absolute inset-0 z-0 opacity-20 max-sm:hidden"}),me.jsx(Xi.div,{style:{backgroundImage:"url('https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/marquee-bg-middle.png?w=1200')",backgroundSize:"120%",backgroundPositionY:v,backgroundPosition:"bottom",backgroundRepeat:"no-repeat"},className:"bg-blur z-1 visible absolute inset-0 opacity-20"}),me.jsxs("div",{className:"container relative flex flex-col items-center justify-start gap-10",children:[me.jsx(hA,{fallback:null,children:me.jsxs(pe.Suspense,{fallback:me.jsx(KR,{position:"left",x:w}),children:[me.jsx(Xi.div,{style:{x:w},className:"data-dust absolute visible left-[2%] top-[20%] z-30 w-[60px] sm:w-[160px] max-sm:hidden",children:me.jsx(D,{progress:u,direction:"left",size:"lg"})}),me.jsx(Xi.div,{style:{x:P},className:"data-dust absolute left-[-1%] top-[30%] z-30 w-[60px] sm:w-[160px] visible max-sm:hidden",children:me.jsx(D,{progress:u,direction:"right",size:"md"})}),me.jsx(Xi.div,{style:{x:I},className:"data-dust absolute left-[5%] top-[28%] z-30 w-[60px] sm:w-[160px] visible max-sm:hidden",children:me.jsx(D,{progress:u,direction:"right",size:"sm"})})]})}),me.jsxs(Xi.div,{className:"flex flex-col items-center justify-center max-sm:px-1",style:{y:S,opacity:x},children:[me.jsx("h1",{className:"marquee__accent antialiased z-0 mx-2 mt-8 text-center font-display text-[2.4rem] text-white sm:text-[3rem] md:text-[4rem] lg:text-[5rem]",dangerouslySetInnerHTML:{__html:i}}),me.jsx("p",{className:"mt-8 text-center font-sans text-[1rem] text-white sm:text-[1.3rem]",dangerouslySetInnerHTML:{__html:r}}),me.jsxs("div",{className:"flex items-center justify-center gap-4 mt-10",children:[(s==null?void 0:s.label)&&me.jsx("a",{href:s==null?void 0:s.url,className:"inline-flex w-auto items-center justify-center font-sans text-[1.1rem] rounded-[4px] bg-sfnavy px-[32px] py-4 font-semibold text-white antialiased hover:bg-sfprimary hover:text-white",onClick:T=>{var F,X,J;return Jr(T,e,(J=(X=n==null?void 0:n.headline)!=null?X:(F=n==null?void 0:n.link_1)==null?void 0:F.label)!=null?J:"missing headline",t)},target:s==null?void 0:s.target,"aria-label":s==null?void 0:s.ariaLabel,children:s==null?void 0:s.label}),(o==null?void 0:o.label)&&me.jsx("a",{href:o==null?void 0:o.url,className:"inline-flex w-auto items-center justify-center font-sans text-[1.1rem] rounded-[4px] bg-white px-[32px] py-4 font-semibold text-sfnavy antialiased hover:bg-sfprimary hover:text-white",onClick:T=>{var F,X,J;return Jr(T,e,(J=(X=n==null?void 0:n.headline)!=null?X:(F=n==null?void 0:n.link_1)==null?void 0:F.label)!=null?J:"missing headline",t)},target:o==null?void 0:o.target,"aria-label":o==null?void 0:o.ariaLabel,children:o==null?void 0:o.label})]})]}),me.jsxs("div",{className:"video-wrapper w-full relative",children:[me.jsx(hA,{children:me.jsxs(pe.Suspense,{fallback:me.jsx(KR,{position:"right",x:A}),children:[me.jsx(Xi.div,{style:{x:m},className:"data-dust absolute right-[8%] top-[-8%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:me.jsx(D,{progress:u,direction:"right",size:"lg"})}),me.jsx(Xi.div,{style:{x:_},className:"data-dust absolute right-[5%] top-[10%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:me.jsx(D,{progress:u,direction:"left",size:"md"})}),me.jsx(Xi.div,{style:{x:A},className:"data-dust absolute right-[1%] top-[1%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:me.jsx(D,{progress:u,direction:"left",size:"sm"})})]})}),me.jsx("div",{className:"w-full sm:max-w-[900px] m-auto bg-sfnavy overflow-hidden rounded-2xl z-10 mb-10 sm:mb-20",children:((N=a==null?void 0:a.video)==null?void 0:N.uuid)!==void 0?me.jsx(nH,{uuid:(B=a==null?void 0:a.video)==null?void 0:B.uuid,maxWidth:"940px",maxHeight:"506px",type:"inline"}):null})]})]})]})},rH=({attributes:n,blade_id:e,media_items:t,blade_position:i})=>{var s,o;const r={transition:{duration:.3,ease:[.45,.14,.1,.97]}};return me.jsxs("section",{className:"container mx-auto px-8 mt-12 py-8 text-white rounded-2xl max-w-[1280px]",children:[me.jsxs("div",{className:"text-center mb-12 mx-auto ",children:[me.jsx("h2",{className:"text-3xl sm:text-5xl font-display text-white mx-0 sm:mx-6",children:n==null?void 0:n.headline}),me.jsx("p",{className:"mt-4 text-lg font-sans",children:n==null?void 0:n.description}),(n==null?void 0:n.link_1)&&me.jsx("a",{href:(s=n==null?void 0:n.link_1)==null?void 0:s.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:a=>{var l,u,d;return Jr(a,e,(d=(u=n.headline)!=null?u:(l=n==null?void 0:n.link_1)==null?void 0:l.label)!=null?d:"missing headline",i)},children:me.jsx("div",{className:"h-[54px] px-8 py-[15px] rounded border border-white justify-center items-center gap-2 inline-flex hover:bg-white/10",children:n.link_1.label})}),(n==null?void 0:n.link_2)&&me.jsx("a",{href:(o=n==null?void 0:n.link_2)==null?void 0:o.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:a=>{var l,u,d;return Jr(a,e,(d=(u=n.headline)!=null?u:(l=n==null?void 0:n.link_2)==null?void 0:l.label)!=null?d:"missing headline",i)},children:me.jsx("div",{className:"h-[54px] px-8 py-[15px] rounded border border-white justify-center items-center gap-2 inline-flex",children:n.link_2.label})})]}),me.jsx("div",{className:"grid gap-8 grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3",children:t==null?void 0:t.map((a,l)=>{var d,h,p,g,v;const u=a;return me.jsxs(Xi.div,{className:"bg-white flex flex-col rounded-2xl overflow-hidden text-left shadow-2xl",transition:r,initial:{scale:.9,opacity:0},whileInView:{scale:1,opacity:1,transition:{duration:.3,ease:[.45,.14,.1,.97],delay:l*.1}},children:[me.jsx("img",{src:(d=u.image)==null?void 0:d.src,alt:(h=u.image)==null?void 0:h.alt,className:"w-full object-cover aspect-video"}),me.jsxs("div",{className:"flex flex-col h-full gap-4 px-8 py-8",children:[me.jsx("a",{href:u.link_1.url,"aria-label":u.headline,target:u.link_1.target,onClick:S=>Jr(S,e,u.headline,i),children:me.jsx("h3",{className:"text-2xl font-display font-semibold mb-2 text-left text-sfnavy",children:u.headline})}),me.jsx("p",{className:"font-sans mb-4 text-left text-sfdarkgrey",dangerouslySetInnerHTML:{__html:(p=u.description)!=null?p:""}}),((g=u.link_1)==null?void 0:g.url)&&me.jsx("a",{href:u.link_1.url,"aria-label":(v=u.link_1.ariaLabel)!=null?v:`${u.link_1.label} : ${u.headline}`,target:u.link_1.target,className:"text-sfnavy mt-auto hover:text-sfprimary hover:no-underline underline-offset-2 font-sans font-bold underline",onClick:S=>Jr(S,e,u.headline,i),children:u.link_1.label})]})]},l)})})]})},sH=({i:n,attributes:e,progress:t,targetScale:i,range:r,id:s,blade_position:o})=>{var m,_,A,w;const a=pe.useRef(null),l=s;Fm(t,{stiffness:300,damping:50,restDelta:.001});const u=lr(t,r,[1,i]),{headline:d,link_1:h,link_2:p,eyebrow:g,description:v,media:S,blade_layout:x}=e||{};return me.jsx(Xi.section,{ref:a,style:{scale:u},className:"card-section relative sm:sticky sm:top-[72px] mx-auto flex sm:min-h-[70vh] w-full",children:me.jsxs("div",{className:`card-container h-auto sm:max-h-[90vh] p-6 sm:p-16 w-full relative flex max-sm:flex-col-reverse flex-col overflow-hidden items-start justify-end gap-6 sm:rounded-[5rem] sm:items-start sm:gap-12 rounded-[3rem] shadow-2xl ${`bg-${(m=g==null?void 0:g.label)==null?void 0:m.toLocaleLowerCase()}-gradient`} ${x==="right"?"sm:flex-row":"sm:flex-row-reverse"}`,children:[me.jsx("div",{className:"w-full flex items-center justify-center sm:w-1/2",children:me.jsx("img",{className:"object-contain w-full h-full max-h-[300px] sm:max-h-[500px]",src:(_=S==null?void 0:S.image)==null?void 0:_.src,alt:((A=S==null?void 0:S.image)==null?void 0:A.alt)||""})}),me.jsxs("div",{className:"copy flex w-full flex-col items-start justify-center gap-3 sm:gap-6 sm:w-1/2",children:[me.jsxs("div",{className:"pill rounded-full bg-white px-5 py-3 flex items-center justify-center gap-2 font-display text-sm text-sfnavy sm:text-lg",children:[me.jsx("img",{src:(w=g==null?void 0:g.image)==null?void 0:w.src,alt:"",className:"w-6 h-6"}),g==null?void 0:g.label]}),me.jsx("h2",{className:"font-display text-2xl sm:text-clamp text-white",children:d}),me.jsx("div",{className:"stacking-card__desc font-sans text-base text-white sm:text-[1.2rem]",dangerouslySetInnerHTML:{__html:v||""}}),me.jsxs("div",{className:"flex w-full items-center justify-start gap-6",children:[h&&me.jsx("a",{href:h==null?void 0:h.url,className:"cta-button lg:my-8 my-2 rounded bg-white px-6 py-4 font-sans text-[1rem] font-semibold text-sfnavy","data-variant":h==null?void 0:h.variant,"aria-label":h==null?void 0:h.ariaLabel,onClick:I=>{var P;return Jr(I,l,(P=d!=null?d:h.label)!=null?P:"missing headline",o)},children:h==null?void 0:h.label}),p&&me.jsx("a",{href:p==null?void 0:p.url,className:'cta-button data-[variant="secondary"]:border-2 bg-black/50 my-8 rounded text-white px-6 py-4 font-sans text-[1rem] font-semibold underline underline-offset-2 hover:no-underline',"data-variant":p==null?void 0:p.variant,"aria-label":p==null?void 0:p.ariaLabel,onClick:I=>{var P;return Jr(I,l,(P=d!=null?d:p.label)!=null?P:"missing headline",o)},children:p==null?void 0:p.label})]})]})]})},n)},oH=({attributes:n,progress:e,blade_id:t,blade_position:i})=>{const{headline:r,description:s,blade_layout:o}=n||{},a=lr(e,[.67,.69],["100%","0%"]),l=lr(e,[.67,.69],["0px","-30px"]);return n?me.jsxs(Xi.div,{className:`text-${o} w-full mb-16`,style:{opacity:a,zIndex:0,y:l},children:[me.jsx("h2",{className:"text-white text-4xl sm:text-5xl font-semibold mx-4 mb-4 font-display",children:r}),me.jsx("div",{className:"text-white text-base sm:text-2xl mx-4 font-bold font-sans leading-[43.20px]",dangerouslySetInnerHTML:{__html:s}}),n.link_1&&me.jsx("a",{href:n.link_1.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:u=>Jr(u,t,n.headline,i),"aria-label":n.link_1.ariaLabel,children:me.jsx("div",{className:"h-[54px] px-8 py-[15px] rounded border border-white justify-center items-center gap-2 inline-flex hover:bg-white/10",children:n.link_1.label})}),n.link_2&&me.jsx("a",{href:n.link_2.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:u=>Jr(u,t,n.headline,i),"aria-label":n.link_2.ariaLabel,children:me.jsx("div",{className:"h-[54px] px-8 py-[15px] rounded border border-white justify-center items-center gap-2 inline-flex",children:n.link_2.label})})]}):null},aH=({attributes:n,blade_id:e,blade_position:t})=>{const{headline:i,link_1:r,link_2:s,description:o,image:a,blade_layout:l}=n||{};return me.jsxs("div",{className:`px-8 mb-16 sm:px-16 gap-6 sm:gap-24 container mx-auto flex items-center justify-center flex-col ${l==="right"?"sm:flex-row":"sm:flex-row-reverse"}`,children:[me.jsxs("div",{className:"max-sm:w-full sm:w-2/3 flex flex-col gap-4",children:[me.jsx("h2",{className:"font-display text-4xl sm:text-5xl text-white",children:i}),me.jsx("div",{className:"blade__description font-sans text-base text-white sm:text-[1.2rem]",dangerouslySetInnerHTML:{__html:o!=null?o:""}}),me.jsxs("div",{className:"flex w-full items-center justify-start gap-6",children:[r!==void 0?me.jsx("a",{href:r==null?void 0:r.url,className:"cta-button my-8 rounded bg-white px-6 py-4 font-sans text-[1rem] font-semibold text-sfnavy","data-variant":r==null?void 0:r.variant,"aria-label":r==null?void 0:r.ariaLabel,onClick:u=>Jr(u,e,i!=null?i:"missing headline",t),children:r==null?void 0:r.label}):null,s!==void 0?me.jsx("a",{href:s==null?void 0:s.url,className:'cta-button data-[variant="secondary"]:border-2 bg-black/50 my-8 rounded text-white px-6 py-4 font-sans text-[1rem] font-semibold underline underline-offset-2 hover:no-underline',"data-variant":s==null?void 0:s.variant,"aria-label":s==null?void 0:s.ariaLabel,onClick:u=>Jr(u,e,i!=null?i:"missing headline",t),children:s==null?void 0:s.label}):null]})]}),me.jsx("div",{className:"max-sm:w-full sm:md:w-1/3 flex flex-col",children:me.jsx("img",{className:"object-contain w-full h-full max-h-[300px] sm:max-h-[500px]",src:a==null?void 0:a.src,alt:a==null?void 0:a.alt})})]})},lH=pe.lazy(()=>Promise.resolve().then(()=>PX));function uH({appUrl:n}){var g,v,S;const[e,t]=pe.useState(),[i,r]=pe.useState(!0);console.log(n),pe.useEffect(()=>{n?fetch(n).then(x=>x.json()).then(x=>{console.log(x),t(x),r(!1)}):(console.error("appUrl is not defined"),r(!1))},[]);const s=e==null?void 0:e.blades.map((x,m)=>Ct(_e({},x),{blade_position:m,blade_id:x.id})),o=(g=s==null?void 0:s.filter(x=>x.name==="sf/oneup"))!=null?g:[],a=s==null?void 0:s.find(x=>x.name==="sf/marquee"),l=s==null?void 0:s.find(x=>x.name==="sf/promotion"),u=s==null?void 0:s.find(x=>x.name==="sf/text"),d=s==null?void 0:s.find(x=>x.name==="sf/nup"),h=pe.useRef(null),{scrollYProgress:p}=JR({target:h,offset:["start start","end end"]});return me.jsx("div",{className:"gt-dark-bg min-h-screen sm:rounded-b-[5rem] rounded-b-[3rem]",children:i?me.jsx(lH,{}):me.jsxs(me.Fragment,{children:[me.jsx(iH,{attributes:a==null?void 0:a.attributes,blade_id:a.blade_id,blade_position:a.blade_position}),me.jsxs(pe.Suspense,{fallback:me.jsx("div",{children:"Loading..."}),children:[me.jsx(aH,{attributes:l==null?void 0:l.attributes,blade_id:(v=l==null?void 0:l.id)!=null?v:"",blade_position:l==null?void 0:l.blade_position}),me.jsxs("div",{ref:h,className:"parallax-section relative",children:[me.jsx(oH,{attributes:u.attributes,blade_id:u.blade_id,blade_position:u.blade_position,progress:p}),o==null?void 0:o.map((x,m)=>me.jsx(sH,{attributes:x.attributes,blade_id:x.id,i:m,range:[m*.25,1],progress:p,blade_position:x.blade_position,targetScale:1},m))]}),me.jsx("div",{className:"relative pb-10",children:me.jsx(rH,{attributes:d.attributes,blade_id:d.blade_id,media_items:d.media_items,blade_position:(S=d.blade_position)!=null?S:0})})]})]})})}const km=document.getElementById("wps-dc-overview-ws"),cH=(km==null?void 0:km.dataset)||{};ey.createRoot(km).render(me.jsx(sF.StrictMode,{children:me.jsx(uH,_e({},cH))}));function fH(n,{whileHover:e,onHoverStart:t,onHoverEnd:i,onPointerOver:r,onPointerOut:s},o){return n||!o||!(e||t||i)?{}:{onPointerOver:l=>{var u;(u=o.animationState)===null||u===void 0||u.setActive("whileHover",!0),r&&r(l)},onPointerOut:l=>{var u;(u=o.animationState)===null||u===void 0||u.setActive("whileHover",!1),s&&s(l)}}}function dH(n,{whileTap:e,onTapStart:t,onTap:i,onTapCancel:r,onPointerDown:s},o){const a=i||t||r||e,l=pe.useRef(!1),u=pe.useRef(null);if(n||!o||!a)return{};function d(){var v;(v=u.current)===null||v===void 0||v.call(u),u.current=null}function h(){var v;return d(),l.current=!1,(v=o.animationState)===null||v===void 0||v.setActive("whileTap",!1),!V_()}function p(v,S){h()&&(i==null||i(v,S))}function g(v,S){h()&&(r==null||r(v,S))}return{onPointerDown:tb((v,S)=>{var x;if(d(),l.current)return;l.current=!0;const m={passive:!(t||i||r||s)};u.current=Us(ps(window,"pointerup",p,m),ps(window,"pointercancel",g,m)),(x=o.animationState)===null||x===void 0||x.setActive("whileTap",!0),s==null||s(v),t==null||t(v,S)})}}const hH=(n,e,t,i,r,s)=>{const o=pH(e);return pe.createElement(n,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ref:t},IR(e,!1,!1)),o),{onUpdate:e.onInstanceUpdate}),fH(r,e,s)),dH(r,e,s)))};function pH(n){return pe.useMemo(()=>{const e={};for(const t in n){const i=n[t];Tn(i)?e[t]=i.get():Array.isArray(i)&&i.includes(Tn)&&(e[t]=i.map(md))}return e},[])}/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT */const xd="167",mH={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},gH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},QR=0,pA=1,qR=2,vH=3,ZR=0,zm=1,_d=2,ms=3,ks=0,ji=1,gs=2,po=0,hl=1,mA=2,gA=3,vA=4,$R=5,ua=100,eP=101,tP=102,nP=103,iP=104,rP=200,sP=201,oP=202,aP=203,Hm=204,Gm=205,lP=206,uP=207,cP=208,fP=209,dP=210,hP=211,pP=212,mP=213,gP=214,vP=0,yP=1,xP=2,Ad=3,_P=4,AP=5,SP=6,MP=7,Sd=0,wP=1,EP=2,zs=0,CP=1,TP=2,bP=3,yA=4,RP=5,PP=6,IP=7,xA="attached",BP="detached",Vm=300,mo=301,ca=302,Md=303,wd=304,Qu=306,fa=1e3,Tr=1001,qu=1002,oi=1003,Wm=1004,yH=1004,pl=1005,xH=1005,kn=1006,Zu=1007,_H=1007,Kr=1008,AH=1008,vs=1009,_A=1010,AA=1011,$u=1012,Xm=1013,go=1014,ur=1015,ec=1016,jm=1017,Jm=1018,ml=1020,SA=35902,MA=1021,wA=1022,Ri=1023,EA=1024,CA=1025,gl=1026,vl=1027,Km=1028,Ed=1029,TA=1030,Ym=1031,SH=1032,Qm=1033,Cd=33776,Td=33777,bd=33778,Rd=33779,qm=35840,Zm=35841,$m=35842,eg=35843,tg=36196,ng=37492,ig=37496,rg=37808,sg=37809,og=37810,ag=37811,lg=37812,ug=37813,cg=37814,fg=37815,dg=37816,hg=37817,pg=37818,mg=37819,gg=37820,vg=37821,Pd=36492,yg=36494,xg=36495,bA=36283,_g=36284,Ag=36285,Sg=36286,LP=2200,DP=2201,FP=2202,tc=2300,nc=2301,Mg=2302,yl=2400,xl=2401,Id=2402,wg=2500,RA=2501,NP=0,PA=1,Eg=2,UP=3200,OP=3201,MH=3202,wH=3203,da=0,kP=1,vo="",Yr="srgb",yo="srgb-linear",Cg="display-p3",Bd="display-p3-linear",Ld="linear",vn="srgb",Dd="rec709",Fd="p3",EH=0,_l=7680,CH=7681,TH=7682,bH=7683,RH=34055,PH=34056,IH=5386,BH=512,LH=513,DH=514,FH=515,NH=516,UH=517,OH=518,IA=519,zP=512,HP=513,GP=514,BA=515,VP=516,WP=517,XP=518,jP=519,Nd=35044,kH=35048,zH=35040,HH=35045,GH=35049,VH=35041,WH=35046,XH=35050,jH=35042,JH="100",LA="300 es",Hs=2e3,Ud=2001;class xo{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+Pi[n>>16&255]+Pi[n>>24&255]+"-"+Pi[e&255]+Pi[e>>8&255]+"-"+Pi[e>>16&15|64]+Pi[e>>24&255]+"-"+Pi[t&63|128]+Pi[t>>8&255]+"-"+Pi[t>>16&255]+Pi[t>>24&255]+Pi[i&255]+Pi[i>>8&255]+Pi[i>>16&255]+Pi[i>>24&255]).toLowerCase()}function zn(n,e,t){return Math.max(e,Math.min(t,n))}function DA(n,e){return(n%e+e)%e}function KH(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function YH(n,e,t){return n!==e?(t-n)/(e-n):0}function Od(n,e,t){return(1-t)*n+t*e}function QH(n,e,t,i){return Od(n,e,1-Math.exp(-t*i))}function qH(n,e=1){return e-Math.abs(DA(n,e*2)-e)}function ZH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function $H(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function eG(n,e){return n+Math.floor(Math.random()*(e-n+1))}function tG(n,e){return n+Math.random()*(e-n)}function nG(n){return n*(.5-Math.random())}function iG(n){n!==void 0&&(JP=n);let e=JP+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function rG(n){return n*Al}function sG(n){return n*ic}function oG(n){return(n&n-1)===0&&n!==0}function aG(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function lG(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function uG(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),u=s((e+i)/2),d=o((e+i)/2),h=s((e-i)/2),p=o((e-i)/2),g=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*d,l*h,l*p,a*u);break;case"YZY":n.set(l*p,a*d,l*h,a*u);break;case"ZXZ":n.set(l*h,l*p,a*d,a*u);break;case"XZX":n.set(a*d,l*v,l*g,a*u);break;case"YXY":n.set(l*g,a*d,l*v,a*u);break;case"ZYZ":n.set(l*v,l*g,a*d,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ji(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Lt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const KP={DEG2RAD:Al,RAD2DEG:ic,generateUUID:br,clamp:zn,euclideanModulo:DA,mapLinear:KH,inverseLerp:YH,lerp:Od,damp:QH,pingpong:qH,smoothstep:ZH,smootherstep:$H,randInt:eG,randFloat:tG,randFloatSpread:nG,seededRandom:iG,degToRad:rG,radToDeg:sG,isPowerOfTwo:oG,ceilPowerOfTwo:aG,floorPowerOfTwo:lG,setQuaternionFromProperEuler:uG,normalize:Lt,denormalize:Ji};class Ae{constructor(e=0,t=0){Ae.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(zn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Dt{constructor(e,t,i,r,s,o,a,l,u){Dt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,u)}set(e,t,i,r,s,o,a,l,u){const d=this.elements;return d[0]=e,d[1]=r,d[2]=a,d[3]=t,d[4]=s,d[5]=l,d[6]=i,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;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],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],u=i[1],d=i[4],h=i[7],p=i[2],g=i[5],v=i[8],S=r[0],x=r[3],m=r[6],_=r[1],A=r[4],w=r[7],I=r[2],P=r[5],D=r[8];return s[0]=o*S+a*_+l*I,s[3]=o*x+a*A+l*P,s[6]=o*m+a*w+l*D,s[1]=u*S+d*_+h*I,s[4]=u*x+d*A+h*P,s[7]=u*m+d*w+h*D,s[2]=p*S+g*_+v*I,s[5]=p*x+g*A+v*P,s[8]=p*m+g*w+v*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8];return t*o*d-t*a*u-i*s*d+i*a*l+r*s*u-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],h=d*o-a*u,p=a*l-d*s,g=u*s-o*l,v=t*h+i*p+r*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/v;return e[0]=h*S,e[1]=(r*u-d*i)*S,e[2]=(a*i-r*o)*S,e[3]=p*S,e[4]=(d*t-r*l)*S,e[5]=(r*s-a*t)*S,e[6]=g*S,e[7]=(i*l-u*t)*S,e[8]=(o*t-i*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),u=Math.sin(s);return this.set(i*l,i*u,-i*(l*o+u*a)+o+e,-r*u,r*l,-r*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(FA.makeScale(e,t)),this}rotate(e){return this.premultiply(FA.makeRotation(-e)),this}translate(e,t){return this.premultiply(FA.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return 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}clone(){return new this.constructor().fromArray(this.elements)}}const FA=new Dt;function YP(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const cG={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function rc(n,e){return new cG[n](e)}function kd(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function QP(){const n=kd("canvas");return n.style.display="block",n}const qP={};function sc(n){n in qP||(qP[n]=!0,console.warn(n))}function fG(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const ZP=new Dt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),$P=new Dt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zd={[yo]:{transfer:Ld,primaries:Dd,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[Yr]:{transfer:vn,primaries:Dd,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Bd]:{transfer:Ld,primaries:Fd,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3($P),fromReference:n=>n.applyMatrix3(ZP)},[Cg]:{transfer:vn,primaries:Fd,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3($P),fromReference:n=>n.applyMatrix3(ZP).convertLinearToSRGB()}},dG=new Set([yo,Bd]),tn={enabled:!0,_workingColorSpace:yo,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!dG.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=zd[e].toReference,r=zd[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return zd[n].primaries},getTransfer:function(n){return n===vo?Ld:zd[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(zd[e].luminanceCoefficients)}};function oc(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function NA(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let ac;class eI{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ac===void 0&&(ac=kd("canvas")),ac.width=e.width,ac.height=e.height;const i=ac.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=ac}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){const t=kd("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Vm)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case fa:e.x=e.x-Math.floor(e.x);break;case Tr:e.x=e.x<0?0:1;break;case qu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case fa:e.y=e.y-Math.floor(e.y);break;case Tr:e.y=e.y<0?0:1;break;case qu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Mn.DEFAULT_IMAGE=null,Mn.DEFAULT_MAPPING=Vm,Mn.DEFAULT_ANISOTROPY=1;class on{constructor(e=0,t=0,i=0,r=1){on.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,u=l[0],d=l[4],h=l[8],p=l[1],g=l[5],v=l[9],S=l[2],x=l[6],m=l[10];if(Math.abs(d-p)<.01&&Math.abs(h-S)<.01&&Math.abs(v-x)<.01){if(Math.abs(d+p)<.1&&Math.abs(h+S)<.1&&Math.abs(v+x)<.1&&Math.abs(u+g+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const A=(u+1)/2,w=(g+1)/2,I=(m+1)/2,P=(d+p)/4,D=(h+S)/4,N=(v+x)/4;return A>w&&A>I?A<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(A),r=P/i,s=D/i):w>I?w<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(w),i=P/r,s=N/r):I<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(I),i=D/s,r=N/s),this.set(i,r,s,t),this}let _=Math.sqrt((x-v)*(x-v)+(h-S)*(h-S)+(p-d)*(p-d));return Math.abs(_)<.001&&(_=1),this.x=(x-v)/_,this.y=(h-S)/_,this.z=(p-d)/_,this.w=Math.acos((u+g+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class tI extends xo{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new on(0,0,e,t),this.scissorTest=!1,this.viewport=new on(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:kn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Mn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,A=1-m*m;if(A>Number.EPSILON){const I=Math.sqrt(A),P=Math.atan2(I,m*_);x=Math.sin(x*P)/I,a=Math.sin(a*P)/I}const w=a*_;if(l=l*x+p*w,u=u*x+g*w,d=d*x+v*w,h=h*x+S*w,x===1-a){const I=1/Math.sqrt(l*l+u*u+d*d+h*h);l*=I,u*=I,d*=I,h*=I}}e[t]=l,e[t+1]=u,e[t+2]=d,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],u=i[r+2],d=i[r+3],h=s[o],p=s[o+1],g=s[o+2],v=s[o+3];return e[t]=a*v+d*h+l*g-u*p,e[t+1]=l*v+d*p+u*h-a*g,e[t+2]=u*v+d*g+a*p-l*h,e[t+3]=d*v-a*h-l*p-u*g,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(i/2),d=a(r/2),h=a(s/2),p=l(i/2),g=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=p*d*h+u*g*v,this._y=u*g*h-p*d*v,this._z=u*d*v+p*g*h,this._w=u*d*h-p*g*v;break;case"YXZ":this._x=p*d*h+u*g*v,this._y=u*g*h-p*d*v,this._z=u*d*v-p*g*h,this._w=u*d*h+p*g*v;break;case"ZXY":this._x=p*d*h-u*g*v,this._y=u*g*h+p*d*v,this._z=u*d*v+p*g*h,this._w=u*d*h-p*g*v;break;case"ZYX":this._x=p*d*h-u*g*v,this._y=u*g*h+p*d*v,this._z=u*d*v-p*g*h,this._w=u*d*h+p*g*v;break;case"YZX":this._x=p*d*h+u*g*v,this._y=u*g*h+p*d*v,this._z=u*d*v-p*g*h,this._w=u*d*h-p*g*v;break;case"XZY":this._x=p*d*h-u*g*v,this._y=u*g*h-p*d*v,this._z=u*d*v+p*g*h,this._w=u*d*h+p*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],u=t[2],d=t[6],h=t[10],p=i+a+h;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-l)*g,this._y=(s-u)*g,this._z=(o-r)*g}else if(i>a&&i>h){const g=2*Math.sqrt(1+i-a-h);this._w=(d-l)/g,this._x=.25*g,this._y=(r+o)/g,this._z=(s+u)/g}else if(a>h){const g=2*Math.sqrt(1+a-i-h);this._w=(s-u)/g,this._x=(r+o)/g,this._y=.25*g,this._z=(l+d)/g}else{const g=2*Math.sqrt(1+h-i-a);this._w=(o-r)/g,this._x=(s+u)/g,this._y=(l+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(zn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,u=t._z,d=t._w;return this._x=i*d+o*a+r*u-s*l,this._y=r*d+o*l+s*a-i*u,this._z=s*d+o*u+i*l-r*a,this._w=o*d-i*a-r*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*i+t*this._x,this._y=g*r+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const u=Math.sqrt(l),d=Math.atan2(u,a),h=Math.sin((1-t)*d)/u,p=Math.sin(t*d)/u;return this._w=o*h+this._w*p,this._x=i*h+this._x*p,this._y=r*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,t=0,i=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(nI.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(nI.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*r-a*i),d=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*u+o*h-a*d,this.y=i+l*d+a*u-s*h,this.z=r+l*h+s*d-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return kA.copy(this).projectOnVector(e),this.sub(kA)}reflect(e){return this.sub(kA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(zn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const kA=new G,nI=new Ii;class Bi{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,xs),xs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Hd),Rg.subVectors(this.max,Hd),lc.subVectors(e.a,Hd),uc.subVectors(e.b,Hd),cc.subVectors(e.c,Hd),ha.subVectors(uc,lc),pa.subVectors(cc,uc),Ml.subVectors(lc,cc);let t=[0,-ha.z,ha.y,0,-pa.z,pa.y,0,-Ml.z,Ml.y,ha.z,0,-ha.x,pa.z,0,-pa.x,Ml.z,0,-Ml.x,-ha.y,ha.x,0,-pa.y,pa.x,0,-Ml.y,Ml.x,0];return!zA(t,lc,uc,cc,Rg)||(t=[1,0,0,0,1,0,0,0,1],!zA(t,lc,uc,cc,Rg))?!1:(Pg.crossVectors(ha,pa),t=[Pg.x,Pg.y,Pg.z],zA(t,lc,uc,cc,Rg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,xs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(xs).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(_o[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_o[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_o[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_o[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_o[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_o[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_o[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_o[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_o),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const _o=[new G,new G,new G,new G,new G,new G,new G,new G],xs=new G,bg=new Bi,lc=new G,uc=new G,cc=new G,ha=new G,pa=new G,Ml=new G,Hd=new G,Rg=new G,Pg=new G,wl=new G;function zA(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){wl.fromArray(n,s);const a=r.x*Math.abs(wl.x)+r.y*Math.abs(wl.y)+r.z*Math.abs(wl.z),l=e.dot(wl),u=t.dot(wl),d=i.dot(wl);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>a)return!1}return!0}const vG=new Bi,Gd=new G,HA=new G;class _i{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):vG.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Gd.subVectors(e,this.center);const t=Gd.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Gd,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(HA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Gd.copy(e.center).add(HA)),this.expandByPoint(Gd.copy(e.center).sub(HA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ao=new G,GA=new G,Ig=new G,ma=new G,VA=new G,Bg=new G,WA=new G;class fc{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ao)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ao.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ao.copy(this.origin).addScaledVector(this.direction,t),Ao.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){GA.copy(e).add(t).multiplyScalar(.5),Ig.copy(t).sub(e).normalize(),ma.copy(this.origin).sub(GA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Ig),a=ma.dot(this.direction),l=-ma.dot(Ig),u=ma.lengthSq(),d=Math.abs(1-o*o);let h,p,g,v;if(d>0)if(h=o*l-a,p=o*a-l,v=s*d,h>=0)if(p>=-v)if(p<=v){const S=1/d;h*=S,p*=S,g=h*(h+o*p+2*a)+p*(o*h+p+2*l)+u}else p=s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*l)+u;else p=-s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*l)+u;else p<=-v?(h=Math.max(0,-(-o*s+a)),p=h>0?-s:Math.min(Math.max(-s,-l),s),g=-h*h+p*(p+2*l)+u):p<=v?(h=0,p=Math.min(Math.max(-s,-l),s),g=p*(p+2*l)+u):(h=Math.max(0,-(o*s+a)),p=h>0?s:Math.min(Math.max(-s,-l),s),g=-h*h+p*(p+2*l)+u);else p=o>0?-s:s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(GA).addScaledVector(Ig,p),g}intersectSphere(e,t){Ao.subVectors(e.center,this.origin);const i=Ao.dot(this.direction),r=Ao.dot(Ao)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const u=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,p=this.origin;return u>=0?(i=(e.min.x-p.x)*u,r=(e.max.x-p.x)*u):(i=(e.max.x-p.x)*u,r=(e.min.x-p.x)*u),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-p.z)*h,l=(e.max.z-p.z)*h):(a=(e.max.z-p.z)*h,l=(e.min.z-p.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Ao)!==null}intersectTriangle(e,t,i,r,s){VA.subVectors(t,e),Bg.subVectors(i,e),WA.crossVectors(VA,Bg);let o=this.direction.dot(WA),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ma.subVectors(this.origin,e);const l=a*this.direction.dot(Bg.crossVectors(ma,Bg));if(l<0)return null;const u=a*this.direction.dot(VA.cross(ma));if(u<0||l+u>o)return null;const d=-a*ma.dot(WA);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class mt{constructor(e,t,i,r,s,o,a,l,u,d,h,p,g,v,S,x){mt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,u,d,h,p,g,v,S,x)}set(e,t,i,r,s,o,a,l,u,d,h,p,g,v,S,x){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=u,m[6]=d,m[10]=h,m[14]=p,m[3]=g,m[7]=v,m[11]=S,m[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new mt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;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}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/dc.setFromMatrixColumn(e,0).length(),s=1/dc.setFromMatrixColumn(e,1).length(),o=1/dc.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),u=Math.sin(r),d=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*h,v=a*d,S=a*h;t[0]=l*d,t[4]=-l*h,t[8]=u,t[1]=g+v*u,t[5]=p-S*u,t[9]=-a*l,t[2]=S-p*u,t[6]=v+g*u,t[10]=o*l}else if(e.order==="YXZ"){const p=l*d,g=l*h,v=u*d,S=u*h;t[0]=p+S*a,t[4]=v*a-g,t[8]=o*u,t[1]=o*h,t[5]=o*d,t[9]=-a,t[2]=g*a-v,t[6]=S+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*d,g=l*h,v=u*d,S=u*h;t[0]=p-S*a,t[4]=-o*h,t[8]=v+g*a,t[1]=g+v*a,t[5]=o*d,t[9]=S-p*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*d,g=o*h,v=a*d,S=a*h;t[0]=l*d,t[4]=v*u-g,t[8]=p*u+S,t[1]=l*h,t[5]=S*u+p,t[9]=g*u-v,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,g=o*u,v=a*l,S=a*u;t[0]=l*d,t[4]=S-p*h,t[8]=v*h+g,t[1]=h,t[5]=o*d,t[9]=-a*d,t[2]=-u*d,t[6]=g*h+v,t[10]=p-S*h}else if(e.order==="XZY"){const p=o*l,g=o*u,v=a*l,S=a*u;t[0]=l*d,t[4]=-h,t[8]=u*d,t[1]=p*h+S,t[5]=o*d,t[9]=g*h-v,t[2]=v*h-g,t[6]=a*d,t[10]=S*h+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(yG,e,xG)}lookAt(e,t,i){const r=this.elements;return Rr.subVectors(e,t),Rr.lengthSq()===0&&(Rr.z=1),Rr.normalize(),ga.crossVectors(i,Rr),ga.lengthSq()===0&&(Math.abs(i.z)===1?Rr.x+=1e-4:Rr.z+=1e-4,Rr.normalize(),ga.crossVectors(i,Rr)),ga.normalize(),Lg.crossVectors(Rr,ga),r[0]=ga.x,r[4]=Lg.x,r[8]=Rr.x,r[1]=ga.y,r[5]=Lg.y,r[9]=Rr.y,r[2]=ga.z,r[6]=Lg.z,r[10]=Rr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],u=i[12],d=i[1],h=i[5],p=i[9],g=i[13],v=i[2],S=i[6],x=i[10],m=i[14],_=i[3],A=i[7],w=i[11],I=i[15],P=r[0],D=r[4],N=r[8],B=r[12],T=r[1],F=r[5],X=r[9],J=r[13],q=r[2],$=r[6],K=r[10],ge=r[14],z=r[3],te=r[7],ie=r[11],fe=r[15];return s[0]=o*P+a*T+l*q+u*z,s[4]=o*D+a*F+l*$+u*te,s[8]=o*N+a*X+l*K+u*ie,s[12]=o*B+a*J+l*ge+u*fe,s[1]=d*P+h*T+p*q+g*z,s[5]=d*D+h*F+p*$+g*te,s[9]=d*N+h*X+p*K+g*ie,s[13]=d*B+h*J+p*ge+g*fe,s[2]=v*P+S*T+x*q+m*z,s[6]=v*D+S*F+x*$+m*te,s[10]=v*N+S*X+x*K+m*ie,s[14]=v*B+S*J+x*ge+m*fe,s[3]=_*P+A*T+w*q+I*z,s[7]=_*D+A*F+w*$+I*te,s[11]=_*N+A*X+w*K+I*ie,s[15]=_*B+A*J+w*ge+I*fe,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],u=e[13],d=e[2],h=e[6],p=e[10],g=e[14],v=e[3],S=e[7],x=e[11],m=e[15];return v*(+s*l*h-r*u*h-s*a*p+i*u*p+r*a*g-i*l*g)+S*(+t*l*g-t*u*p+s*o*p-r*o*g+r*u*d-s*l*d)+x*(+t*u*h-t*a*g-s*o*h+i*o*g+s*a*d-i*u*d)+m*(-r*a*d-t*l*h+t*a*p+r*o*h-i*o*p+i*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],h=e[9],p=e[10],g=e[11],v=e[12],S=e[13],x=e[14],m=e[15],_=h*x*u-S*p*u+S*l*g-a*x*g-h*l*m+a*p*m,A=v*p*u-d*x*u-v*l*g+o*x*g+d*l*m-o*p*m,w=d*S*u-v*h*u+v*a*g-o*S*g-d*a*m+o*h*m,I=v*h*l-d*S*l-v*a*p+o*S*p+d*a*x-o*h*x,P=t*_+i*A+r*w+s*I;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/P;return e[0]=_*D,e[1]=(S*p*s-h*x*s-S*r*g+i*x*g+h*r*m-i*p*m)*D,e[2]=(a*x*s-S*l*s+S*r*u-i*x*u-a*r*m+i*l*m)*D,e[3]=(h*l*s-a*p*s-h*r*u+i*p*u+a*r*g-i*l*g)*D,e[4]=A*D,e[5]=(d*x*s-v*p*s+v*r*g-t*x*g-d*r*m+t*p*m)*D,e[6]=(v*l*s-o*x*s-v*r*u+t*x*u+o*r*m-t*l*m)*D,e[7]=(o*p*s-d*l*s+d*r*u-t*p*u-o*r*g+t*l*g)*D,e[8]=w*D,e[9]=(v*h*s-d*S*s-v*i*g+t*S*g+d*i*m-t*h*m)*D,e[10]=(o*S*s-v*a*s+v*i*u-t*S*u-o*i*m+t*a*m)*D,e[11]=(d*a*s-o*h*s-d*i*u+t*h*u+o*i*g-t*a*g)*D,e[12]=I*D,e[13]=(d*S*r-v*h*r+v*i*p-t*S*p-d*i*x+t*h*x)*D,e[14]=(v*a*r-o*S*r-v*i*l+t*S*l+o*i*x-t*a*x)*D,e[15]=(o*h*r-d*a*r+d*i*l-t*h*l-o*i*p+t*a*p)*D,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,u=s*o,d=s*a;return this.set(u*o+i,u*a-r*l,u*l+r*a,0,u*a+r*l,d*a+i,d*l-r*o,0,u*l-r*a,d*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,u=s+s,d=o+o,h=a+a,p=s*u,g=s*d,v=s*h,S=o*d,x=o*h,m=a*h,_=l*u,A=l*d,w=l*h,I=i.x,P=i.y,D=i.z;return r[0]=(1-(S+m))*I,r[1]=(g+w)*I,r[2]=(v-A)*I,r[3]=0,r[4]=(g-w)*P,r[5]=(1-(p+m))*P,r[6]=(x+_)*P,r[7]=0,r[8]=(v+A)*D,r[9]=(x-_)*D,r[10]=(1-(p+S))*D,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=dc.set(r[0],r[1],r[2]).length();const o=dc.set(r[4],r[5],r[6]).length(),a=dc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],_s.copy(this);const u=1/s,d=1/o,h=1/a;return _s.elements[0]*=u,_s.elements[1]*=u,_s.elements[2]*=u,_s.elements[4]*=d,_s.elements[5]*=d,_s.elements[6]*=d,_s.elements[8]*=h,_s.elements[9]*=h,_s.elements[10]*=h,t.setFromRotationMatrix(_s),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Hs){const l=this.elements,u=2*s/(t-e),d=2*s/(i-r),h=(t+e)/(t-e),p=(i+r)/(i-r);let g,v;if(a===Hs)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Ud)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Hs){const l=this.elements,u=1/(t-e),d=1/(i-r),h=1/(o-s),p=(t+e)*u,g=(i+r)*d;let v,S;if(a===Hs)v=(o+s)*h,S=-2*h;else if(a===Ud)v=s*h,S=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-g,l[2]=0,l[6]=0,l[10]=S,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return 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],e}}const dc=new G,_s=new mt,yG=new G(0,0,0),xG=new G(1,1,1),ga=new G,Lg=new G,Rr=new G,iI=new mt,rI=new Ii;class cr{constructor(e=0,t=0,i=0,r=cr.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],u=r[5],d=r[9],h=r[2],p=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(zn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-zn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(zn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,g),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-zn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(zn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-zn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return iI.makeRotationFromQuaternion(e),this.setFromRotationMatrix(iI,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return rI.setFromEuler(this),this.setFromQuaternion(rI,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}cr.DEFAULT_ORDER="XYZ";class El{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,d=l.length;u0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),d.length>0&&(i.images=d),h.length>0&&(i.shapes=h),p.length>0&&(i.skeletons=p),g.length>0&&(i.animations=g),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const u in a){const d=a[u];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){As.subVectors(r,t),Mo.subVectors(i,t),jA.subVectors(e,t);const o=As.dot(As),a=As.dot(Mo),l=As.dot(jA),u=Mo.dot(Mo),d=Mo.dot(jA),h=o*u-a*a;if(h===0)return s.set(0,0,0),null;const p=1/h,g=(u*l-a*d)*p,v=(o*d-a*l)*p;return s.set(1-g-v,v,g)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,wo)===null?!1:wo.x>=0&&wo.y>=0&&wo.x+wo.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,wo)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,wo.x),l.addScaledVector(o,wo.y),l.addScaledVector(a,wo.z),l)}static isFrontFacing(e,t,i,r){return As.subVectors(i,t),Mo.subVectors(e,t),As.cross(Mo).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return As.subVectors(this.c,this.b),Mo.subVectors(this.a,this.b),As.cross(Mo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Pr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Pr.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Pr.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Pr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Pr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;mc.subVectors(r,i),gc.subVectors(s,i),JA.subVectors(e,i);const l=mc.dot(JA),u=gc.dot(JA);if(l<=0&&u<=0)return t.copy(i);KA.subVectors(e,r);const d=mc.dot(KA),h=gc.dot(KA);if(d>=0&&h<=d)return t.copy(r);const p=l*h-d*u;if(p<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(i).addScaledVector(mc,o);YA.subVectors(e,s);const g=mc.dot(YA),v=gc.dot(YA);if(v>=0&&g<=v)return t.copy(s);const S=g*u-l*v;if(S<=0&&u>=0&&v<=0)return a=u/(u-v),t.copy(i).addScaledVector(gc,a);const x=d*v-g*h;if(x<=0&&h-d>=0&&g-v>=0)return cI.subVectors(s,r),a=(h-d)/(h-d+(g-v)),t.copy(r).addScaledVector(cI,a);const m=1/(x+S+p);return o=S*m,a=p*m,t.copy(i).addScaledVector(mc,o).addScaledVector(gc,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const fI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},va={h:0,s:0,l:0},Fg={h:0,s:0,l:0};function QA(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class ke{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Yr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,tn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=tn.workingColorSpace){return this.r=e,this.g=t,this.b=i,tn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=tn.workingColorSpace){if(e=DA(e,1),t=zn(t,0,1),i=zn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=QA(o,s,e+1/3),this.g=QA(o,s,e),this.b=QA(o,s,e-1/3)}return tn.toWorkingColorSpace(this,r),this}setStyle(e,t=Yr){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Yr){const i=fI[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=oc(e.r),this.g=oc(e.g),this.b=oc(e.b),this}copyLinearToSRGB(e){return this.r=NA(e.r),this.g=NA(e.g),this.b=NA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Yr){return tn.fromWorkingColorSpace(Li.copy(this),e),Math.round(zn(Li.r*255,0,255))*65536+Math.round(zn(Li.g*255,0,255))*256+Math.round(zn(Li.b*255,0,255))}getHexString(e=Yr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=tn.workingColorSpace){tn.fromWorkingColorSpace(Li.copy(this),t);const i=Li.r,r=Li.g,s=Li.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,u;const d=(a+o)/2;if(a===o)l=0,u=0;else{const h=o-a;switch(u=d<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==hl&&(i.blending=this.blending),this.side!==ks&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Hm&&(i.blendSrc=this.blendSrc),this.blendDst!==Gm&&(i.blendDst=this.blendDst),this.blendEquation!==ua&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Ad&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==IA&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==_l&&(i.stencilFail=this.stencilFail),this.stencilZFail!==_l&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==_l&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class Ir extends $n{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ke(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cr,this.combine=Sd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Eo=EG();function EG(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):u<-14?(i[l]=1024>>-u-14,i[l|256]=1024>>-u-14|32768,r[l]=-u-1,r[l|256]=-u-1):u<=15?(i[l]=u+15<<10,i[l|256]=u+15<<10|32768,r[l]=13,r[l|256]=13):u<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,s[l]=u|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function fr(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=zn(n,-65504,65504),Eo.floatView[0]=n;const e=Eo.uint32View[0],t=e>>23&511;return Eo.baseTable[t]+((e&8388607)>>Eo.shiftTable[t])}function Wd(n){const e=n>>10;return Eo.uint32View[0]=Eo.mantissaTable[Eo.offsetTable[e]+(n&1023)]+Eo.exponentTable[e],Eo.floatView[0]}const CG={toHalfFloat:fr,fromHalfFloat:Wd},ei=new G,Ng=new Ae;class $t{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Nd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=ur,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return sc("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],d=[];for(let h=0,p=u.length;h0&&(r[l]=d,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const u in r){const d=r[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],h=s[u];for(let p=0,g=h.length;p0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sJ0(e.far-e.near,2)))&&(dI.copy(s).invert(),Cl.copy(e.ray).applyMatrix4(dI),!(i.boundingBox!==null&&Cl.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Cl)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,h=s.attributes.normal,p=s.groups,g=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,S=p.length;vt.far?null:{distance:u,point:Vg.clone(),object:n}}function Wg(n,e,t,i,r,s,o,a,l,u){n.getVertexPosition(a,yc),n.getVertexPosition(l,xc),n.getVertexPosition(u,_c);const d=DG(n,e,t,i,yc,xc,_c,Gg);if(d){r&&(kg.fromBufferAttribute(r,a),zg.fromBufferAttribute(r,l),Hg.fromBufferAttribute(r,u),d.uv=Pr.getInterpolation(Gg,yc,xc,_c,kg,zg,Hg,new Ae)),s&&(kg.fromBufferAttribute(s,a),zg.fromBufferAttribute(s,l),Hg.fromBufferAttribute(s,u),d.uv1=Pr.getInterpolation(Gg,yc,xc,_c,kg,zg,Hg,new Ae)),o&&(pI.fromBufferAttribute(o,a),mI.fromBufferAttribute(o,l),gI.fromBufferAttribute(o,u),d.normal=Pr.getInterpolation(Gg,yc,xc,_c,pI,mI,gI,new G),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a,b:l,c:u,normal:new G,materialIndex:0};Pr.getNormal(yc,xc,_c,h.normal),d.face=h}return d}class Tl extends Pt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],u=[],d=[],h=[];let p=0,g=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new rt(u,3)),this.setAttribute("normal",new rt(d,3)),this.setAttribute("uv",new rt(h,2));function v(S,x,m,_,A,w,I,P,D,N,B){const T=w/D,F=I/N,X=w/2,J=I/2,q=P/2,$=D+1,K=N+1;let ge=0,z=0;const te=new G;for(let ie=0;ie0?1:-1,d.push(te.x,te.y,te.z),h.push(Ce/D),h.push(1-ie/N),ge+=1}}for(let ie=0;ie0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class jd extends jt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new mt,this.projectionMatrix=new mt,this.projectionMatrixInverse=new mt,this.coordinateSystem=Hs}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const ya=new G,xI=new Ae,_I=new Ae;class ai extends jd{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=ic*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Al*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return ic*2*Math.atan(Math.tan(Al*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){ya.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ya.x,ya.y).multiplyScalar(-e/ya.z),ya.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ya.x,ya.y).multiplyScalar(-e/ya.z)}getViewSize(e,t){return this.getViewBounds(e,xI,_I),t.subVectors(_I,xI)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Al*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/u,r*=o.width/l,i*=o.height/u}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Sc=-90,Mc=1;class AI extends jt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new ai(Sc,Mc,e,t);r.layers=this.layers,this.add(r);const s=new ai(Sc,Mc,e,t);s.layers=this.layers,this.add(s);const o=new ai(Sc,Mc,e,t);o.layers=this.layers,this.add(o);const a=new ai(Sc,Mc,e,t);a.layers=this.layers,this.add(a);const l=new ai(Sc,Mc,e,t);l.layers=this.layers,this.add(l);const u=new ai(Sc,Mc,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const u of t)this.remove(u);if(e===Hs)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ud)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,u,d]=this.children,h=e.getRenderTarget(),p=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const S=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,u),i.texture.generateMipmaps=S,e.setRenderTarget(i,5,r),e.render(t,d),e.setRenderTarget(h,p,g),e.xr.enabled=v,i.texture.needsPMREMUpdate=!0}}class Jd extends Mn{constructor(e,t,i,r,s,o,a,l,u,d){e=e!==void 0?e:[],t=t!==void 0?t:mo,super(e,t,i,r,s,o,a,l,u,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class SI extends ys{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Jd(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:kn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } `,fragmentShader:` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } `},r=new Tl(5,5,5),s=new Ss({name:"CubemapFromEquirect",uniforms:Ac(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:ji,blending:po});s.uniforms.tEquirect.value=t;const o=new jn(r,s),a=t.minFilter;return t.minFilter===Kr&&(t.minFilter=kn),new AI(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const tS=new G,OG=new G,kG=new Dt;class xa{constructor(e=new G(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=tS.subVectors(i,t).cross(OG.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(tS),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||kG.getNormalMatrix(e),r=this.coplanarPoint(tS).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const bl=new _i,Xg=new G;class Kd{constructor(e=new xa,t=new xa,i=new xa,r=new xa,s=new xa,o=new xa){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Hs){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],u=r[4],d=r[5],h=r[6],p=r[7],g=r[8],v=r[9],S=r[10],x=r[11],m=r[12],_=r[13],A=r[14],w=r[15];if(i[0].setComponents(l-s,p-u,x-g,w-m).normalize(),i[1].setComponents(l+s,p+u,x+g,w+m).normalize(),i[2].setComponents(l+o,p+d,x+v,w+_).normalize(),i[3].setComponents(l-o,p-d,x-v,w-_).normalize(),i[4].setComponents(l-a,p-h,x-S,w-A).normalize(),t===Hs)i[5].setComponents(l+a,p+h,x+S,w+A).normalize();else if(t===Ud)i[5].setComponents(a,h,S,A).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),bl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),bl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(bl)}intersectsSprite(e){return bl.center.set(0,0,0),bl.radius=.7071067811865476,bl.applyMatrix4(e.matrixWorld),this.intersectsSphere(bl)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Xg.y=r.normal.y>0?e.max.y:e.min.y,Xg.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Xg)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function MI(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function zG(n){const e=new WeakMap;function t(a,l){const u=a.array,d=a.usage,h=u.byteLength,p=n.createBuffer();n.bindBuffer(l,p),n.bufferData(l,u,d),a.onUploadCallback();let g;if(u instanceof Float32Array)g=n.FLOAT;else if(u instanceof Uint16Array)a.isFloat16BufferAttribute?g=n.HALF_FLOAT:g=n.UNSIGNED_SHORT;else if(u instanceof Int16Array)g=n.SHORT;else if(u instanceof Uint32Array)g=n.UNSIGNED_INT;else if(u instanceof Int32Array)g=n.INT;else if(u instanceof Int8Array)g=n.BYTE;else if(u instanceof Uint8Array)g=n.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)g=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:p,type:g,bytesPerElement:u.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,u){const d=l.array,h=l._updateRange,p=l.updateRanges;if(n.bindBuffer(u,a),h.count===-1&&p.length===0&&n.bufferSubData(u,0,d),p.length!==0){for(let g=0,v=p.length;g 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; float clipOpacity = 1.0; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); if ( clipOpacity == 0.0 ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES float unionClipOpacity = 1.0; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); } #pragma unroll_loop_end clipOpacity *= 1.0 - unionClipOpacity; #endif diffuseColor.a *= clipOpacity; if ( diffuseColor.a == 0.0 ) discard; #else #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif #endif`,i4=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,r4=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,s4=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,o4=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,a4=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,l4=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; #endif`,u4=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; #endif`,c4=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement( a ) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } vec3 pow2( const in vec3 x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract( sin( sn ) * c ); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; #ifdef USE_ALPHAHASH varying vec3 vPosition; #endif vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); } vec3 BRDF_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } // validated`,f4=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; uv.x += filterInt * 3.0 * cubeUV_minTileSize; uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); uv.x *= CUBEUV_TEXEL_WIDTH; uv.y *= CUBEUV_TEXEL_HEIGHT; #ifdef texture2DGradEXT return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; #else return texture2D( envMap, uv ).rgb; #endif } #define cubeUV_r0 1.0 #define cubeUV_m0 - 2.0 #define cubeUV_r1 0.8 #define cubeUV_m1 - 1.0 #define cubeUV_r4 0.4 #define cubeUV_m4 2.0 #define cubeUV_r5 0.305 #define cubeUV_m5 3.0 #define cubeUV_r6 0.21 #define cubeUV_m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= cubeUV_r1 ) { mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; } else if ( roughness >= cubeUV_r4 ) { mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; } else if ( roughness >= cubeUV_r5 ) { mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; } else if ( roughness >= cubeUV_r6 ) { mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`,d4=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif #ifdef USE_BATCHING mat3 bm = mat3( batchingMatrix ); transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); transformedNormal = bm * transformedNormal; #ifdef USE_TANGENT transformedTangent = bm * transformedTangent; #endif #endif #ifdef USE_INSTANCING mat3 im = mat3( instanceMatrix ); transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); transformedNormal = im * transformedNormal; #ifdef USE_TANGENT transformedTangent = im * transformedTangent; #endif #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`,h4=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,p4=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif`,m4=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; #endif`,g4=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,v4="gl_FragColor = linearToOutputTexel( gl_FragColor );",y4=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), vec3( 0.0170827, 0.0723974, 0.9105199 ) ); const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( vec3( 1.2249401, - 0.2249404, 0.0 ), vec3( - 0.0420569, 1.0420571, 0.0 ), vec3( - 0.0196376, - 0.0786361, 1.0982735 ) ); vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); } vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); } vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); }`,x4=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #else vec4 envColor = vec4( 0.0 ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`,_4=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`,A4=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`,S4=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`,M4=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`,w4=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,E4=`#ifdef USE_FOG varying float vFogDepth; #endif`,C4=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`,T4=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,b4=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return vec3( texture2D( gradientMap, coord ).r ); #else vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif }`,R4=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,P4=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,I4=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; }; void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,B4=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; #endif vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; return irradiance; } float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if ( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; } float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { return smoothstep( coneCosine, penumbraCosine, angleCosine ); } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { light.color = directionalLight.color; light.direction = directionalLight.direction; light.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = pointLight.position - geometryPosition; light.direction = normalize( lVector ); float lightDistance = length( lVector ); light.color = pointLight.color; light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = spotLight.position - geometryPosition; light.direction = normalize( lVector ); float angleCos = dot( light.direction, spotLight.direction ); float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); if ( spotAttenuation > 0.0 ) { float lightDistance = length( lVector ); light.color = spotLight.color * spotAttenuation; light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } else { light.color = vec3( 0.0 ); light.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { float dotNL = dot( normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } #endif`,L4=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); return PI * envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 reflectVec = reflect( - viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); return envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } #ifdef USE_ANISOTROPY vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 bentNormal = cross( bitangent, viewDir ); bentNormal = normalize( cross( bentNormal, bitangent ) ); bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); return getIBLRadiance( viewDir, bentNormal, roughness ); #else return vec3( 0.0 ); #endif } #endif #endif`,D4=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,F4=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,N4=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,U4=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; } void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,O4=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; material.roughness = min( material.roughness, 1.0 ); #ifdef IOR material.ior = ior; #ifdef USE_SPECULAR float specularIntensityFactor = specularIntensity; vec3 specularColorFactor = specularColor; #ifdef USE_SPECULAR_COLORMAP specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; #endif #ifdef USE_SPECULAR_INTENSITYMAP specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; #endif material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); #else float specularIntensityFactor = 1.0; vec3 specularColorFactor = vec3( 1.0 ); material.specularF90 = 1.0; #endif material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); material.specularF90 = 1.0; #endif #ifdef USE_CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; material.clearcoatF0 = vec3( 0.04 ); material.clearcoatF90 = 1.0; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_DISPERSION material.dispersion = dispersion; #endif #ifdef USE_IRIDESCENCE material.iridescence = iridescence; material.iridescenceIOR = iridescenceIOR; #ifdef USE_IRIDESCENCEMAP material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; #else material.iridescenceThickness = iridescenceThicknessMaximum; #endif #endif #ifdef USE_SHEEN material.sheenColor = sheenColor; #ifdef USE_SHEEN_COLORMAP material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; #endif material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); #ifdef USE_SHEEN_ROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; #endif #endif #ifdef USE_ANISOTROPY #ifdef USE_ANISOTROPYMAP mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; #else vec2 anisotropyV = anisotropyVector; #endif material.anisotropy = length( anisotropyV ); if( material.anisotropy == 0.0 ) { anisotropyV = vec2( 1.0, 0.0 ); } else { anisotropyV /= material.anisotropy; material.anisotropy = saturate( material.anisotropy ); } material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; #endif`,k4=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; float specularF90; float dispersion; #ifdef USE_CLEARCOAT float clearcoat; float clearcoatRoughness; vec3 clearcoatF0; float clearcoatF90; #endif #ifdef USE_IRIDESCENCE float iridescence; float iridescenceIOR; float iridescenceThickness; vec3 iridescenceFresnel; vec3 iridescenceF0; #endif #ifdef USE_SHEEN vec3 sheenColor; float sheenRoughness; #endif #ifdef IOR float ior; #endif #ifdef USE_TRANSMISSION float transmission; float transmissionAlpha; float thickness; float attenuationDistance; vec3 attenuationColor; #endif #ifdef USE_ANISOTROPY float anisotropy; float alphaT; vec3 anisotropyT; vec3 anisotropyB; #endif }; vec3 clearcoatSpecularDirect = vec3( 0.0 ); vec3 clearcoatSpecularIndirect = vec3( 0.0 ); vec3 sheenSpecularDirect = vec3( 0.0 ); vec3 sheenSpecularIndirect = vec3(0.0 ); vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); float x2 = x * x; float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); } float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } #ifdef USE_ANISOTROPY float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); float v = 0.5 / ( gv + gl ); return saturate(v); } float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { float a2 = alphaT * alphaB; highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); highp float v2 = dot( v, v ); float w2 = a2 / v2; return RECIPROCAL_PI * a2 * pow2 ( w2 ); } #endif #ifdef USE_CLEARCOAT vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { vec3 f0 = material.clearcoatF0; float f90 = material.clearcoatF90; float roughness = material.clearcoatRoughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( V * D ); } #endif vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { vec3 f0 = material.specularColor; float f90 = material.specularF90; float roughness = material.roughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); #ifdef USE_IRIDESCENCE F = mix( F, material.iridescenceFresnel, material.iridescence ); #endif #ifdef USE_ANISOTROPY float dotTL = dot( material.anisotropyT, lightDir ); float dotTV = dot( material.anisotropyT, viewDir ); float dotTH = dot( material.anisotropyT, halfDir ); float dotBL = dot( material.anisotropyB, lightDir ); float dotBV = dot( material.anisotropyB, viewDir ); float dotBH = dot( material.anisotropyB, halfDir ); float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); #else float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); #endif return F * ( V * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } #if defined( USE_SHEEN ) float D_Charlie( float roughness, float dotNH ) { float alpha = pow2( roughness ); float invAlpha = 1.0 / alpha; float cos2h = dotNH * dotNH; float sin2h = max( 1.0 - cos2h, 0.0078125 ); return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); } float V_Neubelt( float dotNV, float dotNL ) { return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); } vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float D = D_Charlie( sheenRoughness, dotNH ); float V = V_Neubelt( dotNV, dotNL ); return sheenColor * ( D * V ); } #endif float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); float r2 = roughness * roughness; float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); return saturate( DG * RECIPROCAL_PI ); } vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; return fab; } vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { vec2 fab = DFGApprox( normal, viewDir, roughness ); return specularColor * fab.x + specularF90 * fab.y; } #ifdef USE_IRIDESCENCE void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { #else void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { #endif vec2 fab = DFGApprox( normal, viewDir, roughness ); #ifdef USE_IRIDESCENCE vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); #else vec3 Fr = specularColor; #endif vec3 FssEss = Fr * fab.x + specularF90 * fab.y; float Ess = fab.x + fab.y; float Ems = 1.0 - Ess; vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } #if NUM_RECT_AREA_LIGHTS > 0 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { vec3 normal = geometryNormal; vec3 viewDir = geometryViewDir; vec3 position = geometryPosition; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.roughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifdef USE_CLEARCOAT float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = dotNLcc * directLight.color; clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); #endif #ifdef USE_SHEEN sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); #endif reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { #ifdef USE_CLEARCOAT clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); #endif #ifdef USE_SHEEN sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); #endif vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; #ifdef USE_IRIDESCENCE computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); #else computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); #endif vec3 totalScattering = singleScattering + multiScattering; vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); reflectedLight.indirectSpecular += radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`,z4=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); vec3 geometryClearcoatNormal = vec3( 0.0 ); #ifdef USE_CLEARCOAT geometryClearcoatNormal = clearcoatNormal; #endif #ifdef USE_IRIDESCENCE float dotNVi = saturate( dot( normal, geometryViewDir ) ); if ( material.iridescenceThickness == 0.0 ) { material.iridescence = 0.0; } else { material.iridescence = saturate( material.iridescence ); } if ( material.iridescence > 0.0 ) { material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); } #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointLightInfo( pointLight, geometryPosition, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; vec4 spotColor; vec3 spotLightCoord; bool inSpotLightMap; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotLightInfo( spotLight, geometryPosition, directLight ); #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS #else #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #endif #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; #endif #undef SPOT_LIGHT_MAP_INDEX #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalLightInfo( directionalLight, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); #if defined( USE_LIGHT_PROBES ) irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); #endif #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`,H4=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getIBLIrradiance( geometryNormal ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) #ifdef USE_ANISOTROPY radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); #else radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); #endif #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif #endif`,G4=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif`,V4=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,W4=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,X4=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; #endif`,j4=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #endif`,J4=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; #endif`,K4=`#ifdef USE_MAP uniform sampler2D map; #endif`,Y4=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #endif #ifdef USE_MAP diffuseColor *= texture2D( map, uv ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`,Q4=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`,q4=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; #endif`,Z4=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,$4=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } #endif`,eV=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; #elif defined( USE_COLOR ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } #endif`,tV=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } #endif`,nV=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; #endif uniform sampler2DArray morphTargetsTexture; uniform ivec2 morphTargetsTextureSize; vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; int y = texelIndex / morphTargetsTextureSize.x; int x = texelIndex - y * morphTargetsTextureSize.x; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } #endif`,iV=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } #endif`,rV=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal *= faceDirection; #endif #endif #if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) #ifdef USE_TANGENT mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn = getTangentFrame( - vViewPosition, normal, #if defined( USE_NORMALMAP ) vNormalMapUv #elif defined( USE_CLEARCOAT_NORMALMAP ) vClearcoatNormalMapUv #else vUv #endif ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn[0] *= faceDirection; tbn[1] *= faceDirection; #endif #endif #ifdef USE_CLEARCOAT_NORMALMAP #ifdef USE_TANGENT mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn2[0] *= faceDirection; tbn2[1] *= faceDirection; #endif #endif vec3 nonPerturbedNormal = normal;`,sV=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( USE_NORMALMAP_TANGENTSPACE ) vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`,oV=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,aV=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,lV=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif`,uV=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef USE_NORMALMAP_OBJECTSPACE uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { vec3 q0 = dFdx( eye_pos.xyz ); vec3 q1 = dFdy( eye_pos.xyz ); vec2 st0 = dFdx( uv.st ); vec2 st1 = dFdy( uv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } #endif`,cV=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif`,fV=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif`,dV=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif`,hV=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,pV=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,mV=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; const float Inv255 = 1. / 255.; const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); vec4 packDepthToRGBA( const in float v ) { if( v <= 0.0 ) return vec4( 0., 0., 0., 0. ); if( v >= 1.0 ) return vec4( 1., 1., 1., 1. ); float vuf; float af = modf( v * PackFactors.a, vuf ); float bf = modf( vuf * ShiftRight8, vuf ); float gf = modf( vuf * ShiftRight8, vuf ); return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); } vec3 packDepthToRGB( const in float v ) { if( v <= 0.0 ) return vec3( 0., 0., 0. ); if( v >= 1.0 ) return vec3( 1., 1., 1. ); float vuf; float bf = modf( v * PackFactors.b, vuf ); float gf = modf( vuf * ShiftRight8, vuf ); return vec3( vuf * Inv255, gf * PackUpscale, bf ); } vec2 packDepthToRG( const in float v ) { if( v <= 0.0 ) return vec2( 0., 0. ); if( v >= 1.0 ) return vec2( 1., 1. ); float vuf; float gf = modf( v * 256., vuf ); return vec2( vuf * Inv255, gf ); } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors4 ); } float unpackRGBToDepth( const in vec3 v ) { return dot( v, UnpackFactors3 ); } float unpackRGToDepth( const in vec2 v ) { return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; } vec4 pack2HalfToRGBA( const in vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); } vec2 unpackRGBATo2Half( const in vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { return depth * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); }`,gV=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,vV=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`,yV=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,xV=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`,_V=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; #endif`,AV=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,SV=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; bool frustumTest = inFrustum && shadowCoord.z <= 1.0; if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return mix( 1.0, shadow, shadowIntensity ); } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { float shadow = 1.0; vec3 lightToPosition = shadowCoord.xyz; float lightToPositionLength = length( lightToPosition ); if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; shadow = ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } return mix( 1.0, shadow, shadowIntensity ); } #endif`,MV=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 struct SpotLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`,wV=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if defined( USE_SHADOWMAP ) #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif #if NUM_SPOT_LIGHT_COORDS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { shadowWorldPosition = worldPosition; #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; #endif vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif`,EV=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`,CV=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,TV=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; mat4 getBoneMatrix( const in float i ) { int size = textureSize( boneTexture, 0 ).x; int j = int( i ) * 4; int x = j % size; int y = j / size; vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } #endif`,bV=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`,RV=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`,PV=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,IV=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,BV=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,LV=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return saturate( toneMappingExposure * color ); } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( vec3( 1.6605, - 0.1246, - 0.0182 ), vec3( - 0.5876, 1.1329, - 0.1006 ), vec3( - 0.0728, - 0.0083, 1.1187 ) ); const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( vec3( 0.6274, 0.0691, 0.0164 ), vec3( 0.3293, 0.9195, 0.0880 ), vec3( 0.0433, 0.0113, 0.8956 ) ); vec3 agxDefaultContrastApprox( vec3 x ) { vec3 x2 = x * x; vec3 x4 = x2 * x2; return + 15.5 * x4 * x2 - 40.14 * x4 * x + 31.96 * x4 - 6.868 * x2 * x + 0.4298 * x2 + 0.1191 * x - 0.00232; } vec3 AgXToneMapping( vec3 color ) { const mat3 AgXInsetMatrix = mat3( vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) ); const mat3 AgXOutsetMatrix = mat3( vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) ); const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; color *= toneMappingExposure; color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; color = AgXInsetMatrix * color; color = max( color, 1e-10 ); color = log2( color ); color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); color = clamp( color, 0.0, 1.0 ); color = agxDefaultContrastApprox( color ); color = AgXOutsetMatrix * color; color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); color = LINEAR_REC2020_TO_LINEAR_SRGB * color; color = clamp( color, 0.0, 1.0 ); return color; } vec3 NeutralToneMapping( vec3 color ) { const float StartCompression = 0.8 - 0.04; const float Desaturation = 0.15; color *= toneMappingExposure; float x = min( color.r, min( color.g, color.b ) ); float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; color -= offset; float peak = max( color.r, max( color.g, color.b ) ); if ( peak < StartCompression ) return color; float d = 1. - StartCompression; float newPeak = 1. - d * d / ( peak + d - StartCompression ); color *= newPeak / peak; float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } vec3 CustomToneMapping( vec3 color ) { return color; }`,DV=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; material.attenuationDistance = attenuationDistance; material.attenuationColor = attenuationColor; #ifdef USE_TRANSMISSIONMAP material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; #endif #ifdef USE_THICKNESSMAP material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; #endif vec3 pos = vWorldPosition; vec3 v = normalize( cameraPosition - pos ); vec3 n = inverseTransformDirection( normal, viewMatrix ); vec4 transmitted = getIBLVolumeRefraction( n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); #endif`,FV=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; uniform vec3 attenuationColor; #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec3 vWorldPosition; float w0( float a ) { return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); } float w1( float a ) { return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); } float w2( float a ){ return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); } float w3( float a ) { return ( 1.0 / 6.0 ) * ( a * a * a ); } float g0( float a ) { return w0( a ) + w1( a ); } float g1( float a ) { return w2( a ) + w3( a ); } float h0( float a ) { return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); } float h1( float a ) { return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); } vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { uv = uv * texelSize.zw + 0.5; vec2 iuv = floor( uv ); vec2 fuv = fract( uv ); float g0x = g0( fuv.x ); float g1x = g1( fuv.x ); float h0x = h0( fuv.x ); float h1x = h1( fuv.x ); float h0y = h0( fuv.y ); float h1y = h1( fuv.y ); vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); } vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); vec2 fLodSizeInv = 1.0 / fLodSize; vec2 cLodSizeInv = 1.0 / cLodSize; vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); return mix( fSample, cSample, fract( lod ) ); } vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); vec3 modelScale; modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); return normalize( refractionVector ) * thickness * modelScale; } float applyIorToRoughness( const in float roughness, const in float ior ) { return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); } vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); } vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { if ( isinf( attenuationDistance ) ) { return vec3( 1.0 ); } else { vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; } } vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, const in vec3 attenuationColor, const in float attenuationDistance ) { vec4 transmittedLight; vec3 transmittance; #ifdef USE_DISPERSION float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); for ( int i = 0; i < 3; i ++ ) { vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); transmittedLight[ i ] = transmissionSample[ i ]; transmittedLight.a += transmissionSample.a; transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; } transmittedLight.a /= 3.0; #else vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); #endif vec3 attenuatedColor = transmittance * transmittedLight.rgb; vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } #endif`,NV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP varying vec2 vNormalMapUv; #endif #ifdef USE_EMISSIVEMAP varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SHEEN_COLORMAP varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_SPECULARMAP varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,UV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP uniform mat3 mapTransform; varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP uniform mat3 alphaMapTransform; varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP uniform mat3 lightMapTransform; varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP uniform mat3 aoMapTransform; varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP uniform mat3 bumpMapTransform; varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP uniform mat3 normalMapTransform; varying vec2 vNormalMapUv; #endif #ifdef USE_DISPLACEMENTMAP uniform mat3 displacementMapTransform; varying vec2 vDisplacementMapUv; #endif #ifdef USE_EMISSIVEMAP uniform mat3 emissiveMapTransform; varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP uniform mat3 metalnessMapTransform; varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP uniform mat3 roughnessMapTransform; varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP uniform mat3 anisotropyMapTransform; varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP uniform mat3 clearcoatMapTransform; varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform mat3 clearcoatNormalMapTransform; varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform mat3 clearcoatRoughnessMapTransform; varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_SHEEN_COLORMAP uniform mat3 sheenColorMapTransform; varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform mat3 sheenRoughnessMapTransform; varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP uniform mat3 iridescenceMapTransform; varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform mat3 iridescenceThicknessMapTransform; varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SPECULARMAP uniform mat3 specularMapTransform; varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP uniform mat3 specularColorMapTransform; varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform mat3 specularIntensityMapTransform; varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,OV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; #endif #ifdef USE_ALPHAMAP vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; #endif #ifdef USE_LIGHTMAP vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; #endif #ifdef USE_AOMAP vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; #endif #ifdef USE_BUMPMAP vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; #endif #ifdef USE_NORMALMAP vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_DISPLACEMENTMAP vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; #endif #ifdef USE_EMISSIVEMAP vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; #endif #ifdef USE_METALNESSMAP vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ROUGHNESSMAP vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ANISOTROPYMAP vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOATMAP vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_NORMALMAP vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCEMAP vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_COLORMAP vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_ROUGHNESSMAP vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULARMAP vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_COLORMAP vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_INTENSITYMAP vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; #endif #ifdef USE_TRANSMISSIONMAP vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; #endif`,kV=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; #endif #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`;const Nt={alphahash_fragment:HG,alphahash_pars_fragment:GG,alphamap_fragment:VG,alphamap_pars_fragment:WG,alphatest_fragment:XG,alphatest_pars_fragment:jG,aomap_fragment:JG,aomap_pars_fragment:KG,batching_pars_vertex:YG,batching_vertex:QG,begin_vertex:qG,beginnormal_vertex:ZG,bsdfs:$G,iridescence_fragment:e4,bumpmap_pars_fragment:t4,clipping_planes_fragment:n4,clipping_planes_pars_fragment:i4,clipping_planes_pars_vertex:r4,clipping_planes_vertex:s4,color_fragment:o4,color_pars_fragment:a4,color_pars_vertex:l4,color_vertex:u4,common:c4,cube_uv_reflection_fragment:f4,defaultnormal_vertex:d4,displacementmap_pars_vertex:h4,displacementmap_vertex:p4,emissivemap_fragment:m4,emissivemap_pars_fragment:g4,colorspace_fragment:v4,colorspace_pars_fragment:y4,envmap_fragment:x4,envmap_common_pars_fragment:_4,envmap_pars_fragment:A4,envmap_pars_vertex:S4,envmap_physical_pars_fragment:L4,envmap_vertex:M4,fog_vertex:w4,fog_pars_vertex:E4,fog_fragment:C4,fog_pars_fragment:T4,gradientmap_pars_fragment:b4,lightmap_pars_fragment:R4,lights_lambert_fragment:P4,lights_lambert_pars_fragment:I4,lights_pars_begin:B4,lights_toon_fragment:D4,lights_toon_pars_fragment:F4,lights_phong_fragment:N4,lights_phong_pars_fragment:U4,lights_physical_fragment:O4,lights_physical_pars_fragment:k4,lights_fragment_begin:z4,lights_fragment_maps:H4,lights_fragment_end:G4,logdepthbuf_fragment:V4,logdepthbuf_pars_fragment:W4,logdepthbuf_pars_vertex:X4,logdepthbuf_vertex:j4,map_fragment:J4,map_pars_fragment:K4,map_particle_fragment:Y4,map_particle_pars_fragment:Q4,metalnessmap_fragment:q4,metalnessmap_pars_fragment:Z4,morphinstance_vertex:$4,morphcolor_vertex:eV,morphnormal_vertex:tV,morphtarget_pars_vertex:nV,morphtarget_vertex:iV,normal_fragment_begin:rV,normal_fragment_maps:sV,normal_pars_fragment:oV,normal_pars_vertex:aV,normal_vertex:lV,normalmap_pars_fragment:uV,clearcoat_normal_fragment_begin:cV,clearcoat_normal_fragment_maps:fV,clearcoat_pars_fragment:dV,iridescence_pars_fragment:hV,opaque_fragment:pV,packing:mV,premultiplied_alpha_fragment:gV,project_vertex:vV,dithering_fragment:yV,dithering_pars_fragment:xV,roughnessmap_fragment:_V,roughnessmap_pars_fragment:AV,shadowmap_pars_fragment:SV,shadowmap_pars_vertex:MV,shadowmap_vertex:wV,shadowmask_pars_fragment:EV,skinbase_vertex:CV,skinning_pars_vertex:TV,skinning_vertex:bV,skinnormal_vertex:RV,specularmap_fragment:PV,specularmap_pars_fragment:IV,tonemapping_fragment:BV,tonemapping_pars_fragment:LV,transmission_fragment:DV,transmission_pars_fragment:FV,uv_pars_fragment:NV,uv_pars_vertex:UV,uv_vertex:OV,worldpos_vertex:kV,background_vert:`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,background_frag:`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); #ifdef DECODE_VIDEO_TEXTURE texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,backgroundCube_vert:`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; #endif uniform float flipEnvMap; uniform float backgroundBlurriness; uniform float backgroundIntensity; uniform mat3 backgroundRotation; varying vec3 vWorldDirection; #include void main() { #ifdef ENVMAP_TYPE_CUBE vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); #else vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,cube_vert:`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,cube_frag:`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; void main() { vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); gl_FragColor = texColor; gl_FragColor.a *= opacity; #include #include }`,depth_vert:`#include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`,depth_frag:`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { vec4 diffuseColor = vec4( 1.0 ); #include #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #elif DEPTH_PACKING == 3202 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif }`,distanceRGBA_vert:`#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include #include void main() { #include #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`,distanceRGBA_frag:`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include #include #include void main () { vec4 diffuseColor = vec4( 1.0 ); #include #include #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`,equirect_vert:`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,equirect_frag:`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include }`,linedashed_vert:`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include #include #include #include }`,linedashed_frag:`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,meshbasic_vert:`#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) #include #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`,meshbasic_frag:`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include #include #include #include #include #include #include }`,meshlambert_vert:`#define LAMBERT varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,meshlambert_frag:`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,meshmatcap_vert:`#define MATCAP varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`,meshmatcap_frag:`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); #else vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; #include #include #include #include #include #include }`,meshnormal_vert:`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif }`,meshnormal_frag:`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); #ifdef OPAQUE gl_FragColor.a = 1.0; #endif }`,meshphong_vert:`#define PHONG varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,meshphong_frag:`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,meshphysical_vert:`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif }`,meshphysical_frag:`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef IOR uniform float ior; #endif #ifdef USE_SPECULAR uniform float specularIntensity; uniform vec3 specularColor; #ifdef USE_SPECULAR_COLORMAP uniform sampler2D specularColorMap; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform sampler2D specularIntensityMap; #endif #endif #ifdef USE_CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_DISPERSION uniform float dispersion; #endif #ifdef USE_IRIDESCENCE uniform float iridescence; uniform float iridescenceIOR; uniform float iridescenceThicknessMinimum; uniform float iridescenceThicknessMaximum; #endif #ifdef USE_SHEEN uniform vec3 sheenColor; uniform float sheenRoughness; #ifdef USE_SHEEN_COLORMAP uniform sampler2D sheenColorMap; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform sampler2D sheenRoughnessMap; #endif #endif #ifdef USE_ANISOTROPY uniform vec2 anisotropyVector; #ifdef USE_ANISOTROPYMAP uniform sampler2D anisotropyMap; #endif #endif varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; #ifdef USE_SHEEN float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; #endif #ifdef USE_CLEARCOAT float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; #endif #include #include #include #include #include #include }`,meshtoon_vert:`#define TOON varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`,meshtoon_frag:`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include }`,points_vert:`uniform float size; uniform float scale; #include #include #include #include #include #include #ifdef USE_POINTS_UV varying vec2 vUv; uniform mat3 uvTransform; #endif void main() { #ifdef USE_POINTS_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif #include #include #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`,points_frag:`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,shadow_vert:`#include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`,shadow_frag:`uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include #include void main() { #include gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`,sprite_vert:`uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`,sprite_frag:`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include }`},We={common:{diffuse:{value:new ke(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new Ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ke(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ke(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new ke(16777215)},opacity:{value:1},center:{value:new Ae(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},Ms={basic:{uniforms:Ki([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.fog]),vertexShader:Nt.meshbasic_vert,fragmentShader:Nt.meshbasic_frag},lambert:{uniforms:Ki([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.fog,We.lights,{emissive:{value:new ke(0)}}]),vertexShader:Nt.meshlambert_vert,fragmentShader:Nt.meshlambert_frag},phong:{uniforms:Ki([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.fog,We.lights,{emissive:{value:new ke(0)},specular:{value:new ke(1118481)},shininess:{value:30}}]),vertexShader:Nt.meshphong_vert,fragmentShader:Nt.meshphong_frag},standard:{uniforms:Ki([We.common,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.roughnessmap,We.metalnessmap,We.fog,We.lights,{emissive:{value:new ke(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag},toon:{uniforms:Ki([We.common,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.gradientmap,We.fog,We.lights,{emissive:{value:new ke(0)}}]),vertexShader:Nt.meshtoon_vert,fragmentShader:Nt.meshtoon_frag},matcap:{uniforms:Ki([We.common,We.bumpmap,We.normalmap,We.displacementmap,We.fog,{matcap:{value:null}}]),vertexShader:Nt.meshmatcap_vert,fragmentShader:Nt.meshmatcap_frag},points:{uniforms:Ki([We.points,We.fog]),vertexShader:Nt.points_vert,fragmentShader:Nt.points_frag},dashed:{uniforms:Ki([We.common,We.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nt.linedashed_vert,fragmentShader:Nt.linedashed_frag},depth:{uniforms:Ki([We.common,We.displacementmap]),vertexShader:Nt.depth_vert,fragmentShader:Nt.depth_frag},normal:{uniforms:Ki([We.common,We.bumpmap,We.normalmap,We.displacementmap,{opacity:{value:1}}]),vertexShader:Nt.meshnormal_vert,fragmentShader:Nt.meshnormal_frag},sprite:{uniforms:Ki([We.sprite,We.fog]),vertexShader:Nt.sprite_vert,fragmentShader:Nt.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Nt.background_vert,fragmentShader:Nt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:Nt.backgroundCube_vert,fragmentShader:Nt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Nt.cube_vert,fragmentShader:Nt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Nt.equirect_vert,fragmentShader:Nt.equirect_frag},distanceRGBA:{uniforms:Ki([We.common,We.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Nt.distanceRGBA_vert,fragmentShader:Nt.distanceRGBA_frag},shadow:{uniforms:Ki([We.lights,We.fog,{color:{value:new ke(0)},opacity:{value:1}}]),vertexShader:Nt.shadow_vert,fragmentShader:Nt.shadow_frag}};Ms.physical={uniforms:Ki([Ms.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new Ae(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new ke(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new Ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new ke(0)},specularColor:{value:new ke(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new Ae},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag};const jg={r:0,b:0,g:0},Rl=new cr,zV=new mt;function HV(n,e,t,i,r,s,o){const a=new ke(0);let l=s===!0?0:1,u,d,h=null,p=0,g=null;function v(_){let A=_.isScene===!0?_.background:null;return A&&A.isTexture&&(A=(_.backgroundBlurriness>0?t:e).get(A)),A}function S(_){let A=!1;const w=v(_);w===null?m(a,l):w&&w.isColor&&(m(w,1),A=!0);const I=n.xr.getEnvironmentBlendMode();I==="additive"?i.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||A)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function x(_,A){const w=v(A);w&&(w.isCubeTexture||w.mapping===Qu)?(d===void 0&&(d=new jn(new Tl(1,1,1),new Ss({name:"BackgroundCubeMaterial",uniforms:Ac(Ms.backgroundCube.uniforms),vertexShader:Ms.backgroundCube.vertexShader,fragmentShader:Ms.backgroundCube.fragmentShader,side:ji,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(I,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(d)),Rl.copy(A.backgroundRotation),Rl.x*=-1,Rl.y*=-1,Rl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Rl.y*=-1,Rl.z*=-1),d.material.uniforms.envMap.value=w,d.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(zV.makeRotationFromEuler(Rl)),d.material.toneMapped=tn.getTransfer(w.colorSpace)!==vn,(h!==w||p!==w.version||g!==n.toneMapping)&&(d.material.needsUpdate=!0,h=w,p=w.version,g=n.toneMapping),d.layers.enableAll(),_.unshift(d,d.geometry,d.material,0,0,null)):w&&w.isTexture&&(u===void 0&&(u=new jn(new wc(2,2),new Ss({name:"BackgroundMaterial",uniforms:Ac(Ms.background.uniforms),vertexShader:Ms.background.vertexShader,fragmentShader:Ms.background.fragmentShader,side:ks,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(u)),u.material.uniforms.t2D.value=w,u.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,u.material.toneMapped=tn.getTransfer(w.colorSpace)!==vn,w.matrixAutoUpdate===!0&&w.updateMatrix(),u.material.uniforms.uvTransform.value.copy(w.matrix),(h!==w||p!==w.version||g!==n.toneMapping)&&(u.material.needsUpdate=!0,h=w,p=w.version,g=n.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null))}function m(_,A){_.getRGB(jg,vI(n)),i.buffers.color.setClear(jg.r,jg.g,jg.b,A,o)}return{getClearColor:function(){return a},setClearColor:function(_,A=1){a.set(_),l=A,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(_){l=_,m(a,l)},render:S,addToRenderList:x}}function GV(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null);let s=r,o=!1;function a(T,F,X,J,q){let $=!1;const K=h(J,X,F);s!==K&&(s=K,u(s.object)),$=g(T,J,X,q),$&&v(T,J,X,q),q!==null&&e.update(q,n.ELEMENT_ARRAY_BUFFER),($||o)&&(o=!1,w(T,F,X,J),q!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(q).buffer))}function l(){return n.createVertexArray()}function u(T){return n.bindVertexArray(T)}function d(T){return n.deleteVertexArray(T)}function h(T,F,X){const J=X.wireframe===!0;let q=i[T.id];q===void 0&&(q={},i[T.id]=q);let $=q[F.id];$===void 0&&($={},q[F.id]=$);let K=$[J];return K===void 0&&(K=p(l()),$[J]=K),K}function p(T){const F=[],X=[],J=[];for(let q=0;q=0){const ie=q[z];let fe=$[z];if(fe===void 0&&(z==="instanceMatrix"&&T.instanceMatrix&&(fe=T.instanceMatrix),z==="instanceColor"&&T.instanceColor&&(fe=T.instanceColor)),ie===void 0||ie.attribute!==fe||fe&&ie.data!==fe.data)return!0;K++}return s.attributesNum!==K||s.index!==J}function v(T,F,X,J){const q={},$=F.attributes;let K=0;const ge=X.getAttributes();for(const z in ge)if(ge[z].location>=0){let ie=$[z];ie===void 0&&(z==="instanceMatrix"&&T.instanceMatrix&&(ie=T.instanceMatrix),z==="instanceColor"&&T.instanceColor&&(ie=T.instanceColor));const fe={};fe.attribute=ie,ie&&ie.data&&(fe.data=ie.data),q[z]=fe,K++}s.attributes=q,s.attributesNum=K,s.index=J}function S(){const T=s.newAttributes;for(let F=0,X=T.length;F=0){let te=q[ge];if(te===void 0&&(ge==="instanceMatrix"&&T.instanceMatrix&&(te=T.instanceMatrix),ge==="instanceColor"&&T.instanceColor&&(te=T.instanceColor)),te!==void 0){const ie=te.normalized,fe=te.itemSize,Ce=e.get(te);if(Ce===void 0)continue;const ot=Ce.buffer,re=Ce.type,Me=Ce.bytesPerElement,Ie=re===n.INT||re===n.UNSIGNED_INT||te.gpuType===Xm;if(te.isInterleavedBufferAttribute){const Be=te.data,$e=Be.stride,wt=te.offset;if(Be.isInstancedInterleavedBuffer){for(let vt=0;vt0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=t.precision!==void 0?t.precision:"highp";const d=l(u);d!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",d,"instead."),u=d);const h=t.logarithmicDepthBuffer===!0,p=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),S=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),x=n.getParameter(n.MAX_VERTEX_ATTRIBS),m=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),_=n.getParameter(n.MAX_VARYING_VECTORS),A=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),w=g>0,I=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:u,logarithmicDepthBuffer:h,maxTextures:p,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:S,maxAttributes:x,maxVertexUniforms:m,maxVaryings:_,maxFragmentUniforms:A,vertexTextures:w,maxSamples:I}}function XV(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new xa,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p){const g=h.length!==0||p||i!==0||r;return r=p,i=h.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,p){t=d(h,p,0)},this.setState=function(h,p,g){const v=h.clippingPlanes,S=h.clipIntersection,x=h.clipShadows,m=n.get(h);if(!r||v===null||v.length===0||s&&!x)s?d(null):u();else{const _=s?0:i,A=_*4;let w=m.clippingState||null;l.value=w,w=d(v,p,A,g);for(let I=0;I!==A;++I)w[I]=t[I];m.clippingState=w,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=_}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(h,p,g,v){const S=h!==null?h.length:0;let x=null;if(S!==0){if(x=l.value,v!==!0||x===null){const m=g+S*4,_=p.matrixWorldInverse;a.getNormalMatrix(_),(x===null||x.length0){const u=new SI(l.height);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",r),t(u.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Ec extends jd{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Cc=4,wI=[.125,.215,.35,.446,.526,.582],Pl=20,nS=new Ec,EI=new ke;let iS=null,rS=0,sS=0,oS=!1;const Il=(1+Math.sqrt(5))/2,Tc=1/Il,CI=[new G(-Il,Tc,0),new G(Il,Tc,0),new G(-Tc,0,Il),new G(Tc,0,Il),new G(0,Il,-Tc),new G(0,Il,Tc),new G(-1,1,-1),new G(1,1,-1),new G(-1,1,1),new G(1,1,1)];class aS{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){iS=this._renderer.getRenderTarget(),rS=this._renderer.getActiveCubeFace(),sS=this._renderer.getActiveMipmapLevel(),oS=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=RI(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=bI(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?A:0,A,A),d.setRenderTarget(r),S&&d.render(v,a),d.render(e,a)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=h,e.background=x}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===mo||e.mapping===ca;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=RI()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=bI());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new jn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Jg(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,nS)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sPl&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Pl}`);const m=[];let _=0;for(let D=0;DA-Cc?r-A+Cc:0),P=4*(this._cubeSize-w);Jg(t,I,P,3*w,2*w),l.setRenderTarget(t),l.render(h,nS)}}function JV(n){const e=[],t=[],i=[];let r=n;const s=n-Cc+1+wI.length;for(let o=0;on-Cc?l=wI[o-n+Cc-1]:o===0&&(l=0),i.push(l);const u=1/(a-2),d=-u,h=1+u,p=[d,d,h,d,h,h,d,d,h,h,d,h],g=6,v=6,S=3,x=2,m=1,_=new Float32Array(S*v*g),A=new Float32Array(x*v*g),w=new Float32Array(m*v*g);for(let P=0;P2?0:-1,B=[D,N,0,D+2/3,N,0,D+2/3,N+1,0,D,N,0,D+2/3,N+1,0,D,N+1,0];_.set(B,S*v*P),A.set(p,x*v*P);const T=[P,P,P,P,P,P];w.set(T,m*v*P)}const I=new Pt;I.setAttribute("position",new $t(_,S)),I.setAttribute("uv",new $t(A,x)),I.setAttribute("faceIndex",new $t(w,m)),e.push(I),r>Cc&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function TI(n,e,t){const i=new ys(n,e,t);return i.texture.mapping=Qu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Jg(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function KV(n,e,t){const i=new Float32Array(Pl),r=new G(0,1,0);return new Ss({name:"SphericalGaussianBlur",defines:{n:Pl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:lS(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } } `,blending:po,depthTest:!1,depthWrite:!1})}function bI(){return new Ss({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:lS(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; #include void main() { vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } `,blending:po,depthTest:!1,depthWrite:!1})}function RI(){return new Ss({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:lS(),fragmentShader:` precision mediump float; precision mediump int; uniform float flipEnvMap; varying vec3 vOutputDirection; uniform samplerCube envMap; void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } `,blending:po,depthTest:!1,depthWrite:!1})}function lS(){return` precision mediump float; precision mediump int; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } `}function YV(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,u=l===Md||l===wd,d=l===mo||l===ca;if(u||d){let h=e.get(a);const p=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==p)return t===null&&(t=new aS(n)),h=u?t.fromEquirectangular(a,h):t.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),h.texture;if(h!==void 0)return h.texture;{const g=a.image;return u&&g&&g.height>0||d&&g&&r(g)?(t===null&&(t=new aS(n)),h=u?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const u=6;for(let d=0;de.maxTextureSize&&(I=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const P=new Float32Array(w*I*4*h),D=new Tg(P,w,I,h);D.type=ur,D.needsUpdate=!0;const N=A*4;for(let T=0;T0)return n;const r=e*t;let s=FI[r];if(s===void 0&&(s=new Float32Array(r),FI[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function li(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` `)}function Y9(n){const e=tn.getPrimaries(tn.workingColorSpace),t=tn.getPrimaries(n);let i;switch(e===t?i="":e===Fd&&t===Dd?i="LinearDisplayP3ToLinearSRGB":e===Dd&&t===Fd&&(i="LinearSRGBToLinearDisplayP3"),n){case yo:case Bd:return[i,"LinearTransferOETF"];case Yr:case Cg:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function GI(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+r+` `+K9(n.getShaderSource(e),o)}else return r}function Q9(n,e){const t=Y9(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function q9(n,e){let t;switch(e){case CP:t="Linear";break;case TP:t="Reinhard";break;case bP:t="OptimizedCineon";break;case yA:t="ACESFilmic";break;case PP:t="AgX";break;case IP:t="Neutral";break;case RP:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Qg=new G;function Z9(){tn.getLuminanceCoefficients(Qg);const n=Qg.x.toFixed(4),e=Qg.y.toFixed(4),t=Qg.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` `)}function $9(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Yd).join(` `)}function e5(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` `)}function t5(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function fS(n){return n.replace(n5,r5)}const i5=new Map;function r5(n,e){let t=Nt[e];if(t===void 0){const i=i5.get(e);if(i!==void 0)t=Nt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return fS(t)}const s5=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function XI(n){return n.replace(s5,o5)}function o5(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(x+=` `),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Yd).join(` `),m.length>0&&(m+=` `)):(x=[jI(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(Yd).join(` `),m=[jI(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",t.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==zs?"#define TONE_MAPPING":"",t.toneMapping!==zs?Nt.tonemapping_pars_fragment:"",t.toneMapping!==zs?q9("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Nt.colorspace_pars_fragment,Q9("linearToOutputTexel",t.outputColorSpace),Z9(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(Yd).join(` `)),o=fS(o),o=VI(o,t),o=WI(o,t),a=fS(a),a=VI(a,t),a=WI(a,t),o=XI(o),a=XI(a),t.isRawShaderMaterial!==!0&&(_=`#version 300 es `,x=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+x,m=["#define varying in",t.glslVersion===LA?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===LA?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` `+m);const A=_+x+o,w=_+m+a,I=HI(r,r.VERTEX_SHADER,A),P=HI(r,r.FRAGMENT_SHADER,w);r.attachShader(S,I),r.attachShader(S,P),t.index0AttributeName!==void 0?r.bindAttribLocation(S,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(S,0,"position"),r.linkProgram(S);function D(F){if(n.debug.checkShaderErrors){const X=r.getProgramInfoLog(S).trim(),J=r.getShaderInfoLog(I).trim(),q=r.getShaderInfoLog(P).trim();let $=!0,K=!0;if(r.getProgramParameter(S,r.LINK_STATUS)===!1)if($=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,S,I,P);else{const ge=GI(r,I,"vertex"),z=GI(r,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(S,r.VALIDATE_STATUS)+` Material Name: `+F.name+` Material Type: `+F.type+` Program Info Log: `+X+` `+ge+` `+z)}else X!==""?console.warn("THREE.WebGLProgram: Program Info Log:",X):(J===""||q==="")&&(K=!1);K&&(F.diagnostics={runnable:$,programLog:X,vertexShader:{log:J,prefix:x},fragmentShader:{log:q,prefix:m}})}r.deleteShader(I),r.deleteShader(P),N=new Yg(r,S),B=t5(r,S)}let N;this.getUniforms=function(){return N===void 0&&D(this),N};let B;this.getAttributes=function(){return B===void 0&&D(this),B};let T=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return T===!1&&(T=r.getProgramParameter(S,j9)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=J9++,this.cacheKey=e,this.usedTimes=1,this.program=S,this.vertexShader=I,this.fragmentShader=P,this}let h5=0;class p5{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new m5(e),t.set(e,i)),i}}class m5{constructor(e){this.id=h5++,this.code=e,this.usedTimes=0}}function g5(n,e,t,i,r,s,o){const a=new El,l=new p5,u=new Set,d=[],h=r.logarithmicDepthBuffer,p=r.vertexTextures;let g=r.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function S(B){return u.add(B),B===0?"uv":`uv${B}`}function x(B,T,F,X,J){const q=X.fog,$=J.geometry,K=B.isMeshStandardMaterial?X.environment:null,ge=(B.isMeshStandardMaterial?t:e).get(B.envMap||K),z=ge&&ge.mapping===Qu?ge.image.height:null,te=v[B.type];B.precision!==null&&(g=r.getMaxPrecision(B.precision),g!==B.precision&&console.warn("THREE.WebGLProgram.getParameters:",B.precision,"not supported, using",g,"instead."));const ie=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,fe=ie!==void 0?ie.length:0;let Ce=0;$.morphAttributes.position!==void 0&&(Ce=1),$.morphAttributes.normal!==void 0&&(Ce=2),$.morphAttributes.color!==void 0&&(Ce=3);let ot,re,Me,Ie;if(te){const Jt=Ms[te];ot=Jt.vertexShader,re=Jt.fragmentShader}else ot=B.vertexShader,re=B.fragmentShader,l.update(B),Me=l.getVertexShaderID(B),Ie=l.getFragmentShaderID(B);const Be=n.getRenderTarget(),$e=J.isInstancedMesh===!0,wt=J.isBatchedMesh===!0,vt=!!B.map,Mt=!!B.matcap,H=!!ge,Te=!!B.aoMap,be=!!B.lightMap,He=!!B.bumpMap,ye=!!B.normalMap,dt=!!B.displacementMap,Ve=!!B.emissiveMap,qe=!!B.metalnessMap,W=!!B.roughnessMap,U=B.anisotropy>0,ae=B.clearcoat>0,ve=B.dispersion>0,we=B.iridescence>0,Ee=B.sheen>0,ut=B.transmission>0,ze=U&&!!B.anisotropyMap,Qe=ae&&!!B.clearcoatMap,Rt=ae&&!!B.clearcoatNormalMap,Pe=ae&&!!B.clearcoatRoughnessMap,Ke=we&&!!B.iridescenceMap,kt=we&&!!B.iridescenceThicknessMap,Et=Ee&&!!B.sheenColorMap,et=Ee&&!!B.sheenRoughnessMap,Tt=!!B.specularMap,Ft=!!B.specularColorMap,sn=!!B.specularIntensityMap,Y=ut&&!!B.transmissionMap,Le=ut&&!!B.thicknessMap,xe=!!B.gradientMap,Se=!!B.alphaMap,Oe=B.alphaTest>0,_t=!!B.alphaHash,Vt=!!B.extensions;let wn=zs;B.toneMapped&&(Be===null||Be.isXRRenderTarget===!0)&&(wn=n.toneMapping);const Kn={shaderID:te,shaderType:B.type,shaderName:B.name,vertexShader:ot,fragmentShader:re,defines:B.defines,customVertexShaderID:Me,customFragmentShaderID:Ie,isRawShaderMaterial:B.isRawShaderMaterial===!0,glslVersion:B.glslVersion,precision:g,batching:wt,batchingColor:wt&&J._colorsTexture!==null,instancing:$e,instancingColor:$e&&J.instanceColor!==null,instancingMorph:$e&&J.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:Be===null?n.outputColorSpace:Be.isXRRenderTarget===!0?Be.texture.colorSpace:yo,alphaToCoverage:!!B.alphaToCoverage,map:vt,matcap:Mt,envMap:H,envMapMode:H&&ge.mapping,envMapCubeUVHeight:z,aoMap:Te,lightMap:be,bumpMap:He,normalMap:ye,displacementMap:p&&dt,emissiveMap:Ve,normalMapObjectSpace:ye&&B.normalMapType===kP,normalMapTangentSpace:ye&&B.normalMapType===da,metalnessMap:qe,roughnessMap:W,anisotropy:U,anisotropyMap:ze,clearcoat:ae,clearcoatMap:Qe,clearcoatNormalMap:Rt,clearcoatRoughnessMap:Pe,dispersion:ve,iridescence:we,iridescenceMap:Ke,iridescenceThicknessMap:kt,sheen:Ee,sheenColorMap:Et,sheenRoughnessMap:et,specularMap:Tt,specularColorMap:Ft,specularIntensityMap:sn,transmission:ut,transmissionMap:Y,thicknessMap:Le,gradientMap:xe,opaque:B.transparent===!1&&B.blending===hl&&B.alphaToCoverage===!1,alphaMap:Se,alphaTest:Oe,alphaHash:_t,combine:B.combine,mapUv:vt&&S(B.map.channel),aoMapUv:Te&&S(B.aoMap.channel),lightMapUv:be&&S(B.lightMap.channel),bumpMapUv:He&&S(B.bumpMap.channel),normalMapUv:ye&&S(B.normalMap.channel),displacementMapUv:dt&&S(B.displacementMap.channel),emissiveMapUv:Ve&&S(B.emissiveMap.channel),metalnessMapUv:qe&&S(B.metalnessMap.channel),roughnessMapUv:W&&S(B.roughnessMap.channel),anisotropyMapUv:ze&&S(B.anisotropyMap.channel),clearcoatMapUv:Qe&&S(B.clearcoatMap.channel),clearcoatNormalMapUv:Rt&&S(B.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Pe&&S(B.clearcoatRoughnessMap.channel),iridescenceMapUv:Ke&&S(B.iridescenceMap.channel),iridescenceThicknessMapUv:kt&&S(B.iridescenceThicknessMap.channel),sheenColorMapUv:Et&&S(B.sheenColorMap.channel),sheenRoughnessMapUv:et&&S(B.sheenRoughnessMap.channel),specularMapUv:Tt&&S(B.specularMap.channel),specularColorMapUv:Ft&&S(B.specularColorMap.channel),specularIntensityMapUv:sn&&S(B.specularIntensityMap.channel),transmissionMapUv:Y&&S(B.transmissionMap.channel),thicknessMapUv:Le&&S(B.thicknessMap.channel),alphaMapUv:Se&&S(B.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(ye||U),vertexColors:B.vertexColors,vertexAlphas:B.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:J.isPoints===!0&&!!$.attributes.uv&&(vt||Se),fog:!!q,useFog:B.fog===!0,fogExp2:!!q&&q.isFogExp2,flatShading:B.flatShading===!0,sizeAttenuation:B.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:J.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:fe,morphTextureStride:Ce,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numLightProbes:T.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:B.dithering,shadowMapEnabled:n.shadowMap.enabled&&F.length>0,shadowMapType:n.shadowMap.type,toneMapping:wn,decodeVideoTexture:vt&&B.map.isVideoTexture===!0&&tn.getTransfer(B.map.colorSpace)===vn,premultipliedAlpha:B.premultipliedAlpha,doubleSided:B.side===gs,flipSided:B.side===ji,useDepthPacking:B.depthPacking>=0,depthPacking:B.depthPacking||0,index0AttributeName:B.index0AttributeName,extensionClipCullDistance:Vt&&B.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Vt&&B.extensions.multiDraw===!0||wt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:B.customProgramCacheKey()};return Kn.vertexUv1s=u.has(1),Kn.vertexUv2s=u.has(2),Kn.vertexUv3s=u.has(3),u.clear(),Kn}function m(B){const T=[];if(B.shaderID?T.push(B.shaderID):(T.push(B.customVertexShaderID),T.push(B.customFragmentShaderID)),B.defines!==void 0)for(const F in B.defines)T.push(F),T.push(B.defines[F]);return B.isRawShaderMaterial===!1&&(_(T,B),A(T,B),T.push(n.outputColorSpace)),T.push(B.customProgramCacheKey),T.join()}function _(B,T){B.push(T.precision),B.push(T.outputColorSpace),B.push(T.envMapMode),B.push(T.envMapCubeUVHeight),B.push(T.mapUv),B.push(T.alphaMapUv),B.push(T.lightMapUv),B.push(T.aoMapUv),B.push(T.bumpMapUv),B.push(T.normalMapUv),B.push(T.displacementMapUv),B.push(T.emissiveMapUv),B.push(T.metalnessMapUv),B.push(T.roughnessMapUv),B.push(T.anisotropyMapUv),B.push(T.clearcoatMapUv),B.push(T.clearcoatNormalMapUv),B.push(T.clearcoatRoughnessMapUv),B.push(T.iridescenceMapUv),B.push(T.iridescenceThicknessMapUv),B.push(T.sheenColorMapUv),B.push(T.sheenRoughnessMapUv),B.push(T.specularMapUv),B.push(T.specularColorMapUv),B.push(T.specularIntensityMapUv),B.push(T.transmissionMapUv),B.push(T.thicknessMapUv),B.push(T.combine),B.push(T.fogExp2),B.push(T.sizeAttenuation),B.push(T.morphTargetsCount),B.push(T.morphAttributeCount),B.push(T.numDirLights),B.push(T.numPointLights),B.push(T.numSpotLights),B.push(T.numSpotLightMaps),B.push(T.numHemiLights),B.push(T.numRectAreaLights),B.push(T.numDirLightShadows),B.push(T.numPointLightShadows),B.push(T.numSpotLightShadows),B.push(T.numSpotLightShadowsWithMaps),B.push(T.numLightProbes),B.push(T.shadowMapType),B.push(T.toneMapping),B.push(T.numClippingPlanes),B.push(T.numClipIntersection),B.push(T.depthPacking)}function A(B,T){a.disableAll(),T.supportsVertexTextures&&a.enable(0),T.instancing&&a.enable(1),T.instancingColor&&a.enable(2),T.instancingMorph&&a.enable(3),T.matcap&&a.enable(4),T.envMap&&a.enable(5),T.normalMapObjectSpace&&a.enable(6),T.normalMapTangentSpace&&a.enable(7),T.clearcoat&&a.enable(8),T.iridescence&&a.enable(9),T.alphaTest&&a.enable(10),T.vertexColors&&a.enable(11),T.vertexAlphas&&a.enable(12),T.vertexUv1s&&a.enable(13),T.vertexUv2s&&a.enable(14),T.vertexUv3s&&a.enable(15),T.vertexTangents&&a.enable(16),T.anisotropy&&a.enable(17),T.alphaHash&&a.enable(18),T.batching&&a.enable(19),T.dispersion&&a.enable(20),T.batchingColor&&a.enable(21),B.push(a.mask),a.disableAll(),T.fog&&a.enable(0),T.useFog&&a.enable(1),T.flatShading&&a.enable(2),T.logarithmicDepthBuffer&&a.enable(3),T.skinning&&a.enable(4),T.morphTargets&&a.enable(5),T.morphNormals&&a.enable(6),T.morphColors&&a.enable(7),T.premultipliedAlpha&&a.enable(8),T.shadowMapEnabled&&a.enable(9),T.doubleSided&&a.enable(10),T.flipSided&&a.enable(11),T.useDepthPacking&&a.enable(12),T.dithering&&a.enable(13),T.transmission&&a.enable(14),T.sheen&&a.enable(15),T.opaque&&a.enable(16),T.pointsUvs&&a.enable(17),T.decodeVideoTexture&&a.enable(18),T.alphaToCoverage&&a.enable(19),B.push(a.mask)}function w(B){const T=v[B.type];let F;if(T){const X=Ms[T];F=yI.clone(X.uniforms)}else F=B.uniforms;return F}function I(B,T){let F;for(let X=0,J=d.length;X0?i.push(m):g.transparent===!0?r.push(m):t.push(m)}function l(h,p,g,v,S,x){const m=o(h,p,g,v,S,x);g.transmission>0?i.unshift(m):g.transparent===!0?r.unshift(m):t.unshift(m)}function u(h,p){t.length>1&&t.sort(h||y5),i.length>1&&i.sort(p||JI),r.length>1&&r.sort(p||JI)}function d(){for(let h=e,p=n.length;h=s.length?(o=new KI,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function _5(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new G,color:new ke};break;case"SpotLight":t={position:new G,direction:new G,color:new ke,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new G,color:new ke,distance:0,decay:0};break;case"HemisphereLight":t={direction:new G,skyColor:new ke,groundColor:new ke};break;case"RectAreaLight":t={color:new ke,position:new G,halfWidth:new G,halfHeight:new G};break}return n[e.id]=t,t}}}function A5(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let S5=0;function M5(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function w5(n){const e=new _5,t=A5(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)i.probe.push(new G);const r=new G,s=new mt,o=new mt;function a(u){let d=0,h=0,p=0;for(let B=0;B<9;B++)i.probe[B].set(0,0,0);let g=0,v=0,S=0,x=0,m=0,_=0,A=0,w=0,I=0,P=0,D=0;u.sort(M5);for(let B=0,T=u.length;B0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=We.LTC_FLOAT_1,i.rectAreaLTC2=We.LTC_FLOAT_2):(i.rectAreaLTC1=We.LTC_HALF_1,i.rectAreaLTC2=We.LTC_HALF_2)),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const N=i.hash;(N.directionalLength!==g||N.pointLength!==v||N.spotLength!==S||N.rectAreaLength!==x||N.hemiLength!==m||N.numDirectionalShadows!==_||N.numPointShadows!==A||N.numSpotShadows!==w||N.numSpotMaps!==I||N.numLightProbes!==D)&&(i.directional.length=g,i.spot.length=S,i.rectArea.length=x,i.point.length=v,i.hemi.length=m,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=A,i.pointShadowMap.length=A,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=A,i.spotLightMatrix.length=w+I-P,i.spotLightMap.length=I,i.numSpotLightShadowsWithMaps=P,i.numLightProbes=D,N.directionalLength=g,N.pointLength=v,N.spotLength=S,N.rectAreaLength=x,N.hemiLength=m,N.numDirectionalShadows=_,N.numPointShadows=A,N.numSpotShadows=w,N.numSpotMaps=I,N.numLightProbes=D,i.version=S5++)}function l(u,d){let h=0,p=0,g=0,v=0,S=0;const x=d.matrixWorldInverse;for(let m=0,_=u.length;m<_;m++){const A=u[m];if(A.isDirectionalLight){const w=i.directional[h];w.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),w.direction.sub(r),w.direction.transformDirection(x),h++}else if(A.isSpotLight){const w=i.spot[g];w.position.setFromMatrixPosition(A.matrixWorld),w.position.applyMatrix4(x),w.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),w.direction.sub(r),w.direction.transformDirection(x),g++}else if(A.isRectAreaLight){const w=i.rectArea[v];w.position.setFromMatrixPosition(A.matrixWorld),w.position.applyMatrix4(x),o.identity(),s.copy(A.matrixWorld),s.premultiply(x),o.extractRotation(s),w.halfWidth.set(A.width*.5,0,0),w.halfHeight.set(0,A.height*.5,0),w.halfWidth.applyMatrix4(o),w.halfHeight.applyMatrix4(o),v++}else if(A.isPointLight){const w=i.point[p];w.position.setFromMatrixPosition(A.matrixWorld),w.position.applyMatrix4(x),p++}else if(A.isHemisphereLight){const w=i.hemi[S];w.direction.setFromMatrixPosition(A.matrixWorld),w.direction.transformDirection(x),S++}}}return{setup:a,setupView:l,state:i}}function YI(n){const e=new w5(n),t=[],i=[];function r(d){u.camera=d,t.length=0,i.length=0}function s(d){t.push(d)}function o(d){i.push(d)}function a(){e.setup(t)}function l(d){e.setupView(t,d)}const u={lightsArray:t,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:u,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function E5(n){let e=new WeakMap;function t(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new YI(n),e.set(r,[a])):s>=o.length?(a=new YI(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}class dS extends $n{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=UP,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class hS extends $n{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const C5=`void main() { gl_Position = vec4( position, 1.0 ); }`,T5=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { const float samples = float( VSM_SAMPLES ); float mean = 0.0; float squared_mean = 0.0; float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); float uvStart = samples <= 1.0 ? 0.0 : - 1.0; for ( float i = 0.0; i < samples; i ++ ) { float uvOffset = uvStart + i * uvStride; #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean / samples; squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`;function b5(n,e,t){let i=new Kd;const r=new Ae,s=new Ae,o=new on,a=new dS({depthPacking:OP}),l=new hS,u={},d=t.maxTextureSize,h={[ks]:ji,[ji]:ks,[gs]:gs},p=new Ss({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:C5,fragmentShader:T5}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new Pt;v.setAttribute("position",new $t(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new jn(v,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=zm;let m=this.type;this.render=function(P,D,N){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||P.length===0)return;const B=n.getRenderTarget(),T=n.getActiveCubeFace(),F=n.getActiveMipmapLevel(),X=n.state;X.setBlending(po),X.buffers.color.setClear(1,1,1,1),X.buffers.depth.setTest(!0),X.setScissorTest(!1);const J=m!==ms&&this.type===ms,q=m===ms&&this.type!==ms;for(let $=0,K=P.length;$d||r.y>d)&&(r.x>d&&(s.x=Math.floor(d/te.x),r.x=s.x*te.x,z.mapSize.x=s.x),r.y>d&&(s.y=Math.floor(d/te.y),r.y=s.y*te.y,z.mapSize.y=s.y)),z.map===null||J===!0||q===!0){const fe=this.type!==ms?{minFilter:oi,magFilter:oi}:{};z.map!==null&&z.map.dispose(),z.map=new ys(r.x,r.y,fe),z.map.texture.name=ge.name+".shadowMap",z.camera.updateProjectionMatrix()}n.setRenderTarget(z.map),n.clear();const ie=z.getViewportCount();for(let fe=0;fe0||D.map&&D.alphaTest>0){const X=T.uuid,J=D.uuid;let q=u[X];q===void 0&&(q={},u[X]=q);let $=q[J];$===void 0&&($=T.clone(),q[J]=$,D.addEventListener("dispose",I)),T=$}if(T.visible=D.visible,T.wireframe=D.wireframe,B===ms?T.side=D.shadowSide!==null?D.shadowSide:D.side:T.side=D.shadowSide!==null?D.shadowSide:h[D.side],T.alphaMap=D.alphaMap,T.alphaTest=D.alphaTest,T.map=D.map,T.clipShadows=D.clipShadows,T.clippingPlanes=D.clippingPlanes,T.clipIntersection=D.clipIntersection,T.displacementMap=D.displacementMap,T.displacementScale=D.displacementScale,T.displacementBias=D.displacementBias,T.wireframeLinewidth=D.wireframeLinewidth,T.linewidth=D.linewidth,N.isPointLight===!0&&T.isMeshDistanceMaterial===!0){const X=n.properties.get(T);X.light=N}return T}function w(P,D,N,B,T){if(P.visible===!1)return;if(P.layers.test(D.layers)&&(P.isMesh||P.isLine||P.isPoints)&&(P.castShadow||P.receiveShadow&&T===ms)&&(!P.frustumCulled||i.intersectsObject(P))){P.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,P.matrixWorld);const J=e.update(P),q=P.material;if(Array.isArray(q)){const $=J.groups;for(let K=0,ge=$.length;K=1):ge.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(ge)[1]),$=K>=2);let z=null,te={};const ie=n.getParameter(n.SCISSOR_BOX),fe=n.getParameter(n.VIEWPORT),Ce=new on().fromArray(ie),ot=new on().fromArray(fe);function re(Y,Le,xe,Se){const Oe=new Uint8Array(4),_t=n.createTexture();n.bindTexture(Y,_t),n.texParameteri(Y,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(Y,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Vt=0;Vte?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function I5(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function B5(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function pS(n,e,t,i){const r=L5(i);switch(t){case MA:return n*e;case EA:return n*e;case CA:return n*e*2;case Km:return n*e/r.components*r.byteLength;case Ed:return n*e/r.components*r.byteLength;case TA:return n*e*2/r.components*r.byteLength;case Ym:return n*e*2/r.components*r.byteLength;case wA:return n*e*3/r.components*r.byteLength;case Ri:return n*e*4/r.components*r.byteLength;case Qm:return n*e*4/r.components*r.byteLength;case Cd:case Td:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case bd:case Rd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Zm:case eg:return Math.max(n,16)*Math.max(e,8)/4;case qm:case $m:return Math.max(n,8)*Math.max(e,8)/2;case tg:case ng:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case ig:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case rg:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case sg:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case og:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case ag:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case lg:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case ug:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case cg:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case fg:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case dg:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case hg:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case pg:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case mg:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case gg:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case vg:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Pd:case yg:case xg:return Math.ceil(n/4)*Math.ceil(e/4)*16;case bA:case _g:return Math.ceil(n/4)*Math.ceil(e/4)*8;case Ag:case Sg:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function L5(n){switch(n){case vs:case _A:return{byteLength:1,components:1};case $u:case AA:case ec:return{byteLength:2,components:1};case jm:case Jm:return{byteLength:2,components:4};case go:case Xm:case ur:return{byteLength:4,components:1};case SA:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const D5={contain:P5,cover:I5,fill:B5,getByteLength:pS};function F5(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator=="undefined"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ae,d=new WeakMap;let h;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(W){}function v(W,U){return g?new OffscreenCanvas(W,U):kd("canvas")}function S(W,U,ae){let ve=1;const we=qe(W);if((we.width>ae||we.height>ae)&&(ve=ae/Math.max(we.width,we.height)),ve<1)if(typeof HTMLImageElement!="undefined"&&W instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&W instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&W instanceof ImageBitmap||typeof VideoFrame!="undefined"&&W instanceof VideoFrame){const Ee=Math.floor(ve*we.width),ut=Math.floor(ve*we.height);h===void 0&&(h=v(Ee,ut));const ze=U?v(Ee,ut):h;return ze.width=Ee,ze.height=ut,ze.getContext("2d").drawImage(W,0,0,Ee,ut),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+we.width+"x"+we.height+") to ("+Ee+"x"+ut+")."),ze}else return"data"in W&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+we.width+"x"+we.height+")."),W;return W}function x(W){return W.generateMipmaps&&W.minFilter!==oi&&W.minFilter!==kn}function m(W){n.generateMipmap(W)}function _(W,U,ae,ve,we=!1){if(W!==null){if(n[W]!==void 0)return n[W];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+W+"'")}let Ee=U;if(U===n.RED&&(ae===n.FLOAT&&(Ee=n.R32F),ae===n.HALF_FLOAT&&(Ee=n.R16F),ae===n.UNSIGNED_BYTE&&(Ee=n.R8)),U===n.RED_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Ee=n.R8UI),ae===n.UNSIGNED_SHORT&&(Ee=n.R16UI),ae===n.UNSIGNED_INT&&(Ee=n.R32UI),ae===n.BYTE&&(Ee=n.R8I),ae===n.SHORT&&(Ee=n.R16I),ae===n.INT&&(Ee=n.R32I)),U===n.RG&&(ae===n.FLOAT&&(Ee=n.RG32F),ae===n.HALF_FLOAT&&(Ee=n.RG16F),ae===n.UNSIGNED_BYTE&&(Ee=n.RG8)),U===n.RG_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Ee=n.RG8UI),ae===n.UNSIGNED_SHORT&&(Ee=n.RG16UI),ae===n.UNSIGNED_INT&&(Ee=n.RG32UI),ae===n.BYTE&&(Ee=n.RG8I),ae===n.SHORT&&(Ee=n.RG16I),ae===n.INT&&(Ee=n.RG32I)),U===n.RGB&&ae===n.UNSIGNED_INT_5_9_9_9_REV&&(Ee=n.RGB9_E5),U===n.RGBA){const ut=we?Ld:tn.getTransfer(ve);ae===n.FLOAT&&(Ee=n.RGBA32F),ae===n.HALF_FLOAT&&(Ee=n.RGBA16F),ae===n.UNSIGNED_BYTE&&(Ee=ut===vn?n.SRGB8_ALPHA8:n.RGBA8),ae===n.UNSIGNED_SHORT_4_4_4_4&&(Ee=n.RGBA4),ae===n.UNSIGNED_SHORT_5_5_5_1&&(Ee=n.RGB5_A1)}return(Ee===n.R16F||Ee===n.R32F||Ee===n.RG16F||Ee===n.RG32F||Ee===n.RGBA16F||Ee===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Ee}function A(W,U){let ae;return W?U===null||U===go||U===ml?ae=n.DEPTH24_STENCIL8:U===ur?ae=n.DEPTH32F_STENCIL8:U===$u&&(ae=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===go||U===ml?ae=n.DEPTH_COMPONENT24:U===ur?ae=n.DEPTH_COMPONENT32F:U===$u&&(ae=n.DEPTH_COMPONENT16),ae}function w(W,U){return x(W)===!0||W.isFramebufferTexture&&W.minFilter!==oi&&W.minFilter!==kn?Math.log2(Math.max(U.width,U.height))+1:W.mipmaps!==void 0&&W.mipmaps.length>0?W.mipmaps.length:W.isCompressedTexture&&Array.isArray(W.image)?U.mipmaps.length:1}function I(W){const U=W.target;U.removeEventListener("dispose",I),D(U),U.isVideoTexture&&d.delete(U)}function P(W){const U=W.target;U.removeEventListener("dispose",P),B(U)}function D(W){const U=i.get(W);if(U.__webglInit===void 0)return;const ae=W.source,ve=p.get(ae);if(ve){const we=ve[U.__cacheKey];we.usedTimes--,we.usedTimes===0&&N(W),Object.keys(ve).length===0&&p.delete(ae)}i.remove(W)}function N(W){const U=i.get(W);n.deleteTexture(U.__webglTexture);const ae=W.source,ve=p.get(ae);delete ve[U.__cacheKey],o.memory.textures--}function B(W){const U=i.get(W);if(W.depthTexture&&W.depthTexture.dispose(),W.isWebGLCubeRenderTarget)for(let ve=0;ve<6;ve++){if(Array.isArray(U.__webglFramebuffer[ve]))for(let we=0;we=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+W+" texture units while this GPU supports only "+r.maxTextures),T+=1,W}function J(W){const U=[];return U.push(W.wrapS),U.push(W.wrapT),U.push(W.wrapR||0),U.push(W.magFilter),U.push(W.minFilter),U.push(W.anisotropy),U.push(W.internalFormat),U.push(W.format),U.push(W.type),U.push(W.generateMipmaps),U.push(W.premultiplyAlpha),U.push(W.flipY),U.push(W.unpackAlignment),U.push(W.colorSpace),U.join()}function q(W,U){const ae=i.get(W);if(W.isVideoTexture&&dt(W),W.isRenderTargetTexture===!1&&W.version>0&&ae.__version!==W.version){const ve=W.image;if(ve===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ve.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ot(ae,W,U);return}}t.bindTexture(n.TEXTURE_2D,ae.__webglTexture,n.TEXTURE0+U)}function $(W,U){const ae=i.get(W);if(W.version>0&&ae.__version!==W.version){ot(ae,W,U);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ae.__webglTexture,n.TEXTURE0+U)}function K(W,U){const ae=i.get(W);if(W.version>0&&ae.__version!==W.version){ot(ae,W,U);return}t.bindTexture(n.TEXTURE_3D,ae.__webglTexture,n.TEXTURE0+U)}function ge(W,U){const ae=i.get(W);if(W.version>0&&ae.__version!==W.version){re(ae,W,U);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ae.__webglTexture,n.TEXTURE0+U)}const z={[fa]:n.REPEAT,[Tr]:n.CLAMP_TO_EDGE,[qu]:n.MIRRORED_REPEAT},te={[oi]:n.NEAREST,[Wm]:n.NEAREST_MIPMAP_NEAREST,[pl]:n.NEAREST_MIPMAP_LINEAR,[kn]:n.LINEAR,[Zu]:n.LINEAR_MIPMAP_NEAREST,[Kr]:n.LINEAR_MIPMAP_LINEAR},ie={[zP]:n.NEVER,[jP]:n.ALWAYS,[HP]:n.LESS,[BA]:n.LEQUAL,[GP]:n.EQUAL,[XP]:n.GEQUAL,[VP]:n.GREATER,[WP]:n.NOTEQUAL};function fe(W,U){if(U.type===ur&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===kn||U.magFilter===Zu||U.magFilter===pl||U.magFilter===Kr||U.minFilter===kn||U.minFilter===Zu||U.minFilter===pl||U.minFilter===Kr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(W,n.TEXTURE_WRAP_S,z[U.wrapS]),n.texParameteri(W,n.TEXTURE_WRAP_T,z[U.wrapT]),(W===n.TEXTURE_3D||W===n.TEXTURE_2D_ARRAY)&&n.texParameteri(W,n.TEXTURE_WRAP_R,z[U.wrapR]),n.texParameteri(W,n.TEXTURE_MAG_FILTER,te[U.magFilter]),n.texParameteri(W,n.TEXTURE_MIN_FILTER,te[U.minFilter]),U.compareFunction&&(n.texParameteri(W,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(W,n.TEXTURE_COMPARE_FUNC,ie[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===oi||U.minFilter!==pl&&U.minFilter!==Kr||U.type===ur&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||i.get(U).__currentAnisotropy){const ae=e.get("EXT_texture_filter_anisotropic");n.texParameterf(W,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy}}}function Ce(W,U){let ae=!1;W.__webglInit===void 0&&(W.__webglInit=!0,U.addEventListener("dispose",I));const ve=U.source;let we=p.get(ve);we===void 0&&(we={},p.set(ve,we));const Ee=J(U);if(Ee!==W.__cacheKey){we[Ee]===void 0&&(we[Ee]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ae=!0),we[Ee].usedTimes++;const ut=we[W.__cacheKey];ut!==void 0&&(we[W.__cacheKey].usedTimes--,ut.usedTimes===0&&N(U)),W.__cacheKey=Ee,W.__webglTexture=we[Ee].texture}return ae}function ot(W,U,ae){let ve=n.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(ve=n.TEXTURE_2D_ARRAY),U.isData3DTexture&&(ve=n.TEXTURE_3D);const we=Ce(W,U),Ee=U.source;t.bindTexture(ve,W.__webglTexture,n.TEXTURE0+ae);const ut=i.get(Ee);if(Ee.version!==ut.__version||we===!0){t.activeTexture(n.TEXTURE0+ae);const ze=tn.getPrimaries(tn.workingColorSpace),Qe=U.colorSpace===vo?null:tn.getPrimaries(U.colorSpace),Rt=U.colorSpace===vo||ze===Qe?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,U.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,U.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Rt);let Pe=S(U.image,!1,r.maxTextureSize);Pe=Ve(U,Pe);const Ke=s.convert(U.format,U.colorSpace),kt=s.convert(U.type);let Et=_(U.internalFormat,Ke,kt,U.colorSpace,U.isVideoTexture);fe(ve,U);let et;const Tt=U.mipmaps,Ft=U.isVideoTexture!==!0,sn=ut.__version===void 0||we===!0,Y=Ee.dataReady,Le=w(U,Pe);if(U.isDepthTexture)Et=A(U.format===vl,U.type),sn&&(Ft?t.texStorage2D(n.TEXTURE_2D,1,Et,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,Et,Pe.width,Pe.height,0,Ke,kt,null));else if(U.isDataTexture)if(Tt.length>0){Ft&&sn&&t.texStorage2D(n.TEXTURE_2D,Le,Et,Tt[0].width,Tt[0].height);for(let xe=0,Se=Tt.length;xe0){const Oe=pS(et.width,et.height,U.format,U.type);for(const _t of U.layerUpdates){const Vt=et.data.subarray(_t*Oe/et.data.BYTES_PER_ELEMENT,(_t+1)*Oe/et.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,xe,0,0,_t,et.width,et.height,1,Ke,Vt,0,0)}U.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,xe,0,0,0,et.width,et.height,Pe.depth,Ke,et.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,xe,Et,et.width,et.height,Pe.depth,0,et.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Ft?Y&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,xe,0,0,0,et.width,et.height,Pe.depth,Ke,kt,et.data):t.texImage3D(n.TEXTURE_2D_ARRAY,xe,Et,et.width,et.height,Pe.depth,0,Ke,kt,et.data)}else{Ft&&sn&&t.texStorage2D(n.TEXTURE_2D,Le,Et,Tt[0].width,Tt[0].height);for(let xe=0,Se=Tt.length;xe0){const xe=pS(Pe.width,Pe.height,U.format,U.type);for(const Se of U.layerUpdates){const Oe=Pe.data.subarray(Se*xe/Pe.data.BYTES_PER_ELEMENT,(Se+1)*xe/Pe.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Se,Pe.width,Pe.height,1,Ke,kt,Oe)}U.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Pe.width,Pe.height,Pe.depth,Ke,kt,Pe.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Et,Pe.width,Pe.height,Pe.depth,0,Ke,kt,Pe.data);else if(U.isData3DTexture)Ft?(sn&&t.texStorage3D(n.TEXTURE_3D,Le,Et,Pe.width,Pe.height,Pe.depth),Y&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Pe.width,Pe.height,Pe.depth,Ke,kt,Pe.data)):t.texImage3D(n.TEXTURE_3D,0,Et,Pe.width,Pe.height,Pe.depth,0,Ke,kt,Pe.data);else if(U.isFramebufferTexture){if(sn)if(Ft)t.texStorage2D(n.TEXTURE_2D,Le,Et,Pe.width,Pe.height);else{let xe=Pe.width,Se=Pe.height;for(let Oe=0;Oe>=1,Se>>=1}}else if(Tt.length>0){if(Ft&&sn){const xe=qe(Tt[0]);t.texStorage2D(n.TEXTURE_2D,Le,Et,xe.width,xe.height)}for(let xe=0,Se=Tt.length;xe0&&Le++;const Se=qe(Ke[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Le,Tt,Se.width,Se.height)}for(let Se=0;Se<6;Se++)if(Pe){Ft?Y&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,0,0,Ke[Se].width,Ke[Se].height,Et,et,Ke[Se].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,Tt,Ke[Se].width,Ke[Se].height,0,Et,et,Ke[Se].data);for(let Oe=0;Oe>Ee),Ke=Math.max(1,U.height>>Ee);we===n.TEXTURE_3D||we===n.TEXTURE_2D_ARRAY?t.texImage3D(we,Ee,Qe,Pe,Ke,U.depth,0,ut,ze,null):t.texImage2D(we,Ee,Qe,Pe,Ke,0,ut,ze,null)}t.bindFramebuffer(n.FRAMEBUFFER,W),ye(U)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ve,we,i.get(ae).__webglTexture,0,He(U)):(we===n.TEXTURE_2D||we>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&we<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ve,we,i.get(ae).__webglTexture,Ee),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ie(W,U,ae){if(n.bindRenderbuffer(n.RENDERBUFFER,W),U.depthBuffer){const ve=U.depthTexture,we=ve&&ve.isDepthTexture?ve.type:null,Ee=A(U.stencilBuffer,we),ut=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ze=He(U);ye(U)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ze,Ee,U.width,U.height):ae?n.renderbufferStorageMultisample(n.RENDERBUFFER,ze,Ee,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,Ee,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ut,n.RENDERBUFFER,W)}else{const ve=U.textures;for(let we=0;we1;if(ut||(ve.__webglTexture===void 0&&(ve.__webglTexture=n.createTexture()),ve.__version=U.version,o.memory.textures++),Ee){ae.__webglFramebuffer=[];for(let ze=0;ze<6;ze++)if(U.mipmaps&&U.mipmaps.length>0){ae.__webglFramebuffer[ze]=[];for(let Qe=0;Qe0){ae.__webglFramebuffer=[];for(let ze=0;ze0&&ye(W)===!1){ae.__webglMultisampledFramebuffer=n.createFramebuffer(),ae.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ae.__webglMultisampledFramebuffer);for(let ze=0;ze0)for(let Qe=0;Qe0)for(let Qe=0;Qe0){if(ye(W)===!1){const U=W.textures,ae=W.width,ve=W.height;let we=n.COLOR_BUFFER_BIT;const Ee=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ut=i.get(W),ze=U.length>1;if(ze)for(let Qe=0;Qe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function dt(W){const U=o.render.frame;d.get(W)!==U&&(d.set(W,U),W.update())}function Ve(W,U){const ae=W.colorSpace,ve=W.format,we=W.type;return W.isCompressedTexture===!0||W.isVideoTexture===!0||ae!==yo&&ae!==vo&&(tn.getTransfer(ae)===vn?(ve!==Ri||we!==vs)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ae)),U}function qe(W){return typeof HTMLImageElement!="undefined"&&W instanceof HTMLImageElement?(u.width=W.naturalWidth||W.width,u.height=W.naturalHeight||W.height):typeof VideoFrame!="undefined"&&W instanceof VideoFrame?(u.width=W.displayWidth,u.height=W.displayHeight):(u.width=W.width,u.height=W.height),u}this.allocateTextureUnit=X,this.resetTextureUnits=F,this.setTexture2D=q,this.setTexture2DArray=$,this.setTexture3D=K,this.setTextureCube=ge,this.rebindTextures=wt,this.setupRenderTarget=vt,this.updateRenderTargetMipmap=Mt,this.updateMultisampleRenderTarget=be,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=ye}function QI(n,e){function t(i,r=vo){let s;const o=tn.getTransfer(r);if(i===vs)return n.UNSIGNED_BYTE;if(i===jm)return n.UNSIGNED_SHORT_4_4_4_4;if(i===Jm)return n.UNSIGNED_SHORT_5_5_5_1;if(i===SA)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===_A)return n.BYTE;if(i===AA)return n.SHORT;if(i===$u)return n.UNSIGNED_SHORT;if(i===Xm)return n.INT;if(i===go)return n.UNSIGNED_INT;if(i===ur)return n.FLOAT;if(i===ec)return n.HALF_FLOAT;if(i===MA)return n.ALPHA;if(i===wA)return n.RGB;if(i===Ri)return n.RGBA;if(i===EA)return n.LUMINANCE;if(i===CA)return n.LUMINANCE_ALPHA;if(i===gl)return n.DEPTH_COMPONENT;if(i===vl)return n.DEPTH_STENCIL;if(i===Km)return n.RED;if(i===Ed)return n.RED_INTEGER;if(i===TA)return n.RG;if(i===Ym)return n.RG_INTEGER;if(i===Qm)return n.RGBA_INTEGER;if(i===Cd||i===Td||i===bd||i===Rd)if(o===vn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Cd)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Td)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===bd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Rd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Cd)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Td)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===bd)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Rd)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===qm||i===Zm||i===$m||i===eg)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===qm)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Zm)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===$m)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===eg)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===tg||i===ng||i===ig)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===tg||i===ng)return o===vn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===ig)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===rg||i===sg||i===og||i===ag||i===lg||i===ug||i===cg||i===fg||i===dg||i===hg||i===pg||i===mg||i===gg||i===vg)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===rg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===sg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===og)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===ag)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===lg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===ug)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===cg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===fg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===dg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===hg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===pg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===mg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===gg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===vg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Pd||i===yg||i===xg)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Pd)return o===vn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===yg)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===xg)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===bA||i===_g||i===Ag||i===Sg)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===Pd)return s.COMPRESSED_RED_RGTC1_EXT;if(i===_g)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Ag)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Sg)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ml?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class qI extends ai{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Co extends jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const N5={type:"move"};class mS{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Co,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Co,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Co,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const S of e.hand.values()){const x=t.getJointPose(S,i),m=this._getHandJoint(u,S);x!==null&&(m.matrix.fromArray(x.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=x.radius),m.visible=x!==null}const d=u.joints["index-finger-tip"],h=u.joints["thumb-tip"],p=d.position.distanceTo(h.position),g=.02,v=.005;u.inputState.pinching&&p>g+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(N5)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Co;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const U5=` void main() { gl_Position = vec4( position, 1.0 ); }`,O5=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; void main() { vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); if ( coord.x >= 1.0 ) { gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; } else { gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; } }`;class k5{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Mn,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Ss({vertexShader:U5,fragmentShader:O5,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new jn(new wc(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class z5 extends xo{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,u=null,d=null,h=null,p=null,g=null,v=null;const S=new k5,x=t.getContextAttributes();let m=null,_=null;const A=[],w=[],I=new Ae;let P=null;const D=new ai;D.layers.enable(1),D.viewport=new on;const N=new ai;N.layers.enable(2),N.viewport=new on;const B=[D,N],T=new qI;T.layers.enable(1),T.layers.enable(2);let F=null,X=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let Me=A[re];return Me===void 0&&(Me=new mS,A[re]=Me),Me.getTargetRaySpace()},this.getControllerGrip=function(re){let Me=A[re];return Me===void 0&&(Me=new mS,A[re]=Me),Me.getGripSpace()},this.getHand=function(re){let Me=A[re];return Me===void 0&&(Me=new mS,A[re]=Me),Me.getHandSpace()};function J(re){const Me=w.indexOf(re.inputSource);if(Me===-1)return;const Ie=A[Me];Ie!==void 0&&(Ie.update(re.inputSource,re.frame,u||o),Ie.dispatchEvent({type:re.type,data:re.inputSource}))}function q(){r.removeEventListener("select",J),r.removeEventListener("selectstart",J),r.removeEventListener("selectend",J),r.removeEventListener("squeeze",J),r.removeEventListener("squeezestart",J),r.removeEventListener("squeezeend",J),r.removeEventListener("end",q),r.removeEventListener("inputsourceschange",$);for(let re=0;re=0&&(w[Be]=null,A[Be].disconnect(Ie))}for(let Me=0;Me=w.length){w.push(Ie),Be=wt;break}else if(w[wt]===null){w[wt]=Ie,Be=wt;break}if(Be===-1)break}const $e=A[Be];$e&&$e.connect(Ie)}}const K=new G,ge=new G;function z(re,Me,Ie){K.setFromMatrixPosition(Me.matrixWorld),ge.setFromMatrixPosition(Ie.matrixWorld);const Be=K.distanceTo(ge),$e=Me.projectionMatrix.elements,wt=Ie.projectionMatrix.elements,vt=$e[14]/($e[10]-1),Mt=$e[14]/($e[10]+1),H=($e[9]+1)/$e[5],Te=($e[9]-1)/$e[5],be=($e[8]-1)/$e[0],He=(wt[8]+1)/wt[0],ye=vt*be,dt=vt*He,Ve=Be/(-be+He),qe=Ve*-be;Me.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(qe),re.translateZ(Ve),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert();const W=vt+Ve,U=Mt+Ve,ae=ye-qe,ve=dt+(Be-qe),we=H*Mt/U*W,Ee=Te*Mt/U*W;re.projectionMatrix.makePerspective(ae,ve,we,Ee,W,U),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}function te(re,Me){Me===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(Me.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(r===null)return;S.texture!==null&&(re.near=S.depthNear,re.far=S.depthFar),T.near=N.near=D.near=re.near,T.far=N.far=D.far=re.far,(F!==T.near||X!==T.far)&&(r.updateRenderState({depthNear:T.near,depthFar:T.far}),F=T.near,X=T.far,D.near=F,D.far=X,N.near=F,N.far=X,D.updateProjectionMatrix(),N.updateProjectionMatrix(),re.updateProjectionMatrix());const Me=re.parent,Ie=T.cameras;te(T,Me);for(let Be=0;Be0&&(x.alphaTest.value=m.alphaTest);const _=e.get(m),A=_.envMap,w=_.envMapRotation;A&&(x.envMap.value=A,Bl.copy(w),Bl.x*=-1,Bl.y*=-1,Bl.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(Bl.y*=-1,Bl.z*=-1),x.envMapRotation.value.setFromMatrix4(H5.makeRotationFromEuler(Bl)),x.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=m.reflectivity,x.ior.value=m.ior,x.refractionRatio.value=m.refractionRatio),m.lightMap&&(x.lightMap.value=m.lightMap,x.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,x.lightMapTransform)),m.aoMap&&(x.aoMap.value=m.aoMap,x.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,x.aoMapTransform))}function o(x,m){x.diffuse.value.copy(m.color),x.opacity.value=m.opacity,m.map&&(x.map.value=m.map,t(m.map,x.mapTransform))}function a(x,m){x.dashSize.value=m.dashSize,x.totalSize.value=m.dashSize+m.gapSize,x.scale.value=m.scale}function l(x,m,_,A){x.diffuse.value.copy(m.color),x.opacity.value=m.opacity,x.size.value=m.size*_,x.scale.value=A*.5,m.map&&(x.map.value=m.map,t(m.map,x.uvTransform)),m.alphaMap&&(x.alphaMap.value=m.alphaMap,t(m.alphaMap,x.alphaMapTransform)),m.alphaTest>0&&(x.alphaTest.value=m.alphaTest)}function u(x,m){x.diffuse.value.copy(m.color),x.opacity.value=m.opacity,x.rotation.value=m.rotation,m.map&&(x.map.value=m.map,t(m.map,x.mapTransform)),m.alphaMap&&(x.alphaMap.value=m.alphaMap,t(m.alphaMap,x.alphaMapTransform)),m.alphaTest>0&&(x.alphaTest.value=m.alphaTest)}function d(x,m){x.specular.value.copy(m.specular),x.shininess.value=Math.max(m.shininess,1e-4)}function h(x,m){m.gradientMap&&(x.gradientMap.value=m.gradientMap)}function p(x,m){x.metalness.value=m.metalness,m.metalnessMap&&(x.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,x.metalnessMapTransform)),x.roughness.value=m.roughness,m.roughnessMap&&(x.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,x.roughnessMapTransform)),m.envMap&&(x.envMapIntensity.value=m.envMapIntensity)}function g(x,m,_){x.ior.value=m.ior,m.sheen>0&&(x.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),x.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(x.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,x.sheenColorMapTransform)),m.sheenRoughnessMap&&(x.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,x.sheenRoughnessMapTransform))),m.clearcoat>0&&(x.clearcoat.value=m.clearcoat,x.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(x.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,x.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(x.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===ji&&x.clearcoatNormalScale.value.negate())),m.dispersion>0&&(x.dispersion.value=m.dispersion),m.iridescence>0&&(x.iridescence.value=m.iridescence,x.iridescenceIOR.value=m.iridescenceIOR,x.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(x.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,x.iridescenceMapTransform)),m.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),m.transmission>0&&(x.transmission.value=m.transmission,x.transmissionSamplerMap.value=_.texture,x.transmissionSamplerSize.value.set(_.width,_.height),m.transmissionMap&&(x.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,x.transmissionMapTransform)),x.thickness.value=m.thickness,m.thicknessMap&&(x.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=m.attenuationDistance,x.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(x.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(x.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=m.specularIntensity,x.specularColor.value.copy(m.specularColor),m.specularColorMap&&(x.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,x.specularColorMapTransform)),m.specularIntensityMap&&(x.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,x.specularIntensityMapTransform))}function v(x,m){m.matcap&&(x.matcap.value=m.matcap)}function S(x,m){const _=e.get(m).light;x.referencePosition.value.setFromMatrixPosition(_.matrixWorld),x.nearDistance.value=_.shadow.camera.near,x.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function V5(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(_,A){const w=A.program;i.uniformBlockBinding(_,w)}function u(_,A){let w=r[_.id];w===void 0&&(v(_),w=d(_),r[_.id]=w,_.addEventListener("dispose",x));const I=A.program;i.updateUBOMapping(_,I);const P=e.render.frame;s[_.id]!==P&&(p(_),s[_.id]=P)}function d(_){const A=h();_.__bindingPointIndex=A;const w=n.createBuffer(),I=_.__size,P=_.usage;return n.bindBuffer(n.UNIFORM_BUFFER,w),n.bufferData(n.UNIFORM_BUFFER,I,P),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,A,w),w}function h(){for(let _=0;_0&&(w+=I-P),_.__size=w,_.__cache={},this}function S(_){const A={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(A.boundary=4,A.storage=4):_.isVector2?(A.boundary=8,A.storage=8):_.isVector3||_.isColor?(A.boundary=16,A.storage=12):_.isVector4?(A.boundary=16,A.storage=16):_.isMatrix3?(A.boundary=48,A.storage=48):_.isMatrix4?(A.boundary=64,A.storage=64):_.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),A}function x(_){const A=_.target;A.removeEventListener("dispose",x);const w=o.indexOf(A.__bindingPointIndex);o.splice(w,1),n.deleteBuffer(r[A.id]),delete r[A.id],delete s[A.id]}function m(){for(const _ in r)n.deleteBuffer(r[_]);o=[],r={},s={}}return{bind:l,update:u,dispose:m}}class ZI{constructor(e={}){const{canvas:t=QP(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let p;if(i!==null){if(typeof WebGLRenderingContext!="undefined"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=i.getContextAttributes().alpha}else p=o;const g=new Uint32Array(4),v=new Int32Array(4);let S=null,x=null;const m=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Yr,this.toneMapping=zs,this.toneMappingExposure=1;const A=this;let w=!1,I=0,P=0,D=null,N=-1,B=null;const T=new on,F=new on;let X=null;const J=new ke(0);let q=0,$=t.width,K=t.height,ge=1,z=null,te=null;const ie=new on(0,0,$,K),fe=new on(0,0,$,K);let Ce=!1;const ot=new Kd;let re=!1,Me=!1;const Ie=new mt,Be=new G,$e=new on,wt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let vt=!1;function Mt(){return D===null?ge:1}let H=i;function Te(O,Z){return t.getContext(O,Z)}try{const O={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${xd}`),t.addEventListener("webglcontextlost",xe,!1),t.addEventListener("webglcontextrestored",Se,!1),t.addEventListener("webglcontextcreationerror",Oe,!1),H===null){const Z="webgl2";if(H=Te(Z,O),H===null)throw Te(Z)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let be,He,ye,dt,Ve,qe,W,U,ae,ve,we,Ee,ut,ze,Qe,Rt,Pe,Ke,kt,Et,et,Tt,Ft,sn;function Y(){be=new QV(H),be.init(),Tt=new QI(H,be),He=new WV(H,be,e,Tt),ye=new R5(H),dt=new $V(H),Ve=new v5,qe=new F5(H,be,ye,Ve,He,Tt,dt),W=new jV(A),U=new YV(A),ae=new zG(H),Ft=new GV(H,ae),ve=new qV(H,ae,dt,Ft),we=new t9(H,ve,ae,dt),kt=new e9(H,He,qe),Rt=new XV(Ve),Ee=new g5(A,W,U,be,He,Ft,Rt),ut=new G5(A,Ve),ze=new x5,Qe=new E5(be),Ke=new HV(A,W,U,ye,we,p,l),Pe=new b5(A,we,He),sn=new V5(H,dt,He,ye),Et=new VV(H,be,dt),et=new ZV(H,be,dt),dt.programs=Ee.programs,A.capabilities=He,A.extensions=be,A.properties=Ve,A.renderLists=ze,A.shadowMap=Pe,A.state=ye,A.info=dt}Y();const Le=new z5(A,H);this.xr=Le,this.getContext=function(){return H},this.getContextAttributes=function(){return H.getContextAttributes()},this.forceContextLoss=function(){const O=be.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=be.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return ge},this.setPixelRatio=function(O){O!==void 0&&(ge=O,this.setSize($,K,!1))},this.getSize=function(O){return O.set($,K)},this.setSize=function(O,Z,oe=!0){if(Le.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=O,K=Z,t.width=Math.floor(O*ge),t.height=Math.floor(Z*ge),oe===!0&&(t.style.width=O+"px",t.style.height=Z+"px"),this.setViewport(0,0,O,Z)},this.getDrawingBufferSize=function(O){return O.set($*ge,K*ge).floor()},this.setDrawingBufferSize=function(O,Z,oe){$=O,K=Z,ge=oe,t.width=Math.floor(O*oe),t.height=Math.floor(Z*oe),this.setViewport(0,0,O,Z)},this.getCurrentViewport=function(O){return O.copy(T)},this.getViewport=function(O){return O.copy(ie)},this.setViewport=function(O,Z,oe,le){O.isVector4?ie.set(O.x,O.y,O.z,O.w):ie.set(O,Z,oe,le),ye.viewport(T.copy(ie).multiplyScalar(ge).round())},this.getScissor=function(O){return O.copy(fe)},this.setScissor=function(O,Z,oe,le){O.isVector4?fe.set(O.x,O.y,O.z,O.w):fe.set(O,Z,oe,le),ye.scissor(F.copy(fe).multiplyScalar(ge).round())},this.getScissorTest=function(){return Ce},this.setScissorTest=function(O){ye.setScissorTest(Ce=O)},this.setOpaqueSort=function(O){z=O},this.setTransparentSort=function(O){te=O},this.getClearColor=function(O){return O.copy(Ke.getClearColor())},this.setClearColor=function(){Ke.setClearColor.apply(Ke,arguments)},this.getClearAlpha=function(){return Ke.getClearAlpha()},this.setClearAlpha=function(){Ke.setClearAlpha.apply(Ke,arguments)},this.clear=function(O=!0,Z=!0,oe=!0){let le=0;if(O){let ne=!1;if(D!==null){const De=D.texture.format;ne=De===Qm||De===Ym||De===Ed}if(ne){const De=D.texture.type,Xe=De===vs||De===go||De===$u||De===ml||De===jm||De===Jm,nt=Ke.getClearColor(),Ze=Ke.getClearAlpha(),ht=nt.r,yt=nt.g,ft=nt.b;Xe?(g[0]=ht,g[1]=yt,g[2]=ft,g[3]=Ze,H.clearBufferuiv(H.COLOR,0,g)):(v[0]=ht,v[1]=yt,v[2]=ft,v[3]=Ze,H.clearBufferiv(H.COLOR,0,v))}else le|=H.COLOR_BUFFER_BIT}Z&&(le|=H.DEPTH_BUFFER_BIT),oe&&(le|=H.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),H.clear(le)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",xe,!1),t.removeEventListener("webglcontextrestored",Se,!1),t.removeEventListener("webglcontextcreationerror",Oe,!1),ze.dispose(),Qe.dispose(),Ve.dispose(),W.dispose(),U.dispose(),we.dispose(),Ft.dispose(),sn.dispose(),Ee.dispose(),Le.dispose(),Le.removeEventListener("sessionstart",Gn),Le.removeEventListener("sessionend",Xc),Dr.stop()};function xe(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function Se(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const O=dt.autoReset,Z=Pe.enabled,oe=Pe.autoUpdate,le=Pe.needsUpdate,ne=Pe.type;Y(),dt.autoReset=O,Pe.enabled=Z,Pe.autoUpdate=oe,Pe.needsUpdate=le,Pe.type=ne}function Oe(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function _t(O){const Z=O.target;Z.removeEventListener("dispose",_t),Vt(Z)}function Vt(O){wn(O),Ve.remove(O)}function wn(O){const Z=Ve.get(O).programs;Z!==void 0&&(Z.forEach(function(oe){Ee.releaseProgram(oe)}),O.isShaderMaterial&&Ee.releaseShaderCache(O))}this.renderBufferDirect=function(O,Z,oe,le,ne,De){Z===null&&(Z=wt);const Xe=ne.isMesh&&ne.matrixWorld.determinant()<0,nt=Ah(O,Z,oe,le,ne);ye.setMaterial(le,Xe);let Ze=oe.index,ht=1;if(le.wireframe===!0){if(Ze=ve.getWireframeAttribute(oe),Ze===void 0)return;ht=2}const yt=oe.drawRange,ft=oe.attributes.position;let Yt=yt.start*ht,ln=(yt.start+yt.count)*ht;De!==null&&(Yt=Math.max(Yt,De.start*ht),ln=Math.min(ln,(De.start+De.count)*ht)),Ze!==null?(Yt=Math.max(Yt,0),ln=Math.min(ln,Ze.count)):ft!=null&&(Yt=Math.max(Yt,0),ln=Math.min(ln,ft.count));const en=ln-Yt;if(en<0||en===1/0)return;Ft.setup(ne,le,nt,oe,Ze);let xn,st=Et;if(Ze!==null&&(xn=ae.get(Ze),st=et,st.setIndex(xn)),ne.isMesh)le.wireframe===!0?(ye.setLineWidth(le.wireframeLinewidth*Mt()),st.setMode(H.LINES)):st.setMode(H.TRIANGLES);else if(ne.isLine){let Ue=le.linewidth;Ue===void 0&&(Ue=1),ye.setLineWidth(Ue*Mt()),ne.isLineSegments?st.setMode(H.LINES):ne.isLineLoop?st.setMode(H.LINE_LOOP):st.setMode(H.LINE_STRIP)}else ne.isPoints?st.setMode(H.POINTS):ne.isSprite&&st.setMode(H.TRIANGLES);if(ne.isBatchedMesh)if(ne._multiDrawInstances!==null)st.renderMultiDrawInstances(ne._multiDrawStarts,ne._multiDrawCounts,ne._multiDrawCount,ne._multiDrawInstances);else if(be.get("WEBGL_multi_draw"))st.renderMultiDraw(ne._multiDrawStarts,ne._multiDrawCounts,ne._multiDrawCount);else{const Ue=ne._multiDrawStarts,fn=ne._multiDrawCounts,At=ne._multiDrawCount,un=Ze?ae.get(Ze).bytesPerElement:1,Ui=Ve.get(le).currentProgram.getUniforms();for(let Fn=0;Fn{function De(){if(le.forEach(function(Xe){Ve.get(Xe).currentProgram.isReady()&&le.delete(Xe)}),le.size===0){ne(O);return}setTimeout(De,10)}be.get("KHR_parallel_shader_compile")!==null?De():setTimeout(De,10)})};let Jt=null;function Qi(O){Jt&&Jt(O)}function Gn(){Dr.stop()}function Xc(){Dr.start()}const Dr=new MI;Dr.setAnimationLoop(Qi),typeof self!="undefined"&&Dr.setContext(self),this.setAnimationLoop=function(O){Jt=O,Le.setAnimationLoop(O),O===null?Dr.stop():Dr.start()},Le.addEventListener("sessionstart",Gn),Le.addEventListener("sessionend",Xc),this.render=function(O,Z){if(Z!==void 0&&Z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),Z.parent===null&&Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),Le.enabled===!0&&Le.isPresenting===!0&&(Le.cameraAutoUpdate===!0&&Le.updateCamera(Z),Z=Le.getCamera()),O.isScene===!0&&O.onBeforeRender(A,O,Z,D),x=Qe.get(O,_.length),x.init(Z),_.push(x),Ie.multiplyMatrices(Z.projectionMatrix,Z.matrixWorldInverse),ot.setFromProjectionMatrix(Ie),Me=this.localClippingEnabled,re=Rt.init(this.clippingPlanes,Me),S=ze.get(O,m.length),S.init(),m.push(S),Le.enabled===!0&&Le.isPresenting===!0){const De=A.xr.getDepthSensingMesh();De!==null&&Ta(De,Z,-1/0,A.sortObjects)}Ta(O,Z,0,A.sortObjects),S.finish(),A.sortObjects===!0&&S.sort(z,te),vt=Le.enabled===!1||Le.isPresenting===!1||Le.hasDepthSensing()===!1,vt&&Ke.addToRenderList(S,O),this.info.render.frame++,re===!0&&Rt.beginShadows();const oe=x.state.shadowsArray;Pe.render(oe,O,Z),re===!0&&Rt.endShadows(),this.info.autoReset===!0&&this.info.reset();const le=S.opaque,ne=S.transmissive;if(x.setupLights(),Z.isArrayCamera){const De=Z.cameras;if(ne.length>0)for(let Xe=0,nt=De.length;Xe0&&ba(le,ne,O,Z),vt&&Ke.render(O),Zl(S,O,Z);D!==null&&(qe.updateMultisampleRenderTarget(D),qe.updateRenderTargetMipmap(D)),O.isScene===!0&&O.onAfterRender(A,O,Z),Ft.resetDefaultState(),N=-1,B=null,_.pop(),_.length>0?(x=_[_.length-1],re===!0&&Rt.setGlobalState(A.clippingPlanes,x.state.camera)):x=null,m.pop(),m.length>0?S=m[m.length-1]:S=null};function Ta(O,Z,oe,le){if(O.visible===!1)return;if(O.layers.test(Z.layers)){if(O.isGroup)oe=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(Z);else if(O.isLight)x.pushLight(O),O.castShadow&&x.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||ot.intersectsSprite(O)){le&&$e.setFromMatrixPosition(O.matrixWorld).applyMatrix4(Ie);const Xe=we.update(O),nt=O.material;nt.visible&&S.push(O,Xe,nt,oe,$e.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||ot.intersectsObject(O))){const Xe=we.update(O),nt=O.material;if(le&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),$e.copy(O.boundingSphere.center)):(Xe.boundingSphere===null&&Xe.computeBoundingSphere(),$e.copy(Xe.boundingSphere.center)),$e.applyMatrix4(O.matrixWorld).applyMatrix4(Ie)),Array.isArray(nt)){const Ze=Xe.groups;for(let ht=0,yt=Ze.length;ht0&&Ra(ne,Z,oe),De.length>0&&Ra(De,Z,oe),Xe.length>0&&Ra(Xe,Z,oe),ye.buffers.depth.setTest(!0),ye.buffers.depth.setMask(!0),ye.buffers.color.setMask(!0),ye.setPolygonOffset(!1)}function ba(O,Z,oe,le){if((oe.isScene===!0?oe.overrideMaterial:null)!==null)return;x.state.transmissionRenderTarget[le.id]===void 0&&(x.state.transmissionRenderTarget[le.id]=new ys(1,1,{generateMipmaps:!0,type:be.has("EXT_color_buffer_half_float")||be.has("EXT_color_buffer_float")?ec:vs,minFilter:Kr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:tn.workingColorSpace}));const De=x.state.transmissionRenderTarget[le.id],Xe=le.viewport||T;De.setSize(Xe.z,Xe.w);const nt=A.getRenderTarget();A.setRenderTarget(De),A.getClearColor(J),q=A.getClearAlpha(),q<1&&A.setClearColor(16777215,.5),A.clear(),vt&&Ke.render(oe);const Ze=A.toneMapping;A.toneMapping=zs;const ht=le.viewport;if(le.viewport!==void 0&&(le.viewport=void 0),x.setupLightsView(le),re===!0&&Rt.setGlobalState(A.clippingPlanes,le),Ra(O,oe,le),qe.updateMultisampleRenderTarget(De),qe.updateRenderTargetMipmap(De),be.has("WEBGL_multisampled_render_to_texture")===!1){let yt=!1;for(let ft=0,Yt=Z.length;ft0),ft=!!oe.morphAttributes.position,Yt=!!oe.morphAttributes.normal,ln=!!oe.morphAttributes.color;let en=zs;le.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(en=A.toneMapping);const xn=oe.morphAttributes.position||oe.morphAttributes.normal||oe.morphAttributes.color,st=xn!==void 0?xn.length:0,Ue=Ve.get(le),fn=x.state.lights;if(re===!0&&(Me===!0||O!==B)){const ci=O===B&&le.id===N;Rt.setState(le,O,ci)}let At=!1;le.version===Ue.__version?(Ue.needsLights&&Ue.lightsStateVersion!==fn.state.version||Ue.outputColorSpace!==nt||ne.isBatchedMesh&&Ue.batching===!1||!ne.isBatchedMesh&&Ue.batching===!0||ne.isBatchedMesh&&Ue.batchingColor===!0&&ne.colorTexture===null||ne.isBatchedMesh&&Ue.batchingColor===!1&&ne.colorTexture!==null||ne.isInstancedMesh&&Ue.instancing===!1||!ne.isInstancedMesh&&Ue.instancing===!0||ne.isSkinnedMesh&&Ue.skinning===!1||!ne.isSkinnedMesh&&Ue.skinning===!0||ne.isInstancedMesh&&Ue.instancingColor===!0&&ne.instanceColor===null||ne.isInstancedMesh&&Ue.instancingColor===!1&&ne.instanceColor!==null||ne.isInstancedMesh&&Ue.instancingMorph===!0&&ne.morphTexture===null||ne.isInstancedMesh&&Ue.instancingMorph===!1&&ne.morphTexture!==null||Ue.envMap!==Ze||le.fog===!0&&Ue.fog!==De||Ue.numClippingPlanes!==void 0&&(Ue.numClippingPlanes!==Rt.numPlanes||Ue.numIntersection!==Rt.numIntersection)||Ue.vertexAlphas!==ht||Ue.vertexTangents!==yt||Ue.morphTargets!==ft||Ue.morphNormals!==Yt||Ue.morphColors!==ln||Ue.toneMapping!==en||Ue.morphTargetsCount!==st)&&(At=!0):(At=!0,Ue.__version=le.version);let un=Ue.currentProgram;At===!0&&(un=Pa(le,Z,ne));let Ui=!1,Fn=!1,Yn=!1;const hn=un.getUniforms(),dr=Ue.uniforms;if(ye.useProgram(un.program)&&(Ui=!0,Fn=!0,Yn=!0),le.id!==N&&(N=le.id,Fn=!0),Ui||B!==O){hn.setValue(H,"projectionMatrix",O.projectionMatrix),hn.setValue(H,"viewMatrix",O.matrixWorldInverse);const ci=hn.map.cameraPosition;ci!==void 0&&ci.setValue(H,Be.setFromMatrixPosition(O.matrixWorld)),He.logarithmicDepthBuffer&&hn.setValue(H,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(le.isMeshPhongMaterial||le.isMeshToonMaterial||le.isMeshLambertMaterial||le.isMeshBasicMaterial||le.isMeshStandardMaterial||le.isShaderMaterial)&&hn.setValue(H,"isOrthographic",O.isOrthographicCamera===!0),B!==O&&(B=O,Fn=!0,Yn=!0)}if(ne.isSkinnedMesh){hn.setOptional(H,ne,"bindMatrix"),hn.setOptional(H,ne,"bindMatrixInverse");const ci=ne.skeleton;ci&&(ci.boneTexture===null&&ci.computeBoneTexture(),hn.setValue(H,"boneTexture",ci.boneTexture,qe))}ne.isBatchedMesh&&(hn.setOptional(H,ne,"batchingTexture"),hn.setValue(H,"batchingTexture",ne._matricesTexture,qe),hn.setOptional(H,ne,"batchingIdTexture"),hn.setValue(H,"batchingIdTexture",ne._indirectTexture,qe),hn.setOptional(H,ne,"batchingColorTexture"),ne._colorsTexture!==null&&hn.setValue(H,"batchingColorTexture",ne._colorsTexture,qe));const Xs=oe.morphAttributes;if((Xs.position!==void 0||Xs.normal!==void 0||Xs.color!==void 0)&&kt.update(ne,oe,un),(Fn||Ue.receiveShadow!==ne.receiveShadow)&&(Ue.receiveShadow=ne.receiveShadow,hn.setValue(H,"receiveShadow",ne.receiveShadow)),le.isMeshGouraudMaterial&&le.envMap!==null&&(dr.envMap.value=Ze,dr.flipEnvMap.value=Ze.isCubeTexture&&Ze.isRenderTargetTexture===!1?-1:1),le.isMeshStandardMaterial&&le.envMap===null&&Z.environment!==null&&(dr.envMapIntensity.value=Z.environmentIntensity),Fn&&(hn.setValue(H,"toneMappingExposure",A.toneMappingExposure),Ue.needsLights&&Sh(dr,Yn),De&&le.fog===!0&&ut.refreshFogUniforms(dr,De),ut.refreshMaterialUniforms(dr,le,ge,K,x.state.transmissionRenderTarget[O.id]),Yg.upload(H,jc(Ue),dr,qe)),le.isShaderMaterial&&le.uniformsNeedUpdate===!0&&(Yg.upload(H,jc(Ue),dr,qe),le.uniformsNeedUpdate=!1),le.isSpriteMaterial&&hn.setValue(H,"center",ne.center),hn.setValue(H,"modelViewMatrix",ne.modelViewMatrix),hn.setValue(H,"normalMatrix",ne.normalMatrix),hn.setValue(H,"modelMatrix",ne.matrixWorld),le.isShaderMaterial||le.isRawShaderMaterial){const ci=le.uniformsGroups;for(let Ia=0,qi=ci.length;Ia0&&qe.useMultisampledRTT(O)===!1?ne=Ve.get(O).__webglMultisampledFramebuffer:Array.isArray(yt)?ne=yt[oe]:ne=yt,T.copy(O.viewport),F.copy(O.scissor),X=O.scissorTest}else T.copy(ie).multiplyScalar(ge).floor(),F.copy(fe).multiplyScalar(ge).floor(),X=Ce;if(ye.bindFramebuffer(H.FRAMEBUFFER,ne)&&le&&ye.drawBuffers(O,ne),ye.viewport(T),ye.scissor(F),ye.setScissorTest(X),De){const Ze=Ve.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+Z,Ze.__webglTexture,oe)}else if(Xe){const Ze=Ve.get(O.texture),ht=Z||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,Ze.__webglTexture,oe||0,ht)}N=-1},this.readRenderTargetPixels=function(O,Z,oe,le,ne,De,Xe){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nt=Ve.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Xe!==void 0&&(nt=nt[Xe]),nt){ye.bindFramebuffer(H.FRAMEBUFFER,nt);try{const Ze=O.texture,ht=Ze.format,yt=Ze.type;if(!He.textureFormatReadable(ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!He.textureTypeReadable(yt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Z>=0&&Z<=O.width-le&&oe>=0&&oe<=O.height-ne&&H.readPixels(Z,oe,le,ne,Tt.convert(ht),Tt.convert(yt),De)}finally{const Ze=D!==null?Ve.get(D).__webglFramebuffer:null;ye.bindFramebuffer(H.FRAMEBUFFER,Ze)}}},this.readRenderTargetPixelsAsync=function(O,Z,oe,le,ne,De,Xe){return fu(this,null,function*(){if(!(O&&O.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let nt=Ve.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Xe!==void 0&&(nt=nt[Xe]),nt){ye.bindFramebuffer(H.FRAMEBUFFER,nt);try{const Ze=O.texture,ht=Ze.format,yt=Ze.type;if(!He.textureFormatReadable(ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!He.textureTypeReadable(yt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(Z>=0&&Z<=O.width-le&&oe>=0&&oe<=O.height-ne){const ft=H.createBuffer();H.bindBuffer(H.PIXEL_PACK_BUFFER,ft),H.bufferData(H.PIXEL_PACK_BUFFER,De.byteLength,H.STREAM_READ),H.readPixels(Z,oe,le,ne,Tt.convert(ht),Tt.convert(yt),0),H.flush();const Yt=H.fenceSync(H.SYNC_GPU_COMMANDS_COMPLETE,0);yield fG(H,Yt,4);try{H.bindBuffer(H.PIXEL_PACK_BUFFER,ft),H.getBufferSubData(H.PIXEL_PACK_BUFFER,0,De)}finally{H.deleteBuffer(ft),H.deleteSync(Yt)}return De}}finally{const Ze=D!==null?Ve.get(D).__webglFramebuffer:null;ye.bindFramebuffer(H.FRAMEBUFFER,Ze)}}})},this.copyFramebufferToTexture=function(O,Z=null,oe=0){O.isTexture!==!0&&(sc("WebGLRenderer: copyFramebufferToTexture function signature has changed."),Z=arguments[0]||null,O=arguments[1]);const le=Math.pow(2,-oe),ne=Math.floor(O.image.width*le),De=Math.floor(O.image.height*le),Xe=Z!==null?Z.x:0,nt=Z!==null?Z.y:0;qe.setTexture2D(O,0),H.copyTexSubImage2D(H.TEXTURE_2D,oe,0,0,Xe,nt,ne,De),ye.unbindTexture()},this.copyTextureToTexture=function(O,Z,oe=null,le=null,ne=0){O.isTexture!==!0&&(sc("WebGLRenderer: copyTextureToTexture function signature has changed."),le=arguments[0]||null,O=arguments[1],Z=arguments[2],ne=arguments[3]||0,oe=null);let De,Xe,nt,Ze,ht,yt;oe!==null?(De=oe.max.x-oe.min.x,Xe=oe.max.y-oe.min.y,nt=oe.min.x,Ze=oe.min.y):(De=O.image.width,Xe=O.image.height,nt=0,Ze=0),le!==null?(ht=le.x,yt=le.y):(ht=0,yt=0);const ft=Tt.convert(Z.format),Yt=Tt.convert(Z.type);qe.setTexture2D(Z,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,Z.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,Z.unpackAlignment);const ln=H.getParameter(H.UNPACK_ROW_LENGTH),en=H.getParameter(H.UNPACK_IMAGE_HEIGHT),xn=H.getParameter(H.UNPACK_SKIP_PIXELS),st=H.getParameter(H.UNPACK_SKIP_ROWS),Ue=H.getParameter(H.UNPACK_SKIP_IMAGES),fn=O.isCompressedTexture?O.mipmaps[ne]:O.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,fn.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,fn.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,nt),H.pixelStorei(H.UNPACK_SKIP_ROWS,Ze),O.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,ne,ht,yt,De,Xe,ft,Yt,fn.data):O.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,ne,ht,yt,fn.width,fn.height,ft,fn.data):H.texSubImage2D(H.TEXTURE_2D,ne,ht,yt,De,Xe,ft,Yt,fn),H.pixelStorei(H.UNPACK_ROW_LENGTH,ln),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,en),H.pixelStorei(H.UNPACK_SKIP_PIXELS,xn),H.pixelStorei(H.UNPACK_SKIP_ROWS,st),H.pixelStorei(H.UNPACK_SKIP_IMAGES,Ue),ne===0&&Z.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),ye.unbindTexture()},this.copyTextureToTexture3D=function(O,Z,oe=null,le=null,ne=0){O.isTexture!==!0&&(sc("WebGLRenderer: copyTextureToTexture3D function signature has changed."),oe=arguments[0]||null,le=arguments[1]||null,O=arguments[2],Z=arguments[3],ne=arguments[4]||0);let De,Xe,nt,Ze,ht,yt,ft,Yt,ln;const en=O.isCompressedTexture?O.mipmaps[ne]:O.image;oe!==null?(De=oe.max.x-oe.min.x,Xe=oe.max.y-oe.min.y,nt=oe.max.z-oe.min.z,Ze=oe.min.x,ht=oe.min.y,yt=oe.min.z):(De=en.width,Xe=en.height,nt=en.depth,Ze=0,ht=0,yt=0),le!==null?(ft=le.x,Yt=le.y,ln=le.z):(ft=0,Yt=0,ln=0);const xn=Tt.convert(Z.format),st=Tt.convert(Z.type);let Ue;if(Z.isData3DTexture)qe.setTexture3D(Z,0),Ue=H.TEXTURE_3D;else if(Z.isDataArrayTexture||Z.isCompressedArrayTexture)qe.setTexture2DArray(Z,0),Ue=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,Z.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,Z.unpackAlignment);const fn=H.getParameter(H.UNPACK_ROW_LENGTH),At=H.getParameter(H.UNPACK_IMAGE_HEIGHT),un=H.getParameter(H.UNPACK_SKIP_PIXELS),Ui=H.getParameter(H.UNPACK_SKIP_ROWS),Fn=H.getParameter(H.UNPACK_SKIP_IMAGES);H.pixelStorei(H.UNPACK_ROW_LENGTH,en.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,en.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,Ze),H.pixelStorei(H.UNPACK_SKIP_ROWS,ht),H.pixelStorei(H.UNPACK_SKIP_IMAGES,yt),O.isDataTexture||O.isData3DTexture?H.texSubImage3D(Ue,ne,ft,Yt,ln,De,Xe,nt,xn,st,en.data):Z.isCompressedArrayTexture?H.compressedTexSubImage3D(Ue,ne,ft,Yt,ln,De,Xe,nt,xn,en.data):H.texSubImage3D(Ue,ne,ft,Yt,ln,De,Xe,nt,xn,st,en),H.pixelStorei(H.UNPACK_ROW_LENGTH,fn),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,At),H.pixelStorei(H.UNPACK_SKIP_PIXELS,un),H.pixelStorei(H.UNPACK_SKIP_ROWS,Ui),H.pixelStorei(H.UNPACK_SKIP_IMAGES,Fn),ne===0&&Z.generateMipmaps&&H.generateMipmap(Ue),ye.unbindTexture()},this.initRenderTarget=function(O){Ve.get(O).__webglFramebuffer===void 0&&qe.setupRenderTarget(O)},this.initTexture=function(O){O.isCubeTexture?qe.setTextureCube(O,0):O.isData3DTexture?qe.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?qe.setTexture2DArray(O,0):qe.setTexture2D(O,0),ye.unbindTexture()},this.resetState=function(){I=0,P=0,D=null,ye.reset(),Ft.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Hs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Cg?"display-p3":"srgb",t.unpackColorSpace=tn.workingColorSpace===Bd?"display-p3":"srgb"}}class qg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ke(e),this.density=t}clone(){return new qg(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Zg{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new ke(e),this.near=t,this.far=i}clone(){return new Zg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class $g extends jt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new cr,this.environmentIntensity=1,this.environmentRotation=new cr,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Qd{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Nd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=br()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return sc("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:qd.clone(),uv:Pr.getInterpolation(qd,ev,$d,tv,eB,vS,tB,new Ae),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function nv(n,e,t,i,r,s){Bc.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Zd.x=s*Bc.x-r*Bc.y,Zd.y=r*Bc.x+s*Bc.y):Zd.copy(Bc),n.copy(e),n.x+=Zd.x,n.y+=Zd.y,n.applyMatrix4($I)}const iv=new G,iB=new G;class rB extends jt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){iv.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(iv);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){iv.setFromMatrixPosition(e.matrixWorld),iB.setFromMatrixPosition(this.matrixWorld);const i=iv.distanceTo(iB)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}}const Aa=new mt,SS=new mt,Q5=new mt,q5=new ke(1,1,1),hB=new mt,MS=new Kd,av=new Bi,Dl=new _i,ih=new G,pB=new G,Z5=new G,wS=new Y5,Di=new jn,lv=[];function $5(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new $t(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Bi);const e=this._geometryCount,t=this.boundingBox,i=this._drawInfo;t.makeEmpty();for(let r=0;r=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:e});const t=this._drawInfo.length-1,i=this._matricesTexture,r=i.image.data;Q5.toArray(r,t*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(q5.toArray(s.image.data,t*4),s.needsUpdate=!0),t}addGeometry(e,t=-1,i=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const u=e.getIndex(),d=u!==null;if(d&&(i===-1?r.indexCount=u.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:d?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Bi,sphereInitialized:!1,sphere:new _i}),this.setGeometryAt(h,e),h}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,u=a.vertexCount;for(const g in i.attributes){const v=t.getAttribute(g),S=i.getAttribute(g);$5(v,S,l);const x=v.itemSize;for(let m=v.count,_=u;m<_;m++){const A=l+m;for(let w=0;w=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let u=l.start,d=l.start+l.count;u=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,av),av.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let u=0;for(let d=l.start,h=l.start+l.count;d=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;Di.material=this.material,Di.geometry.index=o.index,Di.geometry.attributes=o.attributes,Di.geometry.boundingBox===null&&(Di.geometry.boundingBox=new Bi),Di.geometry.boundingSphere===null&&(Di.geometry.boundingSphere=new _i);for(let a=0,l=i.length;a_e({},t)),this._reservedRanges=e._reservedRanges.map(t=>_e({},t)),this._drawInfo=e._drawInfo.map(t=>_e({},t)),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,u=this._multiDrawStarts,d=this._multiDrawCounts,h=this._drawRanges,p=this.perObjectFrustumCulled,g=this._indirectTexture,v=g.image.data;p&&(hB.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),MS.setFromProjectionMatrix(hB,e.coordinateSystem));let S=0;if(this.sortObjects){SS.copy(this.matrixWorld).invert(),ih.setFromMatrixPosition(i.matrixWorld).applyMatrix4(SS),pB.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(SS);for(let _=0,A=l.length;_0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;ES.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(ES);if(!(le.far))return{distance:l,point:vB.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const yB=new G,xB=new G;class ws extends To{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class e8 extends Mn{constructor(e,t,i,r,s,o,a,l,u){super(e,t,i,r,s,o,a,l,u),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:kn,this.magFilter=s!==void 0?s:kn,this.generateMipmaps=!1;const d=this;function h(){d.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class t8 extends Mn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=oi,this.minFilter=oi,this.generateMipmaps=!1,this.needsUpdate=!0}}class gv extends Mn{constructor(e,t,i,r,s,o,a,l,u,d,h,p){super(null,o,a,l,u,d,r,s,h,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class n8 extends gv{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Tr,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class i8 extends gv{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,mo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class r8 extends Mn{constructor(e,t,i,r,s,o,a,l,u){super(e,t,i,r,s,o,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Es{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,u;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),u=i[r]-o,u<0)a=r+1;else if(u>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const d=i[r],p=i[r+1]-d,g=(o-d)/p;return(r+g)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Ae:new G);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new G,r=[],s=[],o=[],a=new G,l=new mt;for(let g=0;g<=e;g++){const v=g/e;r[g]=this.getTangentAt(v,new G)}s[0]=new G,o[0]=new G;let u=Number.MAX_VALUE;const d=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);d<=u&&(u=d,i.set(1,0,0)),h<=u&&(u=h,i.set(0,1,0)),p<=u&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),a.crossVectors(r[g-1],r[g]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(zn(r[g-1].dot(r[g]),-1,1));s[g].applyMatrix4(l.makeRotationAxis(a,v))}o[g].crossVectors(r[g],s[g])}if(t===!0){let g=Math.acos(zn(s[0].dot(s[e]),-1,1));g/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(g=-g);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],g*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class vv extends Es{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Ae){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let u,d;this.closed||a>0?u=r[(a-1)%s]:(yv.subVectors(r[0],r[1]).add(r[0]),u=yv);const h=r[a%s],p=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(wB(a,l.x,u.x,d.x,h.x),wB(a,l.y,u.y,d.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),u=l===0?0:1-o/l;return a.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=u.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(u);const d=u.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class lh extends Pt{constructor(e=[new Ae(0,-.5),new Ae(.5,0),new Ae(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=zn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],u=[],d=1/t,h=new G,p=new Ae,g=new G,v=new G,S=new G;let x=0,m=0;for(let _=0;_<=e.length-1;_++)switch(_){case 0:x=e[_+1].x-e[_].x,m=e[_+1].y-e[_].y,g.x=m*1,g.y=-x,g.z=m*0,S.copy(g),g.normalize(),l.push(g.x,g.y,g.z);break;case e.length-1:l.push(S.x,S.y,S.z);break;default:x=e[_+1].x-e[_].x,m=e[_+1].y-e[_].y,g.x=m*1,g.y=-x,g.z=m*0,v.copy(g),g.x+=S.x,g.y+=S.y,g.z+=S.z,g.normalize(),l.push(g.x,g.y,g.z),S.copy(v)}for(let _=0;_<=t;_++){const A=i+_*d*r,w=Math.sin(A),I=Math.cos(A);for(let P=0;P<=e.length-1;P++){h.x=e[P].x*w,h.y=e[P].y,h.z=e[P].x*I,o.push(h.x,h.y,h.z),p.x=_/t,p.y=P/(e.length-1),a.push(p.x,p.y);const D=l[3*P+0]*w,N=l[3*P+1],B=l[3*P+0]*I;u.push(D,N,B)}}for(let _=0;_0&&A(!0),t>0&&A(!1)),this.setIndex(d),this.setAttribute("position",new rt(h,3)),this.setAttribute("normal",new rt(p,3)),this.setAttribute("uv",new rt(g,2));function _(){const w=new G,I=new G;let P=0;const D=(t-e)/i;for(let N=0;N<=s;N++){const B=[],T=N/s,F=T*(t-e)+e;for(let X=0;X<=r;X++){const J=X/r,q=J*l+a,$=Math.sin(q),K=Math.cos(q);I.x=F*$,I.y=-T*i+x,I.z=F*K,h.push(I.x,I.y,I.z),w.set($,D,K).normalize(),p.push(w.x,w.y,w.z),g.push(J,1-T),B.push(v++)}S.push(B)}for(let N=0;N.9&&D<.1&&(A<.2&&(o[_+0]+=1),w<.2&&(o[_+2]+=1),I<.2&&(o[_+4]+=1))}}function p(_){s.push(_.x,_.y,_.z)}function g(_,A){const w=_*3;A.x=e[w+0],A.y=e[w+1],A.z=e[w+2]}function v(){const _=new G,A=new G,w=new G,I=new G,P=new Ae,D=new Ae,N=new Ae;for(let B=0,T=0;B80*t){a=u=n[0],l=d=n[1];for(let v=t;vu&&(u=h),p>d&&(d=p);g=Math.max(u-a,d-l),g=g!==0?32767/g:0}return uh(s,o,t,a,l,g,0),o}};function RB(n,e,t,i,r){let s,o;if(r===b8(n,e,t,i)>0)for(s=e;s=e;s-=i)o=BB(s,n[s],n[s+1],o);return o&&Tv(o,o.next)&&(fh(o),o=o.next),o}function Nl(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Tv(t,t.next)||Dn(t.prev,t,t.next)===0)){if(fh(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function uh(n,e,t,i,r,s,o){if(!n)return;!o&&s&&S8(n,i,r,s);let a=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,s?p8(n,i,r,s):h8(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),fh(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=m8(Nl(n),e,t),uh(n,e,t,i,r,s,2)):o===2&&g8(n,e,t,i,r,s):uh(Nl(n),e,t,i,r,s,1);break}}}function h8(n){const e=n.prev,t=n,i=n.next;if(Dn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,u=i.y,d=rs?r>o?r:o:s>o?s:o,g=a>l?a>u?a:u:l>u?l:u;let v=i.next;for(;v!==e;){if(v.x>=d&&v.x<=p&&v.y>=h&&v.y<=g&&Fc(r,a,s,l,o,u,v.x,v.y)&&Dn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function p8(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Dn(r,s,o)>=0)return!1;const a=r.x,l=s.x,u=o.x,d=r.y,h=s.y,p=o.y,g=al?a>u?a:u:l>u?l:u,x=d>h?d>p?d:p:h>p?h:p,m=kS(g,v,e,t,i),_=kS(S,x,e,t,i);let A=n.prevZ,w=n.nextZ;for(;A&&A.z>=m&&w&&w.z<=_;){if(A.x>=g&&A.x<=S&&A.y>=v&&A.y<=x&&A!==r&&A!==o&&Fc(a,d,l,h,u,p,A.x,A.y)&&Dn(A.prev,A,A.next)>=0||(A=A.prevZ,w.x>=g&&w.x<=S&&w.y>=v&&w.y<=x&&w!==r&&w!==o&&Fc(a,d,l,h,u,p,w.x,w.y)&&Dn(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;A&&A.z>=m;){if(A.x>=g&&A.x<=S&&A.y>=v&&A.y<=x&&A!==r&&A!==o&&Fc(a,d,l,h,u,p,A.x,A.y)&&Dn(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;w&&w.z<=_;){if(w.x>=g&&w.x<=S&&w.y>=v&&w.y<=x&&w!==r&&w!==o&&Fc(a,d,l,h,u,p,w.x,w.y)&&Dn(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function m8(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Tv(r,s)&&PB(r,i,i.next,s)&&ch(r,s)&&ch(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),fh(i),fh(i.next),i=n=s),i=i.next}while(i!==n);return Nl(i)}function g8(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&E8(o,a)){let l=IB(o,a);o=Nl(o,o.next),l=Nl(l,l.next),uh(o,e,t,i,r,s,0),uh(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function v8(n,e,t,i){const r=[];let s,o,a,l,u;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x=t.x&&t.x>=l&&s!==t.x&&Fc(or.x||t.x===r.x&&A8(r,t)))&&(r=t,d=h)),t=t.next;while(t!==a);return r}function A8(n,e){return Dn(n.prev,n,e.prev)<0&&Dn(e.next,n,n.next)<0}function S8(n,e,t,i){let r=n;do r.z===0&&(r.z=kS(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,M8(r)}function M8(n){let e,t,i,r,s,o,a,l,u=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,u*=2}while(o>1);return n}function kS(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function w8(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function E8(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!C8(n,e)&&(ch(n,e)&&ch(e,n)&&T8(n,e)&&(Dn(n.prev,n,e.prev)||Dn(n,e.prev,e))||Tv(n,e)&&Dn(n.prev,n,n.next)>0&&Dn(e.prev,e,e.next)>0)}function Dn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Tv(n,e){return n.x===e.x&&n.y===e.y}function PB(n,e,t,i){const r=Rv(Dn(n,e,t)),s=Rv(Dn(n,e,i)),o=Rv(Dn(t,i,n)),a=Rv(Dn(t,i,e));return!!(r!==s&&o!==a||r===0&&bv(n,t,e)||s===0&&bv(n,i,e)||o===0&&bv(t,n,i)||a===0&&bv(t,e,i))}function bv(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Rv(n){return n>0?1:n<0?-1:0}function C8(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&PB(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function ch(n,e){return Dn(n.prev,n,n.next)<0?Dn(n,e,n.next)>=0&&Dn(n,n.prev,e)>=0:Dn(n,e,n.prev)<0||Dn(n,n.next,e)<0}function T8(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function IB(n,e){const t=new zS(n.i,n.x,n.y),i=new zS(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function BB(n,e,t,i){const r=new zS(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function fh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function zS(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function b8(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function DB(n,e){for(let t=0;tNumber.EPSILON){const we=Math.sqrt(ae),Ee=Math.sqrt(W*W+U*U),ut=Te.x-qe/we,ze=Te.y+Ve/we,Qe=be.x-U/Ee,Rt=be.y+W/Ee,Pe=((Qe-ut)*U-(Rt-ze)*W)/(Ve*U-qe*W);He=ut+Ve*Pe-H.x,ye=ze+qe*Pe-H.y;const Ke=He*He+ye*ye;if(Ke<=2)return new Ae(He,ye);dt=Math.sqrt(Ke/2)}else{let we=!1;Ve>Number.EPSILON?W>Number.EPSILON&&(we=!0):Ve<-Number.EPSILON?W<-Number.EPSILON&&(we=!0):Math.sign(qe)===Math.sign(U)&&(we=!0),we?(He=-qe,ye=Ve,dt=Math.sqrt(ae)):(He=Ve,ye=qe,dt=Math.sqrt(ae/2))}return new Ae(He/dt,ye/dt)}const te=[];for(let H=0,Te=q.length,be=Te-1,He=H+1;H=0;H--){const Te=H/x,be=g*Math.cos(Te*Math.PI/2),He=v*Math.sin(Te*Math.PI/2)+S;for(let ye=0,dt=q.length;ye=0;){const He=be;let ye=be-1;ye<0&&(ye=H.length-1);for(let dt=0,Ve=d+x*2;dt0)&&g.push(A,w,P),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class zB extends $n{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ke(16777215),this.specular=new ke(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cr,this.combine=Sd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class HB extends $n{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ke(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class GB extends $n{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class VB extends $n{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ke(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cr,this.combine=Sd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class WB extends $n{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ke(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class XB extends Fi{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Ul(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function jB(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function JB(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function HS(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function GS(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function B8(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){h.push(u.times[g]);for(let S=0;Ss.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const m=v*h+d,_=m+h-d;S=a.values.slice(m,_)}else{const m=a.createInterpolant(),_=d,A=h-d;m.evaluate(s),S=m.resultBuffer.slice(_,A)}l==="quaternion"&&new Ii().fromArray(S).normalize().conjugate().toArray(S);const x=u.times.length;for(let m=0;m=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&jB(r))for(let a=0,l=r.length;a!==l;++a){const u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Mg,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,u=0;u!==i;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Cs.prototype.TimeBufferType=Float32Array,Cs.prototype.ValueBufferType=Float32Array,Cs.prototype.DefaultInterpolation=nc;class Ol extends Cs{constructor(e,t,i){super(e,t,i)}}Ol.prototype.ValueTypeName="bool",Ol.prototype.ValueBufferType=Array,Ol.prototype.DefaultInterpolation=tc,Ol.prototype.InterpolantFactoryMethodLinear=void 0,Ol.prototype.InterpolantFactoryMethodSmooth=void 0;class WS extends Cs{}WS.prototype.ValueTypeName="color";class kl extends Cs{}kl.prototype.ValueTypeName="number";class QB extends Nc{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let u=e*a;for(let d=u+a;u!==d;u+=4)Ii.slerpFlat(s,0,o,u-a,o,u,l);return s}}class zl extends Cs{InterpolantFactoryMethodLinear(e){return new QB(this.times,this.values,this.getValueSize(),e)}}zl.prototype.ValueTypeName="quaternion",zl.prototype.InterpolantFactoryMethodSmooth=void 0;class Hl extends Cs{constructor(e,t,i){super(e,t,i)}}Hl.prototype.ValueTypeName="string",Hl.prototype.ValueBufferType=Array,Hl.prototype.DefaultInterpolation=tc,Hl.prototype.InterpolantFactoryMethodLinear=void 0,Hl.prototype.InterpolantFactoryMethodSmooth=void 0;class Gl extends Cs{}Gl.prototype.ValueTypeName="vector";class Uc{constructor(e="",t=-1,i=[],r=wg){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=br(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(N8(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Cs.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const h=d[1];let p=r[h];p||(r[h]=p=[]),p.push(u)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,g,v,S){if(g.length!==0){const x=[],m=[];GS(g,x,m,v),x.length!==0&&S.push(new h(p,x,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(Ro[e]!==void 0){Ro[e].push({onLoad:t,onProgress:i,onError:r});return}Ro[e]=[],Ro[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream=="undefined"||u.body===void 0||u.body.getReader===void 0)return u;const d=Ro[e],h=u.body.getReader(),p=u.headers.get("X-File-Size")||u.headers.get("Content-Length"),g=p?parseInt(p):0,v=g!==0;let S=0;const x=new ReadableStream({start(m){_();function _(){h.read().then(({done:A,value:w})=>{if(A)m.close();else{S+=w.byteLength;const I=new ProgressEvent("progress",{lengthComputable:v,loaded:S,total:g});for(let P=0,D=d.length;P{m.error(A)})}}});return new Response(x)}else throw new U8(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return u.json();default:if(a===void 0)return u.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),p=h&&h[1]?h[1].toLowerCase():void 0,g=new TextDecoder(p);return u.arrayBuffer().then(v=>g.decode(v))}}}).then(u=>{bo.add(e,u);const d=Ro[e];delete Ro[e];for(let h=0,p=d.length;h{const d=Ro[e];if(d===void 0)throw this.manager.itemError(e),u;delete Ro[e];for(let h=0,p=d.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class O8 extends Ni{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Lr(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new ke().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ae().fromArray(o.value);break;case"v3":r.uniforms[s].value=new G().fromArray(o.value);break;case"v4":r.uniforms[s].value=new on().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new mt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Ae().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Ae().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:OB,SpriteMaterial:gS,RawShaderMaterial:kB,ShaderMaterial:Ss,PointsMaterial:hv,MeshPhysicalMaterial:qr,MeshStandardMaterial:ph,MeshPhongMaterial:zB,MeshToonMaterial:HB,MeshNormalMaterial:GB,MeshLambertMaterial:VB,MeshDepthMaterial:dS,MeshDistanceMaterial:hS,MeshBasicMaterial:Ir,MeshMatcapMaterial:WB,LineDashedMaterial:XB,LineBasicMaterial:Fi,Material:$n};return new t[e]}}class wa{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new XS(t);s=new mh(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,d=e.length;u0){r=new mh(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const x=new Bi;x.min.fromArray(S.boxMin),x.max.fromArray(S.boxMax);const m=new _i;return m.radius=S.sphereRadius,m.center.fromArray(S.sphereCenter),{boxInitialized:S.boxInitialized,box:x,sphereInitialized:S.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=u(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=u(e.colorsTexture.uuid));break;case"LOD":o=new rB;break;case"Line":o=new To(a(e.geometry),l(e.material));break;case"LineLoop":o=new CS(a(e.geometry),l(e.material));break;case"LineSegments":o=new ws(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new bS(a(e.geometry),l(e.material));break;case"Sprite":o=new nB(l(e.material));break;case"Group":o=new Co;break;case"Bone":o=new sv;break;default:o=new jt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let g=0;g{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{r&&r(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return bo.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){r&&r(u),bo.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});bo.add(e,l),s.manager.itemStart(e)}}let kv;class ZS{static getContext(){return kv===void 0&&(kv=new(window.AudioContext||window.webkitAudioContext)),kv}static setContext(e){kv=e}}class J8 extends Ni{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Lr(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);ZS.getContext().decodeAudioData(u,function(h){t(h)}).catch(a)}catch(u){a(u)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const dL=new mt,hL=new mt,Vl=new mt;class K8{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ai,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ai,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Vl.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Al*t.fov*.5)/t.zoom;let a,l;hL.elements[12]=-r,dL.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Vl.elements[0]=2*t.near/(l-a),Vl.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Vl),a=-o*t.aspect-s,l=o*t.aspect-s,Vl.elements[0]=2*t.near/(l-a),Vl.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Vl)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(hL),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(dL)}}class $S{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=pL(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=pL();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function pL(){return(typeof performance=="undefined"?Date:performance).now()}const Wl=new G,mL=new Ii,Y8=new G,Xl=new G;class Q8 extends jt{constructor(){super(),this.type="AudioListener",this.context=ZS.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new $S}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Wl,mL,Y8),Xl.set(0,0,-1).applyQuaternion(mL),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Wl.x,r),t.positionY.linearRampToValueAtTime(Wl.y,r),t.positionZ.linearRampToValueAtTime(Wl.z,r),t.forwardX.linearRampToValueAtTime(Xl.x,r),t.forwardY.linearRampToValueAtTime(Xl.y,r),t.forwardZ.linearRampToValueAtTime(Xl.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Wl.x,Wl.y,Wl.z),t.setOrientation(Xl.x,Xl.y,Xl.z,i.x,i.y,i.z)}}class gL extends jt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Ii.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Ii.multiplyQuaternionsFlat(e,o,e,t,e,i),Ii.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const eM="\\[\\]\\.:\\/",eW=new RegExp("["+eM+"]","g"),tM="[^"+eM+"]",tW="[^"+eM.replace("\\.","")+"]",nW=/((?:WC+[\/:])*)/.source.replace("WC",tM),iW=/(WCOD+)?/.source.replace("WCOD",tW),rW=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",tM),sW=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",tM),oW=new RegExp("^"+nW+iW+rW+sW+"$"),aW=["material","materials","bones","map"];class lW{constructor(e,t,i){const r=i||Kt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Kt{constructor(e,t,i){this.path=t,this.parsedPath=i||Kt.parseTrackName(t),this.node=Kt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Kt.Composite(e,t,i):new Kt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(eW,"")}static parseTrackName(e){const t=oW.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);aW.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const h=s++,p=e[h];t[p.uuid]=d,e[d]=p,t[u]=h,e[h]=l;for(let g=0,v=r;g!==v;++g){const S=i[g],x=S[h],m=S[d];S[d]=x,S[h]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],d=u.uuid,h=t[d];if(h!==void 0)if(delete t[d],h0&&(t[g.uuid]=h),e[h]=g,e.pop();for(let v=0,S=r;v!==S;++v){const x=i[v];x[h]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,d=this.nCachedObjects_,h=new Array(u);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(h);for(let p=d,g=l.length;p!==g;++p){const v=l[p];h[p]=new Kt(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],u=e[a];t[u]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class xL{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:yl,endingEnd:yl};for(let u=0;u!==o;++u){const d=s[u].createInterpolant(null);a[u]=d,d.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=DP,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=s,l[1]=s+i,u[0]=e/o,u[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case RA:for(let d=0,h=l.length;d!==h;++d)l[d].evaluate(o),u[d].accumulateAdditive(a);break;case wg:default:for(let d=0,h=l.length;d!==h;++d)l[d].evaluate(o),u[d].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===FP;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===LP){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=xl,r.endingEnd=xl):(e?r.endingStart=this.zeroSlopeAtStart?xl:yl:r.endingStart=Id,t?r.endingEnd=this.zeroSlopeAtEnd?xl:yl:r.endingEnd=Id)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const cW=new Float32Array(1);class fW extends xo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,u=this._bindingsByRootAndName;let d=u[l];d===void 0&&(d={},u[l]=d);for(let h=0;h!==s;++h){const p=r[h],g=p.name;let v=d[g];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,g));continue}const S=t&&t._propertyBindings[h].binding.parsedPath;v=new yL(Kt.create(i,g,S),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,g),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let u=0;u!==i;++u)t[u]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ML).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const wL=new G,zv=new G;class xW{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){wL.subVectors(e,this.start),zv.subVectors(this.end,this.start);const i=zv.dot(zv);let s=zv.dot(wL)/i;return t&&(s=zn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const EL=new G;class _W extends jt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Pt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{IL.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(IL,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class LW extends ws{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Pt;r.setAttribute("position",new rt(t,3)),r.setAttribute("color",new rt(i,3));const s=new Fi({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new ke,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class DW{constructor(){this.type="ShapePath",this.color=new ke,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new ah,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const _=[];for(let A=0,w=m.length;ANumber.EPSILON){if(T<0&&(D=_[P],B=-B,N=_[I],T=-T),m.yN.y)continue;if(m.y===D.y){if(m.x===D.x)return!0}else{const F=T*(m.x-D.x)-B*(m.y-D.y);if(F===0)return!0;if(F<0)continue;w=!w}}else{if(m.y!==D.y)continue;if(N.x<=m.x&&m.x<=D.x||D.x<=m.x&&m.x<=N.x)return!0}}return w}const r=Vs.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const u=[];if(s.length===1)return a=s[0],l=new Fl,l.curves=a.curves,u.push(l),u;let d=!r(s[0].getPoints());d=e?!d:d;const h=[],p=[];let g=[],v=0,S;p[v]=void 0,g[v]=[];for(let m=0,_=s.length;m<_;m++)a=s[m],S=a.getPoints(),o=r(S),o=e?!o:o,o?(!d&&p[v]&&v++,p[v]={s:new Fl,p:S},p[v].s.curves=a.curves,d&&v++,g[v]=[]):g[v].push({h:a,p:S[0]});if(!p[0])return t(s);if(p.length>1){let m=!1,_=0;for(let A=0,w=p.length;A0&&m===!1&&(g=h)}let x;for(let m=0,_=p.length;m<_;m++){l=p[m].s,u.push(l),x=g[m];for(let A=0,w=x.length;At=>(i,r)=>{i[n]===void 0&&(i[n]=new G(e)),i[n].setComponent(t,r)},UW=(n,e)=>t=>(i,r)=>{i[n]===void 0&&(i[n]=new cr(e));const s=i[n];s[t]=r},LL=n=>(e,t)=>{e[n]===void 0&&(e[n]=new ke(t)),e[n].set(t)},aM=BL("scale",1),lM=BL("position",0),uM=UW("rotation",0),DL={x:lM(0),y:lM(1),z:lM(2),scale:(n,e)=>{n.scale===void 0&&(n.scale=new G(1)),n.scale.set(e,e,e)},scaleX:aM(0),scaleY:aM(1),scaleZ:aM(2),rotateX:uM("x"),rotateY:uM("y"),rotateZ:uM("z"),color:LL("color"),specular:LL("specular")};function OW(n,e,t){e in DL?DL[e](n,t[e]):(e==="opacity"&&!n.transparent&&(n.transparent=!0),n[e]=t[e])}const cM=(n,e)=>t=>i=>{const r=i[n];return r?r[t]:e},fM=cM("position",0),jv=cM("scale",1),dM=cM("rotation",0),FL={x:fM("x"),y:fM("y"),z:fM("z"),scale:jv("x"),scaleX:jv("x"),scaleY:jv("y"),scaleZ:jv("z"),rotateX:dM("x"),rotateY:dM("y"),rotateZ:dM("z")};function kW(n){if(n!==void 0)return n instanceof ke?n.getStyle():n}function zW(n,e){return e in FL?FL[e](n):kW(n[e])||0}const HW=["x","y","z"],NL={"position-x":"x","position-y":"y","position-z":"z","rotation-x":"rotateX","rotation-y":"rotateY","rotation-z":"rotateZ","scale-x":"scaleX","scale-y":"scaleY","scale-z":"scaleZ"},UL=(n,e)=>{const t={};let i;for(i in n){const r=n[i];if(Tn(r)||Tn(e[i])){const s=NL[i]||i;t[s]=r}else if(Array.isArray(r))for(let s=0;s({});class VW extends FR{constructor(){super(...arguments),this.type="three",this.measureInstanceViewportBox=On}readValueFromInstance(e,t){return zW(e,t)}getBaseTargetFromProps(){}sortInstanceNodePosition(e,t){return e.id-t.id}removeValueFromRenderState(){}scrapeMotionValuesFromProps(e,t){return UL(e,t)}build(e,t){for(const i in t)e[i]=t[i]}renderInstance(e,t){for(const i in t)OW(e,i,t)}}const WW=(n,e)=>new VW(e,{}),XW=sA({scrapeMotionValuesFromProps:UL,createRenderState:GW}),jW=Object.assign({},$T);function OL(n){return xR({Component:n,preloadedFeatures:jW,useRender:hH,useVisualState:XW,createVisualElement:WW})}const hM=new Map,kL=new Proxy(OL,{get:(n,e)=>(!hM.has(e)&&hM.set(e,OL(e)),hM.get(e))});var zL={exports:{}},Kl={};/** * @license React * react-reconciler-constants.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */Kl.ConcurrentRoot=1,Kl.ContinuousEventPriority=4,Kl.DefaultEventPriority=16,Kl.DiscreteEventPriority=1,Kl.IdleEventPriority=536870912,Kl.LegacyRoot=0,zL.exports=Kl;var Oc=zL.exports;function JW(n){let e;const t=new Set,i=(u,d)=>{const h=typeof u=="function"?u(e):u;if(h!==e){const p=e;e=d?h:Object.assign({},e,h),t.forEach(g=>g(e,p))}},r=()=>e,s=(u,d=r,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function g(){const v=d(e);if(!h(p,v)){const S=p;u(p=v,S)}}return t.add(g),()=>t.delete(g)},l={setState:i,getState:r,subscribe:(u,d,h)=>d||h?s(u,d,h):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(i,r,l),l}const HL=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?pe.useEffect:pe.useLayoutEffect;function KW(n){const e=typeof n=="function"?JW(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=pe.useReducer(x=>x+1,0),o=e.getState(),a=pe.useRef(o),l=pe.useRef(i),u=pe.useRef(r),d=pe.useRef(!1),h=pe.useRef();h.current===void 0&&(h.current=i(o));let p,g=!1;(a.current!==o||l.current!==i||u.current!==r||d.current)&&(p=i(o),g=!r(h.current,p)),HL(()=>{g&&(h.current=p),a.current=o,l.current=i,u.current=r,d.current=!1});const v=pe.useRef(o);HL(()=>{const x=()=>{try{const _=e.getState(),A=l.current(_);u.current(h.current,A)||(a.current=_,h.current=A,s())}catch(_){d.current=!0,s()}},m=e.subscribe(x);return e.getState()!==v.current&&x(),m},[]);const S=g?p:h.current;return pe.useDebugValue(S),S};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}const YW=n=>typeof n=="object"&&typeof n.then=="function",Yl=[];function GL(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=Yl.indexOf(r);s!==-1&&Yl.splice(s,1)},promise:(YW(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(Yl.push(r),!t)throw r.promise}const QW=(n,e,t)=>VL(n,e,!1,t),qW=(n,e,t)=>void VL(n,e,!0,t),ZW=n=>{if(n===void 0||n.length===0)Yl.splice(0,Yl.length);else{const e=Yl.find(t=>GL(n,t.keys,t.equal));e&&e.remove()}};var WL={exports:{}},XL={exports:{}},jL={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(n){function e(z,te){var ie=z.length;z.push(te);e:for(;0>>1,Ce=z[fe];if(0>>1;fer(Me,ie))Ier(Be,Me)?(z[fe]=Be,z[Ie]=ie,fe=Ie):(z[fe]=Me,z[re]=ie,fe=re);else if(Ier(Be,ie))z[fe]=Be,z[Ie]=ie,fe=Ie;else break e}}return te}function r(z,te){var ie=z.sortIndex-te.sortIndex;return ie!==0?ie:z.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,h=null,p=3,g=!1,v=!1,S=!1,x=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(z){for(var te=t(u);te!==null;){if(te.callback===null)i(u);else if(te.startTime<=z)i(u),te.sortIndex=te.expirationTime,e(l,te);else break;te=t(u)}}function w(z){if(S=!1,A(z),!v)if(t(l)!==null)v=!0,K(I);else{var te=t(u);te!==null&&ge(w,te.startTime-z)}}function I(z,te){v=!1,S&&(S=!1,m(N),N=-1),g=!0;var ie=p;try{for(A(te),h=t(l);h!==null&&(!(h.expirationTime>te)||z&&!F());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,p=h.priorityLevel;var Ce=fe(h.expirationTime<=te);te=n.unstable_now(),typeof Ce=="function"?h.callback=Ce:h===t(l)&&i(l),A(te)}else i(l);h=t(l)}if(h!==null)var ot=!0;else{var re=t(u);re!==null&&ge(w,re.startTime-te),ot=!1}return ot}finally{h=null,p=ie,g=!1}}var P=!1,D=null,N=-1,B=5,T=-1;function F(){return!(n.unstable_now()-Tz||125fe?(z.sortIndex=ie,e(u,z),t(l)===null&&z===t(u)&&(S?(m(N),N=-1):S=!0,ge(w,ie-fe))):(z.sortIndex=Ce,e(l,z),v||g||(v=!0,K(I))),z},n.unstable_shouldYield=F,n.unstable_wrapCallback=function(z){var te=p;return function(){var ie=p;p=te;try{return z.apply(this,arguments)}finally{p=ie}}}})(jL),XL.exports=jL;var pM=XL.exports;/** * @license React * react-reconciler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $W=function(e){var t={},i=pe,r=pM,s=Object.assign;function o(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,y=1;yQ||E[V]!==R[Q]){var he=` `+E[V].replace(" at new "," at ");return c.displayName&&he.includes("")&&(he=he.replace("",c.displayName)),he}while(1<=V&&0<=Q);break}}}finally{yt=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?ht(c):""}var Yt=Object.prototype.hasOwnProperty,ln=[],en=-1;function xn(c){return{current:c}}function st(c){0>en||(c.current=ln[en],ln[en]=null,en--)}function Ue(c,f){en++,ln[en]=c.current,c.current=f}var fn={},At=xn(fn),un=xn(!1),Ui=fn;function Fn(c,f){var y=c.type.contextTypes;if(!y)return fn;var M=c.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===f)return M.__reactInternalMemoizedMaskedChildContext;var E={},R;for(R in y)E[R]=f[R];return M&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=E),E}function Yn(c){return c=c.childContextTypes,c!=null}function hn(){st(un),st(At)}function dr(c,f,y){if(At.current!==fn)throw Error(o(168));Ue(At,f),Ue(un,y)}function Xs(c,f,y){var M=c.stateNode;if(f=f.childContextTypes,typeof M.getChildContext!="function")return y;M=M.getChildContext();for(var E in M)if(!(E in f))throw Error(o(108,N(c)||"Unknown",E));return s({},y,M)}function ci(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||fn,Ui=At.current,Ue(At,c),Ue(un,un.current),!0}function Ia(c,f,y){var M=c.stateNode;if(!M)throw Error(o(169));y?(c=Xs(c,f,Ui),M.__reactInternalMemoizedMergedChildContext=c,st(un),st(At),Ue(At,c)):st(un),Ue(un,y)}var qi=Math.clz32?Math.clz32:UM,Yc=Math.log,NM=Math.LN2;function UM(c){return c>>>=0,c===0?32:31-(Yc(c)/NM|0)|0}var Qc=64,Ba=4194304;function Bo(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function qc(c,f){var y=c.pendingLanes;if(y===0)return 0;var M=0,E=c.suspendedLanes,R=c.pingedLanes,V=y&268435455;if(V!==0){var Q=V&~E;Q!==0?M=Bo(Q):(R&=V,R!==0&&(M=Bo(R)))}else V=y&~E,V!==0?M=Bo(V):R!==0&&(M=Bo(R));if(M===0)return 0;if(f!==0&&f!==M&&!(f&E)&&(E=M&-M,R=f&-f,E>=R||E===16&&(R&4194240)!==0))return f;if(M&4&&(M|=y&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=M;0y;y++)f.push(c);return f}function $l(c,f,y){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-qi(f),c[f]=y}function kM(c,f){var y=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var M=c.eventTimes;for(c=c.expirationTimes;0>=V,E-=V,bs=1<<32-qi(f)+E|y<nn?(mi=Bt,Bt=null):mi=Bt.sibling;var rn=xt(se,Bt,ce[nn],Ye);if(rn===null){Bt===null&&(Bt=mi);break}c&&Bt&&rn.alternate===null&&f(se,Bt),ee=R(rn,ee,nn),Ot===null?lt=rn:Ot.sibling=rn,Ot=rn,Bt=mi}if(nn===ce.length)return y(se,Bt),_n&&Do(se,nn),lt;if(Bt===null){for(;nnnn?(mi=Bt,Bt=null):mi=Bt.sibling;var ja=xt(se,Bt,rn.value,Ye);if(ja===null){Bt===null&&(Bt=mi);break}c&&Bt&&ja.alternate===null&&f(se,Bt),ee=R(ja,ee,nn),Ot===null?lt=ja:Ot.sibling=ja,Ot=ja,Bt=mi}if(rn.done)return y(se,Bt),_n&&Do(se,nn),lt;if(Bt===null){for(;!rn.done;nn++,rn=ce.next())rn=It(se,rn.value,Ye),rn!==null&&(ee=R(rn,ee,nn),Ot===null?lt=rn:Ot.sibling=rn,Ot=rn);return _n&&Do(se,nn),lt}for(Bt=M(se,Bt);!rn.done;nn++,rn=ce.next())rn=pn(Bt,se,nn,rn.value,Ye),rn!==null&&(c&&rn.alternate!==null&&Bt.delete(rn.key===null?nn:rn.key),ee=R(rn,ee,nn),Ot===null?lt=rn:Ot.sibling=rn,Ot=rn);return c&&Bt.forEach(function(oj){return f(se,oj)}),_n&&Do(se,nn),lt}function ss(se,ee,ce,Ye){if(typeof ce=="object"&&ce!==null&&ce.type===d&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case l:e:{for(var lt=ce.key,Ot=ee;Ot!==null;){if(Ot.key===lt){if(lt=ce.type,lt===d){if(Ot.tag===7){y(se,Ot.sibling),ee=E(Ot,ce.props.children),ee.return=se,se=ee;break e}}else if(Ot.elementType===lt||typeof lt=="object"&<!==null&<.$$typeof===A&&b(lt)===Ot.type){y(se,Ot.sibling),ee=E(Ot,ce.props),ee.ref=nu(se,Ot,ce),ee.return=se,se=ee;break e}y(se,Ot);break}else f(se,Ot);Ot=Ot.sibling}ce.type===d?(ee=cu(ce.props.children,se.mode,Ye,ce.key),ee.return=se,se=ee):(Ye=W0(ce.type,ce.key,ce.props,null,se.mode,Ye),Ye.ref=nu(se,ee,ce),Ye.return=se,se=Ye)}return V(se);case u:e:{for(Ot=ce.key;ee!==null;){if(ee.key===Ot)if(ee.tag===4&&ee.stateNode.containerInfo===ce.containerInfo&&ee.stateNode.implementation===ce.implementation){y(se,ee.sibling),ee=E(ee,ce.children||[]),ee.return=se,se=ee;break e}else{y(se,ee);break}else f(se,ee);ee=ee.sibling}ee=C1(ce,se.mode,Ye),ee.return=se,se=ee}return V(se);case A:return Ot=ce._init,ss(se,ee,Ot(ce._payload),Ye)}if($(ce))return ct(se,ee,ce,Ye);if(P(ce))return zi(se,ee,ce,Ye);af(se,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,ee!==null&&ee.tag===6?(y(se,ee.sibling),ee=E(ee,ce),ee.return=se,se=ee):(y(se,ee),ee=E1(ce,se.mode,Ye),ee.return=se,se=ee),V(se)):y(se,ee)}return ss}var L=C(!0),k=C(!1),j={},ue=xn(j),de=xn(j),Fe=xn(j);function Je(c){if(c===j)throw Error(o(174));return c}function gt(c,f){Ue(Fe,f),Ue(de,c),Ue(ue,j),c=ge(f),st(ue),Ue(ue,c)}function pt(){st(ue),st(de),st(Fe)}function Nn(c){var f=Je(Fe.current),y=Je(ue.current);f=z(y,c.type,f),y!==f&&(Ue(de,c),Ue(ue,f))}function Vn(c){de.current===c&&(st(ue),st(de))}var qt=xn(0);function Ps(c){for(var f=c;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||Zl(y)||ba(y)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Ge=[];function at(){for(var c=0;cy?y:4,c(!0);var M=zt.transition;zt.transition={};try{c(!1),f()}finally{Qt=y,zt.transition=M}}function j2(){return Qs().memoizedState}function LX(c,f,y){var M=Va(c);y={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null},J2(c)?K2(f,y):(Y2(c,f,y),y=tr(),c=is(c,M,y),c!==null&&Q2(c,f,M))}function DX(c,f,y){var M=Va(c),E={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null};if(J2(c))K2(f,E);else{Y2(c,f,E);var R=c.alternate;if(c.lanes===0&&(R===null||R.lanes===0)&&(R=f.lastRenderedReducer,R!==null))try{var V=f.lastRenderedState,Q=R(V,y);if(E.hasEagerState=!0,E.eagerState=Q,es(Q,V))return}catch(he){}finally{}y=tr(),c=is(c,M,y),c!==null&&Q2(c,f,M)}}function J2(c){var f=c.alternate;return c===Ht||f!==null&&f===Ht}function K2(c,f){iu=za=!0;var y=c.pending;y===null?f.next=f:(f.next=y.next,y.next=f),c.pending=f}function Y2(c,f,y){ti!==null&&c.mode&1&&!(Gt&2)?(c=f.interleaved,c===null?(y.next=y,ts===null?ts=[f]:ts.push(f)):(y.next=c.next,c.next=y),f.interleaved=y):(c=f.pending,c===null?y.next=y:(y.next=c.next,c.next=y),f.pending=y)}function Q2(c,f,y){if(y&4194240){var M=f.lanes;M&=c.pendingLanes,y|=M,f.lanes=y,Eh(c,y)}}var A0={readContext:pr,useCallback:Oi,useContext:Oi,useEffect:Oi,useImperativeHandle:Oi,useInsertionEffect:Oi,useLayoutEffect:Oi,useMemo:Oi,useReducer:Oi,useRef:Oi,useState:Oi,useDebugValue:Oi,useDeferredValue:Oi,useTransition:Oi,useMutableSource:Oi,useSyncExternalStore:Oi,useId:Oi,unstable_isNewReconciler:!1},FX={readContext:pr,useCallback:function(c,f){return Fo().memoizedState=[c,f===void 0?null:f],c},useContext:pr,useEffect:qM,useImperativeHandle:function(c,f,y){return y=y!=null?y.concat([c]):null,x0(4194308,4,G2.bind(null,f,c),y)},useLayoutEffect:function(c,f){return x0(4194308,4,c,f)},useInsertionEffect:function(c,f){return x0(4,2,c,f)},useMemo:function(c,f){var y=Fo();return f=f===void 0?null:f,c=c(),y.memoizedState=[c,f],c},useReducer:function(c,f,y){var M=Fo();return f=y!==void 0?y(f):f,M.memoizedState=M.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},M.queue=c,c=c.dispatch=LX.bind(null,Ht,c),[M.memoizedState,c]},useRef:function(c){var f=Fo();return c={current:c},f.memoizedState=c},useState:QM,useDebugValue:ZM,useDeferredValue:function(c){var f=QM(c),y=f[0],M=f[1];return qM(function(){var E=zt.transition;zt.transition={};try{M(c)}finally{zt.transition=E}},[c]),y},useTransition:function(){var c=QM(!1),f=c[0];return c=BX.bind(null,c[1]),Fo().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,y){var M=Ht,E=Fo();if(_n){if(y===void 0)throw Error(o(407));y=y()}else{if(y=f(),ti===null)throw Error(o(349));dn&30||F2(M,f,y)}E.memoizedState=y;var R={value:y,getSnapshot:f};return E.queue=R,qM(U2.bind(null,M,R,c),[c]),M.flags|=2048,Gh(9,N2.bind(null,M,R,y,f),void 0,null),y},useId:function(){var c=Fo(),f=ti.identifierPrefix;if(_n){var y=Rs,M=bs;y=(M&~(1<<32-qi(M)-1)).toString(32)+y,f=":"+f+"R"+y,y=Hh++,0v1&&(f.flags|=128,M=!0,jh(E,!1),f.lanes=4194304)}else{if(!M)if(c=Ps(R),c!==null){if(f.flags|=128,M=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),jh(E,!0),E.tail===null&&E.tailMode==="hidden"&&!R.alternate&&!_n)return ki(f),null}else 2*Qn()-E.renderingStartTime>v1&&y!==1073741824&&(f.flags|=128,M=!0,jh(E,!1),f.lanes=4194304);E.isBackwards?(R.sibling=f.child,f.child=R):(c=E.last,c!==null?c.sibling=R:f.child=R,E.last=R)}return E.tail!==null?(f=E.tail,E.rendering=f,E.tail=f.sibling,E.renderingStartTime=Qn(),f.sibling=null,c=qt.current,Ue(qt,M?c&1|2:c&1),f):(ki(f),null);case 22:case 23:return S1(),M=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==M&&(f.flags|=8192),M&&f.mode&1?Or&1073741824&&(ki(f),Mt&&f.subtreeFlags&6&&(f.flags|=8192)):ki(f),null;case 24:return null;case 25:return null}throw Error(o(156,f.tag))}var zX=a.ReactCurrentOwner,Ur=!1;function er(c,f,y,M){f.child=c===null?k(f,null,y,M):L(f,c.child,y,M)}function rD(c,f,y,M,E){y=y.render;var R=f.ref;return Fa(f,E),M=KM(c,f,y,M,R,E),y=YM(),c!==null&&!Ur?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~E,No(c,f,E)):(_n&&y&&Fh(f),f.flags|=1,er(c,f,M,E),f.child)}function sD(c,f,y,M,E){if(c===null){var R=y.type;return typeof R=="function"&&!w1(R)&&R.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(f.tag=15,f.type=R,oD(c,f,R,M,E)):(c=W0(y.type,null,M,f,f.mode,E),c.ref=f.ref,c.return=f,f.child=c)}if(R=c.child,!(c.lanes&E)){var V=R.memoizedProps;if(y=y.compare,y=y!==null?y:ef,y(V,M)&&c.ref===f.ref)return No(c,f,E)}return f.flags|=1,c=Xa(R,M),c.ref=f.ref,c.return=f,f.child=c}function oD(c,f,y,M,E){if(c!==null&&ef(c.memoizedProps,M)&&c.ref===f.ref)if(Ur=!1,(c.lanes&E)!==0)c.flags&131072&&(Ur=!0);else return f.lanes=c.lanes,No(c,f,E);return t1(c,f,y,M,E)}function aD(c,f,y){var M=f.pendingProps,E=M.children,R=c!==null?c.memoizedState:null;if(M.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null},Ue(lf,Or),Or|=y;else if(y&1073741824)f.memoizedState={baseLanes:0,cachePool:null},M=R!==null?R.baseLanes:y,Ue(lf,Or),Or|=M;else return c=R!==null?R.baseLanes|y:y,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null},f.updateQueue=null,Ue(lf,Or),Or|=c,null;else R!==null?(M=R.baseLanes|y,f.memoizedState=null):M=y,Ue(lf,Or),Or|=M;return er(c,f,E,y),f.child}function lD(c,f){var y=f.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(f.flags|=512,f.flags|=2097152)}function t1(c,f,y,M,E){var R=Yn(y)?Ui:At.current;return R=Fn(f,R),Fa(f,E),y=KM(c,f,y,M,R,E),M=YM(),c!==null&&!Ur?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~E,No(c,f,E)):(_n&&M&&Fh(f),f.flags|=1,er(c,f,y,E),f.child)}function uD(c,f,y,M,E){if(Yn(y)){var R=!0;ci(f)}else R=!1;if(Fa(f,E),f.stateNode===null)c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),d0(f,y,M),Dh(f,y,M,E),M=!0;else if(c===null){var V=f.stateNode,Q=f.memoizedProps;V.props=Q;var he=V.context,Ne=y.contextType;typeof Ne=="object"&&Ne!==null?Ne=pr(Ne):(Ne=Yn(y)?Ui:At.current,Ne=Fn(f,Ne));var it=y.getDerivedStateFromProps,It=typeof it=="function"||typeof V.getSnapshotBeforeUpdate=="function";It||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==M||he!==Ne)&&h0(f,V,M,Ne),Js=!1;var xt=f.memoizedState;V.state=xt,rf(f,M,V,E),he=f.memoizedState,Q!==M||xt!==he||un.current||Js?(typeof it=="function"&&(sf(f,y,it,M),he=f.memoizedState),(Q=Js||f0(f,y,Q,M,xt,he,Ne))?(It||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(f.flags|=4194308)):(typeof V.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=M,f.memoizedState=he),V.props=M,V.state=he,V.context=Ne,M=Q):(typeof V.componentDidMount=="function"&&(f.flags|=4194308),M=!1)}else{V=f.stateNode,a0(c,f),Q=f.memoizedProps,Ne=f.type===f.elementType?Q:Nr(f.type,Q),V.props=Ne,It=f.pendingProps,xt=V.context,he=y.contextType,typeof he=="object"&&he!==null?he=pr(he):(he=Yn(y)?Ui:At.current,he=Fn(f,he));var pn=y.getDerivedStateFromProps;(it=typeof pn=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==It||xt!==he)&&h0(f,V,M,he),Js=!1,xt=f.memoizedState,V.state=xt,rf(f,M,V,E);var ct=f.memoizedState;Q!==It||xt!==ct||un.current||Js?(typeof pn=="function"&&(sf(f,y,pn,M),ct=f.memoizedState),(Ne=Js||f0(f,y,Ne,M,xt,ct,he)||!1)?(it||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(M,ct,he),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(M,ct,he)),typeof V.componentDidUpdate=="function"&&(f.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof V.componentDidUpdate!="function"||Q===c.memoizedProps&&xt===c.memoizedState||(f.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===c.memoizedProps&&xt===c.memoizedState||(f.flags|=1024),f.memoizedProps=M,f.memoizedState=ct),V.props=M,V.state=ct,V.context=he,M=Ne):(typeof V.componentDidUpdate!="function"||Q===c.memoizedProps&&xt===c.memoizedState||(f.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===c.memoizedProps&&xt===c.memoizedState||(f.flags|=1024),M=!1)}return n1(c,f,y,M,R,E)}function n1(c,f,y,M,E,R){lD(c,f);var V=(f.flags&128)!==0;if(!M&&!V)return E&&Ia(f,y,!1),No(c,f,R);M=f.stateNode,zX.current=f;var Q=V&&typeof y.getDerivedStateFromError!="function"?null:M.render();return f.flags|=1,c!==null&&V?(f.child=L(f,c.child,null,R),f.child=L(f,null,Q,R)):er(c,f,Q,R),f.memoizedState=M.state,E&&Ia(f,y,!0),f.child}function cD(c){var f=c.stateNode;f.pendingContext?dr(c,f.pendingContext,f.pendingContext!==f.context):f.context&&dr(c,f.context,!1),gt(c,f.containerInfo)}function fD(c,f,y,M,E){return ka(),zh(E),f.flags|=256,er(c,f,y,M),f.child}var w0={dehydrated:null,treeContext:null,retryLane:0};function E0(c){return{baseLanes:c,cachePool:null}}function dD(c,f,y){var M=f.pendingProps,E=qt.current,R=!1,V=(f.flags&128)!==0,Q;if((Q=V)||(Q=c!==null&&c.memoizedState===null?!1:(E&2)!==0),Q?(R=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(E|=1),Ue(qt,E&1),c===null)return Oh(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?ba(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(E=M.children,c=M.fallback,R?(M=f.mode,R=f.child,E={mode:"hidden",children:E},!(M&1)&&R!==null?(R.childLanes=0,R.pendingProps=E):R=X0(E,M,0,null),c=cu(c,M,y,null),R.return=f,c.return=f,R.sibling=c,f.child=R,f.child.memoizedState=E0(y),f.memoizedState=w0,c):i1(f,E));if(E=c.memoizedState,E!==null){if(Q=E.dehydrated,Q!==null){if(V)return f.flags&256?(f.flags&=-257,C0(c,f,y,Error(o(422)))):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(R=M.fallback,E=f.mode,M=X0({mode:"visible",children:M.children},E,0,null),R=cu(R,E,y,null),R.flags|=2,M.return=f,R.return=f,M.sibling=R,f.child=M,f.mode&1&&L(f,c.child,null,y),f.child.memoizedState=E0(y),f.memoizedState=w0,R);if(!(f.mode&1))f=C0(c,f,y,null);else if(ba(Q))f=C0(c,f,y,Error(o(419)));else if(M=(y&c.childLanes)!==0,Ur||M){if(M=ti,M!==null){switch(y&-y){case 4:R=2;break;case 16:R=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:R=32;break;case 536870912:R=268435456;break;default:R=0}M=R&(M.suspendedLanes|y)?0:R,M!==0&&M!==E.retryLane&&(E.retryLane=M,is(c,M,-1))}M1(),f=C0(c,f,y,Error(o(421)))}else Zl(Q)?(f.flags|=128,f.child=c.child,f=$X.bind(null,c),Ra(Q,f),f=null):(y=E.treeContext,Te&&($i=Jc(Q),Zi=f,_n=!0,Si=null,tu=!1,y!==null&&(mr[gr++]=bs,mr[gr++]=Rs,mr[gr++]=Lo,bs=y.id,Rs=y.overflow,Lo=f)),f=i1(f,f.pendingProps.children),f.flags|=4096);return f}return R?(M=pD(c,f,M.children,M.fallback,y),R=f.child,E=c.child.memoizedState,R.memoizedState=E===null?E0(y):{baseLanes:E.baseLanes|y,cachePool:null},R.childLanes=c.childLanes&~y,f.memoizedState=w0,M):(y=hD(c,f,M.children,y),f.memoizedState=null,y)}return R?(M=pD(c,f,M.children,M.fallback,y),R=f.child,E=c.child.memoizedState,R.memoizedState=E===null?E0(y):{baseLanes:E.baseLanes|y,cachePool:null},R.childLanes=c.childLanes&~y,f.memoizedState=w0,M):(y=hD(c,f,M.children,y),f.memoizedState=null,y)}function i1(c,f){return f=X0({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function hD(c,f,y,M){var E=c.child;return c=E.sibling,y=Xa(E,{mode:"visible",children:y}),!(f.mode&1)&&(y.lanes=M),y.return=f,y.sibling=null,c!==null&&(M=f.deletions,M===null?(f.deletions=[c],f.flags|=16):M.push(c)),f.child=y}function pD(c,f,y,M,E){var R=f.mode;c=c.child;var V=c.sibling,Q={mode:"hidden",children:y};return!(R&1)&&f.child!==c?(y=f.child,y.childLanes=0,y.pendingProps=Q,f.deletions=null):(y=Xa(c,Q),y.subtreeFlags=c.subtreeFlags&14680064),V!==null?M=Xa(V,M):(M=cu(M,R,E,null),M.flags|=2),M.return=f,y.return=f,y.sibling=M,f.child=y,M}function C0(c,f,y,M){return M!==null&&zh(M),L(f,c.child,null,y),c=i1(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function mD(c,f,y){c.lanes|=f;var M=c.alternate;M!==null&&(M.lanes|=f),Bh(c.return,f,y)}function r1(c,f,y,M,E){var R=c.memoizedState;R===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:M,tail:y,tailMode:E}:(R.isBackwards=f,R.rendering=null,R.renderingStartTime=0,R.last=M,R.tail=y,R.tailMode=E)}function gD(c,f,y){var M=f.pendingProps,E=M.revealOrder,R=M.tail;if(er(c,f,M.children,y),M=qt.current,M&2)M=M&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&mD(c,y,f);else if(c.tag===19)mD(c,y,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}M&=1}if(Ue(qt,M),!(f.mode&1))f.memoizedState=null;else switch(E){case"forwards":for(y=f.child,E=null;y!==null;)c=y.alternate,c!==null&&Ps(c)===null&&(E=y),y=y.sibling;y=E,y===null?(E=f.child,f.child=null):(E=y.sibling,y.sibling=null),r1(f,!1,E,y,R);break;case"backwards":for(y=null,E=f.child,f.child=null;E!==null;){if(c=E.alternate,c!==null&&Ps(c)===null){f.child=E;break}c=E.sibling,E.sibling=y,y=E,E=c}r1(f,!0,y,null,R);break;case"together":r1(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function No(c,f,y){if(c!==null&&(f.dependencies=c.dependencies),uf|=f.lanes,!(y&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(o(153));if(f.child!==null){for(c=f.child,y=Xa(c,c.pendingProps),f.child=y,y.return=f;c.sibling!==null;)c=c.sibling,y=y.sibling=Xa(c,c.pendingProps),y.return=f;y.sibling=null}return f.child}function HX(c,f,y){switch(f.tag){case 3:cD(f),ka();break;case 5:Nn(f);break;case 1:Yn(f.type)&&ci(f);break;case 4:gt(f,f.stateNode.containerInfo);break;case 10:o0(f,f.type._context,f.memoizedProps.value);break;case 13:var M=f.memoizedState;if(M!==null)return M.dehydrated!==null?(Ue(qt,qt.current&1),f.flags|=128,null):y&f.child.childLanes?dD(c,f,y):(Ue(qt,qt.current&1),c=No(c,f,y),c!==null?c.sibling:null);Ue(qt,qt.current&1);break;case 19:if(M=(y&f.childLanes)!==0,c.flags&128){if(M)return gD(c,f,y);f.flags|=128}var E=f.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Ue(qt,qt.current),M)break;return null;case 22:case 23:return f.lanes=0,aD(c,f,y)}return No(c,f,y)}function GX(c,f){switch(Nh(f),f.tag){case 1:return Yn(f.type)&&hn(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return pt(),st(un),st(At),at(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return Vn(f),null;case 13:if(st(qt),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(o(340));ka()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return st(qt),null;case 4:return pt(),null;case 10:return Ih(f.type._context),null;case 22:case 23:return S1(),null;case 24:return null;default:return null}}var T0=!1,su=!1,VX=typeof WeakSet=="function"?WeakSet:Set,je=null;function b0(c,f){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(M){xr(c,f,M)}else y.current=null}function s1(c,f,y){try{y()}catch(M){xr(c,f,M)}}var vD=!1;function WX(c,f){for(te(c.containerInfo),je=f;je!==null;)if(c=je,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,je=f;else for(;je!==null;){c=je;try{var y=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var M=y.memoizedProps,E=y.memoizedState,R=c.stateNode,V=R.getSnapshotBeforeUpdate(c.elementType===c.type?M:Nr(c.type,M),E);R.__reactInternalSnapshotBeforeUpdate=V}break;case 3:Mt&&Oe(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Q){xr(c,c.return,Q)}if(f=c.sibling,f!==null){f.return=c.return,je=f;break}je=c.return}return y=vD,vD=!1,y}function ou(c,f,y){var M=f.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var E=M=M.next;do{if((E.tag&c)===c){var R=E.destroy;E.destroy=void 0,R!==void 0&&s1(f,y,R)}E=E.next}while(E!==M)}}function Jh(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&c)===c){var M=y.create;y.destroy=M()}y=y.next}while(y!==f)}}function o1(c){var f=c.ref;if(f!==null){var y=c.stateNode;switch(c.tag){case 5:c=K(y);break;default:c=y}typeof f=="function"?f(c):f.current=c}}function yD(c,f,y){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount($c,f)}catch(V){}switch(f.tag){case 0:case 11:case 14:case 15:if(c=f.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var M=c=c.next;do{var E=M,R=E.destroy;E=E.tag,R!==void 0&&(E&2||E&4)&&s1(f,y,R),M=M.next}while(M!==c)}break;case 1:if(b0(f,y),c=f.stateNode,typeof c.componentWillUnmount=="function")try{c.props=f.memoizedProps,c.state=f.memoizedState,c.componentWillUnmount()}catch(V){xr(f,y,V)}break;case 5:b0(f,y);break;case 4:Mt?wD(c,f,y):H&&H&&(f=f.stateNode.containerInfo,y=Vt(f),Jt(f,y))}}function xD(c,f,y){for(var M=f;;)if(yD(c,M,y),M.child===null||Mt&&M.tag===4){if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function _D(c){var f=c.alternate;f!==null&&(c.alternate=null,_D(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&dt(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function AD(c){return c.tag===5||c.tag===3||c.tag===4}function SD(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||AD(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function MD(c){if(Mt){e:{for(var f=c.return;f!==null;){if(AD(f))break e;f=f.return}throw Error(o(160))}var y=f;switch(y.tag){case 5:f=y.stateNode,y.flags&32&&(sn(f),y.flags&=-33),y=SD(c),l1(c,y,f);break;case 3:case 4:f=y.stateNode.containerInfo,y=SD(c),a1(c,y,f);break;default:throw Error(o(161))}}}function a1(c,f,y){var M=c.tag;if(M===5||M===6)c=c.stateNode,f?et(y,c,f):Rt(y,c);else if(M!==4&&(c=c.child,c!==null))for(a1(c,f,y),c=c.sibling;c!==null;)a1(c,f,y),c=c.sibling}function l1(c,f,y){var M=c.tag;if(M===5||M===6)c=c.stateNode,f?Et(y,c,f):Qe(y,c);else if(M!==4&&(c=c.child,c!==null))for(l1(c,f,y),c=c.sibling;c!==null;)l1(c,f,y),c=c.sibling}function wD(c,f,y){for(var M=f,E=!1,R,V;;){if(!E){E=M.return;e:for(;;){if(E===null)throw Error(o(160));switch(R=E.stateNode,E.tag){case 5:V=!1;break e;case 3:R=R.containerInfo,V=!0;break e;case 4:R=R.containerInfo,V=!0;break e}E=E.return}E=!0}if(M.tag===5||M.tag===6)xD(c,M,y),V?Ft(R,M.stateNode):Tt(R,M.stateNode);else if(M.tag===18)V?ne(R,M.stateNode):le(R,M.stateNode);else if(M.tag===4){if(M.child!==null){R=M.stateNode.containerInfo,V=!0,M.child.return=M,M=M.child;continue}}else if(yD(c,M,y),M.child!==null){M.child.return=M,M=M.child;continue}if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return,M.tag===4&&(E=!1)}M.sibling.return=M.return,M=M.sibling}}function u1(c,f){if(Mt){switch(f.tag){case 0:case 11:case 14:case 15:ou(3,f,f.return),Jh(3,f),ou(5,f,f.return);return;case 1:return;case 5:var y=f.stateNode;if(y!=null){var M=f.memoizedProps;c=c!==null?c.memoizedProps:M;var E=f.type,R=f.updateQueue;f.updateQueue=null,R!==null&&kt(y,R,E,c,M,f)}return;case 6:if(f.stateNode===null)throw Error(o(162));y=f.memoizedProps,Pe(f.stateNode,c!==null?c.memoizedProps:y,y);return;case 3:Te&&c!==null&&c.memoizedState.isDehydrated&&Z(f.stateNode.containerInfo);return;case 12:return;case 13:R0(f);return;case 19:R0(f);return;case 17:return}throw Error(o(163))}switch(f.tag){case 0:case 11:case 14:case 15:ou(3,f,f.return),Jh(3,f),ou(5,f,f.return);return;case 12:return;case 13:R0(f);return;case 19:R0(f);return;case 3:Te&&c!==null&&c.memoizedState.isDehydrated&&Z(f.stateNode.containerInfo);break;case 22:case 23:return}e:if(H){switch(f.tag){case 1:case 5:case 6:break e;case 3:case 4:f=f.stateNode,Jt(f.containerInfo,f.pendingChildren);break e}throw Error(o(163))}}function R0(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new VX),f.forEach(function(M){var E=ej.bind(null,c,M);y.has(M)||(y.add(M),M.then(E,E))})}}function XX(c,f){for(je=f;je!==null;){f=je;var y=f.deletions;if(y!==null)for(var M=0;M";case I0:return":has("+(d1(c)||"")+")";case B0:return'[role="'+c.value+'"]';case D0:return'"'+c.value+'"';case L0:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function RD(c,f){var y=[];c=[c,0];for(var M=0;ME&&(E=V),M&=~R}if(M=E,M=Qn()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*JX(M/1960))-M,10c?16:c,Ga===null)var M=!1;else{if(c=Ga,Ga=null,k0=0,Gt&6)throw Error(o(331));var E=Gt;for(Gt|=4,je=c.current;je!==null;){var R=je,V=R.child;if(je.flags&16){var Q=R.deletions;if(Q!==null){for(var he=0;heQn()-g1?au(c,0):m1|=y),yr(c,f)}function OD(c,f){f===0&&(c.mode&1?(f=Ba,Ba<<=1,!(Ba&130023424)&&(Ba=4194304)):f=1);var y=tr();c=G0(c,f),c!==null&&($l(c,f,y),yr(c,y))}function $X(c){var f=c.memoizedState,y=0;f!==null&&(y=f.retryLane),OD(c,y)}function ej(c,f){var y=0;switch(c.tag){case 13:var M=c.stateNode,E=c.memoizedState;E!==null&&(y=E.retryLane);break;case 19:M=c.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(f),OD(c,y)}var kD;kD=function(c,f,y){if(c!==null)if(c.memoizedProps!==f.pendingProps||un.current)Ur=!0;else{if(!(c.lanes&y)&&!(f.flags&128))return Ur=!1,HX(c,f,y);Ur=!!(c.flags&131072)}else Ur=!1,_n&&f.flags&1048576&&p0(f,Ts,f.index);switch(f.lanes=0,f.tag){case 2:var M=f.type;c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps;var E=Fn(f,At.current);Fa(f,y),E=KM(null,f,M,c,E,y);var R=YM();return f.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Yn(M)?(R=!0,ci(f)):R=!1,f.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Lh(f),E.updater=of,f.stateNode=E,E._reactInternals=f,Dh(f,M,c,y),f=n1(null,f,M,!0,R,y)):(f.tag=0,_n&&R&&Fh(f),er(null,f,E,y),f=f.child),f;case 16:M=f.elementType;e:{switch(c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps,E=M._init,M=E(M._payload),f.type=M,E=f.tag=nj(M),c=Nr(M,c),E){case 0:f=t1(null,f,M,c,y);break e;case 1:f=uD(null,f,M,c,y);break e;case 11:f=rD(null,f,M,c,y);break e;case 14:f=sD(null,f,M,Nr(M.type,c),y);break e}throw Error(o(306,M,""))}return f;case 0:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Nr(M,E),t1(c,f,M,E,y);case 1:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Nr(M,E),uD(c,f,M,E,y);case 3:e:{if(cD(f),c===null)throw Error(o(387));M=f.pendingProps,R=f.memoizedState,E=R.element,a0(c,f),rf(f,M,null,y);var V=f.memoizedState;if(M=V.element,Te&&R.isDehydrated)if(R={element:M,isDehydrated:!1,cache:V.cache,transitions:V.transitions},f.updateQueue.baseState=R,f.memoizedState=R,f.flags&256){E=Error(o(423)),f=fD(c,f,M,y,E);break e}else if(M!==E){E=Error(o(424)),f=fD(c,f,M,y,E);break e}else for(Te&&($i=jc(f.stateNode.containerInfo),Zi=f,_n=!0,Si=null,tu=!1),y=k(f,null,M,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ka(),M===E){f=No(c,f,y);break e}er(c,f,M,y)}f=f.child}return f;case 5:return Nn(f),c===null&&Oh(f),M=f.type,E=f.pendingProps,R=c!==null?c.memoizedProps:null,V=E.children,Me(M,E)?V=null:R!==null&&Me(M,R)&&(f.flags|=32),lD(c,f),er(c,f,V,y),f.child;case 6:return c===null&&Oh(f),null;case 13:return dD(c,f,y);case 4:return gt(f,f.stateNode.containerInfo),M=f.pendingProps,c===null?f.child=L(f,null,M,y):er(c,f,M,y),f.child;case 11:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Nr(M,E),rD(c,f,M,E,y);case 7:return er(c,f,f.pendingProps,y),f.child;case 8:return er(c,f,f.pendingProps.children,y),f.child;case 12:return er(c,f,f.pendingProps.children,y),f.child;case 10:e:{if(M=f.type._context,E=f.pendingProps,R=f.memoizedProps,V=E.value,o0(f,M,V),R!==null)if(es(R.value,V)){if(R.children===E.children&&!un.current){f=No(c,f,y);break e}}else for(R=f.child,R!==null&&(R.return=f);R!==null;){var Q=R.dependencies;if(Q!==null){V=R.child;for(var he=Q.firstContext;he!==null;){if(he.context===M){if(R.tag===1){he=ns(-1,y&-y),he.tag=2;var Ne=R.updateQueue;if(Ne!==null){Ne=Ne.shared;var it=Ne.pending;it===null?he.next=he:(he.next=it.next,it.next=he),Ne.pending=he}}R.lanes|=y,he=R.alternate,he!==null&&(he.lanes|=y),Bh(R.return,y,f),Q.lanes|=y;break}he=he.next}}else if(R.tag===10)V=R.type===f.type?null:R.child;else if(R.tag===18){if(V=R.return,V===null)throw Error(o(341));V.lanes|=y,Q=V.alternate,Q!==null&&(Q.lanes|=y),Bh(V,y,f),V=R.sibling}else V=R.child;if(V!==null)V.return=R;else for(V=R;V!==null;){if(V===f){V=null;break}if(R=V.sibling,R!==null){R.return=V.return,V=R;break}V=V.return}R=V}er(c,f,E.children,y),f=f.child}return f;case 9:return E=f.type,M=f.pendingProps.children,Fa(f,y),E=pr(E),M=M(E),f.flags|=1,er(c,f,M,y),f.child;case 14:return M=f.type,E=Nr(M,f.pendingProps),E=Nr(M.type,E),sD(c,f,M,E,y);case 15:return oD(c,f,f.type,f.pendingProps,y);case 17:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Nr(M,E),c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,Yn(M)?(c=!0,ci(f)):c=!1,Fa(f,y),d0(f,M,E),Dh(f,M,E,y),n1(null,f,M,!0,c,y);case 19:return gD(c,f,y);case 22:return aD(c,f,y)}throw Error(o(156,f.tag))};function zD(c,f){return La(c,f)}function tj(c,f,y,M){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,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 rs(c,f,y,M){return new tj(c,f,y,M)}function w1(c){return c=c.prototype,!(!c||!c.isReactComponent)}function nj(c){if(typeof c=="function")return w1(c)?1:0;if(c!=null){if(c=c.$$typeof,c===S)return 11;if(c===_)return 14}return 2}function Xa(c,f){var y=c.alternate;return y===null?(y=rs(c.tag,f,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=f,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,f=c.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function W0(c,f,y,M,E,R){var V=2;if(M=c,typeof c=="function")w1(c)&&(V=1);else if(typeof c=="string")V=5;else e:switch(c){case d:return cu(y.children,E,R,f);case h:V=8,E|=8;break;case p:return c=rs(12,y,f,E|2),c.elementType=p,c.lanes=R,c;case x:return c=rs(13,y,f,E),c.elementType=x,c.lanes=R,c;case m:return c=rs(19,y,f,E),c.elementType=m,c.lanes=R,c;case w:return X0(y,E,R,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case g:V=10;break e;case v:V=9;break e;case S:V=11;break e;case _:V=14;break e;case A:V=16,M=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return f=rs(V,y,f,E),f.elementType=c,f.type=M,f.lanes=R,f}function cu(c,f,y,M){return c=rs(7,c,M,f),c.lanes=y,c}function X0(c,f,y,M){return c=rs(22,c,M,f),c.elementType=w,c.lanes=y,c.stateNode={},c}function E1(c,f,y){return c=rs(6,c,null,f),c.lanes=y,c}function C1(c,f,y){return f=rs(4,c.children!==null?c.children:[],c.key,f),f.lanes=y,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function ij(c,f,y,M,E){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=wt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wh(0),this.expirationTimes=wh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wh(0),this.identifierPrefix=M,this.onRecoverableError=E,Te&&(this.mutableSourceEagerHydrationData=null)}function HD(c,f,y,M,E,R,V,Q,he){return c=new ij(c,f,y,Q,he),f===1?(f=1,R===!0&&(f|=8)):f=0,R=rs(3,null,null,f),c.current=R,R.stateNode=c,R.memoizedState={element:M,isDehydrated:y,cache:null,transitions:null},Lh(R),c}function GD(c){if(!c)return fn;c=c._reactInternals;e:{if(B(c)!==c||c.tag!==1)throw Error(o(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Yn(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(o(171))}if(c.tag===1){var y=c.type;if(Yn(y))return Xs(c,y,f)}return f}function VD(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=X(f),c===null?null:c.stateNode}function WD(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y=Ne&&R>=It&&E<=it&&V<=xt){c.splice(f,1);break}else if(M!==Ne||y.width!==he.width||xtV){if(!(R!==It||y.height!==he.height||itE)){Ne>M&&(he.width+=Ne-M,he.x=M),itR&&(he.height+=It-R,he.y=R),xty&&(y=V)),V ")+` No matching component was found for: `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return K(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:rj,findFiberByHostInstance:c.findFiberByHostInstance||sj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{$c=f.inject(c),$r=f}catch(y){}c=!!f.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,f,y,M){if(!W)throw Error(o(363));c=h1(c,f);var E=ze(c,y,M).disconnect;return{disconnect:function(){E()}}},t.registerMutableSourceForHydration=function(c,f){var y=f._getVersion;y=y(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,y]:c.mutableSourceEagerHydrationData.push(f,y)},t.runWithPriority=function(c,f){var y=Qt;try{return Qt=c,f()}finally{Qt=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,f,y,M){var E=f.current,R=tr(),V=Va(E);return y=GD(y),f.context===null?f.context=y:f.pendingContext=y,f=ns(R,V),f.payload={element:c},M=M===void 0?null:M,M!==null&&(f.callback=M),Ks(E,f),c=is(E,V,R),c!==null&&nf(c,E,V),V},t};WL.exports=$W;var e6=WL.exports;const t6=cn(e6),mM={},n6=n=>void Object.assign(mM,n);function i6(n,e){function t(d,S,v){var x=S,{args:h=[],attach:p}=x,g=Wn(x,["args","attach"]);let m=`${d[0].toUpperCase()}${d.slice(1)}`,_;if(d==="primitive"){if(g.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const A=g.object;_=kc(A,{type:d,root:v,attach:p,primitive:!0})}else{const A=mM[m];if(!A)throw new Error(`R3F: ${m} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");_=kc(new A(...h),{type:d,root:v,attach:p,memoizedProps:{args:h}})}return _.__r3f.attach===void 0&&(_ instanceof Pt?_.__r3f.attach="geometry":_ instanceof $n&&(_.__r3f.attach="material")),m!=="inject"&&xM(_,g),_}function i(d,h){let p=!1;if(h){var g,v;(g=h.__r3f)!=null&&g.attach?yM(d,h,h.__r3f.attach):h.isObject3D&&d.isObject3D&&(d.add(h),p=!0),p||(v=d.__r3f)==null||v.objects.push(h),h.__r3f||kc(h,{}),h.__r3f.parent=d,_M(h),zc(h)}}function r(d,h,p){let g=!1;if(h){var v,S;if((v=h.__r3f)!=null&&v.attach)yM(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){h.parent=d,h.dispatchEvent({type:"added"}),d.dispatchEvent({type:"childadded",child:h});const x=d.children.filter(_=>_!==h),m=x.indexOf(p);d.children=[...x.slice(0,m),h,...x.slice(m)],g=!0}g||(S=d.__r3f)==null||S.objects.push(h),h.__r3f||kc(h,{}),h.__r3f.parent=d,_M(h),zc(h)}}function s(d,h,p=!1){d&&[...d].forEach(g=>o(h,g,p))}function o(d,h,p){if(h){var g,v,S;if(h.__r3f&&(h.__r3f.parent=null),(g=d.__r3f)!=null&&g.objects&&(d.__r3f.objects=d.__r3f.objects.filter(w=>w!==h)),(v=h.__r3f)!=null&&v.attach)n2(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){var x;d.remove(h),(x=h.__r3f)!=null&&x.root&&h6(Kv(h),h)}const _=(S=h.__r3f)==null?void 0:S.primitive,A=!_&&(p===void 0?h.dispose!==null:p);if(!_){var m;s((m=h.__r3f)==null?void 0:m.objects,h,A),s(h.children,h,A)}if(delete h.__r3f,A&&h.dispose&&h.type!=="Scene"){const w=()=>{try{h.dispose()}catch(I){}};typeof IS_REACT_ACT_ENVIRONMENT=="undefined"?pM.unstable_scheduleCallback(pM.unstable_IdlePriority,w):w()}zc(d)}}function a(d,h,p,g){var v;const S=(v=d.__r3f)==null?void 0:v.parent;if(!S)return;const x=t(h,p,d.__r3f.root);if(d.children){for(const m of d.children)m.__r3f&&i(x,m);d.children=d.children.filter(m=>!m.__r3f)}d.__r3f.objects.forEach(m=>i(x,m)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(S,d),x.parent&&(x.__r3f.autoRemovedBeforeAppend=!0),i(S,x),x.raycast&&x.__r3f.eventCount&&Kv(x).getState().internal.interaction.push(x),[g,g.alternate].forEach(m=>{m!==null&&(m.stateNode=x,m.ref&&(typeof m.ref=="function"?m.ref(x):m.ref.current=x))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:t6({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,h)=>{if(!h)return;const p=d.getState().scene;p.__r3f&&(p.__r3f.root=d,i(p,h))},removeChildFromContainer:(d,h)=>{h&&o(d.getState().scene,h)},insertInContainerBefore:(d,h,p)=>{if(!h||!p)return;const g=d.getState().scene;g.__r3f&&r(g,h,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var h;return!!((h=d==null?void 0:d.__r3f)!=null?h:{}).handlers},prepareUpdate(d,h,p,g){var v;if(((v=d==null?void 0:d.__r3f)!=null?v:{}).primitive&&g.object&&g.object!==d)return[!0];{const x=g,{args:_=[],children:A}=x,w=Wn(x,["args","children"]),m=p,{args:I=[],children:P}=m,D=Wn(m,["args","children"]);if(!Array.isArray(_))throw new Error("R3F: the args prop must be an array!");if(_.some((B,T)=>B!==I[T]))return[!0];const N=i2(d,w,D,!0);return N.changes.length?[!1,N]:null}},commitUpdate(d,[h,p],g,v,S,x){h?a(d,g,S,x):xM(d,p)},commitMount(d,h,p,g){var v;const S=(v=d.__r3f)!=null?v:{};d.raycast&&S.handlers&&S.eventCount&&Kv(d).getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>kc(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var h;const{attach:p,parent:g}=(h=d.__r3f)!=null?h:{};p&&g&&n2(g,d,p),d.isObject3D&&(d.visible=!1),zc(d)},unhideInstance(d,h){var p;const{attach:g,parent:v}=(p=d.__r3f)!=null?p:{};g&&v&&yM(v,d,g),(d.isObject3D&&h.visible==null||h.visible)&&(d.visible=!0),zc(d)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Oc.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance!="undefined"&&yn.fun(performance.now)?performance.now:yn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:yn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:yn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:xM}}var JL,KL;const gM=n=>"colorSpace"in n||"outputColorSpace"in n,YL=()=>{var n;return(n=mM.ColorManagement)!=null?n:null},QL=n=>n&&n.isOrthographicCamera,r6=n=>n&&n.hasOwnProperty("current"),Jv=typeof window!="undefined"&&((JL=window.document)!=null&&JL.createElement||((KL=window.navigator)==null?void 0:KL.product)==="ReactNative")?pe.useLayoutEffect:pe.useEffect;function s6(n){const e=pe.useRef(n);return Jv(()=>void(e.current=n),[n]),e}function o6({set:n}){return Jv(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class qL extends pe.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}qL.getDerivedStateFromError=()=>({error:!0});const ZL="__default",$L=new Map,a6=n=>n&&!!n.memoized&&!!n.changes;function e2(n){var e;const t=typeof window!="undefined"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const vh=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Kv(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const yn={obj:n=>n===Object(n)&&!yn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(yn.str(n)||yn.num(n)||yn.boo(n))return n===e;const s=yn.obj(n);if(s&&i==="reference")return n===e;const o=yn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!yn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(yn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function l6(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function u6(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function kc(n,e){const t=n;return t.__r3f=_e({type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null},e),n}function vM(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const t2=/-\d+$/;function yM(n,e,t){if(yn.str(t)){if(t2.test(t)){const s=t.replace(t2,""),{target:o,key:a}=vM(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=vM(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function n2(n,e,t){var i,r;if(yn.str(t)){const{target:s,key:o}=vM(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function i2(n,d,p={},u=!1){var h=d,{children:e,key:t,ref:i}=h,r=Wn(h,["children","key","ref"]);var g=p,{children:s,key:o,ref:a}=g,l=Wn(g,["children","key","ref"]);const v=n.__r3f,S=Object.entries(r),x=[];if(u){const _=Object.keys(l);for(let A=0;A<_.length;A++)r.hasOwnProperty(_[A])||S.unshift([_[A],ZL+"remove"])}S.forEach(([_,A])=>{var w;if((w=n.__r3f)!=null&&w.primitive&&_==="object"||yn.equ(A,l[_]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(_))return x.push([_,A,!0,[]]);let I=[];_.includes("-")&&(I=_.split("-")),x.push([_,A,!1,I]);for(const P in r){const D=r[P];P.startsWith(`${_}-`)&&x.push([P,D,!1,P.split("-")])}});const m=_e({},r);return v!=null&&v.memoizedProps&&v!=null&&v.memoizedProps.args&&(m.args=v.memoizedProps.args),v!=null&&v.memoizedProps&&v!=null&&v.memoizedProps.attach&&(m.attach=v.memoizedProps.attach),{memoized:m,changes:x}}const c6=typeof process!="undefined"&&!1;function xM(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=a6(e)?e:i2(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let d=0;dm[_],n),!(x&&x.set))){const[m,..._]=v.reverse();S=_.reverse().reduce((A,w)=>A[w],n),h=m}if(p===ZL+"remove")if(S.constructor){let m=$L.get(S.constructor);m||(m=new S.constructor,$L.set(S.constructor,m)),p=m[h]}else p=0;if(g&&i)p?i.handlers[h]=p:delete i.handlers[h],i.eventCount=Object.keys(i.handlers).length;else if(x&&x.set&&(x.copy||x instanceof El)){if(Array.isArray(p))x.fromArray?x.fromArray(p):x.set(...p);else if(x.copy&&p&&p.constructor&&(c6?x.constructor.name===p.constructor.name:x.constructor===p.constructor))x.copy(p);else if(p!==void 0){const m=x instanceof ke;!m&&x.setScalar?x.setScalar(p):x instanceof El&&p instanceof El?x.mask=p.mask:x.set(p),!YL()&&s&&!s.linear&&m&&x.convertSRGBToLinear()}}else if(S[h]=p,S[h]instanceof Mn&&S[h].format===Ri&&S[h].type===vs&&s){const m=S[h];gM(m)&&gM(s.gl)?m.colorSpace=s.gl.outputColorSpace:m.encoding=s.gl.outputEncoding}zc(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const d=Kv(n).getState().internal,h=d.interaction.indexOf(n);h>-1&&d.interaction.splice(h,1),i.eventCount&&d.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&_M(n),n}function zc(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function _M(n){n.onUpdate==null||n.onUpdate(n)}function f6(n,e){n.manual||(QL(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Yv(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function d6(){var n;const e=typeof self!="undefined"&&self||typeof window!="undefined"&&window;if(!e)return Oc.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Oc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Oc.ContinuousEventPriority;default:return Oc.DefaultEventPriority}}function r2(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function h6(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{r2(t.capturedMap,e,i,r)})}function p6(n){function e(l){const{internal:u}=n.getState(),d=l.offsetX-u.initialClick[0],h=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(d*d+h*h))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(d=>{var h;return(h=u.__r3f)==null?void 0:h.handlers["onPointer"+d]}))}function i(l,u){const d=n.getState(),h=new Set,p=[],g=u?u(d.internal.interaction):d.internal.interaction;for(let m=0;m{const A=vh(m.object),w=vh(_.object);return!A||!w?m.distance-_.distance:w.events.priority-A.events.priority||m.distance-_.distance}).filter(m=>{const _=Yv(m);return h.has(_)?!1:(h.add(_),!0)});d.events.filter&&(S=d.events.filter(S,d));for(const m of S){let _=m.object;for(;_;){var x;(x=_.__r3f)!=null&&x.eventCount&&p.push(Ct(_e({},m),{eventObject:_})),_=_.parent}}if("pointerId"in l&&d.internal.capturedMap.has(l.pointerId))for(let m of d.internal.capturedMap.get(l.pointerId).values())h.has(Yv(m.intersection))||p.push(m.intersection);return p}function r(l,u,d,h){const p=n.getState();if(l.length){const g={stopped:!1};for(const v of l){const S=vh(v.object)||p,{raycaster:x,pointer:m,camera:_,internal:A}=S,w=new G(m.x,m.y,0).unproject(_),I=T=>{var F,X;return(F=(X=A.capturedMap.get(T))==null?void 0:X.has(v.eventObject))!=null?F:!1},P=T=>{const F={intersection:v,target:u.target};A.capturedMap.has(T)?A.capturedMap.get(T).set(v.eventObject,F):A.capturedMap.set(T,new Map([[v.eventObject,F]])),u.target.setPointerCapture(T)},D=T=>{const F=A.capturedMap.get(T);F&&r2(A.capturedMap,v.eventObject,F,T)};let N={};for(let T in u){let F=u[T];typeof F!="function"&&(N[T]=F)}let B=Ct(_e(_e({},v),N),{pointer:m,intersections:l,stopped:g.stopped,delta:d,unprojectedPoint:w,ray:x.ray,camera:_,stopPropagation(){const T="pointerId"in u&&A.capturedMap.get(u.pointerId);if((!T||T.has(v.eventObject))&&(B.stopped=g.stopped=!0,A.hovered.size&&Array.from(A.hovered.values()).find(F=>F.eventObject===v.eventObject))){const F=l.slice(0,l.indexOf(v));s([...F,v])}},target:{hasPointerCapture:I,setPointerCapture:P,releasePointerCapture:D},currentTarget:{hasPointerCapture:I,setPointerCapture:P,releasePointerCapture:D},nativeEvent:u});if(h(B),g.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const d of u.hovered.values())if(!l.length||!l.find(h=>h.object===d.object&&h.index===d.index&&h.instanceId===d.instanceId)){const p=d.eventObject.__r3f,g=p==null?void 0:p.handlers;if(u.hovered.delete(Yv(d)),p!=null&&p.eventCount){const v=Ct(_e({},d),{intersections:l});g.onPointerOut==null||g.onPointerOut(v),g.onPointerLeave==null||g.onPointerLeave(v)}}}function o(l,u){for(let d=0;ds([]);case"onLostPointerCapture":return u=>{const{internal:d}=n.getState();"pointerId"in u&&d.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(u.pointerId)&&(d.capturedMap.delete(u.pointerId),s([]))})}}return function(d){const{onPointerMissed:h,internal:p}=n.getState();p.lastEvent.current=d;const g=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",x=i(d,g?t:void 0),m=v?e(d):0;l==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=x.map(A=>A.eventObject)),v&&!x.length&&m<=2&&(o(d,p.interaction),h&&h(d)),g&&s(x);function _(A){const w=A.eventObject,I=w.__r3f,P=I==null?void 0:I.handlers;if(I!=null&&I.eventCount)if(g){if(P.onPointerOver||P.onPointerEnter||P.onPointerOut||P.onPointerLeave){const D=Yv(A),N=p.hovered.get(D);N?N.stopped&&A.stopPropagation():(p.hovered.set(D,A),P.onPointerOver==null||P.onPointerOver(A),P.onPointerEnter==null||P.onPointerEnter(A))}P.onPointerMove==null||P.onPointerMove(A)}else{const D=P[l];D?(!v||p.initialHits.includes(w))&&(o(d,p.interaction.filter(N=>!p.initialHits.includes(N))),D(A)):v&&p.initialHits.includes(w)&&o(d,p.interaction.filter(N=>!p.initialHits.includes(N)))}}r(x,d,m,_)}}return{handlePointer:a}}const s2=n=>!!(n!=null&&n.render),m6=pe.createContext(null),g6=(n,e)=>{const t=KW((a,l)=>{const u=new G,d=new G,h=new G;function p(m=l().camera,_=d,A=l().size){const{width:w,height:I,top:P,left:D}=A,N=w/I;_ instanceof G?h.copy(_):h.set(..._);const B=m.getWorldPosition(u).distanceTo(h);if(QL(m))return{width:w/m.zoom,height:I/m.zoom,top:P,left:D,factor:1,distance:B,aspect:N};{const T=m.fov*Math.PI/180,F=2*Math.tan(T/2)*B,X=F*(w/I);return{width:X,height:F,top:P,left:D,factor:w/X,distance:B,aspect:N}}}let g;const v=m=>a(_=>({performance:Ct(_e({},_.performance),{current:m})})),S=new Ae;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>n(l(),m),advance:(m,_)=>e(m,_,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new $S,pointer:S,mouse:S,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();g&&clearTimeout(g),m.performance.current!==m.performance.min&&v(m.performance.min),g=setTimeout(()=>v(l().performance.max),m.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:m=>a(_=>Ct(_e({},_),{events:_e(_e({},_.events),m)})),setSize:(m,_,A,w,I)=>{const P=l().camera,D={width:m,height:_,top:w||0,left:I||0,updateStyle:A};a(N=>({size:D,viewport:_e(_e({},N.viewport),p(P,d,D))}))},setDpr:m=>a(_=>{const A=e2(m);return{viewport:Ct(_e({},_.viewport),{dpr:A,initialDpr:_.viewport.initialDpr||A})}}),setFrameloop:(m="always")=>{const _=l().clock;_.stop(),_.elapsedTime=0,m!=="never"&&(_.start(),_.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:pe.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,_,A)=>{const w=l().internal;return w.priority=w.priority+(_>0?1:0),w.subscribers.push({ref:m,priority:_,store:A}),w.subscribers=w.subscribers.sort((I,P)=>I.priority-P.priority),()=>{const I=l().internal;I!=null&&I.subscribers&&(I.priority=I.priority-(_>0?1:0),I.subscribers=I.subscribers.filter(P=>P.ref!==m))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:d,set:h}=t.getState();if(l.width!==r.width||l.height!==r.height||u.dpr!==s){var p;r=l,s=u.dpr,f6(a,l),d.setPixelRatio(u.dpr);const g=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement!="undefined"&&d.domElement instanceof HTMLCanvasElement;d.setSize(l.width,l.height,g)}a!==o&&(o=a,h(g=>({viewport:_e(_e({},g.viewport),g.viewport.getCurrentViewport(a))})))}),t.subscribe(a=>n(a)),t};let Qv,v6=new Set,y6=new Set,x6=new Set;function AM(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function yh(n,e){switch(n){case"before":return AM(v6,e);case"after":return AM(y6,e);case"tail":return AM(x6,e)}}let SM,MM;function wM(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),SM=e.internal.subscribers,Qv=0;Qv0)&&!((d=s.gl.xr)!=null&&d.isPresenting)&&(i+=wM(u,s))}if(t=!1,yh("after",u),i===0)return yh("tail",u),e=!1,cancelAnimationFrame(r)}function a(u,d=1){var h;if(!u)return n.forEach(p=>a(p.store.getState(),d));(h=u.gl.xr)!=null&&h.isPresenting||!u.internal.active||u.frameloop==="never"||(d>1?u.internal.frames=Math.min(60,u.internal.frames+d):t?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(u,d=!0,h,p){if(d&&yh("before",u),h)wM(u,h,p);else for(const g of n.values())wM(u,g.store.getState());d&&yh("after",u)}return{loop:o,invalidate:a,advance:l}}const o2=new WeakMap;function a2(n,e){return function(t,...i){let r=o2.get(t);return r||(r=new t,o2.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,l6(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function xh(n,e,t,i){const r=Array.isArray(e)?e:[e],s=QW(a2(t,i),[n,...r],{equal:yn.equ});return Array.isArray(e)?s:s[0]}xh.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return qW(a2(t),[n,...i])},xh.clear=function(n,e){const t=Array.isArray(e)?e:[e];return ZW([n,...t])};const Hc=new Map,{invalidate:l2,advance:u2}=_6(Hc),{reconciler:qv,applyProps:Gc}=i6(Hc,d6),Vc={objects:"shallow",strict:!1},A6=(n,e)=>{const t=typeof n=="function"?n(e):n;return s2(t)?t:new ZI(_e({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0},n))};function S6(n,e){const t=typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas!="undefined"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function M6(n){const e=Hc.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||g6(l2,u2),o=t||qv.createContainer(s,Oc.ConcurrentRoot,null,!1,null,"",r,null);e||Hc.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(d={}){let{gl:h,size:p,scene:g,events:v,onCreated:S,shadows:x=!1,linear:m=!1,flat:_=!1,legacy:A=!1,orthographic:w=!1,frameloop:I="always",dpr:P=[1,2],performance:D,raycaster:N,camera:B,onPointerMissed:T}=d,F=s.getState(),X=F.gl;F.gl||F.set({gl:X=A6(h,n)});let J=F.raycaster;J||F.set({raycaster:J=new AL});const ie=N||{},{params:q}=ie,$=Wn(ie,["params"]);if(yn.equ($,J,Vc)||Gc(J,_e({},$)),yn.equ(q,J.params,Vc)||Gc(J,{params:_e(_e({},J.params),q)}),!F.camera||F.camera===u&&!yn.equ(u,B,Vc)){u=B;const fe=B instanceof jd,Ce=fe?B:w?new Ec(0,0,0,0,.1,1e3):new ai(75,0,.1,1e3);fe||(Ce.position.z=5,B&&(Gc(Ce,B),("aspect"in B||"left"in B||"right"in B||"bottom"in B||"top"in B)&&(Ce.manual=!0,Ce.updateProjectionMatrix())),!F.camera&&!(B!=null&&B.rotation)&&Ce.lookAt(0,0,0)),F.set({camera:Ce}),J.camera=Ce}if(!F.scene){let fe;g instanceof $g?fe=g:(fe=new $g,g&&Gc(fe,g)),F.set({scene:kc(fe)})}if(!F.xr){var K;const fe=(re,Me)=>{const Ie=s.getState();Ie.frameloop!=="never"&&u2(re,!0,Ie,Me)},Ce=()=>{const re=s.getState();re.gl.xr.enabled=re.gl.xr.isPresenting,re.gl.xr.setAnimationLoop(re.gl.xr.isPresenting?fe:null),re.gl.xr.isPresenting||l2(re)},ot={connect(){const re=s.getState().gl;re.xr.addEventListener("sessionstart",Ce),re.xr.addEventListener("sessionend",Ce)},disconnect(){const re=s.getState().gl;re.xr.removeEventListener("sessionstart",Ce),re.xr.removeEventListener("sessionend",Ce)}};typeof((K=X.xr)==null?void 0:K.addEventListener)=="function"&&ot.connect(),F.set({xr:ot})}if(X.shadowMap){const fe=X.shadowMap.enabled,Ce=X.shadowMap.type;if(X.shadowMap.enabled=!!x,yn.boo(x))X.shadowMap.type=_d;else if(yn.str(x)){var ge;const ot={basic:ZR,percentage:zm,soft:_d,variance:ms};X.shadowMap.type=(ge=ot[x])!=null?ge:_d}else yn.obj(x)&&Object.assign(X.shadowMap,x);(fe!==X.shadowMap.enabled||Ce!==X.shadowMap.type)&&(X.shadowMap.needsUpdate=!0)}const z=YL();z&&("enabled"in z?z.enabled=!A:"legacyMode"in z&&(z.legacyMode=A)),l||Gc(X,{outputEncoding:m?3e3:3001,toneMapping:_?zs:yA}),F.legacy!==A&&F.set(()=>({legacy:A})),F.linear!==m&&F.set(()=>({linear:m})),F.flat!==_&&F.set(()=>({flat:_})),h&&!yn.fun(h)&&!s2(h)&&!yn.equ(h,X,Vc)&&Gc(X,h),v&&!F.events.handlers&&F.set({events:v(s)});const te=S6(n,p);return yn.equ(te,F.size,Vc)||F.setSize(te.width,te.height,te.updateStyle,te.top,te.left),P&&F.viewport.dpr!==e2(P)&&F.setDpr(P),F.frameloop!==I&&F.setFrameloop(I),F.onPointerMissed||F.set({onPointerMissed:T}),D&&!yn.equ(D,F.performance,Vc)&&F.set(fe=>({performance:_e(_e({},fe.performance),D)})),a=S,l=!0,this},render(d){return l||this.configure(),qv.updateContainer(me.jsx(w6,{store:s,children:d,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){c2(n)}}}function w6({store:n,children:e,onCreated:t,rootElement:i}){return Jv(()=>{const r=n.getState();r.set(s=>({internal:Ct(_e({},s.internal),{active:!0})})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),me.jsx(m6.Provider,{value:n,children:e})}function c2(n,e){const t=Hc.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),qv.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),u6(r),Hc.delete(n)}catch(u){}},500)})}}qv.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:pe.version});const EM={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function E6(n){const{handlePointer:e}=p6(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(EM).reduce((t,i)=>Ct(_e({},t),{[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:Ct(_e({},o.events),{connected:t})})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,u]=EM[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=EM[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:Ct(_e({},s.events),{connected:void 0})}))}}}}function CM(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var d=Date.now()-o;d=0?i=setTimeout(l,e-d):(i=null,t||(a=n.apply(s,r),s=r=null))}var u=function(){s=this,r=arguments,o=Date.now();var d=t&&!i;return i||(i=setTimeout(l,e)),d&&(a=n.apply(s,r),s=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},u}CM.debounce=CM;var C6=CM;const f2=cn(C6);var T6=Object.defineProperty,b6=Object.defineProperties,R6=Object.getOwnPropertyDescriptors,d2=Object.getOwnPropertySymbols,P6=Object.prototype.hasOwnProperty,I6=Object.prototype.propertyIsEnumerable,h2=(n,e,t)=>e in n?T6(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,p2=(n,e)=>{for(var t in e||(e={}))P6.call(e,t)&&h2(n,t,e[t]);if(d2)for(var t of d2(e))I6.call(e,t)&&h2(n,t,e[t]);return n},B6=(n,e)=>b6(n,R6(e)),m2,g2;typeof window!="undefined"&&((m2=window.document)!=null&&m2.createElement||((g2=window.navigator)==null?void 0:g2.product)==="ReactNative")?pe.useLayoutEffect:pe.useEffect;function v2(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=v2(i,e,t);if(r)return r;i=i.sibling}}function y2(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(e){return n}}const x2=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=x2;return}return x2.apply(this,arguments)};const TM=y2(pe.createContext(null));class _2 extends pe.Component{render(){return pe.createElement(TM.Provider,{value:this._reactInternals},this.props.children)}}function L6(){const n=pe.useContext(TM);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=pe.useId();return pe.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=v2(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function D6(){const n=L6(),[e]=pe.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==TM&&!e.has(r)&&e.set(r,pe.useContext(y2(r)))}t=t.return}return e}function F6(){const n=D6();return pe.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>pe.createElement(e,null,pe.createElement(t.Provider,B6(p2({},i),{value:n.get(t)}))),e=>pe.createElement(_2,p2({},e))),[n])}function N6({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||typeof window!="undefined"&&window.ResizeObserver,[s,o]=pe.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const a=pe.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),l=n?typeof n=="number"?n:n.scroll:null,u=n?typeof n=="number"?n:n.resize:null,d=pe.useRef(!1);pe.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[h,p,g]=pe.useMemo(()=>{const m=()=>{if(!a.current.element)return;const{left:_,top:A,width:w,height:I,bottom:P,right:D,x:N,y:B}=a.current.element.getBoundingClientRect(),T={left:_,top:A,width:w,height:I,bottom:P,right:D,x:N,y:B};a.current.element instanceof HTMLElement&&i&&(T.height=a.current.element.offsetHeight,T.width=a.current.element.offsetWidth),Object.freeze(T),d.current&&!z6(a.current.lastBounds,T)&&o(a.current.lastBounds=T)};return[m,u?f2(m,u):m,l?f2(m,l):m]},[o,i,l,u]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(m=>m.removeEventListener("scroll",g,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null)}function S(){a.current.element&&(a.current.resizeObserver=new r(g),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(m=>m.addEventListener("scroll",g,{capture:!0,passive:!0})))}const x=m=>{!m||m===a.current.element||(v(),a.current.element=m,a.current.scrollContainers=A2(m),S())};return O6(g,!!e),U6(p),pe.useEffect(()=>{v(),S()},[e,g,p]),pe.useEffect(()=>v,[]),[x,s,h]}function U6(n){pe.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function O6(n,e){pe.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function A2(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...A2(n.parentElement)]}const k6=["x","y","top","bottom","left","right","width","height"],z6=(n,e)=>k6.every(t=>n[t]===e[t]),H6=pe.forwardRef(function(N,D){var B=N,{children:e,fallback:t,resize:i,style:r,gl:s,events:o=E6,eventSource:a,eventPrefix:l,shadows:u,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:S,performance:x,raycaster:m,camera:_,scene:A,onPointerMissed:w,onCreated:I}=B,P=Wn(B,["children","fallback","resize","style","gl","events","eventSource","eventPrefix","shadows","linear","flat","legacy","orthographic","frameloop","dpr","performance","raycaster","camera","scene","onPointerMissed","onCreated"]);pe.useMemo(()=>n6(NW),[]);const T=F6(),[F,X]=N6(_e({scroll:!0,debounce:{scroll:50,resize:0}},i)),J=pe.useRef(null),q=pe.useRef(null);pe.useImperativeHandle(D,()=>J.current);const $=s6(w),[K,ge]=pe.useState(!1),[z,te]=pe.useState(!1);if(K)throw K;if(z)throw z;const ie=pe.useRef(null);Jv(()=>{const Ce=J.current;X.width>0&&X.height>0&&Ce&&(ie.current||(ie.current=M6(Ce)),ie.current.configure({gl:s,events:o,shadows:u,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:S,performance:x,raycaster:m,camera:_,scene:A,size:X,onPointerMissed:(...ot)=>$.current==null?void 0:$.current(...ot),onCreated:ot=>{ot.events.connect==null||ot.events.connect(a?r6(a)?a.current:a:q.current),l&&ot.setEvents({compute:(re,Me)=>{const Ie=re[l+"X"],Be=re[l+"Y"];Me.pointer.set(Ie/Me.size.width*2-1,-(Be/Me.size.height)*2+1),Me.raycaster.setFromCamera(Me.pointer,Me.camera)}}),I==null||I(ot)}}),ie.current.render(me.jsx(T,{children:me.jsx(qL,{set:te,children:me.jsx(pe.Suspense,{fallback:me.jsx(o6,{set:ge}),children:e})})})))}),pe.useEffect(()=>{const Ce=J.current;if(Ce)return()=>c2(Ce)},[]);const fe=a?"none":"auto";return me.jsx("div",Ct(_e({ref:q,style:_e({position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:fe},r)},P),{children:me.jsx("div",{ref:F,style:{width:"100%",height:"100%"},children:me.jsx("canvas",{ref:J,style:{display:"block"},children:t})})}))}),G6=pe.forwardRef(function(e,t){return me.jsx(_2,{children:me.jsx(H6,Ct(_e({},e),{ref:t}))})}),V6=parseInt(xd.replace(/\D+/g,""));function S2(n,e){if(e===NP)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Eg||e===PA){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l=2.0 are supported."));return}const l=new MX(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function X6(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const Wt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class j6{constructor(e){this.parser=e,this.name=Wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class oX{constructor(e){this.parser=e,this.name=Wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class aX{constructor(e){this.parser=e,this.name=Wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class lX{constructor(e){this.name=Wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,u=r.byteLength||0,d=r.count,h=r.byteStride,p=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,h,p,r.mode,r.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(d*h);return o.decodeGltfBuffer(new Uint8Array(g),d,h,p,r.mode,r.filter),g})})}else return null}}class uX{constructor(e){this.name=Wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const u of r.primitives)if(u.mode!==Zr.TRIANGLES&&u.mode!==Zr.TRIANGLE_STRIP&&u.mode!==Zr.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const u in o)a.push(this.parser.getDependency("accessor",o[u]).then(d=>(l[u]=d,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const d=u.pop(),h=d.isGroup?d.children:[d],p=u[0].count,g=[];for(const v of h){const S=new mt,x=new G,m=new Ii,_=new G(1,1,1),A=new AS(v.geometry,v.material,p);for(let w=0;w=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"}),{COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"}),Ca={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},gX={CUBICSPLINE:void 0,LINEAR:nc,STEP:tc},IM={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function vX(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new ph({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ks})),n.DefaultMaterial}function ql(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Io(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function yX(n,e,t){let i=!1,r=!1,s=!1;for(let u=0,d=e.length;u0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const SX=new mt;class MX{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new X6,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,s=-1;typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap=="undefined"||i||r&&s<98?this.textureLoader=new ZB(this.options.manager):this.textureLoader=new fL(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Lr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return ql(s,a,r),Io(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[u,d]of o.children.entries())s(d,a.children[u])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&x.setY(B,P[D*l+1]),l>=3&&x.setZ(B,P[D*l+2]),l>=4&&x.setW(B,P[D*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return x})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,i).then(function(d){d.flipY=!1,d.name=o.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const p=(s.samplers||{})[o.sampler]||{};return d.magFilter=T2[p.magFilter]||kn,d.minFilter=T2[p.minFilter]||Kr,d.wrapS=b2[p.wrapS]||fa,d.wrapT=b2[p.wrapT]||fa,r.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){u=!0;const p=new Blob([h],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(l).then(function(h){return new Promise(function(p,g){let v=p;t.isImageBitmapLoader===!0&&(v=function(S){const x=new Mn(S);x.needsUpdate=!0,p(x)}),t.load(wa.resolveURL(h,s.path),v,void 0,g)})}).then(function(h){return u===!0&&a.revokeObjectURL(l),Io(h,o),h.userData.mimeType=o.mimeType||AX(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=d,d}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[Wt.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Wt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[Wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&(typeof r=="number"&&(r=r===M2?Ql:Po),"colorSpace"in o?o.colorSpace=r:o.encoding=r===Ql?M2:W6),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new hv,$n.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new Fi,$n.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return ph}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},u=[];if(l[Wt.KHR_MATERIALS_UNLIT]){const h=r[Wt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),u.push(h.extendParams(a,s,t))}else{const h=s.pbrMetallicRoughness||{};if(a.color=new ke(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;a.color.setRGB(p[0],p[1],p[2],Po),a.opacity=p[3]}h.baseColorTexture!==void 0&&u.push(t.assignTexture(a,"map",h.baseColorTexture,Ql)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),u.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=gs);const d=s.alphaMode||IM.OPAQUE;if(d===IM.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===IM.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Ir&&(u.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new Ae(1,1),s.normalTexture.scale!==void 0)){const h=s.normalTexture.scale;a.normalScale.set(h,h)}if(s.occlusionTexture!==void 0&&o!==Ir&&(u.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Ir){const h=s.emissiveFactor;a.emissive=new ke().setRGB(h[0],h[1],h[2],Po)}return s.emissiveTexture!==void 0&&o!==Ir&&u.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,Ql)),Promise.all(u).then(function(){const h=new o(a);return s.name&&(h.name=s.name),Io(h,s),t.associations.set(h,{materials:e}),s.extensions&&ql(r,h,s),h})}createUniqueName(e){const t=Kt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[Wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return R2(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&xX(m,s),m.name=t.createUniqueName(s.name||"mesh_"+e),Io(m,s),x.extensions&&ql(r,m,x),t.assignFinalMaterial(m),h.push(m)}for(let g=0,v=h.length;g1?d=new Co:u.length===1?d=u[0]:d=new jt,d!==u[0])for(let h=0,p=u.length;h{const h=new Map;for(const[p,g]of r.associations)(p instanceof $n||p instanceof Mn)&&h.set(p,g);return d.traverse(p=>{const g=r.associations.get(p);g!=null&&h.set(p,g)}),h};return r.associations=u(s),s})}_createAnimationTracks(e,t,i,r,s){const o=[],a=e.name?e.name:e.uuid,l=[];Ca[s.path]===Ca.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(a);let u;switch(Ca[s.path]){case Ca.weights:u=kl;break;case Ca.rotation:u=zl;break;case Ca.position:case Ca.scale:u=Gl;break;default:switch(i.itemSize){case 1:u=kl;break;case 2:case 3:default:u=Gl;break}break}const d=r.interpolation!==void 0?gX[r.interpolation]:nc,h=this._getArrayFromAccessor(i);for(let p=0,g=l.length;p{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const u=t.attributeTypes[l];u.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=u.name)}const i=JSON.stringify(t);if(DM.has(e)){const l=DM.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((u,d)=>{r._callbacks[s]={resolve:u,reject:d},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),DM.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new Pt;e.index&&t.setIndex(new $t(e.index.array,1));for(let i=0;i{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=CX.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const h=d.draco,p=new h.Decoder,g=new h.DecoderBuffer;g.Init(new Int8Array(l),l.byteLength);try{const v=t(h,p,g,u),S=v.attributes.map(x=>x.array.buffer);v.index&&S.push(v.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:v},S)}catch(v){console.error(v),self.postMessage({type:"error",id:a.id,error:v.message})}finally{h.destroy(g),h.destroy(p)}});break}};function t(o,a,l,u){const d=u.attributeIDs,h=u.attributeTypes;let p,g;const v=a.GetEncodedGeometryType(l);if(v===o.TRIANGULAR_MESH)p=new o.Mesh,g=a.DecodeBufferToMesh(l,p);else if(v===o.POINT_CLOUD)p=new o.PointCloud,g=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!g.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+g.error_msg());const S={index:null,attributes:[]};for(const x in d){const m=self[h[x]];let _,A;if(u.useUniqueIDs)A=d[x],_=a.GetAttributeByUniqueId(p,A);else{if(A=a.GetAttributeId(p,o[d[x]]),A===-1)continue;_=a.GetAttribute(p,A)}S.attributes.push(r(o,a,p,x,m,_))}return v===o.TRIANGULAR_MESH&&(S.index=i(o,a,p)),o.destroy(p),S}function i(o,a,l){const d=l.num_faces()*3,h=d*4,p=o._malloc(h);a.GetTrianglesUInt32Array(l,h,p);const g=new Uint32Array(o.HEAPF32.buffer,p,d).slice();return o._free(p),{array:g,itemSize:1}}function r(o,a,l,u,d,h){const p=h.num_components(),v=l.num_points()*p,S=v*d.BYTES_PER_ELEMENT,x=s(o,d),m=o._malloc(S);a.GetAttributeDataArrayForAllPoints(l,h,x,S,m);const _=new d(o.HEAPF32.buffer,m,v).slice();return o._free(m),{name:u,array:_,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let $v;const FM=()=>{if($v)return $v;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(h=>{s=h.instance,s.exports.__wasm_call_ctors()});function a(h){const p=new Uint8Array(h.length);for(let v=0;v96?S-71:S>64?S-65:S>47?S+4:S>46?63:62}let g=0;for(let v=0;v{t&&t(i),n&&(e0||(e0=new EX),e0.setDecoderPath(typeof n=="string"?n:P2),i.setDRACOLoader(e0)),e&&i.setMeshoptDecoder(typeof FM=="function"?FM():FM)}}function t0(n,e=!0,t=!0,i){return xh(bM,n,I2(e,t,i))}t0.preload=(n,e=!0,t=!0,i)=>xh.preload(bM,n,I2(e,t,i)),t0.clear=n=>xh.clear(bM,n),t0.setDecoderPath=n=>{P2=n};const B2={name:"dc-overview-ws",private:!0,version:"0.1.7",type:"module",scripts:{dev:"vite",build:"vite build",lint:"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",preview:"vite preview",commit:"git-cz"},dependencies:{"@react-three/drei":"^9.111.1","@react-three/fiber":"^8.17.5","@vidyard/embed-code":"^4.3.15","framer-motion":"^11.3.19","framer-motion-3d":"^11.3.28",react:"^18.2.0","react-aria-components":"^1.2.1","react-dom":"^18.2.0",three:"^0.167.1"},devDependencies:{"@sfdc-www/chassis-core":"^1.70.0","@sfdc-www/chassis-core-types":"^1.30.0","@sfdc-www/www-schemas":"1.172.0","@types/react":"^18.2.66","@types/react-dom":"^18.2.22","@typescript-eslint/eslint-plugin":"^7.2.0","@typescript-eslint/parser":"^7.2.0","@vitejs/plugin-react":"^4.2.1",autoprefixer:"^10.4.19",eslint:"^8.57.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.6",postcss:"^8.4.38","postcss-prefix-selector":"^1.16.1",tailwindcss:"^3.4.3",typescript:"^5.2.2",vite:"^5.2.0"},config:{commitizen:{path:"./node_modules/cz-conventional-changelog"}}},TX=B2.version,bX=`https://a.sfdcstatic.com/digital/@sfdc-www/open-blade-libs/${B2.name}/v${TX}/data-dust.glb`,RX=Object.freeze(Object.defineProperty({__proto__:null,default:({progress:n,direction:e,size:t})=>{const{nodes:i}=t0(bX),r=lr(n,[0,1],[e==="left"?0:10,e==="left"?10:0]),s=[[2,2,5,.4],[8,0,4,.3]];return me.jsx(kL.div,{initial:{opacity:0},animate:{opacity:1},children:me.jsxs(G6,{resize:{offsetSize:!0},dpr:[1,2],camera:{position:[0,0,5.5],fov:t==="sm"?25:t==="md"?15:10},children:[me.jsx("ambientLight",{intensity:.3,color:"#63B1F8"}),s.map(([o,a,l,u],d)=>me.jsx("pointLight",{intensity:u,position:[o/8,a/8,l/8],color:"#63B1F8"},d)),me.jsx("group",{dispose:null,children:me.jsx(kL.mesh,{geometry:i.Star.geometry,rotation:[Math.PI/2,0,r],scale:8,animate:{rotateZ:0,transition:{rotateZ:{duration:15,ease:"linear",repeat:1/0}}},children:me.jsx("meshPhongMaterial",{color:"#63B1F8",emissive:"#416FB6",specular:"#89DCFA",shininess:30})})})]})})}},Symbol.toStringTag,{value:"Module"})),PX=Object.freeze(Object.defineProperty({__proto__:null,default:()=>me.jsx("div",{className:"flex justify-center items-center h-screen",children:me.jsxs("svg",{className:"animate-spin mt-20 h-20 w-20 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[me.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),me.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})},Symbol.toStringTag,{value:"Module"}))});